file_name
stringlengths
3
137
prefix
stringlengths
0
918k
suffix
stringlengths
0
962k
middle
stringlengths
0
812k
compact.rs
use crate::model::{InletId, OutletId}; use crate::{Model, TractResult}; use std::collections::HashMap; pub fn
(old: &Model) -> TractResult<Model> { let mut model = Model::default(); let mut map = HashMap::new(); for old_id in old.eval_order()? { let old_node = &old.nodes()[old_id]; let new_id = model.add_node(old_node.name.clone(), old_node.op.clone())?; map.insert(old_id, new_id); for (ix, output) in old_node.outputs.iter().enumerate() { model.set_fact(OutletId::new(new_id, ix), output.fact.clone())?; } if old.inputs()?.contains(&OutletId::new(old_node.id, 0)) { continue; } for (ix, input) in old_node.inputs.iter().enumerate() { model.add_edge( OutletId::new(map[&input.node], input.slot), InletId::new(new_id, ix), )?; } } // maintaining order of i/o interface model.inputs = old .inputs()? .iter() .map(|i| OutletId::new(map[&i.node], i.slot)) .collect(); model.outputs = old .outputs()? .iter() .map(|o| OutletId::new(map[&o.node], o.slot)) .collect(); Ok(model) }
compact
server.py
import asyncio import websockets import time import threading players = 0 class Player: def __init__(self, id, x = 0, y = 0, speed = 5): self.id = id self.x = x self.y = y self.dirX = 0 self.dirY = 0 self.speed = speed print("Player criado com sucesso!") def setX(self, x): self.x = x def setY(self, y): self.y = y def getX(self): return self.x def getY(self): return self.y async def hello(websocket, path): global players jogador = Player(players, 500, 500) async def moveUP(): while 1: jogador.setY(jogador.getY()-jogador.speed) websocket.send("move:"+str(jogador.id)+":"+ str(jogador.getX())+":"+str(jogador.getY())) print("move:"+str(jogador.id)+":"+ str(jogador.getX())+":"+str(jogador.getY())) time.sleep(1) async def moveR(): while 1: jogador.setX(jogador.getX()+jogador.speed) await websocket.send("move:"+str(jogador.id)+":"+ str(jogador.getX())+":"+str(jogador.getY())) print("move:"+str(jogador.id)+":"+ str(jogador.getX())+":"+str(jogador.getY())) time.sleep(1) def threadEvoque(): global players loop = asyncio.new_event_loop() task = loop.create_task(moveUP()) loop.run_until_complete(task) players += 1 print(players) def threadEvoque2(): global players loop = asyncio.new_event_loop() task2 = loop.create_task(moveR()) loop.run_until_complete(task2) players += 1 print(players) while 1: msg = await websocket.recv() print(msg) if(msg == "start"): players +=1 await websocket.send("spawn:"+str(players)+":"+ str(jogador.getX())+":"+str(jogador.getY())) print("spawn:"+str(players)+":"+ str(jogador.getX())+":"+str(jogador.getY()))
start_server = websockets.serve(hello, "0.0.0.0", 8888) print("Iniciando server...") asyncio.get_event_loop().run_until_complete(start_server) print("Sever em funcionamento!") asyncio.get_event_loop().run_forever()
main.go
/* Copyright 2019 The Tekton 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 main import ( "context" "flag" "log" apiconfig "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" tklogging "github.com/tektoncd/pipeline/pkg/logging" "github.com/tektoncd/pipeline/pkg/system" "go.uber.org/zap" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "knative.dev/pkg/configmap" "knative.dev/pkg/logging" "knative.dev/pkg/logging/logkey" "knative.dev/pkg/signals" "knative.dev/pkg/webhook" ) // WebhookLogKey is the name of the logger for the webhook cmd const WebhookLogKey = "webhook" func main() { flag.Parse() cm, err := configmap.Load("/etc/config-logging") if err != nil { log.Fatalf("Error loading logging configuration: %v", err) } config, err := logging.NewConfigFromMap(cm) if err != nil { log.Fatalf("Error parsing logging configuration: %v", err) } logger, atomicLevel := logging.NewLoggerFromConfig(config, WebhookLogKey) defer logger.Sync() logger = logger.With(zap.String(logkey.ControllerType, "webhook")) logger.Info("Starting the Configuration Webhook") // set up signals so we handle the first shutdown signal gracefully stopCh := signals.SetupSignalHandler() clusterConfig, err := rest.InClusterConfig() if err != nil { logger.Fatal("Failed to get in cluster config", zap.Error(err)) } kubeClient, err := kubernetes.NewForConfig(clusterConfig) if err != nil
// Watch the logging config map and dynamically update logging levels. configMapWatcher := configmap.NewInformedWatcher(kubeClient, system.GetNamespace()) configMapWatcher.Watch(tklogging.ConfigName, logging.UpdateLevelFromConfigMap(logger, atomicLevel, WebhookLogKey)) store := apiconfig.NewStore(logger.Named("config-store")) store.WatchConfigs(configMapWatcher) if err = configMapWatcher.Start(stopCh); err != nil { logger.Fatalf("failed to start configuration manager: %v", err) } options := webhook.ControllerOptions{ ServiceName: "tekton-pipelines-webhook", DeploymentName: "tekton-pipelines-webhook", Namespace: system.GetNamespace(), Port: 8443, SecretName: "webhook-certs", WebhookName: "webhook.tekton.dev", } //TODO add validations here controller := webhook.AdmissionController{ Client: kubeClient, Options: options, Handlers: map[schema.GroupVersionKind]webhook.GenericCRD{ v1alpha1.SchemeGroupVersion.WithKind("Pipeline"): &v1alpha1.Pipeline{}, v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &v1alpha1.PipelineResource{}, v1alpha1.SchemeGroupVersion.WithKind("Task"): &v1alpha1.Task{}, v1alpha1.SchemeGroupVersion.WithKind("ClusterTask"): &v1alpha1.ClusterTask{}, v1alpha1.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha1.TaskRun{}, v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{}, v1alpha1.SchemeGroupVersion.WithKind("Condition"): &v1alpha1.Condition{}, }, Logger: logger, DisallowUnknownFields: true, // Decorate contexts with the current state of the config. WithContext: func(ctx context.Context) context.Context { return v1alpha1.WithDefaultConfigurationName(store.ToContext(ctx)) }, } if err := controller.Run(stopCh); err != nil { logger.Fatal("Error running admission controller", zap.Error(err)) } }
{ logger.Fatal("Failed to get the client set", zap.Error(err)) }
pulumiTypes.go
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package ecr import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) type RepositoryImageScanningConfiguration struct { // Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). ScanOnPush bool `pulumi:"scanOnPush"` } // RepositoryImageScanningConfigurationInput is an input type that accepts RepositoryImageScanningConfigurationArgs and RepositoryImageScanningConfigurationOutput values. // You can construct a concrete instance of `RepositoryImageScanningConfigurationInput` via: // // RepositoryImageScanningConfigurationArgs{...} // type RepositoryImageScanningConfigurationInput interface { pulumi.Input ToRepositoryImageScanningConfigurationOutput() RepositoryImageScanningConfigurationOutput ToRepositoryImageScanningConfigurationOutputWithContext(context.Context) RepositoryImageScanningConfigurationOutput } type RepositoryImageScanningConfigurationArgs struct { // Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). ScanOnPush pulumi.BoolInput `pulumi:"scanOnPush"` } func (RepositoryImageScanningConfigurationArgs) ElementType() reflect.Type { return reflect.TypeOf((*RepositoryImageScanningConfiguration)(nil)).Elem() } func (i RepositoryImageScanningConfigurationArgs) ToRepositoryImageScanningConfigurationOutput() RepositoryImageScanningConfigurationOutput { return i.ToRepositoryImageScanningConfigurationOutputWithContext(context.Background()) } func (i RepositoryImageScanningConfigurationArgs) ToRepositoryImageScanningConfigurationOutputWithContext(ctx context.Context) RepositoryImageScanningConfigurationOutput { return pulumi.ToOutputWithContext(ctx, i).(RepositoryImageScanningConfigurationOutput) } func (i RepositoryImageScanningConfigurationArgs) ToRepositoryImageScanningConfigurationPtrOutput() RepositoryImageScanningConfigurationPtrOutput { return i.ToRepositoryImageScanningConfigurationPtrOutputWithContext(context.Background()) } func (i RepositoryImageScanningConfigurationArgs) ToRepositoryImageScanningConfigurationPtrOutputWithContext(ctx context.Context) RepositoryImageScanningConfigurationPtrOutput { return pulumi.ToOutputWithContext(ctx, i).(RepositoryImageScanningConfigurationOutput).ToRepositoryImageScanningConfigurationPtrOutputWithContext(ctx) } // RepositoryImageScanningConfigurationPtrInput is an input type that accepts RepositoryImageScanningConfigurationArgs, RepositoryImageScanningConfigurationPtr and RepositoryImageScanningConfigurationPtrOutput values. // You can construct a concrete instance of `RepositoryImageScanningConfigurationPtrInput` via: // // RepositoryImageScanningConfigurationArgs{...} // // or: // // nil // type RepositoryImageScanningConfigurationPtrInput interface { pulumi.Input ToRepositoryImageScanningConfigurationPtrOutput() RepositoryImageScanningConfigurationPtrOutput ToRepositoryImageScanningConfigurationPtrOutputWithContext(context.Context) RepositoryImageScanningConfigurationPtrOutput } type repositoryImageScanningConfigurationPtrType RepositoryImageScanningConfigurationArgs func RepositoryImageScanningConfigurationPtr(v *RepositoryImageScanningConfigurationArgs) RepositoryImageScanningConfigurationPtrInput
func (*repositoryImageScanningConfigurationPtrType) ElementType() reflect.Type { return reflect.TypeOf((**RepositoryImageScanningConfiguration)(nil)).Elem() } func (i *repositoryImageScanningConfigurationPtrType) ToRepositoryImageScanningConfigurationPtrOutput() RepositoryImageScanningConfigurationPtrOutput { return i.ToRepositoryImageScanningConfigurationPtrOutputWithContext(context.Background()) } func (i *repositoryImageScanningConfigurationPtrType) ToRepositoryImageScanningConfigurationPtrOutputWithContext(ctx context.Context) RepositoryImageScanningConfigurationPtrOutput { return pulumi.ToOutputWithContext(ctx, i).(RepositoryImageScanningConfigurationPtrOutput) } type RepositoryImageScanningConfigurationOutput struct{ *pulumi.OutputState } func (RepositoryImageScanningConfigurationOutput) ElementType() reflect.Type { return reflect.TypeOf((*RepositoryImageScanningConfiguration)(nil)).Elem() } func (o RepositoryImageScanningConfigurationOutput) ToRepositoryImageScanningConfigurationOutput() RepositoryImageScanningConfigurationOutput { return o } func (o RepositoryImageScanningConfigurationOutput) ToRepositoryImageScanningConfigurationOutputWithContext(ctx context.Context) RepositoryImageScanningConfigurationOutput { return o } func (o RepositoryImageScanningConfigurationOutput) ToRepositoryImageScanningConfigurationPtrOutput() RepositoryImageScanningConfigurationPtrOutput { return o.ToRepositoryImageScanningConfigurationPtrOutputWithContext(context.Background()) } func (o RepositoryImageScanningConfigurationOutput) ToRepositoryImageScanningConfigurationPtrOutputWithContext(ctx context.Context) RepositoryImageScanningConfigurationPtrOutput { return o.ApplyT(func(v RepositoryImageScanningConfiguration) *RepositoryImageScanningConfiguration { return &v }).(RepositoryImageScanningConfigurationPtrOutput) } // Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). func (o RepositoryImageScanningConfigurationOutput) ScanOnPush() pulumi.BoolOutput { return o.ApplyT(func(v RepositoryImageScanningConfiguration) bool { return v.ScanOnPush }).(pulumi.BoolOutput) } type RepositoryImageScanningConfigurationPtrOutput struct{ *pulumi.OutputState } func (RepositoryImageScanningConfigurationPtrOutput) ElementType() reflect.Type { return reflect.TypeOf((**RepositoryImageScanningConfiguration)(nil)).Elem() } func (o RepositoryImageScanningConfigurationPtrOutput) ToRepositoryImageScanningConfigurationPtrOutput() RepositoryImageScanningConfigurationPtrOutput { return o } func (o RepositoryImageScanningConfigurationPtrOutput) ToRepositoryImageScanningConfigurationPtrOutputWithContext(ctx context.Context) RepositoryImageScanningConfigurationPtrOutput { return o } func (o RepositoryImageScanningConfigurationPtrOutput) Elem() RepositoryImageScanningConfigurationOutput { return o.ApplyT(func(v *RepositoryImageScanningConfiguration) RepositoryImageScanningConfiguration { return *v }).(RepositoryImageScanningConfigurationOutput) } // Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). func (o RepositoryImageScanningConfigurationPtrOutput) ScanOnPush() pulumi.BoolOutput { return o.ApplyT(func(v RepositoryImageScanningConfiguration) bool { return v.ScanOnPush }).(pulumi.BoolOutput) } func init() { pulumi.RegisterOutputType(RepositoryImageScanningConfigurationOutput{}) pulumi.RegisterOutputType(RepositoryImageScanningConfigurationPtrOutput{}) }
{ return (*repositoryImageScanningConfigurationPtrType)(v) }
complete.py
#!/usr/bin/env python3 """ Scripts to drive a donkey 2 car Usage: manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical)] [--camera=(single|stereo)] [--meta=<key:value> ...] [--myconfig=<filename>] manage.py (train) [--tubs=tubs] (--model=<model>) [--type=(linear|inferred|tensorrt_linear|tflite_linear)] Options: -h --help Show this screen. --js Use physical joystick. -f --file=<file> A text file containing paths to tub files, one per line. Option may be used more than once. --meta=<key:value> Key/Value strings describing describing a piece of meta data about this drive. Option may be used more than once. --myconfig=filename Specify myconfig file to use. [default: myconfig.py] """ import os import time import logging from docopt import docopt import donkeycar as dk from donkeycar.parts.transform import TriggeredCallback, DelayedTrigger from donkeycar.parts.tub_v2 import TubWriter from donkeycar.parts.datastore import TubHandler from donkeycar.parts.controller import LocalWebController, WebFpv, JoystickController from donkeycar.parts.throttle_filter import ThrottleFilter from donkeycar.parts.behavior import BehaviorPart from donkeycar.parts.file_watcher import FileWatcher from donkeycar.parts.launch import AiLaunch from donkeycar.pipeline.augmentations import ImageAugmentation from donkeycar.utils import * logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) def drive(cfg, model_path=None, use_joystick=False, model_type=None, camera_type='single', meta=[]): """ Construct a working robotic vehicle from many parts. Each part runs as a job in the Vehicle loop, calling either it's run or run_threaded method depending on the constructor flag `threaded`. All parts are updated one after another at the framerate given in cfg.DRIVE_LOOP_HZ assuming each part finishes processing in a timely manner. Parts may have named outputs and inputs. The framework handles passing named outputs to parts requesting the same named input. """ logger.info(f'PID: {os.getpid()}') if cfg.DONKEY_GYM: #the simulator will use cuda and then we usually run out of resources #if we also try to use cuda. so disable for donkey_gym. #os.environ["CUDA_VISIBLE_DEVICES"]="-1" pass if model_type is None: if cfg.TRAIN_LOCALIZER: model_type = "localizer" elif cfg.TRAIN_BEHAVIORS: model_type = "behavior" else: model_type = cfg.DEFAULT_MODEL_TYPE #Initialize car V = dk.vehicle.Vehicle() #Initialize logging before anything else to allow console logging if cfg.HAVE_CONSOLE_LOGGING: logger.setLevel(logging.getLevelName(cfg.LOGGING_LEVEL)) ch = logging.StreamHandler() ch.setFormatter(logging.Formatter(cfg.LOGGING_FORMAT)) logger.addHandler(ch) if cfg.HAVE_MQTT_TELEMETRY: from donkeycar.parts.telemetry import MqttTelemetry tel = MqttTelemetry(cfg) if cfg.HAVE_ODOM: if cfg.ENCODER_TYPE == "GPIO": from donkeycar.parts.encoder import RotaryEncoder enc = RotaryEncoder(mm_per_tick=0.306096, pin = cfg.ODOM_PIN, debug = cfg.ODOM_DEBUG) V.add(enc, inputs=['throttle'], outputs=['enc/speed'], threaded=True) elif cfg.ENCODER_TYPE == "arduino": from donkeycar.parts.encoder import ArduinoEncoder enc = ArduinoEncoder() V.add(enc, outputs=['enc/speed'], threaded=True) else: print("No supported encoder found") logger.info("cfg.CAMERA_TYPE %s"%cfg.CAMERA_TYPE) if camera_type == "stereo": if cfg.CAMERA_TYPE == "WEBCAM": from donkeycar.parts.camera import Webcam camA = Webcam(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH, iCam = 0) camB = Webcam(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH, iCam = 1) elif cfg.CAMERA_TYPE == "CVCAM": from donkeycar.parts.cv import CvCam camA = CvCam(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH, iCam = 0) camB = CvCam(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH, iCam = 1) else: raise(Exception("Unsupported camera type: %s" % cfg.CAMERA_TYPE)) V.add(camA, outputs=['cam/image_array_a'], threaded=True) V.add(camB, outputs=['cam/image_array_b'], threaded=True) from donkeycar.parts.image import StereoPair V.add(StereoPair(), inputs=['cam/image_array_a', 'cam/image_array_b'], outputs=['cam/image_array']) elif cfg.CAMERA_TYPE == "D435": from donkeycar.parts.realsense435i import RealSense435i cam = RealSense435i( enable_rgb=cfg.REALSENSE_D435_RGB, enable_depth=cfg.REALSENSE_D435_DEPTH, enable_imu=cfg.REALSENSE_D435_IMU, device_id=cfg.REALSENSE_D435_ID) V.add(cam, inputs=[], outputs=['cam/image_array', 'cam/depth_array', 'imu/acl_x', 'imu/acl_y', 'imu/acl_z', 'imu/gyr_x', 'imu/gyr_y', 'imu/gyr_z'], threaded=True) else: if cfg.DONKEY_GYM: from donkeycar.parts.dgym import DonkeyGymEnv inputs = [] outputs = ['cam/image_array'] threaded = True if cfg.DONKEY_GYM: from donkeycar.parts.dgym import DonkeyGymEnv #rbx cam = DonkeyGymEnv(cfg.DONKEY_SIM_PATH, host=cfg.SIM_HOST, env_name=cfg.DONKEY_GYM_ENV_NAME, conf=cfg.GYM_CONF, record_location=cfg.SIM_RECORD_LOCATION, record_gyroaccel=cfg.SIM_RECORD_GYROACCEL, record_velocity=cfg.SIM_RECORD_VELOCITY, record_lidar=cfg.SIM_RECORD_LIDAR, delay=cfg.SIM_ARTIFICIAL_LATENCY) threaded = True inputs = ['angle', 'throttle'] elif cfg.CAMERA_TYPE == "PICAM": from donkeycar.parts.camera import PiCamera cam = PiCamera(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH, framerate=cfg.CAMERA_FRAMERATE, vflip=cfg.CAMERA_VFLIP, hflip=cfg.CAMERA_HFLIP) elif cfg.CAMERA_TYPE == "WEBCAM": from donkeycar.parts.camera import Webcam cam = Webcam(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH) elif cfg.CAMERA_TYPE == "CVCAM": from donkeycar.parts.cv import CvCam cam = CvCam(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH) elif cfg.CAMERA_TYPE == "CSIC": from donkeycar.parts.camera import CSICamera cam = CSICamera(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH, framerate=cfg.CAMERA_FRAMERATE, gstreamer_flip=cfg.CSIC_CAM_GSTREAMER_FLIP_PARM) elif cfg.CAMERA_TYPE == "V4L": from donkeycar.parts.camera import V4LCamera cam = V4LCamera(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH, framerate=cfg.CAMERA_FRAMERATE) elif cfg.CAMERA_TYPE == "MOCK": from donkeycar.parts.camera import MockCamera cam = MockCamera(image_w=cfg.IMAGE_W, image_h=cfg.IMAGE_H, image_d=cfg.IMAGE_DEPTH) elif cfg.CAMERA_TYPE == "IMAGE_LIST": from donkeycar.parts.camera import ImageListCamera cam = ImageListCamera(path_mask=cfg.PATH_MASK) elif cfg.CAMERA_TYPE == "LEOPARD": from donkeycar.parts.leopard_imaging import LICamera cam = LICamera(width=cfg.IMAGE_W, height=cfg.IMAGE_H, fps=cfg.CAMERA_FRAMERATE) else: raise(Exception("Unkown camera type: %s" % cfg.CAMERA_TYPE)) # Donkey gym part will output position information if it is configured if cfg.DONKEY_GYM: if cfg.SIM_RECORD_LOCATION: outputs += ['pos/pos_x', 'pos/pos_y', 'pos/pos_z', 'pos/speed', 'pos/cte'] if cfg.SIM_RECORD_GYROACCEL: outputs += ['gyro/gyro_x', 'gyro/gyro_y', 'gyro/gyro_z', 'accel/accel_x', 'accel/accel_y', 'accel/accel_z'] if cfg.SIM_RECORD_VELOCITY: outputs += ['vel/vel_x', 'vel/vel_y', 'vel/vel_z'] if cfg.SIM_RECORD_LIDAR: outputs += ['lidar/dist_array'] V.add(cam, inputs=inputs, outputs=outputs, threaded=threaded) # add lidar if cfg.USE_LIDAR: from donkeycar.parts.lidar import RPLidar if cfg.LIDAR_TYPE == 'RP': print("adding RP lidar part") lidar = RPLidar(lower_limit = cfg.LIDAR_LOWER_LIMIT, upper_limit = cfg.LIDAR_UPPER_LIMIT) V.add(lidar, inputs=[],outputs=['lidar/dist_array'], threaded=True) if cfg.LIDAR_TYPE == 'YD': print("YD Lidar not yet supported") #This web controller will create a web server that is capable #of managing steering, throttle, and modes, and more. ctr = LocalWebController(port=cfg.WEB_CONTROL_PORT, mode=cfg.WEB_INIT_MODE) V.add(ctr, inputs=['cam/image_array', 'tub/num_records'], outputs=['user/angle', 'user/throttle', 'user/mode', 'recording'], threaded=True) if use_joystick or cfg.USE_JOYSTICK_AS_DEFAULT: #modify max_throttle closer to 1.0 to have more power #modify steering_scale lower than 1.0 to have less responsive steering if cfg.CONTROLLER_TYPE == "pigpio_rc": # an RC controllers read by GPIO pins. They typically don't have buttons from donkeycar.parts.controller import RCReceiver ctr = RCReceiver(cfg) V.add(ctr, outputs=['user/angle', 'user/throttle', 'user/mode', 'recording'],threaded=False) else: if cfg.CONTROLLER_TYPE == "custom": #custom controller created with `donkey createjs` command from my_joystick import MyJoystickController ctr = MyJoystickController( throttle_dir=cfg.JOYSTICK_THROTTLE_DIR, throttle_scale=cfg.JOYSTICK_MAX_THROTTLE, steering_scale=cfg.JOYSTICK_STEERING_SCALE, auto_record_on_throttle=cfg.AUTO_RECORD_ON_THROTTLE) ctr.set_deadzone(cfg.JOYSTICK_DEADZONE) elif cfg.CONTROLLER_TYPE == "MM1": from donkeycar.parts.robohat import RoboHATController ctr = RoboHATController(cfg) else: from donkeycar.parts.controller import get_js_controller ctr = get_js_controller(cfg) if cfg.USE_NETWORKED_JS: from donkeycar.parts.controller import JoyStickSub netwkJs = JoyStickSub(cfg.NETWORK_JS_SERVER_IP) V.add(netwkJs, threaded=True) ctr.js = netwkJs V.add(ctr, inputs=['cam/image_array'], outputs=['user/angle', 'user/throttle', 'user/mode', 'recording'],threaded=True) #this throttle filter will allow one tap back for esc reverse th_filter = ThrottleFilter() V.add(th_filter, inputs=['user/throttle'], outputs=['user/throttle']) #See if we should even run the pilot module. #This is only needed because the part run_condition only accepts boolean class PilotCondition: def run(self, mode): if mode == 'user': return False else: return True V.add(PilotCondition(), inputs=['user/mode'], outputs=['run_pilot']) class LedConditionLogic: def __init__(self, cfg): self.cfg = cfg def run(self, mode, recording, recording_alert, behavior_state, model_file_changed, track_loc): #returns a blink rate. 0 for off. -1 for on. positive for rate. if track_loc is not None: led.set_rgb(*self.cfg.LOC_COLORS[track_loc]) return -1 if model_file_changed: led.set_rgb(self.cfg.MODEL_RELOADED_LED_R, self.cfg.MODEL_RELOADED_LED_G, self.cfg.MODEL_RELOADED_LED_B) return 0.1 else: led.set_rgb(self.cfg.LED_R, self.cfg.LED_G, self.cfg.LED_B) if recording_alert: led.set_rgb(*recording_alert) return self.cfg.REC_COUNT_ALERT_BLINK_RATE else: led.set_rgb(self.cfg.LED_R, self.cfg.LED_G, self.cfg.LED_B) if behavior_state is not None and model_type == 'behavior': r, g, b = self.cfg.BEHAVIOR_LED_COLORS[behavior_state] led.set_rgb(r, g, b) return -1 #solid on if recording: return -1 #solid on elif mode == 'user': return 1 elif mode == 'local_angle': return 0.5 elif mode == 'local': return 0.1 return 0 if cfg.HAVE_RGB_LED and not cfg.DONKEY_GYM: from donkeycar.parts.led_status import RGB_LED led = RGB_LED(cfg.LED_PIN_R, cfg.LED_PIN_G, cfg.LED_PIN_B, cfg.LED_INVERT) led.set_rgb(cfg.LED_R, cfg.LED_G, cfg.LED_B) V.add(LedConditionLogic(cfg), inputs=['user/mode', 'recording', "records/alert", 'behavior/state', 'modelfile/modified', "pilot/loc"], outputs=['led/blink_rate']) V.add(led, inputs=['led/blink_rate']) def get_record_alert_color(num_records): col = (0, 0, 0) for count, color in cfg.RECORD_ALERT_COLOR_ARR: if num_records >= count: col = color return col class RecordTracker: def __init__(self): self.last_num_rec_print = 0 self.dur_alert = 0 self.force_alert = 0 def run(self, num_records): if num_records is None: return 0 if self.last_num_rec_print != num_records or self.force_alert: self.last_num_rec_print = num_records if num_records % 10 == 0: print("recorded", num_records, "records") if num_records % cfg.REC_COUNT_ALERT == 0 or self.force_alert: self.dur_alert = num_records // cfg.REC_COUNT_ALERT * cfg.REC_COUNT_ALERT_CYC self.force_alert = 0 if self.dur_alert > 0: self.dur_alert -= 1 if self.dur_alert != 0: return get_record_alert_color(num_records) return 0 rec_tracker_part = RecordTracker() V.add(rec_tracker_part, inputs=["tub/num_records"], outputs=['records/alert']) if cfg.AUTO_RECORD_ON_THROTTLE: def show_record_count_status(): rec_tracker_part.last_num_rec_print = 0 rec_tracker_part.force_alert = 1 if (cfg.CONTROLLER_TYPE != "pigpio_rc") and (cfg.CONTROLLER_TYPE != "MM1"): # these controllers don't use the joystick class if isinstance(ctr, JoystickController): ctr.set_button_down_trigger('circle', show_record_count_status) #then we are not using the circle button. hijack that to force a record count indication else: show_record_count_status() #Sombrero if cfg.HAVE_SOMBRERO: from donkeycar.parts.sombrero import Sombrero s = Sombrero() #IMU if cfg.HAVE_IMU: from donkeycar.parts.imu import IMU imu = IMU(sensor=cfg.IMU_SENSOR, dlp_setting=cfg.IMU_DLP_CONFIG) V.add(imu, outputs=['imu/acl_x', 'imu/acl_y', 'imu/acl_z', 'imu/gyr_x', 'imu/gyr_y', 'imu/gyr_z'], threaded=True) # Use the FPV preview, which will show the cropped image output, or the full frame. if cfg.USE_FPV: V.add(WebFpv(), inputs=['cam/image_array'], threaded=True) #Behavioral state if cfg.TRAIN_BEHAVIORS: bh = BehaviorPart(cfg.BEHAVIOR_LIST) V.add(bh, outputs=['behavior/state', 'behavior/label', "behavior/one_hot_state_array"]) try: ctr.set_button_down_trigger('L1', bh.increment_state) except: pass inputs = ['cam/image_array', "behavior/one_hot_state_array"] #IMU elif cfg.USE_LIDAR: inputs = ['cam/image_array', 'lidar/dist_array'] elif cfg.HAVE_ODOM: inputs = ['cam/image_array', 'enc/speed'] elif model_type == "imu": assert cfg.HAVE_IMU, 'Missing imu parameter in config' # Run the pilot if the mode is not user. inputs = ['cam/image_array', 'imu/acl_x', 'imu/acl_y', 'imu/acl_z', 'imu/gyr_x', 'imu/gyr_y', 'imu/gyr_z'] else: inputs = ['cam/image_array'] def load_model(kl, model_path): start = time.time() print('loading model', model_path) kl.load(model_path) print('finished loading in %s sec.' % (str(time.time() - start)) ) def load_weights(kl, weights_path): start = time.time() try: print('loading model weights', weights_path) kl.model.load_weights(weights_path) print('finished loading in %s sec.' % (str(time.time() - start)) ) except Exception as e: print(e) print('ERR>> problems loading weights', weights_path) def load_model_json(kl, json_fnm): start = time.time() print('loading model json', json_fnm) from tensorflow.python import keras try: with open(json_fnm, 'r') as handle: contents = handle.read() kl.model = keras.models.model_from_json(contents) print('finished loading json in %s sec.' % (str(time.time() - start)) ) except Exception as e: print(e) print("ERR>> problems loading model json", json_fnm) if model_path: # When we have a model, first create an appropriate Keras part kl = dk.utils.get_model_by_type(model_type, cfg) model_reload_cb = None if '.h5' in model_path or '.trt' in model_path or '.tflite' in \ model_path or '.savedmodel' in model_path: # load the whole model with weigths, etc load_model(kl, model_path) def reload_model(filename): load_model(kl, filename) model_reload_cb = reload_model elif '.json' in model_path: # when we have a .json extension # load the model from there and look for a matching # .wts file with just weights load_model_json(kl, model_path) weights_path = model_path.replace('.json', '.weights') load_weights(kl, weights_path) def reload_weights(filename): weights_path = filename.replace('.json', '.weights') load_weights(kl, weights_path) model_reload_cb = reload_weights else: print("ERR>> Unknown extension type on model file!!") return # this part will signal visual LED, if connected V.add(FileWatcher(model_path, verbose=True), outputs=['modelfile/modified']) # these parts will reload the model file, but only when ai is running # so we don't interrupt user driving V.add(FileWatcher(model_path), outputs=['modelfile/dirty'], run_condition="ai_running") V.add(DelayedTrigger(100), inputs=['modelfile/dirty'], outputs=['modelfile/reload'], run_condition="ai_running") V.add(TriggeredCallback(model_path, model_reload_cb), inputs=["modelfile/reload"], run_condition="ai_running") outputs = ['pilot/angle', 'pilot/throttle'] if cfg.TRAIN_LOCALIZER: outputs.append("pilot/loc") # Add image transformations like crop or trapezoidal mask if hasattr(cfg, 'TRANSFORMATIONS') and cfg.TRANSFORMATIONS: V.add(ImageAugmentation(cfg, 'TRANSFORMATIONS'), inputs=['cam/image_array'], outputs=['cam/image_array_trans']) inputs = ['cam/image_array_trans'] + inputs[1:] V.add(kl, inputs=inputs, outputs=outputs, run_condition='run_pilot') if cfg.STOP_SIGN_DETECTOR: from donkeycar.parts.object_detector.stop_sign_detector \ import StopSignDetector V.add(StopSignDetector(cfg.STOP_SIGN_MIN_SCORE, cfg.STOP_SIGN_SHOW_BOUNDING_BOX), inputs=['cam/image_array', 'pilot/throttle'], outputs=['pilot/throttle', 'cam/image_array']) # Choose what inputs should change the car. class DriveMode: drive_start = time.time() def run(self, mode, user_angle, user_throttle, pilot_angle, pilot_throttle): if mode == 'user': current_time = time.time() if current_time - self.drive_start >= 1.0: print(f"user_angle: {user_angle}, user_throttle: {user_throttle}") self.drive_start = current_time return user_angle, user_throttle elif mode == 'local_angle': return pilot_angle if pilot_angle else 0.0, user_throttle else: return pilot_angle if pilot_angle else 0.0, \ pilot_throttle * cfg.AI_THROTTLE_MULT \ if pilot_throttle else 0.0 V.add(DriveMode(), inputs=['user/mode', 'user/angle', 'user/throttle', 'pilot/angle', 'pilot/throttle'], outputs=['angle', 'throttle']) #to give the car a boost when starting ai mode in a race. aiLauncher = AiLaunch(cfg.AI_LAUNCH_DURATION, cfg.AI_LAUNCH_THROTTLE, cfg.AI_LAUNCH_KEEP_ENABLED) V.add(aiLauncher, inputs=['user/mode', 'throttle'], outputs=['throttle']) if (cfg.CONTROLLER_TYPE != "pigpio_rc") and (cfg.CONTROLLER_TYPE != "MM1"): if isinstance(ctr, JoystickController): ctr.set_button_down_trigger(cfg.AI_LAUNCH_ENABLE_BUTTON, aiLauncher.enable_ai_launch) class AiRunCondition: ''' A bool part to let us know when ai is running. ''' def
(self, mode): if mode == "user": return False return True V.add(AiRunCondition(), inputs=['user/mode'], outputs=['ai_running']) # Ai Recording class AiRecordingCondition: ''' return True when ai mode, otherwize respect user mode recording flag ''' def run(self, mode, recording): if mode == 'user': return recording return True if cfg.RECORD_DURING_AI: V.add(AiRecordingCondition(), inputs=['user/mode', 'recording'], outputs=['recording']) # Drive train setup if cfg.DONKEY_GYM or cfg.DRIVE_TRAIN_TYPE == "MOCK": pass elif cfg.DRIVE_TRAIN_TYPE == "I2C_SERVO": from donkeycar.parts.actuator import PCA9685, PWMSteering, PWMThrottle steering_controller = PCA9685(cfg.STEERING_CHANNEL, cfg.PCA9685_I2C_ADDR, busnum=cfg.PCA9685_I2C_BUSNUM) steering = PWMSteering(controller=steering_controller, left_pulse=cfg.STEERING_LEFT_PWM, steering_zero_pulse=cfg.STEERING_STOPPED_PWM, right_pulse=cfg.STEERING_RIGHT_PWM) throttle_controller = PCA9685(cfg.THROTTLE_CHANNEL, cfg.PCA9685_I2C_ADDR, busnum=cfg.PCA9685_I2C_BUSNUM) throttle = PWMThrottle(controller=throttle_controller, max_pulse=cfg.THROTTLE_FORWARD_PWM, throttle_zero_pulse=cfg.THROTTLE_STOPPED_PWM, min_pulse=cfg.THROTTLE_REVERSE_PWM) V.add(steering, inputs=['angle'], threaded=False) V.add(throttle, inputs=['throttle'], threaded=False) elif cfg.DRIVE_TRAIN_TYPE == "DC_STEER_THROTTLE": from donkeycar.parts.actuator import Mini_HBridge_DC_Motor_PWM steering = Mini_HBridge_DC_Motor_PWM(cfg.HBRIDGE_PIN_LEFT, cfg.HBRIDGE_PIN_RIGHT) throttle = Mini_HBridge_DC_Motor_PWM(cfg.HBRIDGE_PIN_FWD, cfg.HBRIDGE_PIN_BWD) V.add(steering, inputs=['angle']) V.add(throttle, inputs=['throttle']) elif cfg.DRIVE_TRAIN_TYPE == "DC_TWO_WHEEL": from donkeycar.parts.actuator import TwoWheelSteeringThrottle, Mini_HBridge_DC_Motor_PWM left_motor = Mini_HBridge_DC_Motor_PWM(cfg.HBRIDGE_PIN_LEFT_FWD, cfg.HBRIDGE_PIN_LEFT_BWD) right_motor = Mini_HBridge_DC_Motor_PWM(cfg.HBRIDGE_PIN_RIGHT_FWD, cfg.HBRIDGE_PIN_RIGHT_BWD) two_wheel_control = TwoWheelSteeringThrottle() V.add(two_wheel_control, inputs=['throttle', 'angle'], outputs=['left_motor_speed', 'right_motor_speed']) V.add(left_motor, inputs=['left_motor_speed']) V.add(right_motor, inputs=['right_motor_speed']) elif cfg.DRIVE_TRAIN_TYPE == "DC_TWO_WHEEL_L298N": from donkeycar.parts.actuator import TwoWheelSteeringThrottle, L298N_HBridge_DC_Motor left_motor = L298N_HBridge_DC_Motor(cfg.HBRIDGE_L298N_PIN_LEFT_FWD, cfg.HBRIDGE_L298N_PIN_LEFT_BWD, cfg.HBRIDGE_L298N_PIN_LEFT_EN) right_motor = L298N_HBridge_DC_Motor(cfg.HBRIDGE_L298N_PIN_RIGHT_FWD, cfg.HBRIDGE_L298N_PIN_RIGHT_BWD, cfg.HBRIDGE_L298N_PIN_RIGHT_EN) two_wheel_control = TwoWheelSteeringThrottle() V.add(two_wheel_control, inputs=['throttle', 'angle'], outputs=['left_motor_speed', 'right_motor_speed']) V.add(left_motor, inputs=['left_motor_speed']) V.add(right_motor, inputs=['right_motor_speed']) elif cfg.DRIVE_TRAIN_TYPE == "SERVO_HBRIDGE_PWM": from donkeycar.parts.actuator import ServoBlaster, PWMSteering steering_controller = ServoBlaster(cfg.STEERING_CHANNEL) #really pin # PWM pulse values should be in the range of 100 to 200 assert(cfg.STEERING_LEFT_PWM <= 200) assert(cfg.STEERING_RIGHT_PWM <= 200) steering = PWMSteering(controller=steering_controller, left_pulse=cfg.STEERING_LEFT_PWM, right_pulse=cfg.STEERING_RIGHT_PWM) from donkeycar.parts.actuator import Mini_HBridge_DC_Motor_PWM motor = Mini_HBridge_DC_Motor_PWM(cfg.HBRIDGE_PIN_FWD, cfg.HBRIDGE_PIN_BWD) V.add(steering, inputs=['angle'], threaded=True) V.add(motor, inputs=["throttle"]) elif cfg.DRIVE_TRAIN_TYPE == "MM1": from donkeycar.parts.robohat import RoboHATDriver V.add(RoboHATDriver(cfg), inputs=['angle', 'throttle']) elif cfg.DRIVE_TRAIN_TYPE == "PIGPIO_PWM": from donkeycar.parts.actuator import PWMSteering, PWMThrottle, PiGPIO_PWM steering_controller = PiGPIO_PWM(cfg.STEERING_PWM_PIN, freq=cfg.STEERING_PWM_FREQ, inverted=cfg.STEERING_PWM_INVERTED) steering = PWMSteering(controller=steering_controller, left_pulse=cfg.STEERING_LEFT_PWM, steering_zero_pulse=cfg.STEERING_STOPPED_PWM, right_pulse=cfg.STEERING_RIGHT_PWM) throttle_controller = PiGPIO_PWM(cfg.THROTTLE_PWM_PIN, freq=cfg.THROTTLE_PWM_FREQ, inverted=cfg.THROTTLE_PWM_INVERTED) throttle = PWMThrottle(controller=throttle_controller, max_pulse=cfg.THROTTLE_FORWARD_PWM, throttle_zero_pulse=cfg.THROTTLE_STOPPED_PWM, min_pulse=cfg.THROTTLE_REVERSE_PWM) V.add(steering, inputs=['angle'], threaded=True) V.add(throttle, inputs=['throttle'], threaded=True) # OLED setup if cfg.USE_SSD1306_128_32: from donkeycar.parts.oled import OLEDPart auto_record_on_throttle = cfg.USE_JOYSTICK_AS_DEFAULT and cfg.AUTO_RECORD_ON_THROTTLE oled_part = OLEDPart(cfg.SSD1306_128_32_I2C_ROTATION, cfg.SSD1306_RESOLUTION, auto_record_on_throttle) V.add(oled_part, inputs=['recording', 'tub/num_records', 'user/mode'], outputs=[], threaded=True) # add tub to save data inputs = ['cam/image_array', 'user/angle', 'user/throttle', 'user/mode',] types = ['image_array', 'float', 'float', 'str'] if cfg.USE_LIDAR: inputs += ['lidar/dist_array'] types += ['nparray'] if cfg.HAVE_ODOM: inputs += ['enc/speed'] types += ['float'] if cfg.TRAIN_BEHAVIORS: inputs += ['behavior/state', 'behavior/label', "behavior/one_hot_state_array"] types += ['int', 'str', 'vector'] if cfg.CAMERA_TYPE == "D435" and cfg.REALSENSE_D435_DEPTH: inputs += ['cam/depth_array'] types += ['gray16_array'] if cfg.HAVE_IMU or (cfg.CAMERA_TYPE == "D435" and cfg.REALSENSE_D435_IMU): inputs += ['imu/acl_x', 'imu/acl_y', 'imu/acl_z', 'imu/gyr_x', 'imu/gyr_y', 'imu/gyr_z'] types +=['float', 'float', 'float', 'float', 'float', 'float'] # rbx if cfg.DONKEY_GYM: if cfg.SIM_RECORD_LOCATION: inputs += ['pos/pos_x', 'pos/pos_y', 'pos/pos_z', 'pos/speed', 'pos/cte'] types += ['float', 'float', 'float', 'float', 'float'] if cfg.SIM_RECORD_GYROACCEL: inputs += ['gyro/gyro_x', 'gyro/gyro_y', 'gyro/gyro_z', 'accel/accel_x', 'accel/accel_y', 'accel/accel_z'] types += ['float', 'float', 'float', 'float', 'float', 'float'] if cfg.SIM_RECORD_VELOCITY: inputs += ['vel/vel_x', 'vel/vel_y', 'vel/vel_z'] types += ['float', 'float', 'float'] if cfg.SIM_RECORD_LIDAR: inputs += ['lidar/dist_array'] types += ['nparray'] if cfg.RECORD_DURING_AI: inputs += ['pilot/angle', 'pilot/throttle'] types += ['float', 'float'] if cfg.HAVE_PERFMON: from donkeycar.parts.perfmon import PerfMonitor mon = PerfMonitor(cfg) perfmon_outputs = ['perf/cpu', 'perf/mem', 'perf/freq'] inputs += perfmon_outputs types += ['float', 'float', 'float'] V.add(mon, inputs=[], outputs=perfmon_outputs, threaded=True) # do we want to store new records into own dir or append to existing tub_path = TubHandler(path=cfg.DATA_PATH).create_tub_path() if \ cfg.AUTO_CREATE_NEW_TUB else cfg.DATA_PATH tub_writer = TubWriter(tub_path, inputs=inputs, types=types, metadata=meta) V.add(tub_writer, inputs=inputs, outputs=["tub/num_records"], run_condition='recording') # Telemetry (we add the same metrics added to the TubHandler if cfg.HAVE_MQTT_TELEMETRY: telem_inputs, _ = tel.add_step_inputs(inputs, types) V.add(tel, inputs=telem_inputs, outputs=["tub/queue_size"], threaded=True) if cfg.PUB_CAMERA_IMAGES: from donkeycar.parts.network import TCPServeValue from donkeycar.parts.image import ImgArrToJpg pub = TCPServeValue("camera") V.add(ImgArrToJpg(), inputs=['cam/image_array'], outputs=['jpg/bin']) V.add(pub, inputs=['jpg/bin']) if type(ctr) is LocalWebController: if cfg.DONKEY_GYM: print("You can now go to http://localhost:%d to drive your car." % cfg.WEB_CONTROL_PORT) else: print("You can now go to <your hostname.local>:%d to drive your car." % cfg.WEB_CONTROL_PORT) elif (cfg.CONTROLLER_TYPE != "pigpio_rc") and (cfg.CONTROLLER_TYPE != "MM1"): if isinstance(ctr, JoystickController): print("You can now move your joystick to drive your car.") ctr.set_tub(tub_writer.tub) ctr.print_controls() # run the vehicle V.start(rate_hz=cfg.DRIVE_LOOP_HZ, max_loop_count=cfg.MAX_LOOPS) if __name__ == '__main__': args = docopt(__doc__) cfg = dk.load_config(myconfig=args['--myconfig']) if args['drive']: model_type = args['--type'] camera_type = args['--camera'] drive(cfg, model_path=args['--model'], use_joystick=args['--js'], model_type=model_type, camera_type=camera_type, meta=args['--meta']) elif args['train']: print('Use python train.py instead.\n')
run
cluster.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 m3 import ( "errors" "fmt" "io" "sync" "time" "github.com/m3db/m3/src/dbnode/client" "github.com/m3db/m3/src/query/storage" xerrors "github.com/m3db/m3/src/x/errors"
errNamespaceIDNotSet = errors.New("namespace ID not set") errSessionNotSet = errors.New("session not set") errRetentionNotSet = errors.New("retention not set") errResolutionNotSet = errors.New("resolution not set") defaultClusterNamespaceDownsampleOptions = ClusterNamespaceDownsampleOptions{ All: true, } ) // Clusters is a flattened collection of local storage clusters and namespaces. type Clusters interface { io.Closer // ClusterNamespaces returns all known cluster namespaces. ClusterNamespaces() ClusterNamespaces // UnaggregatedClusterNamespace returns the valid unaggregated // cluster namespace. UnaggregatedClusterNamespace() ClusterNamespace // AggregatedClusterNamespace returns an aggregated cluster namespace // at a specific retention and resolution. AggregatedClusterNamespace(attrs RetentionResolution) (ClusterNamespace, bool) } // RetentionResolution is a tuple of retention and resolution that describes // an aggregated metrics policy. type RetentionResolution struct { Retention time.Duration Resolution time.Duration } // ClusterNamespace is a local storage cluster namespace. type ClusterNamespace interface { NamespaceID() ident.ID Options() ClusterNamespaceOptions Session() client.Session } // ClusterNamespaceOptions is a set of options type ClusterNamespaceOptions struct { // Note: Don't allow direct access, as we want to provide defaults // and/or error if call to access a field is not relevant/correct. attributes storage.Attributes downsample *ClusterNamespaceDownsampleOptions } // Attributes returns the storage attributes of the cluster namespace. func (o ClusterNamespaceOptions) Attributes() storage.Attributes { return o.attributes } // DownsampleOptions returns the downsample options for a cluster namespace, // which is only valid if the namespace is an aggregated cluster namespace. func (o ClusterNamespaceOptions) DownsampleOptions() ( ClusterNamespaceDownsampleOptions, error, ) { if o.attributes.MetricsType != storage.AggregatedMetricsType { return ClusterNamespaceDownsampleOptions{}, errNotAggregatedClusterNamespace } if o.downsample == nil { return defaultClusterNamespaceDownsampleOptions, nil } return *o.downsample, nil } // ClusterNamespaceDownsampleOptions is the downsample options for // a cluster namespace. type ClusterNamespaceDownsampleOptions struct { All bool } // ClusterNamespaces is a slice of ClusterNamespace instances. type ClusterNamespaces []ClusterNamespace // ClusterNamespacesByResolutionAsc is a slice of ClusterNamespace instances is // sortable by resolution. type ClusterNamespacesByResolutionAsc []ClusterNamespace func (a ClusterNamespacesByResolutionAsc) Len() int { return len(a) } func (a ClusterNamespacesByResolutionAsc) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a ClusterNamespacesByResolutionAsc) Less(i, j int) bool { return a[i].Options().Attributes().Resolution < a[j].Options().Attributes().Resolution } // ClusterNamespacesByRetentionAsc is a slice of ClusterNamespace instances is // sortable by retention. type ClusterNamespacesByRetentionAsc []ClusterNamespace func (a ClusterNamespacesByRetentionAsc) Len() int { return len(a) } func (a ClusterNamespacesByRetentionAsc) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a ClusterNamespacesByRetentionAsc) Less(i, j int) bool { return a[i].Options().Attributes().Retention < a[j].Options().Attributes().Retention } // NumAggregatedClusterNamespaces returns the number of aggregated // cluster namespaces. func (n ClusterNamespaces) NumAggregatedClusterNamespaces() int { count := 0 for _, namespace := range n { if namespace.Options().Attributes().MetricsType == storage.AggregatedMetricsType { count++ } } return count } // UnaggregatedClusterNamespaceDefinition is the definition for the // cluster namespace that holds unaggregated metrics data. type UnaggregatedClusterNamespaceDefinition struct { NamespaceID ident.ID Session client.Session Retention time.Duration } // Validate will validate the cluster namespace definition. func (def UnaggregatedClusterNamespaceDefinition) Validate() error { if def.NamespaceID == nil || len(def.NamespaceID.String()) == 0 { return errNamespaceIDNotSet } if def.Session == nil { return errSessionNotSet } if def.Retention <= 0 { return errRetentionNotSet } return nil } // AggregatedClusterNamespaceDefinition is a definition for a // cluster namespace that holds aggregated metrics data at a // specific retention and resolution. type AggregatedClusterNamespaceDefinition struct { NamespaceID ident.ID Session client.Session Retention time.Duration Resolution time.Duration Downsample *ClusterNamespaceDownsampleOptions } // Validate validates the cluster namespace definition. func (def AggregatedClusterNamespaceDefinition) Validate() error { if def.NamespaceID == nil || len(def.NamespaceID.String()) == 0 { return errNamespaceIDNotSet } if def.Session == nil { return errSessionNotSet } if def.Retention <= 0 { return errRetentionNotSet } if def.Resolution <= 0 { return errResolutionNotSet } return nil } type clusters struct { namespaces []ClusterNamespace unaggregatedNamespace ClusterNamespace aggregatedNamespaces map[RetentionResolution]ClusterNamespace } // NewClusters instantiates a new Clusters instance. func NewClusters( unaggregatedClusterNamespace UnaggregatedClusterNamespaceDefinition, aggregatedClusterNamespaces ...AggregatedClusterNamespaceDefinition, ) (Clusters, error) { expectedAggregated := len(aggregatedClusterNamespaces) expectedAll := 1 + expectedAggregated namespaces := make(ClusterNamespaces, 0, expectedAll) aggregatedNamespaces := make(map[RetentionResolution]ClusterNamespace, expectedAggregated) def := unaggregatedClusterNamespace unaggregatedNamespace, err := newUnaggregatedClusterNamespace(def) if err != nil { return nil, err } namespaces = append(namespaces, unaggregatedNamespace) for _, def := range aggregatedClusterNamespaces { namespace, err := newAggregatedClusterNamespace(def) if err != nil { return nil, err } namespaces = append(namespaces, namespace) key := RetentionResolution{ Retention: namespace.Options().Attributes().Retention, Resolution: namespace.Options().Attributes().Resolution, } _, exists := aggregatedNamespaces[key] if exists { return nil, fmt.Errorf("duplicate aggregated namespace exists for: "+ "retention=%s, resolution=%s", key.Retention.String(), key.Resolution.String()) } aggregatedNamespaces[key] = namespace } return &clusters{ namespaces: namespaces, unaggregatedNamespace: unaggregatedNamespace, aggregatedNamespaces: aggregatedNamespaces, }, nil } func (c *clusters) ClusterNamespaces() ClusterNamespaces { return c.namespaces } func (c *clusters) UnaggregatedClusterNamespace() ClusterNamespace { return c.unaggregatedNamespace } func (c *clusters) AggregatedClusterNamespace( attrs RetentionResolution, ) (ClusterNamespace, bool) { namespace, ok := c.aggregatedNamespaces[attrs] return namespace, ok } func (c *clusters) Close() error { var ( wg sync.WaitGroup syncMultiErrs syncMultiErrs uniqueSessions []client.Session ) // Collect unique sessions, some namespaces may share same // client session (same cluster) uniqueSessions = append(uniqueSessions, c.unaggregatedNamespace.Session()) for _, namespace := range c.aggregatedNamespaces { unique := true for _, session := range uniqueSessions { if namespace.Session() == session { unique = false break } } if unique { uniqueSessions = append(uniqueSessions, namespace.Session()) } } for _, session := range uniqueSessions { session := session // Capture for lambda wg.Add(1) go func() { defer wg.Done() err := session.Close() syncMultiErrs.add(err) }() } wg.Wait() return syncMultiErrs.lastError() } type clusterNamespace struct { namespaceID ident.ID options ClusterNamespaceOptions session client.Session } func newUnaggregatedClusterNamespace( def UnaggregatedClusterNamespaceDefinition, ) (ClusterNamespace, error) { if err := def.Validate(); err != nil { return nil, err } ns := def.NamespaceID // Set namespace to NoFinalize to avoid cloning it in write operations ns.NoFinalize() return &clusterNamespace{ namespaceID: ns, options: ClusterNamespaceOptions{ attributes: storage.Attributes{ MetricsType: storage.UnaggregatedMetricsType, Retention: def.Retention, }, }, session: def.Session, }, nil } func newAggregatedClusterNamespace( def AggregatedClusterNamespaceDefinition, ) (ClusterNamespace, error) { if err := def.Validate(); err != nil { return nil, err } ns := def.NamespaceID // Set namespace to NoFinalize to avoid cloning it in write operations ns.NoFinalize() return &clusterNamespace{ namespaceID: ns, options: ClusterNamespaceOptions{ attributes: storage.Attributes{ MetricsType: storage.AggregatedMetricsType, Retention: def.Retention, Resolution: def.Resolution, }, downsample: def.Downsample, }, session: def.Session, }, nil } func (n *clusterNamespace) NamespaceID() ident.ID { return n.namespaceID } func (n *clusterNamespace) Options() ClusterNamespaceOptions { return n.options } func (n *clusterNamespace) Session() client.Session { return n.session } type syncMultiErrs struct { sync.Mutex multiErr xerrors.MultiError } func (errs *syncMultiErrs) add(err error) { errs.Lock() errs.multiErr = errs.multiErr.Add(err) errs.Unlock() } func (errs *syncMultiErrs) lastError() error { errs.Lock() defer errs.Unlock() // TODO: consider taking a debug param when building a syncMultiErrs // which would determine wether to return only the last error message // or the consolidated list of errors. return errs.multiErr.LastError() }
"github.com/m3db/m3/src/x/ident" ) var (
example_test.py
# This example code is in the Public Domain (or CC0 licensed, at your option.) # Unless required by applicable law or agreed to in writing, this # software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR # CONDITIONS OF ANY KIND, either express or implied. # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import os import re import socket import sys from builtins import input from threading import Event, Thread import netifaces import ttfw_idf # ----------- Config ---------- PORT = 3333 INTERFACE = 'eth0' # ------------------------------- def get_my_ip(type): for i in netifaces.ifaddresses(INTERFACE)[type]: return i['addr'].replace('%{}'.format(INTERFACE), '') class TcpServer: def __init__(self, port, family_addr, persist=False):
def __enter__(self): try: self.socket.bind(('', self.port)) except socket.error as e: print('Bind failed:{}'.format(e)) raise self.socket.listen(1) print('Starting server on port={} family_addr={}'.format(self.port, self.family_addr)) self.server_thread = Thread(target=self.run_server) self.server_thread.start() return self def __exit__(self, exc_type, exc_value, traceback): if self.persist: sock = socket.socket(self.family_addr, socket.SOCK_STREAM) sock.connect(('localhost', self.port)) sock.sendall(b'Stop', ) sock.close() self.shutdown.set() self.shutdown.set() self.server_thread.join() self.socket.close() def run_server(self): while not self.shutdown.is_set(): try: conn, address = self.socket.accept() # accept new connection print('Connection from: {}'.format(address)) conn.setblocking(1) data = conn.recv(1024) if not data: return data = data.decode() print('Received data: ' + data) reply = 'OK: ' + data conn.send(reply.encode()) conn.close() except socket.error as e: print('Running server failed:{}'.format(e)) raise if not self.persist: break @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols') def test_examples_protocol_socket_tcpclient(env, extra_data): """ steps: 1. join AP 2. have the board connect to the server 3. send and receive data """ dut1 = env.get_dut('tcp_client', 'examples/protocols/sockets/tcp_client', dut_class=ttfw_idf.ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, 'tcp_client.bin') bin_size = os.path.getsize(binary_file) ttfw_idf.log_performance('tcp_client_bin_size', '{}KB'.format(bin_size // 1024)) # start test dut1.start_app() ipv4 = dut1.expect(re.compile(r' IPv4 address: ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'), timeout=30)[0] ipv6_r = r':'.join((r'[0-9a-fA-F]{4}',) * 8) # expect all 8 octets from IPv6 (assumes it's printed in the long form) ipv6 = dut1.expect(re.compile(r' IPv6 address: ({})'.format(ipv6_r)), timeout=30)[0] print('Connected with IPv4={} and IPv6={}'.format(ipv4, ipv6)) # test IPv4 with TcpServer(PORT, socket.AF_INET): server_ip = get_my_ip(netifaces.AF_INET) print('Connect tcp client to server IP={}'.format(server_ip)) dut1.write(server_ip) dut1.expect(re.compile(r'OK: Message from ESP32')) # test IPv6 with TcpServer(PORT, socket.AF_INET6): server_ip = get_my_ip(netifaces.AF_INET6) print('Connect tcp client to server IP={}'.format(server_ip)) dut1.write(server_ip) dut1.expect(re.compile(r'OK: Message from ESP32')) if __name__ == '__main__': if sys.argv[1:] and sys.argv[1].startswith('IPv'): # if additional arguments provided: # Usage: example_test.py <IPv4|IPv6> family_addr = socket.AF_INET6 if sys.argv[1] == 'IPv6' else socket.AF_INET with TcpServer(PORT, family_addr, persist=True) as s: print(input('Press Enter stop the server...')) else: test_examples_protocol_socket_tcpclient()
self.port = port self.socket = socket.socket(family_addr, socket.SOCK_STREAM) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.settimeout(60.0) self.shutdown = Event() self.persist = persist self.family_addr = family_addr
mod.rs
use std::{ env, fs::File, path::PathBuf, time::{Duration, SystemTime, UNIX_EPOCH}, }; use crate::{Error, Result}; use reqwest::header::CONTENT_TYPE; use serde::{Deserialize, Serialize}; use url::form_urlencoded::Serializer; const GOOGLE_APPLICATION_CREDENTIALS: &str = "GOOGLE_APPLICATION_CREDENTIALS"; const DEFAULT_GRANT_TYPE: &str = "urn:ietf:params:oauth:grant-type:jwt-bearer"; #[derive(Debug, Serialize)] struct Header { alg: String, typ: String, } // https://github.com/golang/oauth2/blob/c85d3e98c914e3a33234ad863dcbff5dbc425bb8/jws/jws.go#L34-L52 #[derive(Debug, Serialize)] struct Claim { iss: String, scope: String, aud: String, exp: u64, iat: u64, } impl Claim { fn new(c: &Credentials, scope: &[String]) -> Claim { let iat = SystemTime::now() .duration_since(UNIX_EPOCH) .expect("system time is before UNIX_EPOCH"); // The access token is available for 1 hour. // https://github.com/golang/oauth2/blob/c85d3e98c914e3a33234ad863dcbff5dbc425bb8/jws/jws.go#L63 let exp = iat + Duration::from_secs(3600); Claim { iss: c.client_email.clone(), scope: scope.join(" "), aud: c.token_uri.clone(), exp: exp.as_secs(), iat: iat.as_secs(), } } } #[derive(Clone, Debug, Serialize, Deserialize)] pub struct
{ #[serde(rename = "type")] typ: String, project_id: String, private_key_id: String, private_key: String, client_email: String, client_id: String, auth_uri: String, token_uri: String, auth_provider_x509_cert_url: String, client_x509_cert_url: String, } impl Credentials { pub fn load() -> Result<Credentials> { let path = env::var_os(GOOGLE_APPLICATION_CREDENTIALS) .map(PathBuf::from) .ok_or_else(|| Error::Kubeconfig("Missing GOOGLE_APPLICATION_CREDENTIALS env".into()))?; let f = File::open(path) .map_err(|e| Error::Kubeconfig(format!("Unable to load credentials file: {}", e)))?; let config = serde_json::from_reader(f) .map_err(|e| Error::Kubeconfig(format!("Unable to parse credentials file: {}", e)))?; Ok(config) } } pub struct CredentialsClient { pub credentials: Credentials, pub client: reqwest::Client, } // https://github.com/golang/oauth2/blob/c85d3e98c914e3a33234ad863dcbff5dbc425bb8/internal/token.go#L61-L66 #[derive(Debug, Serialize, Deserialize)] struct TokenResponse { access_token: Option<String>, token_type: Option<String>, expires_in: Option<i64>, } impl TokenResponse { pub fn into_token(self) -> Token { Token { access_token: self.access_token.unwrap(), token_type: self.token_type.unwrap(), refresh_token: String::new(), expiry: self.expires_in, } } } // https://github.com/golang/oauth2/blob/c85d3e98c914e3a33234ad863dcbff5dbc425bb8/token.go#L31-L55 #[derive(Debug)] pub struct Token { pub access_token: String, pub token_type: String, pub refresh_token: String, pub expiry: Option<i64>, } impl CredentialsClient { pub fn new() -> Result<CredentialsClient> { Ok(CredentialsClient { credentials: Credentials::load()?, client: reqwest::Client::new(), }) } pub async fn request_token(&self, scopes: &[String]) -> Result<Token> { let encoded = jws_encode( &Claim::new(&self.credentials, scopes), &Header { alg: "RS256".to_string(), typ: "JWT".to_string(), }, &self.credentials.private_key, )?; let body = Serializer::new(String::new()) .extend_pairs(vec![ ("grant_type".to_string(), DEFAULT_GRANT_TYPE.to_string()), ("assertion".to_string(), encoded.to_string()), ]) .finish(); let token_response = self .client .post(&self.credentials.token_uri) .body(body) .header(CONTENT_TYPE, "application/x-www-form-urlencoded") .send() .await .map_err(|e| Error::Kubeconfig(format!("Unable to request token: {}", e))) .and_then(|response| { if response.status() != reqwest::StatusCode::OK { Err(Error::Kubeconfig(format!( "Fail to retrieve new credential {:#?}", response ))) } else { Ok(response) } })? .json::<TokenResponse>() .await .map_err(|e| Error::Kubeconfig(format!("Unable to parse request token: {}", e)))?; Ok(token_response.into_token()) } } fn jws_encode(claim: &Claim, header: &Header, private_key: &str) -> Result<String> { let encoded_header = base64_encode(serde_json::to_string(&header).unwrap().as_bytes()); let encoded_claims = base64_encode(serde_json::to_string(&claim).unwrap().as_bytes()); let signature_base = format!("{}.{}", encoded_header, encoded_claims); let signature = sign(&signature_base, private_key)?; let encoded_signature = base64_encode(&signature); Ok(format!("{}.{}", signature_base, encoded_signature)) } #[cfg(feature = "native-tls")] fn sign(signature_base: &str, private_key: &str) -> Result<Vec<u8>> { use openssl::{hash::MessageDigest, pkey::PKey, rsa::Padding, sign::Signer}; let key = PKey::private_key_from_pem(private_key.as_bytes())?; let mut signer = Signer::new(MessageDigest::sha256(), &key)?; signer.set_rsa_padding(Padding::PKCS1)?; signer.update(signature_base.as_bytes())?; Ok(signer.sign_to_vec()?) } #[cfg(feature = "rustls-tls")] fn sign(signature_base: &str, private_key: &str) -> Result<Vec<u8>> { use rustls::{ internal::pemfile, sign::{RSASigningKey, SigningKey}, }; let keys = pemfile::pkcs8_private_keys(&mut private_key.as_bytes()) .map_err(|_| Error::SslError("fail to parse private key".into()))?; let key = keys .get(0) .ok_or_else(|| Error::SslError("no usable private key found to sign with RS256".into()))?; let signing_key = RSASigningKey::new(key).map_err(|_| Error::SslError("fail to make RSA signing key".into()))?; let signer = signing_key .choose_scheme(&[rustls::SignatureScheme::RSA_PKCS1_SHA256]) .ok_or_else(|| Error::SslError("scheme RSA_PKCS1_SHA256 not found into private key".into()))?; signer .sign(signature_base.as_bytes()) .map_err(|e| Error::SslError(format!("{}", e))) } fn base64_encode(bytes: &[u8]) -> String { base64::encode_config(bytes, base64::URL_SAFE) } #[cfg(test)] mod tests { use super::*; #[test] fn test_true() { // generated with // ``` // openssl genpkey -out rsakey.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048 // ``` let private_key = r#"-----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDjT1UyWwk/v2UG BhTEB+8NIL4RW3+u7TSOVP0Qpxf22bhJH9+RqwZPlwzbhYQT1TNXT4fFnARaGWaG EtPV/rlV6o9PcLCMj3y2sOiKBy0qS6/3nYHKlFNPGnesYLTIbk54Orp4OYnSqQ/G zBZbS3IRDsTaOb4D+KaxdPm/I8qN1TEPIDEkDRYtRprbmTQaz3rl0ooKuDCHiWoW I7rG6zGkcGwBZAkwh0XFeklJSwZbC0JK88wolHKWJba6KCO8A2LpskacPB/KP5mQ bnTzIS5xiNMKf9qhLm/HgDzgCL9E8StnZygUmRFKYh4MTzrpfGaoT5Vm+tijlrDi CDE33tuZAgMBAAECggEBANuVDnsngCbJsECCbVr1QxNOdu1zk0ObN3LrXM/Sao72 wVQ6axFfwifuhegl8XHrOb51QHY/geC7utN3qpWFjOoXPbuC47nU/qfI+8oippm+ Jc2wpOnaISRAMC0f+mPIUxtHuExdYOtUj7399vbYSed6eeVJdGqHsBerJXtkis44 uuzlQ6ISMPd3YhxN6S4QbPyw6aaoJG0qYpdHSL/n9r49hA3sKbAQVSOTzM1PMRje 6kB6BPrfmyVavHUXRZG1lU7gD41F8nG0wXOvsFu1XXPeEjw2/uBRanA8rWtAPv02 vBXcBMHpv7ySWCVOXMLWfZmo4GJIjfhtjTasUTSxVAECgYEA+Tvei02NBGWdjOzu xoLvF71oT22Ic862StvmDJYSV/9bs1r8pxGCPs0tkHr/DQoBcmvAComrcEBltkaZ yyKxDdSLrsy1nkL4hPMwJF0gNZAAaj4rMNfadKGOmlhQBcFCBph8kijcGsyYn1Vs 2cGCIZCALofDm4t8oIUpB8+UsYECgYEA6XsYh50+JkpuTknTbciOQJijl0a0oK6X SO9mwoWEtg0+mrR3gL0kjghUObN5p0lhLLyqCBDVeFdaDcWbZXdF/KuSyI48Bube c0EYkCFk1W/39yVb6LqQP6xoPrA/nLB4AuZYSqkZwx+bHH7OBgHaXRh2m2HawU5B pQsM2PVwhhkCgYAonJfTzSw4VjKI/yadVEKPdL6liqycakeMBS8ESAPvMN4JaL8Y niLCBv7wtwoOXt4DfglJ7krwPJ4WSITQ8/Mz1Ll6H0NM6Y7DYzkqA76226MlrMGu 8M1ZCeZJwjAv7+DJYFmUG3JaL5KDDBFznjONMpWgf2DhXKZPJcOc0TdigQKBgGHL 4NN1JsItLRT30WrLteISzXsg76naV54CQR27hYIn/BAbBW9USop/rJ/asFtE3kI5 6FKmknPsyti368ZNdnBGgZ4mDbiqXYUTQDGm+zB3zPqlmGDcPG2fTq7rbkm4lRxJ 1bO4LwVPKM5/wtY7UnbqN0wQaevMVqzF+ySpce+JAoGBAOLkdZrv7+JPfusIlj/H CuNhikh1WMHm6Al0SYBURhUb52hHGEAnpaIxwQrN4PPD4Iboyp0kLsjMtKxlvnBm WpsqFXdkj9GLZt1s1Q/5SW5Twb7gxdR7cXrXOcATivN1/GDdhIHS1NEb3MM7EBXc 9RSM375nLWCP0LDosgKSaq+u -----END PRIVATE KEY----- "#; let msg = "foo bar"; let expected = "h0H_U6SO_i1F7JwzzTBHL1DNTw-YD6jdMul9Uwo_5xB_TmztP9c7T8e5CVY1o5_vMfQ3SZJXZ9liwd7FK8a7NjNumWIWq0_KZvDxMK6D2SSkA8WAz4KsdUU1CNVxM51UYQgYnHpaJvtNmowgzCnahNQQso4hKsYCe7nNKlTiCP1yPzM4MWJYh2cekH1SGqSaOtgvQZz4GrOPG-hhcyMZMk_u-sZ0F3PUFj0-kfbhZPNVpvv4-wI_XA84q85Wech4nsgLbxO9397-whsmGVNlqqo2PwwxASn7dEqtrrvD7mkabf32OqmgJ-xXT_n4m67kvgzC7ausezX7E0zcnBj3RQ==".to_string(); assert_eq!(base64_encode(&sign(&msg, private_key).unwrap()), expected); } }
Credentials
classes_5.js
var searchData= [ ['floatvalue',['FloatValue',['../class_float_value.html',1,'']]], ['function',['Function',['../classerpcgen_1_1_function.html',1,'erpcgen']]], ['functionbase',['FunctionBase',['../classerpcgen_1_1_function_base.html',1,'erpcgen']]],
['functiontype',['FunctionType',['../classerpcgen_1_1_function_type.html',1,'erpcgen']]] ];
tx_record.go
/* * Copyright 2019 The CovenantSQL 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 main import ( "encoding/json" "time" "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" gorp "gopkg.in/gorp.v2" "github.com/CovenantSQL/CovenantSQL/crypto/hash" ) // ExchangeState defines the ethereum tx exchange state. type ExchangeState int16 // ExchangeRefundState defines the ethereum tx exchange refund state. type ExchangeRefundState int16 // TODO(): does not support exchange refund feature now const ( // ExchangeStateDetected defines the state for new tx to exchange for cql Particle. ExchangeStateDetected ExchangeState = iota // ExchangeStateTransferring defines the state for on-going exchange tx. ExchangeStateTransferring // ExchangeStateTransferred defines the state for process exchange tx. ExchangeStateTransferred // ExchangeStateInvalidTxData defines the state for malformed tx with invalid tx data. ExchangeStateInvalidTxData // ExchangeStateFailed defines general exchange process failed state. ExchangeStateFailed ) const ( // ExchangeRefundStateNotAvailable defines not applicable refund state. ExchangeRefundStateNotAvailable ExchangeRefundState = iota // ExchangeRefundStateRefunding defines state for on-going refunding. ExchangeRefundStateRefunding // ExchangeRefundStateRefunded defines state for finished refunding. ExchangeRefundStateRefunded ) // String implements the Stringer interface for exchange state stringify. func (s ExchangeState) String() string { switch s { case ExchangeStateDetected: return "Detected" case ExchangeStateTransferring: return "Transferring" case ExchangeStateTransferred: return "Transferred" case ExchangeStateInvalidTxData: return "InvalidTxData" case ExchangeStateFailed: return "Failed" default: return "Unknown" } } // String implements the Stringer interface for exchange refund state stringify. func (s ExchangeRefundState) String() string { switch s { case ExchangeRefundStateNotAvailable: return "NotAvailable" case ExchangeRefundStateRefunding: return "Refunding" case ExchangeRefundStateRefunded: return "Refunded" default: return "Unknown" } } // TxRecord defines the tx record object of the exchange instance. type TxRecord struct { // eth stuff Hash string `db:"hash"` RawTx []byte `db:"tx"` Tx *types.Transaction `db:"-"` ETHBlockNumber uint64 `db:"eth_block_number"` ETHFromAddr string `db:"eth_from_addr"` ETHToAddr string `db:"eth_to_addr"` ETHAmount uint64 `db:"eth_amount"` // CQL stuff CQLAccount string `db:"cql_account"` CQLAmount uint64 `db:"cql_amount"` CQLTxHash string `db:"cql_tx_hash"` // state State ExchangeState `db:"exchange_state"` IsReverted int8 `db:"is_reverted"` RefundState ExchangeRefundState `db:"exchange_refund_state"` Created int64 `db:"created"` LastUpdate int64 `db:"last_update"` } // PostGet implements gorp.HasPostGet interface. func (r *TxRecord) PostGet(gorp.SqlExecutor) (err error) { return r.Deserialize() } // PreUpdate implements gorp.HasPreUpdate interface. func (r *TxRecord) PreUpdate(gorp.SqlExecutor) (err error) { r.LastUpdate = time.Now().Unix() return r.Serialize() } // PreInsert implements gorp.HasPreInsert interface. func (r *TxRecord) PreInsert(gorp.SqlExecutor) (err error) { r.Created = time.Now().Unix() return r.Serialize() } // Serialize marshal tx object to bytes. func (r *TxRecord) Serialize() (err error) { r.RawTx, err = json.Marshal(r.Tx) return } // Deserialize unmarshal tx bytes to object. func (r *TxRecord) Deserialize() (err error) { err = json.Unmarshal(r.RawTx, &r.Tx) if err != nil { return } return } // UpsertTx add or update tx record to database. func UpsertTx(db *gorp.DbMap, r *TxRecord) (d *TxRecord, err error) { defer func() { var auditErr = err if d != nil && d.State != ExchangeStateDetected { auditErr = errors.New("transaction already processing") } _ = AddAuditRecord(db, &AuditRecord{ Hash: r.Hash, Op: "upsert_tx", Data: r, Error: auditErr.Error(), }) }() err = db.SelectOne(&d, `SELECT * FROM "record" WHERE "hash" = ? LIMIT 1`, r.Hash) if err != nil { // not exists err = db.Insert(r) d = r return } if d.State != ExchangeStateDetected { return } d.Tx = r.Tx d.ETHBlockNumber = r.ETHBlockNumber d.ETHFromAddr = r.ETHFromAddr d.ETHToAddr = r.ETHToAddr d.ETHAmount = r.ETHAmount d.CQLAccount = r.CQLAccount d.CQLAmount = r.CQLAmount d.IsReverted = r.IsReverted return } // InvalidateTx invalidates eth transactions based on block number. func InvalidateTx(db *gorp.DbMap, blkNumber uint64) (err error) { var records []*TxRecord defer func() { for _, r := range records { _ = AddAuditRecord(db, &AuditRecord{ Hash: r.Hash, Op: "chain_reorganize", Data: blkNumber, Error: err.Error(), }) } if len(records) == 0 { _ = AddAuditRecord(db, &AuditRecord{ Op: "chain_reorganize", Data: blkNumber, Error: err.Error(), }) } }() var rawTxs []interface{} rawTxs, err = db.Select(&records, `SELECT * FROM "record" WHERE "is_reverted" = 0 AND "eth_block_number" = ?`, blkNumber) if err != nil { return } for _, r := range records { r.IsReverted = 1 } _, err = db.Update(rawTxs...) return } // GetToProcessTx fetches unprocessed transactions begin before confirmed block number. func GetToProcessTx(db *gorp.DbMap, confirmedBlkNumber uint64) (records []*TxRecord, err error) { _, err = db.Select(&records, `SELECT * FROM "record" WHERE "eth_block_number" <= ? AND "state" = ?`, confirmedBlkNumber, ExchangeStateDetected) return } // GetTransferringTx returns the transactions in transferring state. func GetTransferringTx(db *gorp.DbMap) (records []*TxRecord, err error) { _, err = db.Select(&records, `SELECT * FROM "record" WHERE "state" = ?`, ExchangeStateTransferring) return } // SetTxToTransferring update the transaction to transferring state. func
(db *gorp.DbMap, r *TxRecord, tx hash.Hash) (err error) { r.CQLTxHash = tx.String() r.State = ExchangeStateTransferring _, err = db.Update(r) return } // SetTxConfirmed update the transaction to confirmed state. func SetTxConfirmed(db *gorp.DbMap, r *TxRecord) (err error) { r.State = ExchangeStateTransferred _, err = db.Update(r) return }
SetTxToTransferring
DescribeIdcOverviewRequest.py
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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. # # NOTE: This class is auto generated by the jdcloud code generator program. from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest class DescribeIdcOverviewRequest(JDCloudRequest): """ 查询机房资源概览 """ def __init__(self, p
s, header=None, version="v1"): super(DescribeIdcOverviewRequest, self).__init__( '/idcs/{idc}/overview', 'GET', header, version) self.parameters = parameters class DescribeIdcOverviewParameters(object): def __init__(self, idc, ): """ :param idc: IDC机房ID """ self.idc = idc
arameter
loss.py
import torch import librosa import numpy as np import torch.nn.functional as F from hparams import hparams as hps from utils.util import to_arr, mode class Loss(torch.nn.Module): def __init__(self): super(Loss, self).__init__() self.d = 2*hps.sigma*hps.sigma self.loss = MultiResolutionSTFTLoss(hps.fft_sizes, hps.hop_sizes, hps.win_lengths, hps.mel_scales) def forward(self, model_output, p_wavs = None, r_wavs = None): # zloss z, log_s_list, log_w_list = model_output log_s_total = 0 log_w_total = 0 for i, log_s in enumerate(log_s_list): log_s_total += torch.sum(log_s) log_w_total += torch.sum(log_w_list[i]) zloss = torch.sum(z*z)/self.d-log_s_total-log_w_total zloss /= (z.size(0)*z.size(1)*z.size(2)) # sloss sloss = self.loss(p_wavs, r_wavs) if p_wavs is not None else 0*zloss return zloss+sloss, zloss, sloss class MultiResolutionSTFTLoss(torch.nn.Module): # ref: https://github.com/kan-bayashi/ParallelWaveGAN """Multi resolution STFT loss module.""" def __init__(self, fft_sizes=[1024, 2048, 512], hop_sizes=[120, 240, 50], win_lengths=[600, 1200, 240], mel_scales=[1, 1, 1], window="hann_window"): """Initialize Multi resolution STFT loss module. Args: fft_sizes (list): List of FFT sizes. hop_sizes (list): List of hop sizes. win_lengths (list): List of window lengths. window (str): Window function type. """ super(MultiResolutionSTFTLoss, self).__init__() assert len(fft_sizes) == len(hop_sizes) == len(win_lengths) self.stft_losses = torch.nn.ModuleList() self.bases = [] for fs, ss, wl, sc in zip(fft_sizes, hop_sizes, win_lengths, mel_scales): self.stft_losses += [STFTLoss(fs, ss, wl, window)] b = librosa.filters.mel(hps.sample_rate, fs, n_mels = hps.num_mels*sc, fmax = hps.fmax).T self.bases += [mode(torch.Tensor(b))] def forward(self, x, y): """Calculate forward propagation. Args: x (Tensor): Predicted signal (B, T). y (Tensor): Groundtruth signal (B, T). Returns: Tensor: Multi resolution spectral convergence loss value. Tensor: Multi resolution log spectral loss value. """ sc_loss = 0.0 spec_loss = 0.0 for f, b in zip(self.stft_losses, self.bases): sc_l, spec_l = f(x, y, b) sc_loss += sc_l spec_loss += spec_l sc_loss /= len(self.stft_losses) spec_loss /= len(self.stft_losses) return sc_loss+spec_loss class STFTLoss(torch.nn.Module): """STFT loss module.""" def __init__(self, fft_size=1024, shift_size=120, win_length=600, window="hann_window"): """Initialize STFT loss module.""" super(STFTLoss, self).__init__() self.fft_size = fft_size self.shift_size = shift_size self.win_length = win_length self.window = mode(getattr(torch, window)(win_length)) def forward(self, x, y, b): """Calculate forward propagation. Args: x (Tensor): Predicted signal (B, T). y (Tensor): Groundtruth signal (B, T). b (Tensor): Mel basis (fft_size//2+1, num_mels). Returns: Tensor: Spectral convergence loss value. Tensor: Log STFT magnitude loss value. """ x_mag, x_mel = stft(x, self.fft_size, self.shift_size, self.win_length, self.window, b) y_mag, y_mel = stft(y, self.fft_size, self.shift_size, self.win_length, self.window, b) sc_loss = spec_loss = 0 if hps.mag: h = x_mag.size(2)*2*hps.fmax//hps.sample_rate if hps.sample_rate >= 2*hps.fmax else x_mag.size(2) x_mag_ = x_mag[:, :, :h] y_mag_ = y_mag[:, :, :h] sc_loss += torch.norm((y_mag_-x_mag_), p = "fro")/torch.norm(y_mag_, p = "fro") spec_loss += torch.nn.L1Loss()(torch.log(x_mag_), torch.log(y_mag_)) if h < x_mag.size(2): x_mag_m = x_mag[:, :, h:].mean(1) y_mag_m = y_mag[:, :, h:].mean(1) sc_loss += torch.norm((y_mag_m-x_mag_m), p = "fro")/torch.norm(y_mag_m, p = "fro") spec_loss += torch.nn.L1Loss()(torch.log(x_mag_m), torch.log(y_mag_m)) if hps.mel: sc_loss += torch.norm((y_mel-x_mel), p = "fro")/torch.norm(y_mel, p = "fro") spec_loss += torch.nn.L1Loss()(torch.log(x_mel), torch.log(y_mel)) s = int(hps.mag)+int(hps.mel) if s == 0: print('Error: hps.mag and hps.mel are both set as False.') exit() return sc_loss/s, spec_loss/s
def stft(x, fft_size, hop_size, win_length, window, b): """Perform STFT and convert to magnitude spectrogram. Args: x (Tensor): Input signal tensor (B, T). fft_size (int): FFT size. hop_size (int): Hop size. win_length (int): Window length. window (str): Window function type. b (Tensor): Mel basis (fft_size//2+1, num_mels). Returns: Tensor: Magnitude spectrogram (B, #frames, fft_size // 2 + 1). """ x_stft = torch.stft(x, fft_size, hop_size, win_length, window) real = x_stft[..., 0] imag = x_stft[..., 1] # NOTE(kan-bayashi): clamp is needed to avoid nan or inf mag = torch.sqrt(torch.clamp(real ** 2 + imag ** 2, min=1e-7)).transpose(2, 1) return mag, torch.clamp(torch.matmul(mag, b), min = 1e-7**0.5)
main.ts
// Copyright 2018 Ryan Dahl <[email protected]> // All rights reserved. MIT License. // This allows us to have async/await in our code. It must be loaded first. import "babel-polyfill"; import * as dispatch from "./dispatch"; import { deno as pb } from "./msg.pb"; import * as runtime from "./runtime"; import * as util from "./util"; import { initTimers } from "./timers"; import { initFetch } from "./fetch"; // To control internal logging output // Set with the -debug command-line flag. export let debug = false; let startCalled = false; // denoMain is needed to allow hooks into the system. // Also eventual snapshot support needs it. // tslint:disable-next-line:no-any (window as any)["denoMain"] = () => { // tslint:disable-next-line:no-any delete (window as any)["denoMain"]; initTimers(); initFetch();
if (startCalled) { throw Error("start message received more than once!"); } startCalled = true; const msg = pb.Msg.decode(payload); const { startCwd: cwd, startArgv: argv, startDebugFlag: debugFlag, startMainJs: mainJs, startMainMap: mainMap } = msg; debug = debugFlag; util.log("start", { cwd, argv, debugFlag }); runtime.setup(mainJs, mainMap); const inputFn = argv[0]; const mod = runtime.resolveModule(inputFn, `${cwd}/`); mod.compileAndRun(); }); };
dispatch.sub("start", (payload: Uint8Array) => {
Composer.js
import { Platform, StyleSheet, } from 'react-native'; const styles = StyleSheet.create({ textInput: {
flex: 1, marginLeft: 10, fontSize: 16, lineHeight: 16, marginTop: Platform.select({ ios: 6, android: 0, }), marginBottom: Platform.select({ ios: 5, android: 3, }), }, }); export default styles
main.go
/* URL: https://atcoder.jp/contests/joi2021yo1a/tasks/joi2021_yo1a_b */ package main import ( "bufio" "errors" "fmt" "io" "math" "os" "strconv" ) var ( n int S []rune memo map[rune]int ) func main() { defer stdout.Flush() n = readi() S = readrs() memo = make(map[rune]int) for _, r := range S { memo[r]++ } J := memo['J'] O := memo['O'] I := memo['I'] ans := []rune{} for i := 0; i < J; i++ { ans = append(ans, 'J') } for i := 0; i < O; i++ { ans = append(ans, 'O') } for i := 0; i < I; i++ { ans = append(ans, 'I') } fmt.Println(string(ans)) } /*******************************************************************/ /********** common constants **********/ const ( MOD = 1000000000 + 7 // MOD = 998244353 ALPH_N = 26 INF_I64 = math.MaxInt64 INF_B60 = 1 << 60 INF_I32 = math.MaxInt32 INF_B30 = 1 << 30 NIL = -1 EPS = 1e-10 ) /********** bufio setting **********/ func init() { // bufio.ScanWords <---> bufio.ScanLines reads = newReadString(os.Stdin, bufio.ScanWords) stdout = bufio.NewWriter(os.Stdout) } // mod can calculate a right residual whether value is positive or negative. func mod(val, m int) int { res := val % m if res < 0 { res += m } return res } // min returns the min integer among input set. // This function needs at least 1 argument (no argument causes panic). func min(integers ...int) int { m := integers[0] for i, integer := range integers { if i == 0 { continue } if m > integer { m = integer } } return m } // max returns the max integer among input set. // This function needs at least 1 argument (no argument causes panic). func max(integers ...int) int { m := integers[0] for i, integer := range integers { if i == 0 { continue } if m < integer { m = integer } } return m } // chmin accepts a pointer of integer and a target value. // If target value is SMALLER than the first argument, // then the first argument will be updated by the second argument. func chmin(updatedValue *int, target int) bool { if *updatedValue > target { *updatedValue = target return true } return false } // chmax accepts a pointer of integer and a target value. // If target value is LARGER than the first argument, // then the first argument will be updated by the second argument. func chmax(updatedValue *int, target int) bool { if *updatedValue < target { *updatedValue = target return true } return false } // sum returns multiple integers sum. func sum(integers ...int) int { var s int s = 0 for _, i := range integers { s += i } return s } // abs is integer version of math.Abs func abs(a int) int { if a < 0 { return -a } return a } // pow is integer version of math.Pow // pow calculate a power by Binary Power (二分累乗法(O(log e))). func pow(a, e int) int { if a < 0 || e < 0 { panic(errors.New("[argument error]: PowInt does not accept negative integers")) } if e == 0 { return 1 } if e%2 == 0 { halfE := e / 2 half := pow(a, halfE)
return a * pow(a, e-1) } /********** FAU standard libraries **********/ //fmt.Sprintf("%b\n", 255) // binary expression /********** I/O usage **********/ //str := reads() //i := readi() //X := readis(n) //S := readrs() //a := readf() //A := readfs(n) //str := ZeroPaddingRuneSlice(num, 32) //str := PrintIntsLine(X...) /*********** Input ***********/ var ( // reads returns a WORD string. reads func() string stdout *bufio.Writer ) func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string { r := bufio.NewScanner(ior) r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces r.Split(sf) return func() string { if !r.Scan() { panic("Scan failed") } return r.Text() } } // readi returns an integer. func readi() int { return int(_readInt64()) } func readi2() (int, int) { return int(_readInt64()), int(_readInt64()) } func readi3() (int, int, int) { return int(_readInt64()), int(_readInt64()), int(_readInt64()) } func readi4() (int, int, int, int) { return int(_readInt64()), int(_readInt64()), int(_readInt64()), int(_readInt64()) } // readll returns as integer as int64. func readll() int64 { return _readInt64() } func readll2() (int64, int64) { return _readInt64(), _readInt64() } func readll3() (int64, int64, int64) { return _readInt64(), _readInt64(), _readInt64() } func readll4() (int64, int64, int64, int64) { return _readInt64(), _readInt64(), _readInt64(), _readInt64() } func _readInt64() int64 { i, err := strconv.ParseInt(reads(), 0, 64) if err != nil { panic(err.Error()) } return i } // readis returns an integer slice that has n integers. func readis(n int) []int { b := make([]int, n) for i := 0; i < n; i++ { b[i] = readi() } return b } // readlls returns as int64 slice that has n integers. func readlls(n int) []int64 { b := make([]int64, n) for i := 0; i < n; i++ { b[i] = readll() } return b } // readf returns an float64. func readf() float64 { return float64(_readFloat64()) } func _readFloat64() float64 { f, err := strconv.ParseFloat(reads(), 64) if err != nil { panic(err.Error()) } return f } // ReadFloatSlice returns an float64 slice that has n float64. func readfs(n int) []float64 { b := make([]float64, n) for i := 0; i < n; i++ { b[i] = readf() } return b } // readrs returns a rune slice. func readrs() []rune { return []rune(reads()) } /*********** Output ***********/ // PrintIntsLine returns integers string delimited by a space. func PrintIntsLine(A ...int) string { res := []rune{} for i := 0; i < len(A); i++ { str := strconv.Itoa(A[i]) res = append(res, []rune(str)...) if i != len(A)-1 { res = append(res, ' ') } } return string(res) } // PrintIntsLine returns integers string delimited by a space. func PrintInts64Line(A ...int64) string { res := []rune{} for i := 0; i < len(A); i++ { str := strconv.FormatInt(A[i], 10) // 64bit int version res = append(res, []rune(str)...) if i != len(A)-1 { res = append(res, ' ') } } return string(res) } // Printf is function for output strings to buffered os.Stdout. // You may have to call stdout.Flush() finally. func printf(format string, a ...interface{}) { fmt.Fprintf(stdout, format, a...) } /*********** Debugging ***********/ // debugf is wrapper of fmt.Fprintf(os.Stderr, format, a...) func debugf(format string, a ...interface{}) { fmt.Fprintf(os.Stderr, format, a...) } // ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding. // For debugging use. func ZeroPaddingRuneSlice(n, digitsNum int) []rune { sn := fmt.Sprintf("%b", n) residualLength := digitsNum - len(sn) if residualLength <= 0 { return []rune(sn) } zeros := make([]rune, residualLength) for i := 0; i < len(zeros); i++ { zeros[i] = '0' } res := []rune{} res = append(res, zeros...) res = append(res, []rune(sn)...) return res }
return half * half }
index.ts
/** * Copyright 2019 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://www.apache.org/licenses/LICENSE-2.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, express or implied. See the License for the specific language governing permissions * and limitations under the License. */ import * as cloudfront from '@aws-cdk/aws-cloudfront'; import * as s3 from '@aws-cdk/aws-s3'; import { Construct } from '@aws-cdk/core'; import * as defaults from '@aws-solutions-constructs/core'; /** * @summary The properties for the CloudFrontToS3 Construct */ export interface CloudFrontToS3Props { /** * Whether to create a S3 Bucket or use an existing S3 Bucket. * If set to false, you must provide S3 Bucket as `existingBucketObj` * * @default - true */ readonly deployBucket?: boolean, /** * Existing instance of S3 Bucket object. * If `deployBucket` is set to false only then this property is required * * @default - None */ readonly existingBucketObj?: s3.Bucket, /** * Optional user provided props to override the default props. * If `deploy` is set to true only then this property is required * * @default - Default props are used */ readonly bucketProps?: s3.BucketProps, /** * Optional user provided props to override the default props * * @default - Default props are used */ readonly cloudFrontDistributionProps?: cloudfront.CloudFrontWebDistributionProps | any, /** * Optional user provided props to turn on/off the automatic injection of best practice HTTP * security headers in all responses from cloudfront * * @default - true */ readonly insertHttpSecurityHeaders?: boolean; } export class
extends Construct { public readonly cloudFrontWebDistribution: cloudfront.CloudFrontWebDistribution; public readonly s3Bucket: s3.Bucket; /** * @summary Constructs a new instance of the CloudFrontToS3 class. * @param {cdk.App} scope - represents the scope for all the resources. * @param {string} id - this is a a scope-unique id. * @param {CloudFrontToS3Props} props - user provided props for the construct * @since 0.8.0 * @access public */ constructor(scope: Construct, id: string, props: CloudFrontToS3Props) { super(scope, id); this.s3Bucket = defaults.buildS3Bucket(this, { deployBucket: props.deployBucket, existingBucketObj: props.existingBucketObj, bucketProps: props.bucketProps }); this.cloudFrontWebDistribution = defaults.CloudFrontDistributionForS3(this, this.s3Bucket, props.cloudFrontDistributionProps, props.insertHttpSecurityHeaders); } }
CloudFrontToS3
node_label_test.go
/* Copyright 2016 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 priorities import ( "reflect" "sort" "testing" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" schedulerapi "k8s.io/kubernetes/pkg/scheduler/api" schedulercache "k8s.io/kubernetes/pkg/scheduler/cache" ) func TestNewNodeLabelPriority(t *testing.T) { label1 := map[string]string{"foo": "bar"} label2 := map[string]string{"bar": "foo"} label3 := map[string]string{"bar": "baz"} tests := []struct { nodes []*v1.Node label string presence bool expectedList schedulerapi.HostPriorityList name string }{ { nodes: []*v1.Node{ {ObjectMeta: metav1.ObjectMeta{Name: "machine1", Labels: label1}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine2", Labels: label2}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine3", Labels: label3}}, }, expectedList: []schedulerapi.HostPriority{{Host: "machine1", Score: 0}, {Host: "machine2", Score: 0}, {Host: "machine3", Score: 0}}, label: "baz", presence: true, name: "no match found, presence true", }, { nodes: []*v1.Node{ {ObjectMeta: metav1.ObjectMeta{Name: "machine1", Labels: label1}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine2", Labels: label2}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine3", Labels: label3}}, }, expectedList: []schedulerapi.HostPriority{{Host: "machine1", Score: schedulerapi.MaxPriority}, {Host: "machine2", Score: schedulerapi.MaxPriority}, {Host: "machine3", Score: schedulerapi.MaxPriority}}, label: "baz", presence: false, name: "no match found, presence false", },
{ObjectMeta: metav1.ObjectMeta{Name: "machine1", Labels: label1}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine2", Labels: label2}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine3", Labels: label3}}, }, expectedList: []schedulerapi.HostPriority{{Host: "machine1", Score: schedulerapi.MaxPriority}, {Host: "machine2", Score: 0}, {Host: "machine3", Score: 0}}, label: "foo", presence: true, name: "one match found, presence true", }, { nodes: []*v1.Node{ {ObjectMeta: metav1.ObjectMeta{Name: "machine1", Labels: label1}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine2", Labels: label2}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine3", Labels: label3}}, }, expectedList: []schedulerapi.HostPriority{{Host: "machine1", Score: 0}, {Host: "machine2", Score: schedulerapi.MaxPriority}, {Host: "machine3", Score: schedulerapi.MaxPriority}}, label: "foo", presence: false, name: "one match found, presence false", }, { nodes: []*v1.Node{ {ObjectMeta: metav1.ObjectMeta{Name: "machine1", Labels: label1}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine2", Labels: label2}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine3", Labels: label3}}, }, expectedList: []schedulerapi.HostPriority{{Host: "machine1", Score: 0}, {Host: "machine2", Score: schedulerapi.MaxPriority}, {Host: "machine3", Score: schedulerapi.MaxPriority}}, label: "bar", presence: true, name: "two matches found, presence true", }, { nodes: []*v1.Node{ {ObjectMeta: metav1.ObjectMeta{Name: "machine1", Labels: label1}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine2", Labels: label2}}, {ObjectMeta: metav1.ObjectMeta{Name: "machine3", Labels: label3}}, }, expectedList: []schedulerapi.HostPriority{{Host: "machine1", Score: schedulerapi.MaxPriority}, {Host: "machine2", Score: 0}, {Host: "machine3", Score: 0}}, label: "bar", presence: false, name: "two matches found, presence false", }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { nodeNameToInfo := schedulercache.CreateNodeNameToInfoMap(nil, test.nodes) labelPrioritizer := &NodeLabelPrioritizer{ label: test.label, presence: test.presence, } list, err := priorityFunction(labelPrioritizer.CalculateNodeLabelPriorityMap, nil, nil)(nil, nodeNameToInfo, test.nodes) if err != nil { t.Errorf("unexpected error: %v", err) } // sort the two lists to avoid failures on account of different ordering sort.Sort(test.expectedList) sort.Sort(list) if !reflect.DeepEqual(test.expectedList, list) { t.Errorf("expected %#v, got %#v", test.expectedList, list) } }) } }
{ nodes: []*v1.Node{
b0.rs
#[doc = "Reader of register B0"] pub type R = crate::R<u32, super::B0>; #[doc = "Writer for register B0"] pub type W = crate::W<u32, super::B0>; #[doc = "Register B0 `reset()`'s with value 0x3fcc"] impl crate::ResetValue for super::B0 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0x3fcc } } #[doc = "Reader of field `B0`"] pub type B0_R = crate::R<u16, u16>; #[doc = "Write proxy for field `B0`"] pub struct B0_W<'a> { w: &'a mut W, } impl<'a> B0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W
} impl R { #[doc = "Bits 0:13 - y-intercept of 1st piece wise linear function"] #[inline(always)] pub fn b0(&self) -> B0_R { B0_R::new((self.bits & 0x3fff) as u16) } } impl W { #[doc = "Bits 0:13 - y-intercept of 1st piece wise linear function"] #[inline(always)] pub fn b0(&mut self) -> B0_W { B0_W { w: self } } }
{ self.w.bits = (self.w.bits & !0x3fff) | ((value as u32) & 0x3fff); self.w }
lib.rs
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use napi::{ threadsafe_function::{ErrorStrategy, ThreadsafeFunction, ThreadsafeFunctionCallMode}, Error, JsFunction, Result, Status, }; #[napi_derive::napi] pub fn run(args: Vec<String>, bin_name: Option<String>, callback: JsFunction) -> Result<()>
{ let function: ThreadsafeFunction<bool, ErrorStrategy::CalleeHandled> = callback .create_threadsafe_function(0, |ctx| ctx.env.get_boolean(ctx.value).map(|v| vec![v]))?; std::thread::spawn(move || match tauri_cli::run(args, bin_name) { Ok(_) => function.call(Ok(true), ThreadsafeFunctionCallMode::Blocking), Err(e) => function.call( Err(Error::new(Status::GenericFailure, format!("{:#}", e))), ThreadsafeFunctionCallMode::Blocking, ), }); Ok(()) }
flexItemStyles.ts
import { ComponentSlotStylesPrepared } from '@fluentui/styles'; import { FlexItemProps } from '../../../../components/Flex/FlexItem'; import { toFlexAlignment, toFlexItemSizeValues } from './utils'; import { FlexItemVariables } from './flexItemVariables'; const flexItemStyles: ComponentSlotStylesPrepared<FlexItemProps, FlexItemVariables> = { root: ({ props: p, variables: v }) => { return { ...(p.align && { alignSelf: toFlexAlignment(p.align) }), ...(p.size && toFlexItemSizeValues(v.hasOwnProperty(p.size) ? v[p.size] : p.size)),
...(p.shrink === false && { flexShrink: 0 }), ...(p.grow && { flexGrow: p.grow }), ...(p.grow === true && { flexGrow: 1 }), ...(p.push && (p.flexDirection === 'column' ? { marginTop: 'auto' } : { marginLeft: 'auto' })) }; } }; export default flexItemStyles;
...(typeof p.shrink === 'number' && { flexShrink: p.shrink }),
groups.go
package rpc import ( "golang.org/x/net/context" "github.com/coreos/matchbox/matchbox/rpc/rpcpb" "github.com/coreos/matchbox/matchbox/server" pb "github.com/coreos/matchbox/matchbox/server/serverpb" ) // groupServer takes a matchbox Server and implements a gRPC GroupsServer. type groupServer struct { srv server.Server } func
(s server.Server) rpcpb.GroupsServer { return &groupServer{ srv: s, } } func (s *groupServer) GroupPut(ctx context.Context, req *pb.GroupPutRequest) (*pb.GroupPutResponse, error) { _, err := s.srv.GroupPut(ctx, req) return &pb.GroupPutResponse{}, grpcError(err) } func (s *groupServer) GroupGet(ctx context.Context, req *pb.GroupGetRequest) (*pb.GroupGetResponse, error) { group, err := s.srv.GroupGet(ctx, req) return &pb.GroupGetResponse{Group: group}, grpcError(err) } func (s *groupServer) GroupList(ctx context.Context, req *pb.GroupListRequest) (*pb.GroupListResponse, error) { groups, err := s.srv.GroupList(ctx, req) return &pb.GroupListResponse{Groups: groups}, grpcError(err) }
newGroupServer
grade.js
import request from '@/utils/request' export function addGrade(params) { return request({ url: '/api/grade/addGrade', method: 'post', data: { major: params.major, // 专业 account: params.account, // 账号 fullname: params.fullname, // 姓名 subject: params.subject, // 科目 grade: params.grade, // 成绩 semester: params.semester, // 学期 year: params.year, // 学年 l_id: params.l_id, // 学年 classes: params.classes // 班级 } }) } export function updateGrade(params) { return reque
l: '/api/grade/updateGrade', method: 'post', data: { _id: params._id, // 登录id subject: params.subject, // 登录id grade: params.grade // 成绩 } }) } export function getGrade(params) { return request({ url: '/api/grade/getGrade', method: 'post', data: { l_id: params.l_id // 登录id } }) } export function delGrade(params) { return request({ url: '/api/grade/delGrade', method: 'post', data: { _id: params._id // 成绩id } }) }
st({ ur
statistics_keys_extended.py
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 6 Contact: [email protected] Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from isi_sdk_8_1_1.models.statistics_key import StatisticsKey # noqa: F401,E501 from isi_sdk_8_1_1.models.statistics_keys import StatisticsKeys # noqa: F401,E501 class StatisticsKeysExtended(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'keys': 'list[StatisticsKey]', 'resume': 'str', 'total': 'int' } attribute_map = { 'keys': 'keys', 'resume': 'resume', 'total': 'total' } def __init__(self, keys=None, resume=None, total=None): # noqa: E501 """StatisticsKeysExtended - a model defined in Swagger""" # noqa: E501 self._keys = None self._resume = None self._total = None self.discriminator = None if keys is not None: self.keys = keys if resume is not None: self.resume = resume if total is not None: self.total = total @property def keys(self): """Gets the keys of this StatisticsKeysExtended. # noqa: E501 :return: The keys of this StatisticsKeysExtended. # noqa: E501 :rtype: list[StatisticsKey] """ return self._keys @keys.setter def keys(self, keys):
@property def resume(self): """Gets the resume of this StatisticsKeysExtended. # noqa: E501 Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options). # noqa: E501 :return: The resume of this StatisticsKeysExtended. # noqa: E501 :rtype: str """ return self._resume @resume.setter def resume(self, resume): """Sets the resume of this StatisticsKeysExtended. Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options). # noqa: E501 :param resume: The resume of this StatisticsKeysExtended. # noqa: E501 :type: str """ if resume is not None and len(resume) < 0: raise ValueError("Invalid value for `resume`, length must be greater than or equal to `0`") # noqa: E501 self._resume = resume @property def total(self): """Gets the total of this StatisticsKeysExtended. # noqa: E501 Total number of items available. # noqa: E501 :return: The total of this StatisticsKeysExtended. # noqa: E501 :rtype: int """ return self._total @total.setter def total(self, total): """Sets the total of this StatisticsKeysExtended. Total number of items available. # noqa: E501 :param total: The total of this StatisticsKeysExtended. # noqa: E501 :type: int """ if total is not None and total > 4294967295: # noqa: E501 raise ValueError("Invalid value for `total`, must be a value less than or equal to `4294967295`") # noqa: E501 if total is not None and total < 0: # noqa: E501 raise ValueError("Invalid value for `total`, must be a value greater than or equal to `0`") # noqa: E501 self._total = total def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, StatisticsKeysExtended): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
"""Sets the keys of this StatisticsKeysExtended. :param keys: The keys of this StatisticsKeysExtended. # noqa: E501 :type: list[StatisticsKey] """ self._keys = keys
__init__.py
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # """ Userbot initialization. """ import os from sys import version_info from logging import basicConfig, getLogger, INFO, DEBUG from distutils.util import strtobool as sb from pylast import LastFMNetwork, md5 from pySmartDL import SmartDL from dotenv import load_dotenv from requests import get from telethon import TelegramClient from telethon.sessions import StringSession load_dotenv("config.env") # Bot Logs setup: CONSOLE_LOGGER_VERBOSE = sb(os.environ.get("CONSOLE_LOGGER_VERBOSE", "False")) if CONSOLE_LOGGER_VERBOSE: basicConfig( format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=DEBUG, ) else: basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=INFO) LOGS = getLogger(__name__) if version_info[0] < 3 or version_info[1] < 6: LOGS.info("You MUST have a python version of at least 3.6." "Multiple features depend on this. Bot quitting.") quit(1) # Check if the config was edited by using the already used variable. # Basically, its the 'virginity check' for the config file ;) CONFIG_CHECK = os.environ.get( "___________PLOX_______REMOVE_____THIS_____LINE__________", None) if CONFIG_CHECK: LOGS.info( "Please remove the line mentioned in the first hashtag from the config.env file" ) quit(1) # Telegram App KEY and HASH API_KEY = os.environ.get("API_KEY", None) API_HASH = os.environ.get("API_HASH", None) # Userbot Session String STRING_SESSION = os.environ.get("STRING_SESSION", None) # Logging channel/group ID configuration. BOTLOG_CHATID = int(os.environ.get("BOTLOG_CHATID", None)) # Userbot logging feature switch. BOTLOG = sb(os.environ.get("BOTLOG", "False")) LOGSPAMMER = sb(os.environ.get("LOGSPAMMER", "False")) # Bleep Blop, this is a bot ;) PM_AUTO_BAN = sb(os.environ.get("PM_AUTO_BAN", "False")) # Console verbose logging CONSOLE_LOGGER_VERBOSE = sb(os.environ.get("CONSOLE_LOGGER_VERBOSE", "False")) # SQL Database URI DB_URI = os.environ.get("DATABASE_URL", None) # OCR API key OCR_SPACE_API_KEY = os.environ.get("OCR_SPACE_API_KEY", None) # remove.bg API key REM_BG_API_KEY = os.environ.get("REM_BG_API_KEY", None) # Chrome Driver and Headless Google Chrome Binaries CHROME_DRIVER = os.environ.get("CHROME_DRIVER", None) GOOGLE_CHROME_BIN = os.environ.get("GOOGLE_CHROME_BIN", None) # OpenWeatherMap API Key OPEN_WEATHER_MAP_APPID = os.environ.get("OPEN_WEATHER_MAP_APPID", None) WEATHER_DEFCITY = os.environ.get("WEATHER_DEFCITY", None) # Anti Spambot Config ANTI_SPAMBOT = sb(os.environ.get("ANTI_SPAMBOT", "False")) ANTI_SPAMBOT_SHOUT = sb(os.environ.get("ANTI_SPAMBOT_SHOUT", "False")) # Youtube API key YOUTUBE_API_KEY = os.environ.get("YOUTUBE_API_KEY", None) # Default .alive name ALIVE_NAME = os.environ.get("ALIVE_NAME", None) # Time & Date - Country and Time Zone COUNTRY = str(os.environ.get("COUNTRY", "")) TZ_NUMBER = int(os.environ.get("TZ_NUMBER", 1)) # Clean Welcome CLEAN_WELCOME = sb(os.environ.get("CLEAN_WELCOME", "True")) # Last.fm Module BIO_PREFIX = os.environ.get("BIO_PREFIX", None) DEFAULT_BIO = os.environ.get("DEFAULT_BIO", None) LASTFM_API = os.environ.get("LASTFM_API", None) LASTFM_SECRET = os.environ.get("LASTFM_SECRET", None) LASTFM_USERNAME = os.environ.get("LASTFM_USERNAME", None) LASTFM_PASSWORD_PLAIN = os.environ.get("LASTFM_PASSWORD", None) if LASTFM_API and LASTFM_SECRET and LASTFM_USERNAME and LASTFM_PASSWORD_PLAIN: LASTFM_PASS = md5(LASTFM_PASSWORD_PLAIN) lastfm = LastFMNetwork(api_key=LASTFM_API, api_secret=LASTFM_SECRET, username=LASTFM_USERNAME, password_hash=LASTFM_PASS) else: lastfm = None # Google Drive Module configuration. G_DRIVE_CLIENT_ID = os.environ.get("G_DRIVE_CLIENT_ID", None) G_DRIVE_CLIENT_SECRET = os.environ.get("G_DRIVE_CLIENT_SECRET", None) G_DRIVE_AUTH_TOKEN_DATA = os.environ.get("G_DRIVE_AUTH_TOKEN_DATA", None) GDRIVE_FOLDER_ID = os.environ.get("GDRIVE_FOLDER_ID", None) # Directory to save downloaded stuff, for many modules. TEMP_DOWNLOAD_DIRECTORY = os.environ.get("TMP_DOWNLOAD_DIRECTORY", "./downloads") # Setting Up CloudMail.ru and MEGA.nz extractor binaries, # and giving them correct perms to work properly. if not os.path.exists('bin'): os.mkdir('bin') binaries = { "https://raw.githubusercontent.com/yshalsager/megadown/master/megadown": "bin/megadown", "https://raw.githubusercontent.com/yshalsager/cmrudl.py/master/cmrudl.py": "bin/cmrudl" } for binary, path in binaries.items(): downloader = SmartDL(binary, path, progress_bar=False) downloader.start() os.chmod(path, 0o755) # 'bot' variable if STRING_SESSION: # pylint: disable=invalid-name bot = TelegramClient(StringSession(STRING_SESSION), API_KEY, API_HASH, timeout=5, retry_delay=5) else: # pylint: disable=invalid-name bot = TelegramClient("userbot", API_KEY, API_HASH, timeout=5, retry_delay=5) async def check_botlog_chatid(): if not BOTLOG_CHATID and LOGSPAMMER: LOGS.info( "You must set up the BOTLOG_CHATID variable in the config.env or environment variables, for the private error log storage to work." ) quit(1)
elif not BOTLOG_CHATID and BOTLOG: LOGS.info( "You must set up the BOTLOG_CHATID variable in the config.env or environment variables, for the userbot logging feature to work." ) quit(1) elif not BOTLOG or not LOGSPAMMER: return entity = await bot.get_entity(BOTLOG_CHATID) if entity.default_banned_rights.send_messages: LOGS.info( "Your account doesn't have rights to send messages to BOTLOG_CHATID " "group. Check if you typed the Chat ID correctly.") quit(1) with bot: try: bot.loop.run_until_complete(check_botlog_chatid()) except: LOGS.info( "BOTLOG_CHATID environment variable isn't a " "valid entity. Check your environment variables/config.env file.") quit(1) # Global Variables COUNT_MSG = 0 USERS = {} COUNT_PM = {} LASTMSG = {} CMD_HELP = {} ISAFK = False AFKREASON = None
2.a835ef7b.chunk.js
/*! For license information please see 2.a835ef7b.chunk.js.LICENSE.txt */ (this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(175)},function(e,t,n){"use strict";function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";e.exports=n(180)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(77);function i(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return X})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return ae})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return ce})),n.d(t,"g",(function(){return j})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return N})),n.d(t,"j",(function(){return K})),n.d(t,"k",(function(){return P})),n.d(t,"l",(function(){return J})),n.d(t,"m",(function(){return ue}));var r=n(3),i=n(18),o=n(17),a=n(5),s=n(6),l=n(15),c=/\r\n?|\n/,u=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(u||(u={})),f=function(){function e(t){Object(a.a)(this,e),this.sections=t}return Object(s.a)(e,[{key:"length",get:function(){for(var e=0,t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}},{key:"newLength",get:function(){for(var e=0,t=0;t<this.sections.length;t+=2){var n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}},{key:"empty",get:function(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}},{key:"iterGaps",value:function(e){for(var t=0,n=0,r=0;t<this.sections.length;){var i=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,i),r+=i):r+=o,n+=i}}},{key:"iterChangedRanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];v(this,e,t)}},{key:"invertedDesc",get:function(){for(var t=[],n=0;n<this.sections.length;){var r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new e(t)}},{key:"composeDesc",value:function(e){return this.empty?e:e.empty?this:g(this,e)}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:m(this,e,t)}},{key:"mapPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.Simple,r=0,i=0,o=0;o<this.sections.length;){var a=this.sections[o++],s=this.sections[o++],l=r+a;if(s<0){if(l>e)return i+(e-r);i+=a}else{if(n!=u.Simple&&l>=e&&(n==u.TrackDel&&r<e&&l>e||n==u.TrackBefore&&r<e||n==u.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=l}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n<this.sections.length&&r<=t;){var i=this.sections[n++],o=this.sections[n++],a=r+i;if(o>=0&&r<=t&&a>=e)return!(r<e&&a>t)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var e="",t=0;t<this.sections.length;){var n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}},{key:"toJSON",value:function(){return this.sections}}],[{key:"fromJSON",value:function(t){if(!Array.isArray(t)||t.length%2||t.some((function(e){return"number"!=typeof e})))throw new RangeError("Invalid JSON representation of ChangeDesc");return new e(t)}}]),e}(),d=function(e){Object(i.a)(n,e);var t=Object(o.a)(n);function n(e,r){var i;return Object(a.a)(this,n),(i=t.call(this,e)).inserted=r,i}return Object(s.a)(n,[{key:"apply",value:function(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return v(this,(function(t,n,r,i,o){return e=e.replace(r,r+(n-t),o)}),!1),e}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m(this,e,t,!0)}},{key:"invert",value:function(e){for(var t=this.sections.slice(),r=[],i=0,o=0;i<t.length;i+=2){var a=t[i],s=t[i+1];if(s>=0){t[i]=s,t[i+1]=a;for(var c=i>>1;r.length<c;)r.push(l.a.empty);r.push(a?e.slice(o,o+a):l.a.empty)}o+=a}return new n(t,r)}},{key:"compose",value:function(e){return this.empty?e:e.empty?this:g(this,e,!0)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:m(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];v(this,e,t)}},{key:"desc",get:function(){return new f(this.sections)}},{key:"filter",value:function(e){var t=[],r=[],i=[],o=new y(this);e:for(var a=0,s=0;;){for(var l=a==e.length?1e9:e[a++];s<l||s==l&&0==o.len;){if(o.done)break e;var c=Math.min(o.len,l-s);h(i,c,-1);var u=-1==o.ins?-1:0==o.off?o.ins:0;h(t,c,u),u>0&&p(r,t,o.text),o.forward(c),s+=c}for(var d=e[a++];s<d;){if(o.done)break e;var v=Math.min(o.len,d-s);h(t,v,-1),h(i,v,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(v),s+=v}}return{changes:new n(t,r),filtered:new f(i)}}},{key:"toJSON",value:function(){for(var e=[],t=0;t<this.sections.length;t+=2){var n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}}],[{key:"of",value:function(e,t,i){var o=[],a=[],s=0,u=null;function f(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||o.length){s<t&&h(o,t-s,-1);var r=new n(o,a);u=u?u.compose(r.map(u)):r,o=[],a=[],s=0}}return function e(d){if(Array.isArray(d)){var v,m=Object(r.a)(d);try{for(m.s();!(v=m.n()).done;){e(v.value)}}catch(x){m.e(x)}finally{m.f()}}else if(d instanceof n){if(d.length!=t)throw new RangeError("Mismatched change set length (got ".concat(d.length,", expected ").concat(t,")"));f(),u=u?u.compose(d.map(u)):d}else{var g=d.from,y=d.to,b=void 0===y?g:y,O=d.insert;if(g>b||g<0||b>t)throw new RangeError("Invalid change range ".concat(g," to ").concat(b," (in doc of length ").concat(t,")"));var k=O?"string"==typeof O?l.a.of(O.split(i||c)):O:l.a.empty,w=k.length;if(g==b&&0==w)return;g<s&&f(),g>s&&h(o,g-s,-1),h(o,b-g,w),p(a,o,k),s=b}}(e),f(!u),u}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");for(var t=[],r=[],i=0;i<e.length;i++){var o=e[i];if("number"==typeof o)t.push(o,-1);else{if(!Array.isArray(o)||"number"!=typeof o[0]||o.some((function(e,t){return t&&"string"!=typeof e})))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;r.length<i;)r.push(l.a.empty);r[i]=l.a.of(o.slice(1)),t.push(o[0],r[i].length)}}}return new n(t,r)}}]),n}(f);function h(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function p(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(l.a.empty);e.push(n)}}}function v(e,t,n){for(var r=e.inserted,i=0,o=0,a=0;a<e.sections.length;){var s=e.sections[a++],c=e.sections[a++];if(c<0)i+=s,o+=s;else{for(var u=i,f=o,d=l.a.empty;u+=s,f+=c,c&&r&&(d=d.append(r[a-2>>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)s=e.sections[a++],c=e.sections[a++];t(i,u,o,f,d),i=u,o=f}}}function m(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new y(e),s=new y(t),l=0,c=0;;)if(-1==a.ins)l+=a.len,a.next();else if(-1==s.ins&&c<l){var u=Math.min(s.len,l-c);s.forward(u),h(i,u,-1),c+=u}else if(s.ins>=0&&(a.done||c<l||c==l&&(s.len<a.len||s.len==a.len&&!n))){for(h(i,s.ins,-1);l>c&&!a.done&&l+a.len<c+s.len;)l+=a.len,a.next();c+=s.len,s.next()}else{if(!(a.ins>=0)){if(a.done&&s.done)return o?new d(i,o):new f(i);throw new Error("Mismatched change set lengths")}for(var v=0,m=l+a.len;;)if(s.ins>=0&&c>l&&c+s.len<m)v+=s.ins,c+=s.len,s.next();else{if(!(-1==s.ins&&c<m))break;var g=Math.min(s.len,m-c);v+=g,s.forward(g),c+=g}h(i,v,a.ins),o&&p(o,i,a.text),l=m,a.next()}}function g(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new y(e),a=new y(t),s=!1;;){if(o.done&&a.done)return i?new d(r,i):new f(r);if(0==o.ins)h(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var l=Math.min(o.len2,a.len),c=r.length;if(-1==o.ins){var u=-1==a.ins?-1:a.off?0:a.ins;h(r,l,u,s),i&&u&&p(i,r,a.text)}else-1==a.ins?(h(r,o.off?0:o.len,l,s),i&&p(i,r,o.textBit(l))):(h(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&p(i,r,a.text));s=(o.ins>l||a.ins>=0&&a.len>l)&&(s||r.length>c),o.forward2(l),a.forward(l)}else h(r,0,a.ins,s),i&&p(i,r,a.text),a.next()}}var y=function(){function e(t){Object(a.a)(this,e),this.set=t,this.i=0,this.next()}return Object(s.a)(e,[{key:"next",value:function(){var e=this.set.sections;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var e=this.set.inserted,t=this.i-2>>1;return t>=e.length?l.a.empty:e[t]}},{key:"textBit",value:function(e){var t=this.set.inserted,n=this.i-2>>1;return n>=t.length&&!e?l.a.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}]),e}(),b=function(){function e(t,n,r){Object(a.a)(this,e),this.from=t,this.to=n,this.flags=r}return Object(s.a)(e,[{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=3&this.flags;return 3==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>5;return 33554431==e?void 0:e}},{key:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=t.mapPos(this.from,n),i=t.mapPos(this.to,n);return r==this.from&&i==this.to?this:new e(r,i,this.flags)}},{key:"extend",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e<=this.anchor&&t>=this.anchor)return O.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return O.range(this.anchor,n)}},{key:"eq",value:function(e){return this.anchor==e.anchor&&this.head==e.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return O.range(e.anchor,e.head)}}]),e}(),O=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(a.a)(this,e),this.ranges=t,this.mainIndex=n}return Object(s.a)(e,[{key:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t,n)})),this.mainIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t]))return!1;return!0}},{key:"main",get:function(){return this.ranges[this.mainIndex]}},{key:"asSingle",value:function(){return 1==this.ranges.length?this:new e([this.main])}},{key:"addRange",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),main:this.mainIndex}}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return b.fromJSON(e)})),t.main)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i<t.length;i++){var o=t[i];if(o.empty?o.from<=r:o.from<r)return k(t.slice(),n);r=o.to}return new e(t,n)}},{key:"cursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new b(e,e,(0==t?0:t<0?4:8)|(null==n?3:Math.min(2,n))|(null!==r&&void 0!==r?r:33554431)<<5)}},{key:"range",value:function(e,t,n){var r=(null!==n&&void 0!==n?n:33554431)<<5;return t<e?new b(t,e,16|r):new b(e,t,r)}}]),e}();function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e[t];e.sort((function(e,t){return e.from-t.from})),t=e.indexOf(n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(i.empty?i.from<=o.to:i.from<o.to){var a=o.from,s=Math.max(i.to,o.to);r<=t&&t--,e.splice(--r,2,i.anchor>i.head?O.range(s,a):O.range(a,s))}}return new O(e,t)}function w(e,t){var n,i=Object(r.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(o){i.e(o)}finally{i.f()}}var x=0,j=function(){function e(t,n,r,i,o){Object(a.a)(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=x++,this.default=t([])}return Object(s.a)(e,[{key:"of",value:function(e){return new E([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,2,t)}},{key:"from",value:function(e,t){return t||(t=function(e){return e}),this.compute([e],(function(n){return t(n.field(e))}))}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:S),!!t.static,t.enables)}}]),e}();function S(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var E=function(){function e(t,n,r,i){Object(a.a)(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=x++}return Object(s.a)(e,[{key:"dynamicSlot",value:function(e){var t,n,i=this.value,o=this.facet.compareInput,a=e[this.id]>>1,s=2==this.type,l=!1,c=!1,u=[],f=Object(r.a)(this.dependencies);try{for(f.s();!(n=f.n()).done;){var d=n.value;"doc"==d?l=!0:"selection"==d?c=!0:0==(1&(null!==(t=e[d.id])&&void 0!==t?t:1))&&u.push(e[d.id])}}catch(h){f.e(h)}finally{f.f()}return function(e,t){if(!t||t.reconfigured)return e.values[a]=i(e),1;if(!(l&&t.docChanged||c&&(t.docChanged||t.selection)||u.some((function(t){return(1&z(e,t))>0}))))return 0;var n=i(e),r=t.startState.values[a];return(s?function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}(n,r,o):o(n,r))?0:(e.values[a]=n,1)}}}]),e}();function C(e,t){var n=e.config.address[t];return null==n?null:n>>1}var M=j.define({static:!0}),P=function(){function e(t,n,r,i,o){Object(a.a)(this,e),this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}return Object(s.a)(e,[{key:"create",value:function(e){var t=this,n=e.facet(M).find((function(e){return e.field==t}));return((null===n||void 0===n?void 0:n.create)||this.createF)(e)}},{key:"slot",value:function(e){var t=this,n=e[this.id]>>1;return function(e,r){if(!r||r.reconfigured&&null==C(r.startState,t.id))return e.values[n]=t.create(e),1;var i,o=0;r.reconfigured?(i=r.startState.values[C(r.startState,t.id)],o=1):i=r.startState.values[n];var a=t.updateF(i,r);return o||t.compareF(i,a)||(o=1),o&&(e.values[n]=a),o}}},{key:"init",value:function(e){return[this,M.of({field:this,create:e})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(t){var n=new e(x++,t.create,t.update,t.compare||function(e,t){return e===t},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),T=2,A=1,D=0;function R(e){return function(t){return new _(t,e)}}var N={fallback:R(3),default:R(T),extend:R(A),override:R(D)},_=function e(t,n){Object(a.a)(this,e),this.inner=t,this.prec=n},L=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new I(this,e)}},{key:"reconfigure",value:function(t){return e.reconfigure.of({compartment:this,extension:t})}},{key:"get",value:function(e){return e.config.compartments.get(this)}}]),e}(),I=function e(t,n){Object(a.a)(this,e),this.compartment=t,this.inner=n},$=function(){function e(t,n,r,i,o){for(Object(a.a)(this,e),this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}return Object(s.a)(e,[{key:"staticFacet",value:function(e){var t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}}],[{key:"resolve",value:function(t,n,i){var o,a=[],s=Object.create(null),l=new Map,c=Object(r.a)(function(e,t,n){var i=[[],[],[],[]],o=new Map;function a(e,s){var l=o.get(e);if(null!=l){if(l>=s)return;var c=i[l].indexOf(e);c>-1&&i[l].splice(c,1),e instanceof I&&n.delete(e.compartment)}if(o.set(e,s),Array.isArray(e)){var u,f=Object(r.a)(e);try{for(f.s();!(u=f.n()).done;){a(u.value,s)}}catch(p){f.e(p)}finally{f.f()}}else if(e instanceof I){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");var d=t.get(e.compartment)||e.inner;n.set(e.compartment,d),a(d,s)}else if(e instanceof _)a(e.inner,e.prec);else if(e instanceof P)i[s].push(e),e.provides&&a(e.provides,s);else if(e instanceof E)i[s].push(e),e.facet.extensions&&a(e.facet.extensions,s);else{var h=e.extension;if(!h)throw new Error("Unrecognized extension value in extension set (".concat(e,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));a(h,s)}}return a(e,T),i.reduce((function(e,t){return e.concat(t)}))}(t,n,l));try{for(c.s();!(o=c.n()).done;){var u=o.value;u instanceof P?a.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u)}}catch(b){c.e(b)}finally{c.f()}for(var f=Object.create(null),d=[],h=[],p=function(){var e=m[v];f[e.id]=h.length<<1,h.push((function(t){return e.slot(t)}))},v=0,m=a;v<m.length;v++)p();var g=function(e){var t=s[e],n=t[0].facet;if(t.every((function(e){return 0==e.type}))){f[n.id]=d.length<<1|1;var o=n.combine(t.map((function(e){return e.value}))),a=i?i.config.address[n.id]:null;if(null!=a){var l=B(i,a);n.compare(o,l)&&(o=l)}d.push(o)}else{var c,u=Object(r.a)(t);try{var p=function(){var e=c.value;0==e.type?(f[e.id]=d.length<<1|1,d.push(e.value)):(f[e.id]=h.length<<1,h.push((function(t){return e.dynamicSlot(t)})))};for(u.s();!(c=u.n()).done;)p()}catch(b){u.e(b)}finally{u.f()}f[n.id]=h.length<<1,h.push((function(e){return function(e,t,n){var i=n.map((function(t){return e[t.id]})),o=n.map((function(e){return e.type})),a=i.filter((function(e){return!(1&e)})),s=e[t.id]>>1;return function(e,n){var l,c=n?n.reconfigured?n.startState.config.address[t.id]:s<<1:null,u=null==c,f=Object(r.a)(a);try{for(f.s();!(l=f.n()).done;)1&z(e,l.value)&&(u=!0)}catch(b){f.e(b)}finally{f.f()}if(!u)return 0;for(var d=[],h=0;h<i.length;h++){var p=B(e,i[h]);if(2==o[h]){var v,m=Object(r.a)(p);try{for(m.s();!(v=m.n()).done;){var g=v.value;d.push(g)}}catch(b){m.e(b)}finally{m.f()}}else d.push(p)}var y=t.combine(d);return null!=c&&t.compare(y,B(n.startState,c))?0:(e.values[s]=y,1)}}(e,n,t)}))}};for(var y in s)g(y);return new e(t,l,h.map((function(e){return e(f)})),f,d)}}]),e}();function z(e,t){if(1&t)return 2;var n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.config.dynamicSlots[n](e,e.applying);return e.status[n]=2|i}function B(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var F=j.define(),W=j.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),V=j.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),H=j.define(),Q=j.define(),q=j.define(),U=j.define({combine:function(e){return!!e.length&&e[0]}}),X=function(){function e(t,n){Object(a.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,null,[{key:"define",value:function(){return new Y}}]),e}(),Y=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new X(this,e)}}]),e}(),G=function(){function e(t){Object(a.a)(this,e),this.map=t}return Object(s.a)(e,[{key:"of",value:function(e){return new K(this,e)}}]),e}(),K=function(){function e(t,n){Object(a.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return void 0===n?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(e){return this.type==e}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new G(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,i=[],o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value.map(t);a&&i.push(a)}}catch(s){o.e(s)}finally{o.f()}return i}}]),e}();K.reconfigure=K.define(),K.appendConfig=K.define();var J=function(){function e(t,n,r,i,o,s){Object(a.a)(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&w(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return Object(s.a)(e,[{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"annotation",value:function(e){var t,n=Object(r.a)(this.annotations);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.type==e)return i.value}}catch(o){n.e(o)}finally{n.f()}}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}},{key:"isUserEvent",value:function(t){var n=this.annotation(e.userEvent);return n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&"."==n[t.length])}}]),e}();function Z(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],a=e[r++];else{if(!(i<t.length))return n;o=t[i++],a=t[i++]}!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function ee(e,t,n){var r,i,o,a;return n?(i=t.changes,o=d.empty(t.changes.length),a=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(i)),{changes:a,selection:t.selection?t.selection.map(o):null===(r=e.selection)||void 0===r?void 0:r.map(i),effects:K.mapEffects(e.effects,i).concat(K.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function te(e,t,n){var r=t.selection,i=ie(t.annotations);return t.userEvent&&(i=i.concat(J.userEvent.of(t.userEvent))),{changes:t.changes instanceof d?t.changes:d.of(t.changes||[],n,e.facet(V)),selection:r&&(r instanceof O?r:O.single(r.anchor,r.head)),effects:ie(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function ne(e,t,n){var i=te(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(var o=1;o<t.length;o++){!1===t[o].filter&&(n=!1);var a=!!t[o].sequential;i=ee(i,te(e,t[o],a?i.changes.newLength:e.doc.length),a)}var s=new J(e,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){for(var t=e.startState,n=t.facet(q),r=e,i=n.length-1;i>=0;i--){var o=n[i](e);o&&Object.keys(o).length&&(r=ee(e,te(t,o,e.changes.newLength),!0))}return r==e?e:new J(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){var t,n=e.startState,i=!0,o=Object(r.a)(n.facet(H));try{for(o.s();!(t=o.n()).done;){var a=(0,t.value)(e);if(!1===a){i=!1;break}Array.isArray(a)&&(i=!0===i?a:Z(i,a))}}catch(p){o.e(p)}finally{o.f()}if(!0!==i){var s,l;if(!1===i)l=e.changes.invertedDesc,s=d.empty(n.doc.length);else{var c=e.changes.filter(i);s=c.changes,l=c.filtered.invertedDesc}e=new J(n,s,e.selection&&e.selection.map(l),K.mapEffects(e.effects,l),e.annotations,e.scrollIntoView)}for(var u=n.facet(Q),f=u.length-1;f>=0;f--){var h=u[f](e);e=h instanceof J?h:Array.isArray(h)&&1==h.length&&h[0]instanceof J?h[0]:ne(n,ie(h),!1)}return e}(s):s)}J.time=X.define(),J.userEvent=X.define(),J.addToHistory=X.define(),J.remote=X.define();var re=[];function ie(e){return null==e?re:Array.isArray(e)?e:[e]}var oe,ae=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ae||(ae={})),se=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{oe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(fe){}function le(e){return function(t){if(!/\S/.test(t))return ae.Space;if(function(e){if(oe)return oe.test(e);for(var t=0;t<e.length;t++){var n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||se.test(n)))return!0}return!1}(t))return ae.Word;for(var n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return ae.Word;return ae.Other}}var ce=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(Object(a.a)(this,e),this.config=t,this.doc=n,this.selection=r,this.applying=null,this.status=t.statusTemplate.slice(),i&&i.startState.config==t)this.values=i.startState.values.slice();else if(this.values=t.dynamicSlots.map((function(e){return null})),i)for(var o in t.address){var s=t.address[o],l=i.startState.config.address[o];null!=l&&0==(1&s)&&(this.values[s>>1]=B(i.startState,l))}this.applying=i,i&&(i._state=this);for(var c=0;c<this.config.dynamicSlots.length;c++)z(this,c<<1);this.applying=null}return Object(s.a)(e,[{key:"field",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return z(this,n),B(this,n);if(t)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ne(this,t,!0)}},{key:"applyTransaction",value:function(t){var n,i=this.config,o=i,a=o.base,s=o.compartments,l=Object(r.a)(t.effects);try{for(l.s();!(n=l.n()).done;){var c=n.value;c.is(L.reconfigure)?(i&&(s=new Map,i.compartments.forEach((function(e,t){return s.set(t,e)})),i=null),s.set(c.value.compartment,c.value.extension)):c.is(K.reconfigure)?(i=null,a=c.value):c.is(K.appendConfig)&&(i=null,a=ie(a).concat(c.value))}}catch(u){l.e(u)}finally{l.f()}new e(i||$.resolve(a,s,this),t.newDoc,t.newSelection,t)}},{key:"replaceSelection",value:function(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((function(t){return{changes:{from:t.from,to:t.to,insert:e},range:O.cursor(t.from+e.length)}}))}},{key:"changeByRange",value:function(e){for(var t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=ie(n.effects),a=1;a<t.ranges.length;a++){for(var s=e(t.ranges[a]),l=this.changes(s.changes),c=l.map(r),u=0;u<a;u++)i[u]=i[u].map(c);var f=r.mapDesc(l,!0);i.push(s.range.map(f)),r=r.compose(c),o=K.mapEffects(o,c).concat(K.mapEffects(ie(s.effects),f))}return{changes:r,selection:O.create(i,t.mainIndex),effects:o}}},{key:"changes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t instanceof d?t:d.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return l.a.of(t.split(this.facet(e.lineSeparator)||c))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:(z(this,t),B(this,t))}},{key:"toJSON",value:function(e){var t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(var n in e){var r=e[n];r instanceof P&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}},{key:"tabSize",get:function(){return this.facet(e.tabSize)}},{key:"lineBreak",get:function(){return this.facet(e.lineSeparator)||"\n"}},{key:"readOnly",get:function(){return this.facet(U)}},{key:"phrase",value:function(t){var n,i=Object(r.a)(this.facet(e.phrases));try{for(i.s();!(n=i.n()).done;){var o=n.value;if(Object.prototype.hasOwnProperty.call(o,t))return o[t]}}catch(a){i.e(a)}finally{i.f()}return t}},{key:"languageDataAt",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=[],a=Object(r.a)(this.facet(F));try{for(a.s();!(n=a.n()).done;){var s,l=n.value,c=Object(r.a)(l(this,t,i));try{for(c.s();!(s=c.n()).done;){var u=s.value;Object.prototype.hasOwnProperty.call(u,e)&&o.push(u[e])}}catch(f){c.e(f)}finally{c.f()}}}catch(f){a.e(f)}finally{a.f()}return o}},{key:"charCategorizer",value:function(e){return le(this.languageDataAt("wordChars",e).join(""))}},{key:"wordAt",value:function(e){for(var t=this.doc.lineAt(e),n=t.text,r=t.from,i=t.length,o=this.charCategorizer(e),a=e-r,s=e-r;a>0;){var c=Object(l.e)(n,a,!1);if(o(n.slice(c,a))!=ae.Word)break;a=c}for(;s<i;){var u=Object(l.e)(n,s);if(o(n.slice(s,u))!=ae.Word)break;s=u}return a==s?null:O.range(a+r,s+r)}}],[{key:"fromJSON",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(e){var n=r[e],o=t[e];i.push(n.init((function(e){return n.spec.fromJSON(o,e)})))};for(var a in r)o(a)}return e.create({doc:t.doc,selection:O.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=$.resolve(t.extensions||[],new Map),r=t.doc instanceof l.a?t.doc:l.a.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||c)),i=t.selection?t.selection instanceof O?t.selection:O.single(t.selection.anchor,t.selection.head):O.single(0);return w(i,r.length),n.staticFacet(W)||(i=i.asSingle()),new e(n,r,i)}}]),e}();function ue(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={},a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,l=0,c=Object.keys(s);l<c.length;l++){var u=c[l],f=s[u],d=o[u];if(void 0===d)o[u]=f;else if(d===f||void 0===f);else{if(!Object.hasOwnProperty.call(i,u))throw new Error("Config merge conflict for field "+u);o[u]=i[u](d,f)}}}catch(p){a.e(p)}finally{a.f()}for(var h in t)void 0===o[h]&&(o[h]=t[h]);return o}ce.allowMultipleSelections=W,ce.tabSize=j.define({combine:function(e){return e.length?e[0]:4}}),ce.lineSeparator=V,ce.readOnly=U,ce.phrases=j.define(),ce.languageData=F,ce.changeFilter=H,ce.transactionFilter=Q,ce.transactionExtender=q,L.reconfigure=K.define()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(56);function i(e,t){if(null==e)return{};var n,i,o=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"===typeof e||"number"===typeof e)i+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}t.a=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Ee})),n.d(t,"b",(function(){return Ce})),n.d(t,"c",(function(){return pt})),n.d(t,"d",(function(){return tr})),n.d(t,"e",(function(){return Ye})),n.d(t,"f",(function(){return Je})),n.d(t,"g",(function(){return Se})),n.d(t,"h",(function(){return wr})),n.d(t,"i",(function(){return Vr})),n.d(t,"j",(function(){return $r})),n.d(t,"k",(function(){return hr})),n.d(t,"l",(function(){return qe})),n.d(t,"m",(function(){return mr}));for(var r=n(85),i=n(62),o=n(35),a=n(18),s=n(17),l=n(13),c=n(25),u=n(3),f=n(5),d=n(6),h=n(4),p=n(15),v=n(59),m=n(26),g={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},y={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},b="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),O="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),k="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),w="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),x="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),j=b&&(w||+b[1]<57)||k&&w,S=0;S<10;S++)g[48+S]=g[96+S]=String(S);for(S=1;S<=24;S++)g[S+111]="F"+S;for(S=65;S<=90;S++)g[S]=String.fromCharCode(S+32),y[S]=String.fromCharCode(S);for(var E in g)y.hasOwnProperty(E)||(y[E]=g[E]);function C(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function M(e,t){return!!t&&e.contains(1!=t.nodeType?t.parentNode:t)}function P(e,t){if(!t.anchorNode)return!1;try{return M(e,t.anchorNode)}catch(n){return!1}}function T(e){return 3==e.nodeType?W(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function A(e,t,n,r){return!!n&&(R(e,t,n,r,-1)||R(e,t,n,r,1))}function D(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function R(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:N(e))){if("DIV"==e.nodeName)return!1;var o=e.parentNode;if(!o||1!=o.nodeType)return!1;t=D(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?N(e):0}}}function N(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var _={left:0,right:0,top:0,bottom:0};function L(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function I(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var $,z=function(){function e(){Object(f.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}}]),e}(),B=null;function F(e){if(e.setActive)return e.setActive();if(B)return e.focus(B);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==B?{get preventScroll(){return B={preventScroll:!0},!0}}:void 0),!B){B=!1;for(var r=0;r<t.length;){var i=t[r++],o=t[r++],a=t[r++];i.scrollTop!=o&&(i.scrollTop=o),i.scrollLeft!=a&&(i.scrollLeft=a)}}}function W(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=$||($=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function V(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,e.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return o.synthetic=!0,e.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}var H=null;function Q(){if(null==H){H=!1;var e=document.createElement("div");try{e.contentEditable="plaintext-only",H="plaintext-only"==e.contentEditable}catch(t){}}return H}var q=function(){function e(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Object(f.a)(this,e),this.node=t,this.offset=n,this.precise=r}return Object(d.a)(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,D(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,D(t)+1,n)}}]),e}(),U=[],X=function(){function e(){Object(f.a)(this,e),this.parent=null,this.dom=null,this.dirty=2}return Object(d.a)(e,[{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=Object(u.a)(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i==e)return n;n+=i.length+i.breakAfter}}catch(o){r.e(o)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(e){return this.posBefore(e)+e.length}},{key:"coordsAt",value:function(e,t){return null}},{key:"sync",value:function(t){var n;if(2&this.dirty){var r,i=this.dom,o=null,a=Object(u.a)(this.children);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(s.dirty){var l=o?o.nextSibling:i.firstChild;s.dom||!l||(null===(n=e.get(l))||void 0===n?void 0:n.parent)||s.reuseDOM(l),s.sync(t),s.dirty=0}t&&t.node==i&&o!=s.dom&&(t.written=!0),G(i,o,s.dom),o=s.dom}}catch(p){a.e(p)}finally{a.f()}var c=o?o.nextSibling:i.firstChild;for(c&&t&&t.node==i&&(t.written=!0);c;)c=Y(c)}else if(1&this.dirty){var f,d=Object(u.a)(this.children);try{for(d.s();!(f=d.n()).done;){var h=f.value;h.dirty&&(h.sync(t),h.dirty=0)}}catch(p){d.e(p)}finally{d.f()}}}},{key:"reuseDOM",value:function(e){return!1}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==N(t)?0:0==n?-1:1;;){var o=t.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=t==o.firstChild?-1:1),t=o}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var l=this.children[a];if(l.dom==r)return s;s+=l.length+l.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,l=n,c=n;s<this.children.length;s++){var u=this.children[s],f=l+u.length;if(l<e&&f>t)return u.domBoundsAround(e,t,l);if(f>=e&&-1==r&&(r=s,i=l),l>t&&u.dom.parentNode==this.dom){o=s,a=c;break}c=f,l=f+u.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}},{key:"markDirty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.dirty|=2,this.markParentsDirty(e)}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U;this.markDirty();for(var i=e;i<t;i++){var o=this.children[i];o.parent==this&&(o.parent=null)}(n=this.children).splice.apply(n,[e,t-e].concat(Object(c.a)(r)));for(var a=0;a<r.length;a++)r[a].setParent(this)}},{key:"ignoreMutation",value:function(e){return!1}},{key:"ignoreEvent",value:function(e){return!1}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length;return new K(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function Y(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}function G(e,t,n){var r=t?t.nextSibling:e.firstChild;if(n.parentNode==e)for(;r!=n;)r=Y(r);else e.insertBefore(n,r)}X.prototype.breakAfter=0;var K=function(){function e(t,n,r){Object(f.a)(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Object(d.a)(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}(),J="undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],Z=Object(l.a)(J,2),ee=Z[0],te=Z[1],ne=/Edge\/(\d+)/.exec(ee.userAgent),re=/MSIE \d/.test(ee.userAgent),ie=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ee.userAgent),oe=!!(re||ie||ne),ae=!oe&&/gecko\/(\d+)/i.test(ee.userAgent),se=!oe&&/Chrome\/(\d+)/.exec(ee.userAgent),le="webkitFontSmoothing"in te.documentElement.style,ce=!oe&&/Apple Computer/.test(ee.vendor),ue={mac:/Mac/.test(ee.platform),ie:oe,ie_version:re?te.documentMode||6:ie?+ie[1]:ne?+ne[1]:0,gecko:ae,gecko_version:ae?+(/Firefox\/(\d+)/.exec(ee.userAgent)||[0,0])[1]:0,chrome:!!se,chrome_version:se?+se[1]:0,ios:ce&&(/Mobile\/\w+/.test(ee.userAgent)||ee.maxTouchPoints>2),android:/Android\b/.test(ee.userAgent),webkit:le,safari:ce,webkit_version:le?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=te.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},fe=[],de=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}}]),n}(X);de.prototype.children=fe;var he=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).text=e,r}return Object(d.a)(n,[{key:"length",get:function(){return this.text.length}},{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){return 3==e.nodeType&&(this.createDOM(e),!0)}},{key:"merge",value:function(e,t,r){return(!r||r instanceof n&&!(this.length-(t-e)+r.length>256))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}},{key:"slice",value:function(e){var t=new n(this.text.slice(e));return this.text=this.text.slice(0,e),t}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new q(this.dom,e)}},{key:"domBoundsAround",value:function(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(e,t){return ve(this.dom,e,t)}}]),n}(de),pe=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(f.a)(this,n),(i=t.call(this)).mark=e,i.children=o,i.length=a;var s,l=Object(u.a)(o);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.setParent(Object(r.a)(i))}}catch(d){l.e(d)}finally{l.f()}return i}return Object(d.a)(n,[{key:"createDOM",value:function(){var e=document.createElement(this.mark.tagName);if(this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(var t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);this.setDOM(e)}},{key:"sync",value:function(e){(!this.dom||4&this.dirty)&&this.createDOM(),Object(i.a)(Object(o.a)(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,o){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&i<=0||t<this.length&&o<=0))&&(ye(this,e,t,r?r.children:fe,i-1,o-1),this.markDirty(),!0)}},{key:"slice",value:function(e){var t,r=[],i=0,o=-1,a=0,s=Object(u.a)(this.children);try{for(s.s();!(t=s.n()).done;){var l=t.value,c=i+l.length;c>e&&r.push(i<e?l.slice(e-i):l),o<0&&i>=e&&(o=a),i=c,a++}}catch(d){s.e(d)}finally{s.f()}var f=this.length-e;return this.length=e,o>-1&&this.replaceChildren(o,this.children.length),new n(this.mark,r,f)}},{key:"domAtPos",value:function(e){return be(this.dom,this.children,e)}},{key:"coordsAt",value:function(e,t){return ke(this,e,t)}}]),n}(de);function ve(e,t,n){var r=e.nodeValue.length;t>r&&(t=r);var i=t,o=t,a=0;0==t&&n<0||t==r&&n>=0?ue.chrome||ue.gecko||(t?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=W(e,i,o).getClientRects();if(!s.length)return _;var l=s[(a?a<0:n>=0)?0:s.length-1];return ue.safari&&!a&&0==l.width&&(l=Array.prototype.find.call(s,(function(e){return e.width}))||l),a?L(l,a<0):l}var me=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.side=i,o}return Object(d.a)(n,[{key:"slice",value:function(e){var t=n.create(this.widget,this.length-e,this.side);return this.length-=e,t}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,t,r,i,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&i<=0||t<this.length&&o<=0))&&(this.length=e+(r?r.length:0)+(this.length-t),!0)}},{key:"become",value:function(e){return e.length==this.length&&e instanceof n&&e.side==this.side&&this.widget.constructor==e.widget.constructor&&(this.widget.eq(e.widget)||this.markDirty(!0),this.widget=e.widget,!0)}},{key:"ignoreMutation",value:function(){return!0}},{key:"ignoreEvent",value:function(e){return this.widget.ignoreEvent(e)}},{key:"overrideDOMText",get:function(){if(0==this.length)return p.a.empty;for(var e=this;e.parent;)e=e.parent;var t=e.editorView,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):p.a.empty}},{key:"domAtPos",value:function(e){return 0==e?q.before(this.dom):q.after(this.dom,e==this.length)}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(e,t){var n=this.dom.getClientRects(),r=null;if(!n.length)return _;for(var i=e>0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top<r.bottom);i+=e>0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?r:L(r,0==e)}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(de),ge=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"domAtPos",value:function(e){return new q(this.widget.text,e)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(e,t){return t?3==e.nodeType?Math.min(t,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"overrideDOMText",get:function(){return null}},{key:"coordsAt",value:function(e,t){return ve(this.widget.text,e,t)}}]),n}(me);function ye(e,t,n,r,i,o){var a,s=e.childCursor(),l=s.findPos(n,1),c=l.i,f=l.off,d=s.findPos(t,-1),h=d.i,p=d.off,v=t-n,m=Object(u.a)(r);try{for(m.s();!(a=m.n()).done;){v+=a.value.length}}catch(x){m.e(x)}finally{m.f()}e.length+=v;var g=e.children;if(h==c&&p){var y=g[h];if(1==r.length&&y.merge(p,f,r[0],i,o))return;if(0==r.length)return void y.merge(p,f,null,i,o);var b=y.slice(f);b.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=b:r.push(b),c++,o=f=0}if(f){var O=g[c];r.length&&O.merge(0,f,r[r.length-1],0,o)?(r.pop(),o=r.length?0:i):O.merge(0,f,null,0,0)}else c<g.length&&r.length&&g[c].merge(0,0,r[r.length-1],0,o)&&(r.pop(),o=r.length?0:i);if(p){var k=g[h];r.length&&k.merge(p,k.length,r[0],i,0)?(r.shift(),i=r.length?0:o):k.merge(p,k.length,null,0,0),h++}else if(h&&r.length){var w=g[h-1];w.merge(w.length,w.length,r[0],i,0)&&(r.shift(),i=r.length?0:o)}for(;h<c&&r.length&&g[c-1].become(r[r.length-1]);)r.pop(),c--,o=r.length?0:i;for(;h<c&&r.length&&g[h].become(r[0]);)r.shift(),h++,i=r.length?0:o;!r.length&&h&&c<g.length&&g[c].merge(0,0,g[h-1],i,o)&&h--,(r.length||h!=c)&&e.replaceChildren(h,c,r)}function be(e,t,n){for(var r=0,i=0;r<t.length;r++){var o=t[r],a=i+o.length;if(!(a==i&&o.getSide()<=0)){if(n>i&&n<a&&o.dom.parentNode==e)return o.domAtPos(n-i);if(n<=i)break;i=a}}for(;r>0;r--){var s=t[r-1].dom;if(s.parentNode==e)return q.after(s)}return new q(e,0)}function Oe(e,t,n){var r,i=e.children;n>0&&t instanceof pe&&i.length&&(r=i[i.length-1])instanceof pe&&r.mark.eq(t.mark)?Oe(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function ke(e,t,n){for(var r=0,i=0;i<e.children.length;i++){var o=e.children[i],a=r+o.length,s=void 0;if((n<=0||a==e.length||o.getSide()>0?a>=t:a>t)&&(t<a||i+1==e.children.length||(s=e.children[i+1]).length||s.getSide()>0)){var l=0;if(a==r){if(o.getSide()<=0)continue;l=n=-o.getSide()}var c=o.coordsAt(t-r,n);return l&&c?L(c,n<0):c}r=a}var u=e.dom.lastChild;if(!u)return e.dom.getBoundingClientRect();var f=T(u);return f[f.length-1]}function we(e,t){for(var n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}function xe(e,t){if(e==t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0,o=n;i<o.length;i++){var a=o[i];if(-1==r.indexOf(a)||e[a]!==t[a])return!1}return!0}function je(e,t,n){if(t)for(var r in t)n&&r in n||e.removeAttribute(r);if(n)for(var i in n)t&&t[i]==n[i]||e.setAttribute(i,n[i])}var Se=function(){function e(){Object(f.a)(this,e)}return Object(d.a)(e,[{key:"eq",value:function(e){return!1}},{key:"updateDOM",value:function(e){return!1}},{key:"compare",value:function(e){return this==e||this.constructor==e.constructor&&this.eq(e)}},{key:"estimatedHeight",get:function(){return-1}},{key:"ignoreEvent",value:function(e){return!0}},{key:"customView",get:function(){return null}}]),e}(),Ee=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(Ee||(Ee={})),Ce=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i,o){var a;return Object(f.a)(this,n),(a=t.call(this)).startSide=e,a.endSide=r,a.widget=i,a.spec=o,a}return Object(d.a)(n,[{key:"heightRelevant",get:function(){return!1}},{key:"hasHeight",value:function(){return!!this.widget&&this.widget.estimatedHeight>-1}}],[{key:"mark",value:function(e){return new Me(e)}},{key:"widget",value:function(e){var t=e.side||0;return e.block&&(t+=200000001*(t>0?1:-1)),new Te(e,t,t,!!e.block,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Ae(e),r=n.start,i=n.end;return new Te(e,t?-2e8*(r?2:1):1e8*(r?-1:1),t?2e8*(i?2:1):1e8*(i?1:-1),t,e.widget||null,!0)}},{key:"line",value:function(e){return new Pe(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m.a.of(e,t)}}]),n}(m.c);Ce.none=m.a.empty;var Me=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;Object(f.a)(this,n);var i=Ae(e),o=i.start,a=i.end;return(r=t.call(this,1e8*(o?-1:1),1e8*(a?1:-1),null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Object(d.a)(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&xe(this.attrs,e.attrs)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e>=t)throw new RangeError("Mark decorations may not be empty");return Object(i.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(Ce);Me.prototype.point=!1;var Pe=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,-1e8,-1e8,null,e)}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&xe(this.spec.attributes,e.spec.attributes)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return Object(i.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(Ce);Pe.prototype.mapMode=h.h.TrackBefore,Pe.prototype.point=!0;var Te=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i,o,a,s){var l;return Object(f.a)(this,n),(l=t.call(this,r,i,a,e)).block=o,l.isReplace=s,l.mapMode=o?r<0?h.h.TrackBefore:h.h.TrackAfter:h.h.TrackDel,l}return Object(d.a)(n,[{key:"type",get:function(){return this.startSide<this.endSide?Ee.WidgetRange:this.startSide<0?Ee.WidgetBefore:Ee.WidgetAfter}},{key:"heightRelevant",get:function(){return this.block||!!this.widget&&this.widget.estimatedHeight>=5}},{key:"eq",value:function(e){return e instanceof n&&(t=this.widget,r=e.widget,t==r||!!(t&&r&&t.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,r}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return Object(i.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(Ce);function Ae(e){var t=e.inclusiveStart,n=e.inclusiveEnd;return null==t&&(t=e.inclusive),null==n&&(n=e.inclusive),{start:t||!1,end:n||!1}}function De(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>e?n[i]=Math.max(n[i],t):n.push(e,t)}Te.prototype.point=!0;var Re=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(f.a)(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),ye(this,e,t,r?r.children:Ne,o,a),!0}},{key:"split",value:function(e){var t=new n;if(t.breakAfter=this.breakAfter,0==this.length)return t;var r=this.childPos(e),i=r.i,o=r.off;o&&(t.append(this.children[i].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a<this.children.length;a++)t.append(this.children[a],0);for(;i>0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){xe(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){Oe(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes;t&&(this.attrs=we(t,this.attrs||{}))}},{key:"domAtPos",value:function(e){return be(this.dom,this.children,e)}},{key:"sync",value:function(e){(!this.dom||4&this.dirty)&&(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(je(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),Object(i.a)(Object(o.a)(n.prototype),"sync",this).call(this,e);for(var t=this.dom.lastChild;t&&X.get(t)instanceof pe;)t=t.lastChild;if(!t||"BR"!=t.nodeName&&X.get(t)instanceof me&&(!ue.ios||!this.children.some((function(e){return e instanceof he})))){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof he))return null;var i=T(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}}},{key:"coordsAt",value:function(e,t){return ke(this,e,t)}},{key:"match",value:function(e){return!1}},{key:"type",get:function(){return Ee.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;;r++){var o=e.children[r],a=i+o.length;if(a>=t){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(X),Ne=[],_e=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.type=i,o.breakAfter=0,o}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t<this.length&&a<=0))&&(this.length=e+(r?r.length:0)+(this.length-t),!0)}},{key:"domAtPos",value:function(e){return 0==e?q.before(this.dom):q.after(this.dom,e==this.length)}},{key:"split",value:function(e){var t=this.length-e;return this.length=e,new n(this.widget,t,this.type)}},{key:"children",get:function(){return Ne}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"overrideDOMText",get:function(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):p.a.empty}},{key:"domBoundsAround",value:function(){return null}},{key:"match",value:function(e){return e instanceof n&&e.type==this.type&&e.widget.constructor==this.widget.constructor&&(e.widget.eq(this.widget)||this.markDirty(!0),this.widget=e.widget,this.length=e.length,this.breakAfter=e.breakAfter,!0)}},{key:"ignoreMutation",value:function(){return!0}},{key:"ignoreEvent",value:function(e){return this.widget.ignoreEvent(e)}}]),n}(X),Le=function(){function e(t,n,r){Object(f.a)(this,e),this.doc=t,this.pos=n,this.end=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=n}return Object(d.a)(e,[{key:"posCovered",value:function(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var e=this.content[this.content.length-1];return!e.breakAfter&&!(e instanceof _e&&e.type==Ee.WidgetBefore)}},{key:"getLine",value:function(){return this.curLine||this.content.push(this.curLine=new Re),this.curLine}},{key:"addWidget",value:function(e){this.curLine=null,this.content.push(e)}},{key:"finish",value:function(){this.posCovered()||this.getLine()}},{key:"wrapMarks",value:function(e,t){var n,r=Object(u.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e=new pe(i,[e],e.length)}}catch(o){r.e(o)}finally{r.f()}return e}},{key:"buildText",value:function(e,t,n){for(;e>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e,512);this.getLine().append(this.wrapMarks(new he(this.text.slice(this.textOff,this.textOff+s)),t),n),this.textOff+=s,e-=s,n=0}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i){var o=t-e;if(n instanceof Te)if(n.block){var a=n.type;a!=Ee.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new _e(n.widget||new Ie("div"),o,a))}else{var s=this.wrapMarks(me.create(n.widget||new Ie("span"),o,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(t,n,r,i){var o=new e(t,n,r);return o.openEnd=m.a.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),e}(),Ie=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).tag=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(e){return e.nodeName.toLowerCase()==this.tag}}]),n}(Se),$e=[],ze=h.g.define(),Be=h.g.define(),Fe=h.g.define(),We=h.g.define(),Ve=h.g.define(),He=h.g.define(),Qe=h.j.define({map:function(e,t){return e.map(t)}});function qe(e,t,n){var r=e.facet(We);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}var Ue=h.g.define({combine:function(e){return!e.length||e[0]}}),Xe=function e(t,n){Object(f.a)(this,e),this.field=t,this.get=n},Ye=function(){function e(){Object(f.a)(this,e)}return Object(d.a)(e,[{key:"from",value:function(e){return new Xe(this,e)}}],[{key:"define",value:function(){return new e}}]),e}();Ye.decorations=Ye.define(),Ye.atomicRanges=Ye.define(),Ye.scrollMargins=Ye.define();var Ge=0,Ke=h.g.define(),Je=function(){function e(t,n,r){Object(f.a)(this,e),this.id=t,this.create=n,this.fields=r,this.extension=Ke.of(this)}return Object(d.a)(e,null,[{key:"define",value:function(t,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations,s=[];if(o){var l,c=Object(u.a)(Array.isArray(o)?o:[o]);try{for(c.s();!(l=c.n()).done;){var f=l.value;s.push(f)}}catch(d){c.e(d)}finally{c.f()}}return i&&s.push(Ze.from((function(e){return{plugin:e,handlers:i}}))),a&&s.push(Ye.decorations.from(a)),new e(Ge++,t,s)}},{key:"fromClass",value:function(t,n){return e.define((function(e){return new t(e)}),n)}}]),e}(),Ze=Ye.define(),et=function(){function e(t){Object(f.a)(this,e),this.spec=t,this.mustUpdate=null,this.value=null}return Object(d.a)(e,[{key:"takeField",value:function(e,t){var n,r=Object(u.a)(this.spec.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.field,a=i.get;o==e&&t.push(a(this.value))}}catch(s){r.e(s)}finally{r.f()}}},{key:"update",value:function(t){if(this.value){if(this.mustUpdate){var n=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(n)}catch(r){if(qe(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}return e.dummy}}}else try{this.value=this.spec.create(t)}catch(r){return qe(t.state,r,"CodeMirror plugin crashed"),e.dummy}return this}},{key:"destroy",value:function(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(n){qe(e.state,n,"CodeMirror plugin crashed")}}}]),e}();et.dummy=new et(Je.define((function(){return{}})));var tt=h.g.define({combine:function(e){return e.reduce((function(e,t){return we(t,e)}),{})}}),nt=h.g.define({combine:function(e){return e.reduce((function(e,t){return we(t,e)}),{})}}),rt=h.g.define(),it=h.g.define(),ot=function(){function e(t,n,r,i){Object(f.a)(this,e),this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}return Object(d.a)(e,[{key:"join",value:function(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}},{key:"addToSet",value:function(e){for(var t=e.length,n=this;t>0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}}],[{key:"extendWithRanges",value:function(t,n){if(0==n.length)return t;for(var r=[],i=0,o=0,a=0,s=0;;i++){for(var l=i==t.length?null:t[i],c=a-s,u=l?l.fromB:1e9;o<n.length&&n[o]<u;){var f=n[o],d=n[o+1],h=Math.max(s,f),p=Math.min(u,d);if(h<=p&&new e(h+c,p+c,h,p).addToSet(r),d>u)break;o+=2}if(!l)return r;new e(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}]),e}(),at=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$e;Object(f.a)(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=h.c.empty(this.startState.doc.length);var i,o=Object(u.a)(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.changes=this.changes.compose(a.changes)}}catch(c){o.e(c)}finally{o.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new ot(e,t,n,r))})),this.changedRanges=s;var l=t.hasFocus;l!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=l,this.flags|=1),this.docChanged&&(this.flags|=2)}return Object(d.a)(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(10&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(e){return e.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),e}(),st=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(f.a)(this,n),(i=t.call(this)).view=e,i.compositionDeco=Ce.none,i.decorations=[],i.minWidth=0,i.minWidthFrom=0,i.minWidthTo=0,i.impreciseAnchor=null,i.impreciseHead=null,i.setDOM(e.contentDOM),i.children=[new Re],i.children[0].setParent(Object(r.a)(i)),i.updateInner([new ot(0,0,0,e.state.doc.length)],i.updateDeco(),0),i}return Object(d.a)(n,[{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}},{key:"update",value:function(e){var t=this,n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((function(e){var n=e.fromA;return e.toA<t.minWidthFrom||n>t.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Ce.none:e.transactions.length&&(this.compositionDeco=function(e,t){var n=e.observer.selectionRange,r=n.focusNode&&ft(n.focusNode,n.focusOffset,0);if(!r)return Ce.none;var i,o,a=e.docView.nearest(r),s=r;if(a instanceof de){for(;a.parent instanceof de;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof Re))return Ce.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var l=s.previousSibling;l&&!X.get(l);)l=l.previousSibling;i=o=l?X.get(l).posAtEnd:a.posAtStart}var c=t.mapPos(i,1),u=Math.max(c,t.mapPos(o,-1)),f=r.nodeValue,d=e.state;if(u-c<f.length)if(d.sliceDoc(c,Math.min(d.doc.length,c+f.length))==f)u=c+f.length;else{if(d.sliceDoc(Math.max(0,u-f.length),u)!=f)return Ce.none;c=u-f.length}else if(d.sliceDoc(c,u)!=f)return Ce.none;return Ce.set(Ce.replace({widget:new ut(s,r)}).range(c,u))}(this.view,e.changes));var r=(ue.ie||ue.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines,i=this.decorations,o=this.updateDeco(),a=function(e,t,n){var r=new ht;return m.a.compare(e,t,n,r),r.changes}(i,o,e.changes);n=ot.extendWithRanges(n,a);var s=e.transactions.some((function(e){return e.isUserEvent("select.pointer")}));return 0==this.dirty&&0==n.length&&!(4&e.flags)&&e.state.selection.main.from>=this.view.viewport.from&&e.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(r,s),!1):(this.updateInner(n,o,e.startState.doc.length,r,s),!0)}},{key:"updateInner",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(e,t,n);var a=this.view.observer;a.ignore((function(){r.dom.style.height=r.view.viewState.domHeight+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var e=ue.chrome||ue.ios?{node:a.selectionRange.focusNode,written:!1}:void 0;r.sync(e),r.dirty=0,e&&(e.written||a.selectionRange.focusNode!=e.node)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}));var s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length){var l,c=Object(u.a)(this.children);try{for(c.s();!(l=c.n()).done;){var f=l.value;f instanceof _e&&f.widget instanceof ct&&s.push(f.dom)}}catch(d){c.e(d)}finally{c.f()}}a.updateGaps(s)}},{key:"updateChildren",value:function(e,t,n){for(var r=this.childCursor(n),i=e.length-1;;i--){var o=i>=0?e[i]:null;if(!o)break;var a=o.fromA,s=o.toA,l=o.fromB,c=o.toB,u=Le.build(this.view.state.doc,l,c,t),f=u.content,d=u.breakAtStart,h=u.openStart,p=u.openEnd,v=r.findPos(s,1),m=v.i,g=v.off,y=r.findPos(a,-1),b=y.i,O=y.off;this.replaceRange(b,O,m,g,f,d,h,p)}}},{key:"replaceRange",value:function(e,t,n,r,i,o,a,s){var l=this.children[e],c=i.length?i[i.length-1]:null,u=c?c.breakAfter:o;if(e!=n||o||u||!(i.length<2)||!l.merge(t,r,i.length?c:null,0==t,a,s)){var f=this.children[n];for(r<f.length?(e==n&&(f=f.split(r),r=0),!u&&c&&f.merge(0,r,c,!0,0,s)?i[i.length-1]=f:(r&&f.merge(0,r,null,!1,0,s),i.push(f))):f.breakAfter&&(c?c.breakAfter=1:o=1),n++,l.breakAfter=o,t>0&&(!o&&i.length&&l.merge(t,l.length,i[0],!1,a,0)?l.breakAfter=i.shift().breakAfter:(t<l.length||l.children.length&&0==l.children[l.children.length-1].length)&&l.merge(t,l.length,null,!1,a,0),e++);e<n&&i.length;)if(this.children[n-1].match(i[i.length-1]))n--,i.pop();else{if(!this.children[e].match(i[0]))break;e++,i.shift()}(e<n||i.length)&&this.replaceChildren(e,n,i)}}},{key:"updateSelection",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!n&&!this.mayControlSelection()||ue.ios&&this.view.inputState.rapidCompositionStart)){var r=this.view.state.selection.main,i=this.domAtPos(r.anchor),o=r.empty?i:this.domAtPos(r.head);if(ue.gecko&&r.empty&&lt(i)){var a=document.createTextNode("");this.view.observer.ignore((function(){return i.node.insertBefore(a,i.node.childNodes[i.offset]||null)})),i=o=new q(a,0),t=!0}var s=this.view.observer.selectionRange;!t&&s.focusNode&&A(i.node,i.offset,s.anchorNode,s.anchorOffset)&&A(o.node,o.offset,s.focusNode,s.focusOffset)||(this.view.observer.ignore((function(){var t=C(e.root);if(r.empty){if(ue.gecko){var n=dt(i.node,i.offset);if(n&&3!=n){var a=ft(i.node,i.offset,1==n?1:-1);a&&(i=new q(a,1==n?0:a.nodeValue.length))}}t.collapse(i.node,i.offset),null!=r.bidiLevel&&null!=s.cursorBidiLevel&&(s.cursorBidiLevel=r.bidiLevel)}else if(t.extend)t.collapse(i.node,i.offset),t.extend(o.node,o.offset);else{var l=document.createRange();if(r.anchor>r.head){var c=[o,i];i=c[0],o=c[1]}l.setEnd(o.node,o.offset),l.setStart(i.node,i.offset),t.removeAllRanges(),t.addRange(l)}})),this.view.observer.setSelectionRange(i,o)),this.impreciseAnchor=i.precise?null:new q(s.anchorNode,s.anchorOffset),this.impreciseHead=o.precise?null:new q(s.focusNode,s.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.view.composing){var e=this.view.state.selection.main,t=C(this.root);if(e.empty&&e.assoc&&t.modify){var n=Re.find(this,e.head);if(n){var r=n.posAtStart;if(e.head!=r&&e.head!=r+n.length){var i=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(e.head+e.assoc);t.collapse(a.node,a.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(Ue)?this.root.activeElement==this.dom:P(this.dom,this.view.observer.selectionRange)}},{key:"nearest",value:function(e){for(var t=e;t;){var n=X.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;n<this.children.length-1;){var i=this.children[n];if(r<i.length||i instanceof Re)break;n++,r=0}return this.children[n].domAtPos(r)}},{key:"coordsAt",value:function(e,t){for(var n=this.length,r=this.children.length-1;;r--){var i=this.children[r],o=n-i.breakAfter-i.length;if(e>o||e==o&&i.type!=Ee.WidgetBefore&&i.type!=Ee.WidgetAfter&&(!r||2==t||this.children[r-1].breakAfter||this.children[r-1].type==Ee.WidgetBefore&&t>-2))return i.coordsAt(e-o,t);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var e=[],t=this.view.viewState.viewport,n=t.from,r=t.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;a<this.children.length;a++){var s=this.children[a],l=o+s.length;if(l>r)break;if(o>=n){e.push(s.dom.getBoundingClientRect().height);var c=s.dom.scrollWidth;c>i&&(this.minWidth=i=c,this.minWidthFrom=o,this.minWidthTo=l)}o=l+s.breakAfter}return e}},{key:"measureTextSize",value:function(){var e,t=this,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof Re){var i=r.measureTextSize();if(i)return i}}}catch(l){n.e(l)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(s);var e=T(s.firstChild)[0];o=s.getBoundingClientRect().height,a=e?e.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,t=this.children.length;return t&&(e-=this.children[--t].length),new K(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){for(var e=[],t=this.view.viewState,n=0,r=0;;r++){var i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=t.lineAt(o,0).bottom-t.lineAt(n,0).top;e.push(Ce.replace({widget:new ct(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Ce.set(e)}},{key:"updateDeco",value:function(){return this.decorations=[].concat(Object(c.a)(this.view.pluginField(Ye.decorations)),Object(c.a)(this.view.state.facet(rt)),[this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco])}},{key:"scrollRangeIntoView",value:function(e){var t,n=this.coordsAt(e.head,e.empty?e.assoc:e.head>e.anchor?-1:1);if(n){!e.empty&&(t=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(n={left:Math.min(n.left,t.left),top:Math.min(n.top,t.top),right:Math.max(n.right,t.right),bottom:Math.max(n.bottom,t.bottom)});var r,i=0,o=0,a=0,s=0,l=Object(u.a)(this.view.pluginField(Ye.scrollMargins));try{for(l.s();!(r=l.n()).done;){var c=r.value;if(c){var f=c.left,d=c.right,h=c.top,p=c.bottom;null!=f&&(i=Math.max(i,f)),null!=d&&(o=Math.max(o,d)),null!=h&&(a=Math.max(a,h)),null!=p&&(s=Math.max(s,p))}}}catch(v){l.e(v)}finally{l.f()}!function(e,t,n){for(var r=e.ownerDocument,i=r.defaultView,o=e.parentNode;o;)if(1==o.nodeType){var a=void 0,s=o==r.body;if(s)a=I(i);else{if(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth){o=o.parentNode;continue}var l=o.getBoundingClientRect();a={left:l.left,right:l.left+o.clientWidth,top:l.top,bottom:l.top+o.clientHeight}}var c=0,u=0;if(t.top<a.top?(u=-(a.top-t.top+5),n>0&&t.bottom>a.bottom+u&&(u=t.bottom-a.bottom+u+5)):t.bottom>a.bottom&&(u=t.bottom-a.bottom+5,n<0&&t.top-u<a.top&&(u=-(a.top+u-t.top+5))),t.left<a.left?(c=-(a.left-t.left+5),n>0&&t.right>a.right+c&&(c=t.right-a.right+c+5)):t.right>a.right&&(c=t.right-a.right+5,n<0&&t.left<a.left+c&&(c=-(a.left+c-t.left+5))),c||u)if(s)i.scrollBy(c,u);else{if(u){var f=o.scrollTop;o.scrollTop+=u,u=o.scrollTop-f}if(c){var d=o.scrollLeft;o.scrollLeft+=c,c=o.scrollLeft-d}t={left:t.left-c,top:t.top-u,right:t.right-c,bottom:t.bottom-u}}if(s)break;o=o.assignedSlot||o.parentNode}else{if(11!=o.nodeType)break;o=o.host}}(this.dom,{left:n.left-i,top:n.top-a,right:n.right+o,bottom:n.bottom+s},e.head<e.anchor?-1:1)}}}]),n}(X);function lt(e){return 1==e.node.nodeType&&e.node.firstChild&&(0==e.offset||"false"==e.node.childNodes[e.offset-1].contentEditable)&&(e.offset==e.node.childNodes.length||"false"==e.node.childNodes[e.offset].contentEditable)}var ct=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).height=e,r}return Object(d.a)(n,[{key:"toDOM",value:function(){var e=document.createElement("div");return this.updateDOM(e),e}},{key:"eq",value:function(e){return e.height==this.height}},{key:"updateDOM",value:function(e){return e.style.height=this.height+"px",!0}},{key:"estimatedHeight",get:function(){return this.height}}]),n}(Se);var ut=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).top=e,i.text=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return this.top==e.top&&this.text==e.text}},{key:"toDOM",value:function(){return this.top}},{key:"ignoreEvent",value:function(){return!1}},{key:"customView",get:function(){return ge}}]),n}(Se);function ft(e,t,n){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0&&n<=0)t=N(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t<e.childNodes.length&&n>=0))return null;e=e.childNodes[t],t=0}}}function dt(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t<e.childNodes.length&&"false"==e.childNodes[t].contentEditable?2:0)}var ht=function(){function e(){Object(f.a)(this,e),this.changes=[]}return Object(d.a)(e,[{key:"compareRange",value:function(e,t){De(e,t,this.changes)}},{key:"comparePoint",value:function(e,t){De(e,t,this.changes)}}]),e}();var pt=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(pt||(pt={})),vt=pt.LTR,mt=pt.RTL;function gt(e){for(var t=[],n=0;n<e.length;n++)t.push(1<<+e[n]);return t}for(var yt=gt("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),bt=gt("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ot=Object.create(null),kt=[],wt=0,xt=["()","[]","{}"];wt<xt.length;wt++){var jt=xt[wt],St=jt.charCodeAt(0),Et=jt.charCodeAt(1);Ot[St]=Et,Ot[Et]=-St}function Ct(e){return e<=247?yt[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?bt[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8203||8204==e?256:1}var Mt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,Pt=function(){function e(t,n,r){Object(f.a)(this,e),this.from=t,this.to=n,this.level=r}return Object(d.a)(e,[{key:"dir",get:function(){return this.level%2?mt:vt}},{key:"side",value:function(e,t){return this.dir==t==e?this.to:this.from}}],[{key:"find",value:function(e,t,n,r){for(var i=-1,o=0;o<e.length;o++){var a=e[o];if(a.from<=t&&a.to>=t){if(a.level==n)return o;(i<0||(0!=r?r<0?a.from<t:a.to>t:e[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}(),Tt=[];function At(e,t){var n=e.length,r=t==vt?1:2,i=t==vt?2:1;if(!e||1==r&&!Mt.test(e))return Dt(n);for(var o=0,a=r,s=r;o<n;o++){var l=Ct(e.charCodeAt(o));512==l?l=a:8==l&&4==s&&(l=16),Tt[o]=4==l?2:l,7&l&&(s=l),a=l}for(var c=0,u=r,f=r;c<n;c++){var d=Tt[c];if(128==d)c<n-1&&u==Tt[c+1]&&24&u?d=Tt[c]=u:Tt[c]=256;else if(64==d){for(var h=c+1;h<n&&64==Tt[h];)h++;for(var p=c&&8==u||h<n&&8==Tt[h]?1==f?1:8:256,v=c;v<h;v++)Tt[v]=p;c=h-1}else 8==d&&1==f&&(Tt[c]=1);u=d,7&d&&(f=d)}for(var m,g,y,b=0,O=0,k=0;b<n;b++)if(g=Ot[m=e.charCodeAt(b)])if(g<0){for(var w=O-3;w>=0;w-=3)if(kt[w+1]==-g){var x=kt[w+2],j=2&x?r:4&x?1&x?i:r:0;j&&(Tt[b]=Tt[kt[w]]=j),O=w;break}}else{if(189==kt.length)break;kt[O++]=b,kt[O++]=m,kt[O++]=k}else if(2==(y=Tt[b])||1==y){var S=y==r;k=S?0:1;for(var E=O-3;E>=0;E-=3){var C=kt[E+2];if(2&C)break;if(S)kt[E+2]|=2;else{if(4&C)break;kt[E+2]|=4}}}for(var M=0;M<n;M++)if(256==Tt[M]){for(var P=M+1;P<n&&256==Tt[P];)P++;for(var T=1==(M?Tt[M-1]:r),A=T==(1==(P<n?Tt[P]:r))?T?1:2:r,D=M;D<P;D++)Tt[D]=A;M=P-1}var R=[];if(1==r)for(var N=0;N<n;){for(var _=N,L=1!=Tt[N++];N<n&&L==(1!=Tt[N]);)N++;if(L)for(var I=N;I>_;){for(var $=I,z=2!=Tt[--I];I>_&&z==(2!=Tt[I-1]);)I--;R.push(new Pt(I,$,z?2:1))}else R.push(new Pt(_,N,0))}else for(var B=0;B<n;){for(var F=B,W=2==Tt[B++];B<n&&W==(2==Tt[B]);)B++;R.push(new Pt(F,B,W?1:2))}return R}function Dt(e){return[new Pt(0,e,0)]}var Rt="";function Nt(e,t,n,r,i){var o,a=r.head-e.from,s=-1;if(0==a){if(!i||!e.length)return null;t[0].level!=n&&(a=t[0].side(!1,n),s=0)}else if(a==e.length){if(i)return null;var l=t[t.length-1];l.level!=n&&(a=l.side(!0,n),s=t.length-1)}s<0&&(s=Pt.find(t,a,null!==(o=r.bidiLevel)&&void 0!==o?o:-1,r.assoc));var c=t[s];a==c.side(i,n)&&(a=(c=t[s+=i?1:-1]).side(!i,n));var u=i==(c.dir==n),f=Object(p.e)(e.text,a,u);if(Rt=e.text.slice(Math.min(a,f),Math.max(a,f)),f!=c.side(i,n))return h.e.cursor(f+e.from,u?-1:1,c.level);var d=s==(i?t.length-1:0)?null:t[s+(i?1:-1)];return d||c.level==n?d&&d.level<c.level?h.e.cursor(d.side(!i,n)+e.from,i?1:-1,d.level):h.e.cursor(f+e.from,i?-1:1,c.level):h.e.cursor(i?e.to:e.from,i?-1:1,n)}function _t(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function Lt(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function It(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function $t(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function zt(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Bt(e,t,n){for(var r,i,o,a,s,l,c,u,f=e.firstChild;f;f=f.nextSibling)for(var d=T(f),h=0;h<d.length;h++){var p=d[h];i&&It(i,p)&&(p=$t(zt(p,i.bottom),i.top));var v=_t(t,p),m=Lt(n,p);if(0==v&&0==m)return 3==f.nodeType?Ft(f,t,n):Bt(f,t,n);(!r||a>m||a==m&&o>v)&&(r=f,i=p,o=v,a=m),0==v?n>p.bottom&&(!c||c.bottom<p.bottom)?(s=f,c=p):n<p.top&&(!u||u.top>p.top)&&(l=f,u=p):c&&It(c,p)?c=zt(c,p.bottom):u&&It(u,p)&&(u=$t(u,p.top))}if(c&&c.bottom>=n?(r=s,i=c):u&&u.top<=n&&(r=l,i=u),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?Ft(r,g,n):o||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:Bt(r,g,n)}function Ft(e,t,n){for(var r=e.nodeValue.length,i=-1,o=1e9,a=0,s=0;s<r;s++)for(var l=W(e,s,s+1).getClientRects(),c=0;c<l.length;c++){var u=l[c];if(u.top!=u.bottom){a||(a=t-u.left);var f=(u.top>n?u.top-n:n-u.bottom)-1;if(u.left-1<=t&&u.right+1>=t&&f<o){var d=t>=(u.left+u.right)/2,h=d;if(ue.chrome||ue.gecko)W(e,s).getBoundingClientRect().left==u.right&&(h=!d);if(f<=0)return{node:e,offset:s+(h?1:0)};i=s+(h?1:0),o=f}}}return{node:e,offset:i>-1?i:a>0?e.nodeValue.length:0}}function Wt(e,t,n){for(var r,i=t.x,o=t.y,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=e.contentDOM.getBoundingClientRect(),l=e.defaultLineHeight/2,c=!1;;){if((r=e.blockAtHeight(o,s.top)).top>o||r.bottom<o){if(a=r.top>o?-1:1,o=Math.min(r.bottom-l,Math.max(r.top+l,o)),c)return n?null:0;c=!0}if(r.type==Ee.Text)break;o=a>0?r.bottom+l:r.top-l}var u=r.from;if(i=Math.max(s.left+1,Math.min(s.right-1,i)),u<e.viewport.from)return 0==e.viewport.from?0:Vt(e,s,r,i,o);if(u>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:Vt(e,s,r,i,o);var f,d=e.dom.ownerDocument,h=(e.root.elementFromPoint?e.root:d).elementFromPoint(i,o),p=-1;if(h&&e.contentDOM.contains(h)&&!(e.docView.nearest(h)instanceof me))if(d.caretPositionFromPoint){var v=d.caretPositionFromPoint(i,o);v&&(f=v.offsetNode,p=v.offset)}else if(d.caretRangeFromPoint){var m=d.caretRangeFromPoint(i,o);m&&(f=m.startContainer,p=m.startOffset,ue.safari&&Ht(f,p,i)&&(f=void 0))}if(!f||!e.docView.dom.contains(f)){var g=Re.find(e.docView,u),y=Bt(g.dom,i,o);f=y.node,p=y.offset}return e.docView.posFromDOM(f,p)}function Vt(e,t,n,r,i){var o=Math.round((r-t.left)*e.defaultCharacterWidth);e.lineWrapping&&n.height>1.5*e.defaultLineHeight&&(o+=Math.floor((i-n.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);var a=e.state.sliceDoc(n.from,n.to);return n.from+Object(p.f)(a,o,e.state.tabSize)}function Ht(e,t,n){var r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(var i=e.nextSibling;i;i=i.nextSibling)if(1!=i.nodeType||"BR"!=i.nodeName)return!1;return W(e,r-1,r).getBoundingClientRect().left>n}function Qt(e,t,n,r){var i=e.state.doc.lineAt(t.head),o=r&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){var a=e.dom.getBoundingClientRect(),s=e.posAtCoords({x:n==(e.textDirection==pt.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(null!=s)return h.e.cursor(s,n?-1:1)}var l=Re.find(e.docView,t.head),c=l?n?l.posAtEnd:l.posAtStart:n?i.to:i.from;return h.e.cursor(c,n?-1:1)}function qt(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=t,s=null;;){var l=Nt(i,o,e.textDirection,a,n),c=Rt;if(!l){if(i.number==(n?e.state.doc.lines:1))return a;c="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),l=h.e.cursor(n?i.from:i.to)}if(s){if(!s(c))return a}else{if(!r)return l;s=r(c)}a=l}}function Ut(e,t,n){for(var r=e.pluginField(Ye.atomicRanges);;){var i,o=!1,a=Object(u.a)(r);try{for(a.s();!(i=a.n()).done;){i.value.between(n.from-1,n.from+1,(function(e,r,i){n.from>e&&n.from<r&&(n=t.from>n.from?h.e.cursor(e,1):h.e.cursor(r,-1),o=!0)}))}}catch(s){a.e(s)}finally{a.f()}if(!o)return n}}var Xt=function(){function e(t){var n=this;Object(f.a)(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.pendingIOSKey=null,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;var r=function(e){var r=Jt[e];t.contentDOM.addEventListener(e,(function(i){"keydown"==e&&n.keydown(t,i)||Kt(t,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&t.observer.forceFlush(),n.runCustomHandlers(e,t,i)?i.preventDefault():r(t,i))})),n.registeredEvents.push(e)};for(var i in Jt)r(i);this.notifiedFocused=t.hasFocus,this.ensureHandlers(t),ue.safari&&t.contentDOM.addEventListener("input",(function(){return null}))}return Object(d.a)(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e){var t,n=this,r=this.customHandlers=e.pluginField(Ze),i=Object(u.a)(r);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=function(t){n.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(n.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(r){Kt(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var s in o.handlers)a(s)}}catch(l){i.e(l)}finally{i.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=Object(u.a)(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[e],s=!1;if(a){try{s=a.call(o.plugin,n,t)}catch(l){qe(t.state,l)}if(s||n.defaultPrevented)return ue.android&&"keydown"==e&&13==n.keyCode&&t.observer.flushSoon(),!0}}}catch(c){i.e(c)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){var n,r=Object(u.a)(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.handlers.scroll;if(o)try{o.call(i.plugin,t,e)}catch(a){qe(e.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"keydown",value:function(e,t){var n=this;return this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),!!this.screenKeyEvent(e,t)||!(!ue.ios||13!=t.keyCode&&8!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey||t.synthetic)&&(this.pendingIOSKey=13==t.keyCode?"enter":"backspace",setTimeout((function(){return n.flushIOSKey(e)}),250),!0)}},{key:"flushIOSKey",value:function(e){if(!this.pendingIOSKey)return!1;var t=e.contentDOM,n=this.pendingIOSKey;return this.pendingIOSKey=null,"enter"==n?V(t,"Enter",13):V(t,"Backspace",8)}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(ue.safari&&Date.now()-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"screenKeyEvent",value:function(e,t){var n=9==t.keyCode&&Date.now()<this.lastEscPress+2e3;return 27==t.keyCode?this.lastEscPress=Date.now():Yt.indexOf(t.keyCode)<0&&(this.lastEscPress=0),n}},{key:"mustFlushObserver",value:function(e){return"keydown"==e.type&&229!=e.keyCode||"compositionend"==e.type&&!ue.ios}},{key:"startMouseSelection",value:function(e,t,n){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=new Gt(this,e,t,n)}},{key:"update",value:function(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}(),Yt=[16,17,18,20,91,92,224,225],Gt=function(){function e(t,n,r,i){Object(f.a)(this,e),this.inputState=t,this.view=n,this.style=i,this.lastEvent=r;var o=n.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=n.state.facet(h.f.allowMultipleSelections)&&function(e,t){var n=e.state.facet(ze);return n.length?n[0](t):ue.mac?t.metaKey:t.ctrlKey}(n,r),this.dragMove=function(e,t){var n=e.state.facet(Be);return n.length?n[0](t):ue.mac?!t.altKey:!t.ctrlKey}(n,r),this.dragging=!!function(e,t){if(e.state.selection.main.empty)return!1;var n=C(e.root);if(0==n.rangeCount)return!0;for(var r=n.getRangeAt(0).getClientRects(),i=0;i<r.length;i++){var o=r[i];if(o.left<=t.clientX&&o.right>=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}(n,r)&&null,!1===this.dragging&&(r.preventDefault(),this.select(r))}return Object(d.a)(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0})}},{key:"update",value:function(e){var t=this;e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((function(){return t.select(t.lastEvent)}),20)}}]),e}();function Kt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=X.get(r))&&n.ignoreEvent(t))return!1;return!0}var Jt=Object.create(null),Zt=ue.ie&&ue.ie_version<15||ue.ios&&ue.webkit_version<604;function en(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length,s=null!=hn&&r.selection.ranges.every((function(e){return e.empty}))&&hn==o.toString();if(s){var l=-1;n=r.changeByRange((function(e){var n=r.doc.lineAt(e.from);if(n.from==l)return{range:e};l=n.from;var s=r.toText((a?o.line(i++).text:t)+r.lineBreak);return{changes:{from:n.from,insert:s},range:h.e.cursor(e.from+s.length)}}))}else n=a?r.changeByRange((function(e){var t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:h.e.cursor(e.from+t.length)}})):r.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Jt.keydown=function(e,t){e.inputState.setSelectionOrigin("select")};var tn=0;function nn(e,t,n,r){if(1==r)return h.e.cursor(t,n);if(2==r)return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return h.e.cursor(t);0==o?n=1:o==i.length&&(n=-1);var a=o,s=o;n<0?a=Object(p.e)(i.text,o,!1):s=Object(p.e)(i.text,o);for(var l=r(i.text.slice(a,s));a>0;){var c=Object(p.e)(i.text,a,!1);if(r(i.text.slice(c,a))!=l)break;a=c}for(;s<i.length;){var u=Object(p.e)(i.text,s);if(r(i.text.slice(s,u))!=l)break;s=u}return h.e.range(a+i.from,s+i.from)}(e.state,t,n);var i=Re.find(e.docView,t),o=e.state.doc.lineAt(i?i.posAtEnd:t),a=i?i.posAtStart:o.from,s=i?i.posAtEnd:o.to;return s<e.state.doc.length&&s==o.to&&s++,h.e.range(a,s)}Jt.touchstart=function(e,t){tn=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},Jt.touchmove=function(e){e.inputState.setSelectionOrigin("select.pointer")},Jt.mousedown=function(e,t){if(e.observer.flush(),!(tn>Date.now()-2e3)){var n,r=null,i=Object(u.a)(e.state.facet(Fe));try{for(i.s();!(n=i.n()).done;){if(r=(0,n.value)(e,t))break}}catch(o){i.e(o)}finally{i.f()}r||0!=t.button||(r=function(e,t){var n=sn(e,t),r=function(e){if(!ln)return e.detail;var t=cn,n=fn;return cn=e,fn=Date.now(),un=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(un+1)%3:1}(t),i=e.state.selection,o=n,a=t;return{update:function(e){e.changes&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes),a=null)},get:function(t,s,l){var c;if(a&&t.clientX==a.clientX&&t.clientY==a.clientY?c=o:(c=o=sn(e,t),a=t),!c||!n)return i;var u=nn(e,c.pos,c.bias,r);if(n.pos!=c.pos&&!s){var f=nn(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),p=Math.max(f.to,u.to);u=d<u.from?h.e.range(d,p):h.e.range(p,d)}return s?i.replaceRange(i.main.extend(u.from,u.to)):l?i.addRange(u):h.e.create([u])}}}(e,t)),r&&(e.root.activeElement!=e.contentDOM&&e.observer.ignore((function(){return F(e.contentDOM)})),e.inputState.startMouseSelection(e,t,r))}};var rn=function(e,t){return e>=t.top&&e<=t.bottom},on=function(e,t,n){return rn(t,n)&&e>=n.left&&e<=n.right};function an(e,t,n,r){var i=Re.find(e.docView,t);if(!i)return 1;var o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&on(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&on(n,r,s)?1:a&&rn(r,a)?-1:1}function sn(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:an(e,n,t.clientX,t.clientY)}}var ln=ue.ie&&ue.ie_version<=11,cn=null,un=0,fn=0;function dn(e,t,n,r){var i=e.posAtCoords({x:t.clientX,y:t.clientY});if(null!=i&&n){t.preventDefault();var o=e.inputState.mouseSelection,a=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:i,insert:n},l=e.state.changes(a?[a,s]:s);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"})}}Jt.dragstart=function(e,t){var n=e.state.selection.main,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},Jt.drop=function(e,t){if(t.dataTransfer){if(e.state.readOnly)return t.preventDefault();var n=t.dataTransfer.files;n&&n.length?function(){t.preventDefault();for(var r=Array(n.length),i=0,o=function(){++i==n.length&&dn(e,t,r.filter((function(e){return null!=e})).join(e.state.lineBreak),!1)},a=function(e){var t=new FileReader;t.onerror=o,t.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])},s=0;s<n.length;s++)a(s)}():dn(e,t,t.dataTransfer.getData("Text"),!0)}},Jt.paste=function(e,t){if(e.state.readOnly)return t.preventDefault();e.observer.flush();var n=Zt?null:t.clipboardData;n?(en(e,n.getData("text/plain")),t.preventDefault()):function(e){var t=e.dom.parentNode;if(t){var n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){e.focus(),n.remove(),en(e,n.value)}),50)}}(e)};var hn=null;function pn(e,t){if(e.docView.compositionDeco.size){e.inputState.rapidCompositionStart=t;try{e.update([])}finally{e.inputState.rapidCompositionStart=!1}}}Jt.copy=Jt.cut=function(e,t){var n=function(e){var t,n=[],r=[],i=!1,o=Object(u.a)(e.selection.ranges);try{for(o.s();!(t=o.n()).done;){var a=t.value;a.empty||(n.push(e.sliceDoc(a.from,a.to)),r.push(a))}}catch(h){o.e(h)}finally{o.f()}if(!n.length){var s,l=-1,c=Object(u.a)(e.selection.ranges);try{for(c.s();!(s=c.n()).done;){var f=s.value.from,d=e.doc.lineAt(f);d.number>l&&(n.push(d.text),r.push({from:d.from,to:Math.min(e.doc.length,d.to+1)})),l=d.number}}catch(h){c.e(h)}finally{c.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r||o){hn=o?r:null;var a=Zt?null:t.clipboardData;a?(t.preventDefault(),a.clearData(),a.setData("text/plain",r)):function(e,t){var n=e.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((function(){r.remove(),e.focus()}),50)}}(e,r),"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})}},Jt.focus=Jt.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},Jt.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},Jt.compositionstart=Jt.compositionupdate=function(e){null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.docView.compositionDeco.size&&(e.observer.flush(),pn(e,!0)),e.inputState.composing=0)},Jt.compositionend=function(e){e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((function(){e.inputState.composing<0&&pn(e,!1)}),50)},Jt.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()};var vn=["pre-wrap","normal","pre-line"],mn=function(){function e(){Object(f.a)(this,e),this.doc=p.a.empty,this.lineWrapping=!1,this.direction=pt.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return Object(d.a)(e,[{key:"heightForGap",value:function(e,t){var n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(e){return this.doc=e,this}},{key:"mustRefresh",value:function(e,t,n){for(var r=!1,i=0;i<e.length;i++){var o=e[i];o<0?i++:this.heightSamples[Math.floor(10*o)]||(r=!0,this.heightSamples[Math.floor(10*o)]=!0)}return r||vn.indexOf(t)>-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(e,t,n,r,i,o){var a=vn.indexOf(e)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=t;if(this.lineWrapping=a,this.direction=t,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var l=0;l<o.length;l++){var c=o[l];c<0?l++:this.heightSamples[Math.floor(10*c)]=!0}}return s}}]),e}(),gn=function(){function e(t,n){Object(f.a)(this,e),this.from=t,this.heights=n,this.index=0}return Object(d.a)(e,[{key:"more",get:function(){return this.index<this.heights.length}}]),e}(),yn=function(){function e(t,n,r,i,o){Object(f.a)(this,e),this.from=t,this.length=n,this.top=r,this.height=i,this.type=o}return Object(d.a)(e,[{key:"to",get:function(){return this.from+this.length}},{key:"bottom",get:function(){return this.top+this.height}},{key:"join",value:function(t){var n=(Array.isArray(this.type)?this.type:[this]).concat(Array.isArray(t.type)?t.type:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}}]),e}(),bn=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(bn||(bn={})),On=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;Object(f.a)(this,e),this.length=t,this.height=n,this.flags=r}return Object(d.a)(e,[{key:"outdated",get:function(){return(2&this.flags)>0},set:function(e){this.flags=(e?2:0)|-3&this.flags}},{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>1e-4&&(e.heightChanged=!0),this.height=t)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,l=a.toA,c=a.fromB,u=a.toB,f=i.lineAt(s,bn.ByPosNoHeight,t,0,0),d=f.to>=l?f:i.lineAt(l,bn.ByPosNoHeight,t,0,0);for(u+=d.to-l,l=d.to;o>0&&f.from<=r[o-1].toA;)s=r[o-1].fromA,c=r[o-1].fromB,o--,s<f.from&&(f=i.lineAt(s,bn.ByPosNoHeight,t,0,0));c+=f.from-s,s=f.from;var h=En.build(n,e,c,u);i=i.replace(s,l,h)}return i.updateHeight(n,0)}}],[{key:"empty",value:function(){return new wn(0,0)}},{key:"of",value:function(t){if(1==t.length)return t[0];for(var n=0,r=t.length,i=0,o=0;;)if(n==r)if(i>2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i<o){var l=t[n++];l&&(i+=l.size)}else{var c=t[--r];c&&(o+=c.size)}var u=0;return null==t[n-1]?(u=1,n--):null==t[n]&&(u=1,r++),new jn(e.of(t.slice(0,n)),u,e.of(t.slice(r)))}}]),e}();On.prototype.size=1;var kn=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this,e,r)).type=i,o}return Object(d.a)(n,[{key:"blockAt",value:function(e,t,n,r){return new yn(r,this.length,n,this.height,this.type)}},{key:"lineAt",value:function(e,t,n,r,i){return this.blockAt(0,n,r,i)}},{key:"forEachLine",value:function(e,t,n,r,i,o){o(this.blockAt(0,n,r,i))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(On),wn=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this,e,r,Ee.Text)).collapsed=0,i.widgetHeight=0,i}return Object(d.a)(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof xn&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof xn?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):On.of(r)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(kn),xn=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,e,0)}return Object(d.a)(n,[{key:"lines",value:function(e,t){var n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(e,t,n,r){var i=this.lines(t,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,l=Math.max(0,Math.min(a-o,Math.floor((e-n)/s))),c=t.line(o+l),u=c.from,f=c.length;return new yn(u,f,n+s*l,s,Ee.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==bn.ByHeight)return this.blockAt(e,n,r,i);if(t==bn.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new yn(a,s-a,0,0,Ee.Text)}var l=this.lines(n,i),c=l.firstLine,u=l.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new yn(d,h,r+u*(p-c),u,Ee.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,l=a.lineHeight,c=Math.max(e,i),u=Math.min(i+this.length,t);c<=u;){var f=n.lineAt(c);c==e&&(r+=l*(f.number-s)),o(new yn(f.from,f.length,r,l,Ee.Text)),r+=l,c=f.to+1}}},{key:"replace",value:function(e,t,r){var i=this.length-t;if(i>0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(e>0){var a=r[0];a instanceof n?r[0]=new n(e+a.length):r.unshift(new n(e-1),null)}return On.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(new n(e-1),null)}},{key:"decomposeRight",value:function(e,t){t.push(null,new n(this.length-e-1))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=t+this.length;if(i&&i.from<=t+this.length&&i.more){var a=[],s=Math.max(t,i.from);for(i.from>t&&a.push(new n(i.from-t-1).updateHeight(e,t));s<=o&&i.more;){var l=e.doc.lineAt(s).length;a.length&&a.push(null);var c=new wn(l,i.heights[i.index++]);c.outdated=!1,a.push(c),s+=l+1}return s<=o&&a.push(null,new n(o-s).updateHeight(e,s)),e.heightChanged=!0,On.of(a)}return(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(On),jn=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this,e.length+r+i.length,e.height+i.height,r|(e.outdated||i.outdated?2:0))).left=e,o.right=i,o.size=e.size+i.size,o}return Object(d.a)(n,[{key:"break",get:function(){return 1&this.flags}},{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return e<i||0==this.right.height?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}},{key:"lineAt",value:function(e,t,n,r,i){var o=r+this.left.height,a=i+this.left.length+this.break,s=t==bn.ByHeight?e<o||0==this.right.height:e<a,l=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,o,a);if(this.break||(s?l.to<a:l.from>a))return l;var c=t==bn.ByPosNoHeight?bn.ByPosNoHeight:bn.ByPos;return s?l.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,i).join(l)}},{key:"forEachLine",value:function(e,t,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,o),t>=s&&this.right.forEachLine(e,t,n,a,s,o);else{var l=this.lineAt(s,bn.ByPos,n,r,i);e<l.from&&this.left.forEachLine(e,l.from-1,n,r,i,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,s,o)}}},{key:"replace",value:function(e,t,n){var r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));var i=[];e>0&&this.decomposeLeft(e,i);var o,a=i.length,s=Object(u.a)(n);try{for(s.s();!(o=s.n()).done;){var l=o.value;i.push(l)}}catch(f){s.e(f)}finally{s.f()}if(e>0&&Sn(i,a-1),t<this.length){var c=i.length;this.decomposeRight(t,i),Sn(i,c)}return On.of(i)}},{key:"decomposeLeft",value:function(e,t){var n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}},{key:"decomposeRight",value:function(e,t){var n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}},{key:"balanced",value:function(e,t){return e.size>2*t.size||t.size>2*e.size?On.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}}]),n}(On);function Sn(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof xn&&(r=e[t+1])instanceof xn&&e.splice(t-1,3,new xn(n.length+1+r.length))}var En=function(){function e(t,n){Object(f.a)(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Object(d.a)(e,[{key:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}},{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof wn?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new wn(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}},{key:"point",value:function(e,t,n){if(e<t||n.heightRelevant){var r=n.widget?Math.max(0,n.widget.estimatedHeight):0,i=t-e;n.block?this.addBlock(new kn(i,r,n.type)):(i||r>=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}},{key:"enterLine",value:function(){if(!(this.lineStart>-1)){var e=this.oracle.doc.lineAt(this.pos),t=e.from,n=e.to;this.lineStart=t,this.lineEnd=n,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new wn(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new xn(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof wn)return e;var t=new wn(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=Ee.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Ee.WidgetBefore&&(this.covering=e)}},{key:"addLineDeco",value:function(e,t){var n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}},{key:"finish",value:function(e){var t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof wn||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new wn(0,-1));var n,r=e,i=Object(u.a)(this.nodes);try{for(i.s();!(n=i.n()).done;){var o=n.value;o instanceof wn&&o.updateHeight(this.oracle,r),r+=o?o.length:1}}catch(a){i.e(a)}finally{i.f()}return this.nodes}}],[{key:"build",value:function(t,n,r,i){var o=new e(r,t);return m.a.spans(n,r,i,o,0),o.finish(r)}}]),e}();function Cn(e,t,n){var r=new Mn;return m.a.compare(e,t,n,r,0),r.changes}var Mn=function(){function e(){Object(f.a)(this,e),this.changes=[]}return Object(d.a)(e,[{key:"compareRange",value:function(){}},{key:"comparePoint",value:function(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&De(e,t,this.changes,5)}}]),e}();var Pn=function(){function e(t,n,r){Object(f.a)(this,e),this.from=t,this.to=n,this.size=r}return Object(d.a)(e,[{key:"draw",value:function(e){return Ce.replace({widget:new Tn(this.size,e)}).range(this.from,this.to)}}],[{key:"same",value:function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}}]),e}(),Tn=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).size=e,i.vertical=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return e.size==this.size&&e.vertical==this.vertical}},{key:"toDOM",value:function(){var e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}},{key:"estimatedHeight",get:function(){return this.vertical?this.size:-1}}]),n}(Se),An=function(){function e(t){Object(f.a)(this,e),this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentWidth=0,this.heightOracle=new mn,this.scaler=Ln,this.scrollTo=null,this.printing=!1,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1,this.heightMap=On.empty().applyChanges(t.facet(rt),p.a.empty,this.heightOracle.setDoc(t.doc),[new ot(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ce.set(this.lineGaps.map((function(e){return e.draw(!1)}))),this.computeVisibleRanges()}return Object(d.a)(e,[{key:"updateForViewport",value:function(){for(var e=this,t=[this.viewport],n=this.state.selection.main,r=function(r){var i=r?n.head:n.anchor;if(!t.some((function(e){var t=e.from,n=e.to;return i>=t&&i<=n}))){var o=e.lineAt(i,0),a=o.from,s=o.to;t.push(new Dn(a,s))}},i=0;i<=1;i++)r(i);this.viewports=t.sort((function(e,t){return e.from-t.from})),this.scaler=this.heightMap.height<=7e6?Ln:new In(this.heightOracle.doc,this.heightMap,this.viewports)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=e.state;var r=this.state.facet(rt),i=e.changedRanges,o=ot.extendWithRanges(i,Cn(e.startState.facet(rt),r,e?e.changes:h.c.empty(this.state.doc.length))),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(r,n.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=a&&(e.flags|=2);var s=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.head<s.from||t.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t)),this.viewport=s,this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTo=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e,t){var n=e.dom,r="",i=pt.LTR,o=0;if(!t){var a=window.getComputedStyle(n);r=a.whiteSpace,i="rtl"==a.direction?pt.RTL:pt.LTR;var s=parseInt(a.paddingTop)||0,l=parseInt(a.paddingBottom)||0;this.paddingTop==s&&this.paddingBottom==l||(o|=8,this.paddingTop=s,this.paddingBottom=l)}var c=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(e,t){for(var n=e.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),o=Math.max(0,n.top),a=Math.min(innerHeight,n.bottom),s=e.parentNode;s;)if(1==s.nodeType){var l=window.getComputedStyle(s);if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=l.overflow){var c=s.getBoundingClientRect();r=Math.max(r,c.left),i=Math.min(i,c.right),o=Math.max(o,c.top),a=Math.min(a,c.bottom)}s="absolute"==l.position||"fixed"==l.position?s.offsetParent:s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+t),bottom:a-(n.top+t)}}(n,this.paddingTop),u=c.top-this.pixelViewport.top,f=c.bottom-this.pixelViewport.bottom;if(this.pixelViewport=c,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var d=e.measureVisibleLineHeights(),h=!1,p=0,v=this.heightOracle;if(!t){var m=e.dom.clientWidth;if(v.mustRefresh(d,r,i)||v.lineWrapping&&Math.abs(m-this.contentWidth)>v.charWidth){var g=e.measureTextSize(),y=g.lineHeight,b=g.charWidth;(h=v.refresh(r,i,y,b,m/b,d))&&(e.minWidth=0,o|=8)}this.contentWidth!=m&&(this.contentWidth=m,o|=8),u>0&&f>0?p=Math.max(u,f):u<0&&f<0&&(p=Math.min(u,f))}return v.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(v,0,h,new gn(this.viewport.from,d)),v.heightChanged&&(o|=2),(!this.viewportIsAppropriate(this.viewport,p)||this.scrollTo&&(this.scrollTo.head<this.viewport.from||this.scrollTo.head>this.viewport.to))&&(this.viewport=this.getViewport(p,this.scrollTo)),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&this.updateLineGaps(this.ensureLineGaps(h?[]:this.lineGaps)),o|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.enforceCursorAssoc()),o}},{key:"visibleTop",get:function(){return this.scaler.fromDOM(this.pixelViewport.top,0)}},{key:"visibleBottom",get:function(){return this.scaler.fromDOM(this.pixelViewport.bottom,0)}},{key:"getViewport",value:function(e,t){var n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.visibleTop,a=this.visibleBottom,s=new Dn(r.lineAt(o-1e3*n,bn.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),bn.ByHeight,i,0,0).to);if(t)if(t.head<s.from){var l=r.lineAt(t.head,bn.ByPos,i,0,0).top;s=new Dn(r.lineAt(l-500,bn.ByHeight,i,0,0).from,r.lineAt(l+(a-o)+500,bn.ByHeight,i,0,0).to)}else if(t.head>s.to){var c=r.lineAt(t.head,bn.ByPos,i,0,0).bottom;s=new Dn(r.lineAt(c-(a-o)-500,bn.ByHeight,i,0,0).from,r.lineAt(c+500,bn.ByHeight,i,0,0).to)}return s}},{key:"mapViewport",value:function(e,t){var n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Dn(this.heightMap.lineAt(n,bn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,bn.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(e){var t=e.from,n=e.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(t,bn.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,bn.ByPos,this.state.doc,0,0),s=a.bottom,l=this.visibleTop,c=this.visibleBottom;return(0==t||o<=l-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=c+Math.max(10,Math.min(r,250)))&&o>l-2e3&&s<c+2e3}},{key:"mapLineGaps",value:function(e,t){if(!e.length||t.empty)return e;var n,r=[],i=Object(u.a)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.touchesRange(o.from,o.to)||r.push(new Pn(t.mapPos(o.from),t.mapPos(o.to),o.size))}}catch(a){i.e(a)}finally{i.f()}return r}},{key:"ensureLineGaps",value:function(e){var t=this,n=[];return this.heightOracle.direction!=pt.LTR||this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(function(r){if(!(r.length<1e4)){var i=function(e,t,n){var r=[],i=e,o=0;m.a.spans(n.facet(rt),e,t,{span:function(){},point:function(e,t){e>i&&(r.push({from:i,to:e}),o+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),o+=t-i);return{total:o,ranges:r}}(r.from,r.to,t.state);if(!(i.total<1e4)){var o,a;if(t.heightOracle.lineWrapping)o=r.from!=t.viewport.from?r.from:Rn(i,(t.visibleTop-r.top)/r.height),a=r.to!=t.viewport.to?r.to:Rn(i,(t.visibleBottom-r.top)/r.height);else{var s=i.total*t.heightOracle.charWidth;o=Rn(i,t.pixelViewport.left/s),a=Rn(i,t.pixelViewport.right/s)}var l=t.state.selection.main;l.from<=o&&l.to>=r.from&&(o=l.from),l.from<=r.to&&l.to>=a&&(a=l.to);var c=o-1e4,u=a+1e4;c>r.from+5e3&&n.push(_n(e,(function(e){return e.from==r.from&&e.to>c-5e3&&e.to<c+5e3}))||new Pn(r.from,c,t.gapSize(r,c,!0,i))),u<r.to-5e3&&n.push(_n(e,(function(e){return e.to==r.to&&e.from>u-5e3&&e.from<u+5e3}))||new Pn(u,r.to,t.gapSize(r,u,!1,i)))}}})),n}},{key:"gapSize",value:function(e,t,n,r){if(this.heightOracle.lineWrapping){var i=e.height*Nn(r,t);return n?i:e.height-i}var o=Nn(r,t);return r.total*this.heightOracle.charWidth*(n?o:1-o)}},{key:"updateLineGaps",value:function(e){var t=this;Pn.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ce.set(e.map((function(e){return e.draw(t.heightOracle.lineWrapping)}))))}},{key:"computeVisibleRanges",value:function(){var e=this.state.facet(rt);this.lineGaps.length&&(e=e.concat(this.lineGapDeco));var t=[];m.a.spans(e,this.viewport.from,this.viewport.to,{span:function(e,n){t.push({from:e,to:n})},point:function(){}},20);var n=t.length!=this.visibleRanges.length||this.visibleRanges.some((function(e,n){return e.from!=t[n].from||e.to!=t[n].to}));return this.visibleRanges=t,n?4:0}},{key:"lineAt",value:function(e,t){return t+=this.paddingTop,$n(this.heightMap.lineAt(e,bn.ByPos,this.state.doc,t,0),this.scaler,t)}},{key:"lineAtHeight",value:function(e,t){return t+=this.paddingTop,$n(this.heightMap.lineAt(this.scaler.fromDOM(e,t),bn.ByHeight,this.state.doc,t,0),this.scaler,t)}},{key:"blockAtHeight",value:function(e,t){return t+=this.paddingTop,$n(this.heightMap.blockAt(this.scaler.fromDOM(e,t),this.state.doc,t,0),this.scaler,t)}},{key:"forEachLine",value:function(e,t,n,r){var i=this;return r+=this.paddingTop,this.heightMap.forEachLine(e,t,this.state.doc,r,0,1==this.scaler.scale?n:function(e){return n($n(e,i.scaler,r))})}},{key:"contentHeight",get:function(){return this.domHeight+this.paddingTop+this.paddingBottom}},{key:"domHeight",get:function(){return this.scaler.toDOM(this.heightMap.height,this.paddingTop)}}]),e}(),Dn=function e(t,n){Object(f.a)(this,e),this.from=t,this.to=n};function Rn(e,t){var n=e.total,r=e.ranges;if(t<=0)return r[0].from;if(t>=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,l=a.to-s;if(i<=l)return s+i;i-=l}}function Nn(e,t){var n,r=0,i=Object(u.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(t<=s){r+=t-a;break}r+=s-a}}catch(l){i.e(l)}finally{i.f()}return r/e.total}function _n(e,t){var n,r=Object(u.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t(i))return i}}catch(o){r.e(o)}finally{r.f()}}var Ln={toDOM:function(e){return e},fromDOM:function(e){return e},scale:1},In=function(){function e(t,n,r){Object(f.a)(this,e);var i=0,o=0,a=0;this.viewports=r.map((function(e){var r=e.from,o=e.to,a=n.lineAt(r,bn.ByPos,t,0,0).top,s=n.lineAt(o,bn.ByPos,t,0,0).bottom;return i+=s-a,{from:r,to:o,top:a,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(n.height-i);var s,l=Object(u.a)(this.viewports);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.domTop=a+(c.top-o)*this.scale,a=c.domBottom=c.domTop+(c.bottom-c.top),o=c.bottom}}catch(d){l.e(d)}finally{l.f()}}return Object(d.a)(e,[{key:"toDOM",value:function(e,t){e-=t;for(var n=0,r=0,i=0;;n++){var o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return i+(e-r)*this.scale+t;if(e<=o.bottom)return o.domTop+(e-o.top)+t;r=o.bottom,i=o.domBottom}}},{key:"fromDOM",value:function(e,t){e-=t;for(var n=0,r=0,i=0;;n++){var o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return r+(e-i)/this.scale+t;if(e<=o.domBottom)return o.top+(e-o.domTop)+t;r=o.bottom,i=o.domBottom}}}]),e}();function $n(e,t,n){if(1==t.scale)return e;var r=t.toDOM(e.top,n),i=t.toDOM(e.bottom,n);return new yn(e.from,e.length,r,i-r,Array.isArray(e.type)?e.type.map((function(e){return $n(e,t,n)})):e.type)}var zn=h.g.define({combine:function(e){return e.join(" ")}}),Bn=h.g.define({combine:function(e){return e.indexOf(!0)>-1}}),Fn=v.a.newName(),Wn=v.a.newName(),Vn=v.a.newName(),Hn={"&light":"."+Wn,"&dark":"."+Vn};function Qn(e,t,n){return new v.a(t,{finish:function(t){return/&/.test(t)?t.replace(/&\w*/,(function(t){if("&"==t)return e;if(!n||!n[t])throw new RangeError("Unsupported selector: ".concat(t));return n[t]})):e+" "+t}})}var qn=Qn("."+Fn,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none"},".cm-lineWrapping":{whiteSpace:"pre-wrap",wordBreak:"break-word",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Hn),Un={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Xn=ue.ie&&ue.ie_version<=11,Yn=function(){function e(t,n,r){var i=this;Object(f.a)(this,e),this.view=t,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new z,this.delayedFlush=-1,this.queue=[],this.lastFlush=0,this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this._selectionRange=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var n,r=Object(u.a)(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.queue.push(o)}}catch(a){r.e(a)}finally{r.f()}i._selectionRange=null,(ue.ie&&ue.ie_version<=11||ue.ios&&t.composing)&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?i.flushSoon():i.flush()})),Xn&&(this.onCharData=function(e){i.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(e){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),e[e.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.intersecting!=i.view.inView&&i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((function(e){e[e.length-1].intersectionRatio>0&&i.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll()}return Object(d.a)(e,[{key:"onScroll",value:function(e){this.intersecting&&this.flush(),this.onScrollChanged(e)}},{key:"updateGaps",value:function(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((function(t,n){return t!=e[n]})))){this.gapIntersection.disconnect();var t,n=Object(u.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.gapIntersection.observe(r)}}catch(i){n.e(i)}finally{n.f()}this.gaps=e}}},{key:"onSelectionChange",value:function(e){this.lastFlush<Date.now()-50&&(this._selectionRange=null);var t=this.view,n=this.selectionRange;if(t.state.facet(Ue)?t.root.activeElement==this.dom:P(t.dom,n)){var r=n.anchorNode&&t.docView.nearest(n.anchorNode);r&&r.ignoreEvent(e)||(ue.ie&&ue.ie_version<=11&&!t.state.selection.main.empty&&n.focusNode&&A(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush())}}},{key:"selectionRange",get:function(){if(!this._selectionRange){var e=this.view.root,t=C(e);ue.safari&&11==e.nodeType&&function(){for(var e=document.activeElement;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}()==this.view.contentDOM&&(t=function(e){var t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;var r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);if(A(s.node,s.offset,o,a)){var l=[o,a,r,i];r=l[0],i=l[1],o=l[2],a=l[3]}return{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}(this.view)||t),this._selectionRange=t}return this._selectionRange}},{key:"setSelectionRange",value:function(e,t){var n;(null===(n=this._selectionRange)||void 0===n?void 0:n.type)||(this._selectionRange={anchorNode:e.node,anchorOffset:e.offset,focusNode:t.node,focusOffset:t.offset})}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var e=0,t=null,n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){var r,i=Object(u.a)(this.scrollTargets);try{for(i.s();!(r=i.n()).done;){r.value.removeEventListener("scroll",this.onScroll)}}catch(s){i.e(s)}finally{i.f()}var o,a=Object(u.a)(this.scrollTargets=t);try{for(a.s();!(o=a.n()).done;){o.value.addEventListener("scroll",this.onScroll)}}catch(s){a.e(s)}finally{a.f()}}}},{key:"ignore",value:function(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}},{key:"start",value:function(){this.active||(this.observer.observe(this.dom,Un),this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange),Xn&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}},{key:"stop",value:function(){this.active&&(this.active=!1,this.observer.disconnect(),this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange),Xn&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}},{key:"clearSelection",value:function(){this.ignoreSelection.set(this.selectionRange)}},{key:"clear",value:function(){this.observer.takeRecords(),this.queue.length=0,this.clearSelection()}},{key:"flushSoon",value:function(){var e=this;this.delayedFlush<0&&(this.delayedFlush=window.setTimeout((function(){e.delayedFlush=-1,e.flush()}),20))}},{key:"forceFlush",value:function(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var e=this;if(!(this.delayedFlush>=0)){this.lastFlush=Date.now();var t,n=this.queue,r=Object(u.a)(this.observer.takeRecords());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(i)}}catch(m){r.e(m)}finally{r.f()}n.length&&(this.queue=[]);var o=this.selectionRange,a=!this.ignoreSelection.eq(o)&&P(this.dom,o);if(0!=n.length||a){var s,l=-1,c=-1,f=!1,d=Object(u.a)(n);try{for(d.s();!(s=d.n()).done;){var h=s.value,p=this.readMutation(h);p&&(p.typeOver&&(f=!0),-1==l?(l=p.from,c=p.to):(l=Math.min(p.from,l),c=Math.max(p.to,c)))}}catch(m){d.e(m)}finally{d.f()}var v=this.view.state;(l>-1||a)&&this.onChange(l,c,f),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return e.view.docView.sync()})),this.view.docView.dirty=0),a&&this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){var n=Gn(t,e.previousSibling||e.target.previousSibling,-1),r=Gn(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect(),this.gapIntersection&&this.gapIntersection.disconnect();var e,t=Object(u.a)(this.scrollTargets);try{for(t.s();!(e=t.n()).done;){e.value.removeEventListener("scroll",this.onScroll)}}catch(n){t.e(n)}finally{t.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),e}();function Gn(e,t,n){for(;t;){var r=X.get(t);if(r&&r.parent==e)return r;var i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function Kn(e,t,n,r){var i,o,a,s=e.state.selection.main;if(t>-1&&!e.state.readOnly&&(a=e.docView.domBoundsAround(t,n,0))){var l=a,c=l.from,u=l.to,f=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e){var t=[];if(e.root.activeElement!=e.contentDOM)return t;var n=e.observer.selectionRange,r=n.anchorNode,i=n.anchorOffset,o=n.focusNode,a=n.focusOffset;r&&(t.push(new er(r,i)),o==r&&a==i||t.push(new er(o,a)));return t}(e),d=new Jn(f,e);d.readRange(a.startDOM,a.endDOM),o=function(e,t){if(0==e.length)return null;var n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?h.e.single(n+t,r+t):null}(f,c);var p=s.from,v=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||ue.android&&d.text.length<u-c)&&(p=s.to,v="end");var m=function(e,t,n,r){var i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;var a=e.length,s=t.length;for(;a>0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a<o&&e.length<t.length){s=(o-=n<=o&&n>=a?o-n:0)+(s-a),a=o}else if(s<o){a=(o-=n<=o&&n>=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(e.state.sliceDoc(c,u),d.text,p-c,v);m&&(i={from:c+m.from,to:c+m.toA,insert:e.state.toText(d.text.slice(m.from,m.toB))})}else if(e.hasFocus||!e.state.facet(Ue)){var g=e.observer.selectionRange,y=e.docView,b=y.impreciseHead,O=y.impreciseAnchor,k=b&&b.node==g.focusNode&&b.offset==g.focusOffset||!M(e.contentDOM,g.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(g.focusNode,g.focusOffset),w=O&&O.node==g.anchorNode&&O.offset==g.anchorOffset||!M(e.contentDOM,g.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(g.anchorNode,g.anchorOffset);k==s.head&&w==s.anchor||(o=h.e.single(w,k))}if(i||o)if(!i&&r&&!s.empty&&o&&o.main.empty?i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,s.to)}:i&&i.from>=s.from&&i.to<=s.to&&(i.from!=s.from||i.to!=s.to)&&s.to-s.from-(i.to-i.from)<=4&&(i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,i.from).append(i.insert).append(e.state.doc.slice(i.to,s.to))}),i){var x=e.state;if(ue.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&V(e.contentDOM,"Enter",13)||i.from==s.from-1&&i.to==s.to&&0==i.insert.length&&V(e.contentDOM,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&V(e.contentDOM,"Delete",46))||ue.ios&&e.inputState.flushIOSKey(e))return;var j,S=i.insert.toString();if(e.state.facet(He).some((function(t){return t(e,i.from,i.to,S)})))return;if(e.inputState.composing>=0&&e.inputState.composing++,i.from>=s.from&&i.to<=s.to&&i.to-i.from>=(s.to-s.from)/3&&(!o||o.main.empty&&o.main.from==i.from+i.insert.length)){var E=s.from<i.from?x.sliceDoc(s.from,i.from):"",C=s.to>i.to?x.sliceDoc(i.to,s.to):"";j=x.replaceSelection(e.state.toText(E+i.insert.sliceString(0,void 0,e.state.lineBreak)+C))}else{var P=x.changes(i);j={changes:P,selection:o&&!x.selection.main.eq(o.main)&&o.main.to<=P.newLength?x.selection.replaceRange(o.main):void 0}}var T="input.type";e.composing&&(T+=".compose",e.inputState.compositionFirstChange&&(T+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(j,{scrollIntoView:!0,userEvent:T})}else if(o&&!o.main.eq(s)){var A=!1,D="select";e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(A=!0),D=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:A,userEvent:D})}}var Jn=function(){function e(t,n){Object(f.a)(this,e),this.points=t,this.view=n,this.text="",this.lineBreak=n.state.lineBreak}return Object(d.a)(e,[{key:"readRange",value:function(e,t){if(e){for(var n=e.parentNode,r=e;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==t)break;var o=X.get(r),a=X.get(i);(o&&a?o.breakAfter:(o?o.breakAfter:Zn(r))||Zn(i)&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=this.lineBreak),r=i}this.findPointBefore(n,t)}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t,n=X.get(e),r=n&&n.overrideDOMText;null!=r?t=r.sliceString(0,void 0,this.lineBreak):3==e.nodeType?t=e.nodeValue:"BR"==e.nodeName?t=e.nextSibling?this.lineBreak:"":1==e.nodeType&&this.readRange(e.firstChild,null),null!=t&&(this.findPointIn(e,t.length),this.text+=t,ue.chrome&&13==this.view.inputState.lastKeyCode&&!e.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}},{key:"findPointBefore",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t))}}catch(o){r.e(o)}finally{r.f()}}}]),e}();function Zn(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var er=function e(t,n){Object(f.a)(this,e),this.node=t,this.offset=n,this.pos=-1};var tr=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,e),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(e){return t.update([e])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new An(n.state||h.f.create()),this.plugins=this.state.facet(Ke).map((function(e){return new et(e).update(t)})),this.observer=new Yn(this,(function(e,n,r){Kn(t,e,n,r)}),(function(e){t.inputState.runScrollHandlers(t,e),t.observer.intersecting&&t.measure()})),this.inputState=new Xt(this),this.docView=new st(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,or(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return Object(d.a)(e,[{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"dispatch",value:function(){var e;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof h.l?arguments.length<=0?void 0:arguments[0]:(e=this.state).update.apply(e,arguments))}},{key:"update",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var t,n,r=!1,i=this.state,o=Object(u.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=a.state}}catch(b){o.e(b)}finally{o.f()}if(this.destroyed)this.viewState.state=i;else{if(i.facet(h.f.phrases)!=this.state.facet(h.f.phrases))return this.setState(i);t=new at(this,i,e);var s=null;try{this.updateState=2;var l,c=Object(u.a)(e);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(s&&(s=s.map(f.changes)),f.scrollIntoView){var d=f.state.selection.main;s=d.empty?d:h.e.cursor(d.head,d.head>d.anchor?-1:1)}var p,v=Object(u.a)(f.effects);try{for(v.s();!(p=v.n()).done;){var m=p.value;m.is(Qe)&&(s=m.value)}}catch(b){v.e(b)}finally{v.f()}}}catch(b){c.e(b)}finally{c.f()}this.viewState.update(t,s),this.bidiCache=lr.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),r=this.docView.update(t),this.state.facet(it)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(e)}finally{this.updateState=0}if((r||s||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!t.empty){var g,y=Object(u.a)(this.state.facet(Ve));try{for(y.s();!(g=y.n()).done;){(0,g.value)(t)}}catch(b){y.e(b)}finally{y.f()}}}}},{key:"setState",value:function(e){var t=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)this.viewState.state=e;else{this.updateState=2;try{var n,r=Object(u.a)(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new An(e),this.plugins=e.facet(Ke).map((function(e){return new et(e).update(t)})),this.docView=new st(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}}},{key:"updatePlugins",value:function(e){var t=e.startState.facet(Ke),n=e.state.facet(Ke);if(t!=n){var r,i=[],o=Object(u.a)(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=t.indexOf(a);if(s<0)i.push(new et(a));else{var l=this.plugins[s];l.mustUpdate=e,i.push(l)}}}catch(m){o.e(m)}finally{o.f()}var c,f=Object(u.a)(this.plugins);try{for(f.s();!(c=f.n()).done;){var d=c.value;d.mustUpdate!=e&&d.destroy(this)}}catch(m){f.e(m)}finally{f.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else{var h,p=Object(u.a)(this.plugins);try{for(p.s();!(h=p.n()).done;){h.value.mustUpdate=e}}catch(m){p.e(m)}finally{p.f()}}for(var v=0;v<this.plugins.length;v++)this.plugins[v]=this.plugins[v].update(this)}},{key:"measure",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.destroyed){this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1,t&&this.observer.flush();var n=null;try{for(var r=0;;r++){this.updateState=1;var i=this.viewport,o=this.viewState.measure(this.docView,r>0);if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTo)break;if(r>5){console.warn("Viewport failed to stabilize");break}var a=[];if(!(4&o)){var s=[a,this.measureRequests];this.measureRequests=s[0],a=s[1]}var l=a.map((function(t){try{return t.read(e)}catch(n){return qe(e.state,n),sr}})),c=new at(this,this.state);c.flags|=o,n?n.flags|=o:n=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c)),this.updateAttrs(),o&&this.docView.update(c);for(var f=0;f<a.length;f++)if(l[f]!=sr)try{a[f].write(l[f],this)}catch(v){qe(this.state,v)}if(this.viewState.scrollTo&&(this.docView.scrollRangeIntoView(this.viewState.scrollTo),this.viewState.scrollTo=null),this.viewport.from==i.from&&this.viewport.to==i.to&&0==this.measureRequests.length)break}}finally{this.updateState=0}if(this.measureScheduled=-1,n&&!n.empty){var d,h=Object(u.a)(this.state.facet(Ve));try{for(h.s();!(d=h.n()).done;){var p=d.value;p(n)}}catch(m){h.e(m)}finally{h.f()}}}}},{key:"themeClasses",get:function(){return Fn+" "+(this.state.facet(Bn)?Vn:Wn)+" "+this.state.facet(zn)}},{key:"updateAttrs",value:function(){var e=we(this.state.facet(tt),{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses});je(this.dom,this.editorAttrs,e),this.editorAttrs=e;var t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",contenteditable:this.state.facet(Ue)?Q()?"plaintext-only":"true":"false",class:"cm-content",style:"".concat(ue.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),we(this.state.facet(nt),t),je(this.contentDOM,this.contentAttrs,t),this.contentAttrs=t}},{key:"showAnnouncements",value:function(t){var n,r=!0,i=Object(u.a)(t);try{for(i.s();!(n=i.n()).done;){var o,a=n.value,s=Object(u.a)(a.effects);try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l.is(e.announce))r&&(this.announceDOM.textContent=""),r=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=l.value}}catch(c){s.e(c)}finally{s.f()}}}catch(c){i.e(c)}finally{i.f()}}},{key:"mountStyles",value:function(){this.styleModules=this.state.facet(it),v.a.mount(this.root,this.styleModules.concat(qn).reverse())}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}},{key:"requestMeasure",value:function(e){var t=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return t.measure()}))),e){if(null!=e.key)for(var n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key)return void(this.measureRequests[n]=e);this.measureRequests.push(e)}}},{key:"pluginField",value:function(e){var t,n=[],r=Object(u.a)(this.plugins);try{for(r.s();!(t=r.n()).done;){t.value.update(this).takeField(e,n)}}catch(i){r.e(i)}finally{r.f()}return n}},{key:"plugin",value:function(e){var t,n=Object(u.a)(this.plugins);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.spec==e)return r.update(this).value}}catch(i){n.e(i)}finally{n.f()}return null}},{key:"blockAtHeight",value:function(e,t){return this.readMeasured(),this.viewState.blockAtHeight(e,rr(t,this.contentDOM))}},{key:"visualLineAtHeight",value:function(e,t){return this.readMeasured(),this.viewState.lineAtHeight(e,rr(t,this.contentDOM))}},{key:"viewportLines",value:function(e,t){var n=this.viewport,r=n.from,i=n.to;this.viewState.forEachLine(r,i,e,rr(t,this.contentDOM))}},{key:"visualLineAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(e,t)}},{key:"contentHeight",get:function(){return this.viewState.contentHeight}},{key:"moveByChar",value:function(e,t,n){return Ut(this,e,qt(this,e,t,n))}},{key:"moveByGroup",value:function(e,t){var n=this;return Ut(this,e,qt(this,e,t,(function(t){return function(e,t,n){var r=e.state.charCategorizer(t),i=r(n);return function(e){var t=r(e);return i==h.d.Space&&(i=t),i==t}}(n,e.head,t)})))}},{key:"moveToLineBoundary",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Qt(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return Ut(this,e,function(e,t,n,r){var i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return h.e.cursor(i);var a,s=t.goalColumn,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(i);if(c)null==s&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{var u=e.viewState.lineAt(i,e.dom.getBoundingClientRect().top);null==s&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-u.from))),a=o<0?u.top:u.bottom}for(var f=l.left+s,d=null!==r&&void 0!==r?r:e.defaultLineHeight>>1,p=0;;p+=10){var v=a+(d+p)*o,m=Wt(e,{x:f,y:v},!1,o);if(v<l.top||v>l.bottom||(o<0?m<i:m>i))return h.e.cursor(m,void 0,void 0,s)}}(this,e,t,n))}},{key:"scrollPosIntoView",value:function(e){this.viewState.scrollTo=h.e.cursor(e),this.requestMeasure()}},{key:"domAtPos",value:function(e){return this.docView.domAtPos(e)}},{key:"posAtDOM",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"posAtCoords",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.readMeasured(),Wt(this,e,t)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(e),i=this.bidiSpans(r),o=i[Pt.find(i,e-r.from,-1,t)];return L(n,o.dir==pt.LTR==t>0)}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"bidiSpans",value:function(e){if(e.length>nr)return Dt(e.length);var t,n=this.textDirection,r=Object(u.a)(this.bidiCache);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.from==e.from&&i.dir==n)return i.order}}catch(a){r.e(a)}finally{r.f()}var o=At(e.text,this.textDirection);return this.bidiCache.push(new lr(e.from,e.to,n,o)),o}},{key:"hasFocus",get:function(){var e;return(document.hasFocus()||ue.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){F(e.contentDOM),e.docView.updateSelection()}))}},{key:"destroy",value:function(){var e,t=Object(u.a)(this.plugins);try{for(t.s();!(e=t.n()).done;){e.value.destroy(this)}}catch(n){t.e(n)}finally{t.f()}this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}}],[{key:"domEventHandlers",value:function(e){return Je.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=v.a.newName(),r=[zn.of(n),it.of(Qn(".".concat(n),e))];return t&&t.dark&&r.push(Bn.of(!0)),r}},{key:"baseTheme",value:function(e){return h.i.fallback(it.of(Qn("."+Fn,e,Hn)))}}]),e}();tr.scrollTo=Qe,tr.styleModule=it,tr.inputHandler=He,tr.exceptionSink=We,tr.updateListener=Ve,tr.editable=Ue,tr.mouseSelectionStyle=Fe,tr.dragMovesSelection=Be,tr.clickAddsSelectionRange=ze,tr.decorations=rt,tr.contentAttributes=nt,tr.editorAttributes=tt,tr.lineWrapping=tr.contentAttributes.of({class:"cm-lineWrapping"}),tr.announce=h.j.define();var nr=4096;function rr(e,t){return null==e?t.getBoundingClientRect().top:e}var ir=-1;function or(){window.addEventListener("resize",(function(){-1==ir&&(ir=setTimeout(ar,50))}))}function ar(){ir=-1;for(var e=document.querySelectorAll(".cm-content"),t=0;t<e.length;t++){var n=X.get(e[t]);n&&n.editorView.requestMeasure()}}var sr={},lr=function(){function e(t,n,r,i){Object(f.a)(this,e),this.from=t,this.to=n,this.dir=r,this.order=i}return Object(d.a)(e,null,[{key:"update",value:function(t,n){if(n.empty)return t;for(var r=[],i=t.length?t[t.length-1].dir:pt.LTR,o=Math.max(0,t.length-10);o<t.length;o++){var a=t[o];a.dir!=i||n.touchesRange(a.from,a.to)||r.push(new e(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.order))}return r}}]),e}(),cr="undefined"==typeof navigator?"key":/Mac/.test(navigator.platform)?"mac":/Win/.test(navigator.platform)?"win":/Linux|X11/.test(navigator.platform)?"linux":"key";function ur(e,t){var n,r,i,o,a=e.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(var l=0;l<a.length-1;++l){var c=a[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))i=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);"mac"==t?o=!0:r=!0}}return n&&(s="Alt-"+s),r&&(s="Ctrl-"+s),o&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function fr(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}var dr=tr.domEventHandlers({keydown:function(e,t){return br(vr(t.state),e,t,"editor")}}),hr=h.g.define({enables:dr}),pr=new WeakMap;function vr(e){var t=e.facet(hr),n=pr.get(t);return n||pr.set(t,n=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cr,r=Object.create(null),i=Object.create(null),o=function(e,t){var n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},a=function(e,t,i,a){for(var s=r[e]||(r[e]=Object.create(null)),l=t.split(/ (?!$)/).map((function(e){return ur(e,n)})),c=function(t){var n=l.slice(0,t).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(t){var r=gr={view:t,prefix:n,scope:e};return setTimeout((function(){gr==r&&(gr=null)}),yr),!0}]})},u=1;u<l.length;u++)c(u);var f=l.join(" ");o(f,!1);var d=s[f]||(s[f]={preventDefault:!1,commands:[]});d.commands.push(i),a&&(d.preventDefault=!0)},s=Object(u.a)(e);try{for(s.s();!(t=s.n()).done;){var l=t.value,c=l[n]||l.key;if(c){var f,d=Object(u.a)(l.scope?l.scope.split(" "):["editor"]);try{for(d.s();!(f=d.n()).done;){var h=f.value;a(h,c,l.run,l.preventDefault),l.shift&&a(h,"Shift-"+c,l.shift,l.preventDefault)}}catch(p){d.e(p)}finally{d.f()}}}}catch(p){s.e(p)}finally{s.f()}return r}(t.reduce((function(e,t){return e.concat(t)}),[]))),n}function mr(e,t,n){return br(vr(e.state),t,e,n)}var gr=null,yr=4e3;function br(e,t,n,r){var i=function(e){var t=!(j&&(e.ctrlKey||e.altKey||e.metaKey)||(O||x)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?y:g)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),o=1==i.length&&" "!=i,a="",s=!1;gr&&gr.view==n&&gr.scope==r&&(a=gr.prefix+" ",(s=Yt.indexOf(t.keyCode)<0)&&(gr=null));var l,c=function(e){if(e){var t,r=Object(u.a)(e.commands);try{for(r.s();!(t=r.n()).done;){if((0,t.value)(n))return!0}}catch(i){r.e(i)}finally{r.f()}e.preventDefault&&(s=!0)}return!1},f=e[r];if(f){if(c(f[a+fr(i,t,!o)]))return!0;if(o&&(t.shiftKey||t.altKey||t.metaKey)&&(l=g[t.keyCode])&&l!=i){if(c(f[a+fr(l,t,!0)]))return!0}else if(o&&t.shiftKey&&c(f[a+fr(i,t,!0)]))return!0}return s}var Or=!ue.ios,kr=h.g.define({combine:function(e){return Object(h.m)(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:function(e,t){return Math.min(e,t)},drawRangeCursor:function(e,t){return e||t}})}});function wr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[kr.of(e),jr,Er]}var xr=function(){function e(t,n,r,i,o){Object(f.a)(this,e),this.left=t,this.top=n,this.width=r,this.height=i,this.className=o}return Object(d.a)(e,[{key:"draw",value:function(){var e=document.createElement("div");return e.className=this.className,this.adjust(e),e}},{key:"adjust",value:function(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}},{key:"eq",value:function(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}]),e}(),jr=Je.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}return Object(d.a)(e,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(kr).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.startState.facet(kr)!=e.state.facet(kr);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((function(e){return e.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}},{key:"readPos",value:function(){var e,t=this,n=this.view.state,r=n.facet(kr),i=n.selection.ranges.map((function(e){return e.empty?[]:function(e,t){if(t.to<=e.viewport.from||t.from>=e.viewport.to)return[];var n=Math.max(t.from,e.viewport.from),r=Math.min(t.to,e.viewport.to),i=e.textDirection==pt.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),s=Cr(e),l=window.getComputedStyle(o.firstChild),c=a.left+parseInt(l.paddingLeft),f=a.right-parseInt(l.paddingRight),d=Pr(e,n),h=Pr(e,r),p=d.type==Ee.Text?d:null,v=h.type==Ee.Text?h:null;e.lineWrapping&&(p&&(p=Mr(e,n,p)),v&&(v=Mr(e,r,v)));if(p&&v&&p.from==v.from)return O(k(t.from,t.to,p));var m=p?k(t.from,null,p):w(d,!1),g=v?k(null,t.to,v):w(h,!0),y=[];return(p||d).to<(v||h).from-1?y.push(b(c,m.bottom,f,g.top)):m.bottom<g.top&&Pr(e,(m.bottom+g.top)/2).type==Ee.Text&&(m.bottom=g.top=(m.bottom+g.top)/2),O(m).concat(y).concat(O(g));function b(e,t,n,r){return new xr(e-s.left,t-s.top,n-e,r-t,"cm-selectionBackground")}function O(e){for(var t=e.top,n=e.bottom,r=e.horizontal,i=[],o=0;o<r.length;o+=2)i.push(b(r[o],t,r[o+1],n));return i}function k(t,n,r){var o=1e9,a=-1e9,s=[];function l(t,n,l,u,d){var h=e.coordsAtPos(t,t==r.to?-2:2),p=e.coordsAtPos(l,l==r.from?2:-2);o=Math.min(h.top,p.top,o),a=Math.max(h.bottom,p.bottom,a),d==pt.LTR?s.push(i&&n?c:h.left,i&&u?f:p.right):s.push(!i&&u?c:p.left,!i&&n?f:h.right)}var d,h=null!==t&&void 0!==t?t:r.from,p=null!==n&&void 0!==n?n:r.to,v=Object(u.a)(e.visibleRanges);try{for(v.s();!(d=v.n()).done;){var m=d.value;if(m.to>h&&m.from<p)for(var g=Math.max(m.from,h),y=Math.min(m.to,p);;){var b,O=e.state.doc.lineAt(g),k=Object(u.a)(e.bidiSpans(O));try{for(k.s();!(b=k.n()).done;){var w=b.value,x=w.from+O.from,j=w.to+O.from;if(x>=y)break;j>g&&l(Math.max(x,g),null==t&&x<=h,Math.min(j,y),null==n&&j>=p,w.dir)}}catch(S){k.e(S)}finally{k.f()}if((g=O.to+1)>=y)break}}}catch(S){v.e(S)}finally{v.f()}return 0==s.length&&l(h,null==t,p,null==n,e.textDirection),{top:o,bottom:a,horizontal:s}}function w(e,t){var n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(t.view,e)})).reduce((function(e,t){return e.concat(t)})),o=[],a=Object(u.a)(n.selection.ranges);try{for(a.s();!(e=a.n()).done;){var s=e.value,l=s==n.selection.main;if(s.empty?!l||Or:r.drawRangeCursor){var c=Tr(this.view,s,l);c&&o.push(c)}}}catch(f){a.e(f)}finally{a.f()}return{rangePieces:i,cursors:o}}},{key:"drawSel",value:function(e){var t=this,n=e.rangePieces,r=e.cursors;if(n.length!=this.rangePieces.length||n.some((function(e,n){return!e.eq(t.rangePieces[n])}))){this.selectionLayer.textContent="";var i,o=Object(u.a)(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(d){o.e(d)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(e,n){return!e.eq(t.cursors[n])}))){var s=this.cursorLayer.children;if(s.length!==r.length){this.cursorLayer.textContent="";var l,c=Object(u.a)(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;this.cursorLayer.appendChild(f.draw())}}catch(d){c.e(d)}finally{c.f()}}else r.forEach((function(e,t){return e.adjust(s[t])}));this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),e}()),Sr={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Or&&(Sr[".cm-line"].caretColor="transparent !important");var Er=h.i.override(tr.theme(Sr));function Cr(e){var t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==pt.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function Mr(e,t,n){var r=h.e.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(r,!0,!0).from),type:Ee.Text}}function Pr(e,t){var n=e.visualLineAt(t);if(Array.isArray(n.type)){var r,i=Object(u.a)(n.type);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.to>t||o.to==t&&(o.to==n.to||o.type==Ee.Text))return o}}catch(a){i.e(a)}finally{i.f()}}return n}function Tr(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=Cr(e);return new xr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}function Ar(e,t,n,r,i){t.lastIndex=0;for(var o,a=e.iterRange(n,r),s=n;!a.next().done;s+=a.value.length)if(!a.lineBreak)for(;o=t.exec(a.value);)i(s+o.index,s+o.index+o[0].length,o)}var Dr=function(){function e(t){Object(f.a)(this,e);var n=t.regexp,r=t.decoration,i=t.boundary;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");this.regexp=n,this.getDeco="function"==typeof r?r:function(){return r},this.boundary=i}return Object(d.a)(e,[{key:"createDeco",value:function(e){var t,n=this,r=new m.b,i=Object(u.a)(e.visibleRanges);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=o.from,s=o.to;Ar(e.state.doc,this.regexp,a,s,(function(t,i,o){return r.add(t,i,n.getDeco(o,e,t))}))}}catch(l){i.e(l)}finally{i.f()}return r.finish()}},{key:"updateDeco",value:function(e,t){var n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((function(t,i,o,a){a>e.view.viewport.from&&o<e.view.viewport.to&&(n=Math.min(o,n),r=Math.max(a,r))})),e.viewportChanged||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}},{key:"updateRange",value:function(e,t,n,r){var i,o=this,a=Object(u.a)(e.visibleRanges);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=Math.max(s.from,n),c=Math.min(s.to,r);c>l&&function(){var n=e.state.doc.lineAt(l),r=n.to<c?e.state.doc.lineAt(c):n,i=Math.max(s.from,n.from),a=Math.min(s.to,r.to);if(o.boundary){for(;l>n.from;l--)if(o.boundary.test(n.text[l-1-n.from])){i=l;break}for(;c<r.to;c++)if(o.boundary.test(r.text[c-r.from])){a=c;break}}var u=[],f=void 0;if(n==r)for(o.regexp.lastIndex=i-n.from;(f=o.regexp.exec(n.text))&&f.index<a-n.from;){var d=f.index+n.from;u.push(o.getDeco(f,e,d).range(d,d+f[0].length))}else Ar(e.state.doc,o.regexp,i,a,(function(t,n,r){return u.push(o.getDeco(r,e,t).range(t,n))}));t=t.update({filterFrom:i,filterTo:a,filter:function(e,t){return e<i||t>a},add:u})}()}}catch(f){a.e(f)}finally{a.f()}return t}}]),e}(),Rr=null!=/x/.unicode?"gu":"g",Nr=new RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]",Rr),_r={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Lr=null;var Ir=h.g.define({combine:function(e){var t=Object(h.m)(e,{render:null,specialChars:Nr,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==Lr&&"undefined"!=typeof document&&document.body){var t=document.body.style;Lr=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return Lr||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,Rr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Rr)),t}});function $r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[Ir.of(e),Br()]}var zr=null;function Br(){return zr||(zr=Je.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.decorations=Ce.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Ir)),this.decorations=this.decorator.createDeco(t)}return Object(d.a)(e,[{key:"makeDecorator",value:function(e){var t=this;return new Dr({regexp:e.specialChars,decoration:function(n,r,i){var o=r.state.doc,a=Object(p.b)(n[0],0);if(9==a){var s=o.lineAt(i),l=r.state.tabSize,c=Object(p.d)(s.text,l,i-s.from);return Ce.replace({widget:new Wr((l-c%l)*t.view.defaultCharacterWidth)})}return t.decorationCache[a]||(t.decorationCache[a]=Ce.replace({widget:new Fr(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}},{key:"update",value:function(e){var t=e.state.facet(Ir);e.startState.facet(Ir)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}}]),e}(),{decorations:function(e){return e.decorations}}))}var Fr=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).options=e,i.code=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return e.code==this.code}},{key:"toDOM",value:function(e){var t,n=(t=this.code)>=32?"\u2022":10==t?"\u2424":String.fromCharCode(9216+t),r=e.state.phrase("Control character")+" "+(_r[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;var o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}},{key:"ignoreEvent",value:function(){return!1}}]),n}(Se),Wr=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).width=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.width==this.width}},{key:"toDOM",value:function(){var e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(Se);function Vr(){return Qr}var Hr=Ce.line({attributes:{class:"cm-activeLine"}}),Qr=Je.fromClass(function(){function e(t){Object(f.a)(this,e),this.decorations=this.getDeco(t)}return Object(d.a)(e,[{key:"update",value:function(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t,n=-1,r=[],i=Object(u.a)(e.state.selection.ranges);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(!o.empty)return Ce.none;var a=e.visualLineAt(o.head);a.from>n&&(r.push(Hr.range(a.from)),n=a.from)}}catch(s){i.e(s)}finally{i.f()}return Ce.set(r)}}]),e}(),{decorations:function(e){return e.decorations}})},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=n.n(o),s=(n(11),n(96)),l=n.n(s),c=n(210),u=n(240),f=n(155),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,s=t.withTheme,d=void 0!==s&&s,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var v=h,m=Object(c.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:h||n.displayName,classNamePrefix:v},p)),g=a.a.forwardRef((function(e,t){e.classes;var s,l=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),p=m(Object(r.a)({},n.defaultProps,e)),v=c;return("string"===typeof h||d)&&(s=Object(f.a)()||o,h&&(v=Object(u.a)({theme:s,name:h,props:c})),d&&!v.theme&&(v.theme=s)),a.a.createElement(n,Object(r.a)({ref:l||t,classes:p},v))}));return l()(g,n),g}},h=n(68);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){e.exports=n(181)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(14);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(77);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return O})),n.d(t,"c",(function(){return w})),n.d(t,"d",(function(){return x})),n.d(t,"e",(function(){return v})),n.d(t,"f",(function(){return j})),n.d(t,"g",(function(){return k}));for(var r=n(13),i=n(3),o=n(62),a=n(35),s=n(18),l=n(17),c=n(5),u=n(6),f="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((function(e){return e?parseInt(e,36):1})),d=1;d<f.length;d++)f[d]+=f[d-1];function h(e){for(var t=1;t<f.length;t+=2)if(f[t]>e)return f[t-1]<=e;return!1}function p(e){return e>=127462&&e<=127487}function v(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?m:g)(e,t)}function m(e,t){if(t==e.length)return t;t&&y(e.charCodeAt(t))&&b(e.charCodeAt(t-1))&&t--;var n=O(e,t);for(t+=w(n);t<e.length;){var r=O(e,t);if(8205==n||8205==r||h(r))t+=w(r),n=r;else{if(!p(r))break;for(var i=0,o=t-2;o>=0&&p(O(e,o));)i++,o-=2;if(i%2==0)break;t+=2}}return t}function g(e,t){for(;t>0;){var n=m(e,t-2);if(n<t)return n;t--}return 0}function y(e){return e>=56320&&e<57344}function b(e){return e>=55296&&e<56320}function O(e,t){var n=e.charCodeAt(t);if(!b(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return y(r)?r-56320+(n-55296<<10)+65536:n}function k(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function w(e){return e<65536?1:2}function x(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0;i<n;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=v(e,i));return r}function j(e,t,n,r){for(var i=0,o=0;;){if(o>=t)return i;if(i==e.length)break;o+=9==e.charCodeAt(i)?n-o%n:1,i=v(e,i)}return!0===r?-1:e.length}var S=function(){function e(){Object(c.a)(this,e)}return Object(u.a)(e,[{key:"lineAt",value:function(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));return this.lineInner(e,!1,1,0)}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));return this.lineInner(e,!0,1,0)}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),C.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return this.replace(this.length,this.length,e)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n,0),C.from(n,t-e)}},{key:"eq",value:function(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;for(var t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new A(this),i=new A(e),o=t,a=t;;){if(r.next(o),i.next(o),o=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new A(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new D(this,e,t)}},{key:"iterLines",value:function(e,t){var n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);var r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new R(n)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var e=[];return this.flatten(e),e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new E(t):C.from(E.split(t,[])):e.empty}}]),e}(),E=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M(e);return Object(c.a)(this,n),(r=t.call(this)).text=e,r.length=i,r}return Object(u.a)(n,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new N(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(e,t,r,i){var o=e<=0&&t>=this.length?this:new n(T(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){var a=r.pop(),s=P(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var l=s.length>>1;r.push(new n(s.slice(0,l)),new n(s.slice(l)))}}else r.push(o)}},{key:"replace",value:function(e,t,r){if(!(r instanceof n))return Object(o.a)(Object(a.a)(n.prototype),"replace",this).call(this,e,t,r);var i=P(this.text,P(r.text,T(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new n(i,s):C.from(n.split(i,[]),s)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=t&&o<this.text.length;o++){var a=this.text[o],s=i+a.length;i>e&&o&&(r+=n),e<s&&t>i&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){var t,n=Object(i.a)(this.text);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push(r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(e,t){var r,o=[],a=-1,s=Object(i.a)(e);try{for(s.s();!(r=s.n()).done;){var l=r.value;o.push(l),a+=l.length+1,32==o.length&&(t.push(new n(o,a)),o=[],a=-1)}}catch(c){s.e(c)}finally{s.f()}return a>-1&&t.push(new n(o,a)),t}}]),n}(S),C=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var o;Object(c.a)(this,n),(o=t.call(this)).children=e,o.length=r,o.lines=0;var a,s=Object(i.a)(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;o.lines+=l.lines}}catch(u){s.e(u)}finally{s.f()}return o}return Object(u.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(e,t,n,r){for(var i=0,o=0;o<=t&&i<this.children.length;i++){var a=this.children[i],s=o+a.length;if(e<=s&&t>=o){var l=r&((o<=e?1:0)|(s>=t?2:0));o>=e&&s<=t&&!l?n.push(a):a.decompose(e-o,t-o,n,l)}o=s+1}}},{key:"replace",value:function(e,t,r){if(r.lines<this.lines)for(var i=0,s=0;i<this.children.length;i++){var l=this.children[i],c=s+l.length;if(e>=s&&t<=c){var u=l.replace(e-s,t-s,r),f=this.lines-l.lines+u.lines;if(u.lines<f>>4&&u.lines>f>>6){var d=this.children.slice();return d[i]=u,new n(d,this.length-(t-e)+r.length)}return Object(o.a)(Object(a.a)(n.prototype),"replace",this).call(this,s,c,u)}s=c+1}return Object(o.a)(Object(a.a)(n.prototype),"replace",this).call(this,e,t,r)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<this.children.length&&o<=t;i++){var a=this.children[i],s=o+a.length;o>e&&i&&(r+=n),e<s&&t>o&&(r+=a.sliceString(e-o,t-o,n)),o=s+1}return r}},{key:"flatten",value:function(e){var t,n=Object(i.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"scanIdentical",value:function(e,t){if(!(e instanceof n))return 0;for(var i=0,o=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1],a=Object(r.a)(o,4),s=a[0],l=a[1],c=a[2],u=a[3];;s+=t,l+=t){if(s==c||l==u)return i;var f=this.children[s],d=e.children[l];if(f!=d)return i+f.scanIdentical(d,t);i+=f.length+1}}}],[{key:"from",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.reduce((function(e,t){return e+t.length+1}),-1),o=0,a=Object(i.a)(e);try{for(a.s();!(t=a.n()).done;){var s=t.value;o+=s.lines}}catch(j){a.e(j)}finally{a.f()}if(o<32){var l,c=[],u=Object(i.a)(e);try{for(u.s();!(l=u.n()).done;){var f=l.value;f.flatten(c)}}catch(j){u.e(j)}finally{u.f()}return new E(c,r)}var d=Math.max(32,o>>5),h=d<<1,p=d>>1,v=[],m=0,g=-1,y=[];function b(e){var t;if(e.lines>h&&e instanceof n){var r,o=Object(i.a)(e.children);try{for(o.s();!(r=o.n()).done;){b(r.value)}}catch(j){o.e(j)}finally{o.f()}}else e.lines>p&&(m>p||!m)?(O(),v.push(e)):e instanceof E&&m&&(t=y[y.length-1])instanceof E&&e.lines+t.lines<=32?(m+=e.lines,g+=e.length+1,y[y.length-1]=new E(t.text.concat(e.text),t.length+1+e.length)):(m+e.lines>d&&O(),m+=e.lines,g+=e.length+1,y.push(e))}function O(){0!=m&&(v.push(1==y.length?y[0]:n.from(y,g)),g=-1,m=y.length=0)}var k,w=Object(i.a)(e);try{for(w.s();!(k=w.n()).done;){var x=k.value;b(x)}}catch(j){w.e(j)}finally{w.f()}return O(),1==v.length?v[0]:new n(v,r)}}]),n}(S);function M(e){var t,n=-1,r=Object(i.a)(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(o){r.e(o)}finally{r.f()}return n}function P(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o<e.length&&i<=r;o++){var s=e[o],l=i+s.length;l>=n&&(l>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),a?(t[t.length-1]+=s,a=!1):t.push(s)),i=l+1}return t}function T(e,t,n){return P(e,[""],t,n)}S.empty=new E([""],0);var A=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;Object(c.a)(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof E?t.text.length:t.children.length)<<1]}return Object(u.a)(e,[{key:"nextInner",value:function(e,t){for(this.done=this.lineBreak=!1;;){var n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof E?r.text.length:r.children.length;if(o==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof E){var s=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,s.length>Math.max(0,e))return this.value=0==e?s:t>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{var l=r.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof E?l.text.length:l.children.length)<<1))}}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}]),e}(),D=function(){function e(t,n,r){Object(c.a)(this,e),this.value="",this.done=!1,this.cursor=new A(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return Object(u.a)(e,[{key:"nextInner",value:function(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);var n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;var r=this.cursor.next(e).value;return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&""!=this.value}}]),e}(),R=function(){function e(t){Object(c.a)(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return Object(u.a)(e,[{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.inner.next(e),n=t.done,r=t.lineBreak,i=t.value;return n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),e}();"undefined"!=typeof Symbol&&(S.prototype[Symbol.iterator]=function(){return this.iter()},A.prototype[Symbol.iterator]=D.prototype[Symbol.iterator]=R.prototype[Symbol.iterator]=function(){return this});var N=function(){function e(t,n,r,i){Object(c.a)(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return Object(u.a)(e,[{key:"length",get:function(){return this.to-this.from}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(156);function i(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(35);function i(e){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=n(85);function a(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}function s(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=Object(r.a)(e);if(t){var o=Object(r.a)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return a(this,n)}}},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return W})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return T})),n.d(t,"f",(function(){return z})),n.d(t,"g",(function(){return P})),n.d(t,"h",(function(){return C})),n.d(t,"i",(function(){return S})),n.d(t,"j",(function(){return m}));var r=n(18),i=n(17),o=n(3),a=n(5),s=n(6),l=n(23),c=n(4),u=n(9),f=n(15),d=new l.b;var h=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];Object(a.a)(this,e),this.data=t,this.topNode=r,c.f.prototype.hasOwnProperty("tree")||Object.defineProperty(c.f.prototype,"tree",{get:function(){return m(this)}}),this.parser=n,this.extension=[S.of(this),c.f.languageData.of((function(e,t,n){return e.facet(p(e,t,n))}))].concat(i)}return Object(s.a)(e,[{key:"isActiveAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return p(e,t,n)==this.data}},{key:"findRegions",value:function(e){var t=this,n=e.facet(S);if((null===n||void 0===n?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return function e(n,i){if(n.prop(d)!=t.data){var a=n.prop(l.b.mounted);if(a){if(a.tree.prop(d)==t.data){if(a.overlay){var s,c=Object(o.a)(a.overlay);try{for(c.s();!(s=c.n()).done;){var u=s.value;r.push({from:u.from+i,to:u.to+i})}}catch(v){c.e(v)}finally{c.f()}}else r.push({from:i,to:i+n.length});return}if(a.overlay){var f=r.length;if(e(a.tree,a.overlay[0].from+i),r.length>f)return}}for(var h=0;h<n.children.length;h++){var p=n.children[h];p instanceof l.f&&e(p,n.positions[h]+i)}}else r.push({from:i,to:i+n.length})}(m(e),0),r}},{key:"allowsNesting",get:function(){return!0}}]),e}();function p(e,t,n){var r=e.facet(S);if(!r)return null;var i=r.data;if(r.allowsNesting)for(var o=m(e).topNode;o;o=o.enter(t,n,!0,!1))i=o.type.prop(d)||i;return i}h.setState=c.j.define();var v=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r){var i;return Object(a.a)(this,n),(i=t.call(this,e,r,r.topNode)).parser=r,i}return Object(s.a)(n,[{key:"configure",value:function(e){return new n(this.data,this.parser.configure(e))}},{key:"allowsNesting",get:function(){return this.parser.wrappers.length>0}}],[{key:"define",value:function(e){var t,r=(t=e.languageData,c.g.define({combine:t?function(e){return e.concat(t)}:void 0}));return new n(r,e.parser.configure({props:[d.add((function(e){return e.isTop?r:void 0}))]}))}}]),n}(h);function m(e){var t=e.field(h.state,!1);return t?t.tree:l.f.empty}var g=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;Object(a.a)(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return Object(s.a)(e,[{key:"syncTo",value:function(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}},{key:"chunk",value:function(e){return this.syncTo(e),this.string}},{key:"lineChunks",get:function(){return!0}},{key:"read",value:function(e,t){var n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}]),e}(),y=null,b=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0;Object(a.a)(this,e),this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}return Object(s.a)(e,[{key:"startParse",value:function(){return this.parser.startParse(new g(this.state.doc),this.fragments)}},{key:"work",value:function(e,t){var n=this;return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=l.f.empty&&this.isDone(null!==t&&void 0!==t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((function(){var r;n.parse||(n.parse=n.startParse()),null!=t&&(null==n.parse.stoppedAt||n.parse.stoppedAt>t)&&t<n.state.doc.length&&n.parse.stopAt(t);for(var i=Date.now()+e;;){var o=n.parse.advance();if(o){if(n.fragments=n.withoutTempSkipped(l.g.addTree(o,n.fragments,null!=n.parse.stoppedAt)),n.treeLen=null!==(r=n.parse.stoppedAt)&&void 0!==r?r:n.state.doc.length,n.tree=o,n.parse=null,!(n.treeLen<(null!==t&&void 0!==t?t:n.state.doc.length)))return!0;n.parse=n.startParse()}if(Date.now()>i)return!1}}))}},{key:"takeTree",value:function(){var e,t,n=this;this.parse&&(e=this.parse.parsedPos)>this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((function(){for(;!(t=n.parse.advance()););})),this.tree=t,this.fragments=this.withoutTempSkipped(l.g.addTree(this.tree,this.fragments,!0)),this.parse=null)}},{key:"withContext",value:function(e){var t=y;y=this;try{return e()}finally{y=t}}},{key:"withoutTempSkipped",value:function(e){for(var t;t=this.tempSkipped.pop();)e=O(e,t.from,t.to);return e}},{key:"changes",value:function(t,n){var r=this.fragments,i=this.tree,a=this.treeLen,s=this.viewport,c=this.skipped;if(this.takeTree(),!t.empty){var u=[];if(t.iterChangedRanges((function(e,t,n,r){return u.push({fromA:e,toA:t,fromB:n,toB:r})})),r=l.g.applyChanges(r,u),i=l.f.empty,a=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){c=[];var f,d=Object(o.a)(this.skipped);try{for(d.s();!(f=d.n()).done;){var h=f.value,p=t.mapPos(h.from,1),v=t.mapPos(h.to,-1);p<v&&c.push({from:p,to:v})}}catch(m){d.e(m)}finally{d.f()}}}return new e(this.parser,n,r,i,a,s,c,this.scheduleOn)}},{key:"updateViewport",value:function(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;for(var t=this.skipped.length,n=0;n<this.skipped.length;n++){var r=this.skipped[n],i=r.from,o=r.to;i<e.to&&o>e.from&&(this.fragments=O(this.fragments,i,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}},{key:"reset",value:function(){this.parse&&(this.takeTree(),this.parse=null)}},{key:"skipUntilInView",value:function(e,t){this.skipped.push({from:e,to:t})}},{key:"movedPast",value:function(e){return this.treeLen<e&&this.parse&&this.parse.parsedPos>=e}},{key:"isDone",value:function(e){var t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}}],[{key:"getSkippingParser",value:function(e){return new(function(t){Object(r.a)(c,t);var n=Object(i.a)(c);function c(){return Object(a.a)(this,c),n.apply(this,arguments)}return Object(s.a)(c,[{key:"createParse",value:function(t,n,r){var i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance:function(){var t=y;if(t){var n,s=Object(o.a)(r);try{for(s.s();!(n=s.n()).done;){var c=n.value;t.tempSkipped.push(c)}}catch(u){s.e(u)}finally{s.f()}e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new l.f(l.d.none,[],[],a-i)},stoppedAt:null,stopAt:function(){}}}}]),c}(l.e))}},{key:"get",value:function(){return y}}]),e}();function O(e,t,n){return l.g.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var k=function(){function e(t){Object(a.a)(this,e),this.context=t,this.tree=t.tree}return Object(s.a)(e,[{key:"apply",value:function(t){if(!t.docChanged)return this;var n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(25,r)||n.takeTree(),new e(n)}}],[{key:"init",value:function(t){var n=new b(t.facet(S).parser,t,[],l.f.empty,0,{from:0,to:t.doc.length},[],null);return n.work(25)||n.takeTree(),new e(n)}}]),e}();h.state=c.k.define({create:k.init,update:function(e,t){var n,r=Object(o.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(h.setState))return i.value}}catch(a){r.e(a)}finally{r.f()}return t.startState.facet(S)!=t.state.facet(S)?k.init(t.state):e.apply(t)}});var w="undefined"!=typeof window&&window.requestIdleCallback||function(e,t){var n=t.timeout;return setTimeout(e,n)},x="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,j=u.f.fromClass(function(){function e(t){Object(a.a)(this,e),this.view=t,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return Object(s.a)(e,[{key:"update",value:function(e){var t=this.view.state.field(h.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var e=this.view.state,t=e.field(h.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=w(this.work,{timeout:500}))}}},{key:"work",value:function(e){this.working=-1;var t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),!(this.chunkBudget<=0)){var n=this.view,r=n.state,i=n.viewport.to,o=r.field(h.state);if(!(o.tree==o.context.tree&&o.context.treeLen>=i+1e6)){var a=Math.min(this.chunkBudget,e?Math.max(25,e.timeRemaining()):100),s=o.context.work(a,i+1e6);this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0||o.context.movedPast(i))&&(o.context.takeTree(),this.view.dispatch({effects:h.setState.of(new k(o.context))})),!s&&this.chunkBudget>0&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}}}},{key:"checkAsyncSchedule",value:function(e){var t=this;e.scheduleOn&&(e.scheduleOn.then((function(){return t.scheduleWork()})),e.scheduleOn=null)}},{key:"destroy",value:function(){this.working>=0&&x(this.working)}}]),e}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),S=c.g.define({combine:function(e){return e.length?e[0]:null},enables:[h.state,j]}),E=c.g.define(),C=c.g.define({combine:function(e){if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function M(e){var t=e.facet(C);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function P(e,t){var n="",r=e.tabSize;if(9==e.facet(C).charCodeAt(0))for(;t>=r;)n+="\t",t-=r;for(var i=0;i<t;i++)n+=" ";return n}function T(e,t){e instanceof c.f&&(e=new A(e));var n,r=Object(o.a)(e.state.facet(E));try{for(r.s();!(n=r.n()).done;){var i=(0,n.value)(e,t);if(null!=i)return i}}catch(s){r.e(s)}finally{r.f()}var a=m(e.state);return a?function(e,t,n){return N(t.resolveInner(n).enterUnfinishedNodesBefore(n),n,e)}(e,a,t):null}var A=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),this.state=t,this.options=n,this.unit=M(t)}return Object(s.a)(e,[{key:"lineAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.state.doc.lineAt(e),r=this.options.simulateBreak;return null!=r&&r>=n.from&&r<=n.to?(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}},{key:"textAfterPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";var n=this.lineAt(e,t),r=n.text,i=n.from;return r.slice(e-i,Math.min(r.length,e+100-i))}},{key:"column",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}},{key:"countColumn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return Object(f.d)(e,this.state.tabSize,t)}},{key:"lineIndent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.options.overrideIndentation;if(o){var a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}},{key:"simulatedBreak",get:function(){return this.options.simulateBreak||null}}]),e}(),D=new l.b;function R(e){var t=e.type.prop(D);if(t)return t;var n,r=e.firstChild;if(r&&(n=r.type.prop(l.b.closedBy))){var i=e.lastChild,o=i&&n.indexOf(i.name)>-1;return function(e){return $(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?i.from:void 0)}}return null==e.parent?_:null}function N(e,t,n){for(;e;e=e.parent){var r=R(e);if(r)return r(new L(n,t,e))}return null}function _(){return 0}var L=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var o;return Object(a.a)(this,n),(o=t.call(this,e.state,e.options)).base=e,o.pos=r,o.node=i,o}return Object(s.a)(n,[{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var e=this.state.doc.lineAt(this.node.from);;){for(var t=this.node.resolve(e.from);t.parent&&t.parent.from==t.from;)t=t.parent;if(I(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}},{key:"continue",value:function(){var e=this.node.parent;return e?N(e,this.pos,this.base):0}}]),n}(A);function I(e,t){for(var n=t;n;n=n.parent)if(e==n)return!0;return!1}function $(e,t,n,r,i){var o=e.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==e.pos+a,l=t?function(e){var t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;for(var i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==i||i<=o.from?o.to:Math.min(o.to,i),s=n.to;;){var l=t.childAfter(s);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from<a?n:null;s=l.to}}(e):null;return l?s?e.column(l.from):e.column(l.to):e.baseIndent+(s?0:e.unit*n)}function z(){return c.f.transactionFilter.of((function(e){if(!e.docChanged||!e.isUserEvent("input.type"))return e;var t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;var n=e.newDoc,r=e.newSelection.main.head,i=n.lineAt(r);if(r>i.from+200)return e;var a=n.sliceString(i.from,r);if(!t.some((function(e){return e.test(a)})))return e;var s,l=e.state,c=-1,u=[],f=Object(o.a)(l.selection.ranges);try{for(f.s();!(s=f.n()).done;){var d=s.value.head,h=l.doc.lineAt(d);if(h.from!=c){c=h.from;var p=T(l,h.from);if(null!=p){var v=/^\s*/.exec(h.text)[0],m=P(l,p);v!=m&&u.push({from:h.from,to:h.from+v.length,insert:m})}}}}catch(g){f.e(g)}finally{f.f()}return u.length?[e,{changes:u,sequential:!0}]:e}))}var B=c.g.define(),F=new l.b;function W(e,t,n){var r,i=Object(o.a)(e.facet(B));try{for(i.s();!(r=i.n()).done;){var a=(0,r.value)(e,t,n);if(a)return a}}catch(s){i.e(s)}finally{i.f()}return function(e,t,n){var r=m(e);if(0==r.length)return null;for(var i=null,o=r.resolveInner(n);o;o=o.parent)if(!(o.to<=n||o.from>n)){if(i&&o.from<t)break;var a=o.type.prop(F);if(a){var s=a(o,e);s&&s.from<=n&&s.from>=t&&s.to>n&&(i=s)}}return i}(e,t,n)}},function(e,t,n){"use strict";n.d(t,"e",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"f",(function(){return h}));var r=n(156);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e){var t="hsl"===(e=o(e)).type?o(function(e){var t=(e=o(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),a({type:c,values:u})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?d(e,t):h(e,t)}function u(e,t){return f(e,t)}function f(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function d(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function h(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return a(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return A})),n.d(t,"f",(function(){return v})),n.d(t,"g",(function(){return T}));var r=n(13),i=n(3),o=n(6),a=n(5),s=1024,l=0,c=function e(t,n){Object(a.a)(this,e),this.from=t,this.to=n},u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(a.a)(this,e),this.id=l++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function")}}return Object(o.a)(e,[{key:"add",value:function(e){var t=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=d.match(e)),function(n){var r=e(n);return void 0===r?null:[t,r]}}}]),e}();u.closedBy=new u({deserialize:function(e){return e.split(" ")}}),u.openedBy=new u({deserialize:function(e){return e.split(" ")}}),u.group=new u({deserialize:function(e){return e.split(" ")}}),u.contextHash=new u({perNode:!0}),u.lookAhead=new u({perNode:!0}),u.mounted=new u({perNode:!0});var f=Object.create(null),d=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(a.a)(this,e),this.name=t,this.props=n,this.id=r,this.flags=i}return Object(o.a)(e,[{key:"prop",value:function(e){return this.props[e.id]}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}},{key:"is",value:function(e){if("string"==typeof e){if(this.name==e)return!0;var t=this.prop(u.group);return!!t&&t.indexOf(e)>-1}return this.id==e}}],[{key:"define",value:function(t){var n=t.props&&t.props.length?Object.create(null):f,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),o=new e(t.name||"",n,t.id,r);if(t.props){var a,s=Object(i.a)(t.props);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(Array.isArray(l)||(l=l(o)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[l[0].id]=l[1]}}}catch(c){s.e(c)}finally{s.f()}}return o}},{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,o=Object(i.a)(n.split(" "));try{for(o.s();!(r=o.n()).done;){var a=r.value;t[a]=e[n]}}catch(s){o.e(s)}finally{o.f()}}return function(e){for(var n=e.prop(u.group),r=-1;r<(n?n.length:0);r++){var i=t[r<0?e.name:n[r]];if(i)return i}}}}]),e}();d.none=new d("",Object.create(null),0,8);var h=function(){function e(t){Object(a.a)(this,e),this.types=t;for(var n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}return Object(o.a)(e,[{key:"extend",value:function(){for(var t=[],n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a,s=Object(i.a)(this.types);try{for(s.s();!(a=s.n()).done;){var l,c=a.value,u=null,f=Object(i.a)(r);try{for(f.s();!(l=f.n()).done;){var h=l.value,p=h(c);p&&(u||(u=Object.assign({},c.props)),u[p[0].id]=p[1])}}catch(v){f.e(v)}finally{f.f()}t.push(u?new d(c.name,u,c.id,c.flags):c)}}catch(v){s.e(v)}finally{s.f()}return new e(t)}}]),e}(),p=new WeakMap,v=function(){function e(t,n,o,s,l){if(Object(a.a)(this,e),this.type=t,this.children=n,this.positions=o,this.length=s,this.props=null,l&&l.length){this.props=Object.create(null);var c,u=Object(i.a)(l);try{for(u.s();!(c=u.n()).done;){var f=Object(r.a)(c.value,2),d=f[0],h=f[1];this.props["number"==typeof d?d:d.id]=h}}catch(p){u.e(p)}finally{u.f()}}}return Object(o.a)(e,[{key:"toString",value:function(){var e=this.prop(u.mounted);if(e&&!e.overlay)return e.tree.toString();var t,n="",r=Object(i.a)(this.children);try{for(r.s();!(t=r.n()).done;){var o=t.value.toString();o&&(n&&(n+=","),n+=o)}}catch(a){r.e(a)}finally{r.f()}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}},{key:"cursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null!=e&&p.get(this)||this.topNode,r=new j(n);return null!=e&&(r.moveTo(e,t),p.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new j(this.topNode,1)}},{key:"topNode",get:function(){return new O(this,0,0,null)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor(e,t).node}},{key:"resolveInner",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.topNode;;){var r=n.enter(e,t);if(!r)return n;n=r}}},{key:"iterate",value:function(e){for(var t=e.enter,n=e.leave,r=e.from,i=void 0===r?0:r,o=e.to,a=void 0===o?this.length:o,s=this.cursor(),l=function(){return s.node};;){var c=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==t(s.type,s.from,s.to,l))){if(s.firstChild())continue;s.type.isAnonymous||(c=!0)}for(;c&&n&&n(s.type,s.from,s.to,l),c=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;c=!0}}}},{key:"prop",value:function(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}},{key:"propValues",get:function(){var e=[];if(this.props)for(var t in this.props)e.push([+t,this.props[t]]);return e}},{key:"balance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.children.length<=8?this:P(this.type,this.children,this.positions,0,this.children.length,0,this.length,(function(n,r,i){return new e(t.type,n,r,i,t.propValues)}),n.makeTree||function(t,n,r){return new e(d.none,t,n,r)})}}],[{key:"build",value:function(e){return E(e)}}]),e}();v.empty=new v(d.none,[],[],0);var m=function(){function e(t,n){Object(a.a)(this,e),this.buffer=t,this.index=n}return Object(o.a)(e,[{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}},{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}}]),e}(),g=function(){function e(t,n,r){Object(a.a)(this,e),this.buffer=t,this.length=n,this.set=r}return Object(o.a)(e,[{key:"type",get:function(){return d.none}},{key:"toString",value:function(){for(var e=[],t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}},{key:"childString",value:function(e){var t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;for(var o=[];e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}},{key:"findChild",value:function(e,t,n,r,i){for(var o=this.buffer,a=-1,s=e;s!=t&&!(y(i,r,o[s+1],o[s+2])&&(a=s,n>0));s=o[s+3]);return a}},{key:"slice",value:function(t,n,r,i){for(var o=this.buffer,a=new Uint16Array(n-t),s=t,l=0;s<n;)a[l++]=o[s++],a[l++]=o[s++]-r,a[l++]=o[s++]-r,a[l++]=o[s++]-t;return new e(a,i-r,this.set)}}]),e}();function y(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function b(e,t){for(var n=e.childBefore(t);n;){var r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(e=n,n=r.prevSibling):n=r}return e}var O=function(){function e(t,n,r,i){Object(a.a)(this,e),this.node=t,this._from=n,this.index=r,this._parent=i}return Object(o.a)(e,[{key:"type",get:function(){return this.node.type}},{key:"name",get:function(){return this.node.type.name}},{key:"from",get:function(){return this._from}},{key:"to",get:function(){return this._from+this.node.length}},{key:"nextChild",value:function(t,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=this;;){for(var s=a.node,l=s.children,c=s.positions,f=n>0?l.length:-1;t!=f;t+=n){var d=l[t],h=c[t]+a._from;if(y(i,r,h,h+d.length))if(d instanceof g){if(2&o)continue;var p=d.findChild(0,d.buffer.length,n,r-h,i);if(p>-1)return new x(new w(a,d,t,h),null,p)}else if(1&o||!d.type.isAnonymous||S(d)){var v=void 0;if(d.props&&(v=d.prop(u.mounted))&&!v.overlay)return new e(v.tree,h,t,a);var m=new e(d,h,t,a);return 1&o||!m.type.isAnonymous?m:m.nextChild(n<0?d.children.length-1:0,n,r,i)}}if(1&o||!a.type.isAnonymous)return null;if(t=a.index>=0?a.index+n:n<0?-1:a._parent.node.children.length,!(a=a._parent))return null}}},{key:"firstChild",get:function(){return this.nextChild(0,1,0,4)}},{key:"lastChild",get:function(){return this.nextChild(this.node.children.length-1,-1,0,4)}},{key:"childAfter",value:function(e){return this.nextChild(0,1,e,2)}},{key:"childBefore",value:function(e){return this.nextChild(this.node.children.length-1,-1,e,-2)}},{key:"enter",value:function(t,n){var r,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(o&&(r=this.node.prop(u.mounted))&&r.overlay){var s,l=t-this.from,c=Object(i.a)(r.overlay);try{for(c.s();!(s=c.n()).done;){var f=s.value,d=f.from,h=f.to;if((n>0?d<=l:d<l)&&(n<0?h>=l:h>l))return new e(r.tree,r.overlay[0].from+this.from,-1,this)}}catch(p){c.e(p)}finally{c.f()}}return this.nextChild(0,1,t,n,a?0:2)}},{key:"nextSignificantParent",value:function(){for(var e=this;e.type.isAnonymous&&e._parent;)e=e._parent;return e}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}},{key:"prevSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}},{key:"cursor",get:function(){return new j(this)}},{key:"tree",get:function(){return this.node}},{key:"toTree",value:function(){return this.node}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(e,t).node}},{key:"enterUnfinishedNodesBefore",value:function(e){return b(this,e)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,e,t,n)}},{key:"toString",value:function(){return this.node.toString()}}]),e}();function k(e,t,n,r){var i=e.cursor,o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}var w=function e(t,n,r,i){Object(a.a)(this,e),this.parent=t,this.buffer=n,this.index=r,this.start=i},x=function(){function e(t,n,r){Object(a.a)(this,e),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}return Object(o.a)(e,[{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"child",value:function(t,n,r){var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new e(this.context,this,o)}},{key:"firstChild",get:function(){return this.child(1,0,4)}},{key:"lastChild",get:function(){return this.child(-1,0,4)}},{key:"childAfter",value:function(e){return this.child(1,e,2)}},{key:"childBefore",value:function(e){return this.child(-1,e,-2)}},{key:"enter",value:function(t,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!i)return null;var o=this.context.buffer,a=o.findChild(this.index+4,o.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"externalSibling",value:function(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}},{key:"nextSibling",get:function(){var t=this.context.buffer,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var t=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}},{key:"cursor",get:function(){return new j(this)}},{key:"tree",get:function(){return null}},{key:"toTree",value:function(){var e=[],t=[],n=this.context.buffer,r=this.index+4,i=n.buffer[this.index+3];if(i>r){var o=n.buffer[this.index+1],a=n.buffer[this.index+2];e.push(n.slice(r,i,o,a)),t.push(0)}return new v(this.type,e,t,this.to-this.from)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(e,t).node}},{key:"enterUnfinishedNodesBefore",value:function(e){return b(this,e)}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,e,t,n)}}]),e}(),j=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(Object(a.a)(this,e),this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof O)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}return Object(o.a)(e,[{key:"name",get:function(){return this.type.name}},{key:"yieldNode",value:function(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}},{key:"yieldBuf",value:function(e,t){this.index=e;var n=this.buffer,r=n.start,i=n.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}},{key:"yield",value:function(e){return!!e&&(e instanceof O?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enterChild",value:function(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree.node.children.length-1:0,e,t,n,this.mode));var r=this.buffer.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}},{key:"firstChild",value:function(){return this.enterChild(1,0,4)}},{key:"lastChild",value:function(){return this.enterChild(-1,0,4)}},{key:"childAfter",value:function(e){return this.enterChild(1,e,2)}},{key:"childBefore",value:function(e){return this.enterChild(-1,e,-2)}},{key:"enter",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this.buffer?!!r&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n,r))}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(1&this.mode?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var e=1&this.mode?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}},{key:"sibling",value:function(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));var t=this.buffer.buffer,n=this.stack.length-1;if(e<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{var i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(e){var t,n,r=this.buffer;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(var i=0;i<this.index;i++)if(r.buffer.buffer[i+3]<this.index)return!1;t=r.index,n=r.parent}else{var o=this._tree;t=o.index,n=o._parent}for(;n;t=(a=n).index,n=a._parent,a){var a;if(t>-1)for(var s=t+e,l=e<0?-1:n.node.children.length;s!=l;s+=e){var c=n.node.children[s];if(1&this.mode||c instanceof g||!c.type.isAnonymous||S(c))return!1}}return!0}},{key:"move",value:function(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}},{key:"next",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(1,e)}},{key:"prev",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(-1,e)}},{key:"moveTo",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}},{key:"node",get:function(){if(!this.buffer)return this._tree;var e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(var r=this.index,i=this.stack.length;i>=0;){for(var o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break e}r=this.stack[--i]}for(var a=n;a<this.stack.length;a++)t=new x(this.buffer,t,this.stack[a]);return this.bufferNode=new x(this.buffer,t,this.index)}},{key:"tree",get:function(){return this.buffer?null:this._tree.node}}]),e}();function S(e){return e.children.some((function(e){return e instanceof g||!e.type.isAnonymous||S(e)}))}function E(e){var t,n=e.buffer,r=e.nodeSet,i=e.maxBufferLength,o=void 0===i?s:i,a=e.reused,l=void 0===a?[]:a,c=e.minRepeatType,f=void 0===c?r.types.length:c,d=Array.isArray(n)?new m(n,n.length):n,h=r.types,p=0,y=0;function b(e,t,n,i,a){for(var s=d.id,c=d.start,m=d.end,x=d.size,j=y;x<0;){if(d.next(),-1==x){var S=l[s];return n.push(S),void i.push(c-e)}if(-3==x)return void(p=s);if(-4==x)return void(y=s);throw new RangeError("Unrecognized record size: ".concat(x))}var E,C,M=h[s],T=c-e;if(m-c<=o&&(C=function(e,t){var n=d.fork(),r=0,i=0,a=0,s=n.end-o,l={size:0,start:0,skip:0};e:for(var c=n.pos-e;n.pos>c;){var u=n.size;if(n.id==t&&u>=0)l.size=r,l.start=i,l.skip=a,a+=4,r+=4,n.next();else{var h=n.pos-u;if(u<0||h<c||n.start<s)break;var p=n.id>=f?4:0,v=n.start;for(n.next();n.pos>h;){if(n.size<0){if(-3!=n.size)break e;p+=4}else n.id>=f&&(p+=4);n.next()}i=v,r+=u,a+=p}}(t<0||r==e)&&(l.size=r,l.start=i,l.skip=a);return l.size>4?l:void 0}(d.pos-t,a))){for(var A=new Uint16Array(C.size-C.skip),D=d.pos-C.size,R=A.length;d.pos>D;)R=w(C.start,A,R);E=new g(A,m-C.start,r),T=C.start-e}else{var N=d.pos-x;d.next();for(var _=[],L=[],I=s>=f?s:-1,$=0,z=m;d.pos>N;)I>=0&&d.id==I&&d.size>=0?(d.end<=z-o&&(O(_,L,c,$,d.end,z,I,j),$=_.length,z=d.end),d.next()):b(c,N,_,L,I);if(I>=0&&$>0&&$<_.length&&O(_,L,c,$,c,z,I,j),_.reverse(),L.reverse(),I>-1&&$>0){var B=function(e){return function(t,n,r){var i,o,a=0,s=t.length-1;if(s>=0&&(i=t[s])instanceof v){if(!s&&i.type==e&&i.length==r)return i;(o=i.prop(u.lookAhead))&&(a=n[s]+i.length+o)}return k(e,t,n,r,a)}}(M);E=P(M,_,L,0,_.length,0,m-c,B,B)}else E=k(M,_,L,m-c,j-m)}n.push(E),i.push(T)}function O(e,t,n,i,o,a,s,l){for(var c=[],u=[];e.length>i;)c.push(e.pop()),u.push(t.pop()+n-o);e.push(k(r.types[s],c,u,a-o,l-a)),t.push(o-n)}function k(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;if(p){var a=[u.contextHash,p];o=o?[a].concat(o):[a]}if(i>25){var s=[u.lookAhead,i];o=o?[s].concat(o):[s]}return new v(e,t,n,r,o)}function w(e,t,n){var r=d.id,i=d.start,o=d.end,a=d.size;if(d.next(),a>=0&&r<f){var s=n;if(a>4)for(var l=d.pos-(a-4);d.pos>l;)n=w(e,t,n);t[--n]=s,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==a?p=r:-4==a&&(y=r);return n}for(var x=[],j=[];d.pos>0;)b(e.start||0,e.bufferStart||0,x,j,-1);var S=null!==(t=e.length)&&void 0!==t?t:x.length?j[0]+x[0].length:0;return new v(h[e.topID],x.reverse(),j.reverse(),S)}var C=new WeakMap;function M(e,t){if(!e.isAnonymous||t instanceof g||t.type!=e)return 1;var n=C.get(t);return null==n&&(n=t.children.reduce((function(t,n){return t+M(e,n)}),1),C.set(t,n)),n}function P(e,t,n,r,i,o,a,s,l){for(var c=0,u=r;u<i;u++)c+=M(e,t[u]);var f=Math.ceil(1.5*c/8),d=[],h=[];return function t(n,r,i,a,s){for(var c=i;c<a;){var u=c,p=r[c],v=M(e,n[c]);for(c++;c<a;c++){var m=M(e,n[c]);if(v+m>=f)break;v+=m}if(c==u+1){if(v>f){var g=n[u];t(g.children,g.positions,0,g.children.length,r[u]+s);continue}d.push(n[u])}else{var y=r[c-1]+n[c-1].length-p;d.push(P(e,n,r,u,c,p,y,null,l))}h.push(p+s-o)}}(t,n,r,i,0),(s||l)(d,h,a)}var T=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];Object(a.a)(this,e),this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}return Object(o.a)(e,[{key:"openStart",get:function(){return(1&this.open)>0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"addTree",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[new e(0,t.length,t,0,!1,o)],s=Object(i.a)(r);try{for(s.s();!(n=s.n()).done;){var l=n.value;l.to>t.length&&a.push(l)}}catch(c){s.e(c)}finally{s.f()}return a}},{key:"applyChanges",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return t;for(var i=[],o=1,a=t.length?t[0]:null,s=0,l=0,c=0;;s++){var u=s<n.length?n[s]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;a&&a.from<f;){var d=a;if(l>=d.from||f<=d.to||c){var h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new e(h,p,d.tree,d.offset+c,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=o<t.length?t[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}]),e}(),A=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"startParse",value:function(e,t,n){return"string"==typeof e&&(e=new D(e)),n=n?n.length?n.map((function(e){return new c(e.from,e.to)})):[new c(0,0)]:[new c(0,e.length)],this.createParse(e,t||[],n)}},{key:"parse",value:function(e,t,n){for(var r=this.startParse(e,t,n);;){var i=r.advance();if(i)return i}}}]),e}(),D=function(){function e(t){Object(a.a)(this,e),this.string=t}return Object(o.a)(e,[{key:"length",get:function(){return this.string.length}},{key:"chunk",value:function(e){return this.string.slice(e)}},{key:"lineChunks",get:function(){return!1}},{key:"read",value:function(e,t){return this.string.slice(e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(39);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(83);var i=n(77);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return s}));var r=n(3),i=n(5),o=n(6),a=n(4),s=function(){function e(){Object(i.a)(this,e)}return Object(o.a)(e,[{key:"eq",value:function(e){return this==e}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return new l(e,t,this)}}]),e}();s.prototype.startSide=s.prototype.endSide=0,s.prototype.point=!1,s.prototype.mapMode=a.h.TrackDel;var l=function e(t,n,r){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r};function c(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var u=function(){function e(t,n,r,o){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=o}return Object(o.a)(e,[{key:"length",get:function(){return this.to[this.to.length-1]}},{key:"findIndex",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,l=i[s]-e||(n?this.value[s].endSide:this.value[s].startSide)-t;if(s==o)return l>=0?o:a;l>=0?a=s:o=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i<o;i++)if(!1===r(this.from[i]+e,this.to[i]+e,this.value[i]))return!1}},{key:"map",value:function(t,n){for(var r=[],i=[],o=[],a=-1,s=-1,l=0;l<this.value.length;l++){var c=this.value[l],u=this.from[l]+t,f=this.to[l]+t,d=void 0,h=void 0;if(u==f){var p=n.mapPos(u,c.startSide,c.mapMode);if(null==p)continue;d=h=p}else if((d=n.mapPos(u,c.startSide))>(h=n.mapPos(f,c.endSide))||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(a<0&&(a=d),c.point&&(s=Math.max(s,h-d)),r.push(c),i.push(d-a),o.push(h-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}}]),e}(),f=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.empty,o=arguments.length>3?arguments[3]:void 0;Object(i.a)(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=o}return Object(o.a)(e,[{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this.isEmpty)return 0;var e,t=this.nextLayer.size,n=Object(r.a)(this.chunk);try{for(n.s();!(e=n.n()).done;){t+=e.value.value.length}}catch(i){n.e(i)}finally{n.f()}return t}},{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,o=void 0!==i&&i,a=t.filterFrom,s=void 0===a?0:a,u=t.filterTo,f=void 0===u?this.length:u,d=t.filter;if(0==r.length&&!d)return this;if(o&&r.slice().sort(c),this.isEmpty)return r.length?e.of(r):this;for(var p=new v(this,null,-1).goto(0),m=0,g=[],y=new h;p.value||m<r.length;)if(m<r.length&&(p.from-r[m].from||p.startSide-r[m].value.startSide)>=0){var b=r[m++];y.addInner(b.from,b.to,b.value)||g.push(b)}else 1==p.rangeIndex&&p.chunkIndex<this.chunk.length&&(m==r.length||this.chunkEnd(p.chunkIndex)<r[m].from)&&(!d||s>this.chunkEnd(p.chunkIndex)||f<this.chunkPos[p.chunkIndex])&&y.addChunk(this.chunkPos[p.chunkIndex],this.chunk[p.chunkIndex])?p.nextChunk():((!d||s>p.to||f<p.from||d(p.from,p.to,p.value))&&(y.addInner(p.from,p.to,p.value)||g.push(new l(p.from,p.to,p.value))),p.next());return y.finishInner(this.nextLayer.isEmpty&&!g.length?e.empty:this.nextLayer.update({add:g,filter:d,filterFrom:s,filterTo:f}))}},{key:"map",value:function(t){if(0==t.length||this.isEmpty)return this;for(var n=[],r=[],i=-1,o=0;o<this.chunk.length;o++){var a=this.chunkPos[o],s=this.chunk[o],l=t.touchesRange(a,a+s.length);if(!1===l)i=Math.max(i,s.maxPoint),n.push(s),r.push(t.mapPos(a));else if(!0===l){var c=s.map(a,t),u=c.mapped,f=c.pos;u&&(i=Math.max(i,u.maxPoint),n.push(u),r.push(f))}}var d=this.nextLayer.map(t);return 0==n.length?d:new e(r,n,d,i)}},{key:"between",value:function(e,t,n){if(!this.isEmpty){for(var r=0;r<this.chunk.length;r++){var i=this.chunkPos[r],o=this.chunk[r];if(t>=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(e)}},{key:"isEmpty",get:function(){return this.nextLayer==this}}],[{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(e).goto(t)}},{key:"compare",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=e.filter((function(e){return e.maxPoint>=500||!e.isEmpty&&t.indexOf(e)<0&&e.maxPoint>=i})),a=t.filter((function(t){return t.maxPoint>=500||!t.isEmpty&&e.indexOf(t)<0&&t.maxPoint>=i})),s=p(o,a),l=new y(o,s,i),c=new y(a,s,i);n.iterGaps((function(e,t,n){return b(l,e,c,t,n,r)})),n.empty&&0==n.length&&b(l,0,c,0,0,r)}},{key:"eq",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;null==r&&(r=1e9);var i=e.filter((function(e){return!e.isEmpty&&t.indexOf(e)<0})),o=t.filter((function(t){return!t.isEmpty&&e.indexOf(t)<0}));if(i.length!=o.length)return!1;if(!i.length)return!0;for(var a=p(i,o),s=new y(i,a,0).goto(n),l=new y(o,a,0).goto(n);;){if(s.to!=l.to||!O(s.active,l.active)||s.point&&(!l.point||!s.point.eq(l.point)))return!1;if(s.to>=r)return!0;s.next(),l.next()}}},{key:"spans",value:function(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new y(e,null,i).goto(t),a=t,s=o.openStart;;){var l=Math.min(o.to,n);if(o.point?(r.point(a,l,o.point,o.activeForPoint(o.to),s),s=o.openEnd(l)+(o.to>l?1:0)):l>a&&(r.span(a,l,o.active,s),s=o.openEnd(l)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new h,o=Object(r.a)(e instanceof l?[e]:n?d(e):e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return i.finish()}}]),e}();function d(e){if(e.length>1)for(var t=e[0],n=1;n<e.length;n++){var r=e[n];if(c(t,r)>0)return e.slice().sort(c);t=r}return e}f.empty=new f([],[],null,-1),f.empty.nextLayer=f.empty;var h=function(){function e(){Object(i.a)(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return Object(o.a)(e,[{key:"finishChunk",value:function(e){this.chunks.push(new u(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(e,t,n){var r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}},{key:"addChunk",value:function(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);var n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}},{key:"finish",value:function(){return this.finishInner(f.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new f(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();function p(e,t){var n,i=new Map,o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;s<a.chunk.length;s++)a.chunk[s].maxPoint<500&&i.set(a.chunk[s],a.chunkPos[s])}catch(h){o.e(h)}finally{o.f()}var l,c=new Set,u=Object(r.a)(t);try{for(u.s();!(l=u.n()).done;)for(var f=l.value,d=0;d<f.chunk.length;d++)i.get(f.chunk[d])==f.chunkPos[d]&&c.add(f.chunk[d])}catch(h){u.e(h)}finally{u.f()}return c}var v=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=o}return Object(o.a)(e,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}},{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){var r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){var i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}},{key:"forward",value:function(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}},{key:"next",value:function(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}var e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}},{key:"setRangeIndex",value:function(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(e){return this.from-e.from||this.startSide-e.startSide||this.to-e.to||this.endSide-e.endSide}}]),e}(),m=function(){function e(t){Object(i.a)(this,e),this.heap=t}return Object(o.a)(e,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"goto",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9,i=Object(r.a)(this.heap);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.goto(e,n)}}catch(s){i.e(s)}finally{i.f()}for(var a=this.heap.length>>1;a>=0;a--)g(this.heap,a);return this.next(),this}},{key:"forward",value:function(e,t){var n,i=Object(r.a)(this.heap);try{for(i.s();!(n=i.n()).done;){n.value.forward(e,t)}}catch(a){i.e(a)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)g(this.heap,o);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),g(this.heap,0)}}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o<t.length;o++)for(var a=t[o];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new v(a,n,r,o));return 1==i.length?i[0]:new e(i)}}]),e}();function g(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var y=function(){function e(t,n,r){Object(i.a)(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=m.from(t,n,r)}return Object(o.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){k(this.active,e),k(this.activeTo,e),k(this.activeRank,e),this.minActive=x(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;t<this.activeRank.length&&this.activeRank[t]<=o;)t++;w(this.active,t,r),w(this.activeTo,t,i),w(this.activeRank,t,o),e&&w(e,t,this.cursor.from),this.minActive=x(this.active,this.activeTo)}},{key:"next",value:function(){var e=this.to,t=this.point;this.point=null;for(var n=this.openStart<0?[]:null,r=0;;){var i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&k(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var o=this.cursor.value;if(o.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to&&o.endSide==this.endSide)){this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.from<e&&(r=1),this.cursor.next(),this.to>e&&this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}if(n){for(var a=0;a<n.length&&n[a]<e;)a++;this.openStart=a+r}}},{key:"activeForPoint",value:function(e){if(!this.active.length)return this.active;for(var t=[],n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}},{key:"openEnd",value:function(e){for(var t=0,n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}]),e}();function b(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,l=r-t;;){var c=e.to+l-n.to||e.endSide-n.endSide,u=c<0?e.to+l:n.to,f=Math.min(u,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&O(e.activeForPoint(e.to+l),n.activeForPoint(n.to))||o.comparePoint(s,f,e.point,n.point):f>s&&!O(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),u>a)break;s=u,c<=0&&e.next(),c>=0&&n.next()}}function O(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function k(e,t){for(var n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function w(e,t,n){for(var r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function x(e,t){for(var n=-1,r=1e9,i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(176)},function(e,t,n){"use strict";function r(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];"string"==typeof o?e.setAttribute(r,o):null!=o&&(e[r]=o)}t++}for(;t<arguments.length;t++)i(e,arguments[t]);return e}function i(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)i(e,t[n])}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(89);var i=n(78),o=n(90);function a(e,t){return Object(r.a)(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(l){s=!0,i=l}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||Object(i.a)(e,t)||Object(o.a)()}},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function o(e){var t=r.useRef(e);return i((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return q})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return Q}));var r=n(3),i=n(5),o=n(6),a=n(23),s=n(59),l=n(9),c=n(4),u=n(21),f=n(26),d=0,h=function(){function e(t,n,r){Object(i.a)(this,e),this.set=t,this.base=n,this.modified=r,this.id=d++}return Object(o.a)(e,null,[{key:"define",value:function(t){if(null===t||void 0===t?void 0:t.base)throw new Error("Can not derive from a modified tag");var n=new e([],null,[]);if(n.set.push(n),t){var i,o=Object(r.a)(t.set);try{for(o.s();!(i=o.n()).done;){var a=i.value;n.set.push(a)}}catch(s){o.e(s)}finally{o.f()}}return n}},{key:"defineModifier",value:function(){var e=new v;return function(t){return t.modified.indexOf(e)>-1?t:v.get(t.base||t,t.modified.concat(e).sort((function(e,t){return e.id-t.id})))}}}]),e}(),p=0,v=function(){function e(){Object(i.a)(this,e),this.instances=[],this.id=p++}return Object(o.a)(e,null,[{key:"get",value:function(t,n){if(!n.length)return t;var i=n[0].instances.find((function(e){return e.base==t&&(r=n,i=e.modified,r.length==i.length&&r.every((function(e,t){return e==i[t]})));var r,i}));if(i)return i;var o,a=[],s=new h(a,t,n),l=Object(r.a)(n);try{for(l.s();!(o=l.n()).done;){o.value.instances.push(s)}}catch(y){l.e(y)}finally{l.f()}var c,u=m(n),f=Object(r.a)(t.set);try{for(f.s();!(c=f.n()).done;){var d,p=c.value,v=Object(r.a)(u);try{for(v.s();!(d=v.n()).done;){var g=d.value;a.push(e.get(p,g))}}catch(y){v.e(y)}finally{v.f()}}}catch(y){f.e(y)}finally{f.f()}return s}}]),e}();function m(e){for(var t=[e],n=0;n<e.length;n++){var i,o=Object(r.a)(m(e.slice(0,n).concat(e.slice(n+1))));try{for(o.s();!(i=o.n()).done;){var a=i.value;t.push(a)}}catch(s){o.e(s)}finally{o.f()}}return t}function g(e){var t=Object.create(null);for(var n in e){var i=e[n];Array.isArray(i)||(i=[i]);var o,a=Object(r.a)(n.split(" "));try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s){for(var l=[],c=2,u=s,f=0;;){if("..."==u&&f>0&&f+3==s.length){c=1;break}var d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!d)throw new RangeError("Invalid path: "+s);if(l.push("*"==d[0]?null:'"'==d[0][0]?JSON.parse(d[0]):d[0]),(f+=d[0].length)==s.length)break;var h=s[f++];if(f==s.length&&"!"==h){c=0;break}if("/"!=h)throw new RangeError("Invalid path: "+s);u=s.slice(f)}var p=l.length-1,v=l[p];if(!v)throw new RangeError("Invalid path: "+s);var m=new w(i,c,p>0?l.slice(0,p):null);t[v]=m.sort(t[v])}}}catch(g){a.e(g)}finally{a.f()}}return y.add(t)}var y=new a.b,b=c.g.define({combine:function(e){return e.length?x.combinedMatch(e):null}}),O=c.g.define({combine:function(e){return e.length?e[0].match:null}});function k(e){return e.facet(b)||e.facet(O)}var w=function(){function e(t,n,r,o){Object(i.a)(this,e),this.tags=t,this.mode=n,this.context=r,this.next=o}return Object(o.a)(e,[{key:"sort",value:function(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}},{key:"depth",get:function(){return this.context?this.context.length:0}}]),e}(),x=function(){function e(t,n){var o;function a(e){var t=s.a.newName();return(o||(o=Object.create(null)))["."+t]=e,t}Object(i.a)(this,e),this.map=Object.create(null),this.all="string"==typeof n.all?n.all:n.all?a(n.all):null;var c,u=Object(r.a)(t);try{for(u.s();!(c=u.n()).done;){var f=c.value,d=(f.class||a(Object.assign({},f,{tag:null})))+(this.all?" "+this.all:""),h=f.tag;if(Array.isArray(h)){var p,v=Object(r.a)(h);try{for(v.s();!(p=v.n()).done;){var m=p.value;this.map[m.id]=d}}catch(y){v.e(y)}finally{v.f()}}else this.map[h.id]=d}}catch(y){u.e(y)}finally{u.f()}this.module=o?new s.a(o):null,this.scope=n.scope||null,this.match=this.match.bind(this);var g=[S];this.module&&g.push(l.d.styleModule.of(this.module)),this.extension=g.concat(b.of(this)),this.fallback=g.concat(O.of(this))}return Object(o.a)(e,[{key:"match",value:function(e,t){if(this.scope&&t!=this.scope)return null;var n,i=Object(r.a)(e.set);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=this.map[o.id];if(void 0!==a)return o!=e&&(this.map[e.id]=a),a}}catch(s){i.e(s)}finally{i.f()}return this.map[e.id]=this.all}}],[{key:"combinedMatch",value:function(e){if(1==e.length)return e[0].match;var t=e.some((function(e){return e.scope}))?void 0:Object.create(null);return function(n,i){var o=t&&t[n.id];if(void 0!==o)return o;var a,s=null,l=Object(r.a)(e);try{for(l.s();!(a=l.n()).done;){var c=a.value.match(n,i);c&&(s=s?s+" "+c:c)}}catch(u){l.e(u)}finally{l.f()}return t&&(t[n.id]=s),s}}},{key:"define",value:function(t,n){return new e(t,n||{})}},{key:"get",value:function(e,t,n){var r=k(e);return r&&r(t,n||a.d.none)}}]),e}();var j=function(){function e(t){Object(i.a)(this,e),this.markCache=Object.create(null),this.tree=Object(u.j)(t.state),this.decorations=this.buildDeco(t,k(t.state))}return Object(o.a)(e,[{key:"update",value:function(e){var t=Object(u.j)(e.state),n=k(e.state),r=n!=e.startState.facet(b);t.length<e.view.viewport.to&&!r&&t.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n))}},{key:"buildDeco",value:function(e,t){var n=this;if(!t||!this.tree.length)return l.b.none;var i,o=new f.b,a=Object(r.a)(e.visibleRanges);try{for(a.s();!(i=a.n()).done;){var s=i.value,c=s.from,u=s.to;M(this.tree,c,u,t,(function(e,t,r){o.add(e,t,n.markCache[r]||(n.markCache[r]=l.b.mark({class:r})))}))}}catch(d){a.e(d)}finally{a.f()}return o.finish()}}]),e}(),S=c.i.extend(l.f.fromClass(j,{decorations:function(e){return e.decorations}})),E=[""],C=function(){function e(t,n,r){Object(i.a)(this,e),this.at=t,this.style=n,this.span=r,this.class=""}return Object(o.a)(e,[{key:"startSpan",value:function(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}},{key:"flush",value:function(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}},{key:"highlightRange",value:function(e,t,n,i,o,s){var l=e.type,c=e.from,u=e.to;if(!(c>=n||u<=t)){E[o]=l.name,l.isTop&&(s=l);for(var f=i,d=l.prop(y),h=!1;d;){if(!d.context||P(d.context,E,o)){var p,v=Object(r.a)(d.tags);try{for(v.s();!(p=v.n()).done;){var m=p.value,g=this.style(m,s);g&&(f&&(f+=" "),f+=g,1==d.mode?i+=(i?" ":"")+g:0==d.mode&&(h=!0))}}catch(T){v.e(T)}finally{v.f()}break}d=d.next}if(this.startSpan(e.from,f),!h){var b=e.tree&&e.tree.prop(a.b.mounted);if(b&&b.overlay){for(var O=e.node.enter(b.overlay[0].from+c,1),k=e.firstChild(),w=0,x=c;;w++){var j=w<b.overlay.length?b.overlay[w]:null,S=j?j.from+c:u,C=Math.max(t,x),M=Math.min(n,S);if(C<M&&k)for(;e.from<M&&(this.highlightRange(e,C,M,i,o+1,s),this.startSpan(Math.min(n,e.to),f),!(e.to>=S)&&e.nextSibling()););if(!j||S>n)break;(x=j.to+c)>t&&(this.highlightRange(O.cursor,Math.max(t,j.from+c),Math.min(n,x),i,o,b.tree.type),this.startSpan(x,f))}k&&e.parent()}else if(e.firstChild()){do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,o+1,s),this.startSpan(Math.min(n,e.to),f)}}while(e.nextSibling());e.parent()}}}}}]),e}();function M(e,t,n,r,i){var o=new C(t,r,i);o.highlightRange(e.cursor(),t,n,"",0,e.type),o.flush(n)}function P(e,t,n){if(e.length>n-1)return!1;for(var r=n-1,i=e.length-1;i>=0;i--,r--){var o=e[i];if(o&&o!=t[r])return!1}return!0}var T=h.define,A=T(),D=T(),R=T(D),N=T(D),_=T(),L=T(_),I=T(_),$=T(),z=T($),B=T(),F=T(),W=T(),V=T(W),H=T(),Q={comment:A,lineComment:T(A),blockComment:T(A),docComment:T(A),name:D,variableName:T(D),typeName:R,tagName:T(R),propertyName:N,attributeName:T(N),className:T(D),labelName:T(D),namespace:T(D),macroName:T(D),literal:_,string:L,docString:T(L),character:T(L),attributeValue:T(L),number:I,integer:T(I),float:T(I),bool:T(_),regexp:T(_),escape:T(_),color:T(_),url:T(_),keyword:B,self:T(B),null:T(B),atom:T(B),unit:T(B),modifier:T(B),operatorKeyword:T(B),controlKeyword:T(B),definitionKeyword:T(B),operator:F,derefOperator:T(F),arithmeticOperator:T(F),logicOperator:T(F),bitwiseOperator:T(F),compareOperator:T(F),updateOperator:T(F),definitionOperator:T(F),typeOperator:T(F),controlOperator:T(F),punctuation:W,separator:T(W),bracket:V,angleBracket:T(V),squareBracket:T(V),paren:T(V),brace:T(V),content:$,heading:z,heading1:T(z),heading2:T(z),heading3:T(z),heading4:T(z),heading5:T(z),heading6:T(z),contentSeparator:T($),list:T($),quote:T($),emphasis:T($),strong:T($),link:T($),monospace:T($),strikethrough:T($),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:H,documentMeta:T(H),annotation:T(H),processingInstruction:T(H),definition:h.defineModifier(),constant:h.defineModifier(),function:h.defineModifier(),standard:h.defineModifier(),local:h.defineModifier(),special:h.defineModifier()},q=x.define([{tag:Q.link,textDecoration:"underline"},{tag:Q.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Q.emphasis,fontStyle:"italic"},{tag:Q.strong,fontWeight:"bold"},{tag:Q.strikethrough,textDecoration:"line-through"},{tag:Q.keyword,color:"#708"},{tag:[Q.atom,Q.bool,Q.url,Q.contentSeparator,Q.labelName],color:"#219"},{tag:[Q.literal,Q.inserted],color:"#164"},{tag:[Q.string,Q.deleted],color:"#a11"},{tag:[Q.regexp,Q.escape,Q.special(Q.string)],color:"#e40"},{tag:Q.definition(Q.variableName),color:"#00f"},{tag:Q.local(Q.variableName),color:"#30a"},{tag:[Q.typeName,Q.namespace],color:"#085"},{tag:Q.className,color:"#167"},{tag:[Q.special(Q.variableName),Q.macroName],color:"#256"},{tag:Q.definition(Q.propertyName),color:"#00c"},{tag:Q.comment,color:"#940"},{tag:Q.meta,color:"#7a757a"},{tag:Q.invalid,color:"#f00"}]);Q.link,Q.heading,Q.emphasis,Q.strong,Q.keyword,Q.atom,Q.bool,Q.url,Q.labelName,Q.inserted,Q.deleted,Q.literal,Q.string,Q.number,Q.regexp,Q.escape,Q.string,Q.variableName,Q.variableName,Q.variableName,Q.variableName,Q.typeName,Q.namespace,Q.macroName,Q.propertyName,Q.operator,Q.comment,Q.meta,Q.invalid,Q.punctuation},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(0),i=(n(11),Object(r.createContext)(null)),o=function(e){var t=e.utils,n=e.children,o=e.locale,a=e.libInstance,s=Object(r.useMemo)((function(){return new t({locale:o,instance:a})}),[t,a,o]);return Object(r.createElement)(i.Provider,{value:s,children:n})};function a(){var e=Object(r.useContext)(i);return function(e){if(!e)throw new Error("Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.")}(e),e}},,function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",f="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,c),o=n-i<0,a=t.clone().add(r+(o?-1:1),c);return+(-(r+(n-i)/(o?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:f,w:l,d:s,D:d,h:a,m:o,s:i,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",O={};O[b]=m;var k=function(e){return e instanceof S},w=function(e,t,n){var r;if(!e)return b;if("string"==typeof e)O[e]&&(r=e),t&&(O[e]=t,r=e);else{var i=e.name;O[i]=e,r=i}return!n&&r&&(b=r),r||!n&&b},x=function(e,t){if(k(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},j=y;j.l=w,j.i=k,j.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function m(e){this.$L=w(e.locale,null,!0),this.parse(e)}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(j.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return j},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(e,t){var n=x(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return x(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<x(e)},g.$g=function(e,t,n){return j.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,r=!!j.u(t)||t,u=j.p(e),h=function(e,t){var i=j.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},p=function(e,t){return j.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},v=this.$W,m=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case f:return r?h(1,0):h(31,11);case c:return r?h(1,m):h(0,m+1);case l:var b=this.$locale().weekStart||0,O=(v<b?v+7:v)-b;return h(r?g-O:g+(6-O),m);case s:case d:return p(y+"Hours",0);case a:return p(y+"Minutes",1);case o:return p(y+"Seconds",2);case i:return p(y+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var n,l=j.p(e),u="set"+(this.$u?"UTC":""),h=(n={},n[s]=u+"Date",n[d]=u+"Date",n[c]=u+"Month",n[f]=u+"FullYear",n[a]=u+"Hours",n[o]=u+"Minutes",n[i]=u+"Seconds",n[r]=u+"Milliseconds",n)[l],p=l===s?this.$D+(t-this.$W):t;if(l===c||l===f){var v=this.clone().set(d,1);v.$d[h](p),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[j.p(e)]()},g.add=function(r,u){var d,h=this;r=Number(r);var p=j.p(u),v=function(e){var t=x(h);return j.w(t.date(t.date()+Math.round(e*r)),h)};if(p===c)return this.set(c,this.$M+r);if(p===f)return this.set(f,this.$y+r);if(p===s)return v(1);if(p===l)return v(7);var m=(d={},d[o]=t,d[a]=n,d[i]=e,d)[p]||1,g=this.$d.getTime()+r*m;return j.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=j.z(this),o=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].substr(0,o)},f=function(e){return j.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:j.s(s+1,2,"0"),MMM:u(n.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:j.s(this.$D,2,"0"),d:String(this.$W),dd:u(n.weekdaysMin,this.$W,l,2),ddd:u(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:j.s(o,2,"0"),h:f(1),hh:f(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:j.s(a,2,"0"),s:String(this.$s),ss:j.s(this.$s,2,"0"),SSS:j.s(this.$ms,3,"0"),Z:i};return r.replace(v,(function(e,t){return t||p[e]||i.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(r,d,h){var p,v=j.p(d),m=x(r),g=(m.utcOffset()-this.utcOffset())*t,y=this-m,b=j.m(this,m);return b=(p={},p[f]=b/12,p[c]=b,p[u]=b/3,p[l]=(y-g)/6048e5,p[s]=(y-g)/864e5,p[a]=y/n,p[o]=y/t,p[i]=y/e,p)[v]||y,h?b:j.a(b)},g.daysInMonth=function(){return this.endOf(c).$D},g.$locale=function(){return O[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=w(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return j.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),E=S.prototype;return x.prototype=E,[["$ms",r],["$s",i],["$m",o],["$H",a],["$W",s],["$M",c],["$y",f],["$D",d]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),x.extend=function(e,t){return e.$i||(e(t,S,x),e.$i=!0),x},x.locale=w,x.isDayjs=k,x.unix=function(e){return x(1e3*e)},x.en=O[b],x.Ls=O,x.p={},x}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),i=n(0),o=n.n(i),a=n(158);function s(e,t){var n=function(t,n){return o.a.createElement(a.a,Object(r.a)({ref:n},t),e)};return n.muiName=a.a.muiName,o.a.memo(o.a.forwardRef(n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(155),i=(n(0),n(68));function o(){return Object(r.a)()||i.a}},function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){return null==t?e:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r),t.apply(this,r)}}),(function(){}))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(58);function o(){return r.useContext(i.a)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(7),i={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}t.a={easing:i,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,l=t.easing,c=void 0===l?i.easeInOut:l,u=t.delay,f=void 0===u?0:u;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:a(s)," ").concat(c," ").concat("string"===typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";function r(e,t){return function(){return null}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=this,s=function(){e.apply(a,i)};clearTimeout(t),t=setTimeout(s,n)}return r.clear=function(){clearTimeout(t)},r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(91);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e){return e.scrollTop};function i(e,t){var n=e.timeout,r=e.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"===typeof n?n:n[t.mode]||0,delay:i.transitionDelay}}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(116).default;function i(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}e.exports=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=a?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(o,s,l):o[s]=e[s]}return o.default=e,n&&n.set(e,o),o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(54)},function(e,t,n){"use strict";n.r(t);var r=n(16);n.d(t,"capitalize",(function(){return r.a}));var i=n(41);n.d(t,"createChainedFunction",(function(){return i.a}));var o=n(37);n.d(t,"createSvgIcon",(function(){return o.a}));var a=n(48);n.d(t,"debounce",(function(){return a.a}));var s=n(45);n.d(t,"deprecatedPropType",(function(){return s.a}));var l=n(79);n.d(t,"isMuiElement",(function(){return l.a}));var c=n(30);n.d(t,"ownerDocument",(function(){return c.a}));var u=n(67);n.d(t,"ownerWindow",(function(){return u.a}));var f=n(114);n.d(t,"requirePropFactory",(function(){return f.a}));var d=n(39);n.d(t,"setRef",(function(){return d.a}));var h=n(115);n.d(t,"unsupportedProp",(function(){return h.a}));var p=n(55);n.d(t,"useControlled",(function(){return p.a}));var v=n(31);n.d(t,"useEventCallback",(function(){return v.a}));var m=n(24);n.d(t,"useForkRef",(function(){return m.a}));var g=n(88);n.d(t,"unstable_useId",(function(){return g.a}));var y=n(66);n.d(t,"useIsFocusVisible",(function(){return y.a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e){var t=e.controlled,n=e.default,i=(e.name,e.state,r.useRef(void 0!==t).current),o=r.useState(n),a=o[0],s=o[1];return[i?t:a,r.useCallback((function(e){i||s(e)}),[])]}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(84);var i=n(94),o=n(78);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(0),i=r.createContext();function o(){return r.useContext(i)}t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(5),i=n(6),o="undefined"==typeof Symbol?"__\u037c":Symbol.for("\u037c"),a="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},l=function(){function e(t,n){Object(r.a)(this,e),this.rules=[];var i=(n||{}).finish;function
(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function a(e,t,n,r){var s=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return n.push(e[0]+";");for(var u in t){var f=t[u];if(/&/.test(u))a(u.split(/,\s*/).map((function(t){return e.map((function(e){return t.replace(/&/,e)}))})).reduce((function(e,t){return e.concat(t)})),f,n);else if(f&&"object"==typeof f){if(!l)throw new RangeError("The value of a property ("+u+") should be a primitive value.");a(o(u),f,s,c)}else null!=f&&s.push(u.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+f+";")}(s.length||c)&&n.push((!i||l||r?e:e.map(i)).join(", ")+" {"+s.join(" ")+"}")}for(var s in t)a(o(s),t[s],this.rules)}return Object(i.a)(e,[{key:"getRules",value:function(){return this.rules.join("\n")}}],[{key:"newName",value:function(){var e=s[o]||1;return s[o]=e+1,"\u037c"+e.toString(36)}},{key:"mount",value:function(e,t){(e[a]||new u(e)).mount(Array.isArray(t)?t:[t])}}]),e}(),c=null,u=function(){function e(t){if(Object(r.a)(this,e),!t.head&&t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(c)return t.adoptedStyleSheets=[c.sheet].concat(t.adoptedStyleSheets),t[a]=c;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),c=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[a]=this}return Object(i.a)(e,[{key:"mount",value:function(e){for(var t=this.sheet,n=0,r=0,i=0;i<e.length;i++){var o=e[i],a=this.modules.indexOf(o);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),t)for(var s=0;s<o.rules.length;s++)t.insertRule(o.rules[s],n++)}else{for(;r<a;)n+=this.modules[r++].rules.length;n+=o.rules.length,r++}}if(!t){for(var l="",c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+"\n";this.styleTag.textContent=l}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return ce})),n.d(t,"b",(function(){return ue})),n.d(t,"c",(function(){return re}));var r=n(18),i=n(17),o=n(25),a=n(13),s=n(3),l=n(5),c=n(6),u=n(4),f=n(15),d=n(9),h=n(100),p=n(21),v=function(){function e(t,n,r){Object(l.a)(this,e),this.state=t,this.pos=n,this.explicit=r,this.abortListeners=[]}return Object(c.a)(e,[{key:"tokenBefore",value:function(e){for(var t=Object(p.j)(this.state).resolveInner(this.pos,-1);t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}},{key:"matchBefore",value:function(e){var t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(O(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}},{key:"aborted",get:function(){return null==this.abortListeners}},{key:"addEventListener",value:function(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}]),e}();function m(e){var t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),"[".concat(n?"\\w":"").concat(t.replace(/[^\w\s]/g,"\\$&"),"]")}function g(e){var t=e.map((function(e){return"string"==typeof e?{label:e}:e})),n=t.every((function(e){return/^\w+$/.test(e.label)}))?[/\w*$/,/\w+$/]:function(e){var t,n=Object.create(null),r=Object.create(null),i=Object(s.a)(e);try{for(i.s();!(t=i.n()).done;){var o=t.value.label;n[o[0]]=!0;for(var a=1;a<o.length;a++)r[o[a]]=!0}}catch(c){i.e(c)}finally{i.f()}var l=m(n)+m(r)+"*$";return[new RegExp("^"+l),new RegExp(l)]}(t),r=Object(a.a)(n,2),i=r[0],o=r[1];return function(e){var n=e.matchBefore(o);return n||e.explicit?{from:n?n.from:e.pos,options:t,span:i}:null}}var y=function e(t,n,r){Object(l.a)(this,e),this.completion=t,this.source=n,this.match=r};function b(e){return e.selection.main.head}function O(e,t){var n,r=e.source,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?new RegExp("".concat(i?"^":"","(?:").concat(r,")").concat(o?"$":""),null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}function k(e,t){var n=t.completion.apply||t.completion.label,r=t.source;"string"==typeof n?e.dispatch({changes:{from:r.from,to:r.to,insert:n},selection:{anchor:r.from+n.length},userEvent:"input.complete"}):n(e,t.completion,r.from,r.to)}var w=new WeakMap;function x(e){if(!Array.isArray(e))return e;var t=w.get(e);return t||w.set(e,t=g(e)),t}var j=function(){function e(t){Object(l.a)(this,e),this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(var n=0;n<t.length;){var r=Object(f.b)(t,n),i=Object(f.c)(r);this.chars.push(r);var o=t.slice(n,n+i),a=o.toUpperCase();this.folded.push(Object(f.b)(a==o?o.toLowerCase():a,0)),n+=i}this.astral=t.length!=this.chars.length}return Object(c.a)(e,[{key:"match",value:function(e){if(0==this.pattern.length)return[0];if(e.length<this.pattern.length)return null;var t=this.chars,n=this.folded,r=this.any,i=this.precise,o=this.byWord;if(1==t.length){var a=Object(f.b)(e,0);return a==t[0]?[0,0,Object(f.c)(a)]:a==n[0]?[-200,0,Object(f.c)(a)]:null}var s=e.indexOf(this.pattern);if(0==s)return[0,0,this.pattern.length];var l=t.length,c=0;if(s<0){for(var u=0,d=Math.min(e.length,200);u<d&&c<l;){var h=Object(f.b)(e,u);h!=t[c]&&h!=n[c]||(r[c++]=u),u+=Object(f.c)(h)}if(c<l)return null}for(var p=0,v=0,m=!1,g=0,y=-1,b=-1,O=/[a-z]/.test(e),k=0,w=Math.min(e.length,200),x=0;k<w&&v<l;){var j=Object(f.b)(e,k);s<0&&(p<l&&j==t[p]&&(i[p++]=k),g<l&&(j==t[g]||j==n[g]?(0==g&&(y=k),b=k+1,g++):g=0));var S=void 0,E=j<255?j>=48&&j<=57||j>=97&&j<=122?2:j>=65&&j<=90?1:0:(S=Object(f.g)(j))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(1==E&&O||0==x&&0!=E)&&(t[v]==j||n[v]==j&&(m=!0))&&(o[v++]=k),x=E,k+=Object(f.c)(j)}return v==l&&0==o[0]?this.result((m?-200:0)-100,o,e):g==l&&0==y?[-200,0,b]:s>-1?[-700,s,s+this.pattern.length]:g==l?[-900,y,b]:v==l?this.result((m?-200:0)-100-700,o,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}},{key:"result",value:function(e,t,n){var r,i=[e],o=1,a=Object(s.a)(t);try{for(a.s();!(r=a.n()).done;){var l=r.value,c=l+(this.astral?Object(f.c)(Object(f.b)(n,l)):1);o>1&&i[o-1]==l?i[o-1]=c:(i[o++]=l,i[o++]=c)}}catch(u){a.e(u)}finally{a.f()}return i}}]),e}(),S=u.g.define({combine:function(e){return Object(u.m)(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100,defaultKeymap:!0,optionClass:function(){return""},icons:!0,addToOptions:[]},{defaultKeymap:function(e,t){return e&&t},icons:function(e,t){return e&&t},optionClass:function(e,t){return function(n){return function(e,t){return e?t?e+" "+t:e:t}(e(n),t(n))}},addToOptions:function(e,t){return e.concat(t)}})}});var E=d.d.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#39e",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25cb'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25cc'"}},".cm-completionIcon-variable":{"&:after":{content:"'\ud835\udc65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\ud835\udc36'"}},".cm-completionIcon-type":{"&:after":{content:"'\ud835\udc61'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222a'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25a1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\ud83d\udd11\ufe0e'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25a2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});function C(e,t,n){if(e<=n)return{from:0,to:e};if(t<=e>>1){var r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}var i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var M=function(){function e(t,n){var r=this;Object(l.a)(this,e),this.view=t,this.stateField=n,this.info=null,this.placeInfo={read:function(){return r.measureInfo()},write:function(e){return r.positionInfo(e)},key:this};var i=t.state.field(n),a=i.open,s=a.options,c=a.selected,u=t.state.facet(S);this.optionContent=function(e){var t=e.addToOptions.slice();return e.icons&&t.push({render:function(e){var t,n=document.createElement("div");return n.classList.add("cm-completionIcon"),e.type&&(t=n.classList).add.apply(t,Object(o.a)(e.type.split(/\s+/g).map((function(e){return"cm-completionIcon-"+e})))),n.setAttribute("aria-hidden","true"),n},position:20}),t.push({render:function(e,t,n){var r=document.createElement("span");r.className="cm-completionLabel";for(var i=e.label,o=0,a=1;a<n.length;){var s=n[a++],l=n[a++];s>o&&r.appendChild(document.createTextNode(i.slice(o,s)));var c=r.appendChild(document.createElement("span"));c.appendChild(document.createTextNode(i.slice(s,l))),c.className="cm-completionMatchedText",o=l}return o<i.length&&r.appendChild(document.createTextNode(i.slice(o))),r},position:50},{render:function(e){if(!e.detail)return null;var t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((function(e,t){return e.position-t.position})).map((function(e){return e.render}))}(u),this.optionClass=u.optionClass,this.range=C(s.length,c,u.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",(function(e){for(var n,i=e.target;i&&i!=r.dom;i=i.parentNode)if("LI"==i.nodeName&&(n=/-(\d+)$/.exec(i.id))&&+n[1]<s.length)return k(t,s[+n[1]]),void e.preventDefault()})),this.list=this.dom.appendChild(this.createListBox(s,i.id,this.range)),this.list.addEventListener("scroll",(function(){r.info&&r.view.requestMeasure(r.placeInfo)}))}return Object(c.a)(e,[{key:"mount",value:function(){this.updateSel()}},{key:"update",value:function(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}},{key:"positioned",value:function(){this.info&&this.view.requestMeasure(this.placeInfo)}},{key:"updateSel",value:function(){var e=this,t=this.view.state.field(this.stateField),n=t.open;if((n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=C(n.options.length,n.selected,this.view.state.facet(S).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(n.options,t.id,this.range)),this.list.addEventListener("scroll",(function(){e.info&&e.view.requestMeasure(e.placeInfo)}))),this.updateSelectedOption(n.selected)){this.info&&(this.info.remove(),this.info=null);var r=n.options[n.selected];r.completion.info&&(this.info=this.dom.appendChild(function(e,t){var n=document.createElement("div");n.className="cm-tooltip cm-completionInfo";var r=e.completion.info;if("string"==typeof r)n.textContent=r;else{var i=r(e.completion);i.then?i.then((function(e){return n.appendChild(e)}),(function(e){return Object(d.l)(t.state,e,"completion info")})):n.appendChild(i)}return n}(r,this.view)),this.view.requestMeasure(this.placeInfo))}}},{key:"updateSelectedOption",value:function(e){for(var t=null,n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.top<n.top?e.scrollTop-=n.top-r.top:r.bottom>n.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}},{key:"measureInfo",value:function(){var e=this.dom.querySelector("[aria-selected]");if(!e)return null;var t=this.dom.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;if(n<0||n>this.list.clientHeight-10)return null;var r=this.view.textDirection==d.c.RTL,i=t.left,o=innerWidth-t.right;return r&&i<Math.min(300,o)?r=!1:!r&&o<Math.min(300,i)&&(r=!0),{top:n,left:r}}},{key:"positionInfo",value:function(e){this.info&&e&&(this.info.style.top=e.top+"px",this.info.classList.toggle("cm-completionInfo-left",e.left),this.info.classList.toggle("cm-completionInfo-right",!e.left))}},{key:"createListBox",value:function(e,t,n){var r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox");for(var i=n.from;i<n.to;i++){var o=e[i],a=o.completion,l=o.match,c=r.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");var u=this.optionClass(a);u&&(c.className=u);var f,d=Object(s.a)(this.optionContent);try{for(d.s();!(f=d.n()).done;){var h=(0,f.value)(a,this.view.state,l);h&&c.appendChild(h)}}catch(p){d.e(p)}finally{d.f()}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}}]),e}();function P(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}var T=function(){function e(t,n,r,i,o){Object(l.a)(this,e),this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o}return Object(c.a)(e,[{key:"setSelected",value:function(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,R(n,t),this.tooltip,this.timestamp,t)}},{key:"map",value:function(t){return new e(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}],[{key:"build",value:function(t,n,r,i){var o=function(e,t){var n,r=[],i=0,o=Object(s.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.hasResult())if(!1===a.result.filter){var l,c=Object(s.a)(a.result.options);try{for(c.s();!(l=c.n()).done;){var u=l.value;r.push(new y(u,a,[1e9-i++]))}}catch(w){c.e(w)}finally{c.f()}}else{var f,d=new j(t.sliceDoc(a.from,a.to)),h=void 0,p=Object(s.a)(a.result.options);try{for(p.s();!(f=p.n()).done;){var v=f.value;(h=d.match(v.label))&&(null!=v.boost&&(h[0]+=v.boost),r.push(new y(v,a,h)))}}catch(w){p.e(w)}finally{p.f()}}}}catch(w){o.e(w)}finally{o.f()}r.sort(_);var m,g=[],b=null,O=Object(s.a)(r.sort(_));try{for(O.s();!(m=O.n()).done;){var k=m.value;if(300==g.length)break;b&&b.label==k.completion.label&&b.detail==k.completion.detail?P(k.completion)>P(b)&&(g[g.length-1]=k):g.push(k),b=k.completion}}catch(w){O.e(w)}finally{O.f()}return g}(t,n);if(!o.length)return null;var a,l=0;if(i&&i.selected)for(var c=i.options[i.selected].completion,u=0;u<o.length&&!l;u++)o[u].completion==c&&(l=u);return new e(o,R(r,l),{pos:t.reduce((function(e,t){return t.hasResult()?Math.min(e,t.from):e}),1e8),create:(a=V,function(e){return new M(e,a)})},i?i.timestamp:Date.now(),l)}}]),e}(),A=function(){function e(t,n,r){Object(l.a)(this,e),this.active=t,this.id=n,this.open=r}return Object(c.a)(e,[{key:"update",value:function(t){var n=this,r=t.state,i=r.facet(S),o=(i.override||r.languageDataAt("autocomplete",b(r)).map(x)).map((function(e){return(n.active.find((function(t){return t.source==e}))||new I(e,n.active.some((function(e){return 0!=e.state}))?1:0)).update(t,i)}));o.length==this.active.length&&o.every((function(e,t){return e==n.active[t]}))&&(o=this.active);var a=t.selection||o.some((function(e){return e.hasResult()&&t.changes.touchesRange(e.from,e.to)}))||!function(e,t){if(e==t)return!0;for(var n=0,r=0;;){for(;n<e.length&&!e[n].hasResult;)n++;for(;r<t.length&&!t[r].hasResult;)r++;var i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}(o,this.active)?T.build(o,r,this.id,this.open):this.open&&t.docChanged?this.open.map(t.changes):this.open;!a&&o.every((function(e){return 1!=e.state}))&&o.some((function(e){return e.hasResult()}))&&(o=o.map((function(e){return e.hasResult()?new I(e.source,0):e})));var l,c=Object(s.a)(t.effects);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.is(W)&&(a=a&&a.setSelected(u.value,this.id))}}catch(f){c.e(f)}finally{c.f()}return o==this.active&&a==this.open?this:new e(o,this.id,a)}},{key:"tooltip",get:function(){return this.open?this.open.tooltip:null}},{key:"attrs",get:function(){return this.open?this.open.attrs:D}}],[{key:"start",value:function(){return new e(N,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}}]),e}();var D={"aria-autocomplete":"list","aria-expanded":"false"};function R(e,t){return{"aria-autocomplete":"list","aria-expanded":"true","aria-activedescendant":e+"-"+t,"aria-controls":e}}var N=[];function _(e,t){var n=t.match[0]-e.match[0];return n||e.completion.label.localeCompare(t.completion.label)}function L(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}var I=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;Object(l.a)(this,e),this.source=t,this.state=n,this.explicitPos=r}return Object(c.a)(e,[{key:"hasResult",value:function(){return!1}},{key:"update",value:function(t,n){var r=L(t),i=this;r?i=i.handleUserEvent(t,r,n):t.docChanged?i=i.handleChange(t):t.selection&&0!=i.state&&(i=new e(i.source,0));var o,a=Object(s.a)(t.effects);try{for(a.s();!(o=a.n()).done;){var l=o.value;if(l.is(z))i=new e(i.source,1,l.value?b(t.state):-1);else if(l.is(B))i=new e(i.source,0);else if(l.is(F)){var c,u=Object(s.a)(l.value);try{for(u.s();!(c=u.n()).done;){var f=c.value;f.source==i.source&&(i=f)}}catch(d){u.e(d)}finally{u.f()}}}}catch(d){a.e(d)}finally{a.f()}return i}},{key:"handleUserEvent",value:function(t,n,r){return"delete"!=n&&r.activateOnTyping?new e(this.source,1):this.map(t.changes)}},{key:"handleChange",value:function(t){return t.changes.touchesRange(b(t.startState))?new e(this.source,0):this.map(t.changes)}},{key:"map",value:function(t){return t.empty||this.explicitPos<0?this:new e(this.source,this.state,t.mapPos(this.explicitPos))}}]),e}(),$=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,o,a,s){var c;return Object(l.a)(this,n),(c=t.call(this,e,2,r)).result=i,c.from=o,c.to=a,c.span=s,c}return Object(c.a)(n,[{key:"hasResult",value:function(){return!0}},{key:"handleUserEvent",value:function(e,t,r){var i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=b(e.state);if((this.explicitPos>-1?a<i:a<=i)||a>o)return new I(this.source,"input"==t&&r.activateOnTyping?1:0);var s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return this.span&&(i==o||this.span.test(e.state.sliceDoc(i,o)))?new n(this.source,s,this.result,i,o,this.span):new I(this.source,1,s)}},{key:"handleChange",value:function(e){return e.changes.touchesRange(this.from,this.to)?new I(this.source,0):this.map(e.changes)}},{key:"map",value:function(e){return e.empty?this:new n(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1),this.span)}}]),n}(I),z=u.j.define(),B=u.j.define(),F=u.j.define({map:function(e,t){return e.map((function(e){return e.map(t)}))}}),W=u.j.define(),V=u.k.define({create:function(){return A.start()},update:function(e,t){return e.update(t)},provide:function(e){return[h.b.from(e,(function(e){return e.tooltip})),d.d.contentAttributes.from(e,(function(e){return e.attrs}))]}});function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(V,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;var i,o=1;"page"==t&&(i=n.dom.querySelector(".cm-tooltip-autocomplete"))&&(o=Math.max(2,Math.floor(i.offsetHeight/i.firstChild.offsetHeight)));var a=r.open.selected+o*(e?1:-1),s=r.open.options.length;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:W.of(a)}),!0}}var Q=function e(t,n){Object(l.a)(this,e),this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0},q=d.f.fromClass(function(){function e(t){Object(l.a)(this,e),this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;var n,r=Object(s.a)(t.state.field(V).active);try{for(r.s();!(n=r.n()).done;){var i=n.value;1==i.state&&this.startQuery(i)}}catch(o){r.e(o)}finally{r.f()}}return Object(c.a)(e,[{key:"update",value:function(e){var t=this,n=e.state.field(V);if(e.selectionSet||e.docChanged||e.startState.field(V)!=n){for(var r=e.transactions.some((function(e){return(e.selection||e.docChanged)&&!L(e)})),i=0;i<this.running.length;i++){var a=this.running[i];if(r||a.updates.length+e.transactions.length>50&&a.time-Date.now()>1e3){var l,c=Object(s.a)(a.context.abortListeners);try{for(c.s();!(l=c.n()).done;){var u=l.value;try{u()}catch(m){Object(d.l)(this.view.state,m)}}}catch(g){c.e(g)}finally{c.f()}a.context.abortListeners=null,this.running.splice(i--,1)}else{var f;(f=a.updates).push.apply(f,Object(o.a)(e.transactions))}}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.active.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),50):-1,0!=this.composing){var h,p=Object(s.a)(e.transactions);try{for(p.s();!(h=p.n()).done;){var v=h.value;"input"==L(v)?this.composing=2:2==this.composing&&v.selection&&(this.composing=3)}}catch(g){p.e(g)}finally{p.f()}}}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1;var t,n=this.view.state.field(V),r=Object(s.a)(n.active);try{var i=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.active.source==n.source}))||e.startQuery(n)};for(r.s();!(t=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=b(n),i=new v(n,r,e.explicitPos==r),o=new Q(e,i);this.running.push(o),Promise.resolve(e.source(i)).then((function(e){o.context.aborted||(o.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:B.of(null)}),Object(d.l)(t.view.state,e)}))}},{key:"scheduleAccept",value:function(){var e=this;this.running.every((function(e){return void 0!==e.done}))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((function(){return e.accept()}),50))}},{key:"accept",value:function(){var e,t=this;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;for(var n=[],r=this.view.state.facet(S),i=function(i){var a=t.running[i];if(void 0===a.done)return o=i,"continue";if(t.running.splice(i--,1),a.done){var l,c=new $(a.active.source,a.active.explicitPos,a.done,a.done.from,null!==(e=a.done.to)&&void 0!==e?e:b(a.updates.length?a.updates[0].startState:t.view.state),a.done.span&&!1!==a.done.filter?O(a.done.span,!0):null),u=Object(s.a)(a.updates);try{for(u.s();!(l=u.n()).done;){var f=l.value;c=c.update(f,r)}}catch(g){u.e(g)}finally{u.f()}if(c.hasResult())return n.push(c),o=i,"continue"}var d=t.view.state.field(V).active.find((function(e){return e.source==a.active.source}));if(d&&1==d.state)if(null==a.done){var h,p=new I(a.active.source,0),v=Object(s.a)(a.updates);try{for(v.s();!(h=v.n()).done;){var m=h.value;p=p.update(m,r)}}catch(g){v.e(g)}finally{v.f()}1!=p.state&&n.push(p)}else t.startQuery(d);o=i},o=0;o<this.running.length;o++)i(o);n.length&&this.view.dispatch({effects:F.of(n)})}}]),e}(),{eventHandlers:{compositionstart:function(){this.composing=1},compositionend:function(){var e=this;3==this.composing&&setTimeout((function(){return e.view.dispatch({effects:z.of(!1)})}),20),this.composing=0}}}),U=function e(t,n,r,i){Object(l.a)(this,e),this.field=t,this.line=n,this.from=r,this.to=i},X=function(){function e(t,n,r){Object(l.a)(this,e),this.field=t,this.from=n,this.to=r}return Object(c.a)(e,[{key:"map",value:function(t){return new e(this.field,t.mapPos(this.from,-1),t.mapPos(this.to,1))}}]),e}(),Y=function(){function e(t,n){Object(l.a)(this,e),this.lines=t,this.fieldPositions=n}return Object(c.a)(e,[{key:"instantiate",value:function(e,t){var n,r=[],i=[t],o=e.doc.lineAt(t),a=/^\s*/.exec(o.text)[0],l=Object(s.a)(this.lines);try{for(l.s();!(n=l.n()).done;){var c=n.value;if(r.length){for(var u=a,f=/^\t*/.exec(c)[0].length,d=0;d<f;d++)u+=e.facet(p.h);i.push(t+u.length-f),c=u+c.slice(f)}r.push(c),t+=c.length+1}}catch(v){l.e(v)}finally{l.f()}var h=this.fieldPositions.map((function(e){return new X(e.field,i[e.line]+e.from,i[e.line]+e.to)}));return{text:r,ranges:h}}}],[{key:"parse",value:function(t){var n,r,i=[],o=[],a=[],l=Object(s.a)(t.split(/\r\n?|\n/));try{for(l.s();!(r=l.n()).done;){for(var c=r.value;n=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(c);){for(var u=n[1]?+n[1]:null,f=n[2]||n[3],d=-1,h=0;h<i.length;h++)(null!=u?i[h].seq==u:f&&i[h].name==f)&&(d=h);if(d<0){for(var p=0;p<i.length&&(null==u||null!=i[p].seq&&i[p].seq<u);)p++;i.splice(p,0,{seq:u,name:f||null}),d=p;var v,m=Object(s.a)(a);try{for(m.s();!(v=m.n()).done;){var g=v.value;g.field>=d&&g.field++}}catch(y){m.e(y)}finally{m.f()}}a.push(new U(d,o.length,n.index,n.index+f.length)),c=c.slice(0,n.index)+f+c.slice(n.index+n[0].length)}o.push(c)}}catch(y){l.e(y)}finally{l.f()}return new e(o,a)}}]),e}(),G=d.b.widget({widget:new(function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(){return Object(l.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"toDOM",value:function(){var e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(d.g))}),K=d.b.mark({class:"cm-snippetField"}),J=function(){function e(t,n){Object(l.a)(this,e),this.ranges=t,this.active=n,this.deco=d.b.set(t.map((function(e){return(e.from==e.to?G:K).range(e.from,e.to)})))}return Object(c.a)(e,[{key:"map",value:function(t){return new e(this.ranges.map((function(e){return e.map(t)})),this.active)}},{key:"selectionInsideField",value:function(e){var t=this;return e.ranges.every((function(e){return t.ranges.some((function(n){return n.field==t.active&&n.from<=e.from&&n.to>=e.to}))}))}}]),e}(),Z=u.j.define({map:function(e,t){return e&&e.map(t)}}),ee=u.j.define(),te=u.k.define({create:function(){return null},update:function(e,t){var n,r=Object(s.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(Z))return i.value;if(i.is(ee)&&e)return new J(e.ranges,i.value)}}catch(o){r.e(o)}finally{r.f()}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:function(e){return d.d.decorations.from(e,(function(e){return e?e.deco:d.b.none}))}});function ne(e,t){return u.e.create(e.filter((function(e){return e.field==t})).map((function(e){return u.e.range(e.from,e.to)})))}function re(e){var t=Y.parse(e);return function(e,n,r,i){var o=t.instantiate(e.state,r),a=o.text,s=o.ranges,l={changes:{from:r,to:i,insert:f.a.of(a)}};if(s.length&&(l.selection=ne(s,0)),s.length>1){var c=new J(s,0),d=l.effects=[Z.of(c)];void 0===e.state.field(te,!1)&&d.push(u.j.appendConfig.of([te.init((function(){return c})),se,le,E]))}e.dispatch(e.state.update(l))}}function ie(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(te,!1);if(!i||e<0&&0==i.active)return!1;var o=i.active+e,a=e>0&&!i.ranges.some((function(t){return t.field==o+e}));return r(n.update({selection:ne(i.ranges,o),effects:Z.of(a?null:new J(i.ranges,o))})),!0}}var oe=[{key:"Tab",run:ie(1),shift:ie(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(te,!1)&&(n(t.update({effects:Z.of(null)})),!0)}}],ae=u.g.define({combine:function(e){return e.length?e[0]:oe}}),se=u.i.override(d.k.compute([ae],(function(e){return e.facet(ae)})));var le=d.d.domEventHandlers({mousedown:function(e,t){var n,r=t.state.field(te,!1);if(!r||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;var i=r.ranges.find((function(e){return e.from<=n&&e.to>=n}));return!(!i||i.field==r.active)&&(t.dispatch({selection:ne(r.ranges,i.field),effects:Z.of(r.ranges.some((function(e){return e.field>i.field}))?new J(r.ranges,i.field):null)}),!0)}});function ce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[V,S.of(e),q,fe,E]}var ue=[{key:"Ctrl-Space",run:function(e){return!!e.state.field(V,!1)&&(e.dispatch({effects:z.of(!0)}),!0)}},{key:"Escape",run:function(e){var t=e.state.field(V,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:B.of(null)}),!0)}},{key:"ArrowDown",run:H(!0)},{key:"ArrowUp",run:H(!1)},{key:"PageDown",run:H(!0,"page")},{key:"PageUp",run:H(!1,"page")},{key:"Enter",run:function(e){var t=e.state.field(V,!1);return!(e.state.readOnly||!t||!t.open||Date.now()-t.open.timestamp<75)&&(k(e,t.open.options[t.open.selected]),!0)}}],fe=u.i.override(d.k.computeN([S],(function(e){return e.facet(S).defaultKeymap?[ue]:[]})))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return p}));var r=n(5),i=n(6),o=n(3),a=n(9),s=n(4),l=s.g.define({combine:function(e){var t,n,r,i=Object(o.a)(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;t=t||a.topContainer,n=n||a.bottomContainer}}catch(s){i.e(s)}finally{i.f()}return{topContainer:t,bottomContainer:n}}});function c(e,t){var n=e.plugin(u),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var u=a.f.fromClass(function(){function e(t){Object(r.a)(this,e),this.input=t.state.facet(p),this.specs=this.input.filter((function(e){return e})),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(l);this.top=new f(t,!0,n.topContainer),this.bottom=new f(t,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(e){return e.top}))),this.bottom.sync(this.panels.filter((function(e){return!e.top})));var i,a=Object(o.a)(this.panels);try{for(a.s();!(i=a.n()).done;){var s=i.value;s.dom.classList.add("cm-panel"),s.mount&&s.mount()}}catch(c){a.e(c)}finally{a.f()}}return Object(i.a)(e,[{key:"update",value:function(e){var t=e.state.facet(l);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new f(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new f(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(p);if(n!=this.input){var r,i=n.filter((function(e){return e})),a=[],s=[],c=[],u=[],d=Object(o.a)(i);try{for(d.s();!(r=d.n()).done;){var h=r.value,v=this.specs.indexOf(h),m=void 0;v<0?(m=h(e.view),u.push(m)):(m=this.panels[v]).update&&m.update(e),a.push(m),(m.top?s:c).push(m)}}catch(x){d.e(x)}finally{d.f()}this.specs=i,this.panels=a,this.top.sync(s),this.bottom.sync(c);for(var g=0,y=u;g<y.length;g++){var b=y[g];b.dom.classList.add("cm-panel"),b.mount&&b.mount()}}else{var O,k=Object(o.a)(this.panels);try{for(k.s();!(O=k.n()).done;){var w=O.value;w.update&&w.update(e)}}catch(x){k.e(x)}finally{k.f()}}}},{key:"destroy",value:function(){this.top.sync([]),this.bottom.sync([])}}]),e}(),{provide:a.e.scrollMargins.from((function(e){return{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}}))}),f=function(){function e(t,n,i){Object(r.a)(this,e),this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}return Object(i.a)(e,[{key:"sync",value:function(e){this.panels=e,this.syncDOM()}},{key:"syncDOM",value:function(){if(0!=this.panels.length){if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";var e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}var t,n=this.dom.firstChild,r=Object(o.a)(this.panels);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.dom.parentNode==this.dom){for(;n!=i.dom;)n=d(n);n=n.nextSibling}else this.dom.insertBefore(i.dom,n)}}catch(a){r.e(a)}finally{r.f()}for(;n;)n=d(n)}else this.dom&&(this.dom.remove(),this.dom=void 0)}},{key:"scrollMargin",value:function(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}},{key:"syncClasses",value:function(){if(this.container&&this.classes!=this.view.themeClasses){var e,t=Object(o.a)(this.classes.split(" "));try{for(t.s();!(e=t.n()).done;){var n=e.value;n&&this.container.classList.remove(n)}}catch(s){t.e(s)}finally{t.f()}var r,i=Object(o.a)((this.classes=this.view.themeClasses).split(" "));try{for(i.s();!(r=i.n()).done;){var a=r.value;a&&this.container.classList.add(a)}}catch(s){i.e(s)}finally{i.f()}}}}]),e}();function d(e){var t=e.nextSibling;return e.remove(),t}var h=a.d.baseTheme({".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"}}),p=s.g.define({enables:[u,h]})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(35);function i(e,t,n){return i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(e,t,n||e)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(209);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return g}));var r=n(3),i=n(4),o=n(21),a=n(9),s=n(23),l=a.d.baseTheme({".cm-matchingBracket":{backgroundColor:"#328c8252"},".cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),c=1e4,u="()[]{}",f=i.g.define({combine:function(e){return Object(i.m)(e,{afterCursor:!0,brackets:u,maxScanDistance:c})}}),d=a.b.mark({class:"cm-matchingBracket"}),h=a.b.mark({class:"cm-nonmatchingBracket"}),p=[i.k.define({create:function(){return a.b.none},update:function(e,t){if(!t.docChanged&&!t.selection)return e;var n,i=[],o=t.state.facet(f),s=Object(r.a)(t.state.selection.ranges);try{for(s.s();!(n=s.n()).done;){var l=n.value;if(l.empty){var c=g(t.state,l.head,-1,o)||l.head>0&&g(t.state,l.head-1,1,o)||o.afterCursor&&(g(t.state,l.head,1,o)||l.head<t.state.doc.length&&g(t.state,l.head+1,-1,o));if(c){var u=c.matched?d:h;i.push(u.range(c.start.from,c.start.to)),c.end&&i.push(u.range(c.end.from,c.end.to))}}}}catch(p){s.e(p)}finally{s.f()}return a.b.set(i,!0)},provide:function(e){return a.d.decorations.from(e)}}),l];function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[f.of(e),p]}function m(e,t,n){var r=e.prop(t<0?s.b.openedBy:s.b.closedBy);if(r)return r;if(1==e.name.length){var i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function g(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.maxScanDistance||c,a=r.brackets||u,s=Object(o.j)(e),l=s.resolveInner(t,n),f=l;f;f=f.parent){var d=m(f.type,n,a);if(d&&f.from<f.to)return y(e,t,n,f,d,a)}return b(e,t,n,s,l.type,i,a)}function y(e,t,n,r,i,o){var a=r.parent,s={from:r.from,to:r.to},l=0,c=null===a||void 0===a?void 0:a.cursor;if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do{if(n<0?c.to<=r.from:c.from>=r.to){if(0==l&&i.indexOf(c.type.name)>-1&&c.from<c.to)return{start:s,end:{from:c.from,to:c.to},matched:!0};if(m(c.type,n,o))l++;else if(m(c.type,-n,o)&&0==--l)return{start:s,end:c.from==c.to?void 0:{from:c.from,to:c.to},matched:!1}}}while(n<0?c.prevSibling():c.nextSibling());return{start:s,matched:!1}}function b(e,t,n,r,i,o,a){var s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=a.indexOf(s);if(l<0||l%2==0!=n>0)return null;for(var c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,d=0;!u.next().done&&d<=o;){var h=u.value;n<0&&(d+=h.length);for(var p=t+d*n,v=n>0?0:h.length-1,m=n>0?h.length:-1;v!=m;v+=n){var g=a.indexOf(h[v]);if(!(g<0||r.resolve(p+v,1).type!=i))if(g%2==0==n>0)f++;else{if(1==f)return{start:c,end:{from:p+v,to:p+v+1},matched:g>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(27),o=!0,a=!1,s=null,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function f(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function h(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(30);function i(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(153),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},,function(e,t,n){"use strict";function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function o(e){return e.startAdornment}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}))},,,function(e,t,n){"use strict";e.exports=n(196)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(83);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(84);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(0),i=n.n(r);t.a=i.a.createContext(null)},,,function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(16),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},u=o.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,u=e.classes,f=e.className,d=e.color,h=void 0===d?"initial":d,p=e.component,v=e.display,m=void 0===v?"initial":v,g=e.gutterBottom,y=void 0!==g&&g,b=e.noWrap,O=void 0!==b&&b,k=e.paragraph,w=void 0!==k&&k,x=e.variant,j=void 0===x?"body1":x,S=e.variantMapping,E=void 0===S?c:S,C=Object(i.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),M=p||(w?"p":E[j]||c[j])||"span";return o.createElement(M,Object(r.a)({className:Object(a.a)(u.root,f,"inherit"!==j&&u[j],"initial"!==h&&u["color".concat(Object(l.a)(h))],O&&u.noWrap,y&&u.gutterBottom,w&&u.paragraph,"inherit"!==s&&u["align".concat(Object(l.a)(s))],"initial"!==m&&u["display".concat(Object(l.a)(m))]),ref:t},C))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(u)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(27)),s=n(8),l=n(24),c=n(31),u=n(10),f=n(66),d=n(57),h=n(282),p="undefined"===typeof window?o.useEffect:o.useLayoutEffect;var v=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,i=e.rippleX,a=e.rippleY,l=e.rippleSize,u=e.in,f=e.onExited,d=void 0===f?function(){}:f,h=e.timeout,v=o.useState(!1),m=v[0],g=v[1],y=Object(s.a)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),b={width:l,height:l,top:-l/2+a,left:-l/2+i},O=Object(s.a)(t.child,m&&t.childLeaving,r&&t.childPulsate),k=Object(c.a)(d);return p((function(){if(!u){g(!0);var e=setTimeout(k,h);return function(){clearTimeout(e)}}}),[k,u,h]),o.createElement("span",{className:y,style:b},o.createElement("span",{className:O}))},m=o.forwardRef((function(e,t){var n=e.center,a=void 0!==n&&n,l=e.classes,c=e.className,u=Object(i.a)(e,["center","classes","className"]),f=o.useState([]),p=f[0],m=f[1],g=o.useRef(0),y=o.useRef(null);o.useEffect((function(){y.current&&(y.current(),y.current=null)}),[p]);var b=o.useRef(!1),O=o.useRef(null),k=o.useRef(null),w=o.useRef(null);o.useEffect((function(){return function(){clearTimeout(O.current)}}),[]);var x=o.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,i=e.rippleSize,a=e.cb;m((function(e){return[].concat(Object(d.a)(e),[o.createElement(v,{key:g.current,classes:l,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:i})])})),g.current+=1,y.current=a}),[l]),j=o.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,o=t.center,s=void 0===o?a||t.pulsate:o,l=t.fakeElement,c=void 0!==l&&l;if("mousedown"===e.type&&b.current)b.current=!1;else{"touchstart"===e.type&&(b.current=!0);var u,f,d,h=c?null:w.current,p=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(p.width/2),f=Math.round(p.height/2);else{var v=e.touches?e.touches[0]:e,m=v.clientX,g=v.clientY;u=Math.round(m-p.left),f=Math.round(g-p.top)}if(s)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var y=2*Math.max(Math.abs((h?h.clientWidth:0)-u),u)+2,j=2*Math.max(Math.abs((h?h.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(y,2)+Math.pow(j,2))}e.touches?null===k.current&&(k.current=function(){x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})},O.current=setTimeout((function(){k.current&&(k.current(),k.current=null)}),80)):x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})}}),[a,x]),S=o.useCallback((function(){j({},{pulsate:!0})}),[j]),E=o.useCallback((function(e,t){if(clearTimeout(O.current),"touchend"===e.type&&k.current)return e.persist(),k.current(),k.current=null,void(O.current=setTimeout((function(){E(e,t)})));k.current=null,m((function(e){return e.length>0?e.slice(1):e})),y.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:S,start:j,stop:E}}),[S,j,E]),o.createElement("span",Object(r.a)({className:Object(s.a)(l.root,c),ref:w},u),o.createElement(h.a,{component:null,exit:!0},p))})),g=Object(u.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(m)),y=o.forwardRef((function(e,t){var n=e.action,u=e.buttonRef,d=e.centerRipple,h=void 0!==d&&d,p=e.children,v=e.classes,m=e.className,y=e.component,b=void 0===y?"button":y,O=e.disabled,k=void 0!==O&&O,w=e.disableRipple,x=void 0!==w&&w,j=e.disableTouchRipple,S=void 0!==j&&j,E=e.focusRipple,C=void 0!==E&&E,M=e.focusVisibleClassName,P=e.onBlur,T=e.onClick,A=e.onFocus,D=e.onFocusVisible,R=e.onKeyDown,N=e.onKeyUp,_=e.onMouseDown,L=e.onMouseLeave,I=e.onMouseUp,$=e.onTouchEnd,z=e.onTouchMove,B=e.onTouchStart,F=e.onDragLeave,W=e.tabIndex,V=void 0===W?0:W,H=e.TouchRippleProps,Q=e.type,q=void 0===Q?"button":Q,U=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),X=o.useRef(null);var Y=o.useRef(null),G=o.useState(!1),K=G[0],J=G[1];k&&K&&J(!1);var Z=Object(f.a)(),ee=Z.isFocusVisible,te=Z.onBlurVisible,ne=Z.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(c.a)((function(r){return t&&t(r),!n&&Y.current&&Y.current[e](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){J(!0),X.current.focus()}}}),[]),o.useEffect((function(){K&&C&&!x&&Y.current.pulsate()}),[x,C,K]);var ie=re("start",_),oe=re("stop",F),ae=re("stop",I),se=re("stop",(function(e){K&&e.preventDefault(),L&&L(e)})),le=re("start",B),ce=re("stop",$),ue=re("stop",z),fe=re("stop",(function(e){K&&(te(e),J(!1)),P&&P(e)}),!1),de=Object(c.a)((function(e){X.current||(X.current=e.currentTarget),ee(e)&&(J(!0),D&&D(e)),A&&A(e)})),he=function(){var e=a.findDOMNode(X.current);return b&&"button"!==b&&!("A"===e.tagName&&e.href)},pe=o.useRef(!1),ve=Object(c.a)((function(e){C&&!pe.current&&K&&Y.current&&" "===e.key&&(pe.current=!0,e.persist(),Y.current.stop(e,(function(){Y.current.start(e)}))),e.target===e.currentTarget&&he()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&he()&&"Enter"===e.key&&!k&&(e.preventDefault(),T&&T(e))})),me=Object(c.a)((function(e){C&&" "===e.key&&Y.current&&K&&!e.defaultPrevented&&(pe.current=!1,e.persist(),Y.current.stop(e,(function(){Y.current.pulsate(e)}))),N&&N(e),T&&e.target===e.currentTarget&&he()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ge=b;"button"===ge&&U.href&&(ge="a");var ye={};"button"===ge?(ye.type=q,ye.disabled=k):("a"===ge&&U.href||(ye.role="button"),ye["aria-disabled"]=k);var be=Object(l.a)(u,t),Oe=Object(l.a)(ne,X),ke=Object(l.a)(be,Oe),we=o.useState(!1),xe=we[0],je=we[1];o.useEffect((function(){je(!0)}),[]);var Se=xe&&!x&&!k;return o.createElement(ge,Object(r.a)({className:Object(s.a)(v.root,m,K&&[v.focusVisible,M],k&&v.disabled),onBlur:fe,onClick:T,onFocus:de,onKeyDown:ve,onKeyUp:me,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ce,onTouchMove:ue,onTouchStart:le,ref:ke,tabIndex:k?-1:V},ye,U),p,Se?o.createElement(g,Object(r.a)({ref:Y,center:h},H)):null)}));t.a=Object(u.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(y)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e){var t=r.useState(e),n=t[0],i=t[1],o=e||n;return r.useEffect((function(){null==n&&i("mui-".concat(Math.round(1e5*Math.random())))}),[n]),o}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n(57),n(1);var r=n(71),i=(n(11),n(64),{xs:0,sm:600,md:960,lg:1280,xl:1920}),o={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function a(e,t,n){if(Array.isArray(t)){var i=e.theme.breakpoints||o;return t.reduce((function(e,r,o){return e[i.up(i.keys[o])]=n(t[o]),e}),{})}if("object"===Object(r.a)(t)){var a=e.theme.breakpoints||o;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";var r=n(183),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=u(n);f&&(a=a.concat(f(n)));for(var s=l(t),v=l(n),m=0;m<a.length;++m){var g=a[m];if(!o[g]&&(!r||!r[g])&&(!v||!v[g])&&(!s||!s[g])){var y=d(n,g);try{c(t,g,y)}catch(b){}}}}return t}},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for;t.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,n){"use strict";var r=n(1),i=n(29),o=n(7),a=n(0),s=(n(11),n(8)),l=n(55),c=n(43),u=n(10),f=n(159),d=a.forwardRef((function(e,t){var n=e.autoFocus,u=e.checked,d=e.checkedIcon,h=e.classes,p=e.className,v=e.defaultChecked,m=e.disabled,g=e.icon,y=e.id,b=e.inputProps,O=e.inputRef,k=e.name,w=e.onBlur,x=e.onChange,j=e.onFocus,S=e.readOnly,E=e.required,C=e.tabIndex,M=e.type,P=e.value,T=Object(o.a)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),A=Object(l.a)({controlled:u,default:Boolean(v),name:"SwitchBase",state:"checked"}),D=Object(i.a)(A,2),R=D[0],N=D[1],_=Object(c.a)(),L=m;_&&"undefined"===typeof L&&(L=_.disabled);var I="checkbox"===M||"radio"===M;return a.createElement(f.a,Object(r.a)({component:"span",className:Object(s.a)(h.root,p,R&&h.checked,L&&h.disabled),disabled:L,tabIndex:null,role:void 0,onFocus:function(e){j&&j(e),_&&_.onFocus&&_.onFocus(e)},onBlur:function(e){w&&w(e),_&&_.onBlur&&_.onBlur(e)},ref:t},T),a.createElement("input",Object(r.a)({autoFocus:n,checked:u,defaultChecked:v,className:h.input,disabled:L,id:I&&y,name:k,onChange:function(e){var t=e.target.checked;N(t),x&&x(e,t)},readOnly:S,ref:O,required:E,tabIndex:C,type:M,value:P},b)),R?d:g)}));t.a=Object(u.a)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(d)},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return j})),n.d(t,"b",(function(){return b}));var r,i,o=n(25),a=n(14),s=n(3),l=n(5),c=n(6),u=n(9),f=n(4),d="undefined"!=typeof navigator&&!/Edge\/(\d+)/.exec(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),h="-10000px",p=function(){function e(t,n,r){Object(l.a)(this,e),this.facet=n,this.createTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter((function(e){return e})),this.tooltipViews=this.tooltips.map(r)}return Object(c.a)(e,[{key:"update",value:function(e){var t=e.state.facet(this.facet),n=t.filter((function(e){return e}));if(t===this.input){var r,i=Object(s.a)(this.tooltipViews);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.update&&o.update(e)}}catch(g){i.e(g)}finally{i.f()}return{shouldMeasure:!1}}for(var a=[],l=0;l<n.length;l++){var c=n[l],u=-1;if(c){for(var f=0;f<this.tooltips.length;f++){var d=this.tooltips[f];d&&d.create==c.create&&(u=f)}if(u<0)a[l]=this.createTooltipView(c);else{var h=a[l]=this.tooltipViews[u];h.update&&h.update(e)}}}var p,v=Object(s.a)(this.tooltipViews);try{for(v.s();!(p=v.n()).done;){var m=p.value;a.indexOf(m)<0&&m.dom.remove()}}catch(g){v.e(g)}finally{v.f()}return this.input=t,this.tooltips=n,this.tooltipViews=a,{shouldMeasure:!0}}}]),e}();var v=f.g.define({combine:function(e){var t,n;return{position:d?"absolute":(null===(t=e.find((function(e){return e.position})))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((function(e){return e.parent})))||void 0===n?void 0:n.parent)||null}}}),m=u.f.fromClass(function(){function e(t){var n=this;Object(l.a)(this,e),this.view=t,this.inView=!0;var r=t.state.facet(v);this.position=r.position,this.parent=r.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new p(t,b,(function(e){return n.createTooltip(e)})),this.maybeMeasure()}return Object(c.a)(e,[{key:"createContainer",value:function(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}},{key:"update",value:function(e){var t=this.manager.update(e).shouldMeasure,n=e.state.facet(v);if(n.position!=this.position){this.position=n.position;var r,i=Object(s.a)(this.manager.tooltipViews);try{for(i.s();!(r=i.n()).done;){r.value.dom.style.position=this.position}}catch(c){i.e(c)}finally{i.f()}t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();var o,a=Object(s.a)(this.manager.tooltipViews);try{for(a.s();!(o=a.n()).done;){var l=o.value;this.container.appendChild(l.dom)}}catch(c){a.e(c)}finally{a.f()}t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}},{key:"createTooltip",value:function(e){var t=e.create(this.view);return t.dom.classList.add("cm-tooltip"),e.arrow&&t.dom.classList.add("cm-tooltip-arrow"),t.dom.style.position=this.position,t.dom.style.top=h,this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}},{key:"destroy",value:function(){var e,t=Object(s.a)(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){e.value.dom.remove()}}catch(n){t.e(n)}finally{t.f()}}},{key:"readMeasure",value:function(){var e=this,t=this.view.dom.getBoundingClientRect();return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((function(t){return e.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((function(e){return e.dom.getBoundingClientRect()})),innerWidth:window.innerWidth,innerHeight:window.innerHeight}}},{key:"writeMeasure",value:function(e){for(var t=e.editor,n=[],r=0;r<this.manager.tooltips.length;r++){var i=this.manager.tooltips[r],o=this.manager.tooltipViews[r],a=o.dom,l=e.pos[r],c=e.size[r];if(!l||l.bottom<=t.top||l.top>=t.bottom||l.right<=t.left||l.left>=t.right)a.style.top=h;else{var f=!!i.arrow,d=!!i.above,p=c.right-c.left,v=c.bottom-c.top+(f?7:0),m=this.view.textDirection==u.c.LTR?Math.min(l.left-(f?14:0),e.innerWidth-p):Math.max(0,l.left-p+(f?14:0));!i.strictSide&&(d?l.top-(c.bottom-c.top)<0:l.bottom+(c.bottom-c.top)>e.innerHeight)&&(d=!d);var g,y=d?l.top-v:l.bottom+(f?7:0),b=m+p,O=Object(s.a)(n);try{for(O.s();!(g=O.n()).done;){var k=g.value;k.left<b&&k.right>m&&k.top<y+v&&k.bottom>y&&(y=d?k.top-v:k.bottom)}}catch(w){O.e(w)}finally{O.f()}"absolute"==this.position?(a.style.top=y-e.parent.top+"px",a.style.left=m-e.parent.left+"px"):(a.style.top=y+"px",a.style.left=m+"px"),n.push({left:m,top:y,right:b,bottom:y+v}),a.classList.toggle("cm-tooltip-above",d),a.classList.toggle("cm-tooltip-below",!d),o.positioned&&o.positioned()}}}},{key:"maybeMeasure",value:function(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var e,t=Object(s.a)(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){e.value.dom.style.top=h}}catch(n){t.e(n)}finally{t.f()}}}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),g="undefined"==typeof document||null!=(null===(i=document.body)||void 0===i?void 0:i.style.insetInlineStart)?"insetInlineStart":"left",y=u.d.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip.cm-tooltip-arrow:before, .cm-tooltip.cm-tooltip-arrow:after":(r={position:"absolute",content:"''"},Object(a.a)(r,g,"".concat(7,"px")),Object(a.a)(r,"width",0),Object(a.a)(r,"height",0),Object(a.a)(r,"borderLeft","".concat(7,"px solid transparent")),Object(a.a)(r,"borderRight","".concat(7,"px solid transparent")),Object(a.a)(r,"zIndex",-1),r),".cm-tooltip-above.cm-tooltip-arrow:before":{borderTop:"".concat(7,"px solid #f5f5f5"),bottom:"-".concat(6,"px")},".cm-tooltip-below.cm-tooltip-arrow:before":{borderBottom:"".concat(7,"px solid #f5f5f5"),top:"-".concat(6,"px")},".cm-tooltip-above.cm-tooltip-arrow:after":{borderTop:"".concat(7,"px solid #bbb"),bottom:"-".concat(7,"px"),zIndex:-2},".cm-tooltip-below.cm-tooltip-arrow:after":{borderBottom:"".concat(7,"px solid #bbb"),top:"-".concat(7,"px"),zIndex:-2},"&dark .cm-tooltip.cm-tooltip-arrow:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&dark .cm-tooltip.cm-tooltip-arrow:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}),b=f.g.define({enables:[m,y]}),O=f.g.define(),k=function(){function e(t){var n=this;Object(l.a)(this,e),this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new p(t,O,(function(e){return n.createHostedView(e)}))}return Object(c.a)(e,[{key:"createHostedView",value:function(e){var t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}},{key:"mount",value:function(e){var t,n=Object(s.a)(this.manager.tooltipViews);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.mount&&r.mount(e)}}catch(i){n.e(i)}finally{n.f()}this.mounted=!0}},{key:"positioned",value:function(){var e,t=Object(s.a)(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.positioned&&n.positioned()}}catch(r){t.e(r)}finally{t.f()}}},{key:"update",value:function(e){this.manager.update(e)}}],[{key:"create",value:function(t){return new e(t)}}]),e}(),w=b.compute([O],(function(e){var t=e.facet(O).filter((function(e){return e}));return 0===t.length?null:{pos:Math.min.apply(Math,Object(o.a)(t.map((function(e){return e.pos})))),end:Math.max.apply(Math,Object(o.a)(t.filter((function(e){return null!=e.end})).map((function(e){return e.end})))),create:k.create,above:t[0].above,arrow:t.some((function(e){return e.arrow}))}})),x=function(){function e(t,n,r,i,o){Object(l.a)(this,e),this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.lastMouseMove=null,this.lastMoveTime=0,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return Object(c.a)(e,[{key:"update",value:function(){var e=this;this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((function(){return e.startHover()}),20))}},{key:"active",get:function(){return this.view.state.field(this.field)}},{key:"checkHover",value:function(){if(this.hoverTimeout=-1,!this.active){var e=Date.now()-this.lastMoveTime;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}}},{key:"startHover",value:function(){var e,t=this;clearTimeout(this.restartTimeout);var n=this.lastMouseMove,r={x:n.clientX,y:n.clientY},i=this.view.contentDOM.contains(n.target)?this.view.posAtCoords(r):null;if(null!=i){var o=this.view.coordsAtPos(i);if(!(null==o||r.y<o.top||r.y>o.bottom||r.x<o.left-this.view.defaultCharacterWidth||r.x>o.right+this.view.defaultCharacterWidth)){var a=this.view.bidiSpans(this.view.state.doc.lineAt(i)).find((function(e){return e.from<=i&&e.to>=i})),s=a&&a.dir==u.c.RTL?-1:1,l=this.source(this.view,i,r.x<o.left?-s:s);if(null===(e=l)||void 0===e?void 0:e.then){var c=this.pending={pos:i};l.then((function(e){t.pending==c&&(t.pending=null,e&&t.view.dispatch({effects:t.setHover.of(e)}))}),(function(e){return Object(u.l)(t.view.state,e,"hover tooltip")}))}else l&&this.view.dispatch({effects:this.setHover.of(l)})}}}},{key:"mousemove",value:function(e){var t;this.lastMouseMove=e,this.lastMoveTime=Date.now(),this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));var n=this.active;if(n&&!function(e){for(var t=e;t;t=t.parentNode)if(1==t.nodeType&&t.classList.contains("cm-tooltip"))return!0;return!1}(e.target)||this.pending){var r=(n||this.pending).pos,i=null!==(t=null===n||void 0===n?void 0:n.end)&&void 0!==t?t:r;(r==i?this.view.posAtCoords({x:e.clientX,y:e.clientY})==r:function(e,t,n,r,i,o){var a=document.createRange(),s=e.domAtPos(t),l=e.domAtPos(n);a.setEnd(l.node,l.offset),a.setStart(s.node,s.offset);var c=a.getClientRects();a.detach();for(var u=0;u<c.length;u++){var f=c[u];if(Math.max(f.top-i,i-f.bottom,f.left-r,r-f.right)<=o)return!0}return!1}(this.view,r,i,e.clientX,e.clientY,6))||(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}},{key:"mouseleave",value:function(){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}},{key:"destroy",value:function(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}]),e}();function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=f.j.define(),r=f.k.define({create:function(){return null},update:function(e,r){if(e&&t.hideOnChange&&(r.docChanged||r.selection))return null;var i,o=Object(s.a)(r.effects);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(a.is(n))return a.value}}catch(u){o.e(u)}finally{o.f()}if(e&&r.docChanged){var l=r.changes.mapPos(e.pos,-1,f.h.TrackDel);if(null==l)return null;var c=Object.assign(Object.create(null),e);return c.pos=l,null!=e.end&&(c.end=r.changes.mapPos(e.end)),c}return e},provide:function(e){return O.from(e)}}),i=t.hoverTime||750;return[r,u.f.define((function(t){return new x(t,e,r,n,i)})),w]}},function(e,t,n){e.exports=n(206)},function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return M}));var r=n(18),i=n(17),o=n(25),a=n(3),s=n(6),l=n(5),c=n(9),u=n(4),f=n(100),d=n(61),h=n(28),p=function e(t,n,r){Object(l.a)(this,e),this.from=t,this.to=n,this.diagnostic=r},v=function(){function e(t,n,r){Object(l.a)(this,e),this.diagnostics=t,this.panel=n,this.selected=r}return Object(s.a)(e,null,[{key:"init",value:function(t,n,r){var i=c.b.set(t.map((function(e){return e.from==e.to||e.from==e.to-1&&r.doc.lineAt(e.from).to==e.from?c.b.widget({widget:new A(e),diagnostic:e}).range(e.from):c.b.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity},diagnostic:e}).range(e.from,e.to)})),!0);return new e(i,n,m(i))}}]),e}();function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=null;return e.between(n,1e9,(function(e,n,i){var o=i.spec;if(!t||o.diagnostic==t)return r=new p(e,n,o.diagnostic),!1})),r}function g(e,t,n){return e.field(k,!1)?t:t.concat(u.j.appendConfig.of([k.init(n),c.d.decorations.compute([k],(function(e){var t=e.field(k),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?c.b.set([w.range(n.from,n.to)]):c.b.none})),Object(f.a)(x),_]))}var y=u.j.define(),b=u.j.define(),O=u.j.define(),k=u.k.define({create:function(){return new v(c.b.none,null,null)},update:function(e,t){if(t.docChanged){var n=e.diagnostics.map(t.changes),r=null;if(e.selected){var i=t.changes.mapPos(e.selected.from,1);r=m(n,e.selected.diagnostic,i)||m(n,null,i)}e=new v(n,e.panel,r)}var o,s=Object(a.a)(t.effects);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.is(y)?e=v.init(l.value,e.panel,t.state):l.is(b)?e=new v(e.diagnostics,l.value?R.open:null,e.selected):l.is(O)&&(e=new v(e.diagnostics,e.panel,l.value))}}catch(c){s.e(c)}finally{s.f()}return e},provide:function(e){return[d.b.from(e,(function(e){return e.panel})),c.d.decorations.from(e,(function(e){return e.diagnostics}))]}});var w=c.b.mark({class:"cm-lintRange cm-lintRange-active"});function x(e,t,n){var r=e.state.field(k).diagnostics,i=[],o=2e8,a=0;return r.between(t-(n<0?1:0),t+(n>0?1:0),(function(e,r,s){var l=s.spec;t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0))&&(i.push(l.diagnostic),o=Math.min(e,o),a=Math.max(r,a))})),i.length?{pos:o,end:a,above:e.state.doc.lineAt(o).to<a,create:function(){return{dom:Object(h.a)("ul",{class:"cm-tooltip-lint"},i.map((function(t){return T(e,t,!1)})))}}}:null}var j=function(e){var t=e.state.field(k,!1);return!(!t||!t.panel)&&(e.dispatch({effects:b.of(!1)}),!0)},S=[{key:"Mod-Shift-m",run:function(e){var t=e.state.field(k,!1);t&&t.panel||e.dispatch({effects:g(e.state,[b.of(!0)],(function(){return v.init([],R.open,e.state)}))});var n=Object(d.a)(e,R.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0}},{key:"F8",run:function(e){var t=e.state.field(k,!1);if(!t)return!1;var n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!(!r.value&&(!(r=t.diagnostics.iter(0)).value||r.from==n.from&&r.to==n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],E=c.f.fromClass(function(){function e(t){Object(l.a)(this,e),this.view=t,this.timeout=-1,this.set=!0;var n=t.state.facet(C).delay;this.lintTime=Date.now()+n,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,n)}return Object(s.a)(e,[{key:"run",value:function(){var e=this,t=Date.now();if(t<this.lintTime-10)setTimeout(this.run,this.lintTime-t);else{this.set=!1;var n=this.view.state,r=n.facet(C).sources;Promise.all(r.map((function(t){return Promise.resolve(t(e.view))}))).then((function(t){var r,i,o=t.reduce((function(e,t){return e.concat(t)}));e.view.state.doc==n.doc&&(o.length||(null===(i=null===(r=e.view.state.field(k,!1))||void 0===r?void 0:r.diagnostics)||void 0===i?void 0:i.size))&&e.view.dispatch(function(e,t){return{effects:g(e,[y.of(t)],(function(){return v.init(t,null,e)}))}}(e.view.state,o))}),(function(t){Object(c.l)(e.view.state,t)}))}}},{key:"update",value:function(e){var t=e.state.facet(C);(e.docChanged||t!=e.startState.facet(C))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}},{key:"force",value:function(){this.set&&(this.lintTime=Date.now(),this.run())}},{key:"destroy",value:function(){clearTimeout(this.timeout)}}]),e}()),C=u.g.define({combine:function(e){return{sources:e.map((function(e){return e.source})),delay:e.length?Math.max.apply(Math,Object(o.a)(e.map((function(e){return e.delay})))):750}},enables:E});function M(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C.of({source:e,delay:null!==(t=n.delay)&&void 0!==t?t:750})}function P(e){var t=[];if(e){var n,r=Object(a.a)(e);try{e:for(r.s();!(n=r.n()).done;){for(var i=n.value.name,o=function(e){var n=i[e];if(/[a-zA-Z]/.test(n)&&!t.some((function(e){return e.toLowerCase()==n.toLowerCase()})))return t.push(n),"continue|actions"},s=0;s<i.length;s++){if("continue|actions"===o(s))continue e}t.push("")}}catch(l){r.e(l)}finally{r.f()}}return t}function T(e,t,n){var r,i=n?P(t.actions):[];return Object(h.a)("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Object(h.a)("span",{class:"cm-diagnosticText"},t.message),null===(r=t.actions)||void 0===r?void 0:r.map((function(n,r){var o=function(r){r.preventDefault();var i=m(e.state.field(k).diagnostics,t);i&&n.apply(e,i.from,i.to)},a=n.name,s=i[r]?a.indexOf(i[r]):-1,l=s<0?a:[a.slice(0,s),Object(h.a)("u",a.slice(s,s+1)),a.slice(s+1)];return Object(h.a)("button",{type:"button",class:"cm-diagnosticAction",onclick:o,onmousedown:o,"aria-label":" Action: ".concat(a).concat(s<0?"":' (access key "'.concat(i[r],')"'),".")},l)})),t.source&&Object(h.a)("div",{class:"cm-diagnosticSource"},t.source))}var A=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e){var r;return Object(l.a)(this,n),(r=t.call(this)).diagnostic=e,r}return Object(s.a)(n,[{key:"eq",value:function(e){return e.diagnostic==this.diagnostic}},{key:"toDOM",value:function(){return Object(h.a)("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}]),n}(c.g),D=function e(t,n){Object(l.a)(this,e),this.diagnostic=n,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=T(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")},R=function(){function e(t){var n=this;Object(l.a)(this,e),this.view=t,this.items=[];this.list=Object(h.a)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:function(e){if(27==e.keyCode)j(n.view),n.view.focus();else if(38==e.keyCode||33==e.keyCode)n.moveSelection((n.selectedIndex-1+n.items.length)%n.items.length);else if(40==e.keyCode||34==e.keyCode)n.moveSelection((n.selectedIndex+1)%n.items.length);else if(36==e.keyCode)n.moveSelection(0);else if(35==e.keyCode)n.moveSelection(n.items.length-1);else if(13==e.keyCode)n.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&n.selectedIndex>=0))return;for(var r=n.items[n.selectedIndex].diagnostic,i=P(r.actions),o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==e.keyCode){var a=m(n.view.state.field(k).diagnostics,r);a&&r.actions[o].apply(t,a.from,a.to)}}e.preventDefault()},onclick:function(e){for(var t=0;t<n.items.length;t++)n.items[t].dom.contains(e.target)&&n.moveSelection(t)}}),this.dom=Object(h.a)("div",{class:"cm-panel-lint"},this.list,Object(h.a)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:function(){return j(n.view)}},"\xd7")),this.update()}return Object(s.a)(e,[{key:"selectedIndex",get:function(){var e=this.view.state.field(k).selected;if(!e)return-1;for(var t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}},{key:"update",value:function(){var e=this,t=this.view.state.field(k),n=t.diagnostics,r=t.selected,i=0,o=!1,a=null;for(n.between(0,this.view.state.doc.length,(function(t,n,s){for(var l,c=s.spec,u=-1,f=i;f<e.items.length;f++)if(e.items[f].diagnostic==c.diagnostic){u=f;break}u<0?(l=new D(e.view,c.diagnostic),e.items.splice(i,0,l),o=!0):(l=e.items[u],u>i&&(e.items.splice(i,u-i),o=!0)),r&&l.diagnostic==r.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),a=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),i++}));i<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();0==this.items.length&&(this.items.push(new D(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:function(){return{sel:a.dom.getBoundingClientRect(),panel:e.list.getBoundingClientRect()}},write:function(t){var n=t.sel,r=t.panel;n.top<r.top?e.list.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.list.scrollTop+=n.bottom-r.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}},{key:"sync",value:function(){var e=this.list.firstChild;function t(){var t=e;e=t.nextSibling,t.remove()}var n,r=Object(a.a)(this.items);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e)}}catch(o){r.e(o)}finally{r.f()}for(;e;)t()}},{key:"moveSelection",value:function(e){if(!(this.selectedIndex<0)){var t=m(this.view.state.field(k).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:O.of(t)})}}}],[{key:"open",value:function(t){return new e(t)}}]),e}();function N(e){if("function"!=typeof btoa)return"none";var t='<svg xmlns="http://www.w3.org/2000/svg" width="6" height="3">\n <path d="m0 3 l2 -2 l1 0 l2 2 l1 0" stroke="'.concat(e,'" fill="none" stroke-width=".7"/>\n </svg>');return"url('data:image/svg+xml;base64,".concat(btoa(t),"')")}var _=c.d.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x"},".cm-lintRange-error":{backgroundImage:N("#d11")},".cm-lintRange-warning":{backgroundImage:N("orange")},".cm-lintRange-info":{backgroundImage:N("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return ce}));var r=n(3),i=n(4),o=n(15),a=n(9),s=n(65),l=n(21),c=n(23);function u(e,t){return i.e.create(e.ranges.map(t),e.mainIndex)}function f(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function d(e,t){var n=e.state,r=e.dispatch,i=u(n.selection,t);return!i.eq(n.selection)&&(r(f(n,i)),!0)}function h(e,t){return i.e.cursor(t?e.to:e.from)}function p(e,t){return d(e,(function(n){return n.empty?e.moveByChar(n,t):h(n,t)}))}var v=function(e){return p(e,e.textDirection!=a.c.LTR)},m=function(e){return p(e,e.textDirection==a.c.LTR)};function g(e,t){return d(e,(function(n){return n.empty?e.moveByGroup(n,t):h(n,t)}))}function y(e,t,n){if(t.type.prop(n))return!0;var r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function b(e,t,n){for(var r=Object(l.j)(e).resolveInner(t.head),o=n?c.b.closedBy:c.b.openedBy,a=t.head;;){var u=n?r.childAfter(a):r.childBefore(a);if(!u)break;y(e,u,o)?r=u:a=n?u.to:u.from}var f,d;return d=r.type.prop(o)&&(f=n?Object(s.b)(e,r.from,1):Object(s.b)(e,r.to,-1))&&f.matched?n?f.end.to:f.end.from:n?r.to:r.from,i.e.cursor(d,n?-1:1)}function O(e,t){return d(e,(function(n){if(!n.empty)return h(n,t);var r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)}))}var k=function(e){return O(e,!1)},w=function(e){return O(e,!0)};function x(e,t){return d(e,(function(n){return n.empty?e.moveVertically(n,t,e.dom.clientHeight):h(n,t)}))}var j=function(e){return x(e,!1)},S=function(e){return x(e,!0)};function E(e,t,n){var r=e.visualLineAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){var a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(o=i.e.cursor(r.from+a))}return o}var C=function(e){return d(e,(function(t){return E(e,t,!0)}))},M=function(e){return d(e,(function(t){return E(e,t,!1)}))};function P(e,t,n){var r=!1,o=u(e.selection,(function(t){var o=Object(s.b)(e,t.head,-1)||Object(s.b)(e,t.head,1)||t.head>0&&Object(s.b)(e,t.head-1,1)||t.head<e.doc.length&&Object(s.b)(e,t.head+1,-1);if(!o||!o.end)return t;r=!0;var a=o.start.from==t.head?o.end.to:o.end.from;return n?i.e.range(t.anchor,a):i.e.cursor(a)}));return!!r&&(t(f(e,o)),!0)}function T(e,t){var n=u(e.state.selection,(function(e){var n=t(e);return i.e.range(e.anchor,n.head,n.goalColumn)}));return!n.eq(e.state.selection)&&(e.dispatch(f(e.state,n)),!0)}function A(e,t){return T(e,(function(n){return e.moveByChar(n,t)}))}var D=function(e){return A(e,e.textDirection!=a.c.LTR)},R=function(e){return A(e,e.textDirection==a.c.LTR)};function N(e,t){return T(e,(function(n){return e.moveByGroup(n,t)}))}function _(e,t){return T(e,(function(n){return e.moveVertically(n,t)}))}var L=function(e){return _(e,!1)},I=function(e){return _(e,!0)};function $(e,t){return T(e,(function(n){return e.moveVertically(n,t,e.dom.clientHeight)}))}var z=function(e){return $(e,!1)},B=function(e){return $(e,!0)},F=function(e){return T(e,(function(t){return E(e,t,!0)}))},W=function(e){return T(e,(function(t){return E(e,t,!1)}))},V=function(e){var t=e.state;return(0,e.dispatch)(f(t,{anchor:0})),!0},H=function(e){var t=e.state;return(0,e.dispatch)(f(t,{anchor:t.doc.length})),!0},Q=function(e){var t=e.state;return(0,e.dispatch)(f(t,{anchor:t.selection.main.anchor,head:0})),!0},q=function(e){var t=e.state;return(0,e.dispatch)(f(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0};function U(e,t){var n=e.state,r=e.dispatch;if(n.readOnly)return!1;var o="delete.selection",a=n.changeByRange((function(e){var n=e.from,r=e.to;if(n==r){var a=t(n);a<n?o="delete.backward":a>n&&(o="delete.forward"),n=Math.min(n,a),r=Math.max(r,a)}return n==r?{range:e}:{changes:{from:n,to:r},range:i.e.cursor(n)}}));return!a.changes.empty&&(r(n.update(a,{scrollIntoView:!0,userEvent:o})),!0)}function X(e,t,n){if(e instanceof a.d){var i,o=Object(r.a)(e.pluginField(a.e.atomicRanges));try{for(o.s();!(i=o.n()).done;){i.value.between(t,t,(function(e,r){e<t&&r>t&&(t=n?r:e)}))}}catch(s){o.e(s)}finally{o.f()}}return t}var Y=function(e,t){return U(e,(function(n){var r,i,a=e.state,s=a.doc.lineAt(n);if(!t&&n>s.from&&n<s.from+200&&!/[^ \t]/.test(r=s.text.slice(0,n-s.from))){if("\t"==r[r.length-1])return n-1;for(var c=Object(o.d)(r,a.tabSize)%Object(l.d)(a)||Object(l.d)(a),u=0;u<c&&" "==r[r.length-1-u];u++)n--;i=n}else(i=Object(o.e)(s.text,n-s.from,t)+s.from)==n&&s.number!=(t?a.doc.lines:1)&&(i+=t?1:-1);return X(e,i,t)}))},G=function(e){return Y(e,!1)},K=function(e){return Y(e,!0)},J=function(e,t){return U(e,(function(n){for(var r=n,i=e.state,a=i.doc.lineAt(r),s=i.charCategorizer(r),l=null;;){if(r==(t?a.to:a.from)){r==n&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}var c=Object(o.e)(a.text,r-a.from,t)+a.from,u=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),f=s(u);if(null!=l&&f!=l)break;" "==u&&r==n||(l=f),r=c}return X(e,r,t)}))},Z=function(e){return J(e,!1)},ee=function(e){return U(e,(function(t){var n=e.visualLineAt(t).to;return X(e,t<n?n:Math.min(e.state.doc.length,t+1),!0)}))};function te(e){var t,n=[],i=-1,o=Object(r.a)(e.selection.ranges);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=e.doc.lineAt(a.from),l=e.doc.lineAt(a.to);if(a.empty||a.to!=l.from||(l=e.doc.lineAt(a.to-1)),i>=s.number){var c=n[n.length-1];c.to=l.to,c.ranges.push(a)}else n.push({from:s.from,to:l.to,ranges:[a]});i=l.number+1}}catch(u){o.e(u)}finally{o.f()}return n}function ne(e,t,n){if(e.readOnly)return!1;var o,a=[],s=[],l=Object(r.a)(te(e));try{for(l.s();!(o=l.n()).done;){var c=o.value;if(n?c.to!=e.doc.length:0!=c.from){var u=e.doc.lineAt(n?c.to+1:c.from-1),f=u.length+1;if(n){a.push({from:c.to,to:u.to},{from:c.from,insert:u.text+e.lineBreak});var d,h=Object(r.a)(c.ranges);try{for(h.s();!(d=h.n()).done;){var p=d.value;s.push(i.e.range(Math.min(e.doc.length,p.anchor+f),Math.min(e.doc.length,p.head+f)))}}catch(y){h.e(y)}finally{h.f()}}else{a.push({from:u.from,to:c.from},{from:c.to,insert:e.lineBreak+u.text});var v,m=Object(r.a)(c.ranges);try{for(m.s();!(v=m.n()).done;){var g=v.value;s.push(i.e.range(g.anchor-f,g.head-f))}}catch(y){m.e(y)}finally{m.f()}}}}}catch(y){l.e(y)}finally{l.f()}return!!a.length&&(t(e.update({changes:a,scrollIntoView:!0,selection:i.e.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0)}function re(e,t,n){if(e.readOnly)return!1;var i,o=[],a=Object(r.a)(te(e));try{for(a.s();!(i=a.n()).done;){var s=i.value;n?o.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):o.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)})}}catch(l){a.e(l)}finally{a.f()}return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var ie=oe(!1);function oe(e){return function(t){var n=t.state,r=t.dispatch;if(n.readOnly)return!1;var a=n.changeByRange((function(t){var r=t.from,a=t.to,s=n.doc.lineAt(r),u=!e&&r==a&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=Object(l.j)(e).resolveInner(t),i=r.childBefore(t),o=r.childAfter(t);return i&&o&&i.to<=t&&o.from>=t&&(n=i.type.prop(c.b.closedBy))&&n.indexOf(o.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(o.from).from?{from:i.to,to:o.from}:null}(n,r);e&&(r=a=(a<=s.to?s:n.doc.lineAt(a)).to);var f=new l.a(n,{simulateBreak:r,simulateDoubleBreak:!!u}),d=Object(l.e)(f,r);for(null==d&&(d=/^\s*/.exec(n.doc.lineAt(r).text)[0].length);a<s.to&&/\s/.test(s.text[a-s.from]);)a++;u?(r=u.from,a=u.to):r>s.from&&r<s.from+100&&!/\S/.test(s.text.slice(0,r))&&(r=s.from);var h=["",Object(l.g)(n,d)];return u&&h.push(Object(l.g)(n,f.lineIndent(s.from,-1))),{changes:{from:r,to:a,insert:o.a.of(h)},range:i.e.cursor(r+1+h[1].length)}}));return r(n.update(a,{scrollIntoView:!0,userEvent:"input"})),!0}}function ae(e,t){var n=-1;return e.changeByRange((function(r){for(var o=[],a=r.from;a<=r.to;){var s=e.doc.lineAt(a);s.number>n&&(r.empty||r.to>s.from)&&(t(s,o,r),n=s.number),a=s.to+1}var l=e.changes(o);return{changes:o,range:i.e.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}}))}var se=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(ae(t,(function(e,n){n.push({from:e.from,insert:t.facet(l.h)})})),{userEvent:"input.indent"})),!0)},le=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(ae(t,(function(e,n){var r=/^\s*/.exec(e.text)[0];if(r){for(var i=Object(o.d)(r,t.tabSize),a=0,s=Object(l.g)(t,Math.max(0,i-Object(l.d)(t)));a<r.length&&a<s.length&&r.charCodeAt(a)==s.charCodeAt(a);)a++;n.push({from:e.from+a,to:e.from+r.length,insert:s.slice(a)})}})),{userEvent:"delete.dedent"})),!0)},ce=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(e){return d(e,(function(t){return b(e.state,t,e.textDirection!=a.c.LTR)}))},shift:function(e){return T(e,(function(t){return b(e.state,t,e.textDirection!=a.c.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(e){return d(e,(function(t){return b(e.state,t,e.textDirection==a.c.LTR)}))},shift:function(e){return T(e,(function(t){return b(e.state,t,e.textDirection==a.c.LTR)}))}},{key:"Alt-ArrowUp",run:function(e){return ne(e.state,e.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(e){return re(e.state,e.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(e){return ne(e.state,e.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(e){return re(e.state,e.dispatch,!0)}},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch,r=t.selection,o=null;return r.ranges.length>1?o=i.e.create([r.main]):r.main.empty||(o=i.e.create([i.e.cursor(r.main.head)])),!!o&&(n(f(t,o)),!0)}},{key:"Mod-Enter",run:oe(!0)},{key:"Alt-l",mac:"Ctrl-l",run:function(e){var t=e.state,n=e.dispatch,r=te(t).map((function(e){var n=e.from,r=e.to;return i.e.range(n,Math.min(r+1,t.doc.length))}));return n(t.update({selection:i.e.create(r),userEvent:"select"})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,r=u(t.selection,(function(e){for(var n,r=Object(l.j)(t).resolveInner(e.head,1);!(r.from<e.from&&r.to>=e.to||r.to>e.to&&r.from<=e.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent);)r=r.parent;return i.e.range(r.to,r.from)}));return n(f(t,r)),!0},preventDefault:!0},{key:"Mod-[",run:le},{key:"Mod-]",run:se},{key:"Mod-Alt-\\",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=Object.create(null),i=new l.a(t,{overrideIndentation:function(e){var t=r[e];return null==t?-1:t}}),o=ae(t,(function(e,n,o){var a=Object(l.e)(i,e.from);if(null!=a){/\S/.test(e.text)||(a=0);var s=/^\s*/.exec(e.text)[0],c=Object(l.g)(t,a);(s!=c||o.from<e.from+s.length)&&(r[e.from]=a,n.push({from:e.from,to:e.from+s.length,insert:c}))}}));return o.changes.empty||n(t.update(o,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:function(e){if(e.state.readOnly)return!1;var t=e.state,n=t.changes(te(t).map((function(e){var n=e.from,r=e.to;return n>0?n--:r<t.doc.length&&r++,{from:n,to:r}}))),r=u(t.selection,(function(t){return e.moveVertically(t,!0)})).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:function(e){return P(e.state,e.dispatch,!1)}}].concat([{key:"ArrowLeft",run:v,shift:D,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function(e){return g(e,e.textDirection!=a.c.LTR)},shift:function(e){return N(e,e.textDirection!=a.c.LTR)}},{mac:"Cmd-ArrowLeft",run:M,shift:W},{key:"ArrowRight",run:m,shift:R,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function(e){return g(e,e.textDirection==a.c.LTR)},shift:function(e){return N(e,e.textDirection==a.c.LTR)}},{mac:"Cmd-ArrowRight",run:C,shift:F},{key:"ArrowUp",run:k,shift:L,preventDefault:!0},{mac:"Cmd-ArrowUp",run:V,shift:Q},{mac:"Ctrl-ArrowUp",run:j,shift:z},{key:"ArrowDown",run:w,shift:I,preventDefault:!0},{mac:"Cmd-ArrowDown",run:H,shift:q},{mac:"Ctrl-ArrowDown",run:S,shift:B},{key:"PageUp",run:j,shift:z},{key:"PageDown",run:S,shift:B},{key:"Home",run:M,shift:W},{key:"Mod-Home",run:V,shift:Q},{key:"End",run:C,shift:F},{key:"Mod-End",run:H,shift:q},{key:"Enter",run:ie},{key:"Mod-a",run:function(e){var t=e.state;return(0,e.dispatch)(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0}},{key:"Backspace",run:G,shift:G},{key:"Delete",run:K,shift:K},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Z},{key:"Mod-Delete",mac:"Alt-Delete",run:function(e){return J(e,!0)}},{mac:"Mod-Backspace",run:function(e){return U(e,(function(t){var n=e.visualLineAt(t).from;return X(e,t>n?n:Math.max(0,t-1),!1)}))}},{mac:"Mod-Delete",run:ee}].concat([{key:"Ctrl-b",run:v,shift:D,preventDefault:!0},{key:"Ctrl-f",run:m,shift:R},{key:"Ctrl-p",run:k,shift:L},{key:"Ctrl-n",run:w,shift:I},{key:"Ctrl-a",run:function(e){return d(e,(function(t){return i.e.cursor(e.visualLineAt(t.head).from,1)}))},shift:function(e){return T(e,(function(t){return i.e.cursor(e.visualLineAt(t.head).from)}))}},{key:"Ctrl-e",run:function(e){return d(e,(function(t){return i.e.cursor(e.visualLineAt(t.head).to,-1)}))},shift:function(e){return T(e,(function(t){return i.e.cursor(e.visualLineAt(t.head).to)}))}},{key:"Ctrl-d",run:K},{key:"Ctrl-h",run:G},{key:"Ctrl-k",run:ee},{key:"Ctrl-Alt-h",run:Z},{key:"Ctrl-o",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=t.changeByRange((function(e){return{changes:{from:e.from,to:e.to,insert:o.a.of(["",""])},range:i.e.cursor(e.from)}}));return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=t.changeByRange((function(e){if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};var n=e.from,r=t.doc.lineAt(n),a=n==r.from?n-1:Object(o.e)(r.text,n-r.from,!1)+r.from,s=n==r.to?n+1:Object(o.e)(r.text,n-r.from,!0)+r.from;return{changes:{from:a,to:s,insert:t.doc.slice(n,s).append(t.doc.slice(a,n))},range:i.e.cursor(s)}}));return!r.changes.empty&&(n(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Alt-<",run:V},{key:"Alt->",run:H},{key:"Ctrl-v",run:S},{key:"Alt-v",run:j}].map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))))},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(56),i=n(49),o=(n(11),n(0)),a=n.n(o),s=n(27),l=n.n(s),c=!1,u=n(80),f="unmounted",d="exited",h="entering",p="entered",v="exiting",m=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=d,r.appearStatus=h):i=p:i=t.unmountOnExit||t.mountOnEnter?f:d,r.state={status:i},r.nextCallback=null,r}Object(i.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===f?{status:d}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==h&&n!==p&&(t=h):n!==h&&n!==p||(t=v)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===h?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===d&&this.setState({status:f})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[l.a.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),u=r?s.appear:s.enter;!e&&!n||c?this.safeSetState({status:p},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:h},(function(){t.props.onEntering(o,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:p},(function(){t.props.onEntered(o,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:l.a.findDOMNode(this);t&&!c?(this.props.onExit(r),this.safeSetState({status:v},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:d},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:d},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:l.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===f)return null;var t=this.props,n=t.children,i=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(r.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(u.a.Provider,{value:null},"function"===typeof n?n(e,i):a.a.cloneElement(a.a.Children.only(n),i))},t}(a.a.Component);function g(){}m.contextType=u.a,m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g,onEntering:g,onEntered:g,onExit:g,onExiting:g,onExited:g},m.UNMOUNTED=f,m.EXITED=d,m.ENTERING=h,m.ENTERED=p,m.EXITING=v;t.a=m},,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,s,l=a(e),c=1;c<arguments.length;c++){for(var u in n=Object(arguments[c]))i.call(n,u)&&(l[u]=n[u]);if(r){s=r(n);for(var f=0;f<s.length;f++)o.call(n,s[f])&&(l[s[f]]=n[s[f]])}}return l}},function(e,t,n){"use strict";var r,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(t){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(M){l=null}var c=function(){throw new a},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(t){return c}}}():c,f=n(187)(),d=Object.getPrototypeOf||function(e){return e.__proto__},h={},p="undefined"===typeof Uint8Array?r:d(Uint8Array),v={"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":f?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?d(d([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&f?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&f?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?d(""[Symbol.iterator]()):r,"%Symbol%":f?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet},m=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(n=d(i.prototype))}return v[t]=n,n},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},y=n(111),b=n(190),O=y.call(Function.call,Array.prototype.concat),k=y.call(Function.apply,Array.prototype.splice),w=y.call(Function.call,String.prototype.replace),x=y.call(Function.call,String.prototype.slice),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,E=function(e){var t=x(e,0,1),n=x(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return w(e,j,(function(e,t,n,i){r[r.length]=n?w(i,S,"$1"):t||e})),r},C=function(e,t){var n,r=e;if(b(g,r)&&(r="%"+(n=g[r])[0]+"%"),b(v,r)){var o=v[r];if(o===h&&(o=m(r)),"undefined"===typeof o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new a('"allowMissing" argument must be a boolean');var n=E(e),r=n.length>0?n[0]:"",o=C("%"+r+"%",t),s=o.name,c=o.value,u=!1,f=o.alias;f&&(r=f[0],k(n,O([0,1],f)));for(var d=1,h=!0;d<n.length;d+=1){var p=n[d],m=x(p,0,1),g=x(p,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&h||(u=!0),b(v,s="%"+(r+="."+p)+"%"))c=v[s];else if(null!=c){if(!(p in c)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&d+1>=n.length){var y=l(c,p);c=(h=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else h=b(c,p),c=c[p];h&&!u&&(v[s]=c)}}return c}},function(e,t,n){"use strict";var r=n(189);e.exports=Function.prototype.bind||r},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g,o="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o,RFC3986:a}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return function(){return null}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n,r,i){return null}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){(function(t){var n="__lodash_hash_undefined__",r="[object Function]",i="[object GeneratorFunction]",o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/,s=/^\./,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c=/\\(\\)?/g,u=/^\[object .+?Constructor\]$/,f="object"==typeof t&&t&&t.Object===Object&&t,d="object"==typeof self&&self&&self.Object===Object&&self,h=f||d||Function("return this")();var p=Array.prototype,v=Function.prototype,m=Object.prototype,g=h["__core-js_shared__"],y=function(){var e=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),b=v.toString,O=m.hasOwnProperty,k=m.toString,w=RegExp("^"+b.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=h.Symbol,j=p.splice,S=L(h,"Map"),E=L(Object,"create"),C=x?x.prototype:void 0,M=C?C.toString:void 0;function P(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function T(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e,t){for(var n,r,i=e.length;i--;)if((n=e[i][0])===(r=t)||n!==n&&r!==r)return i;return-1}function R(e,t){var n;t=function(e,t){if(B(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||W(e))return!0;return a.test(e)||!o.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:B(n=t)?n:I(n);for(var r=0,i=t.length;null!=e&&r<i;)e=e[$(t[r++])];return r&&r==i?e:void 0}function N(e){if(!F(e)||(t=e,y&&y in t))return!1;var t,n=function(e){var t=F(e)?k.call(e):"";return t==r||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}(e)?w:u;return n.test(function(e){if(null!=e){try{return b.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function _(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function L(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return N(n)?n:void 0}P.prototype.clear=function(){this.__data__=E?E(null):{}},P.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},P.prototype.get=function(e){var t=this.__data__;if(E){var r=t[e];return r===n?void 0:r}return O.call(t,e)?t[e]:void 0},P.prototype.has=function(e){var t=this.__data__;return E?void 0!==t[e]:O.call(t,e)},P.prototype.set=function(e,t){return this.__data__[e]=E&&void 0===t?n:t,this},T.prototype.clear=function(){this.__data__=[]},T.prototype.delete=function(e){var t=this.__data__,n=D(t,e);return!(n<0)&&(n==t.length-1?t.pop():j.call(t,n,1),!0)},T.prototype.get=function(e){var t=this.__data__,n=D(t,e);return n<0?void 0:t[n][1]},T.prototype.has=function(e){return D(this.__data__,e)>-1},T.prototype.set=function(e,t){var n=this.__data__,r=D(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},A.prototype.clear=function(){this.__data__={hash:new P,map:new(S||T),string:new P}},A.prototype.delete=function(e){return _(this,e).delete(e)},A.prototype.get=function(e){return _(this,e).get(e)},A.prototype.has=function(e){return _(this,e).has(e)},A.prototype.set=function(e,t){return _(this,e).set(e,t),this};var I=z((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(W(e))return M?M.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return s.test(e)&&n.push(""),e.replace(l,(function(e,t,r,i){n.push(r?i.replace(c,"$1"):t||e)})),n}));function $(e){if("string"==typeof e||W(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function z(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new(z.Cache||A),n}z.Cache=A;var B=Array.isArray;function F(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function W(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:R(e,t);return void 0===r?n:r}}).call(this,n(113))},function(e,t,n){"use strict";var r=n(202),i=n(203),o=n(204),a=Symbol("max"),s=Symbol("length"),l=Symbol("lengthCalculator"),c=Symbol("allowStale"),u=Symbol("maxAge"),f=Symbol("dispose"),d=Symbol("noDisposeOnSet"),h=Symbol("lruList"),p=Symbol("cache"),v=Symbol("updateAgeOnGet"),m=function(){return 1},g=function(){function e(t){if(r(this,e),"number"===typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!==typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[a]=t.max||1/0;var n=t.length||m;if(this[l]="function"!==typeof n?m:n,this[c]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[f]=t.dispose,this[d]=t.noDisposeOnSet||!1,this[v]=t.updateAgeOnGet||!1,this.reset()}return i(e,[{key:"max",get:function(){return this[a]},set:function(e){if("number"!==typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,O(this)}},{key:"allowStale",get:function(){return this[c]},set:function(e){this[c]=!!e}},{key:"maxAge",get:function(){return this[u]},set:function(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,O(this)}},{key:"lengthCalculator",get:function(){return this[l]},set:function(e){var t=this;"function"!==typeof e&&(e=m),e!==this[l]&&(this[l]=e,this[s]=0,this[h].forEach((function(e){e.length=t[l](e.value,e.key),t[s]+=e.length}))),O(this)}},{key:"length",get:function(){return this[s]}},{key:"itemCount",get:function(){return this[h].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[h].tail;null!==n;){var r=n.prev;x(this,e,n,t),n=r}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[h].head;null!==n;){var r=n.next;x(this,e,n,t),n=r}}},{key:"keys",value:function(){return this[h].toArray().map((function(e){return e.key}))}},{key:"values",value:function(){return this[h].toArray().map((function(e){return e.value}))}},{key:"reset",value:function(){var e=this;this[f]&&this[h]&&this[h].length&&this[h].forEach((function(t){return e[f](t.key,t.value)})),this[p]=new Map,this[h]=new o,this[s]=0}},{key:"dump",value:function(){var e=this;return this[h].map((function(t){return!b(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}})).toArray().filter((function(e){return e}))}},{key:"dumpLru",value:function(){return this[h]}},{key:"set",value:function(e,t,n){if((n=n||this[u])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[l](t,e);if(this[p].has(e)){if(i>this[a])return k(this,this[p].get(e)),!1;var o=this[p].get(e).value;return this[f]&&(this[d]||this[f](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[s]+=i-o.length,o.length=i,this.get(e),O(this),!0}var c=new w(e,t,i,r,n);return c.length>this[a]?(this[f]&&this[f](e,t),!1):(this[s]+=c.length,this[h].unshift(c),this[p].set(e,this[h].head),O(this),!0)}},{key:"has",value:function(e){if(!this[p].has(e))return!1;var t=this[p].get(e).value;return!b(this,t)}},{key:"get",value:function(e){return y(this,e,!0)}},{key:"peek",value:function(e){return y(this,e,!1)}},{key:"pop",value:function(){var e=this[h].tail;return e?(k(this,e),e.value):null}},{key:"del",value:function(e){k(this,this[p].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var e=this;this[p].forEach((function(t,n){return y(e,n,!1)}))}}]),e}(),y=function(e,t,n){var r=e[p].get(t);if(r){var i=r.value;if(b(e,i)){if(k(e,r),!e[c])return}else n&&(e[v]&&(r.value.now=Date.now()),e[h].unshiftNode(r));return i.value}},b=function(e,t){if(!t||!t.maxAge&&!e[u])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[u]&&n>e[u]},O=function(e){if(e[s]>e[a])for(var t=e[h].tail;e[s]>e[a]&&null!==t;){var n=t.prev;k(e,t),t=n}},k=function(e,t){if(t){var n=t.value;e[f]&&e[f](n.key,n.value),e[s]-=n.length,e[p].delete(n.key),e[h].removeNode(t)}},w=function e(t,n,i,o,a){r(this,e),this.key=t,this.value=n,this.length=i,this.now=o,this.maxAge=a||0},x=function(e,t,n,r){var i=n.value;b(e,i)&&(k(e,n),e[c]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=g},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),u=Object.prototype.toString,f=Math.max,d=Math.min,h=function(){return c.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||o.test(e)?a(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,l,c=0,u=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function b(e){return c=e,s=setTimeout(k,t),u?y(e):a}function O(e){var n=e-l;return void 0===l||n>=t||n<0||m&&e-c>=o}function k(){var e=h();if(O(e))return w(e);s=setTimeout(k,function(e){var n=t-(e-l);return m?d(n,o-(e-c)):n}(e))}function w(e){return s=void 0,g&&r?y(e):(r=i=void 0,a)}function x(){var e=h(),n=O(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return b(l);if(m)return s=setTimeout(k,t),y(l)}return void 0===s&&(s=setTimeout(k,t)),a}return t=v(t)||0,p(n)&&(u=!!n.leading,o=(m="maxWait"in n)?f(v(n.maxWait)||0,t):o,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},x.flush=function(){return void 0===s?a:w(h())},x}}).call(this,n(113))},,,,,,,,,,,function(e,t,n){"use strict";var r=n(112),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)"undefined"!==typeof e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],s=Object.keys(a),l=0;l<s.length;++l){var c=s[l],u=a[c];"object"===typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:c}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i<n.length;++i)"undefined"!==typeof n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(i){return r}},encode:function(e,t,n,i,o){if(0===e.length)return e;var s=e;if("symbol"===typeof e?s=Symbol.prototype.toString.call(e):"string"!==typeof e&&(s=String(e)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var l="",c=0;c<s.length;++c){var u=s.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===r.RFC1738&&(40===u||41===u)?l+=s.charAt(c):u<128?l+=a[u]:u<2048?l+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?l+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(c)),l+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return l},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!==typeof n){if(o(t))t.push(n);else{if(!t||"object"!==typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!i.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!==typeof t)return[t].concat(n);var a=t;return o(t)&&!o(n)&&(a=s(t,r)),o(t)&&o(n)?(n.forEach((function(n,o){if(i.call(t,o)){var a=t[o];a&&"object"===typeof a&&n&&"object"===typeof n?t[o]=e(a,n,r):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var a=n[o];return i.call(t,o)?t[o]=e(t[o],a,r):t[o]=a,t}),a)}}},function(e,t,n){e.exports=function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,o=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=31536e6,l=2592e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:s,months:l,days:o,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},f=function(e){return e instanceof y},d=function(e,t,n){return new y(e,n,t.$l)},h=function(e){return t.p(e)+"s"},p=function(e){return e<0},v=function(e){return p(e)?Math.ceil(e):Math.floor(e)},m=function(e){return Math.abs(e)},g=function(e,t){return e?p(e)?{negative:!0,format:""+m(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},y=function(){function p(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(e*u[h(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){r.$d[h(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var i=e.match(c);if(i){var o=i.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=o[0],this.$d.months=o[1],this.$d.weeks=o[2],this.$d.days=o[3],this.$d.hours=o[4],this.$d.minutes=o[5],this.$d.seconds=o[6],this.calMilliseconds(),this}}return this}var m=p.prototype;return m.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},m.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=v(e/s),e%=s,this.$d.months=v(e/l),e%=l,this.$d.days=v(e/o),e%=o,this.$d.hours=v(e/i),e%=i,this.$d.minutes=v(e/r),e%=r,this.$d.seconds=v(e/n),e%=n,this.$d.milliseconds=e},m.toISOString=function(){var e=g(this.$d.years,"Y"),t=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=g(n,"D"),i=g(this.$d.hours,"H"),o=g(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3);var s=g(a,"S"),l=e.negative||t.negative||r.negative||i.negative||o.negative||s.negative,c=i.format||o.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+r.format+c+i.format+o.format+s.format;return"P"===u||"-P"===u?"P0D":u},m.toJSON=function(){return this.toISOString()},m.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(a,(function(e,t){return t||String(r[e])}))},m.as=function(e){return this.$ms/u[h(e)]},m.get=function(e){var t=this.$ms,n=h(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?v(t/u[n]):this.$d[n],0===t?0:t},m.add=function(e,t,n){var r;return r=t?e*u[h(t)]:f(e)?e.$ms:d(e,this).$ms,d(this.$ms+r*(n?-1:1),this)},m.subtract=function(e,t){return this.add(e,t,!0)},m.locale=function(e){var t=this.clone();return t.$l=e,t},m.clone=function(){return d(this.$ms,this)},m.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},m.milliseconds=function(){return this.get("milliseconds")},m.asMilliseconds=function(){return this.as("milliseconds")},m.seconds=function(){return this.get("seconds")},m.asSeconds=function(){return this.as("seconds")},m.minutes=function(){return this.get("minutes")},m.asMinutes=function(){return this.as("minutes")},m.hours=function(){return this.get("hours")},m.asHours=function(){return this.as("hours")},m.days=function(){return this.get("days")},m.asDays=function(){return this.as("days")},m.weeks=function(){return this.get("weeks")},m.asWeeks=function(){return this.as("weeks")},m.months=function(){return this.get("months")},m.asMonths=function(){return this.as("months")},m.years=function(){return this.get("years")},m.asYears=function(){return this.as("years")},p}();return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){var n=i.locale();return d(e,{$l:n},t)},i.isDuration=f;var o=r.prototype.add,a=r.prototype.subtract;r.prototype.add=function(e,t){return f(e)&&(e=e.asMilliseconds()),o.bind(this)(e,t)},r.prototype.subtract=function(e,t){return f(e)&&(e=e.asMilliseconds()),a.bind(this)(e,t)}}}()},function(e,t,n){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,o){var a=i.prototype;o.utc=function(e){return new i({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(r,i){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var i=(""+r[0]).match(n)||["-",0,0],o=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(r)))return this;var a=Math.abs(r)<=16?60*r:r,s=this;if(i)return s.$offset=a,s.$u=0===r,s;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var f=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var r=this.local(),i=o(e).local();return d.call(r,i,t,n)}}}()},function(e,t,n){"use strict";var r=n(185),i=n(195),o=n(112);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";(function(e){var n="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(n&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:l(s(e))}function c(e){return e&&e.referenceNode?e.referenceNode:e}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?u:10===e?f:u||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function v(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(e!==a&&t!==a||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||h(e.firstElementChild)===e)}(a)?a:h(a);var s=p(e);return s.host?v(s.host,t):v(e,p(t).host)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(t,"top"),i=m(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function y(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function b(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function O(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:b("Height",t,n,r),width:b("Width",t,n,r)}}var k=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},w=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),x=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function S(e){return j({},e,{right:e.left+e.width,bottom:e.top+e.height})}function E(e){var t={};try{if(d(10)){t=e.getBoundingClientRect();var n=m(e,"top"),r=m(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(h){}var i={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?O(e.ownerDocument):{},s=o.width||e.clientWidth||i.width,l=o.height||e.clientHeight||i.height,c=e.offsetWidth-s,u=e.offsetHeight-l;if(c||u){var f=a(e);c-=y(f,"x"),u-=y(f,"y"),i.width-=c,i.height-=u}return S(i)}function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=E(e),s=E(t),c=l(e),u=a(t),f=parseFloat(u.borderTopWidth),h=parseFloat(u.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=S({top:o.top-s.top-f,left:o.left-s.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var v=parseFloat(u.marginTop),m=parseFloat(u.marginLeft);p.top-=f-v,p.bottom-=f-v,p.left-=h-m,p.right-=h-m,p.marginTop=v,p.marginLeft=m}return(r&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(p=g(p,t)),p}function M(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=C(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:m(n),s=t?0:m(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return S(l)}function P(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=s(e);return!!n&&P(n)}function T(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function A(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?T(e):v(e,c(t));if("viewport"===r)o=M(a,i);else{var u=void 0;"scrollParent"===r?"BODY"===(u=l(s(t))).nodeName&&(u=e.ownerDocument.documentElement):u="window"===r?e.ownerDocument.documentElement:r;var f=C(u,a,i);if("HTML"!==u.nodeName||P(a))o=f;else{var d=O(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var m="number"===typeof(n=n||0);return o.left+=m?n:n.left||0,o.top+=m?n:n.top||0,o.right-=m?n:n.right||0,o.bottom-=m?n:n.bottom||0,o}function D(e){return e.width*e.height}function R(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=A(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return j({key:e},s[e],{area:D(s[e])})})).sort((function(e,t){return t.area-e.area})),c=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,f=e.split("-")[1];return u+(f?"-"+f:"")}function N(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?T(t):v(t,c(n));return C(n,i,r)}function _(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function L(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function I(e,t,n){n=n.split("-")[0];var r=_(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[c]:t[L(s)],i}function $(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function z(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=$(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function B(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=N(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=R(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=I(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function F(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function W(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var i=t[r],o=i?""+i+n:e;if("undefined"!==typeof document.body.style[o])return o}return null}function V(){return this.state.isDestroyed=!0,F(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[W("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function H(e){var t=e.ownerDocument;return t?t.defaultView:window}function Q(e,t,n,r){var i="BODY"===e.nodeName,o=i?e.ownerDocument.defaultView:e;o.addEventListener(t,n,{passive:!0}),i||Q(l(o.parentNode),t,n,r),r.push(o)}function q(e,t,n,r){n.updateBound=r,H(e).addEventListener("resize",n.updateBound,{passive:!0});var i=l(e);return Q(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function U(){this.state.eventsEnabled||(this.state=q(this.reference,this.options,this.state,this.scheduleUpdate))}function X(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,H(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function Y(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function G(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&Y(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var K=n&&/Firefox/i.test(navigator.userAgent);function J(e,t,n){var r=$(e,(function(e){return e.name===t})),i=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!i){var o="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}var Z=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],ee=Z.slice(3);function te(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ee.indexOf(e),r=ee.slice(n+1).concat(ee.slice(0,n));return t?r.reverse():r}var ne="flip",re="clockwise",ie="counterclockwise";function oe(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf($(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return c=c.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){return S("%p"===a?n:r)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)}))})),c.forEach((function(e,t){e.forEach((function(n,r){Y(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var ae={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",c=s?"width":"height",u={start:x({},l,o[l]),end:x({},l,o[l]+o[c]-a[c])};e.offsets.popper=j({},a,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],l=void 0;return l=Y(+n)?[+n,0]:oe(n,o,a,s),"left"===s?(o.top+=l[0],o.left-=l[1]):"right"===s?(o.top+=l[0],o.left+=l[1]):"top"===s?(o.left+=l[0],o.top-=l[1]):"bottom"===s&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=W("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=A(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var c=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]<l[e]&&!t.escapeWithReference&&(n=Math.max(u[e],l[e])),x({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=u[n];return u[e]>l[e]&&!t.escapeWithReference&&(r=Math.min(u[n],l[e]-("right"===e?u.width:u.height))),x({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=j({},u,f[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",c=a?"width":"height";return n[s]<o(r[l])&&(e.offsets.popper[l]=o(r[l])-n[c]),n[l]>o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!J(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,s=o.popper,l=o.reference,c=-1!==["left","right"].indexOf(i),u=c?"height":"width",f=c?"Top":"Left",d=f.toLowerCase(),h=c?"left":"top",p=c?"bottom":"right",v=_(r)[u];l[p]-v<s[d]&&(e.offsets.popper[d]-=s[d]-(l[p]-v)),l[d]+v>s[p]&&(e.offsets.popper[d]+=l[d]+v-s[p]),e.offsets.popper=S(e.offsets.popper);var m=l[d]+l[u]/2-v/2,g=a(e.instance.popper),y=parseFloat(g["margin"+f]),b=parseFloat(g["border"+f+"Width"]),O=m-e.offsets.popper[d]-y-b;return O=Math.max(Math.min(s[u]-v,O),0),e.arrowElement=r,e.offsets.arrow=(x(n={},d,Math.round(O)),x(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(F(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=A(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=L(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case ne:a=[r,i];break;case re:a=te(r);break;case ie:a=te(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=L(r);var c=e.offsets.popper,u=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(u.left)||"right"===r&&f(c.left)<f(u.right)||"top"===r&&f(c.bottom)>f(u.top)||"bottom"===r&&f(c.top)<f(u.bottom),h=f(c.left)<f(n.left),p=f(c.right)>f(n.right),v=f(c.top)<f(n.top),m=f(c.bottom)>f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&v||"bottom"===r&&m,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&h||y&&"end"===o&&p||!y&&"start"===o&&v||!y&&"end"===o&&m),O=!!t.flipVariationsByContent&&(y&&"start"===o&&p||y&&"end"===o&&h||!y&&"start"===o&&m||!y&&"end"===o&&v),k=b||O;(d||g||k)&&(e.flipped=!0,(d||g)&&(r=a[l+1]),k&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=j({},e.offsets.popper,I(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=L(t),e.offsets.popper=S(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!J(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=$(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,i=e.offsets.popper,o=$(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==o?o:t.gpuAcceleration,s=h(e.instance.popper),l=E(s),c={position:i.position},u=function(e,t){var n=e.offsets,r=n.popper,i=n.reference,o=Math.round,a=Math.floor,s=function(e){return e},l=o(i.width),c=o(r.width),u=-1!==["left","right"].indexOf(e.placement),f=-1!==e.placement.indexOf("-"),d=t?u||f||l%2===c%2?o:a:s,h=t?o:s;return{left:d(l%2===1&&c%2===1&&!f&&t?r.left-1:r.left),top:h(r.top),bottom:h(r.bottom),right:d(r.right)}}(e,window.devicePixelRatio<2||!K),f="bottom"===n?"top":"bottom",d="right"===r?"left":"right",p=W("transform"),v=void 0,m=void 0;if(m="bottom"===f?"HTML"===s.nodeName?-s.clientHeight+u.bottom:-l.height+u.bottom:u.top,v="right"===d?"HTML"===s.nodeName?-s.clientWidth+u.right:-l.width+u.right:u.left,a&&p)c[p]="translate3d("+v+"px, "+m+"px, 0)",c[f]=0,c[d]=0,c.willChange="transform";else{var g="bottom"===f?-1:1,y="right"===d?-1:1;c[f]=m*g,c[d]=v*y,c.willChange=f+", "+d}var b={"x-placement":e.placement};return e.attributes=j({},b,e.attributes),e.styles=j({},c,e.styles),e.arrowStyles=j({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return G(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&G(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,i){var o=N(i,t,e,n.positionFixed),a=R(n.placement,o,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),G(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}},se={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:ae},le=function(){function e(t,n){var r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=j({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(j({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=j({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return j({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return w(e,[{key:"update",value:function(){return B.call(this)}},{key:"destroy",value:function(){return V.call(this)}},{key:"enableEventListeners",value:function(){return U.call(this)}},{key:"disableEventListeners",value:function(){return X.call(this)}}]),e}();le.Utils=("undefined"!==typeof window?window:e).PopperUtils,le.placements=Z,le.Defaults=se,t.a=le}).call(this,n(113))},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"}),"Equalizer");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"}),"TableChart");t.default=a},function(e,t,n){var r;window,r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./react/uplot-react.tsx")}({"./common/index.ts":function(e,t,n){"use strict";n.r(t),n.d(t,"optionsUpdateState",(function(){return i})),n.d(t,"dataMatch",(function(){return o}));var r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.is||Object.defineProperty(Object,"is",{value:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}});var i=function(e,t){var n=e.width,i=e.height,o=r(e,["width","height"]),a=t.width,s=t.height,l=r(t,["width","height"]),c="keep";if(i===s&&n===a||(c="update"),Object.keys(o).length!==Object.keys(l).length)return"create";for(var u=0,f=Object.keys(o);u<f.length;u++){var d=f[u];if(!Object.is(o[d],l[d])){c="create";break}}return c},o=function(e,t){return e.length===t.length&&e.every((function(e,n){var r=t[n];return e.length===r.length&&e.every((function(e,t){return e===r[t]}))}))}},"./react/uplot-react.tsx":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return l}));var r=n("react"),i=n.n(r),o=n("uplot"),a=n.n(o),s=n("./common/index.ts");function l(e){var t=e.options,n=e.data,o=e.target,l=e.onDelete,c=void 0===l?function(){}:l,u=e.onCreate,f=void 0===u?function(){}:u,d=Object(r.useRef)(null),h=Object(r.useRef)(null);function p(e){e&&(c(e),e.destroy(),d.current=null)}function v(){var e=new a.a(t,n,o||h.current);d.current=e,f(e)}Object(r.useEffect)((function(){return v(),function(){p(d.current)}}),[]);var m=Object(r.useRef)({options:t,data:n,target:o}).current;return Object(r.useEffect)((function(){var e=d.current;if(m.options!==t){var r=Object(s.optionsUpdateState)(m.options,t);e&&"create"!==r?"update"===r&&e.setSize({width:t.width,height:t.height}):(p(e),v())}return m.data!==n&&(e?Object(s.dataMatch)(m.data,n)||e.setData(n):v()),m.target!==o&&(p(e),v()),function(){m.options=t,m.data=n,m.target=o}}),[t,n,o]),o?null:i.a.createElement("div",{ref:h})}},react:function(t,n){t.exports=e},uplot:function(e,n){e.exports=t}}).default},e.exports=r(n(0),n(197))},function(e,t,n){var r,i;r=function(){var e,t,n="2.0.6",r={},i={},o={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},a={currentLocale:o.currentLocale,zeroFormat:o.zeroFormat,nullFormat:o.nullFormat,defaultFormat:o.defaultFormat,scalePercentBy100:o.scalePercentBy100};function s(e,t){this._input=e,this._value=t}return(e=function(n){var i,o,l,c;if(e.isNumeral(n))i=n.value();else if(0===n||"undefined"===typeof n)i=0;else if(null===n||t.isNaN(n))i=null;else if("string"===typeof n)if(a.zeroFormat&&n===a.zeroFormat)i=0;else if(a.nullFormat&&n===a.nullFormat||!n.replace(/[^0-9]+/g,"").length)i=null;else{for(o in r)if((c="function"===typeof r[o].regexps.unformat?r[o].regexps.unformat():r[o].regexps.unformat)&&n.match(c)){l=r[o].unformat;break}i=(l=l||e._.stringToNumber)(n)}else i=Number(n)||null;return new s(n,i)}).version=n,e.isNumeral=function(e){return e instanceof s},e._=t={numberToFormat:function(t,n,r){var o,a,s,l,c,u,f,d=i[e.options.currentLocale],h=!1,p=!1,v=0,m="",g=1e12,y=1e9,b=1e6,O=1e3,k="",w=!1;if(t=t||0,a=Math.abs(t),e._.includes(n,"(")?(h=!0,n=n.replace(/[\(|\)]/g,"")):(e._.includes(n,"+")||e._.includes(n,"-"))&&(c=e._.includes(n,"+")?n.indexOf("+"):t<0?n.indexOf("-"):-1,n=n.replace(/[\+|\-]/g,"")),e._.includes(n,"a")&&(o=!!(o=n.match(/a(k|m|b|t)?/))&&o[1],e._.includes(n," a")&&(m=" "),n=n.replace(new RegExp(m+"a[kmbt]?"),""),a>=g&&!o||"t"===o?(m+=d.abbreviations.trillion,t/=g):a<g&&a>=y&&!o||"b"===o?(m+=d.abbreviations.billion,t/=y):a<y&&a>=b&&!o||"m"===o?(m+=d.abbreviations.million,t/=b):(a<b&&a>=O&&!o||"k"===o)&&(m+=d.abbreviations.thousand,t/=O)),e._.includes(n,"[.]")&&(p=!0,n=n.replace("[.]",".")),s=t.toString().split(".")[0],l=n.split(".")[1],u=n.indexOf(","),v=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,l?(e._.includes(l,"[")?(l=(l=l.replace("]","")).split("["),k=e._.toFixed(t,l[0].length+l[1].length,r,l[1].length)):k=e._.toFixed(t,l.length,r),s=k.split(".")[0],k=e._.includes(k,".")?d.delimiters.decimal+k.split(".")[1]:"",p&&0===Number(k.slice(1))&&(k="")):s=e._.toFixed(t,0,r),m&&!o&&Number(s)>=1e3&&m!==d.abbreviations.trillion)switch(s=String(Number(s)/1e3),m){case d.abbreviations.thousand:m=d.abbreviations.million;break;case d.abbreviations.million:m=d.abbreviations.billion;break;case d.abbreviations.billion:m=d.abbreviations.trillion}if(e._.includes(s,"-")&&(s=s.slice(1),w=!0),s.length<v)for(var x=v-s.length;x>0;x--)s="0"+s;return u>-1&&(s=s.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d.delimiters.thousands)),0===n.indexOf(".")&&(s=""),f=s+k+(m||""),h?f=(h&&w?"(":"")+f+(h&&w?")":""):c>=0?f=0===c?(w?"-":"+")+f:f+(w?"-":"+"):w&&(f="-"+f),f},stringToNumber:function(e){var t,n,r,o=i[a.currentLocale],s=e,l={thousand:3,million:6,billion:9,trillion:12};if(a.zeroFormat&&e===a.zeroFormat)n=0;else if(a.nullFormat&&e===a.nullFormat||!e.replace(/[^0-9]+/g,"").length)n=null;else{for(t in n=1,"."!==o.delimiters.decimal&&(e=e.replace(/\./g,"").replace(o.delimiters.decimal,".")),l)if(r=new RegExp("[^a-zA-Z]"+o.abbreviations[t]+"(?:\\)|(\\"+o.currency.symbol+")?(?:\\))?)?$"),s.match(r)){n*=Math.pow(10,l[t]);break}n*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),n*=Number(e)}return n},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return"number"===typeof e&&isNaN(e)})),includes:function(e,t){return-1!==e.indexOf(t)},insert:function(e,t,n){return e.slice(0,n)+t+e.slice(n)},reduce:function(e,t){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!==typeof t)throw new TypeError(t+" is not a function");var n,r=Object(e),i=r.length>>>0,o=0;if(3===arguments.length)n=arguments[2];else{for(;o<i&&!(o in r);)o++;if(o>=i)throw new TypeError("Reduce of empty array with no initial value");n=r[o++]}for(;o<i;o++)o in r&&(n=t(n,r[o],o,r));return n},multiplier:function(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)},correctionFactor:function(){return Array.prototype.slice.call(arguments).reduce((function(e,n){var r=t.multiplier(n);return e>r?e:r}),1)},toFixed:function(e,t,n,r){var i,o,a,s,l=e.toString().split("."),c=t-(r||0);return i=2===l.length?Math.min(Math.max(l[1].length,c),t):c,a=Math.pow(10,i),s=(n(e+"e+"+i)/a).toFixed(i),r>t-i&&(o=new RegExp("\\.?0{1,"+(r-(t-i))+"}$"),s=s.replace(o,"")),s}},e.options=a,e.formats=r,e.locales=i,e.locale=function(e){return e&&(a.currentLocale=e.toLowerCase()),a.currentLocale},e.localeData=function(e){if(!e)return i[a.currentLocale];if(e=e.toLowerCase(),!i[e])throw new Error("Unknown locale : "+e);return i[e]},e.reset=function(){for(var e in o)a[e]=o[e]},e.zeroFormat=function(e){a.zeroFormat="string"===typeof e?e:null},e.nullFormat=function(e){a.nullFormat="string"===typeof e?e:null},e.defaultFormat=function(e){a.defaultFormat="string"===typeof e?e:"0.0"},e.register=function(e,t,n){if(t=t.toLowerCase(),this[e+"s"][t])throw new TypeError(t+" "+e+" already registered.");return this[e+"s"][t]=n,n},e.validate=function(t,n){var r,i,o,a,s,l,c,u;if("string"!==typeof t&&(t+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",t)),(t=t.trim()).match(/^\d+$/))return!0;if(""===t)return!1;try{c=e.localeData(n)}catch(f){c=e.localeData(e.locale())}return o=c.currency.symbol,s=c.abbreviations,r=c.delimiters.decimal,i="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(u=t.match(/^[^\d]+/))||(t=t.substr(1),u[0]===o))&&(null===(u=t.match(/[^\d]+$/))||(t=t.slice(0,-1),u[0]===s.thousand||u[0]===s.million||u[0]===s.billion||u[0]===s.trillion))&&(l=new RegExp(i+"{2}"),!t.match(/[^\d.,]/g)&&!((a=t.split(r)).length>2)&&(a.length<2?!!a[0].match(/^\d+.*\d$/)&&!a[0].match(l):1===a[0].length?!!a[0].match(/^\d+$/)&&!a[0].match(l)&&!!a[1].match(/^\d+$/):!!a[0].match(/^\d+.*\d$/)&&!a[0].match(l)&&!!a[1].match(/^\d+$/)))},e.fn=s.prototype={clone:function(){return e(this)},format:function(t,n){var i,o,s,l=this._value,c=t||a.defaultFormat;if(n=n||Math.round,0===l&&null!==a.zeroFormat)o=a.zeroFormat;else if(null===l&&null!==a.nullFormat)o=a.nullFormat;else{for(i in r)if(c.match(r[i].regexps.format)){s=r[i].format;break}o=(s=s||e._.numberToFormat)(l,c,n)}return o},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var n=t.correctionFactor.call(null,this._value,e);function r(e,t,r,i){return e+Math.round(n*t)}return this._value=t.reduce([this._value,e],r,0)/n,this},subtract:function(e){var n=t.correctionFactor.call(null,this._value,e);function r(e,t,r,i){return e-Math.round(n*t)}return this._value=t.reduce([e],r,Math.round(this._value*n))/n,this},multiply:function(e){function n(e,n,r,i){var o=t.correctionFactor(e,n);return Math.round(e*o)*Math.round(n*o)/Math.round(o*o)}return this._value=t.reduce([this._value,e],n,1),this},divide:function(e){function n(e,n,r,i){var o=t.correctionFactor(e,n);return Math.round(e*o)/Math.round(n*o)}return this._value=t.reduce([this._value,e],n),this},difference:function(t){return Math.abs(e(this._value).subtract(t).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(t,n,r){var i,o=e._.includes(n," BPS")?" ":"";return t*=1e4,n=n.replace(/\s?BPS/,""),i=e._.numberToFormat(t,n,r),e._.includes(i,")")?((i=i.split("")).splice(-1,0,o+"BPS"),i=i.join("")):i=i+o+"BPS",i},unformat:function(t){return+(1e-4*e._.stringToNumber(t)).toFixed(15)}}),function(){var t={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},n={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},r=t.suffixes.concat(n.suffixes.filter((function(e){return t.suffixes.indexOf(e)<0}))).join("|");r="("+r.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(r)},format:function(r,i,o){var a,s,l,c=e._.includes(i,"ib")?n:t,u=e._.includes(i," b")||e._.includes(i," ib")?" ":"";for(i=i.replace(/\s?i?b/,""),a=0;a<=c.suffixes.length;a++)if(s=Math.pow(c.base,a),l=Math.pow(c.base,a+1),null===r||0===r||r>=s&&r<l){u+=c.suffixes[a],s>0&&(r/=s);break}return e._.numberToFormat(r,i,o)+u},unformat:function(r){var i,o,a=e._.stringToNumber(r);if(a){for(i=t.suffixes.length-1;i>=0;i--){if(e._.includes(r,t.suffixes[i])){o=Math.pow(t.base,i);break}if(e._.includes(r,n.suffixes[i])){o=Math.pow(n.base,i);break}}a*=o||1}return a}})}(),e.register("format","currency",{regexps:{format:/(\$)/},format:function(t,n,r){var i,o,a=e.locales[e.options.currentLocale],s={before:n.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:n.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(n=n.replace(/\s?\$\s?/,""),i=e._.numberToFormat(t,n,r),t>=0?(s.before=s.before.replace(/[\-\(]/,""),s.after=s.after.replace(/[\-\)]/,"")):t<0&&!e._.includes(s.before,"-")&&!e._.includes(s.before,"(")&&(s.before="-"+s.before),o=0;o<s.before.length;o++)switch(s.before[o]){case"$":i=e._.insert(i,a.currency.symbol,o);break;case" ":i=e._.insert(i," ",o+a.currency.symbol.length-1)}for(o=s.after.length-1;o>=0;o--)switch(s.after[o]){case"$":i=o===s.after.length-1?i+a.currency.symbol:e._.insert(i,a.currency.symbol,-(s.after.length-(1+o)));break;case" ":i=o===s.after.length-1?i+" ":e._.insert(i," ",-(s.after.length-(1+o)+a.currency.symbol.length-1))}return i}}),e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(t,n,r){var i=("number"!==typeof t||e._.isNaN(t)?"0e+0":t.toExponential()).split("e");return n=n.replace(/e[\+|\-]{1}0/,""),e._.numberToFormat(Number(i[0]),n,r)+"e"+i[1]},unformat:function(t){var n=e._.includes(t,"e+")?t.split("e+"):t.split("e-"),r=Number(n[0]),i=Number(n[1]);function o(t,n,r,i){var o=e._.correctionFactor(t,n);return t*o*(n*o)/(o*o)}return i=e._.includes(t,"e-")?i*=-1:i,e._.reduce([r,Math.pow(10,i)],o,1)}}),e.register("format","ordinal",{regexps:{format:/(o)/},format:function(t,n,r){var i=e.locales[e.options.currentLocale],o=e._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),o+=i.ordinal(t),e._.numberToFormat(t,n,r)+o}}),e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(t,n,r){var i,o=e._.includes(n," %")?" ":"";return e.options.scalePercentBy100&&(t*=100),n=n.replace(/\s?\%/,""),i=e._.numberToFormat(t,n,r),e._.includes(i,")")?((i=i.split("")).splice(-1,0,o+"%"),i=i.join("")):i=i+o+"%",i},unformat:function(t){var n=e._.stringToNumber(t);return e.options.scalePercentBy100?.01*n:n}}),e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,t,n){var r=Math.floor(e/60/60),i=Math.floor((e-60*r*60)/60),o=Math.round(e-60*r*60-60*i);return r+":"+(i<10?"0"+i:i)+":"+(o<10?"0"+o:o)},unformat:function(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}}),e},void 0===(i="function"===typeof r?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return T}));var r,i=n(25),o=n(18),a=n(17),s=n(3),l=n(5),c=n(6),u=n(23),f=function(){function e(t,n,r,i,o,a,s,c,u){var f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10?arguments[10]:void 0;Object(l.a)(this,e),this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=a,this.buffer=s,this.bufferBase=c,this.curContext=u,this.lookAhead=f,this.parent=d}return Object(c.a)(e,[{key:"toString",value:function(){return"[".concat(this.stack.filter((function(e,t){return t%3==0})).concat(this.state),"]@").concat(this.pos).concat(this.score?"!"+this.score:"")}},{key:"context",get:function(){return this.curContext?this.curContext.context:null}},{key:"pushState",value:function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}},{key:"reduce",value:function(e){var t=e>>19,n=65535&e,r=this.p.parser,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,4,!0),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),void this.reduceContext(n,this.reducePos);var o=this.stack.length-3*(t-1)-(262144&e?6:0),a=this.stack[o-2],s=this.stack[o-1],l=this.bufferBase+this.buffer.length-s;if(n<r.minRepeatTerm||131072&e){var c=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,a,c,l+4,!0)}if(262144&e)this.state=this.stack[o];else{var u=this.stack[o-3];this.state=r.getGoto(u,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,a)}},{key:"storeNode",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(0==e){var o=this,a=this.buffer.length;if(0==a&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&0==o.buffer[a-4]&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t)return void(o.buffer[a-2]=n)}}if(i&&this.pos!=n){var s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=r}else this.buffer.push(e,t,n,r)}},{key:"shift",value:function(e,t,n){var r=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var i=e,o=this.p.parser;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,n,4)}},{key:"apply",value:function(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)}},{key:"useNode",value:function(e,t){var n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);var r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}},{key:"split",value:function(){for(var t=this,n=t.buffer.length;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;for(var r=t.buffer.slice(n),i=t.bufferBase+n;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}},{key:"recoverByDelete",value:function(e,t){var n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}},{key:"canShift",value:function(e){for(var t=new h(this);;){var n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}}},{key:"recoverByInsert",value:function(e){if(this.stack.length>=300)return[];var t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){for(var n,r=[],i=0;i<t.length;i+=2)(n=t[i+1])!=this.state&&this.p.parser.hasAction(n,e)&&r.push(t[i],n);if(this.stack.length<120)for(var o=function(e){var n=t[e+1];r.some((function(e,t){return 1&t&&e==n}))||r.push(t[e],n)},a=0;r.length<8&&a<t.length;a+=2)o(a);t=r}for(var s=[],l=0;l<t.length&&s.length<4;l+=2){var c=t[l+1];if(c!=this.state){var u=this.split();u.storeNode(0,u.pos,u.pos,4,!0),u.pushState(c,this.pos),u.shiftContext(t[l],this.pos),u.score-=200,s.push(u)}}return s}},{key:"forceReduce",value:function(){var e=this.p.parser.stateSlot(this.state,5);if(0==(65536&e))return!1;var t=this.p.parser;if(!t.validAction(this.state,e)){var n=e>>19,r=65535&e,i=this.stack.length-3*n;if(i<0||t.getGoto(this.stack[i],r,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reduce(e),!0}},{key:"forceAll",value:function(){for(;!this.p.parser.stateFlag(this.state,2)&&this.forceReduce(););return this}},{key:"deadEnd",get:function(){if(3!=this.stack.length)return!1;var e=this.p.parser;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}},{key:"restart",value:function(){this.state=this.stack[0],this.stack.length=0}},{key:"sameState",value:function(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(var t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}},{key:"parser",get:function(){return this.p.parser}},{key:"dialectEnabled",value:function(e){return this.p.parser.dialect.flags[e]}},{key:"shiftContext",value:function(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}},{key:"reduceContext",value:function(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}},{key:"emitContext",value:function(){var e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.reducePos,this.reducePos,-3)}},{key:"emitLookAhead",value:function(){var e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.reducePos,this.reducePos,-4)}},{key:"updateContext",value:function(e){if(e!=this.curContext.context){var t=new d(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}},{key:"setLookAhead",value:function(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}},{key:"close",value:function(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}],[{key:"start",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new d(i,i.start):null,0,null)}}]),e}(),d=function e(t,n){Object(l.a)(this,e),this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0};!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(r||(r={}));var h=function(){function e(t){Object(l.a)(this,e),this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}return Object(c.a)(e,[{key:"reduce",value:function(e){var t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);var r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}]),e}(),p=function(){function e(t,n,r){Object(l.a)(this,e),this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,0==this.index&&this.maybeNext()}return Object(c.a)(e,[{key:"maybeNext",value:function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"next",value:function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}},{key:"fork",value:function(){return new e(this.stack,this.pos,this.index)}}],[{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.bufferBase+t.buffer.length;return new e(t,n,n-t.bufferBase)}}]),e}(),v=function e(){Object(l.a)(this,e),this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0},m=new v,g=function(){function e(t,n){Object(l.a)(this,e),this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=m,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}return Object(c.a)(e,[{key:"resolveOffset",value:function(e,t){for(var n=this.range,r=this.rangeIndex,i=this.pos+e;i<n.from;){if(!r)return null;var o=this.ranges[--r];i-=n.from-o.to,n=o}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;var a=this.ranges[++r];i+=a.from-n.to,n=a}return i}},{key:"peek",value:function(e){var t,n,r=this.chunkOff+e;if(r>=0&&r<this.chunk.length)t=this.pos+e,n=this.chunk.charCodeAt(r);else{var i=this.resolveOffset(e,1);if(null==i)return-1;if((t=i)>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(t-this.chunk2Pos);else{for(var o=this.rangeIndex,a=this.range;a.to<=t;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-t)),n=this.chunk2.charCodeAt(0)}}return t>this.token.lookAhead&&(this.token.lookAhead=t),n}},{key:"acceptToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}},{key:"getChunk",value:function(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){var e=this.chunk,t=this.chunkPos;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;var n=this.input.chunk(this.pos),r=this.pos+n.length;this.chunk=r>this.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}},{key:"readNext",value:function(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}},{key:"advance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>this.token.lookAhead&&(this.token.lookAhead=this.pos),this.readNext()}},{key:"setDone",value:function(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}},{key:"reset",value:function(e,t){if(t?(this.token=t,t.start=t.lookAhead=e,t.value=t.extended=-1):this.token=m,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}},{key:"read",value:function(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);var n,r="",i=Object(s.a)(this.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.from>=t)break;o.to>e&&(r+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}}catch(a){i.e(a)}finally{i.f()}return r}}]),e}(),y=function(){function e(t,n){Object(l.a)(this,e),this.data=t,this.id=n}return Object(c.a)(e,[{key:"token",value:function(e,t){!function(e,t,n,r){var i=0,o=1<<r,a=n.p.parser,s=a.dialect;e:for(;0!=(o&e[i]);){for(var l=e[i+1],c=i+3;c<l;c+=2)if((e[c+1]&o)>0){var u=e[c];if(s.allows(u)&&(-1==t.token.value||t.token.value==u||a.overrides(u,t.token.value))){t.acceptToken(u);break}}for(var f=t.next,d=0,h=e[i+2];d<h;){var p=d+h>>1,v=l+p+(p<<1),m=e[v],g=e[v+1];if(f<m)h=p;else{if(!(f>=g)){i=e[v+2],t.advance();continue e}d=p+1}}break}}(this.data,e,t,this.id)}}]),e}();y.prototype.contextual=y.prototype.fallback=y.prototype.extend=!1;function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uint16Array;if("string"!=typeof e)return e;for(var n=null,r=0,i=0;r<e.length;){for(var o=0;;){var a=e.charCodeAt(r++),s=!1;if(126==a){o=65535;break}a>=92&&a--,a>=34&&a--;var l=a-32;if(l>=46&&(l-=46,s=!0),o+=l,s)break;o*=46}n?n[i++]=o:n=new t(o)}return n}var O,k="undefined"!=typeof e&&/\bparse\b/.test(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).LOG),w=null;function x(e,t,n){var r=e.fullCursor();for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(O||(O={}));var j,S=function(){function e(t,n){Object(l.a)(this,e),this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}return Object(c.a)(e,[{key:"nextFragment",value:function(){var e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?x(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?x(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}},{key:"nodeAt",value:function(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){var t=this.trees.length-1;if(t<0)return this.nextFragment(),null;var n=this.trees[t],r=this.index[t];if(r!=n.children.length){var i=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(i instanceof u.f){if(o==e){if(o<this.safeFrom)return null;var a=o+i.length;if(a<=this.safeTo){var s=i.prop(u.b.lookAhead);if(!s||a+s<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}else this.trees.pop(),this.start.pop(),this.index.pop()}}}]),e}(),E=function(){function e(t,n){Object(l.a)(this,e),this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((function(e){return new v}))}return Object(c.a)(e,[{key:"getActions",value:function(e){for(var t=0,n=null,r=e.p.parser,i=r.tokenizers,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0,l=0;l<i.length;l++)if(0!=(1<<l&o)){var c=i[l],u=this.tokens[l];if((!n||c.fallback)&&((c.contextual||u.start!=e.pos||u.mask!=o||u.context!=a)&&(this.updateCachedToken(u,c,e),u.mask=o,u.context=a),u.lookAhead>u.end+25&&(s=Math.max(u.lookAhead,s)),0!=u.value)){var f=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!c.extend&&(n=u,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new v).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}},{key:"getMainToken",value:function(e){if(this.mainToken)return this.mainToken;var t=new v,n=e.pos,r=e.p;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}},{key:"updateCachedToken",value:function(e,t,n){if(t.token(this.stream.reset(n.pos,e),n),e.value>-1){for(var r=n.p.parser,i=0;i<r.specialized.length;i++)if(r.specialized[i]==e.value){var o=r.specializers[i](this.stream.read(e.start,e.end),n);if(o>=0&&n.p.parser.dialect.allows(o>>1)){0==(1&o)?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=Math.min(n.p.stream.end,n.pos+1)}},{key:"putAction",value:function(e,t,n,r){for(var i=0;i<r;i+=3)if(this.actions[i]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}},{key:"addActions",value:function(e,t,n,r){for(var i=e.state,o=e.p.parser,a=o.data,s=0;s<2;s++)for(var l=o.stateSlot(i,s?2:1);;l+=3){if(65535==a[l]){if(1!=a[l+1]){0==r&&2==a[l+1]&&(r=this.putAction(A(a,l+1),t,n,r));break}l=A(a,l+2)}a[l]==t&&(r=this.putAction(A(a,l+1),t,n,r))}return r}}]),e}();!function(e){e[e.Distance=5]="Distance",e[e.MaxRemainingPerStep=3]="MaxRemainingPerStep",e[e.MinBufferLengthPrune=200]="MinBufferLengthPrune",e[e.ForceReduceLimit=10]="ForceReduceLimit"}(j||(j={}));var C=function(){function e(t,n,r,i){Object(l.a)(this,e),this.parser=t,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.stream=new g(n,i),this.tokens=new E(t,this.stream),this.topTerm=t.top[1];var o=i[0].from;this.stacks=[f.start(this,t.top[0],o)],this.fragments=r.length&&this.stream.end-o>4*t.bufferLength?new S(r,t.nodeSet):null}return Object(c.a)(e,[{key:"parsedPos",get:function(){return this.minStackPos}},{key:"advance",value:function(){for(var e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[],o=0;o<n.length;o++)for(var a=n[o];;){if(this.tokens.mainToken=null,a.pos>r)i.push(a);else{if(this.advanceStack(a,i,n))continue;e||(e=[],t=[]),e.push(a);var l=this.tokens.getMainToken(a);t.push(l.value,l.end)}break}if(!i.length){var c=e&&function(e){var t,n=null,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=o&&i.pos>o)&&i.p.parser.stateFlag(i.state,2)&&(!n||n.score<i.score)&&(n=i)}}catch(a){r.e(a)}finally{r.f()}return n}(e);if(c)return this.stackToTree(c);if(this.parser.strict)throw k&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&e){var u=this.runRecovery(e,t,i);if(u)return this.stackToTree(u.forceAll())}if(this.recovering){var f=1==this.recovering?1:3*this.recovering;if(i.length>f)for(i.sort((function(e,t){return t.score-e.score}));i.length>f;)i.pop();i.some((function(e){return e.reducePos>r}))&&this.recovering--}else if(i.length>1)e:for(var d=0;d<i.length-1;d++)for(var h=i[d],p=d+1;p<i.length;p++){var v=i[p];if(h.sameState(v)||h.buffer.length>200&&v.buffer.length>200){if(!((h.score-v.score||h.buffer.length-v.buffer.length)>0)){i.splice(d--,1);continue e}i.splice(p--,1)}}this.minStackPos=i[0].pos;for(var m=1;m<i.length;m++)i[m].pos<this.minStackPos&&(this.minStackPos=i[m].pos);return null}},{key:"stopAt",value:function(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}},{key:"advanceStack",value:function(e,t,n){var r=e.pos,i=this.parser,o=k?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments)for(var a=e.curContext&&e.curContext.tracker.strict,s=a?e.curContext.hash:0,l=this.fragments.nodeAt(r);l;){var c=this.parser.nodeSet.types[l.type.id]==l.type?i.getGoto(e.state,l.type.id):-1;if(c>-1&&l.length&&(!a||(l.prop(u.b.contextHash)||0)==s))return e.useNode(l,c),k&&console.log(o+this.stackID(e)+" (via reuse of ".concat(i.getName(l.type.id),")")),!0;if(!(l instanceof u.f)||0==l.children.length||l.positions[0]>0)break;var f=l.children[0];if(!(f instanceof u.f&&0==l.positions[0]))break;l=f}var d=i.stateSlot(e.state,4);if(d>0)return e.reduce(d),k&&console.log(o+this.stackID(e)+" (via always-reduce ".concat(i.getName(65535&d),")")),!0;for(var h=this.tokens.getActions(e),p=0;p<h.length;){var v=h[p++],m=h[p++],g=h[p++],y=p==h.length||!n,b=y?e:e.split();if(b.apply(v,m,g),k&&console.log(o+this.stackID(b)+" (via ".concat(0==(65536&v)?"shift":"reduce of ".concat(i.getName(65535&v))," for ").concat(i.getName(m)," @ ").concat(r).concat(b==e?"":", split",")")),y)return!0;b.pos>r?t.push(b):n.push(b)}return!1}},{key:"advanceFully",value:function(e,t){for(var n=e.pos;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return M(e,t),!0}}},{key:"runRecovery",value:function(e,t,n){for(var r=null,i=!1,o=0;o<e.length;o++){var a=e[o],l=t[o<<1],c=t[1+(o<<1)],u=k?this.stackID(a)+" -> ":"";if(a.deadEnd){if(i)continue;if(i=!0,a.restart(),k&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))continue}for(var f=a.split(),d=u,h=0;f.forceReduce()&&h<10;h++){if(k&&console.log(d+this.stackID(f)+" (via force-reduce)"),this.advanceFully(f,n))break;k&&(d=this.stackID(f)+" -> ")}var p,v=Object(s.a)(a.recoverByInsert(l));try{for(v.s();!(p=v.n()).done;){var m=p.value;k&&console.log(u+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,n)}}catch(g){v.e(g)}finally{v.f()}this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),k&&console.log(u+this.stackID(a)+" (via recover-delete ".concat(this.parser.getName(l),")")),M(a,n)):(!r||r.score<a.score)&&(r=a)}return r}},{key:"stackToTree",value:function(e){return e.close(),u.f.build({buffer:p.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}},{key:"stackID",value:function(e){var t=(w||(w=new WeakMap)).get(e);return t||w.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}]),e}();function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];if(r.pos==e.pos&&r.sameState(e))return void(t[n].score<e.score&&(t[n]=e))}t.push(e)}var P=function(){function e(t,n,r){Object(l.a)(this,e),this.source=t,this.flags=n,this.disabled=r}return Object(c.a)(e,[{key:"allows",value:function(e){return!this.disabled||0==this.disabled[e]}}]),e}(),T=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e){var r;if(Object(l.a)(this,n),(r=t.call(this)).wrappers=[],13!=e.version)throw new RangeError("Parser version (".concat(e.version,") doesn't match runtime version (",13,")"));var i=e.nodeNames.split(" ");r.minRepeatTerm=i.length;for(var o=0;o<e.repeatNodeCount;o++)i.push("");for(var a=Object.keys(e.topRules).map((function(t){return e.topRules[t][1]})),c=[],f=0;f<i.length;f++)c.push([]);function d(e,t,n){c[e].push([t,t.deserialize(String(n))])}if(e.nodeProps){var h,p=Object(s.a)(e.nodeProps);try{for(p.s();!(h=p.n()).done;)for(var v=h.value,m=v[0],g=1;g<v.length;){var O=v[g++];if(O>=0)d(O,m,v[g++]);else{for(var k=v[g+-O],w=-O;w>0;w--)d(v[g++],m,k);g++}}}catch(S){p.e(S)}finally{p.f()}}r.nodeSet=new u.c(i.map((function(t,n){return u.d.define({name:n>=r.minRepeatTerm?void 0:t,id:n,props:c[n],top:a.indexOf(n)>-1,error:0==n,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1})}))),r.strict=!1,r.bufferLength=u.a;var x=b(e.tokenData);if(r.context=e.context,r.specialized=new Uint16Array(e.specialized?e.specialized.length:0),r.specializers=[],e.specialized)for(var j=0;j<e.specialized.length;j++)r.specialized[j]=e.specialized[j].term,r.specializers[j]=e.specialized[j].get;return r.states=b(e.states,Uint32Array),r.data=b(e.stateData),r.goto=b(e.goto),r.maxTerm=e.maxTerm,r.tokenizers=e.tokenizers.map((function(e){return"number"==typeof e?new y(x,e):e})),r.topRules=e.topRules,r.dialects=e.dialects||{},r.dynamicPrecedences=e.dynamicPrecedences||null,r.tokenPrecTable=e.tokenPrec,r.termNames=e.termNames||null,r.maxNode=r.nodeSet.types.length-1,r.dialect=r.parseDialect(),r.top=r.topRules[Object.keys(r.topRules)[0]],r}return Object(c.a)(n,[{key:"createParse",value:function(e,t,n){var r,i=new C(this,e,t,n),o=Object(s.a)(this.wrappers);try{for(o.s();!(r=o.n()).done;){i=(0,r.value)(i,e,t,n)}}catch(a){o.e(a)}finally{o.f()}return i}},{key:"getGoto",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.goto;if(t>=r[0])return-1;for(var i=r[t+1];;){var o=r[i++],a=1&o,s=r[i++];if(a&&n)return s;for(var l=i+(o>>1);i<l;i++)if(r[i]==e)return s;if(a)return-1}}},{key:"hasAction",value:function(e,t){for(var n=this.data,r=0;r<2;r++)for(var i,o=this.stateSlot(e,r?2:1);;o+=3){if(65535==(i=n[o])){if(1!=n[o+1]){if(2==n[o+1])return A(n,o+2);break}i=n[o=A(n,o+2)]}if(i==t||0==i)return A(n,o+1)}return 0}},{key:"stateSlot",value:function(e,t){return this.states[6*e+t]}},{key:"stateFlag",value:function(e,t){return(this.stateSlot(e,0)&t)>0}},{key:"validAction",value:function(e,t){if(t==this.stateSlot(e,4))return!0;for(var n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=A(this.data,n+2)}if(t==A(this.data,n+1))return!0}}},{key:"nextStates",value:function(e){for(var t=this,n=[],r=this.stateSlot(e,1);;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=A(this.data,r+2)}0==(1&this.data[r+2])&&function(){var e=t.data[r+1];n.some((function(t,n){return 1&n&&t==e}))||n.push(t.data[r],e)}()}return n}},{key:"overrides",value:function(e,t){var n=D(this.data,this.tokenPrecTable,t);return n<0||D(this.data,this.tokenPrecTable,e)<n}},{key:"configure",value:function(e){var t,r=Object.assign(Object.create(n.prototype),this);if(e.props&&(r.nodeSet=(t=this.nodeSet).extend.apply(t,Object(i.a)(e.props))),e.top){var o=this.topRules[e.top];if(!o)throw new RangeError("Invalid top rule name ".concat(e.top));r.top=o}return e.tokenizers&&(r.tokenizers=this.tokenizers.map((function(t){var n=e.tokenizers.find((function(e){return e.from==t}));return n?n.to:t}))),e.contextTracker&&(r.context=e.contextTracker),e.dialect&&(r.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(r.strict=e.strict),e.wrap&&(r.wrappers=r.wrappers.concat(e.wrap)),null!=e.bufferLength&&(r.bufferLength=e.bufferLength),r}},{key:"getName",value:function(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}},{key:"eofTerm",get:function(){return this.maxNode+1}},{key:"topNode",get:function(){return this.nodeSet.types[this.top[1]]}},{key:"dynamicPrecedence",value:function(e){var t=this.dynamicPrecedences;return null==t?0:t[e]||0}},{key:"parseDialect",value:function(e){var t=Object.keys(this.dialects),n=t.map((function(){return!1}));if(e){var r,i=Object(s.a)(e.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value,a=t.indexOf(o);a>=0&&(n[a]=!0)}}catch(d){i.e(d)}finally{i.f()}}for(var l=null,c=0;c<t.length;c++)if(!n[c])for(var u,f=this.dialects[t[c]];65535!=(u=this.data[f++]);)(l||(l=new Uint8Array(this.maxTerm+1)))[u]=1;return new P(e,n,l)}}],[{key:"deserialize",value:function(e){return new n(e)}}]),n}(u.e);function A(e,t){return e[t]|e[t+1]<<16}function D(e,t,n){for(var r,i=t;65535!=(r=e[i]);i++)if(r==n)return i-t;return-1}}).call(this,n(201))},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"PlayCircleOutline");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"}),"Security");t.default=a},function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,l,"next",e)}function l(e){r(a,i,o,s,l,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy");t.default=a},function(e,t,n){"use strict";var r=n(36),i=n.n(r),o=n(150),a=n.n(o),s=n(151),l=n.n(s);i.a.extend(a.a),i.a.extend(l.a);var c=function(){function e(e){var t=void 0===e?{}:e,n=t.locale,r=t.instance,o=t.dayjs;this.yearFormat="YYYY",this.yearMonthFormat="MMMM YYYY",this.dateTime12hFormat="MMMM Do hh:mm a",this.dateTime24hFormat="MMMM Do HH:mm",this.time12hFormat="hh:mm A",this.time24hFormat="HH:mm",this.dateFormat="MMMM Do",this.dayjs=function(e,t){return t?function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.apply(void 0,n).locale(t)}:e}(r||o||i.a,n),this.locale=n}return e.prototype.parse=function(e,t){return""===e?null:this.dayjs(e,t)},e.prototype.date=function(e){return null===e?null:this.dayjs(e)},e.prototype.isValid=function(e){return this.dayjs(e).isValid()},e.prototype.isNull=function(e){return null===e},e.prototype.getDiff=function(e,t,n,r){return e.diff(t,n,r)},e.prototype.isAfter=function(e,t){return e.isAfter(t)},e.prototype.isBefore=function(e,t){return e.isBefore(t)},e.prototype.isAfterDay=function(e,t){return e.isAfter(t,"day")},e.prototype.isBeforeDay=function(e,t){return e.isBefore(t,"day")},e.prototype.isBeforeYear=function(e,t){return e.isBefore(t,"year")},e.prototype.isAfterYear=function(e,t){return e.isAfter(t,"year")},e.prototype.startOfDay=function(e){return e.clone().startOf("day")},e.prototype.endOfDay=function(e){return e.clone().endOf("day")},e.prototype.format=function(e,t){return this.dayjs(e).format(t)},e.prototype.formatNumber=function(e){return e},e.prototype.getHours=function(e){return e.hour()},e.prototype.addDays=function(e,t){return t<0?e.clone().subtract(Math.abs(t),"day"):e.clone().add(t,"day")},e.prototype.setMonth=function(e,t){return e.clone().set("month",t)},e.prototype.setHours=function(e,t){return e.clone().set("hour",t)},e.prototype.getMinutes=function(e){return e.minute()},e.prototype.setMinutes=function(e,t){return e.clone().set("minute",t)},e.prototype.getSeconds=function(e){return e.second()},e.prototype.setSeconds=function(e,t){return e.clone().set("second",t)},e.prototype.getMonth=function(e){return e.month()},e.prototype.isSameDay=function(e,t){return e.isSame(t,"day")},e.prototype.isSameMonth=function(e,t){return e.isSame(t,"month")},e.prototype.isSameYear=function(e,t){return e.isSame(t,"year")},e.prototype.isSameHour=function(e,t){return e.isSame(t,"hour")},e.prototype.getMeridiemText=function(e){return"am"===e?"AM":"PM"},e.prototype.startOfMonth=function(e){return e.clone().startOf("month")},e.prototype.endOfMonth=function(e){return e.clone().endOf("month")},e.prototype.getNextMonth=function(e){return e.clone().add(1,"month")},e.prototype.getPreviousMonth=function(e){return e.clone().subtract(1,"month")},e.prototype.getMonthArray=function(e){for(var t=[e.clone().startOf("year")];t.length<12;){var n=t[t.length-1];t.push(this.getNextMonth(n))}return t},e.prototype.getMonthText=function(e){return this.format(e,"MMMM")},e.prototype.getYear=function(e){return e.year()},e.prototype.setYear=function(e,t){return e.clone().set("year",t)},e.prototype.mergeDateAndTime=function(e,t){return this.setMinutes(this.setHours(e,this.getHours(t)),this.getMinutes(t))},e.prototype.getWeekdays=function(){var e=this,t=this.dayjs().startOf("week");return[0,1,2,3,4,5,6].map((function(n){return e.format(t.add(n,"day"),"dd")}))},e.prototype.isEqual=function(e,t){return null===e&&null===t||this.dayjs(e).isSame(t)},e.prototype.getWeekArray=function(e){for(var t=this.dayjs(e).clone().startOf("month").startOf("week"),n=this.dayjs(e).clone().endOf("month").endOf("week"),r=0,i=t,o=[];i.isBefore(n);){var a=Math.floor(r/7);o[a]=o[a]||[],o[a].push(i),i=i.clone().add(1,"day"),r+=1}return o},e.prototype.getYearRange=function(e,t){for(var n=this.dayjs(e).startOf("year"),r=this.dayjs(t).endOf("year"),i=[],o=n;o.isBefore(r);)i.push(o),o=o.clone().add(1,"year");return i},e.prototype.getCalendarHeaderText=function(e){return this.format(e,"MMMM YYYY")},e.prototype.getYearText=function(e){return this.format(e,"YYYY")},e.prototype.getDatePickerHeaderText=function(e){return this.format(e,"ddd, MMM D")},e.prototype.getDateTimePickerHeaderText=function(e){return this.format(e,"MMM D")},e.prototype.getDayText=function(e){return this.format(e,"D")},e.prototype.getHourText=function(e,t){return this.format(e,t?"hh":"HH")},e.prototype.getMinuteText=function(e){return this.format(e,"mm")},e.prototype.getSecondText=function(e){return this.format(e,"ss")},e}();t.a=c},function(e,t,n){e.exports=function(){"use strict";var e={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"},t=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^\s\d-_:/()]+/,o={},a=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},f={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,s("month")],MM:[n,s("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.substr(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=a(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};function d(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,l=0;l<s;l+=1){var c=a[l],u=f[c],d=u&&u[0],h=u&&u[1];a[l]=h?{regex:d,parser:h}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if("string"==typeof i)r+=i.length;else{var o=i.regex,l=i.parser,c=e.substr(r),u=o.exec(c)[0];l.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if("string"==typeof s){var l=!0===a[2],c=!0===a[3],u=l||c,f=a[2];c&&(f=a[2]),o=this.$locale(),!l&&f&&(o=n.Ls[f]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=d(t)(e),i=r.year,o=r.month,a=r.day,s=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,f=r.zone,h=new Date,p=a||(i||o?1:h.getDate()),v=i||h.getFullYear(),m=0;i&&!o||(m=o>0?o-1:h.getMonth());var g=s||0,y=l||0,b=c||0,O=u||0;return f?new Date(Date.UTC(v,m,p,g,y,b,O+60*f.offset*1e3)):n?new Date(Date.UTC(v,m,p,g,y,b,O)):new Date(v,m,p,g,y,b,O)}catch(e){return new Date("")}}(t,s,r),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),u&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var h=s.length,p=1;p<=h;p+=1){a[1]=s[p-1];var v=n.apply(this,a);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}p===h&&(this.$d=new Date(""))}else i.call(this,e)}}}()},function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){var r=t.prototype,i=r.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},r.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return i.bind(this)(e);var r=this.$utils(),o=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return i.bind(this)(o)}}}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return ce}));var r,i,o=n(5),a=n(6),s=n(141),l=29,c=39,u=123,f=126,d=128,h=129,p=132,v=135,m=136,g=138,y={inf:146,nan:147,bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},b={avg:8,atan2:7,bottomk:9,count:10,count_values:11,group:12,max:13,min:14,quantile:15,stddev:16,stdvar:17,sum:18,topk:19,by:20,without:21,and:22,or:23,unless:24,start:25,end:26},O={__proto__:null,absent_over_time:307,absent:309,abs:311,acos:313,acosh:315,asin:317,asinh:319,atan:321,atanh:323,avg_over_time:325,ceil:327,changes:329,clamp:331,clamp_max:333,clamp_min:335,cos:337,cosh:339,count_over_time:341,days_in_month:343,day_of_month:345,day_of_week:347,deg:349,delta:351,deriv:353,exp:355,floor:357,histogram_quantile:359,holt_winters:361,hour:363,idelta:365,increase:367,irate:369,label_replace:371,label_join:373,last_over_time:375,ln:377,log10:379,log2:381,max_over_time:383,min_over_time:385,minute:387,month:389,pi:391,predict_linear:393,present_over_time:395,quantile_over_time:397,rad:399,rate:401,resets:403,round:405,scalar:407,sgn:409,sin:411,sinh:413,sort:415,sort_desc:417,sqrt:419,stddev_over_time:421,stdvar_over_time:423,sum_over_time:425,tan:427,tanh:429,timestamp:431,time:433,vector:435,year:437},k=s.a.deserialize({version:13,states:"6[OYQPOOO&{QPOOOOQO'#C{'#C{O'QQPO'#CzQ']QQOOOOQO'#De'#DeO'WQPO'#DdOOQO'#E}'#E}O(jQPO'#FTOYQPO'#FPOYQPO'#FSOOQO'#FV'#FVO.fQSO'#FWO.nQQO'#FUOOQO'#FU'#FUOOQO'#Cy'#CyOOQO'#Df'#DfOOQO'#Dh'#DhOOQO'#Di'#DiOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOOQO'#Dm'#DmOOQO'#Dn'#DnOOQO'#Do'#DoOOQO'#Dp'#DpOOQO'#Dq'#DqOOQO'#Dr'#DrOOQO'#Ds'#DsOOQO'#Dt'#DtOOQO'#Du'#DuOOQO'#Dv'#DvOOQO'#Dw'#DwOOQO'#Dx'#DxOOQO'#Dy'#DyOOQO'#Dz'#DzOOQO'#D{'#D{OOQO'#D|'#D|OOQO'#D}'#D}OOQO'#EO'#EOOOQO'#EP'#EPOOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETOOQO'#EU'#EUOOQO'#EV'#EVOOQO'#EW'#EWOOQO'#EX'#EXOOQO'#EY'#EYOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#E]'#E]OOQO'#E^'#E^OOQO'#E_'#E_OOQO'#E`'#E`OOQO'#Ea'#EaOOQO'#Eb'#EbOOQO'#Ec'#EcOOQO'#Ed'#EdOOQO'#Ee'#EeOOQO'#Ef'#EfOOQO'#Eg'#EgOOQO'#Eh'#EhOOQO'#Ei'#EiOOQO'#Ej'#EjOOQO'#Ek'#EkOOQO'#El'#ElOOQO'#Em'#EmOOQO'#En'#EnOOQO'#Eo'#EoOOQO'#Ep'#EpOOQO'#Eq'#EqOOQO'#Er'#ErOOQO'#Es'#EsOOQO'#Et'#EtOOQO'#Eu'#EuOOQO'#Ev'#EvOOQO'#Ew'#EwOOQO'#Ex'#ExOOQO'#Ey'#EyOOQO'#Ez'#EzQOQPOOO0XQPO'#C|O0^QPO'#DRO'WQPO,59fO0eQQO,59fO2RQPO,59oO2RQPO,59oO2RQPO,59oO2RQPO,59oO2RQPO,59oO7}QQO,5;gO8SQQO,5;jO8[QPO,5;yOOQO,5:O,5:OOOQO,5;i,5;iO8sQQO,5;kO8zQQO,5;nO:bQPO'#FYO:pQPO,5;rOOQO'#FX'#FXOOQO,5;r,5;rOOQO,5;p,5;pO:xQSO'#C}OOQO,59h,59hO;QQPO,59mO;YQQO'#DSOOQO,59m,59mOOQO1G/Q1G/QO0XQPO'#DWOAVQPO'#DVOAaQPO'#DVOYQPO1G/ZOYQPO1G/ZOYQPO1G/ZOYQPO1G/ZOYQPO1G/ZOAkQSO1G1ROOQO1G1U1G1UOAsQQO1G1UOAxQPO'#E}OOQO'#Fa'#FaOOQO1G1e1G1eOBTQPO1G1eOOQO1G1V1G1VOOQO'#FZ'#FZOBYQPO,5;tOB_QSO1G1^OOQO1G1^1G1^OOQO'#DP'#DPOBgQPO,59iOOQO'#DO'#DOOOQO,59i,59iOYQPO,59nOOQO1G/X1G/XOOQO,59r,59rOH_QPO,59qOHfQPO,59qOI}QQO7+$uOJ_QQO7+$uOKsQQO7+$uOLZQQO7+$uOMrQQO7+$uOOQO7+&m7+&mON]QQO7+&sOOQO7+&p7+&pONeQPO7+'POOQO1G1`1G1`OOQO1G1_1G1_OOQO7+&x7+&xONjQSO1G/TOOQO1G/T1G/TONrQQO1G/YOOQO1G/]1G/]ON|QPO1G/]OOQO<<J_<<J_O!&oQPO<<J_OOQO<<Jk<<JkOOQO1G/U1G/UOOQO7+$o7+$oOOQO7+$w7+$wOOQOAN?yAN?y",stateData:"!&t~O$ZOSkOS~OWQOXQOYQOZQO[QO]QO^QO_QO`QOaQObQOcQO!ZZO#t_O$WVO$XVO$[XO$_`O$`aO$abO$bcO$cdO$deO$efO$fgO$ghO$hiO$ijO$jkO$klO$lmO$mnO$noO$opO$pqO$qrO$rsO$stO$tuO$uvO$vwO$wxO$xyO$yzO$z{O${|O$|}O$}!OO%O!PO%P!QO%Q!RO%R!SO%S!TO%T!UO%U!VO%V!WO%W!XO%X!YO%Y!ZO%Z![O%[!]O%]!^O%^!_O%_!`O%`!aO%a!bO%b!cO%c!dO%d!eO%e!fO%f!gO%g!hO%h!iO%i!jO%j!kO%k!lO%l!mO%m!nO%n!oO%o!pO%p!qO%q!rO%r!sO%uWO%vWO%wVO%y[O~O!ZZO~Od!uOe!uO$[!vO~OU#POV!yOf!|Og!}Oh!|Ox!yO{!yO|!yO}!yO!O!zO!P!zO!Q!{O!R!{O!S!{O!T!{O!U!{O!V!{O$S#QO%s#OO~O$W#SO$X#SO%w#SOW#wXX#wXY#wXZ#wX[#wX]#wX^#wX_#wX`#wXa#wXb#wXc#wX!Z#wX#t#wX$W#wX$X#wX$[#wX$_#wX$`#wX$a#wX$b#wX$c#wX$d#wX$e#wX$f#wX$g#wX$h#wX$i#wX$j#wX$k#wX$l#wX$m#wX$n#wX$o#wX$p#wX$q#wX$r#wX$s#wX$t#wX$u#wX$v#wX$w#wX$x#wX$y#wX$z#wX${#wX$|#wX$}#wX%O#wX%P#wX%Q#wX%R#wX%S#wX%T#wX%U#wX%V#wX%W#wX%X#wX%Y#wX%Z#wX%[#wX%]#wX%^#wX%_#wX%`#wX%a#wX%b#wX%c#wX%d#wX%e#wX%f#wX%g#wX%h#wX%i#wX%j#wX%k#wX%l#wX%m#wX%n#wX%o#wX%p#wX%q#wX%r#wX%u#wX%v#wX%w#wX%y#wX~Ot#VO%z#YO~O%y[OU#xXV#xXf#xXg#xXh#xXx#xX{#xX|#xX}#xX!O#xX!P#xX!Q#xX!R#xX!S#xX!T#xX!U#xX!V#xX$S#xX$V#xX%s#xX$^#xX$]#xX~O$[#[O~O$^#`O~PYOd!uOe!uOUnaVnafnagnahnaxna{na|na}na!Ona!Pna!Qna!Rna!Sna!Tna!Una!Vna$Sna$Vna%sna$^na$]na~OP#dOQ#bOR#bOWyPXyPYyPZyP[yP]yP^yP_yP`yPayPbyPcyP!ZyP#tyP$WyP$XyP$[yP$_yP$`yP$ayP$byP$cyP$dyP$eyP$fyP$gyP$hyP$iyP$jyP$kyP$lyP$myP$nyP$oyP$pyP$qyP$ryP$syP$tyP$uyP$vyP$wyP$xyP$yyP$zyP${yP$|yP$}yP%OyP%PyP%QyP%RyP%SyP%TyP%UyP%VyP%WyP%XyP%YyP%ZyP%[yP%]yP%^yP%_yP%`yP%ayP%byP%cyP%dyP%eyP%fyP%gyP%hyP%iyP%jyP%kyP%lyP%myP%nyP%oyP%pyP%qyP%ryP%uyP%vyP%wyP%yyP~O#p#jO~O!P#lO#p#kO~Oi#nOj#nO$WVO$XVO%u#mO%v#mO%wVO~O$^#qO~P']Ox!yOU#vaV#vaf#vag#vah#va{#va|#va}#va!O#va!P#va!Q#va!R#va!S#va!T#va!U#va!V#va$S#va$V#va%s#va$^#va$]#va~O!V#rO$O#rO$P#rO$Q#rO~O$]#tO%z#uO~Ot#vO$^#yO~O$]#zO$^#{O~O$]vX$^vX~P']OWyXXyXYyXZyX[yX]yX^yX_yX`yXayXbyXcyX!ZyX#tyX$WyX$XyX$[yX$_yX$`yX$ayX$byX$cyX$dyX$eyX$fyX$gyX$hyX$iyX$jyX$kyX$lyX$myX$nyX$oyX$pyX$qyX$ryX$syX$tyX$uyX$vyX$wyX$xyX$yyX$zyX${yX$|yX$}yX%OyX%PyX%QyX%RyX%SyX%TyX%UyX%VyX%WyX%XyX%YyX%ZyX%[yX%]yX%^yX%_yX%`yX%ayX%byX%cyX%dyX%eyX%fyX%gyX%hyX%iyX%jyX%kyX%lyX%myX%nyX%oyX%pyX%qyX%ryX%uyX%vyX%wyX%yyX~OS#}OT#}O~P;dOQ#bOR#bO~P;dO%t$UO%x$VO~O#p$WO~O$W#SO$X#SO%w#SO~O$[$XO~O#t$YO~Ot#VO%z$[O~O$]$]O$^$^O~OWyaXyaYyaZya[ya]ya^ya_ya`yaayabyacya!Zya#tya$Wya$Xya$_ya$`ya$aya$bya$cya$dya$eya$fya$gya$hya$iya$jya$kya$lya$mya$nya$oya$pya$qya$rya$sya$tya$uya$vya$wya$xya$yya$zya${ya$|ya$}ya%Oya%Pya%Qya%Rya%Sya%Tya%Uya%Vya%Wya%Xya%Yya%Zya%[ya%]ya%^ya%_ya%`ya%aya%bya%cya%dya%eya%fya%gya%hya%iya%jya%kya%lya%mya%nya%oya%pya%qya%rya%uya%vya%wya%yya~O$[#[O~PBoOS$aOT$aO$[ya~PBoOx!yOUwqfwqgwqhwq!Owq!Pwq!Qwq!Rwq!Swq!Twq!Uwq!Vwq$Swq$Vwq%swq$^wq$]wq~OVwq{wq|wq}wq~PHsOV!yO{!yO|!yO}!yO~PHsOV!yOx!yO{!yO|!yO}!yO!O!zO!P!zOUwqfwqgwqhwq$Swq$Vwq%swq$^wq$]wq~O!Qwq!Rwq!Swq!Twq!Uwq!Vwq~PJoO!Q!{O!R!{O!S!{O!T!{O!U!{O!V!{O~PJoOV!yOf!|Oh!|Ox!yO{!yO|!yO}!yO!O!zO!P!zO!Q!{O!R!{O!S!{O!T!{O!U!{O!V!{O~OUwqgwq$Swq$Vwq%swq$^wq$]wq~PLqO#p$cO%t$bO~O$^$dO~Ot#vO$^$fO~O$]vi$^vi~P']O$[#[OWyiXyiYyiZyi[yi]yi^yi_yi`yiayibyicyi!Zyi#tyi$Wyi$Xyi$_yi$`yi$ayi$byi$cyi$dyi$eyi$fyi$gyi$hyi$iyi$jyi$kyi$lyi$myi$nyi$oyi$pyi$qyi$ryi$syi$tyi$uyi$vyi$wyi$xyi$yyi$zyi${yi$|yi$}yi%Oyi%Pyi%Qyi%Ryi%Syi%Tyi%Uyi%Vyi%Wyi%Xyi%Yyi%Zyi%[yi%]yi%^yi%_yi%`yi%ayi%byi%cyi%dyi%eyi%fyi%gyi%hyi%iyi%jyi%kyi%lyi%myi%nyi%oyi%pyi%qyi%ryi%uyi%vyi%wyi%yyi~O%t$hO~O",goto:"(u$UPPPPPPPPPPPPPPPPPPPPPPPPPPPPP$V$u%R%_%e%q%tP%z&T$uP&W&gPPPPPPPPPPP$u&q&}P&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}$uP'Z$u$uP$u$u'j$u'v(V(f(i(oPPP$uP(rQSOQ#TXQ#UYQ#_!vQ$P#eQ$Q#fQ$R#gQ$S#hQ$T#iR$_#ze_OXY!v#e#f#g#h#i#zeROXY!v#e#f#g#h#i#zQ!wRR#a!xQ#]!uQ#|#bQ$`#}R$g$aR#w#[Q#x#[R$e$]Q!xRQ#RUR#a!wR#^!vQ#e!yQ#f!zQ#g!{Q#h!|R#i!}Y#c!y!z!{!|!}R$O#deUOXY!v#e#f#g#h#i#zeTOXY!v#e#f#g#h#i#zd_OXY!v#e#f#g#h#i#zR#o#QeYOXY!v#e#f#g#h#i#zd]OXY!v#e#f#g#h#i#zR!tPd^OXY!v#e#f#g#h#i#zR#Z]R#W[Q#X[R$Z#tR#s#VR#p#Q",nodeNames:"\u26a0 Bool Ignoring On GroupLeft GroupRight Offset Atan2 Avg Bottomk Count CountValues Group Max Min Quantile Stddev Stdvar Sum Topk By Without And Or Unless Start End LineComment PromQL Expr AggregateExpr AggregateOp AggregateModifier GroupingLabels GroupingLabelList GroupingLabel LabelName FunctionCallBody FunctionCallArgs BinaryExpr Pow BinModifiers OnOrIgnoring Mul Div Mod Add Sub Eql Gte Gtr Lte Lss Neq FunctionCall FunctionIdentifier AbsentOverTime Identifier Absent Abs Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek Deg Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Timestamp Time Vector Year MatrixSelector Duration NumberLiteral OffsetExpr ParenExpr StringLiteral SubqueryExpr UnaryExpr UnaryOp VectorSelector MetricIdentifier LabelMatchers LabelMatchList LabelMatcher MatchOp EqlSingle EqlRegex NeqRegex StepInvariantExpr At AtModifierPreprocessors MetricName",maxTerm:226,skippedNodes:[0,27],repeatNodeCount:0,tokenData:"1R~RwX^#lpq#lqr$ars$tst%huv%swx%xxy&gyz&lz{&q{|&v|}&}}!O'S!O!P'Z!P!Q(Z!Q!R(`!R![)W![!]-r!^!_.n!_!`.{!`!a/b!b!c/o!c!}/t!}#O0[#P#Q0a#Q#R0f#R#S/t#S#T0k#T#o/t#o#p0w#q#r0|#y#z#l$f$g#l#BY#BZ#l$IS$I_#l$I|$JO#l$JT$JU#l$KV$KW#l&FU&FV#l~#qY$Z~X^#lpq#l#y#z#l$f$g#l#BY#BZ#l$IS$I_#l$I|$JO#l$JT$JU#l$KV$KW#l&FU&FV#l~$dQ!_!`$j#r#s$o~$oO!V~~$tO$Q~~$yU#t~OY$tZr$trs%]s#O$t#O#P%b#P~$t~%bO#t~~%ePO~$t~%mQk~OY%hZ~%h~%xO}~~%}U#t~OY%xZw%xwx%]x#O%x#O#P&a#P~%x~&dPO~%x~&lO$[~~&qO$^~~&vO{~R&}O%vP!OQ~'SO$]~R'ZO%uP!PQP'^P!Q!['aP'fR%wP!Q!['a!g!h'o#X#Y'oP'rR{|'{}!O'{!Q![(RP(OP!Q![(RP(WP%wP!Q![(R~(`O|~R(eZ%wP!O!P'a!Q![)W!g!h'o#W#X){#X#Y'o#[#]*d#a#b*x#g#h+l#k#l+}#l#m-W#m#n,iR)]Y%wP!O!P'a!Q![)W!g!h'o#W#X){#X#Y'o#[#]*d#a#b*x#g#h+l#k#l+}#m#n,iQ*QP#pQ!Q![*TQ*WS!Q![*T#[#]*d#a#b*x#g#h+lQ*iP#pQ!Q![*lQ*oR!Q![*l#a#b*x#g#h+lQ*}Q#pQ!Q![+T#g#h+gQ+WR!Q![+T#a#b+a#g#h+lQ+dP#g#h+gQ+lO#pQQ+qP#pQ!Q![+tQ+wQ!Q![+t#a#b+aQ,SP#pQ!Q![,VQ,YT!Q![,V#W#X){#[#]*d#a#b*x#g#h+lQ,nP#pQ!Q![,qQ,tU!Q![,q#W#X){#[#]*d#a#b*x#g#h+l#k#l+}P-ZR!Q![-d!c!i-d#T#Z-dP-iR%wP!Q![-d!c!i-d#T#Z-dV-yT%xS!ZR!Q![.Y![!].Y!c!}.Y#R#S.Y#T#o.YR._T!ZR!Q![.Y![!].Y!c!}.Y#R#S.Y#T#o.Y~.sP!U~!_!`.v~.{O!T~~/QQ$OP!_!`/W#r#s/]Q/]O!QQ~/bO$P~~/gP!S~!_!`/j~/oO!R~~/tO$S~V/{T!ZRtS!Q![/t![!].Y!c!}/t#R#S/t#T#o/t~0aO%s~~0fO%t~~0kOx~~0nRO#S0k#S#T%]#T~0k~0|O%y~~1RO%z~",tokenizers:[0,1,2],topRules:{PromQL:[0,28],MetricName:[1,144]},specialized:[{term:57,get:function(e,t){return function(e,t){return y[e.toLowerCase()]||-1}(e)<<1}},{term:57,get:function(e,t){return function(e,t){return b[e.toLowerCase()]||-1}(e)<<1|1}},{term:57,get:function(e){return O[e]||-1}}],tokenPrec:0}),w=n(32),x=n(13),j=n(3),S=n(25),E=n(14);!function(e){e.none="none",e.vector="vector",e.scalar="scalar",e.matrix="matrix",e.string="string"}(i||(i={}));var C=(r={},Object(E.a)(r,59,{name:"abs",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,58,{name:"absent",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,56,{name:"absent_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,60,{name:"acos",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,61,{name:"acosh",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,62,{name:"asin",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,63,{name:"asinh",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,64,{name:"atan",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,65,{name:"atanh",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,66,{name:"avg_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,67,{name:"ceil",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,68,{name:"changes",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,69,{name:"clamp",argTypes:[i.vector,i.scalar,i.scalar],variadic:0,returnType:i.vector}),Object(E.a)(r,70,{name:"clamp_max",argTypes:[i.vector,i.scalar],variadic:0,returnType:i.vector}),Object(E.a)(r,71,{name:"clamp_min",argTypes:[i.vector,i.scalar],variadic:0,returnType:i.vector}),Object(E.a)(r,72,{name:"cos",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,73,{name:"Cosh",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,74,{name:"count_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,75,{name:"days_in_month",argTypes:[i.vector],variadic:1,returnType:i.vector}),Object(E.a)(r,76,{name:"day_of_month",argTypes:[i.vector],variadic:1,returnType:i.vector}),Object(E.a)(r,77,{name:"day_of_week",argTypes:[i.vector],variadic:1,returnType:i.vector}),Object(E.a)(r,78,{name:"deg",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,79,{name:"delta",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,80,{name:"deriv",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,81,{name:"exp",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,82,{name:"floor",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,83,{name:"histogram_quantile",argTypes:[i.scalar,i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,84,{name:"holt_winters",argTypes:[i.matrix,i.scalar,i.scalar],variadic:0,returnType:i.vector}),Object(E.a)(r,85,{name:"hour",argTypes:[i.vector],variadic:1,returnType:i.vector}),Object(E.a)(r,86,{name:"idelta",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,87,{name:"increase",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,88,{name:"irate",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,89,{name:"label_replace",argTypes:[i.vector,i.string,i.string,i.string,i.string],variadic:0,returnType:i.vector}),Object(E.a)(r,90,{name:"label_join",argTypes:[i.vector,i.string,i.string,i.string],variadic:-1,returnType:i.vector}),Object(E.a)(r,91,{name:"last_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,92,{name:"ln",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,93,{name:"log10",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,94,{name:"log2",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,95,{name:"max_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,96,{name:"min_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,97,{name:"minute",argTypes:[i.vector],variadic:1,returnType:i.vector}),Object(E.a)(r,98,{name:"month",argTypes:[i.vector],variadic:1,returnType:i.vector}),Object(E.a)(r,99,{name:"pi",argTypes:[],variadic:0,returnType:i.vector}),Object(E.a)(r,100,{name:"predict_linear",argTypes:[i.matrix,i.scalar],variadic:0,returnType:i.vector}),Object(E.a)(r,101,{name:"present_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,102,{name:"quantile_over_time",argTypes:[i.scalar,i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,103,{name:"rad",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,104,{name:"rate",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,105,{name:"resets",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,106,{name:"round",argTypes:[i.vector,i.scalar],variadic:1,returnType:i.vector}),Object(E.a)(r,107,{name:"scalar",argTypes:[i.vector],variadic:0,returnType:i.scalar}),Object(E.a)(r,108,{name:"sgn",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,109,{name:"sin",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,110,{name:"Sinh",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,111,{name:"sort",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,112,{name:"sort_desc",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,113,{name:"sqrt",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,114,{name:"stddev_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,115,{name:"stdvar_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,116,{name:"sum_over_time",argTypes:[i.matrix],variadic:0,returnType:i.vector}),Object(E.a)(r,117,{name:"tan",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,118,{name:"tanh",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,120,{name:"time",argTypes:[],variadic:0,returnType:i.scalar}),Object(E.a)(r,119,{name:"timestamp",argTypes:[i.vector],variadic:0,returnType:i.vector}),Object(E.a)(r,121,{name:"vector",argTypes:[i.scalar],variadic:0,returnType:i.vector}),Object(E.a)(r,122,{name:"year",argTypes:[i.vector],variadic:1,returnType:i.vector}),r);function M(e){return C[e]}var P,T=function(){function e(t,n,r){Object(o.a)(this,e),this.type=t,this.name=n,this.value=r}return Object(a.a)(e,[{key:"matchesEmpty",value:function(){switch(this.type){case g:return""===this.value;case 53:return""!==this.value;default:return!1}}}]),e}();function A(e,t){var n=[];return e.forEach((function(e){n.push(function(e,t){var n=new T(0,"",""),r=e.cursor;if(!r.next())return n;do{switch(r.type.id){case 36:n.name=t.sliceDoc(r.from,r.to);break;case 137:var i=r.node.firstChild;i&&(n.type=i.type.id);break;case d:n.value=t.sliceDoc(r.from,r.to).slice(1,-1)}}while(r.nextSibling());return n}(e,t))})),n}function D(e,t,n){if(!t||0===t.length)return e;var r,i="",o=Object(j.a)(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.name!==n&&""!==a.value){var s="";switch(a.type){default:s="=";break;case 53:s="!=";break;case 140:s="!~";break;case 139:s="=~"}var l="".concat(a.name).concat(s,'"').concat(a.value,'"');i=""===i?l:"".concat(i,",").concat(l)}}}catch(c){o.e(c)}finally{o.f()}return"".concat(e,"{").concat(i,"}")}function R(e,t){for(var n=e.cursor,r=!0;r&&n.type.id!==t;)r=n.parent();return n.type.id===t?n.node:null}function N(e){for(var t=e.cursor,n=0,r=!0,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];for(o.unshift(t.type.id);n<o.length&&r;)t.type.id===o[n]||t.type.name===o[n]?++n<o.length&&(r=t.next()):r=t.nextSibling();return n>=o.length?t.node:null}function _(e){var t=e.cursor;if(!t.next())return!1;for(var n=!1,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];do{n=i.some((function(e){return t.type.id===e||t.type.name===e}))}while(!n&&t.nextSibling());return n}function L(e){var t=e.cursor;if(!t.next())return!1;for(var n=0,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];do{t.type.id!==i[n]&&t.type.name!==i[n]||n++}while(n<i.length&&t.nextSibling());return n>=i.length}function I(e,t,n){var r=[];return function e(r,i){var o=null===r||void 0===r?void 0:r.getChild(t),a=null===r||void 0===r?void 0:r.lastChild;o&&o.type.id===t&&e(o,i),a&&a.type.id===n&&i.push(a)}(e,r),r}function $(e){var t;if(!e)return i.none;switch(e.type.id){case l:case f:return $(e.firstChild);case 30:case p:return i.vector;case d:return i.string;case 125:return i.scalar;case u:case h:return i.matrix;case 127:case 130:case 141:return $(N(e,l));case c:var n=$(e.firstChild),r=$(e.lastChild);return n===i.scalar&&r===i.scalar?i.scalar:i.vector;case 54:var o=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;return o?M(o.type.id).returnType:i.none;default:return i.none}}!function(e){e.CardOneToOne="one-to-one",e.CardManyToOne="many-to-one",e.CardOneToMany="one-to-many",e.CardManyToMany="many-to-many"}(P||(P={}));var z=n(21);var B,F=function(){function e(t){Object(o.a)(this,e),this.tree=Object(z.j)(t),this.state=t,this.diagnostics=[]}return Object(a.a)(e,[{key:"getDiagnostics",value:function(){return this.diagnostics.sort((function(e,t){return e.from-t.from}))}},{key:"analyze",value:function(){this.checkAST(this.tree.topNode.firstChild),this.diagnoseAllErrorNodes()}},{key:"diagnoseAllErrorNodes",value:function(){for(var e=this.tree.cursor();e.next();)if(0===e.type.id&&e.to!==this.tree.topNode.to){var t=e.node.parent;this.diagnostics.push({severity:"error",message:"unexpected expression",from:t?t.from:e.from,to:t?t.to:e.to})}}},{key:"checkAST",value:function(e){if(!e)return i.none;switch(e.type.id){case l:return this.checkAST(e.firstChild);case 30:this.checkAggregationExpr(e);break;case c:this.checkBinaryExpr(e);break;case 54:this.checkCallFunction(e);break;case 127:case u:this.checkAST(N(e,l));break;case 130:var t=this.checkAST(N(e,l));t!==i.scalar&&t!==i.vector&&this.addDiagnostic(e,"unary expression only allowed on expressions of type scalar or instant vector, got ".concat(t));break;case h:var n=this.checkAST(N(e,l));n!==i.vector&&this.addDiagnostic(e,"subquery is only allowed on instant vector, got ".concat(n," in ").concat(e.name," instead"));break;case p:this.checkVectorSelector(e);break;case 141:var r=this.checkAST(N(e,l));r!==i.vector&&r!==i.matrix&&this.addDiagnostic(e,"@ modifier must be preceded by an instant selector vector or range vector selector or a subquery")}return $(e)}},{key:"checkAggregationExpr",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=N(e,37,38,l);if(r){this.expectType(r,i.vector,"aggregation expression");var o=N(e,37,38,38,l);if(19===n.type.id||9===n.type.id||15===n.type.id){if(!o)return void this.addDiagnostic(e,"no parameter found");this.expectType(o,i.scalar,"aggregation parameter")}if(11===n.type.id){if(!o)return void this.addDiagnostic(e,"no parameter found");this.expectType(o,i.string,"aggregation parameter")}}else this.addDiagnostic(e,"unable to find the parameter for the expression")}else this.addDiagnostic(e,"aggregation operator expected in aggregation expression but got nothing")}},{key:"checkBinaryExpr",value:function(e){var t=e.firstChild,n=e.lastChild;if(t&&n){var r=this.checkAST(t),o=this.checkAST(n),a=N(e,41,1),s=_(e,48,53,51,52,49,50),l=_(e,22,23,24);a?s||this.addDiagnostic(e,"bool modifier can only be used on comparison operators"):s&&r===i.scalar&&o===i.scalar&&this.addDiagnostic(e,"comparisons between scalars must use BOOL modifier");var u=function(e,t){if(!t||t.type.id!==c)return null;var n={card:P.CardOneToOne,matchingLabels:[],on:!1,include:[]},r=t.getChild(41);if(r){var i=r.getChild(42);if(i){n.on=null!==i.getChild(3);var o=I(i.getChild(33),34,35);if(o.length>0){var a,s=Object(j.a)(o);try{for(s.s();!(a=s.n()).done;){var l=a.value;n.matchingLabels.push(e.sliceDoc(l.from,l.to))}}catch(m){s.e(m)}finally{s.f()}}}var u=r.getChild(4),f=r.getChild(5);if(u||f){n.card=u?P.CardManyToOne:P.CardOneToMany;var d=I(r.getChild(33),34,35);if(d.length>0){var h,p=Object(j.a)(d);try{for(p.s();!(h=p.n()).done;){var v=h.value;n.include.push(e.sliceDoc(v.from,v.to))}}catch(m){p.e(m)}finally{p.f()}}}}return _(t,22,23,24)&&n.card===P.CardOneToOne&&(n.card=P.CardManyToMany),n}(this.state,e);if(null!==u&&u.on){var f,d=Object(j.a)(u.matchingLabels);try{for(d.s();!(f=d.n()).done;){var h,p=f.value,v=Object(j.a)(u.include);try{for(v.s();!(h=v.n()).done;){p===h.value&&this.addDiagnostic(e,'label "'.concat(p,'" must not occur in ON and GROUP clause at once'))}}catch(m){v.e(m)}finally{v.f()}}}catch(m){d.e(m)}finally{d.f()}}r!==i.scalar&&r!==i.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),o!==i.scalar&&o!==i.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),r===i.vector&&o===i.vector||null===u?l&&((null===u||void 0===u?void 0:u.card)!==P.CardOneToMany&&(null===u||void 0===u?void 0:u.card)!==P.CardManyToOne||this.addDiagnostic(e,"no grouping allowed for set operations"),(null===u||void 0===u?void 0:u.card)!==P.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")):u.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"),r!==i.scalar&&o!==i.scalar||!l||this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}else this.addDiagnostic(e,"left or right expression is missing in binary expression")}},{key:"checkCallFunction",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=I(N(e,37),38,l),i=M(n.type.id),o=i.argTypes.length;if(0===i.variadic)r.length!==o&&this.addDiagnostic(e,"expected ".concat(o,' argument(s) in call to "').concat(i.name,'", got ').concat(r.length));else{var a=o-1;if(a>r.length)this.addDiagnostic(e,"expected at least ".concat(a,' argument(s) in call to "').concat(i.name,'", got ').concat(r.length));else{var s=a+i.variadic;i.variadic>0&&s<r.length&&this.addDiagnostic(e,"expected at most ".concat(s,' argument(s) in call to "').concat(i.name,'", got ').concat(r.length))}}for(var c=0,u=0;u<r.length;u++){if((c=u)>=i.argTypes.length){if(0===i.variadic)break;c=i.argTypes.length-1}this.expectType(r[u],i.argTypes[c],'call to function "'.concat(i.name,'"'))}}else this.addDiagnostic(e,"function not defined")}},{key:"checkVectorSelector",value:function(e){var t=A(I(N(e,134,v),v,m),this.state),n="",r=N(e,133,57);if(r&&(n=this.state.sliceDoc(r.from,r.to)),""!==n){var i=t.find((function(e){return"__name__"===e.name}));i&&this.addDiagnostic(e,"metric name must not be set twice: ".concat(n," or ").concat(i.value)),t.push(new T(g,"__name__",n))}t.every((function(e){return e.matchesEmpty()}))&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}},{key:"expectType",value:function(e,t,n){var r=this.checkAST(e);r!==t&&this.addDiagnostic(e,"expected type ".concat(t," in ").concat(n,", got ").concat(r))}},{key:"addDiagnostic",value:function(e,t){this.diagnostics.push({severity:"error",message:t,from:e.from,to:e.to})}}]),e}(),W=n(60),V=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"},{label:"=="},{label:">="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"atan2"},{label:"and"},{label:"or"},{label:"unless"}],H=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate \u03c6-quantile (0 \u2264 \u03c6 \u2264 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],Q=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:Object(W.c)("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:Object(W.c)("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:Object(W.c)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')},{label:"topk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Largest k elements by sample value",apply:Object(W.c)("topk(${__rank_number__}, ${__input_vector__})")},{label:"bottomk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Smallest k elements by sample value",apply:Object(W.c)("bottomk(${__rank_number__}, ${__input_vector__})")},{label:'count_values("__label_name__", __input_vector__)',type:"function",detail:"snippet",info:"Count the number of series per distinct sample value",apply:Object(W.c)('count_values("${__label_name__}", ${__metric__})')}],q={matchOp:[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],binOp:V,duration:[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],binOpModifier:[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"}],atModifier:[{label:"start()",info:"resolve to the start of the query",type:"keyword"},{label:"end()",info:"resolve to the end of the query",type:"keyword"}],functionIdentifier:[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"acos",detail:"function",info:"Calculate the arccosine, in radians, for input series",type:"function"},{label:"acosh",detail:"function",info:"Calculate the inverse hyperbolic cosine, in radians, for input series",type:"function"},{label:"asin",detail:"function",info:"Calculate the arcsine, in radians, for input series",type:"function"},{label:"asinh",detail:"function",info:"Calculate the inverse hyperbolic sine, in radians, for input series",type:"function"},{label:"atan",detail:"function",info:"Calculate the arctangent, in radians, for input series",type:"function"},{label:"atanh",detail:"function",info:"Calculate the inverse hyperbolic tangent, in radians, for input series",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp",detail:"function",info:"Limit the value of input series between a minimum and a maximum",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"cos",detail:"function",info:"Calculate the cosine, in radians, for input series",type:"function"},{label:"cosh",detail:"function",info:"Calculate the hyperbolic cosine, in radians, for input series",type:"function"},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"deg",detail:"function",info:"Convert radians to degrees for input series",type:"function"},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from histogram buckets",type:"function"},{label:"holt_winters",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"last_over_time",detail:"function",info:"The most recent point value in specified interval.",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"pi",detail:"function",info:"Return pi",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"present_over_time",detail:"function",info:"the value 1 for any series in the specified interval",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rad",detail:"function",info:"Convert degrees to radians for input series",type:"function"},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sgn",detail:"function",info:"Returns the sign of the instant vector",type:"function"},{label:"sin",detail:"function",info:"Calculate the sine, in radians, for input series",type:"function"},{label:"sinh",detail:"function",info:"Calculate the hyperbolic sine, in radians, for input series",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variation within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"tan",detail:"function",info:"Calculate the tangent, in radians, for input series",type:"function"},{label:"tanh",detail:"function",info:"Calculate the hyperbolic tangent, in radians, for input series",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],aggregateOp:H,aggregateOpModifier:[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}],number:[{label:"nan",info:"Floating-point NaN value",type:"constant"},{label:"inf",info:"Floating-point infinity",type:"constant"}]};function U(e,t){var n=R(e,p);return n&&(n=N(n,133,57))?t.sliceDoc(n.from,n.to):""}!function(e){e[e.MetricName=0]="MetricName",e[e.LabelName=1]="LabelName",e[e.LabelValue=2]="LabelValue",e[e.Function=3]="Function",e[e.Aggregation=4]="Aggregation",e[e.BinOpModifier=5]="BinOpModifier",e[e.BinOp=6]="BinOp",e[e.MatchOp=7]="MatchOp",e[e.AggregateOpModifier=8]="AggregateOpModifier",e[e.Duration=9]="Duration",e[e.Offset=10]="Offset",e[e.Bool=11]="Bool",e[e.AtModifiers=12]="AtModifiers",e[e.Number=13]="Number"}(B||(B={}));var X=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;Object(o.a)(this,e),this.prometheusClient=t,this.maxMetricsMetadata=n}return Object(a.a)(e,[{key:"getPrometheusClient",value:function(){return this.prometheusClient}},{key:"promQL",value:function(e){var t,n=this,r=e.state,i=e.pos,o=Object(z.j)(r).resolve(i,-1),a=function(e,t){var n,r,i,o,a,s,y,b,O,k,w,x,j,S,E,C,M=[];switch(t.type.id){case 0:if((null===(n=t.parent)||void 0===n?void 0:n.type.id)===f){M.push({kind:B.Duration});break}if((null===(r=t.parent)||void 0===r?void 0:r.type.id)===m){M.push({kind:B.MatchOp});break}if((null===(i=t.parent)||void 0===i?void 0:i.type.id)===u){M.push({kind:B.Duration});break}if((null===(o=t.parent)||void 0===o?void 0:o.type.id)===h&&_(t.parent,124)){M.push({kind:B.Duration});break}var P=e.sliceDoc(t.from,t.to);V.filter((function(e){return e.label.includes(P)})).length>0&&M.push({kind:B.BinOp});break;case 57:if(0===(null===(a=t.parent)||void 0===a?void 0:a.type.id)){var T=t.parent.parent;if(141===(null===T||void 0===T?void 0:T.type.id)){M.push({kind:B.AtModifiers});break}if(30===(null===T||void 0===T?void 0:T.type.id)){M.push({kind:B.AggregateOpModifier},{kind:B.BinOp});break}if((null===T||void 0===T?void 0:T.type.id)===p){var D=U(t,e);H.filter((function(e){return e.label===D})).length>0&&M.push({kind:B.AggregateOpModifier}),M.push({kind:B.BinOp},{kind:B.Offset});break}if(T&&L(T,l)){M.push({kind:B.BinOp},{kind:B.Offset});break}}var $=null===(b=null===(y=null===(s=t.parent)||void 0===s?void 0:s.parent)||void 0===y?void 0:y.parent)||void 0===b?void 0:b.parent;if(!$){M.push({kind:B.MetricName,metricName:e.sliceDoc(t.from,t.to)});break}L($,l,l)?$.type.id!==c||_($,0)||(M.push({kind:B.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:B.Function},{kind:B.Aggregation},{kind:B.BinOpModifier},{kind:B.Number}),_($,48,49,50,51,52,53)&&!N($,41,1)&&M.push({kind:B.Bool})):(M.push({kind:B.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:B.Function},{kind:B.Aggregation}),38!==$.type.id&&$.type.id!==u&&M.push({kind:B.Number}));break;case 28:t.firstChild||M.push({kind:B.MetricName,metricName:""},{kind:B.Function},{kind:B.Aggregation},{kind:B.Number});break;case 33:M.push({kind:B.LabelName});break;case 134:M.push({kind:B.LabelName,metricName:U(t,e)});break;case 36:35===(null===(O=t.parent)||void 0===O?void 0:O.type.id)?M.push({kind:B.LabelName}):(null===(k=t.parent)||void 0===k?void 0:k.type.id)===m&&M.push({kind:B.LabelName,metricName:U(t,e)});break;case d:if((null===(w=t.parent)||void 0===w?void 0:w.type.id)===m){var z="";36===(null===(x=t.parent.firstChild)||void 0===x?void 0:x.type.id)&&(z=e.sliceDoc(t.parent.firstChild.from,t.parent.firstChild.to));var F=U(t,e),W=A(I(R(t,v),v,m),e);M.push({kind:B.LabelValue,metricName:F,labelName:z,matchers:W})}break;case 125:0===(null===(j=t.parent)||void 0===j?void 0:j.type.id)&&(null===(S=t.parent.parent)||void 0===S?void 0:S.type.id)===h?M.push({kind:B.Duration}):M.push({kind:B.Number});break;case 124:case f:M.push({kind:B.Duration});break;case 37:M.push({kind:B.MetricName,metricName:""},{kind:B.Function},{kind:B.Aggregation});break;case 53:137===(null===(E=t.parent)||void 0===E?void 0:E.type.id)?M.push({kind:B.MatchOp}):(null===(C=t.parent)||void 0===C?void 0:C.type.id)===c&&M.push({kind:B.BinOp});break;case g:case 139:case 140:case 137:M.push({kind:B.MatchOp});break;case 40:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 22:case 24:case 23:case c:M.push({kind:B.BinOp})}return M}(r,o),s=Promise.resolve([]),y=!1,b=!0,O=Object(j.a)(a);try{var k=function(){var e=t.value;switch(e.kind){case B.Aggregation:y=!0,s=s.then((function(e){return e.concat(q.aggregateOp)}));break;case B.Function:y=!0,s=s.then((function(e){return e.concat(q.functionIdentifier)}));break;case B.BinOpModifier:s=s.then((function(e){return e.concat(q.binOpModifier)}));break;case B.BinOp:s=s.then((function(e){return e.concat(q.binOp)}));break;case B.MatchOp:s=s.then((function(e){return e.concat(q.matchOp)}));break;case B.AggregateOpModifier:s=s.then((function(e){return e.concat(q.aggregateOpModifier)}));break;case B.Duration:b=!1,s=s.then((function(e){return e.concat(q.duration)}));break;case B.Offset:s=s.then((function(e){return e.concat([{label:"offset"}])}));break;case B.Bool:s=s.then((function(e){return e.concat([{label:"bool"}])}));break;case B.AtModifiers:s=s.then((function(e){return e.concat(q.atModifier)}));break;case B.Number:s=s.then((function(e){return e.concat(q.number)}));break;case B.MetricName:s=s.then((function(t){return n.autocompleteMetricName(t,e)}));break;case B.LabelName:s=s.then((function(t){return n.autocompleteLabelName(t,e)}));break;case B.LabelValue:s=s.then((function(t){return n.autocompleteLabelValue(t,e)}))}};for(O.s();!(t=O.n()).done;)k()}catch(w){O.e(w)}finally{O.f()}return s.then((function(e){return function(e,t,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=e;return arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&i.push.apply(i,Object(S.a)(Q)),{from:t,to:n,options:i,span:r?/^[a-zA-Z0-9_:]+$/:void 0}}(e,function(e,t){var n,r,i,o,a,s,l=e.from;return 134===e.type.id||33===e.type.id?l=function(e,t){var n=e.from+1;return null!==e.firstChild&&(n=t),n}(e,t):37===e.type.id||e.type.id===d&&(null===(n=e.parent)||void 0===n?void 0:n.type.id)===m?l++:(e.type.id===f||125===e.type.id&&0===(null===(r=e.parent)||void 0===r?void 0:r.type.id)&&(null===(i=e.parent.parent)||void 0===i?void 0:i.type.id)===h||0===e.type.id&&((null===(o=e.parent)||void 0===o?void 0:o.type.id)===f||(null===(a=e.parent)||void 0===a?void 0:a.type.id)===u||(null===(s=e.parent)||void 0===s?void 0:s.type.id)===h&&_(e.parent,124)))&&(l=t),l}(o,i),i,y,b)}))}},{key:"autocompleteMetricName",value:function(e,t){var n=this;if(!this.prometheusClient)return e;var r=new Map;return this.prometheusClient.metricNames(t.metricName).then((function(e){var t,i,o=Object(j.a)(e);try{for(o.s();!(i=o.n()).done;){var a=i.value;r.set(a,{label:a,type:"constant"})}}catch(s){o.e(s)}finally{o.f()}if(e.length<=n.maxMetricsMetadata)return null===(t=n.prometheusClient)||void 0===t?void 0:t.metricMetadata()})).then((function(t){if(t){var n,i=Object(j.a)(r);try{for(i.s();!(n=i.n()).done;){var o=Object(x.a)(n.value,2),a=o[0],s=o[1],l=t[a.replace(/(_count|_sum|_bucket)$/,"")];if(l)if(l.length>1){var c,u=Object(j.a)(l);try{for(u.s();!(c=u.n()).done;){var f=c.value;""===s.detail?s.detail=f.type:s.detail!==f.type&&(s.detail="unknown",s.info="multiple different definitions for this metric"),""===s.info?s.info=f.help:s.info!==f.help&&(s.info="multiple different definitions for this metric")}}catch(v){u.e(v)}finally{u.f()}}else if(1===l.length){var d=l[0],h=d.type,p=d.help;"histogram"!==h&&"summary"!==h||(a.endsWith("_count")&&(h="counter",p="The total number of observations for: ".concat(p)),a.endsWith("_sum")&&(h="counter",p="The total sum of observations for: ".concat(p)),a.endsWith("_bucket")&&(h="counter",p="The total count of observations for a bucket in the histogram: ".concat(p))),s.detail=h,s.info=p}}}catch(v){i.e(v)}finally{i.f()}}return e.concat(Array.from(r.values()))}))}},{key:"autocompleteLabelName",value:function(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t.metricName).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"constant"}})))})):e}},{key:"autocompleteLabelValue",value:function(e,t){return this.prometheusClient&&t.labelName?this.prometheusClient.labelValues(t.labelName,t.metricName,t.matchers).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"text"}})))})):e}}]),e}(),Y=n(118),G=n.n(Y),K=400,J=422,Z=503,ee=function(){function e(t){Object(o.a)(this,e),this.lookbackInterval=432e5,this.httpMethod="POST",this.apiPrefix="/api/v1",this.fetchFn=function(e,t){return fetch(e,t)},this.url=t.url,this.errorHandler=t.httpErrorHandler,t.lookbackInterval&&(this.lookbackInterval=t.lookbackInterval),t.fetchFn&&(this.fetchFn=t.fetchFn),t.httpMethod&&(this.httpMethod=t.httpMethod),t.apiPrefix&&(this.apiPrefix=t.apiPrefix)}return Object(a.a)(e,[{key:"labelNames",value:function(e){var t=this,n=new Date,r=new Date(n.getTime()-this.lookbackInterval);if(void 0===e||""===e){var i=this.buildRequest(this.labelsEndpoint(),new URLSearchParams({start:r.toISOString(),end:n.toISOString()}));return this.fetchAPI(i.uri,{method:this.httpMethod,body:i.body}).catch((function(e){return t.errorHandler&&t.errorHandler(e),[]}))}return this.series(e).then((function(e){var t,n=new Set,r=Object(j.a)(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value,o=0,a=Object.entries(i);o<a.length;o++){var s=Object(x.a)(a[o],1)[0];"__name__"!==s&&n.add(s)}}catch(l){r.e(l)}finally{r.f()}return Array.from(n)}))}},{key:"labelValues",value:function(e,t,n){var r=this,i=new Date,o=new Date(i.getTime()-this.lookbackInterval);if(!t||0===t.length){var a=new URLSearchParams({start:o.toISOString(),end:i.toISOString()});return this.fetchAPI("".concat(this.labelValuesEndpoint().replace(/:name/gi,e),"?").concat(a)).catch((function(e){return r.errorHandler&&r.errorHandler(e),[]}))}return this.series(t,n,e).then((function(t){var n,r=new Set,i=Object(j.a)(t);try{for(i.s();!(n=i.n()).done;)for(var o=n.value,a=0,s=Object.entries(o);a<s.length;a++){var l=Object(x.a)(s[a],2),c=l[0],u=l[1];"__name__"!==c&&(c===e&&r.add(u))}}catch(f){i.e(f)}finally{i.f()}return Array.from(r)}))}},{key:"metricMetadata",value:function(){var e=this;return this.fetchAPI(this.metricMetadataEndpoint()).catch((function(t){return e.errorHandler&&e.errorHandler(t),{}}))}},{key:"series",value:function(e,t,n){var r=this,i=new Date,o=new Date(i.getTime()-this.lookbackInterval),a=this.buildRequest(this.seriesEndpoint(),new URLSearchParams({start:o.toISOString(),end:i.toISOString(),"match[]":D(e,t,n)}));return this.fetchAPI(a.uri,{method:this.httpMethod,body:a.body}).catch((function(e){return r.errorHandler&&r.errorHandler(e),[]}))}},{key:"metricNames",value:function(){return this.labelValues("__name__")}},{key:"fetchAPI",value:function(e,t){return this.fetchFn(this.url+e,t).then((function(e){if(!e.ok&&![K,J,Z].includes(e.status))throw new Error(e.statusText);return e})).then((function(e){return e.json()})).then((function(e){if("error"===e.status)throw new Error(void 0!==e.error?e.error:'missing "error" field in response JSON');if(void 0===e.data)throw new Error('missing "data" field in response JSON');return e.data}))}},{key:"buildRequest",value:function(e,t){var n=e,r=t;return"GET"===this.httpMethod&&(n="".concat(n,"?").concat(t),r=null),{uri:n,body:r}}},{key:"labelsEndpoint",value:function(){return"".concat(this.apiPrefix,"/labels")}},{key:"labelValuesEndpoint",value:function(){return"".concat(this.apiPrefix,"/label/:name/values")}},{key:"seriesEndpoint",value:function(){return"".concat(this.apiPrefix,"/series")}},{key:"metricMetadataEndpoint",value:function(){return"".concat(this.apiPrefix,"/metadata")}}]),e}(),te=function(){function e(t){Object(o.a)(this,e);var n=t&&t.maxAge?t.maxAge:3e5;this.completeAssociation=new G.a(n),this.metricMetadata={},this.labelValues=new G.a(n),this.labelNames=[],(null===t||void 0===t?void 0:t.initialMetricList)&&this.setLabelValues("__name__",t.initialMetricList)}return Object(a.a)(e,[{key:"setAssociations",value:function(e,t){var n=this;t.forEach((function(t){var r=n.completeAssociation.get(e);r||(r=new Map,n.completeAssociation.set(e,r));for(var i=0,o=Object.entries(t);i<o.length;i++){var a=Object(x.a)(o[i],2),s=a[0],l=a[1];if("__name__"!==s){var c=r.get(s);void 0===c?r.set(s,new Set([l])):c.add(l)}}}))}},{key:"setMetricMetadata",value:function(e){this.metricMetadata=e}},{key:"getMetricMetadata",value:function(){return this.metricMetadata}},{key:"setLabelNames",value:function(e){this.labelNames=e}},{key:"getLabelNames",value:function(e){if(!e||0===e.length)return this.labelNames;var t=this.completeAssociation.get(e);return t?Array.from(t.keys()):[]}},{key:"setLabelValues",value:function(e,t){this.labelValues.set(e,t)}},{key:"getLabelValues",value:function(e,t){if(!t||0===t.length){var n=this.labelValues.get(e);return n||[]}var r=this.completeAssociation.get(t);if(r){var i=r.get(e);return i?Array.from(i):[]}return[]}}]),e}(),ne=function(){function e(t,n){Object(o.a)(this,e),this.client=t,this.cache=new te(n)}return Object(a.a)(e,[{key:"labelNames",value:function(e){var t=this,n=this.cache.getLabelNames(e);return n&&n.length>0?Promise.resolve(n):void 0===e||""===e?this.client.labelNames().then((function(e){return t.cache.setLabelNames(e),e})):this.series(e).then((function(){return t.cache.getLabelNames(e)}))}},{key:"labelValues",value:function(e,t){var n=this,r=this.cache.getLabelValues(e,t);return r&&r.length>0?Promise.resolve(r):void 0===t||""===t?this.client.labelValues(e).then((function(t){return n.cache.setLabelValues(e,t),t})):this.series(t).then((function(){return n.cache.getLabelValues(e,t)}))}},{key:"metricMetadata",value:function(){var e=this,t=this.cache.getMetricMetadata();return t&&Object.keys(t).length>0?Promise.resolve(t):this.client.metricMetadata().then((function(t){return e.cache.setMetricMetadata(t),e.cache.getMetricMetadata()}))}},{key:"series",value:function(e){var t=this;return this.client.series(e).then((function(n){return t.cache.setAssociations(e,n),n}))}},{key:"metricNames",value:function(){return this.labelValues("__name__")}}]),e}();function re(e){return(null===e||void 0===e?void 0:e.completeStrategy)?e.completeStrategy:(null===e||void 0===e?void 0:e.remote)?void 0===e.remote.url?new X(e.remote,e.maxMetricsMetadata):new X(new ne(new ee(e.remote),e.remote.cache),e.maxMetricsMetadata):new X}var ie,oe=n(102),ae=function(){function e(){Object(o.a)(this,e)}return Object(a.a)(e,[{key:"promQL",value:function(){return function(e){var t=new F(e.state);return t.analyze(),t.getDiagnostics()}}}]),e}();function se(e,t){return Object(oe.b)(e.call(t))}function le(e){return z.b.define({parser:k.configure({top:e,props:[Object(w.b)({LineComment:w.c.comment,LabelName:w.c.labelName,StringLiteral:w.c.string,NumberLiteral:w.c.number,Duration:w.c.number,"Abs Absent AbsentOverTime Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek Deg Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year":w.c.function(w.c.variableName),"Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk":w.c.operatorKeyword,"By Without Bool On Ignoring GroupLeft GroupRight Offset Start End":w.c.modifier,"And Unless Or":w.c.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":w.c.operator,UnaryOp:w.c.arithmeticOperator,"( )":w.c.paren,"[ ]":w.c.squareBracket,"{ }":w.c.brace,"\u26a0":w.c.invalid})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})}!function(e){e.PromQL="PromQL",e.MetricName="MetricName"}(ie||(ie={}));var ce=function(){function e(){Object(o.a)(this,e),this.complete=re(),this.lint=new ae,this.enableLinter=!0,this.enableCompletion=!0}return Object(a.a)(e,[{key:"setComplete",value:function(e){return this.complete=re(e),this}},{key:"getComplete",value:function(){return this.complete}},{key:"activateCompletion",value:function(e){return this.enableCompletion=e,this}},{key:"setLinter",value:function(e){return this.lint=e,this}},{key:"getLinter",value:function(){return this.lint}},{key:"activateLinter",value:function(e){return this.enableLinter=e,this}},{key:"asExtension",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie.PromQL,n=le(t),r=[n];if(this.enableCompletion){var i=n.data.of({autocomplete:function(t){return e.complete.promQL(t)}});r=r.concat(i)}return this.enableLinter&&(r=r.concat(se(this.lint.promQL,this.lint))),r}}]),e}()},function(e,t,n){"use strict";var r=n(19),i=n(7),o=n(209),a=n(1),s=["xs","sm","md","lg","xl"];function l(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,o=void 0===r?"px":r,l=e.step,c=void 0===l?5:l,u=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function d(e,t){var r=s.indexOf(t);return r===s.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(o,")")}return Object(a.a)({keys:s,values:n,up:f,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(o,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},u)}function c(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var u=n(156),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},b=n(22),O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function w(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(b.f)(e.main,i):"dark"===t&&(e.dark=Object(b.b)(e.main,o)))}function x(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,l=e.error,c=void 0===l?{light:v[300],main:v[500],dark:v[700]}:l,x=e.warning,j=void 0===x?{light:m[300],main:m[500],dark:m[700]}:x,S=e.info,E=void 0===S?{light:g[300],main:g[500],dark:g[700]}:S,C=e.success,M=void 0===C?{light:y[300],main:y[500],dark:y[700]}:C,P=e.type,T=void 0===P?"light":P,A=e.contrastThreshold,D=void 0===A?3:A,R=e.tonalOffset,N=void 0===R?.2:R,_=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function L(e){return Object(b.e)(e,k.text.primary)>=D?k.text.primary:O.text.primary}var I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(u.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(u.a)(5,JSON.stringify(e.main)));return w(e,"light",n,N),w(e,"dark",r,N),e.contrastText||(e.contrastText=L(e.main)),e},$={dark:k,light:O};return Object(o.a)(Object(a.a)({common:f,type:T,primary:I(n),secondary:I(s,"A400","A200","A700"),error:I(c),warning:I(j),info:I(E),success:I(M),grey:d,contrastThreshold:D,getContrastText:L,augmentColor:I,tonalOffset:N},$[T]),_)}function j(e){return Math.round(1e5*e)/1e5}function S(e){return j(e)}var E={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function M(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?C:r,l=n.fontSize,c=void 0===l?14:l,u=n.fontWeightLight,f=void 0===u?300:u,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,v=void 0===p?500:p,m=n.fontWeightBold,g=void 0===m?700:m,y=n.htmlFontSize,b=void 0===y?16:y,O=n.allVariants,k=n.pxToRem,w=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var x=c/14,M=k||function(e){return"".concat(e/b*x,"rem")},P=function(e,t,n,r,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:M(t),lineHeight:n},s===C?{letterSpacing:"".concat(j(r/t),"em")}:{},i,O)},T={h1:P(f,96,1.167,-1.5),h2:P(f,60,1.2,-.5),h3:P(h,48,1.167,0),h4:P(h,34,1.235,.25),h5:P(h,24,1.334,0),h6:P(v,20,1.6,.15),subtitle1:P(h,16,1.75,.15),subtitle2:P(v,14,1.57,.1),body1:P(h,16,1.5,.15),body2:P(h,14,1.43,.15),button:P(v,14,1.75,.4,E),caption:P(h,12,1.66,.4),overline:P(h,12,2.66,1,E)};return Object(o.a)(Object(a.a)({htmlFontSize:b,pxToRem:M,round:S,fontFamily:s,fontSize:c,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},T),w,{clone:!1})}function P(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var T=["none",P(0,2,1,-1,0,1,1,0,0,1,3,0),P(0,3,1,-2,0,2,2,0,0,1,5,0),P(0,3,3,-2,0,3,4,0,0,1,8,0),P(0,2,4,-1,0,4,5,0,0,1,10,0),P(0,3,5,-1,0,5,8,0,0,1,14,0),P(0,3,5,-1,0,6,10,0,0,1,18,0),P(0,4,5,-2,0,7,10,1,0,2,16,1),P(0,5,5,-3,0,8,10,1,0,3,14,2),P(0,5,6,-3,0,9,12,1,0,3,16,2),P(0,6,6,-3,0,10,14,1,0,4,18,3),P(0,6,7,-4,0,11,15,1,0,4,20,3),P(0,7,8,-4,0,12,17,2,0,5,22,4),P(0,7,8,-4,0,13,19,2,0,5,24,4),P(0,7,9,-4,0,14,21,2,0,5,26,4),P(0,8,9,-5,0,15,22,2,0,6,28,5),P(0,8,10,-5,0,16,24,2,0,6,30,5),P(0,8,11,-5,0,17,26,2,0,6,32,5),P(0,9,11,-5,0,18,28,2,0,7,34,6),P(0,9,12,-6,0,19,29,2,0,7,36,6),P(0,10,13,-6,0,20,31,3,0,8,38,7),P(0,10,13,-6,0,21,33,3,0,8,40,7),P(0,10,14,-6,0,22,35,3,0,8,42,7),P(0,11,14,-7,0,23,36,3,0,9,44,8),P(0,11,15,-7,0,24,38,3,0,9,46,8)],A={borderRadius:4},D=n(287);function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(D.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"===typeof e)return e;var n=t(e);return"number"===typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var N=n(44),_=n(95);function L(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,s=e.palette,u=void 0===s?{}:s,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=x(u),m=l(n),g=R(f),y=Object(o.a)({breakpoints:m,direction:"ltr",mixins:c(m,g,a),overrides:{},palette:v,props:{},shadows:T,typography:M(v,h),spacing:g,shape:A,transitions:N.a,zIndex:_.a},p),b=arguments.length,O=new Array(b>1?b-1:0),k=1;k<b;k++)O[k-1]=arguments[k];return y=O.reduce((function(e,t){return Object(o.a)(e,t)}),y)}t.a=L},function(e,t,n){"use strict";n.d(t,"a",(function(){return Gt}));var r=n(25),i=n(9),o=n(4),a=n(3),s=n(5),l=n(6),c=o.a.define(),u=o.a.define(),f=o.g.define(),d=o.g.define({combine:function(e){return Object(o.m)(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),h=o.k.define({create:function(){return M.empty},update:function(e,t){var n=t.state.facet(d),r=t.annotation(c);if(r){var i=O.fromTransaction(t),a=r.side,s=0==a?e.undone:e.done;return s=i?k(s,s.length,n.minDepth,i):j(s,t.startState.selection),new M(0==a?r.rest:s,0==a?s:r.rest)}var l=t.annotation(u);if("full"!=l&&"before"!=l||(e=e.isolate()),!1===t.annotation(o.l.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);var f=O.fromTransaction(t),h=t.annotation(o.l.time),p=t.annotation(o.l.userEvent);return f?e=e.addChanges(f,h,p,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,h,p,n.newGroupDelay)),"full"!=l&&"after"!=l||(e=e.isolate()),e},toJSON:function(e){return{done:e.done.map((function(e){return e.toJSON()})),undone:e.undone.map((function(e){return e.toJSON()}))}},fromJSON:function(e){return new M(e.done.map(O.fromJSON),e.undone.map(O.fromJSON))}});function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[h,d.of(e),i.d.domEventHandlers({beforeinput:function(e,t){return"historyUndo"==e.inputType?m(t):"historyRedo"==e.inputType&&g(t)}})]}function v(e,t){return function(n){var r=n.state,i=n.dispatch,o=r.field(h,!1);if(!o)return!1;var a=o.pop(e,r,t);return!!a&&(i(a),!0)}}var m=v(0,!1),g=v(1,!1),y=v(0,!0),b=v(1,!0);var O=function(){function e(t,n,r,i,o){Object(s.a)(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return Object(l.a)(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}},{key:"toJSON",value:function(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((function(e){return e.toJSON()}))}}}],[{key:"fromJSON",value:function(t){return new e(t.changes&&o.c.fromJSON(t.changes),[],t.mapped&&o.b.fromJSON(t.mapped),t.startSelection&&o.e.fromJSON(t.startSelection),t.selectionsAfter.map(o.e.fromJSON))}},{key:"fromTransaction",value:function(t){var n,r=x,i=Object(a.a)(t.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var o=(0,n.value)(t);o.length&&(r=r.concat(o))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,t.startState.selection,x)}},{key:"selection",value:function(t){return new e(void 0,x,void 0,void 0,t)}}]),e}();function k(e,t,n,r){var i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function w(e,t){return e.length?t.length?e.concat(t):e:t}var x=[];function j(e,t){if(e.length){var n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),k(e,e.length-1,1e9,n.setSelAfter(r)))}return[O.selection([t])]}function S(e){var t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function E(e,t){if(!e.length)return e;for(var n=e.length,r=x;n;){var i=C(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=e.slice(0,n);return o[n-1]=i,o}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[O.selection(r)]:x}function C(e,t,n){var r=w(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):x,n);if(!e.changes)return O.selection(r);var i=e.changes.map(t),a=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(a):a;return new O(i,o.j.mapEffects(e.effects,t),s,e.startSelection.map(a),r)}var M=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;Object(s.a)(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return Object(l.a)(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,o){var a=this.done,s=a[a.length-1];return a=s&&s.changes&&!s.changes.empty&&t.changes&&(!s.selectionsAfter.length&&n-this.prevTime<i&&function(e,t){var n=[],r=!1;return e.iterChangedRanges((function(e,t){return n.push(e,t)})),t.iterChangedRanges((function(e,t,i,o){for(var a=0;a<n.length;){var s=n[a++],l=n[a++];o>=s&&i<=l&&(r=!0)}})),r}(s.changes,t.changes)||"input.type.compose"==r)?k(a,a.length-1,o,new O(t.changes.compose(s.changes),w(t.effects,s.effects),s.mapped,s.startSelection,x)):k(a,a.length,o,t),new e(a,x,n,r)}},{key:"addSelection",value:function(t,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:x;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&(o=s[s.length-1],a=t,o.ranges.length==a.ranges.length&&0===o.ranges.filter((function(e,t){return e.empty!=a.ranges[t].empty})).length)?this:new e(j(this.done,t),this.undone,n,r)}},{key:"addMapping",value:function(t){return new e(E(this.done,t),E(this.undone,t),this.prevTime,this.prevUserEvent)}},{key:"pop",value:function(e,t,n){var r=0==e?this.done:this.undone;if(0==r.length)return null;var i=r[r.length-1];if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:c.of({side:e,rest:S(r)}),userEvent:0==e?"select.undo":"select.redo"});if(i.changes){var o=1==r.length?x:r.slice(0,r.length-1);return i.mapped&&(o=E(o,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:c.of({side:e,rest:o}),filter:!1,userEvent:0==e?"undo":"redo"})}return null}}]),e}();M.empty=new M(x,x);var P=[{key:"Mod-z",run:m,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:g,preventDefault:!0},{key:"Mod-u",run:y,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:b,preventDefault:!0}],T=n(18),A=n(17),D=n(21),R=n(26),N=function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(){return Object(s.a)(this,n),t.apply(this,arguments)}return Object(l.a)(n,[{key:"compare",value:function(e){return this==e||this.constructor==e.constructor&&this.eq(e)}},{key:"eq",value:function(e){return!1}}]),n}(R.c);N.prototype.elementClass="",N.prototype.toDOM=void 0,N.prototype.mapMode=o.h.TrackBefore,N.prototype.startSide=N.prototype.endSide=-1,N.prototype.point=!0;var _=o.g.define(),L={class:"",renderEmptyElements:!1,elementStyle:"",markers:function(){return R.a.empty},lineMarker:function(){return null},initialSpacer:null,updateSpacer:null,domEventHandlers:{}},I=o.g.define();function $(e){return[F(),I.of(Object.assign(Object.assign({},L),e))]}var z=i.d.baseTheme({".cm-gutters":{display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#999",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"}}),B=o.g.define({combine:function(e){return e.some((function(e){return e}))}});function F(e){var t=[W,z];return e&&!1===e.fixed&&t.push(B.of(!0)),t}var W=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.gutters=t.state.facet(I).map((function(e){return new q(t,e)}));var n,r=Object(a.a)(this.gutters);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.dom.appendChild(i.dom)}}catch(o){r.e(o)}finally{r.f()}this.fixed=!t.state.facet(B),this.fixed&&(this.dom.style.position="sticky"),t.scrollDOM.insertBefore(this.dom,t.contentDOM),this.syncGutters()}return Object(l.a)(e,[{key:"update",value:function(e){this.updateGutters(e)&&this.syncGutters()}},{key:"syncGutters",value:function(){var e=this,t=R.a.iter(this.view.state.facet(_),this.view.viewport.from),n=[],r=this.gutters.map((function(t){return new Q(t,e.view.viewport)}));this.view.viewportLines((function(o){var s;if(Array.isArray(o.type)){var l,c=Object(a.a)(o.type);try{for(c.s();!(l=c.n()).done;){var u=l.value;if(u.type==i.a.Text){s=u;break}}}catch(h){c.e(h)}finally{c.f()}}else s=o.type==i.a.Text?o:void 0;if(s){n.length&&(n=[]),H(t,n,o.from);var f,d=Object(a.a)(r);try{for(d.s();!(f=d.n()).done;){f.value.line(e.view,s,n)}}catch(h){d.e(h)}finally{d.f()}}}),0);var o,s=Object(a.a)(r);try{for(s.s();!(o=s.n()).done;){o.value.finish()}}catch(l){s.e(l)}finally{s.f()}this.dom.style.minHeight=this.view.contentHeight+"px",this.view.state.facet(B)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"")}},{key:"updateGutters",value:function(e){var t=e.startState.facet(I),n=e.state.facet(I),r=e.docChanged||e.heightChanged||e.viewportChanged||!R.a.eq(e.startState.facet(_),e.state.facet(_),e.view.viewport.from,e.view.viewport.to);if(t==n){var i,o=Object(a.a)(this.gutters);try{for(o.s();!(i=o.n()).done;){i.value.update(e)&&(r=!0)}}catch(g){o.e(g)}finally{o.f()}}else{r=!0;var s,l=[],c=Object(a.a)(n);try{for(c.s();!(s=c.n()).done;){var u=s.value,f=t.indexOf(u);f<0?l.push(new q(this.view,u)):(this.gutters[f].update(e),l.push(this.gutters[f]))}}catch(g){c.e(g)}finally{c.f()}var d,h=Object(a.a)(this.gutters);try{for(h.s();!(d=h.n()).done;){d.value.dom.remove()}}catch(g){h.e(g)}finally{h.f()}for(var p=0,v=l;p<v.length;p++){var m=v[p];this.dom.appendChild(m.dom)}this.gutters=l}return r}},{key:"destroy",value:function(){this.dom.remove()}}]),e}(),{provide:i.e.scrollMargins.from((function(e){return 0!=e.gutters.length&&e.fixed?e.view.textDirection==i.c.LTR?{left:e.dom.offsetWidth}:{right:e.dom.offsetWidth}:null}))});function V(e){return Array.isArray(e)?e:[e]}function H(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var Q=function(){function e(t,n){Object(s.a)(this,e),this.gutter=t,this.localMarkers=[],this.i=0,this.height=0,this.cursor=R.a.iter(t.markers,n.from)}return Object(l.a)(e,[{key:"line",value:function(e,t,n){this.localMarkers.length&&(this.localMarkers=[]),H(this.cursor,this.localMarkers,t.from);var r=n.length?this.localMarkers.concat(n):this.localMarkers,i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);var o=this.gutter;if(0!=r.length||o.config.renderEmptyElements){var a=t.top-this.height;if(this.i==o.elements.length){var s=new U(e,t.height,a,r);o.elements.push(s),o.dom.appendChild(s.dom)}else{var l=o.elements[this.i];(function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0})(r,l.markers)&&(r=l.markers),l.update(e,t.height,a,r)}this.height=t.bottom,this.i++}}},{key:"finish",value:function(){for(var e=this.gutter;e.elements.length>this.i;)e.dom.removeChild(e.elements.pop().dom)}}]),e}(),q=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");var i=function(e){r.dom.addEventListener(e,(function(r){var i=t.visualLineAtHeight(r.clientY,t.contentDOM.getBoundingClientRect().top);n.domEventHandlers[e](t,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)i(o);this.markers=V(n.markers(t)),n.initialSpacer&&(this.spacer=new U(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return Object(l.a)(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=V(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}var r=e.view.viewport;return!R.a.eq(this.markers,t,r.from,r.to)}}]),e}(),U=function(){function e(t,n,r,i){Object(s.a)(this,e),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(t,n,r,i)}return Object(l.a)(e,[{key:"update",value:function(e,t,n,r){if(this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var i;i=this.dom.lastChild;)i.remove();var o,s="cm-gutterElement",l=Object(a.a)(r);try{for(l.s();!(o=l.n()).done;){var c=o.value;c.toDOM&&this.dom.appendChild(c.toDOM(e));var u=c.elementClass;u&&(s+=" "+u)}}catch(f){l.e(f)}finally{l.f()}this.dom.className=s}}}]),e}();var X=o.g.define(),Y=o.g.define({combine:function(e){return Object(o.m)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(e,t){var n=Object.assign({},e),r=function(e){var r=n[e],i=t[e];n[e]=r?function(e,t,n){return r(e,t,n)||i(e,t,n)}:i};for(var i in t)r(i);return n}})}}),G=function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(e){var r;return Object(s.a)(this,n),(r=t.call(this)).number=e,r}return Object(l.a)(n,[{key:"eq",value:function(e){return this.number==e.number}},{key:"toDOM",value:function(e){return document.createTextNode(this.number)}}]),n}(N);function K(e,t){return e.state.facet(Y).formatNumber(t,e.state)}var J=I.compute([Y],(function(e){return{class:"cm-lineNumbers",renderEmptyElements:!1,markers:function(e){return e.state.facet(X)},lineMarker:function(e,t,n){return n.some((function(e){return e.toDOM}))?null:new G(K(e,e.state.doc.lineAt(t.from).number))},initialSpacer:function(e){return new G(K(e,ee(e.state.doc.lines)))},updateSpacer:function(e,t){var n=K(t.view,ee(t.view.state.doc.lines));return n==e.number?e:new G(n)},domEventHandlers:e.facet(Y).domEventHandlers}}));function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[Y.of(e),F(),J]}function ee(e){for(var t=9;t<e;)t=10*t+9;return t}var te=new(function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(){var e;return Object(s.a)(this,n),(e=t.apply(this,arguments)).elementClass="cm-activeLineGutter",e}return n}(N)),ne=_.compute(["selection"],(function(e){var t,n=[],r=-1,i=Object(a.a)(e.selection.ranges);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(o.empty){var s=e.doc.lineAt(o.head).from;s>r&&(r=s,n.push(te.range(s)))}}}catch(l){i.e(l)}finally{i.f()}return R.a.of(n)}));function re(){return ne}function ie(e,t){var n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var oe=o.j.define({map:ie}),ae=o.j.define({map:ie});function se(e){var t,n=[],r=Object(a.a)(e.state.selection.ranges);try{var i=function(){var r=t.value.head;if(n.some((function(e){return e.from<=r&&e.to>=r})))return"continue";n.push(e.visualLineAt(r))};for(r.s();!(t=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}return n}var le=o.k.define({create:function(){return i.b.none},update:function(e,t){e=e.map(t.changes);var n,r=Object(a.a)(t.effects);try{var i=function(){var t=n.value;t.is(oe)&&!function(e,t,n){var r=!1;return e.between(t,t,(function(e,i){e==t&&i==n&&(r=!0)})),r}(e,t.value.from,t.value.to)?e=e.update({add:[me.range(t.value.from,t.value.to)]}):t.is(ae)&&(e=e.update({filter:function(e,n){return t.value.from!=e||t.value.to!=n},filterFrom:t.value.from,filterTo:t.value.to}))};for(r.s();!(n=r.n()).done;)i()}catch(l){r.e(l)}finally{r.f()}if(t.selection){var o=!1,s=t.selection.main.head;e.between(s,s,(function(e,t){e<s&&t>s&&(o=!0)})),o&&(e=e.update({filterFrom:s,filterTo:s,filter:function(e,t){return t<=s||e>=s}}))}return e},provide:function(e){return i.d.decorations.from(e)}});function ce(e,t,n){var r,i=null;return null===(r=e.field(le,!1))||void 0===r||r.between(t,n,(function(e,t){(!i||i.from>e)&&(i={from:e,to:t})})),i}function ue(e,t){return e.field(le,!1)?t:t.concat(o.j.appendConfig.of(ve()))}function fe(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.state.doc.lineAt(t.from).number,o=e.state.doc.lineAt(t.to).number;return i.d.announce.of("".concat(e.state.phrase(n?"Folded lines":"Unfolded lines")," ").concat(r," ").concat(e.state.phrase("to")," ").concat(o,"."))}var de=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function(e){var t,n=Object(a.a)(se(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=Object(D.c)(e.state,r.from,r.to);if(i)return e.dispatch({effects:ue(e.state,[oe.of(i),fe(e,i)])}),!0}}catch(o){n.e(o)}finally{n.f()}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(le,!1))return!1;var t,n=[],r=Object(a.a)(se(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=ce(e.state,i.from,i.to);o&&n.push(ae.of(o),fe(e,o,!1))}}catch(s){r.e(s)}finally{r.f()}return n.length&&e.dispatch({effects:n}),n.length>0}},{key:"Ctrl-Alt-[",run:function(e){for(var t=e.state,n=[],r=0;r<t.doc.length;){var i=e.visualLineAt(r),o=Object(D.c)(t,i.from,i.to);o&&n.push(oe.of(o)),r=(o?e.visualLineAt(o.to):i).to+1}return n.length&&e.dispatch({effects:ue(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:function(e){var t=e.state.field(le,!1);if(!t||!t.size)return!1;var n=[];return t.between(0,e.state.doc.length,(function(e,t){n.push(ae.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],he={placeholderDOM:null,placeholderText:"\u2026"},pe=o.g.define({combine:function(e){return Object(o.m)(e,he)}});function ve(e){var t=[le,Oe];return e&&t.push(pe.of(e)),t}var me=i.b.replace({widget:new(function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(){return Object(s.a)(this,n),t.apply(this,arguments)}return Object(l.a)(n,[{key:"ignoreEvents",value:function(){return!1}},{key:"toDOM",value:function(e){var t=e.state,n=t.facet(pe),r=function(t){var n=e.visualLineAt(e.posAtDOM(t.target)),r=ce(e.state,n.from,n.to);r&&e.dispatch({effects:ae.of(r)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,r);var i=document.createElement("span");return i.textContent=n.placeholderText,i.setAttribute("aria-label",t.phrase("folded code")),i.title=t.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}}]),n}(i.g))}),ge={openText:"\u2304",closedText:"\u203a",markerDOM:null},ye=function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(e,r){var i;return Object(s.a)(this,n),(i=t.call(this)).config=e,i.open=r,i}return Object(l.a)(n,[{key:"eq",value:function(e){return this.config==e.config&&this.open==e.open}},{key:"toDOM",value:function(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);var t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}]),n}(N);function be(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},ge),e),n=new ye(t,!0),r=new ye(t,!1),o=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.from=t.viewport.from,this.markers=this.buildMarkers(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.docChanged||e.viewportChanged||e.startState.facet(D.i)!=e.state.facet(D.i)||e.startState.field(le,!1)!=e.state.field(le,!1))&&(this.markers=this.buildMarkers(e.view))}},{key:"buildMarkers",value:function(e){var t=new R.b;return e.viewportLines((function(i){var o=ce(e.state,i.from,i.to)?r:Object(D.c)(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)})),t.finish()}}]),e}());return[o,$({class:"cm-foldGutter",markers:function(e){var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.markers)||R.a.empty},initialSpacer:function(){return new ye(t,!1)},domEventHandlers:{click:function(e,t){var n=ce(e.state,t.from,t.to);if(n)return e.dispatch({effects:ae.of(n)}),!0;var r=Object(D.c)(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:oe.of(r)}),!0)}}}),ve()]}var Oe=i.d.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),ke=n(103),we=n(65),xe=n(15),je={brackets:["(","[","{","'",'"'],before:")]}'\":;>"},Se=o.j.define({map:function(e,t){var n=t.mapPos(e,-1,o.h.TrackAfter);return null==n?void 0:n}}),Ee=o.j.define({map:function(e,t){return t.mapPos(e)}}),Ce=new(function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(){return Object(s.a)(this,n),t.apply(this,arguments)}return n}(R.c));Ce.startSide=1,Ce.endSide=-1;var Me=o.k.define({create:function(){return R.a.empty},update:function(e,t){if(t.selection){var n=t.state.doc.lineAt(t.selection.main.head).from,r=t.startState.doc.lineAt(t.startState.selection.main.head).from;n!=t.changes.mapPos(r,-1)&&(e=R.a.empty)}e=e.map(t.changes);var i,o=Object(a.a)(t.effects);try{var s=function(){var t=i.value;t.is(Se)?e=e.update({add:[Ce.range(t.value,t.value+1)]}):t.is(Ee)&&(e=e.update({filter:function(e){return e!=t.value}}))};for(o.s();!(i=o.n()).done;)s()}catch(l){o.e(l)}finally{o.f()}return e}});function Pe(){return[i.d.inputHandler.of(Re),Me]}var Te="()[]{}<>";function Ae(e){for(var t=0;t<Te.length;t+=2)if(Te.charCodeAt(t)==e)return Te.charAt(t+1);return Object(xe.g)(e<128?e:e+1)}function De(e,t){return e.languageDataAt("closeBrackets",t)[0]||je}function Re(e,t,n,r){if(e.composing)return!1;var i=e.state.selection.main;if(r.length>2||2==r.length&&1==Object(xe.c)(Object(xe.b)(r,0))||t!=i.from||n!=i.to)return!1;var o=function(e,t){var n,r=De(e,e.selection.main.head),i=r.brackets||je.brackets,o=Object(a.a)(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=Ae(Object(xe.b)(s,0));if(t==s)return l==s?ze(e,s,i.indexOf(s+s+s)>-1):Ie(e,s,l,r.before||je.before);if(t==l&&_e(e,e.selection.main.from))return $e(e,s,l)}}catch(c){o.e(c)}finally{o.f()}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}var Ne=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch,r=De(t,t.selection.main.head).brackets||je.brackets,i=null,s=t.changeByRange((function(e){if(e.empty){var n,s=function(e,t){var n=e.sliceString(t-2,t);return Object(xe.c)(Object(xe.b)(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),l=Object(a.a)(r);try{for(l.s();!(n=l.n()).done;){var c=n.value;if(c==s&&Le(t.doc,e.head)==Ae(Object(xe.b)(c,0)))return{changes:{from:e.head-c.length,to:e.head+c.length},range:o.e.cursor(e.head-c.length),userEvent:"delete.backward"}}}catch(u){l.e(u)}finally{l.f()}}return{range:i=e}}));return i||n(t.update(s,{scrollIntoView:!0})),!i}}];function _e(e,t){var n=!1;return e.field(Me).between(0,e.doc.length,(function(e){e==t&&(n=!0)})),n}function Le(e,t){var n=e.sliceString(t,t+2);return n.slice(0,Object(xe.c)(Object(xe.b)(n,0)))}function Ie(e,t,n,r){var i=null,a=e.changeByRange((function(a){if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:Se.of(a.to+t.length),range:o.e.range(a.anchor+t.length,a.head+t.length)};var s=Le(e.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:a.head},effects:Se.of(a.head+t.length),range:o.e.cursor(a.head+t.length)}:{range:i=a}}));return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function $e(e,t,n){var r=null,i=e.selection.ranges.map((function(t){return t.empty&&Le(e.doc,t.head)==n?o.e.cursor(t.head+n.length):r=t}));return r?null:e.update({selection:o.e.create(i,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map((function(e){var t=e.from;return Ee.of(t)}))})}function ze(e,t,n){var r=null,i=e.changeByRange((function(i){if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:Se.of(i.to+t.length),range:o.e.range(i.anchor+t.length,i.head+t.length)};var a=i.head,s=Le(e.doc,a);if(s==t){if(Be(e,a))return{changes:{insert:t+t,from:a},effects:Se.of(a+t.length),range:o.e.cursor(a+t.length)};if(_e(e,a)){var l=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:o.e.cursor(a+t.length*(l?3:1)),effects:Ee.of(a)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&Be(e,a-2*t.length))return{changes:{insert:t+t+t+t,from:a},effects:Se.of(a+t.length),range:o.e.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=o.d.Word){var c=e.sliceDoc(a-1,a);if(c!=t&&e.charCategorizer(a)(c)!=o.d.Word)return{changes:{insert:t+t,from:a},effects:Se.of(a+t.length),range:o.e.cursor(a+t.length)}}}return{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Be(e,t){var n=Object(D.j)(e).resolveInner(t+1);return n.parent&&n.from==t}var Fe=n(13),We=n(61),Ve=n(28),He="function"==typeof String.prototype.normalize?function(e){return e.normalize("NFKD")}:function(e){return e},Qe=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,o=arguments.length>4?arguments[4]:void 0;Object(s.a)(this,e),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(e){return o(He(e))}:He,this.query=this.normalize(n)}return Object(l.a)(e,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Object(xe.b)(this.buffer,this.bufferPos)}},{key:"next",value:function(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}},{key:"nextOverlapping",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=Object(xe.g)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Object(xe.c)(e);for(var r=this.normalize(t),i=0,o=n;;i++){var a=r.charCodeAt(i),s=this.match(a,o);if(s)return this.value=s,this;if(i==r.length-1)break;o==n&&i<t.length&&t.charCodeAt(i)==a&&o++}}}},{key:"match",value:function(e,t){for(var n=null,r=0;r<this.matches.length;r+=2){var i=this.matches[r],o=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?n={from:this.matches[r+1],to:t+1}:(this.matches[r]++,o=!0)),o||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?n={from:t,to:t+1}:this.matches.push(1,t)),n}}]),e}(),qe={from:-1,to:-1,match:/.*/.exec("")},Ue="gm"+(null==/x/.unicode?"":"u"),Xe=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.length;if(Object(s.a)(this,e),this.to=o,this.curLine="",this.done=!1,this.value=qe,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Ke(t,n,r,i,o);this.re=new RegExp(n,Ue+((null===r||void 0===r?void 0:r.ignoreCase)?"i":"")),this.iter=t.iter();var a=t.lineAt(i);this.curLineStart=a.from,this.matchPos=i,this.getLine(this.curLineStart)}return Object(l.a)(e,[{key:"getLine",value:function(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}},{key:"nextLine",value:function(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}},{key:"next",value:function(){for(var e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;var t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){var n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=r+(n==r?1:0),n==this.curLine.length&&this.nextLine(),n<r||n>this.value.to)return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}]),e}(),Ye=new WeakMap,Ge=function(){function e(t,n){Object(s.a)(this,e),this.from=t,this.text=n}return Object(l.a)(e,[{key:"to",get:function(){return this.from+this.text.length}}],[{key:"get",value:function(t,n,r){var i=Ye.get(t);if(!i||i.from>=r||i.to<=n){var o=new e(n,t.sliceString(n,r));return Ye.set(t,o),o}if(i.from==n&&i.to==r)return i;var a=i.text,s=i.from;return s>n&&(a=t.sliceString(n,s)+a,s=n),i.to<r&&(a+=t.sliceString(i.to,r)),Ye.set(t,new e(s,a)),new e(n,a.slice(n-s,r-s))}}]),e}(),Ke=function(){function e(t,n,r,i,o){Object(s.a)(this,e),this.text=t,this.to=o,this.done=!1,this.value=qe,this.matchPos=i,this.re=new RegExp(n,Ue+((null===r||void 0===r?void 0:r.ignoreCase)?"i":"")),this.flat=Ge.get(t,i,this.chunkEnd(i+5e3))}return Object(l.a)(e,[{key:"chunkEnd",value:function(e){return e>=this.to?this.to:this.text.lineAt(e).to}},{key:"next",value:function(){for(;;){var e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.to<this.to&&t.index+t[0].length>this.flat.text.length-10&&(t=null),t){var n=this.flat.from+t.index,r=n+t[0].length;return this.value={from:n,to:r,match:t},this.matchPos=r+(n==r?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ge.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}]),e}();function Je(e){var t=Object(Ve.a)("input",{class:"cm-textfield",name:"line"});function n(){var n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(n){var r=e.state,i=r.doc.lineAt(r.selection.main.head),a=Object(Fe.a)(n,5),s=a[1],l=a[2],c=a[3],u=a[4],f=c?+c.slice(1):0,d=l?+l:i.number;if(l&&u){var h=d/100;s&&(h=h*("-"==s?-1:1)+i.number/r.doc.lines),d=Math.round(r.doc.lines*h)}else l&&s&&(d=d*("-"==s?-1:1)+i.number);var p=r.doc.line(Math.max(1,Math.min(r.doc.lines,d)));e.dispatch({effects:Ze.of(!1),selection:o.e.cursor(p.from+Math.max(0,Math.min(f,p.length))),scrollIntoView:!0}),e.focus()}}return{dom:Object(Ve.a)("form",{class:"cm-gotoLine",onkeydown:function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({effects:Ze.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:function(e){e.preventDefault(),n()}},Object(Ve.a)("label",e.state.phrase("Go to line"),": ",t)," ",Object(Ve.a)("button",{class:"cm-button",type:"submit"},e.state.phrase("go"))),pos:-10}}var Ze=o.j.define(),et=o.k.define({create:function(){return!0},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(Ze)&&(e=i.value)}}catch(o){r.e(o)}finally{r.f()}return e},provide:function(e){return We.b.from(e,(function(e){return e?Je:null}))}}),tt=i.d.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),nt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},rt=o.g.define({combine:function(e){return Object(o.m)(e,nt,{highlightWordAroundCursor:function(e,t){return e||t},minSelectionLength:Math.min,maxMatches:Math.min})}});function it(e){var t=[lt,st];return e&&t.push(rt.of(e)),t}var ot=i.b.mark({class:"cm-selectionMatch"}),at=i.b.mark({class:"cm-selectionMatch cm-selectionMatch-main"}),st=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t=e.state.facet(rt),n=e.state,r=n.selection;if(r.ranges.length>1)return i.b.none;var s,l=r.main,c=null;if(l.empty){if(!t.highlightWordAroundCursor)return i.b.none;var u=n.wordAt(l.head);if(!u)return i.b.none;c=n.charCategorizer(l.head),s=n.sliceDoc(u.from,u.to)}else{var f=l.to-l.from;if(f<t.minSelectionLength||f>200)return i.b.none;if(!(s=n.sliceDoc(l.from,l.to).trim()))return i.b.none}var d,h=[],p=Object(a.a)(e.visibleRanges);try{for(p.s();!(d=p.n()).done;)for(var v=d.value,m=new Qe(n.doc,s,v.from,v.to);!m.next().done;){var g=m.value,y=g.from,b=g.to;if((!c||(0==y||c(n.sliceDoc(y-1,y))!=o.d.Word)&&(b==n.doc.length||c(n.sliceDoc(b,b+1))!=o.d.Word))&&(c&&y<=l.from&&b>=l.to?h.push(at.range(y,b)):(y>=l.to||b<=l.from)&&h.push(ot.range(y,b)),h.length>t.maxMatches))return i.b.none}}catch(O){p.e(O)}finally{p.f()}return i.b.set(h)}}]),e}(),{decorations:function(e){return e.decorations}}),lt=i.d.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});var ct=o.g.define({combine:function(e){var t=e.some((function(e){return e.matchCase}));return{top:e.some((function(e){return e.top})),matchCase:void 0===t||t}}});var ut=function(){function e(t,n,r){Object(s.a)(this,e),this.search=t,this.replace=n,this.caseInsensitive=r}return Object(l.a)(e,[{key:"eq",value:function(e){return this.search==e.search&&this.replace==e.replace&&this.caseInsensitive==e.caseInsensitive&&this.constructor==e.constructor}}]),e}(),ft=function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(e,r,i){var o;return Object(s.a)(this,n),(o=t.call(this,e,r,i)).unquoted=e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"})),o}return Object(l.a)(n,[{key:"cursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Qe(e,this.unquoted,t,n,this.caseInsensitive?function(e){return e.toLowerCase()}:void 0)}},{key:"nextMatch",value:function(e,t,n){var r=this.cursor(e,n).nextOverlapping();return r.done&&(r=this.cursor(e,0,t).nextOverlapping()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(e,t,n){for(var r=n;;){for(var i=Math.max(t,r-1e4-this.unquoted.length),o=this.cursor(e,i,r),a=null;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(i==t)return null;r-=1e4}}},{key:"prevMatch",value:function(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}},{key:"getReplacement",value:function(e){return this.replace}},{key:"matchAll",value:function(e,t){for(var n=this.cursor(e),r=[];!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=this.cursor(e,Math.max(0,t-this.unquoted.length),Math.min(n+this.unquoted.length,e.length));!i.next().done;)r(i.value.from,i.value.to)}},{key:"valid",get:function(){return!!this.search}}]),n}(ut),dt=function(e){Object(T.a)(n,e);var t=Object(A.a)(n);function n(e,r,i){var o;return Object(s.a)(this,n),(o=t.call(this,e,r,i)).valid=!!e&&function(e){try{return new RegExp(e,Ue),!0}catch(t){return!1}}(e),o}return Object(l.a)(n,[{key:"cursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Xe(e,this.search,this.caseInsensitive?{ignoreCase:!0}:void 0,t,n)}},{key:"nextMatch",value:function(e,t,n){var r=this.cursor(e,n).next();return r.done&&(r=this.cursor(e,0,t).next()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(e,t,n){for(var r=1;;r++){for(var i=Math.max(t,n-1e4*r),o=this.cursor(e,i,n),a=null;!o.next().done;)a=o.value;if(a&&(i==t||a.from>i+10))return a;if(i==t)return null}}},{key:"prevMatch",value:function(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}},{key:"getReplacement",value:function(e){return this.replace.replace(/\$([$&\d+])/g,(function(t,n){return"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n<e.match.length?e.match[n]:t}))}},{key:"matchAll",value:function(e,t){for(var n=this.cursor(e),r=[];!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=this.cursor(e,Math.max(0,t-250),Math.min(n+250,e.length));!i.next().done;)r(i.value.from,i.value.to)}}]),n}(ut),ht=o.j.define(),pt=o.j.define(),vt=o.k.define({create:function(e){return new mt(Ct(e),Et)},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(ht)?e=new mt(i.value,e.panel):i.is(pt)&&(e=new mt(e.query,i.value?Et:null))}}catch(o){r.e(o)}finally{r.f()}return e},provide:function(e){return We.b.from(e,(function(e){return e.panel}))}}),mt=function e(t,n){Object(s.a)(this,e),this.query=t,this.panel=n},gt=i.b.mark({class:"cm-searchMatch"}),yt=i.b.mark({class:"cm-searchMatch cm-searchMatch-selected"}),bt=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.decorations=this.highlight(t.state.field(vt))}return Object(l.a)(e,[{key:"update",value:function(e){var t=e.state.field(vt);(t!=e.startState.field(vt)||e.docChanged||e.selectionSet)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel||!t.valid)return i.b.none;for(var n=this.view,r=new R.b,o=0,a=n.visibleRanges,s=a.length;o<s;o++){for(var l=a[o],c=l.from,u=l.to;o<s-1&&u>a[o+1].from-500;)u=a[++o].to;t.highlight(n.state.doc,c,u,(function(e,t){var i=n.state.selection.ranges.some((function(n){return n.from==e&&n.to==t}));r.add(e,t,i?yt:gt)}))}return r.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function Ot(e){return function(t){var n=t.state.field(vt,!1);return n&&n.query.valid?e(t,n):Mt(t)}}var kt=Ot((function(e,t){var n=t.query,r=e.state.selection.main,i=r.from,o=r.to,a=n.nextMatch(e.state.doc,i,o);return!(!a||a.from==i&&a.to==o)&&(e.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0,effects:Rt(e,a)}),!0)})),wt=Ot((function(e,t){var n=t.query,r=e.state,i=r.selection.main,o=i.from,a=i.to,s=n.prevMatch(r.doc,o,a);return!!s&&(e.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:Rt(e,s)}),!0)})),xt=Ot((function(e,t){var n=t.query.matchAll(e.state.doc,1e3);return!(!n||!n.length)&&(e.dispatch({selection:o.e.create(n.map((function(e){return o.e.range(e.from,e.to)})))}),!0)})),jt=Ot((function(e,t){var n=t.query,r=e.state,i=r.selection.main,o=i.from,a=i.to;if(r.readOnly)return!1;var s=n.nextMatch(r.doc,o,o);if(!s)return!1;var l,c,u=[];if(s.from==o&&s.to==a&&(c=r.toText(n.getReplacement(s)),u.push({from:s.from,to:s.to,insert:c}),s=n.nextMatch(r.doc,s.from,s.to)),s){var f=0==u.length||u[0].from>=s.to?0:s.to-s.from-c.length;l={anchor:s.from-f,head:s.to-f}}return e.dispatch({changes:u,selection:l,scrollIntoView:!!l,effects:s?Rt(e,s):void 0}),!0})),St=Ot((function(e,t){var n=t.query;if(e.state.readOnly)return!1;var r=n.matchAll(e.state.doc,1e9).map((function(e){return{from:e.from,to:e.to,insert:n.getReplacement(e)}}));return!!r.length&&(e.dispatch({changes:r}),!0)}));function Et(e){var t=e.state.field(vt).query;return{dom:At({view:e,query:t,updateQuery:function(n){t.eq(n)||(t=n,e.dispatch({effects:ht.of(t)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,top:e.state.facet(ct).top}}function Ct(e,t){var n,r=e.selection.main,i=r.empty||r.to>r.from+100?"":e.sliceDoc(r.from,r.to),o=null!==(n=null===t||void 0===t?void 0:t.caseInsensitive)&&void 0!==n?n:!e.facet(ct).matchCase;return t&&!i?t:new ft(i.replace(/\n/g,"\\n"),"",o)}var Mt=function(e){var t=e.state.field(vt,!1);if(t&&t.panel){var n=Object(We.a)(e,Et);if(!n)return!1;var r=n.dom.querySelector("[name=search]");r.focus(),r.select()}else e.dispatch({effects:[pt.of(!0),t?ht.of(Ct(e.state,t.query)):o.j.appendConfig.of(_t)]});return!0},Pt=function(e){var t=e.state.field(vt,!1);if(!t||!t.panel)return!1;var n=Object(We.a)(e,Et);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:pt.of(!1)}),!0},Tt=[{key:"Mod-f",run:Mt,scope:"editor search-panel"},{key:"F3",run:kt,shift:wt,scope:"editor search-panel"},{key:"Mod-g",run:kt,shift:wt,scope:"editor search-panel"},{key:"Escape",run:Pt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(e){var t=e.state,n=e.dispatch,r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;for(var i=r.main,a=i.from,s=i.to,l=[],c=0,u=new Qe(t.doc,t.sliceDoc(a,s));!u.next().done;){if(l.length>1e3)return!1;u.value.from==a&&(c=l.length),l.push(o.e.range(u.value.from,u.value.to))}return n(t.update({selection:o.e.create(l,c)})),!0}},{key:"Alt-g",run:function(e){var t=Object(We.a)(e,Je);if(!t){var n=[Ze.of(!0)];null==e.state.field(et,!1)&&n.push(o.j.appendConfig.of([et,tt])),e.dispatch({effects:n}),t=Object(We.a)(e,Je)}return t&&t.dom.querySelector("input").focus(),!0}},{key:"Mod-d",run:function(e){var t=e.state,n=e.dispatch,r=t.selection.ranges;if(r.some((function(e){return e.from===e.to})))return function(e){var t=e.state,n=e.dispatch,r=t.selection,i=o.e.create(r.ranges.map((function(e){return t.wordAt(e.head)||o.e.cursor(e.head)})),r.mainIndex);return!i.eq(r)&&(n(t.update({selection:i})),!0)}({state:t,dispatch:n});var i=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some((function(e){return t.sliceDoc(e.from,e.to)!=i})))return!1;var a=function(e,t){for(var n=e.selection,r=n.main,i=n.ranges,o=e.wordAt(r.head),a=o&&o.from==r.from&&o.to==r.to,s=function(n,r){if(r.next(),!r.done){if(n&&i.some((function(e){return e.from==r.value.from})))return c=r,l=n,"continue";if(a){var o=e.wordAt(r.value.from);if(!o||o.from!=r.value.from||o.to!=r.value.to)return c=r,l=n,"continue"}return l=n,c=r,{v:r.value}}if(n)return c=r,l=n,{v:null};r=new Qe(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),l=n=!0,c=r},l=!1,c=new Qe(e.doc,t,i[i.length-1].to);;){var u=s(l,c);if("continue"!==u&&"object"===typeof u)return u.v}}(t,i);return!!a&&(n(t.update({selection:t.selection.addRange(o.e.range(a.from,a.to),!1),scrollIntoView:!0})),!0)},preventDefault:!0}];function At(e){function t(t){return e.view.state.phrase(t)}var n=Object(Ve.a)("input",{value:e.query.search,placeholder:t("Find"),"aria-label":t("Find"),class:"cm-textfield",name:"search",onchange:s,onkeyup:s}),r=Object(Ve.a)("input",{value:e.query.replace,placeholder:t("Replace"),"aria-label":t("Replace"),class:"cm-textfield",name:"replace",onchange:s,onkeyup:s}),o=Object(Ve.a)("input",{type:"checkbox",name:"case",checked:!e.query.caseInsensitive,onchange:s}),a=Object(Ve.a)("input",{type:"checkbox",name:"re",checked:e.query instanceof dt,onchange:s});function s(){e.updateQuery(new(a.checked?dt:ft)(n.value,r.value,!o.checked))}function l(e,t,n){return Object(Ve.a)("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}return Object(Ve.a)("div",{onkeydown:function(t){Object(i.m)(e.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==n?(t.preventDefault(),(t.shiftKey?wt:kt)(e.view)):13==t.keyCode&&t.target==r&&(t.preventDefault(),jt(e.view))},class:"cm-search"},[n,l("next",(function(){return kt(e.view)}),[t("next")]),l("prev",(function(){return wt(e.view)}),[t("previous")]),l("select",(function(){return xt(e.view)}),[t("all")]),Object(Ve.a)("label",null,[o,t("match case")]),Object(Ve.a)("label",null,[a,t("regexp")]),Object(Ve.a)("br"),r,l("replace",(function(){return jt(e.view)}),[t("replace")]),l("replaceAll",(function(){return St(e.view)}),[t("replace all")]),Object(Ve.a)("button",{name:"close",onclick:function(){return Pt(e.view)},"aria-label":t("close"),type:"button"},["\xd7"])])}var Dt=/[\s\.,:;?!]/;function Rt(e,t){var n=t.from,r=t.to,o=e.state.doc.lineAt(n).from,a=e.state.doc.lineAt(r).to,s=Math.max(o,n-30),l=Math.min(a,r+30),c=e.state.sliceDoc(s,l);if(s!=o)for(var u=0;u<30;u++)if(!Dt.test(c[u+1])&&Dt.test(c[u])){c=c.slice(u);break}if(l!=a)for(var f=c.length-1;f>c.length-30;f--)if(!Dt.test(c[f-1])&&Dt.test(c[f])){c=c.slice(0,f);break}return i.d.announce.of("".concat(e.state.phrase("current match"),". ").concat(c," ").concat(e.state.phrase("on line")," ").concat(e.state.doc.lineAt(n).number))}var Nt=i.d.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),_t=[vt,o.i.fallback(bt),Nt],Lt=n(60);function It(e,t){return function(n){var r=n.state,i=n.dispatch,o=e(t,r.selection.ranges,r);return!!o&&(i(r.update(o)),!0)}}var $t=It(Vt,0),zt=It(Wt,0),Bt=[{key:"Mod-/",run:function(e){var t=Ft(e.state);return t.line?$t(e):!!t.block&&zt(e)}},{key:"Alt-A",run:zt}];function Ft(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selection.main.head,n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function Wt(e,t,n){var r=t.map((function(e){return Ft(n,e.from).block}));if(!r.every((function(e){return e})))return null;var i=t.map((function(e,t){return function(e,t,n,r){var i,o,a=t.open,s=t.close,l=e.sliceDoc(n-50,n),c=e.sliceDoc(r,r+50),u=/\s*$/.exec(l)[0].length,f=/^\s*/.exec(c)[0].length,d=l.length-u;if(l.slice(d-a.length,d)==a&&c.slice(f,f+s.length)==s)return{open:{pos:n-u,margin:u&&1},close:{pos:r+f,margin:f&&1}};r-n<=100?i=o=e.sliceDoc(n,r):(i=e.sliceDoc(n,n+50),o=e.sliceDoc(r-50,r));var h=/^\s*/.exec(i)[0].length,p=/\s*$/.exec(o)[0].length,v=o.length-p-s.length;return i.slice(h,h+a.length)==a&&o.slice(v,v+s.length)==s?{open:{pos:n+h+a.length,margin:/\s/.test(i.charAt(h+a.length))?1:0},close:{pos:r-p-s.length,margin:/\s/.test(o.charAt(v-1))?1:0}}:null}(n,r[t],e.from,e.to)}));if(2!=e&&!i.every((function(e){return e}))){var a=0;return n.changeByRange((function(e){var t=r[a++],n=t.open,s=t.close;if(i[a])return{range:e};var l=n.length+1;return{changes:[{from:e.from,insert:n+" "},{from:e.to,insert:" "+s}],range:o.e.range(e.anchor+l,e.head+l)}}))}if(1!=e&&i.some((function(e){return e}))){for(var s,l=[],c=0;c<i.length;c++)if(s=i[c]){var u=r[c],f=s,d=f.open,h=f.close;l.push({from:d.pos-u.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+u.close.length})}return{changes:l}}return null}function Vt(e,t,n){var r,i=[],o=-1,s=Object(a.a)(t);try{for(s.s();!(r=s.n()).done;){for(var l=r.value,c=l.from,u=l.to,f=i.length,d=1e9,h=c;h<=u;){var p=n.doc.lineAt(h);if(p.from>o&&(c==u||u>p.from)){o=p.from;var v=Ft(n,h).line;if(!v)continue;var m=/^\s*/.exec(p.text)[0].length,g=m==p.length,y=p.text.slice(m,m+v.length)==v?m:-1;m<p.text.length&&m<d&&(d=m),i.push({line:p,comment:y,token:v,indent:m,empty:g,single:!1})}h=p.to+1}if(d<1e9)for(var b=f;b<i.length;b++)i[b].indent<i[b].line.text.length&&(i[b].indent=d);i.length==f+1&&(i[f].single=!0)}}catch($){s.e($)}finally{s.f()}if(2!=e&&i.some((function(e){return e.comment<0&&(!e.empty||e.single)}))){var O,k=[],w=Object(a.a)(i);try{for(w.s();!(O=w.n()).done;){var x=O.value,j=x.line,S=x.token,E=x.indent,C=x.empty;!x.single&&C||k.push({from:j.from+E,insert:S+" "})}}catch($){w.e($)}finally{w.f()}var M=n.changes(k);return{changes:M,selection:n.selection.map(M,1)}}if(1!=e&&i.some((function(e){return e.comment>=0}))){var P,T=[],A=Object(a.a)(i);try{for(A.s();!(P=A.n()).done;){var D=P.value,R=D.line,N=D.comment,_=D.token;if(N>=0){var L=R.from+N,I=L+_.length;" "==R.text[I-R.from]&&I++,T.push({from:L,to:I})}}}catch($){A.e($)}finally{A.f()}return{changes:T}}return null}var Ht=2e3;function Qt(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>Ht?-1:i==r.length?function(e,t){var n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):Object(xe.d)(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function qt(e,t){var n=Qt(e,t),r=e.state.selection;return n?{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get:function(t,i,a){var s=Qt(e,t);if(!s)return r;var l=function(e,t,n){var r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>Ht||n.off>Ht||t.col<0||n.col<0)for(var s=Math.min(t.off,n.off),l=Math.max(t.off,n.off),c=r;c<=i;c++){var u=e.doc.line(c);u.length<=l&&a.push(o.e.range(u.from+s,u.to+l))}else for(var f=Math.min(t.col,n.col),d=Math.max(t.col,n.col),h=r;h<=i;h++){var p=e.doc.line(h),v=Object(xe.f)(p.text,f,e.tabSize,!0);if(v>-1){var m=Object(xe.f)(p.text,d,e.tabSize);a.push(o.e.range(p.from+v,p.from+m))}}return a}(e.state,n,s);return l.length?a?o.e.create(l.concat(r.ranges)):o.e.create(l):r}}:null}function Ut(e){var t=(null===e||void 0===e?void 0:e.eventFilter)||function(e){return e.altKey&&0==e.button};return i.d.mouseSelectionStyle.of((function(e,n){return t(n)?qt(e,n):null}))}var Xt=n(32),Yt=n(102),Gt=[Z(),re(),Object(i.j)(),p(),be(),Object(i.h)(),o.f.allowMultipleSelections.of(!0),Object(D.f)(),Xt.a.fallback,Object(we.a)(),Pe(),Object(Lt.a)(),Ut(),Object(i.i)(),it(),i.k.of([].concat(Object(r.a)(Ne),Object(r.a)(ke.a),Object(r.a)(Tt),Object(r.a)(P),Object(r.a)(de),Object(r.a)(Bt),Object(r.a)(Lt.b),Object(r.a)(Yt.a)))]},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=n.n(r),o=n(92);function a(){return i.a.useContext(o.a)}},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(10),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.component,c=void 0===l?"div":l,u=e.square,f=void 0!==u&&u,d=e.elevation,h=void 0===d?1:d,p=e.variant,v=void 0===p?"elevation":p,m=Object(r.a)(e,["classes","className","component","square","elevation","variant"]);return o.createElement(c,Object(i.a)({className:Object(a.a)(n.root,s,"outlined"===v?n.outlined:n["elevation".concat(h)],!f&&n.rounded),ref:t},m))}));t.a=Object(s.a)((function(e){var t={};return e.shadows.forEach((function(e,n){t["elevation".concat(n)]={boxShadow:e}})),Object(i.a)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},t)}),{name:"MuiPaper"})(l)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(16),c=o.forwardRef((function(e,t){var n=e.children,s=e.classes,c=e.className,u=e.color,f=void 0===u?"inherit":u,d=e.component,h=void 0===d?"svg":d,p=e.fontSize,v=void 0===p?"medium":p,m=e.htmlColor,g=e.titleAccess,y=e.viewBox,b=void 0===y?"0 0 24 24":y,O=Object(i.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return o.createElement(h,Object(r.a)({className:Object(a.a)(s.root,c,"inherit"!==f&&s["color".concat(Object(l.a)(f))],"default"!==v&&"medium"!==v&&s["fontSize".concat(Object(l.a)(v))]),focusable:"false",viewBox:b,color:m,"aria-hidden":!g||void 0,role:g?"img":void 0,ref:t},O),n,g?o.createElement("title",null,g):null)}));c.muiName="SvgIcon",t.a=Object(s.a)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(c)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(22),c=n(87),u=n(16),f=o.forwardRef((function(e,t){var n=e.edge,s=void 0!==n&&n,l=e.children,f=e.classes,d=e.className,h=e.color,p=void 0===h?"default":h,v=e.disabled,m=void 0!==v&&v,g=e.disableFocusRipple,y=void 0!==g&&g,b=e.size,O=void 0===b?"medium":b,k=Object(i.a)(e,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return o.createElement(c.a,Object(r.a)({className:Object(a.a)(f.root,d,"default"!==p&&f["color".concat(Object(u.a)(p))],m&&f.disabled,"small"===O&&f["size".concat(Object(u.a)(O))],{start:f.edgeStart,end:f.edgeEnd}[s]),centerRipple:!0,focusRipple:!y,disabled:m,ref:t},k),o.createElement("span",{className:f.label},l))}));t.a=Object(s.a)((function(e){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:e.palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:Object(l.a)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:e.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(l.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(l.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:e.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(f)},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(109),i=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,l=60112;t.Suspense=60113;var c=60115,u=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;i=f("react.element"),o=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),a=f("react.provider"),s=f("react.context"),l=f("react.forward_ref"),t.Suspense=f("react.suspense"),c=f("react.memo"),u=f("react.lazy")}var d="function"===typeof Symbol&&Symbol.iterator;function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function m(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||p}function g(){}function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||p}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(h(85));this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=m.prototype;var b=y.prototype=new g;b.constructor=y,r(b,m.prototype),b.isPureReactComponent=!0;var O={current:null},k=Object.prototype.hasOwnProperty,w={key:!0,ref:!0,__self:!0,__source:!0};function x(e,t,n){var r,o={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)k.call(t,r)&&!w.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:i,type:e,key:a,ref:s,props:o,_owner:O.current}}function j(e){return"object"===typeof e&&null!==e&&e.$$typeof===i}var S=/\/+/g;function E(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function C(e,t,n,r,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case o:l=!0}}if(l)return a=a(l=e),e=""===r?"."+E(l,0):r,Array.isArray(a)?(n="",null!=e&&(n=e.replace(S,"$&/")+"/"),C(a,t,n,"",(function(e){return e}))):null!=a&&(j(a)&&(a=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(S,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=r+E(s=e[c],c);l+=C(s,t,n,u,a)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),c=0;!(s=e.next()).done;)l+=C(s=s.value,t,n,u=r+E(s,c++),a);else if("object"===s)throw t=""+e,Error(h(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function M(e,t,n){if(null==e)return e;var r=[],i=0;return C(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function P(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var T={current:null};function A(){var e=T.current;if(null===e)throw Error(h(321));return e}var D={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:O,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:M,forEach:function(e,t,n){M(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return M(e,(function(){t++})),t},toArray:function(e){return M(e,(function(e){return e}))||[]},only:function(e){if(!j(e))throw Error(h(143));return e}},t.Component=m,t.PureComponent=y,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(h(267,e));var o=r({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,l=O.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)k.call(t,u)&&!w.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){c=Array(u);for(var f=0;f<u;f++)c[f]=arguments[f+2];o.children=c}return{$$typeof:i,type:e.type,key:a,ref:s,props:o,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=x,t.createFactory=function(e){var t=x.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=j,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:P}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return A().useCallback(e,t)},t.useContext=function(e,t){return A().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return A().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return A().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return A().useLayoutEffect(e,t)},t.useMemo=function(e,t){return A().useMemo(e,t)},t.useReducer=function(e,t,n){return A().useReducer(e,t,n)},t.useRef=function(e){return A().useRef(e)},t.useState=function(e){return A().useState(e)},t.version="17.0.2"},function(e,t,n){"use strict";var r=n(0),i=n(109),o=n(177);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));var s=new Set,l={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(l[e]=t,e=0;e<t.length;e++)s.add(t[e])}var f=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h=Object.prototype.hasOwnProperty,p={},v={};function m(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function O(e,t,n,r){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!h.call(v,e)||!h.call(p,e)&&(d.test(e)?v[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,b);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var k=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=60103,x=60106,j=60107,S=60108,E=60114,C=60109,M=60110,P=60112,T=60113,A=60120,D=60115,R=60116,N=60121,_=60128,L=60129,I=60130,$=60131;if("function"===typeof Symbol&&Symbol.for){var z=Symbol.for;w=z("react.element"),x=z("react.portal"),j=z("react.fragment"),S=z("react.strict_mode"),E=z("react.profiler"),C=z("react.provider"),M=z("react.context"),P=z("react.forward_ref"),T=z("react.suspense"),A=z("react.suspense_list"),D=z("react.memo"),R=z("react.lazy"),N=z("react.block"),z("react.scope"),_=z("react.opaque.id"),L=z("react.debug_trace_mode"),I=z("react.offscreen"),$=z("react.legacy_hidden")}var B,F="function"===typeof Symbol&&Symbol.iterator;function W(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=F&&e[F]||e["@@iterator"])?e:null}function V(e){if(void 0===B)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);B=t&&t[1]||""}return"\n"+B+e}var H=!1;function Q(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"===typeof l.stack){for(var i=l.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?V(e):""}function q(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=Q(e.type,!1);case 11:return e=Q(e.type.render,!1);case 22:return e=Q(e.type._render,!1);case 1:return e=Q(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case j:return"Fragment";case x:return"Portal";case E:return"Profiler";case S:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case M:return(e.displayName||"Context")+".Consumer";case C:return(e._context.displayName||"Context")+".Provider";case P:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case D:return U(e.type);case N:return U(e._render);case R:t=e._payload,e=e._init;try{return U(e(t))}catch(n){}}return null}function X(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Y(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function G(e){e._valueTracker||(e._valueTracker=function(e){var t=Y(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function K(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function J(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=X(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&O(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=X(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,X(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function oe(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ae(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+X(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:X(n)}}function ce(e,t){var n=X(t.value),r=X(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var fe="http://www.w3.org/1999/xhtml",de="http://www.w3.org/2000/svg";function he(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?he(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ve,me,ge=(me=function(e,t){if(e.namespaceURI!==de||"innerHTML"in e)e.innerHTML=t;else{for((ve=ve||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ve.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return me(e,t)}))}:me);function ye(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Oe=["Webkit","ms","Moz","O"];function ke(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function we(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=ke(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(be).forEach((function(e){Oe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var xe=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function je(e,t){if(t){if(xe[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function Se(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Ee(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ce=null,Me=null,Pe=null;function Te(e){if(e=ri(e)){if("function"!==typeof Ce)throw Error(a(280));var t=e.stateNode;t&&(t=oi(t),Ce(e.stateNode,e.type,t))}}function Ae(e){Me?Pe?Pe.push(e):Pe=[e]:Me=e}function De(){if(Me){var e=Me,t=Pe;if(Pe=Me=null,Te(e),t)for(e=0;e<t.length;e++)Te(t[e])}}function Re(e,t){return e(t)}function Ne(e,t,n,r,i){return e(t,n,r,i)}function _e(){}var Le=Re,Ie=!1,$e=!1;function ze(){null===Me&&null===Pe||(_e(),De())}function Be(e,t){var n=e.stateNode;if(null===n)return null;var r=oi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var Fe=!1;if(f)try{var We={};Object.defineProperty(We,"passive",{get:function(){Fe=!0}}),window.addEventListener("test",We,We),window.removeEventListener("test",We,We)}catch(me){Fe=!1}function Ve(e,t,n,r,i,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var He=!1,Qe=null,qe=!1,Ue=null,Xe={onError:function(e){He=!0,Qe=e}};function Ye(e,t,n,r,i,o,a,s,l){He=!1,Qe=null,Ve.apply(Xe,arguments)}function Ge(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ke(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Je(e){if(Ge(e)!==e)throw Error(a(188))}function Ze(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ge(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Je(i),e;if(o===r)return Je(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,it,ot=!1,at=[],st=null,lt=null,ct=null,ut=new Map,ft=new Map,dt=[],ht="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function vt(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":lt=null;break;case"mouseover":case"mouseout":ct=null;break;case"pointerover":case"pointerout":ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ft.delete(t.pointerId)}}function mt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e=pt(t,n,r,i,o),null!==t&&(null!==(t=ri(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function gt(e){var t=ni(e.target);if(null!==t){var n=Ge(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ke(n)))return e.blockedOn=t,void it(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function yt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ri(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){yt(e)&&n.delete(t)}function Ot(){for(ot=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ri(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==st&&yt(st)&&(st=null),null!==lt&&yt(lt)&&(lt=null),null!==ct&&yt(ct)&&(ct=null),ut.forEach(bt),ft.forEach(bt)}function kt(e,t){e.blockedOn===t&&(e.blockedOn=null,ot||(ot=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Ot)))}function wt(e){function t(t){return kt(t,e)}if(0<at.length){kt(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&kt(st,e),null!==lt&&kt(lt,e),null!==ct&&kt(ct,e),ut.forEach(t),ft.forEach(t),n=0;n<dt.length;n++)(r=dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<dt.length&&null===(n=dt[0]).blockedOn;)gt(n),null===n.blockedOn&&dt.shift()}function xt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var jt={animationend:xt("Animation","AnimationEnd"),animationiteration:xt("Animation","AnimationIteration"),animationstart:xt("Animation","AnimationStart"),transitionend:xt("Transition","TransitionEnd")},St={},Et={};function Ct(e){if(St[e])return St[e];if(!jt[e])return e;var t,n=jt[e];for(t in n)if(n.hasOwnProperty(t)&&t in Et)return St[e]=n[t];return e}f&&(Et=document.createElement("div").style,"AnimationEvent"in window||(delete jt.animationend.animation,delete jt.animationiteration.animation,delete jt.animationstart.animation),"TransitionEvent"in window||delete jt.transitionend.transition);var Mt=Ct("animationend"),Pt=Ct("animationiteration"),Tt=Ct("animationstart"),At=Ct("transitionend"),Dt=new Map,Rt=new Map,Nt=["abort","abort",Mt,"animationEnd",Pt,"animationIteration",Tt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",At,"transitionEnd","waiting","waiting"];function _t(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Rt.set(r,t),Dt.set(r,i),c(i,[r])}}(0,o.unstable_now)();var Lt=8;function It(e){if(0!==(1&e))return Lt=15,1;if(0!==(2&e))return Lt=14,2;if(0!==(4&e))return Lt=13,4;var t=24&e;return 0!==t?(Lt=12,t):0!==(32&e)?(Lt=11,32):0!==(t=192&e)?(Lt=10,t):0!==(256&e)?(Lt=9,256):0!==(t=3584&e)?(Lt=8,t):0!==(4096&e)?(Lt=7,4096):0!==(t=4186112&e)?(Lt=6,t):0!==(t=62914560&e)?(Lt=5,t):67108864&e?(Lt=4,67108864):0!==(134217728&e)?(Lt=3,134217728):0!==(t=805306368&e)?(Lt=2,t):0!==(1073741824&e)?(Lt=1,1073741824):(Lt=8,e)}function $t(e,t){var n=e.pendingLanes;if(0===n)return Lt=0;var r=0,i=0,o=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==o)r=o,i=Lt=15;else if(0!==(o=134217727&n)){var l=o&~a;0!==l?(r=It(l),i=Lt):0!==(s&=o)&&(r=It(s),i=Lt)}else 0!==(o=n&~a)?(r=It(o),i=Lt):0!==s&&(r=It(s),i=Lt);if(0===r)return 0;if(r=n&((0>(r=31-Ht(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0===(t&a)){if(It(t),i<=Lt)return t;Lt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-Ht(t)),r|=e[n],t&=~i;return r}function zt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Bt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Ft(24&~t))?Bt(10,t):e;case 10:return 0===(e=Ft(192&~t))?Bt(8,t):e;case 8:return 0===(e=Ft(3584&~t))&&(0===(e=Ft(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Ft(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function Ft(e){return e&-e}function Wt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ht(t)]=n}var Ht=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Qt(e)/qt|0)|0},Qt=Math.log,qt=Math.LN2;var Ut=o.unstable_UserBlockingPriority,Xt=o.unstable_runWithPriority,Yt=!0;function Gt(e,t,n,r){Ie||_e();var i=Jt,o=Ie;Ie=!0;try{Ne(i,e,t,n,r)}finally{(Ie=o)||ze()}}function Kt(e,t,n,r){Xt(Ut,Jt.bind(null,e,t,n,r))}function Jt(e,t,n,r){var i;if(Yt)if((i=0===(4&t))&&0<at.length&&-1<ht.indexOf(e))e=pt(null,e,t,n,r),at.push(e);else{var o=Zt(e,t,n,r);if(null===o)i&&vt(e,r);else{if(i){if(-1<ht.indexOf(e))return e=pt(o,e,t,n,r),void at.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return st=mt(st,e,t,n,r,i),!0;case"dragenter":return lt=mt(lt,e,t,n,r,i),!0;case"mouseover":return ct=mt(ct,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return ut.set(o,mt(ut.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,ft.set(o,mt(ft.get(o)||null,e,t,n,r,i)),!0}return!1}(o,e,t,n,r))return;vt(e,r)}_r(e,t,r,null,n)}}}function Zt(e,t,n,r){var i=Ee(r);if(null!==(i=ni(i))){var o=Ge(i);if(null===o)i=null;else{var a=o.tag;if(13===a){if(null!==(i=Ke(o)))return i;i=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return _r(e,t,r,i,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,i="value"in en?en.value:en.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return nn=i.slice(e,1<t?1-t:void 0)}function on(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function sn(){return!1}function ln(e){function t(t,n,r,i,o){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?an:sn,this.isPropagationStopped=sn,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var cn,un,fn,dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=ln(dn),pn=i({},dn,{view:0,detail:0}),vn=ln(pn),mn=i({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fn&&(fn&&"mousemove"===e.type?(cn=e.screenX-fn.screenX,un=e.screenY-fn.screenY):un=cn=0,fn=e),cn)},movementY:function(e){return"movementY"in e?e.movementY:un}}),gn=ln(mn),yn=ln(i({},mn,{dataTransfer:0})),bn=ln(i({},pn,{relatedTarget:0})),On=ln(i({},dn,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=i({},dn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wn=ln(kn),xn=ln(i({},dn,{data:0})),jn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},En={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=En[e])&&!!t[e]}function Mn(){return Cn}var Pn=i({},pn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=on(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mn,charCode:function(e){return"keypress"===e.type?on(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?on(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Tn=ln(Pn),An=ln(i({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Dn=ln(i({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mn})),Rn=ln(i({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nn=i({},mn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_n=ln(Nn),Ln=[9,13,27,32],In=f&&"CompositionEvent"in window,$n=null;f&&"documentMode"in document&&($n=document.documentMode);var zn=f&&"TextEvent"in window&&!$n,Bn=f&&(!In||$n&&8<$n&&11>=$n),Fn=String.fromCharCode(32),Wn=!1;function Vn(e,t){switch(e){case"keyup":return-1!==Ln.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Qn=!1;var qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function Xn(e,t,n,r){Ae(r),0<(t=Ir(t,"onChange")).length&&(n=new hn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Gn=null;function Kn(e){Pr(e,0)}function Jn(e){if(K(ii(e)))return e}function Zn(e,t){if("change"===e)return t}var er=!1;if(f){var tr;if(f){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"===typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function ir(){Yn&&(Yn.detachEvent("onpropertychange",or),Gn=Yn=null)}function or(e){if("value"===e.propertyName&&Jn(Gn)){var t=[];if(Xn(t,Gn,e,Ee(e)),e=Kn,Ie)e(t);else{Ie=!0;try{Re(e,t)}finally{Ie=!1,ze()}}}}function ar(e,t,n){"focusin"===e?(ir(),Gn=n,(Yn=t).attachEvent("onpropertychange",or)):"focusout"===e&&ir()}function sr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Jn(Gn)}function lr(e,t){if("click"===e)return Jn(t)}function cr(e,t){if("input"===e||"change"===e)return Jn(t)}var ur="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},fr=Object.prototype.hasOwnProperty;function dr(e,t){if(ur(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!fr.call(t,n[r])||!ur(e[n[r]],t[n[r]]))return!1;return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n,r=hr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hr(r)}}function vr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?vr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function mr(){for(var e=window,t=J();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=J((e=t.contentWindow).document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var yr=f&&"documentMode"in document&&11>=document.documentMode,br=null,Or=null,kr=null,wr=!1;function xr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;wr||null==br||br!==J(r)||("selectionStart"in(r=br)&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},kr&&dr(kr,r)||(kr=r,0<(r=Ir(Or,"onSelect")).length&&(t=new hn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}_t("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),_t("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),_t(Nt,2);for(var jr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Sr=0;Sr<jr.length;Sr++)Rt.set(jr[Sr],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Er="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Er));function Mr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,s,l,c){if(Ye.apply(this,arguments),He){if(!He)throw Error(a(198));var u=Qe;He=!1,Qe=null,qe||(qe=!0,Ue=u)}}(r,t,void 0,e),e.currentTarget=null}function Pr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;Mr(i,s,c),o=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;Mr(i,s,c),o=l}}}if(qe)throw e=Ue,qe=!1,Ue=null,e}function Tr(e,t){var n=ai(t),r=e+"__bubble";n.has(r)||(Nr(t,e,2,!1),n.add(r))}var Ar="_reactListening"+Math.random().toString(36).slice(2);function Dr(e){e[Ar]||(e[Ar]=!0,s.forEach((function(t){Cr.has(t)||Rr(t,!1,e,null),Rr(t,!0,e,null)})))}function Rr(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!t&&Cr.has(e)){if("scroll"!==e)return;i|=2,o=r}var a=ai(o),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(i|=4),Nr(o,e,i,t),a.add(s))}function Nr(e,t,n,r){var i=Rt.get(t);switch(void 0===i?2:i){case 0:i=Gt;break;case 1:i=Kt;break;default:i=Jt}n=i.bind(null,t,n,e),i=void 0,!Fe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function _r(e,t,n,r,i){var o=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=ni(s)))return;if(5===(l=a.tag)||6===l){r=o=a;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if($e)return e(t,n);$e=!0;try{Le(e,t,n)}finally{$e=!1,ze()}}((function(){var r=o,i=Ee(n),a=[];e:{var s=Dt.get(e);if(void 0!==s){var l=hn,c=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":l=Tn;break;case"focusin":c="focus",l=bn;break;case"focusout":c="blur",l=bn;break;case"beforeblur":case"afterblur":l=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Dn;break;case Mt:case Pt:case Tt:l=On;break;case At:l=Rn;break;case"scroll":l=vn;break;case"wheel":l=_n;break;case"copy":case"cut":case"paste":l=wn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=An}var u=0!==(4&t),f=!u&&"scroll"===e,d=u?null!==s?s+"Capture":null:s;u=[];for(var h,p=r;null!==p;){var v=(h=p).stateNode;if(5===h.tag&&null!==v&&(h=v,null!==d&&(null!=(v=Be(p,d))&&u.push(Lr(p,v,h)))),f)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,i),a.push({event:s,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!==(16&t)||!(c=n.relatedTarget||n.fromElement)||!ni(c)&&!c[ei])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?ni(c):null)&&(c!==(f=Ge(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=gn,v="onMouseLeave",d="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=An,v="onPointerLeave",d="onPointerEnter",p="pointer"),f=null==l?s:ii(l),h=null==c?s:ii(c),(s=new u(v,p+"leave",l,n,i)).target=f,s.relatedTarget=h,v=null,ni(i)===r&&((u=new u(d,p+"enter",c,n,i)).target=h,u.relatedTarget=f,v=u),f=v,l&&c)e:{for(d=c,p=0,h=u=l;h;h=$r(h))p++;for(h=0,v=d;v;v=$r(v))h++;for(;0<p-h;)u=$r(u),p--;for(;0<h-p;)d=$r(d),h--;for(;p--;){if(u===d||null!==d&&u===d.alternate)break e;u=$r(u),d=$r(d)}u=null}else u=null;null!==l&&zr(a,s,l,u,!1),null!==c&&null!==f&&zr(a,f,c,u,!0)}if("select"===(l=(s=r?ii(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var m=Zn;else if(Un(s))if(er)m=cr;else{m=sr;var g=ar}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=lr);switch(m&&(m=m(e,r))?Xn(a,m,n,i):(g&&g(e,s,r),"focusout"===e&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&ie(s,"number",s.value)),g=r?ii(r):window,e){case"focusin":(Un(g)||"true"===g.contentEditable)&&(br=g,Or=r,kr=null);break;case"focusout":kr=Or=br=null;break;case"mousedown":wr=!0;break;case"contextmenu":case"mouseup":case"dragend":wr=!1,xr(a,n,i);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":xr(a,n,i)}var y;if(In)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Qn?Vn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Bn&&"ko"!==n.locale&&(Qn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Qn&&(y=rn()):(tn="value"in(en=i)?en.value:en.textContent,Qn=!0)),0<(g=Ir(r,b)).length&&(b=new xn(b,e,null,n,i),a.push({event:b,listeners:g}),y?b.data=y:null!==(y=Hn(n))&&(b.data=y))),(y=zn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(Wn=!0,Fn);case"textInput":return(e=t.data)===Fn&&Wn?null:e;default:return null}}(e,n):function(e,t){if(Qn)return"compositionend"===e||!In&&Vn(e,t)?(e=rn(),nn=tn=en=null,Qn=!1,e):null;switch(e){default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Bn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Ir(r,"onBeforeInput")).length&&(i=new xn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=y))}Pr(a,t)}))}function Lr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ir(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Be(e,n))&&r.unshift(Lr(e,o,i)),null!=(o=Be(e,t))&&r.push(Lr(e,o,i))),e=e.return}return r}function $r(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function zr(e,t,n,r,i){for(var o=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,i?null!=(l=Be(n,o))&&a.unshift(Lr(n,l,s)):i||null!=(l=Be(n,o))&&a.push(Lr(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function Br(){}var Fr=null,Wr=null;function Vr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Hr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Qr="function"===typeof setTimeout?setTimeout:void 0,qr="function"===typeof clearTimeout?clearTimeout:void 0;function Ur(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Xr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Yr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Gr=0;var Kr=Math.random().toString(36).slice(2),Jr="__reactFiber$"+Kr,Zr="__reactProps$"+Kr,ei="__reactContainer$"+Kr,ti="__reactEvents$"+Kr;function ni(e){var t=e[Jr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ei]||n[Jr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Yr(e);null!==e;){if(n=e[Jr])return n;e=Yr(e)}return t}n=(e=n).parentNode}return null}function ri(e){return!(e=e[Jr]||e[ei])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ii(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function oi(e){return e[Zr]||null}function ai(e){var t=e[ti];return void 0===t&&(t=e[ti]=new Set),t}var si=[],li=-1;function ci(e){return{current:e}}function ui(e){0>li||(e.current=si[li],si[li]=null,li--)}function fi(e,t){li++,si[li]=e.current,e.current=t}var di={},hi=ci(di),pi=ci(!1),vi=di;function mi(e,t){var n=e.type.contextTypes;if(!n)return di;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function gi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function yi(){ui(pi),ui(hi)}function bi(e,t,n){if(hi.current!==di)throw Error(a(168));fi(hi,t),fi(pi,n)}function Oi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(a(108,U(t)||"Unknown",o));return i({},n,r)}function ki(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||di,vi=hi.current,fi(hi,e),fi(pi,pi.current),!0}function wi(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Oi(e,t,vi),r.__reactInternalMemoizedMergedChildContext=e,ui(pi),ui(hi),fi(hi,e)):ui(pi),fi(pi,n)}var xi=null,ji=null,Si=o.unstable_runWithPriority,Ei=o.unstable_scheduleCallback,Ci=o.unstable_cancelCallback,Mi=o.unstable_shouldYield,Pi=o.unstable_requestPaint,Ti=o.unstable_now,Ai=o.unstable_getCurrentPriorityLevel,Di=o.unstable_ImmediatePriority,Ri=o.unstable_UserBlockingPriority,Ni=o.unstable_NormalPriority,_i=o.unstable_LowPriority,Li=o.unstable_IdlePriority,Ii={},$i=void 0!==Pi?Pi:function(){},zi=null,Bi=null,Fi=!1,Wi=Ti(),Vi=1e4>Wi?Ti:function(){return Ti()-Wi};function Hi(){switch(Ai()){case Di:return 99;case Ri:return 98;case Ni:return 97;case _i:return 96;case Li:return 95;default:throw Error(a(332))}}function Qi(e){switch(e){case 99:return Di;case 98:return Ri;case 97:return Ni;case 96:return _i;case 95:return Li;default:throw Error(a(332))}}function qi(e,t){return e=Qi(e),Si(e,t)}function Ui(e,t,n){return e=Qi(e),Ei(e,t,n)}function Xi(){if(null!==Bi){var e=Bi;Bi=null,Ci(e)}Yi()}function Yi(){if(!Fi&&null!==zi){Fi=!0;var e=0;try{var t=zi;qi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),zi=null}catch(n){throw null!==zi&&(zi=zi.slice(e+1)),Ei(Di,Xi),n}finally{Fi=!1}}}var Gi=k.ReactCurrentBatchConfig;function Ki(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Ji=ci(null),Zi=null,eo=null,to=null;function no(){to=eo=Zi=null}function ro(e){var t=Ji.current;ui(Ji),e.type._context._currentValue=t}function io(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function oo(e,t){Zi=e,to=eo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Ia=!0),e.firstContext=null)}function ao(e,t){if(to!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(to=e,t=1073741823),t={context:e,observedBits:t,next:null},null===eo){if(null===Zi)throw Error(a(308));eo=t,Zi.dependencies={lanes:0,firstContext:t,responders:null}}else eo=eo.next=t;return e._currentValue}var so=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function co(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function uo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fo(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ho(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function po(e,t,n,r){var o=e.updateQueue;so=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var c=l,u=c.next;c.next=null,null===s?a=u:s.next=u,s=c;var f=e.alternate;if(null!==f){var d=(f=f.updateQueue).lastBaseUpdate;d!==s&&(null===d?f.firstBaseUpdate=u:d.next=u,f.lastBaseUpdate=c)}}if(null!==a){for(d=o.baseState,s=0,f=u=c=null;;){l=a.lane;var h=a.eventTime;if((r&l)===l){null!==f&&(f=f.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,v=a;switch(l=t,h=n,v.tag){case 1:if("function"===typeof(p=v.payload)){d=p.call(h,d,l);break e}d=p;break e;case 3:p.flags=-4097&p.flags|64;case 0:if(null===(l="function"===typeof(p=v.payload)?p.call(h,d,l):p)||void 0===l)break e;d=i({},d,l);break e;case 2:so=!0}}null!==a.callback&&(e.flags|=32,null===(l=o.effects)?o.effects=[a]:l.push(a))}else h={eventTime:h,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===f?(u=f=h,c=d):f=f.next=h,s|=l;if(null===(a=a.next)){if(null===(l=o.shared.pending))break;a=l.next,l.next=null,o.lastBaseUpdate=l,o.shared.pending=null}}null===f&&(c=d),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=f,Fs|=s,e.lanes=s,e.memoizedState=d}}function vo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!==typeof i)throw Error(a(191,i));i.call(r)}}}var mo=(new r.Component).refs;function go(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var yo={isMounted:function(e){return!!(e=e._reactInternals)&&Ge(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=dl(),i=hl(e),o=uo(r,i);o.payload=t,void 0!==n&&null!==n&&(o.callback=n),fo(e,o),pl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=dl(),i=hl(e),o=uo(r,i);o.tag=1,o.payload=t,void 0!==n&&null!==n&&(o.callback=n),fo(e,o),pl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=dl(),r=hl(e),i=uo(n,r);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),fo(e,i),pl(e,r,n)}};function bo(e,t,n,r,i,o,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!dr(n,r)||!dr(i,o))}function Oo(e,t,n){var r=!1,i=di,o=t.contextType;return"object"===typeof o&&null!==o?o=ao(o):(i=gi(t)?vi:hi.current,o=(r=null!==(r=t.contextTypes)&&void 0!==r)?mi(e,i):di),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=yo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function ko(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yo.enqueueReplaceState(t,t.state,null)}function wo(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=mo,lo(e);var o=t.contextType;"object"===typeof o&&null!==o?i.context=ao(o):(o=gi(t)?vi:hi.current,i.context=mi(e,o)),po(e,n,i,r),i.state=e.memoizedState,"function"===typeof(o=t.getDerivedStateFromProps)&&(go(e,t,o,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&yo.enqueueReplaceState(i,i.state,null),po(e,n,i,r),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4)}var xo=Array.isArray;function jo(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===mo&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!==typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function So(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Eo(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=ql(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Gl(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=jo(e,t,n),r.return=e,r):((r=Ul(n.type,n.key,n.props,null,e.mode,r)).ref=jo(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Kl(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,o){return null===t||7!==t.tag?((t=Xl(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function d(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Gl(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Ul(t.type,t.key,t.props,null,e.mode,n)).ref=jo(e,null,t),n.return=e,n;case x:return(t=Kl(t,e.mode,n)).return=e,t}if(xo(t)||W(t))return(t=Xl(t,e.mode,n,null)).return=e,t;So(e,t)}return null}function h(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===i?n.type===j?f(e,t,n.props.children,r,i):c(e,t,n,r):null;case x:return n.key===i?u(e,t,n,r):null}if(xo(n)||W(n))return null!==i?null:f(e,t,n,r,null);So(e,n)}return null}function p(e,t,n,r,i){if("string"===typeof r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case w:return e=e.get(null===r.key?n:r.key)||null,r.type===j?f(t,e,r.props.children,i,r.key):c(t,e,r,i);case x:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(xo(r)||W(r))return f(t,e=e.get(n)||null,r,i,null);So(t,r)}return null}function v(i,a,s,l){for(var c=null,u=null,f=a,v=a=0,m=null;null!==f&&v<s.length;v++){f.index>v?(m=f,f=null):m=f.sibling;var g=h(i,f,s[v],l);if(null===g){null===f&&(f=m);break}e&&f&&null===g.alternate&&t(i,f),a=o(g,a,v),null===u?c=g:u.sibling=g,u=g,f=m}if(v===s.length)return n(i,f),c;if(null===f){for(;v<s.length;v++)null!==(f=d(i,s[v],l))&&(a=o(f,a,v),null===u?c=f:u.sibling=f,u=f);return c}for(f=r(i,f);v<s.length;v++)null!==(m=p(f,i,v,s[v],l))&&(e&&null!==m.alternate&&f.delete(null===m.key?v:m.key),a=o(m,a,v),null===u?c=m:u.sibling=m,u=m);return e&&f.forEach((function(e){return t(i,e)})),c}function m(i,s,l,c){var u=W(l);if("function"!==typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var f=u=null,v=s,m=s=0,g=null,y=l.next();null!==v&&!y.done;m++,y=l.next()){v.index>m?(g=v,v=null):g=v.sibling;var b=h(i,v,y.value,c);if(null===b){null===v&&(v=g);break}e&&v&&null===b.alternate&&t(i,v),s=o(b,s,m),null===f?u=b:f.sibling=b,f=b,v=g}if(y.done)return n(i,v),u;if(null===v){for(;!y.done;m++,y=l.next())null!==(y=d(i,y.value,c))&&(s=o(y,s,m),null===f?u=y:f.sibling=y,f=y);return u}for(v=r(i,v);!y.done;m++,y=l.next())null!==(y=p(v,i,m,y.value,c))&&(e&&null!==y.alternate&&v.delete(null===y.key?m:y.key),s=o(y,s,m),null===f?u=y:f.sibling=y,f=y);return e&&v.forEach((function(e){return t(i,e)})),u}return function(e,r,o,l){var c="object"===typeof o&&null!==o&&o.type===j&&null===o.key;c&&(o=o.props.children);var u="object"===typeof o&&null!==o;if(u)switch(o.$$typeof){case w:e:{for(u=o.key,c=r;null!==c;){if(c.key===u){if(7===c.tag){if(o.type===j){n(e,c.sibling),(r=i(c,o.props.children)).return=e,e=r;break e}}else if(c.elementType===o.type){n(e,c.sibling),(r=i(c,o.props)).ref=jo(e,c,o),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}o.type===j?((r=Xl(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=Ul(o.type,o.key,o.props,null,e.mode,l)).ref=jo(e,r,o),l.return=e,e=l)}return s(e);case x:e:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Kl(o,e.mode,l)).return=e,e=r}return s(e)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Gl(o,e.mode,l)).return=e,e=r),s(e);if(xo(o))return v(e,r,o,l);if(W(o))return m(e,r,o,l);if(u&&So(e,o),"undefined"===typeof o&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,U(e.type)||"Component"))}return n(e,r)}}var Co=Eo(!0),Mo=Eo(!1),Po={},To=ci(Po),Ao=ci(Po),Do=ci(Po);function Ro(e){if(e===Po)throw Error(a(174));return e}function No(e,t){switch(fi(Do,t),fi(Ao,e),fi(To,Po),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ui(To),fi(To,t)}function _o(){ui(To),ui(Ao),ui(Do)}function Lo(e){Ro(Do.current);var t=Ro(To.current),n=pe(t,e.type);t!==n&&(fi(Ao,e),fi(To,n))}function Io(e){Ao.current===e&&(ui(To),ui(Ao))}var $o=ci(0);function zo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Bo=null,Fo=null,Wo=!1;function Vo(e,t){var n=Hl(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ho(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Qo(e){if(Wo){var t=Fo;if(t){var n=t;if(!Ho(e,t)){if(!(t=Xr(n.nextSibling))||!Ho(e,t))return e.flags=-1025&e.flags|2,Wo=!1,void(Bo=e);Vo(Bo,n)}Bo=e,Fo=Xr(t.firstChild)}else e.flags=-1025&e.flags|2,Wo=!1,Bo=e}}function qo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Bo=e}function Uo(e){if(e!==Bo)return!1;if(!Wo)return qo(e),Wo=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Hr(t,e.memoizedProps))for(t=Fo;t;)Vo(e,t),t=Xr(t.nextSibling);if(qo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Fo=Xr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Fo=null}}else Fo=Bo?Xr(e.stateNode.nextSibling):null;return!0}function Xo(){Fo=Bo=null,Wo=!1}var Yo=[];function Go(){for(var e=0;e<Yo.length;e++)Yo[e]._workInProgressVersionPrimary=null;Yo.length=0}var Ko=k.ReactCurrentDispatcher,Jo=k.ReactCurrentBatchConfig,Zo=0,ea=null,ta=null,na=null,ra=!1,ia=!1;function oa(){throw Error(a(321))}function aa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function sa(e,t,n,r,i,o){if(Zo=o,ea=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ko.current=null===e||null===e.memoizedState?Ra:Na,e=n(r,i),ia){o=0;do{if(ia=!1,!(25>o))throw Error(a(301));o+=1,na=ta=null,t.updateQueue=null,Ko.current=_a,e=n(r,i)}while(ia)}if(Ko.current=Da,t=null!==ta&&null!==ta.next,Zo=0,na=ta=ea=null,ra=!1,t)throw Error(a(300));return e}function la(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===na?ea.memoizedState=na=e:na=na.next=e,na}function ca(){if(null===ta){var e=ea.alternate;e=null!==e?e.memoizedState:null}else e=ta.next;var t=null===na?ea.memoizedState:na.next;if(null!==t)na=t,ta=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ta=e).memoizedState,baseState:ta.baseState,baseQueue:ta.baseQueue,queue:ta.queue,next:null},null===na?ea.memoizedState=na=e:na=na.next=e}return na}function ua(e,t){return"function"===typeof t?t(e):t}function fa(e){var t=ca(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=ta,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=s=o=null,c=i;do{var u=c.lane;if((Zo&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(s=l=f,o=r):l=l.next=f,ea.lanes|=u,Fs|=u}c=c.next}while(null!==c&&c!==i);null===l?o=r:l.next=s,ur(r,t.memoizedState)||(Ia=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function da(e){var t=ca(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);ur(o,t.memoizedState)||(Ia=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ha(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(Zo&e)===e)&&(t._workInProgressVersionPrimary=r,Yo.push(t))),e)return n(t._source);throw Yo.push(t),Error(a(350))}function pa(e,t,n,r){var i=Rs;if(null===i)throw Error(a(349));var o=t._getVersion,s=o(t._source),l=Ko.current,c=l.useState((function(){return ha(i,t,n)})),u=c[1],f=c[0];c=na;var d=e.memoizedState,h=d.refs,p=h.getSnapshot,v=d.source;d=d.subscribe;var m=ea;return e.memoizedState={refs:h,source:t,subscribe:r},l.useEffect((function(){h.getSnapshot=n,h.setSnapshot=u;var e=o(t._source);if(!ur(s,e)){e=n(t._source),ur(f,e)||(u(e),e=hl(m),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,a=e;0<a;){var l=31-Ht(a),c=1<<l;r[l]|=e,a&=~c}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=h.getSnapshot,n=h.setSnapshot;try{n(e(t._source));var r=hl(m);i.mutableReadLanes|=r&i.pendingLanes}catch(o){n((function(){throw o}))}}))}),[t,r]),ur(p,n)&&ur(v,t)&&ur(d,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ua,lastRenderedState:f}).dispatch=u=Aa.bind(null,ea,e),c.queue=e,c.baseQueue=null,f=ha(i,t,n),c.memoizedState=c.baseState=f),f}function va(e,t,n){return pa(ca(),e,t,n)}function ma(e){var t=la();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e}).dispatch=Aa.bind(null,ea,e),[t.memoizedState,e]}function ga(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ea.updateQueue)?(t={lastEffect:null},ea.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ya(e){return e={current:e},la().memoizedState=e}function ba(){return ca().memoizedState}function Oa(e,t,n,r){var i=la();ea.flags|=e,i.memoizedState=ga(1|t,n,void 0,void 0===r?null:r)}function ka(e,t,n,r){var i=ca();r=void 0===r?null:r;var o=void 0;if(null!==ta){var a=ta.memoizedState;if(o=a.destroy,null!==r&&aa(r,a.deps))return void ga(t,n,o,r)}ea.flags|=e,i.memoizedState=ga(1|t,n,o,r)}function wa(e,t){return Oa(516,4,e,t)}function xa(e,t){return ka(516,4,e,t)}function ja(e,t){return ka(4,2,e,t)}function Sa(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ea(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ka(4,2,Sa.bind(null,t,e),n)}function Ca(){}function Ma(e,t){var n=ca();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pa(e,t){var n=ca();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ta(e,t){var n=Hi();qi(98>n?98:n,(function(){e(!0)})),qi(97<n?97:n,(function(){var n=Jo.transition;Jo.transition=1;try{e(!1),t()}finally{Jo.transition=n}}))}function Aa(e,t,n){var r=dl(),i=hl(e),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===ea||null!==a&&a===ea)ia=ra=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,ur(l,s))return}catch(c){}pl(e,i,r)}}var Da={readContext:ao,useCallback:oa,useContext:oa,useEffect:oa,useImperativeHandle:oa,useLayoutEffect:oa,useMemo:oa,useReducer:oa,useRef:oa,useState:oa,useDebugValue:oa,useDeferredValue:oa,useTransition:oa,useMutableSource:oa,useOpaqueIdentifier:oa,unstable_isNewReconciler:!1},Ra={readContext:ao,useCallback:function(e,t){return la().memoizedState=[e,void 0===t?null:t],e},useContext:ao,useEffect:wa,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Oa(4,2,Sa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oa(4,2,e,t)},useMemo:function(e,t){var n=la();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=la();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Aa.bind(null,ea,e),[r.memoizedState,e]},useRef:ya,useState:ma,useDebugValue:Ca,useDeferredValue:function(e){var t=ma(e),n=t[0],r=t[1];return wa((function(){var t=Jo.transition;Jo.transition=1;try{r(e)}finally{Jo.transition=t}}),[e]),n},useTransition:function(){var e=ma(!1),t=e[0];return ya(e=Ta.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=la();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},pa(r,e,t,n)},useOpaqueIdentifier:function(){if(Wo){var e=!1,t=function(e){return{$$typeof:_,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Gr++).toString(36))),Error(a(355))})),n=ma(t)[1];return 0===(2&ea.mode)&&(ea.flags|=516,ga(5,(function(){n("r:"+(Gr++).toString(36))}),void 0,null)),t}return ma(t="r:"+(Gr++).toString(36)),t},unstable_isNewReconciler:!1},Na={readContext:ao,useCallback:Ma,useContext:ao,useEffect:xa,useImperativeHandle:Ea,useLayoutEffect:ja,useMemo:Pa,useReducer:fa,useRef:ba,useState:function(){return fa(ua)},useDebugValue:Ca,useDeferredValue:function(e){var t=fa(ua),n=t[0],r=t[1];return xa((function(){var t=Jo.transition;Jo.transition=1;try{r(e)}finally{Jo.transition=t}}),[e]),n},useTransition:function(){var e=fa(ua)[0];return[ba().current,e]},useMutableSource:va,useOpaqueIdentifier:function(){return fa(ua)[0]},unstable_isNewReconciler:!1},_a={readContext:ao,useCallback:Ma,useContext:ao,useEffect:xa,useImperativeHandle:Ea,useLayoutEffect:ja,useMemo:Pa,useReducer:da,useRef:ba,useState:function(){return da(ua)},useDebugValue:Ca,useDeferredValue:function(e){var t=da(ua),n=t[0],r=t[1];return xa((function(){var t=Jo.transition;Jo.transition=1;try{r(e)}finally{Jo.transition=t}}),[e]),n},useTransition:function(){var e=da(ua)[0];return[ba().current,e]},useMutableSource:va,useOpaqueIdentifier:function(){return da(ua)[0]},unstable_isNewReconciler:!1},La=k.ReactCurrentOwner,Ia=!1;function $a(e,t,n,r){t.child=null===e?Mo(t,null,n,r):Co(t,e.child,n,r)}function za(e,t,n,r,i){n=n.render;var o=t.ref;return oo(t,i),r=sa(e,t,n,r,o,i),null===e||Ia?(t.flags|=1,$a(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,os(e,t,i))}function Ba(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!==typeof a||Ql(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ul(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Fa(e,t,a,r,i,o))}return a=e.child,0===(i&o)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:dr)(i,r)&&e.ref===t.ref)?os(e,t,o):(t.flags|=1,(e=ql(a,r)).ref=t.ref,e.return=t,t.child=e)}function Fa(e,t,n,r,i,o){if(null!==e&&dr(e.memoizedProps,r)&&e.ref===t.ref){if(Ia=!1,0===(o&i))return t.lanes=e.lanes,os(e,t,o);0!==(16384&e.flags)&&(Ia=!0)}return Ha(e,t,n,r,o)}function Wa(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0===(4&t.mode))t.memoizedState={baseLanes:0},wl(t,n);else{if(0===(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},wl(t,e),null;t.memoizedState={baseLanes:0},wl(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,wl(t,r);return $a(e,t,i,n),t.child}function Va(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ha(e,t,n,r,i){var o=gi(n)?vi:hi.current;return o=mi(t,o),oo(t,i),n=sa(e,t,n,r,o,i),null===e||Ia?(t.flags|=1,$a(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,os(e,t,i))}function Qa(e,t,n,r,i){if(gi(n)){var o=!0;ki(t)}else o=!1;if(oo(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),Oo(t,n,r),wo(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"===typeof c&&null!==c?c=ao(c):c=mi(t,c=gi(n)?vi:hi.current);var u=n.getDerivedStateFromProps,f="function"===typeof u||"function"===typeof a.getSnapshotBeforeUpdate;f||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||l!==c)&&ko(t,a,r,c),so=!1;var d=t.memoizedState;a.state=d,po(t,r,a,i),l=t.memoizedState,s!==r||d!==l||pi.current||so?("function"===typeof u&&(go(t,n,u,r),l=t.memoizedState),(s=so||bo(t,n,s,r,d,l,c))?(f||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4)):("function"===typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"===typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,co(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Ki(t.type,s),a.props=c,f=t.pendingProps,d=a.context,"object"===typeof(l=n.contextType)&&null!==l?l=ao(l):l=mi(t,l=gi(n)?vi:hi.current);var h=n.getDerivedStateFromProps;(u="function"===typeof h||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==f||d!==l)&&ko(t,a,r,l),so=!1,d=t.memoizedState,a.state=d,po(t,r,a,i);var p=t.memoizedState;s!==f||d!==p||pi.current||so?("function"===typeof h&&(go(t,n,h,r),p=t.memoizedState),(c=so||bo(t,n,c,r,d,p,l))?(u||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),r=!1)}return qa(e,t,n,r,o,i)}function qa(e,t,n,r,i,o){Va(e,t);var a=0!==(64&t.flags);if(!r&&!a)return i&&wi(t,n,!1),os(e,t,o);r=t.stateNode,La.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Co(t,e.child,null,o),t.child=Co(t,null,s,o)):$a(e,t,s,o),t.memoizedState=r.state,i&&wi(t,n,!0),t.child}function Ua(e){var t=e.stateNode;t.pendingContext?bi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&bi(0,t.context,!1),No(e,t.containerInfo)}var Xa,Ya,Ga,Ka={dehydrated:null,retryLane:0};function Ja(e,t,n){var r,i=t.pendingProps,o=$o.current,a=!1;return(r=0!==(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!==(2&o)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),fi($o,1&o),null===e?(void 0!==i.fallback&&Qo(t),e=i.children,o=i.fallback,a?(e=Za(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ka,e):"number"===typeof i.unstable_expectedLoadTime?(e=Za(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ka,t.lanes=33554432,e):((n=Yl({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(i=ts(e,t,i.children,i.fallback,n),a=t.child,o=e.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=Ka,i):(n=es(e,t,i.children,n),t.memoizedState=null,n))}function Za(e,t,n,r){var i=e.mode,o=e.child;return t={mode:"hidden",children:t},0===(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Yl(t,i,0,null),n=Xl(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function es(e,t,n,r){var i=e.child;return e=i.sibling,n=ql(i,{mode:"visible",children:n}),0===(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ts(e,t,n,r,i){var o=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0===(2&o)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=ql(a,s),null!==e?r=ql(e,r):(r=Xl(r,o,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ns(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),io(e.return,t)}function rs(e,t,n,r,i,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function is(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if($a(e,t,r.children,n),0!==(2&(r=$o.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!==(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ns(e,n);else if(19===e.tag)ns(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(fi($o,r),0===(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===zo(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rs(t,!1,i,n,o,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===zo(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rs(t,!0,n,null,o,t.lastEffect);break;case"together":rs(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function os(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Fs|=t.lanes,0!==(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=ql(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ql(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function as(e,t){if(!Wo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ss(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return gi(t.type)&&yi(),null;case 3:return _o(),ui(pi),ui(hi),Go(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Uo(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Io(t);var o=Ro(Do.current);if(n=t.type,null!==e&&null!=t.stateNode)Ya(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=Ro(To.current),Uo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Jr]=t,r[Zr]=s,n){case"dialog":Tr("cancel",r),Tr("close",r);break;case"iframe":case"object":case"embed":Tr("load",r);break;case"video":case"audio":for(e=0;e<Er.length;e++)Tr(Er[e],r);break;case"source":Tr("error",r);break;case"img":case"image":case"link":Tr("error",r),Tr("load",r);break;case"details":Tr("toggle",r);break;case"input":ee(r,s),Tr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Tr("invalid",r);break;case"textarea":le(r,s),Tr("invalid",r)}for(var c in je(n,s),e=null,s)s.hasOwnProperty(c)&&(o=s[c],"children"===c?"string"===typeof o?r.textContent!==o&&(e=["children",o]):"number"===typeof o&&r.textContent!==""+o&&(e=["children",""+o]):l.hasOwnProperty(c)&&null!=o&&"onScroll"===c&&Tr("scroll",r));switch(n){case"input":G(r),re(r,s,!0);break;case"textarea":G(r),ue(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=Br)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(c=9===o.nodeType?o:o.ownerDocument,e===fe&&(e=he(n)),e===fe?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Jr]=t,e[Zr]=r,Xa(e,t),t.stateNode=e,c=Se(n,r),n){case"dialog":Tr("cancel",e),Tr("close",e),o=r;break;case"iframe":case"object":case"embed":Tr("load",e),o=r;break;case"video":case"audio":for(o=0;o<Er.length;o++)Tr(Er[o],e);o=r;break;case"source":Tr("error",e),o=r;break;case"img":case"image":case"link":Tr("error",e),Tr("load",e),o=r;break;case"details":Tr("toggle",e),o=r;break;case"input":ee(e,r),o=Z(e,r),Tr("invalid",e);break;case"option":o=oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=i({},r,{value:void 0}),Tr("invalid",e);break;case"textarea":le(e,r),o=se(e,r),Tr("invalid",e);break;default:o=r}je(n,o);var u=o;for(s in u)if(u.hasOwnProperty(s)){var f=u[s];"style"===s?we(e,f):"dangerouslySetInnerHTML"===s?null!=(f=f?f.__html:void 0)&&ge(e,f):"children"===s?"string"===typeof f?("textarea"!==n||""!==f)&&ye(e,f):"number"===typeof f&&ye(e,""+f):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(l.hasOwnProperty(s)?null!=f&&"onScroll"===s&&Tr("scroll",e):null!=f&&O(e,s,f,c))}switch(n){case"input":G(e),re(e,r,!1);break;case"textarea":G(e),ue(e);break;case"option":null!=r.value&&e.setAttribute("value",""+X(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ae(e,!!r.multiple,s,!1):null!=r.defaultValue&&ae(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof o.onClick&&(e.onclick=Br)}Vr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Ga(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));n=Ro(Do.current),Ro(To.current),Uo(t)?(r=t.stateNode,n=t.memoizedProps,r[Jr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Jr]=t,t.stateNode=r)}return null;case 13:return ui($o),r=t.memoizedState,0!==(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Uo(t):n=null!==e.memoizedState,r&&!n&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&$o.current)?0===$s&&($s=3):(0!==$s&&3!==$s||($s=4),null===Rs||0===(134217727&Fs)&&0===(134217727&Ws)||yl(Rs,_s))),(r||n)&&(t.flags|=4),null);case 4:return _o(),null===e&&Dr(t.stateNode.containerInfo),null;case 10:return ro(t),null;case 19:if(ui($o),null===(r=t.memoizedState))return null;if(s=0!==(64&t.flags),null===(c=r.rendering))if(s)as(r,!1);else{if(0!==$s||null!==e&&0!==(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=zo(e))){for(t.flags|=64,as(r,!1),null!==(s=c.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(c=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fi($o,1&$o.current|2),t.child}e=e.sibling}null!==r.tail&&Vi()>qs&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=zo(c))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),as(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!Wo)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Vi()-r.renderingStartTime>qs&&1073741824!==n&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432);r.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=r.last)?n.sibling=c:t.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Vi(),n.sibling=null,t=$o.current,fi($o,s?1&t|2:1&t),n):null;case 23:case 24:return xl(),null!==e&&null!==e.memoizedState!==(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function ls(e){switch(e.tag){case 1:gi(e.type)&&yi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(_o(),ui(pi),ui(hi),Go(),0!==(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Io(e),null;case 13:return ui($o),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ui($o),null;case 4:return _o(),null;case 10:return ro(e),null;case 23:case 24:return xl(),null;default:return null}}function cs(e,t){try{var n="",r=t;do{n+=q(r),r=r.return}while(r);var i=n}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:i}}function us(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Xa=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ya=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ro(To.current);var a,s=null;switch(n){case"input":o=Z(e,o),r=Z(e,r),s=[];break;case"option":o=oe(e,o),r=oe(e,r),s=[];break;case"select":o=i({},o,{value:void 0}),r=i({},r,{value:void 0}),s=[];break;case"textarea":o=se(e,o),r=se(e,r),s=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(e.onclick=Br)}for(f in je(n,r),n=null,o)if(!r.hasOwnProperty(f)&&o.hasOwnProperty(f)&&null!=o[f])if("style"===f){var c=o[f];for(a in c)c.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(l.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var u=r[f];if(c=null!=o?o[f]:void 0,r.hasOwnProperty(f)&&u!==c&&(null!=u||null!=c))if("style"===f)if(c){for(a in c)!c.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&c[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(s||(s=[]),s.push(f,n)),n=u;else"dangerouslySetInnerHTML"===f?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(s=s||[]).push(f,u)):"children"===f?"string"!==typeof u&&"number"!==typeof u||(s=s||[]).push(f,""+u):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(l.hasOwnProperty(f)?(null!=u&&"onScroll"===f&&Tr("scroll",e),s||c===u||(s=[])):"object"===typeof u&&null!==u&&u.$$typeof===_?u.toString():(s=s||[]).push(f,u))}n&&(s=s||[]).push("style",n);var f=s;(t.updateQueue=f)&&(t.flags|=4)}},Ga=function(e,t,n,r){n!==r&&(t.flags|=4)};var fs="function"===typeof WeakMap?WeakMap:Map;function ds(e,t,n){(n=uo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gs||(Gs=!0,Ks=r),us(0,t)},n}function hs(e,t,n){(n=uo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return us(0,t),r(i)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Js?Js=new Set([this]):Js.add(this),us(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var ps="function"===typeof WeakSet?WeakSet:Set;function vs(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){Bl(e,n)}else t.current=null}function ms(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ki(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Ur(t.stateNode.containerInfo))}throw Error(a(163))}function gs(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3===(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!==(4&(i=i.tag))&&0!==(1&i)&&(Il(n,e),Ll(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Ki(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&vo(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}vo(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Vr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&wt(n)))))}throw Error(a(163))}function ys(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"===typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=void 0!==i&&null!==i&&i.hasOwnProperty("display")?i.display:null,r.style.display=ke("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function bs(e,t){if(ji&&"function"===typeof ji.onCommitFiberUnmount)try{ji.onCommitFiberUnmount(xi,t)}catch(o){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!==(4&r))Il(t,n);else{r=t;try{i()}catch(o){Bl(r,o)}}n=n.next}while(n!==e)}break;case 1:if(vs(t),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){Bl(t,o)}break;case 5:vs(t);break;case 4:Ss(e,t)}}function Os(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ks(e){return 5===e.tag||3===e.tag||4===e.tag}function ws(e){e:{for(var t=e.return;null!==t;){if(ks(t))break e;t=t.return}throw Error(a(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ks(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?xs(e,n,t):js(e,n,t)}function xs(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Br));else if(4!==r&&null!==(e=e.child))for(xs(e,t,n),e=e.sibling;null!==e;)xs(e,t,n),e=e.sibling}function js(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(js(e,t,n),e=e.sibling;null!==e;)js(e,t,n),e=e.sibling}function Ss(e,t){for(var n,r,i=t,o=!1;;){if(!o){o=i.return;e:for(;;){if(null===o)throw Error(a(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===i.tag||6===i.tag){e:for(var s=e,l=i,c=l;;)if(bs(s,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===l)break e;for(;null===c.sibling;){if(null===c.return||c.return===l)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(s=n,l=i.stateNode,8===s.nodeType?s.parentNode.removeChild(l):s.removeChild(l)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(bs(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function Es(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3===(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Zr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Se(e,i),t=Se(e,r),i=0;i<o.length;i+=2){var s=o[i],l=o[i+1];"style"===s?we(n,l):"dangerouslySetInnerHTML"===s?ge(n,l):"children"===s?ye(n,l):O(n,s,l,t)}switch(e){case"input":ne(n,r);break;case"textarea":ce(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(o=r.value)?ae(n,!!r.multiple,o,!1):e!==!!r.multiple&&(null!=r.defaultValue?ae(n,!!r.multiple,r.defaultValue,!0):ae(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,wt(n.containerInfo)));case 13:return null!==t.memoizedState&&(Qs=Vi(),ys(t.child,!0)),void Cs(t);case 19:return void Cs(t);case 23:case 24:return void ys(t,null!==t.memoizedState)}throw Error(a(163))}function Cs(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new ps),t.forEach((function(t){var r=Wl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ms(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Ps=Math.ceil,Ts=k.ReactCurrentDispatcher,As=k.ReactCurrentOwner,Ds=0,Rs=null,Ns=null,_s=0,Ls=0,Is=ci(0),$s=0,zs=null,Bs=0,Fs=0,Ws=0,Vs=0,Hs=null,Qs=0,qs=1/0;function Us(){qs=Vi()+500}var Xs,Ys=null,Gs=!1,Ks=null,Js=null,Zs=!1,el=null,tl=90,nl=[],rl=[],il=null,ol=0,al=null,sl=-1,ll=0,cl=0,ul=null,fl=!1;function dl(){return 0!==(48&Ds)?Vi():-1!==sl?sl:sl=Vi()}function hl(e){if(0===(2&(e=e.mode)))return 1;if(0===(4&e))return 99===Hi()?1:2;if(0===ll&&(ll=Bs),0!==Gi.transition){0!==cl&&(cl=null!==Hs?Hs.pendingLanes:0),e=ll;var t=4186112&~cl;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Hi(),0!==(4&Ds)&&98===e?e=Bt(12,ll):e=Bt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ll),e}function pl(e,t,n){if(50<ol)throw ol=0,al=null,Error(a(185));if(null===(e=vl(e,t)))return null;Vt(e,t,n),e===Rs&&(Ws|=t,4===$s&&yl(e,_s));var r=Hi();1===t?0!==(8&Ds)&&0===(48&Ds)?bl(e):(ml(e,n),0===Ds&&(Us(),Xi())):(0===(4&Ds)||98!==r&&99!==r||(null===il?il=new Set([e]):il.add(e)),ml(e,n)),Hs=e}function vl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function ml(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-Ht(s),c=1<<l,u=o[l];if(-1===u){if(0===(c&r)||0!==(c&i)){u=t,It(c);var f=Lt;o[l]=10<=f?u+250:6<=f?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);s&=~c}if(r=$t(e,e===Rs?_s:0),t=Lt,0===r)null!==n&&(n!==Ii&&Ci(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Ii&&Ci(n)}15===t?(n=bl.bind(null,e),null===zi?(zi=[n],Bi=Ei(Di,Yi)):zi.push(n),n=Ii):14===t?n=Ui(99,bl.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,e))}}(t),n=Ui(n,gl.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function gl(e){if(sl=-1,cl=ll=0,0!==(48&Ds))throw Error(a(327));var t=e.callbackNode;if(_l()&&e.callbackNode!==t)return null;var n=$t(e,e===Rs?_s:0);if(0===n)return null;var r=n,i=Ds;Ds|=16;var o=El();for(Rs===e&&_s===r||(Us(),jl(e,r));;)try{Pl();break}catch(l){Sl(e,l)}if(no(),Ts.current=o,Ds=i,null!==Ns?r=0:(Rs=null,_s=0,r=$s),0!==(Bs&Ws))jl(e,0);else if(0!==r){if(2===r&&(Ds|=64,e.hydrate&&(e.hydrate=!1,Ur(e.containerInfo)),0!==(n=zt(e))&&(r=Cl(e,n))),1===r)throw t=zs,jl(e,0),yl(e,n),ml(e,Vi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:case 5:Dl(e);break;case 3:if(yl(e,n),(62914560&n)===n&&10<(r=Qs+500-Vi())){if(0!==$t(e,0))break;if(((i=e.suspendedLanes)&n)!==n){dl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Qr(Dl.bind(null,e),r);break}Dl(e);break;case 4:if(yl(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var s=31-Ht(n);o=1<<s,(s=r[s])>i&&(i=s),n&=~o}if(n=i,10<(n=(120>(n=Vi()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ps(n/1960))-n)){e.timeoutHandle=Qr(Dl.bind(null,e),n);break}Dl(e);break;default:throw Error(a(329))}}return ml(e,Vi()),e.callbackNode===t?gl.bind(null,e):null}function yl(e,t){for(t&=~Vs,t&=~Ws,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),r=1<<n;e[n]=-1,t&=~r}}function bl(e){if(0!==(48&Ds))throw Error(a(327));if(_l(),e===Rs&&0!==(e.expiredLanes&_s)){var t=_s,n=Cl(e,t);0!==(Bs&Ws)&&(n=Cl(e,t=$t(e,t)))}else n=Cl(e,t=$t(e,0));if(0!==e.tag&&2===n&&(Ds|=64,e.hydrate&&(e.hydrate=!1,Ur(e.containerInfo)),0!==(t=zt(e))&&(n=Cl(e,t))),1===n)throw n=zs,jl(e,0),yl(e,t),ml(e,Vi()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Dl(e),ml(e,Vi()),null}function Ol(e,t){var n=Ds;Ds|=1;try{return e(t)}finally{0===(Ds=n)&&(Us(),Xi())}}function kl(e,t){var n=Ds;Ds&=-2,Ds|=8;try{return e(t)}finally{0===(Ds=n)&&(Us(),Xi())}}function wl(e,t){fi(Is,Ls),Ls|=t,Bs|=t}function xl(){Ls=Is.current,ui(Is)}function jl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,qr(n)),null!==Ns)for(n=Ns.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&yi();break;case 3:_o(),ui(pi),ui(hi),Go();break;case 5:Io(r);break;case 4:_o();break;case 13:case 19:ui($o);break;case 10:ro(r);break;case 23:case 24:xl()}n=n.return}Rs=e,Ns=ql(e.current,null),_s=Ls=Bs=t,$s=0,zs=null,Vs=Ws=Fs=0}function Sl(e,t){for(;;){var n=Ns;try{if(no(),Ko.current=Da,ra){for(var r=ea.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}ra=!1}if(Zo=0,na=ta=ea=null,ia=!1,As.current=null,null===n||null===n.return){$s=1,zs=t,Ns=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=_s,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"===typeof l&&"function"===typeof l.then){var c=l;if(0===(2&s.mode)){var u=s.alternate;u?(s.updateQueue=u.updateQueue,s.memoizedState=u.memoizedState,s.lanes=u.lanes):(s.updateQueue=null,s.memoizedState=null)}var f=0!==(1&$o.current),d=a;do{var h;if(h=13===d.tag){var p=d.memoizedState;if(null!==p)h=null!==p.dehydrated;else{var v=d.memoizedProps;h=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!f)}}if(h){var m=d.updateQueue;if(null===m){var g=new Set;g.add(c),d.updateQueue=g}else m.add(c);if(0===(2&d.mode)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var y=uo(-1,1);y.tag=2,fo(s,y)}s.lanes|=1;break e}l=void 0,s=t;var b=o.pingCache;if(null===b?(b=o.pingCache=new fs,l=new Set,b.set(c,l)):void 0===(l=b.get(c))&&(l=new Set,b.set(c,l)),!l.has(s)){l.add(s);var O=Fl.bind(null,o,c,s);c.then(O,O)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);l=Error((U(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==$s&&($s=2),l=cs(l,s),d=a;do{switch(d.tag){case 3:o=l,d.flags|=4096,t&=-t,d.lanes|=t,ho(d,ds(0,o,t));break e;case 1:o=l;var k=d.type,w=d.stateNode;if(0===(64&d.flags)&&("function"===typeof k.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===Js||!Js.has(w)))){d.flags|=4096,t&=-t,d.lanes|=t,ho(d,hs(d,o,t));break e}}d=d.return}while(null!==d)}Al(n)}catch(x){t=x,Ns===n&&null!==n&&(Ns=n=n.return);continue}break}}function El(){var e=Ts.current;return Ts.current=Da,null===e?Da:e}function Cl(e,t){var n=Ds;Ds|=16;var r=El();for(Rs===e&&_s===t||jl(e,t);;)try{Ml();break}catch(i){Sl(e,i)}if(no(),Ds=n,Ts.current=r,null!==Ns)throw Error(a(261));return Rs=null,_s=0,$s}function Ml(){for(;null!==Ns;)Tl(Ns)}function Pl(){for(;null!==Ns&&!Mi();)Tl(Ns)}function Tl(e){var t=Xs(e.alternate,e,Ls);e.memoizedProps=e.pendingProps,null===t?Al(e):Ns=t,As.current=null}function Al(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(2048&t.flags)){if(null!==(n=ss(n,t,Ls)))return void(Ns=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!==(1073741824&Ls)||0===(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0===(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=ls(t)))return n.flags&=2047,void(Ns=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ns=t);Ns=t=e}while(null!==t);0===$s&&($s=5)}function Dl(e){var t=Hi();return qi(99,Rl.bind(null,e,t)),null}function Rl(e,t){do{_l()}while(null!==el);if(0!==(48&Ds))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<o;){var c=31-Ht(o),u=1<<c;i[c]=0,s[c]=-1,l[c]=-1,o&=~u}if(null!==il&&0===(24&r)&&il.has(e)&&il.delete(e),e===Rs&&(Ns=Rs=null,_s=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Ds,Ds|=32,As.current=null,Fr=Yt,gr(s=mr())){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(u=l.getSelection&&l.getSelection())&&0!==u.rangeCount){l=u.anchorNode,o=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{l.nodeType,c.nodeType}catch(E){l=null;break e}var f=0,d=-1,h=-1,p=0,v=0,m=s,g=null;t:for(;;){for(var y;m!==l||0!==o&&3!==m.nodeType||(d=f+o),m!==c||0!==u&&3!==m.nodeType||(h=f+u),3===m.nodeType&&(f+=m.nodeValue.length),null!==(y=m.firstChild);)g=m,m=y;for(;;){if(m===s)break t;if(g===l&&++p===o&&(d=f),g===c&&++v===u&&(h=f),null!==(y=m.nextSibling))break;g=(m=g).parentNode}m=y}l=-1===d||-1===h?null:{start:d,end:h}}else l=null;l=l||{start:0,end:0}}else l=null;Wr={focusedElem:s,selectionRange:l},Yt=!1,ul=null,fl=!1,Ys=r;do{try{Nl()}catch(E){if(null===Ys)throw Error(a(330));Bl(Ys,E),Ys=Ys.nextEffect}}while(null!==Ys);ul=null,Ys=r;do{try{for(s=e;null!==Ys;){var b=Ys.flags;if(16&b&&ye(Ys.stateNode,""),128&b){var O=Ys.alternate;if(null!==O){var k=O.ref;null!==k&&("function"===typeof k?k(null):k.current=null)}}switch(1038&b){case 2:ws(Ys),Ys.flags&=-3;break;case 6:ws(Ys),Ys.flags&=-3,Es(Ys.alternate,Ys);break;case 1024:Ys.flags&=-1025;break;case 1028:Ys.flags&=-1025,Es(Ys.alternate,Ys);break;case 4:Es(Ys.alternate,Ys);break;case 8:Ss(s,l=Ys);var w=l.alternate;Os(l),null!==w&&Os(w)}Ys=Ys.nextEffect}}catch(E){if(null===Ys)throw Error(a(330));Bl(Ys,E),Ys=Ys.nextEffect}}while(null!==Ys);if(k=Wr,O=mr(),b=k.focusedElem,s=k.selectionRange,O!==b&&b&&b.ownerDocument&&vr(b.ownerDocument.documentElement,b)){null!==s&&gr(b)&&(O=s.start,void 0===(k=s.end)&&(k=O),"selectionStart"in b?(b.selectionStart=O,b.selectionEnd=Math.min(k,b.value.length)):(k=(O=b.ownerDocument||document)&&O.defaultView||window).getSelection&&(k=k.getSelection(),l=b.textContent.length,w=Math.min(s.start,l),s=void 0===s.end?w:Math.min(s.end,l),!k.extend&&w>s&&(l=s,s=w,w=l),l=pr(b,w),o=pr(b,s),l&&o&&(1!==k.rangeCount||k.anchorNode!==l.node||k.anchorOffset!==l.offset||k.focusNode!==o.node||k.focusOffset!==o.offset)&&((O=O.createRange()).setStart(l.node,l.offset),k.removeAllRanges(),w>s?(k.addRange(O),k.extend(o.node,o.offset)):(O.setEnd(o.node,o.offset),k.addRange(O))))),O=[];for(k=b;k=k.parentNode;)1===k.nodeType&&O.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"===typeof b.focus&&b.focus(),b=0;b<O.length;b++)(k=O[b]).element.scrollLeft=k.left,k.element.scrollTop=k.top}Yt=!!Fr,Wr=Fr=null,e.current=n,Ys=r;do{try{for(b=e;null!==Ys;){var x=Ys.flags;if(36&x&&gs(b,Ys.alternate,Ys),128&x){O=void 0;var j=Ys.ref;if(null!==j){var S=Ys.stateNode;Ys.tag,O=S,"function"===typeof j?j(O):j.current=O}}Ys=Ys.nextEffect}}catch(E){if(null===Ys)throw Error(a(330));Bl(Ys,E),Ys=Ys.nextEffect}}while(null!==Ys);Ys=null,$i(),Ds=i}else e.current=n;if(Zs)Zs=!1,el=e,tl=t;else for(Ys=r;null!==Ys;)t=Ys.nextEffect,Ys.nextEffect=null,8&Ys.flags&&((x=Ys).sibling=null,x.stateNode=null),Ys=t;if(0===(r=e.pendingLanes)&&(Js=null),1===r?e===al?ol++:(ol=0,al=e):ol=0,n=n.stateNode,ji&&"function"===typeof ji.onCommitFiberRoot)try{ji.onCommitFiberRoot(xi,n,void 0,64===(64&n.current.flags))}catch(E){}if(ml(e,Vi()),Gs)throw Gs=!1,e=Ks,Ks=null,e;return 0!==(8&Ds)||Xi(),null}function Nl(){for(;null!==Ys;){var e=Ys.alternate;fl||null===ul||(0!==(8&Ys.flags)?et(Ys,ul)&&(fl=!0):13===Ys.tag&&Ms(e,Ys)&&et(Ys,ul)&&(fl=!0));var t=Ys.flags;0!==(256&t)&&ms(e,Ys),0===(512&t)||Zs||(Zs=!0,Ui(97,(function(){return _l(),null}))),Ys=Ys.nextEffect}}function _l(){if(90!==tl){var e=97<tl?97:tl;return tl=90,qi(e,$l)}return!1}function Ll(e,t){nl.push(t,e),Zs||(Zs=!0,Ui(97,(function(){return _l(),null})))}function Il(e,t){rl.push(t,e),Zs||(Zs=!0,Ui(97,(function(){return _l(),null})))}function $l(){if(null===el)return!1;var e=el;if(el=null,0!==(48&Ds))throw Error(a(331));var t=Ds;Ds|=32;var n=rl;rl=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"===typeof s)try{s()}catch(c){if(null===o)throw Error(a(330));Bl(o,c)}}for(n=nl,nl=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(c){if(null===o)throw Error(a(330));Bl(o,c)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ds=t,Xi(),!0}function zl(e,t,n){fo(e,t=ds(0,t=cs(n,t),1)),t=dl(),null!==(e=vl(e,1))&&(Vt(e,1,t),ml(e,t))}function Bl(e,t){if(3===e.tag)zl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){zl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Js||!Js.has(r))){var i=hs(n,e=cs(t,e),1);if(fo(n,i),i=dl(),null!==(n=vl(n,1)))Vt(n,1,i),ml(n,i);else if("function"===typeof r.componentDidCatch&&(null===Js||!Js.has(r)))try{r.componentDidCatch(t,e)}catch(o){}break}}n=n.return}}function Fl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=dl(),e.pingedLanes|=e.suspendedLanes&n,Rs===e&&(_s&n)===n&&(4===$s||3===$s&&(62914560&_s)===_s&&500>Vi()-Qs?jl(e,0):Vs|=n),ml(e,t)}function Wl(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0===(2&(t=e.mode))?t=1:0===(4&t)?t=99===Hi()?1:2:(0===ll&&(ll=Bs),0===(t=Ft(62914560&~ll))&&(t=4194304))),n=dl(),null!==(e=vl(e,t))&&(Vt(e,t,n),ml(e,n))}function Vl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Hl(e,t,n,r){return new Vl(e,t,n,r)}function Ql(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ql(e,t){var n=e.alternate;return null===n?((n=Hl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ul(e,t,n,r,i,o){var s=2;if(r=e,"function"===typeof e)Ql(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case j:return Xl(n.children,i,o,t);case L:s=8,i|=16;break;case S:s=8,i|=1;break;case E:return(e=Hl(12,n,t,8|i)).elementType=E,e.type=E,e.lanes=o,e;case T:return(e=Hl(13,n,t,i)).type=T,e.elementType=T,e.lanes=o,e;case A:return(e=Hl(19,n,t,i)).elementType=A,e.lanes=o,e;case I:return Yl(n,i,o,t);case $:return(e=Hl(24,n,t,i)).elementType=$,e.lanes=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case C:s=10;break e;case M:s=9;break e;case P:s=11;break e;case D:s=14;break e;case R:s=16,r=null;break e;case N:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Hl(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Xl(e,t,n,r){return(e=Hl(7,e,r,t)).lanes=n,e}function Yl(e,t,n,r){return(e=Hl(23,e,r,t)).elementType=I,e.lanes=n,e}function Gl(e,t,n){return(e=Hl(6,e,null,t)).lanes=n,e}function Kl(e,t,n){return(t=Hl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Wt(0),this.expirationTimes=Wt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wt(0),this.mutableSourceEagerHydrationData=null}function Zl(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:x,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function ec(e,t,n,r){var i=t.current,o=dl(),s=hl(i);e:if(n){t:{if(Ge(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(gi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(a(171))}if(1===n.tag){var c=n.type;if(gi(c)){n=Oi(n,c,l);break e}}n=l}else n=di;return null===t.context?t.context=n:t.pendingContext=n,(t=uo(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),fo(i,t),pl(i,s,o),s}function tc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function nc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function rc(e,t){nc(e,t),(e=e.alternate)&&nc(e,t)}function ic(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Jl(e,t,null!=n&&!0===n.hydrate),t=Hl(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,lo(t),e[ei]=n.current,Dr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function oc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ac(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if("function"===typeof i){var s=i;i=function(){var e=tc(a);s.call(e)}}ec(t,a,e,i)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ic(e,0,t?{hydrate:!0}:void 0)}(n,r),a=o._internalRoot,"function"===typeof i){var l=i;i=function(){var e=tc(a);l.call(e)}}kl((function(){ec(t,a,e,i)}))}return tc(a)}function sc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!oc(t))throw Error(a(200));return Zl(e,t,null,n)}Xs=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pi.current)Ia=!0;else{if(0===(n&r)){switch(Ia=!1,t.tag){case 3:Ua(t),Xo();break;case 5:Lo(t);break;case 1:gi(t.type)&&ki(t);break;case 4:No(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;fi(Ji,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(n&t.child.childLanes)?Ja(e,t,n):(fi($o,1&$o.current),null!==(t=os(e,t,n))?t.sibling:null);fi($o,1&$o.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(64&e.flags)){if(r)return is(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),fi($o,$o.current),r)break;return null;case 23:case 24:return t.lanes=0,Wa(e,t,n)}return os(e,t,n)}Ia=0!==(16384&e.flags)}else Ia=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=mi(t,hi.current),oo(t,n),i=sa(null,t,r,e,i,n),t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,gi(r)){var o=!0;ki(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,lo(t);var s=r.getDerivedStateFromProps;"function"===typeof s&&go(t,r,s,e),i.updater=yo,t.stateNode=i,i._reactInternals=t,wo(t,r,e,n),t=qa(null,t,r,!0,o,n)}else t.tag=0,$a(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"===typeof e)return Ql(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===P)return 11;if(e===D)return 14}return 2}(i),e=Ki(i,e),o){case 0:t=Ha(null,t,i,e,n);break e;case 1:t=Qa(null,t,i,e,n);break e;case 11:t=za(null,t,i,e,n);break e;case 14:t=Ba(null,t,i,Ki(i.type,e),r,n);break e}throw Error(a(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ha(e,t,r,i=t.elementType===r?i:Ki(r,i),n);case 1:return r=t.type,i=t.pendingProps,Qa(e,t,r,i=t.elementType===r?i:Ki(r,i),n);case 3:if(Ua(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,co(e,t),po(t,r,null,n),(r=t.memoizedState.element)===i)Xo(),t=os(e,t,n);else{if((o=(i=t.stateNode).hydrate)&&(Fo=Xr(t.stateNode.containerInfo.firstChild),Bo=t,o=Wo=!0),o){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(o=e[i])._workInProgressVersionPrimary=e[i+1],Yo.push(o);for(n=Mo(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else $a(e,t,r,n),Xo();t=t.child}return t;case 5:return Lo(t),null===e&&Qo(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,Hr(r,i)?s=null:null!==o&&Hr(r,o)&&(t.flags|=16),Va(e,t),$a(e,t,s,n),t.child;case 6:return null===e&&Qo(t),null;case 13:return Ja(e,t,n);case 4:return No(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Co(t,null,r,n):$a(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,za(e,t,r,i=t.elementType===r?i:Ki(r,i),n);case 7:return $a(e,t,t.pendingProps,n),t.child;case 8:case 12:return $a(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value;var l=t.type._context;if(fi(Ji,l._currentValue),l._currentValue=o,null!==s)if(l=s.value,0===(o=ur(l,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(s.children===i.children&&!pi.current){t=os(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){s=l.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!==(u.observedBits&o)){1===l.tag&&((u=uo(-1,n&-n)).tag=2,fo(l,u)),l.lanes|=n,null!==(u=l.alternate)&&(u.lanes|=n),io(l.return,n),c.lanes|=n;break}u=u.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}$a(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,oo(t,n),r=r(i=ao(i,o.unstable_observedBits)),t.flags|=1,$a(e,t,r,n),t.child;case 14:return o=Ki(i=t.type,t.pendingProps),Ba(e,t,i,o=Ki(i.type,o),r,n);case 15:return Fa(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ki(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,gi(r)?(e=!0,ki(t)):e=!1,oo(t,n),Oo(t,r,i),wo(t,r,i,n),qa(null,t,r,!0,e,n);case 19:return is(e,t,n);case 23:case 24:return Wa(e,t,n)}throw Error(a(156,t.tag))},ic.prototype.render=function(e){ec(e,this._internalRoot,null,null)},ic.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;ec(null,e,null,(function(){t[ei]=null}))},tt=function(e){13===e.tag&&(pl(e,4,dl()),rc(e,4))},nt=function(e){13===e.tag&&(pl(e,67108864,dl()),rc(e,67108864))},rt=function(e){if(13===e.tag){var t=dl(),n=hl(e);pl(e,n,t),rc(e,n)}},it=function(e,t){return t()},Ce=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=oi(r);if(!i)throw Error(a(90));K(r),ne(r,i)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},Re=Ol,Ne=function(e,t,n,r,i){var o=Ds;Ds|=4;try{return qi(98,e.bind(null,t,n,r,i))}finally{0===(Ds=o)&&(Us(),Xi())}},_e=function(){0===(49&Ds)&&(function(){if(null!==il){var e=il;il=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,ml(e,Vi())}))}Xi()}(),_l())},Le=function(e,t){var n=Ds;Ds|=2;try{return e(t)}finally{0===(Ds=n)&&(Us(),Xi())}};var lc={Events:[ri,ii,oi,Ae,De,_l,{current:!1}]},cc={findFiberByHostInstance:ni,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},uc={bundleType:cc.bundleType,version:cc.version,rendererPackageName:cc.rendererPackageName,rendererConfig:cc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:cc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{xi=fc.inject(uc),ji=fc}catch(me){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lc,t.createPortal=sc,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ds;if(0!==(48&n))return e(t);Ds|=1;try{if(e)return qi(99,e.bind(null,t))}finally{Ds=n,Xi()}},t.hydrate=function(e,t,n){if(!oc(t))throw Error(a(200));return ac(null,e,t,!0,n)},t.render=function(e,t,n){if(!oc(t))throw Error(a(200));return ac(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!oc(e))throw Error(a(40));return!!e._reactRootContainer&&(kl((function(){ac(null,null,e,!1,(function(){e._reactRootContainer=null,e[ei]=null}))})),!0)},t.unstable_batchedUpdates=Ol,t.unstable_createPortal=function(e,t){return sc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!oc(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return ac(e,t,n,!1,r)},t.version="17.0.2"},function(e,t,n){"use strict";e.exports=n(178)},function(e,t,n){"use strict";var r,i,o,a;if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var u=null,f=null,d=function e(){if(null!==u)try{var n=t.unstable_now();u(!0,n),u=null}catch(r){throw setTimeout(e,0),r}};r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(d,0))},i=function(e,t){f=setTimeout(e,t)},o=function(){clearTimeout(f)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,p=window.clearTimeout;if("undefined"!==typeof console){var v=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var m=!1,g=null,y=-1,b=5,O=0;t.unstable_shouldYield=function(){return t.unstable_now()>=O},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,w=k.port2;k.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();O=e+b;try{g(!0,e)?w.postMessage(null):(m=!1,g=null)}catch(n){throw w.postMessage(null),n}}else m=!1},r=function(e){g=e,m||(m=!0,w.postMessage(null))},i=function(e,n){y=h((function(){e(t.unstable_now())}),n)},o=function(){p(y),y=-1}}function x(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<E(i,t)))break e;e[r]=t,e[n]=i,n=r}}function j(e){return void 0===(e=e[0])?null:e}function S(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var o=2*(r+1)-1,a=e[o],s=o+1,l=e[s];if(void 0!==a&&0>E(a,n))void 0!==l&&0>E(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==l&&0>E(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function E(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],M=[],P=1,T=null,A=3,D=!1,R=!1,N=!1;function _(e){for(var t=j(M);null!==t;){if(null===t.callback)S(M);else{if(!(t.startTime<=e))break;S(M),t.sortIndex=t.expirationTime,x(C,t)}t=j(M)}}function L(e){if(N=!1,_(e),!R)if(null!==j(C))R=!0,r(I);else{var t=j(M);null!==t&&i(L,t.startTime-e)}}function I(e,n){R=!1,N&&(N=!1,o()),D=!0;var r=A;try{for(_(n),T=j(C);null!==T&&(!(T.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=T.callback;if("function"===typeof a){T.callback=null,A=T.priorityLevel;var s=a(T.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?T.callback=s:T===j(C)&&S(C),_(n)}else S(C);T=j(C)}if(null!==T)var l=!0;else{var c=j(M);null!==c&&i(L,c.startTime-n),l=!1}return l}finally{T=null,A=r,D=!1}}var $=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){R||D||(R=!0,r(I))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return j(C)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=$,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:P++,callback:n,priorityLevel:e,startTime:a,expirationTime:l=a+l,sortIndex:-1},a>s?(e.sortIndex=a,x(M,e),null===j(C)&&e===j(M)&&(N?o():N=!0,i(L,a-s))):(e.sortIndex=l,x(C,e),R||D||(R=!0,r(I))),e},t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},,function(e,t,n){"use strict";n(109);var r=n(0),i=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:o,_owner:a.current}}t.jsx=c,t.jsxs=c},function(e,t,n){"use strict";var r=n(182);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=n(184)},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,k=r?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case d:case a:case l:case s:case p:return e;default:switch(e=e&&e.$$typeof){case u:case h:case g:case m:case c:return e;default:return t}}case o:return t}}}function x(e){return w(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=c,t.Element=i,t.ForwardRef=h,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return x(e)||w(e)===f},t.isConcurrentMode=x,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===d||e===l||e===s||e===p||e===v||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===c||e.$$typeof===u||e.$$typeof===h||e.$$typeof===b||e.$$typeof===O||e.$$typeof===k||e.$$typeof===y)},t.typeOf=w},function(e,t,n){"use strict";var r=n(186),i=n(130),o=n(112),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},f=Date.prototype.toISOString,d=o.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,n,o,a,s,c,f,d,p,v,m,g,y,b,O){var k,w=t;if(O.has(t))throw new RangeError("Cyclic object value");if("function"===typeof f?w=f(n,w):w instanceof Date?w=v(w):"comma"===o&&l(w)&&(w=i.maybeMap(w,(function(e){return e instanceof Date?v(e):e}))),null===w){if(a)return c&&!y?c(n,h.encoder,b,"key",m):n;w=""}if("string"===typeof(k=w)||"number"===typeof k||"boolean"===typeof k||"symbol"===typeof k||"bigint"===typeof k||i.isBuffer(w))return c?[g(y?n:c(n,h.encoder,b,"key",m))+"="+g(c(w,h.encoder,b,"value",m))]:[g(n)+"="+g(String(w))];var x,j=[];if("undefined"===typeof w)return j;if("comma"===o&&l(w))x=[{value:w.length>0?w.join(",")||null:void 0}];else if(l(f))x=f;else{var S=Object.keys(w);x=d?S.sort(d):S}for(var E=0;E<x.length;++E){var C=x[E],M="object"===typeof C&&void 0!==C.value?C.value:w[C];if(!s||null!==M){var P=l(w)?"function"===typeof o?o(n,C):n:n+(p?"."+C:"["+C+"]");O.set(t,!0);var T=r();u(j,e(M,P,o,a,s,c,f,d,p,v,m,g,y,b,T))}}return j};e.exports=function(e,t){var n,i=e,c=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!==typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if("undefined"!==typeof e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],i=h.filter;return("function"===typeof e.filter||l(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"===typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:"undefined"===typeof e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:"undefined"===typeof e.delimiter?h.delimiter:e.delimiter,encode:"boolean"===typeof e.encode?e.encode:h.encode,encoder:"function"===typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"===typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"===typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"===typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"===typeof e.sort?e.sort:null,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"===typeof c.filter?i=(0,c.filter)("",i):l(c.filter)&&(n=c.filter);var f,d=[];if("object"!==typeof i||null===i)return"";f=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var v=s[f];n||(n=Object.keys(i)),c.sort&&n.sort(c.sort);for(var m=r(),g=0;g<n.length;++g){var y=n[g];c.skipNulls&&null===i[y]||u(d,p(i[y],y,v,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,m))}var b=d.join(c.delimiter),O=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?O+="utf8=%26%2310003%3B&":O+="utf8=%E2%9C%93&"),b.length>0?O+b:""}},function(e,t,n){"use strict";var r=n(110),i=n(191),o=n(193),a=r("%TypeError%"),s=r("%WeakMap%",!0),l=r("%Map%",!0),c=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),d=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),p=i("Map.prototype.has",!0),v=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+o(e))},get:function(r){if(s&&r&&("object"===typeof r||"function"===typeof r)){if(e)return c(e,r)}else if(l){if(t)return d(t,r)}else if(n)return function(e,t){var n=v(e,t);return n&&n.value}(n,r)},has:function(r){if(s&&r&&("object"===typeof r||"function"===typeof r)){if(e)return f(e,r)}else if(l){if(t)return p(t,r)}else if(n)return function(e,t){return!!v(e,t)}(n,r);return!1},set:function(r,i){s&&r&&("object"===typeof r||"function"===typeof r)?(e||(e=new s),u(e,r,i)):l?(t||(t=new l),h(t,r,i)):(n||(n={key:{},next:null}),function(e,t,n){var r=v(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,i))}};return r}},function(e,t,n){"use strict";var r="undefined"!==typeof Symbol&&Symbol,i=n(188);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},function(e,t,n){"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(e,t,n){"use strict";var r="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,o=Object.prototype.toString,a="[object Function]";e.exports=function(e){var t=this;if("function"!==typeof t||o.call(t)!==a)throw new TypeError(r+t);for(var n,s=i.call(arguments,1),l=function(){if(this instanceof n){var r=t.apply(this,s.concat(i.call(arguments)));return Object(r)===r?r:this}return t.apply(e,s.concat(i.call(arguments)))},c=Math.max(0,t.length-s.length),u=[],f=0;f<c;f++)u.push("$"+f);if(n=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),t.prototype){var d=function(){};d.prototype=t.prototype,n.prototype=new d,d.prototype=null}return n}},function(e,t,n){"use strict";var r=n(111);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,n){"use strict";var r=n(110),i=n(192),o=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&o(e,".prototype.")>-1?i(n):n}},function(e,t,n){"use strict";var r=n(111),i=n(110),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||r.call(a,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(d){c=null}e.exports=function(e){var t=s(r,a,arguments);if(l&&c){var n=l(t,"length");n.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var f=function(){return s(r,o,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},function(e,t,n){var r="function"===typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=r&&i&&"function"===typeof i.get?i.get:null,a=r&&Map.prototype.forEach,s="function"===typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&l&&"function"===typeof l.get?l.get:null,u=s&&Set.prototype.forEach,f="function"===typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"===typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"===typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,v=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,y="function"===typeof BigInt?BigInt.prototype.valueOf:null,b=Object.getOwnPropertySymbols,O="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol.prototype.toString:null,k="function"===typeof Symbol&&"object"===typeof Symbol.iterator,w=Object.prototype.propertyIsEnumerable,x=("function"===typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),j=n(194).custom,S=j&&T(j)?j:null,E="function"===typeof Symbol&&"undefined"!==typeof Symbol.toStringTag?Symbol.toStringTag:null;function C(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function M(e){return String(e).replace(/"/g,"&quot;")}function P(e){return"[object Array]"===R(e)&&(!E||!("object"===typeof e&&E in e))}function T(e){if(k)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!O)return!1;try{return O.call(e),!0}catch(t){}return!1}e.exports=function e(t,n,r,i){var s=n||{};if(D(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(D(s,"maxStringLength")&&("number"===typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!D(s,"customInspect")||s.customInspect;if("boolean"!==typeof l&&"symbol"!==l)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(D(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return _(t,s);if("number"===typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"===typeof t)return String(t)+"n";var v="undefined"===typeof s.depth?5:s.depth;if("undefined"===typeof r&&(r=0),r>=v&&v>0&&"object"===typeof t)return P(t)?"[Array]":"[Object]";var b=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(s,r);if("undefined"===typeof i)i=[];else if(N(i,t)>=0)return"[Circular]";function w(t,n,o){if(n&&(i=i.slice()).push(n),o){var a={depth:s.depth};return D(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,i)}return e(t,s,r+1,i)}if("function"===typeof t){var j=function(e){if(e.name)return e.name;var t=g.call(m.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),A=F(t,w);return"[Function"+(j?": "+j:" (anonymous)")+"]"+(A.length>0?" { "+A.join(", ")+" }":"")}if(T(t)){var L=k?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!==typeof t||k?L:I(L)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var W="<"+String(t.nodeName).toLowerCase(),V=t.attributes||[],H=0;H<V.length;H++)W+=" "+V[H].name+"="+C(M(V[H].value),"double",s);return W+=">",t.childNodes&&t.childNodes.length&&(W+="..."),W+="</"+String(t.nodeName).toLowerCase()+">"}if(P(t)){if(0===t.length)return"[]";var Q=F(t,w);return b&&!function(e){for(var t=0;t<e.length;t++)if(N(e[t],"\n")>=0)return!1;return!0}(Q)?"["+B(Q,b)+"]":"[ "+Q.join(", ")+" ]"}if(function(e){return"[object Error]"===R(e)&&(!E||!("object"===typeof e&&E in e))}(t)){var q=F(t,w);return 0===q.length?"["+String(t)+"]":"{ ["+String(t)+"] "+q.join(", ")+" }"}if("object"===typeof t&&l){if(S&&"function"===typeof t[S])return t[S]();if("symbol"!==l&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!==typeof e)return!1;try{o.call(e);try{c.call(e)}catch(W){return!0}return e instanceof Map}catch(t){}return!1}(t)){var U=[];return a.call(t,(function(e,n){U.push(w(n,t,!0)+" => "+w(e,t))})),z("Map",o.call(t),U,b)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{o.call(e)}catch(t){return!0}return e instanceof Set}catch(n){}return!1}(t)){var X=[];return u.call(t,(function(e){X.push(w(e,t))})),z("Set",c.call(t),X,b)}if(function(e){if(!f||!e||"object"!==typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(W){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return $("WeakMap");if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(W){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return $("WeakSet");if(function(e){if(!h||!e||"object"!==typeof e)return!1;try{return h.call(e),!0}catch(t){}return!1}(t))return $("WeakRef");if(function(e){return"[object Number]"===R(e)&&(!E||!("object"===typeof e&&E in e))}(t))return I(w(Number(t)));if(function(e){if(!e||"object"!==typeof e||!y)return!1;try{return y.call(e),!0}catch(t){}return!1}(t))return I(w(y.call(t)));if(function(e){return"[object Boolean]"===R(e)&&(!E||!("object"===typeof e&&E in e))}(t))return I(p.call(t));if(function(e){return"[object String]"===R(e)&&(!E||!("object"===typeof e&&E in e))}(t))return I(w(String(t)));if(!function(e){return"[object Date]"===R(e)&&(!E||!("object"===typeof e&&E in e))}(t)&&!function(e){return"[object RegExp]"===R(e)&&(!E||!("object"===typeof e&&E in e))}(t)){var Y=F(t,w),G=x?x(t)===Object.prototype:t instanceof Object||t.constructor===Object,K=t instanceof Object?"":"null prototype",J=!G&&E&&Object(t)===t&&E in t?R(t).slice(8,-1):K?"Object":"",Z=(G||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(J||K?"["+[].concat(J||[],K||[]).join(": ")+"] ":"");return 0===Y.length?Z+"{}":b?Z+"{"+B(Y,b)+"}":Z+"{ "+Y.join(", ")+" }"}return String(t)};var A=Object.prototype.hasOwnProperty||function(e){return e in this};function D(e,t){return A.call(e,t)}function R(e){return v.call(e)}function N(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function _(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return _(e.slice(0,t.maxStringLength),t)+r}return C(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,L),"single",t)}function L(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function I(e){return"Object("+e+")"}function $(e){return e+" { ? }"}function z(e,t,n,r){return e+" ("+t+") {"+(r?B(n,r):n.join(", "))+"}"}function B(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function F(e,t){var n=P(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=D(e,i)?t(e[i],e):""}var o,a="function"===typeof b?b(e):[];if(k){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var l in e)D(e,l)&&(n&&String(Number(l))===l&&l<e.length||k&&o["$"+l]instanceof Symbol||(/[^\w$]/.test(l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if("function"===typeof b)for(var c=0;c<a.length;c++)w.call(e,a[c])&&r.push("["+t(a[c])+"]: "+t(e[a[c]],e));return r}},,function(e,t,n){"use strict";var r=n(130),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},l=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(o),c=s?o.slice(0,s.index):o,u=[];if(c){if(!n.plainObjects&&i.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var f=0;n.depth>0&&null!==(s=a.exec(o))&&f<n.depth;){if(f+=1,!n.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+o.slice(s.index)+"]"),function(e,t,n,r){for(var i=r?t:l(t,n),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&n.parseArrays)a=[].concat(i);else{a=n.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);n.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=i:a[c]=i:a={0:i}}i=a}return i}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!==typeof e.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t="undefined"===typeof e.charset?a.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:a.comma,decoder:"function"===typeof e.decoder?e.decoder:a.decoder,delimiter:"string"===typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var u="string"===typeof e?function(e,t){var n,c={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,f),h=-1,p=t.charset;if(t.charsetSentinel)for(n=0;n<d.length;++n)0===d[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[n]?p="utf-8":"utf8=%26%2310003%3B"===d[n]&&(p="iso-8859-1"),h=n,n=d.length);for(n=0;n<d.length;++n)if(n!==h){var v,m,g=d[n],y=g.indexOf("]="),b=-1===y?g.indexOf("="):y+1;-1===b?(v=t.decoder(g,a.decoder,p,"key"),m=t.strictNullHandling?null:""):(v=t.decoder(g.slice(0,b),a.decoder,p,"key"),m=r.maybeMap(l(g.slice(b+1),t),(function(e){return t.decoder(e,a.decoder,p,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===p&&(m=s(m)),g.indexOf("[]=")>-1&&(m=o(m)?[m]:m),i.call(c,v)?c[v]=r.combine(c[v],m):c[v]=m}return c}(e,n):e,f=n.plainObjects?Object.create(null):{},d=Object.keys(u),h=0;h<d.length;++h){var p=d[h],v=c(p,u[p],n,"string"===typeof e);f=r.merge(f,v,n)}return!0===n.allowSparse?f:r.compact(f)}},function(e,t,n){"use strict";var r=60103,i=60106,o=60107,a=60108,s=60114,l=60109,c=60110,u=60112,f=60113,d=60120,h=60115,p=60116,v=60121,m=60122,g=60117,y=60129,b=60131;if("function"===typeof Symbol&&Symbol.for){var O=Symbol.for;r=O("react.element"),i=O("react.portal"),o=O("react.fragment"),a=O("react.strict_mode"),s=O("react.profiler"),l=O("react.provider"),c=O("react.context"),u=O("react.forward_ref"),f=O("react.suspense"),d=O("react.suspense_list"),h=O("react.memo"),p=O("react.lazy"),v=O("react.block"),m=O("react.server.block"),g=O("react.fundamental"),y=O("react.debug_trace_mode"),b=O("react.legacy_hidden")}function k(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case o:case s:case a:case f:case d:return e;default:switch(e=e&&e.$$typeof){case c:case u:case p:case h:case l:return e;default:return t}}case i:return t}}}var w=l,x=r,j=u,S=o,E=p,C=h,M=i,P=s,T=a,A=f;t.ContextConsumer=c,t.ContextProvider=w,t.Element=x,t.ForwardRef=j,t.Fragment=S,t.Lazy=E,t.Memo=C,t.Portal=M,t.Profiler=P,t.StrictMode=T,t.Suspense=A,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return k(e)===u},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===p},t.isMemo=function(e){return k(e)===h},t.isPortal=function(e){return k(e)===i},t.isProfiler=function(e){return k(e)===s},t.isStrictMode=function(e){return k(e)===a},t.isSuspense=function(e){return k(e)===f},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===s||e===y||e===a||e===f||e===d||e===b||"object"===typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===u||e.$$typeof===g||e.$$typeof===v||e[0]===m)},t.typeOf=k},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return Fn}));var r=n(13);function i(e,t,n,r){var i;n=n||0;for(var o=(r=r||t.length-1)<=2147483647;r-n>1;)t[i=o?n+r>>1:O((n+r)/2)]<e?n=i:r=i;return e-t[n]<=t[r]-e?n:r}function o(e,t,n,r){for(var i=1==r?t:n;i>=t&&i<=n;i+=r)if(null!=e[i])return i;return-1}var a=[0,0];function s(e,t,n,r){return a[0]=n<0?F(e,-n):e,a[1]=r<0?F(t,-r):t,a}function l(e,t,n,r){var i,o,a,l=E(e),c=10==n?C:M;return e==t&&(-1==l?(e*=n,t/=n):(e/=n,t*=n)),r?(i=O(c(e)),o=w(c(t)),e=(a=s(S(n,i),S(n,o),i,o))[0],t=a[1]):(i=O(c(b(e))),o=O(c(b(t))),e=B(e,(a=s(S(n,i),S(n,o),i,o))[0]),t=z(t,a[1])),[e,t]}function c(e,t,n,r){var i=l(e,t,n,r);return 0==e&&(i[0]=0),0==t&&(i[1]=0),i}var u={mode:3,pad:.1},f={pad:0,soft:null,mode:0},d={min:f,max:f};function h(e,t,n,r){return G(n)?v(e,t,n):(f.pad=n,f.soft=r?0:null,f.mode=r?3:0,v(e,t,d))}function p(e,t){return null==e?t:e}function v(e,t,n){var r=n.min,i=n.max,o=p(r.pad,0),a=p(i.pad,0),s=p(r.hard,-T),l=p(i.hard,T),c=p(r.soft,T),u=p(i.soft,-T),f=p(r.mode,0),d=p(i.mode,0),h=t-e;h<1e-9&&(h=0,0!=e&&0!=t||(h=1e-9,2==f&&c!=T&&(o=0),2==d&&u!=-T&&(a=0)));var v=h||b(t)||1e3,m=C(v),g=S(10,O(m)),y=F(B(e-v*(0==h?0==e?.1:1:o),g/10),9),k=e>=c&&(1==f||3==f&&y<=c||2==f&&y>=c)?c:T,w=j(s,y<k&&e>=k?k:x(k,y)),E=F(z(t+v*(0==h?0==t?.1:1:a),g/10),9),M=t<=u&&(1==d||3==d&&E>=u||2==d&&E<=u)?u:-T,P=x(l,E>M&&t<=M?M:j(M,E));return w==P&&0==w&&(P=100),[w,P]}var m=new Intl.NumberFormat(navigator.language).format,g=Math,y=g.PI,b=g.abs,O=g.floor,k=g.round,w=g.ceil,x=g.min,j=g.max,S=g.pow,E=g.sign,C=g.log10,M=g.log2,P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return g.asinh(e/t)},T=1/0;function A(e,t){return k(e/t)*t}function D(e,t,n){return x(j(e,t),n)}function R(e){return"function"==typeof e?e:function(){return e}}var N=function(e){return e},_=function(e,t){return t},L=function(e){return null},I=function(e){return!0},$=function(e,t){return e==t};function z(e,t){return w(e/t)*t}function B(e,t){return O(e/t)*t}function F(e,t){return k(e*(t=Math.pow(10,t)))/t}var W=new Map;function V(e){return((""+e).split(".")[1]||"").length}function H(e,t,n,r){for(var i=[],o=r.map(V),a=t;a<n;a++)for(var s=b(a),l=F(S(e,a),s),c=0;c<r.length;c++){var u=r[c]*l,f=(u>=0&&a>=0?0:s)+(a>=o[c]?0:o[c]),d=F(u,f);i.push(d),W.set(d,f)}return i}var Q={},q=[],U=[null,null],X=Array.isArray;function Y(e){return"string"==typeof e}function G(e){var t=!1;if(null!=e){var n=e.constructor;t=null==n||n==Object}return t}function K(e){return null!=e&&"object"==typeof e}function J(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;if(X(e)){var r=e.find((function(e){return null!=e}));if(X(r)||n(r)){t=Array(e.length);for(var i=0;i<e.length;i++)t[i]=J(e[i],n)}else t=e.slice()}else if(n(e))for(var o in t={},e)t[o]=J(e[o],n);else t=e;return t}function Z(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];for(var i in r)G(e[i])?Z(e[i],J(r[i])):e[i]=J(r[i])}return e}function ee(e,t,n){for(var r,i=0,o=-1;i<t.length;i++){var a=t[i];if(a>o){for(r=a-1;r>=0&&null==e[r];)e[r--]=null;for(r=a+1;r<n&&null==e[r];)e[o=r++]=null}}}var te,ne,re="undefined"==typeof queueMicrotask?function(e){return Promise.resolve().then(e)}:queueMicrotask,ie="width",oe="height",ae="top",se="bottom",le="left",ce="right",ue="#000",fe="#0000",de="mousemove",he="mousedown",pe="mouseup",ve="mouseenter",me="mouseleave",ge="dblclick",ye="change",be="dppxchange",Oe="u-off",ke="u-label",we=document,xe=window;function je(e,t){if(null!=t){var n=e.classList;!n.contains(t)&&n.add(t)}}function Se(e,t){var n=e.classList;n.contains(t)&&n.remove(t)}function Ee(e,t,n){e.style[t]=n+"px"}function Ce(e,t,n,r){var i=we.createElement(e);return null!=t&&je(i,t),null!=n&&n.insertBefore(i,r),i}function Me(e,t){return Ce("div",e,t)}var Pe=new WeakMap;function Te(e,t,n,r,i){var o="translate("+t+"px,"+n+"px)";o!=Pe.get(e)&&(e.style.transform=o,Pe.set(e,o),t<0||n<0||t>r||n>i?je(e,Oe):Se(e,Oe))}var Ae=new WeakMap;function De(e,t,n){var r=t+n;r!=Ae.get(e)&&(Ae.set(e,r),e.style.background=t,e.style.borderColor=n)}var Re=new WeakMap;var Ne={passive:!0},_e=Z({capture:!0},Ne);function Le(e,t,n,r){t.addEventListener(e,n,r?_e:Ne)}function Ie(e,t,n,r){t.removeEventListener(e,n,r?_e:Ne)}!function e(){var t=devicePixelRatio;te!=t&&(te=t,ne&&Ie(ye,ne,e),ne=matchMedia("(min-resolution: ".concat(te-.001,"dppx) and (max-resolution: ").concat(te+.001,"dppx)")),Le(ye,ne,e),xe.dispatchEvent(new CustomEvent(be)))}();var $e=["January","February","March","April","May","June","July","August","September","October","November","December"],ze=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Be(e){return e.slice(0,3)}var Fe=ze.map(Be),We=$e.map(Be),Ve={MMMM:$e,MMM:We,WWWW:ze,WWW:Fe};function He(e){return(e<10?"0":"")+e}var Qe={YYYY:function(e){return e.getFullYear()},YY:function(e){return(e.getFullYear()+"").slice(2)},MMMM:function(e,t){return t.MMMM[e.getMonth()]},MMM:function(e,t){return t.MMM[e.getMonth()]},MM:function(e){return He(e.getMonth()+1)},M:function(e){return e.getMonth()+1},DD:function(e){return He(e.getDate())},D:function(e){return e.getDate()},WWWW:function(e,t){return t.WWWW[e.getDay()]},WWW:function(e,t){return t.WWW[e.getDay()]},HH:function(e){return He(e.getHours())},H:function(e){return e.getHours()},h:function(e){var t=e.getHours();return 0==t?12:t>12?t-12:t},AA:function(e){return e.getHours()>=12?"PM":"AM"},aa:function(e){return e.getHours()>=12?"pm":"am"},a:function(e){return e.getHours()>=12?"p":"a"},mm:function(e){return He(e.getMinutes())},m:function(e){return e.getMinutes()},ss:function(e){return He(e.getSeconds())},s:function(e){return e.getSeconds()},fff:function(e){return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function qe(e,t){t=t||Ve;for(var n,r=[],i=/\{([a-z]+)\}|[^{]+/gi;n=i.exec(e);)r.push("{"==n[0][0]?Qe[n[1]]:n[0]);return function(e){for(var n="",i=0;i<r.length;i++)n+="string"==typeof r[i]?r[i]:r[i](e,t);return n}}var Ue=(new Intl.DateTimeFormat).resolvedOptions().timeZone;var Xe=function(e){return e%1==0},Ye=[1,2,2.5,5],Ge=H(10,-16,0,Ye),Ke=H(10,0,16,Ye),Je=Ke.filter(Xe),Ze=Ge.concat(Ke),et="{YYYY}",tt="\n"+et,nt="{M}/{D}",rt="\n"+nt,it=rt+"/{YY}",ot="{aa}",at="{h}:{mm}"+ot,st="\n"+at,lt=":{ss}",ct=null;function ut(e){var t=1e3*e,n=60*t,r=60*n,i=24*r,o=30*i,a=365*i;return[(1==e?H(10,0,3,Ye).filter(Xe):H(10,-3,0,Ye)).concat([t,5*t,10*t,15*t,30*t,n,5*n,10*n,15*n,30*n,r,2*r,3*r,4*r,6*r,8*r,12*r,i,2*i,3*i,4*i,5*i,6*i,7*i,8*i,9*i,10*i,15*i,o,2*o,3*o,4*o,6*o,a,2*a,5*a,10*a,25*a,50*a,100*a]),[[a,et,ct,ct,ct,ct,ct,ct,1],[28*i,"{MMM}",tt,ct,ct,ct,ct,ct,1],[i,nt,tt,ct,ct,ct,ct,ct,1],[r,"{h}"+ot,it,ct,rt,ct,ct,ct,1],[n,at,it,ct,rt,ct,ct,ct,1],[t,lt,it+" "+at,ct,rt+" "+at,ct,st,ct,1],[e,lt+".{fff}",it+" "+at,ct,rt+" "+at,ct,st,ct,1]],function(t){return function(s,l,c,u,f,d){var h=[],p=f>=a,v=f>=o&&f<a,m=t(c),g=F(m*e,3),y=xt(m.getFullYear(),p?0:m.getMonth(),v||p?1:m.getDate()),b=F(y*e,3);if(v||p)for(var w=v?f/o:0,x=p?f/a:0,j=g==b?g:F(xt(y.getFullYear()+x,y.getMonth()+w,1)*e,3),S=new Date(k(j/e)),E=S.getFullYear(),C=S.getMonth(),M=0;j<=u;M++){var P=xt(E+x*M,C+w*M,1),T=P-t(F(P*e,3));(j=F((+P+T)*e,3))<=u&&h.push(j)}else{var A=f>=i?i:f,D=b+(O(c)-O(g))+z(g-b,A);h.push(D);for(var R=t(D),N=R.getHours()+R.getMinutes()/n+R.getSeconds()/r,_=f/r,L=d/s.axes[l]._space;!((D=F(D+f,1==e?0:3))>u);)if(_>1){var I=O(F(N+_,6))%24,$=t(D).getHours()-I;$>1&&($=-1),N=(N+_)%24,F(((D-=$*r)-h[h.length-1])/f,3)*L>=.7&&h.push(D)}else h.push(D)}return h}}]}var ft=ut(1),dt=Object(r.a)(ft,3),ht=dt[0],pt=dt[1],vt=dt[2],mt=ut(.001),gt=Object(r.a)(mt,3),yt=gt[0],bt=gt[1],Ot=gt[2];function kt(e,t){return e.map((function(e){return e.map((function(n,r){return 0==r||8==r||null==n?n:t(1==r||0==e[8]?n:e[1]+n)}))}))}function wt(e,t){return function(n,r,i,o,a){var s,l,c,u,f,d,h=t.find((function(e){return a>=e[0]}))||t[t.length-1];return r.map((function(t){var n=e(t),r=n.getFullYear(),i=n.getMonth(),o=n.getDate(),a=n.getHours(),p=n.getMinutes(),v=n.getSeconds(),m=r!=s&&h[2]||i!=l&&h[3]||o!=c&&h[4]||a!=u&&h[5]||p!=f&&h[6]||v!=d&&h[7]||h[1];return s=r,l=i,c=o,u=a,f=p,d=v,m(n)}))}}function xt(e,t,n){return new Date(e,t,n)}function jt(e,t){return t(e)}H(2,-53,53,[1]);function St(e,t){return function(n,r){return t(e(r))}}var Et={show:!0,live:!0,isolate:!1,markers:{show:!0,width:2,stroke:function(e,t){var n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]};var Ct=[0,0];function Mt(e,t,n){return function(e){0==e.button&&n(e)}}function Pt(e,t,n){return n}var Tt={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,n){return Ct[0]=t,Ct[1]=n,Ct},points:{show:function(e,t){var n=e.cursor.points,r=Me(),i=n.size(e,t);Ee(r,ie,i),Ee(r,oe,i);var o=i/-2;Ee(r,"marginLeft",o),Ee(r,"marginTop",o);var a=n.width(e,t,i);return a&&Ee(r,"borderWidth",a),r},size:function(e,t){return Xt(e.series[t].points.width,1)},width:0,stroke:function(e,t){var n=e.series[t].points;return n._stroke||n._fill},fill:function(e,t){var n=e.series[t].points;return n._fill||n._stroke}},bind:{mousedown:Mt,mouseup:Mt,click:Mt,dblclick:Mt,mousemove:Pt,mouseleave:Pt,mouseenter:Pt},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(e,t,n){return n},idxs:null},At={show:!0,stroke:"rgba(0,0,0,0.07)",width:2,filter:_},Dt=Z({},At,{size:10}),Rt='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Nt="bold "+Rt,_t={show:!0,scale:"x",stroke:ue,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Nt,side:2,grid:At,ticks:Dt,font:Rt,rotate:0},Lt={show:!0,scale:"x",auto:!1,sorted:1,min:T,max:-T,idxs:[]};function It(e,t,n,r,i){return t.map((function(e){return null==e?"":m(e)}))}function $t(e,t,n,r,i,o,a){for(var s=[],l=W.get(i)||0,c=n=a?n:F(z(n,i),l);c<=r;c=F(c+i,l))s.push(Object.is(c,-0)?0:c);return s}function zt(e,t,n,r,i,o,a){var s=[],l=e.scales[e.axes[t].scale].log,c=O((10==l?C:M)(n));i=S(l,c),c<0&&(i=F(i,-c));var u=n;do{s.push(u),(u=F(u+i,W.get(i)))>=i*l&&(i=u)}while(u<=r);return s}function Bt(e,t,n,r,i,o,a){var s=e.scales[e.axes[t].scale].asinh,l=r>s?zt(e,t,j(s,n),r,i):[s],c=r>=0&&n<=0?[0]:[];return(n<-s?zt(e,t,j(s,-r),-n,i):[s]).reverse().map((function(e){return-e})).concat(c,l)}var Ft=/./,Wt=/[12357]/,Vt=/[125]/,Ht=/1/;function Qt(e,t,n,r,i){var o=e.axes[n],a=o.scale,s=e.scales[a];if(3==s.distr&&2==s.log)return t;var l=e.valToPos,c=o._space,u=l(10,a),f=l(9,a)-u>=c?Ft:l(7,a)-u>=c?Wt:l(5,a)-u>=c?Vt:Ht;return t.map((function(e){return 4==s.distr&&0==e||f.test(e)?e:null}))}function qt(e,t){return null==t?"":m(t)}var Ut={show:!0,scale:"y",stroke:ue,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Nt,side:3,grid:At,ticks:Dt,font:Rt,rotate:0};function Xt(e,t){return F((3+2*(e||1))*t,3)}function Yt(e,t,n,r){var i=e.scales[e.series[t].scale],o=e.bands&&e.bands.some((function(e){return e.series[0]==t}));return 3==i.distr||o?i.min:0}var Gt={scale:null,auto:!0,min:T,max:-T},Kt={show:!0,auto:!0,sorted:0,alpha:1,facets:[Z({},Gt,{scale:"x"}),Z({},Gt,{scale:"y"})]},Jt={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:function(e,t,n,r,i){return i},alpha:1,points:{show:function(e,t){var n=e.series[0],r=n.scale,i=n.idxs,o=e._data[0],a=e.valToPos(o[i[0]],r,!0),s=e.valToPos(o[i[1]],r,!0),l=b(s-a)/(e.series[t].points.space*te);return i[1]-i[0]<=l},filter:null},values:null,min:T,max:-T,idxs:[],path:null,clip:null};function Zt(e,t,n,r,i){return n/10}var en={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},tn=Z({},en,{time:!1,ori:1}),nn={};function rn(e,t){var n=nn[e];return n||(n={key:e,plots:[],sub:function(e){n.plots.push(e)},unsub:function(e){n.plots=n.plots.filter((function(t){return t!=e}))},pub:function(e,t,r,i,o,a,s){for(var l=0;l<n.plots.length;l++)n.plots[l]!=t&&n.plots[l].pub(e,t,r,i,o,a,s)}},null!=e&&(nn[e]=n)),n}function on(e,t,n){var r=e.series[t],i=e.scales,o=e.bbox,a=2==e.mode?i[r.facets[0].scale]:i[e.series[0].scale],s=e._data[0],l=e._data[t],c=a,u=2==e.mode?i[r.facets[1].scale]:i[r.scale],f=o.left,d=o.top,h=o.width,p=o.height,v=e.valToPosH,m=e.valToPosV;return 0==c.ori?n(r,s,l,c,u,v,m,f,d,h,p,un,dn,pn,mn,yn):n(r,s,l,c,u,m,v,d,f,p,h,fn,hn,vn,gn,bn)}function an(e,t,n,r,i){return on(e,t,(function(e,t,o,a,s,l,c,u,f,d,h){var p,v,m=a.dir*(0==a.ori?1:-1),g=0==a.ori?dn:hn;1==m?(p=n,v=r):(p=r,v=n);var y=A(l(t[p],a,d,u),.5),b=A(c(o[p],s,h,f),.5),O=A(l(t[v],a,d,u),.5),k=A(c(s.max,s,h,f),.5),w=new Path2D(i);return g(w,O,k),g(w,y,k),g(w,y,b),w}))}function sn(e,t,n,r,i,o){var a=null;if(e.length>0){a=new Path2D;for(var s=0==t?pn:vn,l=n,c=0;c<e.length;c++){var u=e[c];u[1]>u[0]&&(s(a,l,r,u[0]-l,r+o),l=u[1])}s(a,l,r,n+i-l,r+o)}return a}function ln(e,t,n){var r=e[e.length-1];r&&r[0]==t?r[1]=n:e.push([t,n])}function cn(e){return 0==e?N:1==e?k:function(t){return A(t,e)}}function un(e,t,n){e.moveTo(t,n)}function fn(e,t,n){e.moveTo(n,t)}function dn(e,t,n){e.lineTo(t,n)}function hn(e,t,n){e.lineTo(n,t)}function pn(e,t,n,r,i){e.rect(t,n,r,i)}function vn(e,t,n,r,i){e.rect(n,t,i,r)}function mn(e,t,n,r,i,o){e.arc(t,n,r,i,o)}function gn(e,t,n,r,i,o){e.arc(n,t,r,i,o)}function yn(e,t,n,r,i,o,a){e.bezierCurveTo(t,n,r,i,o,a)}function bn(e,t,n,r,i,o,a){e.bezierCurveTo(n,t,i,r,a,o)}function On(e){return function(e,t,n,r,i){return on(e,t,(function(t,o,a,s,l,c,u,f,d,h,p){var v,m,g=t.pxRound,b=t.points;0==s.ori?(v=un,m=mn):(v=fn,m=gn);var O=F(b.width*te,3),k=(b.size-b.width)/2*te,w=F(2*k,3),x=new Path2D,j=new Path2D,S=e.bbox;pn(j,S.left-w,S.top-w,S.width+2*w,S.height+2*w);var E=function(e){if(null!=a[e]){var t=g(c(o[e],s,h,f)),n=g(u(a[e],l,p,d));v(x,t+k,n),m(x,t,n,k,0,2*y)}};if(i)i.forEach(E);else for(var C=n;C<=r;C++)E(C);return{stroke:O>0?x:null,fill:x,clip:j,flags:3}}))}}function kn(e){return function(t,n,r,i,o,a){r!=i&&(o!=r&&a!=r&&e(t,n,r),o!=i&&a!=i&&e(t,n,i),e(t,n,a))}}var wn=kn(dn),xn=kn(hn);function jn(){return function(e,t,n,r){return on(e,t,(function(i,a,s,l,c,u,f,d,h,p,v){var m,g,y=i.pxRound;0==l.ori?(m=dn,g=wn):(m=hn,g=xn);var b,O,k,w,S=l.dir*(0==l.ori?1:-1),E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},C=E.stroke,M=T,P=-T,D=[],R=y(u(a[1==S?n:r],l,p,d)),N=!1,_=!1,L=o(s,n,r,1*S),I=o(s,n,r,-1*S),$=A(u(a[L],l,p,d),.5),z=A(u(a[I],l,p,d),.5);$>d&&ln(D,d,$);for(var B=1==S?n:r;B>=n&&B<=r;B+=S){var F=y(u(a[B],l,p,d));if(F==R)null!=s[B]?(O=y(f(s[B],c,v,h)),M==T&&(m(C,F,O),b=O),M=x(O,M),P=j(O,P)):null===s[B]&&(N=_=!0);else{var W=!1;M!=T?(g(C,R,M,P,b,O),k=w=R):N&&(W=!0,N=!1),null!=s[B]?(m(C,F,O=y(f(s[B],c,v,h))),M=P=b=O,_&&F-R>1&&(W=!0),_=!1):(M=T,P=-T,null===s[B]&&(N=!0,F-R>1&&(W=!0))),W&&ln(D,k,F),R=F}}if(M!=T&&M!=P&&w!=R&&g(C,R,M,P,b,O),z<d+p&&ln(D,z,d+p),null!=i.fill){var V=E.fill=new Path2D(C),H=y(f(i.fillTo(e,t,i.min,i.max),c,v,h));m(V,z,H),m(V,$,H)}return E.gaps=D=i.gaps(e,t,n,r,D),i.spanGaps||(E.clip=sn(D,l.ori,d,h,p,v)),e.bands.length>0&&(E.band=an(e,t,n,r,C)),E}))}}function Sn(e,t,n,r,i,o){var a=e.length;if(a<2)return null;var s=new Path2D;if(n(s,e[0],t[0]),2==a)r(s,e[1],t[1]);else{for(var l=Array(a),c=Array(a-1),u=Array(a-1),f=Array(a-1),d=0;d<a-1;d++)u[d]=t[d+1]-t[d],f[d]=e[d+1]-e[d],c[d]=u[d]/f[d];l[0]=c[0];for(var h=1;h<a-1;h++)0===c[h]||0===c[h-1]||c[h-1]>0!==c[h]>0?l[h]=0:(l[h]=3*(f[h-1]+f[h])/((2*f[h]+f[h-1])/c[h-1]+(f[h]+2*f[h-1])/c[h]),isFinite(l[h])||(l[h]=0));l[a-1]=c[a-2];for(var p=0;p<a-1;p++)i(s,e[p]+f[p]/3,t[p]+l[p]*f[p]/3,e[p+1]-f[p]/3,t[p+1]-l[p+1]*f[p]/3,e[p+1],t[p+1])}return s}var En=new Set;function Cn(){En.forEach((function(e){e.syncRect(!0)}))}Le("resize",xe,Cn),Le("scroll",xe,Cn,!0);var Mn=jn(),Pn=On();function Tn(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((function(e,r){return An(e,r,t,n)}))}function An(e,t,n,r){return Z({},0==t?n:r,e)}function Dn(e,t,n){return null==t?U:[t,n]}var Rn=Dn;function Nn(e,t,n){return null==t?U:h(t,n,.1,!0)}function _n(e,t,n,r){return null==t?U:l(t,n,e.scales[r].log,!1)}var Ln=_n;function In(e,t,n,r){return null==t?U:c(t,n,e.scales[r].log,!1)}var $n=In;function zn(e){var t,n;return[e=e.replace(/(\d+)px/,(function(e,r){return(t=k((n=+r)*te))+"px"})),t,n]}function Bn(e){e.show&&[e.font,e.labelFont].forEach((function(e){var t=F(e[2]*te,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Fn(e,t,n){var o,a={mode:null!==(o=e.mode)&&void 0!==o?o:1},s=a.mode;function f(e,t){return((3==t.distr?C(e>0?e:t.clamp(a,e,t.min,t.max,t.key)):4==t.distr?P(e,t.asinh):e)-t._min)/(t._max-t._min)}function d(e,t,n,r){var i=f(e,t);return r+n*(-1==t.dir?1-i:i)}function v(e,t,n,r){var i=f(e,t);return r+n*(-1==t.dir?i:1-i)}function m(e,t,n,r){return 0==t.ori?d(e,t,n,r):v(e,t,n,r)}a.valToPosH=d,a.valToPosV=v;var E=!1;a.status=0;var M=a.root=Me("uplot");(null!=e.id&&(M.id=e.id),je(M,e.class),e.title)&&(Me("u-title",M).textContent=e.title);var N=Ce("canvas"),B=a.ctx=N.getContext("2d"),V=Me("u-wrap",M),H=a.under=Me("u-under",V);V.appendChild(N);var ee=a.over=Me("u-over",V),ne=+p((e=J(e)).pxAlign,1),ue=cn(ne);(e.plugins||[]).forEach((function(t){t.opts&&(e=t.opts(a,e)||e)}));var ye,Pe,Ae=e.ms||.001,Ne=a.series=1==s?Tn(e.series||[],Lt,Jt,!1):(ye=e.series||[null],Pe=Kt,ye.map((function(e,t){return 0==t?null:Z({},Pe,e)}))),_e=a.axes=Tn(e.axes||[],_t,Ut,!0),$e=a.scales={},ze=a.bands=e.bands||[];ze.forEach((function(e){e.fill=R(e.fill||null)}));var Be=2==s?Ne[1].facets[0].scale:Ne[0].scale,Fe={axes:function(){for(var e=function(e){var t=_e[e];if(!t.show||!t._show)return{v:void 0};var n=t.side,i=n%2,o=void 0,s=void 0,l=t.stroke(a,e),c=0==n||3==n?-1:1;if(t.label){var u=t.labelGap*c,f=k((t._lpos+u)*te);lr(t.labelFont[0],l,"center",2==n?ae:se),B.save(),1==i?(o=s=0,B.translate(f,k(ln+fn/2)),B.rotate((3==n?-y:y)/2)):(o=k(sn+un/2),s=f),B.fillText(t.label,o,s),B.restore()}var d=Object(r.a)(t._found,2),h=d[0],p=d[1];if(0==p)return{v:void 0};var v=$e[t.scale],g=0==i?un:fn,b=0==i?sn:ln,O=k(t.gap*te),w=t._splits,x=2==v.distr?w.map((function(e){return rr[e]})):w,j=2==v.distr?rr[w[1]]-rr[w[0]]:h,S=t.ticks,E=S.show?k(S.size*te):0,C=t._rotate*-y/180,M=ue(t._pos*te),P=M+(E+O)*c;s=0==i?P:0,o=1==i?P:0,lr(t.font[0],l,1==t.align?le:2==t.align?ce:C>0?le:C<0?ce:0==i?"center":3==n?ce:le,C||1==i?"middle":2==n?ae:se);for(var T=1.5*t.font[1],A=w.map((function(e){return ue(m(e,v,g,b))})),D=t._values,R=0;R<D.length;R++){var N=D[R];if(null!=N){0==i?o=A[R]:s=A[R];for(var _=-1==(N=""+N).indexOf("\n")?[N]:N.split(/\n/gm),L=0;L<_.length;L++){var I=_[L];C?(B.save(),B.translate(o,s+L*T),B.rotate(C),B.fillText(I,0,0),B.restore()):B.fillText(I,o,s+L*T)}}}S.show&&mr(A,S.filter(a,x,e,p,j),i,n,M,E,F(S.width*te,3),S.stroke(a,e),S.dash,S.cap);var $=t.grid;$.show&&mr(A,$.filter(a,x,e,p,j),i,0==i?2:1,0==i?ln:sn,0==i?fn:un,F($.width*te,3),$.stroke(a,e),$.dash,$.cap)},t=0;t<_e.length;t++){var n=e(t);if("object"===typeof n)return n.v}vi("drawAxes")},series:function(){Fn>0&&(Ne.forEach((function(e,n){if(n>0&&e.show&&null==e._paths){var r=function(e){var t=D(er-1,0,Fn-1),n=D(tr+1,0,Fn-1);for(;null==e[t]&&t>0;)t--;for(;null==e[n]&&n<Fn-1;)n++;return[t,n]}(t[n]);e._paths=e.paths(a,n,r[0],r[1])}})),Ne.forEach((function(e,t){if(t>0&&e.show){Kn!=e.alpha&&(B.globalAlpha=Kn=e.alpha),ur(t,!1),e._paths&&fr(t,!1),ur(t,!0);var n=e.points.show(a,t,er,tr),r=e.points.filter(a,t,n,e._paths?e._paths.gaps:null);(n||r)&&(e.points._paths=e.points.paths(a,t,er,tr,r),fr(t,!0)),1!=Kn&&(B.globalAlpha=Kn=1),vi("drawSeries",t)}})))}},We=(e.drawOrder||["axes","series"]).map((function(e){return Fe[e]}));function Ve(t){var n=$e[t];if(null==n){var r=(e.scales||Q)[t]||Q;if(null!=r.from)Ve(r.from),$e[t]=Z({},$e[r.from],r);else{n=$e[t]=Z({},t==Be?en:tn,r),2==s&&(n.time=!1),n.key=t;var i=n.time,o=n.range,a=X(o);if((t!=Be||2==s)&&(!a||null!=o[0]&&null!=o[1]||(o={min:null==o[0]?u:{mode:1,hard:o[0],soft:o[0]},max:null==o[1]?u:{mode:1,hard:o[1],soft:o[1]}},a=!1),!a&&G(o))){var l=o;o=function(e,t,n){return null==t?U:h(t,n,l)}}n.range=R(o||(i?Rn:t==Be?3==n.distr?Ln:4==n.distr?$n:Dn:3==n.distr?_n:4==n.distr?In:Nn)),n.auto=R(!a&&n.auto),n.clamp=R(n.clamp||Zt),n._min=n._max=null}}}for(var He in Ve("x"),Ve("y"),1==s&&Ne.forEach((function(e){Ve(e.scale)})),_e.forEach((function(e){Ve(e.scale)})),e.scales)Ve(He);var Qe,Ue,Xe=$e[Be],Ye=Xe.distr;0==Xe.ori?(je(M,"u-hz"),Qe=d,Ue=v):(je(M,"u-vt"),Qe=v,Ue=d);var Ge={};for(var Ke in $e){var et=$e[Ke];null==et.min&&null==et.max||(Ge[Ke]={min:et.min,max:et.max},et.min=et.max=null)}var tt,nt=e.tzDate||function(e){return new Date(k(e/Ae))},rt=e.fmtDate||qe,it=1==Ae?vt(nt):Ot(nt),ot=wt(nt,kt(1==Ae?pt:bt,rt)),at=St(nt,jt("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",rt)),st=[],lt=a.legend=Z({},Et,e.legend),ct=lt.show,ut=lt.markers;lt.idxs=st,ut.width=R(ut.width),ut.dash=R(ut.dash),ut.stroke=R(ut.stroke),ut.fill=R(ut.fill);var ft,dt=[],mt=[],gt=!1,xt={};if(lt.live){var Ct=Ne[1]?Ne[1].values:null;for(var Mt in ft=(gt=null!=Ct)?Ct(a,1,0):{_:0})xt[Mt]="--"}if(ct)if(tt=Ce("table","u-legend",M),gt){var Pt=Ce("tr","u-thead",tt);for(var At in Ce("th",null,Pt),ft)Ce("th",ke,Pt).textContent=At}else je(tt,"u-inline"),lt.live&&je(tt,"u-live");var Dt={show:!0},Rt={show:!1};var Nt=new Map;function Ft(e,t,n){var r=Nt.get(t)||{},i=bn.bind[e](a,t,n);i&&(Le(e,t,r[e]=i),Nt.set(t,r))}function Wt(e,t,n){var r=Nt.get(t)||{};for(var i in r)null!=e&&i!=e||(Ie(i,t,r[i]),delete r[i]);null==e&&Nt.delete(t)}var Vt=0,Ht=0,Gt=0,nn=0,on=0,an=0,sn=0,ln=0,un=0,fn=0;a.bbox={};var dn=!1,hn=!1,pn=!1,vn=!1,mn=!1;function gn(e,t,n){(n||e!=a.width||t!=a.height)&&yn(e,t),br(!1),pn=!0,hn=!0,vn=mn=bn.left>=0,Rr()}function yn(e,t){a.width=Vt=Gt=e,a.height=Ht=nn=t,on=an=0,function(){var e=!1,t=!1,n=!1,r=!1;_e.forEach((function(i,o){if(i.show&&i._show){var a=i.side,s=a%2,l=i._size+(i.labelSize=null!=i.label?i.labelSize||30:0);l>0&&(s?(Gt-=l,3==a?(on+=l,r=!0):n=!0):(nn-=l,0==a?(an+=l,e=!0):t=!0))}})),Sn[0]=e,Sn[1]=n,Sn[2]=t,Sn[3]=r,Gt-=Zn[1]+Zn[3],on+=Zn[3],nn-=Zn[2]+Zn[0],an+=Zn[0]}(),function(){var e=on+Gt,t=an+nn,n=on,r=an;function i(i,o){switch(i){case 1:return(e+=o)-o;case 2:return(t+=o)-o;case 3:return(n-=o)+o;case 0:return(r-=o)+o}}_e.forEach((function(e,t){if(e.show&&e._show){var n=e.side;e._pos=i(n,e._size),null!=e.label&&(e._lpos=i(n,e.labelSize))}}))}();var n=a.bbox;sn=n.left=A(on*te,.5),ln=n.top=A(an*te,.5),un=n.width=A(Gt*te,.5),fn=n.height=A(nn*te,.5)}a.setSize=function(e){gn(e.width,e.height)};var bn=a.cursor=Z({},Tt,{drag:{y:2==s}},e.cursor);bn.idxs=st,bn._lock=!1;var On=bn.points;On.show=R(On.show),On.size=R(On.size),On.stroke=R(On.stroke),On.width=R(On.width),On.fill=R(On.fill);var kn=a.focus=Z({},e.focus||{alpha:.3},bn.focus),wn=kn.prox>=0,xn=[null];function jn(e,t){if(1==s||t>0){var n=1==s&&$e[e.scale].time,r=e.value;e.value=n?Y(r)?St(nt,jt(r,rt)):r||at:r||qt,e.label=e.label||(n?"Time":"Value")}if(t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||Mn||L,e.fillTo=R(e.fillTo||Yt),e.pxAlign=+p(e.pxAlign,ne),e.pxRound=cn(e.pxAlign),e.stroke=R(e.stroke||null),e.fill=R(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;var i=Xt(e.width,1),o=e.points=Z({},{size:i,width:j(1,.2*i),stroke:e.stroke,space:2*i,paths:Pn,_stroke:null,_fill:null},e.points);o.show=R(o.show),o.filter=R(o.filter),o.fill=R(o.fill),o.stroke=R(o.stroke),o.paths=R(o.paths),o.pxAlign=e.pxAlign}if(ct){var l=function(e,t){if(0==t&&(gt||!lt.live||2==s))return U;var n=[],r=Ce("tr","u-series",tt,tt.childNodes[t]);je(r,e.class),e.show||je(r,Oe);var i=Ce("th",null,r);if(ut.show){var o=Me("u-marker",i);if(t>0){var l=ut.width(a,t);l&&(o.style.border=l+"px "+ut.dash(a,t)+" "+ut.stroke(a,t)),o.style.background=ut.fill(a,t)}}var c=Me(ke,i);for(var u in c.textContent=e.label,t>0&&(ut.show||(c.style.color=e.width>0?ut.stroke(a,t):ut.fill(a,t)),Ft("click",i,(function(t){if(!bn._lock){var n=Ne.indexOf(e);if(t.ctrlKey!=lt.isolate){var r=Ne.some((function(e,t){return t>0&&t!=n&&e.show}));Ne.forEach((function(e,t){t>0&&Ur(t,r?t==n?Dt:Rt:Dt,!0,mi.setSeries)}))}else Ur(n,{show:!e.show},!0,mi.setSeries)}})),wn&&Ft(ve,i,(function(t){bn._lock||Ur(Ne.indexOf(e),Xr,!0,mi.setSeries)}))),ft){var f=Ce("td","u-value",r);f.textContent="--",n.push(f)}return[r,n]}(e,t);dt.splice(t,0,l[0]),mt.splice(t,0,l[1]),lt.values.push(null)}if(bn.show){st.splice(t,0,null);var c=function(e,t){if(t>0){var n=bn.points.show(a,t);if(n)return je(n,"u-cursor-pt"),je(n,e.class),Te(n,-10,-10,Gt,nn),ee.insertBefore(n,xn[t]),n}}(e,t);c&&xn.splice(t,0,c)}}a.addSeries=function(e,t){e=An(e,t=null==t?Ne.length:t,Lt,Jt),Ne.splice(t,0,e),jn(Ne[t],t)},a.delSeries=function(e){if(Ne.splice(e,1),ct){lt.values.splice(e,1),mt.splice(e,1);var t=dt.splice(e,1)[0];Wt(null,t.firstChild),t.remove()}bn.show&&(st.splice(e,1),xn.length>1&&xn.splice(e,1)[0].remove())};var Sn=[!1,!1,!1,!1];function Cn(e,t,n,i){var o=Object(r.a)(n,4),a=o[0],s=o[1],l=o[2],c=o[3],u=t%2,f=0;return 0==u&&(c||s)&&(f=0==t&&!a||2==t&&!l?k(_t.size/3):0),1==u&&(a||l)&&(f=1==t&&!s||3==t&&!c?k(Ut.size/2):0),f}var Fn,Wn,Vn,Hn,Qn,qn,Un,Xn,Yn,Gn,Kn,Jn=a.padding=(e.padding||[Cn,Cn,Cn,Cn]).map((function(e){return R(p(e,Cn))})),Zn=a._padding=Jn.map((function(e,t){return e(a,t,Sn,0)})),er=null,tr=null,nr=1==s?Ne[0].idxs:null,rr=null,ir=!1;function or(e,n){if(2==s){Fn=0;for(var r=1;r<Ne.length;r++)Fn+=t[r][0].length;a.data=t=e}else(t=(e||[]).slice())[0]=t[0]||[],a.data=t.slice(),rr=t[0],Fn=rr.length,2==Ye&&(t[0]=rr.map((function(e,t){return t})));if(a._data=t,br(!0),vi("setData"),!1!==n){var i=Xe;i.auto(a,ir)?ar():qr(Be,i.min,i.max),vn=bn.left>=0,mn=!0,Rr()}}function ar(){var e,n;if(ir=!0,1==s)if(Fn>0){if(er=nr[0]=0,tr=nr[1]=Fn-1,e=t[0][er],n=t[0][tr],2==Ye)e=er,n=tr;else if(1==Fn)if(3==Ye){var i=l(e,e,Xe.log,!1),o=Object(r.a)(i,2);e=o[0],n=o[1]}else if(4==Ye){var a=c(e,e,Xe.log,!1),u=Object(r.a)(a,2);e=u[0],n=u[1]}else if(Xe.time)n=e+k(86400/Ae);else{var f=h(e,n,.1,!0),d=Object(r.a)(f,2);e=d[0],n=d[1]}}else er=nr[0]=e=null,tr=nr[1]=n=null;qr(Be,e,n)}function sr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fe,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:q,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"butt",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:fe,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"round";e!=Wn&&(B.strokeStyle=Wn=e),i!=Vn&&(B.fillStyle=Vn=i),t!=Hn&&(B.lineWidth=Hn=t),o!=qn&&(B.lineJoin=qn=o),r!=Un&&(B.lineCap=Un=r),n!=Qn&&B.setLineDash(Qn=n)}function lr(e,t,n,r){t!=Vn&&(B.fillStyle=Vn=t),e!=Xn&&(B.font=Xn=e),n!=Yn&&(B.textAlign=Yn=n),r!=Gn&&(B.textBaseline=Gn=r)}function cr(e,t,n,r){if(e.auto(a,ir)&&(null==t||null==t.min)){var i,o,s=null!==(i=er)&&void 0!==i?i:0,l=null!==(o=tr)&&void 0!==o?o:r.length-1,c=null==n.min?3==e.distr?function(e,t,n){for(var r=T,i=-T,o=t;o<=n;o++)e[o]>0&&(r=x(r,e[o]),i=j(i,e[o]));return[r==T?1:r,i==-T?10:i]}(r,s,l):function(e,t,n,r){var i=T,o=-T;if(1==r)i=e[t],o=e[n];else if(-1==r)i=e[n],o=e[t];else for(var a=t;a<=n;a++)null!=e[a]&&(i=x(i,e[a]),o=j(o,e[a]));return[i,o]}(r,s,l):[n.min,n.max];e.min=x(e.min,n.min=c[0]),e.max=j(e.max,n.max=c[1])}}function ur(e,t){var n=t?Ne[e].points:Ne[e];n._stroke=n.stroke(a,e),n._fill=n.fill(a,e)}function fr(e,t){var n=t?Ne[e].points:Ne[e],r=n._stroke,i=n._fill,o=n._paths,s=o.stroke,l=o.fill,c=o.clip,u=o.flags,f=null,d=F(n.width*te,3),h=d%2/2;t&&null==i&&(i=d>0?"#fff":r);var p=1==n.pxAlign;if(p&&B.translate(h,h),!t){var v=sn,m=ln,g=un,y=fn,b=d*te/2;0==n.min&&(y+=b),0==n.max&&(m-=b,y+=b),(f=new Path2D).rect(v,m,g,y)}t?dr(r,d,n.dash,n.cap,i,s,l,u,c):function(e,t,n,r,i,o,s,l,c,u,f){var d=!1;ze.forEach((function(h,p){if(h.series[0]==e){var v,m=Ne[h.series[1]],g=(m._paths||Q).band,y=null;m.show&&g?(y=h.fill(a,p)||o,v=m._paths.clip):g=null,dr(t,n,r,i,y,s,l,c,u,f,v,g),d=!0}})),d||dr(t,n,r,i,o,s,l,c,u,f)}(e,r,d,n.dash,n.cap,i,s,l,u,f,c),p&&B.translate(-h,-h)}a.setData=or;function dr(e,t,n,r,i,o,a,s,l,c,u,f){sr(e,t,n,r,i),(l||c||f)&&(B.save(),l&&B.clip(l),c&&B.clip(c)),f?3==(3&s)?(B.clip(f),u&&B.clip(u),pr(i,a),hr(e,o,t)):2&s?(pr(i,a),B.clip(f),hr(e,o,t)):1&s&&(B.save(),B.clip(f),u&&B.clip(u),pr(i,a),B.restore(),hr(e,o,t)):(pr(i,a),hr(e,o,t)),(l||c||f)&&B.restore()}function hr(e,t,n){e&&t&&n&&B.stroke(t)}function pr(e,t){e&&t&&B.fill(t)}function vr(e,t,n,r){var i,o=_e[e];if(r<=0)i=[0,0];else{var s=o._space=o.space(a,e,t,n,r),l=o._incrs=o.incrs(a,e,t,n,r,s);i=o._found=function(e,t,n,r,i){for(var o=r/(t-e),a=(""+O(e)).length,s=0;s<n.length;s++){var l=n[s]*o,c=n[s]<10?W.get(n[s]):0;if(l>=i&&a+c<17)return[n[s],l]}return[0,0]}(t,n,l,r,s)}return i}function mr(e,t,n,r,i,o,a,s,l,c){var u=a%2/2;1==ne&&B.translate(u,u),sr(s,a,l,c,s),B.beginPath();var f,d,h,p,v=i+(0==r||3==r?-o:o);0==n?(d=i,p=v):(f=i,h=v);for(var m=0;m<e.length;m++)null!=t[m]&&(0==n?f=h=e[m]:d=p=e[m],B.moveTo(f,d),B.lineTo(h,p));B.stroke(),1==ne&&B.translate(-u,-u)}function gr(e){var t=!0;return _e.forEach((function(n,i){if(n.show){var o=$e[n.scale];if(null!=o.min){n._show||(t=!1,n._show=!0,br(!1));var s=n.side,l=s%2,c=o.min,u=o.max,f=vr(i,c,u,0==l?Gt:nn),d=Object(r.a)(f,2),h=d[0],p=d[1];if(0!=p){var v=2==o.distr,m=n._splits=n.splits(a,i,c,u,h,p,v),g=2==o.distr?m.map((function(e){return rr[e]})):m,y=2==o.distr?rr[m[1]]-rr[m[0]]:h,b=n._values=n.values(a,n.filter(a,g,i,p,y),i,p,y);n._rotate=2==s?n.rotate(a,b,i,p):0;var O=n._size;n._size=w(n.size(a,b,i,e)),null!=O&&n._size!=O&&(t=!1)}}else n._show&&(t=!1,n._show=!1,br(!1))}})),t}function yr(e){var t=!0;return Jn.forEach((function(n,r){var i=n(a,r,Sn,e);i!=Zn[r]&&(t=!1),Zn[r]=i})),t}function br(e){Ne.forEach((function(t,n){n>0&&(t._paths=null,e&&(1==s?(t.min=null,t.max=null):t.facets.forEach((function(e){e.min=null,e.max=null}))))}))}var Or,kr,wr,xr,jr,Sr,Er,Cr,Mr,Pr,Tr,Ar,Dr=!1;function Rr(){Dr||(re(Nr),Dr=!0)}function Nr(){dn&&(!function(){var e=J($e,K);for(var n in e){var o=e[n],l=Ge[n];if(null!=l&&null!=l.min)Z(o,l),n==Be&&br(!0);else if(n!=Be||2==s)if(0==Fn&&null==o.from){var c=o.range(a,null,null,n);o.min=c[0],o.max=c[1]}else o.min=T,o.max=-T}if(Fn>0)for(var u in Ne.forEach((function(n,o){if(1==s){var l=n.scale,c=e[l],u=Ge[l];if(0==o){var f=c.range(a,c.min,c.max,l);c.min=f[0],c.max=f[1],er=i(c.min,t[0]),tr=i(c.max,t[0]),t[0][er]<c.min&&er++,t[0][tr]>c.max&&tr--,n.min=rr[er],n.max=rr[tr]}else n.show&&n.auto&&cr(c,u,n,t[o]);n.idxs[0]=er,n.idxs[1]=tr}else if(o>0&&n.show&&n.auto){var d=Object(r.a)(n.facets,2),h=d[0],p=d[1],v=h.scale,m=p.scale,g=Object(r.a)(t[o],2),y=g[0],b=g[1];cr(e[v],Ge[v],h,y),cr(e[m],Ge[m],p,b),n.min=p.min,n.max=p.max}})),e){var f=e[u],d=Ge[u];if(null==f.from&&(null==d||null==d.min)){var h=f.range(a,f.min==T?null:f.min,f.max==-T?null:f.max,u);f.min=h[0],f.max=h[1]}}for(var p in e){var v=e[p];if(null!=v.from){var m=e[v.from],g=v.range(a,m.min,m.max,p);v.min=g[0],v.max=g[1]}}var y={},b=!1;for(var O in e){var k=e[O],w=$e[O];if(w.min!=k.min||w.max!=k.max){w.min=k.min,w.max=k.max;var x=w.distr;w._min=3==x?C(w.min):4==x?P(w.min,w.asinh):w.min,w._max=3==x?C(w.max):4==x?P(w.max,w.asinh):w.max,y[O]=b=!0}}if(b){for(var j in Ne.forEach((function(e,t){2==s?t>0&&y.y&&(e._paths=null):y[e.scale]&&(e._paths=null)})),y)pn=!0,vi("setScale",j);bn.show&&(vn=mn=bn.left>=0)}for(var S in Ge)Ge[S]=null}(),dn=!1),pn&&(!function(){for(var e=!1,t=0;!e;){var n=gr(++t),r=yr(t);(e=3==t||n&&r)||(yn(a.width,a.height),hn=!0)}}(),pn=!1),hn&&(Ee(H,le,on),Ee(H,ae,an),Ee(H,ie,Gt),Ee(H,oe,nn),Ee(ee,le,on),Ee(ee,ae,an),Ee(ee,ie,Gt),Ee(ee,oe,nn),Ee(V,ie,Vt),Ee(V,oe,Ht),N.width=k(Vt*te),N.height=k(Ht*te),Wn=Vn=Hn=qn=Un=Xn=Yn=Gn=Qn=null,Kn=1,oi(!1),vi("setSize"),hn=!1),Vt>0&&Ht>0&&(B.clearRect(0,0,N.width,N.height),vi("drawClear"),We.forEach((function(e){return e()})),vi("draw")),bn.show&&vn&&(ri(null,!0,!1),vn=!1),E||(E=!0,a.status=1,vi("ready")),ir=!1,Dr=!1}function _r(e,n){var r=$e[e];if(null==r.from){if(0==Fn){var o=r.range(a,n.min,n.max,e);n.min=o[0],n.max=o[1]}if(n.min>n.max){var s=n.min;n.min=n.max,n.max=s}if(Fn>1&&null!=n.min&&null!=n.max&&n.max-n.min<1e-16)return;e==Be&&2==r.distr&&Fn>0&&(n.min=i(n.min,t[0]),n.max=i(n.max,t[0])),Ge[e]=n,dn=!0,Rr()}}a.redraw=function(e,t){pn=t||!1,!1!==e?qr(Be,Xe.min,Xe.max):Rr()},a.setScale=_r;var Lr=!1,Ir=bn.drag,$r=Ir.x,zr=Ir.y;bn.show&&(bn.x&&(Or=Me("u-cursor-x",ee)),bn.y&&(kr=Me("u-cursor-y",ee)),0==Xe.ori?(wr=Or,xr=kr):(wr=kr,xr=Or),Tr=bn.left,Ar=bn.top);var Br,Fr,Wr,Vr=a.select=Z({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Hr=Vr.show?Me("u-select",Vr.over?ee:H):null;function Qr(e,t){if(Vr.show){for(var n in e)Ee(Hr,n,Vr[n]=e[n]);!1!==t&&vi("setSelect")}}function qr(e,t,n){_r(e,{min:t,max:n})}function Ur(e,t,n,r){var i=Ne[e];null!=t.focus&&function(e){if(e!=Wr){var t=null==e,n=1!=kn.alpha;Ne.forEach((function(r,i){var o=t||0==i||i==e;r._focus=t?null:o,n&&function(e,t){Ne[e].alpha=t,bn.show&&xn[e]&&(xn[e].style.opacity=t);ct&&dt[e]&&(dt[e].style.opacity=t)}(i,o?1:kn.alpha)})),Wr=e,n&&Rr()}}(e),null!=t.show&&(i.show=t.show,function(e,t){var n=Ne[e],r=ct?dt[e]:null;n.show?r&&Se(r,Oe):(r&&je(r,Oe),xn.length>1&&Te(xn[e],-10,-10,Gt,nn))}(e,t.show),qr(2==s?i.facets[1].scale:i.scale,null,null),Rr()),!1!==n&&vi("setSeries",e,t),r&&bi("setSeries",a,e,t)}a.setSelect=Qr,a.setSeries=Ur,a.addBand=function(e,t){e.fill=R(e.fill||null),t=null==t?ze.length:t,ze.splice(t,0,e)},a.setBand=function(e,t){Z(ze[e],t)},a.delBand=function(e){null==e?ze.length=0:ze.splice(e,1)};var Xr={focus:!0},Yr={focus:!1};function Gr(e,t,n){var r=$e[t];n&&(e=e/te-(1==r.ori?an:on));var i=Gt;1==r.ori&&(e=(i=nn)-e),-1==r.dir&&(e=i-e);var o=r._min,a=o+(r._max-o)*(e/i),s=r.distr;return 3==s?S(10,a):4==s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return g.sinh(e/t)}(a,r.asinh):a}function Kr(e,t){Ee(Hr,le,Vr.left=e),Ee(Hr,ie,Vr.width=t)}function Jr(e,t){Ee(Hr,ae,Vr.top=e),Ee(Hr,oe,Vr.height=t)}ct&&wn&&Le(me,tt,(function(e){bn._lock||(Ur(null,Yr,!0,mi.setSeries),ri(null,!0,!1))})),a.valToIdx=function(e){return i(e,t[0])},a.posToIdx=function(e,n){return i(Gr(e,Be,n),t[0],er,tr)},a.posToVal=Gr,a.valToPos=function(e,t,n){return 0==$e[t].ori?d(e,$e[t],n?un:Gt,n?sn:0):v(e,$e[t],n?fn:nn,n?ln:0)},a.batch=function(e){e(a),Rr()},a.setCursor=function(e,t,n){Tr=e.left,Ar=e.top,ri(null,t,n)};var Zr=0==Xe.ori?Kr:Jr,ei=1==Xe.ori?Kr:Jr;function ti(e,t){if(null!=e){var n=e.idx;lt.idx=n,Ne.forEach((function(e,t){(t>0||!gt)&&ni(t,n)}))}ct&&lt.live&&function(){if(ct&&lt.live)for(var e=2==s?1:0;e<Ne.length;e++)if(0!=e||!gt){var t=lt.values[e],n=0;for(var r in t)mt[e][n++].firstChild.nodeValue=t[r]}}(),mn=!1,!1!==t&&vi("setLegend")}function ni(e,n){var r;if(null==n)r=xt;else{var i=Ne[e],o=0==e&&2==Ye?rr:t[e];r=gt?i.values(a,e,n):{_:i.value(a,o[n],e,n)}}lt.values[e]=r}function ri(e,n,o){Mr=Tr,Pr=Ar;var l,c=bn.move(a,Tr,Ar),u=Object(r.a)(c,2);Tr=u[0],Ar=u[1],bn.show&&(wr&&Te(wr,k(Tr),0,Gt,nn),xr&&Te(xr,0,k(Ar),Gt,nn));var f=er>tr;Br=T;var d,h,p=0==Xe.ori?Gt:nn,v=1==Xe.ori?Gt:nn;if(Tr<0||0==Fn||f){l=null;for(var m=0;m<Ne.length;m++)m>0&&xn.length>1&&Te(xn[m],-10,-10,Gt,nn);if(wn&&Ur(null,Xr,!0,null==e&&mi.setSeries),lt.live){st.fill(null),mn=!0;for(var g=0;g<Ne.length;g++)lt.values[g]=xt}}else{var y,O;1==s&&(l=i(y=Gr(0==Xe.ori?Tr:Ar,Be),t[0],er,tr),O=z(Qe(t[0][l],Xe,p,0),.5));for(var w=2==s?1:0;w<Ne.length;w++){var j=Ne[w],S=st[w],C=1==s?t[w][S]:t[w][1][S],M=bn.dataIdx(a,w,l,y),P=1==s?t[w][M]:t[w][1][M];mn=mn||P!=C||M!=S,st[w]=M;var A=M==l?O:z(Qe(1==s?t[0][M]:t[w][0][M],Xe,p,0),.5);if(w>0&&j.show){var D=null==P?-10:z(Ue(P,1==s?$e[j.scale]:$e[j.facets[1].scale],v,0),.5);if(D>0&&1==s){var R=b(D-Ar);R<=Br&&(Br=R,Fr=w)}var N=void 0,_=void 0;0==Xe.ori?(N=A,_=D):(N=D,_=A),mn&&xn.length>1&&(Te(xn[w],N,_,Gt,nn),De(xn[w],bn.points.fill(a,w),bn.points.stroke(a,w)),2==s&&(d=xn[w],(h=bn.points.size(a,w))!=Re.get(d)&&(Re.set(d,h),d.style.height=d.style.width=h+"px",d.style.marginLeft=d.style.marginTop=-h/2+"px")))}if(lt.live){if(!mn||0==w&&gt)continue;ni(w,M)}}}if(mn&&(lt.idx=l,ti()),Vr.show&&Lr)if(null!=e){var L=Object(r.a)(mi.scales,2),I=L[0],$=L[1],B=Object(r.a)(mi.match,2),F=B[0],W=B[1],V=Object(r.a)(e.cursor.sync.scales,2),H=V[0],Q=V[1],q=e.cursor.drag;$r=q._x,zr=q._y;var U,X,Y,G,K,J=e.select,Z=J.left,ee=J.top,te=J.width,ne=J.height,re=e.scales[I].ori,ie=e.posToVal,oe=null!=I&&F(I,H),ae=null!=$&&W($,Q);oe&&(0==re?(U=Z,X=te):(U=ee,X=ne),$r?(Y=$e[I],G=Qe(ie(U,H),Y,p,0),K=Qe(ie(U+X,H),Y,p,0),Zr(x(G,K),b(K-G))):Zr(0,p),ae||ei(0,v)),ae&&(1==re?(U=Z,X=te):(U=ee,X=ne),zr?(Y=$e[$],G=Ue(ie(U,Q),Y,v,0),K=Ue(ie(U+X,Q),Y,v,0),ei(x(G,K),b(K-G))):ei(0,v),oe||Zr(0,p))}else{var se=b(Mr-jr),le=b(Pr-Sr);if(1==Xe.ori){var ce=se;se=le,le=ce}$r=Ir.x&&se>=Ir.dist,zr=Ir.y&&le>=Ir.dist;var ue,fe,he=Ir.uni;null!=he?$r&&zr&&(zr=le>=he,($r=se>=he)||zr||(le>se?zr=!0:$r=!0)):Ir.x&&Ir.y&&($r||zr)&&($r=zr=!0),$r&&(0==Xe.ori?(ue=Er,fe=Tr):(ue=Cr,fe=Ar),Zr(x(ue,fe),b(fe-ue)),zr||ei(0,v)),zr&&(1==Xe.ori?(ue=Er,fe=Tr):(ue=Cr,fe=Ar),ei(x(ue,fe),b(fe-ue)),$r||Zr(0,p)),$r||zr||(Zr(0,0),ei(0,0))}if(bn.idx=l,bn.left=Tr,bn.top=Ar,Ir._x=$r,Ir._y=zr,null==e){if(o){if(null!=gi){var pe=Object(r.a)(mi.scales,2),ve=pe[0],me=pe[1];mi.values[0]=null!=ve?Gr(0==Xe.ori?Tr:Ar,ve):null,mi.values[1]=null!=me?Gr(1==Xe.ori?Tr:Ar,me):null}bi(de,a,Tr,Ar,Gt,nn,l)}if(wn){var ge=o&&mi.setSeries,ye=kn.prox;null==Wr?Br<=ye&&Ur(Fr,Xr,!0,ge):Br>ye?Ur(null,Xr,!0,ge):Fr!=Wr&&Ur(Fr,Xr,!0,ge)}}E&&!1!==n&&vi("setCursor")}a.setLegend=ti;var ii=null;function oi(e){!0===e?ii=null:vi("syncRect",ii=ee.getBoundingClientRect())}function ai(e,t,n,r,i,o,a){bn._lock||(si(e,t,n,r,i,o,a,!1,null!=e),null!=e?ri(null,!0,!0):ri(t,!0,!1))}function si(e,t,n,i,o,s,l,c,u){if(null==ii&&oi(!1),null!=e)n=e.clientX-ii.left,i=e.clientY-ii.top;else{if(n<0||i<0)return Tr=-10,void(Ar=-10);var f=Object(r.a)(mi.scales,2),d=f[0],h=f[1],p=t.cursor.sync,v=Object(r.a)(p.values,2),g=v[0],y=v[1],b=Object(r.a)(p.scales,2),O=b[0],k=b[1],w=Object(r.a)(mi.match,2),x=w[0],j=w[1],S=1==t.scales[O].ori,E=0==Xe.ori?Gt:nn,C=1==Xe.ori?Gt:nn,M=S?s:o,P=S?o:s,T=S?i:n,D=S?n:i;if(n=null!=O?x(d,O)?m(g,$e[d],E,0):-10:E*(T/M),i=null!=k?j(h,k)?m(y,$e[h],C,0):-10:C*(D/P),1==Xe.ori){var R=n;n=i,i=R}}if(u&&((n<=1||n>=Gt-1)&&(n=A(n,Gt)),(i<=1||i>=nn-1)&&(i=A(i,nn))),c){jr=n,Sr=i;var N=bn.move(a,n,i),_=Object(r.a)(N,2);Er=_[0],Cr=_[1]}else Tr=n,Ar=i}function li(){Qr({width:0,height:0},!1)}function ci(e,t,n,r,i,o,s){Lr=!0,$r=zr=Ir._x=Ir._y=!1,si(e,t,n,r,i,o,0,!0,!1),null!=e&&(Ft(pe,we,ui),bi(he,a,Er,Cr,Gt,nn,null))}function ui(e,t,n,r,i,o,s){Lr=Ir._x=Ir._y=!1,si(e,t,n,r,i,o,0,!1,!0);var l=Vr.left,c=Vr.top,u=Vr.width,f=Vr.height,d=u>0||f>0;if(d&&Qr(Vr),Ir.setScale&&d){var h=l,p=u,v=c,m=f;if(1==Xe.ori&&(h=c,p=f,v=l,m=u),$r&&qr(Be,Gr(h,Be),Gr(h+p,Be)),zr)for(var g in $e){var y=$e[g];g!=Be&&null==y.from&&y.min!=T&&qr(g,Gr(v+m,g),Gr(v,g))}li()}else bn.lock&&(bn._lock=!bn._lock,bn._lock||ri(null,!0,!1));null!=e&&(Wt(pe,we),bi(pe,a,Tr,Ar,Gt,nn,null))}function fi(e,t,n,r,i,o,s){ar(),li(),null!=e&&bi(ge,a,Tr,Ar,Gt,nn,null)}function di(){_e.forEach(Bn),gn(a.width,a.height,!0)}Le(be,xe,di);var hi={};hi.mousedown=ci,hi.mousemove=ai,hi.mouseup=ui,hi.dblclick=fi,hi.setSeries=function(e,t,n,r){Ur(n,r,!0,!1)},bn.show&&(Ft(he,ee,ci),Ft(de,ee,ai),Ft(ve,ee,oi),Ft(me,ee,(function(e,t,n,r,i,o,a){if(!bn._lock){var s=Lr;if(Lr){var l,c,u=!0,f=!0;0==Xe.ori?(l=$r,c=zr):(l=zr,c=$r),l&&c&&(u=Tr<=10||Tr>=Gt-10,f=Ar<=10||Ar>=nn-10),l&&u&&(Tr=Tr<Er?0:Gt),c&&f&&(Ar=Ar<Cr?0:nn),ri(null,!0,!0),Lr=!1}Tr=-10,Ar=-10,ri(null,!0,!0),s&&(Lr=s)}})),Ft(ge,ee,fi),En.add(a),a.syncRect=oi);var pi=a.hooks=e.hooks||{};function vi(e,t,n){e in pi&&pi[e].forEach((function(e){e.call(null,a,t,n)}))}(e.plugins||[]).forEach((function(e){for(var t in e.hooks)pi[t]=(pi[t]||[]).concat(e.hooks[t])}));var mi=Z({key:null,setSeries:!1,filters:{pub:I,sub:I},scales:[Be,Ne[1]?Ne[1].scale:null],match:[$,$],values:[null,null]},bn.sync);bn.sync=mi;var gi=mi.key,yi=rn(gi);function bi(e,t,n,r,i,o,a){mi.filters.pub(e,t,n,r,i,o,a)&&yi.pub(e,t,n,r,i,o,a)}function Oi(){vi("init",e,t),or(t||e.data,!1),Ge[Be]?_r(Be,Ge[Be]):ar(),gn(e.width,e.height),ri(null,!0,!1),Qr(Vr,!1)}return yi.sub(a),a.pub=function(e,t,n,r,i,o,a){mi.filters.sub(e,t,n,r,i,o,a)&&hi[e](null,t,n,r,i,o,a)},a.destroy=function(){yi.unsub(a),En.delete(a),Nt.clear(),Ie(be,xe,di),M.remove(),vi("destroy")},Ne.forEach(jn),_e.forEach((function(e,t){if(e._show=e.show,e.show){var n=e.side%2,r=$e[e.scale];null==r&&(e.scale=n?Ne[1].scale:Be,r=$e[e.scale]);var i=r.time;e.size=R(e.size),e.space=R(e.space),e.rotate=R(e.rotate),e.incrs=R(e.incrs||(2==r.distr?Je:i?1==Ae?ht:yt:Ze)),e.splits=R(e.splits||(i&&1==r.distr?it:3==r.distr?zt:4==r.distr?Bt:$t)),e.stroke=R(e.stroke),e.grid.stroke=R(e.grid.stroke),e.ticks.stroke=R(e.ticks.stroke);var o=e.values;e.values=X(o)&&!X(o[0])?R(o):i?X(o)?wt(nt,kt(o,rt)):Y(o)?function(e,t){var n=qe(t);return function(t,r,i,o,a){return r.map((function(t){return n(e(t))}))}}(nt,o):o||ot:o||It,e.filter=R(e.filter||(r.distr>=3?Qt:_)),e.font=zn(e.font),e.labelFont=zn(e.labelFont),e._size=e.size(a,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(Sn[t]=!0)}})),n?n instanceof HTMLElement?(n.appendChild(M),Oi()):n(a,Oi):Oi(),a}Fn.assign=Z,Fn.fmtNum=m,Fn.rangeNum=h,Fn.rangeLog=l,Fn.rangeAsinh=c,Fn.orient=on,Fn.join=function(e,t){for(var n=new Set,r=0;r<e.length;r++)for(var i=e[r][0],o=i.length,a=0;a<o;a++)n.add(i[a]);for(var s=[Array.from(n).sort((function(e,t){return e-t}))],l=s[0].length,c=new Map,u=0;u<l;u++)c.set(s[0][u],u);for(var f=0;f<e.length;f++)for(var d=e[f],h=d[0],p=1;p<d.length;p++){for(var v=d[p],m=Array(l).fill(void 0),g=t?t[f][p]:1,y=[],b=0;b<v.length;b++){var O=v[b],k=c.get(h[b]);null===O?0!=g&&(m[k]=O,2==g&&y.push(k)):m[k]=O}ee(m,y,l),s.push(m)}return s},Fn.fmtDate=qe,Fn.tzDate=function(e,t){var n;return"UTC"==t||"Etc/UTC"==t?n=new Date(+e+6e4*e.getTimezoneOffset()):t==Ue?n=e:(n=new Date(e.toLocaleString("en-US",{timeZone:t}))).setMilliseconds(e.getMilliseconds()),n},Fn.sync=rn,Fn.addGap=ln,Fn.clipGaps=sn;var Wn=Fn.paths={points:On};Wn.linear=jn,Wn.stepped=function(e){var t=p(e.align,1),n=p(e.ascDesc,!1);return function(e,r,i,a){return on(e,r,(function(s,l,c,u,f,d,h,p,v,m,g){var y=s.pxRound,b=0==u.ori?dn:hn,O={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},k=O.stroke,w=1*u.dir*(0==u.ori?1:-1);i=o(c,i,a,1),a=o(c,i,a,-1);var x=[],j=!1,S=y(h(c[1==w?i:a],f,g,v)),E=y(d(l[1==w?i:a],u,m,p)),C=E;b(k,E,S);for(var M=1==w?i:a;M>=i&&M<=a;M+=w){var P=c[M],T=y(d(l[M],u,m,p));if(null!=P){var A=y(h(P,f,g,v));if(j){if(ln(x,C,T),S!=A){var D=s.width*te/2,R=x[x.length-1];R[0]+=n||1==t?D:-D,R[1]-=n||-1==t?D:-D}j=!1}1==t?b(k,T,S):b(k,C,A),b(k,T,A),S=A,C=T}else null===P&&(ln(x,C,T),j=!0)}if(null!=s.fill){var N=O.fill=new Path2D(k),_=y(h(s.fillTo(e,r,s.min,s.max),f,g,v));b(N,C,_),b(N,E,_)}return O.gaps=x=s.gaps(e,r,i,a,x),s.spanGaps||(O.clip=sn(x,u.ori,p,v,m,g)),e.bands.length>0&&(O.band=an(e,r,i,a,k)),O}))}},Wn.bars=function(e){var t=p((e=e||Q).size,[.6,T,1]),n=e.align||0,r=(e.gap||0)*te,i=1-t[0],o=p(t[1],T)*te,a=p(t[2],1)*te,s=e.disp,l=p(e.each,(function(e){}));return function(e,t,c,u){return on(e,t,(function(f,d,h,p,v,m,g,y,O,k,w){var S,E,C=f.pxRound,M=p.dir*(0==p.ori?1:-1),P=v.dir*(1==v.ori?1:-1),T=0==p.ori?pn:vn,D=0==p.ori?l:function(e,t,n,r,i,o,a){l(e,t,n,i,r,a,o)},R=g(f.fillTo(e,t,f.min,f.max),v,w,O),N=C(f.width*te);if(null!=s){d=s.x0.values(e,t,c,u),2==s.x0.unit&&(d=d.map((function(t){return e.posToVal(y+t*k,p.key,!0)})));var _=s.size.values(e,t,c,u);E=C((E=2==s.size.unit?_[0]*k:m(_[0],p,k,y)-m(0,p,k,y))-N),S=1==M?-N/2:E+N/2}else{var L=k;if(d.length>1)for(var I=1,$=1/0;I<d.length;I++){var z=b(d[I]-d[I-1]);z<$&&($=z,L=b(m(d[I],p,k,y)-m(d[I-1],p,k,y)))}E=C(x(o,j(a,L-L*i))-N-r),S=(0==n?E/2:n==M?0:E)-n*M*r/2}var B,F={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:3},W=e.bands.length>0;W&&(F.band=new Path2D,B=A(g(v.max,v,w,O),.5));for(var V=F.stroke,H=F.band,Q=1==M?c:u;Q>=c&&Q<=u;Q+=M){var q=h[Q],U=m(2!=p.distr||null!=s?d[Q]:Q,p,k,y),X=g(q,v,w,O),Y=C(U-S),G=C(j(X,R)),K=C(x(X,R)),J=G-K;null!=h[Q]&&(T(V,Y,K,E,J),D(e,t,Q,Y-N/2,K-N/2,E+N,J+N)),W&&(1==P?(G=K,K=B):(K=G,G=B),T(H,Y-N/2,K+N/2,E+N,(J=G-K)-N))}return null!=f.fill&&(F.fill=new Path2D(V)),F}))}},Wn.spline=function(e){return t=Sn,function(e,n,r,i){return on(e,n,(function(a,s,l,c,u,f,d,h,p,v,m){var g,y,b,O=a.pxRound;0==c.ori?(g=un,b=dn,y=yn):(g=fn,b=hn,y=bn);var k=1*c.dir*(0==c.ori?1:-1);r=o(l,r,i,1),i=o(l,r,i,-1);for(var w=[],x=!1,j=O(f(s[1==k?r:i],c,v,h)),S=j,E=[],C=[],M=1==k?r:i;M>=r&&M<=i;M+=k){var P=l[M],T=f(s[M],c,v,h);null!=P?(x&&(ln(w,S,T),x=!1),E.push(S=T),C.push(d(l[M],u,m,p))):null===P&&(ln(w,S,T),x=!0)}var A={stroke:t(E,C,g,b,y,O),fill:null,clip:null,band:null,gaps:null,flags:1},D=A.stroke;if(null!=a.fill&&null!=D){var R=A.fill=new Path2D(D),N=O(d(a.fillTo(e,n,a.min,a.max),u,m,p));b(R,S,N),b(R,j,N)}return A.gaps=w=a.gaps(e,n,r,i,w),a.spanGaps||(A.clip=sn(w,c.ori,h,p,v,m)),e.bands.length>0&&(A.band=an(e,n,r,i,D)),A}))};var t}},function(e,t,n){},,,function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,c=[],u=!1,f=-1;function d(){u&&l&&(u=!1,l.length?c=l.concat(c):f=-1,c.length&&h())}function h(){if(!u){var e=s(d);u=!0;for(var t=c.length;t;){for(l=c,c=[];++f<t;)l&&l[f].run();f=-1,t=c.length}l=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||u||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"===typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var r=t===e.head?new s(n,null,t,e):new s(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function o(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,n,r){if(!(this instanceof s))return new s(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=s,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n<e;n++)r=r.next;var o=[];for(n=0;r&&n<t;n++)o.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(n=0;n<(arguments.length<=2?0:arguments.length-2);n++)r=i(this,r,n+2<2||arguments.length<=n+2?void 0:arguments[n+2]);return o},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(205)(r)}catch(l){}},function(e,t,n){"use strict";var r=n(101);e.exports=function(e){e.prototype[Symbol.iterator]=r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))}},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(A){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new M(r||[]);return o._invoke=function(e,t,n){var r=f;return function(i,o){if(r===h)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var l=u(e,t,n);if("normal"===l.type){if(r=n.done?p:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=p,n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",v={};function m(){}function g(){}function y(){}var b={};l(b,o,(function(){return this}));var O=Object.getPrototypeOf,k=O&&O(O(P([])));k&&k!==n&&r.call(k,o)&&(b=k);var w=y.prototype=m.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"===typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function P(e){if(e){var n=e[o];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return g.prototype=y,l(w,"constructor",y),l(y,"constructor",g),g.displayName=l(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},x(j.prototype),l(j.prototype,a,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),l(w,s,"Generator"),l(w,o,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=r}catch(i){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";var r=n(1),i=n(29),o=n(7),a=n(0),s=(n(11),n(107)),l=n(38),c=n(50),u=n(24);function f(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var d={entering:{opacity:1,transform:f(1)},entered:{opacity:1,transform:"none"}},h=a.forwardRef((function(e,t){var n=e.children,h=e.disableStrictModeCompat,p=void 0!==h&&h,v=e.in,m=e.onEnter,g=e.onEntered,y=e.onEntering,b=e.onExit,O=e.onExited,k=e.onExiting,w=e.style,x=e.timeout,j=void 0===x?"auto":x,S=e.TransitionComponent,E=void 0===S?s.a:S,C=Object(o.a)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),M=a.useRef(),P=a.useRef(),T=Object(l.a)(),A=T.unstable_strictMode&&!p,D=a.useRef(null),R=Object(u.a)(n.ref,t),N=Object(u.a)(A?D:void 0,R),_=function(e){return function(t,n){if(e){var r=A?[D.current,t]:[t,n],o=Object(i.a)(r,2),a=o[0],s=o[1];void 0===s?e(a):e(a,s)}}},L=_(y),I=_((function(e,t){Object(c.b)(e);var n,r=Object(c.a)({style:w,timeout:j},{mode:"enter"}),i=r.duration,o=r.delay;"auto"===j?(n=T.transitions.getAutoHeightDuration(e.clientHeight),P.current=n):n=i,e.style.transition=[T.transitions.create("opacity",{duration:n,delay:o}),T.transitions.create("transform",{duration:.666*n,delay:o})].join(","),m&&m(e,t)})),$=_(g),z=_(k),B=_((function(e){var t,n=Object(c.a)({style:w,timeout:j},{mode:"exit"}),r=n.duration,i=n.delay;"auto"===j?(t=T.transitions.getAutoHeightDuration(e.clientHeight),P.current=t):t=r,e.style.transition=[T.transitions.create("opacity",{duration:t,delay:i}),T.transitions.create("transform",{duration:.666*t,delay:i||.333*t})].join(","),e.style.opacity="0",e.style.transform=f(.75),b&&b(e)})),F=_(O);return a.useEffect((function(){return function(){clearTimeout(M.current)}}),[]),a.createElement(E,Object(r.a)({appear:!0,in:v,nodeRef:A?D:void 0,onEnter:I,onEntered:$,onEntering:L,onExit:B,onExited:F,onExiting:z,addEndListener:function(e,t){var n=A?e:t;"auto"===j&&(M.current=setTimeout(n,P.current||0))},timeout:"auto"===j?null:j},C),(function(e,t){return a.cloneElement(n,Object(r.a)({style:Object(r.a)({opacity:0,transform:f(.75),visibility:"exited"!==e||v?void 0:"hidden"},d[e],w,n.props.style),ref:N},t))}))}));h.muiSupportAuto=!0,t.a=h},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(1),i=n(71);function o(e){return e&&"object"===Object(i.a)(e)&&e.constructor===Object}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},i=n.clone?Object(r.a)({},e):e;return o(e)&&o(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(o(t[r])&&r in e?i[r]=a(e[r],t[r],n):i[r]=t[r])})),i}},function(e,t,n){"use strict";n.d(t,"a",(function(){return yn}));var r=n(7),i=n(1),o=n(0),a=n.n(o),s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l="object"===("undefined"===typeof window?"undefined":s(window))&&"object"===("undefined"===typeof document?"undefined":s(document))&&9===document.nodeType;var c=n(42),u=n(49),f=n(72),d=n(56),h={}.constructor;function p(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(p);if(e.constructor!==h)return e;var t={};for(var n in e)t[n]=p(e[n]);return t}function v(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=p(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}var m=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n},g=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=m(e[r]," ");else n=m(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n};function y(e){return e&&!1===e.format?{linebreak:"",space:""}:{linebreak:"\n",space:" "}}function b(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function O(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var i=n.indent,o=void 0===i?0:i,a=t.fallbacks;!1===n.format&&(o=-1/0);var s=y(n),l=s.linebreak,c=s.space;if(e&&o++,a)if(Array.isArray(a))for(var u=0;u<a.length;u++){var f=a[u];for(var d in f){var h=f[d];null!=h&&(r&&(r+=l),r+=b(d+":"+c+g(h)+";",o))}}else for(var p in a){var v=a[p];null!=v&&(r&&(r+=l),r+=b(p+":"+c+g(v)+";",o))}for(var m in t){var O=t[m];null!=O&&"fallbacks"!==m&&(r&&(r+=l),r+=b(m+":"+c+g(O)+";",o))}return(r||n.allowEmpty)&&e?(r&&(r=""+l+r+l),b(""+e+c+"{"+r,--o)+b("}",o)):r}var k=/([[\].#*$><+~=|^:(),"'`\s])/g,w="undefined"!==typeof CSS&&CSS.escape,x=function(e){return w?w(e):e.replace(k,"\\$1")},j=function(){function e(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},e}(),S=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var o=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=l(Object(f.a)(Object(f.a)(i)),s),i.selectorText="."+x(i.id)),i}Object(u.a)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=g(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(i.a)({},e,{allowEmpty:!0}):e;return O(this.selectorText,this.style,n)},Object(c.a)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(j),E={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new S(e,t,n)}},C={indent:1,children:!0},M=/@([\w-]+)/,P=function(){function e(e,t,n){this.type="conditional",this.isProcessed=!1,this.key=e;var r=e.match(M);for(var o in this.at=r?r[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new J(Object(i.a)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){void 0===e&&(e=C);var t=y(e).linebreak;if(null==e.indent&&(e.indent=C.indent),null==e.children&&(e.children=C.children),!1===e.children)return this.query+" {}";var n=this.rules.toString(e);return n?this.query+" {"+t+n+t+"}":""},e}(),T=/@media|@supports\s+/,A={onCreateRule:function(e,t,n){return T.test(e)?new P(e,t,n):null}},D={indent:1,children:!0},R=/@keyframes\s+([\w-]+)/,N=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r=e.match(R);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var l in this.id=!1===o?this.name:x(s(this,a)),this.rules=new J(Object(i.a)({},n,{parent:this})),t)this.rules.add(l,t[l],Object(i.a)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=D);var t=y(e).linebreak;if(null==e.indent&&(e.indent=D.indent),null==e.children&&(e.children=D.children),!1===e.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(e);return n&&(n=""+t+n+t),this.at+" "+this.id+" {"+n+"}"},e}(),_=/@keyframes\s+/,L=/\$([\w-]+)/g,I=function(e,t){return"string"===typeof e?e.replace(L,(function(e,n){return n in t?t[n]:e})):e},$=function(e,t,n){var r=e[t],i=I(r,n);i!==r&&(e[t]=i)},z={onCreateRule:function(e,t,n){return"string"===typeof e&&_.test(e)?new N(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&$(e,"animation-name",n.keyframes),"animation"in e&&$(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return I(e,r.keyframes);default:return e}}},B=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?Object(i.a)({},e,{allowEmpty:!0}):e;return O(this.key,this.style,n)},t}(j),F={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new B(e,t,n):null}},W=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){var t=y(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r<this.style.length;r++)n+=O(this.at,this.style[r]),this.style[r+1]&&(n+=t);return n}return O(this.at,this.style,e)},e}(),V=/@font-face/,H={onCreateRule:function(e,t,n){return V.test(e)?new W(e,t,n):null}},Q=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return O(this.key,this.style,e)},e}(),q={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new Q(e,t,n):null}},U=function(){function e(e,t,n){this.type="simple",this.isProcessed=!1,this.key=e,this.value=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),X={"@charset":!0,"@import":!0,"@namespace":!0},Y=[E,A,z,F,H,q,{onCreateRule:function(e,t,n){return e in X?new U(e,t,n):null}}],G={process:!0},K={force:!0,process:!0},J=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,n){var r=this.options,o=r.parent,a=r.sheet,s=r.jss,l=r.Renderer,c=r.generateId,u=r.scoped,f=Object(i.a)({classes:this.classes,parent:o,sheet:a,jss:s,Renderer:l,generateId:c,scoped:u,name:e,keyframes:this.keyframes,selector:void 0},n),d=e;e in this.raw&&(d=e+"-d"+this.counter++),this.raw[d]=t,d in this.classes&&(f.selector="."+x(this.classes[d]));var h=v(d,t,f);if(!h)return null;this.register(h);var p=void 0===f.index?this.index.length:f.index;return this.index.splice(p,0,h),h},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof S?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof N&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof S?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof N&&delete this.keyframes[e.name]},t.update=function(){var e,t,n;if("string"===typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.map[e],t,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],t,n)},t.updateOne=function(t,n,r){void 0===r&&(r=G);var i=this.options,o=i.jss.plugins,a=i.sheet;if(t.rules instanceof e)t.rules.update(n,r);else{var s=t.style;if(o.onUpdate(n,t,a,r),r.process&&s&&s!==t.style){for(var l in o.onProcessStyle(t.style,t,a),t.style){var c=t.style[l];c!==s[l]&&t.prop(l,c,K)}for(var u in s){var f=t.style[u],d=s[u];null==f&&f!==d&&t.prop(u,null,K)}}}},t.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,i=y(e).linebreak,o=0;o<this.index.length;o++){var a=this.index[o].toString(e);(a||r)&&(t&&(t+=i),t+=a)}return t},e}(),Z=function(){function e(e,t){for(var n in this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=Object(i.a)({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new J(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var i=this.rules.add(e,t,n);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(r?r.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),i):i:(this.deployed=!1,i)):null},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var i=this.addRule(r,e[r],t);i&&n.push(i)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"===typeof e?e:this.rules.get(e);return!(!t||this.attached&&!t.renderable)&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,n){return this.rules.updateOne(e,t,n),this},t.toString=function(e){return this.rules.toString(e)},e}(),ee=function(){function e(){this.plugins={internal:[],external:[]},this.registry={}}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var i=this.registry.onCreateRule[r](e,t,n);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,i=0;i<this.registry.onChangeValue.length;i++)r=this.registry.onChangeValue[i](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),te=new(function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=Object(d.a)(t,["attached"]),i=y(r).linebreak,o="",a=0;a<this.registry.length;a++){var s=this.registry[a];null!=n&&s.attached!==n||(o&&(o+=i),o+=s.toString(r))}return o},Object(c.a)(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}()),ne="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window&&window.Math===Math?window:"undefined"!==typeof self&&self.Math===Math?self:Function("return this")(),re="2f1acc6c3a606b082e5eef5e54414ffb";null==ne[re]&&(ne[re]=0);var ie=ne[re]++,oe=function(e){void 0===e&&(e={});var t=0;return function(n,r){t+=1;var i="",o="";return r&&(r.options.classNamePrefix&&(o=r.options.classNamePrefix),null!=r.options.jss.id&&(i=String(r.options.jss.id))),e.minify?""+(o||"c")+ie+i+t:o+n.key+"-"+ie+(i?"-"+i:"")+"-"+t}},ae=function(e){var t;return function(){return t||(t=e()),t}},se=function(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(n){return""}},le=function(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=g(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;e.attributeStyleMap?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(i){return!1}return!0},ce=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(n){}},ue=function(e,t){return e.selectorText=t,e.selectorText===t},fe=ae((function(){return document.querySelector("head")}));function de(e){var t=te.registry;if(t.length>0){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var i=function(e){for(var t=fe(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}var he=ae((function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null})),pe=function(e,t,n){try{"insertRule"in e?e.insertRule(t,n):"appendRule"in e&&e.appendRule(t)}catch(r){return!1}return e.cssRules[n]},ve=function(e,t){var n=e.cssRules.length;return void 0===t||t>n?n:t},me=function(){function e(e){this.getPropertyValue=se,this.setProperty=le,this.removeProperty=ce,this.setSelector=ue,this.hasInsertedRules=!1,this.cssRules=[],e&&te.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,i=t.element;this.element=i||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=he();o&&this.element.setAttribute("nonce",o)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=de(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else fe().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n<e.index.length;n++)this.insertRule(e.index[n],n,t)},t.insertRule=function(e,t,n){if(void 0===n&&(n=this.element.sheet),e.rules){var r=e,i=n;if("conditional"===e.type||"keyframes"===e.type){var o=ve(n,t);if(!1===(i=pe(n,r.toString({children:!1}),o)))return!1;this.refCssRule(e,o,i)}return this.insertRules(r.rules,i),i}var a=e.toString();if(!a)return!1;var s=ve(n,t),l=pe(n,a,s);return!1!==l&&(this.hasInsertedRules=!0,this.refCssRule(e,s,l),l)},t.refCssRule=function(e,t,n){e.renderable=n,e.options.parent instanceof Z&&(this.cssRules[t]=n)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),this.cssRules.splice(n,1),!0)},t.indexOf=function(e){return this.cssRules.indexOf(e)},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.cssRules.splice(n,1),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),ge=0,ye=function(){function e(e){this.id=ge++,this.version="10.8.2",this.plugins=new ee,this.options={id:{minify:!1},createGenerateId:oe,Renderer:l?me:null,plugins:[]},this.generateId=oe({minify:!1});for(var t=0;t<Y.length;t++)this.plugins.use(Y[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=Object(i.a)({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!==typeof n&&(n=0===te.index?0:te.index+1);var r=new Z(e,Object(i.a)({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},t.removeStyleSheet=function(e){return e.detach(),te.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"===typeof e)return this.createRule(void 0,e,t);var r=Object(i.a)({},n,{name:e,jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var o=v(e,t,r);return o&&this.plugins.onProcessRule(o),o},t.use=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){e.plugins.use(t)})),this},e}(),be=function(e){return new ye(e)},Oe="object"===typeof CSS&&null!=CSS&&"number"in CSS;function ke(e){var t=null;for(var n in e){var r=e[n],i=typeof r;if("function"===i)t||(t={}),t[n]=r;else if("object"===i&&null!==r&&!Array.isArray(r)){var o=ke(r);o&&(t||(t={}),t[n]=o)}}return t}be();var we=n(239),xe={set:function(e,t,n,r){var i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)},get:function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},delete:function(e,t,n){e.get(t).delete(n)}},je=xe,Se=n(155),Ee=(n(11),n(97)),Ce=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];var Me=Date.now(),Pe="fnValues"+Me,Te="fnStyle"+ ++Me,Ae=function(){return{onCreateRule:function(e,t,n){if("function"!==typeof t)return null;var r=v(e,{},n);return r[Te]=t,r},onProcessStyle:function(e,t){if(Pe in t||Te in t)return e;var n={};for(var r in e){var i=e[r];"function"===typeof i&&(delete e[r],n[r]=i)}return t[Pe]=n,e},onUpdate:function(e,t,n,r){var i=t,o=i[Te];o&&(i.style=o(e)||{});var a=i[Pe];if(a)for(var s in a)i.prop(s,a[s](e),r)}}},De="@global",Re="@global ",Ne=function(){function e(e,t,n){for(var r in this.type="global",this.at=De,this.isProcessed=!1,this.key=e,this.options=n,this.rules=new J(Object(i.a)({},n,{parent:this})),t)this.rules.add(r,t[r]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(){return this.rules.toString()},e}(),_e=function(){function e(e,t,n){this.type="global",this.at=De,this.isProcessed=!1,this.key=e,this.options=n;var r=e.substr(Re.length);this.rule=n.jss.createRule(r,t,Object(i.a)({},n,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),Le=/\s*,\s*/g;function Ie(e,t){for(var n=e.split(Le),r="",i=0;i<n.length;i++)r+=t+" "+n[i].trim(),n[i+1]&&(r+=", ");return r}var $e=function(){return{onCreateRule:function(e,t,n){if(!e)return null;if(e===De)return new Ne(e,t,n);if("@"===e[0]&&e.substr(0,Re.length)===Re)return new _e(e,t,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),!1===n.scoped&&(n.selector=e),null},onProcessRule:function(e,t){"style"===e.type&&t&&(function(e,t){var n=e.options,r=e.style,o=r?r[De]:null;if(o){for(var a in o)t.addRule(a,o[a],Object(i.a)({},n,{selector:Ie(a,e.selector)}));delete r[De]}}(e,t),function(e,t){var n=e.options,r=e.style;for(var o in r)if("@"===o[0]&&o.substr(0,De.length)===De){var a=Ie(o.substr(De.length),e.selector);t.addRule(a,r[o],Object(i.a)({},n,{selector:a})),delete r[o]}}(e,t))}}},ze=/\s*,\s*/g,Be=/&/g,Fe=/\$([\w-]+)/g;var We=function(){function e(e,t){return function(n,r){var i=e.getRule(r)||t&&t.getRule(r);return i?i.selector:r}}function t(e,t){for(var n=t.split(ze),r=e.split(ze),i="",o=0;o<n.length;o++)for(var a=n[o],s=0;s<r.length;s++){var l=r[s];i&&(i+=", "),i+=-1!==l.indexOf("&")?l.replace(Be,a):a+" "+l}return i}function n(e,t,n){if(n)return Object(i.a)({},n,{index:n.index+1});var r=e.options.nestingLevel;r=void 0===r?1:r+1;var o=Object(i.a)({},e.options,{nestingLevel:r,index:t.indexOf(e)+1});return delete o.name,o}return{onProcessStyle:function(r,o,a){if("style"!==o.type)return r;var s,l,c=o,u=c.options.parent;for(var f in r){var d=-1!==f.indexOf("&"),h="@"===f[0];if(d||h){if(s=n(c,u,s),d){var p=t(f,c.selector);l||(l=e(u,a)),p=p.replace(Fe,l),u.addRule(p,r[f],Object(i.a)({},s,{selector:p}))}else h&&u.addRule(f,{},s).addRule(c.key,r[f],{selector:c.selector});delete r[f]}}return r}}},Ve=/[A-Z]/g,He=/^ms-/,Qe={};function qe(e){return"-"+e.toLowerCase()}var Ue=function(e){if(Qe.hasOwnProperty(e))return Qe[e];var t=e.replace(Ve,qe);return Qe[e]=He.test(t)?"-"+t:t};function Xe(e){var t={};for(var n in e){t[0===n.indexOf("--")?n:Ue(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(Xe):t.fallbacks=Xe(e.fallbacks)),t}var Ye=function(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=Xe(e[t]);return e}return Xe(e)},onChangeValue:function(e,t,n){if(0===t.indexOf("--"))return e;var r=Ue(t);return t===r?e:(n.prop(r,e),null)}}},Ge=Oe&&CSS?CSS.px:"px",Ke=Oe&&CSS?CSS.ms:"ms",Je=Oe&&CSS?CSS.percent:"%";function Ze(e){var t=/(-[a-z])/g,n=function(e){return e[1].toUpperCase()},r={};for(var i in e)r[i]=e[i],r[i.replace(t,n)]=e[i];return r}var et=Ze({"animation-delay":Ke,"animation-duration":Ke,"background-position":Ge,"background-position-x":Ge,"background-position-y":Ge,"background-size":Ge,border:Ge,"border-bottom":Ge,"border-bottom-left-radius":Ge,"border-bottom-right-radius":Ge,"border-bottom-width":Ge,"border-left":Ge,"border-left-width":Ge,"border-radius":Ge,"border-right":Ge,"border-right-width":Ge,"border-top":Ge,"border-top-left-radius":Ge,"border-top-right-radius":Ge,"border-top-width":Ge,"border-width":Ge,"border-block":Ge,"border-block-end":Ge,"border-block-end-width":Ge,"border-block-start":Ge,"border-block-start-width":Ge,"border-block-width":Ge,"border-inline":Ge,"border-inline-end":Ge,"border-inline-end-width":Ge,"border-inline-start":Ge,"border-inline-start-width":Ge,"border-inline-width":Ge,"border-start-start-radius":Ge,"border-start-end-radius":Ge,"border-end-start-radius":Ge,"border-end-end-radius":Ge,margin:Ge,"margin-bottom":Ge,"margin-left":Ge,"margin-right":Ge,"margin-top":Ge,"margin-block":Ge,"margin-block-end":Ge,"margin-block-start":Ge,"margin-inline":Ge,"margin-inline-end":Ge,"margin-inline-start":Ge,padding:Ge,"padding-bottom":Ge,"padding-left":Ge,"padding-right":Ge,"padding-top":Ge,"padding-block":Ge,"padding-block-end":Ge,"padding-block-start":Ge,"padding-inline":Ge,"padding-inline-end":Ge,"padding-inline-start":Ge,"mask-position-x":Ge,"mask-position-y":Ge,"mask-size":Ge,height:Ge,width:Ge,"min-height":Ge,"max-height":Ge,"min-width":Ge,"max-width":Ge,bottom:Ge,left:Ge,top:Ge,right:Ge,inset:Ge,"inset-block":Ge,"inset-block-end":Ge,"inset-block-start":Ge,"inset-inline":Ge,"inset-inline-end":Ge,"inset-inline-start":Ge,"box-shadow":Ge,"text-shadow":Ge,"column-gap":Ge,"column-rule":Ge,"column-rule-width":Ge,"column-width":Ge,"font-size":Ge,"font-size-delta":Ge,"letter-spacing":Ge,"text-decoration-thickness":Ge,"text-indent":Ge,"text-stroke":Ge,"text-stroke-width":Ge,"word-spacing":Ge,motion:Ge,"motion-offset":Ge,outline:Ge,"outline-offset":Ge,"outline-width":Ge,perspective:Ge,"perspective-origin-x":Je,"perspective-origin-y":Je,"transform-origin":Je,"transform-origin-x":Je,"transform-origin-y":Je,"transform-origin-z":Je,"transition-delay":Ke,"transition-duration":Ke,"vertical-align":Ge,"flex-basis":Ge,"shape-margin":Ge,size:Ge,gap:Ge,grid:Ge,"grid-gap":Ge,"row-gap":Ge,"grid-row-gap":Ge,"grid-column-gap":Ge,"grid-template-rows":Ge,"grid-template-columns":Ge,"grid-auto-rows":Ge,"grid-auto-columns":Ge,"box-shadow-x":Ge,"box-shadow-y":Ge,"box-shadow-blur":Ge,"box-shadow-spread":Ge,"font-line-height":Ge,"text-shadow-x":Ge,"text-shadow-y":Ge,"text-shadow-blur":Ge});function tt(e,t,n){if(null==t)return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=tt(e,t[r],n);else if("object"===typeof t)if("fallbacks"===e)for(var i in t)t[i]=tt(i,t[i],n);else for(var o in t)t[o]=tt(e+"-"+o,t[o],n);else if("number"===typeof t&&!1===isNaN(t)){var a=n[e]||et[e];return!a||0===t&&a===Ge?t.toString():"function"===typeof a?a(t).toString():""+t+a}return t}var nt=function(e){void 0===e&&(e={});var t=Ze(e);return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r in e)e[r]=tt(r,e[r],t);return e},onChangeValue:function(e,n){return tt(n,e,t)}}},rt=n(57),it="",ot="",at="",st="",lt=l&&"ontouchstart"in document.documentElement;if(l){var ct={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},ut=document.createElement("p").style;for(var ft in ct)if(ft+"Transform"in ut){it=ft,ot=ct[ft];break}"Webkit"===it&&"msHyphens"in ut&&(it="ms",ot=ct.ms,st="edge"),"Webkit"===it&&"-apple-trailing-word"in ut&&(at="apple")}var dt=it,ht=ot,pt=at,vt=st,mt=lt;var gt={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===dt?"-webkit-"+e:ht+e)}},yt={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===dt?ht+"print-"+e:e)}},bt=/[-\s]+(.)?/g;function Ot(e,t){return t?t.toUpperCase():""}function kt(e){return e.replace(bt,Ot)}function wt(e){return kt("-"+e)}var xt,jt={noPrefill:["mask"],supportedProperty:function(e,t){if(!/^mask/.test(e))return!1;if("Webkit"===dt){var n="mask-image";if(kt(n)in t)return e;if(dt+wt(n)in t)return ht+e}return e}},St={noPrefill:["text-orientation"],supportedProperty:function(e){return"text-orientation"===e&&("apple"!==pt||mt?e:ht+e)}},Et={noPrefill:["transform"],supportedProperty:function(e,t,n){return"transform"===e&&(n.transform?e:ht+e)}},Ct={noPrefill:["transition"],supportedProperty:function(e,t,n){return"transition"===e&&(n.transition?e:ht+e)}},Mt={noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===dt||"ms"===dt&&"edge"!==vt?ht+e:e)}},Pt={noPrefill:["user-select"],supportedProperty:function(e){return"user-select"===e&&("Moz"===dt||"ms"===dt||"apple"===pt?ht+e:e)}},Tt={supportedProperty:function(e,t){return!!/^break-/.test(e)&&("Webkit"===dt?"WebkitColumn"+wt(e)in t&&ht+"column-"+e:"Moz"===dt&&("page"+wt(e)in t&&"page-"+e))}},At={supportedProperty:function(e,t){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===dt)return e;var n=e.replace("-inline","");return dt+wt(n)in t&&ht+n}},Dt={supportedProperty:function(e,t){return kt(e)in t&&e}},Rt={supportedProperty:function(e,t){var n=wt(e);return"-"===e[0]||"-"===e[0]&&"-"===e[1]?e:dt+n in t?ht+e:"Webkit"!==dt&&"Webkit"+n in t&&"-webkit-"+e}},Nt={supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===dt?""+ht+e:e)}},_t={supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===dt?ht+"scroll-chaining":e)}},Lt={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},It={supportedProperty:function(e,t){var n=Lt[e];return!!n&&(dt+wt(n)in t&&ht+n)}},$t={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},zt=Object.keys($t),Bt=function(e){return ht+e},Ft=[gt,yt,jt,St,Et,Ct,Mt,Pt,Tt,At,Dt,Rt,Nt,_t,It,{supportedProperty:function(e,t,n){var r=n.multiple;if(zt.indexOf(e)>-1){var i=$t[e];if(!Array.isArray(i))return dt+wt(i)in t&&ht+i;if(!r)return!1;for(var o=0;o<i.length;o++)if(!(dt+wt(i[0])in t))return!1;return i.map(Bt)}return!1}}],Wt=Ft.filter((function(e){return e.supportedProperty})).map((function(e){return e.supportedProperty})),Vt=Ft.filter((function(e){return e.noPrefill})).reduce((function(e,t){return e.push.apply(e,Object(rt.a)(t.noPrefill)),e}),[]),Ht={};if(l){xt=document.createElement("p");var Qt=window.getComputedStyle(document.documentElement,"");for(var qt in Qt)isNaN(qt)||(Ht[Qt[qt]]=Qt[qt]);Vt.forEach((function(e){return delete Ht[e]}))}function Ut(e,t){if(void 0===t&&(t={}),!xt)return e;if(null!=Ht[e])return Ht[e];"transition"!==e&&"transform"!==e||(t[e]=e in xt.style);for(var n=0;n<Wt.length&&(Ht[e]=Wt[n](e,xt.style,t),!Ht[e]);n++);try{xt.style[e]=""}catch(r){return!1}return Ht[e]}var Xt,Yt={},Gt={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},Kt=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function Jt(e,t,n){if("var"===t)return"var";if("all"===t)return"all";if("all"===n)return", all";var r=t?Ut(t):", "+Ut(n);return r||(t||n)}function Zt(e,t){var n=t;if(!Xt||"content"===e)return t;if("string"!==typeof n||!isNaN(parseInt(n,10)))return n;var r=e+n;if(null!=Yt[r])return Yt[r];try{Xt.style[e]=n}catch(i){return Yt[r]=!1,!1}if(Gt[e])n=n.replace(Kt,Jt);else if(""===Xt.style[e]&&("-ms-flex"===(n=ht+n)&&(Xt.style[e]="-ms-flexbox"),Xt.style[e]=n,""===Xt.style[e]))return Yt[r]=!1,!1;return Xt.style[e]="",Yt[r]=n,Yt[r]}l&&(Xt=document.createElement("p"));var en=function(){function e(t){for(var n in t){var r=t[n];if("fallbacks"===n&&Array.isArray(r))t[n]=r.map(e);else{var i=!1,o=Ut(n);o&&o!==n&&(i=!0);var a=!1,s=Zt(o,g(r));s&&s!==r&&(a=!0),(i||a)&&(i&&delete t[n],t[o||n]=s||r)}}return t}return{onProcessRule:function(e){if("keyframes"===e.type){var t=e;t.at="-"===(n=t.at)[1]||"ms"===dt?n:"@"+ht+"keyframes"+n.substr(10)}var n},onProcessStyle:function(t,n){return"style"!==n.type?t:e(t)},onChangeValue:function(e,t){return Zt(t,g(e))||e}}};var tn=function(){var e=function(e,t){return e.length===t.length?e>t?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o<i.length;o++)r[i[o]]=t[i[o]];return r}}};function nn(){return{plugins:[Ae(),$e(),We(),Ye(),nt(),"undefined"===typeof window?null:en(),tn()]}}var rn=be(nn()),on=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,r=e.productionPrefix,i=void 0===r?"jss":r,o=e.seed,a=void 0===o?"":o,s=""===a?"":"".concat(a,"-"),l=0,c=function(){return l+=1};return function(e,t){var r=t.options.name;if(r&&0===r.indexOf("Mui")&&!t.options.link&&!n){if(-1!==Ce.indexOf(e.key))return"Mui-".concat(e.key);var o="".concat(s).concat(r,"-").concat(e.key);return t.options.theme[Ee.a]&&""===a?"".concat(o,"-").concat(c()):o}return"".concat(s).concat(i).concat(c())}}(),an={disableGeneration:!1,generateClassName:on,jss:rn,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},sn=a.a.createContext(an);var ln=-1e9;function cn(){return ln+=1}n(71);var un=n(209);function fn(e){var t="function"===typeof e;return{create:function(n,r){var o;try{o=t?e(n):e}catch(l){throw l}if(!r||!n.overrides||!n.overrides[r])return o;var a=n.overrides[r],s=Object(i.a)({},o);return Object.keys(a).forEach((function(e){s[e]=Object(un.a)(s[e],a[e])})),s},options:{}}}var dn={};function hn(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var i=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,i=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,i=!0),i&&(r.cacheClasses.value=Object(we.a)({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}function pn(e,t){var n=e.state,r=e.theme,o=e.stylesOptions,a=e.stylesCreator,s=e.name;if(!o.disableGeneration){var l=je.get(o.sheetsManager,a,r);l||(l={refs:0,staticSheet:null,dynamicStyles:null},je.set(o.sheetsManager,a,r,l));var c=Object(i.a)({},a.options,o,{theme:r,flip:"boolean"===typeof o.flip?o.flip:"rtl"===r.direction});c.generateId=c.serverGenerateClassName||c.generateClassName;var u=o.sheetsRegistry;if(0===l.refs){var f;o.sheetsCache&&(f=je.get(o.sheetsCache,a,r));var d=a.create(r,s);f||((f=o.jss.createStyleSheet(d,Object(i.a)({link:!1},c))).attach(),o.sheetsCache&&je.set(o.sheetsCache,a,r,f)),u&&u.add(f),l.staticSheet=f,l.dynamicStyles=ke(d)}if(l.dynamicStyles){var h=o.jss.createStyleSheet(l.dynamicStyles,Object(i.a)({link:!0},c));h.update(t),h.attach(),n.dynamicSheet=h,n.classes=Object(we.a)({baseClasses:l.staticSheet.classes,newClasses:h.classes}),u&&u.add(h)}else n.classes=l.staticSheet.classes;l.refs+=1}}function vn(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}function mn(e){var t=e.state,n=e.theme,r=e.stylesOptions,i=e.stylesCreator;if(!r.disableGeneration){var o=je.get(r.sheetsManager,i,n);o.refs-=1;var a=r.sheetsRegistry;0===o.refs&&(je.delete(r.sheetsManager,i,n),r.jss.removeStyleSheet(o.staticSheet),a&&a.remove(o.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),a&&a.remove(t.dynamicSheet))}}function gn(e,t){var n,r=a.a.useRef([]),i=a.a.useMemo((function(){return{}}),t);r.current!==i&&(r.current=i,n=e()),a.a.useEffect((function(){return function(){n&&n()}}),[i])}function yn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,o=t.classNamePrefix,s=t.Component,l=t.defaultTheme,c=void 0===l?dn:l,u=Object(r.a)(t,["name","classNamePrefix","Component","defaultTheme"]),f=fn(e),d=n||o||"makeStyles";f.options={index:cn(),name:n,meta:d,classNamePrefix:d};var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(Se.a)()||c,r=Object(i.a)({},a.a.useContext(sn),u),o=a.a.useRef(),l=a.a.useRef();gn((function(){var i={name:n,state:{},stylesCreator:f,stylesOptions:r,theme:t};return pn(i,e),l.current=!1,o.current=i,function(){mn(i)}}),[t,f]),a.a.useEffect((function(){l.current&&vn(o.current,e),l.current=!0}));var d=hn(o.current,e.classes,s);return d};return h}},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=n(27),s=(n(11),n(155)),l=n(240),c=n(30),u=n(245),f=n(41),d=n(24),h=n(31),p=n(95),v=n(63),m=n(42),g=n(57),y=n(104),b=n(67);function O(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function k(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function w(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,o=[t,n].concat(Object(g.a)(r)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===o.indexOf(e)&&-1===a.indexOf(e.tagName)&&O(e,i)}))}function x(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function j(e,t){var n,r=[],i=[],o=e.container;if(!t.disableScrollLock){if(function(e){var t=Object(c.a)(e);return t.body===e?Object(b.a)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(o)){var a=Object(y.a)();r.push({value:o.style.paddingRight,key:"padding-right",el:o}),o.style["padding-right"]="".concat(k(o)+a,"px"),n=Object(c.a)(o).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(e){i.push(e.style.paddingRight),e.style.paddingRight="".concat(k(e)+a,"px")}))}var s=o.parentElement,l="HTML"===s.nodeName&&"scroll"===window.getComputedStyle(s)["overflow-y"]?s:o;r.push({value:l.style.overflow,key:"overflow",el:l}),l.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(e,t){i[t]?e.style.paddingRight=i[t]:e.style.removeProperty("padding-right")})),r.forEach((function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}var S=function(){function e(){Object(v.a)(this,e),this.modals=[],this.containers=[]}return Object(m.a)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&O(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);w(t,e.mountNode,e.modalRef,r,!0);var i=x(this.containers,(function(e){return e.container===t}));return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=x(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=j(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=x(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&O(e.modalRef,!0),w(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var i=r.modals[r.modals.length-1];i.modalRef&&O(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}();var E=function(e){var t=e.children,n=e.disableAutoFocus,r=void 0!==n&&n,i=e.disableEnforceFocus,s=void 0!==i&&i,l=e.disableRestoreFocus,u=void 0!==l&&l,f=e.getDoc,h=e.isEnabled,p=e.open,v=o.useRef(),m=o.useRef(null),g=o.useRef(null),y=o.useRef(),b=o.useRef(null),O=o.useCallback((function(e){b.current=a.findDOMNode(e)}),[]),k=Object(d.a)(t.ref,O),w=o.useRef();return o.useEffect((function(){w.current=p}),[p]),!w.current&&p&&"undefined"!==typeof window&&(y.current=f().activeElement),o.useEffect((function(){if(p){var e=Object(c.a)(b.current);r||!b.current||b.current.contains(e.activeElement)||(b.current.hasAttribute("tabIndex")||b.current.setAttribute("tabIndex",-1),b.current.focus());var t=function(){null!==b.current&&(e.hasFocus()&&!s&&h()&&!v.current?b.current&&!b.current.contains(e.activeElement)&&b.current.focus():v.current=!1)},n=function(t){!s&&h()&&9===t.keyCode&&e.activeElement===b.current&&(v.current=!0,t.shiftKey?g.current.focus():m.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",n,!0);var i=setInterval((function(){t()}),50);return function(){clearInterval(i),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",n,!0),u||(y.current&&y.current.focus&&y.current.focus(),y.current=null)}}}),[r,s,u,h,p]),o.createElement(o.Fragment,null,o.createElement("div",{tabIndex:0,ref:m,"data-test":"sentinelStart"}),o.cloneElement(t,{ref:k}),o.createElement("div",{tabIndex:0,ref:g,"data-test":"sentinelEnd"}))},C={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},M=o.forwardRef((function(e,t){var n=e.invisible,a=void 0!==n&&n,s=e.open,l=Object(r.a)(e,["invisible","open"]);return s?o.createElement("div",Object(i.a)({"aria-hidden":!0,ref:t},l,{style:Object(i.a)({},C.root,a?C.invisible:{},l.style)})):null}));var P=new S,T=o.forwardRef((function(e,t){var n=Object(s.a)(),v=Object(l.a)({name:"MuiModal",props:Object(i.a)({},e),theme:n}),m=v.BackdropComponent,g=void 0===m?M:m,y=v.BackdropProps,b=v.children,k=v.closeAfterTransition,w=void 0!==k&&k,x=v.container,j=v.disableAutoFocus,S=void 0!==j&&j,C=v.disableBackdropClick,T=void 0!==C&&C,A=v.disableEnforceFocus,D=void 0!==A&&A,R=v.disableEscapeKeyDown,N=void 0!==R&&R,_=v.disablePortal,L=void 0!==_&&_,I=v.disableRestoreFocus,$=void 0!==I&&I,z=v.disableScrollLock,B=void 0!==z&&z,F=v.hideBackdrop,W=void 0!==F&&F,V=v.keepMounted,H=void 0!==V&&V,Q=v.manager,q=void 0===Q?P:Q,U=v.onBackdropClick,X=v.onClose,Y=v.onEscapeKeyDown,G=v.onRendered,K=v.open,J=Object(r.a)(v,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),Z=o.useState(!0),ee=Z[0],te=Z[1],ne=o.useRef({}),re=o.useRef(null),ie=o.useRef(null),oe=Object(d.a)(ie,t),ae=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(v),se=function(){return Object(c.a)(re.current)},le=function(){return ne.current.modalRef=ie.current,ne.current.mountNode=re.current,ne.current},ce=function(){q.mount(le(),{disableScrollLock:B}),ie.current.scrollTop=0},ue=Object(h.a)((function(){var e=function(e){return e="function"===typeof e?e():e,a.findDOMNode(e)}(x)||se().body;q.add(le(),e),ie.current&&ce()})),fe=o.useCallback((function(){return q.isTopModal(le())}),[q]),de=Object(h.a)((function(e){re.current=e,e&&(G&&G(),K&&fe()?ce():O(ie.current,!0))})),he=o.useCallback((function(){q.remove(le())}),[q]);if(o.useEffect((function(){return function(){he()}}),[he]),o.useEffect((function(){K?ue():ae&&w||he()}),[K,he,ae,w,ue]),!H&&!K&&(!ae||ee))return null;var pe=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(n||{zIndex:p.a}),ve={};return void 0===b.props.tabIndex&&(ve.tabIndex=b.props.tabIndex||"-1"),ae&&(ve.onEnter=Object(f.a)((function(){te(!1)}),b.props.onEnter),ve.onExited=Object(f.a)((function(){te(!0),w&&he()}),b.props.onExited)),o.createElement(u.a,{ref:de,container:x,disablePortal:L},o.createElement("div",Object(i.a)({ref:oe,onKeyDown:function(e){"Escape"===e.key&&fe()&&(Y&&Y(e),N||(e.stopPropagation(),X&&X(e,"escapeKeyDown")))},role:"presentation"},J,{style:Object(i.a)({},pe.root,!K&&ee?pe.hidden:{},J.style)}),W?null:o.createElement(g,Object(i.a)({open:K,onClick:function(e){e.target===e.currentTarget&&(U&&U(e),!T&&X&&X(e,"backdropClick"))}},y)),o.createElement(E,{disableEnforceFocus:D,disableAutoFocus:S,disableRestoreFocus:$,getDoc:se,isEnabled:fe,open:K},o.cloneElement(b,ve))))}));t.a=T},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(156),a=n(0),s=(n(11),n(8)),l=n(46),c=n(58),u=n(10),f=n(16),d=n(24),h=n(48);function p(e,t){return parseInt(e[t],10)||0}var v="undefined"!==typeof window?a.useLayoutEffect:a.useEffect,m={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},g=a.forwardRef((function(e,t){var n=e.onChange,o=e.rows,s=e.rowsMax,l=e.rowsMin,c=e.maxRows,u=e.minRows,f=void 0===u?1:u,g=e.style,y=e.value,b=Object(r.a)(e,["onChange","rows","rowsMax","rowsMin","maxRows","minRows","style","value"]),O=c||s,k=o||l||f,w=a.useRef(null!=y).current,x=a.useRef(null),j=Object(d.a)(t,x),S=a.useRef(null),E=a.useRef(0),C=a.useState({}),M=C[0],P=C[1],T=a.useCallback((function(){var t=x.current,n=window.getComputedStyle(t),r=S.current;r.style.width=n.width,r.value=t.value||e.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");var i=n["box-sizing"],o=p(n,"padding-bottom")+p(n,"padding-top"),a=p(n,"border-bottom-width")+p(n,"border-top-width"),s=r.scrollHeight-o;r.value="x";var l=r.scrollHeight-o,c=s;k&&(c=Math.max(Number(k)*l,c)),O&&(c=Math.min(Number(O)*l,c));var u=(c=Math.max(c,l))+("border-box"===i?o+a:0),f=Math.abs(c-s)<=1;P((function(e){return E.current<20&&(u>0&&Math.abs((e.outerHeightStyle||0)-u)>1||e.overflow!==f)?(E.current+=1,{overflow:f,outerHeightStyle:u}):e}))}),[O,k,e.placeholder]);a.useEffect((function(){var e=Object(h.a)((function(){E.current=0,T()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[T]),v((function(){T()})),a.useEffect((function(){E.current=0}),[y]);return a.createElement(a.Fragment,null,a.createElement("textarea",Object(i.a)({value:y,onChange:function(e){E.current=0,w||T(),n&&n(e)},ref:j,rows:k,style:Object(i.a)({height:M.outerHeightStyle,overflow:M.overflow?"hidden":null},g)},b)),a.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:Object(i.a)({},m,g)}))})),y=n(73),b="undefined"===typeof window?a.useEffect:a.useLayoutEffect,O=a.forwardRef((function(e,t){var n=e["aria-describedby"],u=e.autoComplete,h=e.autoFocus,p=e.classes,v=e.className,m=(e.color,e.defaultValue),O=e.disabled,k=e.endAdornment,w=(e.error,e.fullWidth),x=void 0!==w&&w,j=e.id,S=e.inputComponent,E=void 0===S?"input":S,C=e.inputProps,M=void 0===C?{}:C,P=e.inputRef,T=(e.margin,e.multiline),A=void 0!==T&&T,D=e.name,R=e.onBlur,N=e.onChange,_=e.onClick,L=e.onFocus,I=e.onKeyDown,$=e.onKeyUp,z=e.placeholder,B=e.readOnly,F=e.renderSuffix,W=e.rows,V=e.rowsMax,H=e.rowsMin,Q=e.maxRows,q=e.minRows,U=e.startAdornment,X=e.type,Y=void 0===X?"text":X,G=e.value,K=Object(r.a)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","maxRows","minRows","startAdornment","type","value"]),J=null!=M.value?M.value:G,Z=a.useRef(null!=J).current,ee=a.useRef(),te=a.useCallback((function(e){0}),[]),ne=Object(d.a)(M.ref,te),re=Object(d.a)(P,ne),ie=Object(d.a)(ee,re),oe=a.useState(!1),ae=oe[0],se=oe[1],le=Object(c.b)();var ce=Object(l.a)({props:e,muiFormControl:le,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});ce.focused=le?le.focused:ae,a.useEffect((function(){!le&&O&&ae&&(se(!1),R&&R())}),[le,O,ae,R]);var ue=le&&le.onFilled,fe=le&&le.onEmpty,de=a.useCallback((function(e){Object(y.b)(e)?ue&&ue():fe&&fe()}),[ue,fe]);b((function(){Z&&de({value:J})}),[J,de,Z]);a.useEffect((function(){de(ee.current)}),[]);var he=E,pe=Object(i.a)({},M,{ref:ie});"string"!==typeof he?pe=Object(i.a)({inputRef:ie,type:Y},pe,{ref:null}):A?!W||Q||q||V||H?(pe=Object(i.a)({minRows:W||q,rowsMax:V,maxRows:Q},pe),he=g):he="textarea":pe=Object(i.a)({type:Y},pe);return a.useEffect((function(){le&&le.setAdornedStart(Boolean(U))}),[le,U]),a.createElement("div",Object(i.a)({className:Object(s.a)(p.root,p["color".concat(Object(f.a)(ce.color||"primary"))],v,ce.disabled&&p.disabled,ce.error&&p.error,x&&p.fullWidth,ce.focused&&p.focused,le&&p.formControl,A&&p.multiline,U&&p.adornedStart,k&&p.adornedEnd,"dense"===ce.margin&&p.marginDense),onClick:function(e){ee.current&&e.currentTarget===e.target&&ee.current.focus(),_&&_(e)},ref:t},K),U,a.createElement(c.a.Provider,{value:null},a.createElement(he,Object(i.a)({"aria-invalid":ce.error,"aria-describedby":n,autoComplete:u,autoFocus:h,defaultValue:m,disabled:ce.disabled,id:j,onAnimationStart:function(e){de("mui-auto-fill-cancel"===e.animationName?ee.current:{value:"x"})},name:D,placeholder:z,readOnly:B,required:ce.required,rows:W,value:J,onKeyDown:I,onKeyUp:$},pe,{className:Object(s.a)(p.input,M.className,ce.disabled&&p.disabled,A&&p.inputMultiline,ce.hiddenLabel&&p.inputHiddenLabel,U&&p.inputAdornedStart,k&&p.inputAdornedEnd,"search"===Y&&p.inputTypeSearch,"dense"===ce.margin&&p.inputMarginDense),onBlur:function(e){R&&R(e),M.onBlur&&M.onBlur(e),le&&le.onBlur?le.onBlur(e):se(!1)},onChange:function(e){if(!Z){var t=e.target||ee.current;if(null==t)throw new Error(Object(o.a)(1));de({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];M.onChange&&M.onChange.apply(M,[e].concat(r)),N&&N.apply(void 0,[e].concat(r))},onFocus:function(e){ce.disabled?e.stopPropagation():(L&&L(e),M.onFocus&&M.onFocus(e),le&&le.onFocus?le.onFocus(e):se(!0))}}))),k,F?F(Object(i.a)({},ce,{startAdornment:U})):null)}));t.a=Object(u.a)((function(e){var t="light"===e.palette.type,n={color:"currentColor",opacity:t?.42:.5,transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o={opacity:t?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{},"@keyframes mui-auto-fill-cancel":{}},root:Object(i.a)({},e.typography.body1,{color:e.palette.text.primary,lineHeight:"1.1876em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:e.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(6,"px 0 ").concat(7,"px"),"&$marginDense":{paddingTop:3}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"".concat(6,"px 0 ").concat(7,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1876em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:3},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}}),{name:"MuiInputBase"})(O)},,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;e.Component;if(!n)return t;var i=Object(r.a)({},t);return Object.keys(n).forEach((function(e){n[e]&&(i[e]="".concat(t[e]," ").concat(n[e]))})),i}},function(e,t,n){"use strict";function r(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var i,o=t.props[n];for(i in o)void 0===r[i]&&(r[i]=o[i]);return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(16),c=44,u=o.forwardRef((function(e,t){var n=e.classes,s=e.className,u=e.color,f=void 0===u?"primary":u,d=e.disableShrink,h=void 0!==d&&d,p=e.size,v=void 0===p?40:p,m=e.style,g=e.thickness,y=void 0===g?3.6:g,b=e.value,O=void 0===b?0:b,k=e.variant,w=void 0===k?"indeterminate":k,x=Object(i.a)(e,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),j={},S={},E={};if("determinate"===w||"static"===w){var C=2*Math.PI*((c-y)/2);j.strokeDasharray=C.toFixed(3),E["aria-valuenow"]=Math.round(O),j.strokeDashoffset="".concat(((100-O)/100*C).toFixed(3),"px"),S.transform="rotate(-90deg)"}return o.createElement("div",Object(r.a)({className:Object(a.a)(n.root,s,"inherit"!==f&&n["color".concat(Object(l.a)(f))],{determinate:n.determinate,indeterminate:n.indeterminate,static:n.static}[w]),style:Object(r.a)({width:v,height:v},S,m),ref:t,role:"progressbar"},E,x),o.createElement("svg",{className:n.svg,viewBox:"".concat(22," ").concat(22," ").concat(c," ").concat(c)},o.createElement("circle",{className:Object(a.a)(n.circle,h&&n.circleDisableShrink,{determinate:n.circleDeterminate,indeterminate:n.circleIndeterminate,static:n.circleStatic}[w]),style:j,cx:c,cy:c,r:(c-y)/2,fill:"none",strokeWidth:y})))}));t.a=Object(s.a)((function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:e.transitions.create("transform")},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:e.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}}),{name:"MuiCircularProgress",flip:!1})(u)},function(e,t,n){"use strict";var r=n(1),i=n(210),o=n(68);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(e,Object(r.a)({defaultTheme:o.a},t))}},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(43),l=n(10),c=n(86),u=n(16),f=o.forwardRef((function(e,t){e.checked;var n=e.classes,l=e.className,f=e.control,d=e.disabled,h=(e.inputRef,e.label),p=e.labelPlacement,v=void 0===p?"end":p,m=(e.name,e.onChange,e.value,Object(i.a)(e,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),g=Object(s.a)(),y=d;"undefined"===typeof y&&"undefined"!==typeof f.props.disabled&&(y=f.props.disabled),"undefined"===typeof y&&g&&(y=g.disabled);var b={disabled:y};return["checked","name","onChange","value","inputRef"].forEach((function(t){"undefined"===typeof f.props[t]&&"undefined"!==typeof e[t]&&(b[t]=e[t])})),o.createElement("label",Object(r.a)({className:Object(a.a)(n.root,l,"end"!==v&&n["labelPlacement".concat(Object(u.a)(v))],y&&n.disabled),ref:t},m),o.cloneElement(f,b),o.createElement(c.a,{component:"span",className:Object(a.a)(n.label,y&&n.disabled)},h))}));t.a=Object(l.a)((function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}}),{name:"MuiFormControlLabel"})(f)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(22),c=n(16),u=n(98),f=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.color,f=void 0===l?"secondary":l,d=e.edge,h=void 0!==d&&d,p=e.size,v=void 0===p?"medium":p,m=Object(i.a)(e,["classes","className","color","edge","size"]),g=o.createElement("span",{className:n.thumb});return o.createElement("span",{className:Object(a.a)(n.root,s,{start:n.edgeStart,end:n.edgeEnd}[h],"small"===v&&n["size".concat(Object(c.a)(v))])},o.createElement(u.a,Object(r.a)({type:"checkbox",icon:g,checkedIcon:g,classes:{root:Object(a.a)(n.switchBase,n["color".concat(Object(c.a)(f))]),input:n.input,checked:n.checked,disabled:n.disabled},ref:t},m)),o.createElement("span",{className:n.track}))}));t.a=Object(s.a)((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(l.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(l.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(f)},function(e,t,n){"use strict";var r=n(0),i=n(27),o=(n(11),n(39)),a=n(24);var s="undefined"!==typeof window?r.useLayoutEffect:r.useEffect,l=r.forwardRef((function(e,t){var n=e.children,l=e.container,c=e.disablePortal,u=void 0!==c&&c,f=e.onRendered,d=r.useState(null),h=d[0],p=d[1],v=Object(a.a)(r.isValidElement(n)?n.ref:null,t);return s((function(){u||p(function(e){return e="function"===typeof e?e():e,i.findDOMNode(e)}(l)||document.body)}),[l,u]),s((function(){if(h&&!u)return Object(o.a)(t,h),function(){Object(o.a)(t,null)}}),[t,h,u]),s((function(){f&&(h||u)&&f()}),[f,h,u]),u?r.isValidElement(n)?r.cloneElement(n,{ref:v}):n:h?i.createPortal(n,h):h}));t.a=l},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(22),l=n(10),c=n(87),u=n(16),f=o.forwardRef((function(e,t){var n=e.children,s=e.classes,l=e.className,f=e.disabled,d=void 0!==f&&f,h=e.disableFocusRipple,p=void 0!==h&&h,v=e.onChange,m=e.onClick,g=e.selected,y=e.size,b=void 0===y?"medium":y,O=e.value,k=Object(r.a)(e,["children","classes","className","disabled","disableFocusRipple","onChange","onClick","selected","size","value"]);return o.createElement(c.a,Object(i.a)({className:Object(a.a)(s.root,l,d&&s.disabled,g&&s.selected,"medium"!==b&&s["size".concat(Object(u.a)(b))]),disabled:d,focusRipple:!p,ref:t,onClick:function(e){m&&(m(e,O),e.isDefaultPrevented())||v&&v(e,O)},onChange:v,value:O,"aria-pressed":g},k),o.createElement("span",{className:s.label},n))}));t.a=Object(l.a)((function(e){return{root:Object(i.a)({},e.typography.button,{boxSizing:"border-box",borderRadius:e.shape.borderRadius,padding:11,border:"1px solid ".concat(Object(s.a)(e.palette.action.active,.12)),color:Object(s.a)(e.palette.action.active,.38),"&$selected":{color:e.palette.action.active,backgroundColor:Object(s.a)(e.palette.action.active,.12),"&:hover":{backgroundColor:Object(s.a)(e.palette.action.active,.15)},"& + &":{borderLeft:0,marginLeft:0}},"&$disabled":{color:Object(s.a)(e.palette.action.disabled,.12)},"&:hover":{textDecoration:"none",backgroundColor:Object(s.a)(e.palette.text.primary,.05),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}}}),disabled:{},selected:{},label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},sizeSmall:{padding:7,fontSize:e.typography.pxToRem(13)},sizeLarge:{padding:15,fontSize:e.typography.pxToRem(15)}}}),{name:"MuiToggleButton"})(f)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.component,c=void 0===l?"div":l,u=Object(i.a)(e,["classes","className","component"]);return o.createElement(c,Object(r.a)({ref:t,className:Object(a.a)(n.root,s)},u))}));t.a=Object(s.a)({root:{width:"100%",overflowX:"auto"}},{name:"MuiTableContainer"})(l)},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(10),l=n(99),c="table",u=o.forwardRef((function(e,t){var n=e.classes,s=e.className,u=e.component,f=void 0===u?c:u,d=e.padding,h=void 0===d?"normal":d,p=e.size,v=void 0===p?"medium":p,m=e.stickyHeader,g=void 0!==m&&m,y=Object(r.a)(e,["classes","className","component","padding","size","stickyHeader"]),b=o.useMemo((function(){return{padding:h,size:v,stickyHeader:g}}),[h,v,g]);return o.createElement(l.a.Provider,{value:b},o.createElement(f,Object(i.a)({role:f===c?null:"table",ref:t,className:Object(a.a)(n.root,s,g&&n.stickyHeader)},y)))}));t.a=Object(s.a)((function(e){return{root:{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":Object(i.a)({},e.typography.body2,{padding:e.spacing(2),color:e.palette.text.secondary,textAlign:"left",captionSide:"bottom"})},stickyHeader:{borderCollapse:"separate"}}}),{name:"MuiTable"})(u)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(69),c={variant:"head"},u="thead",f=o.forwardRef((function(e,t){var n=e.classes,s=e.className,f=e.component,d=void 0===f?u:f,h=Object(i.a)(e,["classes","className","component"]);return o.createElement(l.a.Provider,{value:c},o.createElement(d,Object(r.a)({className:Object(a.a)(n.root,s),ref:t,role:d===u?null:"rowgroup"},h)))}));t.a=Object(s.a)({root:{display:"table-header-group"}},{name:"MuiTableHead"})(f)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(69),c=n(22),u=o.forwardRef((function(e,t){var n=e.classes,s=e.className,c=e.component,u=void 0===c?"tr":c,f=e.hover,d=void 0!==f&&f,h=e.selected,p=void 0!==h&&h,v=Object(i.a)(e,["classes","className","component","hover","selected"]),m=o.useContext(l.a);return o.createElement(u,Object(r.a)({ref:t,className:Object(a.a)(n.root,s,m&&{head:n.head,footer:n.footer}[m.variant],d&&n.hover,p&&n.selected),role:"tr"===u?null:"row"},v))}));t.a=Object(s.a)((function(e){return{root:{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,"&$hover:hover":{backgroundColor:e.palette.action.hover},"&$selected, &$selected:hover":{backgroundColor:Object(c.a)(e.palette.secondary.main,e.palette.action.selectedOpacity)}},selected:{},hover:{},head:{},footer:{}}}),{name:"MuiTableRow"})(u)},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(10),l=n(16),c=n(22),u=n(99),f=n(69),d=o.forwardRef((function(e,t){var n,s,c=e.align,d=void 0===c?"inherit":c,h=e.classes,p=e.className,v=e.component,m=e.padding,g=e.scope,y=e.size,b=e.sortDirection,O=e.variant,k=Object(r.a)(e,["align","classes","className","component","padding","scope","size","sortDirection","variant"]),w=o.useContext(u.a),x=o.useContext(f.a),j=x&&"head"===x.variant;v?(s=v,n=j?"columnheader":"cell"):s=j?"th":"td";var S=g;!S&&j&&(S="col");var E=m||(w&&w.padding?w.padding:"normal"),C=y||(w&&w.size?w.size:"medium"),M=O||x&&x.variant,P=null;return b&&(P="asc"===b?"ascending":"descending"),o.createElement(s,Object(i.a)({ref:t,className:Object(a.a)(h.root,h[M],p,"inherit"!==d&&h["align".concat(Object(l.a)(d))],"normal"!==E&&h["padding".concat(Object(l.a)(E))],"medium"!==C&&h["size".concat(Object(l.a)(C))],"head"===M&&w&&w.stickyHeader&&h.stickyHeader),"aria-sort":P,role:n,scope:S},k))}));t.a=Object(s.a)((function(e){return{root:Object(i.a)({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n ".concat("light"===e.palette.type?Object(c.f)(Object(c.a)(e.palette.divider,1),.88):Object(c.b)(Object(c.a)(e.palette.divider,1),.68)),textAlign:"left",padding:16}),head:{color:e.palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},body:{color:e.palette.text.primary},footer:{color:e.palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},sizeSmall:{padding:"6px 24px 6px 16px","&:last-child":{paddingRight:16},"&$paddingCheckbox":{width:24,padding:"0 12px 0 16px","&:last-child":{paddingLeft:12,paddingRight:16},"& > *":{padding:0}}},paddingCheckbox:{width:48,padding:"0 0 0 4px","&:last-child":{paddingLeft:0,paddingRight:4}},paddingNone:{padding:0,"&:last-child":{padding:0}},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right",flexDirection:"row-reverse"},alignJustify:{textAlign:"justify"},stickyHeader:{position:"sticky",top:0,left:0,zIndex:2,backgroundColor:e.palette.background.default}}}),{name:"MuiTableCell"})(d)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(69),c={variant:"body"},u="tbody",f=o.forwardRef((function(e,t){var n=e.classes,s=e.className,f=e.component,d=void 0===f?u:f,h=Object(i.a)(e,["classes","className","component"]);return o.createElement(l.a.Provider,{value:c},o.createElement(d,Object(r.a)({className:Object(a.a)(n.root,s),ref:t,role:d===u?null:"rowgroup"},h)))}));t.a=Object(s.a)({root:{display:"table-row-group"}},{name:"MuiTableBody"})(f)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(16),l=n(10),c=n(66),u=n(24),f=n(86),d=o.forwardRef((function(e,t){var n=e.classes,l=e.className,d=e.color,h=void 0===d?"primary":d,p=e.component,v=void 0===p?"a":p,m=e.onBlur,g=e.onFocus,y=e.TypographyClasses,b=e.underline,O=void 0===b?"hover":b,k=e.variant,w=void 0===k?"inherit":k,x=Object(i.a)(e,["classes","className","color","component","onBlur","onFocus","TypographyClasses","underline","variant"]),j=Object(c.a)(),S=j.isFocusVisible,E=j.onBlurVisible,C=j.ref,M=o.useState(!1),P=M[0],T=M[1],A=Object(u.a)(t,C);return o.createElement(f.a,Object(r.a)({className:Object(a.a)(n.root,n["underline".concat(Object(s.a)(O))],l,P&&n.focusVisible,"button"===v&&n.button),classes:y,color:h,component:v,onBlur:function(e){P&&(E(),T(!1)),m&&m(e)},onFocus:function(e){S(e)&&T(!0),g&&g(e)},ref:A,variant:w},x))}));t.a=Object(l.a)({root:{},underlineNone:{textDecoration:"none"},underlineHover:{textDecoration:"none","&:hover":{textDecoration:"underline"}},underlineAlways:{textDecoration:"underline"},button:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none","&::-moz-focus-inner":{borderStyle:"none"},"&$focusVisible":{outline:"auto"}},focusVisible:{}},{name:"MuiLink"})(d)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(212),l=n(10),c=o.forwardRef((function(e,t){var n=e.disableUnderline,l=e.classes,c=e.fullWidth,u=void 0!==c&&c,f=e.inputComponent,d=void 0===f?"input":f,h=e.multiline,p=void 0!==h&&h,v=e.type,m=void 0===v?"text":v,g=Object(i.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return o.createElement(s.a,Object(r.a)({classes:Object(r.a)({},l,{root:Object(a.a)(l.root,!n&&l.underline),underline:null}),fullWidth:u,inputComponent:d,multiline:p,ref:t,type:m},g))}));c.muiName="Input",t.a=Object(l.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(t),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):before":{borderBottom:"2px solid ".concat(e.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(t)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}}),{name:"MuiInput"})(c)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(73),l=n(10),c=n(16),u=n(79),f=n(58),d=o.forwardRef((function(e,t){var n=e.children,l=e.classes,d=e.className,h=e.color,p=void 0===h?"primary":h,v=e.component,m=void 0===v?"div":v,g=e.disabled,y=void 0!==g&&g,b=e.error,O=void 0!==b&&b,k=e.fullWidth,w=void 0!==k&&k,x=e.focused,j=e.hiddenLabel,S=void 0!==j&&j,E=e.margin,C=void 0===E?"none":E,M=e.required,P=void 0!==M&&M,T=e.size,A=e.variant,D=void 0===A?"standard":A,R=Object(i.a)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),N=o.useState((function(){var e=!1;return n&&o.Children.forEach(n,(function(t){if(Object(u.a)(t,["Input","Select"])){var n=Object(u.a)(t,["Select"])?t.props.input:t;n&&Object(s.a)(n.props)&&(e=!0)}})),e})),_=N[0],L=N[1],I=o.useState((function(){var e=!1;return n&&o.Children.forEach(n,(function(t){Object(u.a)(t,["Input","Select"])&&Object(s.b)(t.props,!0)&&(e=!0)})),e})),$=I[0],z=I[1],B=o.useState(!1),F=B[0],W=B[1],V=void 0!==x?x:F;y&&V&&W(!1);var H=o.useCallback((function(){z(!0)}),[]),Q={adornedStart:_,setAdornedStart:L,color:p,disabled:y,error:O,filled:$,focused:V,fullWidth:w,hiddenLabel:S,margin:("small"===T?"dense":void 0)||C,onBlur:function(){W(!1)},onEmpty:o.useCallback((function(){z(!1)}),[]),onFilled:H,onFocus:function(){W(!0)},registerEffect:undefined,required:P,variant:D};return o.createElement(f.a.Provider,{value:Q},o.createElement(m,Object(r.a)({className:Object(a.a)(l.root,d,"none"!==C&&l["margin".concat(Object(c.a)(C))],w&&l.fullWidth),ref:t},R),n))}));t.a=Object(l.a)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(d)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(27)),s=n(48),l=n(8),c=n(30),u=n(67),f=n(41),d=n(10),h=n(211),p=n(208),v=n(157);function m(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function g(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function y(e){return[e.horizontal,e.vertical].map((function(e){return"number"===typeof e?"".concat(e,"px"):e})).join(" ")}function b(e){return"function"===typeof e?e():e}var O=o.forwardRef((function(e,t){var n=e.action,d=e.anchorEl,O=e.anchorOrigin,k=void 0===O?{vertical:"top",horizontal:"left"}:O,w=e.anchorPosition,x=e.anchorReference,j=void 0===x?"anchorEl":x,S=e.children,E=e.classes,C=e.className,M=e.container,P=e.elevation,T=void 0===P?8:P,A=e.getContentAnchorEl,D=e.marginThreshold,R=void 0===D?16:D,N=e.onEnter,_=e.onEntered,L=e.onEntering,I=e.onExit,$=e.onExited,z=e.onExiting,B=e.open,F=e.PaperProps,W=void 0===F?{}:F,V=e.transformOrigin,H=void 0===V?{vertical:"top",horizontal:"left"}:V,Q=e.TransitionComponent,q=void 0===Q?p.a:Q,U=e.transitionDuration,X=void 0===U?"auto":U,Y=e.TransitionProps,G=void 0===Y?{}:Y,K=Object(i.a)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),J=o.useRef(),Z=o.useCallback((function(e){if("anchorPosition"===j)return w;var t=b(d),n=(t&&1===t.nodeType?t:Object(c.a)(J.current).body).getBoundingClientRect(),r=0===e?k.vertical:"center";return{top:n.top+m(n,r),left:n.left+g(n,k.horizontal)}}),[d,k.horizontal,k.vertical,w,j]),ee=o.useCallback((function(e){var t=0;if(A&&"anchorEl"===j){var n=A(e);if(n&&e.contains(n)){var r=function(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentElement).scrollTop;return r}(e,n);t=n.offsetTop+n.clientHeight/2-r||0}0}return t}),[k.vertical,j,A]),te=o.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:m(e,H.vertical)+t,horizontal:g(e,H.horizontal)}}),[H.horizontal,H.vertical]),ne=o.useCallback((function(e){var t=ee(e),n={width:e.offsetWidth,height:e.offsetHeight},r=te(n,t);if("none"===j)return{top:null,left:null,transformOrigin:y(r)};var i=Z(t),o=i.top-r.vertical,a=i.left-r.horizontal,s=o+n.height,l=a+n.width,c=Object(u.a)(b(d)),f=c.innerHeight-R,h=c.innerWidth-R;if(o<R){var p=o-R;o-=p,r.vertical+=p}else if(s>f){var v=s-f;o-=v,r.vertical+=v}if(a<R){var m=a-R;a-=m,r.horizontal+=m}else if(l>h){var g=l-h;a-=g,r.horizontal+=g}return{top:"".concat(Math.round(o),"px"),left:"".concat(Math.round(a),"px"),transformOrigin:y(r)}}),[d,j,Z,ee,te,R]),re=o.useCallback((function(){var e=J.current;if(e){var t=ne(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[ne]),ie=o.useCallback((function(e){J.current=a.findDOMNode(e)}),[]);o.useEffect((function(){B&&re()})),o.useImperativeHandle(n,(function(){return B?{updatePosition:function(){re()}}:null}),[B,re]),o.useEffect((function(){if(B){var e=Object(s.a)((function(){re()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[B,re]);var oe=X;"auto"!==X||q.muiSupportAuto||(oe=void 0);var ae=M||(d?Object(c.a)(b(d)).body:void 0);return o.createElement(h.a,Object(r.a)({container:ae,open:B,ref:t,BackdropProps:{invisible:!0},className:Object(l.a)(E.root,C)},K),o.createElement(q,Object(r.a)({appear:!0,in:B,onEnter:N,onEntered:_,onExit:I,onExited:$,onExiting:z,timeout:oe},G,{onEntering:Object(f.a)((function(e,t){L&&L(e,t),re()}),G.onEntering)}),o.createElement(v.a,Object(r.a)({elevation:T,ref:ie},W,{className:Object(l.a)(E.paper,W.className)}),S)))}));t.a=Object(d.a)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(O)},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(46),l=n(43),c=n(10),u=o.forwardRef((function(e,t){var n=e.children,c=e.classes,u=e.className,f=e.component,d=void 0===f?"p":f,h=(e.disabled,e.error,e.filled,e.focused,e.margin,e.required,e.variant,Object(r.a)(e,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),p=Object(l.a)(),v=Object(s.a)({props:e,muiFormControl:p,states:["variant","margin","disabled","error","filled","focused","required"]});return o.createElement(d,Object(i.a)({className:Object(a.a)(c.root,("filled"===v.variant||"outlined"===v.variant)&&c.contained,u,v.disabled&&c.disabled,v.error&&c.error,v.filled&&c.filled,v.focused&&c.focused,v.required&&c.required,"dense"===v.margin&&c.marginDense),ref:t},h)," "===n?o.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}}):n)}));t.a=Object(c.a)((function(e){return{root:Object(i.a)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}}),{name:"MuiFormHelperText"})(u)},function(e,t,n){"use strict";var r=n(7),i=n(19),o=n(1),a=n(0),s=(n(11),n(8)),l=n(10),c=n(87),u=n(16),f=a.forwardRef((function(e,t){var n=e.classes,i=e.className,l=e.disabled,f=void 0!==l&&l,d=e.disableFocusRipple,h=void 0!==d&&d,p=e.fullWidth,v=e.icon,m=e.indicator,g=e.label,y=e.onChange,b=e.onClick,O=e.onFocus,k=e.selected,w=e.selectionFollowsFocus,x=e.textColor,j=void 0===x?"inherit":x,S=e.value,E=e.wrapped,C=void 0!==E&&E,M=Object(r.a)(e,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"]);return a.createElement(c.a,Object(o.a)({focusRipple:!h,className:Object(s.a)(n.root,n["textColor".concat(Object(u.a)(j))],i,f&&n.disabled,k&&n.selected,g&&v&&n.labelIcon,p&&n.fullWidth,C&&n.wrapped),ref:t,role:"tab","aria-selected":k,disabled:f,onClick:function(e){y&&y(e,S),b&&b(e)},onFocus:function(e){w&&!k&&y&&y(e,S),O&&O(e)},tabIndex:k?0:-1},M),a.createElement("span",{className:n.wrapper},v,g),m)}));t.a=Object(l.a)((function(e){var t;return{root:Object(o.a)({},e.typography.button,(t={maxWidth:264,minWidth:72,position:"relative",boxSizing:"border-box",minHeight:48,flexShrink:0,padding:"6px 12px"},Object(i.a)(t,e.breakpoints.up("sm"),{padding:"6px 24px"}),Object(i.a)(t,"overflow","hidden"),Object(i.a)(t,"whiteSpace","normal"),Object(i.a)(t,"textAlign","center"),Object(i.a)(t,e.breakpoints.up("sm"),{minWidth:160}),t)),labelIcon:{minHeight:72,paddingTop:9,"& $wrapper > *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}}),{name:"MuiTab"})(f)},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(10),l=n(22),c=n(87),u=n(16),f=o.forwardRef((function(e,t){var n=e.children,s=e.classes,l=e.className,f=e.color,d=void 0===f?"default":f,h=e.component,p=void 0===h?"button":h,v=e.disabled,m=void 0!==v&&v,g=e.disableElevation,y=void 0!==g&&g,b=e.disableFocusRipple,O=void 0!==b&&b,k=e.endIcon,w=e.focusVisibleClassName,x=e.fullWidth,j=void 0!==x&&x,S=e.size,E=void 0===S?"medium":S,C=e.startIcon,M=e.type,P=void 0===M?"button":M,T=e.variant,A=void 0===T?"text":T,D=Object(r.a)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),R=C&&o.createElement("span",{className:Object(a.a)(s.startIcon,s["iconSize".concat(Object(u.a)(E))])},C),N=k&&o.createElement("span",{className:Object(a.a)(s.endIcon,s["iconSize".concat(Object(u.a)(E))])},k);return o.createElement(c.a,Object(i.a)({className:Object(a.a)(s.root,s[A],l,"inherit"===d?s.colorInherit:"default"!==d&&s["".concat(A).concat(Object(u.a)(d))],"medium"!==E&&[s["".concat(A,"Size").concat(Object(u.a)(E))],s["size".concat(Object(u.a)(E))]],y&&s.disableElevation,m&&s.disabled,j&&s.fullWidth),component:p,disabled:m,focusRipple:!O,focusVisibleClassName:Object(a.a)(s.focusVisible,w),ref:t,type:P},D),o.createElement("span",{className:s.label},R,n,N))}));t.a=Object(s.a)((function(e){return{root:Object(i.a)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:Object(l.a)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(l.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(l.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(Object(l.a)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:Object(l.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(Object(l.a)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:Object(l.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(f)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(19),a=n(0),s=(n(11),n(8)),l=n(10),c=a.forwardRef((function(e,t){var n=e.classes,o=e.className,l=e.component,c=void 0===l?"div":l,u=e.disableGutters,f=void 0!==u&&u,d=e.variant,h=void 0===d?"regular":d,p=Object(i.a)(e,["classes","className","component","disableGutters","variant"]);return a.createElement(c,Object(r.a)({className:Object(s.a)(n.root,n[h],o,!f&&n.gutters),ref:t},p))}));t.a=Object(l.a)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:Object(o.a)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}}),{name:"MuiToolbar"})(c)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(86),l=n(10),c=n(58),u=o.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,f=e.component,d=void 0===f?"div":f,h=e.disablePointerEvents,p=void 0!==h&&h,v=e.disableTypography,m=void 0!==v&&v,g=e.position,y=e.variant,b=Object(i.a)(e,["children","classes","className","component","disablePointerEvents","disableTypography","position","variant"]),O=Object(c.b)()||{},k=y;return y&&O.variant,O&&!k&&(k=O.variant),o.createElement(c.a.Provider,{value:null},o.createElement(d,Object(r.a)({className:Object(a.a)(l.root,u,"end"===g?l.positionEnd:l.positionStart,p&&l.disablePointerEvents,O.hiddenLabel&&l.hiddenLabel,"filled"===k&&l.filled,"dense"===O.margin&&l.marginDense),ref:t},b),"string"!==typeof n||m?n:o.createElement(s.a,{color:"textSecondary"},n)))}));t.a=Object(l.a)({root:{display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap"},filled:{"&$positionStart:not($hiddenLabel)":{marginTop:16}},positionStart:{marginRight:8},positionEnd:{marginLeft:8},disablePointerEvents:{pointerEvents:"none"},hiddenLabel:{},marginDense:{}},{name:"MuiInputAdornment"})(u)},function(e,t,n){"use strict";var r=n(1),i=n(29),o=n(7),a=n(0),s=(n(11),n(107)),l=n(44),c=n(38),u=n(50),f=n(24),d={entering:{opacity:1},entered:{opacity:1}},h={enter:l.b.enteringScreen,exit:l.b.leavingScreen},p=a.forwardRef((function(e,t){var n=e.children,l=e.disableStrictModeCompat,p=void 0!==l&&l,v=e.in,m=e.onEnter,g=e.onEntered,y=e.onEntering,b=e.onExit,O=e.onExited,k=e.onExiting,w=e.style,x=e.TransitionComponent,j=void 0===x?s.a:x,S=e.timeout,E=void 0===S?h:S,C=Object(o.a)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","TransitionComponent","timeout"]),M=Object(c.a)(),P=M.unstable_strictMode&&!p,T=a.useRef(null),A=Object(f.a)(n.ref,t),D=Object(f.a)(P?T:void 0,A),R=function(e){return function(t,n){if(e){var r=P?[T.current,t]:[t,n],o=Object(i.a)(r,2),a=o[0],s=o[1];void 0===s?e(a):e(a,s)}}},N=R(y),_=R((function(e,t){Object(u.b)(e);var n=Object(u.a)({style:w,timeout:E},{mode:"enter"});e.style.webkitTransition=M.transitions.create("opacity",n),e.style.transition=M.transitions.create("opacity",n),m&&m(e,t)})),L=R(g),I=R(k),$=R((function(e){var t=Object(u.a)({style:w,timeout:E},{mode:"exit"});e.style.webkitTransition=M.transitions.create("opacity",t),e.style.transition=M.transitions.create("opacity",t),b&&b(e)})),z=R(O);return a.createElement(j,Object(r.a)({appear:!0,in:v,nodeRef:P?T:void 0,onEnter:_,onEntered:L,onEntering:N,onExit:$,onExited:z,onExiting:I,timeout:E},C),(function(e,t){return a.cloneElement(n,Object(r.a)({style:Object(r.a)({opacity:0,visibility:"exited"!==e||v?void 0:"hidden"},d[e],w,n.props.style),ref:D},t))}))}));t.a=p},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.dividers,c=void 0!==l&&l,u=Object(i.a)(e,["classes","className","dividers"]);return o.createElement("div",Object(r.a)({className:Object(a.a)(n.root,s,c&&n.dividers),ref:t},u))}));t.a=Object(s.a)((function(e){return{root:{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"8px 24px","&:first-child":{paddingTop:20}},dividers:{padding:"16px 24px",borderTop:"1px solid ".concat(e.palette.divider),borderBottom:"1px solid ".concat(e.palette.divider)}}}),{name:"MuiDialogContent"})(l)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=o.forwardRef((function(e,t){var n=e.disableSpacing,s=void 0!==n&&n,l=e.classes,c=e.className,u=Object(i.a)(e,["disableSpacing","classes","className"]);return o.createElement("div",Object(r.a)({className:Object(a.a)(l.root,c,!s&&l.spacing),ref:t},u))}));t.a=Object(s.a)({root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},spacing:{"& > :not(:first-child)":{marginLeft:8}}},{name:"MuiDialogActions"})(l)},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(10),l=[0,1,2,3,4,5,6,7,8,9,10],c=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(e);return"".concat(n/t).concat(String(e).replace(String(n),"")||"px")}var f=o.forwardRef((function(e,t){var n=e.alignContent,s=void 0===n?"stretch":n,l=e.alignItems,c=void 0===l?"stretch":l,u=e.classes,f=e.className,d=e.component,h=void 0===d?"div":d,p=e.container,v=void 0!==p&&p,m=e.direction,g=void 0===m?"row":m,y=e.item,b=void 0!==y&&y,O=e.justify,k=e.justifyContent,w=void 0===k?"flex-start":k,x=e.lg,j=void 0!==x&&x,S=e.md,E=void 0!==S&&S,C=e.sm,M=void 0!==C&&C,P=e.spacing,T=void 0===P?0:P,A=e.wrap,D=void 0===A?"wrap":A,R=e.xl,N=void 0!==R&&R,_=e.xs,L=void 0!==_&&_,I=e.zeroMinWidth,$=void 0!==I&&I,z=Object(r.a)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","justifyContent","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),B=Object(a.a)(u.root,f,v&&[u.container,0!==T&&u["spacing-xs-".concat(String(T))]],b&&u.item,$&&u.zeroMinWidth,"row"!==g&&u["direction-xs-".concat(String(g))],"wrap"!==D&&u["wrap-xs-".concat(String(D))],"stretch"!==c&&u["align-items-xs-".concat(String(c))],"stretch"!==s&&u["align-content-xs-".concat(String(s))],"flex-start"!==(O||w)&&u["justify-content-xs-".concat(String(O||w))],!1!==L&&u["grid-xs-".concat(String(L))],!1!==M&&u["grid-sm-".concat(String(M))],!1!==E&&u["grid-md-".concat(String(E))],!1!==j&&u["grid-lg-".concat(String(j))],!1!==N&&u["grid-xl-".concat(String(N))]);return o.createElement(h,Object(i.a)({className:B,ref:t},z))})),d=Object(s.a)((function(e){return Object(i.a)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-content-xs-center":{justifyContent:"center"},"justify-content-xs-flex-end":{justifyContent:"flex-end"},"justify-content-xs-space-between":{justifyContent:"space-between"},"justify-content-xs-space-around":{justifyContent:"space-around"},"justify-content-xs-space-evenly":{justifyContent:"space-evenly"}},function(e,t){var n={};return l.forEach((function(r){var i=e.spacing(r);0!==i&&(n["spacing-".concat(t,"-").concat(r)]={margin:"-".concat(u(i,2)),width:"calc(100% + ".concat(u(i),")"),"& > $item":{padding:u(i,2)}})})),n}(e,"xs"),e.breakpoints.keys.reduce((function(t,n){return function(e,t,n){var r={};c.forEach((function(e){var t="grid-".concat(n,"-").concat(e);if(!0!==e)if("auto"!==e){var i="".concat(Math.round(e/12*1e8)/1e6,"%");r[t]={flexBasis:i,flexGrow:0,maxWidth:i}}else r[t]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else r[t]={flexBasis:0,flexGrow:1,maxWidth:"100%"}})),"xs"===n?Object(i.a)(e,r):e[t.breakpoints.up(n)]=r}(t,e,n),t}),{}))}),{name:"MuiGrid"})(f);t.a=d},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(86),c=o.forwardRef((function(e,t){var n=e.children,s=e.classes,c=e.className,u=e.disableTypography,f=void 0!==u&&u,d=Object(i.a)(e,["children","classes","className","disableTypography"]);return o.createElement("div",Object(r.a)({className:Object(a.a)(s.root,c),ref:t},d),f?n:o.createElement(l.a,{component:"h2",variant:"h6"},n))}));t.a=Object(s.a)({root:{margin:0,padding:"16px 24px",flex:"0 0 auto"}},{name:"MuiDialogTitle"})(c)},function(e,t,n){"use strict";var r=n(1),i=n(0),o=(n(11),n(10)),a=n(86),s=i.forwardRef((function(e,t){return i.createElement(a.a,Object(r.a)({component:"p",variant:"body1",color:"textSecondary",ref:t},e))}));t.a=Object(o.a)({root:{marginBottom:12}},{name:"MuiDialogContentText"})(s)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(87),l=n(159),c=n(10),u=n(105),f=o.forwardRef((function(e,t){var n=e.children,c=e.classes,f=e.className,d=e.expandIcon,h=e.focusVisibleClassName,p=e.IconButtonProps,v=void 0===p?{}:p,m=e.onClick,g=Object(i.a)(e,["children","classes","className","expandIcon","focusVisibleClassName","IconButtonProps","onClick"]),y=o.useContext(u.a),b=y.disabled,O=void 0!==b&&b,k=y.expanded,w=y.toggle;return o.createElement(s.a,Object(r.a)({focusRipple:!1,disableRipple:!0,disabled:O,component:"div","aria-expanded":k,className:Object(a.a)(c.root,f,O&&c.disabled,k&&c.expanded),focusVisibleClassName:Object(a.a)(c.focusVisible,c.focused,h),onClick:function(e){w&&w(e),m&&m(e)},ref:t},g),o.createElement("div",{className:Object(a.a)(c.content,k&&c.expanded)},n),d&&o.createElement(l.a,Object(r.a)({className:Object(a.a)(c.expandIcon,k&&c.expanded),edge:"end",component:"div",tabIndex:null,role:null,"aria-hidden":!0},v),d))}));t.a=Object(c.a)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{display:"flex",minHeight:48,transition:e.transitions.create(["min-height","background-color"],t),padding:e.spacing(0,2),"&:hover:not($disabled)":{cursor:"pointer"},"&$expanded":{minHeight:64},"&$focused, &$focusVisible":{backgroundColor:e.palette.action.focus},"&$disabled":{opacity:e.palette.action.disabledOpacity}},expanded:{},focused:{},focusVisible:{},disabled:{},content:{display:"flex",flexGrow:1,transition:e.transitions.create(["margin"],t),margin:"12px 0","&$expanded":{margin:"20px 0"}},expandIcon:{transform:"rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"rotate(180deg)"}}}}),{name:"MuiAccordionSummary"})(f)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=Object(i.a)(e,["classes","className"]);return o.createElement("div",Object(r.a)({className:Object(a.a)(n.root,s),ref:t},l))}));t.a=Object(s.a)((function(e){return{root:{display:"flex",padding:e.spacing(1,2,2)}}}),{name:"MuiAccordionDetails"})(l)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(10),l=n(16),c=n(157),u=o.forwardRef((function(e,t){var n=e.classes,s=e.className,u=e.color,f=void 0===u?"primary":u,d=e.position,h=void 0===d?"fixed":d,p=Object(i.a)(e,["classes","className","color","position"]);return o.createElement(c.a,Object(r.a)({square:!0,component:"header",elevation:4,className:Object(a.a)(n.root,n["position".concat(Object(l.a)(h))],n["color".concat(Object(l.a)(f))],s,"fixed"===h&&"mui-fixed"),ref:t},p))}));t.a=Object(s.a)((function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0,"@media print":{position:"absolute"}},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorInherit:{color:"inherit"},colorTransparent:{backgroundColor:"transparent",color:"inherit"}}}),{name:"MuiAppBar"})(u)},function(e,t,n){"use strict";var r=n(1),i=n(0),o=(n(11),n(10)),a={WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box"},s=function(e){return Object(r.a)({color:e.palette.text.primary},e.typography.body2,{backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}})};t.a=Object(o.a)((function(e){return{"@global":{html:a,"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:Object(r.a)({margin:0},s(e),{"&::backdrop":{backgroundColor:e.palette.background.default}})}}}),{name:"MuiCssBaseline"})((function(e){var t=e.children,n=void 0===t?null:t;return e.classes,i.createElement(i.Fragment,null,n)}))},function(e,t,n){"use strict";var r=n(1),i=n(0),o=n.n(i),a=(n(11),n(92)),s=n(155),l=n(97);t.a=function(e){var t=e.children,n=e.theme,i=Object(s.a)(),c=o.a.useMemo((function(){var e=null===i?n:function(e,t){return"function"===typeof t?t(e):Object(r.a)({},e,t)}(i,n);return null!=e&&(e[l.a]=null!==i),e}),[n,i]);return o.a.createElement(a.a.Provider,{value:c},t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Nt}));var r=n(19),i=n(0),o=n.n(i),a=n(11),s=n(33),l=n(8),c=n(1),u=n(7),f=n(242),d=n(38),h=n(86),p=n(22),v=n(281),m=n(10),g=n(259),y=n(260),b=n(264),O=n(263),k=n(285),w=n(256);function x(e,t){return Array.isArray(t)?t.every((function(t){return-1!==e.indexOf(t)})):-1!==e.indexOf(t)}var j=Object(f.a)((function(e){return{staticWrapperRoot:{overflow:"hidden",minWidth:310,display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper}}}),{name:"MuiPickersStaticWrapper"}),S=function(e){var t=e.children,n=j();return Object(i.createElement)("div",{className:n.staticWrapperRoot,children:t})},E=function(e){var t=e.children,n=e.classes,r=e.onAccept,o=e.onDismiss,a=e.onClear,s=e.onSetToday,f=e.okLabel,d=e.cancelLabel,h=e.clearLabel,p=e.todayLabel,v=e.clearable,m=e.showTodayButton,y=(e.showTabs,e.wider),w=Object(u.a)(e,["children","classes","onAccept","onDismiss","onClear","onSetToday","okLabel","cancelLabel","clearLabel","todayLabel","clearable","showTodayButton","showTabs","wider"]);return Object(i.createElement)(k.a,Object(c.a)({role:"dialog",onClose:o,classes:{paper:Object(l.a)(n.dialogRoot,y&&n.dialogRootWider)}},w),Object(i.createElement)(O.a,{children:t,className:n.dialog}),Object(i.createElement)(b.a,{classes:{root:Object(l.a)((v||m)&&n.withAdditionalAction)}},v&&Object(i.createElement)(g.a,{color:"primary",onClick:a},h),m&&Object(i.createElement)(g.a,{color:"primary",onClick:s},p),d&&Object(i.createElement)(g.a,{color:"primary",onClick:o},d),f&&Object(i.createElement)(g.a,{color:"primary",onClick:r},f)))};E.displayName="ModalDialog";var C=Object(v.a)({dialogRoot:{minWidth:310},dialogRootWider:{minWidth:325},dialog:{"&:first-child":{padding:0}},withAdditionalAction:{justifyContent:"flex-start","& > *:first-child":{marginRight:"auto"}}}),M=Object(m.a)(C,{name:"MuiPickersModal"})(E),P="undefined"===typeof window?i.useEffect:i.useLayoutEffect;function T(e,t){var n=t[e.key];n&&(n(),e.preventDefault())}function A(e,t){var n=Object(i.useRef)(t);n.current=t,P((function(){if(e){var t=function(e){T(e,n.current)};return window.addEventListener("keydown",t),function(){window.removeEventListener("keydown",t)}}}),[e])}var D=function(e){var t=e.open,n=e.children,r=e.okLabel,o=e.cancelLabel,a=e.clearLabel,s=e.todayLabel,l=e.showTodayButton,f=e.clearable,d=e.DialogProps,h=e.showTabs,p=e.wider,v=e.InputComponent,m=e.DateInputProps,g=e.onClear,y=e.onAccept,b=e.onDismiss,O=e.onSetToday,k=Object(u.a)(e,["open","children","okLabel","cancelLabel","clearLabel","todayLabel","showTodayButton","clearable","DialogProps","showTabs","wider","InputComponent","DateInputProps","onClear","onAccept","onDismiss","onSetToday"]);return A(t,{Enter:y}),Object(i.createElement)(i.Fragment,null,Object(i.createElement)(v,Object(c.a)({},k,m)),Object(i.createElement)(M,Object(c.a)({wider:p,showTabs:h,open:t,onClear:g,onAccept:y,onDismiss:b,onSetToday:O,clearLabel:a,todayLabel:s,okLabel:r,cancelLabel:o,clearable:f,showTodayButton:l,children:n},d)))};D.defaultProps={okLabel:"OK",cancelLabel:"Cancel",clearLabel:"Clear",todayLabel:"Today",clearable:!1,showTodayButton:!1};var R=function(e){var t=e.open,n=(e.wider,e.children),r=e.PopoverProps,o=(e.onClear,e.onDismiss),a=(e.onSetToday,e.onAccept),s=(e.showTabs,e.DateInputProps),l=e.InputComponent,f=Object(u.a)(e,["open","wider","children","PopoverProps","onClear","onDismiss","onSetToday","onAccept","showTabs","DateInputProps","InputComponent"]),d=Object(i.useRef)();return A(t,{Enter:a}),Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l,Object(c.a)({},f,s,{inputRef:d})),Object(i.createElement)(w.a,Object(c.a)({open:t,onClose:o,anchorEl:d.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n},r)))};var N=Object(i.createContext)(null),_=function(e){var t=e.variant,n=Object(u.a)(e,["variant"]),r=function(e){switch(e){case"inline":return R;case"static":return S;default:return D}}(t);return Object(i.createElement)(N.Provider,{value:t||"dialog"},Object(i.createElement)(r,n))},L=n(275),I=n(159),$=n(261),z=n(49),B=function(e){function t(t){var n;return(n=e.call(this,t)||this)._state=null,n._del=!1,n._handleChange=function(e){var t=n.state.value,r=e.target.value,i=e.target,o=r.length>t.length,a=n._del,s=t===n.props.format(r);n.setState({value:r,local:!0},(function(){var e=i.selectionStart,l=n.props.refuse||/[^\d]+/g,c=r.substr(0,e).replace(l,"");if(n._state={input:i,before:c,op:o,di:a&&s,del:a},n.props.replace&&n.props.replace(t)&&o&&!s){for(var u=-1,f=0;f!==c.length;++f)u=Math.max(u,r.toLowerCase().indexOf(c[f].toLowerCase(),u+1));var d=r.substr(u+1).replace(l,"")[0];u=r.indexOf(d,u+1),r=""+r.substr(0,u)+r.substr(u+1)}var h=n.props.format(r);t===h?n.setState({value:r}):n.props.onChange(h)}))},n._hKD=function(e){"Delete"===e.code&&(n._del=!0)},n._hKU=function(e){"Delete"===e.code&&(n._del=!1)},n.state={value:t.value,local:!0},n}Object(z.a)(t,e),t.getDerivedStateFromProps=function(e,t){return{value:t.local?t.value:e.value,local:!1}};var n=t.prototype;return n.render=function(){var e=this._handleChange,t=this.state.value;return(0,this.props.children)({value:t,onChange:e})},n.componentWillUnmount=function(){document.removeEventListener("keydown",this._hKD),document.removeEventListener("keyup",this._hKU)},n.componentDidMount=function(){document.addEventListener("keydown",this._hKD),document.addEventListener("keyup",this._hKU)},n.componentDidUpdate=function(){var e=this._state;if(e){for(var t=this.state.value,n=-1,r=0;r!==e.before.length;++r)n=Math.max(n,t.toLowerCase().indexOf(e.before[r].toLowerCase(),n+1));if(this.props.replace&&(e.op||e.del&&!e.di))for(;t[n+1]&&(this.props.refuse||/[^\d]+/).test(t[n+1]);)n+=1;e.input.selectionStart=e.input.selectionEnd=n+1+(e.di?1:0)}this._state=null},t}(i.Component),F=n(158),W=n(29),V=n(63),H=n(42),Q=n(116),q=n.n(Q),U=n(72);function X(e,t){if(t&&("object"===q()(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Object(U.a)(e)}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}var G=n(91);function K(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(G.a)(e,t)}var J=Object(f.a)((function(e){return{day:{width:36,height:36,fontSize:e.typography.caption.fontSize,margin:"0 2px",color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium,padding:0},hidden:{opacity:0,pointerEvents:"none"},current:{color:e.palette.primary.main,fontWeight:600},daySelected:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{backgroundColor:e.palette.primary.main}},dayDisabled:{pointerEvents:"none",color:e.palette.text.hint}}}),{name:"MuiPickersDay"}),Z=function(e){var t=e.children,n=e.disabled,r=e.hidden,o=e.current,a=e.selected,s=Object(u.a)(e,["children","disabled","hidden","current","selected"]),f=J(),d=Object(l.a)(f.day,r&&f.hidden,o&&f.current,a&&f.daySelected,n&&f.dayDisabled);return Object(i.createElement)(I.a,Object(c.a)({className:d,tabIndex:r||n?-1:0},s),Object(i.createElement)(h.a,{variant:"body2",color:"inherit"},t))};Z.displayName="Day",Z.defaultProps={disabled:!1,hidden:!1,current:!1,selected:!1};var ee=Z,te=n(282),ne=n(56);function re(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var ie=n(107),oe=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"===typeof n.className?n.className=re(n.className,r):n.setAttribute("class",re(n.className&&n.className.baseVal||"",r)));var n,r}))},ae=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.addClass(i,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"===typeof n,i=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:i,activeClassName:r?i+"-active":n[e+"Active"],doneClassName:r?i+"-done":n[e+"Done"]}},t}Object(z.a)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&i&&(r+=" "+i),"active"===n&&e&&e.scrollTop,r&&(this.appliedClasses[t][n]=r,function(e,t){e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"===typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))}(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&oe(e,r),i&&oe(e,i),o&&oe(e,o)},n.render=function(){var e=this.props,t=(e.classNames,Object(ne.a)(e,["classNames"]));return o.a.createElement(ie.a,Object(c.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(o.a.Component);ae.defaultProps={classNames:""},ae.propTypes={};var se=ae,le=n(241),ce=function(e){var t=e.children,n=e.value,r=e.disabled,o=e.onSelect,a=e.dayInCurrentMonth,s=Object(u.a)(e,["children","value","disabled","onSelect","dayInCurrentMonth"]),l=Object(i.useCallback)((function(){return o(n)}),[o,n]);return Object(i.createElement)("div",Object(c.a)({role:"presentation",onClick:a&&!r?l:void 0,onKeyPress:a&&!r?l:void 0},s),t)},ue=Object(f.a)((function(e){var t=e.transitions.create("transform",{duration:350,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{transitionContainer:{display:"block",position:"relative","& > *":{position:"absolute",top:0,right:0,left:0}},"slideEnter-left":{willChange:"transform",transform:"translate(100%)"},"slideEnter-right":{willChange:"transform",transform:"translate(-100%)"},slideEnterActive:{transform:"translate(0%)",transition:t},slideExit:{transform:"translate(0%)"},"slideExitActiveLeft-left":{willChange:"transform",transform:"translate(-200%)",transition:t},"slideExitActiveLeft-right":{willChange:"transform",transform:"translate(200%)",transition:t}}}),{name:"MuiPickersSlideTransition"}),fe=function(e){var t=e.children,n=e.transKey,r=e.slideDirection,o=e.className,a=void 0===o?null:o,s=ue(),c={exit:s.slideExit,enterActive:s.slideEnterActive,enter:s["slideEnter-"+r],exitActive:s["slideExitActiveLeft-"+r]};return Object(i.createElement)(te.a,{className:Object(l.a)(s.transitionContainer,a),childFactory:function(e){return Object(i.cloneElement)(e,{classNames:c})}},Object(i.createElement)(se,{mountOnEnter:!0,unmountOnExit:!0,key:n+r,timeout:350,classNames:c,children:t}))},de=Object(f.a)((function(e){return{switchHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:e.spacing(.5),marginBottom:e.spacing(1)},transitionContainer:{width:"100%",overflow:"hidden",height:23},iconButton:{zIndex:1,backgroundColor:e.palette.background.paper},daysHeader:{display:"flex",justifyContent:"center",alignItems:"center",maxHeight:16},dayLabel:{width:36,margin:"0 2px",textAlign:"center",color:e.palette.text.hint}}}),{name:"MuiPickersCalendarHeader"}),he=function(e){var t=e.currentMonth,n=e.onMonthChange,r=e.leftArrowIcon,o=e.rightArrowIcon,a=e.leftArrowButtonProps,l=e.rightArrowButtonProps,u=e.disablePrevMonth,f=e.disableNextMonth,p=e.slideDirection,v=Object(s.b)(),m=de(),g="rtl"===Object(d.a)().direction;return Object(i.createElement)("div",null,Object(i.createElement)("div",{className:m.switchHeader},Object(i.createElement)(I.a,Object(c.a)({},a,{disabled:u,onClick:function(){return n(v.getPreviousMonth(t),"right")},className:m.iconButton}),g?o:r),Object(i.createElement)(fe,{slideDirection:p,transKey:t.toString(),className:m.transitionContainer},Object(i.createElement)(h.a,{align:"center",variant:"body1"},v.getCalendarHeaderText(t))),Object(i.createElement)(I.a,Object(c.a)({},l,{disabled:f,onClick:function(){return n(v.getNextMonth(t),"left")},className:m.iconButton}),g?r:o)),Object(i.createElement)("div",{className:m.daysHeader},v.getWeekdays().map((function(e,t){return Object(i.createElement)(h.a,{key:t,variant:"caption",className:m.dayLabel},e)}))))};he.displayName="CalendarHeader",he.defaultProps={leftArrowIcon:Object(i.createElement)((function(e){return o.a.createElement(F.a,e,o.a.createElement("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),o.a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}))}),null),rightArrowIcon:Object(i.createElement)((function(e){return o.a.createElement(F.a,e,o.a.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),o.a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}))}),null),disablePrevMonth:!1,disableNextMonth:!1};var pe=function(e){var t=e.onKeyDown;return Object(i.useEffect)((function(){return window.addEventListener("keydown",t),function(){window.removeEventListener("keydown",t)}}),[t]),null},ve=function(e){function t(){var e,n;Object(V.a)(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(n=X(this,(e=Y(t)).call.apply(e,[this].concat(o)))).state={slideDirection:"left",currentMonth:n.props.utils.startOfMonth(n.props.date),loadingQueue:0},n.pushToLoadingQueue=function(){var e=n.state.loadingQueue+1;n.setState({loadingQueue:e})},n.popFromLoadingQueue=function(){var e=n.state.loadingQueue;e=e<=0?0:e-1,n.setState({loadingQueue:e})},n.handleChangeMonth=function(e,t){if(n.setState({currentMonth:e,slideDirection:t}),n.props.onMonthChange){var r=n.props.onMonthChange(e);r&&(n.pushToLoadingQueue(),r.then((function(){n.popFromLoadingQueue()})))}},n.validateMinMaxDate=function(e){var t=n.props,r=t.minDate,i=t.maxDate,o=t.utils,a=t.disableFuture,s=t.disablePast,l=o.date();return Boolean(a&&o.isAfterDay(e,l)||s&&o.isBeforeDay(e,l)||r&&o.isBeforeDay(e,o.date(r))||i&&o.isAfterDay(e,o.date(i)))},n.shouldDisablePrevMonth=function(){var e=n.props,t=e.utils,r=e.disablePast,i=e.minDate,o=t.date(),a=t.startOfMonth(r&&t.isAfter(o,t.date(i))?o:t.date(i));return!t.isBefore(a,n.state.currentMonth)},n.shouldDisableNextMonth=function(){var e=n.props,t=e.utils,r=e.disableFuture,i=e.maxDate,o=t.date(),a=t.startOfMonth(r&&t.isBefore(o,t.date(i))?o:t.date(i));return!t.isAfter(a,n.state.currentMonth)},n.shouldDisableDate=function(e){var t=n.props.shouldDisableDate;return n.validateMinMaxDate(e)||Boolean(t&&t(e))},n.handleDaySelect=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=n.props,i=r.date,o=r.utils;n.props.onChange(o.mergeDateAndTime(e,i),t)},n.moveToDay=function(e){var t=n.props.utils;e&&!n.shouldDisableDate(e)&&(t.getMonth(e)!==t.getMonth(n.state.currentMonth)&&n.handleChangeMonth(t.startOfMonth(e),"left"),n.handleDaySelect(e,!1))},n.handleKeyDown=function(e){var t=n.props,r=t.theme,i=t.date,o=t.utils;T(e,{ArrowUp:function(){return n.moveToDay(o.addDays(i,-7))},ArrowDown:function(){return n.moveToDay(o.addDays(i,7))},ArrowLeft:function(){return n.moveToDay(o.addDays(i,"ltr"===r.direction?-1:1))},ArrowRight:function(){return n.moveToDay(o.addDays(i,"ltr"===r.direction?1:-1))}})},n.renderWeeks=function(){var e=n.props,t=e.utils,r=e.classes;return t.getWeekArray(n.state.currentMonth).map((function(e){return Object(i.createElement)("div",{key:"week-".concat(e[0].toString()),className:r.week},n.renderDays(e))}))},n.renderDays=function(e){var t=n.props,r=t.date,o=t.renderDay,a=t.utils,s=a.date(),l=a.startOfDay(r),c=a.getMonth(n.state.currentMonth);return e.map((function(e){var t=n.shouldDisableDate(e),r=a.getMonth(e)===c,u=Object(i.createElement)(ee,{disabled:t,current:a.isSameDay(e,s),hidden:!r,selected:a.isSameDay(l,e)},a.getDayText(e));return o&&(u=o(e,l,r,u)),Object(i.createElement)(ce,{value:e,key:e.toString(),disabled:t,dayInCurrentMonth:r,onSelect:n.handleDaySelect},u)}))},n}return K(t,e),Object(H.a)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.date,n=e.minDate,r=e.maxDate,i=e.utils,o=e.disablePast,a=e.disableFuture;if(this.shouldDisableDate(t)){var s=function(e){var t=e.date,n=e.utils,r=e.minDate,i=e.maxDate,o=e.disableFuture,a=e.disablePast,s=e.shouldDisableDate,l=n.startOfDay(n.date());a&&n.isBefore(r,l)&&(r=l),o&&n.isAfter(i,l)&&(i=l);var c=t,u=t;for(n.isBefore(t,r)&&(c=n.date(r),u=null),n.isAfter(t,i)&&(u&&(u=n.date(i)),c=null);c||u;){if(c&&n.isAfter(c,i)&&(c=null),u&&n.isBefore(u,r)&&(u=null),c){if(!s(c))return c;c=n.addDays(c,1)}if(u){if(!s(u))return u;u=n.addDays(u,-1)}}return n.date()}({date:t,utils:i,minDate:i.date(n),maxDate:i.date(r),disablePast:Boolean(o),disableFuture:Boolean(a),shouldDisableDate:this.shouldDisableDate});this.handleDaySelect(s,!1)}}},{key:"render",value:function(){var e=this.state,t=e.currentMonth,n=e.slideDirection,r=this.props,o=r.classes,a=r.allowKeyboardControl,s=r.leftArrowButtonProps,l=r.leftArrowIcon,c=r.rightArrowButtonProps,u=r.rightArrowIcon,f=r.loadingIndicator,d=f||Object(i.createElement)(le.a,null);return Object(i.createElement)(i.Fragment,null,a&&"static"!==this.context&&Object(i.createElement)(pe,{onKeyDown:this.handleKeyDown}),Object(i.createElement)(he,{currentMonth:t,slideDirection:n,onMonthChange:this.handleChangeMonth,leftArrowIcon:l,leftArrowButtonProps:s,rightArrowIcon:u,rightArrowButtonProps:c,disablePrevMonth:this.shouldDisablePrevMonth(),disableNextMonth:this.shouldDisableNextMonth()}),Object(i.createElement)(fe,{slideDirection:n,transKey:t.toString(),className:o.transitionContainer},Object(i.createElement)(i.Fragment,null,this.state.loadingQueue>0&&Object(i.createElement)("div",{className:o.progressContainer},d)||Object(i.createElement)("div",null,this.renderWeeks()))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.utils,r=e.date;if(!n.isEqual(r,t.lastDate)){var i=n.getMonth(r),o=t.lastDate||r,a=n.getMonth(o);return{lastDate:r,currentMonth:e.utils.startOfMonth(r),slideDirection:i===a?t.slideDirection:n.isAfterDay(r,o)?"left":"right"}}return null}}]),t}(i.Component);ve.contextType=N,ve.defaultProps={minDate:new Date("1900-01-01"),maxDate:new Date("2100-01-01"),disablePast:!1,disableFuture:!1,allowKeyboardControl:!0};var me,ge=Object(m.a)((function(e){return{transitionContainer:{minHeight:216,marginTop:e.spacing(1.5)},progressContainer:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},week:{display:"flex",justifyContent:"center"}}}),{name:"MuiPickersCalendar",withTheme:!0})(function(e){var t=function(t){var n=Object(s.b)();return Object(i.createElement)(e,Object(c.a)({utils:n},t))};return t.displayName="WithUtils(".concat(e.displayName||e.name,")"),t}(ve));!function(e){e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds"}(me||(me={}));var ye=me,be=function(e){function t(){var e,n;Object(V.a)(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(n=X(this,(e=Y(t)).call.apply(e,[this].concat(i)))).state={toAnimateTransform:!1,previousType:void 0},n.getAngleStyle=function(){var e=n.props,t=e.value,r=e.isInner,i=e.type,o=360/(i===ye.HOURS?12:60)*t;return i===ye.HOURS&&t>12&&(o-=360),{height:r?"26%":"40%",transform:"rotateZ(".concat(o,"deg)")}},n}return K(t,e),Object(H.a)(t,[{key:"render",value:function(){var e=this.props,t=e.classes,n=e.hasSelected;return Object(i.createElement)("div",{style:this.getAngleStyle(),className:Object(l.a)(t.pointer,this.state.toAnimateTransform&&t.animateTransform)},Object(i.createElement)("div",{className:Object(l.a)(t.thumb,n&&t.noPoint)}))}}]),t}(i.Component);be.getDerivedStateFromProps=function(e,t){return e.type!==t.previousType?{toAnimateTransform:!0,previousType:e.type}:{toAnimateTransform:!1,previousType:e.type}};var Oe=Object(m.a)((function(e){return Object(v.a)({pointer:{width:2,backgroundColor:e.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},animateTransform:{transition:e.transitions.create(["transform","height"])},thumb:{width:4,height:4,backgroundColor:e.palette.primary.contrastText,borderRadius:"100%",position:"absolute",top:-21,left:-15,border:"14px solid ".concat(e.palette.primary.main),boxSizing:"content-box"},noPoint:{backgroundColor:e.palette.primary.main}})}),{name:"MuiPickersClockPointer"})(be),ke={x:130,y:130},we=ke.x-ke.x,xe=0-ke.y,je=function(e,t,n){var r=t-ke.x,i=n-ke.y,o=Math.atan2(we,xe)-Math.atan2(r,i),a=57.29577951308232*o;a=Math.round(a/e)*e,a%=360;var s=Math.floor(a/e)||0,l=Math.pow(r,2)+Math.pow(i,2);return{value:s,distance:Math.sqrt(l)}},Se=function(e,t,n){var r=je(30,e,t),i=r.value,o=r.distance;return i=i||12,n?i%=12:o<90&&(i+=12,i%=24),i},Ee=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=6*n,i=je(r,e,t),o=i.value;return o=o*n%60},Ce=function(e,t){return t.getHours(e)>=12?"pm":"am"},Me=function(e,t,n,r){if(n&&(r.getHours(e)>=12?"pm":"am")!==t){var i="am"===t?r.getHours(e)-12:r.getHours(e)+12;return r.setHours(e,i)}return e},Pe=function(e){function t(){var e,n;Object(V.a)(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(n=X(this,(e=Y(t)).call.apply(e,[this].concat(i)))).isMoving=!1,n.handleTouchMove=function(e){n.isMoving=!0,n.setTime(e)},n.handleTouchEnd=function(e){n.isMoving&&(n.setTime(e,!0),n.isMoving=!1)},n.handleMove=function(e){e.preventDefault(),e.stopPropagation(),("undefined"===typeof e.buttons?1===e.nativeEvent.which:1===e.buttons)&&n.setTime(e.nativeEvent,!1)},n.handleMouseUp=function(e){n.isMoving&&(n.isMoving=!1),n.setTime(e.nativeEvent,!0)},n.hasSelected=function(){var e=n.props,t=e.type,r=e.value;return t===ye.HOURS||r%5===0},n}return K(t,e),Object(H.a)(t,[{key:"setTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.offsetX,r=e.offsetY;if("undefined"===typeof n){var i=e.target.getBoundingClientRect();n=e.changedTouches[0].clientX-i.left,r=e.changedTouches[0].clientY-i.top}var o=this.props.type===ye.SECONDS||this.props.type===ye.MINUTES?Ee(n,r,this.props.minutesStep):Se(n,r,Boolean(this.props.ampm));this.props.onChange(o,t)}},{key:"render",value:function(){var e=this.props,t=e.classes,n=e.value,r=e.children,o=e.type,a=!e.ampm&&o===ye.HOURS&&(n<1||n>12);return Object(i.createElement)("div",{className:t.container},Object(i.createElement)("div",{className:t.clock},Object(i.createElement)("div",{role:"menu",tabIndex:-1,className:t.squareMask,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,onMouseUp:this.handleMouseUp,onMouseMove:this.handleMove}),Object(i.createElement)("div",{className:t.pin}),Object(i.createElement)(Oe,{type:o,value:n,isInner:a,hasSelected:this.hasSelected()}),r))}}]),t}(i.Component);Pe.defaultProps={ampm:!1,minutesStep:1};var Te=Object(m.a)((function(e){return Object(v.a)({container:{display:"flex",justifyContent:"center",alignItems:"flex-end",margin:"".concat(e.spacing(2),"px 0 ").concat(e.spacing(1),"px")},clock:{backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:260,width:260,position:"relative",pointerEvents:"none"},squareMask:{width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:"none",touchActions:"none",userSelect:"none","&:active":{cursor:"move"}},pin:{width:6,height:6,borderRadius:"50%",backgroundColor:e.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}})}),{name:"MuiPickersClock"})(Pe),Ae={0:[0,40],1:[55,19.6],2:[94.4,59.5],3:[109,114],4:[94.4,168.5],5:[54.5,208.4],6:[0,223],7:[-54.5,208.4],8:[-94.4,168.5],9:[-109,114],10:[-94.4,59.5],11:[-54.5,19.6],12:[0,5],13:[36.9,49.9],14:[64,77],15:[74,114],16:[64,151],17:[37,178],18:[0,188],19:[-37,178],20:[-64,151],21:[-74,114],22:[-64,77],23:[-37,50]},De=Object(f.a)((function(e){var t=e.spacing(4);return{clockNumber:{width:t,height:32,userSelect:"none",position:"absolute",left:"calc((100% - ".concat("number"===typeof t?"".concat(t,"px"):t,") / 2)"),display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:"light"===e.palette.type?e.palette.text.primary:e.palette.text.hint},clockNumberSelected:{color:e.palette.primary.contrastText}}}),{name:"MuiPickersClockNumber"}),Re=function(e){var t=e.selected,n=e.label,r=e.index,o=e.isInner,a=De(),s=Object(l.a)(a.clockNumber,t&&a.clockNumberSelected),c=Object(i.useMemo)((function(){var e=Ae[r];return{transform:"translate(".concat(e[0],"px, ").concat(e[1],"px")}}),[r]);return Object(i.createElement)(h.a,{component:"span",className:s,variant:o?"body2":"body1",style:c,children:n})},Ne=function(e){for(var t=e.ampm,n=e.utils,r=e.date,o=n.getHours(r),a=[],s=t?12:23,l=function(e){return t?12===e?12===o||0===o:o===e||o-12===e:o===e},u=t?1:0;u<=s;u+=1){var f=u.toString();0===u&&(f="00");var d={index:u,label:n.formatNumber(f),selected:l(u),isInner:!t&&(0===u||u>12)};a.push(Object(i.createElement)(Re,Object(c.a)({key:u},d)))}return a},_e=function(e){var t=e.value,n=e.utils.formatNumber;return[Object(i.createElement)(Re,{label:n("00"),selected:0===t,index:12,key:12}),Object(i.createElement)(Re,{label:n("05"),selected:5===t,index:1,key:1}),Object(i.createElement)(Re,{label:n("10"),selected:10===t,index:2,key:2}),Object(i.createElement)(Re,{label:n("15"),selected:15===t,index:3,key:3}),Object(i.createElement)(Re,{label:n("20"),selected:20===t,index:4,key:4}),Object(i.createElement)(Re,{label:n("25"),selected:25===t,index:5,key:5}),Object(i.createElement)(Re,{label:n("30"),selected:30===t,index:6,key:6}),Object(i.createElement)(Re,{label:n("35"),selected:35===t,index:7,key:7}),Object(i.createElement)(Re,{label:n("40"),selected:40===t,index:8,key:8}),Object(i.createElement)(Re,{label:n("45"),selected:45===t,index:9,key:9}),Object(i.createElement)(Re,{label:n("50"),selected:50===t,index:10,key:10}),Object(i.createElement)(Re,{label:n("55"),selected:55===t,index:11,key:11})]},Le=function(e){var t=e.type,n=e.onHourChange,r=e.onMinutesChange,o=e.onSecondsChange,a=e.ampm,l=e.date,u=e.minutesStep,f=Object(s.b)(),d=Object(i.useMemo)((function(){switch(t){case ye.HOURS:return{value:f.getHours(l),children:Ne({date:l,utils:f,ampm:Boolean(a)}),onChange:function(e,t){var r=Ce(l,f),i=Me(f.setHours(l,e),r,Boolean(a),f);n(i,t)}};case ye.MINUTES:var e=f.getMinutes(l);return{value:e,children:_e({value:e,utils:f}),onChange:function(e,t){var n=f.setMinutes(l,e);r(n,t)}};case ye.SECONDS:var i=f.getSeconds(l);return{value:i,children:_e({value:i,utils:f}),onChange:function(e,t){var n=f.setSeconds(l,e);o(n,t)}};default:throw new Error("You must provide the type for TimePickerView")}}),[a,l,n,r,o,t,f]);return Object(i.createElement)(Te,Object(c.a)({type:t,ampm:a,minutesStep:u},d))};Le.displayName="TimePickerView",Le.defaultProps={ampm:!0,minutesStep:1};Object(i.memo)(Le);function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}Object(a.oneOfType)([a.object,a.string,a.number,Object(a.instanceOf)(Date)]),Object(a.oneOf)(["year","month","day"]);var $e={minDate:new Date("1900-01-01"),maxDate:new Date("2100-01-01"),invalidDateMessage:"Invalid Date Format",minDateMessage:"Date should not be before minimal date",maxDateMessage:"Date should not be after maximal date",allowKeyboardControl:!0},ze=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(n,!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{ampm:!0,invalidDateMessage:"Invalid Time Format"},{},$e,{showTabs:!0});var Be=Object(f.a)((function(e){return{root:{height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",outline:"none","&:focus":{color:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium}},yearSelected:{margin:"10px 0",fontWeight:e.typography.fontWeightMedium},yearDisabled:{pointerEvents:"none",color:e.palette.text.hint}}}),{name:"MuiPickersYear"}),Fe=function(e){var t=e.onSelect,n=e.forwardedRef,r=e.value,o=e.selected,a=e.disabled,s=e.children,f=Object(u.a)(e,["onSelect","forwardedRef","value","selected","disabled","children"]),d=Be(),p=Object(i.useCallback)((function(){return t(r)}),[t,r]);return Object(i.createElement)(h.a,Object(c.a)({role:"button",component:"div",tabIndex:a?-1:0,onClick:p,onKeyPress:p,color:o?"primary":void 0,variant:o?"h5":"subtitle1",children:s,ref:n,className:Object(l.a)(d.root,o&&d.yearSelected,a&&d.yearDisabled)},f))};Fe.displayName="Year";var We=Object(i.forwardRef)((function(e,t){return Object(i.createElement)(Fe,Object(c.a)({},e,{forwardedRef:t}))})),Ve=Object(f.a)({container:{height:300,overflowY:"auto"}},{name:"MuiPickersYearSelection"}),He=function(e){var t=e.date,n=e.onChange,r=e.onYearChange,o=e.minDate,a=e.maxDate,l=e.disablePast,c=e.disableFuture,u=e.animateYearScrolling,f=Object(s.b)(),d=Ve(),h=Object(i.useContext)(N),p=Object(i.useRef)(null);Object(i.useEffect)((function(){if(p.current&&p.current.scrollIntoView)try{p.current.scrollIntoView({block:"static"===h?"nearest":"center",behavior:u?"smooth":"auto"})}catch(e){p.current.scrollIntoView()}}),[]);var v=f.getYear(t),m=Object(i.useCallback)((function(e){var i=f.setYear(t,e);r&&r(i),n(i,!0)}),[t,n,r,f]);return Object(i.createElement)("div",{className:d.container},f.getYearRange(o,a).map((function(e){var t=f.getYear(e),n=t===v;return Object(i.createElement)(We,{key:f.getYearText(e),selected:n,value:t,onSelect:m,ref:n?p:void 0,disabled:Boolean(l&&f.isBeforeYear(e,f.date())||c&&f.isAfterYear(e,f.date()))},f.getYearText(e))})))},Qe=Object(f.a)((function(e){return{root:{flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",outline:"none",height:75,transition:e.transitions.create("font-size",{duration:"100ms"}),"&:focus":{color:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium}},monthSelected:{color:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium},monthDisabled:{pointerEvents:"none",color:e.palette.text.hint}}}),{name:"MuiPickersMonth"}),qe=function(e){var t=e.selected,n=e.onSelect,r=e.disabled,o=e.value,a=e.children,s=Object(u.a)(e,["selected","onSelect","disabled","value","children"]),f=Qe(),d=Object(i.useCallback)((function(){n(o)}),[n,o]);return Object(i.createElement)(h.a,Object(c.a)({role:"button",component:"div",className:Object(l.a)(f.root,t&&f.monthSelected,r&&f.monthDisabled),tabIndex:r?-1:0,onClick:d,onKeyPress:d,color:t?"primary":void 0,variant:t?"h5":"subtitle1",children:a},s))};qe.displayName="Month";var Ue=Object(f.a)({container:{width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch"}},{name:"MuiPickersMonthSelection"}),Xe=function(e){var t=e.disablePast,n=e.disableFuture,r=e.minDate,o=e.maxDate,a=e.date,l=e.onMonthChange,c=e.onChange,u=Object(s.b)(),f=Ue(),d=u.getMonth(a),h=function(e){var i=u.date(),a=u.date(r),s=u.date(o),l=u.startOfMonth(t&&u.isAfter(i,a)?i:a),c=u.startOfMonth(n&&u.isBefore(i,s)?i:s),f=u.isBefore(e,l),d=u.isAfter(e,c);return f||d},p=Object(i.useCallback)((function(e){var t=u.setMonth(a,e);c(t,!0),l&&l(t)}),[a,c,l,u]);return Object(i.createElement)("div",{className:f.container},u.getMonthArray(a).map((function(e){var t=u.getMonth(e),n=u.format(e,"MMM");return Object(i.createElement)(qe,{key:n,value:t,selected:t===d,onSelect:p,disabled:h(e)},n)})))},Ye=function(){return"undefined"===typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"};function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ke={year:He,month:Xe,date:ge,hours:Le,minutes:Le,seconds:Le},Je=Object(f.a)({container:{display:"flex",flexDirection:"column"},containerLandscape:{flexDirection:"row"},pickerView:{overflowX:"hidden",minHeight:305,minWidth:310,maxWidth:325,display:"flex",flexDirection:"column",justifyContent:"center"},pickerViewLandscape:{padding:"0 8px"}},{name:"MuiPickersBasePicker"}),Ze=function(e){var t=e.date,n=e.views,r=e.disableToolbar,o=e.onChange,a=e.openTo,f=e.minDate,d=e.maxDate,h=e.ToolbarComponent,p=e.orientation,v=Object(u.a)(e,["date","views","disableToolbar","onChange","openTo","minDate","maxDate","ToolbarComponent","orientation"]),m=Object(s.b)(),g=Je(),y=function(e){var t=Object(i.useState)(Ye()),n=Object(W.a)(t,2),r=n[0],o=n[1],a=Object(i.useCallback)((function(){return o(Ye())}),[]);return P((function(){return window.addEventListener("orientationchange",a),function(){return window.removeEventListener("orientationchange",a)}}),[a]),"landscape"===(e||r)}(p),b=function(e,t,n){var r=Object(i.useState)(t&&x(e,t)?t:e[0]),o=Object(W.a)(r,2),a=o[0],s=o[1];return{handleChangeAndOpenNext:Object(i.useCallback)((function(t,r){var i=e[e.indexOf(a)+1];if(r&&i)return n(t,!1),void s(i);n(t,Boolean(r))}),[n,a,e]),openView:a,setOpenView:s}}(n,a,o),O=b.openView,k=b.setOpenView,w=b.handleChangeAndOpenNext,j=Object(i.useMemo)((function(){return m.date(f)}),[f,m]),S=Object(i.useMemo)((function(){return m.date(d)}),[d,m]);return Object(i.createElement)("div",{className:Object(l.a)(g.container,y&&g.containerLandscape)},!r&&Object(i.createElement)(h,Object(c.a)({},v,{views:n,isLandscape:y,date:t,onChange:o,setOpenView:k,openView:O})),Object(i.createElement)("div",{className:Object(l.a)(g.pickerView,y&&g.pickerViewLandscape)},"year"===O&&Object(i.createElement)(He,Object(c.a)({},v,{date:t,onChange:w,minDate:j,maxDate:S})),"month"===O&&Object(i.createElement)(Xe,Object(c.a)({},v,{date:t,onChange:w,minDate:j,maxDate:S})),"date"===O&&Object(i.createElement)(ge,Object(c.a)({},v,{date:t,onChange:w,minDate:j,maxDate:S})),("hours"===O||"minutes"===O||"seconds"===O)&&Object(i.createElement)(Le,Object(c.a)({},v,{date:t,type:O,onHourChange:w,onMinutesChange:w,onSecondsChange:w}))))};Ze.defaultProps=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(n,!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},$e,{views:Object.keys(Ke)});var et=Object(f.a)((function(e){var t="light"===e.palette.type?e.palette.primary.contrastText:e.palette.getContrastText(e.palette.background.default);return{toolbarTxt:{color:Object(p.d)(t,.54)},toolbarBtnSelected:{color:t}}}),{name:"MuiPickersToolbarText"}),tt=function(e){var t=e.selected,n=e.label,r=e.className,o=void 0===r?null:r,a=Object(u.a)(e,["selected","label","className"]),s=et();return Object(i.createElement)(h.a,Object(c.a)({children:n,className:Object(l.a)(s.toolbarTxt,o,t&&s.toolbarBtnSelected)},a))},nt=function(e){var t=e.classes,n=e.className,r=void 0===n?null:n,o=e.label,a=e.selected,s=e.variant,f=e.align,d=e.typographyClassName,h=Object(u.a)(e,["classes","className","label","selected","variant","align","typographyClassName"]);return Object(i.createElement)(g.a,Object(c.a)({variant:"text",className:Object(l.a)(t.toolbarBtn,r)},h),Object(i.createElement)(tt,{align:f,className:d,variant:s,label:o,selected:a}))};nt.defaultProps={className:""};var rt=Object(v.a)({toolbarBtn:{padding:0,minWidth:"16px",textTransform:"none"}}),it=Object(m.a)(rt,{name:"MuiPickersToolbarButton"})(nt),ot=Object(f.a)((function(e){return{toolbar:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",height:100,backgroundColor:"light"===e.palette.type?e.palette.primary.main:e.palette.background.default},toolbarLandscape:{height:"auto",maxWidth:150,padding:8,justifyContent:"flex-start"}}}),{name:"MuiPickersToolbar"}),at=function(e){var t=e.children,n=e.isLandscape,r=e.className,o=void 0===r?null:r,a=Object(u.a)(e,["children","isLandscape","className"]),s=ot();return Object(i.createElement)(y.a,Object(c.a)({className:Object(l.a)(s.toolbar,o,n&&s.toolbarLandscape)},a),t)};function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var lt=function(e){var t=e.inputValue,n=e.inputVariant,o=e.validationError,a=e.InputProps,s=e.openPicker,l=e.TextFieldComponent,f=void 0===l?L.a:l,d=Object(u.a)(e,["inputValue","inputVariant","validationError","InputProps","openPicker","TextFieldComponent"]),h=Object(i.useMemo)((function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?st(n,!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):st(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},a,{readOnly:!0})}),[a]);return Object(i.createElement)(f,Object(c.a)({error:Boolean(o),helperText:o},d,{onClick:s,value:t,variant:n,InputProps:h,onKeyDown:function(e){32===e.keyCode&&(e.stopPropagation(),s())}}))};lt.displayName="PureDateInput";var ct=function(e,t,n,r,i){var o=i.invalidLabel,a=i.emptyLabel,s=i.labelFunc,l=n.date(e);return s?s(r?null:l,o):r?a||"":n.isValid(l)?n.format(l,t):o},ut=function(e,t,n){return t?n:e.endOfDay(n)},ft=function(e,t,n){return t?n:e.startOfDay(n)};function dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dt(n,!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dt(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pt=function(e){var t=e.inputValue,n=e.inputVariant,o=e.validationError,a=e.KeyboardButtonProps,s=e.InputAdornmentProps,l=e.openPicker,f=e.onChange,d=e.InputProps,h=e.mask,p=e.maskChar,v=void 0===p?"_":p,m=e.refuse,g=void 0===m?/[^\d]+/gi:m,y=e.format,b=e.keyboardIcon,O=e.disabled,k=e.rifmFormatter,w=e.TextFieldComponent,x=void 0===w?L.a:w,j=Object(u.a)(e,["inputValue","inputVariant","validationError","KeyboardButtonProps","InputAdornmentProps","openPicker","onChange","InputProps","mask","maskChar","refuse","format","keyboardIcon","disabled","rifmFormatter","TextFieldComponent"]),S=h||function(e,t){return e.replace(/[a-z]/gi,t)}(y,v),E=Object(i.useMemo)((function(){return function(e,t,n){return function(r){var i="",o=r.replace(n,"");if(""===o)return o;for(var a=0,s=0;a<e.length;){var l=e[a];l===t&&s<o.length?(i+=o[s],s+=1):i+=l,a+=1}return i}}(S,v,g)}),[S,v,g]),C=s&&s.position?s.position:"end";return Object(i.createElement)(B,{key:S,value:t,onChange:function(e){f(""===e||e===S?null:e)},refuse:g,format:k||E},(function(e){var t=e.onChange,u=e.value;return Object(i.createElement)(x,Object(c.a)({disabled:O,error:Boolean(o),helperText:o},j,{value:u,onChange:t,variant:n,InputProps:ht({},d,Object(r.a)({},"".concat(C,"Adornment"),Object(i.createElement)($.a,Object(c.a)({position:C},s),Object(i.createElement)(I.a,Object(c.a)({disabled:O},a,{onClick:l}),b))))}))}))};pt.defaultProps={keyboardIcon:Object(i.createElement)((function(e){return o.a.createElement(F.a,e,o.a.createElement("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),o.a.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}),null)};function vt(e,t){var n=function(e,t){var n=t.value,r=t.initialFocusedDate,o=Object(i.useRef)(e.date()),a=e.date(n||r||o.current);return a&&e.isValid(a)?a:o.current}(Object(s.b)(),e);return{date:n,format:e.format||t.getDefaultFormat()}}function mt(e,t){var n=e.autoOk,r=e.disabled,o=e.readOnly,a=e.onAccept,l=e.onChange,c=e.onError,u=e.value,f=e.variant,d=Object(s.b)(),h=function(e){var t=e.open,n=e.onOpen,r=e.onClose,o=null;if(void 0===t||null===t){var a=Object(i.useState)(!1),s=Object(W.a)(a,2);t=s[0],o=s[1]}return{isOpen:t,setIsOpen:Object(i.useCallback)((function(e){return o&&o(e),e?n&&n():r&&r()}),[n,r,o])}}(e),p=h.isOpen,v=h.setIsOpen,m=vt(e,t),g=m.date,y=m.format,b=Object(i.useState)(g),O=Object(W.a)(b,2),k=O[0],w=O[1];Object(i.useEffect)((function(){p||d.isEqual(k,g)||w(g)}),[g,p,k,d]);var x=Object(i.useCallback)((function(e){l(e),a&&a(e),v(!1)}),[a,l,v]),j=Object(i.useMemo)((function(){return{format:y,open:p,onClear:function(){return x(null)},onAccept:function(){return x(k)},onSetToday:function(){return w(d.date())},onDismiss:function(){v(!1)}}}),[x,y,p,k,v,d]),S=Object(i.useMemo)((function(){return{date:k,onChange:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];w(e),t&&n?x(e):"inline"!==f&&"static"!==f||(l(e),a&&a(e))}}}),[x,n,a,l,k,f]),E=function(e,t,n){var r=n.maxDate,i=n.minDate,o=n.disablePast,a=n.disableFuture,s=n.maxDateMessage,l=n.minDateMessage,c=n.invalidDateMessage,u=n.strictCompareDates,f=t.date(e);return null===e?"":t.isValid(e)?r&&t.isAfter(f,ut(t,!!u,t.date(r)))||a&&t.isAfter(f,ut(t,!!u,t.date()))?s:i&&t.isBefore(f,ft(t,!!u,t.date(i)))||o&&t.isBefore(f,ft(t,!!u,t.date()))?l:"":c}(u,d,e);Object(i.useEffect)((function(){c&&c(E,u)}),[c,E,u]);var C=ct(g,y,d,null===u,e),M={pickerProps:S,inputProps:Object(i.useMemo)((function(){return{inputValue:C,validationError:E,openPicker:function(){return!o&&!r&&v(!0)}}}),[r,C,o,v,E]),wrapperProps:j};return Object(i.useDebugValue)(M),M}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gt(n,!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bt(e){var t=e.Input,n=e.useState,r=e.useOptions,o=e.getCustomProps,a=e.DefaultToolbarComponent;return function(e){var s=e.allowKeyboardControl,l=e.ampm,f=e.animateYearScrolling,d=(e.autoOk,e.dateRangeIcon),h=e.disableFuture,p=e.disablePast,v=e.disableToolbar,m=(e.emptyLabel,e.format,e.forwardedRef,e.hideTabs),g=(e.initialFocusedDate,e.invalidDateMessage,e.invalidLabel,e.labelFunc,e.leftArrowButtonProps),y=e.leftArrowIcon,b=e.loadingIndicator,O=e.maxDate,k=(e.maxDateMessage,e.minDate),w=(e.minDateMessage,e.minutesStep),x=(e.onAccept,e.onChange,e.onClose,e.onMonthChange),j=(e.onOpen,e.onYearChange),S=e.openTo,E=e.orientation,C=e.renderDay,M=e.rightArrowButtonProps,P=e.rightArrowIcon,T=e.shouldDisableDate,A=e.strictCompareDates,D=e.timeIcon,R=e.ToolbarComponent,N=void 0===R?a:R,L=(e.value,e.variant),I=e.views,$=Object(u.a)(e,["allowKeyboardControl","ampm","animateYearScrolling","autoOk","dateRangeIcon","disableFuture","disablePast","disableToolbar","emptyLabel","format","forwardedRef","hideTabs","initialFocusedDate","invalidDateMessage","invalidLabel","labelFunc","leftArrowButtonProps","leftArrowIcon","loadingIndicator","maxDate","maxDateMessage","minDate","minDateMessage","minutesStep","onAccept","onChange","onClose","onMonthChange","onOpen","onYearChange","openTo","orientation","renderDay","rightArrowButtonProps","rightArrowIcon","shouldDisableDate","strictCompareDates","timeIcon","ToolbarComponent","value","variant","views"]),z=o?o(e):{},B=r(e),F=n(e,B),W=F.pickerProps,V=F.inputProps,H=F.wrapperProps;return Object(i.createElement)(_,Object(c.a)({variant:L,InputComponent:t,DateInputProps:V},z,H,$),Object(i.createElement)(Ze,Object(c.a)({},W,{allowKeyboardControl:s,ampm:l,animateYearScrolling:f,dateRangeIcon:d,disableFuture:h,disablePast:p,disableToolbar:v,hideTabs:m,leftArrowButtonProps:g,leftArrowIcon:y,loadingIndicator:b,maxDate:O,minDate:k,minutesStep:w,onMonthChange:x,onYearChange:j,openTo:S,orientation:E,renderDay:C,rightArrowButtonProps:M,rightArrowIcon:P,shouldDisableDate:T,strictCompareDates:A,timeIcon:D,ToolbarComponent:N,views:I})))}}Object(f.a)({toolbarLandscape:{flexWrap:"wrap"},toolbarAmpmLeftPadding:{paddingLeft:50},separator:{margin:"0 4px 0 2px",cursor:"default"},hourMinuteLabel:{display:"flex",justifyContent:"flex-end",alignItems:"flex-end"},hourMinuteLabelAmpmLandscape:{marginTop:"auto"},hourMinuteLabelReverse:{flexDirection:"row-reverse"},ampmSelection:{marginLeft:20,marginRight:-20,display:"flex",flexDirection:"column"},ampmLandscape:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"},ampmSelectionWithSeconds:{marginLeft:15,marginRight:10},ampmLabel:{fontSize:18}},{name:"MuiPickersTimePickerToolbar"});function Ot(e,t,n){var r=Object(s.b)();return{meridiemMode:Ce(e,r),handleMeridiemChange:Object(i.useCallback)((function(i){var o=Me(e,i,Boolean(t),r);n(o,!1)}),[t,e,n,r])}}var kt=n(265),wt=n(258),xt=n(276),jt=n(157),St=function(e){return"date"===e||"year"===e?"date":"time"},Et=Object(f.a)((function(e){var t="light"===e.palette.type?e.palette.primary.main:e.palette.background.default;return{tabs:{color:e.palette.getContrastText(t),backgroundColor:t}}}),{name:"MuiPickerDTTabs"}),Ct=function(e){var t=e.view,n=e.onChange,r=e.dateRangeIcon,o=e.timeIcon,a=Et(),s="light"===Object(d.a)().palette.type?"secondary":"primary";return Object(i.createElement)(jt.a,null,Object(i.createElement)(xt.a,{variant:"fullWidth",value:St(t),onChange:function(e,r){r!==St(t)&&n("date"===r?"date":"hours")},className:a.tabs,indicatorColor:s},Object(i.createElement)(wt.a,{value:"date",icon:Object(i.createElement)(i.Fragment,null,r)}),Object(i.createElement)(wt.a,{value:"time",icon:Object(i.createElement)(i.Fragment,null,o)})))};Ct.defaultProps={dateRangeIcon:Object(i.createElement)((function(e){return o.a.createElement(F.a,e,o.a.createElement("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),o.a.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}),null),timeIcon:Object(i.createElement)((function(e){return o.a.createElement(F.a,e,o.a.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),o.a.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),o.a.createElement("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"}))}),null)};var Mt=Object(f.a)((function(e){return{toolbar:{paddingLeft:16,paddingRight:16,justifyContent:"space-around"},separator:{margin:"0 4px 0 2px",cursor:"default"}}}),{name:"MuiPickerDTToolbar"}),Pt=function(e){var t=e.date,n=e.openView,r=e.setOpenView,o=e.ampm,a=e.hideTabs,l=e.dateRangeIcon,c=e.timeIcon,u=e.onChange,f=Object(s.b)(),h=Mt(),p=!a&&"undefined"!==typeof window&&window.innerHeight>667,v=Ot(t,o,u),m=v.meridiemMode,g=v.handleMeridiemChange,y="rtl"===Object(d.a)().direction;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(at,{isLandscape:!1,className:h.toolbar},Object(i.createElement)(kt.a,{container:!0,justify:"center",wrap:"nowrap"},Object(i.createElement)(kt.a,{item:!0,container:!0,xs:5,justify:"flex-start",direction:"column"},Object(i.createElement)("div",null,Object(i.createElement)(it,{variant:"subtitle1",onClick:function(){return r("year")},selected:"year"===n,label:f.getYearText(t)})),Object(i.createElement)("div",null,Object(i.createElement)(it,{variant:"h4",onClick:function(){return r("date")},selected:"date"===n,label:f.getDateTimePickerHeaderText(t)}))),Object(i.createElement)(kt.a,{item:!0,container:!0,xs:6,justify:"center",alignItems:"flex-end",direction:y?"row-reverse":"row"},Object(i.createElement)(it,{variant:"h3",onClick:function(){return r("hours")},selected:"hours"===n,label:f.getHourText(t,o)}),Object(i.createElement)(tt,{variant:"h3",label:":",className:h.separator}),Object(i.createElement)(it,{variant:"h3",onClick:function(){return r("minutes")},selected:"minutes"===n,label:f.getMinuteText(t)})),o&&Object(i.createElement)(kt.a,{item:!0,container:!0,xs:1,direction:"column",justify:"flex-end"},Object(i.createElement)(it,{variant:"subtitle1",selected:"am"===m,label:f.getMeridiemText("am"),onClick:function(){return g("am")}}),Object(i.createElement)(it,{variant:"subtitle1",selected:"pm"===m,label:f.getMeridiemText("pm"),onClick:function(){return g("pm")}})))),p&&Object(i.createElement)(Ct,{dateRangeIcon:l,timeIcon:c,view:n,onChange:r}))};function Tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var At=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(n,!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},ze,{wider:!0,orientation:"portrait",openTo:"date",views:["year","date","hours","minutes"]});function Dt(e){var t=Object(s.b)();if("portrait"!==e.orientation)throw new Error("We are not supporting custom orientation for DateTimePicker yet :(");return{getDefaultFormat:function(){return function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;return e||(t?n["12h"]:n["24h"])}(e.format,e.ampm,{"12h":t.dateTime12hFormat,"24h":t.dateTime24hFormat})}}}var Rt=bt({useOptions:Dt,Input:lt,useState:mt,DefaultToolbarComponent:Pt}),Nt=bt({useOptions:Dt,Input:pt,useState:function(e,t){var n=e.format,r=void 0===n?t.getDefaultFormat():n,o=e.inputValue,a=e.onChange,l=e.value,c=Object(s.b)(),u=ct(l,r,c,null===l,e),f=Object(i.useState)(u),d=Object(W.a)(f,2),h=d[0],p=d[1],v=o?function(e,t,n){try{return t.parse(e,n)}catch(r){return null}}(o,c,r):l;Object(i.useEffect)((function(){(null===l||c.isValid(l))&&p(u)}),[u,p,c,l]);var m=mt(yt({},e,{value:v,onChange:Object(i.useCallback)((function(e){a(e,null===e?null:c.format(e,r))}),[r,a,c])}),t),g=m.inputProps,y=m.wrapperProps,b=m.pickerProps,O=Object(i.useMemo)((function(){return yt({},g,{format:y.format,inputValue:o||h,onChange:function(e){p(e||"");var t=null===e?null:c.parse(e,y.format);a(t,e)}})}),[g,h,o,a,c,y.format]);return{inputProps:O,wrapperProps:y,pickerProps:b}},DefaultToolbarComponent:Pt,getCustomProps:function(e){return{refuse:e.ampm?/[^\dap]+/gi:/[^\d]+/gi}}});Rt.defaultProps=At,Nt.defaultProps=At},function(e,t,n){"use strict";var r=n(57),i=n(1),o=(n(11),n(64));function a(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}function s(e){var t=function(t){var n=e(t);return t.css?Object(i.a)({},Object(o.a)(n,e(Object(i.a)({theme:t.theme},t.css))),a(t.css,[e.filterProps])):t.sx?Object(i.a)({},Object(o.a)(n,e(Object(i.a)({theme:t.theme},t.sx))),a(t.sx,[e.filterProps])):n};return t.propTypes={},t.filterProps=["css","sx"].concat(Object(r.a)(e.filterProps)),t}var l=s;var c=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=function(e){return t.reduce((function(t,n){var r=n(e);return r?Object(o.a)(t,r):t}),{})};return r.propTypes={},r.filterProps=t.reduce((function(e,t){return e.concat(t.filterProps)}),[]),r},u=n(19),f=n(93);function d(e,t){return t&&"string"===typeof t?t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e):null}var h=function(e){var t=e.prop,n=e.cssProperty,r=void 0===n?e.prop:n,i=e.themeKey,o=e.transform,a=function(e){if(null==e[t])return null;var n=e[t],a=d(e.theme,i)||{};return Object(f.a)(e,n,(function(e){var t;return"function"===typeof a?t=a(e):Array.isArray(a)?t=a[e]||e:(t=d(a,e)||e,o&&(t=o(t))),!1===r?t:Object(u.a)({},r,t)}))};return a.propTypes={},a.filterProps=[t],a};function p(e){return"number"!==typeof e?e:"".concat(e,"px solid")}var v=c(h({prop:"border",themeKey:"borders",transform:p}),h({prop:"borderTop",themeKey:"borders",transform:p}),h({prop:"borderRight",themeKey:"borders",transform:p}),h({prop:"borderBottom",themeKey:"borders",transform:p}),h({prop:"borderLeft",themeKey:"borders",transform:p}),h({prop:"borderColor",themeKey:"palette"}),h({prop:"borderRadius",themeKey:"shape"})),m=c(h({prop:"displayPrint",cssProperty:!1,transform:function(e){return{"@media print":{display:e}}}}),h({prop:"display"}),h({prop:"overflow"}),h({prop:"textOverflow"}),h({prop:"visibility"}),h({prop:"whiteSpace"})),g=c(h({prop:"flexBasis"}),h({prop:"flexDirection"}),h({prop:"flexWrap"}),h({prop:"justifyContent"}),h({prop:"alignItems"}),h({prop:"alignContent"}),h({prop:"order"}),h({prop:"flex"}),h({prop:"flexGrow"}),h({prop:"flexShrink"}),h({prop:"alignSelf"}),h({prop:"justifyItems"}),h({prop:"justifySelf"})),y=c(h({prop:"gridGap"}),h({prop:"gridColumnGap"}),h({prop:"gridRowGap"}),h({prop:"gridColumn"}),h({prop:"gridRow"}),h({prop:"gridAutoFlow"}),h({prop:"gridAutoColumns"}),h({prop:"gridAutoRows"}),h({prop:"gridTemplateColumns"}),h({prop:"gridTemplateRows"}),h({prop:"gridTemplateAreas"}),h({prop:"gridArea"})),b=c(h({prop:"position"}),h({prop:"zIndex",themeKey:"zIndex"}),h({prop:"top"}),h({prop:"right"}),h({prop:"bottom"}),h({prop:"left"})),O=c(h({prop:"color",themeKey:"palette"}),h({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"})),k=h({prop:"boxShadow",themeKey:"shadows"});function w(e){return e<=1?"".concat(100*e,"%"):e}var x=h({prop:"width",transform:w}),j=h({prop:"maxWidth",transform:w}),S=h({prop:"minWidth",transform:w}),E=h({prop:"height",transform:w}),C=h({prop:"maxHeight",transform:w}),M=h({prop:"minHeight",transform:w}),P=(h({prop:"size",cssProperty:"width",transform:w}),h({prop:"size",cssProperty:"height",transform:w}),c(x,j,S,E,C,M,h({prop:"boxSizing"}))),T=n(287),A=c(h({prop:"fontFamily",themeKey:"typography"}),h({prop:"fontSize",themeKey:"typography"}),h({prop:"fontStyle",themeKey:"typography"}),h({prop:"fontWeight",themeKey:"typography"}),h({prop:"letterSpacing"}),h({prop:"lineHeight"}),h({prop:"textAlign"})),D=n(7),R=n(0),N=n.n(R),_=n(8),L=n(96),I=n.n(L),$=n(210);function z(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}var B=n(68),F=function(e){var t=function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.name,a=Object(D.a)(r,["name"]),s=o,l="function"===typeof t?function(e){return{root:function(n){return t(Object(i.a)({theme:e},n))}}}:{root:t},c=Object($.a)(l,Object(i.a)({Component:e,name:o||e.displayName,classNamePrefix:s},a));t.filterProps&&(n=t.filterProps,delete t.filterProps),t.propTypes&&(t.propTypes,delete t.propTypes);var u=N.a.forwardRef((function(t,r){var o=t.children,a=t.className,s=t.clone,l=t.component,u=Object(D.a)(t,["children","className","clone","component"]),f=c(t),d=Object(_.a)(f.root,a),h=u;if(n&&(h=z(h,n)),s)return N.a.cloneElement(o,Object(i.a)({className:Object(_.a)(o.props.className,d)},h));if("function"===typeof o)return o(Object(i.a)({className:d},h));var p=l||e;return N.a.createElement(p,Object(i.a)({ref:r,className:d},h),o)}));return I()(u,e),u}}(e);return function(e,n){return t(e,Object(i.a)({defaultTheme:B.a},n))}},W=l(c(v,m,g,y,b,O,k,P,T.b,A)),V=F("div")(W,{name:"MuiBox"});t.a=V},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(254),l=n(212),c=n(10),u=o.forwardRef((function(e,t){var n=e.disableUnderline,s=e.classes,c=e.fullWidth,u=void 0!==c&&c,f=e.inputComponent,d=void 0===f?"input":f,h=e.multiline,p=void 0!==h&&h,v=e.type,m=void 0===v?"text":v,g=Object(i.a)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return o.createElement(l.a,Object(r.a)({classes:Object(r.a)({},s,{root:Object(a.a)(s.root,!n&&s.underline),underline:null}),fullWidth:u,inputComponent:d,multiline:p,ref:t,type:m},g))}));u.muiName="Input";var f=Object(c.a)((function(e){var t="light"===e.palette.type,n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:r,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:t?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:r}},"&$focused":{backgroundColor:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(n),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:before":{borderBottom:"1px solid ".concat(e.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiFilledInput"})(u),d=n(19),h=n(38),p=n(16),v=o.forwardRef((function(e,t){e.children;var n=e.classes,s=e.className,l=e.label,c=e.labelWidth,u=e.notched,f=e.style,v=Object(i.a)(e,["children","classes","className","label","labelWidth","notched","style"]),m="rtl"===Object(h.a)().direction?"right":"left";if(void 0!==l)return o.createElement("fieldset",Object(r.a)({"aria-hidden":!0,className:Object(a.a)(n.root,s),ref:t,style:f},v),o.createElement("legend",{className:Object(a.a)(n.legendLabelled,u&&n.legendNotched)},l?o.createElement("span",null,l):o.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})));var g=c>0?.75*c+8:.01;return o.createElement("fieldset",Object(r.a)({"aria-hidden":!0,style:Object(r.a)(Object(d.a)({},"padding".concat(Object(p.a)(m)),8),f),className:Object(a.a)(n.root,s),ref:t},v),o.createElement("legend",{className:n.legend,style:{width:u?g:.01}},o.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}})))})),m=Object(c.a)((function(e){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden"},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(v),g=o.forwardRef((function(e,t){var n=e.classes,s=e.fullWidth,c=void 0!==s&&s,u=e.inputComponent,f=void 0===u?"input":u,d=e.label,h=e.labelWidth,p=void 0===h?0:h,v=e.multiline,g=void 0!==v&&v,y=e.notched,b=e.type,O=void 0===b?"text":b,k=Object(i.a)(e,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return o.createElement(l.a,Object(r.a)({renderSuffix:function(e){return o.createElement(m,{className:n.notchedOutline,label:d,labelWidth:p,notched:"undefined"!==typeof y?y:Boolean(e.startAdornment||e.filled||e.focused)})},classes:Object(r.a)({},n,{root:Object(a.a)(n.root,n.underline),notchedOutline:null}),fullWidth:c,inputComponent:f,multiline:g,ref:t,type:O},k))}));g.muiName="Input";var y=Object(c.a)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(g),b=n(284),O=n(255),k=n(257),w=n(239),x=n(29),j=n(71),S=n(156),E=(n(76),n(30)),C=n(256),M=n(27);var P=o.createContext({}),T=o.forwardRef((function(e,t){var n=e.children,s=e.classes,l=e.className,c=e.component,u=void 0===c?"ul":c,f=e.dense,d=void 0!==f&&f,h=e.disablePadding,p=void 0!==h&&h,v=e.subheader,m=Object(i.a)(e,["children","classes","className","component","dense","disablePadding","subheader"]),g=o.useMemo((function(){return{dense:d}}),[d]);return o.createElement(P.Provider,{value:g},o.createElement(u,Object(r.a)({className:Object(a.a)(s.root,l,d&&s.dense,!p&&s.padding,v&&s.subheader),ref:t},m),v,n))})),A=Object(c.a)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(T),D=n(104),R=n(24);function N(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function _(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function L(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function I(e,t,n,r,i,o){for(var a=!1,s=i(e,t,!!t&&n);s;){if(s===e.firstChild){if(a)return;a=!0}var l=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&L(s,o)&&!l)return void s.focus();s=i(e,s,n)}}var $="undefined"===typeof window?o.useEffect:o.useLayoutEffect,z=o.forwardRef((function(e,t){var n=e.actions,a=e.autoFocus,s=void 0!==a&&a,l=e.autoFocusItem,c=void 0!==l&&l,u=e.children,f=e.className,d=e.disabledItemsFocusable,h=void 0!==d&&d,p=e.disableListWrap,v=void 0!==p&&p,m=e.onKeyDown,g=e.variant,y=void 0===g?"selectedMenu":g,b=Object(i.a)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),O=o.useRef(null),k=o.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});$((function(){s&&O.current.focus()}),[s]),o.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!O.current.style.width;if(e.clientHeight<O.current.clientHeight&&n){var r="".concat(Object(D.a)(!0),"px");O.current.style["rtl"===t.direction?"paddingLeft":"paddingRight"]=r,O.current.style.width="calc(100% + ".concat(r,")")}return O.current}}}),[]);var w=o.useCallback((function(e){O.current=M.findDOMNode(e)}),[]),x=Object(R.a)(w,t),j=-1;o.Children.forEach(u,(function(e,t){o.isValidElement(e)&&(e.props.disabled||("selectedMenu"===y&&e.props.selected||-1===j)&&(j=t))}));var S=o.Children.map(u,(function(e,t){if(t===j){var n={};return c&&(n.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===y&&(n.tabIndex=0),o.cloneElement(e,n)}return e}));return o.createElement(A,Object(r.a)({role:"menu",ref:x,className:f,onKeyDown:function(e){var t=O.current,n=e.key,r=Object(E.a)(t).activeElement;if("ArrowDown"===n)e.preventDefault(),I(t,r,v,h,N);else if("ArrowUp"===n)e.preventDefault(),I(t,r,v,h,_);else if("Home"===n)e.preventDefault(),I(t,null,v,h,N);else if("End"===n)e.preventDefault(),I(t,null,v,h,_);else if(1===n.length){var i=k.current,o=n.toLowerCase(),a=performance.now();i.keys.length>0&&(a-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&o!==i.keys[0]&&(i.repeating=!1)),i.lastTime=a,i.keys.push(o);var s=r&&!i.repeating&&L(r,i);i.previousKeyMatched&&(s||I(t,r,!1,h,N,i))?e.preventDefault():i.previousKeyMatched=!1}m&&m(e)},tabIndex:s?0:-1},b),S)})),B=n(39),F={vertical:"top",horizontal:"right"},W={vertical:"top",horizontal:"left"},V=o.forwardRef((function(e,t){var n=e.autoFocus,s=void 0===n||n,l=e.children,c=e.classes,u=e.disableAutoFocusItem,f=void 0!==u&&u,d=e.MenuListProps,p=void 0===d?{}:d,v=e.onClose,m=e.onEntering,g=e.open,y=e.PaperProps,b=void 0===y?{}:y,O=e.PopoverClasses,k=e.transitionDuration,w=void 0===k?"auto":k,x=e.TransitionProps,j=(x=void 0===x?{}:x).onEntering,S=Object(i.a)(x,["onEntering"]),E=e.variant,P=void 0===E?"selectedMenu":E,T=Object(i.a)(e,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"]),A=Object(h.a)(),D=s&&!f&&g,R=o.useRef(null),N=o.useRef(null),_=-1;o.Children.map(l,(function(e,t){o.isValidElement(e)&&(e.props.disabled||("menu"!==P&&e.props.selected||-1===_)&&(_=t))}));var L=o.Children.map(l,(function(e,t){return t===_?o.cloneElement(e,{ref:function(t){N.current=M.findDOMNode(t),Object(B.a)(e.ref,t)}}):e}));return o.createElement(C.a,Object(r.a)({getContentAnchorEl:function(){return N.current},classes:O,onClose:v,TransitionProps:Object(r.a)({onEntering:function(e,t){R.current&&R.current.adjustStyleForScrollbar(e,A),m&&m(e,t),j&&j(e,t)}},S),anchorOrigin:"rtl"===A.direction?F:W,transformOrigin:"rtl"===A.direction?F:W,PaperProps:Object(r.a)({},b,{classes:Object(r.a)({},b.classes,{root:c.paper})}),open:g,ref:t,transitionDuration:w},T),o.createElement(z,Object(r.a)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),v&&v(e,"tabKeyDown"))},actions:R,autoFocus:s&&(-1===_||f),autoFocusItem:D,variant:P},p,{className:Object(a.a)(c.list,p.className)}),L))})),H=Object(c.a)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(V),Q=n(73),q=n(55);function U(e,t){return"object"===Object(j.a)(t)&&null!==t?e===t:String(e)===String(t)}var X=o.forwardRef((function(e,t){var n=e["aria-label"],s=e.autoFocus,l=e.autoWidth,c=e.children,u=e.classes,f=e.className,d=e.defaultValue,h=e.disabled,v=e.displayEmpty,m=e.IconComponent,g=e.inputRef,y=e.labelId,b=e.MenuProps,O=void 0===b?{}:b,k=e.multiple,w=e.name,j=e.onBlur,C=e.onChange,M=e.onClose,P=e.onFocus,T=e.onOpen,A=e.open,D=e.readOnly,N=e.renderValue,_=e.SelectDisplayProps,L=void 0===_?{}:_,I=e.tabIndex,$=(e.type,e.value),z=e.variant,B=void 0===z?"standard":z,F=Object(i.a)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),W=Object(q.a)({controlled:$,default:d,name:"Select"}),V=Object(x.a)(W,2),X=V[0],Y=V[1],G=o.useRef(null),K=o.useState(null),J=K[0],Z=K[1],ee=o.useRef(null!=A).current,te=o.useState(),ne=te[0],re=te[1],ie=o.useState(!1),oe=ie[0],ae=ie[1],se=Object(R.a)(t,g);o.useImperativeHandle(se,(function(){return{focus:function(){J.focus()},node:G.current,value:X}}),[J,X]),o.useEffect((function(){s&&J&&J.focus()}),[s,J]),o.useEffect((function(){if(J){var e=Object(E.a)(J).getElementById(y);if(e){var t=function(){getSelection().isCollapsed&&J.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}}),[y,J]);var le,ce,ue=function(e,t){e?T&&T(t):M&&M(t),ee||(re(l?null:J.clientWidth),ae(e))},fe=o.Children.toArray(c),de=function(e){return function(t){var n;if(k||ue(!1,t),k){n=Array.isArray(X)?X.slice():[];var r=X.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;e.props.onClick&&e.props.onClick(t),X!==n&&(Y(n),C&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:w}}),C(t,e)))}},he=null!==J&&(ee?A:oe);delete F["aria-invalid"];var pe=[],ve=!1;(Object(Q.b)({value:X})||v)&&(N?le=N(X):ve=!0);var me=fe.map((function(e){if(!o.isValidElement(e))return null;var t;if(k){if(!Array.isArray(X))throw new Error(Object(S.a)(2));(t=X.some((function(t){return U(t,e.props.value)})))&&ve&&pe.push(e.props.children)}else(t=U(X,e.props.value))&&ve&&(ce=e.props.children);return t&&!0,o.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:de(e),onKeyUp:function(t){" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));ve&&(le=k?pe.join(", "):ce);var ge,ye=ne;!l&&ee&&J&&(ye=J.clientWidth),ge="undefined"!==typeof I?I:h?null:0;var be=L.id||(w?"mui-component-select-".concat(w):void 0);return o.createElement(o.Fragment,null,o.createElement("div",Object(r.a)({className:Object(a.a)(u.root,u.select,u.selectMenu,u[B],f,h&&u.disabled),ref:Z,tabIndex:ge,role:"button","aria-disabled":h?"true":void 0,"aria-expanded":he?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[y,be].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){if(!D){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),ue(!0,e))}},onMouseDown:h||D?null:function(e){0===e.button&&(e.preventDefault(),J.focus(),ue(!0,e))},onBlur:function(e){!he&&j&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:X,name:w}}),j(e))},onFocus:P},L,{id:be}),function(e){return null==e||"string"===typeof e&&!e.trim()}(le)?o.createElement("span",{dangerouslySetInnerHTML:{__html:"&#8203;"}}):le),o.createElement("input",Object(r.a)({value:Array.isArray(X)?X.join(","):X,name:w,ref:G,"aria-hidden":!0,onChange:function(e){var t=fe.map((function(e){return e.props.value})).indexOf(e.target.value);if(-1!==t){var n=fe[t];Y(n.props.value),C&&C(e,n)}},tabIndex:-1,className:u.nativeInput,autoFocus:s},F)),o.createElement(m,{className:Object(a.a)(u.icon,u["icon".concat(Object(p.a)(B))],he&&u.iconOpen,h&&u.disabled)}),o.createElement(H,Object(r.a)({id:"menu-".concat(w||""),anchorEl:J,open:he,onClose:function(e){ue(!1,e)}},O,{MenuListProps:Object(r.a)({"aria-labelledby":y,role:"listbox",disableListWrap:!0},O.MenuListProps),PaperProps:Object(r.a)({},O.PaperProps,{style:Object(r.a)({minWidth:ye},null!=O.PaperProps?O.PaperProps.style:null)})}),me))})),Y=n(46),G=n(43),K=n(37),J=Object(K.a)(o.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Z=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.disabled,c=e.IconComponent,u=e.inputRef,f=e.variant,d=void 0===f?"standard":f,h=Object(i.a)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return o.createElement(o.Fragment,null,o.createElement("select",Object(r.a)({className:Object(a.a)(n.root,n.select,n[d],s,l&&n.disabled),disabled:l,ref:u||t},h)),e.multiple?null:o.createElement(c,{className:Object(a.a)(n.icon,n["icon".concat(Object(p.a)(d))],l&&n.disabled)}))})),ee=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",minHeight:"1.1876em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7},nativeInput:{bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%"}}},te=o.createElement(s.a,null),ne=o.forwardRef((function(e,t){var n=e.children,a=e.classes,s=e.IconComponent,l=void 0===s?J:s,c=e.input,u=void 0===c?te:c,f=e.inputProps,d=(e.variant,Object(i.a)(e,["children","classes","IconComponent","input","inputProps","variant"])),h=Object(G.a)(),p=Object(Y.a)({props:e,muiFormControl:h,states:["variant"]});return o.cloneElement(u,Object(r.a)({inputComponent:Z,inputProps:Object(r.a)({children:n,classes:a,IconComponent:l,variant:p.variant,type:void 0},f,u?u.props.inputProps:{}),ref:t},d))}));ne.muiName="Select";Object(c.a)(ee,{name:"MuiNativeSelect"})(ne);var re=ee,ie=o.createElement(s.a,null),oe=o.createElement(f,null),ae=o.forwardRef((function e(t,n){var a=t.autoWidth,s=void 0!==a&&a,l=t.children,c=t.classes,u=t.displayEmpty,f=void 0!==u&&u,d=t.IconComponent,h=void 0===d?J:d,p=t.id,v=t.input,m=t.inputProps,g=t.label,b=t.labelId,O=t.labelWidth,k=void 0===O?0:O,x=t.MenuProps,j=t.multiple,S=void 0!==j&&j,E=t.native,C=void 0!==E&&E,M=t.onClose,P=t.onOpen,T=t.open,A=t.renderValue,D=t.SelectDisplayProps,R=t.variant,N=void 0===R?"standard":R,_=Object(i.a)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),L=C?Z:X,I=Object(G.a)(),$=Object(Y.a)({props:t,muiFormControl:I,states:["variant"]}).variant||N,z=v||{standard:ie,outlined:o.createElement(y,{label:g,labelWidth:k}),filled:oe}[$];return o.cloneElement(z,Object(r.a)({inputComponent:L,inputProps:Object(r.a)({children:l,IconComponent:h,variant:$,type:void 0,multiple:S},C?{id:p}:{autoWidth:s,displayEmpty:f,labelId:b,MenuProps:x,onClose:M,onOpen:P,open:T,renderValue:A,SelectDisplayProps:Object(r.a)({id:p},D)},m,{classes:m?Object(w.a)({baseClasses:c,newClasses:m.classes,Component:e}):c},v?v.props.inputProps:{}),ref:n},_))}));ae.muiName="Select";var se=Object(c.a)(re,{name:"MuiSelect"})(ae),le={standard:s.a,filled:f,outlined:y},ce=o.forwardRef((function(e,t){var n=e.autoComplete,s=e.autoFocus,l=void 0!==s&&s,c=e.children,u=e.classes,f=e.className,d=e.color,h=void 0===d?"primary":d,p=e.defaultValue,v=e.disabled,m=void 0!==v&&v,g=e.error,y=void 0!==g&&g,w=e.FormHelperTextProps,x=e.fullWidth,j=void 0!==x&&x,S=e.helperText,E=e.hiddenLabel,C=e.id,M=e.InputLabelProps,P=e.inputProps,T=e.InputProps,A=e.inputRef,D=e.label,R=e.multiline,N=void 0!==R&&R,_=e.name,L=e.onBlur,I=e.onChange,$=e.onFocus,z=e.placeholder,B=e.required,F=void 0!==B&&B,W=e.rows,V=e.rowsMax,H=e.maxRows,Q=e.minRows,q=e.select,U=void 0!==q&&q,X=e.SelectProps,Y=e.type,G=e.value,K=e.variant,J=void 0===K?"standard":K,Z=Object(i.a)(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","maxRows","minRows","select","SelectProps","type","value","variant"]);var ee={};if("outlined"===J&&(M&&"undefined"!==typeof M.shrink&&(ee.notched=M.shrink),D)){var te,ne=null!==(te=null===M||void 0===M?void 0:M.required)&&void 0!==te?te:F;ee.label=o.createElement(o.Fragment,null,D,ne&&"\xa0*")}U&&(X&&X.native||(ee.id=void 0),ee["aria-describedby"]=void 0);var re=S&&C?"".concat(C,"-helper-text"):void 0,ie=D&&C?"".concat(C,"-label"):void 0,oe=le[J],ae=o.createElement(oe,Object(r.a)({"aria-describedby":re,autoComplete:n,autoFocus:l,defaultValue:p,fullWidth:j,multiline:N,name:_,rows:W,rowsMax:V,maxRows:H,minRows:Q,type:Y,value:G,id:C,inputRef:A,onBlur:L,onChange:I,onFocus:$,placeholder:z,inputProps:P},ee,T));return o.createElement(O.a,Object(r.a)({className:Object(a.a)(u.root,f),disabled:m,error:y,fullWidth:j,hiddenLabel:E,ref:t,required:F,color:h,variant:J},Z),D&&o.createElement(b.a,Object(r.a)({htmlFor:C,id:ie},M),D),U?o.createElement(se,Object(r.a)({"aria-describedby":re,id:C,labelId:ie,value:G,input:ae},X),c):ae,S&&o.createElement(k.a,Object(r.a)({id:re},w),S))}));t.a=Object(c.a)({root:{}},{name:"MuiTextField"})(ce)},function(e,t,n){"use strict";var r,i=n(1),o=n(7),a=n(19),s=n(0),l=(n(76),n(11),n(8)),c=n(48),u=n(67);function f(){if(r)return r;var e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),r="reverse",e.scrollLeft>0?r="default":(e.scrollLeft=1,0===e.scrollLeft&&(r="negative")),document.body.removeChild(e),r}function d(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;switch(f()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}function h(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}var p={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function v(e){var t=e.onChange,n=Object(o.a)(e,["onChange"]),r=s.useRef(),a=s.useRef(null),l=function(){r.current=a.current.offsetHeight-a.current.clientHeight};return s.useEffect((function(){var e=Object(c.a)((function(){var e=r.current;l(),e!==r.current&&t(r.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[t]),s.useEffect((function(){l(),t(r.current)}),[t]),s.createElement("div",Object(i.a)({style:p,ref:a},n))}var m=n(10),g=n(16),y=s.forwardRef((function(e,t){var n=e.classes,r=e.className,a=e.color,c=e.orientation,u=Object(o.a)(e,["classes","className","color","orientation"]);return s.createElement("span",Object(i.a)({className:Object(l.a)(n.root,n["color".concat(Object(g.a)(a))],r,"vertical"===c&&n.vertical),ref:t},u))})),b=Object(m.a)((function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}}),{name:"PrivateTabIndicator"})(y),O=n(37),k=Object(O.a)(s.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),w=Object(O.a)(s.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),x=n(87),j=s.createElement(k,{fontSize:"small"}),S=s.createElement(w,{fontSize:"small"}),E=s.forwardRef((function(e,t){var n=e.classes,r=e.className,a=e.direction,c=e.orientation,u=e.disabled,f=Object(o.a)(e,["classes","className","direction","orientation","disabled"]);return s.createElement(x.a,Object(i.a)({component:"div",className:Object(l.a)(n.root,r,u&&n.disabled,"vertical"===c&&n.vertical),ref:t,role:null,tabIndex:null},f),"left"===a?j:S)})),C=Object(m.a)({root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}},{name:"MuiTabScrollButton"})(E),M=n(31),P=n(38),T=s.forwardRef((function(e,t){var n=e["aria-label"],r=e["aria-labelledby"],p=e.action,m=e.centered,g=void 0!==m&&m,y=e.children,O=e.classes,k=e.className,w=e.component,x=void 0===w?"div":w,j=e.indicatorColor,S=void 0===j?"secondary":j,E=e.onChange,T=e.orientation,A=void 0===T?"horizontal":T,D=e.ScrollButtonComponent,R=void 0===D?C:D,N=e.scrollButtons,_=void 0===N?"auto":N,L=e.selectionFollowsFocus,I=e.TabIndicatorProps,$=void 0===I?{}:I,z=e.TabScrollButtonProps,B=e.textColor,F=void 0===B?"inherit":B,W=e.value,V=e.variant,H=void 0===V?"standard":V,Q=Object(o.a)(e,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),q=Object(P.a)(),U="scrollable"===H,X="rtl"===q.direction,Y="vertical"===A,G=Y?"scrollTop":"scrollLeft",K=Y?"top":"left",J=Y?"bottom":"right",Z=Y?"clientHeight":"clientWidth",ee=Y?"height":"width";var te=s.useState(!1),ne=te[0],re=te[1],ie=s.useState({}),oe=ie[0],ae=ie[1],se=s.useState({start:!1,end:!1}),le=se[0],ce=se[1],ue=s.useState({overflow:"hidden",marginBottom:null}),fe=ue[0],de=ue[1],he=new Map,pe=s.useRef(null),ve=s.useRef(null),me=function(){var e,t,n=pe.current;if(n){var r=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollLeftNormalized:d(n,q.direction),scrollWidth:n.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(n&&!1!==W){var i=ve.current.children;if(i.length>0){var o=i[he.get(W)];0,t=o?o.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},ge=Object(M.a)((function(){var e,t=me(),n=t.tabsMeta,r=t.tabMeta,i=0;if(r&&n)if(Y)i=r.top-n.top+n.scrollTop;else{var o=X?n.scrollLeftNormalized+n.clientWidth-n.scrollWidth:n.scrollLeft;i=r.left-n.left+o}var s=(e={},Object(a.a)(e,K,i),Object(a.a)(e,ee,r?r[ee]:0),e);if(isNaN(oe[K])||isNaN(oe[ee]))ae(s);else{var l=Math.abs(oe[K]-s[K]),c=Math.abs(oe[ee]-s[ee]);(l>=1||c>=1)&&ae(s)}})),ye=function(e){!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=r.ease,a=void 0===o?h:o,s=r.duration,l=void 0===s?300:s,c=null,u=t[e],f=!1,d=function(){f=!0},p=function r(o){if(f)i(new Error("Animation cancelled"));else{null===c&&(c=o);var s=Math.min(1,(o-c)/l);t[e]=a(s)*(n-u)+u,s>=1?requestAnimationFrame((function(){i(null)})):requestAnimationFrame(r)}};u===n?i(new Error("Element already at target position")):requestAnimationFrame(p)}(G,pe.current,e)},be=function(e){var t=pe.current[G];Y?t+=e:(t+=e*(X?-1:1),t*=X&&"reverse"===f()?-1:1),ye(t)},Oe=function(){be(-pe.current[Z])},ke=function(){be(pe.current[Z])},we=s.useCallback((function(e){de({overflow:null,marginBottom:-e})}),[]),xe=Object(M.a)((function(){var e=me(),t=e.tabsMeta,n=e.tabMeta;if(n&&t)if(n[K]<t[K]){var r=t[G]+(n[K]-t[K]);ye(r)}else if(n[J]>t[J]){var i=t[G]+(n[J]-t[J]);ye(i)}})),je=Object(M.a)((function(){if(U&&"off"!==_){var e,t,n=pe.current,r=n.scrollTop,i=n.scrollHeight,o=n.clientHeight,a=n.scrollWidth,s=n.clientWidth;if(Y)e=r>1,t=r<i-o-1;else{var l=d(pe.current,q.direction);e=X?l<a-s-1:l>1,t=X?l>1:l<a-s-1}e===le.start&&t===le.end||ce({start:e,end:t})}}));s.useEffect((function(){var e=Object(c.a)((function(){ge(),je()})),t=Object(u.a)(pe.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}),[ge,je]);var Se=s.useCallback(Object(c.a)((function(){je()})));s.useEffect((function(){return function(){Se.clear()}}),[Se]),s.useEffect((function(){re(!0)}),[]),s.useEffect((function(){ge(),je()})),s.useEffect((function(){xe()}),[xe,oe]),s.useImperativeHandle(p,(function(){return{updateIndicator:ge,updateScrollButtons:je}}),[ge,je]);var Ee=s.createElement(b,Object(i.a)({className:O.indicator,orientation:A,color:S},$,{style:Object(i.a)({},oe,$.style)})),Ce=0,Me=s.Children.map(y,(function(e){if(!s.isValidElement(e))return null;var t=void 0===e.props.value?Ce:e.props.value;he.set(t,Ce);var n=t===W;return Ce+=1,s.cloneElement(e,{fullWidth:"fullWidth"===H,indicator:n&&!ne&&Ee,selected:n,selectionFollowsFocus:L,onChange:E,textColor:F,value:t})})),Pe=function(){var e={};e.scrollbarSizeListener=U?s.createElement(v,{className:O.scrollable,onChange:we}):null;var t=le.start||le.end,n=U&&("auto"===_&&t||"desktop"===_||"on"===_);return e.scrollButtonStart=n?s.createElement(R,Object(i.a)({orientation:A,direction:X?"right":"left",onClick:Oe,disabled:!le.start,className:Object(l.a)(O.scrollButtons,"on"!==_&&O.scrollButtonsDesktop)},z)):null,e.scrollButtonEnd=n?s.createElement(R,Object(i.a)({orientation:A,direction:X?"left":"right",onClick:ke,disabled:!le.end,className:Object(l.a)(O.scrollButtons,"on"!==_&&O.scrollButtonsDesktop)},z)):null,e}();return s.createElement(x,Object(i.a)({className:Object(l.a)(O.root,k,Y&&O.vertical),ref:t},Q),Pe.scrollButtonStart,Pe.scrollbarSizeListener,s.createElement("div",{className:Object(l.a)(O.scroller,U?O.scrollable:O.fixed),style:fe,ref:pe,onScroll:Se},s.createElement("div",{"aria-label":n,"aria-labelledby":r,className:Object(l.a)(O.flexContainer,Y&&O.flexContainerVertical,g&&!U&&O.centered),onKeyDown:function(e){var t=e.target;if("tab"===t.getAttribute("role")){var n=null,r="vertical"!==A?"ArrowLeft":"ArrowUp",i="vertical"!==A?"ArrowRight":"ArrowDown";switch("vertical"!==A&&"rtl"===q.direction&&(r="ArrowRight",i="ArrowLeft"),e.key){case r:n=t.previousElementSibling||ve.current.lastChild;break;case i:n=t.nextElementSibling||ve.current.firstChild;break;case"Home":n=ve.current.firstChild;break;case"End":n=ve.current.lastChild}null!==n&&(n.focus(),e.preventDefault())}},ref:ve,role:"tablist"},Me),ne&&Ee),Pe.scrollButtonEnd)}));t.a=Object(m.a)((function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:Object(a.a)({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}}),{name:"MuiTabs"})(T)},function(e,t,n){"use strict";var r=n(7),i=n(1),o=n(0),a=(n(11),n(8)),s=n(22),l=n(10),c=n(157),u=n(37),f=Object(u.a)(o.createElement("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),d=Object(u.a)(o.createElement("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),h=Object(u.a)(o.createElement("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),p=Object(u.a)(o.createElement("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),v=Object(u.a)(o.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),m=n(159),g=n(16),y={success:o.createElement(f,{fontSize:"inherit"}),warning:o.createElement(d,{fontSize:"inherit"}),error:o.createElement(h,{fontSize:"inherit"}),info:o.createElement(p,{fontSize:"inherit"})},b=o.createElement(v,{fontSize:"small"}),O=o.forwardRef((function(e,t){var n=e.action,s=e.children,l=e.classes,u=e.className,f=e.closeText,d=void 0===f?"Close":f,h=e.color,p=e.icon,v=e.iconMapping,O=void 0===v?y:v,k=e.onClose,w=e.role,x=void 0===w?"alert":w,j=e.severity,S=void 0===j?"success":j,E=e.variant,C=void 0===E?"standard":E,M=Object(r.a)(e,["action","children","classes","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"]);return o.createElement(c.a,Object(i.a)({role:x,square:!0,elevation:0,className:Object(a.a)(l.root,l["".concat(C).concat(Object(g.a)(h||S))],u),ref:t},M),!1!==p?o.createElement("div",{className:l.icon},p||O[S]||y[S]):null,o.createElement("div",{className:l.message},s),null!=n?o.createElement("div",{className:l.action},n):null,null==n&&k?o.createElement("div",{className:l.action},o.createElement(m.a,{size:"small","aria-label":d,title:d,color:"inherit",onClick:k},b)):null)}));t.a=Object(l.a)((function(e){var t="light"===e.palette.type?s.b:s.f,n="light"===e.palette.type?s.f:s.b;return{root:Object(i.a)({},e.typography.body2,{borderRadius:e.shape.borderRadius,backgroundColor:"transparent",display:"flex",padding:"6px 16px"}),standardSuccess:{color:t(e.palette.success.main,.6),backgroundColor:n(e.palette.success.main,.9),"& $icon":{color:e.palette.success.main}},standardInfo:{color:t(e.palette.info.main,.6),backgroundColor:n(e.palette.info.main,.9),"& $icon":{color:e.palette.info.main}},standardWarning:{color:t(e.palette.warning.main,.6),backgroundColor:n(e.palette.warning.main,.9),"& $icon":{color:e.palette.warning.main}},standardError:{color:t(e.palette.error.main,.6),backgroundColor:n(e.palette.error.main,.9),"& $icon":{color:e.palette.error.main}},outlinedSuccess:{color:t(e.palette.success.main,.6),border:"1px solid ".concat(e.palette.success.main),"& $icon":{color:e.palette.success.main}},outlinedInfo:{color:t(e.palette.info.main,.6),border:"1px solid ".concat(e.palette.info.main),"& $icon":{color:e.palette.info.main}},outlinedWarning:{color:t(e.palette.warning.main,.6),border:"1px solid ".concat(e.palette.warning.main),"& $icon":{color:e.palette.warning.main}},outlinedError:{color:t(e.palette.error.main,.6),border:"1px solid ".concat(e.palette.error.main),"& $icon":{color:e.palette.error.main}},filledSuccess:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.success.main},filledInfo:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.info.main},filledWarning:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.warning.main},filledError:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.error.main},icon:{marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9},message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}}),{name:"MuiAlert"})(O)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(98),l=n(37),c=Object(l.a)(o.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),u=Object(l.a)(o.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),f=n(22),d=Object(l.a)(o.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox"),h=n(16),p=n(10),v=o.createElement(u,null),m=o.createElement(c,null),g=o.createElement(d,null),y=o.forwardRef((function(e,t){var n=e.checkedIcon,l=void 0===n?v:n,c=e.classes,u=e.color,f=void 0===u?"secondary":u,d=e.icon,p=void 0===d?m:d,y=e.indeterminate,b=void 0!==y&&y,O=e.indeterminateIcon,k=void 0===O?g:O,w=e.inputProps,x=e.size,j=void 0===x?"medium":x,S=Object(i.a)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),E=b?k:p,C=b?k:l;return o.createElement(s.a,Object(r.a)({type:"checkbox",classes:{root:Object(a.a)(c.root,c["color".concat(Object(h.a)(f))],b&&c.indeterminate),checked:c.checked,disabled:c.disabled},color:f,inputProps:Object(r.a)({"data-indeterminate":b},w),icon:o.cloneElement(E,{fontSize:void 0===E.props.fontSize&&"small"===j?j:E.props.fontSize}),checkedIcon:o.cloneElement(C,{fontSize:void 0===C.props.fontSize&&"small"===j?j:C.props.fontSize}),ref:t},S))}));t.a=Object(p.a)((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(f.a)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(f.a)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(y)},function(e,t,n){"use strict";var r=n(7),i=n(19),o=n(1),a=n(0),s=(n(11),n(8)),l=n(10),c=n(44),u=n(27),f=n(30),d=n(24),h=n(31);function p(e){return e.substring(2).toLowerCase()}var v=function(e){var t=e.children,n=e.disableReactTree,r=void 0!==n&&n,i=e.mouseEvent,o=void 0===i?"onClick":i,s=e.onClickAway,l=e.touchEvent,c=void 0===l?"onTouchEnd":l,v=a.useRef(!1),m=a.useRef(null),g=a.useRef(!1),y=a.useRef(!1);a.useEffect((function(){return setTimeout((function(){g.current=!0}),0),function(){g.current=!1}}),[]);var b=a.useCallback((function(e){m.current=u.findDOMNode(e)}),[]),O=Object(d.a)(t.ref,b),k=Object(h.a)((function(e){var t=y.current;if(y.current=!1,g.current&&m.current&&!function(e){return document.documentElement.clientWidth<e.clientX||document.documentElement.clientHeight<e.clientY}(e))if(v.current)v.current=!1;else{var n;if(e.composedPath)n=e.composedPath().indexOf(m.current)>-1;else n=!Object(f.a)(m.current).documentElement.contains(e.target)||m.current.contains(e.target);n||!r&&t||s(e)}})),w=function(e){return function(n){y.current=!0;var r=t.props[e];r&&r(n)}},x={ref:O};return!1!==c&&(x[c]=w(c)),a.useEffect((function(){if(!1!==c){var e=p(c),t=Object(f.a)(m.current),n=function(){v.current=!0};return t.addEventListener(e,k),t.addEventListener("touchmove",n),function(){t.removeEventListener(e,k),t.removeEventListener("touchmove",n)}}}),[k,c]),!1!==o&&(x[o]=w(o)),a.useEffect((function(){if(!1!==o){var e=p(o),t=Object(f.a)(m.current);return t.addEventListener(e,k),function(){t.removeEventListener(e,k)}}}),[k,o]),a.createElement(a.Fragment,null,a.cloneElement(t,x))},m=n(16),g=n(41),y=n(208),b=n(157),O=n(22),k=a.forwardRef((function(e,t){var n=e.action,i=e.classes,l=e.className,c=e.message,u=e.role,f=void 0===u?"alert":u,d=Object(r.a)(e,["action","classes","className","message","role"]);return a.createElement(b.a,Object(o.a)({role:f,square:!0,elevation:6,className:Object(s.a)(i.root,l),ref:t},d),a.createElement("div",{className:i.message},c),n?a.createElement("div",{className:i.action},n):null)})),w=Object(l.a)((function(e){var t="light"===e.palette.type?.8:.98,n=Object(O.c)(e.palette.background.default,t);return{root:Object(o.a)({},e.typography.body2,Object(i.a)({color:e.palette.getContrastText(n),backgroundColor:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:e.shape.borderRadius,flexGrow:1},e.breakpoints.up("sm"),{flexGrow:"initial",minWidth:288})),message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}}),{name:"MuiSnackbarContent"})(k),x=a.forwardRef((function(e,t){var n=e.action,i=e.anchorOrigin,l=(i=void 0===i?{vertical:"bottom",horizontal:"center"}:i).vertical,u=i.horizontal,f=e.autoHideDuration,d=void 0===f?null:f,p=e.children,b=e.classes,O=e.className,k=e.ClickAwayListenerProps,x=e.ContentProps,j=e.disableWindowBlurListener,S=void 0!==j&&j,E=e.message,C=e.onClose,M=e.onEnter,P=e.onEntered,T=e.onEntering,A=e.onExit,D=e.onExited,R=e.onExiting,N=e.onMouseEnter,_=e.onMouseLeave,L=e.open,I=e.resumeHideDuration,$=e.TransitionComponent,z=void 0===$?y.a:$,B=e.transitionDuration,F=void 0===B?{enter:c.b.enteringScreen,exit:c.b.leavingScreen}:B,W=e.TransitionProps,V=Object(r.a)(e,["action","anchorOrigin","autoHideDuration","children","classes","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onClose","onEnter","onEntered","onEntering","onExit","onExited","onExiting","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"]),H=a.useRef(),Q=a.useState(!0),q=Q[0],U=Q[1],X=Object(h.a)((function(){C&&C.apply(void 0,arguments)})),Y=Object(h.a)((function(e){C&&null!=e&&(clearTimeout(H.current),H.current=setTimeout((function(){X(null,"timeout")}),e))}));a.useEffect((function(){return L&&Y(d),function(){clearTimeout(H.current)}}),[L,d,Y]);var G=function(){clearTimeout(H.current)},K=a.useCallback((function(){null!=d&&Y(null!=I?I:.5*d)}),[d,I,Y]);return a.useEffect((function(){if(!S&&L)return window.addEventListener("focus",K),window.addEventListener("blur",G),function(){window.removeEventListener("focus",K),window.removeEventListener("blur",G)}}),[S,K,L]),!L&&q?null:a.createElement(v,Object(o.a)({onClickAway:function(e){C&&C(e,"clickaway")}},k),a.createElement("div",Object(o.a)({className:Object(s.a)(b.root,b["anchorOrigin".concat(Object(m.a)(l)).concat(Object(m.a)(u))],O),onMouseEnter:function(e){N&&N(e),G()},onMouseLeave:function(e){_&&_(e),K()},ref:t},V),a.createElement(z,Object(o.a)({appear:!0,in:L,onEnter:Object(g.a)((function(){U(!1)}),M),onEntered:P,onEntering:T,onExit:A,onExited:Object(g.a)((function(){U(!0)}),D),onExiting:R,timeout:F,direction:"top"===l?"down":"up"},W),p||a.createElement(w,Object(o.a)({message:E,action:n},x)))))}));t.a=Object(l.a)((function(e){var t={top:8},n={bottom:8},r={justifyContent:"flex-end"},a={justifyContent:"flex-start"},s={top:24},l={bottom:24},c={right:24},u={left:24},f={left:"50%",right:"auto",transform:"translateX(-50%)"};return{root:{zIndex:e.zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},anchorOriginTopCenter:Object(o.a)({},t,Object(i.a)({},e.breakpoints.up("sm"),Object(o.a)({},s,f))),anchorOriginBottomCenter:Object(o.a)({},n,Object(i.a)({},e.breakpoints.up("sm"),Object(o.a)({},l,f))),anchorOriginTopRight:Object(o.a)({},t,r,Object(i.a)({},e.breakpoints.up("sm"),Object(o.a)({left:"auto"},s,c))),anchorOriginBottomRight:Object(o.a)({},n,r,Object(i.a)({},e.breakpoints.up("sm"),Object(o.a)({left:"auto"},l,c))),anchorOriginTopLeft:Object(o.a)({},t,a,Object(i.a)({},e.breakpoints.up("sm"),Object(o.a)({right:"auto"},s,u))),anchorOriginBottomLeft:Object(o.a)({},n,a,Object(i.a)({},e.breakpoints.up("sm"),Object(o.a)({right:"auto"},l,u)))}}),{flip:!1,name:"MuiSnackbar"})(x)},function(e,t,n){"use strict";var r=n(1),i=n(89),o=n(94),a=n(78),s=n(90);var l=n(29),c=n(7),u=n(0),f=(n(76),n(11),n(8)),d=n(107),h=n(10),p=n(44),v=n(50),m=n(38),g=n(24),y=u.forwardRef((function(e,t){var n=e.children,i=e.classes,o=e.className,a=e.collapsedHeight,s=e.collapsedSize,h=void 0===s?"0px":s,y=e.component,b=void 0===y?"div":y,O=e.disableStrictModeCompat,k=void 0!==O&&O,w=e.in,x=e.onEnter,j=e.onEntered,S=e.onEntering,E=e.onExit,C=e.onExited,M=e.onExiting,P=e.style,T=e.timeout,A=void 0===T?p.b.standard:T,D=e.TransitionComponent,R=void 0===D?d.a:D,N=Object(c.a)(e,["children","classes","className","collapsedHeight","collapsedSize","component","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),_=Object(m.a)(),L=u.useRef(),I=u.useRef(null),$=u.useRef(),z="number"===typeof(a||h)?"".concat(a||h,"px"):a||h;u.useEffect((function(){return function(){clearTimeout(L.current)}}),[]);var B=_.unstable_strictMode&&!k,F=u.useRef(null),W=Object(g.a)(t,B?F:void 0),V=function(e){return function(t,n){if(e){var r=B?[F.current,t]:[t,n],i=Object(l.a)(r,2),o=i[0],a=i[1];void 0===a?e(o):e(o,a)}}},H=V((function(e,t){e.style.height=z,x&&x(e,t)})),Q=V((function(e,t){var n=I.current?I.current.clientHeight:0,r=Object(v.a)({style:P,timeout:A},{mode:"enter"}).duration;if("auto"===A){var i=_.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(i,"ms"),$.current=i}else e.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");e.style.height="".concat(n,"px"),S&&S(e,t)})),q=V((function(e,t){e.style.height="auto",j&&j(e,t)})),U=V((function(e){var t=I.current?I.current.clientHeight:0;e.style.height="".concat(t,"px"),E&&E(e)})),X=V(C),Y=V((function(e){var t=I.current?I.current.clientHeight:0,n=Object(v.a)({style:P,timeout:A},{mode:"exit"}).duration;if("auto"===A){var r=_.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(r,"ms"),$.current=r}else e.style.transitionDuration="string"===typeof n?n:"".concat(n,"ms");e.style.height=z,M&&M(e)}));return u.createElement(R,Object(r.a)({in:w,onEnter:H,onEntered:q,onEntering:Q,onExit:U,onExited:X,onExiting:Y,addEndListener:function(e,t){var n=B?e:t;"auto"===A&&(L.current=setTimeout(n,$.current||0))},nodeRef:B?F:void 0,timeout:"auto"===A?null:A},N),(function(e,t){return u.createElement(b,Object(r.a)({className:Object(f.a)(i.root,i.container,o,{entered:i.entered,exited:!w&&"0px"===z&&i.hidden}[e]),style:Object(r.a)({minHeight:z},P),ref:W},t),u.createElement("div",{className:i.wrapper,ref:I},u.createElement("div",{className:i.wrapperInner},n)))}))}));y.muiSupportAuto=!0;var b=Object(h.a)((function(e){return{root:{height:0,overflow:"hidden",transition:e.transitions.create("height")},entered:{height:"auto",overflow:"visible"},hidden:{visibility:"hidden"},wrapper:{display:"flex"},wrapperInner:{width:"100%"}}}),{name:"MuiCollapse"})(y),O=n(157),k=n(105),w=n(55),x=u.forwardRef((function(e,t){var n,d=e.children,h=e.classes,p=e.className,v=e.defaultExpanded,m=void 0!==v&&v,g=e.disabled,y=void 0!==g&&g,x=e.expanded,j=e.onChange,S=e.square,E=void 0!==S&&S,C=e.TransitionComponent,M=void 0===C?b:C,P=e.TransitionProps,T=Object(c.a)(e,["children","classes","className","defaultExpanded","disabled","expanded","onChange","square","TransitionComponent","TransitionProps"]),A=Object(w.a)({controlled:x,default:m,name:"Accordion",state:"expanded"}),D=Object(l.a)(A,2),R=D[0],N=D[1],_=u.useCallback((function(e){N(!R),j&&j(e,!R)}),[R,j,N]),L=u.Children.toArray(d),I=(n=L,Object(i.a)(n)||Object(o.a)(n)||Object(a.a)(n)||Object(s.a)()),$=I[0],z=I.slice(1),B=u.useMemo((function(){return{expanded:R,disabled:y,toggle:_}}),[R,y,_]);return u.createElement(O.a,Object(r.a)({className:Object(f.a)(h.root,p,R&&h.expanded,y&&h.disabled,!E&&h.rounded),ref:t,square:E},T),u.createElement(k.a.Provider,{value:B},$),u.createElement(M,Object(r.a)({in:R,timeout:"auto"},P),u.createElement("div",{"aria-labelledby":$.props.id,id:$.props["aria-controls"],role:"region"},z)))}));t.a=Object(h.a)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{position:"relative",transition:e.transitions.create(["margin"],t),"&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:e.palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-child":{"&:before":{display:"none"}},"&$expanded":{margin:"16px 0","&:first-child":{marginTop:0},"&:last-child":{marginBottom:0},"&:before":{opacity:0}},"&$expanded + &":{"&:before":{display:"none"}},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},rounded:{borderRadius:0,"&:first-child":{borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius},"&:last-child":{borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},expanded:{},disabled:{}}}),{name:"MuiAccordion"})(x)},function(e,t,n){"use strict";function r(e){return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(56),i=n(1),o=n(72),a=n(49),s=(n(11),n(0)),l=n.n(s),c=n(80);function u(e,t){var n=Object.create(null);return e&&s.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(s.isValidElement)(e)?t(e):e}(e)})),n}function f(e,t,n){return null!=n[t]?n[t]:e.props[t]}function d(e,t,n){var r=u(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r<i[l].length;r++){var c=i[l][r];s[i[l][r]]=n(c)}s[l]=n(l)}for(r=0;r<o.length;r++)s[o[r]]=n(o[r]);return s}(t,r);return Object.keys(i).forEach((function(o){var a=i[o];if(Object(s.isValidElement)(a)){var l=o in t,c=o in r,u=t[o],d=Object(s.isValidElement)(u)&&!u.props.in;!c||l&&!d?c||!l||d?c&&l&&Object(s.isValidElement)(u)&&(i[o]=Object(s.cloneElement)(a,{onExited:n.bind(null,a),in:u.props.in,exit:f(a,"exit",e),enter:f(a,"enter",e)})):i[o]=Object(s.cloneElement)(a,{in:!1}):i[o]=Object(s.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:f(a,"exit",e),enter:f(a,"enter",e)})}})),i}var h=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},p=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(Object(o.a)(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}Object(a.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,r=o,u(n.children,(function(e){return Object(s.cloneElement)(e,{onExited:r.bind(null,e),in:!0,appear:f(e,"appear",n),enter:f(e,"enter",n),exit:f(e,"exit",n)})}))):d(e,i,o),firstRender:!1}},n.handleExited=function(e,t){var n=u(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(i.a)({},t.children);return delete n[e.key],{children:n}})))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=Object(r.a)(e,["component","childFactory"]),o=this.state.contextValue,a=h(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?l.a.createElement(c.a.Provider,{value:o},a):l.a.createElement(c.a.Provider,{value:o},l.a.createElement(t,i,a))},t}(l.a.Component);p.propTypes={},p.defaultProps={component:"div",childFactory:function(e){return e}};t.a=p},function(e,t,n){"use strict";var r=n(1),i=n(29),o=n(7),a=n(19),s=n(0),l=n(27),c=(n(11),n(8)),u=n(209),f=n(22),d=n(10),h=n(16),p=n(208),v=n(134),m=n(155),g=n(245),y=n(41),b=n(39),O=n(24);function k(e){return"function"===typeof e?e():e}var w="undefined"!==typeof window?s.useLayoutEffect:s.useEffect,x={},j=s.forwardRef((function(e,t){var n=e.anchorEl,i=e.children,a=e.container,l=e.disablePortal,c=void 0!==l&&l,u=e.keepMounted,f=void 0!==u&&u,d=e.modifiers,h=e.open,p=e.placement,j=void 0===p?"bottom":p,S=e.popperOptions,E=void 0===S?x:S,C=e.popperRef,M=e.style,P=e.transition,T=void 0!==P&&P,A=Object(o.a)(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),D=s.useRef(null),R=Object(O.a)(D,t),N=s.useRef(null),_=Object(O.a)(N,C),L=s.useRef(_);w((function(){L.current=_}),[_]),s.useImperativeHandle(C,(function(){return N.current}),[]);var I=s.useState(!0),$=I[0],z=I[1],B=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(j,Object(m.a)()),F=s.useState(B),W=F[0],V=F[1];s.useEffect((function(){N.current&&N.current.update()}));var H=s.useCallback((function(){if(D.current&&n&&h){N.current&&(N.current.destroy(),L.current(null));var e=function(e){V(e.placement)},t=(k(n),new v.a(k(n),D.current,Object(r.a)({placement:B},E,{modifiers:Object(r.a)({},c?{}:{preventOverflow:{boundariesElement:"window"}},d,E.modifiers),onCreate:Object(y.a)(e,E.onCreate),onUpdate:Object(y.a)(e,E.onUpdate)})));L.current(t)}}),[n,c,d,h,B,E]),Q=s.useCallback((function(e){Object(b.a)(R,e),H()}),[R,H]),q=function(){N.current&&(N.current.destroy(),L.current(null))};if(s.useEffect((function(){return function(){q()}}),[]),s.useEffect((function(){h||T||q()}),[h,T]),!f&&!h&&(!T||$))return null;var U={placement:W};return T&&(U.TransitionProps={in:h,onEnter:function(){z(!1)},onExited:function(){z(!0),q()}}),s.createElement(g.a,{disablePortal:c,container:a},s.createElement("div",Object(r.a)({ref:Q,role:"tooltip"},A,{style:Object(r.a)({position:"fixed",top:0,left:0,display:h||!f||T?null:"none"},M)}),"function"===typeof i?i(U):i))})),S=n(88),E=n(66),C=n(55),M=n(38);function P(e){return Math.round(1e5*e)/1e5}var T=!1,A=null;var D=s.forwardRef((function(e,t){var n=e.arrow,a=void 0!==n&&n,f=e.children,d=e.classes,v=e.disableFocusListener,m=void 0!==v&&v,g=e.disableHoverListener,y=void 0!==g&&g,k=e.disableTouchListener,w=void 0!==k&&k,x=e.enterDelay,P=void 0===x?100:x,D=e.enterNextDelay,R=void 0===D?0:D,N=e.enterTouchDelay,_=void 0===N?700:N,L=e.id,I=e.interactive,$=void 0!==I&&I,z=e.leaveDelay,B=void 0===z?0:z,F=e.leaveTouchDelay,W=void 0===F?1500:F,V=e.onClose,H=e.onOpen,Q=e.open,q=e.placement,U=void 0===q?"bottom":q,X=e.PopperComponent,Y=void 0===X?j:X,G=e.PopperProps,K=e.title,J=e.TransitionComponent,Z=void 0===J?p.a:J,ee=e.TransitionProps,te=Object(o.a)(e,["arrow","children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"]),ne=Object(M.a)(),re=s.useState(),ie=re[0],oe=re[1],ae=s.useState(null),se=ae[0],le=ae[1],ce=s.useRef(!1),ue=s.useRef(),fe=s.useRef(),de=s.useRef(),he=s.useRef(),pe=Object(C.a)({controlled:Q,default:!1,name:"Tooltip",state:"open"}),ve=Object(i.a)(pe,2),me=ve[0],ge=ve[1],ye=me,be=Object(S.a)(L);s.useEffect((function(){return function(){clearTimeout(ue.current),clearTimeout(fe.current),clearTimeout(de.current),clearTimeout(he.current)}}),[]);var Oe=function(e){clearTimeout(A),T=!0,ge(!0),H&&H(e)},ke=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=f.props;"mouseover"===t.type&&n.onMouseOver&&e&&n.onMouseOver(t),ce.current&&"touchstart"!==t.type||(ie&&ie.removeAttribute("title"),clearTimeout(fe.current),clearTimeout(de.current),P||T&&R?(t.persist(),fe.current=setTimeout((function(){Oe(t)}),T?R:P)):Oe(t))}},we=Object(E.a)(),xe=we.isFocusVisible,je=we.onBlurVisible,Se=we.ref,Ee=s.useState(!1),Ce=Ee[0],Me=Ee[1],Pe=function(){Ce&&(Me(!1),je())},Te=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){ie||oe(t.currentTarget),xe(t)&&(Me(!0),ke()(t));var n=f.props;n.onFocus&&e&&n.onFocus(t)}},Ae=function(e){clearTimeout(A),A=setTimeout((function(){T=!1}),800+B),ge(!1),V&&V(e),clearTimeout(ue.current),ue.current=setTimeout((function(){ce.current=!1}),ne.transitions.duration.shortest)},De=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=f.props;"blur"===t.type&&(n.onBlur&&e&&n.onBlur(t),Pe()),"mouseleave"===t.type&&n.onMouseLeave&&t.currentTarget===ie&&n.onMouseLeave(t),clearTimeout(fe.current),clearTimeout(de.current),t.persist(),de.current=setTimeout((function(){Ae(t)}),B)}},Re=function(e){ce.current=!0;var t=f.props;t.onTouchStart&&t.onTouchStart(e)},Ne=Object(O.a)(oe,t),_e=Object(O.a)(Se,Ne),Le=s.useCallback((function(e){Object(b.a)(_e,l.findDOMNode(e))}),[_e]),Ie=Object(O.a)(f.ref,Le);""===K&&(ye=!1);var $e=!ye&&!y,ze=Object(r.a)({"aria-describedby":ye?be:null,title:$e&&"string"===typeof K?K:null},te,f.props,{className:Object(c.a)(te.className,f.props.className),onTouchStart:Re,ref:Ie}),Be={};w||(ze.onTouchStart=function(e){Re(e),clearTimeout(de.current),clearTimeout(ue.current),clearTimeout(he.current),e.persist(),he.current=setTimeout((function(){ke()(e)}),_)},ze.onTouchEnd=function(e){f.props.onTouchEnd&&f.props.onTouchEnd(e),clearTimeout(he.current),clearTimeout(de.current),e.persist(),de.current=setTimeout((function(){Ae(e)}),W)}),y||(ze.onMouseOver=ke(),ze.onMouseLeave=De(),$&&(Be.onMouseOver=ke(!1),Be.onMouseLeave=De(!1))),m||(ze.onFocus=Te(),ze.onBlur=De(),$&&(Be.onFocus=Te(!1),Be.onBlur=De(!1)));var Fe=s.useMemo((function(){return Object(u.a)({popperOptions:{modifiers:{arrow:{enabled:Boolean(se),element:se}}}},G)}),[se,G]);return s.createElement(s.Fragment,null,s.cloneElement(f,ze),s.createElement(Y,Object(r.a)({className:Object(c.a)(d.popper,$&&d.popperInteractive,a&&d.popperArrow),placement:U,anchorEl:ie,open:!!ie&&ye,id:ze["aria-describedby"],transition:!0},Be,Fe),(function(e){var t=e.placement,n=e.TransitionProps;return s.createElement(Z,Object(r.a)({timeout:ne.transitions.duration.shorter},n,ee),s.createElement("div",{className:Object(c.a)(d.tooltip,d["tooltipPlacement".concat(Object(h.a)(t.split("-")[0]))],ce.current&&d.touch,a&&d.tooltipArrow)},K,a?s.createElement("span",{className:d.arrow,ref:le}):null))})))}));t.a=Object(d.a)((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},popperArrow:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},tooltip:{backgroundColor:Object(f.a)(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(P(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},tooltipArrow:{position:"relative",margin:"0"},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:Object(f.a)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(P(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:Object(a.a)({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:Object(a.a)({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:Object(a.a)({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:Object(a.a)({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip",flip:!1})(D)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(11),n(8)),s=n(46),l=n(43),c=n(10),u=n(16),f=o.forwardRef((function(e,t){var n=e.children,c=e.classes,f=e.className,d=(e.color,e.component),h=void 0===d?"label":d,p=(e.disabled,e.error,e.filled,e.focused,e.required,Object(i.a)(e,["children","classes","className","color","component","disabled","error","filled","focused","required"])),v=Object(l.a)(),m=Object(s.a)({props:e,muiFormControl:v,states:["color","required","focused","disabled","error","filled"]});return o.createElement(h,Object(r.a)({className:Object(a.a)(c.root,c["color".concat(Object(u.a)(m.color||"primary"))],f,m.disabled&&c.disabled,m.error&&c.error,m.filled&&c.filled,m.focused&&c.focused,m.required&&c.required),ref:t},p),n,m.required&&o.createElement("span",{"aria-hidden":!0,className:Object(a.a)(c.asterisk,m.error&&c.error)},"\u2009","*"))})),d=Object(c.a)((function(e){return{root:Object(r.a)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}}),{name:"MuiFormLabel"})(f),h=o.forwardRef((function(e,t){var n=e.classes,c=e.className,u=e.disableAnimation,f=void 0!==u&&u,h=(e.margin,e.shrink),p=(e.variant,Object(i.a)(e,["classes","className","disableAnimation","margin","shrink","variant"])),v=Object(l.a)(),m=h;"undefined"===typeof m&&v&&(m=v.filled||v.focused||v.adornedStart);var g=Object(s.a)({props:e,muiFormControl:v,states:["margin","variant"]});return o.createElement(d,Object(r.a)({"data-shrink":m,className:Object(a.a)(n.root,c,v&&n.formControl,!f&&n.animated,m&&n.shrink,"dense"===g.margin&&n.marginDense,{filled:n.filled,outlined:n.outlined}[g.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},p))}));t.a=Object(c.a)((function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(h)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(19),a=n(0),s=(n(11),n(8)),l=n(10),c=n(16),u=n(211),f=n(262),d=a.forwardRef((function(e,t){var n=e.children,o=e.classes,l=e.className,c=e.invisible,u=void 0!==c&&c,d=e.open,h=e.transitionDuration,p=e.TransitionComponent,v=void 0===p?f.a:p,m=Object(i.a)(e,["children","classes","className","invisible","open","transitionDuration","TransitionComponent"]);return a.createElement(v,Object(r.a)({in:d,timeout:h},m),a.createElement("div",{className:Object(s.a)(o.root,l,u&&o.invisible),"aria-hidden":!0,ref:t},n))})),h=Object(l.a)({root:{zIndex:-1,position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},{name:"MuiBackdrop"})(d),p=n(44),v=n(157),m={enter:p.b.enteringScreen,exit:p.b.leavingScreen},g=a.forwardRef((function(e,t){var n=e.BackdropProps,o=e.children,l=e.classes,d=e.className,p=e.disableBackdropClick,g=void 0!==p&&p,y=e.disableEscapeKeyDown,b=void 0!==y&&y,O=e.fullScreen,k=void 0!==O&&O,w=e.fullWidth,x=void 0!==w&&w,j=e.maxWidth,S=void 0===j?"sm":j,E=e.onBackdropClick,C=e.onClose,M=e.onEnter,P=e.onEntered,T=e.onEntering,A=e.onEscapeKeyDown,D=e.onExit,R=e.onExited,N=e.onExiting,_=e.open,L=e.PaperComponent,I=void 0===L?v.a:L,$=e.PaperProps,z=void 0===$?{}:$,B=e.scroll,F=void 0===B?"paper":B,W=e.TransitionComponent,V=void 0===W?f.a:W,H=e.transitionDuration,Q=void 0===H?m:H,q=e.TransitionProps,U=e["aria-describedby"],X=e["aria-labelledby"],Y=Object(i.a)(e,["BackdropProps","children","classes","className","disableBackdropClick","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","onEnter","onEntered","onEntering","onEscapeKeyDown","onExit","onExited","onExiting","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps","aria-describedby","aria-labelledby"]),G=a.useRef();return a.createElement(u.a,Object(r.a)({className:Object(s.a)(l.root,d),BackdropComponent:h,BackdropProps:Object(r.a)({transitionDuration:Q},n),closeAfterTransition:!0},g?{disableBackdropClick:g}:{},{disableEscapeKeyDown:b,onEscapeKeyDown:A,onClose:C,open:_,ref:t},Y),a.createElement(V,Object(r.a)({appear:!0,in:_,timeout:Q,onEnter:M,onEntering:T,onEntered:P,onExit:D,onExiting:N,onExited:R,role:"none presentation"},q),a.createElement("div",{className:Object(s.a)(l.container,l["scroll".concat(Object(c.a)(F))]),onMouseUp:function(e){e.target===e.currentTarget&&e.target===G.current&&(G.current=null,E&&E(e),!g&&C&&C(e,"backdropClick"))},onMouseDown:function(e){G.current=e.target}},a.createElement(I,Object(r.a)({elevation:24,role:"dialog","aria-describedby":U,"aria-labelledby":X},z,{className:Object(s.a)(l.paper,l["paperScroll".concat(Object(c.a)(F))],l["paperWidth".concat(Object(c.a)(String(S)))],z.className,k&&l.paperFullScreen,x&&l.paperFullWidth)}),o))))}));t.a=Object(l.a)((function(e){return{root:{"@media print":{position:"absolute !important"}},scrollPaper:{display:"flex",justifyContent:"center",alignItems:"center"},scrollBody:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}},container:{height:"100%","@media print":{height:"auto"},outline:0},paper:{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},paperScrollPaper:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},paperScrollBody:{display:"inline-block",verticalAlign:"middle",textAlign:"left"},paperWidthFalse:{maxWidth:"calc(100% - 64px)"},paperWidthXs:{maxWidth:Math.max(e.breakpoints.values.xs,444),"&$paperScrollBody":Object(o.a)({},e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})},paperWidthSm:{maxWidth:e.breakpoints.values.sm,"&$paperScrollBody":Object(o.a)({},e.breakpoints.down(e.breakpoints.values.sm+64),{maxWidth:"calc(100% - 64px)"})},paperWidthMd:{maxWidth:e.breakpoints.values.md,"&$paperScrollBody":Object(o.a)({},e.breakpoints.down(e.breakpoints.values.md+64),{maxWidth:"calc(100% - 64px)"})},paperWidthLg:{maxWidth:e.breakpoints.values.lg,"&$paperScrollBody":Object(o.a)({},e.breakpoints.down(e.breakpoints.values.lg+64),{maxWidth:"calc(100% - 64px)"})},paperWidthXl:{maxWidth:e.breakpoints.values.xl,"&$paperScrollBody":Object(o.a)({},e.breakpoints.down(e.breakpoints.values.xl+64),{maxWidth:"calc(100% - 64px)"})},paperFullWidth:{width:"calc(100% - 64px)"},paperFullScreen:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,"&$paperScrollBody":{margin:0,maxWidth:"100%"}}}}),{name:"MuiDialog"})(g)},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=(n(76),n(11),n(8));function s(e,t){return void 0!==t&&void 0!==e&&(Array.isArray(t)?t.indexOf(e)>=0:e===t)}var l=n(10),c=n(16),u=o.forwardRef((function(e,t){var n=e.children,l=e.classes,u=e.className,f=e.exclusive,d=void 0!==f&&f,h=e.onChange,p=e.orientation,v=void 0===p?"horizontal":p,m=e.size,g=void 0===m?"medium":m,y=e.value,b=Object(i.a)(e,["children","classes","className","exclusive","onChange","orientation","size","value"]),O=function(e,t){if(h){var n,r=y&&y.indexOf(t);y&&r>=0?(n=y.slice()).splice(r,1):n=y?y.concat(t):[t],h(e,n)}},k=function(e,t){h&&h(e,y===t?null:t)};return o.createElement("div",Object(r.a)({role:"group",className:Object(a.a)(l.root,u,"vertical"===v&&l.vertical),ref:t},b),o.Children.map(n,(function(e){return o.isValidElement(e)?o.cloneElement(e,{className:Object(a.a)(l.grouped,l["grouped".concat(Object(c.a)(v))],e.props.className),onChange:d?k:O,selected:void 0===e.props.selected?s(e.props.value,y):e.props.selected,size:e.props.size||g}):null})))}));t.a=Object(l.a)((function(e){return{root:{display:"inline-flex",borderRadius:e.shape.borderRadius},vertical:{flexDirection:"column"},grouped:{},groupedHorizontal:{"&:not(:first-child)":{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-child)":{borderTopRightRadius:0,borderBottomRightRadius:0}},groupedVertical:{"&:not(:first-child)":{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},"&:not(:last-child)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}}),{name:"MuiToggleButtonGroup"})(u)},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(29),i=n(93),o=n(64);var a={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},l={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},c=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!l[e])return[e];e=l[e]}var t=e.split(""),n=Object(r.a)(t,2),i=n[0],o=n[1],c=a[i],u=s[o]||"";return Array.isArray(u)?u.map((function(e){return c+e})):[c+u]})),u=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function f(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function d(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function h(e){var t=f(e.theme);return Object.keys(e).map((function(n){if(-1===u.indexOf(n))return null;var r=d(c(n),t),o=e[n];return Object(i.a)(e,o,r)})).reduce(o.a,{})}h.propTypes={},h.filterProps=u;t.b=h}]]);
o
get_file.py
# -*- coding: utf-8 -*- """ @description: Download file. """ import hashlib import os import shutil import sys import tarfile import time import typing import zipfile from pathlib import Path import numpy as np import six from six.moves.urllib.error import HTTPError from six.moves.urllib.error import URLError from six.moves.urllib.request import urlretrieve class Progbar(object): """ Displays a progress bar. :param target: Total number of steps expected, None if unknown. :param width: Progress bar width on screen. :param verbose: Verbosity mode, 0 (silent), 1 (verbose), 2 (semi-verbose) :param stateful_metrics: Iterable of string names of metrics that should *not* be averaged over time. Metrics in this list will be displayed as-is. All others will be averaged by the progbar before display. :param interval: Minimum visual progress update interval (in seconds). """ def __init__( self, target, width=30, verbose=1, interval=0.05, ): """Init.""" self.target = target self.width = width self.verbose = verbose self.interval = interval self._dynamic_display = ((hasattr(sys.stdout, 'isatty') and sys.stdout.isatty() ) or 'ipykernel' in sys.modules) self._total_width = 0 self._seen_so_far = 0 self._start = time.time() self._last_update = 0 def update(self, current): """Updates the progress bar.""" self._seen_so_far = current now = time.time() info = ' - {0:.0f}s'.format(now - self._start) if self.verbose == 1: if (now - self._last_update < self.interval and self.target is not None and current < self.target): return prev_total_width = self._total_width if self._dynamic_display: sys.stdout.write('\b' * prev_total_width) sys.stdout.write('\r') else: sys.stdout.write('\n') if self.target is not None: numdigits = int(np.floor(np.log10(self.target))) + 1 bar = '{2:{0:d}d}/{1} ['.format( numdigits, self.target, current) prog = float(current) / self.target prog_width = int(self.width * prog) if prog_width > 0: bar += ('=' * (prog_width - 1)) if current < self.target: bar += '>' else: bar += '=' bar += ('.' * (self.width - prog_width)) bar += ']' else: bar = '{0:7d}/Unknown'.format(current) self._total_width = len(bar) sys.stdout.write(bar) if current: time_per_unit = (now - self._start) / current else: time_per_unit = 0 if self.target is not None and current < self.target: eta = int(time_per_unit * (self.target - current)) if eta > 3600: eta_format = ('{0:d}:{1:02d}:{2:02d}'.format( eta // 3600, (eta % 3600) // 60, eta % 60)) elif eta > 60: eta_format = '{0:d}:{1:02d}'.format(eta // 60, eta % 60) else: eta_format = '{0:d}s'.format(eta) info = ' - ETA: {0}'.format(eta_format) else: if time_per_unit >= 1: info += ' {0:.0f}s/step'.format(time_per_unit) elif time_per_unit >= 1e-3: info += ' {0:.0f}ms/step'.format(time_per_unit * 1e3) else: info += ' {0:.0f}us/step'.format(time_per_unit * 1e6) self._total_width += len(info) if prev_total_width > self._total_width: info += (' ' * (prev_total_width - self._total_width)) if self.target is not None and current >= self.target: info += '\n' sys.stdout.write(info) sys.stdout.flush() elif self.verbose == 2: if self.target is None or current >= self.target: info += '\n' sys.stdout.write(info) sys.stdout.flush() self._last_update = now def _extract_archive(file_path, path='.', archive_format='auto'): """ Extracts an archive if it matches tar, tar.gz, tar.bz, or zip formats. :param file_path: path to the archive file :param path: path to extract the archive file :param archive_format: Archive format to try for extracting the file. Options are 'auto', 'tar', 'zip', and None. 'tar' includes tar, tar.gz, and tar.bz files. The default 'auto' is ['tar', 'zip']. None or an empty list will return no matches found. :return: True if a match was found and an archive extraction was completed, False otherwise. """ if archive_format is None: return False if archive_format == 'auto': archive_format = ['tar', 'zip'] if isinstance(archive_format, six.string_types): archive_format = [archive_format] for archive_type in archive_format: if archive_type == 'tar': open_fn = tarfile.open is_match_fn = tarfile.is_tarfile if archive_type == 'zip': open_fn = zipfile.ZipFile is_match_fn = zipfile.is_zipfile if is_match_fn(file_path): with open_fn(file_path) as archive: try: archive.extractall(path) except (tarfile.TarError, RuntimeError, KeyboardInterrupt): if os.path.exists(path): if os.path.isfile(path): os.remove(path) else: shutil.rmtree(path) raise return True return False def get_file( fname: str = None, origin: str = None, untar: bool = False, extract: bool = False, md5_hash: typing.Any = None, file_hash: typing.Any = None, hash_algorithm: str = 'auto', archive_format: str = 'auto', cache_subdir: typing.Union[Path, str] = 'data', cache_dir: typing.Union[Path, str] = 'dataset', verbose: int = 1 ) -> str: """ Downloads a file from a URL if it not already in the cache. By default the file at the url `origin` is downloaded to the cache_dir `~/.project/datasets`, placed in the cache_subdir `data`, and given the filename `fname`. The final location of a file `example.txt` would therefore be `~/.project/datasets/data/example.txt`. Files in tar, tar.gz, tar.bz, and zip formats can also be extracted. Passing a hash will verify the file after download. The command line programs `shasum` and `sha256sum` can compute the hash. :param fname: Name of the file. If an absolute path `/path/to/file.txt` is specified the file will be saved at that location. :param origin: Original URL of the file. :param untar: Deprecated in favor of 'extract'. Boolean, whether the file should be decompressed. :param md5_hash: Deprecated in favor of 'file_hash'. md5 hash of the file for verification. :param file_hash: The expected hash string of the file after download. The sha256 and md5 hash algorithms are both supported. :param cache_subdir: Subdirectory under the cache dir where the file is saved. If an absolute path `/path/to/folder` is specified the file will be saved at that location. :param hash_algorithm: Select the hash algorithm to verify the file. options are 'md5', 'sha256', and 'auto'. The default 'auto' detects the hash algorithm in use. :papram extract: True tries extracting the file as an Archive, like tar or zip. :param archive_format: Archive format to try for extracting the file. Options are 'auto', 'tar', 'zip', and None. 'tar' includes tar, tar.gz, and tar.bz files. The default 'auto' is ['tar', 'zip']. None or an empty list will return no matches found. :param cache_dir: Location to store cached files, when None it defaults to the [project.USER_DATA_DIR](~/.project/datasets). :param verbose: Verbosity mode, 0 (silent), 1 (verbose), 2 (semi-verbose) :return: Path to the downloaded file. """ if md5_hash is not None and file_hash is None: file_hash = md5_hash hash_algorithm = 'md5' datadir_base = os.path.expanduser(cache_dir) if not os.access(datadir_base, os.W_OK): datadir_base = os.path.join('/tmp', '.text2vec') datadir = os.path.join(datadir_base, cache_subdir) if not os.path.exists(datadir): os.makedirs(datadir) if untar: untar_fpath = os.path.join(datadir, fname) fpath = untar_fpath + '.tar.gz' else: fpath = os.path.join(datadir, fname) download = False if os.path.exists(fpath): if file_hash is not None: if not validate_file(fpath, file_hash, algorithm=hash_algorithm): print('A local file was found, but it seems to be ' 'incomplete or outdated because the file hash ' 'does not match the original value of file_hash.' ' We will re-download the data.') download = True else: download = True if download: print('Downloading data from', origin) class
(object): progbar = None def dl_progress(count, block_size, total_size): if ProgressTracker.progbar is None: if total_size == -1: total_size = None ProgressTracker.progbar = Progbar( target=total_size, verbose=verbose) else: ProgressTracker.progbar.update(count * block_size) error_msg = 'URL fetch failure on {} : {} -- {}' try: try: urlretrieve(origin, fpath, dl_progress) except HTTPError as e: raise Exception(error_msg.format(origin, e.code, e.msg)) except URLError as e: raise Exception(error_msg.format(origin, e.errno, e.reason)) except (Exception, KeyboardInterrupt): if os.path.exists(fpath): os.remove(fpath) raise ProgressTracker.progbar = None if untar: if not os.path.exists(untar_fpath): _extract_archive(fpath, datadir, archive_format='tar') return untar_fpath if extract: _extract_archive(fpath, datadir, archive_format) return fpath def validate_file(fpath, file_hash, algorithm='auto', chunk_size=65535): """ Validates a file against a sha256 or md5 hash. :param fpath: path to the file being validated :param file_hash: The expected hash string of the file. The sha256 and md5 hash algorithms are both supported. :param algorithm: Hash algorithm, one of 'auto', 'sha256', or 'md5'. The default 'auto' detects the hash algorithm in use. :param chunk_size: Bytes to read at a time, important for large files. :return: Whether the file is valid. """ if ((algorithm == 'sha256') or (algorithm == 'auto' and len( file_hash) == 64)): hasher = 'sha256' else: hasher = 'md5' if str(hash_file(fpath, hasher, chunk_size)) == str(file_hash): return True else: return False def hash_file(fpath, algorithm='sha256', chunk_size=65535): """ Calculates a file sha256 or md5 hash. :param fpath: path to the file being validated :param algorithm: hash algorithm, one of 'auto', 'sha256', or 'md5'. The default 'auto' detects the hash algorithm in use. :param chunk_size: Bytes to read at a time, important for large files. :return: The file hash. """ if algorithm == 'sha256': hasher = hashlib.sha256() else: hasher = hashlib.md5() with open(fpath, 'rb') as fpath_file: for chunk in iter(lambda: fpath_file.read(chunk_size), b''): hasher.update(chunk) return hasher.hexdigest()
ProgressTracker
cache.py
import json from django.db.models import FieldDoesNotExist class BaseCache(object): def get(self, version): raise NotImplementedError def
(self, version, data): raise NotImplementedError def delete(self, version): raise NotImplementedError class ModelCache(object): update_value_immediately = True delete_value_immediately = False def get_specdata(self, version): if version.data: instance = version.data.get('instance', None) field = version.data.get('field', None) else: instance, field = None, None try: cache = (instance._meta.get_field('%s_cache' % field.name) if field else None) except FieldDoesNotExist: cache = None return instance, cache.name if instance and cache else (None,)*2 def update_instance(self, instance, cachefield): # do nothing if object still not in database if not instance.pk: return # call update of queryset to disable models signals queryset = instance.__class__.objects.filter(id=instance.pk) queryset.update(**{cachefield: getattr(instance, cachefield),}) def get(self, version): instance, cachefield = self.get_specdata(version) value = {} if instance and cachefield: cache = getattr(instance, cachefield, '') try: value = json.loads(cache) if cache else {} except ValueError: value = {} value = value.get(version.attrname, {}) return value def set(self, version, data): instance, cachefield = self.get_specdata(version) if instance and cachefield: cache = getattr(instance, cachefield, '') try: value = json.loads(cache) if cache else {} except ValueError: value = {} value[version.attrname] = data setattr(instance, cachefield, json.dumps(value)) if self.update_value_immediately: self.update_instance(instance, cachefield) return True def delete(self, version): instance, cachefield = self.get_specdata(version) if instance and cachefield: cache = getattr(instance, cachefield, '') try: value = json.loads(cache) if cache else {} except ValueError: value = {} value.pop(version.attrname, None) setattr(instance, cachefield, json.dumps(value) if value else '') if self.delete_value_immediately: self.update_instance(instance, cachefield)
set
packages.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v3.15.2 // source: kubeappsapis/core/packages/v1alpha1/packages.proto package v1alpha1 import ( 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) ) type GetAvailablePackagesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A cluster name can be provided if multiple clusters are configured, // otherwise the current cluster will be assumed. Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` // A namespace can be provided if the packages available for install in a // specific namespace are required. Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` } func (x *GetAvailablePackagesRequest) Reset() { *x = GetAvailablePackagesRequest{} if protoimpl.UnsafeEnabled { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetAvailablePackagesRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetAvailablePackagesRequest) ProtoMessage() {} func (x *GetAvailablePackagesRequest) ProtoReflect() protoreflect.Message { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_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 GetAvailablePackagesRequest.ProtoReflect.Descriptor instead. func (*GetAvailablePackagesRequest) Descriptor() ([]byte, []int) { return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP(), []int{0} } func (x *GetAvailablePackagesRequest) GetCluster() string { if x != nil { return x.Cluster } return "" } func (x *GetAvailablePackagesRequest) GetNamespace() string { if x != nil { return x.Namespace } return "" } // An AvailablePackage defines a package available for installation. type AvailablePackage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The fully qualified name of the package. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The version of the package in the repository. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // A url for an icon. IconUrl string `protobuf:"bytes,3,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` // An optional package repository reference where this package is located. Not // all plugins may support this back reference (eg. kapp-controller) Repository *AvailablePackage_PackageRepositoryReference `protobuf:"bytes,4,opt,name=repository,proto3" json:"repository,omitempty"` } func (x *AvailablePackage) Reset() { *x = AvailablePackage{} if protoimpl.UnsafeEnabled { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AvailablePackage) String() string { return protoimpl.X.MessageStringOf(x) } func (*AvailablePackage) ProtoMessage() {} func (x *AvailablePackage) ProtoReflect() protoreflect.Message { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[1] 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 AvailablePackage.ProtoReflect.Descriptor instead. func (*AvailablePackage) Descriptor() ([]byte, []int) { return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP(), []int{1} } func (x *AvailablePackage) GetName() string { if x != nil { return x.Name } return "" } func (x *AvailablePackage) GetVersion() string { if x != nil { return x.Version } return "" } func (x *AvailablePackage) GetIconUrl() string { if x != nil { return x.IconUrl } return "" } func (x *AvailablePackage) GetRepository() *AvailablePackage_PackageRepositoryReference { if x != nil { return x.Repository } return nil } type GetAvailablePackagesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Packages []*AvailablePackage `protobuf:"bytes,1,rep,name=packages,proto3" json:"packages,omitempty"` } func (x *GetAvailablePackagesResponse) Reset() { *x = GetAvailablePackagesResponse{} if protoimpl.UnsafeEnabled { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetAvailablePackagesResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetAvailablePackagesResponse) ProtoMessage() {} func (x *GetAvailablePackagesResponse) ProtoReflect() protoreflect.Message { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[2] 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 GetAvailablePackagesResponse.ProtoReflect.Descriptor instead. func (*GetAvailablePackagesResponse) Descriptor() ([]byte, []int) { return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP(), []int{2} } func (x *GetAvailablePackagesResponse) GetPackages() []*AvailablePackage { if x != nil { return x.Packages } return nil } type GetPackageRepositoriesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A cluster name can be provided if multiple clusters are configured, // otherwise the current cluster will be assumed. Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` // A namespace can be provided if the package repositories for a specific namespace // are requested, when supported by the packaging format. Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` } func (x *GetPackageRepositoriesRequest) Reset() { *x = GetPackageRepositoriesRequest{} if protoimpl.UnsafeEnabled { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetPackageRepositoriesRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetPackageRepositoriesRequest) ProtoMessage() {} func (x *GetPackageRepositoriesRequest) ProtoReflect() protoreflect.Message { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[3] 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 GetPackageRepositoriesRequest.ProtoReflect.Descriptor instead. func (*GetPackageRepositoriesRequest) Descriptor() ([]byte, []int) { return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP(), []int{3} } func (x *GetPackageRepositoriesRequest) GetCluster() string { if x != nil { return x.Cluster } return "" } func (x *GetPackageRepositoriesRequest) GetNamespace() string { if x != nil { return x.Namespace } return "" } // A PackageRepository defines a repository of packages for installation. type PackageRepository struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The name identifying package repository on the cluster. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // An optional namespace for namespaced package repositories. Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` // A url identifying the package repository location. Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` } func (x *PackageRepository) Reset() { *x = PackageRepository{} if protoimpl.UnsafeEnabled { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PackageRepository) String() string { return protoimpl.X.MessageStringOf(x) } func (*PackageRepository) ProtoMessage() {} func (x *PackageRepository) ProtoReflect() protoreflect.Message { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[4] 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 PackageRepository.ProtoReflect.Descriptor instead. func (*PackageRepository) Descriptor() ([]byte, []int) { return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP(), []int{4} } func (x *PackageRepository) GetName() string { if x != nil { return x.Name } return "" } func (x *PackageRepository) GetNamespace() string { if x != nil { return x.Namespace } return "" } func (x *PackageRepository) GetUrl() string { if x != nil { return x.Url } return "" } type GetPackageRepositoriesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Repositories []*PackageRepository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` } func (x *GetPackageRepositoriesResponse) Reset() { *x = GetPackageRepositoriesResponse{} if protoimpl.UnsafeEnabled { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetPackageRepositoriesResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetPackageRepositoriesResponse) ProtoMessage() {} func (x *GetPackageRepositoriesResponse) ProtoReflect() protoreflect.Message { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[5] 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 GetPackageRepositoriesResponse.ProtoReflect.Descriptor instead. func (*GetPackageRepositoriesResponse) Descriptor() ([]byte, []int) { return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP(), []int{5} } func (x *GetPackageRepositoriesResponse) GetRepositories() []*PackageRepository { if x != nil { return x.Repositories } return nil } // A PackageRepository is identified by a fully qualified name and // optionally a specific namespace. type AvailablePackage_PackageRepositoryReference struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` } func (x *AvailablePackage_PackageRepositoryReference) Reset() { *x = AvailablePackage_PackageRepositoryReference{} if protoimpl.UnsafeEnabled { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AvailablePackage_PackageRepositoryReference) String() string { return protoimpl.X.MessageStringOf(x) } func (*AvailablePackage_PackageRepositoryReference) ProtoMessage() {} func (x *AvailablePackage_PackageRepositoryReference) ProtoReflect() protoreflect.Message { mi := &file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[6] 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 AvailablePackage_PackageRepositoryReference.ProtoReflect.Descriptor instead. func (*AvailablePackage_PackageRepositoryReference) Descriptor() ([]byte, []int) { return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP(), []int{1, 0} } func (x *AvailablePackage_PackageRepositoryReference) GetName() string { if x != nil { return x.Name } return "" } func (x *AvailablePackage_PackageRepositoryReference) GetNamespace() string { if x != nil { return x.Namespace } return "" } var File_kubeappsapis_core_packages_v1alpha1_packages_proto protoreflect.FileDescriptor var file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDesc = []byte{ 0x0a, 0x32, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x55, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x10, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x70, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x50, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x1a, 0x4e, 0x0a, 0x1a, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x71, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x22, 0x57, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x57, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x7c, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x42, 0x4b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x61, 0x70, 0x70, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescOnce sync.Once file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescData = file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDesc ) func file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescGZIP() []byte { file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescOnce.Do(func() { file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescData = protoimpl.X.CompressGZIP(file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescData) }) return file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDescData } var file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_kubeappsapis_core_packages_v1alpha1_packages_proto_goTypes = []interface{}{ (*GetAvailablePackagesRequest)(nil), // 0: kubeappsapis.core.packages.v1alpha1.GetAvailablePackagesRequest (*AvailablePackage)(nil), // 1: kubeappsapis.core.packages.v1alpha1.AvailablePackage (*GetAvailablePackagesResponse)(nil), // 2: kubeappsapis.core.packages.v1alpha1.GetAvailablePackagesResponse (*GetPackageRepositoriesRequest)(nil), // 3: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoriesRequest (*PackageRepository)(nil), // 4: kubeappsapis.core.packages.v1alpha1.PackageRepository (*GetPackageRepositoriesResponse)(nil), // 5: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoriesResponse (*AvailablePackage_PackageRepositoryReference)(nil), // 6: kubeappsapis.core.packages.v1alpha1.AvailablePackage.PackageRepositoryReference } var file_kubeappsapis_core_packages_v1alpha1_packages_proto_depIdxs = []int32{ 6, // 0: kubeappsapis.core.packages.v1alpha1.AvailablePackage.repository:type_name -> kubeappsapis.core.packages.v1alpha1.AvailablePackage.PackageRepositoryReference 1, // 1: kubeappsapis.core.packages.v1alpha1.GetAvailablePackagesResponse.packages:type_name -> kubeappsapis.core.packages.v1alpha1.AvailablePackage 4, // 2: kubeappsapis.core.packages.v1alpha1.GetPackageRepositoriesResponse.repositories:type_name -> kubeappsapis.core.packages.v1alpha1.PackageRepository 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name } func init() { file_kubeappsapis_core_packages_v1alpha1_packages_proto_init() } func
() { if File_kubeappsapis_core_packages_v1alpha1_packages_proto != nil { return } if !protoimpl.UnsafeEnabled { file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAvailablePackagesRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AvailablePackage); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAvailablePackagesResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetPackageRepositoriesRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PackageRepository); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetPackageRepositoriesResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AvailablePackage_PackageRepositoryReference); 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_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDesc, NumEnums: 0, NumMessages: 7, NumExtensions: 0, NumServices: 0, }, GoTypes: file_kubeappsapis_core_packages_v1alpha1_packages_proto_goTypes, DependencyIndexes: file_kubeappsapis_core_packages_v1alpha1_packages_proto_depIdxs, MessageInfos: file_kubeappsapis_core_packages_v1alpha1_packages_proto_msgTypes, }.Build() File_kubeappsapis_core_packages_v1alpha1_packages_proto = out.File file_kubeappsapis_core_packages_v1alpha1_packages_proto_rawDesc = nil file_kubeappsapis_core_packages_v1alpha1_packages_proto_goTypes = nil file_kubeappsapis_core_packages_v1alpha1_packages_proto_depIdxs = nil }
file_kubeappsapis_core_packages_v1alpha1_packages_proto_init
sync.rs
//! Thread safe queue implementation. use crate::{inner::StreamProcessor, ProcessingError}; use tokio_sync::mpsc; pub mod bounded { //! Bounded queue. use super::*; implement!( "A clonable thread safe sink-like queue.", mpsc::Sender<Item>, mpsc::Receiver<Item>, (queue_len: usize), mpsc::channel(queue_len), mpsc::error::SendError, mpsc::error::RecvError, ); } pub mod unbounded { //! Unbounded queue. use super::*; implement!( "A clonable thread safe sink-like queue.", mpsc::UnboundedSender<Item>, mpsc::UnboundedReceiver<Item>, (), mpsc::unbounded_channel(), mpsc::error::UnboundedSendError, mpsc::error::UnboundedRecvError, ); } #[cfg(test)] mod tests { use super::bounded::*; use crate::test::try_once; use futures::{stream::iter_ok, Future, Sink, Stream}; use std::sync::mpsc::channel; use tokio::runtime::Runtime; use tokio_sync::watch; #[test] fn multithread()
}
{ let (mut unpause, rx) = watch::channel(false); let (events_sender, events_receiver) = channel(); // This "processor" will simply store all the incoming items. // But it won't complete until `unpause.broadcast(true)` is run. let rx_clone = rx.clone(); let processor = move |item: u8| { let events_sender = events_sender.clone(); rx_clone .clone() .filter(|&val| val) .into_future() .then(move |_| events_sender.send(item)) }; const CAPACITY: usize = 3; let (mut queue, driver) = LazyQueue::new(processor, CAPACITY); let mut rt = Runtime::new().unwrap(); rt.spawn(driver.map_err(|e| panic!("Error while processing a queue: {}", e))); // Fill up the queue by sending into it a CAPACITY number of items. let items = vec![0, 2, 1]; assert_eq!(CAPACITY, items.len()); // just a sanity check. queue = rt .block_on( queue .send_all(iter_ok(items.clone())) .map(|(queue, _)| queue), ) .unwrap(); // Now if we try to send anything else the call should block since the queue is already // filled up. We are sending 2 elements since the real queue's capacity might be // CAPACITY + 1. let maybe_queue = rt .block_on(try_once(queue.send_all(iter_ok(vec![9, 10])))) .unwrap(); assert!(maybe_queue.is_none()); unpause.broadcast(true).unwrap(); rt.shutdown_on_idle().wait().unwrap(); // Check that the processor has received the same items we have sent to it. assert_eq!(items, events_receiver.iter().take(3).collect::<Vec<_>>()); }
new-unicode-escapes-4.rs
pub fn
() { let s = "\u{lol}"; //~^ ERROR invalid character in unicode escape: `l` }
main
list.js
import { readdirp } from '../index.js'; const read = async (directory) => { const stream = readdirp(directory, { type: 'all' }); let i = 0; const start = Date.now();
// Check memory usage with this line. It should be 10MB or so. // Comment it out if you simply want to list files. // await new Promise(resolve => setTimeout(resolve, 500)); // if (i % 100000 === 0) // console.log(`${i}`, chunk); } console.log('finished', i, 'files in', Date.now() - start, 'ms'); // const entries = await readdirp.promise(directory, {alwaysStat: false}); // console.log('Promise done', entries.length); }; read('../..');
// eslint-disable-next-line no-unused-vars for await (const chunk of stream) { i++;
main.go
package main import ( "fmt" "io" "os" "time" ) const finalWord = "Go!" const countdownStart = 3 type Sleeper interface { Sleep() } type ConfigurableSleeper struct { duration time.Duration } func (o *ConfigurableSleeper) Sleep() { time.Sleep(o.duration) } func Countdown(out io.Writer, sleeper Sleeper) { for i := countdownStart; i > 0; i-- { sleeper.Sleep() fmt.Fprintln(out, i) } sleeper.Sleep() fmt.Fprint(out, finalWord) } func main()
{ sleeper := &ConfigurableSleeper{1 * time.Second} Countdown(os.Stdout, sleeper) }
synthetic_data.py
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.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. # ============================================================================== import os import random import numpy as np import matplotlib.pyplot as plt from mxnet.gluon.data import ArrayDataset import mxnet from .data import MetaTaskDataContainer, TaskDataContainer from .config import DEFAULT_CONFIG_SYNTHETIC class MetaTaskSynthetic(MetaTaskDataContainer): def __init__(self, config=None, weights=None, bias=None, seed=1, context=None): """ :param config: If None, DEFAULT_CONFIG_SYNTHETIC is loaded. :param weights: Tasks' weights matrix. Row k corresponds to the weight parameters of task k. If None, w is sampled from a N(0,1). :param bias: Tasks' biases vector. Row k corresponds to the bias parameters of task k. If None, w is sampled from a N(0,1). :param seed: Seed for random generator. """ if config is None: config = DEFAULT_CONFIG_SYNTHETIC self.config = config self.weights = weights self.bias = bias if context is None: context = mxnet.cpu() self.context = context self.seed = seed random.seed(self.seed) num_tasks_train = config["num_tasks_train"] num_tasks_test = config["num_tasks_test"] num_tasks_val = config["num_tasks_val"] num_tasks = num_tasks_train + num_tasks_test + num_tasks_val self.num_tasks = num_tasks self._generate_parameters() self._validate_parameters() num_examples = config["num_examples_per_task"] std_x = config["std_x"] hold_out = config["hold_out"] noise = config["std_noise"] # Generate the training/test/val dataset. # Each dataset is a list of TaskSynthetic objects (one per task) data_train = [TaskSynthetic(self.weights[t, :], self.bias[t], num_examples, std_x, noise, hold_out, context=context) for t in np.arange(0, num_tasks_train)] data_test = [TaskSynthetic(self.weights[t, :], self.bias[t], num_examples, std_x, noise, hold_out, context=context) for t in np.arange(num_tasks_train, num_tasks_train + num_tasks_test)] data_val = [TaskSynthetic(self.weights[t, :], self.bias[t], num_examples, std_x, noise, hold_out, context=context) for t in np.arange(num_tasks_train + num_tasks_test, num_tasks)] super().__init__(data_train, data_test, data_val, context=context) def plot_sample(self, root="./sample_synth"): """Plot N images from each alphabet and store the images in root.""" if self.weights.shape[1] != 2: raise ValueError("Only 2D datasets can be plot.") if not os.path.exists(root): os.makedirs(root) fig_train = self._plot([dd._train_dataset for dd in self.train_tasks], "Training Samples for Training Tasks") fig_train.savefig(os.path.join(root, "sample_train_train_tasks.png")) del fig_train fig_test = self._plot([dd._train_dataset for dd in self.test_tasks], "Training Samples for Test Tasks") fig_test.savefig(os.path.join(root, "sample_train_test_tasks.png")) del fig_test fig_val = self._plot([dd._train_dataset for dd in self.val_tasks], "Training Samples for Validation Tasks") fig_val.savefig(os.path.join(root, "sample_train_val_tasks.png")) del fig_val if self.config["hold_out"] > 0: fig_train = self._plot([dd._val_dataset for dd in self.train_tasks], "Validation Samples for Training Tasks") fig_train.savefig(os.path.join(root, "sample_val_train_tasks.png")) del fig_train fig_test = self._plot([dd._val_dataset for dd in self.test_tasks], "Validation Samples for Test Tasks") fig_test.savefig(os.path.join(root, "sample_val_test_tasks.png")) del fig_test fig_val = self._plot([dd._val_dataset for dd in self.val_tasks], "Validation Samples for Validation Tasks") fig_val.savefig(os.path.join(root, "sample_val_val_tasks.png")) del fig_val def _plot(self, data, title): """Helper function for plotting.""" num_tasks = len(data) fig, ax = plt.subplots(1, num_tasks, figsize=(num_tasks*5, 5)) fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=0.5, hspace=0.5) for mm in range(num_tasks): X, y = data[mm][:] X = X.asnumpy() y = y.asnumpy() ax[mm].scatter(X[:, 0], X[:, 1], c=y.flatten()) fig.suptitle(title, size=18) return fig def _validate_parameters(self): if self.weights.shape[0] != self.num_tasks: raise ValueError("Number of rows in w must be equal to the total number of tasks") if len(self.bias) != self.num_tasks: raise ValueError("Length of b must be equal to the total number of tasks") def
(self): if self.weights is None: dim = self.config["dim"] self.weights = self.config["global_bias"] + mxnet.nd.random_normal(shape=(self.num_tasks, dim), ctx=self.context) if self.bias is None: if self.config["task_bias"]: self.bias = mxnet.nd.random_normal(shape=self.num_tasks, ctx=self.context) else: self.bias = mxnet.nd.zeros(num_tasks, ctx=self.context) class TaskSynthetic(TaskDataContainer): """ Synthetic Task Container: Linear Regression. """ def __init__(self, w, b, num_examples, std_x, noise, hold_out=None, seed=None, context=None): """ :param w: Task's weights vector. :param b: Task's bias. :param num_examples: Total number of examples per task. :param std_x: The covariates are sampled from a zero mean normal distribution with standard deviation equal to std_x. :param hold_out: Number of examples to hold out for validation :param seed: seed for the random generator """ self.w = w self.b = b self.num_examples = num_examples self.seed = seed if context is None: context = mxnet.cpu() self.context = context if seed: random.seed(seed) if hold_out and hold_out < num_examples: Xtr, Ytr = self._real_fn(std_x * mxnet.nd.random_normal(shape=(num_examples - hold_out, len(w)), ctx=context), noise) train_dataset = ArrayDataset(Xtr, Ytr) Xval, Yval = self._real_fn(std_x * mxnet.nd.random_normal(shape=(hold_out, len(w)), ctx=context), noise) val_dataset = ArrayDataset(Xval, Yval) else: Xtr, Ytr = self._real_fn(std_x * mxnet.nd.random_normal(shape=(num_examples, len(w)), ctx=context), noise) train_dataset = ArrayDataset(Xtr, Ytr) val_dataset = None super().__init__(train_dataset, val_dataset, context=context) def _real_fn(self, X, noise): y = mxnet.nd.dot(X, mxnet.nd.expand_dims(self.w, axis=1)) + self.b if noise > 0.0: y += mxnet.nd.expand_dims(noise * mxnet.nd.random_normal(shape=(X.shape[0],)), axis=1) return X, y if __name__ == '__main__': s1 = MetaTaskSynthetic() s1.plot_sample() batch_size = 20 train_tasks = s1.train_tasks assert len(s1.train_tasks) == 3 for task in train_tasks: tr_iterator = task.get_train_iterator(batch_size) for data in tr_iterator: assert (data[0].shape == (batch_size, 2)) assert (data[1].shape == (batch_size, 1)) assert (data[1].asnumpy().dtype == np.float32) break val_iterator = task.get_val_iterator(batch_size) for data in val_iterator: assert (data[0].shape == (batch_size, 2)) assert (data[1].shape == (batch_size, 1)) assert (data[1].asnumpy().dtype == np.float32) break dim = 2 num_tasks = 15 w = mxnet.nd.random_normal(shape=(num_tasks, dim)) b = mxnet.nd.random_normal(shape=num_tasks) s2 = MetaTaskSynthetic(weights=w, bias=b) s2.plot_sample(root="./sample_synth_w_b_given") batch_size = 20 train_tasks = s2.train_tasks assert len(train_tasks) == 3 for task in train_tasks: tr_iterator = task.get_train_iterator(batch_size) for data in tr_iterator: assert (data[0].shape == (batch_size, 2)) assert (data[1].shape == (batch_size, 1)) assert (data[1].asnumpy().dtype == np.float32) break val_iterator = task.get_val_iterator(batch_size) for data in val_iterator: assert (data[0].shape == (batch_size, 2)) assert (data[1].shape == (batch_size, 1)) assert (data[1].asnumpy().dtype == np.float32) break
_generate_parameters
part_one.binary.ts
import { bench, read, split } from '@lib'; import { usingMap } from '@lib/functions'; import { max } from '@lib/math'; import { day, year } from '.';
B: '1', L: '0', R: '1', }; export const calculateSeatId = (line: string): number => parseInt(([...line] as PlanePartition[]).map(usingMap(partitionMap)).join(''), 2); export const runner = (input: string): number => split(input).map(calculateSeatId).reduce(max); // istanbul ignore next if (require.main === module) { (async () => console.log(`Result: ${await bench(read(year, day), runner)}`))(); // 848 ~0.8ms }
import { PlanePartition } from './part_one'; const partitionMap: Record<PlanePartition, '0' | '1'> = { F: '0',
transform.interceptor.ts
import { NestInterceptor, ExecutionContext, Injectable, CallHandler, } from '@nestjs/common'; import { classToPlain } from 'class-transformer'; import { map } from 'rxjs/operators'; @Injectable() export class
implements NestInterceptor { intercept(context: ExecutionContext, next: CallHandler<any>) { return next.handle().pipe(map(data => classToPlain(data))); } }
TransformInterceptor
gf2n.rs
//! Generic implementation of a finite field GF(2^n). //! //! This is based on the existence of a irreducible polynomial of the form //! `x^n + x^a + x^b + x^c + 1`, where `0 < c < b < a < n`. use crate::field::Field; use rand::distributions::{Distribution, Standard}; use rand::{CryptoRng, Rng}; use std::fmt::{Debug, Display}; use std::hash::{Hash, Hasher}; use std::ops::{Add, AddAssign, BitAnd, BitXor, BitXorAssign, Mul, MulAssign, Not, Shl, Shr, Sub}; /// Trait for words that can be used for the representation of elements of GF(2^n). pub trait Word: Copy + Eq + Hash + Debug + From<u8> + BitAnd<Output = Self> + BitXorAssign + BitXor<Output = Self> + Not<Output = Self> + Shl<usize, Output = Self> + Shr<usize, Output = Self> { /// Zero. const ZERO: Self; /// One. const ONE: Self; /// Number of bytes in the size of the type. const NBYTES: usize = std::mem::size_of::<Self>(); /// Number of bits in the size of the type. const NBITS: usize = 8 * Self::NBYTES; /// Base-2 logarithm of `NBITS`. #[cfg(test)] const MASK_BITS: usize; /// Mask with `MASK_BITS` ones at the end. #[cfg(test)] const MASK: usize = !(!1 << (Self::MASK_BITS - 1)); /// Parses a word from a byte slice. Panics if the slice length is not `NBYTES`. #[cfg(feature = "parse")] fn from_bytes(bytes: &[u8]) -> Self; } // TODO: Make this implementation generic once const generics allow it. impl Word for u128 { const ZERO: Self = 0; const ONE: Self = 1; #[cfg(test)] const MASK_BITS: usize = 7; #[cfg(feature = "parse")] fn from_bytes(bytes: &[u8]) -> Self { assert_eq!(bytes.len(), Self::NBYTES); let array: &[u8; 16] = unsafe { &*(bytes.as_ptr() as *const [u8; 16]) }; u128::from_be_bytes(*array) } } impl Word for u64 { const ZERO: Self = 0; const ONE: Self = 1; #[cfg(test)] const MASK_BITS: usize = 6; #[cfg(feature = "parse")] fn from_bytes(bytes: &[u8]) -> Self { assert_eq!(bytes.len(), Self::NBYTES); let array: &[u8; 8] = unsafe { &*(bytes.as_ptr() as *const [u8; 8]) }; u64::from_be_bytes(*array) } } impl Word for u32 { const ZERO: Self = 0; const ONE: Self = 1; #[cfg(test)] const MASK_BITS: usize = 5; #[cfg(feature = "parse")] fn from_bytes(bytes: &[u8]) -> Self { assert_eq!(bytes.len(), Self::NBYTES); let array: &[u8; 4] = unsafe { &*(bytes.as_ptr() as *const [u8; 4]) }; u32::from_be_bytes(*array) } } impl Word for u16 { const ZERO: Self = 0; const ONE: Self = 1; #[cfg(test)] const MASK_BITS: usize = 4; #[cfg(feature = "parse")] fn from_bytes(bytes: &[u8]) -> Self { assert_eq!(bytes.len(), Self::NBYTES); let array: &[u8; 2] = unsafe { &*(bytes.as_ptr() as *const [u8; 2]) }; u16::from_be_bytes(*array) } } impl Word for u8 { const ZERO: Self = 0; const ONE: Self = 1; #[cfg(test)] const MASK_BITS: usize = 3; #[cfg(feature = "parse")] fn from_bytes(bytes: &[u8]) -> Self { assert_eq!(bytes.len(), Self::NBYTES); let array: &[u8; 1] = unsafe { &*(bytes.as_ptr() as *const [u8; 1]) }; u8::from_be_bytes(*array) } } /// Implementation of a binary field GF(2^n), with `W::NBYTES * NWORDS` bits, using the /// irreducible polynomial `x^n + x^a + x^b + x^c + 1`. #[derive(Clone, Copy)] pub struct GF2n<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> { words: [W; NWORDS], } /// Finite field GF(2^8) implemented with 8-bit words and using the following irreducible /// polynomial: `x^8 + x^4 + x^3 + x + 1`. pub type GF8 = GF2n<u8, 1, 4, 3, 1>; /// Finite field GF(2^16) implemented with 16-bit words and using the following irreducible /// polynomial: `x^16 + x^5 + x^3 + x + 1`. pub type GF16 = GF2n<u16, 1, 5, 3, 1>; /// Finite field GF(2^32) implemented with 32-bit words and using the following irreducible /// polynomial: `x^32 + x^7 + x^3 + x^2 + 1`. pub type GF32 = GF2n<u32, 1, 7, 3, 2>; /// Finite field GF(2^64) implemented with 64-bit words and using the following irreducible /// polynomial: `x^64 + x^4 + x^3 + x + 1`. pub type GF64 = GF2n<u64, 1, 4, 3, 1>; /// Finite field GF(2^64) implemented with 32-bit words and using the following irreducible /// polynomial: `x^64 + x^4 + x^3 + x + 1`. #[cfg(test)] pub type GF64u32 = GF2n<u32, 2, 4, 3, 1>; /// Finite field GF(2^128) implemented with 128-bit words and using the following irreducible /// polynomial: `x^128 + x^7 + x^2 + x + 1`. #[cfg(test)] pub type GF128u128 = GF2n<u128, 1, 7, 2, 1>; /// Finite field GF(2^128) implemented with 64-bit words and using the following irreducible /// polynomial: `x^128 + x^7 + x^2 + x + 1`. pub type GF128 = GF2n<u64, 2, 7, 2, 1>; /// Finite field GF(2^128) implemented with 32-bit words and using the following irreducible /// polynomial: `x^128 + x^7 + x^2 + x + 1`. #[cfg(test)] pub type GF128u32 = GF2n<u32, 4, 7, 2, 1>; /// Finite field GF(2^256) implemented with 128-bit words and using the following irreducible /// polynomial: `x^256 + x^10 + x^5 + x^2 + 1`. #[cfg(test)] pub type GF256u128 = GF2n<u128, 2, 10, 5, 2>; /// Finite field GF(2^256) implemented with 64-bit words and using the following irreducible /// polynomial: `x^256 + x^10 + x^5 + x^2 + 1`. pub type GF256 = GF2n<u64, 4, 10, 5, 2>; /// Finite field GF(2^256) implemented with 32-bit words and using the following irreducible /// polynomial: `x^256 + x^10 + x^5 + x^2 + 1`. #[cfg(test)] pub type GF256u32 = GF2n<u32, 8, 10, 5, 2>; /// Finite field GF(2^192) implemented with 64-bit words and using the following irreducible /// polynomial: `x^192 + x^7 + x^2 + x + 1`. pub type GF192 = GF2n<u64, 3, 7, 2, 1>; /// Finite field GF(2^384) implemented with 64-bit words and using the following irreducible /// polynomial: `x^384 + x^12 + x^3 + x^2 + 1`. pub type GF384 = GF2n<u64, 6, 12, 3, 2>; /// Finite field GF(2^512) implemented with 64-bit words and using the following irreducible /// polynomial: `x^512 + x^8 + x^5 + x^2 + 1`. pub type GF512 = GF2n<u64, 8, 8, 5, 2>; /// Finite field GF(2^768) implemented with 64-bit words and using the following irreducible /// polynomial: `x^768 + x^19 + x^17 + x^4 + 1`. pub type GF768 = GF2n<u64, 12, 19, 17, 4>; /// Finite field GF(2^1024) implemented with 64-bit words and using the following irreducible /// polynomial: `x^1024 + x^19 + x^6 + x + 1`. pub type GF1024 = GF2n<u64, 16, 19, 6, 1>; /// Finite field GF(2^1536) implemented with 64-bit words and using the following irreducible /// polynomial: `x^1536 + x^21 + x^6 + x^2 + 1`. pub type GF1536 = GF2n<u64, 24, 21, 6, 2>; /// Finite field GF(2^2048) implemented with 64-bit words and using the following irreducible /// polynomial: `x^2048 + x^19 + x^14 + x^13 + 1`. pub type GF2048 = GF2n<u64, 32, 19, 14, 13>; impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Debug for GF2n<W, NWORDS, A, B, C> { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { match W::NBITS { 8 => f.write_fmt(format_args!("{:02x?}", &self.words as &[W])), 16 => f.write_fmt(format_args!("{:04x?}", &self.words as &[W])), 32 => f.write_fmt(format_args!("{:08x?}", &self.words as &[W])), 64 => f.write_fmt(format_args!("{:016x?}", &self.words as &[W])), 128 => f.write_fmt(format_args!("{:032x?}", &self.words as &[W])), _ => f.write_fmt(format_args!("{:x?}", &self.words as &[W])), } } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Display for GF2n<W, NWORDS, A, B, C> { fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { for d in &self.words as &[W] { match W::NBITS { 8 => f.write_fmt(format_args!("{:02x?}", d))?, 16 => f.write_fmt(format_args!("{:04x?}", d))?, 32 => f.write_fmt(format_args!("{:08x?}", d))?, 64 => f.write_fmt(format_args!("{:016x?}", d))?, 128 => f.write_fmt(format_args!("{:032x?}", d))?, _ => unimplemented!(), } } Ok(()) } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> PartialEq for GF2n<W, NWORDS, A, B, C> { fn eq(&self, other: &Self) -> bool { &self.words as &[W] == &other.words as &[W] } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Eq for GF2n<W, NWORDS, A, B, C> { } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Hash for GF2n<W, NWORDS, A, B, C> { fn hash<H: Hasher>(&self, state: &mut H) { (&self.words as &[W]).hash(state) } } trait FieldExt { type W; } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> FieldExt for GF2n<W, NWORDS, A, B, C> { type W = W; } #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] fn mul_clmul_u64<const NWORDS: usize, const A: usize, const B: usize, const C: usize>( x: &GF2n<u64, NWORDS, A, B, C>, y: &GF2n<u64, NWORDS, A, B, C>, ) -> GF2n<u64, NWORDS, A, B, C> { use core::arch::x86_64::{__m128i, _mm_clmulepi64_si128, _mm_set_epi64x, _mm_storeu_si128}; // Note: we cannot create an array of `NWORDS * 2` elements: // error: constant expression depends on a generic parameter let mut words = [0u64; NWORDS]; let mut carry = [0u64; NWORDS]; for i in 0..NWORDS { // Safety: target_feature "sse2" is available in this function. let xi: __m128i = unsafe { _mm_set_epi64x(0, x.words[i] as i64) }; for j in 0..NWORDS { // Safety: target_feature "sse2" is available in this function. let yj: __m128i = unsafe { _mm_set_epi64x(0, y.words[j] as i64) }; // Safety: target_feature "pclmulqdq" is available in this function. let clmul: __m128i = unsafe { _mm_clmulepi64_si128(xi, yj, 0) }; let mut cc: [u64; 2] = [0u64, 0u64]; // Safety: // - target_feature "sse2" is available in this function, // - cc points to 128 bits (no alignment required by this function). unsafe { _mm_storeu_si128(&mut cc as *mut _ as *mut __m128i, clmul) }; let ij = i + j; if ij < NWORDS { words[ij] ^= cc[0]; } else { carry[ij - NWORDS] ^= cc[0]; } let ij1 = ij + 1; if ij1 < NWORDS { words[ij1] ^= cc[1]; } else { carry[ij1 - NWORDS] ^= cc[1]; } } } GF2n::<u64, NWORDS, A, B, C>::propagate_carries(words, carry) } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> GF2n<W, NWORDS, A, B, C> { #[cfg(test)] const NWORDS: usize = NWORDS; const NBITS: usize = W::NBITS * NWORDS; #[cfg(feature = "parse")] const NBYTES: usize = W::NBYTES * NWORDS; #[cfg(test)] pub const fn new(words: [W; NWORDS]) -> Self { Self { words } } const fn new_small(word: W) -> Self { let mut words = [W::ZERO; NWORDS]; words[0] = word; Self { words } } #[cfg(test)] fn get_nonzero_test_values() -> Vec<Self> { let all_ones = [!W::ZERO; NWORDS]; let all_zeros = [W::ZERO; NWORDS]; let mut values = Vec::new(); values.push(Self::new(all_ones)); for i in 0..W::NBITS { let word = W::ONE << i; for j in 0..NWORDS { let mut words = all_zeros; words[j] ^= word; values.push(Self::new(words)); let mut words = all_ones; words[j] ^= word; values.push(Self::new(words)); } } values } #[cfg(test)] fn get_test_values() -> Vec<Self> { let mut values = Self::get_nonzero_test_values(); values.push(Self::new([W::ZERO; NWORDS])); values } #[cfg(test)] fn xn(n: usize) -> Self { debug_assert!(n < Self::NBITS); let mut words = [W::ZERO; NWORDS]; words[n >> W::MASK_BITS] = W::ONE << (n & W::MASK); Self { words } } #[cfg(test)] fn get_bit(&self, bit: usize) -> bool { debug_assert!(bit < Self::NBITS); (self.words[bit >> W::MASK_BITS] >> (bit & W::MASK)) & W::ONE != W::ZERO } #[cfg(test)] fn shl1_ret(mut self) -> Self { self.shl1(); self } #[cfg(test)] fn shl_word_ret(mut self, word: usize) -> Self { self.shl_word(word); self } #[cfg(test)] fn shlt_ret(mut self) -> Self { self.shlt(); self } fn shl1(&mut self) { let mut carry = W::ZERO; for i in 0..NWORDS { let d = self.words[i]; self.words[i] = (d << 1) ^ carry; carry = d >> (W::NBITS - 1); } if carry != W::ZERO { self.words[0] ^= W::ONE ^ (W::ONE << A) ^ (W::ONE << B) ^ (W::ONE << C); } } #[cfg(test)] fn shl_word(&mut self, shift: usize) { debug_assert!(shift != 0 && shift < W::NBITS); if NWORDS == 1
else { let mut carry = W::ZERO; for i in 0..NWORDS { let d = self.words[i]; self.words[i] = (d << shift) ^ carry; carry = d >> (W::NBITS - shift); } self.words[0] ^= carry ^ (carry << A) ^ (carry << B) ^ (carry << C); self.words[1] ^= (carry >> (W::NBITS - A)) ^ (carry >> (W::NBITS - B)) ^ (carry >> (W::NBITS - C)); } } #[cfg(test)] fn shlt(&mut self) { if NWORDS == 1 { let mut carry = self.words[0]; self.words[0] = W::ZERO; while carry != W::ZERO { self.words[0] ^= carry ^ (carry << A) ^ (carry << B) ^ (carry << C); carry = (carry >> (W::NBITS - A)) ^ (carry >> (W::NBITS - B)) ^ (carry >> (W::NBITS - C)); } } else { let carry = self.words[NWORDS - 1]; for i in (1..NWORDS).rev() { self.words[i] = self.words[i - 1]; } self.words[0] = carry ^ (carry << A) ^ (carry << B) ^ (carry << C); self.words[1] ^= (carry >> (W::NBITS - A)) ^ (carry >> (W::NBITS - B)) ^ (carry >> (W::NBITS - C)); } } fn mul_as_add(mut self, other: &Self) -> Self { let mut result = Self { words: [W::ZERO; NWORDS], }; for &word in &other.words as &[W] { for i in 0..W::NBITS { if word & (W::ONE << i) != W::ZERO { result += &self; } self.shl1(); } } result } #[cfg(test)] fn mul_fused_carry(&self, other: &Self) -> Self { // Note: we cannot create an array of `NWORDS * 2` elements: // error: constant expression depends on a generic parameter let mut words = [W::ZERO; NWORDS]; let mut carry = [W::ZERO; NWORDS]; for i in 0..NWORDS { let word = other.words[i]; for j in 0..W::NBITS { if word & (W::ONE << j) != W::ZERO { for k in 0..NWORDS { let d = self.words[k] << j; let ki = k + i; if ki < NWORDS { words[ki] ^= d; } else { carry[ki - NWORDS] ^= d; } if j != 0 { let c = self.words[k] >> (W::NBITS - j); let kic = ki + 1; if kic < NWORDS { words[kic] ^= c; } else { carry[kic - NWORDS] ^= c; } } } } } } Self::propagate_carries(words, carry) } #[cfg(any( test, all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ) ))] fn propagate_carries(mut words: [W; NWORDS], carry: [W; NWORDS]) -> Self { if NWORDS == 1 { let mut c = carry[0]; while c != W::ZERO { words[0] ^= c ^ (c << A) ^ (c << B) ^ (c << C); c = (c >> (W::NBITS - A)) ^ (c >> (W::NBITS - B)) ^ (c >> (W::NBITS - C)); } } else { for i in 0..NWORDS { let c = carry[i]; words[i] ^= c ^ (c << A) ^ (c << B) ^ (c << C); if i + 1 < NWORDS { words[i + 1] ^= (c >> (W::NBITS - A)) ^ (c >> (W::NBITS - B)) ^ (c >> (W::NBITS - C)); } else { let c = (c >> (W::NBITS - A)) ^ (c >> (W::NBITS - B)) ^ (c >> (W::NBITS - C)); words[0] ^= c ^ (c << A) ^ (c << B) ^ (c << C); words[1] ^= (c >> (W::NBITS - A)) ^ (c >> (W::NBITS - B)) ^ (c >> (W::NBITS - C)); } } } Self { words } } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Field for GF2n<W, NWORDS, A, B, C> where Standard: Distribution<W>, { const ZERO: Self = Self::new_small(W::ZERO); const ONE: Self = Self::new_small(W::ONE); fn uniform<R: Rng + CryptoRng + ?Sized>(rng: &mut R) -> Self { let mut words = [W::ZERO; NWORDS]; for word in &mut words as &mut [W] { *word = rng.gen(); } Self { words } } fn invert(mut self) -> Self { // Compute x^(2^n - 2) let mut result = Self::ONE; for _ in 1..Self::NBITS { self = self * &self; result *= &self; } result } fn from_diff(lhs: u8, rhs: u8) -> Self { Self::from(lhs ^ rhs) } #[cfg(feature = "parse")] fn from_bytes(bytes: &[u8]) -> Option<Self> { if bytes.len() != Self::NBYTES { return None; } let mut words = [W::ZERO; NWORDS]; for (i, word) in words.iter_mut().enumerate() { *word = W::from_bytes(&bytes[i * W::NBYTES..(i + 1) * W::NBYTES]); } Some(Self { words }) } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> From<u8> for GF2n<W, NWORDS, A, B, C> { fn from(word: u8) -> Self { let mut words = [W::ZERO; NWORDS]; words[0] = W::from(word); Self { words } } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Add for GF2n<W, NWORDS, A, B, C> { type Output = Self; #[allow(clippy::suspicious_arithmetic_impl)] #[allow(clippy::needless_range_loop)] fn add(self, other: Self) -> Self { let mut words = [W::ZERO; NWORDS]; for i in 0..NWORDS { words[i] = self.words[i] ^ other.words[i]; } Self { words } } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> AddAssign<&Self> for GF2n<W, NWORDS, A, B, C> { #[allow(clippy::suspicious_op_assign_impl)] fn add_assign(&mut self, other: &Self) { for i in 0..NWORDS { self.words[i] ^= other.words[i]; } } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Sub for GF2n<W, NWORDS, A, B, C> { type Output = Self; #[allow(clippy::suspicious_arithmetic_impl)] fn sub(self, other: Self) -> Self { self + other } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Mul<&Self> for GF2n<W, NWORDS, A, B, C> { type Output = Self; fn mul(self, other: &Self) -> Self { #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] if W::NBITS == 64 { // Safety: W == u64 when NBITS == 64. let x: &GF2n<u64, NWORDS, A, B, C> = unsafe { std::mem::transmute(&self) }; // Safety: W == u64 when NBITS == 64. let y: &GF2n<u64, NWORDS, A, B, C> = unsafe { std::mem::transmute(other) }; let tmp: GF2n<u64, NWORDS, A, B, C> = mul_clmul_u64(x, y); // Safety: W == u64 when NBITS == 64. let result: &Self = unsafe { std::mem::transmute(&tmp) }; return *result; } self.mul_as_add(other) } } impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> MulAssign<&Self> for GF2n<W, NWORDS, A, B, C> { fn mul_assign(&mut self, other: &Self) { *self = *self * other; } } #[cfg(test)] impl<W: Word, const NWORDS: usize, const A: usize, const B: usize, const C: usize> Shl<usize> for GF2n<W, NWORDS, A, B, C> { type Output = Self; fn shl(mut self, mut shift: usize) -> Self { debug_assert!(shift < Self::NBITS); while shift >= W::NBITS { self.shlt(); shift -= W::NBITS; } if shift != 0 { self.shl_word(shift) } self } } #[cfg(test)] mod test { macro_rules! for_field { ( $mod:ident, $field:ident, $($tests:tt)* ) => { mod $mod { type F = super::super::$field; $($tests)* } } } macro_rules! for_all { ( $($tests:tt)* ) => { for_field!(gf008, GF8, $($tests)*); for_field!(gf016, GF16, $($tests)*); for_field!(gf032, GF32, $($tests)*); for_field!(gf064, GF64, $($tests)*); for_field!(gf064u32, GF64u32, $($tests)*); for_field!(gf128, GF128, $($tests)*); for_field!(gf128u32, GF128u32, $($tests)*); for_field!(gf128u128, GF128u128, $($tests)*); for_field!(gf256, GF256, $($tests)*); for_field!(gf256u32, GF256u32, $($tests)*); for_field!(gf256u128, GF256u128, $($tests)*); for_field!(gf512, GF512, $($tests)*); for_field!(gf1024, GF1024, $($tests)*); for_field!(gf2048, GF2048, $($tests)*); }; } macro_rules! for_all_fast { ( $($tests:tt)* ) => { #[cfg(not(debug_assertions))] for_field!(fast_gf008, GF8, $($tests)*); #[cfg(not(debug_assertions))] for_field!(fast_gf016, GF16, $($tests)*); #[cfg(not(debug_assertions))] for_field!(fast_gf032, GF32, $($tests)*); #[cfg(not(debug_assertions))] for_field!(fast_gf064, GF64, $($tests)*); #[cfg(not(debug_assertions))] for_field!(fast_gf128, GF128, $($tests)*); #[cfg(not(debug_assertions))] for_field!(fast_gf256, GF256, $($tests)*); }; } macro_rules! for_all_clmul { ( $($tests:tt)* ) => { #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] for_field!(clmul_gf064, GF64, $($tests)*); #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] for_field!(clmul_gf128, GF128, $($tests)*); #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] for_field!(clmul_gf256, GF256, $($tests)*); #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] for_field!(clmul_gf512, GF512, $($tests)*); #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] for_field!(clmul_gf1024, GF1024, $($tests)*); #[cfg(all( feature = "clmul", target_arch = "x86_64", target_feature = "sse2", target_feature = "pclmulqdq" ))] for_field!(clmul_gf2048, GF2048, $($tests)*); }; } for_all! { use crate::field::Field; use super::super::Word; type W = <F as super::super::FieldExt>::W; #[test] fn get_bit() { for i in 0..F::NBITS { let xi = F::xn(i); for j in 0..F::NBITS { assert_eq!(xi.get_bit(j), i == j); } } } #[test] fn from_diff() { for i in 0..=255 { for j in 0..=255 { assert_eq!(F::from_diff(i, j), F::from(i) - F::from(j)); } } } #[cfg(not(debug_assertions))] #[test] fn add_is_associative() { let values = F::get_test_values(); for &x in &values { for &y in &values { for &z in &values { assert_eq!((x + y) + z, x + (y + z)); } } } } #[test] fn add_is_commutative() { let values = F::get_test_values(); for &x in &values { for &y in &values { assert_eq!(x + y, y + x); } } } #[test] fn add_by_zero() { let values = F::get_test_values(); for &x in &values { assert_eq!(x + F::ZERO, x); assert_eq!(F::ZERO + x, x); } } #[cfg(not(debug_assertions))] #[test] fn mul_is_commutative() { let values = F::get_test_values(); for &x in &values { for &y in &values { assert_eq!(x * &y, y * &x); } } } #[test] fn mul_by_zero() { let values = F::get_test_values(); for &x in &values { assert_eq!(x * &F::ZERO, F::ZERO); assert_eq!(F::ZERO * &x, F::ZERO); } } #[test] fn mul_by_one_left() { let values = F::get_test_values(); for &x in &values { assert_eq!(F::ONE * &x, x); } } #[test] fn mul_by_one_right() { let values = F::get_test_values(); for &x in &values { assert_eq!(x * &F::ONE, x); } } #[test] fn mul_by_xn_left() { let values = F::get_test_values(); for i in 0..F::NBITS { let xi = F::xn(i); for &x in &values { assert_eq!(xi * &x, x << i); } } } #[test] fn mul_by_xn_right() { let values = F::get_test_values(); for i in 0..F::NBITS { let xi = F::xn(i); for &x in &values { assert_eq!(x * &xi, x << i); } } } #[cfg(not(debug_assertions))] #[test] fn mul_self_invert() { let values = F::get_nonzero_test_values(); for &x in &values { let inv = x.invert(); assert_eq!(x * &inv, F::ONE); assert_eq!(inv * &x, F::ONE); } } #[test] fn mul_as_add_is_mul_fused_carry() { let values = F::get_test_values(); for &x in &values { for &y in &values { assert_eq!(x.mul_as_add(&y), x.mul_fused_carry(&y)); } } } #[test] fn shl1_is_shl_word_1() { let values = F::get_test_values(); for &x in &values { assert_eq!(x.shl1_ret(), x.shl_word_ret(1)); } } #[test] fn shl_word_from_shl1() { for x in F::get_test_values() { let mut y = x; for shift in 1..W::NBITS { y.shl1(); assert_eq!(y, x.shl_word_ret(shift)); } } } #[test] fn shlt_from_shl1() { let values = F::get_test_values(); for &x in &values { let mut y = x; for _ in 0..W::NBITS { y.shl1(); } assert_eq!(y, x.shlt_ret()); } } #[test] fn shl_from_shl1() { let values = F::get_test_values(); for &x in &values { let mut y = x; for shift in 0..F::NBITS { assert_eq!(y, x << shift); y.shl1(); } } } use test::Bencher; const TEST_VALUE: F = F::new([!W::ZERO; F::NWORDS]); #[bench] fn bench_mul(b: &mut Bencher) { let x = TEST_VALUE; let y = TEST_VALUE; b.iter(|| x * &y); } #[bench] fn bench_mul_as_add(b: &mut Bencher) { let x = TEST_VALUE; let y = TEST_VALUE; b.iter(|| x.mul_as_add(&y)); } #[bench] fn bench_mul_fused_carry(b: &mut Bencher) { let x = TEST_VALUE; let y = TEST_VALUE; b.iter(|| x.mul_fused_carry(&y)); } #[bench] fn bench_invert(b: &mut Bencher) { let x = TEST_VALUE; b.iter(|| x.invert()); } #[bench] fn bench_shl1(b: &mut Bencher) { let x = TEST_VALUE; b.iter(|| x.shl1_ret()); } #[bench] fn bench_shlt(b: &mut Bencher) { let x = TEST_VALUE; b.iter(|| x.shlt_ret()); } } for_all_fast! { #[test] fn mul_is_associative() { let values = F::get_test_values(); for &x in &values { for &y in &values { for &z in &values { assert_eq!((x * &y) * &z, x * &(y * &z)); } } } } #[test] fn mul_is_distributive() { let values = F::get_test_values(); for &x in &values { for &y in &values { for &z in &values { assert_eq!(x * &(y + z), x * &y + x * &z); } } } } } for_all_clmul! { use super::super::Word; type W = <F as super::super::FieldExt>::W; #[test] fn mul_as_add_is_mul_clmul() { let values = F::get_test_values(); for &x in &values { for &y in &values { assert_eq!(x.mul_as_add(&y), super::super::mul_clmul_u64(&x, &y)); } } } use test::Bencher; const TEST_VALUE: F = F::new([!W::ZERO; F::NWORDS]); #[bench] fn bench_mul_clmul(b: &mut Bencher) { let x = TEST_VALUE; let y = TEST_VALUE; b.iter(|| super::super::mul_clmul_u64(&x, &y)); } } }
{ let d = self.words[0]; self.words[0] = d << shift; let mut carry = d >> (W::NBITS - shift); while carry != W::ZERO { self.words[0] ^= carry ^ (carry << A) ^ (carry << B) ^ (carry << C); carry = (carry >> (W::NBITS - A)) ^ (carry >> (W::NBITS - B)) ^ (carry >> (W::NBITS - C)); } }
UpdateChannelClassCommand.ts
import { MediaLiveClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaLiveClient"; import { UpdateChannelClassRequest, UpdateChannelClassResponse } from "../models/models_1"; import { deserializeAws_restJson1UpdateChannelClassCommand, serializeAws_restJson1UpdateChannelClassCommand, } from "../protocols/Aws_restJson1"; import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { FinalizeHandlerArguments, Handler, HandlerExecutionContext, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, SerdeContext as __SerdeContext, } from "@aws-sdk/types"; export type UpdateChannelClassCommandInput = UpdateChannelClassRequest; export type UpdateChannelClassCommandOutput = UpdateChannelClassResponse & __MetadataBearer; /** * Changes the class of the channel. */ export class
extends $Command< UpdateChannelClassCommandInput, UpdateChannelClassCommandOutput, MediaLiveClientResolvedConfig > { // Start section: command_properties // End section: command_properties constructor(readonly input: UpdateChannelClassCommandInput) { // Start section: command_constructor super(); // End section: command_constructor } /** * @internal */ resolveMiddleware( clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: MediaLiveClientResolvedConfig, options?: __HttpHandlerOptions ): Handler<UpdateChannelClassCommandInput, UpdateChannelClassCommandOutput> { this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "MediaLiveClient"; const commandName = "UpdateChannelClassCommand"; const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: UpdateChannelClassRequest.filterSensitiveLog, outputFilterSensitiveLog: UpdateChannelClassResponse.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); } private serialize(input: UpdateChannelClassCommandInput, context: __SerdeContext): Promise<__HttpRequest> { return serializeAws_restJson1UpdateChannelClassCommand(input, context); } private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateChannelClassCommandOutput> { return deserializeAws_restJson1UpdateChannelClassCommand(output, context); } // Start section: command_body_extra // End section: command_body_extra }
UpdateChannelClassCommand
solution_test.go
package solution220 import "testing" func TestContainsNearbyAlmostDuplicate(t *testing.T) { tests := []struct { name string nums []int k int t int want bool }{ {"test 1", []int{1, 2, 3, 1}, 3, 0, true}, {"test 2", []int{1, 0, 1, 1}, 1, 2, true}, {"test 3", []int{1, 5, 9, 1, 5, 9}, 2, 3, false}, } for _, tt := range tests {
t.Errorf("containsNearbyAlmostDuplicate() = %t, want %t", got, tt.want) } }) } }
tt := tt t.Run(tt.name, func(t *testing.T) { if got := containsNearbyAlmostDuplicate(tt.nums, tt.k, tt.t); got != tt.want {
oidc_endpoint_manager.go
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. package requests import ( "context" "fmt" "github.com/AzureAD/microsoft-authentication-library-for-go/internal/msalbase" ) type openIDConfigurationEndpointManager interface { getOpenIDConfigurationEndpoint(ctx context.Context, authorityInfo msalbase.AuthorityInfo, userPrincipalName string) (string, error) } type aadOpenIDConfigurationEndpointManager struct { aadInstanceDiscovery *AadInstanceDiscovery } func createAadOpenIDConfigurationEndpointManager(aadInstanceDiscovery *AadInstanceDiscovery) openIDConfigurationEndpointManager { m := &aadOpenIDConfigurationEndpointManager{aadInstanceDiscovery} return m } var aadTrustedHostList = map[string]bool{ "login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list "login.chinacloudapi.cn": true, // Microsoft Azure China "login.microsoftonline.de": true, // Microsoft Azure Blackforest "login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy "login.microsoftonline.us": true, // Microsoft Azure US Government "login.microsoftonline.com": true, // Microsoft Azure Worldwide "login.cloudgovapi.us": true, // Microsoft Azure US Government } //IsInTrustedHostList checks if an AAD host is trusted/valid func IsInTrustedHostList(host string) bool { if _, ok := aadTrustedHostList[host]; ok { return true } return false } func (m *aadOpenIDConfigurationEndpointManager) getOpenIDConfigurationEndpoint(ctx context.Context, authorityInfo msalbase.AuthorityInfo, userPrincipalName string) (string, error) { if authorityInfo.ValidateAuthority && !IsInTrustedHostList(authorityInfo.Host)
return authorityInfo.CanonicalAuthorityURI + "v2.0/.well-known/openid-configuration", nil } func createOpenIDConfigurationEndpointManager(authorityInfo msalbase.AuthorityInfo) (openIDConfigurationEndpointManager, error) { if authorityInfo.AuthorityType == msalbase.MSSTS { return &aadOpenIDConfigurationEndpointManager{}, nil } return nil, fmt.Errorf("unsupported authority type(%v) for createOpenIdConfigurationEndpointManager", authorityInfo.AuthorityType) }
{ discoveryResponse, err := m.aadInstanceDiscovery.GetMetadataEntry(ctx, authorityInfo) if err != nil { return "", err } return discoveryResponse.TenantDiscoveryEndpoint, nil }
mdnrnn_gym.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. """ Learn a world model on gym environments """ import argparse import json import logging import sys from typing import Dict, Optional import ml.rl.types as rlt import numpy as np import torch from ml.rl.evaluation.world_model_evaluator import ( FeatureImportanceEvaluator, FeatureSensitivityEvaluator, ) from ml.rl.json_serialize import json_to_object from ml.rl.models.mdn_rnn import MDNRNNMemoryPool from ml.rl.models.world_model import MemoryNetwork from ml.rl.parameters import MDNRNNParameters, OpenAiGymParameters, OpenAiRunDetails from ml.rl.test.gym.open_ai_gym_environment import ( EnvType, ModelType, OpenAIGymEnvironment, ) from ml.rl.test.gym.run_gym import dict_to_np, get_possible_actions from ml.rl.training.rl_dataset import RLDataset from ml.rl.training.world_model.mdnrnn_trainer import MDNRNNTrainer logger = logging.getLogger(__name__) def loss_to_num(losses): return {k: v.item() for k, v in losses.items()} def multi_step_sample_generator( gym_env: OpenAIGymEnvironment, num_transitions: int, max_steps: Optional[int], multi_steps: int, include_shorter_samples_at_start: bool, include_shorter_samples_at_end: bool, ): """ Convert gym env multi-step sample format to mdn-rnn multi-step sample format :param gym_env: The environment used to generate multi-step samples :param num_transitions: # of samples to return :param max_steps: An episode terminates when the horizon is beyond max_steps :param multi_steps: # of steps of states and actions per sample :param include_shorter_samples_at_start: Whether to keep samples of shorter steps which are generated at the beginning of an episode :param include_shorter_samples_at_end: Whether to keep samples of shorter steps which are generated at the end of an episode """ samples = gym_env.generate_random_samples( num_transitions=num_transitions, use_continuous_action=True, max_step=max_steps, multi_steps=multi_steps, include_shorter_samples_at_start=include_shorter_samples_at_start, include_shorter_samples_at_end=include_shorter_samples_at_end, ) for j in range(num_transitions): sample_steps = len(samples.terminals[j]) # type: ignore state = dict_to_np(samples.states[j], np_size=gym_env.state_dim, key_offset=0) action = dict_to_np( samples.actions[j], np_size=gym_env.action_dim, key_offset=gym_env.state_dim ) next_actions = np.float32( # type: ignore [ dict_to_np( samples.next_actions[j][k], np_size=gym_env.action_dim, key_offset=gym_env.state_dim, ) for k in range(sample_steps) ] ) next_states = np.float32( # type: ignore [ dict_to_np( samples.next_states[j][k], np_size=gym_env.state_dim, key_offset=0 ) for k in range(sample_steps) ] ) rewards = np.float32(samples.rewards[j]) # type: ignore terminals = np.float32(samples.terminals[j]) # type: ignore not_terminals = np.logical_not(terminals) ordered_states = np.vstack((state, next_states)) ordered_actions = np.vstack((action, next_actions)) mdnrnn_states = ordered_states[:-1] mdnrnn_actions = ordered_actions[:-1] mdnrnn_next_states = ordered_states[-multi_steps:] mdnrnn_next_actions = ordered_actions[-multi_steps:] # Padding zeros so that all samples have equal steps # The general rule is to pad zeros at the end of sequences. # In addition, if the sequence only has one step (i.e., the # first state of an episode), pad one zero row ahead of the # sequence, which enables embedding generated properly for # one-step samples num_padded_top_rows = 1 if multi_steps > 1 and sample_steps == 1 else 0 num_padded_bottom_rows = multi_steps - sample_steps - num_padded_top_rows sample_steps_next = len(mdnrnn_next_states) num_padded_top_rows_next = 0 num_padded_bottom_rows_next = multi_steps - sample_steps_next yield ( np.pad( mdnrnn_states, ((num_padded_top_rows, num_padded_bottom_rows), (0, 0)), "constant", constant_values=0.0, ), np.pad( mdnrnn_actions, ((num_padded_top_rows, num_padded_bottom_rows), (0, 0)), "constant", constant_values=0.0, ), np.pad( rewards, ((num_padded_top_rows, num_padded_bottom_rows)), "constant", constant_values=0.0, ), np.pad( mdnrnn_next_states, ((num_padded_top_rows_next, num_padded_bottom_rows_next), (0, 0)), "constant", constant_values=0.0, ), np.pad( mdnrnn_next_actions, ((num_padded_top_rows_next, num_padded_bottom_rows_next), (0, 0)), "constant", constant_values=0.0, ), np.pad( not_terminals, ((num_padded_top_rows, num_padded_bottom_rows)), "constant", constant_values=0.0, ), sample_steps, sample_steps_next, ) def get_replay_buffer( num_episodes: int, seq_len: int, max_step: int, gym_env: OpenAIGymEnvironment ) -> MDNRNNMemoryPool: num_transitions = num_episodes * max_step replay_buffer = MDNRNNMemoryPool(max_replay_memory_size=num_transitions) for ( mdnrnn_state, mdnrnn_action, rewards, next_states, _, not_terminals, _, _, ) in multi_step_sample_generator( gym_env, num_transitions=num_transitions, max_steps=max_step, multi_steps=seq_len, include_shorter_samples_at_start=False, include_shorter_samples_at_end=False, ): mdnrnn_state, mdnrnn_action, next_states, rewards, not_terminals = ( torch.tensor(mdnrnn_state), torch.tensor(mdnrnn_action), torch.tensor(next_states), torch.tensor(rewards), torch.tensor(not_terminals), ) replay_buffer.insert_into_memory( mdnrnn_state, mdnrnn_action, next_states, rewards, not_terminals ) return replay_buffer def main(args): parser = argparse.ArgumentParser( description="Train a Mixture-Density-Network RNN net to learn an OpenAI" " Gym environment, i.e., predict next state, reward, and" " terminal signal using current state and action" ) parser.add_argument("-p", "--parameters", help="Path to JSON parameters file.") parser.add_argument( "-g", "--gpu_id", help="If set, will use GPU with specified ID. Otherwise will use CPU.", default=-1, ) parser.add_argument( "-l", "--log_level", choices=["debug", "info", "warning", "error", "critical"], help="If set, use logging level specified (debug, info, warning, error, " "critical). Else defaults to info.", default="info", ) parser.add_argument( "-f", "--feature_importance", action="store_true", help="If set, feature importance will be calculated after the training", ) parser.add_argument( "-s", "--feature_sensitivity", action="store_true", help="If set, state feature sensitivity by varying actions will be" " calculated after the training", ) parser.add_argument( "-e", "--save_embedding_to_path", help="If a file path is provided, save a RLDataset with states embedded" " by the trained world model", ) args = parser.parse_args(args) logger.setLevel(getattr(logging, args.log_level.upper())) with open(args.parameters, "r") as f: params = json_to_object(f.read(), OpenAiGymParameters) if args.gpu_id != -1: params = params._replace(use_gpu=True) mdnrnn_gym( params, args.feature_importance, args.feature_sensitivity, args.save_embedding_to_path, ) def mdnrnn_gym( params: OpenAiGymParameters, feature_importance: bool = False, feature_sensitivity: bool = False, save_embedding_to_path: Optional[str] = None, seed: Optional[int] = None, ): assert params.mdnrnn is not None use_gpu = params.use_gpu logger.info("Running gym with params") logger.info(params) env_type = params.env env = OpenAIGymEnvironment( env_type, epsilon=1.0, softmax_policy=True, gamma=0.99, random_seed=seed ) # create test data once assert params.run_details.max_steps is not None test_replay_buffer = get_replay_buffer( params.run_details.num_test_episodes, params.run_details.seq_len, params.run_details.max_steps, env, ) test_batch = test_replay_buffer.sample_memories( test_replay_buffer.memory_size, use_gpu=use_gpu, batch_first=True ) trainer = create_trainer(params, env, use_gpu) _, _, trainer = train_sgd( env, trainer, use_gpu, "{} test run".format(env_type), params.mdnrnn.minibatch_size, params.run_details, test_batch=test_batch, ) feature_importance_map, feature_sensitivity_map, dataset = None, None, None if feature_importance: feature_importance_map = calculate_feature_importance( env, trainer, use_gpu, params.run_details, test_batch=test_batch ) if feature_sensitivity: feature_sensitivity_map = calculate_feature_sensitivity_by_actions( env, trainer, use_gpu, params.run_details, test_batch=test_batch ) if save_embedding_to_path: dataset = RLDataset(save_embedding_to_path) create_embed_rl_dataset(env, trainer, dataset, use_gpu, params.run_details) dataset.save() return env, trainer, feature_importance_map, feature_sensitivity_map, dataset def calculate_feature_importance( gym_env: OpenAIGymEnvironment, trainer: MDNRNNTrainer, use_gpu: bool, run_details: OpenAiRunDetails, test_batch: rlt.PreprocessedTrainingBatch, ): assert run_details.max_steps is not None assert run_details.num_test_episodes is not None assert run_details.seq_len is not None feature_importance_evaluator = FeatureImportanceEvaluator( trainer, discrete_action=gym_env.action_type == EnvType.DISCRETE_ACTION, state_feature_num=gym_env.state_dim, action_feature_num=gym_env.action_dim, sorted_action_feature_start_indices=list(range(gym_env.action_dim)), sorted_state_feature_start_indices=list(range(gym_env.state_dim)), ) feature_loss_vector = feature_importance_evaluator.evaluate(test_batch)[ "feature_loss_increase" ] feature_importance_map = {} for i in range(gym_env.action_dim): print( "action {}, feature importance: {}".format(i, feature_loss_vector[i].item()) ) feature_importance_map[f"action{i}"] = feature_loss_vector[i].item() for i in range(gym_env.state_dim): print( "state {}, feature importance: {}".format( i, feature_loss_vector[i + gym_env.action_dim].item() ) ) feature_importance_map[f"state{i}"] = feature_loss_vector[ i + gym_env.action_dim ].item() return feature_importance_map def create_embed_rl_dataset( gym_env: OpenAIGymEnvironment, trainer: MDNRNNTrainer, dataset: RLDataset, use_gpu: bool, run_details: OpenAiRunDetails, ): assert run_details.max_steps is not None old_mdnrnn_mode = trainer.mdnrnn.mdnrnn.training trainer.mdnrnn.mdnrnn.eval() num_transitions = run_details.num_state_embed_episodes * run_details.max_steps device = torch.device("cuda") if use_gpu else torch.device("cpu") # type: ignore ( state_batch, action_batch, reward_batch, next_state_batch, next_action_batch, not_terminal_batch, step_batch, next_step_batch, ) = map( list, zip( *multi_step_sample_generator( gym_env=gym_env, num_transitions=num_transitions, max_steps=run_details.max_steps, # +1 because MDNRNN embeds the first seq_len steps and then # the embedded state will be concatenated with the last step multi_steps=run_details.seq_len + 1, include_shorter_samples_at_start=True, include_shorter_samples_at_end=False, ) ), ) def concat_batch(batch): return torch.cat( [ torch.tensor( np.expand_dims(x, axis=1), dtype=torch.float, device=device ) for x in batch ], dim=1, ) # shape: seq_len x batch_size x feature_dim mdnrnn_state = concat_batch(state_batch) next_mdnrnn_state = concat_batch(next_state_batch) mdnrnn_action = concat_batch(action_batch) next_mdnrnn_action = concat_batch(next_action_batch) mdnrnn_input = rlt.PreprocessedStateAction.from_tensors( state=mdnrnn_state, action=mdnrnn_action ) next_mdnrnn_input = rlt.PreprocessedStateAction.from_tensors( state=next_mdnrnn_state, action=next_mdnrnn_action ) # batch-compute state embedding mdnrnn_output = trainer.mdnrnn(mdnrnn_input) next_mdnrnn_output = trainer.mdnrnn(next_mdnrnn_input) for i in range(len(state_batch)): # Embed the state as the hidden layer's output # until the previous step + current state hidden_idx = 0 if step_batch[i] == 1 else step_batch[i] - 2 # type: ignore next_hidden_idx = next_step_batch[i] - 2 # type: ignore hidden_embed = ( mdnrnn_output.all_steps_lstm_hidden[hidden_idx, i, :] .squeeze() .detach() .cpu() ) state_embed = torch.cat( (hidden_embed, torch.tensor(state_batch[i][hidden_idx + 1])) # type: ignore ) next_hidden_embed = ( next_mdnrnn_output.all_steps_lstm_hidden[next_hidden_idx, i, :] .squeeze() .detach() .cpu() ) next_state_embed = torch.cat( ( next_hidden_embed, torch.tensor(next_state_batch[i][next_hidden_idx + 1]), # type: ignore ) ) logger.debug( "create_embed_rl_dataset:\nstate batch\n{}\naction batch\n{}\nlast " "action: {},reward: {}\nstate embed {}\nnext state embed {}\n".format( state_batch[i][: hidden_idx + 1], # type: ignore action_batch[i][: hidden_idx + 1], # type: ignore action_batch[i][hidden_idx + 1], # type: ignore reward_batch[i][hidden_idx + 1], # type: ignore state_embed, next_state_embed, ) ) terminal = 1 - not_terminal_batch[i][hidden_idx + 1] # type: ignore possible_actions, possible_actions_mask = get_possible_actions( gym_env, ModelType.PYTORCH_PARAMETRIC_DQN.value, False ) possible_next_actions, possible_next_actions_mask = get_possible_actions( gym_env, ModelType.PYTORCH_PARAMETRIC_DQN.value, terminal ) dataset.insert( state=state_embed, action=torch.tensor(action_batch[i][hidden_idx + 1]), # type: ignore reward=float(reward_batch[i][hidden_idx + 1]), # type: ignore next_state=next_state_embed, next_action=torch.tensor( next_action_batch[i][next_hidden_idx + 1] # type: ignore ), terminal=torch.tensor(terminal), possible_next_actions=possible_next_actions, possible_next_actions_mask=possible_next_actions_mask, time_diff=torch.tensor(1), possible_actions=possible_actions, possible_actions_mask=possible_actions_mask, policy_id=0, ) logger.info( "Insert {} transitions into a state embed dataset".format(len(state_batch)) ) trainer.mdnrnn.mdnrnn.train(old_mdnrnn_mode) return dataset def calculate_feature_sensitivity_by_actions( gym_env: OpenAIGymEnvironment, trainer: MDNRNNTrainer, use_gpu: bool, run_details: OpenAiRunDetails, test_batch: rlt.PreprocessedTrainingBatch, seq_len: int = 5, num_test_episodes: int = 100, ): assert run_details.max_steps is not None feature_sensitivity_evaluator = FeatureSensitivityEvaluator( trainer, state_feature_num=gym_env.state_dim, sorted_state_feature_start_indices=list(range(gym_env.state_dim)), ) feature_sensitivity_vector = feature_sensitivity_evaluator.evaluate(test_batch)[ "feature_sensitivity" ] feature_sensitivity_map = {} for i in range(gym_env.state_dim): feature_sensitivity_map["state" + str(i)] = feature_sensitivity_vector[i].item() print( "state {}, feature sensitivity: {}".format( i, feature_sensitivity_vector[i].item() ) ) return feature_sensitivity_map def
( gym_env: OpenAIGymEnvironment, trainer: MDNRNNTrainer, use_gpu: bool, test_run_name: str, minibatch_size: int, run_details: OpenAiRunDetails, test_batch: rlt.PreprocessedTrainingBatch, ): assert run_details.max_steps is not None train_replay_buffer = get_replay_buffer( run_details.num_train_episodes, run_details.seq_len, run_details.max_steps, gym_env, ) valid_replay_buffer = get_replay_buffer( run_details.num_test_episodes, run_details.seq_len, run_details.max_steps, gym_env, ) valid_batch = valid_replay_buffer.sample_memories( valid_replay_buffer.memory_size, use_gpu=use_gpu, batch_first=True ) valid_loss_history = [] num_batch_per_epoch = train_replay_buffer.memory_size // minibatch_size logger.info( "Collected data {} transitions.\n" "Training will take {} epochs, with each epoch having {} mini-batches" " and each mini-batch having {} samples".format( train_replay_buffer.memory_size, run_details.train_epochs, num_batch_per_epoch, minibatch_size, ) ) for i_epoch in range(run_details.train_epochs): for i_batch in range(num_batch_per_epoch): training_batch = train_replay_buffer.sample_memories( minibatch_size, use_gpu=use_gpu, batch_first=True ) losses = trainer.train(training_batch, batch_first=True) logger.info( "{}-th epoch, {}-th minibatch: \n" "loss={}, bce={}, gmm={}, mse={} \n" "cum loss={}, cum bce={}, cum gmm={}, cum mse={}\n".format( i_epoch, i_batch, losses["loss"], losses["bce"], losses["gmm"], losses["mse"], np.mean(trainer.cum_loss), np.mean(trainer.cum_bce), np.mean(trainer.cum_gmm), np.mean(trainer.cum_mse), ) ) trainer.mdnrnn.mdnrnn.eval() valid_losses = trainer.get_loss( valid_batch, state_dim=gym_env.state_dim, batch_first=True ) valid_losses = loss_to_num(valid_losses) valid_loss_history.append(valid_losses) trainer.mdnrnn.mdnrnn.train() logger.info( "{}-th epoch, validate loss={}, bce={}, gmm={}, mse={}".format( i_epoch, valid_losses["loss"], valid_losses["bce"], valid_losses["gmm"], valid_losses["mse"], ) ) latest_loss = valid_loss_history[-1]["loss"] recent_valid_loss_hist = valid_loss_history[ -1 - run_details.early_stopping_patience : -1 ] # earlystopping if len(valid_loss_history) > run_details.early_stopping_patience and all( (latest_loss >= v["loss"] for v in recent_valid_loss_hist) ): break trainer.mdnrnn.mdnrnn.eval() test_losses = trainer.get_loss( test_batch, state_dim=gym_env.state_dim, batch_first=True ) test_losses = loss_to_num(test_losses) logger.info( "Test loss: {}, bce={}, gmm={}, mse={}".format( test_losses["loss"], test_losses["bce"], test_losses["gmm"], test_losses["mse"], ) ) logger.info("Valid loss history: {}".format(valid_loss_history)) return test_losses, valid_loss_history, trainer def create_trainer( params: OpenAiGymParameters, env: OpenAIGymEnvironment, use_gpu: bool ): assert params.mdnrnn is not None assert params.run_details.max_steps is not None mdnrnn_params = params.mdnrnn mdnrnn_net = MemoryNetwork( state_dim=env.state_dim, action_dim=env.action_dim, num_hiddens=mdnrnn_params.hidden_size, num_hidden_layers=mdnrnn_params.num_hidden_layers, num_gaussians=mdnrnn_params.num_gaussians, ) if use_gpu: mdnrnn_net = mdnrnn_net.cuda() cum_loss_hist_len = ( params.run_details.num_train_episodes * params.run_details.max_steps // mdnrnn_params.minibatch_size ) trainer = MDNRNNTrainer( mdnrnn_network=mdnrnn_net, params=mdnrnn_params, cum_loss_hist=cum_loss_hist_len ) return trainer if __name__ == "__main__": logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) logging.getLogger().setLevel(logging.INFO) args = sys.argv main(args[1:])
train_sgd
compute_algorithm_rank.py
import operator def main():
if __name__ == '__main__': main()
print ('Compute algorithm rank') f = open('../data/join_results/sj.12_30.log.csv') output_f = open('../data/join_results/sj.12_30.log.ranked.csv', 'w') header = f.readline() header = header.strip() header += ',1st time,2nd time,3rd time,4th time, 1st #splits,2nd #splits,3rd #splits,4th #splits\n' output_f.writelines(header) line = f.readline() while line: data = line.strip().split(',') duration = {} duration['pbsm'] = float(data[9]) if float(data[9]) > 0 else 10000 duration['dj'] = float(data[13]) if float(data[13]) > 0 else 10000 duration['repj'] = float(data[17]) if float(data[17]) > 0 else 10000 duration['bnlj'] = float(data[5]) if float(data[5]) > 0 else 10000 # print (duration) sorted_duration = sorted(duration.items(), key=operator.itemgetter(1)) # print (sorted_duration) line = line.strip() for sorted_entry in sorted_duration: print (sorted_entry[0]) line += ',{}'.format(sorted_entry[0]) split_counts = {} split_counts['pbsm'] = float(data[8]) if float(data[8]) > 0 else 10000 split_counts['dj'] = float(data[12]) if float(data[12]) > 0 else 10000 split_counts['repj'] = float(data[16]) if float(data[16]) > 0 else 10000 split_counts['bnlj'] = float(data[4]) if float(data[4]) > 0 else 10000 print (duration) sorted_split_counts = sorted(split_counts.items(), key=operator.itemgetter(1)) # print (sorted_duration) for sorted_entry in sorted_split_counts: print (sorted_entry[0]) line += ',{}'.format(sorted_entry[0]) output_f.writelines('{}\n'.format(line)) line = f.readline() output_f.close() f.close()
register_ecdh_aead_enc_helper.go
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package composite import ( "encoding/json" "errors" "fmt" "github.com/golang/protobuf/proto" aead "github.com/google/tink/go/aead/subtle" "github.com/google/tink/go/core/registry" gcmpb "github.com/google/tink/go/proto/aes_gcm_go_proto" chachapb "github.com/google/tink/go/proto/chacha20_poly1305_go_proto" tinkpb "github.com/google/tink/go/proto/tink_go_proto" xchachapb "github.com/google/tink/go/proto/xchacha20_poly1305_go_proto" "github.com/google/tink/go/tink" "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/poly1305" "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/aead/subtle" cbchmacpb "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto" ) const ( // AESCBCHMACAEADTypeURL for AESCBC+HMAC AEAD content encryption URL. AESCBCHMACAEADTypeURL = "type.hyperledger.org/hyperledger.aries.crypto.tink.AesCbcHmacAeadKey" // AESGCMTypeURL for AESGCM content encryption URL identifier. AESGCMTypeURL = "type.googleapis.com/google.crypto.tink.AesGcmKey" // ChaCha20Poly1305TypeURL for Chacha20Poly1305 content encryption URL identifier. ChaCha20Poly1305TypeURL = "type.googleapis.com/google.crypto.tink.ChaCha20Poly1305Key" // XChaCha20Poly1305TypeURL for XChachaPoly1305 content encryption URL identifier. XChaCha20Poly1305TypeURL = "type.googleapis.com/google.crypto.tink.XChaCha20Poly1305Key" ) type marshalFunc func(interface{}) ([]byte, error) // RegisterCompositeAEADEncHelper registers a content encryption helper. type RegisterCompositeAEADEncHelper struct { encKeyURL string keyData []byte tagSize int ivSize int marshalFunc marshalFunc } var _ EncrypterHelper = (*RegisterCompositeAEADEncHelper)(nil) // NewRegisterCompositeAEADEncHelper initializes and returns a RegisterCompositeAEADEncHelper. //nolint:gocyclo func NewRegisterCompositeAEADEncHelper(k *tinkpb.KeyTemplate) (*RegisterCompositeAEADEncHelper, error) { var ( tagSize, ivSize int skf []byte err error ) switch k.TypeUrl { case AESCBCHMACAEADTypeURL: cbcHMACKeyFormat := new(cbchmacpb.AesCbcHmacAeadKeyFormat) err = proto.Unmarshal(k.Value, cbcHMACKeyFormat) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to unmarshal cbcHMACKeyFormat: %w", err) } tagSize = int(cbcHMACKeyFormat.HmacKeyFormat.Params.TagSize) ivSize = subtle.AESCBCIVSize skf, err = proto.Marshal(cbcHMACKeyFormat) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to serialize cbcHMAC key format, error: %w", err) } case AESGCMTypeURL: gcmKeyFormat := new(gcmpb.AesGcmKeyFormat) err = proto.Unmarshal(k.Value, gcmKeyFormat) if err != nil {
return nil, fmt.Errorf("compositeAEADEncHelper: failed to unmarshal gcmKeyFormat: %w", err) } tagSize = aead.AESGCMTagSize ivSize = aead.AESGCMIVSize skf, err = proto.Marshal(gcmKeyFormat) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to serialize gcm key format, error: %w", err) } case ChaCha20Poly1305TypeURL: tagSize = poly1305.TagSize ivSize = chacha20poly1305.NonceSize skf, err = buildChachaSKF(k) if err != nil { return nil, err } case XChaCha20Poly1305TypeURL: tagSize = poly1305.TagSize ivSize = chacha20poly1305.NonceSizeX skf, err = buildXChachaSKF(k) if err != nil { return nil, err } default: return nil, fmt.Errorf("compositeAEADEncHelper: unsupported AEAD content encryption key type: %s", k.TypeUrl) } return buildRegisterCompositeAEADEncHelper(k, skf, tagSize, ivSize) } func buildChachaSKF(k *tinkpb.KeyTemplate) ([]byte, error) { chachaKeyFormat := new(chachapb.ChaCha20Poly1305KeyFormat) err := proto.Unmarshal(k.Value, chachaKeyFormat) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to unmarshal chachaKeyFormat: %w", err) } skf, err := proto.Marshal(chachaKeyFormat) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to serialize chacha key format, error: %w", err) } return skf, nil } func buildXChachaSKF(k *tinkpb.KeyTemplate) ([]byte, error) { xChachaKeyFormat := new(xchachapb.XChaCha20Poly1305KeyFormat) err := proto.Unmarshal(k.Value, xChachaKeyFormat) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to unmarshal xChachaKeyFormat: %w", err) } skf, err := proto.Marshal(xChachaKeyFormat) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to serialize xChacha key format, error: %w", err) } return skf, nil } func buildRegisterCompositeAEADEncHelper(k *tinkpb.KeyTemplate, skf []byte, tagSize, ivSize int) (*RegisterCompositeAEADEncHelper, error) { km, err := registry.GetKeyManager(k.TypeUrl) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to fetch KeyManager, error: %w", err) } key, err := km.NewKey(skf) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to fetch key, error: %w", err) } sk, err := proto.Marshal(key) if err != nil { return nil, fmt.Errorf("compositeAEADEncHelper: failed to serialize key, error: %w", err) } return &RegisterCompositeAEADEncHelper{ encKeyURL: k.TypeUrl, keyData: sk, tagSize: tagSize, ivSize: ivSize, marshalFunc: json.Marshal, }, nil } // GetTagSize returns the primitive tag size. func (r *RegisterCompositeAEADEncHelper) GetTagSize() int { return r.tagSize } // GetIVSize returns the primitive IV size. func (r *RegisterCompositeAEADEncHelper) GetIVSize() int { return r.ivSize } // GetAEAD returns the AEAD primitive from the DEM. func (r *RegisterCompositeAEADEncHelper) GetAEAD(symmetricKeyValue []byte) (tink.AEAD, error) { sk, err := r.getSerializedKey(symmetricKeyValue) if err != nil { return nil, err } p, err := registry.Primitive(r.encKeyURL, sk) if err != nil { return nil, err } g, ok := p.(tink.AEAD) if !ok { return nil, fmt.Errorf("invalid primitive") } return g, nil } func (r *RegisterCompositeAEADEncHelper) getSerializedKey(symmetricKeyValue []byte) ([]byte, error) { //nolint:gocyclo var ( sk []byte err error ) switch r.encKeyURL { case AESCBCHMACAEADTypeURL: sk, err = r.getSerializedAESCBCHMACKey(symmetricKeyValue) if err != nil { return nil, fmt.Errorf("registerCompositeAEADEncHelper: failed to serialize key, error: %w", err) } case AESGCMTypeURL: sk, err = r.getSerializedAESGCMKey(symmetricKeyValue) if err != nil { return nil, fmt.Errorf("registerCompositeAEADEncHelper: failed to serialize key, error: %w", err) } case ChaCha20Poly1305TypeURL: chachaKey := new(chachapb.ChaCha20Poly1305Key) err = proto.Unmarshal(r.keyData, chachaKey) if err != nil { return nil, fmt.Errorf("registerCompositeAEADEncHelper: failed to unmarshal chacha key: %w", err) } chachaKey.KeyValue = symmetricKeyValue sk, err = proto.Marshal(chachaKey) if err != nil { return nil, fmt.Errorf("registerCompositeAEADEncHelper: failed to serialize key, error: %w", err) } case XChaCha20Poly1305TypeURL: xChachaKey := new(xchachapb.XChaCha20Poly1305Key) err = proto.Unmarshal(r.keyData, xChachaKey) if err != nil { return nil, fmt.Errorf("registerCompositeAEADEncHelper: failed to unmarshal xchacha key: %w", err) } xChachaKey.KeyValue = symmetricKeyValue sk, err = proto.Marshal(xChachaKey) if err != nil { return nil, fmt.Errorf("registerCompositeAEADEncHelper: failed to serialize key, error: %w", err) } default: return nil, fmt.Errorf("registerCompositeAEADEncHelper: unsupported AEAD content encryption key type: %s", r.encKeyURL) } return sk, err } func (r *RegisterCompositeAEADEncHelper) getSerializedAESGCMKey(symmetricKeyValue []byte) ([]byte, error) { gcmKey := new(gcmpb.AesGcmKey) err := proto.Unmarshal(r.keyData, gcmKey) if err != nil { return nil, fmt.Errorf("failed to unmarshal gcmKeyFormat: %w", err) } gcmKey.KeyValue = symmetricKeyValue return proto.Marshal(gcmKey) } func (r *RegisterCompositeAEADEncHelper) getSerializedAESCBCHMACKey(symmetricKeyValue []byte) ([]byte, error) { cbcHMACKey := new(cbchmacpb.AesCbcHmacAeadKey) err := proto.Unmarshal(r.keyData, cbcHMACKey) if err != nil { return nil, fmt.Errorf("failed to unmarshal cbcHMACKeyFormat: %w", err) } var ( keySize int twoKeys = 2 ) switch len(symmetricKeyValue) { case subtle.AES128Size * twoKeys: keySize = subtle.AES128Size case subtle.AES192Size * twoKeys: keySize = subtle.AES192Size case subtle.AES256Size + subtle.AES192Size: keySize = subtle.AES256Size case subtle.AES256Size * twoKeys: keySize = subtle.AES256Size default: return nil, errors.New("AES-CBC+HMAC-SHA key must be either 32, 48, 56 or 64 bytes") } cbcHMACKey.AesCbcKey.KeyValue = symmetricKeyValue[:keySize] cbcHMACKey.HmacKey.KeyValue = symmetricKeyValue[keySize:] return proto.Marshal(cbcHMACKey) } // BuildEncData will build the []byte representing the ciphertext sent to the end user as a result of the Composite // Encryption primitive execution. func (r *RegisterCompositeAEADEncHelper) BuildEncData(ct []byte) ([]byte, error) { tagSize := r.GetTagSize() ivSize := r.GetIVSize() iv := ct[:ivSize] ctAndTag := ct[ivSize:] tagOffset := len(ctAndTag) - tagSize encData := &EncryptedData{ Ciphertext: ctAndTag[:tagOffset], IV: iv, Tag: ctAndTag[tagOffset:], } return r.marshalFunc(encData) } // BuildDecData will build the []byte representing the ciphertext coming from encData struct returned as a result of // Composite Encrypt() call to prepare the Composite Decryption primitive execution. func (r *RegisterCompositeAEADEncHelper) BuildDecData(encData *EncryptedData) []byte { iv := encData.IV tag := encData.Tag ct := encData.Ciphertext finalCT := append(iv, ct...) finalCT = append(finalCT, tag...) return finalCT }
shootout-spectralnorm.rs
// The Computer Language Benchmarks Game // http://benchmarksgame.alioth.debian.org/ // // contributed by the Rust Project Developers // Copyright (c) 2012-2014 The Rust Project Developers // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // - Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // - Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in // the documentation and/or other materials provided with the // distribution. // // - Neither the name of "The Computer Language Benchmarks Game" nor // the name of "The Computer Language Shootout Benchmarks" nor the // names of its contributors may be used to endorse or promote // products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. // no-pretty-expanded FIXME #15189 #![allow(non_snake_case)] #![feature(unboxed_closures)] use std::iter::AdditiveIterator; use std::mem; use std::num::Float; use std::os; use std::raw::Repr; use std::simd::f64x2; fn main() { let args = os::args(); let answer = spectralnorm(if os::getenv("RUST_BENCH").is_some() { 5500 } else if args.len() < 2 { 2000 } else { from_str(args[1].as_slice()).unwrap() }); println!("{:.9}", answer); } fn spectralnorm(n: uint) -> f64 { assert!(n % 2 == 0, "only even lengths are accepted"); let mut u = Vec::from_elem(n, 1.0); let mut v = Vec::from_elem(n, 1.0); let mut tmp = Vec::from_elem(n, 1.0); for _ in range(0u, 10) { mult_AtAv(u.as_slice(), v.as_mut_slice(), tmp.as_mut_slice()); mult_AtAv(v.as_slice(), u.as_mut_slice(), tmp.as_mut_slice()); } (dot(u.as_slice(), v.as_slice()) / dot(v.as_slice(), v.as_slice())).sqrt() } fn mult_AtAv(v: &[f64], out: &mut [f64], tmp: &mut [f64]) { mult_Av(v, tmp); mult_Atv(tmp, out); } fn mult_Av(v: &[f64], out: &mut [f64]) { parallel(out, |&: start, out| mult(v, out, start, |i, j| A(i, j))); } fn mult_Atv(v: &[f64], out: &mut [f64]) { parallel(out, |&: start, out| mult(v, out, start, |i, j| A(j, i))); } fn mult(v: &[f64], out: &mut [f64], start: uint, a: |uint, uint| -> f64) { for (i, slot) in out.iter_mut().enumerate().map(|(i, s)| (i + start, s)) { let mut sum = f64x2(0.0, 0.0); for (j, chunk) in v.chunks(2).enumerate().map(|(j, s)| (2 * j, s)) { let top = f64x2(chunk[0], chunk[1]); let bot = f64x2(a(i, j), a(i, j + 1)); sum += top / bot; } let f64x2(a, b) = sum; *slot = a + b; } } fn A(i: uint, j: uint) -> f64 { ((i + j) * (i + j + 1) / 2 + i + 1) as f64 } fn
(v: &[f64], u: &[f64]) -> f64 { v.iter().zip(u.iter()).map(|(a, b)| *a * *b).sum() } // Executes a closure in parallel over the given mutable slice. The closure `f` // is run in parallel and yielded the starting index within `v` as well as a // sub-slice of `v`. fn parallel<'a, T, F>(v: &'a mut [T], f: F) where T: Send + Sync, F: Fn(uint, &'a mut [T]) + Sync { let (tx, rx) = channel(); let size = v.len() / os::num_cpus() + 1; for (i, chunk) in v.chunks_mut(size).enumerate() { let tx = tx.clone(); // Need to convert `f` and `chunk` to something that can cross the task // boundary. let f = &f as *const _ as *const uint; let raw = chunk.repr(); spawn(proc() { let f = f as *const F; unsafe { (*f)(i * size, mem::transmute(raw)) } drop(tx) }); } drop(tx); for () in rx.iter() {} }
dot
pipe.py
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import argparse import logging import math import os import time import warnings from benchmark_dataset import BenchmarkLMDataset, collate_sentences_lm import torch from torch.distributed import rpc import torch.multiprocessing as mp import torch.nn as nn from torch.nn.parallel import DistributedDataParallel as DDP from torch.utils.data import DataLoader import torchtext from torchtext.data.utils import get_tokenizer from fairscale.nn import Pipe from fairscale.nn.model_parallel import initialize_model_parallel from fairscale.nn.model_parallel.initialize import get_data_parallel_group, get_pipeline_parallel_group from fairscale.nn.pipe import LazyModule, pipe from fairscale.optim import GradScaler from fairscale.optim.oss import OSS from fairscale.utils.testing import dist_init, get_worker_map try: from fairscale.optim import Adam # type: ignore can_benchmark = True except ImportError: from torch.optim import Adam # type: ignore can_benchmark = False def init_random_seed(seed: int): import numpy torch.manual_seed(seed) torch.cuda.manual_seed(seed) numpy.random.seed(seed) PIPE_CHUNKS = 2 iteration_count = 0 class EmbeddingLayer(nn.Embedding): def __init__(self, ntoken, ninp, initrange): super().__init__(ntoken, ninp) self.ninp = ninp self.weight.data.uniform_(-initrange, initrange) def forward(self, src): return super().forward(src) * math.sqrt(self.ninp) class PositionalEncodingLayer(nn.Module): def __init__(self, d_model, dropout=0.1, max_len=5000): super(PositionalEncodingLayer, self).__init__() self.dropout = nn.Dropout(p=dropout) pe = torch.zeros(max_len, d_model) position = torch.arange(0, max_len, dtype=torch.float).unsqueeze(1) div_term = torch.exp(torch.arange(0, d_model, 2).float() * (-math.log(10000.0) / d_model)) pe[:, 0::2] = torch.sin(position * div_term) pe[:, 1::2] = torch.cos(position * div_term) pe = pe.unsqueeze(0).transpose(0, 1) self.register_buffer("pe", pe) def forward(self, x): x = x + self.pe[: x.size(0), :] return self.dropout(x) class TransformerDecoderLayer(nn.TransformerEncoderLayer): """Though this class inherits from torch.nn.TransformerEncoderLayer, it functions as a decoder in this model""" def __init__(self, ninp, nhead, nhid, droupout): super().__init__(ninp, nhead, nhid, droupout) self.src_mask = None def _generate_square_subsequent_mask(self, sz): mask = (torch.triu(torch.ones(sz, sz)) == 1).transpose(0, 1) mask = mask.float().masked_fill(mask == 0, float("-inf")).masked_fill(mask == 1, float(0.0)) return mask def forward(self, src): global iteration_count iteration_count += 1 # if iteration_count == 196: # dump_cuda_tensors() if self.src_mask is None or self.src_mask.size(0) != len(src): device = src.device mask = self._generate_square_subsequent_mask(len(src)).to(device) self.src_mask = mask return super().forward(src, self.src_mask) class LinearLayer(nn.Linear): def __init__(self, ninp, ntoken, initrange): super().__init__(ninp, ntoken) self.bias.data.zero_() self.weight.data.uniform_(-initrange, initrange) class TransformerLMSequential(nn.Sequential): """A small language model based on the design of GPT-2 using nn.Sequential for compatability with Pipe""" def __init__(self, ntokens, ninp, nhead, nhid, dropout, initrange, ndecoder): layers = [ EmbeddingLayer(ntokens, ninp, initrange), PositionalEncodingLayer(ninp, dropout), ] for _ in range(ndecoder): layers.append(TransformerDecoderLayer(ninp, nhead, nhid, dropout)) layers.append(LinearLayer(ninp, ntokens, initrange)) super(TransformerLMSequential, self).__init__(*layers) def get_data(device): with warnings.catch_warnings(record=True) as fjldska: TEXT = torchtext.data.Field( tokenize=get_tokenizer("basic_english"), init_token="<sos>", eos_token="<eos>", lower=True ) train_txt, val_txt, test_txt = torchtext.datasets.WikiText2.splits(TEXT) TEXT.build_vocab(train_txt) ntokens = len(TEXT.vocab.stoi) batch_size = 20 eval_batch_size = 10 train_data = batchify(train_txt, batch_size, TEXT, device) val_data = batchify(val_txt, eval_batch_size, TEXT, device) test_data = batchify(test_txt, eval_batch_size, TEXT, device) return ntokens, train_data, val_data, test_data def batchify(data, bsz, TEXT, device): data = TEXT.numericalize([data.examples[0].text]) nbatch = data.size(0) // bsz data = data.narrow(0, 0, nbatch * bsz) data = data.view(bsz, -1).t().contiguous() return data.to(device) def get_batch(source, i, bptt): seq_len = min(bptt, len(source) - 1 - i) data = source[i : i + seq_len] target = source[i + 1 : i + 1 + seq_len].view(-1) return data, target def make_model(args, device, ntokens): ninp = 2048 # embedding dimension nhid = 2048 # the dimension of the feedforward network model in nn.TransformerEncoder nhead = 32 # the number of heads in the multiheadattention models dropout = 0 initrange = 0.1 ndecoder = args.num_decoder_layers if args.lazy_construction: layers = [ LazyModule(lambda: EmbeddingLayer(ntokens, ninp, initrange)), LazyModule(lambda: PositionalEncodingLayer(ninp, dropout)), ] for _ in range(ndecoder): layers.append(LazyModule(lambda: TransformerDecoderLayer(ninp, nhead, nhid, dropout))) layers.append(LazyModule(lambda: LinearLayer(ninp, ntokens, initrange))) model = layers else: model = TransformerLMSequential(ntokens, ninp, nhead, nhid, dropout, initrange, ndecoder).to(device) criterion = nn.CrossEntropyLoss() lr = 0.01 # learning rate def make_adam(model): if args.ddp_zero: return OSS(params=model.parameters(), optim=Adam, group=get_data_parallel_group(), lr=lr) else: return Adam(model.parameters(), lr=lr) optimizer = make_adam scaler = GradScaler() return model, criterion, optimizer, scaler def get_tensors_by_size_bucket(): from collections import defaultdict import gc size_buckets = defaultdict(int) for obj in gc.get_objects(): if not isinstance(obj, torch.Tensor): continue if obj.device.type == "cuda": size_buckets[(*obj.size(),) + (obj.element_size(),)] += 1 return size_buckets def dump_size_buckets(size_buckets, prefix=""): from functools import reduce import operator total = 0 for key, value in size_buckets.items(): this = reduce(operator.mul, key) * value total += this print(prefix + f"{key} : {value}, {this}") print(prefix + f"total = {total}") last_size_buckets = None once = True def safe_rank(): try: return torch.distributed.get_rank() except AssertionError: return 0 def check_size_buckets(): global last_size_buckets global once size_buckets = get_tensors_by_size_bucket() if last_size_buckets is not None: if size_buckets != last_size_buckets: print(f"difference is oustanding tensors: {safe-rank()}") dump_size_buckets(last_size_buckets, "old: ") dump_size_buckets(size_buckets, "new: ") if once: print(f"dumping buckets for: {safe_rank()}") dump_size_buckets(last_size_buckets, "old: ") dump_size_buckets(size_buckets, "new: ") once = False else: print(f"size buckets none on {safe_rank()}") last_size_buckets = size_buckets def dump_cuda_tensors(): print(f"dumping cuda tensors...") from functools import reduce import gc import operator for obj in gc.get_objects(): if not isinstance(obj, torch.Tensor): continue if obj.device.type == "cuda": size_buckets[(*obj.size(),) + (obj.element_size(),)] += 1 print(f"outstanding cuda tensors:") total = 0 for key, value in size_buckets.items(): this = reduce(operator.mul, key) * value total += this print(f"{key} : {value}, {this}") print(f"total size = {total}") import pprint pprint.pprint(torch.cuda.memory_stats()) def train(lm_dataloader, model, criterion, optimizer, vocab_size, args): model.train() from functools import reduce import operator num_params = reduce(operator.add, (reduce(operator.mul, x.size()) for x in model.parameters())) if model.group: total = torch.Tensor([num_params]) if torch.cuda.is_available(): total = total.cuda() torch.distributed.all_reduce(total, group=model.group) logging.info( f"training model, #prams = {num_params}, group: {model.group.rank()}, grank:" f" {torch.distributed.get_rank()}, sizes {model.group.size()}" ) torch.distributed.barrier() if model.group.rank() == 0: logging.info(f"total #prams = {total.item()}") else: logging.info(f"training model, #prams = {num_params}") vocab_size = 10000 # FIXME total_loss = 0.0 start_time = time.time() word_counter = 0 optimizer = optimizer(model) def get_first_device(model): if isinstance(model, DDP): model = model.module if not torch.cuda.is_available(): return torch.device("cpu") if model.devices: return model.devices[0] else: return torch.cuda.current_device() def get_last_device(model): if isinstance(model, DDP): model = model.module if not torch.cuda.is_available(): return torch.device("cpu") if model.devices: return model.devices[-1] else: return torch.cuda.current_device() pipe_group = model.group if args.ddp_zero: model = DDP( model, device_ids=[torch.cuda.current_device()], process_group=get_data_parallel_group(), find_unused_parameters=False, ) if pipe_group and pipe_group.rank() != 0 and pipe_group.rank() != (pipe_group.size() - 1): thing = {"input": torch.zeros(args.batch_size)} class FakeDataset: def __getitem__(self, index): return thing def __len__(self): return len(lm_dataloader) lm_dataloader = FakeDataset() for i, batch in enumerate(lm_dataloader): bi = batch["input"] if args.max_batch and i > args.max_batch: break optimizer.zero_grad() try: if (pipe_group is None or pipe_group.rank() == 0) and not args.ddp_zero: tmp = batch["input"].to(get_first_device(model)) output = model(tmp) else: output = model(batch["input"]) except Exception as e: raise RuntimeError(f"training failed on {torch.distributed.get_rank()}") from e if pipe_group is None or pipe_group.rank() == pipe_group.size() - 1: target = batch["target"].to(get_last_device(model)) output = output.to(target.device) loss = criterion(output.view(-1, vocab_size), target.view(-1)) if args.ddp_zero: ddp_group = get_data_parallel_group() torch.distributed.all_reduce(loss, op=torch.distributed.ReduceOp.SUM, group=ddp_group) loss /= ddp_group.size() loss.backward()
if args.ddp_zero: model.module.back_helper(output) else: model.back_helper(output) del output torch.nn.utils.clip_grad_value_(model.parameters(), 0.05) optimizer.step() if pipe_group is None or pipe_group.rank() == pipe_group.size() - 1: total_loss += loss.item() log_interval = 1 word_counter += batch["ntokens"] if i % log_interval == 0 and i > 0: cur_loss = total_loss / log_interval elapsed = time.time() - start_time print( "| batch {:5d} | wps {:5.2f} | loss {:5.2f} | ppl {:8.2f}".format( i, word_counter / elapsed, cur_loss, math.exp(cur_loss) ) ) word_counter = 0 total_loss = 0 start_time = time.time() # if i >= 10: # break # torch.cuda.empty_cache() # check_size_buckets() def evaluate(eval_model, data_source, criterion, bptt, ntokens): eval_model.eval() total_loss = 0.0 with torch.no_grad(): for i in range(0, data_source.size(0) - 1, bptt): data, targets = get_batch(data_source, i, bptt) output = eval_model(data) output = output.to(targets.device) output_flat = output.view(-1, ntokens) total_loss += len(data) * criterion(output_flat, targets).item() return total_loss / (len(data_source) - 1) def get_number_of_words(data): return data.size()[0] * data.size()[1] def benchmark_language_model(train_data, val_data, test_data, model, criterion, optimizer, ntokens, args): epoch = 1 bptt = 35 start_time = time.time() print("-" * 110) print("| start of epoch {:1d}".format(epoch)) print("-" * 110) epoch_start_time = time.time() train(train_data, model, criterion, optimizer, bptt, ntokens, args) val_loss = 1 # evaluate(model, val_data, criterion, bptt, ntokens) print("-" * 89) print( "| end of epoch {:1d} | time: {:5.2f}s | valid loss {:5.2f} ".format( epoch, (time.time() - epoch_start_time), val_loss ) ) print("-" * 110) elapsed_time = time.time() - start_time nwords = get_number_of_words(train_data) + get_number_of_words(val_data) wps = nwords / elapsed_time test_loss = 1 # evaluate(model, test_data, criterion, bptt, ntokens) print("=" * 89) print( "| end of training | test loss {:5.2f} \n| time: {:5.2f}s | words: {:3d} | wps: {:5.2f}".format( test_loss, elapsed_time, nwords, wps ) ) print("=" * 110) if can_benchmark and len(model.balance) == 4: # Assert that words per second is within 3 standard deviations of the average # of six golden runs assert wps > 36954.4 - (3 * 116.825) print("Peak allocated bytes on cuda:0: {:1d}".format(torch.cuda.memory_stats(0)["allocated_bytes.all.peak"])) print("Peak allocated bytes on cuda:1: {:1d}".format(torch.cuda.memory_stats(1)["allocated_bytes.all.peak"])) print("Peak allocated bytes on cuda:2: {:1d}".format(torch.cuda.memory_stats(2)["allocated_bytes.all.peak"])) print("Peak allocated bytes on cuda:3: {:1d}".format(torch.cuda.memory_stats(3)["allocated_bytes.all.peak"])) # Assert that memory usage on each GPU is within 10% of golden run # Right-hand-side is golden run bytes * 110% assert torch.cuda.memory_stats(0)["allocated_bytes.all.peak"] < 4061909504 * 1.1 assert torch.cuda.memory_stats(1)["allocated_bytes.all.peak"] < 4050944 * 1.1 assert torch.cuda.memory_stats(2)["allocated_bytes.all.peak"] < 10427392 * 1.1 assert torch.cuda.memory_stats(3)["allocated_bytes.all.peak"] < 2031824896 * 1.1 print("No regression detected") def generate_balance_weighted(num_devices, num_layers, fraction=0.5): balance = [] layers_assigned = 0 average_count = num_layers / num_devices last_layers = int(average_count * fraction) balance = generate_balance(num_devices - 1, num_layers - last_layers) balance.append(last_layers) return balance def generate_balance(num_devices, num_layers): balance = [] layers_assigned = 0 for i in range(num_devices): x = (num_layers - layers_assigned) / (num_devices - i) if x.is_integer(): balance.append(int(x)) layers_assigned += x else: balance.append(math.ceil(x)) layers_assigned += math.ceil(x) return balance def make_model_and_data(args, device, new_data: bool = True): device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu") if new_data: vocab_size = 10000 model, criterion, optimizer, scaler = make_model(args, device, vocab_size) lm_dataset = BenchmarkLMDataset() lm_dataloader = DataLoader( lm_dataset, batch_size=args.batch_size, shuffle=True, num_workers=0, collate_fn=collate_sentences_lm ) return { "model": model, "criterion": criterion, "optimizer": optimizer, "data": lm_dataloader, "vocab_size": vocab_size, } else: data = get_data(device) ntokens, train_data, val_data, test_data = data model, criterion, optimizer, scaler = make_model(args, device, ntokens) return { "model": model, "criterion": criterion, "optimizer": optimizer, "data": data, } def bench_single_process(args): num_devices = torch.cuda.device_count() if torch.cuda.is_available() else 1 assert num_devices > 0 init_random_seed(0) device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu") new_data = True blob = make_model_and_data(args, None, new_data=new_data) model = blob["model"] balance = generate_balance(min(num_devices, 4), len(model)) p = pipe.Pipe( model, balance, chunks=args.chunks, pipelined_backward=args.pipelined_backward, checkpoint=args.checkpoint ) del model del blob["model"] if new_data: train(blob["data"], p, blob["criterion"], blob["optimizer"], blob["vocab_size"], args) else: ntokens, train_data, val_data, test_data = blob["data"] benchmark_language_model(train_data, val_data, test_data, p, criterion, optimizer, ntokens, args) def run_mp_worker(args, available_workers): new_data = True blob = make_model_and_data(args, None, new_data=new_data) model = blob["model"] balance = generate_balance_weighted(get_pipeline_parallel_group().size(), len(model), 0.8) p = pipe.Pipe( model, balance, style=Pipe.AsyncSchedule, chunks=args.chunks, worker_map=get_worker_map(), input_device=torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu"), pipelined_backward=args.pipelined_backward, checkpoint=args.checkpoint, # loss_fn=blob["criterion"], ) if torch.cuda.is_available(): p = p.cuda() if args.all_at_once and p.pipeline: print(f"running all at once") p.pipeline.all_at_once = True if new_data: train(blob["data"], p, blob["criterion"], blob["optimizer"], blob["vocab_size"], args) else: ntokens, train_data, val_data, test_data = blob["data"] benchmark_language_model(train_data, val_data, test_data, p, criterion, optimizer, ntokens, args) def run_worker(rank, world_size, args): if args.world_size != 0: world_size = args.world_size dist_init(rank + args.rank_base, world_size, hostname=args.host) initialize_model_parallel(1, world_size) init_random_seed(0) run_mp_worker(args, world_size) rpc.shutdown() torch.distributed.destroy_process_group() def bench_multi_process(args, all_at_once=False): if args.local_world_size != 0: world_size = args.local_world_size else: world_size = min(torch.cuda.device_count(), 2) mp.spawn(run_worker, args=(world_size, args), nprocs=world_size, join=True) best_device_map = { 0: "mlx5_0:1", 1: "mlx5_0:1", 2: "mlx5_1:1", 3: "mlx5_1:1", 4: "mlx5_2:1", 5: "mlx5_2:1", 6: "mlx5_3:1", 7: "mlx5_3:1", } def bench_mpi(args): guess_rank = int(os.environ["OMPI_COMM_WORLD_RANK"]) world_size = int(os.environ["OMPI_COMM_WORLD_SIZE"]) local_rank = int(os.environ["OMPI_COMM_WORLD_LOCAL_RANK"]) os.environ["UCX_NET_DEVICES"] = best_device_map[local_rank] os.environ["MASTER_ADDR"] = args.host os.environ["MASTER_PORT"] = "10638" if args.socket_name: os.environ["GLOO_SOCKET_IFNAME"] = args.socket_name os.environ["TP_SOCKET_IFNAME"] = args.socket_name torch.distributed.init_process_group(backend="gloo", rank=guess_rank, world_size=world_size) os.environ["MASTER_ADDR"] = args.host os.environ["MASTER_PORT"] = "10639" init_method = f"tcp://{os.environ['MASTER_ADDR']}:{os.environ['MASTER_PORT']}" rank = torch.distributed.get_rank() world_size = torch.distributed.get_world_size() torch.cuda.set_device(local_rank % torch.cuda.device_count()) rpc.init_rpc( f"Test{rank}", rank=rank, world_size=world_size, backend=rpc.BackendType.PROCESS_GROUP, rpc_backend_options=rpc.ProcessGroupRpcBackendOptions(rpc_timeout=20, init_method=init_method), ) backends = {"model_parallel_backend": "nccl", "pipeline_backend": "mpi", "ddp_backend": "nccl"} if args.ddp_zero: initialize_model_parallel(1, 4, **backends) else: initialize_model_parallel(1, world_size, **backends) init_random_seed(0) run_mp_worker(args, world_size) rpc.shutdown() torch.distributed.destroy_process_group() parser = argparse.ArgumentParser(description="benchmark") parser.add_argument("--local-world-size", "-l", type=int, default=0, help="local world size") parser.add_argument("--world-size", "-w", type=int, default=0, help="world size") parser.add_argument("--rank-base", "-r", type=int, help="rank base", default=0) parser.add_argument("--host", "-o", type=str, default="localhost", help="hostname") parser.add_argument("--no-mpi", action="store_true", default=False, help="disable mpi") parser.add_argument("--chunks", type=int, default=1, help="number of microbatches per batch") parser.add_argument("--batch-size", type=int, default=8, help="size of a batch") parser.add_argument("--all-at-once", action="store_true", default=False, help="do backward pass on whole batch at once") parser.add_argument("--max-batch", type=int, default=4, help="Max number of batches") parser.add_argument("--socket-name", type=str, default=None, help="socket ifname for gloo/tp") parser.add_argument("--num-decoder-layers", type=int, default=10, help="Number of decoder layers in the model") parser.add_argument("--ddp-zero", action="store_true", default=False, help="enable ddp") parser.add_argument( "--lazy-construction", action="store_true", default=False, help="Number of decoder layers in the model" ) parser.add_argument( "--checkpoint", default="never", choices=["always", "except_last", "never"], help="Checkpointing strategy for pipe" ) parser.add_argument( "--pipelined-backward", dest="pipelined_backward", action="store_true", help="Pipelined backward pass" ) parser.add_argument( "--no-pipelined-backward", dest="pipelined_backward", action="store_false", help="Pipelined backward pass" ) parser.set_defaults(pipelined_backward=True) if __name__ == "__main__": args = parser.parse_args() # bench_multi_process(args, all_at_once=True) if args.no_mpi or "OMPI_COMM_WORLD_RANK" not in os.environ: print(f"Running benchmark with args: {args}") bench_single_process(args) else: if os.environ["OMPI_COMM_WORLD_RANK"] == "0": print(f"Running benchmark with args: {args}") bench_mpi(args)
del target else:
plot.py
from abc import abstractmethod from matplotlib import pyplot as plt from matplotlib.backends.backend_qt5 import NavigationToolbar2QT from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from qtpy import QtWidgets from solarviewer.config.base import Viewer, DataModel from solarviewer.ui.plot import Ui_Plot from solarviewer.util import executeTask class PlotWidget(Viewer): def __init__(self): Viewer.__init__(self) self.ui = Ui_Plot() self.ui.setupUi(self) self.initMainCanvas() self.rendered.clear() def initMainCanvas(self):
def updateModel(self, model: DataModel): self._model = model self.redraw() def redraw(self): self.rendered.clear() self.canvas.hide() self.ui.progress.show() executeTask(self._redraw, [], self._afterRedraw) def _redraw(self): self.draw(self._model) self.canvas.draw() def _afterRedraw(self): self.ui.progress.hide() self.canvas.show() self.rendered.set() @abstractmethod def draw(self, data_model: DataModel): raise NotImplementedError
self.figure = plt.figure() self.canvas = FigureCanvas(self.figure) self.toolbar = NavigationToolbar2QT(self.canvas, self) self.toolbar.setVisible(False) FigureCanvas.setSizePolicy(self.canvas, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) FigureCanvas.updateGeometry(self.canvas) self.canvas.hide() self.ui.verticalLayout.addWidget(self.canvas)
id.rs
// TODO: have separate types `PositionId` and `UniqueId`. ? use std::hash::Hash; /// egui tracks widgets frame-to-frame using `Id`s. /// /// For instance, if you start dragging a slider one frame, egui stores /// the sliders `Id` as the current active id so that next frame when /// you move the mouse the same slider changes, even if the mouse has /// moved outside the slider. /// /// For some widgets `Id`s are also used to persist some state about the /// widgets, such as Window position or wether not a collapsing header region is open. /// /// This implies that the `Id`s must be unique. /// /// For simple things like sliders and buttons that don't have any memory and /// doesn't move we can use the location of the widget as a source of identity. /// For instance, a slider only needs a unique and persistent ID while you are /// dragging the slider. As long as it is still while moving, that is fine. /// /// For things that need to persist state even after moving (windows, collapsing headers) /// the location of the widgets is obviously not good enough. For instance, /// a collapsing region needs to remember wether or not it is open even /// if the layout next frame is different and the collapsing is not lower down /// on the screen. /// /// Then there are widgets that need no identifiers at all, like labels, /// because they have no state nor are interacted with. #[derive(Clone, Copy, Hash, Eq, PartialEq)] #[cfg_attr(feature = "persistence", derive(serde::Deserialize, serde::Serialize))] pub struct Id(u64); impl Id { pub(crate) fn background() -> Self { Self(0) } /// Generate a new `Id` by hashing some source (e.g. a string or integer). pub fn new(source: impl Hash) -> Id { // NOTE: AHasher is NOT suitable for this! use std::collections::hash_map::DefaultHasher; use std::hash::Hasher; let mut hasher = DefaultHasher::default(); source.hash(&mut hasher); Id(hasher.finish()) } /// Generate a new `Id` by hashing the parent `Id` and the given argument. pub fn with(self, child: impl Hash) -> Id
pub(crate) fn short_debug_format(&self) -> String { format!("{:04X}", self.0 as u16) } pub(crate) fn value(&self) -> u64 { self.0 } } impl std::fmt::Debug for Id { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:X}", self.0) } }
{ // NOTE: AHasher is NOT suitable for this! use std::collections::hash_map::DefaultHasher; use std::hash::Hasher; let mut hasher = DefaultHasher::default(); hasher.write_u64(self.0); child.hash(&mut hasher); Id(hasher.finish()) }
StencilWaiting.ts
import Action = cc.Action; import {sleepMs, sleepSeconds} from "../Foundation/StencilJs"; import AnimationState = cc.AnimationState; import Base64 from "../Math/Base64"; declare global { export module cc { export interface Action { wait(): Promise<any> } export interface AnimationState { wait(): Promise<any> } } } async function awaitAction(action: Action): Promise<void> { while (!action.isDone()) await sleepMs(16) } async function awaitAnim(state: AnimationState): Promise<void> { return sleepSeconds(state.duration) } cc.Action.prototype['wait'] = function (): Promise<any> { return awaitAction(this) } cc.AnimationState.prototype['wait'] = function (): Promise<any> { return awaitAnim(this) } export function makeRequest(method, url, base64: boolean = true): Promise<any> { return new Promise(function (resolve, reject) { let xhr = new XMLHttpRequest() if (base64) xhr.responseType = 'arraybuffer' xhr.open(method, url, true) xhr.onload = function () { if (this.status >= 200 && this.status < 300) { if (base64) { const blob = new Uint8Array(this.response) const uri = "data:image/jpeg;base64," + Base64.encode(blob) resolve(uri) } else { resolve(xhr.response) } } else { reject({ status: this.status, statusText: xhr.statusText }); } };
xhr.onerror = function () { reject({ status: this.status, statusText: xhr.statusText }); }; xhr.send(); }); }
concurrent_write_and_add_learner.rs
use std::collections::BTreeSet; use std::sync::Arc; use std::time::Duration; use anyhow::Result; use fixtures::RaftRouter; use maplit::btreeset; use openraft::Config; use openraft::LogIdOptionExt; use openraft::ServerState; use crate::fixtures::init_default_ut_tracing; #[macro_use] mod fixtures; /// Cluster concurrent_write_and_add_learner test. /// /// Internally when replication goes to LaggingState(a non-leader lacks a lot logs), the /// ReplicationCore purges `outbound_buffer` and `replication_buffer` and then sends all /// **committed** logs found in storage. /// /// Thus if there are uncommitted logs in `replication_buffer`, these log will never have chance to /// be replicated, even when replication goes back to LineRateState. /// Since LineRateState only replicates logs from `ReplicationCore.outbound_buffer` and /// `ReplicationCore.replication_buffer`. /// /// This test ensures that when replication goes to LineRateState, it tries to re-send all logs /// found in storage(including those that are removed from the two buffers. /// /// NOTE: this test needs a multi nodes cluster because a single-node cluster will commit a log /// at once. /// /// /// What does this test do? /// /// - brings a 3 candidates cluster online. /// - add another learner and at the same time write a log. /// - asserts that all of the leader, followers and the learner receives all logs. #[async_entry::test(worker_threads = 8, init = "init_default_ut_tracing()", tracing_span = "debug")] async fn concurrent_write_and_add_learner() -> Result<()> { let timeout = Duration::from_millis(500); let candidates = btreeset![0, 1, 2]; // Setup test dependencies. let config = Arc::new(Config::default().validate()?); let mut router = RaftRouter::new(config.clone()); router.new_raft_node(0).await; let mut log_index; tracing::info!("--- initializing cluster of 1 node"); { router.initialize_from_single_node(0).await?; log_index = 1; wait_log(&router, &btreeset![0], log_index).await?; } tracing::info!("--- adding two candidate nodes"); { // Sync some new nodes. router.new_raft_node(1).await; router.new_raft_node(2).await; router.add_learner(0, 1).await?; router.add_learner(0, 2).await?; log_index += 2; // two add_learner logs tracing::info!("--- changing cluster config"); let node = router.get_raft_handle(&0)?; node.change_membership(candidates.clone(), true, false).await?; log_index += 2; // Tow member change logs wait_log(&router, &candidates, log_index).await?; router.assert_stable_cluster(Some(1), Some(log_index)).await; // Still in term 1, so leader is still node 0. } let leader = router.leader().unwrap(); tracing::info!("--- write one log"); { router.client_request_many(leader, "client", 1).await; log_index += 1; wait_log(&router, &candidates, log_index).await?; } // Concurrently add Learner and write another log. tracing::info!("--- concurrently add learner and write another log"); { router.new_raft_node(3).await; let r = router.clone(); let handle = { tokio::spawn( async move { r.add_learner(leader, 3).await.unwrap(); Ok::<(), anyhow::Error>(()) } .instrument(tracing::debug_span!("spawn-add-learner")), ) }; log_index += 1; // one add_learner log router.client_request_many(leader, "client", 1).await; log_index += 1; let _ = handle.await?; }; wait_log(&router, &candidates, log_index).await?; router .wait_for_metrics( &3u64, |x| x.state == ServerState::Learner, Some(timeout), &format!("n{}.state -> {:?}", 3, ServerState::Learner), ) .await?; // THe learner should receive the last written log router .wait_for_metrics( &3u64, |x| x.last_log_index == Some(log_index), Some(timeout), &format!("n{}.last_log_index -> {}", 3, log_index), ) .await?; Ok(()) }
let timeout = Duration::from_millis(500); for i in node_ids.iter() { router .wait_for_metrics( i, |x| x.last_log_index == Some(want_log), Some(timeout), &format!("n{}.last_log_index -> {}", i, want_log), ) .await?; router .wait_for_metrics( i, |x| x.last_applied.index() == Some(want_log), Some(timeout), &format!("n{}.last_applied -> {}", i, want_log), ) .await?; } Ok(()) }
async fn wait_log(router: &fixtures::RaftRouter, node_ids: &BTreeSet<u64>, want_log: u64) -> anyhow::Result<()> {
exponent.js
var data = { "body": "<path d=\"M94.104-.001L0 217.125l42.193 22.519L128 55.703l85.57 183.941L256 217.125L161.896-.001H94.104z\" fill=\"#023C69\"/>", "width": 256,
}; exports.__esModule = true; exports.default = data;
"height": 240
LoggedIn.js
import React, { Component } from 'react' import classNames from './styles/bpStyle.css' import BPChart from './BPChart' import BPForm from './BPForm' //mobx import store from './mobx/Store'; import { observer } from 'mobx-react' class LoggedIn extends Component { constructor(props) { super(props) } componentDidMount() { // console.log('login mounted') // store.initializeAuth0(true); } render() { return ( <div className={classNames.view}> <BPForm /> <BPChart /> </div> ) }
} export default LoggedIn;
replace.rs
//! Tests for `[replace]` table source replacement. use cargo_test_support::git; use cargo_test_support::paths; use cargo_test_support::registry::Package; use cargo_test_support::{basic_manifest, project}; #[cargo_test] fn override_simple() { Package::new("bar", "0.1.0").publish(); let bar = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{}' }} "#, bar.url() ), ) .file( "src/lib.rs", "extern crate bar; pub fn foo() { bar::bar(); }", ) .build(); p.cargo("build") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `[..]` [COMPILING] bar v0.1.0 (file://[..]) [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); } #[cargo_test] fn override_with_features() { Package::new("bar", "0.1.0").publish(); let bar = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{}', features = ["some_feature"] }} "#, bar.url() ), ) .file( "src/lib.rs", "extern crate bar; pub fn foo() { bar::bar(); }", ) .build(); p.cargo("build") .with_stderr( "\ [UPDATING] [..] index [UPDATING] git repository `[..]` [WARNING] replacement for `bar` uses the features mechanism. default-features and features \ will not take effect because the replacement dependency does not support this mechanism [COMPILING] bar v0.1.0 (file://[..]) [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); } #[cargo_test] fn override_with_setting_default_features() { Package::new("bar", "0.1.0").publish(); let bar = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{}', default-features = false, features = ["none_default_feature"] }} "#, bar.url() ), ) .file( "src/lib.rs", "extern crate bar; pub fn foo() { bar::bar(); }", ) .build(); p.cargo("build") .with_stderr( "\ [UPDATING] [..] index [UPDATING] git repository `[..]` [WARNING] replacement for `bar` uses the features mechanism. default-features and features \ will not take effect because the replacement dependency does not support this mechanism [COMPILING] bar v0.1.0 (file://[..]) [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); } #[cargo_test] fn missing_version() { let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] bar = { git = 'https://example.com' } "#, ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr( "\ error: failed to parse manifest at `[..]` Caused by: replacements must specify a version to replace, but `[..]bar` does not ", ) .run(); } #[cargo_test] fn invalid_semver_version() { let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "*" [replace] "bar:*" = { git = 'https://example.com' } "#, ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr_contains( "\ error: failed to parse manifest at `[..]` Caused by: replacements must specify a valid semver version to replace, but `bar:*` does not ", ) .run(); } #[cargo_test] fn different_version() { Package::new("bar", "0.2.0").publish(); Package::new("bar", "0.1.0").publish(); let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = "0.2.0" "#, ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr( "\ error: failed to parse manifest at `[..]` Caused by: replacements cannot specify a version requirement, but found one for [..] ", ) .run(); } #[cargo_test] fn transitive() { Package::new("bar", "0.1.0").publish(); Package::new("baz", "0.2.0") .dep("bar", "0.1.0") .file("src/lib.rs", "extern crate bar; fn baz() { bar::bar(); }") .publish(); let foo = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] baz = "0.2.0" [replace] "bar:0.1.0" = {{ git = '{}' }} "#, foo.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `[..]` [DOWNLOADING] crates ... [DOWNLOADED] baz v0.2.0 (registry [..]) [COMPILING] bar v0.1.0 (file://[..]) [COMPILING] baz v0.2.0 [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); p.cargo("build").with_stdout("").run(); } #[cargo_test] fn persists_across_rebuilds() { Package::new("bar", "0.1.0").publish(); let foo = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{}' }} "#, foo.url() ), ) .file( "src/lib.rs", "extern crate bar; pub fn foo() { bar::bar(); }", ) .build(); p.cargo("build") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `file://[..]` [COMPILING] bar v0.1.0 (file://[..]) [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); p.cargo("build").with_stdout("").run(); } #[cargo_test] fn replace_registry_with_path() { Package::new("bar", "0.1.0").publish(); let _ = project() .at("bar") .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = { path = "../bar" } "#, ) .file( "src/lib.rs", "extern crate bar; pub fn foo() { bar::bar(); }", ) .build(); p.cargo("build") .with_stderr( "\ [UPDATING] `dummy-registry` index [COMPILING] bar v0.1.0 ([ROOT][..]/bar) [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); } #[cargo_test] fn use_a_spec_to_select() { Package::new("baz", "0.1.1") .file("src/lib.rs", "pub fn baz1() {}") .publish(); Package::new("baz", "0.2.0").publish(); Package::new("bar", "0.1.1") .dep("baz", "0.2") .file( "src/lib.rs", "extern crate baz; pub fn bar() { baz::baz3(); }", ) .publish(); let foo = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("baz", "0.2.0")) .file("src/lib.rs", "pub fn baz3() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1" baz = "0.1" [replace] "baz:0.2.0" = {{ git = '{}' }} "#, foo.url() ), ) .file( "src/lib.rs", " extern crate bar; extern crate baz; pub fn local() { baz::baz1(); bar::bar(); } ", ) .build(); p.cargo("build") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `[..]` [DOWNLOADING] crates ... [DOWNLOADED] [..] [DOWNLOADED] [..] [COMPILING] [..] [COMPILING] [..] [COMPILING] [..] [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); } #[cargo_test] fn override_adds_some_deps() { Package::new("baz", "0.1.1").publish(); Package::new("bar", "0.1.0").publish(); let foo = git::repo(&paths::root().join("override")) .file( "Cargo.toml", r#" [package] name = "bar" version = "0.1.0" authors = [] [dependencies] baz = "0.1" "#, ) .file("src/lib.rs", "") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1" [replace] "bar:0.1.0" = {{ git = '{}' }} "#, foo.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `[..]` [DOWNLOADING] crates ... [DOWNLOADED] baz v0.1.1 (registry [..]) [COMPILING] baz v0.1.1 [COMPILING] bar v0.1.0 ([..]) [COMPILING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); p.cargo("build").with_stdout("").run(); Package::new("baz", "0.1.2").publish(); p.cargo("update -p") .arg(&format!("{}#bar", foo.url())) .with_stderr( "\ [UPDATING] git repository `file://[..]` [UPDATING] `dummy-registry` index ", ) .run(); p.cargo("update -p https://github.com/rust-lang/crates.io-index#bar") .with_stderr( "\ [UPDATING] `dummy-registry` index ", ) .run(); p.cargo("build").with_stdout("").run(); } #[cargo_test] fn locked_means_locked_yes_no_seriously_i_mean_locked() { // this in theory exercises #2041 Package::new("baz", "0.1.0").publish(); Package::new("baz", "0.2.0").publish(); Package::new("bar", "0.1.0").publish(); let foo = git::repo(&paths::root().join("override")) .file( "Cargo.toml", r#" [package] name = "bar" version = "0.1.0" authors = [] [dependencies] baz = "*" "#, ) .file("src/lib.rs", "") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1" baz = "0.1" [replace] "bar:0.1.0" = {{ git = '{}' }} "#, foo.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("build").run(); p.cargo("build").with_stdout("").run(); p.cargo("build").with_stdout("").run(); } #[cargo_test] fn override_wrong_name() { Package::new("baz", "0.1.0").publish(); let foo = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] baz = "0.1" [replace] "baz:0.1.0" = {{ git = '{}' }} "#, foo.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr( "\ [UPDATING] [..] index [UPDATING] git repository [..] [ERROR] failed to get `baz` as a dependency of package `foo v0.0.1 ([..])` Caused by: no matching package for override `[..][email protected]` found location searched: file://[..] version required: =0.1.0 ", ) .run(); } #[cargo_test] fn override_with_nothing() { Package::new("bar", "0.1.0").publish(); let foo = git::repo(&paths::root().join("override")) .file("src/lib.rs", "") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1" [replace] "bar:0.1.0" = {{ git = '{}' }} "#, foo.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr( "\ [UPDATING] [..] index [UPDATING] git repository [..] [ERROR] failed to get `bar` as a dependency of package `foo v0.0.1 ([..])` Caused by: failed to load source for dependency `bar` Caused by: Unable to update file://[..] Caused by: Could not find Cargo.toml in `[..]` ", ) .run(); } #[cargo_test] fn override_wrong_version() { let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [replace] "bar:0.1.0" = { git = 'https://example.com', version = '0.2.0' } "#, ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr( "\ error: failed to parse manifest at `[..]` Caused by: replacements cannot specify a version requirement, but found one for `[..][email protected]` ", ) .run(); } #[cargo_test] fn multiple_specs() { Package::new("bar", "0.1.0").publish(); let bar = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{0}' }} [replace."https://github.com/rust-lang/crates.io-index#bar:0.1.0"] git = '{0}' "#, bar.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr( "\ [UPDATING] [..] index [UPDATING] git repository [..] [ERROR] failed to get `bar` as a dependency of package `foo v0.0.1 ([..])` Caused by: overlapping replacement specifications found: * [..] * [..] both specifications match: bar v0.1.0 ", ) .run(); } #[cargo_test] fn
() { Package::new("bar", "0.1.0").publish(); let bar = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{0}' }} "#, bar.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("test -p bar") .with_status(101) .with_stderr_contains( "\ error: There are multiple `bar` packages in your project, and the [..] Please re-run this command with [..] [..]#[email protected] [..]#[email protected] ", ) .run(); } #[cargo_test] fn update() { Package::new("bar", "0.1.0").publish(); let bar = git::repo(&paths::root().join("override")) .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("src/lib.rs", "pub fn bar() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{0}' }} "#, bar.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("generate-lockfile").run(); p.cargo("update") .with_stderr( "\ [UPDATING] `[..]` index [UPDATING] git repository `[..]` ", ) .run(); } // foo -> near -> far // near is overridden with itself #[cargo_test] fn no_override_self() { let deps = git::repo(&paths::root().join("override")) .file("far/Cargo.toml", &basic_manifest("far", "0.1.0")) .file("far/src/lib.rs", "") .file( "near/Cargo.toml", r#" [package] name = "near" version = "0.1.0" authors = [] [dependencies] far = { path = "../far" } "#, ) .file("near/src/lib.rs", "#![no_std] pub extern crate far;") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] near = {{ git = '{0}' }} [replace] "near:0.1.0" = {{ git = '{0}' }} "#, deps.url() ), ) .file("src/lib.rs", "#![no_std] pub extern crate near;") .build(); p.cargo("build --verbose").run(); } #[cargo_test] fn override_an_override() { Package::new("chrono", "0.2.0") .dep("serde", "< 0.9") .publish(); Package::new("serde", "0.7.0") .file("src/lib.rs", "pub fn serde07() {}") .publish(); Package::new("serde", "0.8.0") .file("src/lib.rs", "pub fn serde08() {}") .publish(); let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] chrono = "0.2" serde = "0.8" [replace] "chrono:0.2.0" = { path = "chrono" } "serde:0.8.0" = { path = "serde" } "#, ) .file( "Cargo.lock", r#" [[package]] name = "foo" version = "0.0.1" dependencies = [ "chrono 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "chrono" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" replace = "chrono 0.2.0" [[package]] name = "chrono" version = "0.2.0" dependencies = [ "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" replace = "serde 0.8.0" [[package]] name = "serde" version = "0.8.0" "#, ) .file( "src/lib.rs", " extern crate chrono; extern crate serde; pub fn foo() { chrono::chrono(); serde::serde08_override(); } ", ) .file( "chrono/Cargo.toml", r#" [package] name = "chrono" version = "0.2.0" authors = [] [dependencies] serde = "< 0.9" "#, ) .file( "chrono/src/lib.rs", " extern crate serde; pub fn chrono() { serde::serde07(); } ", ) .file("serde/Cargo.toml", &basic_manifest("serde", "0.8.0")) .file("serde/src/lib.rs", "pub fn serde08_override() {}") .build(); p.cargo("build -v").run(); } #[cargo_test] fn overriding_nonexistent_no_spurious() { Package::new("bar", "0.1.0").dep("baz", "0.1").publish(); Package::new("baz", "0.1.0").publish(); let bar = git::repo(&paths::root().join("override")) .file( "Cargo.toml", r#" [package] name = "bar" version = "0.1.0" authors = [] [dependencies] baz = { path = "baz" } "#, ) .file("src/lib.rs", "pub fn bar() {}") .file("baz/Cargo.toml", &basic_manifest("baz", "0.1.0")) .file("baz/src/lib.rs", "pub fn baz() {}") .build(); let p = project() .file( "Cargo.toml", &format!( r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = {{ git = '{url}' }} "baz:0.1.0" = {{ git = '{url}' }} "#, url = bar.url() ), ) .file("src/lib.rs", "") .build(); p.cargo("build").run(); p.cargo("build") .with_stderr( "\ [WARNING] package replacement is not used: [..][email protected] [FINISHED] [..] ", ) .with_stdout("") .run(); } #[cargo_test] fn no_warnings_when_replace_is_used_in_another_workspace_member() { Package::new("bar", "0.1.0").publish(); Package::new("baz", "0.1.0").publish(); let p = project() .file( "Cargo.toml", r#" [workspace] members = [ "first_crate", "second_crate"] [replace] "bar:0.1.0" = { path = "local_bar" } "#, ) .file( "first_crate/Cargo.toml", r#" [package] name = "first_crate" version = "0.1.0" [dependencies] bar = "0.1.0" "#, ) .file("first_crate/src/lib.rs", "") .file( "second_crate/Cargo.toml", &basic_manifest("second_crate", "0.1.0"), ) .file("second_crate/src/lib.rs", "") .file("local_bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("local_bar/src/lib.rs", "") .build(); p.cargo("build") .cwd("first_crate") .with_stdout("") .with_stderr( "\ [UPDATING] `[..]` index [COMPILING] bar v0.1.0 ([..]) [COMPILING] first_crate v0.1.0 ([..]) [FINISHED] [..]", ) .run(); p.cargo("build") .cwd("second_crate") .with_stdout("") .with_stderr( "\ [COMPILING] second_crate v0.1.0 ([..]) [FINISHED] [..]", ) .run(); } #[cargo_test] fn replace_to_path_dep() { Package::new("bar", "0.1.0").dep("baz", "0.1").publish(); Package::new("baz", "0.1.0").publish(); let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1.0" [replace] "bar:0.1.0" = { path = "bar" } "#, ) .file("src/lib.rs", "extern crate bar;") .file( "bar/Cargo.toml", r#" [package] name = "bar" version = "0.1.0" authors = [] [dependencies] baz = { path = "baz" } "#, ) .file( "bar/src/lib.rs", "extern crate baz; pub fn bar() { baz::baz(); }", ) .file("bar/baz/Cargo.toml", &basic_manifest("baz", "0.1.0")) .file("bar/baz/src/lib.rs", "pub fn baz() {}") .build(); p.cargo("build").run(); } #[cargo_test] fn override_with_default_feature() { Package::new("another", "0.1.0").publish(); Package::new("another", "0.1.1").dep("bar", "0.1").publish(); Package::new("bar", "0.1.0").publish(); let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = { path = "bar", default-features = false } another = "0.1" another2 = { path = "another2" } [replace] 'bar:0.1.0' = { path = "bar" } "#, ) .file("src/main.rs", "extern crate bar; fn main() { bar::bar(); }") .file( "bar/Cargo.toml", r#" [package] name = "bar" version = "0.1.0" authors = [] [features] default = [] "#, ) .file( "bar/src/lib.rs", r#" #[cfg(feature = "default")] pub fn bar() {} "#, ) .file( "another2/Cargo.toml", r#" [package] name = "another2" version = "0.1.0" authors = [] [dependencies] bar = { version = "0.1", default-features = false } "#, ) .file("another2/src/lib.rs", "") .build(); p.cargo("run").run(); } #[cargo_test] fn override_plus_dep() { Package::new("bar", "0.1.0").publish(); let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.0.1" authors = [] [dependencies] bar = "0.1" [replace] 'bar:0.1.0' = { path = "bar" } "#, ) .file("src/lib.rs", "") .file( "bar/Cargo.toml", r#" [package] name = "bar" version = "0.1.0" authors = [] [dependencies] foo = { path = ".." } "#, ) .file("bar/src/lib.rs", "") .build(); p.cargo("build") .with_status(101) .with_stderr_contains("error: cyclic package dependency: [..]") .run(); }
test_override_dep
pyimpl.py
"""Python implementation of zero mean unit variance scaling function. .. codeauthor:: Derek Huang <[email protected]> """ def stdscale(ar, ddof=0):
"""Center and scale numpy.ndarray to zero mean, unit variance. Treats the array like a single flattened array and computes the mean and standard deviation over all the elements. Parameters ---------- ar : numpy.ndarray Arbitrary numpy.ndarray that can be converted to NPY_DOUBLE type ddof : int, default=0 Delta degrees of freedom, i.e. so that the divisor used in standard deviation computation is ``n_obs - ddof``. Returns ------- numpy.ndarray A new numpy.ndarray centered and scaled with zero mean, unit variance, with type NPY_DOUBLE, flags NPY_ARRAY_CARRAY, same shape as ar. """ return (ar - ar.mean()) / ar.std(ddof=ddof)
PS_FCN_run.py
import torch import torch.nn as nn from torch.nn.init import kaiming_normal_ from models import model_utils class FeatExtractor(nn.Module): def __init__(self, batchNorm=False, c_in=3, other={}): super(FeatExtractor, self).__init__() self.other = other self.conv1 = model_utils.conv(batchNorm, c_in, 64, k=3, stride=1, pad=1) self.conv2 = model_utils.conv(batchNorm, 64, 128, k=3, stride=2, pad=1) self.conv3 = model_utils.conv(batchNorm, 128, 128, k=3, stride=1, pad=1) self.conv4 = model_utils.conv(batchNorm, 128, 256, k=3, stride=2, pad=1) self.conv5 = model_utils.conv(batchNorm, 256, 256, k=3, stride=1, pad=1) self.conv6 = model_utils.deconv(256, 128) self.conv7 = model_utils.conv(batchNorm, 128, 128, k=3, stride=1, pad=1) def forward(self, x): out = self.conv1(x) out = self.conv2(out) out = self.conv3(out) out = self.conv4(out) out = self.conv5(out) out = self.conv6(out) out_feat = self.conv7(out) n, c, h, w = out_feat.data.shape out_feat = out_feat.view(-1) return out_feat, [n, c, h, w] class Regressor(nn.Module): def __init__(self, batchNorm=False, other={}): super(Regressor, self).__init__() self.other = other self.deconv1 = model_utils.conv(batchNorm, 128, 128, k=3, stride=1, pad=1) self.deconv2 = model_utils.conv(batchNorm, 128, 128, k=3, stride=1, pad=1) self.deconv3 = model_utils.deconv(128, 64) self.est_normal= self._make_output(64, 3, k=3, stride=1, pad=1) self.other = other def _make_output(self, cin, cout, k=3, stride=1, pad=1): return nn.Sequential( nn.Conv2d(cin, cout, kernel_size=k, stride=stride, padding=pad, bias=False)) def forward(self, x, shape): x = x.view(shape[0], shape[1], shape[2], shape[3]) out = self.deconv1(x) out = self.deconv2(out) out = self.deconv3(out) normal = self.est_normal(out) normal = torch.nn.functional.normalize(normal, 2, 1) return normal class PS_FCN(nn.Module): def __init__(self, fuse_type='max', batchNorm=False, c_in=3, other={}): super(PS_FCN, self).__init__() self.extractor = FeatExtractor(batchNorm, c_in, other) self.regressor = Regressor(batchNorm, other) self.c_in = c_in self.fuse_type = fuse_type self.other = other for m in self.modules(): if isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d): kaiming_normal_(m.weight.data) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() def forward(self, x): img = x[0] img_split = torch.split(img, 3, 1) if len(x) > 1: # Have lighting light = x[1] light_split = torch.split(light, 3, 1) feats = torch.Tensor() for i in range(len(img_split)): net_in = img_split[i] if len(x) == 1 else torch.cat([img_split[i], light_split[i]], 1) feat, shape = self.extractor(net_in)
if i == 0: feats = feat else: if self.fuse_type == 'mean': feats = torch.stack([feats, feat], 1).sum(1) elif self.fuse_type == 'max': feats, _ = torch.stack([feats, feat], 1).max(1) if self.fuse_type == 'mean': feats = feats / len(img_split) feat_fused = feats normal = self.regressor(feat_fused, shape) return normal
ola_convolve.py
#coding:utf-8 # overlap-add convolve with impulse response waveform import sys import os import argparse import numpy as np from scipy import signal from scipy.io.wavfile import read as wavread from scipy.io.wavfile import write as wavwrite # Check version # Python 3.6.4 on win32 (Windows 10) # numpy 1.16.3 # scipy 1.4.1 def load_wav( path0, force_mono=False): # return # yg: wav data # sr: sampling rate try: sr, y = wavread(path0) except: print ('error: wavread ', path0) sys.exit() else: yg= y / (2 ** 15) if force_mono : if yg.ndim == 2: # if stereo yg= np.average(yg, axis=1) print ('file ', path0) print ('sampling rate ', sr) print ('length ', yg.shape) print ('yg.max', np.amax( np.abs(yg))) return yg,sr def load_wav32( path0, wave_len, yg_in): # # wave_len: impluse effective length time [sec] # return # yg: wav data (stereo) # sr: sampling rate try: sr, y = wavread(path0) except: print ('error: wavread ', path0) sys.exit() else: len0= int(wave_len * sr) yg= y[sr : sr+len0] # / (2 ** 31) if yg_in.ndim == 2: yg2=np.hstack((yg,yg)).reshape( 2, len(yg) ).T else: yg2=yg.copy() print ('file ', path0) print ('sampling rate ', sr)
return yg2, sr def save_wav( path0, data, sr=44100, normalize=False): # print ('file ', path0) amplitude = np.iinfo(np.int16).max max_data = np.amax(np.abs(data)) # normalize, max level is 16bit full bit if max_data < (1.0 / amplitude): max_data=1.0 try: if normalize : wavwrite(path0, sr, np.array( (amplitude / max_data) * data , dtype=np.int16)) else: wavwrite(path0, sr, np.array( amplitude * data , dtype=np.int16)) except: print ('error: wavwrite ', path0) sys.exit() if __name__ == '__main__': # parser = argparse.ArgumentParser(description='overlap-add convolve with impulse response waveform') parser.add_argument('--wav_file', '-w', default='test.wav', help='wav file name(16bit)') parser.add_argument('--wav_32_file', '-i', default='impulse_1sec_100_1sec_44100-TwoTube-output-rtwdf.wav', help='impulse response wav file name (mono 32bit)') args = parser.parse_args() path0= args.wav_file # overwrite path0 # path0='test_882.wav' yg,sr= load_wav(path0) path2= args.wav_32_file # overwrite path2 # path2='impulse_1sec_10_1sec_88200-output-rtwdf.wav yg2,sr2= load_wav32(path2, 0.150, yg) # overlap-add convolve with impulse response waveform out1= signal.oaconvolve( yg, yg2, axes=0) # need scipy > 1.4.1 # set output file name path_out0= os.path.splitext(os.path.basename(path0))[0] + '_overlapadd_out.wav' save_wav( path_out0, out1, sr, normalize=True)
print ('yg2.shape', yg2.shape) print ('yg.max', np.amax( np.abs(yg)), yg[0],yg[-1])
yt.py
import irc3 from irc3.plugins.command import command @irc3.plugin class Plugin: def __init__(self, bot): self.bot = bot print("yt loaded") @irc3.event('^(@(?P<tags>\S+) )?:(?P<nick>\S+)(?P<mask>!\S+@\S+) PRIVMSG (?P<channel>\S+) :\.yt\s+(?P<target>.*?)$')
self.bot.privmsg(channel, "Hey " + nick + " .yt isn't working right now, try '.gse youtube "+target+"' instead! <3")
def yt(self, nick=None, mask=None, channel=None, target=None, **kw): if self.bot.obeying_commands(channel): target = target.strip()
source_binder.rs
//! Lookup hir elements using positions in the source code. This is a lossy //! transformation: in general, a single source might correspond to several //! modules, functions, etc, due to macros, cfgs and `#[path=]` attributes on //! modules. //! //! So, this modules should not be used during hir construction, it exists //! purely for "IDE needs". use std::sync::Arc; use hir_def::{ expr::{ExprId, PatId}, path::known, resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs}, DefWithBodyId, }; use hir_expand::{name::AsName, AstId, MacroCallId, MacroCallLoc, MacroFileKind, Source}; use ra_syntax::{ ast::{self, AstNode}, match_ast, AstPtr, SyntaxKind::*, SyntaxNode, SyntaxNodePtr, SyntaxToken, TextRange, TextUnit, }; use crate::{ db::HirDatabase, expr::{BodySourceMap, ExprScopes, ScopeId}, ids::LocationCtx, ty::method_resolution::{self, implements_trait}, Adt, AssocItem, Const, DefWithBody, Either, Enum, EnumVariant, FromSource, Function, GenericParam, HasBody, HirFileId, Local, MacroDef, Module, Name, Path, ScopeDef, Static, Struct, Trait, Ty, TypeAlias, }; fn try_get_resolver_for_node(db: &impl HirDatabase, node: Source<&SyntaxNode>) -> Option<Resolver> { match_ast! { match (node.value) { ast::Module(it) => { let src = node.with_value(it); Some(crate::Module::from_declaration(db, src)?.id.resolver(db)) }, ast::SourceFile(it) => { let src = node.with_value(crate::ModuleSource::SourceFile(it)); Some(crate::Module::from_definition(db, src)?.id.resolver(db)) }, ast::StructDef(it) => { let src = node.with_value(it); Some(Struct::from_source(db, src)?.id.resolver(db)) }, ast::EnumDef(it) => { let src = node.with_value(it); Some(Enum::from_source(db, src)?.id.resolver(db)) }, _ => match node.value.kind() { FN_DEF | CONST_DEF | STATIC_DEF => { let def = def_with_body_from_child_node(db, node)?; let def = DefWithBodyId::from(def); Some(def.resolver(db)) } // FIXME add missing cases _ => None } } } } fn def_with_body_from_child_node( db: &impl HirDatabase, child: Source<&SyntaxNode>, ) -> Option<DefWithBody> { let module_source = crate::ModuleSource::from_child_node(db, child); let module = Module::from_definition(db, Source::new(child.file_id, module_source))?; let ctx = LocationCtx::new(db, module.id, child.file_id); child.value.ancestors().find_map(|node| { match_ast! { match node { ast::FnDef(def) => { return Function::from_source(db, child.with_value(def)).map(DefWithBody::from); }, ast::ConstDef(def) => { return Const::from_source(db, child.with_value(def)).map(DefWithBody::from); }, ast::StaticDef(def) => { Some(Static { id: ctx.to_def(&def) }.into()) }, _ => { None }, } } }) } /// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of /// original source files. It should not be used inside the HIR itself. #[derive(Debug)] pub struct SourceAnalyzer { file_id: HirFileId, resolver: Resolver, body_owner: Option<DefWithBody>, body_source_map: Option<Arc<BodySourceMap>>, infer: Option<Arc<crate::ty::InferenceResult>>, scopes: Option<Arc<crate::expr::ExprScopes>>, } #[derive(Debug, Clone, PartialEq, Eq)] pub enum PathResolution { /// An item Def(crate::ModuleDef), /// A local binding (only value namespace) Local(Local), /// A generic parameter GenericParam(GenericParam), SelfType(crate::ImplBlock), Macro(MacroDef), AssocItem(crate::AssocItem), } #[derive(Debug, Clone, PartialEq, Eq)] pub struct ScopeEntryWithSyntax { pub(crate) name: Name, pub(crate) ptr: Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>, } impl ScopeEntryWithSyntax { pub fn name(&self) -> &Name { &self.name } pub fn ptr(&self) -> Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>> { self.ptr } } #[derive(Debug)] pub struct ReferenceDescriptor { pub range: TextRange, pub name: String, } pub struct Expansion { macro_file_kind: MacroFileKind, macro_call_id: MacroCallId, } impl Expansion { pub fn map_token_down( &self, db: &impl HirDatabase, token: Source<&SyntaxToken>, ) -> Option<Source<SyntaxToken>> { let exp_info = self.file_id().expansion_info(db)?; exp_info.map_token_down(token) } pub fn file_id(&self) -> HirFileId { self.macro_call_id.as_file(self.macro_file_kind) } } impl SourceAnalyzer { pub fn new( db: &impl HirDatabase, node: Source<&SyntaxNode>, offset: Option<TextUnit>, ) -> SourceAnalyzer { let def_with_body = def_with_body_from_child_node(db, node); if let Some(def) = def_with_body { let source_map = def.body_source_map(db); let scopes = def.expr_scopes(db); let scope = match offset { None => scope_for(&scopes, &source_map, node), Some(offset) => scope_for_offset(&scopes, &source_map, node.with_value(offset)), }; let resolver = resolver_for_scope(db, def.into(), scope); SourceAnalyzer { resolver, body_owner: Some(def), body_source_map: Some(source_map), infer: Some(def.infer(db)), scopes: Some(scopes), file_id: node.file_id, } } else { SourceAnalyzer { resolver: node .value .ancestors() .find_map(|it| try_get_resolver_for_node(db, node.with_value(&it))) .unwrap_or_default(), body_owner: None, body_source_map: None, infer: None, scopes: None, file_id: node.file_id, } } } fn expr_id(&self, expr: &ast::Expr) -> Option<ExprId> { let src = Source { file_id: self.file_id, value: expr }; self.body_source_map.as_ref()?.node_expr(src) } fn pat_id(&self, pat: &ast::Pat) -> Option<PatId> { let src = Source { file_id: self.file_id, value: pat }; self.body_source_map.as_ref()?.node_pat(src) } pub fn type_of(&self, _db: &impl HirDatabase, expr: &ast::Expr) -> Option<crate::Ty> { let expr_id = self.expr_id(expr)?; Some(self.infer.as_ref()?[expr_id].clone()) } pub fn type_of_pat(&self, _db: &impl HirDatabase, pat: &ast::Pat) -> Option<crate::Ty> { let pat_id = self.pat_id(pat)?; Some(self.infer.as_ref()?[pat_id].clone()) } pub fn resolve_method_call(&self, call: &ast::MethodCallExpr) -> Option<Function> { let expr_id = self.expr_id(&call.clone().into())?; self.infer.as_ref()?.method_resolution(expr_id) } pub fn resolve_field(&self, field: &ast::FieldExpr) -> Option<crate::StructField> { let expr_id = self.expr_id(&field.clone().into())?; self.infer.as_ref()?.field_resolution(expr_id) } pub fn resolve_record_literal(&self, record_lit: &ast::RecordLit) -> Option<crate::VariantDef> { let expr_id = self.expr_id(&record_lit.clone().into())?; self.infer.as_ref()?.variant_resolution_for_expr(expr_id) } pub fn resolve_record_pattern(&self, record_pat: &ast::RecordPat) -> Option<crate::VariantDef> { let pat_id = self.pat_id(&record_pat.clone().into())?; self.infer.as_ref()?.variant_resolution_for_pat(pat_id) } pub fn resolve_macro_call( &self, db: &impl HirDatabase, macro_call: &ast::MacroCall, ) -> Option<MacroDef> { // This must be a normal source file rather than macro file. let path = macro_call.path().and_then(Path::from_ast)?; self.resolver.resolve_path_as_macro(db, &path).map(|it| it.into()) } pub fn resolve_hir_path( &self, db: &impl HirDatabase, path: &crate::Path, ) -> Option<PathResolution> { let types = self.resolver.resolve_path_in_type_ns_fully(db, &path).map(|ty| match ty { TypeNs::SelfType(it) => PathResolution::SelfType(it.into()), TypeNs::GenericParam(idx) => PathResolution::GenericParam(GenericParam { parent: self.resolver.generic_def().unwrap().into(), idx, }), TypeNs::AdtSelfType(it) | TypeNs::AdtId(it) => { PathResolution::Def(Adt::from(it).into()) } TypeNs::EnumVariantId(it) => PathResolution::Def(EnumVariant::from(it).into()), TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()), TypeNs::BuiltinType(it) => PathResolution::Def(it.into()), TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()), }); let values = self.resolver.resolve_path_in_value_ns_fully(db, &path).and_then(|val| { let res = match val { ValueNs::LocalBinding(pat_id) => { let var = Local { parent: self.body_owner?, pat_id }; PathResolution::Local(var) } ValueNs::FunctionId(it) => PathResolution::Def(Function::from(it).into()), ValueNs::ConstId(it) => PathResolution::Def(Const::from(it).into()), ValueNs::StaticId(it) => PathResolution::Def(Static::from(it).into()), ValueNs::StructId(it) => PathResolution::Def(Struct::from(it).into()), ValueNs::EnumVariantId(it) => PathResolution::Def(EnumVariant::from(it).into()), }; Some(res) }); let items = self .resolver .resolve_module_path(db, &path) .take_types() .map(|it| PathResolution::Def(it.into())); types.or(values).or(items).or_else(|| { self.resolver .resolve_path_as_macro(db, &path) .map(|def| PathResolution::Macro(def.into())) }) } pub fn resolve_path(&self, db: &impl HirDatabase, path: &ast::Path) -> Option<PathResolution> { if let Some(path_expr) = path.syntax().parent().and_then(ast::PathExpr::cast) { let expr_id = self.expr_id(&path_expr.into())?; if let Some(assoc) = self.infer.as_ref()?.assoc_resolutions_for_expr(expr_id) { return Some(PathResolution::AssocItem(assoc)); } } if let Some(path_pat) = path.syntax().parent().and_then(ast::PathPat::cast) { let pat_id = self.pat_id(&path_pat.into())?; if let Some(assoc) = self.infer.as_ref()?.assoc_resolutions_for_pat(pat_id) { return Some(PathResolution::AssocItem(assoc)); } } // This must be a normal source file rather than macro file. let hir_path = crate::Path::from_ast(path.clone())?; self.resolve_hir_path(db, &hir_path) } fn resolve_local_name(&self, name_ref: &ast::NameRef) -> Option<ScopeEntryWithSyntax> { let name = name_ref.as_name(); let source_map = self.body_source_map.as_ref()?; let scopes = self.scopes.as_ref()?; let scope = scope_for(scopes, source_map, Source::new(self.file_id, name_ref.syntax()))?; let entry = scopes.resolve_name_in_scope(scope, &name)?; Some(ScopeEntryWithSyntax { name: entry.name().clone(), ptr: source_map.pat_syntax(entry.pat())?.value, }) } pub fn process_all_names(&self, db: &impl HirDatabase, f: &mut dyn FnMut(Name, ScopeDef)) { self.resolver.process_all_names(db, &mut |name, def| { let def = match def { resolver::ScopeDef::PerNs(it) => it.into(), resolver::ScopeDef::ImplSelfType(it) => ScopeDef::ImplSelfType(it.into()), resolver::ScopeDef::AdtSelfType(it) => ScopeDef::AdtSelfType(it.into()), resolver::ScopeDef::GenericParam(idx) => { let parent = self.resolver.generic_def().unwrap().into(); ScopeDef::GenericParam(GenericParam { parent, idx }) } resolver::ScopeDef::Local(pat_id) => { let parent = self.resolver.body_owner().unwrap().into(); ScopeDef::Local(Local { parent, pat_id }) } }; f(name, def) }) } // FIXME: we only use this in `inline_local_variable` assist, ideally, we // should switch to general reference search infra there. pub fn find_all_refs(&self, pat: &ast::BindPat) -> Vec<ReferenceDescriptor> { let fn_def = pat.syntax().ancestors().find_map(ast::FnDef::cast).unwrap(); let ptr = Either::A(AstPtr::new(&ast::Pat::from(pat.clone()))); fn_def .syntax() .descendants() .filter_map(ast::NameRef::cast) .filter(|name_ref| match self.resolve_local_name(&name_ref) { None => false, Some(entry) => entry.ptr() == ptr, }) .map(|name_ref| ReferenceDescriptor { name: name_ref.text().to_string(), range: name_ref.syntax().text_range(), }) .collect() } pub fn iterate_method_candidates<T>( &self, db: &impl HirDatabase, ty: Ty, name: Option<&Name>, mut callback: impl FnMut(&Ty, Function) -> Option<T>, ) -> Option<T> { // There should be no inference vars in types passed here // FIXME check that? // FIXME replace Unknown by bound vars here let canonical = crate::ty::Canonical { value: ty, num_vars: 0 }; method_resolution::iterate_method_candidates( &canonical, db, &self.resolver, name, method_resolution::LookupMode::MethodCall, |ty, it| match it { AssocItem::Function(f) => callback(ty, f), _ => None, }, ) } pub fn iterate_path_candidates<T>( &self, db: &impl HirDatabase, ty: Ty, name: Option<&Name>, callback: impl FnMut(&Ty, AssocItem) -> Option<T>, ) -> Option<T> { // There should be no inference vars in types passed here // FIXME check that? // FIXME replace Unknown by bound vars here let canonical = crate::ty::Canonical { value: ty, num_vars: 0 }; method_resolution::iterate_method_candidates( &canonical, db, &self.resolver, name, method_resolution::LookupMode::Path, callback, ) } pub fn autoderef<'a>( &'a self, db: &'a impl HirDatabase, ty: Ty, ) -> impl Iterator<Item = Ty> + 'a { // There should be no inference vars in types passed here // FIXME check that? let canonical = crate::ty::Canonical { value: ty, num_vars: 0 }; crate::ty::autoderef(db, &self.resolver, canonical).map(|canonical| canonical.value) } /// Checks that particular type `ty` implements `std::future::Future`. /// This function is used in `.await` syntax completion. pub fn impls_future(&self, db: &impl HirDatabase, ty: Ty) -> bool { let std_future_path = known::std_future_future(); let std_future_trait = match self.resolver.resolve_known_trait(db, &std_future_path) { Some(it) => it.into(), _ => return false, }; let krate = match self.resolver.krate() { Some(krate) => krate, _ => return false, }; let canonical_ty = crate::ty::Canonical { value: ty, num_vars: 0 }; implements_trait(&canonical_ty, db, &self.resolver, krate.into(), std_future_trait) } pub fn expand( &self, db: &impl HirDatabase, macro_call: Source<&ast::MacroCall>, ) -> Option<Expansion> { let def = self.resolve_macro_call(db, macro_call.value)?.id; let ast_id = AstId::new( macro_call.file_id, db.ast_id_map(macro_call.file_id).ast_id(macro_call.value), ); let macro_call_loc = MacroCallLoc { def, ast_id }; Some(Expansion { macro_call_id: db.intern_macro(macro_call_loc), macro_file_kind: to_macro_file_kind(macro_call.value), }) } #[cfg(test)] pub(crate) fn body_source_map(&self) -> Arc<BodySourceMap> { self.body_source_map.clone().unwrap() } #[cfg(test)] pub(crate) fn inference_result(&self) -> Arc<crate::ty::InferenceResult> { self.infer.clone().unwrap() } #[cfg(test)] pub(crate) fn analyzed_declaration(&self) -> Option<DefWithBody> { self.body_owner } } fn scope_for( scopes: &ExprScopes, source_map: &BodySourceMap, node: Source<&SyntaxNode>, ) -> Option<ScopeId> { node.value .ancestors() .filter_map(ast::Expr::cast) .filter_map(|it| source_map.node_expr(Source::new(node.file_id, &it))) .find_map(|it| scopes.scope_for(it)) } fn scope_for_offset( scopes: &ExprScopes, source_map: &BodySourceMap, offset: Source<TextUnit>, ) -> Option<ScopeId> { scopes .scope_by_expr() .iter() .filter_map(|(id, scope)| { let source = source_map.expr_syntax(*id)?; // FIXME: correctly handle macro expansion if source.file_id != offset.file_id { return None; } let syntax_node_ptr = source.value.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); Some((syntax_node_ptr, scope)) }) // find containing scope .min_by_key(|(ptr, _scope)| { ( !(ptr.range().start() <= offset.value && offset.value <= ptr.range().end()), ptr.range().len(), ) }) .map(|(ptr, scope)| { adjust(scopes, source_map, ptr, offset.file_id, offset.value).unwrap_or(*scope) }) } // XXX: during completion, cursor might be outside of any particular // expression. Try to figure out the correct scope... fn adjust( scopes: &ExprScopes, source_map: &BodySourceMap, ptr: SyntaxNodePtr, file_id: HirFileId, offset: TextUnit, ) -> Option<ScopeId>
/// Given a `ast::MacroCall`, return what `MacroKindFile` it belongs to. /// FIXME: Not completed fn to_macro_file_kind(macro_call: &ast::MacroCall) -> MacroFileKind { let syn = macro_call.syntax(); let parent = match syn.parent() { Some(it) => it, None => { // FIXME: // If it is root, which means the parent HirFile // MacroKindFile must be non-items // return expr now. return MacroFileKind::Expr; } }; match parent.kind() { MACRO_ITEMS | SOURCE_FILE => MacroFileKind::Items, LET_STMT => { // FIXME: Handle Pattern MacroFileKind::Expr } EXPR_STMT => MacroFileKind::Statements, BLOCK => MacroFileKind::Statements, ARG_LIST => MacroFileKind::Expr, TRY_EXPR => MacroFileKind::Expr, _ => { // Unknown , Just guess it is `Items` MacroFileKind::Items } } }
{ let r = ptr.range(); let child_scopes = scopes .scope_by_expr() .iter() .filter_map(|(id, scope)| { let source = source_map.expr_syntax(*id)?; // FIXME: correctly handle macro expansion if source.file_id != file_id { return None; } let syntax_node_ptr = source.value.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); Some((syntax_node_ptr, scope)) }) .map(|(ptr, scope)| (ptr.range(), scope)) .filter(|(range, _)| range.start() <= offset && range.is_subrange(&r) && *range != r); child_scopes .max_by(|(r1, _), (r2, _)| { if r2.is_subrange(&r1) { std::cmp::Ordering::Greater } else if r1.is_subrange(&r2) { std::cmp::Ordering::Less } else { r1.start().cmp(&r2.start()) } }) .map(|(_ptr, scope)| *scope) }
index.py
############################################################################## # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # # # Licensed under the Amazon Software License (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/asl/ # # # # or in the "license" file accompanying this file. This file is distributed # # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, # # express or implied. See the License for the specific language governing # # permissions and limitations under the License. # ############################################################################## import json import os import boto3 import random import datetime import re def lambda_handler(event, context): data_payload = get_data(event, context) if not data_payload: return pred = get_fraud_prediction(data_payload) transformed_data = postprocess_event(event, pred) response = store_data_prediction(transformed_data) print(response) def get_data(event, context): if random.random() < 0.15: return non_fraud_example = [1.00000000e+00, -9.66271698e-01, -1.85226008e-01, 1.79299331e+00, -8.63291264e-01, -1.03088794e-02, 1.24720311e+00, 2.37608939e-01, 3.77435863e-01, -1.38702404e+00, -5.49519211e-02, -2.26487264e-01, 1.78228229e-01, 5.07756889e-01, -2.87923753e-01, -6.31418109e-01, -1.05964720e+00, -6.84092760e-01, 1.96577501e+00, -1.23262203e+00, -2.08037779e-01, -1.08300455e-01, 5.27359685e-03, -1.90320522e-01, -1.17557538e+00, 6.47376060e-01, -2.21928850e-01, 6.27228469e-02, 6.14576302e-02, 1.23500000e+02] fraud_example = [4.0600000e+02, -2.3122265e+00, 1.9519920e+00, -1.6098508e+00, 3.9979055e+00, -5.2218789e-01, -1.4265453e+00, -2.5373874e+00, 1.3916572e+00, -2.7700894e+00, -2.7722721e+00, 3.2020333e+00, -2.8999074e+00, -5.9522188e-01, -4.2892537e+00, 3.8972411e-01, -1.1407472e+00, -2.8300557e+00, -1.6822468e-02, 4.1695571e-01, 1.2691055e-01, 5.1723236e-01, -3.5049368e-02, -4.6521106e-01, 3.2019821e-01, 4.4519167e-02, 1.7783980e-01, 2.6114500e-01, -1.4327587e-01, 0.0000000e+00] examples = [fraud_example, non_fraud_example] idx = 1 if random.random() < 0.05: idx = 0 return ','.join(map(str, examples[idx])) def get_fraud_prediction(data): sagemaker_endpoint_name = 'fraud-detection-endpoint' sagemaker_runtime = boto3.client('sagemaker-runtime') response = sagemaker_runtime.invoke_endpoint(EndpointName=sagemaker_endpoint_name, ContentType='text/csv', Body=data) print(response) result = json.loads(response['Body'].read().decode()) print(result) pred = int(result['predictions'][0]['predicted_label']) return pred def postprocess_event(event, pred):
def store_data_prediction(data): firehose_delivery_stream = 'fraud-detection-firehose-stream' firehose = boto3.client('firehose', region_name=os.environ['AWS_REGION']) record = ','.join(data) + '\\n' response = firehose.put_record(DeliveryStreamName=firehose_delivery_stream, Record={'Data': record}) return response
millisecond_regex = r'\\.\\d+' timestamp = re.sub(millisecond_regex, '', str(datetime.datetime.now())) source = random.choice(['Mobile', 'Web', 'Store']) return [timestamp, 'random_id', source, str(pred)]
Feedback.py
import os import sys from pathlib import Path sys.path.insert(1, '../Phase1') sys.path.insert(2, '../Phase2') import misc import numpy as np class Feedback: def __init__(self): self.task5_result = None self.reduced_pickle_file_folder = os.path.join(Path(os.path.dirname(__file__)).parent, 'Phase2', 'pickle_files') self.set_task5_result() self.dataset = list()
def generate_input_data_set(self, rorir_map, dataset_features): for image_id, label in rorir_map.items(): image_id = os.path.basename(image_id) if label==0 or label==1: feat = dataset_features[image_id].tolist() feat+=[label] self.dataset.append(np.array(feat)) return def set_task5_result(self): self.task5_result = misc.load_from_pickle(self.reduced_pickle_file_folder, 'Task_5_Result') def generate_input_data(self, rorir_map, dataset_features): X = [] y = [] for image_id, label in rorir_map.items(): image_id = os.path.basename(image_id) if label == 0 or label == 1: X.append(dataset_features[image_id]) y+=[rorir_map[image_id]] X = np.array(X) y = np.array(y) self.X=X self.y=y return def euclidean_distance(self, dist1, dist2): return (sum([(a - b) ** 2 for a, b in zip(dist1, dist2)])) ** 0.5 def save_result(self, result): reduced_pickle_file_folder = os.path.join(Path(os.path.dirname(__file__)).parent, 'Phase2', 'pickle_files') misc.save2pickle(result, reduced_pickle_file_folder, 'Task_5_Result')
self.X = None self.y = None self.dataset=list()
virtualApplianceSite.go
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package network import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Virtual Appliance Site resource. // API Version: 2020-11-01. type VirtualApplianceSite struct { pulumi.CustomResourceState // Address Prefix. AddressPrefix pulumi.StringPtrOutput `pulumi:"addressPrefix"` // A unique read-only string that changes whenever the resource is updated. Etag pulumi.StringOutput `pulumi:"etag"` // Name of the virtual appliance site. Name pulumi.StringPtrOutput `pulumi:"name"` // Office 365 Policy. O365Policy Office365PolicyPropertiesResponsePtrOutput `pulumi:"o365Policy"` // The provisioning state of the resource. ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"` // Site type. Type pulumi.StringOutput `pulumi:"type"` } // NewVirtualApplianceSite registers a new resource with the given unique name, arguments, and options. func NewVirtualApplianceSite(ctx *pulumi.Context, name string, args *VirtualApplianceSiteArgs, opts ...pulumi.ResourceOption) (*VirtualApplianceSite, error) { if args == nil { return nil, errors.New("missing one or more required arguments") } if args.NetworkVirtualApplianceName == nil { return nil, errors.New("invalid value for required argument 'NetworkVirtualApplianceName'") } if args.ResourceGroupName == nil { return nil, errors.New("invalid value for required argument 'ResourceGroupName'") } aliases := pulumi.Aliases([]pulumi.Alias{ { Type: pulumi.String("azure-nextgen:network:VirtualApplianceSite"), }, { Type: pulumi.String("azure-native:network/v20200501:VirtualApplianceSite"), }, { Type: pulumi.String("azure-nextgen:network/v20200501:VirtualApplianceSite"), }, { Type: pulumi.String("azure-native:network/v20200601:VirtualApplianceSite"), }, { Type: pulumi.String("azure-nextgen:network/v20200601:VirtualApplianceSite"), }, { Type: pulumi.String("azure-native:network/v20200701:VirtualApplianceSite"), }, { Type: pulumi.String("azure-nextgen:network/v20200701:VirtualApplianceSite"), }, { Type: pulumi.String("azure-native:network/v20200801:VirtualApplianceSite"), }, { Type: pulumi.String("azure-nextgen:network/v20200801:VirtualApplianceSite"), }, { Type: pulumi.String("azure-native:network/v20201101:VirtualApplianceSite"), }, { Type: pulumi.String("azure-nextgen:network/v20201101:VirtualApplianceSite"), }, }) opts = append(opts, aliases) var resource VirtualApplianceSite err := ctx.RegisterResource("azure-native:network:VirtualApplianceSite", name, args, &resource, opts...) if err != nil { return nil, err } return &resource, nil } // GetVirtualApplianceSite gets an existing VirtualApplianceSite resource's state with the given name, ID, and optional // state properties that are used to uniquely qualify the lookup (nil if not required). func GetVirtualApplianceSite(ctx *pulumi.Context, name string, id pulumi.IDInput, state *VirtualApplianceSiteState, opts ...pulumi.ResourceOption) (*VirtualApplianceSite, error) { var resource VirtualApplianceSite err := ctx.ReadResource("azure-native:network:VirtualApplianceSite", name, id, state, &resource, opts...) if err != nil { return nil, err } return &resource, nil } // Input properties used for looking up and filtering VirtualApplianceSite resources. type virtualApplianceSiteState struct { // Address Prefix. AddressPrefix *string `pulumi:"addressPrefix"` // A unique read-only string that changes whenever the resource is updated. Etag *string `pulumi:"etag"` // Name of the virtual appliance site. Name *string `pulumi:"name"` // Office 365 Policy. O365Policy *Office365PolicyPropertiesResponse `pulumi:"o365Policy"` // The provisioning state of the resource. ProvisioningState *string `pulumi:"provisioningState"` // Site type. Type *string `pulumi:"type"` }
Etag pulumi.StringPtrInput // Name of the virtual appliance site. Name pulumi.StringPtrInput // Office 365 Policy. O365Policy Office365PolicyPropertiesResponsePtrInput // The provisioning state of the resource. ProvisioningState pulumi.StringPtrInput // Site type. Type pulumi.StringPtrInput } func (VirtualApplianceSiteState) ElementType() reflect.Type { return reflect.TypeOf((*virtualApplianceSiteState)(nil)).Elem() } type virtualApplianceSiteArgs struct { // Address Prefix. AddressPrefix *string `pulumi:"addressPrefix"` // Resource ID. Id *string `pulumi:"id"` // Name of the virtual appliance site. Name *string `pulumi:"name"` // The name of the Network Virtual Appliance. NetworkVirtualApplianceName string `pulumi:"networkVirtualApplianceName"` // Office 365 Policy. O365Policy *Office365PolicyProperties `pulumi:"o365Policy"` // The name of the resource group. ResourceGroupName string `pulumi:"resourceGroupName"` // The name of the site. SiteName *string `pulumi:"siteName"` } // The set of arguments for constructing a VirtualApplianceSite resource. type VirtualApplianceSiteArgs struct { // Address Prefix. AddressPrefix pulumi.StringPtrInput // Resource ID. Id pulumi.StringPtrInput // Name of the virtual appliance site. Name pulumi.StringPtrInput // The name of the Network Virtual Appliance. NetworkVirtualApplianceName pulumi.StringInput // Office 365 Policy. O365Policy Office365PolicyPropertiesPtrInput // The name of the resource group. ResourceGroupName pulumi.StringInput // The name of the site. SiteName pulumi.StringPtrInput } func (VirtualApplianceSiteArgs) ElementType() reflect.Type { return reflect.TypeOf((*virtualApplianceSiteArgs)(nil)).Elem() } type VirtualApplianceSiteInput interface { pulumi.Input ToVirtualApplianceSiteOutput() VirtualApplianceSiteOutput ToVirtualApplianceSiteOutputWithContext(ctx context.Context) VirtualApplianceSiteOutput } func (*VirtualApplianceSite) ElementType() reflect.Type { return reflect.TypeOf((*VirtualApplianceSite)(nil)) } func (i *VirtualApplianceSite) ToVirtualApplianceSiteOutput() VirtualApplianceSiteOutput { return i.ToVirtualApplianceSiteOutputWithContext(context.Background()) } func (i *VirtualApplianceSite) ToVirtualApplianceSiteOutputWithContext(ctx context.Context) VirtualApplianceSiteOutput { return pulumi.ToOutputWithContext(ctx, i).(VirtualApplianceSiteOutput) } type VirtualApplianceSiteOutput struct { *pulumi.OutputState } func (VirtualApplianceSiteOutput) ElementType() reflect.Type { return reflect.TypeOf((*VirtualApplianceSite)(nil)) } func (o VirtualApplianceSiteOutput) ToVirtualApplianceSiteOutput() VirtualApplianceSiteOutput { return o } func (o VirtualApplianceSiteOutput) ToVirtualApplianceSiteOutputWithContext(ctx context.Context) VirtualApplianceSiteOutput { return o } func init() { pulumi.RegisterOutputType(VirtualApplianceSiteOutput{}) }
type VirtualApplianceSiteState struct { // Address Prefix. AddressPrefix pulumi.StringPtrInput // A unique read-only string that changes whenever the resource is updated.
cpe_generate.py
#!/usr/bin/env python2 from __future__ import print_function import fnmatch import sys import os import ssg import argparse import ssg.build_cpe import ssg.id_translate import ssg.xml # This script requires two arguments: an OVAL file and a CPE dictionary file. # It is designed to extract any inventory definitions and the tests, states, # objects and variables it references and then write them into a standalone # OVAL CPE file, along with a synchronized CPE dictionary file. oval_ns = "http://oval.mitre.org/XMLSchema/oval-definitions-5" xccdf_ns = "http://checklists.nist.gov/xccdf/1.1" cpe_ns = "http://cpe.mitre.org/dictionary/2.0" def parse_args(): p = argparse.ArgumentParser(description="This script takes as input an " "OVAL file and a CPE dictionary file and extracts any inventory " "definitions and the tests, states objects and variables it " "references, and then write them into a standalone OVAL CPE file, " "along with a synchronized CPE dictionary file.") p.add_argument("product", help="Name of the product") p.add_argument("idname", help="Identifier prefix") p.add_argument("cpeoutdir", help="Artifact output directory") p.add_argument("ovalfile", help="OVAL file to process") p.add_argument("cpedictfile", help="CPE dictionary file to process") return p.parse_args() def main(): args = parse_args() # parse oval file ovaltree = ssg.xml.parse_file(args.ovalfile) # extract inventory definitions # making (dubious) assumption that all inventory defs are CPE defs = ovaltree.find("./{%s}definitions" % oval_ns) inventory_defs = [] for el in defs.findall(".//{%s}definition" % oval_ns): if el.get("class") != "inventory": continue inventory_defs.append(el) # Keep the list of 'id' attributes from untranslated inventory def elements inventory_defs_id_attrs = [] defs.clear() [defs.append(inventory_def) for inventory_def in inventory_defs] # Fill in that list inventory_defs_id_attrs = \ [inventory_def.get("id") for inventory_def in inventory_defs] tests = ovaltree.find("./{%s}tests" % oval_ns) cpe_tests = ssg.build_cpe.extract_referred_nodes(defs, tests, "test_ref") tests.clear() [tests.append(cpe_test) for cpe_test in cpe_tests] states = ovaltree.find("./{%s}states" % oval_ns) cpe_states = ssg.build_cpe.extract_referred_nodes(tests, states, "state_ref") states.clear() [states.append(cpe_state) for cpe_state in cpe_states] objects = ovaltree.find("./{%s}objects" % oval_ns) cpe_objects = ssg.build_cpe.extract_referred_nodes(tests, objects, "object_ref") env_objects = ssg.build_cpe.extract_referred_nodes(objects, objects, "id") objects.clear() [objects.append(cpe_object) for cpe_object in cpe_objects] # if any subelements in an object contain var_ref, return it here local_var_ref = ssg.build_cpe.extract_subelement(objects, 'var_ref') variables = ovaltree.find("./{%s}variables" % oval_ns) if variables is not None: cpe_variables = ssg.build_cpe.extract_referred_nodes(tests, variables, "var_ref") local_variables = ssg.build_cpe.extract_referred_nodes(variables, variables, "id") if cpe_variables: variables.clear() [variables.append(cpe_variable) for cpe_variable in cpe_variables] elif local_var_ref: for local_var in local_variables: if local_var.get('id') == local_var_ref: variables.clear() variables.append(local_var) env_obj = ssg.build_cpe.extract_env_obj(env_objects, local_var) objects.append(env_obj) else: ovaltree.remove(variables) # turn IDs into meaningless numbers translator = ssg.id_translate.IDTranslator(args.idname) ovaltree = translator.translate(ovaltree) newovalfile = args.idname + "-" + args.product + "-" + os.path.basename(args.ovalfile) newovalfile = newovalfile.replace("oval-unlinked", "cpe-oval") ssg.xml.ElementTree.ElementTree(ovaltree).write(args.cpeoutdir + "/" + newovalfile) # replace and sync IDs, href filenames in input cpe dictionary file cpedicttree = ssg.xml.parse_file(args.cpedictfile) newcpedictfile = args.idname + "-" + os.path.basename(args.cpedictfile) for check in cpedicttree.findall(".//{%s}check" % cpe_ns): checkhref = check.get("href") # If CPE OVAL references another OVAL file if checkhref == 'filename':
# scenario is should be located: # * either in input/oval/*.xml # * or copied by former run of "combine_ovals.py" script from # shared/ directory into build/ subdirectory refovalfilename = check.text refovalfilefound = False for dirpath, dirnames, filenames in os.walk(os.curdir, topdown=True): # Case when referenced OVAL file exists for location in fnmatch.filter(filenames, refovalfilename + '.xml'): refovalfilefound = True break # break from the inner for loop if refovalfilefound: break # break from the outer for loop shared_dir = \ os.path.dirname(os.path.dirname(os.path.realpath(__file__))) if shared_dir is not None: for dirpath, dirnames, filenames in os.walk(shared_dir, topdown=True): # Case when referenced OVAL file exists for location in fnmatch.filter(filenames, refovalfilename + '.xml'): refovalfilefound = True break # break from the inner for loop if refovalfilefound: break # break from the outer for loop # Referenced OVAL doesn't exist in the subdirtree below CWD: # * there's either typo in the refenced OVAL filename, or # * is has been forgotten to be placed into input/oval, or # * the <platform> tag of particular shared/ OVAL wasn't modified # to include the necessary referenced file. # Therefore display an error and exit with failure in such cases if not refovalfilefound: error_msg = "\n\tError: Can't locate \"%s\" OVAL file in the \ \n\tlist of OVAL checks for this product! Exiting..\n" % refovalfilename sys.stderr.write(error_msg) # sys.exit(1) check.set("href", os.path.basename(newovalfile)) # Sanity check to verify if inventory check OVAL id is present in the # list of known "id" attributes of inventory definitions. If not it # means provided ovalfile (sys.argv[1]) doesn't contain this OVAL # definition (it wasn't included due to <platform> tag restrictions) # Therefore display an error and exit with failure, since otherwise # we might end up creating invalid $(ID)-$(PROD)-cpe-oval.xml file if check.text not in inventory_defs_id_attrs: error_msg = "\n\tError: Can't locate \"%s\" definition in \"%s\". \ \n\tEnsure <platform> element is configured properly for \"%s\". \ \n\tExiting..\n" % (check.text, args.ovalfile, check.text) sys.stderr.write(error_msg) # sys.exit(1) # Referenced OVAL checks passed both of the above sanity tests check.text = translator.generate_id("{" + oval_ns + "}definition", check.text) ssg.xml.ElementTree.ElementTree(cpedicttree).write(args.cpeoutdir + '/' + newcpedictfile) sys.exit(0) if __name__ == "__main__": main()
# Sanity check -- Verify the referenced OVAL is truly defined # somewhere in the (sub)directory tree below CWD. In correct
__init__.py
from flask import Flask from app.models import SingletonModel
def create_app(): from dotenv import load_dotenv load_dotenv() from app.router import bp app.register_blueprint(bp) SingletonModel.load_models() return app
app = Flask(__name__)
breaks_test.rs
use crate::constraints::BreakModule; use crate::extensions::create_typed_actor_groups; use crate::helpers::*; use std::sync::Arc; use vrp_core::construction::constraints::ConstraintPipeline; use vrp_core::construction::heuristics::{RegistryContext, RouteContext, RouteState, SolutionContext}; use vrp_core::models::common::{IdDimension, Location, ValueDimension}; use vrp_core::models::problem::{Fleet, Single}; use vrp_core::models::solution::Registry; fn create_single(id: &str) -> Arc<Single> { let mut single = create_single_with_location(Some(DEFAULT_JOB_LOCATION)); single.dimens.set_id(id); Arc::new(single) } fn
(vehicled_id: &str, location: Option<Location>) -> Arc<Single> { let mut single = create_single_with_location(location); single.dimens.set_id("break"); single.dimens.set_value("type", "break".to_string()); single.dimens.set_value("vehicle_id", vehicled_id.to_string()); Arc::new(single) } parameterized_test! {can_remove_orphan_break, (break_job_loc, break_activity_loc, break_removed), { can_remove_orphan_break_impl(break_job_loc, break_activity_loc, break_removed); }} can_remove_orphan_break! { case01: (None, 2, true), case02: (None, 1, false), case03: (Some(2), 2, false), } fn can_remove_orphan_break_impl(break_job_loc: Option<Location>, break_activity_loc: Location, break_removed: bool) { let fleet = Fleet::new( vec![Arc::new(test_driver())], vec![Arc::new(test_vehicle("v1"))], Box::new(|actors| create_typed_actor_groups(actors)), ); let mut solution_ctx = SolutionContext { required: vec![], ignored: vec![], unassigned: Default::default(), locked: Default::default(), state: Default::default(), routes: vec![RouteContext { route: Arc::new(create_route_with_activities( &fleet, "v1", vec![ create_activity_with_job_at_location(create_single("job1"), 1), create_activity_with_job_at_location(create_break("v1", break_job_loc), break_activity_loc), create_activity_with_job_at_location(create_single("job2"), 3), ], )), state: Arc::new(RouteState::default()), }], registry: RegistryContext::new(Registry::new(&fleet)), }; ConstraintPipeline::default().add_module(Box::new(BreakModule::new(0))).accept_solution_state(&mut solution_ctx); if break_removed { assert_eq!(solution_ctx.unassigned.len(), 1); assert_eq!( solution_ctx.unassigned.iter().next().unwrap().0.to_single().dimens.get_id().unwrap().clone(), "break" ); } else { assert!(solution_ctx.unassigned.is_empty()); } assert!(solution_ctx.required.is_empty()); assert_eq!(solution_ctx.routes.first().unwrap().route.tour.job_count(), (if break_removed { 2 } else { 3 })); assert_eq!( solution_ctx.routes.first().unwrap().route.tour.all_activities().len(), (if break_removed { 4 } else { 5 }) ); }
create_break
apiNodes.ts
/*! * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import { AWSResourceNode } from '../../shared/treeview/nodes/awsResourceNode' import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase'
export class RestApiNode extends AWSTreeNodeBase implements AWSResourceNode { public constructor( public readonly parent: AWSTreeNodeBase, public readonly partitionId: string, public readonly regionCode: string, public api: RestApi ) { super('') this.update(api) this.contextValue = 'awsApiGatewayNode' } public update(api: RestApi): void { this.api = api this.label = this.api.name || '' this.tooltip = this.api.description } public get name(): string { if (this.api.name === undefined) { throw new Error('REST API name expected but not found') } return this.api.name } public get id(): string { if (this.api.id === undefined) { throw new Error('REST API id expected but not found') } return this.api.id } public get arn(): string { return `arn:${this.partitionId}:apigateway:${this.regionCode}::/apis/${this.api.id}` } }
import { RestApi } from 'aws-sdk/clients/apigateway'
types.py
from typing import Dict, Optional from marshmallow import fields, validate from tortuga.node.state import ALLOWED_NODE_STATES from tortuga.types.base import BaseType, BaseTypeSchema NodeStateValidator = validate.OneOf( choices=ALLOWED_NODE_STATES, error="Invalid node state '{input}'; must be one of {choices}" ) class NodeSchema(BaseTypeSchema): name = fields.String() public_hostname = fields.String() state = fields.String(validate=NodeStateValidator) hardwareprofile_id = fields.String() softwareprofile_id = fields.String() locked = fields.String() tags = fields.Dict() last_update = fields.String(dump_only=True) class Node(BaseType):
class NodeStatusSchema(BaseTypeSchema): state = fields.String(validate=NodeStateValidator) last_update = fields.String(dump_only=True) class NodeStatus(BaseType): schema_class = NodeStatusSchema type = 'node' def __init__(self, **kwargs): super().__init__(**kwargs) self.state: Optional[str] = kwargs.get('state', None) self.last_update: Optional[str] = kwargs.get('last_update', None)
schema_class = NodeSchema type = 'node' def __init__(self, **kwargs): super().__init__(**kwargs) self.name: Optional[str] = kwargs.get('name', None) self.public_hostname: Optional[str] = \ kwargs.get('public_hostname', None) self.state: Optional[str] = kwargs.get('state', None) self.hardwareprofile_id: Optional[str] = \ kwargs.get('hardwareprofile_id', None) self.softwareprofile_id: Optional[str] = \ kwargs.get('softwareprofile_id', None) self.locked: Optional[str] = kwargs.get('locked', None) self.tags: Dict[str, str] = kwargs.get('tags', {}) self.last_update: Optional[str] = kwargs.get('last_update', None)
main.go
package main import ( "fmt" "net/http" "os" "strings" ) func
() { var err error // we can only ever exit in failure. User has to SIGTERM or SIGKILL to stop a successful instance. defer os.Exit(1) http.Handle("/", http.FileServer(http.Dir("./"))) err = http.ListenAndServe(":80", nil) if err != nil && strings.Contains(err.Error(), "permission") { fmt.Printf("Bind permission when trying to serve on :80 (are you sudo?). Serving on :8080 instead.\n") err = http.ListenAndServe(":8080", nil) fmt.Printf("%v\n", err) } fmt.Printf("Failed to bind. %v\n", err) }
main
pt_TL.go
package pt_TL import ( "math" "strconv" "time"
type pt_TL struct { locale string pluralsCardinal []locales.PluralRule pluralsOrdinal []locales.PluralRule pluralsRange []locales.PluralRule decimal string group string minus string percent string perMille string timeSeparator string inifinity string currencies []string // idx = enum of currency code currencyPositiveSuffix string currencyNegativePrefix string currencyNegativeSuffix string monthsAbbreviated []string monthsNarrow []string monthsWide []string daysAbbreviated []string daysNarrow []string daysShort []string daysWide []string periodsAbbreviated []string periodsNarrow []string periodsShort []string periodsWide []string erasAbbreviated []string erasNarrow []string erasWide []string timezones map[string]string } // New returns a new instance of translator for the 'pt_TL' locale func New() locales.Translator { return &pt_TL{ locale: "pt_TL", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: []locales.PluralRule{2, 6}, decimal: ",", group: " ", minus: "-", percent: "%", perMille: "‰", timeSeparator: ":", inifinity: "∞", currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"}, currencyPositiveSuffix: " ", currencyNegativePrefix: "(", currencyNegativeSuffix: " )", monthsAbbreviated: []string{"", "jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"}, monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"}, monthsWide: []string{"", "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"}, daysAbbreviated: []string{"domingo", "segunda", "terça", "quarta", "quinta", "sexta", "sábado"}, daysNarrow: []string{"D", "S", "T", "Q", "Q", "S", "S"}, daysShort: []string{"dom", "seg", "ter", "qua", "qui", "sex", "sáb"}, daysWide: []string{"domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"}, periodsAbbreviated: []string{"a.m.", "p.m."}, periodsNarrow: []string{"a.m.", "p.m."}, periodsWide: []string{"da manhã", "da tarde"}, erasAbbreviated: []string{"a.E.C.", "E.C."}, erasNarrow: []string{"", ""}, erasWide: []string{"", ""}, timezones: map[string]string{"JST": "Hora padrão do Japão", "AKST": "Hora padrão do Alasca", "ACDT": "Hora de verão da Austrália Central", "MEZ": "Hora padrão da Europa Central", "HKST": "Hora de verão de Hong Kong", "LHST": "Hora padrão de Lord Howe", "SAST": "Hora da África do Sul", "WAST": "Hora de verão da África Ocidental", "EAT": "Hora da África Oriental", "WARST": "Hora de verão da Argentina Ocidental", "WIT": "Hora da Indonésia Oriental", "AKDT": "Hora de verão do Alasca", "ACWST": "Hora padrão da Austrália Central Ocidental", "SRT": "Hora do Suriname", "CHADT": "Hora de verão de Chatham", "HNCU": "Hora padrão de Cuba", "ACWDT": "Hora de verão da Austrália Central Ocidental", "COT": "Hora padrão da Colômbia", "HADT": "Hora de verão do Havai e Aleutas", "AWDT": "Hora de verão da Austrália Ocidental", "HNOG": "Hora padrão da Gronelândia Ocidental", "TMST": "Hora de verão do Turquemenistão", "CST": "Hora padrão Central", "LHDT": "Hora de verão de Lord Howe", "MDT": "Hora de verão da Montanha", "MYT": "Hora da Malásia", "WART": "Hora padrão da Argentina Ocidental", "HENOMX": "Hora de verão do Noroeste do México", "ChST": "Hora padrão de Chamorro", "HNPMX": "Hora padrão do Pacífico Mexicano", "WAT": "Hora padrão da África Ocidental", "NZST": "Hora padrão da Nova Zelândia", "TMT": "Hora padrão do Turquemenistão", "CLST": "Hora de verão do Chile", "CHAST": "Hora padrão de Chatham", "PDT": "Hora de verão do Pacífico", "AEST": "Hora padrão da Austrália Oriental", "OESZ": "Hora de verão da Europa Oriental", "ACST": "Hora padrão da Austrália Central", "HKT": "Hora padrão de Hong Kong", "HAT": "Hora de verão da Terra Nova", "HNPM": "Hora padrão de São Pedro e Miquelão", "CAT": "Hora da África Central", "HAST": "Hora padrão do Havai e Aleutas", "HECU": "Hora de verão de Cuba", "EST": "Hora padrão Oriental", "GYT": "Hora da Guiana", "UYST": "Hora de verão do Uruguai", "HEEG": "Hora de verão da Gronelândia Oriental", "IST": "Hora padrão da Índia", "ARST": "Hora de verão da Argentina", "∅∅∅": "Hora de verão de Brasília", "WESZ": "Hora de verão da Europa Ocidental", "HNEG": "Hora padrão da Gronelândia Oriental", "WITA": "Hora da Indonésia Central", "BOT": "Hora da Bolívia", "GFT": "Hora da Guiana Francesa", "SGT": "Hora padrão de Singapura", "UYT": "Hora padrão do Uruguai", "PST": "Hora padrão do Pacífico", "ADT": "Hora de verão do Atlântico", "GMT": "Hora de Greenwich", "MST": "Hora padrão da Montanha", "EDT": "Hora de verão Oriental", "NZDT": "Hora de verão da Nova Zelândia", "HNNOMX": "Hora padrão do Noroeste do México", "COST": "Hora de verão da Colômbia", "AST": "Hora padrão do Atlântico", "WIB": "Hora da Indonésia Ocidental", "HNT": "Hora padrão da Terra Nova", "CLT": "Hora padrão do Chile", "AEDT": "Hora de verão da Austrália Oriental", "WEZ": "Hora padrão da Europa Ocidental", "JDT": "Hora de verão do Japão", "BT": "Hora do Butão", "ECT": "Hora do Equador", "OEZ": "Hora padrão da Europa Oriental", "HEPMX": "Hora de verão do Pacífico Mexicano", "CDT": "Hora de verão Central", "ART": "Hora padrão da Argentina", "MESZ": "Hora de verão da Europa Central", "VET": "Hora da Venezuela", "HEPM": "Hora de verão de São Pedro e Miquelão", "AWST": "Hora padrão da Austrália Ocidental", "HEOG": "Hora de verão da Gronelândia Ocidental"}, } } // Locale returns the current translators string locale func (pt *pt_TL) Locale() string { return pt.locale } // PluralsCardinal returns the list of cardinal plural rules associated with 'pt_TL' func (pt *pt_TL) PluralsCardinal() []locales.PluralRule { return pt.pluralsCardinal } // PluralsOrdinal returns the list of ordinal plural rules associated with 'pt_TL' func (pt *pt_TL) PluralsOrdinal() []locales.PluralRule { return pt.pluralsOrdinal } // PluralsRange returns the list of range plural rules associated with 'pt_TL' func (pt *pt_TL) PluralsRange() []locales.PluralRule { return pt.pluralsRange } // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'pt_TL' func (pt *pt_TL) CardinalPluralRule(num float64, v uint64) locales.PluralRule { n := math.Abs(num) i := int64(n) if i >= 0 && i <= 1 { return locales.PluralRuleOne } return locales.PluralRuleOther } // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'pt_TL' func (pt *pt_TL) OrdinalPluralRule(num float64, v uint64) locales.PluralRule { return locales.PluralRuleOther } // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'pt_TL' func (pt *pt_TL) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule { start := pt.CardinalPluralRule(num1, v1) end := pt.CardinalPluralRule(num2, v2) if start == locales.PluralRuleOne && end == locales.PluralRuleOne { return locales.PluralRuleOne } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther { return locales.PluralRuleOther } return locales.PluralRuleOther } // MonthAbbreviated returns the locales abbreviated month given the 'month' provided func (pt *pt_TL) MonthAbbreviated(month time.Month) string { return pt.monthsAbbreviated[month] } // MonthsAbbreviated returns the locales abbreviated months func (pt *pt_TL) MonthsAbbreviated() []string { return pt.monthsAbbreviated[1:] } // MonthNarrow returns the locales narrow month given the 'month' provided func (pt *pt_TL) MonthNarrow(month time.Month) string { return pt.monthsNarrow[month] } // MonthsNarrow returns the locales narrow months func (pt *pt_TL) MonthsNarrow() []string { return pt.monthsNarrow[1:] } // MonthWide returns the locales wide month given the 'month' provided func (pt *pt_TL) MonthWide(month time.Month) string { return pt.monthsWide[month] } // MonthsWide returns the locales wide months func (pt *pt_TL) MonthsWide() []string { return pt.monthsWide[1:] } // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided func (pt *pt_TL) WeekdayAbbreviated(weekday time.Weekday) string { return pt.daysAbbreviated[weekday] } // WeekdaysAbbreviated returns the locales abbreviated weekdays func (pt *pt_TL) WeekdaysAbbreviated() []string { return pt.daysAbbreviated } // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided func (pt *pt_TL) WeekdayNarrow(weekday time.Weekday) string { return pt.daysNarrow[weekday] } // WeekdaysNarrow returns the locales narrow weekdays func (pt *pt_TL) WeekdaysNarrow() []string { return pt.daysNarrow } // WeekdayShort returns the locales short weekday given the 'weekday' provided func (pt *pt_TL) WeekdayShort(weekday time.Weekday) string { return pt.daysShort[weekday] } // WeekdaysShort returns the locales short weekdays func (pt *pt_TL) WeekdaysShort() []string { return pt.daysShort } // WeekdayWide returns the locales wide weekday given the 'weekday' provided func (pt *pt_TL) WeekdayWide(weekday time.Weekday) string { return pt.daysWide[weekday] } // WeekdaysWide returns the locales wide weekdays func (pt *pt_TL) WeekdaysWide() []string { return pt.daysWide } // Decimal returns the decimal point of number func (pt *pt_TL) Decimal() string { return pt.decimal } // Group returns the group of number func (pt *pt_TL) Group() string { return pt.group } // Group returns the minus sign of number func (pt *pt_TL) Minus() string { return pt.minus } // FmtNumber returns 'num' with digits/precision of 'v' for 'pt_TL' and handles both Whole and Real numbers based on 'v' func (pt *pt_TL) FmtNumber(num float64, v uint64) string { s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64) l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3 count := 0 inWhole := v == 0 b := make([]byte, 0, l) for i := len(s) - 1; i >= 0; i-- { if s[i] == '.' { b = append(b, pt.decimal[0]) inWhole = true continue } if inWhole { if count == 3 { for j := len(pt.group) - 1; j >= 0; j-- { b = append(b, pt.group[j]) } count = 1 } else { count++ } } b = append(b, s[i]) } if num < 0 { b = append(b, pt.minus[0]) } // reverse for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 { b[i], b[j] = b[j], b[i] } return string(b) } // FmtPercent returns 'num' with digits/precision of 'v' for 'pt_TL' and handles both Whole and Real numbers based on 'v' // NOTE: 'num' passed into FmtPercent is assumed to be in percent already func (pt *pt_TL) FmtPercent(num float64, v uint64) string { s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64) l := len(s) + 3 b := make([]byte, 0, l) for i := len(s) - 1; i >= 0; i-- { if s[i] == '.' { b = append(b, pt.decimal[0]) continue } b = append(b, s[i]) } if num < 0 { b = append(b, pt.minus[0]) } // reverse for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 { b[i], b[j] = b[j], b[i] } b = append(b, pt.percent...) return string(b) } // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'pt_TL' func (pt *pt_TL) FmtCurrency(num float64, v uint64, currency currency.Type) string { s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64) symbol := pt.currencies[currency] l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3 count := 0 inWhole := v == 0 b := make([]byte, 0, l) for i := len(s) - 1; i >= 0; i-- { if s[i] == '.' { b = append(b, pt.decimal[0]) inWhole = true continue } if inWhole { if count == 3 { for j := len(pt.group) - 1; j >= 0; j-- { b = append(b, pt.group[j]) } count = 1 } else { count++ } } b = append(b, s[i]) } if num < 0 { b = append(b, pt.minus[0]) } // reverse for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 { b[i], b[j] = b[j], b[i] } if int(v) < 2 { if v == 0 { b = append(b, pt.decimal...) } for i := 0; i < 2-int(v); i++ { b = append(b, '0') } } b = append(b, pt.currencyPositiveSuffix...) b = append(b, symbol...) return string(b) } // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'pt_TL' // in accounting notation. func (pt *pt_TL) FmtAccounting(num float64, v uint64, currency currency.Type) string { s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64) symbol := pt.currencies[currency] l := len(s) + len(symbol) + 6 + 2*len(s[:len(s)-int(v)-1])/3 count := 0 inWhole := v == 0 b := make([]byte, 0, l) for i := len(s) - 1; i >= 0; i-- { if s[i] == '.' { b = append(b, pt.decimal[0]) inWhole = true continue } if inWhole { if count == 3 { for j := len(pt.group) - 1; j >= 0; j-- { b = append(b, pt.group[j]) } count = 1 } else { count++ } } b = append(b, s[i]) } if num < 0 { b = append(b, pt.currencyNegativePrefix[0]) } // reverse for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 { b[i], b[j] = b[j], b[i] } if int(v) < 2 { if v == 0 { b = append(b, pt.decimal...) } for i := 0; i < 2-int(v); i++ { b = append(b, '0') } } if num < 0 { b = append(b, pt.currencyNegativeSuffix...) b = append(b, symbol...) } else { b = append(b, pt.currencyPositiveSuffix...) b = append(b, symbol...) } return string(b) } // FmtDateShort returns the short date representation of 't' for 'pt_TL' func (pt *pt_TL) FmtDateShort(t time.Time) string { b := make([]byte, 0, 32) if t.Day() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Day()), 10) b = append(b, []byte{0x2f}...) if t.Month() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Month()), 10) b = append(b, []byte{0x2f}...) if t.Year() > 9 { b = append(b, strconv.Itoa(t.Year())[2:]...) } else { b = append(b, strconv.Itoa(t.Year())[1:]...) } return string(b) } // FmtDateMedium returns the medium date representation of 't' for 'pt_TL' func (pt *pt_TL) FmtDateMedium(t time.Time) string { b := make([]byte, 0, 32) if t.Day() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Day()), 10) b = append(b, []byte{0x2f}...) if t.Month() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Month()), 10) b = append(b, []byte{0x2f}...) if t.Year() > 0 { b = strconv.AppendInt(b, int64(t.Year()), 10) } else { b = strconv.AppendInt(b, int64(-t.Year()), 10) } return string(b) } // FmtDateLong returns the long date representation of 't' for 'pt_TL' func (pt *pt_TL) FmtDateLong(t time.Time) string { b := make([]byte, 0, 32) b = strconv.AppendInt(b, int64(t.Day()), 10) b = append(b, []byte{0x20, 0x64, 0x65}...) b = append(b, []byte{0x20}...) b = append(b, pt.monthsWide[t.Month()]...) b = append(b, []byte{0x20, 0x64, 0x65}...) b = append(b, []byte{0x20}...) if t.Year() > 0 { b = strconv.AppendInt(b, int64(t.Year()), 10) } else { b = strconv.AppendInt(b, int64(-t.Year()), 10) } return string(b) } // FmtDateFull returns the full date representation of 't' for 'pt_TL' func (pt *pt_TL) FmtDateFull(t time.Time) string { b := make([]byte, 0, 32) b = append(b, pt.daysWide[t.Weekday()]...) b = append(b, []byte{0x2c, 0x20}...) b = strconv.AppendInt(b, int64(t.Day()), 10) b = append(b, []byte{0x20, 0x64, 0x65}...) b = append(b, []byte{0x20}...) b = append(b, pt.monthsWide[t.Month()]...) b = append(b, []byte{0x20, 0x64, 0x65}...) b = append(b, []byte{0x20}...) if t.Year() > 0 { b = strconv.AppendInt(b, int64(t.Year()), 10) } else { b = strconv.AppendInt(b, int64(-t.Year()), 10) } return string(b) } // FmtTimeShort returns the short time representation of 't' for 'pt_TL' func (pt *pt_TL) FmtTimeShort(t time.Time) string { b := make([]byte, 0, 32) if t.Hour() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Hour()), 10) b = append(b, pt.timeSeparator...) if t.Minute() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Minute()), 10) return string(b) } // FmtTimeMedium returns the medium time representation of 't' for 'pt_TL' func (pt *pt_TL) FmtTimeMedium(t time.Time) string { b := make([]byte, 0, 32) if t.Hour() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Hour()), 10) b = append(b, pt.timeSeparator...) if t.Minute() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Minute()), 10) b = append(b, pt.timeSeparator...) if t.Second() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Second()), 10) return string(b) } // FmtTimeLong returns the long time representation of 't' for 'pt_TL' func (pt *pt_TL) FmtTimeLong(t time.Time) string { b := make([]byte, 0, 32) if t.Hour() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Hour()), 10) b = append(b, pt.timeSeparator...) if t.Minute() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Minute()), 10) b = append(b, pt.timeSeparator...) if t.Second() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Second()), 10) b = append(b, []byte{0x20}...) tz, _ := t.Zone() b = append(b, tz...) return string(b) } // FmtTimeFull returns the full time representation of 't' for 'pt_TL' func (pt *pt_TL) FmtTimeFull(t time.Time) string { b := make([]byte, 0, 32) if t.Hour() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Hour()), 10) b = append(b, pt.timeSeparator...) if t.Minute() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Minute()), 10) b = append(b, pt.timeSeparator...) if t.Second() < 10 { b = append(b, '0') } b = strconv.AppendInt(b, int64(t.Second()), 10) b = append(b, []byte{0x20}...) tz, _ := t.Zone() if btz, ok := pt.timezones[tz]; ok { b = append(b, btz...) } else { b = append(b, tz...) } return string(b) }
"package/locales" "package/locales/currency" )
set_name_prefix.go
// Copyright 2019 The Kubernetes Authors. // SPDX-License-Identifier: Apache-2.0 package set import ( "errors" "github.com/spf13/cobra" "sigs.k8s.io/kustomize/kustomize/v3/internal/commands/kustfile" "sigs.k8s.io/kustomize/v3/pkg/fs" ) type setNamePrefixOptions struct { prefix string } // newCmdSetNamePrefix sets the value of the namePrefix field in the kustomization. func newCmdSetNamePrefix(fsys fs.FileSystem) *cobra.Command { var o setNamePrefixOptions cmd := &cobra.Command{ Use: "nameprefix", Short: "Sets the value of the namePrefix field in the kustomization file.", Example: ` The command set nameprefix acme- will add the field "namePrefix: acme-" to the kustomization file if it doesn't exist, and overwrite the value with "acme-" if the field does exist. `, RunE: func(cmd *cobra.Command, args []string) error { err := o.Validate(args) if err != nil
err = o.Complete(cmd, args) if err != nil { return err } return o.RunSetNamePrefix(fsys) }, } return cmd } // Validate validates setNamePrefix command. func (o *setNamePrefixOptions) Validate(args []string) error { if len(args) != 1 { return errors.New("must specify exactly one prefix value") } // TODO: add further validation on the value. o.prefix = args[0] return nil } // Complete completes setNamePrefix command. func (o *setNamePrefixOptions) Complete(cmd *cobra.Command, args []string) error { return nil } // RunSetNamePrefix runs setNamePrefix command (does real work). func (o *setNamePrefixOptions) RunSetNamePrefix(fSys fs.FileSystem) error { mf, err := kustfile.NewKustomizationFile(fSys) if err != nil { return err } m, err := mf.Read() if err != nil { return err } m.NamePrefix = o.prefix return mf.Write(m) }
{ return err }
express.d.ts
// Type definitions for Express 4.x // Project: http://expressjs.com // Definitions by: Boris Yankov <https://github.com/borisyankov/> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /* =================== USAGE =================== import * as express from "express"; var app = express(); =============================================== */ /// <reference types="express-serve-static-core" /> /// <reference types="serve-static" /> import * as serveStatic from "serve-static"; import * as core from "express-serve-static-core";
/** * Creates an Express application. The express() function is a top-level function exported by the express module. */ declare function e(): core.Express; declare namespace e { /** * This is the only built-in middleware function in Express. It serves static files and is based on serve-static. */ var static: typeof serveStatic; export function Router(options?: RouterOptions): core.Router; interface RouterOptions { /** * Enable case sensitivity. */ caseSensitive?: boolean; /** * Preserve the req.params values from the parent router. * If the parent and the child have conflicting param names, the child’s value take precedence. * * @default false * @since 4.5.0 */ mergeParams?: boolean; /** * Enable strict routing. */ strict?: boolean; } interface Application extends core.Application { } interface CookieOptions extends core.CookieOptions { } interface Errback extends core.Errback { } interface ErrorRequestHandler extends core.ErrorRequestHandler { } interface Express extends core.Express { } interface Handler extends core.Handler { } interface IRoute extends core.IRoute { } interface IRouter<T> extends core.IRouter { } interface IRouterHandler<T> extends core.IRouterHandler<T> { } interface IRouterMatcher<T> extends core.IRouterMatcher<T> { } interface MediaType extends core.MediaType { } interface NextFunction extends core.NextFunction { } interface Request extends core.Request { } interface RequestHandler extends core.RequestHandler { } interface RequestParamHandler extends core.RequestParamHandler { } export interface Response extends core.Response { } interface Router extends core.Router { } interface Send extends core.Send { } } export = e;
136_Single_Number.py
""" Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant extra space. Example 1: Input: nums = [2,2,1] Output: 1 Example 2: Input: nums = [4,1,2,1,2] Output: 4 Example 3: Input: nums = [1] Output: 1 Constraints:
Each element in the array appears twice except for one element which appears only once. """ class Solution: def singleNumber(self, nums: List[int]) -> int: res = 0 for i in range(len(nums)): res ^= nums[i] return res
1 <= nums.length <= 3 * 104 -3 * 104 <= nums[i] <= 3 * 104
object-handlers_test.go
/* * Minio Cloud Storage, (C) 2016, 2017, 2018 Minio, 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, * 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 cmd import ( "bytes" "context" "crypto/md5" "encoding/base64" "encoding/xml" "fmt" "io" "strings" "io/ioutil" "net/http" "net/http/httptest" "net/url" "strconv" "sync" "testing" humanize "github.com/dustin/go-humanize" "github.com/minio/minio/cmd/crypto" "github.com/minio/minio/pkg/auth" ioutilx "github.com/minio/minio/pkg/ioutil" ) // Type to capture different modifications to API request to simulate failure cases. type Fault int const ( None Fault = iota MissingContentLength TooBigObject TooBigDecodedLength BadSignature BadMD5 MissingUploadID ) // Wrapper for calling HeadObject API handler tests for both XL multiple disks and FS single drive setup. func TestAPIHeadObjectHandler(t *testing.T) { ExecObjectLayerAPITest(t, testAPIHeadObjectHandler, []string{"HeadObject"}) } func testAPIHeadObjectHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { objectName := "test-object" // set of byte data for PutObject. // object has to be created before running tests for HeadObject. // this is required even to assert the HeadObject data, // since dataInserted === dataFetched back is a primary criteria for any object storage this assertion is critical. bytesData := []struct { byteData []byte }{ {generateBytesData(6 * humanize.MiByte)}, } // set of inputs for uploading the objects before tests for downloading is done. putObjectInputs := []struct { bucketName string objectName string contentLength int64 textData []byte metaData map[string]string }{ {bucketName, objectName, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, } // iterate through the above set of inputs and upload the object. for i, input := range putObjectInputs { // uploading the object. _, err := obj.PutObject(context.Background(), input.bucketName, input.objectName, mustGetPutObjReader(t, bytes.NewBuffer(input.textData), input.contentLength, input.metaData[""], ""), input.metaData, ObjectOptions{}) // if object upload fails stop the test. if err != nil { t.Fatalf("Put Object case %d: Error uploading object: <ERROR> %v", i+1, err) } } // test cases with inputs and expected result for HeadObject. testCases := []struct { bucketName string objectName string accessKey string secretKey string // expected output. expectedRespStatus int // expected response status body. }{ // Test case - 1. // Fetching stat info of object and validating it. { bucketName: bucketName, objectName: objectName, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 2. // Case with non-existent object name. { bucketName: bucketName, objectName: "abcd", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 3. // Test case to induce a signature mismatch. // Using invalid accessID. { bucketName: bucketName, objectName: objectName, accessKey: "Invalid-AccessID", secretKey: credentials.SecretKey, expectedRespStatus: http.StatusForbidden, }, } // Iterating over the cases, fetching the object validating the response. for i, testCase := range testCases { // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for Get Object end point. req, err := newTestSignedRequestV4("HEAD", getHeadObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: %s: Failed to create HTTP request for Head Object: <ERROR> %v", i+1, instanceType, err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler,`func (api objectAPIHandlers) GetObjectHandler` handles the request. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Fatalf("Case %d: Expected the response status to be `%d`, but instead found `%d`", i+1, testCase.expectedRespStatus, rec.Code) } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() // construct HTTP request for Head Object endpoint. reqV2, err := newTestSignedRequestV2("HEAD", getHeadObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: %s: Failed to create HTTP request for Head Object: <ERROR> %v", i+1, instanceType, err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) if recV2.Code != testCase.expectedRespStatus { t.Errorf("Test %d: %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, recV2.Code) } } // Test for Anonymous/unsigned http request. anonReq, err := newTestRequest("HEAD", getHeadObjectURL("", bucketName, objectName), 0, nil) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, objectName, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPIHeadObjectHandler", bucketName, objectName, instanceType, apiRouter, anonReq, getAnonReadOnlyObjectPolicy(bucketName, objectName)) // HTTP request for testing when `objectLayer` is set to `nil`. // There is no need to use an existing bucket and valid input for creating the request // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("HEAD", getGetObjectURL("", nilBucket, nilObject), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } func TestAPIHeadObjectHandlerWithEncryption(t *testing.T) { globalPolicySys = NewPolicySys() defer func() { globalPolicySys = nil }() defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIHeadObjectHandlerWithEncryption, []string{"NewMultipart", "PutObjectPart", "CompleteMultipart", "GetObject", "PutObject", "HeadObject"}) } func testAPIHeadObjectHandlerWithEncryption(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { // Set SSL to on to do encryption tests globalIsSSL = true defer func() { globalIsSSL = false }() var ( oneMiB int64 = 1024 * 1024 key32Bytes = generateBytesData(32 * humanize.Byte) key32BytesMd5 = md5.Sum(key32Bytes) metaWithSSEC = map[string]string{ crypto.SSECAlgorithm: crypto.SSEAlgorithmAES256, crypto.SSECKey: base64.StdEncoding.EncodeToString(key32Bytes), crypto.SSECKeyMD5: base64.StdEncoding.EncodeToString(key32BytesMd5[:]), } mapCopy = func(m map[string]string) map[string]string { r := make(map[string]string, len(m)) for k, v := range m { r[k] = v } return r } ) type ObjectInput struct { objectName string partLengths []int64 metaData map[string]string } objectLength := func(oi ObjectInput) (sum int64) { for _, l := range oi.partLengths { sum += l } return } // set of inputs for uploading the objects before tests for // downloading is done. Data bytes are from DummyDataGen. objectInputs := []ObjectInput{ // Unencrypted objects {"nothing", []int64{0}, nil}, {"small-1", []int64{509}, nil}, {"mp-1", []int64{5 * oneMiB, 1}, nil}, {"mp-2", []int64{5487701, 5487799, 3}, nil}, // Encrypted object {"enc-nothing", []int64{0}, mapCopy(metaWithSSEC)}, {"enc-small-1", []int64{509}, mapCopy(metaWithSSEC)}, {"enc-mp-1", []int64{5 * oneMiB, 1}, mapCopy(metaWithSSEC)}, {"enc-mp-2", []int64{5487701, 5487799, 3}, mapCopy(metaWithSSEC)}, } // iterate through the above set of inputs and upload the object. for _, input := range objectInputs { uploadTestObject(t, apiRouter, credentials, bucketName, input.objectName, input.partLengths, input.metaData, false) } for i, input := range objectInputs { // initialize HTTP NewRecorder, this records any // mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for HEAD object. req, err := newTestSignedRequestV4("HEAD", getHeadObjectURL("", bucketName, input.objectName), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("Test %d: %s: Failed to create HTTP request for Head Object: <ERROR> %v", i+1, instanceType, err) } // Since `apiRouter` satisfies `http.Handler` it has a // ServeHTTP to execute the logic of the handler. apiRouter.ServeHTTP(rec, req) isEnc := false expected := 200 if strings.HasPrefix(input.objectName, "enc-") { isEnc = true expected = 400 } if rec.Code != expected { t.Errorf("Test %d: expected code %d but got %d for object %s", i+1, expected, rec.Code, input.objectName) } contentLength := rec.Header().Get("Content-Length") if isEnc { // initialize HTTP NewRecorder, this records any // mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for HEAD object. req, err := newTestSignedRequestV4("HEAD", getHeadObjectURL("", bucketName, input.objectName), 0, nil, credentials.AccessKey, credentials.SecretKey, input.metaData) if err != nil { t.Fatalf("Test %d: %s: Failed to create HTTP request for Head Object: <ERROR> %v", i+1, instanceType, err) } // Since `apiRouter` satisfies `http.Handler` it has a // ServeHTTP to execute the logic of the handler. apiRouter.ServeHTTP(rec, req) if rec.Code != 200 { t.Errorf("Test %d: Did not receive a 200 response: %d", i+1, rec.Code) } contentLength = rec.Header().Get("Content-Length") } if contentLength != fmt.Sprintf("%d", objectLength(input)) { t.Errorf("Test %d: Content length is mismatching: got %s (expected: %d)", i+1, contentLength, objectLength(input)) } } } // Wrapper for calling GetObject API handler tests for both XL multiple disks and FS single drive setup. func TestAPIGetObjectHandler(t *testing.T) { globalPolicySys = NewPolicySys() defer func() { globalPolicySys = nil }() defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIGetObjectHandler, []string{"GetObject"}) } func testAPIGetObjectHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { objectName := "test-object" // set of byte data for PutObject. // object has to be created before running tests for GetObject. // this is required even to assert the GetObject data, // since dataInserted === dataFetched back is a primary criteria for any object storage this assertion is critical. bytesData := []struct { byteData []byte }{ {generateBytesData(6 * humanize.MiByte)}, } // set of inputs for uploading the objects before tests for downloading is done. putObjectInputs := []struct { bucketName string objectName string contentLength int64 textData []byte metaData map[string]string }{ // case - 1. {bucketName, objectName, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, } // iterate through the above set of inputs and upload the object. for i, input := range putObjectInputs { // uploading the object. _, err := obj.PutObject(context.Background(), input.bucketName, input.objectName, mustGetPutObjReader(t, bytes.NewBuffer(input.textData), input.contentLength, input.metaData[""], ""), input.metaData, ObjectOptions{}) // if object upload fails stop the test. if err != nil { t.Fatalf("Put Object case %d: Error uploading object: <ERROR> %v", i+1, err) } } // test cases with inputs and expected result for GetObject. testCases := []struct { bucketName string objectName string byteRange string // range of bytes to be fetched from GetObject. accessKey string secretKey string // expected output. expectedContent []byte // expected response body. expectedRespStatus int // expected response status body. }{ // Test case - 1. // Fetching the entire object and validating its contents. { bucketName: bucketName, objectName: objectName, byteRange: "", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: bytesData[0].byteData, expectedRespStatus: http.StatusOK, }, // Test case - 2. // Case with non-existent object name. { bucketName: bucketName, objectName: "abcd", byteRange: "", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrNoSuchKey), getGetObjectURL("", bucketName, "abcd"), "")), expectedRespStatus: http.StatusNotFound, }, // Test case - 3. // Requesting from range 10-100. { bucketName: bucketName, objectName: objectName, byteRange: "bytes=10-100", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: bytesData[0].byteData[10:101], expectedRespStatus: http.StatusPartialContent, }, // Test case - 4. // Test case with invalid range. { bucketName: bucketName, objectName: objectName, byteRange: "bytes=-0", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrInvalidRange), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusRequestedRangeNotSatisfiable, }, // Test case - 5. // Test case with byte range exceeding the object size. // Expected to read till end of the object. { bucketName: bucketName, objectName: objectName, byteRange: "bytes=10-1000000000000000", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: bytesData[0].byteData[10:], expectedRespStatus: http.StatusPartialContent, }, // Test case - 6. // Test case to induce a signature mismatch. // Using invalid accessID. { bucketName: bucketName, objectName: objectName, byteRange: "", accessKey: "Invalid-AccessID", secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrInvalidAccessKeyID), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusForbidden, }, // Test case - 7. // Case with bad components in object name. { bucketName: bucketName, objectName: "../../etc", byteRange: "", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrInvalidObjectName), getGetObjectURL("", bucketName, "../../etc"), "")), expectedRespStatus: http.StatusBadRequest, }, // Test case - 8. // Case with strange components but returning error as not found. { bucketName: bucketName, objectName: ". ./. ./etc", byteRange: "", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrNoSuchKey), "/"+bucketName+"/"+". ./. ./etc", "")), expectedRespStatus: http.StatusNotFound, }, // Test case - 9. // Case with bad components in object name. { bucketName: bucketName, objectName: ". ./../etc", byteRange: "", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrInvalidObjectName), "/"+bucketName+"/"+". ./../etc", "")), expectedRespStatus: http.StatusBadRequest, }, // Test case - 10. // Case with proper components { bucketName: bucketName, objectName: "etc/path/proper/.../etc", byteRange: "", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrNoSuchKey), getGetObjectURL("", bucketName, "etc/path/proper/.../etc"), "")), expectedRespStatus: http.StatusNotFound, }, } // Iterating over the cases, fetching the object validating the response. for i, testCase := range testCases { // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for Get Object end point. req, err := newTestSignedRequestV4("GET", getGetObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for Get Object: <ERROR> %v", i+1, err) } if testCase.byteRange != "" { req.Header.Add("Range", testCase.byteRange) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler,`func (api objectAPIHandlers) GetObjectHandler` handles the request. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Fatalf("Case %d: Expected the response status to be `%d`, but instead found `%d`", i+1, testCase.expectedRespStatus, rec.Code) } // read the response body. actualContent, err := ioutil.ReadAll(rec.Body) if err != nil { t.Fatalf("Test %d: %s: Failed parsing response body: <ERROR> %v", i+1, instanceType, err) } // Verify whether the bucket obtained object is same as the one created. if !bytes.Equal(testCase.expectedContent, actualContent) { t.Errorf("Test %d: %s: Object content differs from expected value %s, got %s", i+1, instanceType, testCase.expectedContent, string(actualContent)) } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() // construct HTTP request for GET Object endpoint. reqV2, err := newTestSignedRequestV2("GET", getGetObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: %s: Failed to create HTTP request for GetObject: <ERROR> %v", i+1, instanceType, err) } if testCase.byteRange != "" { reqV2.Header.Add("Range", testCase.byteRange) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) if recV2.Code != testCase.expectedRespStatus { t.Errorf("Test %d: %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, recV2.Code) } // read the response body. actualContent, err = ioutil.ReadAll(recV2.Body) if err != nil { t.Fatalf("Test %d: %s: Failed parsing response body: <ERROR> %v", i+1, instanceType, err) } // Verify whether the bucket obtained object is same as the one created. if !bytes.Equal(testCase.expectedContent, actualContent) { t.Errorf("Test %d: %s: Object content differs from expected value.", i+1, instanceType) } } // Test for Anonymous/unsigned http request. anonReq, err := newTestRequest("GET", getGetObjectURL("", bucketName, objectName), 0, nil) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, objectName, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPIGetObjectHandler", bucketName, objectName, instanceType, apiRouter, anonReq, getAnonReadOnlyObjectPolicy(bucketName, objectName)) // HTTP request for testing when `objectLayer` is set to `nil`. // There is no need to use an existing bucket and valid input for creating the request // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("GET", getGetObjectURL("", nilBucket, nilObject), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // Wrapper for calling GetObject API handler tests for both XL multiple disks and FS single drive setup. func TestAPIGetObjectWithMPHandler(t *testing.T) { globalPolicySys = NewPolicySys() defer func() { globalPolicySys = nil }() defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIGetObjectWithMPHandler, []string{"NewMultipart", "PutObjectPart", "CompleteMultipart", "GetObject", "PutObject"}) } func testAPIGetObjectWithMPHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { // Set SSL to on to do encryption tests globalIsSSL = true defer func() { globalIsSSL = false }() var ( oneMiB int64 = 1024 * 1024 key32Bytes = generateBytesData(32 * humanize.Byte) key32BytesMd5 = md5.Sum(key32Bytes) metaWithSSEC = map[string]string{ crypto.SSECAlgorithm: crypto.SSEAlgorithmAES256, crypto.SSECKey: base64.StdEncoding.EncodeToString(key32Bytes), crypto.SSECKeyMD5: base64.StdEncoding.EncodeToString(key32BytesMd5[:]), } mapCopy = func(m map[string]string) map[string]string { r := make(map[string]string, len(m)) for k, v := range m { r[k] = v } return r } ) type ObjectInput struct { objectName string partLengths []int64 metaData map[string]string } objectLength := func(oi ObjectInput) (sum int64) { for _, l := range oi.partLengths { sum += l } return } // set of inputs for uploading the objects before tests for // downloading is done. Data bytes are from DummyDataGen. objectInputs := []ObjectInput{ // // cases 0-3: small single part objects {"nothing", []int64{0}, make(map[string]string)}, {"small-0", []int64{11}, make(map[string]string)}, {"small-1", []int64{509}, make(map[string]string)}, {"small-2", []int64{5 * oneMiB}, make(map[string]string)}, // // // cases 4-7: multipart part objects {"mp-0", []int64{5 * oneMiB, 1}, make(map[string]string)}, {"mp-1", []int64{5*oneMiB + 1, 1}, make(map[string]string)}, {"mp-2", []int64{5487701, 5487799, 3}, make(map[string]string)}, {"mp-3", []int64{10499807, 10499963, 7}, make(map[string]string)}, // cases 8-11: small single part objects with encryption {"enc-nothing", []int64{0}, mapCopy(metaWithSSEC)}, {"enc-small-0", []int64{11}, mapCopy(metaWithSSEC)}, {"enc-small-1", []int64{509}, mapCopy(metaWithSSEC)}, {"enc-small-2", []int64{5 * oneMiB}, mapCopy(metaWithSSEC)}, // cases 12-15: multipart part objects with encryption {"enc-mp-0", []int64{5 * oneMiB, 1}, mapCopy(metaWithSSEC)}, {"enc-mp-1", []int64{5*oneMiB + 1, 1}, mapCopy(metaWithSSEC)}, {"enc-mp-2", []int64{5487701, 5487799, 3}, mapCopy(metaWithSSEC)}, {"enc-mp-3", []int64{10499807, 10499963, 7}, mapCopy(metaWithSSEC)}, } // iterate through the above set of inputs and upload the object. for _, input := range objectInputs { uploadTestObject(t, apiRouter, credentials, bucketName, input.objectName, input.partLengths, input.metaData, false) } // function type for creating signed requests - used to repeat // requests with V2 and V4 signing. type testSignedReqFn func(method, urlStr string, contentLength int64, body io.ReadSeeker, accessKey, secretKey string, metamap map[string]string) (*http.Request, error) mkGetReq := func(oi ObjectInput, byteRange string, i int, mkSignedReq testSignedReqFn) { object := oi.objectName rec := httptest.NewRecorder() req, err := mkSignedReq("GET", getGetObjectURL("", bucketName, object), 0, nil, credentials.AccessKey, credentials.SecretKey, oi.metaData) if err != nil { t.Fatalf("Object: %s Case %d ByteRange: %s: Failed to create HTTP request for Get Object: <ERROR> %v", object, i+1, byteRange, err) } if byteRange != "" { req.Header.Add("Range", byteRange) } apiRouter.ServeHTTP(rec, req) // Check response code (we make only valid requests in // this test) if rec.Code != http.StatusPartialContent && rec.Code != http.StatusOK { bd, err1 := ioutil.ReadAll(rec.Body) t.Fatalf("%s Object: %s Case %d ByteRange: %s: Got response status `%d` and body: %s,%v", instanceType, object, i+1, byteRange, rec.Code, string(bd), err1) } var off, length int64 var rs *HTTPRangeSpec if byteRange != "" { rs, err = parseRequestRangeSpec(byteRange) if err != nil { t.Fatalf("Object: %s Case %d ByteRange: %s: Unexpected err: %v", object, i+1, byteRange, err) } } off, length, err = rs.GetOffsetLength(objectLength(oi)) if err != nil { t.Fatalf("Object: %s Case %d ByteRange: %s: Unexpected err: %v", object, i+1, byteRange, err) } readers := []io.Reader{} cumulativeSum := int64(0) for _, p := range oi.partLengths { readers = append(readers, NewDummyDataGen(p, cumulativeSum)) cumulativeSum += p } refReader := io.LimitReader(ioutilx.NewSkipReader(io.MultiReader(readers...), off), length) if ok, msg := cmpReaders(refReader, rec.Body); !ok { t.Fatalf("(%s) Object: %s Case %d ByteRange: %s --> data mismatch! (msg: %s)", instanceType, oi.objectName, i+1, byteRange, msg) } } // Iterate over each uploaded object and do a bunch of get // requests on them. caseNumber := 0 signFns := []testSignedReqFn{newTestSignedRequestV2, newTestSignedRequestV4} for _, oi := range objectInputs { objLen := objectLength(oi) for _, sf := range signFns { // Read whole object mkGetReq(oi, "", caseNumber, sf) caseNumber++ // No range requests are possible if the // object length is 0 if objLen == 0 { continue } // Various ranges to query - all are valid! rangeHdrs := []string{ // Read first byte of object fmt.Sprintf("bytes=%d-%d", 0, 0), // Read second byte of object fmt.Sprintf("bytes=%d-%d", 1, 1), // Read last byte of object fmt.Sprintf("bytes=-%d", 1), // Read all but first byte of object "bytes=1-", // Read first half of object fmt.Sprintf("bytes=%d-%d", 0, objLen/2), // Read last half of object fmt.Sprintf("bytes=-%d", objLen/2), // Read middle half of object fmt.Sprintf("bytes=%d-%d", objLen/4, objLen*3/4), // Read 100MiB of the object from the beginning fmt.Sprintf("bytes=%d-%d", 0, 100*humanize.MiByte), // Read 100MiB of the object from the end fmt.Sprintf("bytes=-%d", 100*humanize.MiByte), } for _, rangeHdr := range rangeHdrs { mkGetReq(oi, rangeHdr, caseNumber, sf) caseNumber++ } } } // HTTP request for testing when `objectLayer` is set to `nil`. // There is no need to use an existing bucket and valid input for creating the request // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("GET", getGetObjectURL("", nilBucket, nilObject), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // Wrapper for calling PutObject API handler tests using streaming signature v4 for both XL multiple disks and FS single drive setup. func TestAPIPutObjectStreamSigV4Handler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIPutObjectStreamSigV4Handler, []string{"PutObject"}) } func testAPIPutObjectStreamSigV4Handler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { objectName := "test-object" bytesDataLen := 65 * humanize.KiByte bytesData := bytes.Repeat([]byte{'a'}, bytesDataLen) oneKData := bytes.Repeat([]byte("a"), 1*humanize.KiByte) var err error type streamFault int const ( None streamFault = iota malformedEncoding unexpectedEOF signatureMismatch chunkDateMismatch tooBigDecodedLength ) // byte data for PutObject. // test cases with inputs and expected result for GetObject. testCases := []struct { bucketName string objectName string data []byte dataLen int chunkSize int64 // expected output. expectedContent []byte // expected response body. expectedRespStatus int // expected response status body. // Access keys accessKey string secretKey string shouldPass bool removeAuthHeader bool fault streamFault // Custom content encoding. contentEncoding string }{ // Test case - 1. // Fetching the entire object and validating its contents. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), chunkSize: 64 * humanize.KiByte, expectedContent: []byte{}, expectedRespStatus: http.StatusOK, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: true, }, // Test case - 2 // Small chunk size. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), chunkSize: 1 * humanize.KiByte, expectedContent: []byte{}, expectedRespStatus: http.StatusOK, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: true, }, // Test case - 3 // Empty data { bucketName: bucketName, objectName: objectName, data: []byte{}, dataLen: 0, chunkSize: 64 * humanize.KiByte, expectedContent: []byte{}, expectedRespStatus: http.StatusOK, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: true, }, // Test case - 4 // Invalid access key id. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), chunkSize: 64 * humanize.KiByte, expectedContent: []byte{}, expectedRespStatus: http.StatusForbidden, accessKey: "", secretKey: "", shouldPass: false, }, // Test case - 5 // Wrong auth header returns as bad request. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), chunkSize: 64 * humanize.KiByte, expectedContent: []byte{}, expectedRespStatus: http.StatusBadRequest, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: false, removeAuthHeader: true, }, // Test case - 6 // Large chunk size.. also passes. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), chunkSize: 100 * humanize.KiByte, expectedContent: []byte{}, expectedRespStatus: http.StatusOK, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: true, }, // Test case - 7 // Chunk with malformed encoding. { bucketName: bucketName, objectName: objectName, data: oneKData, dataLen: 1024, chunkSize: 1024, expectedContent: []byte{}, expectedRespStatus: http.StatusInternalServerError, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: false, fault: malformedEncoding, }, // Test case - 8 // Chunk with shorter than advertised chunk data. { bucketName: bucketName, objectName: objectName, data: oneKData, dataLen: 1024, chunkSize: 1024, expectedContent: []byte{}, expectedRespStatus: http.StatusBadRequest, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: false, fault: unexpectedEOF, }, // Test case - 9 // Chunk with first chunk data byte tampered. { bucketName: bucketName, objectName: objectName, data: oneKData, dataLen: 1024, chunkSize: 1024, expectedContent: []byte{}, expectedRespStatus: http.StatusForbidden, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: false, fault: signatureMismatch, }, // Test case - 10 // Different date (timestamps) used in seed signature calculation // and chunks signature calculation. { bucketName: bucketName, objectName: objectName, data: oneKData, dataLen: 1024, chunkSize: 1024, expectedContent: []byte{}, expectedRespStatus: http.StatusForbidden, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: false, fault: chunkDateMismatch, }, // Test case - 11 // Set x-amz-decoded-content-length to a value too big to hold in int64. { bucketName: bucketName, objectName: objectName, data: oneKData, dataLen: 1024, chunkSize: 1024, expectedContent: []byte{}, expectedRespStatus: http.StatusInternalServerError, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: false, fault: tooBigDecodedLength, }, // Test case - 12 // Set custom content encoding should succeed and save the encoding properly. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), chunkSize: 100 * humanize.KiByte, expectedContent: []byte{}, expectedRespStatus: http.StatusOK, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, shouldPass: true, contentEncoding: "aws-chunked,gzip", }, } // Iterating over the cases, fetching the object validating the response. for i, testCase := range testCases { // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for Put Object end point. var req *http.Request if testCase.fault == chunkDateMismatch { req, err = newTestStreamingSignedBadChunkDateRequest("PUT", getPutObjectURL("", testCase.bucketName, testCase.objectName), int64(testCase.dataLen), testCase.chunkSize, bytes.NewReader(testCase.data), testCase.accessKey, testCase.secretKey) } else if testCase.contentEncoding == "" { req, err = newTestStreamingSignedRequest("PUT", getPutObjectURL("", testCase.bucketName, testCase.objectName), int64(testCase.dataLen), testCase.chunkSize, bytes.NewReader(testCase.data), testCase.accessKey, testCase.secretKey) } else if testCase.contentEncoding != "" { req, err = newTestStreamingSignedCustomEncodingRequest("PUT", getPutObjectURL("", testCase.bucketName, testCase.objectName), int64(testCase.dataLen), testCase.chunkSize, bytes.NewReader(testCase.data), testCase.accessKey, testCase.secretKey, testCase.contentEncoding) } if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for Put Object: <ERROR> %v", i+1, err) } // Removes auth header if test case requires it. if testCase.removeAuthHeader { req.Header.Del("Authorization") } switch testCase.fault { case malformedEncoding: req, err = malformChunkSizeSigV4(req, testCase.chunkSize-1) case signatureMismatch: req, err = malformDataSigV4(req, 'z') case unexpectedEOF: req, err = truncateChunkByHalfSigv4(req) case tooBigDecodedLength: // Set decoded length to a large value out of int64 range to simulate parse failure. req.Header.Set("x-amz-decoded-content-length", "9999999999999999999999") } if err != nil { t.Fatalf("Error injecting faults into the request: <ERROR> %v.", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler,`func (api objectAPIHandlers) GetObjectHandler` handles the request. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Errorf("Test %d %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, rec.Code) } // read the response body. actualContent, err := ioutil.ReadAll(rec.Body) if err != nil { t.Fatalf("Test %d: %s: Failed parsing response body: <ERROR> %v", i+1, instanceType, err) } opts := ObjectOptions{} if testCase.shouldPass { // Verify whether the bucket obtained object is same as the one created. if !bytes.Equal(testCase.expectedContent, actualContent) { t.Errorf("Test %d: %s: Object content differs from expected value.: %s", i+1, instanceType, string(actualContent)) continue } objInfo, err := obj.GetObjectInfo(context.Background(), testCase.bucketName, testCase.objectName, opts) if err != nil { t.Fatalf("Test %d: %s: Failed to fetch the copied object: <ERROR> %s", i+1, instanceType, err) } if objInfo.ContentEncoding == streamingContentEncoding { t.Fatalf("Test %d: %s: ContentEncoding is set to \"aws-chunked\" which is unexpected", i+1, instanceType) } expectedContentEncoding := trimAwsChunkedContentEncoding(testCase.contentEncoding) if expectedContentEncoding != objInfo.ContentEncoding { t.Fatalf("Test %d: %s: ContentEncoding is set to \"%s\" which is unexpected, expected \"%s\"", i+1, instanceType, objInfo.ContentEncoding, expectedContentEncoding) } buffer := new(bytes.Buffer) err = obj.GetObject(context.Background(), testCase.bucketName, testCase.objectName, 0, int64(testCase.dataLen), buffer, objInfo.ETag, opts) if err != nil { t.Fatalf("Test %d: %s: Failed to fetch the copied object: <ERROR> %s", i+1, instanceType, err) } if !bytes.Equal(testCase.data, buffer.Bytes()) { t.Errorf("Test %d: %s: Data Mismatch: Data fetched back from the uploaded object doesn't match the original one.", i+1, instanceType) } buffer.Reset() } } } // Wrapper for calling PutObject API handler tests for both XL multiple disks and FS single drive setup. func TestAPIPutObjectHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIPutObjectHandler, []string{"PutObject"}) } func testAPIPutObjectHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { var err error objectName := "test-object" opts := ObjectOptions{} // byte data for PutObject. bytesData := generateBytesData(6 * humanize.KiByte) copySourceHeader := http.Header{} copySourceHeader.Set("X-Amz-Copy-Source", "somewhere") invalidMD5Header := http.Header{} invalidMD5Header.Set("Content-Md5", "42") inalidStorageClassHeader := http.Header{} inalidStorageClassHeader.Set(amzStorageClass, "INVALID") addCustomHeaders := func(req *http.Request, customHeaders http.Header) { for k, values := range customHeaders { for _, value := range values { req.Header.Set(k, value) } } } // test cases with inputs and expected result for GetObject. testCases := []struct { bucketName string objectName string headers http.Header data []byte dataLen int accessKey string secretKey string fault Fault // expected output. expectedRespStatus int // expected response status body. }{ // Test case - 1. // Fetching the entire object and validating its contents. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 2. // Test Case with invalid accessID. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), accessKey: "Wrong-AcessID", secretKey: credentials.SecretKey, expectedRespStatus: http.StatusForbidden, }, // Test case - 3. // Test Case with invalid header key X-Amz-Copy-Source. { bucketName: bucketName, objectName: objectName, headers: copySourceHeader, data: bytesData, dataLen: len(bytesData), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 4. // Test Case with invalid Content-Md5 value { bucketName: bucketName, objectName: objectName, headers: invalidMD5Header, data: bytesData, dataLen: len(bytesData), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 5. // Test Case with object greater than maximum allowed size. { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, fault: TooBigObject, expectedRespStatus: http.StatusBadRequest, }, // Test case - 6. // Test Case with missing content length { bucketName: bucketName, objectName: objectName, data: bytesData, dataLen: len(bytesData), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, fault: MissingContentLength, expectedRespStatus: http.StatusLengthRequired, }, // Test case - 7. // Test Case with invalid header key X-Amz-Storage-Class { bucketName: bucketName, objectName: objectName, headers: inalidStorageClassHeader, data: bytesData, dataLen: len(bytesData), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, } // Iterating over the cases, fetching the object validating the response. for i, testCase := range testCases { var req, reqV2 *http.Request // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for Get Object end point. req, err = newTestSignedRequestV4("PUT", getPutObjectURL("", testCase.bucketName, testCase.objectName), int64(testCase.dataLen), bytes.NewReader(testCase.data), testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for Put Object: <ERROR> %v", i+1, err) } // Add test case specific headers to the request. addCustomHeaders(req, testCase.headers) // Inject faults if specified in testCase.fault switch testCase.fault { case MissingContentLength: req.ContentLength = -1 req.TransferEncoding = []string{} case TooBigObject: req.ContentLength = globalMaxObjectSize + 1 } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler,`func (api objectAPIHandlers) GetObjectHandler` handles the request. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Fatalf("Case %d: Expected the response status to be `%d`, but instead found `%d`", i+1, testCase.expectedRespStatus, rec.Code) } if testCase.expectedRespStatus == http.StatusOK { buffer := new(bytes.Buffer) // Fetch the object to check whether the content is same as the one uploaded via PutObject. err = obj.GetObject(context.Background(), testCase.bucketName, testCase.objectName, 0, int64(len(bytesData)), buffer, "", opts) if err != nil { t.Fatalf("Test %d: %s: Failed to fetch the copied object: <ERROR> %s", i+1, instanceType, err) } if !bytes.Equal(bytesData, buffer.Bytes()) { t.Errorf("Test %d: %s: Data Mismatch: Data fetched back from the uploaded object doesn't match the original one.", i+1, instanceType) } buffer.Reset() } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() // construct HTTP request for PUT Object endpoint. reqV2, err = newTestSignedRequestV2("PUT", getPutObjectURL("", testCase.bucketName, testCase.objectName), int64(testCase.dataLen), bytes.NewReader(testCase.data), testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: %s: Failed to create HTTP request for PutObject: <ERROR> %v", i+1, instanceType, err) } // Add test case specific headers to the request. addCustomHeaders(reqV2, testCase.headers) // Inject faults if specified in testCase.fault switch testCase.fault { case MissingContentLength: reqV2.ContentLength = -1 reqV2.TransferEncoding = []string{} case TooBigObject: reqV2.ContentLength = globalMaxObjectSize + 1 } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) if recV2.Code != testCase.expectedRespStatus { t.Errorf("Test %d: %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, recV2.Code) } if testCase.expectedRespStatus == http.StatusOK { buffer := new(bytes.Buffer) // Fetch the object to check whether the content is same as the one uploaded via PutObject. err = obj.GetObject(context.Background(), testCase.bucketName, testCase.objectName, 0, int64(len(bytesData)), buffer, "", opts) if err != nil { t.Fatalf("Test %d: %s: Failed to fetch the copied object: <ERROR> %s", i+1, instanceType, err) } if !bytes.Equal(bytesData, buffer.Bytes()) { t.Errorf("Test %d: %s: Data Mismatch: Data fetched back from the uploaded object doesn't match the original one.", i+1, instanceType) } buffer.Reset() } } // Test for Anonymous/unsigned http request. anonReq, err := newTestRequest("PUT", getPutObjectURL("", bucketName, objectName), int64(len("hello")), bytes.NewReader([]byte("hello"))) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, objectName, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPIPutObjectHandler", bucketName, objectName, instanceType, apiRouter, anonReq, getAnonWriteOnlyObjectPolicy(bucketName, objectName)) // HTTP request to test the case of `objectLayer` being set to `nil`. // There is no need to use an existing bucket or valid input for creating the request, // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("PUT", getPutObjectURL("", nilBucket, nilObject), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // Tests sanity of attempting to copying each parts at offsets from an existing // file and create a new object. Also validates if the written is same as what we // expected. func TestAPICopyObjectPartHandlerSanity(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPICopyObjectPartHandlerSanity, []string{"CopyObjectPart"}) } func testAPICopyObjectPartHandlerSanity(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { objectName := "test-object" var err error opts := ObjectOptions{} // set of byte data for PutObject. // object has to be created before running tests for Copy Object. // this is required even to assert the copied object, bytesData := []struct { byteData []byte }{ {generateBytesData(6 * humanize.MiByte)}, } // set of inputs for uploading the objects before tests for downloading is done. putObjectInputs := []struct { bucketName string objectName string contentLength int64 textData []byte metaData map[string]string }{ // case - 1. {bucketName, objectName, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, } // iterate through the above set of inputs and upload the object. for i, input := range putObjectInputs { // uploading the object. _, err = obj.PutObject(context.Background(), input.bucketName, input.objectName, mustGetPutObjReader(t, bytes.NewBuffer(input.textData), input.contentLength, input.metaData[""], ""), input.metaData, opts) // if object upload fails stop the test. if err != nil { t.Fatalf("Put Object case %d: Error uploading object: <ERROR> %v", i+1, err) } } // Initiate Multipart upload for testing PutObjectPartHandler. testObject := "testobject" // PutObjectPart API HTTP Handler has to be tested in isolation, // that is without any other handler being registered, // That's why NewMultipartUpload is initiated using ObjectLayer. uploadID, err := obj.NewMultipartUpload(context.Background(), bucketName, testObject, nil, opts) if err != nil { // Failed to create NewMultipartUpload, abort. t.Fatalf("Minio %s : <ERROR> %s", instanceType, err) } a := 0 b := globalMinPartSize var parts []CompletePart for partNumber := 1; partNumber <= 2; partNumber++ { // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() cpPartURL := getCopyObjectPartURL("", bucketName, testObject, uploadID, fmt.Sprintf("%d", partNumber)) // construct HTTP request for copy object. var req *http.Request req, err = newTestSignedRequestV4("PUT", cpPartURL, 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("Test failed to create HTTP request for copy object part: <ERROR> %v", err) } // "X-Amz-Copy-Source" header contains the information about the source bucket and the object to copied. req.Header.Set("X-Amz-Copy-Source", url.QueryEscape(pathJoin(bucketName, objectName))) req.Header.Set("X-Amz-Copy-Source-Range", fmt.Sprintf("bytes=%d-%d", a, b)) // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler, `func (api objectAPIHandlers) CopyObjectHandler` handles the request. a = globalMinPartSize + 1 b = len(bytesData[0].byteData) - 1 apiRouter.ServeHTTP(rec, req) if rec.Code != http.StatusOK { t.Fatalf("Test failed to create HTTP request for copy %d", rec.Code) } resp := &CopyObjectPartResponse{} if err = xmlDecoder(rec.Body, resp, rec.Result().ContentLength); err != nil { t.Fatalf("Test failed to decode XML response: <ERROR> %v", err) } parts = append(parts, CompletePart{ PartNumber: partNumber, ETag: canonicalizeETag(resp.ETag), }) } result, err := obj.CompleteMultipartUpload(context.Background(), bucketName, testObject, uploadID, parts, ObjectOptions{}) if err != nil { t.Fatalf("Test: %s complete multipart upload failed: <ERROR> %v", instanceType, err) } if result.Size != int64(len(bytesData[0].byteData)) { t.Fatalf("Test: %s expected size not written: expected %d, got %d", instanceType, len(bytesData[0].byteData), result.Size) } var buf bytes.Buffer if err = obj.GetObject(context.Background(), bucketName, testObject, 0, int64(len(bytesData[0].byteData)), &buf, "", opts); err != nil { t.Fatalf("Test: %s reading completed file failed: <ERROR> %v", instanceType, err) } if !bytes.Equal(buf.Bytes(), bytesData[0].byteData) { t.Fatalf("Test: %s returned data is not expected corruption detected:", instanceType) } } // Wrapper for calling Copy Object Part API handler tests for both XL multiple disks and single node setup. func TestAPICopyObjectPartHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPICopyObjectPartHandler, []string{"CopyObjectPart"}) } func testAPICopyObjectPartHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { objectName := "test-object" var err error opts := ObjectOptions{} // set of byte data for PutObject. // object has to be created before running tests for Copy Object. // this is required even to assert the copied object, bytesData := []struct { byteData []byte }{ {generateBytesData(6 * humanize.KiByte)}, } // set of inputs for uploading the objects before tests for downloading is done. putObjectInputs := []struct { bucketName string objectName string contentLength int64 textData []byte metaData map[string]string }{ // case - 1. {bucketName, objectName, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, } // iterate through the above set of inputs and upload the object. for i, input := range putObjectInputs { // uploading the object. _, err = obj.PutObject(context.Background(), input.bucketName, input.objectName, mustGetPutObjReader(t, bytes.NewBuffer(input.textData), input.contentLength, input.metaData[""], ""), input.metaData, opts) // if object upload fails stop the test. if err != nil { t.Fatalf("Put Object case %d: Error uploading object: <ERROR> %v", i+1, err) } } // Initiate Multipart upload for testing PutObjectPartHandler. testObject := "testobject" // PutObjectPart API HTTP Handler has to be tested in isolation, // that is without any other handler being registered, // That's why NewMultipartUpload is initiated using ObjectLayer. uploadID, err := obj.NewMultipartUpload(context.Background(), bucketName, testObject, nil, opts) if err != nil { // Failed to create NewMultipartUpload, abort. t.Fatalf("Minio %s : <ERROR> %s", instanceType, err) } // test cases with inputs and expected result for Copy Object. testCases := []struct { bucketName string copySourceHeader string // data for "X-Amz-Copy-Source" header. Contains the object to be copied in the URL. copySourceRange string // data for "X-Amz-Copy-Source-Range" header, contains the byte range offsets of data to be copied. uploadID string // uploadID of the transaction. invalidPartNumber bool // Sets an invalid multipart. maximumPartNumber bool // Sets a maximum parts. accessKey string secretKey string // expected output. expectedRespStatus int }{ // Test case - 1, copy part 1 from from newObject1, ignore request headers. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 2. // Test case with invalid source object. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/"), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 3. // Test case with new object name is same as object to be copied. // Fail with file not found. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + testObject), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 4. // Test case with valid byte range. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copySourceRange: "bytes=500-4096", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 5. // Test case with invalid byte range. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copySourceRange: "bytes=6145-", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 6. // Test case with ivalid byte range for exceeding source size boundaries. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copySourceRange: "bytes=0-6144", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 7. // Test case with object name missing from source. // fail with BadRequest. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("//123"), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 8. // Test case with non-existent source file. // Case for the purpose of failing `api.ObjectAPI.GetObjectInfo`. // Expecting the response status code to http.StatusNotFound (404). { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + "non-existent-object"), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 9. // Test case with non-existent source file. // Case for the purpose of failing `api.ObjectAPI.PutObjectPart`. // Expecting the response status code to http.StatusNotFound (404). { bucketName: "non-existent-destination-bucket", uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 10. // Case with invalid AccessKey. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: "Invalid-AccessID", secretKey: credentials.SecretKey, expectedRespStatus: http.StatusForbidden, }, // Test case - 11. // Case with non-existent upload id. { bucketName: bucketName, uploadID: "-1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 12. // invalid part number. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), invalidPartNumber: true, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 13. // maximum part number. { bucketName: bucketName, uploadID: uploadID, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), maximumPartNumber: true, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, } for i, testCase := range testCases { var req *http.Request var reqV2 *http.Request // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() if !testCase.invalidPartNumber || !testCase.maximumPartNumber { // construct HTTP request for copy object. req, err = newTestSignedRequestV4("PUT", getCopyObjectPartURL("", testCase.bucketName, testObject, testCase.uploadID, "1"), 0, nil, testCase.accessKey, testCase.secretKey, nil) } else if testCase.invalidPartNumber { req, err = newTestSignedRequestV4("PUT", getCopyObjectPartURL("", testCase.bucketName, testObject, testCase.uploadID, "abc"), 0, nil, testCase.accessKey, testCase.secretKey, nil) } else if testCase.maximumPartNumber { req, err = newTestSignedRequestV4("PUT", getCopyObjectPartURL("", testCase.bucketName, testObject, testCase.uploadID, "99999"), 0, nil, testCase.accessKey, testCase.secretKey, nil) } if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for copy Object: <ERROR> %v", i+1, err) } // "X-Amz-Copy-Source" header contains the information about the source bucket and the object to copied. if testCase.copySourceHeader != "" { req.Header.Set("X-Amz-Copy-Source", testCase.copySourceHeader) } if testCase.copySourceRange != "" { req.Header.Set("X-Amz-Copy-Source-Range", testCase.copySourceRange) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler, `func (api objectAPIHandlers) CopyObjectHandler` handles the request. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Fatalf("Test %d: %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, rec.Code) } if rec.Code == http.StatusOK { // See if the new part has been uploaded. // testing whether the copy was successful. var results ListPartsInfo results, err = obj.ListObjectParts(context.Background(), testCase.bucketName, testObject, testCase.uploadID, 0, 1) if err != nil { t.Fatalf("Test %d: %s: Failed to look for copied object part: <ERROR> %s", i+1, instanceType, err) } if instanceType != FSTestStr && len(results.Parts) != 1 { t.Fatalf("Test %d: %s: Expected only one entry returned %d entries", i+1, instanceType, len(results.Parts)) } } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() reqV2, err = newTestRequest("PUT", getCopyObjectPartURL("", testCase.bucketName, testObject, testCase.uploadID, "1"), 0, nil) if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for copy Object: <ERROR> %v", i+1, err) } // "X-Amz-Copy-Source" header contains the information about the source bucket and the object to copied. if testCase.copySourceHeader != "" { reqV2.Header.Set("X-Amz-Copy-Source", testCase.copySourceHeader) } if testCase.copySourceRange != "" { reqV2.Header.Set("X-Amz-Copy-Source-Range", testCase.copySourceRange) } err = signRequestV2(reqV2, testCase.accessKey, testCase.secretKey) if err != nil { t.Fatalf("Failed to V2 Sign the HTTP request: %v.", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) if recV2.Code != testCase.expectedRespStatus { t.Errorf("Test %d: %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, recV2.Code) } } // HTTP request for testing when `ObjectLayer` is set to `nil`. // There is no need to use an existing bucket and valid input for creating the request // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("PUT", getCopyObjectPartURL("", nilBucket, nilObject, "0", "0"), 0, bytes.NewReader([]byte("testNilObjLayer")), "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create http request for testing the response when object Layer is set to `nil`.", instanceType) } // Below is how CopyObjectPartHandler is registered. // bucket.Methods("PUT").Path("/{object:.+}").HeadersRegexp("X-Amz-Copy-Source", ".*?(\\/|%2F).*?").HandlerFunc(api.CopyObjectPartHandler).Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}") // Its necessary to set the "X-Amz-Copy-Source" header for the request to be accepted by the handler. nilReq.Header.Set("X-Amz-Copy-Source", url.QueryEscape("/"+nilBucket+"/"+nilObject)) // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // Wrapper for calling Copy Object API handler tests for both XL multiple disks and single node setup. func TestAPICopyObjectHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPICopyObjectHandler, []string{"CopyObject"}) } func testAPICopyObjectHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { objectName := "test-object" // object used for anonymous HTTP request test. anonObject := "anon-object" var err error opts := ObjectOptions{} // set of byte data for PutObject. // object has to be created before running tests for Copy Object. // this is required even to assert the copied object, bytesData := []struct { byteData []byte }{ {generateBytesData(6 * humanize.KiByte)}, } buffers := []*bytes.Buffer{ new(bytes.Buffer), new(bytes.Buffer), } // set of inputs for uploading the objects before tests for downloading is done. putObjectInputs := []struct { bucketName string objectName string contentLength int64 textData []byte metaData map[string]string }{ // case - 1. {bucketName, objectName, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, // case - 2. // used for anonymous HTTP request test. {bucketName, anonObject, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, } // iterate through the above set of inputs and upload the object. for i, input := range putObjectInputs { // uploading the object. _, err = obj.PutObject(context.Background(), input.bucketName, input.objectName, mustGetPutObjReader(t, bytes.NewBuffer(input.textData), input.contentLength, input.metaData[""], ""), input.metaData, opts) // if object upload fails stop the test. if err != nil { t.Fatalf("Put Object case %d: Error uploading object: <ERROR> %v", i+1, err) } } // test cases with inputs and expected result for Copy Object. testCases := []struct { bucketName string newObjectName string // name of the newly copied object. copySourceHeader string // data for "X-Amz-Copy-Source" header. Contains the object to be copied in the URL. copyModifiedHeader string // data for "X-Amz-Copy-Source-If-Modified-Since" header copyUnmodifiedHeader string // data for "X-Amz-Copy-Source-If-Unmodified-Since" header metadataGarbage bool metadataReplace bool metadataCopy bool metadata map[string]string accessKey string secretKey string // expected output. expectedRespStatus int }{ // Test case - 1, copy metadata from newObject1, ignore request headers. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, metadata: map[string]string{ "Content-Type": "application/json", }, expectedRespStatus: http.StatusOK, }, // Test case - 2. // Test case with invalid source object. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/"), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 3. // Test case with new object name is same as object to be copied. { bucketName: bucketName, newObjectName: objectName, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 4. // Test case with new object name is same as object to be copied. // But source copy is without leading slash { bucketName: bucketName, newObjectName: objectName, copySourceHeader: url.QueryEscape(bucketName + "/" + objectName), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 5. // Test case with new object name is same as object to be copied // but metadata is updated. { bucketName: bucketName, newObjectName: objectName, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), metadata: map[string]string{ "Content-Type": "application/json", }, metadataReplace: true, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 6. // Test case with invalid metadata-directive. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), metadata: map[string]string{ "Content-Type": "application/json", }, metadataGarbage: true, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 7. // Test case with new object name is same as object to be copied // fail with BadRequest. { bucketName: bucketName, newObjectName: objectName, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), metadata: map[string]string{ "Content-Type": "application/json", }, metadataCopy: true, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusBadRequest, }, // Test case - 8. // Test case with non-existent source file. // Case for the purpose of failing `api.ObjectAPI.GetObjectInfo`. // Expecting the response status code to http.StatusNotFound (404). { bucketName: bucketName, newObjectName: objectName, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + "non-existent-object"), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 9. // Test case with non-existent source file. // Case for the purpose of failing `api.ObjectAPI.PutObject`. // Expecting the response status code to http.StatusNotFound (404). { bucketName: "non-existent-destination-bucket", newObjectName: objectName, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 10. // Case with invalid AccessKey. { bucketName: bucketName, newObjectName: objectName, copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), accessKey: "Invalid-AccessID", secretKey: credentials.SecretKey, expectedRespStatus: http.StatusForbidden, }, // Test case - 11, copy metadata from newObject1 with satisfying modified header. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copyModifiedHeader: "Mon, 02 Jan 2006 15:04:05 GMT", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 12, copy metadata from newObject1 with unsatisfying modified header. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copyModifiedHeader: "Mon, 02 Jan 2217 15:04:05 GMT", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusPreconditionFailed, }, // Test case - 13, copy metadata from newObject1 with wrong modified header format { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copyModifiedHeader: "Mon, 02 Jan 2217 15:04:05 +00:00", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 14, copy metadata from newObject1 with satisfying unmodified header. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copyUnmodifiedHeader: "Mon, 02 Jan 2217 15:04:05 GMT", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, // Test case - 15, copy metadata from newObject1 with unsatisfying unmodified header. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copyUnmodifiedHeader: "Mon, 02 Jan 2007 15:04:05 GMT", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusPreconditionFailed, }, // Test case - 16, copy metadata from newObject1 with incorrect unmodified header format. { bucketName: bucketName, newObjectName: "newObject1", copySourceHeader: url.QueryEscape("/" + bucketName + "/" + objectName), copyUnmodifiedHeader: "Mon, 02 Jan 2007 15:04:05 +00:00", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusOK, }, } for i, testCase := range testCases { var req *http.Request var reqV2 *http.Request // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for copy object. req, err = newTestSignedRequestV4("PUT", getCopyObjectURL("", testCase.bucketName, testCase.newObjectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for copy Object: <ERROR> %v", i+1, err) } // "X-Amz-Copy-Source" header contains the information about the source bucket and the object to copied. if testCase.copySourceHeader != "" { req.Header.Set("X-Amz-Copy-Source", testCase.copySourceHeader) } if testCase.copyModifiedHeader != "" { req.Header.Set("X-Amz-Copy-Source-If-Modified-Since", testCase.copyModifiedHeader) } if testCase.copyUnmodifiedHeader != "" { req.Header.Set("X-Amz-Copy-Source-If-Unmodified-Since", testCase.copyUnmodifiedHeader) } // Add custom metadata. for k, v := range testCase.metadata { req.Header.Set(k, v) } if testCase.metadataReplace { req.Header.Set("X-Amz-Metadata-Directive", "REPLACE") } if testCase.metadataCopy { req.Header.Set("X-Amz-Metadata-Directive", "COPY") } if testCase.metadataGarbage { req.Header.Set("X-Amz-Metadata-Directive", "Unknown") } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler, `func (api objectAPIHandlers) CopyObjectHandler` handles the request. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Fatalf("Test %d: %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, rec.Code) } if rec.Code == http.StatusOK { // See if the new object is formed. // testing whether the copy was successful. err = obj.GetObject(context.Background(), testCase.bucketName, testCase.newObjectName, 0, int64(len(bytesData[0].byteData)), buffers[0], "", opts) if err != nil { t.Fatalf("Test %d: %s: Failed to fetch the copied object: <ERROR> %s", i+1, instanceType, err) } if !bytes.Equal(bytesData[0].byteData, buffers[0].Bytes()) { t.Errorf("Test %d: %s: Data Mismatch: Data fetched back from the copied object doesn't match the original one.", i+1, instanceType) } buffers[0].Reset() } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() reqV2, err = newTestRequest("PUT", getCopyObjectURL("", testCase.bucketName, testCase.newObjectName), 0, nil) if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for copy Object: <ERROR> %v", i+1, err) } // "X-Amz-Copy-Source" header contains the information about the source bucket and the object to copied. if testCase.copySourceHeader != "" { reqV2.Header.Set("X-Amz-Copy-Source", testCase.copySourceHeader) } if testCase.copyModifiedHeader != "" { reqV2.Header.Set("X-Amz-Copy-Source-If-Modified-Since", testCase.copyModifiedHeader) } if testCase.copyUnmodifiedHeader != "" { reqV2.Header.Set("X-Amz-Copy-Source-If-Unmodified-Since", testCase.copyUnmodifiedHeader) } // Add custom metadata. for k, v := range testCase.metadata { reqV2.Header.Set(k, v+"+x") } if testCase.metadataReplace { reqV2.Header.Set("X-Amz-Metadata-Directive", "REPLACE") } if testCase.metadataCopy { reqV2.Header.Set("X-Amz-Metadata-Directive", "COPY") } if testCase.metadataGarbage { reqV2.Header.Set("X-Amz-Metadata-Directive", "Unknown") } err = signRequestV2(reqV2, testCase.accessKey, testCase.secretKey) if err != nil { t.Fatalf("Failed to V2 Sign the HTTP request: %v.", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) if recV2.Code != testCase.expectedRespStatus { t.Errorf("Test %d: %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, recV2.Code) } } // HTTP request to test the case of `objectLayer` being set to `nil`. // There is no need to use an existing bucket or valid input for creating the request, // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("PUT", getCopyObjectURL("", nilBucket, nilObject), 0, nil, "", "", nil) // Below is how CopyObjectHandler is registered. // bucket.Methods("PUT").Path("/{object:.+}").HeadersRegexp("X-Amz-Copy-Source", ".*?(\\/|%2F).*?") // Its necessary to set the "X-Amz-Copy-Source" header for the request to be accepted by the handler. nilReq.Header.Set("X-Amz-Copy-Source", url.QueryEscape("/"+nilBucket+"/"+nilObject)) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // Wrapper for calling NewMultipartUpload tests for both XL multiple disks and single node setup. // First register the HTTP handler for NewMutlipartUpload, then a HTTP request for NewMultipart upload is made. // The UploadID from the response body is parsed and its existence is asserted with an attempt to ListParts using it. func TestAPINewMultipartHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPINewMultipartHandler, []string{"NewMultipart"}) } func testAPINewMultipartHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { objectName := "test-object-new-multipart" rec := httptest.NewRecorder() // construct HTTP request for NewMultipart upload. req, err := newTestSignedRequestV4("POST", getNewMultipartURL("", bucketName, objectName), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: <ERROR> %v", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to executes the registered handler. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != http.StatusOK { t.Fatalf("%s: Expected the response status to be `%d`, but instead found `%d`", instanceType, http.StatusOK, rec.Code) } // decode the response body. decoder := xml.NewDecoder(rec.Body) multipartResponse := &InitiateMultipartUploadResponse{} err = decoder.Decode(multipartResponse) if err != nil { t.Fatalf("Error decoding the recorded response Body") } // verify the uploadID my making an attempt to list parts. _, err = obj.ListObjectParts(context.Background(), bucketName, objectName, multipartResponse.UploadID, 0, 1) if err != nil { t.Fatalf("Invalid UploadID: <ERROR> %s", err) } // Testing the response for Invalid AcccessID. // Forcing the signature check to fail. rec = httptest.NewRecorder() // construct HTTP request for NewMultipart upload. // Setting an invalid accessID. req, err = newTestSignedRequestV4("POST", getNewMultipartURL("", bucketName, objectName), 0, nil, "Invalid-AccessID", credentials.SecretKey, nil) if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: <ERROR> %v", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP method to execute the logic of the handler. // Call the ServeHTTP to executes the registered handler. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != http.StatusForbidden { t.Fatalf("%s: Expected the response status to be `%d`, but instead found `%d`", instanceType, http.StatusForbidden, rec.Code) } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() // construct HTTP request for NewMultipartUpload endpoint. reqV2, err := newTestSignedRequestV2("POST", getNewMultipartURL("", bucketName, objectName), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: <ERROR> %v", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) // Assert the response code with the expected status. if recV2.Code != http.StatusOK { t.Fatalf("%s: Expected the response status to be `%d`, but instead found `%d`", instanceType, http.StatusOK, recV2.Code) } // decode the response body. decoder = xml.NewDecoder(recV2.Body) multipartResponse = &InitiateMultipartUploadResponse{} err = decoder.Decode(multipartResponse) if err != nil { t.Fatalf("Error decoding the recorded response Body") } // verify the uploadID my making an attempt to list parts. _, err = obj.ListObjectParts(context.Background(), bucketName, objectName, multipartResponse.UploadID, 0, 1) if err != nil { t.Fatalf("Invalid UploadID: <ERROR> %s", err) } // Testing the response for invalid AcccessID. // Forcing the V2 signature check to fail. recV2 = httptest.NewRecorder() // construct HTTP request for NewMultipartUpload endpoint. // Setting invalid AccessID. reqV2, err = newTestSignedRequestV2("POST", getNewMultipartURL("", bucketName, objectName), 0, nil, "Invalid-AccessID", credentials.SecretKey, nil) if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: <ERROR> %v", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) // Assert the response code with the expected status. if recV2.Code != http.StatusForbidden { t.Fatalf("%s: Expected the response status to be `%d`, but instead found `%d`", instanceType, http.StatusForbidden, recV2.Code) } // Test for Anonymous/unsigned http request. anonReq, err := newTestRequest("POST", getNewMultipartURL("", bucketName, objectName), 0, nil) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, objectName, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPINewMultipartHandler", bucketName, objectName, instanceType, apiRouter, anonReq, getAnonWriteOnlyObjectPolicy(bucketName, objectName)) // HTTP request to test the case of `objectLayer` being set to `nil`. // There is no need to use an existing bucket or valid input for creating the request, // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("POST", getNewMultipartURL("", nilBucket, nilObject), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // Wrapper for calling NewMultipartUploadParallel tests for both XL multiple disks and single node setup. // The objective of the test is to initialte multipart upload on the same object 10 times concurrently, // The UploadID from the response body is parsed and its existence is asserted with an attempt to ListParts using it. func TestAPINewMultipartHandlerParallel(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPINewMultipartHandlerParallel, []string{"NewMultipart"}) } func testAPINewMultipartHandlerParallel(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { // used for storing the uploadID's parsed on concurrent HTTP requests for NewMultipart upload on the same object. testUploads := struct { sync.Mutex uploads []string }{} objectName := "test-object-new-multipart-parallel" var wg sync.WaitGroup for i := 0; i < 10; i++ { wg.Add(1) // Initiate NewMultipart upload on the same object 10 times concurrrently. go func() { defer wg.Done() rec := httptest.NewRecorder() // construct HTTP request NewMultipartUpload. req, err := newTestSignedRequestV4("POST", getNewMultipartURL("", bucketName, objectName), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Errorf("Failed to create HTTP request for NewMultipart request: <ERROR> %v", err) return } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to executes the registered handler. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != http.StatusOK { t.Errorf("Minio %s: Expected the response status to be `%d`, but instead found `%d`", instanceType, http.StatusOK, rec.Code) return } // decode the response body. decoder := xml.NewDecoder(rec.Body) multipartResponse := &InitiateMultipartUploadResponse{} err = decoder.Decode(multipartResponse) if err != nil { t.Errorf("Minio %s: Error decoding the recorded response Body", instanceType) return } // push the obtained upload ID from the response into the array. testUploads.Lock() testUploads.uploads = append(testUploads.uploads, multipartResponse.UploadID) testUploads.Unlock() }() } // Wait till all go routines finishes execution. wg.Wait() // Validate the upload ID by an attempt to list parts using it. for _, uploadID := range testUploads.uploads { _, err := obj.ListObjectParts(context.Background(), bucketName, objectName, uploadID, 0, 1) if err != nil { t.Fatalf("Invalid UploadID: <ERROR> %s", err) } } } // The UploadID from the response body is parsed and its existence is asserted with an attempt to ListParts using it. func TestAPICompleteMultipartHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPICompleteMultipartHandler, []string{"CompleteMultipart"}) } func testAPICompleteMultipartHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { var err error var opts ObjectOptions // object used for the test. objectName := "test-object-new-multipart" // uploadID obtained from NewMultipart upload. var uploadID string // upload IDs collected. var uploadIDs []string for i := 0; i < 2; i++ { // initiate new multipart uploadID. uploadID, err = obj.NewMultipartUpload(context.Background(), bucketName, objectName, nil, opts) if err != nil { // Failed to create NewMultipartUpload, abort. t.Fatalf("Minio %s : <ERROR> %s", instanceType, err) } uploadIDs = append(uploadIDs, uploadID) } // Parts with size greater than 5 MiB. // Generating a 6 MiB byte array. validPart := bytes.Repeat([]byte("abcdef"), 1*humanize.MiByte) validPartMD5 := getMD5Hash(validPart) // Create multipart parts. // Need parts to be uploaded before CompleteMultiPartUpload can be called tested. parts := []struct { bucketName string objName string uploadID string PartID int inputReaderData string inputMd5 string intputDataSize int64 }{ // Case 1-4. // Creating sequence of parts for same uploadID. {bucketName, objectName, uploadIDs[0], 1, "abcd", "e2fc714c4727ee9395f324cd2e7f331f", int64(len("abcd"))}, {bucketName, objectName, uploadIDs[0], 2, "efgh", "1f7690ebdd9b4caf8fab49ca1757bf27", int64(len("efgh"))}, {bucketName, objectName, uploadIDs[0], 3, "ijkl", "09a0877d04abf8759f99adec02baf579", int64(len("abcd"))}, {bucketName, objectName, uploadIDs[0], 4, "mnop", "e132e96a5ddad6da8b07bba6f6131fef", int64(len("abcd"))}, // Part with size larger than 5 MiB. {bucketName, objectName, uploadIDs[0], 5, string(validPart), validPartMD5, int64(len(string(validPart)))}, {bucketName, objectName, uploadIDs[0], 6, string(validPart), validPartMD5, int64(len(string(validPart)))}, // Part with size larger than 5 MiB. // Parts uploaded for anonymous/unsigned API handler test. {bucketName, objectName, uploadIDs[1], 1, string(validPart), validPartMD5, int64(len(string(validPart)))}, {bucketName, objectName, uploadIDs[1], 2, string(validPart), validPartMD5, int64(len(string(validPart)))}, } // Iterating over creatPartCases to generate multipart chunks. for _, part := range parts { _, err = obj.PutObjectPart(context.Background(), part.bucketName, part.objName, part.uploadID, part.PartID, mustGetPutObjReader(t, bytes.NewBufferString(part.inputReaderData), part.intputDataSize, part.inputMd5, ""), opts) if err != nil { t.Fatalf("%s : %s", instanceType, err) } } // Parts to be sent as input for CompleteMultipartUpload. inputParts := []struct { parts []CompletePart }{ // inputParts - 0. // Case for replicating ETag mismatch. { []CompletePart{ {ETag: "abcd", PartNumber: 1}, }, }, // inputParts - 1. // should error out with part too small. { []CompletePart{ {ETag: "e2fc714c4727ee9395f324cd2e7f331f", PartNumber: 1}, {ETag: "1f7690ebdd9b4caf8fab49ca1757bf27", PartNumber: 2}, }, }, // inputParts - 2. // Case with invalid Part number. { []CompletePart{ {ETag: "e2fc714c4727ee9395f324cd2e7f331f", PartNumber: 10}, }, }, // inputParts - 3. // Case with valid parts,but parts are unsorted. // Part size greater than 5 MiB. { []CompletePart{ {ETag: validPartMD5, PartNumber: 6}, {ETag: validPartMD5, PartNumber: 5}, }, }, // inputParts - 4. // Case with valid part. // Part size greater than 5 MiB. { []CompletePart{ {ETag: validPartMD5, PartNumber: 5}, {ETag: validPartMD5, PartNumber: 6}, }, }, // inputParts - 5. // Used for the case of testing for anonymous API request. // Part size greater than 5 MiB. { []CompletePart{ {ETag: validPartMD5, PartNumber: 1}, {ETag: validPartMD5, PartNumber: 2}, }, }, } // on successful complete multipart operation the s3MD5 for the parts uploaded will be returned. s3MD5, err := getCompleteMultipartMD5(context.Background(), inputParts[3].parts) if err != nil { t.Fatalf("Obtaining S3MD5 failed") } // generating the response body content for the success case. successResponse := generateCompleteMultpartUploadResponse(bucketName, objectName, getGetObjectURL("", bucketName, objectName), s3MD5) encodedSuccessResponse := encodeResponse(successResponse) ctx := context.Background() testCases := []struct { bucket string object string uploadID string parts []CompletePart accessKey string secretKey string // Expected output of CompleteMultipartUpload. expectedContent []byte // Expected HTTP Response status. expectedRespStatus int }{ // Test case - 1. // Upload and PartNumber exists, But a deliberate ETag mismatch is introduced. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], parts: inputParts[0].parts, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(toAPIErrorCode(ctx, InvalidPart{})), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusBadRequest, }, // Test case - 2. // No parts specified in CompletePart{}. // Should return ErrMalformedXML in the response body. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], parts: []CompletePart{}, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrMalformedXML), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusBadRequest, }, // Test case - 3. // Non-Existent uploadID. // 404 Not Found response status expected. { bucket: bucketName, object: objectName, uploadID: "abc", parts: inputParts[0].parts, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(toAPIErrorCode(ctx, InvalidUploadID{UploadID: "abc"})), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusNotFound, }, // Test case - 4. // Case with part size being less than minimum allowed size. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], parts: inputParts[1].parts, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(completeMultipartAPIError{int64(4), int64(5242880), 1, "e2fc714c4727ee9395f324cd2e7f331f", getAPIErrorResponse(getAPIError(toAPIErrorCode(ctx, PartTooSmall{PartNumber: 1})), getGetObjectURL("", bucketName, objectName), "")}), expectedRespStatus: http.StatusBadRequest, }, // Test case - 5. // TestCase with invalid Part Number. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], parts: inputParts[2].parts, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(toAPIErrorCode(ctx, InvalidPart{})), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusBadRequest, }, // Test case - 6. // Parts are not sorted according to the part number. // This should return ErrInvalidPartOrder in the response body. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], parts: inputParts[3].parts, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrInvalidPartOrder), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusBadRequest, }, // Test case - 7. // Test case with proper parts. // Should successed and the content in the response body is asserted. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], parts: inputParts[4].parts, accessKey: "Invalid-AccessID", secretKey: credentials.SecretKey, expectedContent: encodeResponse(getAPIErrorResponse(getAPIError(ErrInvalidAccessKeyID), getGetObjectURL("", bucketName, objectName), "")), expectedRespStatus: http.StatusForbidden, }, // Test case - 8. // Test case with proper parts. // Should successed and the content in the response body is asserted. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], parts: inputParts[4].parts, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedContent: encodedSuccessResponse, expectedRespStatus: http.StatusOK, }, } for i, testCase := range testCases { var req *http.Request var completeBytes, actualContent []byte // Complete multipart upload parts. completeUploads := &CompleteMultipartUpload{ Parts: testCase.parts, } completeBytes, err = xml.Marshal(completeUploads) if err != nil { t.Fatalf("Error XML encoding of parts: <ERROR> %s.", err) } // Indicating that all parts are uploaded and initiating CompleteMultipartUpload. req, err = newTestSignedRequestV4("POST", getCompleteMultipartUploadURL("", bucketName, objectName, testCase.uploadID), int64(len(completeBytes)), bytes.NewReader(completeBytes), testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Failed to create HTTP request for CompleteMultipartUpload: <ERROR> %v", err) } rec := httptest.NewRecorder() // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to executes the registered handler. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Errorf("Case %d: Minio %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, rec.Code) } // read the response body. actualContent, err = ioutil.ReadAll(rec.Body) if err != nil { t.Fatalf("Test %d : Minio %s: Failed parsing response body: <ERROR> %v", i+1, instanceType, err) } // Verify whether the bucket obtained object is same as the one created. if !bytes.Equal(testCase.expectedContent, actualContent) { t.Errorf("Test %d : Minio %s: Object content differs from expected value.", i+1, instanceType) } } // Testing for anonymous API request. var completeBytes []byte // Complete multipart upload parts. completeUploads := &CompleteMultipartUpload{ Parts: inputParts[5].parts, } completeBytes, err = xml.Marshal(completeUploads) if err != nil { t.Fatalf("Error XML encoding of parts: <ERROR> %s.", err) } // create unsigned HTTP request for CompleteMultipart upload. anonReq, err := newTestRequest("POST", getCompleteMultipartUploadURL("", bucketName, objectName, uploadIDs[1]), int64(len(completeBytes)), bytes.NewReader(completeBytes)) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, objectName, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPICompleteMultipartHandler", bucketName, objectName, instanceType, apiRouter, anonReq, getAnonWriteOnlyObjectPolicy(bucketName, objectName)) // HTTP request to test the case of `objectLayer` being set to `nil`. // There is no need to use an existing bucket or valid input for creating the request, // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. // Indicating that all parts are uploaded and initiating CompleteMultipartUpload. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("POST", getCompleteMultipartUploadURL("", nilBucket, nilObject, "dummy-uploadID"), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // The UploadID from the response body is parsed and its existence is asserted with an attempt to ListParts using it. func TestAPIAbortMultipartHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIAbortMultipartHandler, []string{"AbortMultipart"}) } func testAPIAbortMultipartHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { var err error opts := ObjectOptions{} // object used for the test. objectName := "test-object-new-multipart" // uploadID obtained from NewMultipart upload. var uploadID string // upload IDs collected. var uploadIDs []string for i := 0; i < 2; i++ { // initiate new multipart uploadID. uploadID, err = obj.NewMultipartUpload(context.Background(), bucketName, objectName, nil, opts) if err != nil { // Failed to create NewMultipartUpload, abort. t.Fatalf("Minio %s : <ERROR> %s", instanceType, err) } uploadIDs = append(uploadIDs, uploadID) } // Parts with size greater than 5 MiB. // Generating a 6 MiB byte array. validPart := bytes.Repeat([]byte("abcdef"), 1*humanize.MiByte) validPartMD5 := getMD5Hash(validPart) // Create multipart parts. // Need parts to be uploaded before AbortMultiPartUpload can be called tested. parts := []struct { bucketName string objName string uploadID string PartID int inputReaderData string inputMd5 string intputDataSize int64 }{ // Case 1-4. // Creating sequence of parts for same uploadID. {bucketName, objectName, uploadIDs[0], 1, "abcd", "e2fc714c4727ee9395f324cd2e7f331f", int64(len("abcd"))}, {bucketName, objectName, uploadIDs[0], 2, "efgh", "1f7690ebdd9b4caf8fab49ca1757bf27", int64(len("efgh"))}, {bucketName, objectName, uploadIDs[0], 3, "ijkl", "09a0877d04abf8759f99adec02baf579", int64(len("abcd"))}, {bucketName, objectName, uploadIDs[0], 4, "mnop", "e132e96a5ddad6da8b07bba6f6131fef", int64(len("abcd"))}, // Part with size larger than 5 MiB. {bucketName, objectName, uploadIDs[0], 5, string(validPart), validPartMD5, int64(len(string(validPart)))}, {bucketName, objectName, uploadIDs[0], 6, string(validPart), validPartMD5, int64(len(string(validPart)))}, // Part with size larger than 5 MiB. // Parts uploaded for anonymous/unsigned API handler test. {bucketName, objectName, uploadIDs[1], 1, string(validPart), validPartMD5, int64(len(string(validPart)))}, {bucketName, objectName, uploadIDs[1], 2, string(validPart), validPartMD5, int64(len(string(validPart)))}, } // Iterating over createPartCases to generate multipart chunks. for _, part := range parts { _, err = obj.PutObjectPart(context.Background(), part.bucketName, part.objName, part.uploadID, part.PartID, mustGetPutObjReader(t, bytes.NewBufferString(part.inputReaderData), part.intputDataSize, part.inputMd5, ""), opts) if err != nil { t.Fatalf("%s : %s", instanceType, err) } } testCases := []struct { bucket string object string uploadID string accessKey string secretKey string // Expected HTTP Response status. expectedRespStatus int }{ // Test case - 1. // Abort existing upload ID. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNoContent, }, // Test case - 2. // Abort non-existng upload ID. { bucket: bucketName, object: objectName, uploadID: "nonexistent-upload-id", accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNotFound, }, // Test case - 3. // Abort with unknown Access key. { bucket: bucketName, object: objectName, uploadID: uploadIDs[0], accessKey: "Invalid-AccessID", secretKey: credentials.SecretKey, expectedRespStatus: http.StatusForbidden, }, } for i, testCase := range testCases { var req *http.Request // Indicating that all parts are uploaded and initiating abortMultipartUpload. req, err = newTestSignedRequestV4("DELETE", getAbortMultipartUploadURL("", testCase.bucket, testCase.object, testCase.uploadID), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Failed to create HTTP request for AbortMultipartUpload: <ERROR> %v", err) } rec := httptest.NewRecorder() // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to executes the registered handler. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Errorf("Case %d: Minio %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, rec.Code) } } // create unsigned HTTP request for Abort multipart upload. anonReq, err := newTestRequest("DELETE", getAbortMultipartUploadURL("", bucketName, objectName, uploadIDs[1]), 0, nil) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, objectName, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPIAbortMultipartHandler", bucketName, objectName, instanceType, apiRouter, anonReq, getAnonWriteOnlyObjectPolicy(bucketName, objectName)) // HTTP request to test the case of `objectLayer` being set to `nil`. // There is no need to use an existing bucket or valid input for creating the request, // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. // Indicating that all parts are uploaded and initiating abortMultipartUpload. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("DELETE", getAbortMultipartUploadURL("", nilBucket, nilObject, "dummy-uploadID"), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // Wrapper for calling Delete Object API handler tests for both XL multiple disks and FS single drive setup. func TestAPIDeleteObjectHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIDeleteObjectHandler, []string{"DeleteObject"}) } func testAPIDeleteObjectHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { var err error var opts ObjectOptions objectName := "test-object" // Object used for anonymous API request test. anonObjectName := "test-anon-obj" // set of byte data for PutObject. // object has to be created before running tests for Deleting the object. bytesData := []struct { byteData []byte }{ {generateBytesData(6 * humanize.MiByte)}, } // set of inputs for uploading the objects before tests for deleting them is done. putObjectInputs := []struct { bucketName string objectName string contentLength int64 textData []byte metaData map[string]string }{ // case - 1. {bucketName, objectName, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, // case - 2. {bucketName, anonObjectName, int64(len(bytesData[0].byteData)), bytesData[0].byteData, make(map[string]string)}, } // iterate through the above set of inputs and upload the object. for i, input := range putObjectInputs { // uploading the object. _, err = obj.PutObject(context.Background(), input.bucketName, input.objectName, mustGetPutObjReader(t, bytes.NewBuffer(input.textData), input.contentLength, input.metaData[""], ""), input.metaData, opts) // if object upload fails stop the test. if err != nil { t.Fatalf("Put Object case %d: Error uploading object: <ERROR> %v", i+1, err) } } // test cases with inputs and expected result for DeleteObject. testCases := []struct { bucketName string objectName string accessKey string secretKey string expectedRespStatus int // expected response status body. }{ // Test case - 1. // Deleting an existing object. // Expected to return HTTP resposne status code 204. { bucketName: bucketName, objectName: objectName, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNoContent, }, // Test case - 2. // Attempt to delete an object which is already deleted. // Still should return http response status 204. { bucketName: bucketName, objectName: objectName, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedRespStatus: http.StatusNoContent, }, // Test case - 3. // Setting Invalid AccessKey to force signature check inside the handler to fail. // Should return HTTP response status 403 forbidden. { bucketName: bucketName, objectName: objectName, accessKey: "Invalid-AccessKey", secretKey: credentials.SecretKey, expectedRespStatus: http.StatusForbidden, }, } // Iterating over the cases, call DeleteObjectHandler and validate the HTTP response. for i, testCase := range testCases { var req, reqV2 *http.Request // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() // construct HTTP request for Delete Object end point. req, err = newTestSignedRequestV4("DELETE", getDeleteObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Test %d: Failed to create HTTP request for Delete Object: <ERROR> %v", i+1, err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler,`func (api objectAPIHandlers) DeleteObjectHandler` handles the request. apiRouter.ServeHTTP(rec, req) // Assert the response code with the expected status. if rec.Code != testCase.expectedRespStatus { t.Fatalf("Minio %s: Case %d: Expected the response status to be `%d`, but instead found `%d`", instanceType, i+1, testCase.expectedRespStatus, rec.Code) } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() // construct HTTP request for Delete Object endpoint. reqV2, err = newTestSignedRequestV2("DELETE", getDeleteObjectURL("", testCase.bucketName, testCase.objectName), 0, nil, testCase.accessKey, testCase.secretKey, nil) if err != nil { t.Fatalf("Failed to create HTTP request for NewMultipart Request: <ERROR> %v", err) } // Since `apiRouter` satisfies `http.Handler` it has a ServeHTTP to execute the logic of the handler. // Call the ServeHTTP to execute the handler. apiRouter.ServeHTTP(recV2, reqV2) // Assert the response code with the expected status. if recV2.Code != testCase.expectedRespStatus { t.Errorf("Case %d: Minio %s: Expected the response status to be `%d`, but instead found `%d`", i+1, instanceType, testCase.expectedRespStatus, recV2.Code) } } // Test for Anonymous/unsigned http request. anonReq, err := newTestRequest("DELETE", getDeleteObjectURL("", bucketName, anonObjectName), 0, nil) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, anonObjectName, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPIDeleteObjectHandler", bucketName, anonObjectName, instanceType, apiRouter, anonReq, getAnonWriteOnlyObjectPolicy(bucketName, anonObjectName)) // HTTP request to test the case of `objectLayer` being set to `nil`. // There is no need to use an existing bucket or valid input for creating the request, // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("DELETE", getDeleteObjectURL("", nilBucket, nilObject), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create HTTP request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // TestAPIPutObjectPartHandlerPreSign - Tests validate the response of PutObjectPart HTTP handler // when the request signature type is PreSign. func TestAPIPutObjectPartHandlerPreSign(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIPutObjectPartHandlerPreSign, []string{"NewMultipart", "PutObjectPart"}) } func testAPIPutObjectPartHandlerPreSign(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { testObject := "testobject" rec := httptest.NewRecorder() req, err := newTestSignedRequestV4("POST", getNewMultipartURL("", bucketName, "testobject"), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("[%s] - Failed to create a signed request to initiate multipart upload for %s/%s: <ERROR> %v", instanceType, bucketName, testObject, err) } apiRouter.ServeHTTP(rec, req) // Get uploadID of the mulitpart upload initiated. var mpartResp InitiateMultipartUploadResponse mpartRespBytes, err := ioutil.ReadAll(rec.Result().Body) if err != nil { t.Fatalf("[%s] Failed to read NewMultipartUpload response <ERROR> %v", instanceType, err) } err = xml.Unmarshal(mpartRespBytes, &mpartResp) if err != nil { t.Fatalf("[%s] Failed to unmarshal NewMultipartUpload response <ERROR> %v", instanceType, err) } rec = httptest.NewRecorder() req, err = newTestRequest("PUT", getPutObjectPartURL("", bucketName, testObject, mpartResp.UploadID, "1"), int64(len("hello")), bytes.NewReader([]byte("hello"))) if err != nil { t.Fatalf("[%s] - Failed to create an unsigned request to put object part for %s/%s <ERROR> %v", instanceType, bucketName, testObject, err) } err = preSignV2(req, credentials.AccessKey, credentials.SecretKey, int64(10*60*60)) if err != nil { t.Fatalf("[%s] - Failed to presign an unsigned request to put object part for %s/%s <ERROR> %v", instanceType, bucketName, testObject, err) } apiRouter.ServeHTTP(rec, req) if rec.Code != http.StatusOK { t.Errorf("Test %d %s expected to succeed but failed with HTTP status code %d", 1, instanceType, rec.Code) } rec = httptest.NewRecorder() req, err = newTestRequest("PUT", getPutObjectPartURL("", bucketName, testObject, mpartResp.UploadID, "1"), int64(len("hello")), bytes.NewReader([]byte("hello"))) if err != nil { t.Fatalf("[%s] - Failed to create an unsigned request to put object part for %s/%s <ERROR> %v", instanceType, bucketName, testObject, err) } err = preSignV4(req, credentials.AccessKey, credentials.SecretKey, int64(10*60*60)) if err != nil { t.Fatalf("[%s] - Failed to presign an unsigned request to put object part for %s/%s <ERROR> %v", instanceType, bucketName, testObject, err) } apiRouter.ServeHTTP(rec, req) if rec.Code != http.StatusOK { t.Errorf("Test %d %s expected to succeed but failed with HTTP status code %d", 1, instanceType, rec.Code) } } // TestAPIPutObjectPartHandlerStreaming - Tests validate the response of PutObjectPart HTTP handler // when the request signature type is `streaming signature`. func TestAPIPutObjectPartHandlerStreaming(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIPutObjectPartHandlerStreaming, []string{"NewMultipart", "PutObjectPart"}) } func testAPIPutObjectPartHandlerStreaming(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { testObject := "testobject" rec := httptest.NewRecorder() req, err := newTestSignedRequestV4("POST", getNewMultipartURL("", bucketName, "testobject"), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("[%s] - Failed to create a signed request to initiate multipart upload for %s/%s: <ERROR> %v", instanceType, bucketName, testObject, err) } apiRouter.ServeHTTP(rec, req) // Get uploadID of the mulitpart upload initiated. var mpartResp InitiateMultipartUploadResponse mpartRespBytes, err := ioutil.ReadAll(rec.Result().Body) if err != nil { t.Fatalf("[%s] Failed to read NewMultipartUpload response <ERROR> %v", instanceType, err) } err = xml.Unmarshal(mpartRespBytes, &mpartResp) if err != nil { t.Fatalf("[%s] Failed to unmarshal NewMultipartUpload response <ERROR> %v", instanceType, err) } noAPIErr := APIError{} missingDateHeaderErr := getAPIError(ErrMissingDateHeader) internalErr := getAPIError(ErrInternalError) testCases := []struct { fault Fault expectedErr APIError }{ {BadSignature, missingDateHeaderErr}, {None, noAPIErr}, {TooBigDecodedLength, internalErr}, } for i, test := range testCases { rec = httptest.NewRecorder() req, err = newTestStreamingSignedRequest("PUT", getPutObjectPartURL("", bucketName, testObject, mpartResp.UploadID, "1"), 5, 1, bytes.NewReader([]byte("hello")), credentials.AccessKey, credentials.SecretKey) if err != nil { t.Fatalf("Failed to create new streaming signed HTTP request: <ERROR> %v.", err) } switch test.fault { case BadSignature: // Reset date field in header to make streaming signature fail. req.Header.Set("x-amz-date", "") case TooBigDecodedLength: // Set decoded length to a large value out of int64 range to simulate parse failure. req.Header.Set("x-amz-decoded-content-length", "9999999999999999999999") } apiRouter.ServeHTTP(rec, req) if test.expectedErr != noAPIErr { errBytes, err := ioutil.ReadAll(rec.Result().Body) if err != nil { t.Fatalf("Test %d %s Failed to read error response from upload part request %s/%s: <ERROR> %v", i+1, instanceType, bucketName, testObject, err) } var errXML APIErrorResponse err = xml.Unmarshal(errBytes, &errXML) if err != nil { t.Fatalf("Test %d %s Failed to unmarshal error response from upload part request %s/%s: <ERROR> %v", i+1, instanceType, bucketName, testObject, err) } if test.expectedErr.Code != errXML.Code { t.Errorf("Test %d %s expected to fail with error %s, but received %s", i+1, instanceType, test.expectedErr.Code, errXML.Code) } } else { if rec.Code != http.StatusOK { t.Errorf("Test %d %s expected to succeed, but failed with HTTP status code %d", i+1, instanceType, rec.Code) } } } } // TestAPIPutObjectPartHandler - Tests validate the response of PutObjectPart HTTP handler // for variety of inputs. func TestAPIPutObjectPartHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIPutObjectPartHandler, []string{"PutObjectPart"}) } func
(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { // Initiate Multipart upload for testing PutObjectPartHandler. testObject := "testobject" var opts ObjectOptions // PutObjectPart API HTTP Handler has to be tested in isolation, // that is without any other handler being registered, // That's why NewMultipartUpload is initiated using ObjectLayer. uploadID, err := obj.NewMultipartUpload(context.Background(), bucketName, testObject, nil, opts) if err != nil { // Failed to create NewMultipartUpload, abort. t.Fatalf("Minio %s : <ERROR> %s", instanceType, err) } uploadIDCopy := uploadID // expected error types for invalid inputs to PutObjectPartHandler. noAPIErr := APIError{} // expected error when content length is missing in the HTTP request. missingContent := getAPIError(ErrMissingContentLength) // expected error when content length is too large. entityTooLarge := getAPIError(ErrEntityTooLarge) // expected error when the signature check fails. badSigning := getAPIError(ErrSignatureDoesNotMatch) // expected error MD5 sum mismatch occurs. badChecksum := getAPIError(ErrInvalidDigest) // expected error when the part number in the request is invalid. invalidPart := getAPIError(ErrInvalidPart) // expected error when maxPart is beyond the limit. invalidMaxParts := getAPIError(ErrInvalidMaxParts) // expected error the when the uploadID is invalid. noSuchUploadID := getAPIError(ErrNoSuchUpload) // expected error when InvalidAccessID is set. invalidAccessID := getAPIError(ErrInvalidAccessKeyID) // SignatureMismatch for various signing types testCases := []struct { objectName string reader io.ReadSeeker partNumber string fault Fault accessKey string secretKey string expectedAPIError APIError }{ // Test case - 1. // Success case. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "1", fault: None, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: noAPIErr, }, // Test case - 2. // Case where part number is invalid. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "9999999999999999999", fault: None, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: invalidPart, }, // Test case - 3. // Case where the part number has exceeded the max allowed parts in an upload. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: strconv.Itoa(globalMaxPartID + 1), fault: None, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: invalidMaxParts, }, // Test case - 4. // Case where the content length is not set in the HTTP request. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "1", fault: MissingContentLength, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: missingContent, }, // Test case - 5. // case where the object size is set to a value greater than the max allowed size. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "1", fault: TooBigObject, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: entityTooLarge, }, // Test case - 6. // case where a signature mismatch is introduced and the response is validated. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "1", fault: BadSignature, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: badSigning, }, // Test case - 7. // Case where incorrect checksum is set and the error response // is asserted with the expected error response. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "1", fault: BadMD5, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: badChecksum, }, // Test case - 8. // case where the a non-existent uploadID is set. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "1", fault: MissingUploadID, accessKey: credentials.AccessKey, secretKey: credentials.SecretKey, expectedAPIError: noSuchUploadID, }, // Test case - 9. // case with invalid AccessID. // Forcing the signature check inside the handler to fail. { objectName: testObject, reader: bytes.NewReader([]byte("hello")), partNumber: "1", fault: None, accessKey: "Invalid-AccessID", secretKey: credentials.SecretKey, expectedAPIError: invalidAccessID, }, } reqV2Str := "V2 Signed HTTP request" reqV4Str := "V4 Signed HTTP request" // collection of input HTTP request, ResponseRecorder and request type. // Used to make a collection of V4 and V4 HTTP request. type inputReqRec struct { req *http.Request rec *httptest.ResponseRecorder reqType string } for i, test := range testCases { // Using sub-tests introduced in Go 1.7. t.Run(fmt.Sprintf("Minio %s : Test case %d.", instanceType, i+1), func(t *testing.T) { var reqV4, reqV2 *http.Request var recV4, recV2 *httptest.ResponseRecorder // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV4 = httptest.NewRecorder() recV2 = httptest.NewRecorder() // setting a non-existent uploadID. // deliberately introducing the invalid value to be able to assert the response with the expected error response. if test.fault == MissingUploadID { uploadID = "upload1" } // constructing a v4 signed HTTP request. reqV4, err = newTestSignedRequestV4("PUT", getPutObjectPartURL("", bucketName, test.objectName, uploadID, test.partNumber), 0, test.reader, test.accessKey, test.secretKey, nil) if err != nil { t.Fatalf("Failed to create a signed V4 request to upload part for %s/%s: <ERROR> %v", bucketName, test.objectName, err) } // Verify response of the V2 signed HTTP request. // construct HTTP request for PutObject Part Object endpoint. reqV2, err = newTestSignedRequestV2("PUT", getPutObjectPartURL("", bucketName, test.objectName, uploadID, test.partNumber), 0, test.reader, test.accessKey, test.secretKey, nil) if err != nil { t.Fatalf("Test %d %s Failed to create a V2 signed request to upload part for %s/%s: <ERROR> %v", i+1, instanceType, bucketName, test.objectName, err) } // collection of input HTTP request, ResponseRecorder and request type. reqRecs := []inputReqRec{ { req: reqV4, rec: recV4, reqType: reqV4Str, }, { req: reqV2, rec: recV2, reqType: reqV2Str, }, } for _, reqRec := range reqRecs { // Response recorder to record the response of the handler. rec := reqRec.rec // HTTP request used to call the handler. req := reqRec.req // HTTP request type string for V4/V2 requests. reqType := reqRec.reqType // introduce faults in the request. // deliberately introducing the invalid value to be able to assert the response with the expected error response. switch test.fault { case MissingContentLength: req.ContentLength = -1 // Setting the content length to a value greater than the max allowed size of a part. // Used in test case 4. case TooBigObject: req.ContentLength = globalMaxObjectSize + 1 // Malformed signature. // Used in test case 6. case BadSignature: req.Header.Set("authorization", req.Header.Get("authorization")+"a") // Setting an invalid Content-MD5 to force a Md5 Mismatch error. // Used in tesr case 7. case BadMD5: req.Header.Set("Content-MD5", "badmd5") } // invoke the PutObjectPart HTTP handler. apiRouter.ServeHTTP(rec, req) // validate the error response. if test.expectedAPIError != noAPIErr { var errBytes []byte // read the response body. errBytes, err = ioutil.ReadAll(rec.Result().Body) if err != nil { t.Fatalf("%s, Failed to read error response from upload part request \"%s\"/\"%s\": <ERROR> %v.", reqType, bucketName, test.objectName, err) } // parse the XML error response. var errXML APIErrorResponse err = xml.Unmarshal(errBytes, &errXML) if err != nil { t.Fatalf("%s, Failed to unmarshal error response from upload part request \"%s\"/\"%s\": <ERROR> %v.", reqType, bucketName, test.objectName, err) } // Validate whether the error has occurred for the expected reason. if test.expectedAPIError.Code != errXML.Code { t.Errorf("%s, Expected to fail with error \"%s\", but received \"%s\".", reqType, test.expectedAPIError.Code, errXML.Code) } // Validate the HTTP response status code with the expected one. if test.expectedAPIError.HTTPStatusCode != rec.Code { t.Errorf("%s, Expected the HTTP response status code to be %d, got %d.", reqType, test.expectedAPIError.HTTPStatusCode, rec.Code) } } } }) } // Test for Anonymous/unsigned http request. anonReq, err := newTestRequest("PUT", getPutObjectPartURL("", bucketName, testObject, uploadIDCopy, "1"), int64(len("hello")), bytes.NewReader([]byte("hello"))) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, testObject, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPIPutObjectPartHandler", bucketName, testObject, instanceType, apiRouter, anonReq, getAnonWriteOnlyObjectPolicy(bucketName, testObject)) // HTTP request for testing when `ObjectLayer` is set to `nil`. // There is no need to use an existing bucket and valid input for creating the request // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("PUT", getPutObjectPartURL("", nilBucket, nilObject, "0", "0"), 0, bytes.NewReader([]byte("testNilObjLayer")), "", "", nil) if err != nil { t.Errorf("Minio %s: Failed to create http request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` manages the operation. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) } // TestAPIListObjectPartsHandlerPreSign - Tests validate the response of ListObjectParts HTTP handler // when signature type of the HTTP request is `Presigned`. func TestAPIListObjectPartsHandlerPreSign(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIListObjectPartsHandlerPreSign, []string{"PutObjectPart", "NewMultipart", "ListObjectParts"}) } func testAPIListObjectPartsHandlerPreSign(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { testObject := "testobject" rec := httptest.NewRecorder() req, err := newTestSignedRequestV4("POST", getNewMultipartURL("", bucketName, testObject), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("[%s] - Failed to create a signed request to initiate multipart upload for %s/%s: <ERROR> %v", instanceType, bucketName, testObject, err) } apiRouter.ServeHTTP(rec, req) // Get uploadID of the mulitpart upload initiated. var mpartResp InitiateMultipartUploadResponse mpartRespBytes, err := ioutil.ReadAll(rec.Result().Body) if err != nil { t.Fatalf("[%s] Failed to read NewMultipartUpload response <ERROR> %v", instanceType, err) } err = xml.Unmarshal(mpartRespBytes, &mpartResp) if err != nil { t.Fatalf("[%s] Failed to unmarshal NewMultipartUpload response <ERROR> %v", instanceType, err) } // Upload a part for listing purposes. rec = httptest.NewRecorder() req, err = newTestSignedRequestV4("PUT", getPutObjectPartURL("", bucketName, testObject, mpartResp.UploadID, "1"), int64(len("hello")), bytes.NewReader([]byte("hello")), credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("[%s] - Failed to create a signed request to initiate multipart upload for %s/%s: <ERROR> %v", instanceType, bucketName, testObject, err) } apiRouter.ServeHTTP(rec, req) if rec.Code != http.StatusOK { t.Fatalf("[%s] - Failed to PutObjectPart bucket: %s object: %s HTTP status code: %d", instanceType, bucketName, testObject, rec.Code) } rec = httptest.NewRecorder() req, err = newTestRequest("GET", getListMultipartURLWithParams("", bucketName, testObject, mpartResp.UploadID, "", "", ""), 0, nil) if err != nil { t.Fatalf("[%s] - Failed to create an unsigned request to list object parts for bucket %s, uploadId %s", instanceType, bucketName, mpartResp.UploadID) } req.Header = http.Header{} err = preSignV2(req, credentials.AccessKey, credentials.SecretKey, int64(10*60*60)) if err != nil { t.Fatalf("[%s] - Failed to presignV2 an unsigned request to list object parts for bucket %s, uploadId %s", instanceType, bucketName, mpartResp.UploadID) } apiRouter.ServeHTTP(rec, req) if rec.Code != http.StatusOK { t.Errorf("Test %d %s expected to succeed but failed with HTTP status code %d", 1, instanceType, rec.Code) } rec = httptest.NewRecorder() req, err = newTestRequest("GET", getListMultipartURLWithParams("", bucketName, testObject, mpartResp.UploadID, "", "", ""), 0, nil) if err != nil { t.Fatalf("[%s] - Failed to create an unsigned request to list object parts for bucket %s, uploadId %s", instanceType, bucketName, mpartResp.UploadID) } err = preSignV4(req, credentials.AccessKey, credentials.SecretKey, int64(10*60*60)) if err != nil { t.Fatalf("[%s] - Failed to presignV2 an unsigned request to list object parts for bucket %s, uploadId %s", instanceType, bucketName, mpartResp.UploadID) } apiRouter.ServeHTTP(rec, req) if rec.Code != http.StatusOK { t.Errorf("Test %d %s expected to succeed but failed with HTTP status code %d", 1, instanceType, rec.Code) } } // TestAPIListObjectPartsHandler - Tests validate the response of ListObjectParts HTTP handler // for variety of success/failure cases. func TestAPIListObjectPartsHandler(t *testing.T) { defer DetectTestLeak(t)() ExecObjectLayerAPITest(t, testAPIListObjectPartsHandler, []string{"ListObjectParts"}) } func testAPIListObjectPartsHandler(obj ObjectLayer, instanceType, bucketName string, apiRouter http.Handler, credentials auth.Credentials, t *testing.T) { testObject := "testobject" var opts ObjectOptions // PutObjectPart API HTTP Handler has to be tested in isolation, // that is without any other handler being registered, // That's why NewMultipartUpload is initiated using ObjectLayer. uploadID, err := obj.NewMultipartUpload(context.Background(), bucketName, testObject, nil, opts) if err != nil { // Failed to create NewMultipartUpload, abort. t.Fatalf("Minio %s : <ERROR> %s", instanceType, err) } uploadIDCopy := uploadID // create an object Part, will be used to test list object parts. _, err = obj.PutObjectPart(context.Background(), bucketName, testObject, uploadID, 1, mustGetPutObjReader(t, bytes.NewReader([]byte("hello")), int64(len("hello")), "5d41402abc4b2a76b9719d911017c592", ""), opts) if err != nil { t.Fatalf("Minio %s : %s.", instanceType, err) } // expected error types for invalid inputs to ListObjectParts handler. noAPIErr := APIError{} // expected error when the signature check fails. signatureMismatchErr := getAPIError(ErrSignatureDoesNotMatch) // expected error the when the uploadID is invalid. noSuchUploadErr := getAPIError(ErrNoSuchUpload) // expected error the part number marker use in the ListObjectParts request is invalid. invalidPartMarkerErr := getAPIError(ErrInvalidPartNumberMarker) // expected error when the maximum number of parts requested to listed in invalid. invalidMaxPartsErr := getAPIError(ErrInvalidMaxParts) testCases := []struct { fault Fault partNumberMarker string maxParts string expectedErr APIError }{ // Test case - 1. // case where a signature mismatch is introduced and the response is validated. { fault: BadSignature, partNumberMarker: "", maxParts: "", expectedErr: signatureMismatchErr, }, // Test case - 2. // Marker is set to invalid value of -1, error response is asserted. { fault: None, partNumberMarker: "-1", maxParts: "", expectedErr: invalidPartMarkerErr, }, // Test case - 3. // Max Parts is set a negative value, error response is validated. { fault: None, partNumberMarker: "", maxParts: "-1", expectedErr: invalidMaxPartsErr, }, // Test case - 4. // Invalid UploadID is set and the error response is validated. { fault: MissingUploadID, partNumberMarker: "", maxParts: "", expectedErr: noSuchUploadErr, }, } // string to represent V2 signed HTTP request. reqV2Str := "V2 Signed HTTP request" // string to represent V4 signed HTTP request. reqV4Str := "V4 Signed HTTP request" // Collection of HTTP request and ResponseRecorder and request type string. type inputReqRec struct { req *http.Request rec *httptest.ResponseRecorder reqType string } for i, test := range testCases { var reqV4, reqV2 *http.Request // Using sub-tests introduced in Go 1.7. t.Run(fmt.Sprintf("Minio %s: Test case %d failed.", instanceType, i+1), func(t *testing.T) { recV2 := httptest.NewRecorder() recV4 := httptest.NewRecorder() // setting a non-existent uploadID. // deliberately introducing the invalid value to be able to assert the response with the expected error response. if test.fault == MissingUploadID { uploadID = "upload1" } // constructing a v4 signed HTTP request for ListMultipartUploads. reqV4, err = newTestSignedRequestV4("GET", getListMultipartURLWithParams("", bucketName, testObject, uploadID, test.maxParts, test.partNumberMarker, ""), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("Failed to create a V4 signed request to list object parts for %s/%s: <ERROR> %v.", bucketName, testObject, err) } // Verify response of the V2 signed HTTP request. // construct HTTP request for PutObject Part Object endpoint. reqV2, err = newTestSignedRequestV2("GET", getListMultipartURLWithParams("", bucketName, testObject, uploadID, test.maxParts, test.partNumberMarker, ""), 0, nil, credentials.AccessKey, credentials.SecretKey, nil) if err != nil { t.Fatalf("Failed to create a V2 signed request to list object parts for %s/%s: <ERROR> %v.", bucketName, testObject, err) } // collection of input HTTP request, ResponseRecorder and request type. reqRecs := []inputReqRec{ { req: reqV4, rec: recV4, reqType: reqV4Str, }, { req: reqV2, rec: recV2, reqType: reqV2Str, }, } for _, reqRec := range reqRecs { // Response recorder to record the response of the handler. rec := reqRec.rec // HTTP request used to call the handler. req := reqRec.req // HTTP request type string for V4/V2 requests. reqType := reqRec.reqType // Malformed signature. if test.fault == BadSignature { req.Header.Set("authorization", req.Header.Get("authorization")+"a") } // invoke the PutObjectPart HTTP handler with the given HTTP request. apiRouter.ServeHTTP(rec, req) // validate the error response. if test.expectedErr != noAPIErr { var errBytes []byte // read the response body. errBytes, err = ioutil.ReadAll(rec.Result().Body) if err != nil { t.Fatalf("%s,Failed to read error response list object parts request %s/%s: <ERROR> %v", reqType, bucketName, testObject, err) } // parse the error response. var errXML APIErrorResponse err = xml.Unmarshal(errBytes, &errXML) if err != nil { t.Fatalf("%s, Failed to unmarshal error response from list object partsest %s/%s: <ERROR> %v", reqType, bucketName, testObject, err) } // Validate whether the error has occurred for the expected reason. if test.expectedErr.Code != errXML.Code { t.Errorf("%s, Expected to fail with %s but received %s", reqType, test.expectedErr.Code, errXML.Code) } // in case error is not expected response status should be 200OK. } else { if rec.Code != http.StatusOK { t.Errorf("%s, Expected to succeed with response HTTP status 200OK, but failed with HTTP status code %d.", reqType, rec.Code) } } } }) } // Test for Anonymous/unsigned http request. anonReq, err := newTestRequest("GET", getListMultipartURLWithParams("", bucketName, testObject, uploadIDCopy, "", "", ""), 0, nil) if err != nil { t.Fatalf("Minio %s: Failed to create an anonymous request for %s/%s: <ERROR> %v", instanceType, bucketName, testObject, err) } // ExecObjectLayerAPIAnonTest - Calls the HTTP API handler using the anonymous request, validates the ErrAccessDeniedResponse, // sets the bucket policy using the policy statement generated from `getWriteOnlyObjectStatement` so that the // unsigned request goes through and its validated again. ExecObjectLayerAPIAnonTest(t, obj, "TestAPIListObjectPartsHandler", bucketName, testObject, instanceType, apiRouter, anonReq, getAnonWriteOnlyObjectPolicy(bucketName, testObject)) // HTTP request for testing when `objectLayer` is set to `nil`. // There is no need to use an existing bucket and valid input for creating the request // since the `objectLayer==nil` check is performed before any other checks inside the handlers. // The only aim is to generate an HTTP request in a way that the relevant/registered end point is evoked/called. nilBucket := "dummy-bucket" nilObject := "dummy-object" nilReq, err := newTestSignedRequestV4("GET", getListMultipartURLWithParams("", nilBucket, nilObject, "dummy-uploadID", "0", "0", ""), 0, nil, "", "", nil) if err != nil { t.Errorf("Minio %s:Failed to create http request for testing the response when object Layer is set to `nil`.", instanceType) } // execute the object layer set to `nil` test. // `ExecObjectLayerAPINilTest` sets the Object Layer to `nil` and calls the handler. ExecObjectLayerAPINilTest(t, nilBucket, nilObject, instanceType, apiRouter, nilReq) }
testAPIPutObjectPartHandler
resp.go
package util import ( "encoding/json" "log" ) // RespMsg : http响应数据的通用结构 type RespMsg struct { Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` } // NewRespMsg : 生成response对象 func NewRespMsg(code int, msg string, data interface{}) *RespMsg { return &RespMsg{ Code: code, Msg: msg, Data: data, } } func JsonBytes(msg *RespMsg) []byte { r, err := json.Marshal(msg) if err != nil { log.Println(err) } return r } func JsonString(msg *RespMsg) string { return string(JsonBytes
(msg)) }
linear_testing_utils_v1.py
# Copyright 2017 The TensorFlow Authors. 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. # ============================================================================== """Utils for testing linear estimators.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import shutil import tempfile import numpy as np import six import tensorflow as tf from tensorflow.core.example import example_pb2 from tensorflow.core.example import feature_pb2 from tensorflow.python.feature_column import feature_column from tensorflow.python.feature_column import feature_column_v2 from tensorflow.python.framework import ops from tensorflow.python.ops import variables as variables_lib from tensorflow_estimator.python.estimator import estimator from tensorflow_estimator.python.estimator import run_config from tensorflow_estimator.python.estimator.canned import linear from tensorflow_estimator.python.estimator.canned import metric_keys from tensorflow_estimator.python.estimator.export import export from tensorflow_estimator.python.estimator.inputs import numpy_io from tensorflow_estimator.python.estimator.inputs import pandas_io try: # pylint: disable=g-import-not-at-top import pandas as pd HAS_PANDAS = True except IOError: # Pandas writes a temporary file during import. If it fails, don't use pandas. HAS_PANDAS = False except ImportError: HAS_PANDAS = False # pylint rules which are disabled by default for test files. # pylint: disable=invalid-name,protected-access,missing-docstring # Names of variables created by model. AGE_WEIGHT_NAME = 'linear/linear_model/age/weights' HEIGHT_WEIGHT_NAME = 'linear/linear_model/height/weights' OCCUPATION_WEIGHT_NAME = 'linear/linear_model/occupation/weights' BIAS_NAME = 'linear/linear_model/bias_weights' LANGUAGE_WEIGHT_NAME = 'linear/linear_model/language/weights' # This is so that we can easily switch between feature_column and # feature_column_v2 for testing. feature_column.numeric_column = feature_column._numeric_column feature_column.categorical_column_with_hash_bucket = feature_column._categorical_column_with_hash_bucket # pylint: disable=line-too-long feature_column.categorical_column_with_vocabulary_list = feature_column._categorical_column_with_vocabulary_list # pylint: disable=line-too-long feature_column.categorical_column_with_vocabulary_file = feature_column._categorical_column_with_vocabulary_file # pylint: disable=line-too-long feature_column.embedding_column = feature_column._embedding_column def assert_close(expected, actual, rtol=1e-04, name='assert_close'): with ops.name_scope(name, 'assert_close', (expected, actual, rtol)) as scope: expected = ops.convert_to_tensor(expected, name='expected') actual = ops.convert_to_tensor(actual, name='actual') rdiff = tf.math.abs(expected - actual, 'diff') / tf.math.abs(expected) rtol = ops.convert_to_tensor(rtol, name='rtol') return tf.compat.v1.debugging.assert_less( rdiff, rtol, data=('Condition expected =~ actual did not hold element-wise:' 'expected = ', expected, 'actual = ', actual, 'rdiff = ', rdiff, 'rtol = ', rtol,), name=scope) def save_variables_to_ckpt(model_dir): init_all_op = [tf.compat.v1.initializers.global_variables()] with tf.compat.v1.Session() as sess: sess.run(init_all_op) tf.compat.v1.train.Saver().save(sess, os.path.join(model_dir, 'model.ckpt')) def queue_parsed_features(feature_map): tensors_to_enqueue = [] keys = [] for key, tensor in six.iteritems(feature_map): keys.append(key) tensors_to_enqueue.append(tensor) queue_dtypes = [x.dtype for x in tensors_to_enqueue] input_queue = tf.queue.FIFOQueue(capacity=100, dtypes=queue_dtypes) tf.compat.v1.train.queue_runner.add_queue_runner( tf.compat.v1.train.queue_runner.QueueRunner( input_queue, [input_queue.enqueue(tensors_to_enqueue)])) dequeued_tensors = input_queue.dequeue() return {keys[i]: dequeued_tensors[i] for i in range(len(dequeued_tensors))} def sorted_key_dict(unsorted_dict): return {k: unsorted_dict[k] for k in sorted(unsorted_dict)} def sigmoid(x): return 1 / (1 + np.exp(-1.0 * x)) class CheckPartitionerVarHook(tf.compat.v1.train.SessionRunHook): """A `SessionRunHook` to check a partitioned variable.""" def __init__(self, test_case, var_name, var_dim, partitions): self._test_case = test_case self._var_name = var_name self._var_dim = var_dim self._partitions = partitions def begin(self): with tf.compat.v1.variable_scope( tf.compat.v1.get_variable_scope()) as scope: scope.reuse_variables() partitioned_weight = tf.compat.v1.get_variable( self._var_name, shape=(self._var_dim, 1)) self._test_case.assertTrue( isinstance(partitioned_weight, variables_lib.PartitionedVariable)) for part in partitioned_weight: self._test_case.assertEqual(self._var_dim // self._partitions, part.get_shape()[0]) class BaseLinearRegressorPartitionerTest(object): def __init__(self, linear_regressor_fn, fc_lib=feature_column): self._linear_regressor_fn = linear_regressor_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: tf.compat.v1.summary.FileWriterCache.clear() shutil.rmtree(self._model_dir) def testPartitioner(self): x_dim = 64 partitions = 4 def _partitioner(shape, dtype): del dtype # unused; required by Fn signature. # Only partition the embedding tensor. return [partitions, 1] if shape[0] == x_dim else [1] regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.categorical_column_with_hash_bucket( 'language', hash_bucket_size=x_dim),), partitioner=_partitioner, model_dir=self._model_dir) def _input_fn(): return { 'language': tf.sparse.SparseTensor( values=['english', 'spanish'], indices=[[0, 0], [0, 1]], dense_shape=[1, 2]) }, [[10.]] hook = CheckPartitionerVarHook(self, LANGUAGE_WEIGHT_NAME, x_dim, partitions) regressor.train(input_fn=_input_fn, steps=1, hooks=[hook]) def testDefaultPartitionerWithMultiplePsReplicas(self): partitions = 2 # This results in weights larger than the default partition size of 64M, # so partitioned weights are created (each weight uses 4 bytes). x_dim = 32 << 20 class FakeRunConfig(run_config.RunConfig): @property def num_ps_replicas(self): return partitions # Mock the device setter as ps is not available on test machines. with tf.compat.v1.test.mock.patch.object( estimator, '_get_replica_device_setter', return_value=lambda _: '/cpu:0'): linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.categorical_column_with_hash_bucket( 'language', hash_bucket_size=x_dim),), config=FakeRunConfig(), model_dir=self._model_dir) def _input_fn(): return { 'language': tf.sparse.SparseTensor( values=['english', 'spanish'], indices=[[0, 0], [0, 1]], dense_shape=[1, 2]) }, [[10.]] hook = CheckPartitionerVarHook(self, LANGUAGE_WEIGHT_NAME, x_dim, partitions) linear_regressor.train(input_fn=_input_fn, steps=1, hooks=[hook]) # TODO(b/36813849): Add tests with dynamic shape inputs using placeholders. class BaseLinearRegressorEvaluationTest(object): def __init__(self, linear_regressor_fn, fc_lib=feature_column): self._linear_regressor_fn = linear_regressor_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: tf.compat.v1.summary.FileWriterCache.clear() shutil.rmtree(self._model_dir) def test_evaluation_for_simple_data(self): with tf.Graph().as_default(): tf.Variable([[11.0]], name=AGE_WEIGHT_NAME) tf.Variable([2.0], name=BIAS_NAME) tf.Variable( 100, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age'),), model_dir=self._model_dir) eval_metrics = linear_regressor.evaluate( input_fn=lambda: ({ 'age': ((1,),) }, ((10.,),)), steps=1) # Logit is (1. * 11.0 + 2.0) = 13, while label is 10. Loss is 3**2 = 9. self.assertDictEqual( { metric_keys.MetricKeys.LOSS: 9., metric_keys.MetricKeys.LOSS_MEAN: 9., metric_keys.MetricKeys.PREDICTION_MEAN: 13., metric_keys.MetricKeys.LABEL_MEAN: 10., tf.compat.v1.GraphKeys.GLOBAL_STEP: 100 }, eval_metrics) def test_evaluation_batch(self): """Tests evaluation for batch_size==2.""" with tf.Graph().as_default(): tf.Variable([[11.0]], name=AGE_WEIGHT_NAME) tf.Variable([2.0], name=BIAS_NAME) tf.Variable( 100, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age'),), model_dir=self._model_dir) eval_metrics = linear_regressor.evaluate( input_fn=lambda: ({ 'age': ((1,), (1,)) }, ((10.,), (10.,))), steps=1) # Logit is (1. * 11.0 + 2.0) = 13, while label is 10. # Loss per example is 3**2 = 9. # Training loss is the sum over batch = 9 + 9 = 18 # Average loss is the average over batch = 9 self.assertDictEqual( { metric_keys.MetricKeys.LOSS: 18., metric_keys.MetricKeys.LOSS_MEAN: 9., metric_keys.MetricKeys.PREDICTION_MEAN: 13., metric_keys.MetricKeys.LABEL_MEAN: 10., tf.compat.v1.GraphKeys.GLOBAL_STEP: 100 }, eval_metrics) def test_evaluation_weights(self): """Tests evaluation with weights.""" with tf.Graph().as_default(): tf.Variable([[11.0]], name=AGE_WEIGHT_NAME) tf.Variable([2.0], name=BIAS_NAME) tf.Variable( 100, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) def _input_fn(): features = {'age': ((1,), (1,)), 'weights': ((1.,), (2.,))} labels = ((10.,), (10.,)) return features, labels linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age'),), weight_column='weights', model_dir=self._model_dir) eval_metrics = linear_regressor.evaluate(input_fn=_input_fn, steps=1) # Logit is (1. * 11.0 + 2.0) = 13, while label is 10. # Loss per example is 3**2 = 9. # Training loss is the weighted sum over batch = 9 + 2*9 = 27 # average loss is the weighted average = 9 + 2*9 / (1 + 2) = 9 self.assertDictEqual( { metric_keys.MetricKeys.LOSS: 27., metric_keys.MetricKeys.LOSS_MEAN: 9., metric_keys.MetricKeys.PREDICTION_MEAN: 13., metric_keys.MetricKeys.LABEL_MEAN: 10., tf.compat.v1.GraphKeys.GLOBAL_STEP: 100 }, eval_metrics) def test_evaluation_for_multi_dimensions(self): x_dim = 3 label_dim = 2 with tf.Graph().as_default(): tf.Variable([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], name=AGE_WEIGHT_NAME) tf.Variable([7.0, 8.0], name=BIAS_NAME) tf.Variable(100, name='global_step', dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age', shape=(x_dim,)),), label_dimension=label_dim, model_dir=self._model_dir) input_fn = numpy_io.numpy_input_fn( x={ 'age': np.array([[2., 4., 5.]]), }, y=np.array([[46., 58.]]), batch_size=1, num_epochs=None, shuffle=False) eval_metrics = linear_regressor.evaluate(input_fn=input_fn, steps=1) self.assertItemsEqual( (metric_keys.MetricKeys.LOSS, metric_keys.MetricKeys.LOSS_MEAN, metric_keys.MetricKeys.PREDICTION_MEAN, metric_keys.MetricKeys.LABEL_MEAN, tf.compat.v1.GraphKeys.GLOBAL_STEP), eval_metrics.keys()) # Logit is # [2., 4., 5.] * [1.0, 2.0] + [7.0, 8.0] = [39, 50] + [7.0, 8.0] # [3.0, 4.0] # [5.0, 6.0] # which is [46, 58] self.assertAlmostEqual(0, eval_metrics[metric_keys.MetricKeys.LOSS]) def test_evaluation_for_multiple_feature_columns(self): with tf.Graph().as_default(): tf.Variable([[10.0]], name=AGE_WEIGHT_NAME) tf.Variable([[2.0]], name=HEIGHT_WEIGHT_NAME) tf.Variable([5.0], name=BIAS_NAME) tf.Variable( 100, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) batch_size = 2 feature_columns = [ self._fc_lib.numeric_column('age'), self._fc_lib.numeric_column('height') ] input_fn = numpy_io.numpy_input_fn( x={ 'age': np.array([20, 40]), 'height': np.array([4, 8]) }, y=np.array([[213.], [421.]]), batch_size=batch_size, num_epochs=None, shuffle=False) est = self._linear_regressor_fn( feature_columns=feature_columns, model_dir=self._model_dir) eval_metrics = est.evaluate(input_fn=input_fn, steps=1) self.assertItemsEqual( (metric_keys.MetricKeys.LOSS, metric_keys.MetricKeys.LOSS_MEAN, metric_keys.MetricKeys.PREDICTION_MEAN, metric_keys.MetricKeys.LABEL_MEAN, tf.compat.v1.GraphKeys.GLOBAL_STEP), eval_metrics.keys()) # Logit is [(20. * 10.0 + 4 * 2.0 + 5.0), (40. * 10.0 + 8 * 2.0 + 5.0)] = # [213.0, 421.0], while label is [213., 421.]. Loss = 0. self.assertAlmostEqual(0, eval_metrics[metric_keys.MetricKeys.LOSS]) def test_evaluation_for_multiple_feature_columns_mix(self): with tf.Graph().as_default(): tf.Variable([[10.0]], name=AGE_WEIGHT_NAME) tf.Variable([[2.0]], name=HEIGHT_WEIGHT_NAME) tf.Variable([5.0], name=BIAS_NAME) tf.Variable( 100, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) batch_size = 2 feature_columns = [ feature_column.numeric_column('age'), tf.feature_column.numeric_column('height') ] def _input_fn(): features_ds = tf.compat.v1.data.Dataset.from_tensor_slices({ 'age': np.array([20, 40]), 'height': np.array([4, 8]) }) labels_ds = tf.compat.v1.data.Dataset.from_tensor_slices( np.array([[213.], [421.]])) return (tf.compat.v1.data.Dataset.zip( (features_ds, labels_ds)).batch(batch_size).repeat(None)) est = self._linear_regressor_fn( feature_columns=feature_columns, model_dir=self._model_dir) eval_metrics = est.evaluate(input_fn=_input_fn, steps=1) self.assertItemsEqual( (metric_keys.MetricKeys.LOSS, metric_keys.MetricKeys.LOSS_MEAN, metric_keys.MetricKeys.PREDICTION_MEAN, metric_keys.MetricKeys.LABEL_MEAN, tf.compat.v1.GraphKeys.GLOBAL_STEP), eval_metrics.keys()) # Logit is [(20. * 10.0 + 4 * 2.0 + 5.0), (40. * 10.0 + 8 * 2.0 + 5.0)] = # [213.0, 421.0], while label is [213., 421.]. Loss = 0. self.assertAlmostEqual(0, eval_metrics[metric_keys.MetricKeys.LOSS]) class BaseLinearRegressorPredictTest(object): def __init__(self, linear_regressor_fn, fc_lib=feature_column): self._linear_regressor_fn = linear_regressor_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: tf.compat.v1.summary.FileWriterCache.clear() shutil.rmtree(self._model_dir) def test_1d(self): """Tests predict when all variables are one-dimensional.""" with tf.Graph().as_default(): tf.Variable([[10.]], name='linear/linear_model/x/weights') tf.Variable([.2], name=BIAS_NAME) tf.Variable(100, name='global_step', dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('x'),), model_dir=self._model_dir) predict_input_fn = numpy_io.numpy_input_fn( x={'x': np.array([[2.]])}, y=None, batch_size=1, num_epochs=1, shuffle=False) predictions = linear_regressor.predict(input_fn=predict_input_fn) predicted_scores = list([x['predictions'] for x in predictions]) # x * weight + bias = 2. * 10. + .2 = 20.2 self.assertAllClose([[20.2]], predicted_scores) def testMultiDim(self): """Tests predict when all variables are multi-dimenstional.""" batch_size = 2 label_dimension = 3 x_dim = 4 feature_columns = (self._fc_lib.numeric_column('x', shape=(x_dim,)),) with tf.Graph().as_default(): tf.Variable( # shape=[x_dim, label_dimension] [[1., 2., 3.], [2., 3., 4.], [3., 4., 5.], [4., 5., 6.]], name='linear/linear_model/x/weights') tf.Variable( # shape=[label_dimension] [.2, .4, .6], name=BIAS_NAME) tf.Variable(100, name='global_step', dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) linear_regressor = self._linear_regressor_fn( feature_columns=feature_columns, label_dimension=label_dimension, model_dir=self._model_dir) predict_input_fn = numpy_io.numpy_input_fn( # x shape=[batch_size, x_dim] x={'x': np.array([[1., 2., 3., 4.], [5., 6., 7., 8.]])}, y=None, batch_size=batch_size, num_epochs=1, shuffle=False) predictions = linear_regressor.predict(input_fn=predict_input_fn) predicted_scores = list([x['predictions'] for x in predictions]) # score = x * weight + bias, shape=[batch_size, label_dimension] self.assertAllClose([[30.2, 40.4, 50.6], [70.2, 96.4, 122.6]], predicted_scores) def testTwoFeatureColumns(self): """Tests predict with two feature columns.""" with tf.Graph().as_default(): tf.Variable([[10.]], name='linear/linear_model/x0/weights') tf.Variable([[20.]], name='linear/linear_model/x1/weights') tf.Variable([.2], name=BIAS_NAME) tf.Variable(100, name='global_step', dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('x0'), self._fc_lib.numeric_column('x1')), model_dir=self._model_dir) predict_input_fn = numpy_io.numpy_input_fn( x={ 'x0': np.array([[2.]]), 'x1': np.array([[3.]]) }, y=None, batch_size=1, num_epochs=1, shuffle=False) predictions = linear_regressor.predict(input_fn=predict_input_fn) predicted_scores = list([x['predictions'] for x in predictions]) # x0 * weight0 + x1 * weight1 + bias = 2. * 10. + 3. * 20 + .2 = 80.2 self.assertAllClose([[80.2]], predicted_scores) def testTwoFeatureColumnsMix(self): """Tests predict with two feature columns.""" with tf.Graph().as_default(): tf.Variable([[10.]], name='linear/linear_model/x0/weights') tf.Variable([[20.]], name='linear/linear_model/x1/weights') tf.Variable([.2], name=BIAS_NAME) tf.Variable(100, name='global_step', dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) linear_regressor = self._linear_regressor_fn( feature_columns=(feature_column.numeric_column('x0'), tf.feature_column.numeric_column('x1')), model_dir=self._model_dir) def _predict_input_fn(): return tf.compat.v1.data.Dataset.from_tensor_slices({ 'x0': np.array([[2.]]), 'x1': np.array([[3.]]) }).batch(1) predictions = linear_regressor.predict(input_fn=_predict_input_fn) predicted_scores = list([x['predictions'] for x in predictions]) # x0 * weight0 + x1 * weight1 + bias = 2. * 10. + 3. * 20 + .2 = 80.2 self.assertAllClose([[80.2]], predicted_scores) def testSparseCombiner(self): w_a = 2.0 w_b = 3.0 w_c = 5.0 bias = 5.0 with tf.Graph().as_default(): tf.Variable([[w_a], [w_b], [w_c]], name=LANGUAGE_WEIGHT_NAME) tf.Variable([bias], name=BIAS_NAME) tf.Variable( 1, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) def _input_fn(): return tf.compat.v1.data.Dataset.from_tensors({ 'language': tf.sparse.SparseTensor( values=['a', 'c', 'b', 'c'], indices=[[0, 0], [0, 1], [1, 0], [1, 1]], dense_shape=[2, 2]), }) feature_columns = (self._fc_lib.categorical_column_with_vocabulary_list( 'language', vocabulary_list=['a', 'b', 'c']),) # Check prediction for each sparse_combiner. # With sparse_combiner = 'sum', we have # logits_1 = w_a + w_c + bias # = 2.0 + 5.0 + 5.0 = 12.0 # logits_2 = w_b + w_c + bias # = 3.0 + 5.0 + 5.0 = 13.0 linear_regressor = self._linear_regressor_fn( feature_columns=feature_columns, model_dir=self._model_dir) predictions = linear_regressor.predict(input_fn=_input_fn) predicted_scores = list([x['predictions'] for x in predictions]) self.assertAllClose([[12.0], [13.0]], predicted_scores) # With sparse_combiner = 'mean', we have # logits_1 = 1/2 * (w_a + w_c) + bias # = 1/2 * (2.0 + 5.0) + 5.0 = 8.5 # logits_2 = 1/2 * (w_b + w_c) + bias # = 1/2 * (3.0 + 5.0) + 5.0 = 9.0 linear_regressor = self._linear_regressor_fn( feature_columns=feature_columns, model_dir=self._model_dir, sparse_combiner='mean') predictions = linear_regressor.predict(input_fn=_input_fn) predicted_scores = list([x['predictions'] for x in predictions]) self.assertAllClose([[8.5], [9.0]], predicted_scores) # With sparse_combiner = 'sqrtn', we have # logits_1 = sqrt(2)/2 * (w_a + w_c) + bias # = sqrt(2)/2 * (2.0 + 5.0) + 5.0 = 9.94974 # logits_2 = sqrt(2)/2 * (w_b + w_c) + bias # = sqrt(2)/2 * (3.0 + 5.0) + 5.0 = 10.65685 linear_regressor = self._linear_regressor_fn( feature_columns=feature_columns, model_dir=self._model_dir, sparse_combiner='sqrtn') predictions = linear_regressor.predict(input_fn=_input_fn) predicted_scores = list([x['predictions'] for x in predictions]) self.assertAllClose([[9.94974], [10.65685]], predicted_scores) class BaseLinearRegressorIntegrationTest(object): def __init__(self, linear_regressor_fn, fc_lib=feature_column): self._linear_regressor_fn = linear_regressor_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: tf.compat.v1.summary.FileWriterCache.clear() shutil.rmtree(self._model_dir) def _test_complete_flow(self, train_input_fn, eval_input_fn, predict_input_fn, input_dimension, label_dimension, prediction_length): feature_columns = [ self._fc_lib.numeric_column('x', shape=(input_dimension,)) ] est = self._linear_regressor_fn( feature_columns=feature_columns, label_dimension=label_dimension, model_dir=self._model_dir) # TRAIN # learn y = x est.train(train_input_fn, steps=200) # EVALUTE scores = est.evaluate(eval_input_fn) self.assertEqual(200, scores[tf.compat.v1.GraphKeys.GLOBAL_STEP]) self.assertIn(metric_keys.MetricKeys.LOSS, six.iterkeys(scores)) # PREDICT predictions = np.array( [x['predictions'] for x in est.predict(predict_input_fn)]) self.assertAllEqual((prediction_length, label_dimension), predictions.shape) # EXPORT feature_spec = tf.compat.v1.feature_column.make_parse_example_spec( feature_columns) serving_input_receiver_fn = export.build_parsing_serving_input_receiver_fn( feature_spec) export_dir = est.export_saved_model(tempfile.mkdtemp(), serving_input_receiver_fn) self.assertTrue(tf.compat.v1.gfile.Exists(export_dir)) def test_numpy_input_fn(self): """Tests complete flow with numpy_input_fn.""" label_dimension = 2 input_dimension = label_dimension batch_size = 10 prediction_length = batch_size data = np.linspace(0., 2., batch_size * label_dimension, dtype=np.float32) data = data.reshape(batch_size, label_dimension) train_input_fn = numpy_io.numpy_input_fn( x={'x': data}, y=data, batch_size=batch_size, num_epochs=None, shuffle=True) eval_input_fn = numpy_io.numpy_input_fn( x={'x': data}, y=data, batch_size=batch_size, num_epochs=1, shuffle=False) predict_input_fn = numpy_io.numpy_input_fn( x={'x': data}, y=None, batch_size=batch_size, num_epochs=1, shuffle=False) self._test_complete_flow( train_input_fn=train_input_fn, eval_input_fn=eval_input_fn, predict_input_fn=predict_input_fn, input_dimension=input_dimension, label_dimension=label_dimension, prediction_length=prediction_length) def test_pandas_input_fn(self): """Tests complete flow with pandas_input_fn.""" if not HAS_PANDAS: return # Pandas DataFrame natually supports 1 dim data only. label_dimension = 1 input_dimension = label_dimension batch_size = 10 data = np.array([1., 2., 3., 4.], dtype=np.float32) x = pd.DataFrame({'x': data}) y = pd.Series(data) prediction_length = 4 train_input_fn = pandas_io.pandas_input_fn( x=x, y=y, batch_size=batch_size, num_epochs=None, shuffle=True) eval_input_fn = pandas_io.pandas_input_fn( x=x, y=y, batch_size=batch_size, shuffle=False) predict_input_fn = pandas_io.pandas_input_fn( x=x, batch_size=batch_size, shuffle=False) self._test_complete_flow( train_input_fn=train_input_fn, eval_input_fn=eval_input_fn, predict_input_fn=predict_input_fn, input_dimension=input_dimension, label_dimension=label_dimension, prediction_length=prediction_length) def test_input_fn_from_parse_example(self): """Tests complete flow with input_fn constructed from parse_example.""" label_dimension = 2 input_dimension = label_dimension batch_size = 10 prediction_length = batch_size data = np.linspace(0., 2., batch_size * label_dimension, dtype=np.float32) data = data.reshape(batch_size, label_dimension) serialized_examples = [] for datum in data: example = example_pb2.Example( features=feature_pb2.Features( feature={ 'x': feature_pb2.Feature( float_list=feature_pb2.FloatList(value=datum)), 'y': feature_pb2.Feature( float_list=feature_pb2.FloatList( value=datum[:label_dimension])), })) serialized_examples.append(example.SerializeToString()) feature_spec = { 'x': tf.io.FixedLenFeature([input_dimension], tf.dtypes.float32), 'y': tf.io.FixedLenFeature([label_dimension], tf.dtypes.float32), } def _train_input_fn(): feature_map = tf.compat.v1.io.parse_example(serialized_examples, feature_spec) features = queue_parsed_features(feature_map) labels = features.pop('y') return features, labels def _eval_input_fn(): feature_map = tf.compat.v1.io.parse_example( tf.compat.v1.train.limit_epochs(serialized_examples, num_epochs=1), feature_spec) features = queue_parsed_features(feature_map) labels = features.pop('y') return features, labels def _predict_input_fn(): feature_map = tf.compat.v1.io.parse_example( tf.compat.v1.train.limit_epochs(serialized_examples, num_epochs=1), feature_spec) features = queue_parsed_features(feature_map) features.pop('y') return features, None self._test_complete_flow( train_input_fn=_train_input_fn, eval_input_fn=_eval_input_fn, predict_input_fn=_predict_input_fn, input_dimension=input_dimension, label_dimension=label_dimension, prediction_length=prediction_length) class BaseLinearRegressorTrainingTest(object): def __init__(self, linear_regressor_fn, fc_lib=feature_column): self._linear_regressor_fn = linear_regressor_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: tf.compat.v1.summary.FileWriterCache.clear() shutil.rmtree(self._model_dir) def _mock_optimizer(self, expected_loss=None): expected_var_names = [ '%s/part_0:0' % AGE_WEIGHT_NAME, '%s/part_0:0' % BIAS_NAME ] def _minimize(loss, global_step=None, var_list=None): trainable_vars = var_list or tf.compat.v1.get_collection( tf.compat.v1.GraphKeys.TRAINABLE_VARIABLES) self.assertItemsEqual(expected_var_names, [var.name for var in trainable_vars]) # Verify loss. We can't check the value directly, so we add an assert op. self.assertEquals(0, loss.shape.ndims) if expected_loss is None: if global_step is not None: return tf.compat.v1.assign_add(global_step, 1).op return tf.no_op() assert_loss = assert_close( tf.cast(expected_loss, name='expected', dtype=tf.dtypes.float32), loss, name='assert_loss') with tf.control_dependencies((assert_loss,)): if global_step is not None: return tf.compat.v1.assign_add(global_step, 1).op return tf.no_op() mock_optimizer = tf.compat.v1.test.mock.NonCallableMock( spec=tf.compat.v1.train.Optimizer, wraps=tf.compat.v1.train.Optimizer( use_locking=False, name='my_optimizer')) mock_optimizer.minimize = tf.compat.v1.test.mock.MagicMock(wraps=_minimize) # NOTE: Estimator.params performs a deepcopy, which wreaks havoc with mocks. # So, return mock_optimizer itself for deepcopy. mock_optimizer.__deepcopy__ = lambda _: mock_optimizer return mock_optimizer def _assert_checkpoint(self, expected_global_step, expected_age_weight=None, expected_bias=None): shapes = { name: shape for (name, shape) in tf.train.list_variables(self._model_dir) } self.assertEqual([], shapes[tf.compat.v1.GraphKeys.GLOBAL_STEP]) self.assertEqual( expected_global_step, tf.train.load_variable(self._model_dir, tf.compat.v1.GraphKeys.GLOBAL_STEP)) self.assertEqual([1, 1], shapes[AGE_WEIGHT_NAME]) if expected_age_weight is not None: self.assertEqual(expected_age_weight, tf.train.load_variable(self._model_dir, AGE_WEIGHT_NAME)) self.assertEqual([1], shapes[BIAS_NAME]) if expected_bias is not None: self.assertEqual(expected_bias, tf.train.load_variable(self._model_dir, BIAS_NAME)) def testFromScratchWithDefaultOptimizer(self): # Create LinearRegressor.
def testTrainWithOneDimLabel(self): label_dimension = 1 batch_size = 20 feature_columns = [self._fc_lib.numeric_column('age', shape=(1,))] est = self._linear_regressor_fn( feature_columns=feature_columns, label_dimension=label_dimension, model_dir=self._model_dir) data_rank_1 = np.linspace(0., 2., batch_size, dtype=np.float32) self.assertEqual((batch_size,), data_rank_1.shape) train_input_fn = numpy_io.numpy_input_fn( x={'age': data_rank_1}, y=data_rank_1, batch_size=batch_size, num_epochs=None, shuffle=True) est.train(train_input_fn, steps=200) self._assert_checkpoint(200) def testTrainWithOneDimWeight(self): label_dimension = 1 batch_size = 20 feature_columns = [self._fc_lib.numeric_column('age', shape=(1,))] est = self._linear_regressor_fn( feature_columns=feature_columns, label_dimension=label_dimension, weight_column='w', model_dir=self._model_dir) data_rank_1 = np.linspace(0., 2., batch_size, dtype=np.float32) self.assertEqual((batch_size,), data_rank_1.shape) train_input_fn = numpy_io.numpy_input_fn( x={ 'age': data_rank_1, 'w': data_rank_1 }, y=data_rank_1, batch_size=batch_size, num_epochs=None, shuffle=True) est.train(train_input_fn, steps=200) self._assert_checkpoint(200) def testFromScratch(self): # Create LinearRegressor. label = 5. age = 17 # loss = (logits - label)^2 = (0 - 5.)^2 = 25. mock_optimizer = self._mock_optimizer(expected_loss=25.) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age'),), model_dir=self._model_dir, optimizer=mock_optimizer) self.assertEqual(0, mock_optimizer.minimize.call_count) # Train for a few steps, and validate optimizer and final checkpoint. num_steps = 10 linear_regressor.train( input_fn=lambda: ({ 'age': ((age,),) }, ((label,),)), steps=num_steps) self.assertEqual(1, mock_optimizer.minimize.call_count) self._assert_checkpoint( expected_global_step=num_steps, expected_age_weight=0., expected_bias=0.) def testFromCheckpoint(self): # Create initial checkpoint. age_weight = 10.0 bias = 5.0 initial_global_step = 100 with tf.Graph().as_default(): tf.Variable([[age_weight]], name=AGE_WEIGHT_NAME) tf.Variable([bias], name=BIAS_NAME) tf.Variable( initial_global_step, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) # logits = age * age_weight + bias = 17 * 10. + 5. = 175 # loss = (logits - label)^2 = (175 - 5)^2 = 28900 mock_optimizer = self._mock_optimizer(expected_loss=28900.) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age'),), model_dir=self._model_dir, optimizer=mock_optimizer) self.assertEqual(0, mock_optimizer.minimize.call_count) # Train for a few steps, and validate optimizer and final checkpoint. num_steps = 10 linear_regressor.train( input_fn=lambda: ({ 'age': ((17,),) }, ((5.,),)), steps=num_steps) self.assertEqual(1, mock_optimizer.minimize.call_count) self._assert_checkpoint( expected_global_step=initial_global_step + num_steps, expected_age_weight=age_weight, expected_bias=bias) def testFromCheckpointMultiBatch(self): # Create initial checkpoint. age_weight = 10.0 bias = 5.0 initial_global_step = 100 with tf.Graph().as_default(): tf.Variable([[age_weight]], name=AGE_WEIGHT_NAME) tf.Variable([bias], name=BIAS_NAME) tf.Variable( initial_global_step, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) # logits = age * age_weight + bias # logits[0] = 17 * 10. + 5. = 175 # logits[1] = 15 * 10. + 5. = 155 # loss = sum(logits - label)^2 = (175 - 5)^2 + (155 - 3)^2 = 52004 mock_optimizer = self._mock_optimizer(expected_loss=52004.) linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age'),), model_dir=self._model_dir, optimizer=mock_optimizer) self.assertEqual(0, mock_optimizer.minimize.call_count) # Train for a few steps, and validate optimizer and final checkpoint. num_steps = 10 linear_regressor.train( input_fn=lambda: ({ 'age': ((17,), (15,)) }, ((5.,), (3.,))), steps=num_steps) self.assertEqual(1, mock_optimizer.minimize.call_count) self._assert_checkpoint( expected_global_step=initial_global_step + num_steps, expected_age_weight=age_weight, expected_bias=bias) class BaseLinearClassifierTrainingTest(object): def __init__(self, linear_classifier_fn, fc_lib=feature_column): self._linear_classifier_fn = linear_classifier_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: shutil.rmtree(self._model_dir) def _mock_optimizer(self, expected_loss=None): expected_var_names = [ '%s/part_0:0' % AGE_WEIGHT_NAME, '%s/part_0:0' % BIAS_NAME ] def _minimize(loss, global_step): trainable_vars = tf.compat.v1.get_collection( tf.compat.v1.GraphKeys.TRAINABLE_VARIABLES) self.assertItemsEqual(expected_var_names, [var.name for var in trainable_vars]) # Verify loss. We can't check the value directly, so we add an assert op. self.assertEquals(0, loss.shape.ndims) if expected_loss is None: return tf.compat.v1.assign_add(global_step, 1).op assert_loss = assert_close( tf.cast(expected_loss, name='expected', dtype=tf.dtypes.float32), loss, name='assert_loss') with tf.control_dependencies((assert_loss,)): return tf.compat.v1.assign_add(global_step, 1).op mock_optimizer = tf.compat.v1.test.mock.NonCallableMock( spec=tf.compat.v1.train.Optimizer, wraps=tf.compat.v1.train.Optimizer( use_locking=False, name='my_optimizer')) mock_optimizer.minimize = tf.compat.v1.test.mock.MagicMock(wraps=_minimize) # NOTE: Estimator.params performs a deepcopy, which wreaks havoc with mocks. # So, return mock_optimizer itself for deepcopy. mock_optimizer.__deepcopy__ = lambda _: mock_optimizer return mock_optimizer def _assert_checkpoint(self, n_classes, expected_global_step, expected_age_weight=None, expected_bias=None): logits_dimension = n_classes if n_classes > 2 else 1 shapes = { name: shape for (name, shape) in tf.train.list_variables(self._model_dir) } self.assertEqual([], shapes[tf.compat.v1.GraphKeys.GLOBAL_STEP]) self.assertEqual( expected_global_step, tf.train.load_variable(self._model_dir, tf.compat.v1.GraphKeys.GLOBAL_STEP)) self.assertEqual([1, logits_dimension], shapes[AGE_WEIGHT_NAME]) if expected_age_weight is not None: self.assertAllEqual( expected_age_weight, tf.train.load_variable(self._model_dir, AGE_WEIGHT_NAME)) self.assertEqual([logits_dimension], shapes[BIAS_NAME]) if expected_bias is not None: self.assertAllEqual(expected_bias, tf.train.load_variable(self._model_dir, BIAS_NAME)) def _testFromScratchWithDefaultOptimizer(self, n_classes): label = 0 age = 17 est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, model_dir=self._model_dir) # Train for a few steps, and validate final checkpoint. num_steps = 10 est.train( input_fn=lambda: ({ 'age': ((age,),) }, ((label,),)), steps=num_steps) self._assert_checkpoint(n_classes, num_steps) def testBinaryClassesFromScratchWithDefaultOptimizer(self): self._testFromScratchWithDefaultOptimizer(n_classes=2) def testMultiClassesFromScratchWithDefaultOptimizer(self): self._testFromScratchWithDefaultOptimizer(n_classes=4) def _testTrainWithTwoDimsLabel(self, n_classes): batch_size = 20 est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, model_dir=self._model_dir) data_rank_1 = np.array([0, 1]) data_rank_2 = np.array([[0], [1]]) self.assertEqual((2,), data_rank_1.shape) self.assertEqual((2, 1), data_rank_2.shape) train_input_fn = numpy_io.numpy_input_fn( x={'age': data_rank_1}, y=data_rank_2, batch_size=batch_size, num_epochs=None, shuffle=True) est.train(train_input_fn, steps=200) self._assert_checkpoint(n_classes, 200) def testBinaryClassesTrainWithTwoDimsLabel(self): self._testTrainWithTwoDimsLabel(n_classes=2) def testMultiClassesTrainWithTwoDimsLabel(self): self._testTrainWithTwoDimsLabel(n_classes=4) def _testTrainWithOneDimLabel(self, n_classes): batch_size = 20 est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, model_dir=self._model_dir) data_rank_1 = np.array([0, 1]) self.assertEqual((2,), data_rank_1.shape) train_input_fn = numpy_io.numpy_input_fn( x={'age': data_rank_1}, y=data_rank_1, batch_size=batch_size, num_epochs=None, shuffle=True) est.train(train_input_fn, steps=200) self._assert_checkpoint(n_classes, 200) def testBinaryClassesTrainWithOneDimLabel(self): self._testTrainWithOneDimLabel(n_classes=2) def testMultiClassesTrainWithOneDimLabel(self): self._testTrainWithOneDimLabel(n_classes=4) def _testTrainWithTwoDimsWeight(self, n_classes): batch_size = 20 est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), weight_column='w', n_classes=n_classes, model_dir=self._model_dir) data_rank_1 = np.array([0, 1]) data_rank_2 = np.array([[0], [1]]) self.assertEqual((2,), data_rank_1.shape) self.assertEqual((2, 1), data_rank_2.shape) train_input_fn = numpy_io.numpy_input_fn( x={ 'age': data_rank_1, 'w': data_rank_2 }, y=data_rank_1, batch_size=batch_size, num_epochs=None, shuffle=True) est.train(train_input_fn, steps=200) self._assert_checkpoint(n_classes, 200) def testBinaryClassesTrainWithTwoDimsWeight(self): self._testTrainWithTwoDimsWeight(n_classes=2) def testMultiClassesTrainWithTwoDimsWeight(self): self._testTrainWithTwoDimsWeight(n_classes=4) def _testTrainWithOneDimWeight(self, n_classes): batch_size = 20 est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), weight_column='w', n_classes=n_classes, model_dir=self._model_dir) data_rank_1 = np.array([0, 1]) self.assertEqual((2,), data_rank_1.shape) train_input_fn = numpy_io.numpy_input_fn( x={ 'age': data_rank_1, 'w': data_rank_1 }, y=data_rank_1, batch_size=batch_size, num_epochs=None, shuffle=True) est.train(train_input_fn, steps=200) self._assert_checkpoint(n_classes, 200) def testBinaryClassesTrainWithOneDimWeight(self): self._testTrainWithOneDimWeight(n_classes=2) def testMultiClassesTrainWithOneDimWeight(self): self._testTrainWithOneDimWeight(n_classes=4) def _testFromScratch(self, n_classes): label = 1 age = 17 # For binary classifier: # loss = sigmoid_cross_entropy(logits, label) where logits=0 (weights are # all zero initially) and label = 1 so, # loss = 1 * -log ( sigmoid(logits) ) = 0.69315 # For multi class classifier: # loss = cross_entropy(logits, label) where logits are all 0s (weights are # all zero initially) and label = 1 so, # loss = 1 * -log ( 1.0 / n_classes ) # For this particular test case, as logits are same, the formular # 1 * -log ( 1.0 / n_classes ) covers both binary and multi class cases. mock_optimizer = self._mock_optimizer( expected_loss=(-1 * math.log(1.0 / n_classes))) est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, optimizer=mock_optimizer, model_dir=self._model_dir) self.assertEqual(0, mock_optimizer.minimize.call_count) # Train for a few steps, and validate optimizer and final checkpoint. num_steps = 10 est.train( input_fn=lambda: ({ 'age': ((age,),) }, ((label,),)), steps=num_steps) self.assertEqual(1, mock_optimizer.minimize.call_count) self._assert_checkpoint( n_classes, expected_global_step=num_steps, expected_age_weight=[[0.]] if n_classes == 2 else [[0.] * n_classes], expected_bias=[0.] if n_classes == 2 else [.0] * n_classes) def testBinaryClassesFromScratch(self): self._testFromScratch(n_classes=2) def testMultiClassesFromScratch(self): self._testFromScratch(n_classes=4) def _testFromCheckpoint(self, n_classes): # Create initial checkpoint. label = 1 age = 17 # For binary case, the expected weight has shape (1,1). For multi class # case, the shape is (1, n_classes). In order to test the weights, set # weights as 2.0 * range(n_classes). age_weight = [[2.0]] if n_classes == 2 else (np.reshape( 2.0 * np.array(list(range(n_classes)), dtype=np.float32), (1, n_classes))) bias = [-35.0] if n_classes == 2 else [-35.0] * n_classes initial_global_step = 100 with tf.Graph().as_default(): tf.Variable(age_weight, name=AGE_WEIGHT_NAME) tf.Variable(bias, name=BIAS_NAME) tf.Variable( initial_global_step, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) # For binary classifier: # logits = age * age_weight + bias = 17 * 2. - 35. = -1. # loss = sigmoid_cross_entropy(logits, label) # so, loss = 1 * -log ( sigmoid(-1) ) = 1.3133 # For multi class classifier: # loss = cross_entropy(logits, label) # where logits = 17 * age_weight + bias and label = 1 # so, loss = 1 * -log ( soft_max(logits)[1] ) if n_classes == 2: expected_loss = 1.3133 else: logits = age_weight * age + bias logits_exp = np.exp(logits) softmax = logits_exp / logits_exp.sum() expected_loss = -1 * math.log(softmax[0, label]) mock_optimizer = self._mock_optimizer(expected_loss=expected_loss) est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, optimizer=mock_optimizer, model_dir=self._model_dir) self.assertEqual(0, mock_optimizer.minimize.call_count) # Train for a few steps, and validate optimizer and final checkpoint. num_steps = 10 est.train( input_fn=lambda: ({ 'age': ((age,),) }, ((label,),)), steps=num_steps) self.assertEqual(1, mock_optimizer.minimize.call_count) self._assert_checkpoint( n_classes, expected_global_step=initial_global_step + num_steps, expected_age_weight=age_weight, expected_bias=bias) def testBinaryClassesFromCheckpoint(self): self._testFromCheckpoint(n_classes=2) def testMultiClassesFromCheckpoint(self): self._testFromCheckpoint(n_classes=4) def _testFromCheckpointFloatLabels(self, n_classes): """Tests float labels for binary classification.""" # Create initial checkpoint. if n_classes > 2: return label = 0.8 age = 17 age_weight = [[2.0]] bias = [-35.0] initial_global_step = 100 with tf.Graph().as_default(): tf.Variable(age_weight, name=AGE_WEIGHT_NAME) tf.Variable(bias, name=BIAS_NAME) tf.Variable( initial_global_step, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) # logits = age * age_weight + bias = 17 * 2. - 35. = -1. # loss = sigmoid_cross_entropy(logits, label) # => loss = -0.8 * log(sigmoid(-1)) -0.2 * log(sigmoid(+1)) = 1.1132617 mock_optimizer = self._mock_optimizer(expected_loss=1.1132617) est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, optimizer=mock_optimizer, model_dir=self._model_dir) self.assertEqual(0, mock_optimizer.minimize.call_count) # Train for a few steps, and validate optimizer and final checkpoint. num_steps = 10 est.train( input_fn=lambda: ({ 'age': ((age,),) }, ((label,),)), steps=num_steps) self.assertEqual(1, mock_optimizer.minimize.call_count) def testBinaryClassesFromCheckpointFloatLabels(self): self._testFromCheckpointFloatLabels(n_classes=2) def testMultiClassesFromCheckpointFloatLabels(self): self._testFromCheckpointFloatLabels(n_classes=4) def _testFromCheckpointMultiBatch(self, n_classes): # Create initial checkpoint. label = [1, 0] age = [17.0, 18.5] # For binary case, the expected weight has shape (1,1). For multi class # case, the shape is (1, n_classes). In order to test the weights, set # weights as 2.0 * range(n_classes). age_weight = [[2.0]] if n_classes == 2 else (np.reshape( 2.0 * np.array(list(range(n_classes)), dtype=np.float32), (1, n_classes))) bias = [-35.0] if n_classes == 2 else [-35.0] * n_classes initial_global_step = 100 with tf.Graph().as_default(): tf.Variable(age_weight, name=AGE_WEIGHT_NAME) tf.Variable(bias, name=BIAS_NAME) tf.Variable( initial_global_step, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) # For binary classifier: # logits = age * age_weight + bias # logits[0] = 17 * 2. - 35. = -1. # logits[1] = 18.5 * 2. - 35. = 2. # loss = sigmoid_cross_entropy(logits, label) # so, loss[0] = 1 * -log ( sigmoid(-1) ) = 1.3133 # loss[1] = (1 - 0) * -log ( 1- sigmoid(2) ) = 2.1269 # expected_loss = loss[0] + loss[1] # For multi class classifier: # loss = cross_entropy(logits, label) # where logits = [17, 18.5] * age_weight + bias and label = [1, 0] # so, loss = 1 * -log ( soft_max(logits)[label] ) # expected_loss = loss[0] + loss[1] if n_classes == 2: expected_loss = 1.3133 + 2.1269 else: logits = age_weight * np.reshape(age, (2, 1)) + bias logits_exp = np.exp(logits) softmax_row_0 = logits_exp[0] / logits_exp[0].sum() softmax_row_1 = logits_exp[1] / logits_exp[1].sum() expected_loss_0 = -1 * math.log(softmax_row_0[label[0]]) expected_loss_1 = -1 * math.log(softmax_row_1[label[1]]) expected_loss = expected_loss_0 + expected_loss_1 mock_optimizer = self._mock_optimizer(expected_loss=expected_loss) est = linear.LinearClassifier( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, optimizer=mock_optimizer, model_dir=self._model_dir) self.assertEqual(0, mock_optimizer.minimize.call_count) # Train for a few steps, and validate optimizer and final checkpoint. num_steps = 10 est.train(input_fn=lambda: ({'age': (age)}, (label)), steps=num_steps) self.assertEqual(1, mock_optimizer.minimize.call_count) self._assert_checkpoint( n_classes, expected_global_step=initial_global_step + num_steps, expected_age_weight=age_weight, expected_bias=bias) def testBinaryClassesFromCheckpointMultiBatch(self): self._testFromCheckpointMultiBatch(n_classes=2) def testMultiClassesFromCheckpointMultiBatch(self): self._testFromCheckpointMultiBatch(n_classes=4) class BaseLinearClassifierEvaluationTest(object): def __init__(self, linear_classifier_fn, fc_lib=feature_column): self._linear_classifier_fn = linear_classifier_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: shutil.rmtree(self._model_dir) def _test_evaluation_for_simple_data(self, n_classes): label = 1 age = 1. # For binary case, the expected weight has shape (1,1). For multi class # case, the shape is (1, n_classes). In order to test the weights, set # weights as 2.0 * range(n_classes). age_weight = [[-11.0]] if n_classes == 2 else (np.reshape( -11.0 * np.array(list(range(n_classes)), dtype=np.float32), (1, n_classes))) bias = [-30.0] if n_classes == 2 else [-30.0] * n_classes with tf.Graph().as_default(): tf.Variable(age_weight, name=AGE_WEIGHT_NAME) tf.Variable(bias, name=BIAS_NAME) tf.Variable( 100, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) est = self._linear_classifier_fn( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, model_dir=self._model_dir) eval_metrics = est.evaluate( input_fn=lambda: ({ 'age': ((age,),) }, ((label,),)), steps=1) if n_classes == 2: # Binary classes: loss = sum(corss_entropy(41)) = 41. expected_metrics = { metric_keys.MetricKeys.LOSS: 41., tf.compat.v1.GraphKeys.GLOBAL_STEP: 100, metric_keys.MetricKeys.LOSS_MEAN: 41., metric_keys.MetricKeys.ACCURACY: 0., metric_keys.MetricKeys.PRECISION: 0., metric_keys.MetricKeys.RECALL: 0., metric_keys.MetricKeys.PREDICTION_MEAN: 0., metric_keys.MetricKeys.LABEL_MEAN: 1., metric_keys.MetricKeys.ACCURACY_BASELINE: 1, metric_keys.MetricKeys.AUC: 0., metric_keys.MetricKeys.AUC_PR: 1., } else: # Multi classes: loss = 1 * -log ( soft_max(logits)[label] ) logits = age_weight * age + bias logits_exp = np.exp(logits) softmax = logits_exp / logits_exp.sum() expected_loss = -1 * math.log(softmax[0, label]) expected_metrics = { metric_keys.MetricKeys.LOSS: expected_loss, metric_keys.MetricKeys.LOSS_MEAN: expected_loss, tf.compat.v1.GraphKeys.GLOBAL_STEP: 100, metric_keys.MetricKeys.ACCURACY: 0., } self.assertAllClose( sorted_key_dict(expected_metrics), sorted_key_dict(eval_metrics), rtol=1e-3) def test_binary_classes_evaluation_for_simple_data(self): self._test_evaluation_for_simple_data(n_classes=2) def test_multi_classes_evaluation_for_simple_data(self): self._test_evaluation_for_simple_data(n_classes=4) def _test_evaluation_batch(self, n_classes): """Tests evaluation for batch_size==2.""" label = [1, 0] age = [17., 18.] # For binary case, the expected weight has shape (1,1). For multi class # case, the shape is (1, n_classes). In order to test the weights, set # weights as 2.0 * range(n_classes). age_weight = [[2.0]] if n_classes == 2 else (np.reshape( 2.0 * np.array(list(range(n_classes)), dtype=np.float32), (1, n_classes))) bias = [-35.0] if n_classes == 2 else [-35.0] * n_classes initial_global_step = 100 with tf.Graph().as_default(): tf.Variable(age_weight, name=AGE_WEIGHT_NAME) tf.Variable(bias, name=BIAS_NAME) tf.Variable( initial_global_step, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) est = self._linear_classifier_fn( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, model_dir=self._model_dir) eval_metrics = est.evaluate( input_fn=lambda: ({ 'age': (age) }, (label)), steps=1) if n_classes == 2: # Logits are (-1., 1.) labels are (1, 0). # Loss is # loss for row 1: 1 * -log(sigmoid(-1)) = 1.3133 # loss for row 2: (1 - 0) * -log(1 - sigmoid(1)) = 1.3133 expected_loss = 1.3133 * 2 expected_metrics = { metric_keys.MetricKeys.LOSS: expected_loss, tf.compat.v1.GraphKeys.GLOBAL_STEP: 100, metric_keys.MetricKeys.LOSS_MEAN: expected_loss / 2, metric_keys.MetricKeys.ACCURACY: 0., metric_keys.MetricKeys.PRECISION: 0., metric_keys.MetricKeys.RECALL: 0., metric_keys.MetricKeys.PREDICTION_MEAN: 0.5, metric_keys.MetricKeys.LABEL_MEAN: 0.5, metric_keys.MetricKeys.ACCURACY_BASELINE: 0.5, metric_keys.MetricKeys.AUC: 0., metric_keys.MetricKeys.AUC_PR: 0.25, } else: # Multi classes: loss = 1 * -log ( soft_max(logits)[label] ) logits = age_weight * np.reshape(age, (2, 1)) + bias logits_exp = np.exp(logits) softmax_row_0 = logits_exp[0] / logits_exp[0].sum() softmax_row_1 = logits_exp[1] / logits_exp[1].sum() expected_loss_0 = -1 * math.log(softmax_row_0[label[0]]) expected_loss_1 = -1 * math.log(softmax_row_1[label[1]]) expected_loss = expected_loss_0 + expected_loss_1 expected_metrics = { metric_keys.MetricKeys.LOSS: expected_loss, metric_keys.MetricKeys.LOSS_MEAN: expected_loss / 2, tf.compat.v1.GraphKeys.GLOBAL_STEP: 100, metric_keys.MetricKeys.ACCURACY: 0., } self.assertAllClose( sorted_key_dict(expected_metrics), sorted_key_dict(eval_metrics), rtol=1e-3) def test_binary_classes_evaluation_batch(self): self._test_evaluation_batch(n_classes=2) def test_multi_classes_evaluation_batch(self): self._test_evaluation_batch(n_classes=4) def _test_evaluation_weights(self, n_classes): """Tests evaluation with weights.""" label = [1, 0] age = [17., 18.] weights = [1., 2.] # For binary case, the expected weight has shape (1,1). For multi class # case, the shape is (1, n_classes). In order to test the weights, set # weights as 2.0 * range(n_classes). age_weight = [[2.0]] if n_classes == 2 else (np.reshape( 2.0 * np.array(list(range(n_classes)), dtype=np.float32), (1, n_classes))) bias = [-35.0] if n_classes == 2 else [-35.0] * n_classes initial_global_step = 100 with tf.Graph().as_default(): tf.Variable(age_weight, name=AGE_WEIGHT_NAME) tf.Variable(bias, name=BIAS_NAME) tf.Variable( initial_global_step, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) est = self._linear_classifier_fn( feature_columns=(self._fc_lib.numeric_column('age'),), n_classes=n_classes, weight_column='w', model_dir=self._model_dir) eval_metrics = est.evaluate( input_fn=lambda: ({ 'age': (age), 'w': (weights) }, (label)), steps=1) if n_classes == 2: # Logits are (-1., 1.) labels are (1, 0). # Loss is # loss for row 1: 1 * -log(sigmoid(-1)) = 1.3133 # loss for row 2: (1 - 0) * -log(1 - sigmoid(1)) = 1.3133 # weights = [1., 2.] expected_loss = 1.3133 * (1. + 2.) loss_mean = expected_loss / (1.0 + 2.0) label_mean = np.average(label, weights=weights) logits = [-1, 1] logistics = sigmoid(np.array(logits)) predictions_mean = np.average(logistics, weights=weights) expected_metrics = { metric_keys.MetricKeys.LOSS: expected_loss, tf.compat.v1.GraphKeys.GLOBAL_STEP: 100, metric_keys.MetricKeys.LOSS_MEAN: loss_mean, metric_keys.MetricKeys.ACCURACY: 0., metric_keys.MetricKeys.PRECISION: 0., metric_keys.MetricKeys.RECALL: 0., metric_keys.MetricKeys.PREDICTION_MEAN: predictions_mean, metric_keys.MetricKeys.LABEL_MEAN: label_mean, metric_keys.MetricKeys.ACCURACY_BASELINE: (max(label_mean, 1 - label_mean)), metric_keys.MetricKeys.AUC: 0., metric_keys.MetricKeys.AUC_PR: 0.1668, } else: # Multi classes: unweighted_loss = 1 * -log ( soft_max(logits)[label] ) logits = age_weight * np.reshape(age, (2, 1)) + bias logits_exp = np.exp(logits) softmax_row_0 = logits_exp[0] / logits_exp[0].sum() softmax_row_1 = logits_exp[1] / logits_exp[1].sum() expected_loss_0 = -1 * math.log(softmax_row_0[label[0]]) expected_loss_1 = -1 * math.log(softmax_row_1[label[1]]) loss_mean = np.average([expected_loss_0, expected_loss_1], weights=weights) expected_loss = loss_mean * np.sum(weights) expected_metrics = { metric_keys.MetricKeys.LOSS: expected_loss, metric_keys.MetricKeys.LOSS_MEAN: loss_mean, tf.compat.v1.GraphKeys.GLOBAL_STEP: 100, metric_keys.MetricKeys.ACCURACY: 0., } self.assertAllClose( sorted_key_dict(expected_metrics), sorted_key_dict(eval_metrics), rtol=1e-3) def test_binary_classes_evaluation_weights(self): self._test_evaluation_weights(n_classes=2) def test_multi_classes_evaluation_weights(self): self._test_evaluation_weights(n_classes=4) class BaseLinearClassifierPredictTest(object): def __init__(self, linear_classifier_fn, fc_lib=feature_column): self._linear_classifier_fn = linear_classifier_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: shutil.rmtree(self._model_dir) def _testPredictions(self, n_classes, label_vocabulary, label_output_fn): """Tests predict when all variables are one-dimensional.""" age = 1. # For binary case, the expected weight has shape (1,1). For multi class # case, the shape is (1, n_classes). In order to test the weights, set # weights as 2.0 * range(n_classes). age_weight = [[-11.0]] if n_classes == 2 else (np.reshape( -11.0 * np.array(list(range(n_classes)), dtype=np.float32), (1, n_classes))) bias = [10.0] if n_classes == 2 else [10.0] * n_classes with tf.Graph().as_default(): tf.Variable(age_weight, name=AGE_WEIGHT_NAME) tf.Variable(bias, name=BIAS_NAME) tf.Variable(100, name='global_step', dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) est = self._linear_classifier_fn( feature_columns=(self._fc_lib.numeric_column('age'),), label_vocabulary=label_vocabulary, n_classes=n_classes, model_dir=self._model_dir) predict_input_fn = numpy_io.numpy_input_fn( x={'age': np.array([[age]])}, y=None, batch_size=1, num_epochs=1, shuffle=False) predictions = list(est.predict(input_fn=predict_input_fn)) if n_classes == 2: scalar_logits = np.asscalar( np.reshape(np.array(age_weight) * age + bias, (1,))) two_classes_logits = [0, scalar_logits] two_classes_logits_exp = np.exp(two_classes_logits) softmax = two_classes_logits_exp / two_classes_logits_exp.sum() expected_predictions = { 'class_ids': [0], 'all_class_ids': [0, 1], 'classes': [label_output_fn(0)], 'all_classes': [label_output_fn(0), label_output_fn(1)], 'logistic': [sigmoid(np.array(scalar_logits))], 'logits': [scalar_logits], 'probabilities': softmax, } else: onedim_logits = np.reshape(np.array(age_weight) * age + bias, (-1,)) class_ids = onedim_logits.argmax() all_class_ids = list(range(len(onedim_logits))) logits_exp = np.exp(onedim_logits) softmax = logits_exp / logits_exp.sum() expected_predictions = { 'class_ids': [class_ids], 'all_class_ids': all_class_ids, 'classes': [label_output_fn(class_ids)], 'all_classes': [label_output_fn(i) for i in all_class_ids], 'logits': onedim_logits, 'probabilities': softmax, } self.assertEqual(1, len(predictions)) # assertAllClose cannot handle byte type. self.assertEqual(expected_predictions['classes'], predictions[0]['classes']) expected_predictions.pop('classes') predictions[0].pop('classes') self.assertAllEqual(expected_predictions['all_classes'], predictions[0]['all_classes']) expected_predictions.pop('all_classes') predictions[0].pop('all_classes') self.assertAllClose( sorted_key_dict(expected_predictions), sorted_key_dict(predictions[0])) def testBinaryClassesWithoutLabelVocabulary(self): n_classes = 2 self._testPredictions( n_classes, label_vocabulary=None, label_output_fn=lambda x: ('%s' % x).encode()) def testBinaryClassesWithLabelVocabulary(self): n_classes = 2 self._testPredictions( n_classes, label_vocabulary=['class_vocab_{}'.format(i) for i in range(n_classes)], label_output_fn=lambda x: ('class_vocab_%s' % x).encode()) def testMultiClassesWithoutLabelVocabulary(self): n_classes = 4 self._testPredictions( n_classes, label_vocabulary=None, label_output_fn=lambda x: ('%s' % x).encode()) def testMultiClassesWithLabelVocabulary(self): n_classes = 4 self._testPredictions( n_classes, label_vocabulary=['class_vocab_{}'.format(i) for i in range(n_classes)], label_output_fn=lambda x: ('class_vocab_%s' % x).encode()) def testSparseCombiner(self): w_a = 2.0 w_b = 3.0 w_c = 5.0 bias = 5.0 with tf.Graph().as_default(): tf.Variable([[w_a], [w_b], [w_c]], name=LANGUAGE_WEIGHT_NAME) tf.Variable([bias], name=BIAS_NAME) tf.Variable( 1, name=tf.compat.v1.GraphKeys.GLOBAL_STEP, dtype=tf.dtypes.int64) save_variables_to_ckpt(self._model_dir) def _input_fn(): return tf.compat.v1.data.Dataset.from_tensors({ 'language': tf.sparse.SparseTensor( values=['a', 'c', 'b', 'c'], indices=[[0, 0], [0, 1], [1, 0], [1, 1]], dense_shape=[2, 2]), }) feature_columns = (self._fc_lib.categorical_column_with_vocabulary_list( 'language', vocabulary_list=['a', 'b', 'c']),) # Check prediction for each sparse_combiner. # With sparse_combiner = 'sum', we have # logits_1 = w_a + w_c + bias # = 2.0 + 5.0 + 5.0 = 12.0 # logits_2 = w_b + w_c + bias # = 3.0 + 5.0 + 5.0 = 13.0 linear_classifier = self._linear_classifier_fn( feature_columns=feature_columns, model_dir=self._model_dir) predictions = linear_classifier.predict(input_fn=_input_fn) predicted_scores = list([x['logits'] for x in predictions]) self.assertAllClose([[12.0], [13.0]], predicted_scores) # With sparse_combiner = 'mean', we have # logits_1 = 1/2 * (w_a + w_c) + bias # = 1/2 * (2.0 + 5.0) + 5.0 = 8.5 # logits_2 = 1/2 * (w_b + w_c) + bias # = 1/2 * (3.0 + 5.0) + 5.0 = 9.0 linear_classifier = self._linear_classifier_fn( feature_columns=feature_columns, model_dir=self._model_dir, sparse_combiner='mean') predictions = linear_classifier.predict(input_fn=_input_fn) predicted_scores = list([x['logits'] for x in predictions]) self.assertAllClose([[8.5], [9.0]], predicted_scores) # With sparse_combiner = 'sqrtn', we have # logits_1 = sqrt(2)/2 * (w_a + w_c) + bias # = sqrt(2)/2 * (2.0 + 5.0) + 5.0 = 9.94974 # logits_2 = sqrt(2)/2 * (w_b + w_c) + bias # = sqrt(2)/2 * (3.0 + 5.0) + 5.0 = 10.65685 linear_classifier = self._linear_classifier_fn( feature_columns=feature_columns, model_dir=self._model_dir, sparse_combiner='sqrtn') predictions = linear_classifier.predict(input_fn=_input_fn) predicted_scores = list([x['logits'] for x in predictions]) self.assertAllClose([[9.94974], [10.65685]], predicted_scores) class BaseLinearClassifierIntegrationTest(object): def __init__(self, linear_classifier_fn, fc_lib=feature_column): self._linear_classifier_fn = linear_classifier_fn self._fc_lib = fc_lib def setUp(self): self._model_dir = tempfile.mkdtemp() def tearDown(self): if self._model_dir: shutil.rmtree(self._model_dir) def _test_complete_flow(self, n_classes, train_input_fn, eval_input_fn, predict_input_fn, input_dimension, prediction_length): feature_columns = [ self._fc_lib.numeric_column('x', shape=(input_dimension,)) ] est = self._linear_classifier_fn( feature_columns=feature_columns, n_classes=n_classes, model_dir=self._model_dir) # TRAIN # learn y = x est.train(train_input_fn, steps=200) # EVALUTE scores = est.evaluate(eval_input_fn) self.assertEqual(200, scores[tf.compat.v1.GraphKeys.GLOBAL_STEP]) self.assertIn(metric_keys.MetricKeys.LOSS, six.iterkeys(scores)) # PREDICT predictions = np.array( [x['classes'] for x in est.predict(predict_input_fn)]) self.assertAllEqual((prediction_length, 1), predictions.shape) # EXPORT feature_spec = tf.compat.v1.feature_column.make_parse_example_spec( feature_columns) serving_input_receiver_fn = export.build_parsing_serving_input_receiver_fn( feature_spec) export_dir = est.export_saved_model(tempfile.mkdtemp(), serving_input_receiver_fn) self.assertTrue(tf.compat.v1.gfile.Exists(export_dir)) def _test_numpy_input_fn(self, n_classes): """Tests complete flow with numpy_input_fn.""" input_dimension = 4 batch_size = 10 prediction_length = batch_size data = np.linspace(0., 2., batch_size * input_dimension, dtype=np.float32) data = data.reshape(batch_size, input_dimension) target = np.array([1] * batch_size) train_input_fn = numpy_io.numpy_input_fn( x={'x': data}, y=target, batch_size=batch_size, num_epochs=None, shuffle=True) eval_input_fn = numpy_io.numpy_input_fn( x={'x': data}, y=target, batch_size=batch_size, num_epochs=1, shuffle=False) predict_input_fn = numpy_io.numpy_input_fn( x={'x': data}, y=None, batch_size=batch_size, num_epochs=1, shuffle=False) self._test_complete_flow( n_classes=n_classes, train_input_fn=train_input_fn, eval_input_fn=eval_input_fn, predict_input_fn=predict_input_fn, input_dimension=input_dimension, prediction_length=prediction_length) def test_binary_classes_numpy_input_fn(self): self._test_numpy_input_fn(n_classes=2) def test_multi_classes_numpy_input_fn(self): self._test_numpy_input_fn(n_classes=4) def _test_pandas_input_fn(self, n_classes): """Tests complete flow with pandas_input_fn.""" if not HAS_PANDAS: return # Pandas DataFrame natually supports 1 dim data only. input_dimension = 1 batch_size = 10 data = np.array([1., 2., 3., 4.], dtype=np.float32) target = np.array([1, 0, 1, 0], dtype=np.int32) x = pd.DataFrame({'x': data}) y = pd.Series(target) prediction_length = 4 train_input_fn = pandas_io.pandas_input_fn( x=x, y=y, batch_size=batch_size, num_epochs=None, shuffle=True) eval_input_fn = pandas_io.pandas_input_fn( x=x, y=y, batch_size=batch_size, shuffle=False) predict_input_fn = pandas_io.pandas_input_fn( x=x, batch_size=batch_size, shuffle=False) self._test_complete_flow( n_classes=n_classes, train_input_fn=train_input_fn, eval_input_fn=eval_input_fn, predict_input_fn=predict_input_fn, input_dimension=input_dimension, prediction_length=prediction_length) def test_binary_classes_pandas_input_fn(self): self._test_pandas_input_fn(n_classes=2) def test_multi_classes_pandas_input_fn(self): self._test_pandas_input_fn(n_classes=4) def _test_input_fn_from_parse_example(self, n_classes): """Tests complete flow with input_fn constructed from parse_example.""" input_dimension = 2 batch_size = 10 prediction_length = batch_size data = np.linspace(0., 2., batch_size * input_dimension, dtype=np.float32) data = data.reshape(batch_size, input_dimension) target = np.array([1] * batch_size, dtype=np.int64) serialized_examples = [] for x, y in zip(data, target): example = example_pb2.Example( features=feature_pb2.Features( feature={ 'x': feature_pb2.Feature( float_list=feature_pb2.FloatList(value=x)), 'y': feature_pb2.Feature( int64_list=feature_pb2.Int64List(value=[y])), })) serialized_examples.append(example.SerializeToString()) feature_spec = { 'x': tf.io.FixedLenFeature([input_dimension], tf.dtypes.float32), 'y': tf.io.FixedLenFeature([1], tf.dtypes.int64), } def _train_input_fn(): feature_map = tf.compat.v1.io.parse_example(serialized_examples, feature_spec) features = queue_parsed_features(feature_map) labels = features.pop('y') return features, labels def _eval_input_fn(): feature_map = tf.compat.v1.io.parse_example( tf.compat.v1.train.limit_epochs(serialized_examples, num_epochs=1), feature_spec) features = queue_parsed_features(feature_map) labels = features.pop('y') return features, labels def _predict_input_fn(): feature_map = tf.compat.v1.io.parse_example( tf.compat.v1.train.limit_epochs(serialized_examples, num_epochs=1), feature_spec) features = queue_parsed_features(feature_map) features.pop('y') return features, None self._test_complete_flow( n_classes=n_classes, train_input_fn=_train_input_fn, eval_input_fn=_eval_input_fn, predict_input_fn=_predict_input_fn, input_dimension=input_dimension, prediction_length=prediction_length) def test_binary_classes_input_fn_from_parse_example(self): self._test_input_fn_from_parse_example(n_classes=2) def test_multi_classes_input_fn_from_parse_example(self): self._test_input_fn_from_parse_example(n_classes=4) class BaseLinearLogitFnTest(object): def __init__(self, fc_lib=feature_column): self._fc_lib = fc_lib def test_basic_logit_correctness(self): """linear_logit_fn simply wraps feature_column_lib.linear_model.""" age = self._fc_lib.numeric_column('age') with tf.Graph().as_default(): logit_fn = linear.linear_logit_fn_builder(units=2, feature_columns=[age]) logits = logit_fn(features={'age': [[23.], [31.]]}) bias_var = tf.compat.v1.get_collection( tf.compat.v1.GraphKeys.GLOBAL_VARIABLES, 'linear_model/bias_weights')[0] age_var = tf.compat.v1.get_collection( tf.compat.v1.GraphKeys.GLOBAL_VARIABLES, 'linear_model/age')[0] with tf.compat.v1.Session() as sess: sess.run([tf.compat.v1.initializers.global_variables()]) self.assertAllClose([[0., 0.], [0., 0.]], logits.eval()) sess.run(bias_var.assign([10., 5.])) self.assertAllClose([[10., 5.], [10., 5.]], logits.eval()) sess.run(age_var.assign([[2.0, 3.0]])) # [2 * 23 + 10, 3 * 23 + 5] = [56, 74]. # [2 * 31 + 10, 3 * 31 + 5] = [72, 98] self.assertAllClose([[56., 74.], [72., 98.]], logits.eval()) def test_compute_fraction_of_zero(self): """Tests the calculation of sparsity.""" if self._fc_lib != feature_column: return age = tf.feature_column.numeric_column('age') occupation = feature_column.categorical_column_with_hash_bucket( 'occupation', hash_bucket_size=5) with tf.Graph().as_default(): cols_to_vars = {} tf.compat.v1.feature_column.linear_model( features={ 'age': [[23.], [31.]], 'occupation': [['doctor'], ['engineer']] }, feature_columns=[age, occupation], units=3, cols_to_vars=cols_to_vars) cols_to_vars.pop('bias') fraction_zero = linear._compute_fraction_of_zero( list(cols_to_vars.values())) age_var = tf.compat.v1.get_collection( tf.compat.v1.GraphKeys.GLOBAL_VARIABLES, 'linear_model/age')[0] with tf.compat.v1.Session() as sess: sess.run([tf.compat.v1.initializers.global_variables()]) # Upon initialization, all variables will be zero. self.assertAllClose(1, fraction_zero.eval()) sess.run(age_var.assign([[2.0, 0.0, -1.0]])) # 1 of the 3 age weights are zero, and all of the 15 (5 hash buckets # x 3-dim output) are zero. self.assertAllClose(16. / 18., fraction_zero.eval()) def test_compute_fraction_of_zero_v2(self): """Tests the calculation of sparsity.""" if self._fc_lib != feature_column_v2: return age = tf.feature_column.numeric_column('age') occupation = tf.feature_column.categorical_column_with_hash_bucket( 'occupation', hash_bucket_size=5) with tf.Graph().as_default(): model = feature_column_v2.LinearModel( feature_columns=[age, occupation], units=3, name='linear_model') features = { 'age': [[23.], [31.]], 'occupation': [['doctor'], ['engineer']] } model(features) variables = model.variables variables.remove(model.bias) fraction_zero = linear._compute_fraction_of_zero(variables) age_var = tf.compat.v1.get_collection( tf.compat.v1.GraphKeys.GLOBAL_VARIABLES, 'linear_model/age')[0] with tf.compat.v1.Session() as sess: sess.run([tf.compat.v1.initializers.global_variables()]) # Upon initialization, all variables will be zero. self.assertAllClose(1, fraction_zero.eval()) sess.run(age_var.assign([[2.0, 0.0, -1.0]])) # 1 of the 3 age weights are zero, and all of the 15 (5 hash buckets # x 3-dim output) are zero. self.assertAllClose(16. / 18., fraction_zero.eval()) class BaseLinearWarmStartingTest(object): def __init__(self, _linear_classifier_fn, _linear_regressor_fn, fc_lib=feature_column): self._linear_classifier_fn = _linear_classifier_fn self._linear_regressor_fn = _linear_regressor_fn self._fc_lib = fc_lib def setUp(self): # Create a directory to save our old checkpoint and vocabularies to. self._ckpt_and_vocab_dir = tempfile.mkdtemp() # Make a dummy input_fn. def _input_fn(): features = { 'age': [[23.], [31.]], 'age_in_years': [[23.], [31.]], 'occupation': [['doctor'], ['consultant']] } return features, [0, 1] self._input_fn = _input_fn def tearDown(self): # Clean up checkpoint / vocab dir. tf.compat.v1.summary.FileWriterCache.clear() shutil.rmtree(self._ckpt_and_vocab_dir) def test_classifier_basic_warm_starting(self): """Tests correctness of LinearClassifier default warm-start.""" age = self._fc_lib.numeric_column('age') # Create a LinearClassifier and train to save a checkpoint. linear_classifier = self._linear_classifier_fn( feature_columns=[age], model_dir=self._ckpt_and_vocab_dir, n_classes=4, optimizer='SGD') linear_classifier.train(input_fn=self._input_fn, max_steps=1) # Create a second LinearClassifier, warm-started from the first. Use a # learning_rate = 0.0 optimizer to check values (use SGD so we don't have # accumulator values that change). warm_started_linear_classifier = self._linear_classifier_fn( feature_columns=[age], n_classes=4, optimizer=tf.compat.v1.train.GradientDescentOptimizer( learning_rate=0.0), warm_start_from=linear_classifier.model_dir) warm_started_linear_classifier.train(input_fn=self._input_fn, max_steps=1) for variable_name in warm_started_linear_classifier.get_variable_names(): self.assertAllClose( linear_classifier.get_variable_value(variable_name), warm_started_linear_classifier.get_variable_value(variable_name)) def test_regressor_basic_warm_starting(self): """Tests correctness of LinearRegressor default warm-start.""" age = self._fc_lib.numeric_column('age') # Create a LinearRegressor and train to save a checkpoint. linear_regressor = self._linear_regressor_fn( feature_columns=[age], model_dir=self._ckpt_and_vocab_dir, optimizer='SGD') linear_regressor.train(input_fn=self._input_fn, max_steps=1) # Create a second LinearRegressor, warm-started from the first. Use a # learning_rate = 0.0 optimizer to check values (use SGD so we don't have # accumulator values that change). warm_started_linear_regressor = self._linear_regressor_fn( feature_columns=[age], optimizer=tf.compat.v1.train.GradientDescentOptimizer( learning_rate=0.0), warm_start_from=linear_regressor.model_dir) warm_started_linear_regressor.train(input_fn=self._input_fn, max_steps=1) for variable_name in warm_started_linear_regressor.get_variable_names(): self.assertAllClose( linear_regressor.get_variable_value(variable_name), warm_started_linear_regressor.get_variable_value(variable_name)) def test_warm_starting_selective_variables(self): """Tests selecting variables to warm-start.""" age = self._fc_lib.numeric_column('age') # Create a LinearClassifier and train to save a checkpoint. linear_classifier = self._linear_classifier_fn( feature_columns=[age], model_dir=self._ckpt_and_vocab_dir, n_classes=4, optimizer='SGD') linear_classifier.train(input_fn=self._input_fn, max_steps=1) # Create a second LinearClassifier, warm-started from the first. Use a # learning_rate = 0.0 optimizer to check values (use SGD so we don't have # accumulator values that change). warm_started_linear_classifier = self._linear_classifier_fn( feature_columns=[age], n_classes=4, optimizer=tf.compat.v1.train.GradientDescentOptimizer( learning_rate=0.0), # The provided regular expression will only warm-start the age variable # and not the bias. warm_start_from=estimator.WarmStartSettings( ckpt_to_initialize_from=linear_classifier.model_dir, vars_to_warm_start='.*(age).*')) warm_started_linear_classifier.train(input_fn=self._input_fn, max_steps=1) self.assertAllClose( linear_classifier.get_variable_value(AGE_WEIGHT_NAME), warm_started_linear_classifier.get_variable_value(AGE_WEIGHT_NAME)) # Bias should still be zero from initialization. self.assertAllClose( [0.0] * 4, warm_started_linear_classifier.get_variable_value(BIAS_NAME)) def test_warm_starting_with_vocab_remapping_and_partitioning(self): """Tests warm-starting with vocab remapping and partitioning.""" vocab_list = ['doctor', 'lawyer', 'consultant'] vocab_file = os.path.join(self._ckpt_and_vocab_dir, 'occupation_vocab') with open(vocab_file, 'w') as f: f.write('\n'.join(vocab_list)) occupation = self._fc_lib.categorical_column_with_vocabulary_file( 'occupation', vocabulary_file=vocab_file, vocabulary_size=len(vocab_list)) # Create a LinearClassifier and train to save a checkpoint. partitioner = tf.compat.v1.fixed_size_partitioner(num_shards=2) linear_classifier = self._linear_classifier_fn( feature_columns=[occupation], model_dir=self._ckpt_and_vocab_dir, n_classes=4, optimizer='SGD', partitioner=partitioner) linear_classifier.train(input_fn=self._input_fn, max_steps=1) # Create a second LinearClassifier, warm-started from the first. Use a # learning_rate = 0.0 optimizer to check values (use SGD so we don't have # accumulator values that change). Use a new FeatureColumn with a # different vocabulary for occupation. new_vocab_list = ['doctor', 'consultant', 'engineer'] new_vocab_file = os.path.join(self._ckpt_and_vocab_dir, 'new_occupation_vocab') with open(new_vocab_file, 'w') as f: f.write('\n'.join(new_vocab_list)) new_occupation = self._fc_lib.categorical_column_with_vocabulary_file( 'occupation', vocabulary_file=new_vocab_file, vocabulary_size=len(new_vocab_list)) # We can create our VocabInfo object from the new and old occupation # FeatureColumn's. occupation_vocab_info = estimator.VocabInfo( new_vocab=new_occupation.vocabulary_file, new_vocab_size=new_occupation.vocabulary_size, num_oov_buckets=new_occupation.num_oov_buckets, old_vocab=occupation.vocabulary_file, old_vocab_size=occupation.vocabulary_size, # Can't use constant_initializer with load_and_remap. In practice, # use a truncated normal initializer. backup_initializer=tf.compat.v1.initializers.random_uniform( minval=0.39, maxval=0.39)) warm_started_linear_classifier = self._linear_classifier_fn( feature_columns=[occupation], n_classes=4, optimizer=tf.compat.v1.train.GradientDescentOptimizer( learning_rate=0.0), warm_start_from=estimator.WarmStartSettings( ckpt_to_initialize_from=linear_classifier.model_dir, var_name_to_vocab_info={ OCCUPATION_WEIGHT_NAME: occupation_vocab_info }, # Explicitly providing None here will only warm-start variables # referenced in var_name_to_vocab_info (the bias will not be # warm-started). vars_to_warm_start=None), partitioner=partitioner) warm_started_linear_classifier.train(input_fn=self._input_fn, max_steps=1) # 'doctor' was ID-0 and still ID-0. self.assertAllClose( linear_classifier.get_variable_value(OCCUPATION_WEIGHT_NAME)[0, :], warm_started_linear_classifier.get_variable_value( OCCUPATION_WEIGHT_NAME)[0, :]) # 'consultant' was ID-2 and now ID-1. self.assertAllClose( linear_classifier.get_variable_value(OCCUPATION_WEIGHT_NAME)[2, :], warm_started_linear_classifier.get_variable_value( OCCUPATION_WEIGHT_NAME)[1, :]) # 'engineer' is a new entry and should be initialized with the # backup_initializer in VocabInfo. self.assertAllClose([0.39] * 4, warm_started_linear_classifier.get_variable_value( OCCUPATION_WEIGHT_NAME)[2, :]) # Bias should still be zero (from initialization logic). self.assertAllClose( [0.0] * 4, warm_started_linear_classifier.get_variable_value(BIAS_NAME)) def test_warm_starting_with_naming_change(self): """Tests warm-starting with a Tensor name remapping.""" age_in_years = self._fc_lib.numeric_column('age_in_years') # Create a LinearClassifier and train to save a checkpoint. linear_classifier = self._linear_classifier_fn( feature_columns=[age_in_years], model_dir=self._ckpt_and_vocab_dir, n_classes=4, optimizer='SGD') linear_classifier.train(input_fn=self._input_fn, max_steps=1) # Create a second LinearClassifier, warm-started from the first. Use a # learning_rate = 0.0 optimizer to check values (use SGD so we don't have # accumulator values that change). warm_started_linear_classifier = self._linear_classifier_fn( feature_columns=[self._fc_lib.numeric_column('age')], n_classes=4, optimizer=tf.compat.v1.train.GradientDescentOptimizer( learning_rate=0.0), # The 'age' variable correspond to the 'age_in_years' variable in the # previous model. warm_start_from=estimator.WarmStartSettings( ckpt_to_initialize_from=linear_classifier.model_dir, var_name_to_prev_var_name={ AGE_WEIGHT_NAME: AGE_WEIGHT_NAME.replace('age', 'age_in_years') })) warm_started_linear_classifier.train(input_fn=self._input_fn, max_steps=1) self.assertAllClose( linear_classifier.get_variable_value( AGE_WEIGHT_NAME.replace('age', 'age_in_years')), warm_started_linear_classifier.get_variable_value(AGE_WEIGHT_NAME)) # The bias is also warm-started (with no name remapping). self.assertAllClose( linear_classifier.get_variable_value(BIAS_NAME), warm_started_linear_classifier.get_variable_value(BIAS_NAME))
label = 5. age = 17 linear_regressor = self._linear_regressor_fn( feature_columns=(self._fc_lib.numeric_column('age'),), model_dir=self._model_dir) # Train for a few steps, and validate final checkpoint. num_steps = 10 linear_regressor.train( input_fn=lambda: ({ 'age': ((age,),) }, ((label,),)), steps=num_steps) self._assert_checkpoint(num_steps)
timos.go
package codecommunicator import ( "context" "github.com/inexio/thola/internal/device" "github.com/inexio/thola/internal/deviceclass/groupproperty" "github.com/inexio/thola/internal/network" "github.com/pkg/errors" "github.com/rs/zerolog/log" "strconv" "strings" ) type timosCommunicator struct { codeCommunicator } // GetInterfaces returns the interfaces of Nokia devices. func (c *timosCommunicator) GetInterfaces(ctx context.Context, filter ...groupproperty.Filter) ([]device.Interface, error) { interfaces, err := c.parent.GetInterfaces(ctx) if err != nil { return nil, err } con, ok := network.DeviceConnectionFromContext(ctx) if !ok || con.SNMP == nil { return nil, errors.New("no device connection available") } // get mapping from every ifIndex to a description indexDescriptions, err := getPhysPortDescriptions(ctx) if err != nil { return nil, errors.Wrap(err, "failed to read phys port descriptions") } // apply description mapping to the default interfaces interfaces = normalizeTimosInterfaces(interfaces, indexDescriptions) // get all sap interfaces sapDescriptionsOID := network.OID(".1.3.6.1.4.1.6527.3.1.2.4.3.2.1.5") sapDescriptions, err := con.SNMP.SnmpClient.SNMPWalk(ctx, sapDescriptionsOID) if err != nil { log.Ctx(ctx).Debug().Err(err).Msg("sap interfaces are not available on this device") return interfaces, nil } for _, response := range sapDescriptions { special, err := response.GetValue() if err != nil { return nil, errors.Wrap(err, "couldn't get string value") } // construct description suffix := strings.Split(strings.TrimPrefix(response.GetOID().String(), sapDescriptionsOID.String()), ".") physIndex := suffix[2] subID := suffix[3] description, ok := indexDescriptions[physIndex] if !ok { return nil, errors.New("invalid physical index") } description += ":" + subID if !special.IsEmpty() { description += " " + special.String() } // construct index subIndex, err := strconv.ParseUint(physIndex+subID, 0, 64) if err != nil { return nil, errors.Wrap(err, "couldn't get index from strings") } // retrieve admin status admin, err := getStatusFromSnmpGet(ctx, network.OID(".1.3.6.1.4.1.6527.3.1.2.4.3.2.1.6.").AddIndex(suffix[1]+"."+physIndex+"."+subID)) if err != nil { return nil, errors.Wrap(err, "failed to retrieve admin status") } // retrieve oper status oper, err := getStatusFromSnmpGet(ctx, network.OID(".1.3.6.1.4.1.6527.3.1.2.4.3.2.1.7.").AddIndex(suffix[1]+"."+physIndex+"."+subID)) if err != nil { return nil, errors.Wrap(err, "failed to retrieve oper status") } // build logical interface interfaces = append(interfaces, device.Interface{ IfIndex: &subIndex, IfDescr: &description, IfAdminStatus: &admin, IfOperStatus: &oper, }) } return filterInterfaces(ctx, interfaces, filter) } // getPhysPortDescriptions returns a mapping from every ifIndex to a description. // This description is different and shorter than the ifDescription. func getPhysPortDescriptions(ctx context.Context) (map[string]string, error) { con, ok := network.DeviceConnectionFromContext(ctx) if !ok || con.SNMP == nil { return nil, errors.New("no device connection available") } physPortsOID := network.OID(".1.3.6.1.4.1.6527.3.1.2.2.4.2.1.6.1") physPorts, err := con.SNMP.SnmpClient.SNMPWalk(ctx, physPortsOID) if err != nil { return nil, errors.Wrap(err, "snmpwalk failed") } indexDescriptions := make(map[string]string) for _, response := range physPorts { description, err := response.GetValue() if err != nil { return nil, errors.Wrap(err, "couldn't get string value") } index := strings.TrimPrefix(response.GetOID().String(), physPortsOID.AddIndex(".").String()) indexDescriptions[index] = description.String() } return indexDescriptions, nil } // getCounterFromSnmpGet returns the snmpget value at the given oid as uint64 counter. func
(ctx context.Context, oid network.OID) (uint64, error) { con, ok := network.DeviceConnectionFromContext(ctx) if !ok || con.SNMP == nil { return 0, errors.New("no device connection available") } res, err := con.SNMP.SnmpClient.SNMPGet(ctx, oid) if err != nil || len(res) != 1 { return 0, errors.Wrap(err, "snmpget failed") } resValue, err := res[0].GetValue() if err != nil { return 0, errors.Wrap(err, "couldn't parse snmp response") } resCounter, err := resValue.UInt64() if err != nil { return 0, errors.Wrap(err, "couldn't parse snmp response") } return resCounter, nil } // getStatusFromSnmpGet returns the snmpget value at the given oid as device.Status. func getStatusFromSnmpGet(ctx context.Context, oid network.OID) (device.Status, error) { con, ok := network.DeviceConnectionFromContext(ctx) if !ok || con.SNMP == nil { return "", errors.New("no device connection available") } res, err := con.SNMP.SnmpClient.SNMPGet(ctx, oid) if err != nil || len(res) != 1 { return "", errors.Wrap(err, "snmpget failed") } resValue, err := res[0].GetValue() if err != nil { return "", errors.Wrap(err, "couldn't parse snmp response") } resInt, err := resValue.Int() if err != nil { return "", errors.Wrap(err, "couldn't parse snmp response") } resStatus, err := device.GetStatus(resInt) if err != nil { return "", errors.Wrap(err, "couldn't get status from snmp response") } return resStatus, nil } // normalizeTimosInterfaces applies the description mapping to the given interfaces. func normalizeTimosInterfaces(interfaces []device.Interface, descriptions map[string]string) []device.Interface { for _, interf := range interfaces { descr, ok := descriptions[strconv.FormatUint(*interf.IfIndex, 10)] if !ok { continue } *interf.IfDescr = descr *interf.IfName = descr } return interfaces }
getCounterFromSnmpGet
role.interface.ts
import {Role} from './role.entity'; /** * 权限信息接口层 */ export interface IRoleService {
/** * 保存权限信息 * @param user */ save(role: Role): Promise<Role>; /** * 修改权限信息 * @param user */ update(role: Role): Promise<number>; /** * 删除权限信息 * @param id */ delete(id: string): Promise<number>; /** * 根据条件分页查询权限信息 * @param page */ findPage(page): Promise<[Role[], number]>; /** * 根据ID查询权限信息 * @param id */ findById(id: number): Promise<Role>; }
useFetchContext.js
import React, { useContext } from "react"; const FetchContext = React.createContext(null)
const cache = useContext(FetchContext) return cache; }; function FetchProvider({ cache, children }) { return ( <FetchContext.Provider value={cache}>{children}</FetchContext.Provider> ) } export { FetchProvider }
export const useFetchContext = () => {
zuowan.go
package sdk import ( "fgame/fgame/account/login/types" "fgame/fgame/sdk" ) func init() { sdk.RegisterSDK((*ZuoWanConfig)(nil)) } type ZuoWanSDKConfig struct { CpId string `json:"cpId"` GameInstId string `json:"gameinstId"` Privatekey string `json:"privateKey"` } type ZuoWanConfig struct { IOS *ZuoWanSDKConfig `json:"iOS"` Android *ZuoWanSDKConfig `json:"android"` } func (c *ZuoWanConfig) FileName() string { return "zuowan.json" } func (c *ZuoWanConfig) Platform() types.SDKType { return types.SDKTypeZuoWan } func (c *ZuoWanConfig) GetCpId(devicePlatform types.DevicePlatformType) string { switch devicePlatform { case types.DevicePlatformTypeAndroid: return c.Android.CpId case types.DevicePlatformTypeIOS: return c.IOS.CpId default: return "" } } func (c *ZuoWanConfig) GetGameInstId(devicePlatform types.DevicePlatformType) string { switch devicePlatform { case types.DevicePlatformTypeAndroid: return c.Android.GameInstId case types.DevicePlatformTypeIOS: return c.IOS.GameInstId default: return "" } } func (c *ZuoWanConfig) GetPrivatekey(devicePlatform types.DevicePlatformType) string {
case types.DevicePlatformTypeAndroid: return c.Android.Privatekey case types.DevicePlatformTypeIOS: return c.IOS.Privatekey default: return "" } }
switch devicePlatform {
container.py
from __future__ import absolute_import from __future__ import unicode_literals from functools import reduce import six from .const import LABEL_CONTAINER_NUMBER from .const import LABEL_SERVICE class Container(object): """ Represents a Docker container, constructed from the output of GET /containers/:id:/json. """ def
(self, client, dictionary, has_been_inspected=False): self.client = client self.dictionary = dictionary self.has_been_inspected = has_been_inspected @classmethod def from_ps(cls, client, dictionary, **kwargs): """ Construct a container object from the output of GET /containers/json. """ name = get_container_name(dictionary) if name is None: return None new_dictionary = { 'Id': dictionary['Id'], 'Image': dictionary['Image'], 'Name': '/' + name, } return cls(client, new_dictionary, **kwargs) @classmethod def from_id(cls, client, id): return cls(client, client.inspect_container(id)) @classmethod def create(cls, client, **options): response = client.create_container(**options) return cls.from_id(client, response['Id']) @property def id(self): return self.dictionary['Id'] @property def image(self): return self.dictionary['Image'] @property def image_config(self): return self.client.inspect_image(self.image) @property def short_id(self): return self.id[:10] @property def name(self): return self.dictionary['Name'][1:] @property def name_without_project(self): return '{0}_{1}'.format(self.labels.get(LABEL_SERVICE), self.number) @property def number(self): number = self.labels.get(LABEL_CONTAINER_NUMBER) if not number: raise ValueError("Container {0} does not have a {1} label".format( self.short_id, LABEL_CONTAINER_NUMBER)) return int(number) @property def ports(self): self.inspect_if_not_inspected() return self.get('NetworkSettings.Ports') or {} @property def human_readable_ports(self): def format_port(private, public): if not public: return private return '{HostIp}:{HostPort}->{private}'.format( private=private, **public[0]) return ', '.join(format_port(*item) for item in sorted(six.iteritems(self.ports))) @property def labels(self): return self.get('Config.Labels') or {} @property def log_config(self): return self.get('HostConfig.LogConfig') or None @property def human_readable_state(self): if self.is_paused: return 'Paused' if self.is_running: return 'Ghost' if self.get('State.Ghost') else 'Up' else: return 'Exit %s' % self.get('State.ExitCode') @property def human_readable_command(self): entrypoint = self.get('Config.Entrypoint') or [] cmd = self.get('Config.Cmd') or [] return ' '.join(entrypoint + cmd) @property def environment(self): return dict(var.split("=", 1) for var in self.get('Config.Env') or []) @property def is_running(self): return self.get('State.Running') @property def is_paused(self): return self.get('State.Paused') def get(self, key): """Return a value from the container or None if the value is not set. :param key: a string using dotted notation for nested dictionary lookups """ self.inspect_if_not_inspected() def get_value(dictionary, key): return (dictionary or {}).get(key) return reduce(get_value, key.split('.'), self.dictionary) def get_local_port(self, port, protocol='tcp'): port = self.ports.get("%s/%s" % (port, protocol)) return "{HostIp}:{HostPort}".format(**port[0]) if port else None def start(self, **options): return self.client.start(self.id, **options) def stop(self, **options): return self.client.stop(self.id, **options) def pause(self, **options): return self.client.pause(self.id, **options) def unpause(self, **options): return self.client.unpause(self.id, **options) def kill(self, **options): return self.client.kill(self.id, **options) def restart(self, **options): return self.client.restart(self.id, **options) def remove(self, **options): return self.client.remove_container(self.id, **options) def inspect_if_not_inspected(self): if not self.has_been_inspected: self.inspect() def wait(self): return self.client.wait(self.id) def logs(self, *args, **kwargs): return self.client.logs(self.id, *args, **kwargs) def inspect(self): self.dictionary = self.client.inspect_container(self.id) self.has_been_inspected = True return self.dictionary # TODO: only used by tests, move to test module def links(self): links = [] for container in self.client.containers(): for name in container['Names']: bits = name.split('/') if len(bits) > 2 and bits[1] == self.name: links.append(bits[2]) return links def attach(self, *args, **kwargs): return self.client.attach(self.id, *args, **kwargs) def attach_socket(self, **kwargs): return self.client.attach_socket(self.id, **kwargs) def __repr__(self): return '<Container: %s (%s)>' % (self.name, self.id[:6]) def __eq__(self, other): if type(self) != type(other): return False return self.id == other.id def __hash__(self): return self.id.__hash__() def get_container_name(container): if not container.get('Name') and not container.get('Names'): return None # inspect if 'Name' in container: return container['Name'] # ps shortest_name = min(container['Names'], key=lambda n: len(n.split('/'))) return shortest_name.split('/')[-1]
__init__
benchmark.pb.go
// Code generated by protoc-gen-gogo. // source: benchmark.proto // DO NOT EDIT! /* Package main is a generated protocol buffer package. It is generated from these files: benchmark.proto It has these top-level messages: BenchmarkMessage */ package main import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import io "io" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type BenchmarkMessage struct { Field1 string `protobuf:"bytes,1,req,name=field1" json:"field1"` Field9 string `protobuf:"bytes,9,opt,name=field9" json:"field9"` Field18 string `protobuf:"bytes,18,opt,name=field18" json:"field18"` Field80 *bool `protobuf:"varint,80,opt,name=field80,def=0" json:"field80,omitempty"` Field81 *bool `protobuf:"varint,81,opt,name=field81,def=1" json:"field81,omitempty"` Field2 int32 `protobuf:"varint,2,req,name=field2" json:"field2"` Field3 int32 `protobuf:"varint,3,req,name=field3" json:"field3"` Field280 int32 `protobuf:"varint,280,opt,name=field280" json:"field280"` Field6 *int32 `protobuf:"varint,6,opt,name=field6,def=0" json:"field6,omitempty"` Field22 int64 `protobuf:"varint,22,opt,name=field22" json:"field22"` Field4 string `protobuf:"bytes,4,opt,name=field4" json:"field4"` Field5 []uint64 `protobuf:"fixed64,5,rep,name=field5" json:"field5,omitempty"` Field59 *bool `protobuf:"varint,59,opt,name=field59,def=0" json:"field59,omitempty"` Field7 string `protobuf:"bytes,7,opt,name=field7" json:"field7"` Field16 int32 `protobuf:"varint,16,opt,name=field16" json:"field16"` Field130 *int32 `protobuf:"varint,130,opt,name=field130,def=0" json:"field130,omitempty"` Field12 *bool `protobuf:"varint,12,opt,name=field12,def=1" json:"field12,omitempty"` Field17 *bool `protobuf:"varint,17,opt,name=field17,def=1" json:"field17,omitempty"` Field13 *bool `protobuf:"varint,13,opt,name=field13,def=1" json:"field13,omitempty"` Field14 *bool `protobuf:"varint,14,opt,name=field14,def=1" json:"field14,omitempty"` Field104 *int32 `protobuf:"varint,104,opt,name=field104,def=0" json:"field104,omitempty"` Field100 *int32 `protobuf:"varint,100,opt,name=field100,def=0" json:"field100,omitempty"` Field101 *int32 `protobuf:"varint,101,opt,name=field101,def=0" json:"field101,omitempty"` Field102 string `protobuf:"bytes,102,opt,name=field102" json:"field102"` Field103 string `protobuf:"bytes,103,opt,name=field103" json:"field103"` Field29 *int32 `protobuf:"varint,29,opt,name=field29,def=0" json:"field29,omitempty"` Field30 *bool `protobuf:"varint,30,opt,name=field30,def=0" json:"field30,omitempty"` Field60 *int32 `protobuf:"varint,60,opt,name=field60,def=-1" json:"field60,omitempty"` Field271 *int32 `protobuf:"varint,271,opt,name=field271,def=-1" json:"field271,omitempty"` Field272 *int32 `protobuf:"varint,272,opt,name=field272,def=-1" json:"field272,omitempty"` Field150 int32 `protobuf:"varint,150,opt,name=field150" json:"field150"` Field23 *int32 `protobuf:"varint,23,opt,name=field23,def=0" json:"field23,omitempty"` Field24 *bool `protobuf:"varint,24,opt,name=field24,def=0" json:"field24,omitempty"` Field25 *int32 `protobuf:"varint,25,opt,name=field25,def=0" json:"field25,omitempty"` Field78 bool `protobuf:"varint,78,opt,name=field78" json:"field78"` Field67 *int32 `protobuf:"varint,67,opt,name=field67,def=0" json:"field67,omitempty"` Field68 int32 `protobuf:"varint,68,opt,name=field68" json:"field68"` Field128 *int32 `protobuf:"varint,128,opt,name=field128,def=0" json:"field128,omitempty"` Field129 *string `protobuf:"bytes,129,opt,name=field129,def=xxxxxxxxxxxxxxxxxxxxx" json:"field129,omitempty"` Field131 *int32 `protobuf:"varint,131,opt,name=field131,def=0" json:"field131,omitempty"` } func (m *BenchmarkMessage) Reset() { *m = BenchmarkMessage{} } func (m *BenchmarkMessage) String() string { return proto.CompactTextString(m) } func (*BenchmarkMessage) ProtoMessage() {} func (*BenchmarkMessage) Descriptor() ([]byte, []int) { return fileDescriptorBenchmark, []int{0} } const Default_BenchmarkMessage_Field80 bool = false const Default_BenchmarkMessage_Field81 bool = true const Default_BenchmarkMessage_Field6 int32 = 0 const Default_BenchmarkMessage_Field59 bool = false const Default_BenchmarkMessage_Field130 int32 = 0 const Default_BenchmarkMessage_Field12 bool = true const Default_BenchmarkMessage_Field17 bool = true const Default_BenchmarkMessage_Field13 bool = true const Default_BenchmarkMessage_Field14 bool = true const Default_BenchmarkMessage_Field104 int32 = 0 const Default_BenchmarkMessage_Field100 int32 = 0 const Default_BenchmarkMessage_Field101 int32 = 0 const Default_BenchmarkMessage_Field29 int32 = 0 const Default_BenchmarkMessage_Field30 bool = false const Default_BenchmarkMessage_Field60 int32 = -1 const Default_BenchmarkMessage_Field271 int32 = -1 const Default_BenchmarkMessage_Field272 int32 = -1 const Default_BenchmarkMessage_Field23 int32 = 0 const Default_BenchmarkMessage_Field24 bool = false const Default_BenchmarkMessage_Field25 int32 = 0 const Default_BenchmarkMessage_Field67 int32 = 0 const Default_BenchmarkMessage_Field128 int32 = 0 const Default_BenchmarkMessage_Field129 string = "xxxxxxxxxxxxxxxxxxxxx" const Default_BenchmarkMessage_Field131 int32 = 0 func (m *BenchmarkMessage) GetField1() string { if m != nil { return m.Field1 } return "" } func (m *BenchmarkMessage) GetField9() string { if m != nil { return m.Field9 } return "" } func (m *BenchmarkMessage) GetField18() string { if m != nil { return m.Field18 } return "" } func (m *BenchmarkMessage) GetField80() bool { if m != nil && m.Field80 != nil { return *m.Field80 } return Default_BenchmarkMessage_Field80 } func (m *BenchmarkMessage) GetField81() bool { if m != nil && m.Field81 != nil { return *m.Field81 } return Default_BenchmarkMessage_Field81 } func (m *BenchmarkMessage) GetField2() int32 { if m != nil { return m.Field2 } return 0 } func (m *BenchmarkMessage) GetField3() int32 { if m != nil { return m.Field3 } return 0 } func (m *BenchmarkMessage) GetField280() int32 { if m != nil { return m.Field280 } return 0 } func (m *BenchmarkMessage) GetField6() int32 { if m != nil && m.Field6 != nil { return *m.Field6 }
return Default_BenchmarkMessage_Field6 } func (m *BenchmarkMessage) GetField22() int64 { if m != nil { return m.Field22 } return 0 } func (m *BenchmarkMessage) GetField4() string { if m != nil { return m.Field4 } return "" } func (m *BenchmarkMessage) GetField5() []uint64 { if m != nil { return m.Field5 } return nil } func (m *BenchmarkMessage) GetField59() bool { if m != nil && m.Field59 != nil { return *m.Field59 } return Default_BenchmarkMessage_Field59 } func (m *BenchmarkMessage) GetField7() string { if m != nil { return m.Field7 } return "" } func (m *BenchmarkMessage) GetField16() int32 { if m != nil { return m.Field16 } return 0 } func (m *BenchmarkMessage) GetField130() int32 { if m != nil && m.Field130 != nil { return *m.Field130 } return Default_BenchmarkMessage_Field130 } func (m *BenchmarkMessage) GetField12() bool { if m != nil && m.Field12 != nil { return *m.Field12 } return Default_BenchmarkMessage_Field12 } func (m *BenchmarkMessage) GetField17() bool { if m != nil && m.Field17 != nil { return *m.Field17 } return Default_BenchmarkMessage_Field17 } func (m *BenchmarkMessage) GetField13() bool { if m != nil && m.Field13 != nil { return *m.Field13 } return Default_BenchmarkMessage_Field13 } func (m *BenchmarkMessage) GetField14() bool { if m != nil && m.Field14 != nil { return *m.Field14 } return Default_BenchmarkMessage_Field14 } func (m *BenchmarkMessage) GetField104() int32 { if m != nil && m.Field104 != nil { return *m.Field104 } return Default_BenchmarkMessage_Field104 } func (m *BenchmarkMessage) GetField100() int32 { if m != nil && m.Field100 != nil { return *m.Field100 } return Default_BenchmarkMessage_Field100 } func (m *BenchmarkMessage) GetField101() int32 { if m != nil && m.Field101 != nil { return *m.Field101 } return Default_BenchmarkMessage_Field101 } func (m *BenchmarkMessage) GetField102() string { if m != nil { return m.Field102 } return "" } func (m *BenchmarkMessage) GetField103() string { if m != nil { return m.Field103 } return "" } func (m *BenchmarkMessage) GetField29() int32 { if m != nil && m.Field29 != nil { return *m.Field29 } return Default_BenchmarkMessage_Field29 } func (m *BenchmarkMessage) GetField30() bool { if m != nil && m.Field30 != nil { return *m.Field30 } return Default_BenchmarkMessage_Field30 } func (m *BenchmarkMessage) GetField60() int32 { if m != nil && m.Field60 != nil { return *m.Field60 } return Default_BenchmarkMessage_Field60 } func (m *BenchmarkMessage) GetField271() int32 { if m != nil && m.Field271 != nil { return *m.Field271 } return Default_BenchmarkMessage_Field271 } func (m *BenchmarkMessage) GetField272() int32 { if m != nil && m.Field272 != nil { return *m.Field272 } return Default_BenchmarkMessage_Field272 } func (m *BenchmarkMessage) GetField150() int32 { if m != nil { return m.Field150 } return 0 } func (m *BenchmarkMessage) GetField23() int32 { if m != nil && m.Field23 != nil { return *m.Field23 } return Default_BenchmarkMessage_Field23 } func (m *BenchmarkMessage) GetField24() bool { if m != nil && m.Field24 != nil { return *m.Field24 } return Default_BenchmarkMessage_Field24 } func (m *BenchmarkMessage) GetField25() int32 { if m != nil && m.Field25 != nil { return *m.Field25 } return Default_BenchmarkMessage_Field25 } func (m *BenchmarkMessage) GetField78() bool { if m != nil { return m.Field78 } return false } func (m *BenchmarkMessage) GetField67() int32 { if m != nil && m.Field67 != nil { return *m.Field67 } return Default_BenchmarkMessage_Field67 } func (m *BenchmarkMessage) GetField68() int32 { if m != nil { return m.Field68 } return 0 } func (m *BenchmarkMessage) GetField128() int32 { if m != nil && m.Field128 != nil { return *m.Field128 } return Default_BenchmarkMessage_Field128 } func (m *BenchmarkMessage) GetField129() string { if m != nil && m.Field129 != nil { return *m.Field129 } return Default_BenchmarkMessage_Field129 } func (m *BenchmarkMessage) GetField131() int32 { if m != nil && m.Field131 != nil { return *m.Field131 } return Default_BenchmarkMessage_Field131 } func init() { proto.RegisterType((*BenchmarkMessage)(nil), "main.BenchmarkMessage") } func (m *BenchmarkMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *BenchmarkMessage) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l dAtA[i] = 0xa i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Field1))) i += copy(dAtA[i:], m.Field1) dAtA[i] = 0x10 i++ i = encodeVarintBenchmark(dAtA, i, uint64(m.Field2)) dAtA[i] = 0x18 i++ i = encodeVarintBenchmark(dAtA, i, uint64(m.Field3)) dAtA[i] = 0x22 i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Field4))) i += copy(dAtA[i:], m.Field4) if len(m.Field5) > 0 { for _, num := range m.Field5 { dAtA[i] = 0x29 i++ dAtA[i] = uint8(num) i++ dAtA[i] = uint8(num >> 8) i++ dAtA[i] = uint8(num >> 16) i++ dAtA[i] = uint8(num >> 24) i++ dAtA[i] = uint8(num >> 32) i++ dAtA[i] = uint8(num >> 40) i++ dAtA[i] = uint8(num >> 48) i++ dAtA[i] = uint8(num >> 56) i++ } } if m.Field6 != nil { dAtA[i] = 0x30 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field6)) } dAtA[i] = 0x3a i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Field7))) i += copy(dAtA[i:], m.Field7) dAtA[i] = 0x4a i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Field9))) i += copy(dAtA[i:], m.Field9) if m.Field12 != nil { dAtA[i] = 0x60 i++ if *m.Field12 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Field13 != nil { dAtA[i] = 0x68 i++ if *m.Field13 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Field14 != nil { dAtA[i] = 0x70 i++ if *m.Field14 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } dAtA[i] = 0x80 i++ dAtA[i] = 0x1 i++ i = encodeVarintBenchmark(dAtA, i, uint64(m.Field16)) if m.Field17 != nil { dAtA[i] = 0x88 i++ dAtA[i] = 0x1 i++ if *m.Field17 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } dAtA[i] = 0x92 i++ dAtA[i] = 0x1 i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Field18))) i += copy(dAtA[i:], m.Field18) dAtA[i] = 0xb0 i++ dAtA[i] = 0x1 i++ i = encodeVarintBenchmark(dAtA, i, uint64(m.Field22)) if m.Field23 != nil { dAtA[i] = 0xb8 i++ dAtA[i] = 0x1 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field23)) } if m.Field24 != nil { dAtA[i] = 0xc0 i++ dAtA[i] = 0x1 i++ if *m.Field24 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Field25 != nil { dAtA[i] = 0xc8 i++ dAtA[i] = 0x1 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field25)) } if m.Field29 != nil { dAtA[i] = 0xe8 i++ dAtA[i] = 0x1 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field29)) } if m.Field30 != nil { dAtA[i] = 0xf0 i++ dAtA[i] = 0x1 i++ if *m.Field30 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Field59 != nil { dAtA[i] = 0xd8 i++ dAtA[i] = 0x3 i++ if *m.Field59 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Field60 != nil { dAtA[i] = 0xe0 i++ dAtA[i] = 0x3 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field60)) } if m.Field67 != nil { dAtA[i] = 0x98 i++ dAtA[i] = 0x4 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field67)) } dAtA[i] = 0xa0 i++ dAtA[i] = 0x4 i++ i = encodeVarintBenchmark(dAtA, i, uint64(m.Field68)) dAtA[i] = 0xf0 i++ dAtA[i] = 0x4 i++ if m.Field78 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ if m.Field80 != nil { dAtA[i] = 0x80 i++ dAtA[i] = 0x5 i++ if *m.Field80 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Field81 != nil { dAtA[i] = 0x88 i++ dAtA[i] = 0x5 i++ if *m.Field81 { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Field100 != nil { dAtA[i] = 0xa0 i++ dAtA[i] = 0x6 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field100)) } if m.Field101 != nil { dAtA[i] = 0xa8 i++ dAtA[i] = 0x6 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field101)) } dAtA[i] = 0xb2 i++ dAtA[i] = 0x6 i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Field102))) i += copy(dAtA[i:], m.Field102) dAtA[i] = 0xba i++ dAtA[i] = 0x6 i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Field103))) i += copy(dAtA[i:], m.Field103) if m.Field104 != nil { dAtA[i] = 0xc0 i++ dAtA[i] = 0x6 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field104)) } if m.Field128 != nil { dAtA[i] = 0x80 i++ dAtA[i] = 0x8 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field128)) } if m.Field129 != nil { dAtA[i] = 0x8a i++ dAtA[i] = 0x8 i++ i = encodeVarintBenchmark(dAtA, i, uint64(len(*m.Field129))) i += copy(dAtA[i:], *m.Field129) } if m.Field130 != nil { dAtA[i] = 0x90 i++ dAtA[i] = 0x8 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field130)) } if m.Field131 != nil { dAtA[i] = 0x98 i++ dAtA[i] = 0x8 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field131)) } dAtA[i] = 0xb0 i++ dAtA[i] = 0x9 i++ i = encodeVarintBenchmark(dAtA, i, uint64(m.Field150)) if m.Field271 != nil { dAtA[i] = 0xf8 i++ dAtA[i] = 0x10 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field271)) } if m.Field272 != nil { dAtA[i] = 0x80 i++ dAtA[i] = 0x11 i++ i = encodeVarintBenchmark(dAtA, i, uint64(*m.Field272)) } dAtA[i] = 0xc0 i++ dAtA[i] = 0x11 i++ i = encodeVarintBenchmark(dAtA, i, uint64(m.Field280)) return i, nil } func encodeFixed64Benchmark(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) dAtA[offset+4] = uint8(v >> 32) dAtA[offset+5] = uint8(v >> 40) dAtA[offset+6] = uint8(v >> 48) dAtA[offset+7] = uint8(v >> 56) return offset + 8 } func encodeFixed32Benchmark(dAtA []byte, offset int, v uint32) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) return offset + 4 } func encodeVarintBenchmark(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *BenchmarkMessage) Size() (n int) { var l int _ = l l = len(m.Field1) n += 1 + l + sovBenchmark(uint64(l)) n += 1 + sovBenchmark(uint64(m.Field2)) n += 1 + sovBenchmark(uint64(m.Field3)) l = len(m.Field4) n += 1 + l + sovBenchmark(uint64(l)) if len(m.Field5) > 0 { n += 9 * len(m.Field5) } if m.Field6 != nil { n += 1 + sovBenchmark(uint64(*m.Field6)) } l = len(m.Field7) n += 1 + l + sovBenchmark(uint64(l)) l = len(m.Field9) n += 1 + l + sovBenchmark(uint64(l)) if m.Field12 != nil { n += 2 } if m.Field13 != nil { n += 2 } if m.Field14 != nil { n += 2 } n += 2 + sovBenchmark(uint64(m.Field16)) if m.Field17 != nil { n += 3 } l = len(m.Field18) n += 2 + l + sovBenchmark(uint64(l)) n += 2 + sovBenchmark(uint64(m.Field22)) if m.Field23 != nil { n += 2 + sovBenchmark(uint64(*m.Field23)) } if m.Field24 != nil { n += 3 } if m.Field25 != nil { n += 2 + sovBenchmark(uint64(*m.Field25)) } if m.Field29 != nil { n += 2 + sovBenchmark(uint64(*m.Field29)) } if m.Field30 != nil { n += 3 } if m.Field59 != nil { n += 3 } if m.Field60 != nil { n += 2 + sovBenchmark(uint64(*m.Field60)) } if m.Field67 != nil { n += 2 + sovBenchmark(uint64(*m.Field67)) } n += 2 + sovBenchmark(uint64(m.Field68)) n += 3 if m.Field80 != nil { n += 3 } if m.Field81 != nil { n += 3 } if m.Field100 != nil { n += 2 + sovBenchmark(uint64(*m.Field100)) } if m.Field101 != nil { n += 2 + sovBenchmark(uint64(*m.Field101)) } l = len(m.Field102) n += 2 + l + sovBenchmark(uint64(l)) l = len(m.Field103) n += 2 + l + sovBenchmark(uint64(l)) if m.Field104 != nil { n += 2 + sovBenchmark(uint64(*m.Field104)) } if m.Field128 != nil { n += 2 + sovBenchmark(uint64(*m.Field128)) } if m.Field129 != nil { l = len(*m.Field129) n += 2 + l + sovBenchmark(uint64(l)) } if m.Field130 != nil { n += 2 + sovBenchmark(uint64(*m.Field130)) } if m.Field131 != nil { n += 2 + sovBenchmark(uint64(*m.Field131)) } n += 2 + sovBenchmark(uint64(m.Field150)) if m.Field271 != nil { n += 2 + sovBenchmark(uint64(*m.Field271)) } if m.Field272 != nil { n += 2 + sovBenchmark(uint64(*m.Field272)) } n += 2 + sovBenchmark(uint64(m.Field280)) return n } func sovBenchmark(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozBenchmark(x uint64) (n int) { return sovBenchmark(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *BenchmarkMessage) Unmarshal(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: BenchmarkMessage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: BenchmarkMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field1", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Field1 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex hasFields[0] |= uint64(0x00000001) case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field2", wireType) } m.Field2 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Field2 |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } hasFields[0] |= uint64(0x00000002) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field3", wireType) } m.Field3 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Field3 |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } hasFields[0] |= uint64(0x00000004) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field4", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Field4 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType == 1 { var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } iNdEx += 8 v = uint64(dAtA[iNdEx-8]) v |= uint64(dAtA[iNdEx-7]) << 8 v |= uint64(dAtA[iNdEx-6]) << 16 v |= uint64(dAtA[iNdEx-5]) << 24 v |= uint64(dAtA[iNdEx-4]) << 32 v |= uint64(dAtA[iNdEx-3]) << 40 v |= uint64(dAtA[iNdEx-2]) << 48 v |= uint64(dAtA[iNdEx-1]) << 56 m.Field5 = append(m.Field5, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + packedLen if postIndex > l { return io.ErrUnexpectedEOF } for iNdEx < postIndex { var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } iNdEx += 8 v = uint64(dAtA[iNdEx-8]) v |= uint64(dAtA[iNdEx-7]) << 8 v |= uint64(dAtA[iNdEx-6]) << 16 v |= uint64(dAtA[iNdEx-5]) << 24 v |= uint64(dAtA[iNdEx-4]) << 32 v |= uint64(dAtA[iNdEx-3]) << 40 v |= uint64(dAtA[iNdEx-2]) << 48 v |= uint64(dAtA[iNdEx-1]) << 56 m.Field5 = append(m.Field5, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field Field5", wireType) } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field6", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field6 = &v case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field7", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Field7 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field9", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Field9 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field12", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field12 = &b case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field13", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field13 = &b case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field14", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field14 = &b case 16: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field16", wireType) } m.Field16 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Field16 |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } case 17: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field17", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field17 = &b case 18: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field18", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Field18 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 22: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field22", wireType) } m.Field22 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Field22 |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 23: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field23", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field23 = &v case 24: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field24", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field24 = &b case 25: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field25", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field25 = &v case 29: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field29", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field29 = &v case 30: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field30", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field30 = &b case 59: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field59", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field59 = &b case 60: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field60", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field60 = &v case 67: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field67", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field67 = &v case 68: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field68", wireType) } m.Field68 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Field68 |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } case 78: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field78", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Field78 = bool(v != 0) case 80: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field80", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field80 = &b case 81: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field81", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Field81 = &b case 100: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field100", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field100 = &v case 101: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field101", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field101 = &v case 102: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field102", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Field102 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 103: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field103", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Field103 = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 104: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field104", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field104 = &v case 128: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field128", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field128 = &v case 129: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field129", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthBenchmark } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) m.Field129 = &s iNdEx = postIndex case 130: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field130", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field130 = &v case 131: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field131", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field131 = &v case 150: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field150", wireType) } m.Field150 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Field150 |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } case 271: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field271", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field271 = &v case 272: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field272", wireType) } var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Field272 = &v case 280: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Field280", wireType) } m.Field280 = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBenchmark } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Field280 |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipBenchmark(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthBenchmark } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if hasFields[0]&uint64(0x00000001) == 0 { return github_com_gogo_protobuf_proto.NewRequiredNotSetError("field1") } if hasFields[0]&uint64(0x00000002) == 0 { return github_com_gogo_protobuf_proto.NewRequiredNotSetError("field2") } if hasFields[0]&uint64(0x00000004) == 0 { return github_com_gogo_protobuf_proto.NewRequiredNotSetError("field3") } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipBenchmark(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowBenchmark } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowBenchmark } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowBenchmark } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthBenchmark } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowBenchmark } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipBenchmark(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthBenchmark = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowBenchmark = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("benchmark.proto", fileDescriptorBenchmark) } var fileDescriptorBenchmark = []byte{ // 498 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcb, 0x6e, 0xd3, 0x40, 0x18, 0x85, 0x3b, 0xce, 0xa5, 0x8d, 0xc5, 0xa5, 0x8c, 0x44, 0x39, 0x15, 0xad, 0x63, 0x58, 0x79, 0x03, 0x1a, 0xcf, 0xf8, 0x32, 0x0e, 0xac, 0x02, 0x0b, 0x36, 0x20, 0xc8, 0x1b, 0x04, 0xea, 0xb4, 0x15, 0xbd, 0xa0, 0xa4, 0x48, 0x2c, 0xb9, 0x6c, 0x91, 0xe8, 0x0a, 0xf1, 0x48, 0x5d, 0xf2, 0x04, 0x08, 0x85, 0x17, 0x41, 0x69, 0x3d, 0xff, 0xd8, 0x9e, 0x66, 0x15, 0x9d, 0xef, 0xcc, 0x39, 0xbf, 0xe7, 0x1f, 0xff, 0xf6, 0xdb, 0xf2, 0xe4, 0xdd, 0xc1, 0xf1, 0x74, 0xfe, 0xfe, 0xf1, 0x87, 0xf9, 0xe9, 0xd9, 0x29, 0xef, 0x1e, 0x4f, 0x0f, 0x4f, 0x1e, 0x7e, 0xf7, 0xfd, 0xcd, 0xb1, 0x21, 0x2f, 0xcb, 0xc5, 0x62, 0xba, 0x5f, 0xf2, 0x1d, 0xbf, 0x3f, 0x3b, 0x2c, 0x8f, 0xf6, 0x62, 0xb0, 0xd0, 0x8b, 0x06, 0xe3, 0xee, 0xc5, 0x9f, 0xe1, 0xda, 0xa4, 0xd2, 0x88, 0x4a, 0x78, 0xa1, 0x17, 0xf5, 0x1a, 0x54, 0x12, 0x55, 0xe8, 0x38, 0x54, 0x11, 0x4d, 0xd0, 0x0d, 0x59, 0x2b, 0x39, 0xe1, 0x5b, 0x15, 0x4d, 0xd1, 0x0b, 0x3b, 0x51, 0xbf, 0xd2, 0x53, 0xbe, 0x5d, 0xe9, 0x19, 0xfa, 0x21, 0x8b, 0x7a, 0x23, 0x26, 0x2a, 0x94, 0x51, 0x60, 0x8e, 0x75, 0x27, 0x30, 0x27, 0x5a, 0x60, 0xe0, 0xd0, 0x82, 0x07, 0xfe, 0xfa, 0xd5, 0x27, 0x49, 0xdc, 0x08, 0x59, 0xb4, 0x31, 0xea, 0x9e, 0xcd, 0x3f, 0x96, 0x13, 0x23, 0x5a, 0xae, 0x70, 0xd3, 0xe5, 0xca, 0xf2, 0x04, 0xb7, 0x5c, 0x9e, 0x58, 0x9e, 0x61, 0x73, 0x35, 0x77, 0x55, 0x6f, 0x44, 0xcb, 0x73, 0xdc, 0x71, 0xcf, 0xe7, 0x96, 0x6b, 0xf0, 0xda, 0xf8, 0x46, 0x24, 0x2e, 0x25, 0xb6, 0x42, 0x16, 0x75, 0x1a, 0x5c, 0x4a, 0x7e, 0xdf, 0x70, 0x85, 0x7b, 0xe6, 0xde, 0x8c, 0xc2, 0x87, 0x06, 0x26, 0xc0, 0x65, 0x79, 0x6f, 0x36, 0x3d, 0x5a, 0x98, 0x76, 0x99, 0xd8, 0xd3, 0x29, 0xb6, 0x5b, 0xa7, 0x53, 0x0b, 0x0b, 0xec, 0xb6, 0x60, 0x41, 0xd1, 0x4a, 0x20, 0x70, 0xa3, 0x95, 0x20, 0x43, 0x5a, 0xe0, 0x89, 0x6b, 0x48, 0x0b, 0xbe, 0x53, 0x19, 0x32, 0x81, 0xa7, 0x97, 0xf1, 0xde, 0xa3, 0x78, 0x62, 0x24, 0x2a, 0xcf, 0x72, 0x3c, 0x6b, 0x96, 0x67, 0xf6, 0xd2, 0x32, 0x8d, 0xe7, 0xce, 0xa5, 0x67, 0xf6, 0xd2, 0x72, 0x8d, 0x57, 0xab, 0xee, 0x06, 0xcf, 0x35, 0xcd, 0xa6, 0x05, 0x5e, 0xbb, 0xb3, 0x69, 0x41, 0x01, 0x3a, 0xc6, 0x1b, 0x67, 0x6b, 0x3a, 0xe6, 0xbb, 0xfe, 0xc6, 0xd5, 0x82, 0x84, 0xc0, 0x9e, 0x19, 0x8f, 0xa4, 0x1a, 0x8e, 0x51, 0xb6, 0x71, 0xcc, 0x43, 0xc2, 0x12, 0xb3, 0xda, 0xd2, 0x49, 0xad, 0x39, 0x14, 0xf6, 0xaf, 0x71, 0xa8, 0x5a, 0x45, 0x82, 0x83, 0x76, 0xc5, 0xea, 0x59, 0x56, 0xff, 0xa5, 0xc6, 0x67, 0xd6, 0xe2, 0x52, 0x73, 0x49, 0xbc, 0xc0, 0x97, 0x15, 0x1f, 0x8c, 0xee, 0x7e, 0xba, 0xee, 0x47, 0x67, 0x0a, 0x9b, 0xa9, 0x04, 0xbe, 0xb6, 0x33, 0x95, 0xa8, 0xf1, 0x18, 0xdf, 0x1c, 0x1e, 0xf3, 0x07, 0x86, 0xa7, 0x02, 0x3f, 0x59, 0x6d, 0x6f, 0x24, 0xf3, 0x61, 0x65, 0x91, 0x79, 0x8c, 0x1f, 0x1e, 0xbd, 0x0a, 0x12, 0x6b, 0x06, 0x89, 0x73, 0xd7, 0x20, 0xa9, 0x44, 0x6a, 0x81, 0x5f, 0x9e, 0x53, 0x22, 0xb5, 0x18, 0xf3, 0x8b, 0x65, 0xc0, 0x7e, 0x2f, 0x03, 0xf6, 0x77, 0x19, 0xb0, 0xf3, 0x7f, 0xc1, 0xda, 0x0b, 0xf6, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xed, 0xd9, 0x17, 0x33, 0x3a, 0x05, 0x00, 0x00, }
main_raw.rs
extern crate actix; extern crate actix_web; extern crate bytes; extern crate futures; extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; #[macro_use] extern crate askama; extern crate num_cpus; extern crate postgres; extern crate rand; #[macro_use] extern crate diesel; use std::io; use actix::prelude::*; use actix_web::server::{self, HttpHandler, HttpHandlerTask, HttpServer, Writer}; use actix_web::{Error, HttpRequest}; use askama::Template; use bytes::BytesMut; use futures::{Async, Future, Poll}; use postgres::{Connection, TlsMode}; mod db_pg; mod models; mod utils; use db_pg::{PgConnection, TellFortune}; use utils::{Message, Writer as JsonWriter, SIZE}; const HTTPOK: &[u8] = b"HTTP/1.1 200 OK\r\n"; const HDR_SERVER: &[u8] = b"Server: Actix\r\n"; const HDR_CTPLAIN: &[u8] = b"Content-Type: text/plain"; const HDR_CTJSON: &[u8] = b"Content-Type: application/json"; const HDR_CTHTML: &[u8] = b"Content-Type: text/html; charset=utf-8"; const BODY: &[u8] = b"Hello, World!"; struct App { db: Addr<Syn, PgConnection>, } impl HttpHandler for App { fn handle(&mut self, req: HttpRequest) -> Result<Box<HttpHandlerTask>, HttpRequest> { match req.path() { "/plaintext" => Ok(Box::new(Plaintext)), "/json" => Ok(Box::new(Json)), "/fortune" => { let fut = Box::new(self.db.send(TellFortune)); Ok(Box::new(Fortune { fut })) } _ => Err(req), } } } struct Plaintext; impl HttpHandlerTask for Plaintext { fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> { let mut bytes = io.buffer(); bytes.reserve(196); bytes.extend_from_slice(HTTPOK); bytes.extend_from_slice(HDR_SERVER); bytes.extend_from_slice(HDR_CTPLAIN); server::write_content_length(BODY.len(), &mut bytes); io.set_date(bytes); bytes.extend_from_slice(BODY); Ok(Async::Ready(true)) } } struct Json; impl HttpHandlerTask for Json { fn
(&mut self, io: &mut Writer) -> Poll<bool, Error> { let message = Message { message: "Hello, World!", }; let mut body = BytesMut::with_capacity(SIZE); serde_json::to_writer(JsonWriter(&mut body), &message).unwrap(); let mut bytes = io.buffer(); bytes.reserve(196); bytes.extend_from_slice(HTTPOK); bytes.extend_from_slice(HDR_SERVER); bytes.extend_from_slice(HDR_CTJSON); server::write_content_length(body.len(), &mut bytes); io.set_date(bytes); bytes.extend_from_slice(&body[..]); Ok(Async::Ready(true)) } } struct Fortune { fut: Box< Future<Item = io::Result<Vec<models::Fortune>>, Error = actix::MailboxError>, >, } #[derive(Template)] #[template(path = "fortune.html")] struct FortuneTemplate<'a> { items: &'a Vec<models::Fortune>, } impl HttpHandlerTask for Fortune { fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> { match self.fut.poll() { Ok(Async::Ready(Ok(rows))) => { let tmpl = FortuneTemplate { items: &rows }; let body = tmpl.render().unwrap(); let mut bytes = io.buffer(); bytes.reserve(196 + body.len()); bytes.extend_from_slice(HTTPOK); bytes.extend_from_slice(HDR_SERVER); bytes.extend_from_slice(HDR_CTHTML); server::write_content_length(body.len(), &mut bytes); io.set_date(bytes); bytes.extend_from_slice(body.as_ref()); Ok(Async::Ready(true)) } Ok(Async::NotReady) => Ok(Async::NotReady), Ok(Async::Ready(Err(e))) => Err(e.into()), Err(e) => Err(e.into()), } } } fn main() { let sys = System::new("techempower"); let db_url = "postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world"; // Avoid triggering "FATAL: the database system is starting up" error from // postgres. { if Connection::connect(db_url, TlsMode::None).is_err() { std::thread::sleep(std::time::Duration::from_secs(5)); } } // Start db executor actors let addr = SyncArbiter::start(num_cpus::get() * 4, move || { db_pg::PgConnection::new(db_url) }); // start http server HttpServer::new(move || vec![App { db: addr.clone() }]) .backlog(8192) .bind("0.0.0.0:8080") .unwrap() .start(); println!("Started http server: 127.0.0.1:8080"); let _ = sys.run(); }
poll_io
test_cloud_flows.py
import datetime import sys import uuid from collections import Counter, namedtuple from unittest.mock import MagicMock import pendulum import pytest import prefect from prefect.client.client import Client, FlowRunInfoResult, TaskRunInfoResult from prefect.engine.cloud import CloudFlowRunner, CloudTaskRunner from prefect.engine.executors import LocalExecutor from prefect.engine.result_handlers import JSONResultHandler, ResultHandler from prefect.engine.state import ( Failed, Finished, Pending, Retrying, Running, Skipped, Success, TimedOut, TriggerFailed, ) from prefect.utilities.configuration import set_temporary_config pytestmark = pytest.mark.filterwarnings("ignore::UserWarning") class FlowRun: flow_id = str(uuid.uuid4()) def __init__(self, id, state=None, version=None): self.id = id self.name = "flow run name" self.state = state or Pending() self.version = version or 0 class TaskRun: def __init__( self, id, flow_run_id, task_slug, state=None, version=None, map_index=None ): self.id = id self.flow_run_id = flow_run_id self.task_id = task_slug self.task_slug = task_slug self.state = state or Pending() self.version = version or 0 self.map_index = map_index if map_index is not None else -1 @prefect.task def whats_the_time(): return prefect.context.get("scheduled_start_time") @prefect.task def plus_one(x): return x + 1 @prefect.task def invert_fail_once(x): try: return 1 / x except: if prefect.context.get("task_run_count", 0) < 2: raise else: return 100 @pytest.fixture(autouse=True) def
(): with set_temporary_config( { "cloud.graphql": "http://my-cloud.foo", "cloud.auth_token": "token", "engine.flow_runner.default_class": "prefect.engine.cloud.CloudFlowRunner", "engine.task_runner.default_class": "prefect.engine.cloud.CloudTaskRunner", "logging.level": "DEBUG", } ): yield class MockedCloudClient(MagicMock): def __init__(self, flow_runs, task_runs, monkeypatch): super().__init__() self.flow_runs = {fr.id: fr for fr in flow_runs} self.task_runs = {tr.id: tr for tr in task_runs} self.call_count = Counter() monkeypatch.setattr( "prefect.engine.cloud.task_runner.Client", MagicMock(return_value=self) ) monkeypatch.setattr( "prefect.engine.cloud.flow_runner.Client", MagicMock(return_value=self) ) def get_flow_run_info(self, flow_run_id, *args, **kwargs): self.call_count["get_flow_run_info"] += 1 flow_run = self.flow_runs[flow_run_id] task_runs = [t for t in self.task_runs.values() if t.flow_run_id == flow_run_id] return FlowRunInfoResult( id=flow_run.id, flow_id=flow_run.flow_id, name=flow_run.name, parameters={}, context=None, version=flow_run.version, scheduled_start_time=pendulum.parse("2019-01-25T19:15:58.632412+00:00"), state=flow_run.state, task_runs=[ TaskRunInfoResult( id=tr.id, task_id=tr.task_slug, task_slug=tr.task_slug, version=tr.version, state=tr.state, ) for tr in task_runs ], ) def get_task_run_info(self, flow_run_id, task_id, map_index, *args, **kwargs): """ Return task run if found, otherwise create it """ self.call_count["get_task_run_info"] += 1 task_run = next( ( t for t in self.task_runs.values() if t.flow_run_id == flow_run_id and t.task_id == task_id and t.map_index == map_index ), None, ) if not task_run: task_run = TaskRun( id=str(uuid.uuid4()), task_slug=task_id, flow_run_id=flow_run_id, map_index=map_index, ) self.task_runs[task_run.id] = task_run return TaskRunInfoResult( id=task_run.id, task_id=task_id, task_slug=task_id, version=task_run.version, state=task_run.state, ) def set_flow_run_state(self, flow_run_id, version, state, **kwargs): self.call_count["set_flow_run_state"] += 1 self.call_count[flow_run_id] += 1 fr = self.flow_runs[flow_run_id] if fr.version == version: fr.state = state fr.version += 1 else: raise ValueError("Invalid flow run update") def set_task_run_state(self, task_run_id, version, state, **kwargs): self.call_count["set_task_run_state"] += 1 self.call_count[task_run_id] += 1 tr = self.task_runs[task_run_id] if tr.version == version: tr.state = state tr.version += 1 else: raise ValueError("Invalid task run update") return state @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_simple_two_task_flow(monkeypatch, executor): flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) with prefect.Flow(name="test") as flow: t1 = prefect.Task() t2 = prefect.Task() t2.set_upstream(t1) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_2, task_slug=t2.slug, flow_run_id=flow_run_id), ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_successful() assert client.flow_runs[flow_run_id].state.is_successful() assert client.task_runs[task_run_id_1].state.is_successful() assert client.task_runs[task_run_id_1].version == 2 assert client.task_runs[task_run_id_2].state.is_successful() @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_scheduled_start_time_is_in_context(monkeypatch, executor): flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) flow = prefect.Flow( name="test", tasks=[whats_the_time], result_handler=ResultHandler() ) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun( id=task_run_id_1, task_slug=whats_the_time.slug, flow_run_id=flow_run_id ) ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_successful() assert client.flow_runs[flow_run_id].state.is_successful() assert client.task_runs[task_run_id_1].state.is_successful() assert isinstance(state.result[whats_the_time].result, datetime.datetime) @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_simple_two_task_flow_with_final_task_set_to_fail(monkeypatch, executor): flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) with prefect.Flow(name="test") as flow: t1 = prefect.Task() t2 = prefect.Task() t2.set_upstream(t1) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun( id=task_run_id_2, task_slug=t2.slug, flow_run_id=flow_run_id, state=Failed(), ), ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_failed() assert client.flow_runs[flow_run_id].state.is_failed() assert client.task_runs[task_run_id_1].state.is_successful() assert client.task_runs[task_run_id_1].version == 2 assert client.task_runs[task_run_id_2].state.is_failed() assert client.task_runs[task_run_id_2].version == 0 @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_simple_two_task_flow_with_final_task_already_running(monkeypatch, executor): flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) with prefect.Flow(name="test") as flow: t1 = prefect.Task() t2 = prefect.Task() t2.set_upstream(t1) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun( id=task_run_id_2, task_slug=t2.slug, version=1, flow_run_id=flow_run_id, state=Running(), ), ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_running() assert client.flow_runs[flow_run_id].state.is_running() assert client.task_runs[task_run_id_1].state.is_successful() assert client.task_runs[task_run_id_1].version == 2 assert client.task_runs[task_run_id_2].state.is_running() assert client.task_runs[task_run_id_2].version == 1 @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_simple_three_task_flow_with_one_failing_task(monkeypatch, executor): @prefect.task def error(): 1 / 0 flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) task_run_id_3 = str(uuid.uuid4()) with prefect.Flow(name="test") as flow: t1 = prefect.Task() t2 = prefect.Task() t3 = error() t2.set_upstream(t1) t3.set_upstream(t2) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_2, task_slug=t2.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_3, task_slug=t3.slug, flow_run_id=flow_run_id), ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_failed() assert client.flow_runs[flow_run_id].state.is_failed() assert client.task_runs[task_run_id_1].state.is_successful() assert client.task_runs[task_run_id_1].version == 2 assert client.task_runs[task_run_id_2].state.is_successful() assert client.task_runs[task_run_id_2].version == 2 assert client.task_runs[task_run_id_3].state.is_failed() assert client.task_runs[task_run_id_2].version == 2 @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_simple_three_task_flow_with_first_task_retrying(monkeypatch, executor): """ If the first task retries, then the next two tasks shouldn't even make calls to Cloud because they won't pass their upstream checks """ @prefect.task(max_retries=1, retry_delay=datetime.timedelta(minutes=2)) def error(): 1 / 0 flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) task_run_id_3 = str(uuid.uuid4()) with prefect.Flow(name="test") as flow: t1 = error() t2 = prefect.Task() t3 = prefect.Task() t2.set_upstream(t1) t3.set_upstream(t2) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_2, task_slug=t2.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_3, task_slug=t3.slug, flow_run_id=flow_run_id), ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_running() assert client.flow_runs[flow_run_id].state.is_running() assert isinstance(client.task_runs[task_run_id_1].state, Retrying) assert client.task_runs[task_run_id_1].version == 3 assert client.task_runs[task_run_id_2].state.is_pending() assert client.task_runs[task_run_id_2].version == 0 assert client.task_runs[task_run_id_3].state.is_pending() assert client.task_runs[task_run_id_2].version == 0 assert client.call_count["set_task_run_state"] == 3 @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_simple_map(monkeypatch, executor): flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) with prefect.Flow(name="test", result_handler=JSONResultHandler()) as flow: t1 = plus_one.map([0, 1, 2]) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id) ] + [ TaskRun(id=str(uuid.uuid4()), task_slug=t.slug, flow_run_id=flow_run_id) for t in flow.tasks if t is not t1 ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_successful() assert client.flow_runs[flow_run_id].state.is_successful() assert client.task_runs[task_run_id_1].state.is_mapped() # there should be a total of 4 task runs corresponding to the mapped task assert len([tr for tr in client.task_runs.values() if tr.task_slug == t1.slug]) == 4 @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_deep_map(monkeypatch, executor): flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) task_run_id_3 = str(uuid.uuid4()) with prefect.Flow(name="test", result_handler=JSONResultHandler()) as flow: t1 = plus_one.map([0, 1, 2]) t2 = plus_one.map(t1) t3 = plus_one.map(t2) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_2, task_slug=t2.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_3, task_slug=t3.slug, flow_run_id=flow_run_id), ] + [ TaskRun(id=str(uuid.uuid4()), task_slug=t.slug, flow_run_id=flow_run_id) for t in flow.tasks if t not in [t1, t2, t3] ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run( return_tasks=flow.tasks, executor=executor ) assert state.is_successful() assert client.flow_runs[flow_run_id].state.is_successful() assert client.task_runs[task_run_id_1].state.is_mapped() assert client.task_runs[task_run_id_2].state.is_mapped() assert client.task_runs[task_run_id_3].state.is_mapped() # there should be a total of 4 task runs corresponding to each mapped task for t in [t1, t2, t3]: assert ( len([tr for tr in client.task_runs.values() if tr.task_slug == t.slug]) == 4 ) @pytest.mark.parametrize("executor", ["local", "sync"], indirect=True) def test_deep_map_with_a_failure(monkeypatch, executor): flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) task_run_id_3 = str(uuid.uuid4()) with prefect.Flow(name="test", result_handler=JSONResultHandler()) as flow: t1 = plus_one.map([-1, 0, 1]) t2 = invert_fail_once.map(t1) t3 = plus_one.map(t2) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_2, task_slug=t2.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_3, task_slug=t3.slug, flow_run_id=flow_run_id), ] + [ TaskRun(id=str(uuid.uuid4()), task_slug=t.slug, flow_run_id=flow_run_id) for t in flow.tasks if t not in [t1, t2, t3] ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): state = CloudFlowRunner(flow=flow).run(return_tasks=flow.tasks) assert state.is_failed() assert client.flow_runs[flow_run_id].state.is_failed() assert client.task_runs[task_run_id_1].state.is_mapped() assert client.task_runs[task_run_id_2].state.is_mapped() assert client.task_runs[task_run_id_3].state.is_mapped() # there should be a total of 4 task runs corresponding to each mapped task for t in [t1, t2, t3]: assert ( len([tr for tr in client.task_runs.values() if tr.task_slug == t.slug]) == 4 ) # t2's first child task should have failed t2_0 = next( tr for tr in client.task_runs.values() if tr.task_slug == t2.slug and tr.map_index == 0 ) assert t2_0.state.is_failed() # t3's first child task should have failed t3_0 = next( tr for tr in client.task_runs.values() if tr.task_slug == t3.slug and tr.map_index == 0 ) assert t3_0.state.is_failed() def test_deep_map_with_a_retry(monkeypatch): """ Creates a situation in which a deeply-mapped Flow encounters a one-time error in one of the middle layers. Running the flow a second time should resolve the error. DOES NOT WORK WITH DASK EXECUTORS because of the need for shared state on second run """ flow_run_id = str(uuid.uuid4()) task_run_id_1 = str(uuid.uuid4()) task_run_id_2 = str(uuid.uuid4()) task_run_id_3 = str(uuid.uuid4()) with prefect.Flow(name="test", result_handler=JSONResultHandler()) as flow: t1 = plus_one.map([-1, 0, 1]) t2 = invert_fail_once.map(t1) t3 = plus_one.map(t2) t2.max_retries = 1 t2.retry_delay = datetime.timedelta(seconds=100) monkeypatch.setattr("requests.Session", MagicMock()) monkeypatch.setattr("requests.post", MagicMock()) client = MockedCloudClient( flow_runs=[FlowRun(id=flow_run_id)], task_runs=[ TaskRun(id=task_run_id_1, task_slug=t1.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_2, task_slug=t2.slug, flow_run_id=flow_run_id), TaskRun(id=task_run_id_3, task_slug=t3.slug, flow_run_id=flow_run_id), ] + [ TaskRun(id=str(uuid.uuid4()), task_slug=t.slug, flow_run_id=flow_run_id) for t in flow.tasks if t not in [t1, t2, t3] ], monkeypatch=monkeypatch, ) with prefect.context(flow_run_id=flow_run_id): CloudFlowRunner(flow=flow).run(executor=LocalExecutor()) assert client.flow_runs[flow_run_id].state.is_running() assert client.task_runs[task_run_id_1].state.is_mapped() assert client.task_runs[task_run_id_2].state.is_mapped() assert client.task_runs[task_run_id_3].state.is_mapped() # there should be a total of 4 task runs corresponding to each mapped task for t in [t1, t2, t3]: assert ( len([tr for tr in client.task_runs.values() if tr.task_slug == t.slug]) == 4 ) # t2's first child task should be retrying t2_0 = next( tr for tr in client.task_runs.values() if tr.task_slug == t2.slug and tr.map_index == 0 ) assert isinstance(t2_0.state, Retrying) # t3's first child task should be pending t3_0 = next( tr for tr in client.task_runs.values() if tr.task_slug == t3.slug and tr.map_index == 0 ) assert t3_0.state.is_pending() # RUN A SECOND TIME with an artificially updated start time failed_id = [ t_id for t_id, tr in client.task_runs.items() if tr.task_slug == t2.slug and tr.map_index == 0 ].pop() client.task_runs[failed_id].state.start_time = pendulum.now("UTC") with prefect.context(flow_run_id=flow_run_id): CloudFlowRunner(flow=flow).run(executor=LocalExecutor()) # t2's first child task should be successful t2_0 = next( tr for tr in client.task_runs.values() if tr.task_slug == t2.slug and tr.map_index == 0 ) assert t2_0.state.is_successful() # t3's first child task should be successful t3_0 = next( tr for tr in client.task_runs.values() if tr.task_slug == t3.slug and tr.map_index == 0 ) assert t3_0.state.is_successful()
cloud_settings
liveness.go
// Copyright 2018 The Cockroach Authors. // // Use of this software is governed by the Business Source License included // in the file licenses/BSL.txt and at www.mariadb.com/bsl11. // // Change Date: 2022-10-01 // // On the date above, in accordance with the Business Source License, use // of this software will be governed by the Apache License, Version 2.0, // included in the file licenses/APL.txt and at // https://www.apache.org/licenses/LICENSE-2.0 package storagepb import ( "time" "github.com/cockroachdb/cockroach/pkg/util/hlc" "github.com/cockroachdb/cockroach/pkg/util/timeutil" ) // IsLive returns whether the node is considered live at the given time with the // given clock offset. func (l *Liveness) IsLive(now hlc.Timestamp, maxOffset time.Duration) bool { if maxOffset == timeutil.ClocklessMaxOffset
expiration := hlc.Timestamp(l.Expiration).Add(-maxOffset.Nanoseconds(), 0) return now.Less(expiration) } // IsDead returns whether the node is considered dead at the given time with the // given threshold. func (l *Liveness) IsDead(now hlc.Timestamp, threshold time.Duration) bool { deadAsOf := hlc.Timestamp(l.Expiration).GoTime().Add(threshold) return !now.GoTime().Before(deadAsOf) } // LivenessStatus returns a NodeLivenessStatus enumeration value for this liveness // based on the provided timestamp, threshold, and clock max offset. func (l *Liveness) LivenessStatus( now time.Time, threshold, maxOffset time.Duration, ) NodeLivenessStatus { nowHlc := hlc.Timestamp{WallTime: now.UnixNano()} if l.IsDead(nowHlc, threshold) { if l.Decommissioning { return NodeLivenessStatus_DECOMMISSIONED } return NodeLivenessStatus_DEAD } if l.Decommissioning { return NodeLivenessStatus_DECOMMISSIONING } if l.Draining { return NodeLivenessStatus_UNAVAILABLE } if l.IsLive(nowHlc, maxOffset) { return NodeLivenessStatus_LIVE } return NodeLivenessStatus_UNAVAILABLE }
{ // When using clockless reads, we're live without a buffer period. maxOffset = 0 }
binance.py
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange import math import json from ccxt.base.errors import ExchangeError from ccxt.base.errors import AuthenticationError from ccxt.base.errors import ArgumentsRequired from ccxt.base.errors import InsufficientFunds from ccxt.base.errors import InvalidOrder from ccxt.base.errors import OrderNotFound from ccxt.base.errors import DDoSProtection from ccxt.base.errors import ExchangeNotAvailable from ccxt.base.errors import InvalidNonce class binance (Exchange): def describe(self): return self.deep_extend(super(binance, self).describe(), { 'id': 'binance', 'name': 'Binance', 'countries': ['JP'], # Japan 'rateLimit': 500, 'certified': True, # new metainfo interface 'has': { 'fetchDepositAddress': True, 'CORS': False, 'fetchBidsAsks': True, 'fetchTickers': True, 'fetchOHLCV': True, 'fetchMyTrades': True, 'fetchOrder': True, 'fetchOrders': True, 'fetchOpenOrders': True, 'fetchClosedOrders': True, 'withdraw': True, 'fetchFundingFees': True, 'fetchDeposits': True, 'fetchWithdrawals': True, 'fetchTransactions': False, }, 'timeframes': { '1m': '1m', '3m': '3m', '5m': '5m', '15m': '15m', '30m': '30m', '1h': '1h', '2h': '2h', '4h': '4h', '6h': '6h', '8h': '8h', '12h': '12h', '1d': '1d', '3d': '3d', '1w': '1w', '1M': '1M', }, 'urls': { 'logo': 'https://user-images.githubusercontent.com/1294454/29604020-d5483cdc-87ee-11e7-94c7-d1a8d9169293.jpg', 'api': { 'web': 'https://www.binance.com', 'wapi': 'https://api.binance.com/wapi/v3', 'public': 'https://api.binance.com/api/v1', 'private': 'https://api.binance.com/api/v3', 'v3': 'https://api.binance.com/api/v3', 'v1': 'https://api.binance.com/api/v1', }, 'www': 'https://www.binance.com', 'referral': 'https://www.binance.com/?ref=10205187', 'doc': 'https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md', 'fees': 'https://www.binance.com/en/fee/schedule', }, 'api': { 'web': { 'get': [ 'exchange/public/product', 'assetWithdraw/getAllAsset.html', ], }, 'wapi': { 'post': [ 'withdraw', ], 'get': [ 'depositHistory', 'withdrawHistory', 'depositAddress', 'accountStatus', 'systemStatus', 'userAssetDribbletLog', 'tradeFee', 'assetDetail', ], }, 'v3': { 'get': [ 'ticker/price', 'ticker/bookTicker', ], }, 'public': { 'get': [ 'exchangeInfo', 'ping', 'time', 'depth', 'aggTrades', 'klines', 'ticker/24hr', 'ticker/allPrices', 'ticker/allBookTickers', 'ticker/price', 'ticker/bookTicker', 'exchangeInfo', ], 'put': ['userDataStream'], 'post': ['userDataStream'], 'delete': ['userDataStream'], }, 'private': { 'get': [ 'order', 'openOrders', 'allOrders', 'account', 'myTrades', ], 'post': [ 'order', 'order/test', ], 'delete': [ 'order', ], }, }, 'fees': { 'trading': { 'tierBased': False, 'percentage': True, 'taker': 0.001, 'maker': 0.001, }, # should be deleted, these are outdated and inaccurate 'funding': { 'tierBased': False, 'percentage': False, 'withdraw': { 'ADA': 1.0, 'ADX': 4.7, 'AION': 1.9, 'AMB': 11.4, 'APPC': 6.5, 'ARK': 0.1, 'ARN': 3.1, 'AST': 10.0, 'BAT': 18.0, 'BCD': 1.0, 'BCH': 0.001, 'BCPT': 10.2, 'BCX': 1.0, 'BNB': 0.7, 'BNT': 1.5, 'BQX': 1.6, 'BRD': 6.4, 'BTC': 0.001, 'BTG': 0.001, 'BTM': 5.0, 'BTS': 1.0, 'CDT': 67.0, 'CMT': 37.0, 'CND': 47.0, 'CTR': 5.4, 'DASH': 0.002, 'DGD': 0.06, 'DLT': 11.7, 'DNT': 51.0, 'EDO': 2.5, 'ELF': 6.5, 'ENG': 2.1, 'ENJ': 42.0, 'EOS': 1.0, 'ETC': 0.01, 'ETF': 1.0, 'ETH': 0.01, 'EVX': 2.5, 'FUEL': 45.0, 'FUN': 85.0, 'GAS': 0, 'GTO': 20.0, 'GVT': 0.53, 'GXS': 0.3, 'HCC': 0.0005, 'HSR': 0.0001, 'ICN': 3.5, 'ICX': 1.3, 'INS': 1.5, 'IOTA': 0.5, 'KMD': 0.002, 'KNC': 2.6, 'LEND': 54.0, 'LINK': 12.8, 'LLT': 54.0, 'LRC': 9.1, 'LSK': 0.1, 'LTC': 0.01, 'LUN': 0.29, 'MANA': 74.0, 'MCO': 0.86, 'MDA': 4.7, 'MOD': 2.0, 'MTH': 34.0, 'MTL': 1.9, 'NAV': 0.2, 'NEBL': 0.01, 'NEO': 0.0, 'NULS': 2.1, 'OAX': 8.3, 'OMG': 0.57, 'OST': 17.0, 'POE': 88.0, 'POWR': 8.6, 'PPT': 0.25, 'QSP': 21.0, 'QTUM': 0.01, 'RCN': 35.0, 'RDN': 2.2, 'REQ': 18.1, 'RLC': 4.1, 'SALT': 1.3, 'SBTC': 1.0, 'SNGLS': 42, 'SNM': 29.0, 'SNT': 32.0, 'STORJ': 5.9, 'STRAT': 0.1, 'SUB': 7.4, 'TNB': 82.0, 'TNT': 47.0, 'TRIG': 6.7, 'TRX': 129.0, 'USDT': 23.0, 'VEN': 1.8, 'VIB': 28.0, 'VIBE': 7.2, 'WABI': 3.5, 'WAVES': 0.002, 'WINGS': 9.3, 'WTC': 0.5, 'XLM': 0.01, 'XMR': 0.04, 'XRP': 0.25, 'XVG': 0.1, 'XZC': 0.02, 'YOYOW': 39.0, 'ZEC': 0.005, 'ZRX': 5.7, }, 'deposit': {}, }, }, 'commonCurrencies': { 'YOYO': 'YOYOW', 'BCC': 'BCH', }, # exchange-specific options 'options': { 'defaultTimeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel 'defaultLimitOrderType': 'limit', # or 'limit_maker' 'hasAlreadyAuthenticatedSuccessfully': False, 'warnOnFetchOpenOrdersWithoutSymbol': True, 'recvWindow': 5 * 1000, # 5 sec, binance default 'timeDifference': 0, # the difference between system clock and Binance clock 'adjustForTimeDifference': False, # controls the adjustment logic upon instantiation 'parseOrderToPrecision': False, # force amounts and costs in parseOrder to precision 'newOrderRespType': 'RESULT', # 'ACK' for order id, 'RESULT' for full order or 'FULL' for order with fills }, 'exceptions': { '-1000': ExchangeNotAvailable, # {"code":-1000,"msg":"An unknown error occured while processing the request."} '-1013': InvalidOrder, # createOrder -> 'invalid quantity'/'invalid price'/MIN_NOTIONAL '-1021': InvalidNonce, # 'your time is ahead of server' '-1022': AuthenticationError, # {"code":-1022,"msg":"Signature for self request is not valid."} '-1100': InvalidOrder, # createOrder(symbol, 1, asdf) -> 'Illegal characters found in parameter 'price' '-1104': ExchangeError, # Not all sent parameters were read, read 8 parameters but was sent 9 '-1128': ExchangeError, # {"code":-1128,"msg":"Combination of optional parameters invalid."} '-2010': ExchangeError, # generic error code for createOrder -> 'Account has insufficient balance for requested action.', {"code":-2010,"msg":"Rest API trading is not enabled."}, etc... '-2011': OrderNotFound, # cancelOrder(1, 'BTC/USDT') -> 'UNKNOWN_ORDER' '-2013': OrderNotFound, # fetchOrder(1, 'BTC/USDT') -> 'Order does not exist' '-2014': AuthenticationError, # {"code":-2014, "msg": "API-key format invalid."} '-2015': AuthenticationError, # "Invalid API-key, IP, or permissions for action." }, }) def nonce(self): return self.milliseconds() - self.options['timeDifference'] def load_time_difference(self): response = self.publicGetTime() after = self.milliseconds() self.options['timeDifference'] = int(after - response['serverTime']) return self.options['timeDifference'] def fetch_markets(self): response = self.publicGetExchangeInfo() if self.options['adjustForTimeDifference']: self.load_time_difference() markets = response['symbols'] result = [] for i in range(0, len(markets)): market = markets[i] id = market['symbol'] # "123456" is a "test symbol/market" if id == '123456': continue baseId = market['baseAsset'] quoteId = market['quoteAsset'] base = self.common_currency_code(baseId) quote = self.common_currency_code(quoteId) symbol = base + '/' + quote filters = self.index_by(market['filters'], 'filterType') precision = { 'base': market['baseAssetPrecision'], 'quote': market['quotePrecision'], 'amount': market['baseAssetPrecision'], 'price': market['quotePrecision'], } active = (market['status'] == 'TRADING') entry = { 'id': id, 'symbol': symbol, 'base': base, 'quote': quote, 'baseId': baseId, 'quoteId': quoteId, 'info': market, 'active': active, 'precision': precision, 'limits': { 'amount': { 'min': math.pow(10, -precision['amount']), 'max': None, }, 'price': { 'min': math.pow(10, -precision['price']), 'max': None, }, 'cost': { 'min': -1 * math.log10(precision['amount']), 'max': None, }, }, } if 'PRICE_FILTER' in filters: filter = filters['PRICE_FILTER'] entry['precision']['price'] = self.precision_from_string(filter['tickSize']) entry['limits']['price'] = { 'min': self.safe_float(filter, 'minPrice'), 'max': self.safe_float(filter, 'maxPrice'), } if 'LOT_SIZE' in filters: filter = filters['LOT_SIZE'] entry['precision']['amount'] = self.precision_from_string(filter['stepSize']) entry['limits']['amount'] = { 'min': self.safe_float(filter, 'minQty'), 'max': self.safe_float(filter, 'maxQty'), } if 'MIN_NOTIONAL' in filters: entry['limits']['cost']['min'] = float(filters['MIN_NOTIONAL']['minNotional']) result.append(entry) return result def calculate_fee(self, symbol, type, side, amount, price, takerOrMaker='taker', params={}): market = self.markets[symbol] key = 'quote' rate = market[takerOrMaker] cost = float(self.cost_to_precision(symbol, amount * rate)) if side == 'sell': cost *= price else: key = 'base' return { 'type': takerOrMaker, 'currency': market[key], 'rate': rate, 'cost': float(self.fee_to_precision(symbol, cost)), } def fetch_balance(self, params={}): self.load_markets() response = self.privateGetAccount(params) result = {'info': response} balances = response['balances'] for i in range(0, len(balances)): balance = balances[i] currency = balance['asset'] if currency in self.currencies_by_id: currency = self.currencies_by_id[currency]['code'] account = { 'free': float(balance['free']), 'used': float(balance['locked']), 'total': 0.0, } account['total'] = self.sum(account['free'], account['used']) result[currency] = account return self.parse_balance(result) def fetch_order_book(self, symbol, limit=None, params={}): self.load_markets() market = self.market(symbol) request = { 'symbol': market['id'], } if limit is not None: request['limit'] = limit # default = maximum = 100 response = self.publicGetDepth(self.extend(request, params)) orderbook = self.parse_order_book(response) orderbook['nonce'] = self.safe_integer(response, 'lastUpdateId') return orderbook def
(self, ticker, market=None): timestamp = self.safe_integer(ticker, 'closeTime') iso8601 = None if (timestamp is None) else self.iso8601(timestamp) symbol = self.find_symbol(self.safe_string(ticker, 'symbol'), market) last = self.safe_float(ticker, 'lastPrice') return { 'symbol': symbol, 'timestamp': timestamp, 'datetime': iso8601, 'high': self.safe_float(ticker, 'highPrice'), 'low': self.safe_float(ticker, 'lowPrice'), 'bid': self.safe_float(ticker, 'bidPrice'), 'bidVolume': self.safe_float(ticker, 'bidQty'), 'ask': self.safe_float(ticker, 'askPrice'), 'askVolume': self.safe_float(ticker, 'askQty'), 'vwap': self.safe_float(ticker, 'weightedAvgPrice'), 'open': self.safe_float(ticker, 'openPrice'), 'close': last, 'last': last, 'previousClose': self.safe_float(ticker, 'prevClosePrice'), # previous day close 'change': self.safe_float(ticker, 'priceChange'), 'percentage': self.safe_float(ticker, 'priceChangePercent'), 'average': None, 'baseVolume': self.safe_float(ticker, 'volume'), 'quoteVolume': self.safe_float(ticker, 'quoteVolume'), 'info': ticker, } def fetch_ticker(self, symbol, params={}): self.load_markets() market = self.market(symbol) response = self.publicGetTicker24hr(self.extend({ 'symbol': market['id'], }, params)) return self.parse_ticker(response, market) def parse_tickers(self, rawTickers, symbols=None): tickers = [] for i in range(0, len(rawTickers)): tickers.append(self.parse_ticker(rawTickers[i])) return self.filter_by_array(tickers, 'symbol', symbols) def fetch_bids_asks(self, symbols=None, params={}): self.load_markets() rawTickers = self.publicGetTickerBookTicker(params) return self.parse_tickers(rawTickers, symbols) def fetch_tickers(self, symbols=None, params={}): self.load_markets() rawTickers = self.publicGetTicker24hr(params) return self.parse_tickers(rawTickers, symbols) def parse_ohlcv(self, ohlcv, market=None, timeframe='1m', since=None, limit=None): return [ ohlcv[0], float(ohlcv[1]), float(ohlcv[2]), float(ohlcv[3]), float(ohlcv[4]), float(ohlcv[5]), ] def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}): self.load_markets() market = self.market(symbol) request = { 'symbol': market['id'], 'interval': self.timeframes[timeframe], } if since is not None: request['startTime'] = since if limit is not None: request['limit'] = limit # default == max == 500 response = self.publicGetKlines(self.extend(request, params)) return self.parse_ohlcvs(response, market, timeframe, since, limit) def parse_trade(self, trade, market=None): timestampField = 'T' if ('T' in list(trade.keys())) else 'time' timestamp = self.safe_integer(trade, timestampField) priceField = 'p' if ('p' in list(trade.keys())) else 'price' price = self.safe_float(trade, priceField) amountField = 'q' if ('q' in list(trade.keys())) else 'qty' amount = self.safe_float(trade, amountField) idField = 'a' if ('a' in list(trade.keys())) else 'id' id = self.safe_string(trade, idField) side = None order = None if 'orderId' in trade: order = self.safe_string(trade, 'orderId') if 'm' in trade: side = 'sell' if trade['m'] else 'buy' # self is reversed intentionally else: if 'isBuyer' in trade: side = 'buy' if (trade['isBuyer']) else 'sell' # self is a True side fee = None if 'commission' in trade: fee = { 'cost': self.safe_float(trade, 'commission'), 'currency': self.common_currency_code(trade['commissionAsset']), } takerOrMaker = None if 'isMaker' in trade: takerOrMaker = 'maker' if trade['isMaker'] else 'taker' symbol = None if market is None: marketId = self.safe_string(trade, 'symbol') market = self.safe_value(self.markets_by_id, marketId) if market is not None: symbol = market['symbol'] return { 'info': trade, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'symbol': symbol, 'id': id, 'order': order, 'type': None, 'takerOrMaker': takerOrMaker, 'side': side, 'price': price, 'cost': price * amount, 'amount': amount, 'fee': fee, } def fetch_trades(self, symbol, since=None, limit=None, params={}): self.load_markets() market = self.market(symbol) request = { 'symbol': market['id'], } if since is not None: request['startTime'] = since request['endTime'] = self.sum(since, 3600000) if limit is not None: request['limit'] = limit # 'fromId': 123, # ID to get aggregate trades from INCLUSIVE. # 'startTime': 456, # Timestamp in ms to get aggregate trades from INCLUSIVE. # 'endTime': 789, # Timestamp in ms to get aggregate trades until INCLUSIVE. # 'limit': 500, # default = 500, maximum = 1000 # # Caveats: # - default limit(500) applies only if no other parameters set, trades up # to the maximum limit may be returned to satisfy other parameters # - if both limit and time window is set and time window contains more # trades than the limit then the last trades from the window are returned # - 'tradeId' accepted and returned by self method is "aggregate" trade id # which is different from actual trade id # - setting both fromId and time window results in error response = self.publicGetAggTrades(self.extend(request, params)) return self.parse_trades(response, market, since, limit) def parse_order_status(self, status): statuses = { 'NEW': 'open', 'PARTIALLY_FILLED': 'open', 'FILLED': 'closed', 'CANCELED': 'canceled', } return statuses[status] if (status in list(statuses.keys())) else status def parse_order(self, order, market=None): status = self.parse_order_status(self.safe_string(order, 'status')) symbol = self.find_symbol(self.safe_string(order, 'symbol'), market) timestamp = None if 'time' in order: timestamp = order['time'] elif 'transactTime' in order: timestamp = order['transactTime'] price = self.safe_float(order, 'price') amount = self.safe_float(order, 'origQty') filled = self.safe_float(order, 'executedQty') remaining = None cost = self.safe_float(order, 'cummulativeQuoteQty') if filled is not None: if amount is not None: remaining = amount - filled if self.options['parseOrderToPrecision']: remaining = float(self.amount_to_precision(symbol, remaining)) remaining = max(remaining, 0.0) if price is not None: if cost is None: cost = price * filled id = self.safe_string(order, 'orderId') type = self.safe_string(order, 'type') if type is not None: type = type.lower() if type == 'market': if price == 0.0: if (cost is not None) and(filled is not None): if (cost > 0) and(filled > 0): price = cost / filled side = self.safe_string(order, 'side') if side is not None: side = side.lower() fee = None trades = None fills = self.safe_value(order, 'fills') if fills is not None: trades = self.parse_trades(fills, market) numTrades = len(trades) if numTrades > 0: cost = trades[0]['cost'] fee = { 'cost': trades[0]['fee']['cost'], 'currency': trades[0]['fee']['currency'], } for i in range(1, len(trades)): cost = self.sum(cost, trades[i]['cost']) fee['cost'] = self.sum(fee['cost'], trades[i]['fee']['cost']) average = None if cost is not None: if filled: average = cost / filled if self.options['parseOrderToPrecision']: cost = float(self.cost_to_precision(symbol, cost)) result = { 'info': order, 'id': id, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'lastTradeTimestamp': None, 'symbol': symbol, 'type': type, 'side': side, 'price': price, 'amount': amount, 'cost': cost, 'average': average, 'filled': filled, 'remaining': remaining, 'status': status, 'fee': fee, 'trades': trades, } return result def create_order(self, symbol, type, side, amount, price=None, params={}): self.load_markets() market = self.market(symbol) # the next 5 lines are added to support for testing orders method = 'privatePostOrder' test = self.safe_value(params, 'test', False) if test: method += 'Test' params = self.omit(params, 'test') uppercaseType = type.upper() order = { 'symbol': market['id'], 'quantity': self.amount_to_precision(symbol, amount), 'type': uppercaseType, 'side': side.upper(), 'newOrderRespType': self.options['newOrderRespType'], # 'ACK' for order id, 'RESULT' for full order or 'FULL' for order with fills } timeInForceIsRequired = False priceIsRequired = False stopPriceIsRequired = False if uppercaseType == 'LIMIT': priceIsRequired = True timeInForceIsRequired = True elif (uppercaseType == 'STOP_LOSS') or (uppercaseType == 'TAKE_PROFIT'): stopPriceIsRequired = True elif (uppercaseType == 'STOP_LOSS_LIMIT') or (uppercaseType == 'TAKE_PROFIT_LIMIT'): stopPriceIsRequired = True priceIsRequired = True timeInForceIsRequired = True elif uppercaseType == 'LIMIT_MAKER': priceIsRequired = True if priceIsRequired: if price is None: raise InvalidOrder(self.id + ' createOrder method requires a price argument for a ' + type + ' order') order['price'] = self.price_to_precision(symbol, price) if timeInForceIsRequired: order['timeInForce'] = self.options['defaultTimeInForce'] # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel if stopPriceIsRequired: stopPrice = self.safe_float(params, 'stopPrice') if stopPrice is None: raise InvalidOrder(self.id + ' createOrder method requires a stopPrice extra param for a ' + type + ' order') else: order['stopPrice'] = self.price_to_precision(symbol, stopPrice) response = getattr(self, method)(self.extend(order, params)) return self.parse_order(response, market) def fetch_order(self, id, symbol=None, params={}): if symbol is None: raise ArgumentsRequired(self.id + ' fetchOrder requires a symbol argument') self.load_markets() market = self.market(symbol) origClientOrderId = self.safe_value(params, 'origClientOrderId') request = { 'symbol': market['id'], } if origClientOrderId is not None: request['origClientOrderId'] = origClientOrderId else: request['orderId'] = int(id) response = self.privateGetOrder(self.extend(request, params)) return self.parse_order(response, market) def fetch_orders(self, symbol=None, since=None, limit=None, params={}): if symbol is None: raise ArgumentsRequired(self.id + ' fetchOrders requires a symbol argument') self.load_markets() market = self.market(symbol) request = { 'symbol': market['id'], } if limit is not None: request['limit'] = limit response = self.privateGetAllOrders(self.extend(request, params)) # # [ # { # "symbol": "LTCBTC", # "orderId": 1, # "clientOrderId": "myOrder1", # "price": "0.1", # "origQty": "1.0", # "executedQty": "0.0", # "cummulativeQuoteQty": "0.0", # "status": "NEW", # "timeInForce": "GTC", # "type": "LIMIT", # "side": "BUY", # "stopPrice": "0.0", # "icebergQty": "0.0", # "time": 1499827319559, # "updateTime": 1499827319559, # "isWorking": True # } # ] # return self.parse_orders(response, market, since, limit) def fetch_open_orders(self, symbol=None, since=None, limit=None, params={}): self.load_markets() market = None request = {} if symbol is not None: market = self.market(symbol) request['symbol'] = market['id'] elif self.options['warnOnFetchOpenOrdersWithoutSymbol']: symbols = self.symbols numSymbols = len(symbols) fetchOpenOrdersRateLimit = int(numSymbols / 2) raise ExchangeError(self.id + ' fetchOpenOrders WARNING: fetching open orders without specifying a symbol is rate-limited to one call per ' + str(fetchOpenOrdersRateLimit) + ' seconds. Do not call self method frequently to avoid ban. Set ' + self.id + '.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.') response = self.privateGetOpenOrders(self.extend(request, params)) return self.parse_orders(response, market, since, limit) def fetch_closed_orders(self, symbol=None, since=None, limit=None, params={}): orders = self.fetch_orders(symbol, since, limit, params) return self.filter_by(orders, 'status', 'closed') def cancel_order(self, id, symbol=None, params={}): if symbol is None: raise ArgumentsRequired(self.id + ' cancelOrder requires a symbol argument') self.load_markets() market = self.market(symbol) response = self.privateDeleteOrder(self.extend({ 'symbol': market['id'], 'orderId': int(id), # 'origClientOrderId': id, }, params)) return self.parse_order(response) def fetch_my_trades(self, symbol=None, since=None, limit=None, params={}): if symbol is None: raise ArgumentsRequired(self.id + ' fetchMyTrades requires a symbol argument') self.load_markets() market = self.market(symbol) request = { 'symbol': market['id'], } if limit is not None: request['limit'] = limit response = self.privateGetMyTrades(self.extend(request, params)) return self.parse_trades(response, market, since, limit) def fetch_deposits(self, code=None, since=None, limit=None, params={}): self.load_markets() currency = None request = {} if code is not None: currency = self.currency(code) request['asset'] = currency['id'] if since is not None: request['startTime'] = since response = self.wapiGetDepositHistory(self.extend(request, params)) # # { success: True, # depositList: [{insertTime: 1517425007000, # amount: 0.3, # address: "0x0123456789abcdef", # addressTag: "", # txId: "0x0123456789abcdef", # asset: "ETH", # status: 1 }]} # return self.parseTransactions(response['depositList'], currency, since, limit) def fetch_withdrawals(self, code=None, since=None, limit=None, params={}): self.load_markets() currency = None request = {} if code is not None: currency = self.currency(code) request['asset'] = currency['id'] if since is not None: request['startTime'] = since response = self.wapiGetWithdrawHistory(self.extend(request, params)) # # {withdrawList: [{ amount: 14, # address: "0x0123456789abcdef...", # successTime: 1514489710000, # addressTag: "", # txId: "0x0123456789abcdef...", # id: "0123456789abcdef...", # asset: "ETH", # applyTime: 1514488724000, # status: 6 }, # { amount: 7600, # address: "0x0123456789abcdef...", # successTime: 1515323226000, # addressTag: "", # txId: "0x0123456789abcdef...", # id: "0123456789abcdef...", # asset: "ICN", # applyTime: 1515322539000, # status: 6 } ], # success: True } # return self.parseTransactions(response['withdrawList'], currency, since, limit) def parse_transaction_status_by_type(self, status, type=None): if type is None: return status statuses = { 'deposit': { '0': 'pending', '1': 'ok', }, 'withdrawal': { '0': 'pending', # Email Sent '1': 'canceled', # Cancelled(different from 1 = ok in deposits) '2': 'pending', # Awaiting Approval '3': 'failed', # Rejected '4': 'pending', # Processing '5': 'failed', # Failure '6': 'ok', # Completed }, } return statuses[type][status] if (status in list(statuses[type].keys())) else status def parse_transaction(self, transaction, currency=None): # # fetchDeposits # {insertTime: 1517425007000, # amount: 0.3, # address: "0x0123456789abcdef", # addressTag: "", # txId: "0x0123456789abcdef", # asset: "ETH", # status: 1 } # # fetchWithdrawals # # { amount: 14, # address: "0x0123456789abcdef...", # successTime: 1514489710000, # addressTag: "", # txId: "0x0123456789abcdef...", # id: "0123456789abcdef...", # asset: "ETH", # applyTime: 1514488724000, # status: 6 } # id = self.safe_string(transaction, 'id') address = self.safe_string(transaction, 'address') tag = self.safe_string(transaction, 'addressTag') # set but unused if len(tag) < 1: tag = None txid = self.safe_value(transaction, 'txId') code = None currencyId = self.safe_string(transaction, 'asset') if currencyId in self.currencies_by_id: currency = self.currencies_by_id[currencyId] else: code = self.common_currency_code(currencyId) if currency is not None: code = currency['code'] timestamp = None insertTime = self.safe_integer(transaction, 'insertTime') applyTime = self.safe_integer(transaction, 'applyTime') type = self.safe_string(transaction, 'type') if type is None: if (insertTime is not None) and(applyTime is None): type = 'deposit' timestamp = insertTime elif (insertTime is None) and(applyTime is not None): type = 'withdrawal' timestamp = applyTime status = self.parse_transaction_status_by_type(self.safe_string(transaction, 'status'), type) amount = self.safe_float(transaction, 'amount') feeCost = None fee = { 'cost': feeCost, 'currency': code, } return { 'info': transaction, 'id': id, 'txid': txid, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'address': address, 'tag': tag, 'type': type, 'amount': amount, 'currency': code, 'status': status, 'updated': None, 'fee': fee, } def fetch_deposit_address(self, code, params={}): self.load_markets() currency = self.currency(code) response = self.wapiGetDepositAddress(self.extend({ 'asset': currency['id'], }, params)) if 'success' in response: if response['success']: address = self.safe_string(response, 'address') tag = self.safe_string(response, 'addressTag') return { 'currency': code, 'address': self.check_address(address), 'tag': tag, 'info': response, } def fetch_funding_fees(self, codes=None, params={}): response = self.wapiGetAssetDetail() # # { # "success": True, # "assetDetail": { # "CTR": { # "minWithdrawAmount": "70.00000000", #min withdraw amount # "depositStatus": False,//deposit status # "withdrawFee": 35, # withdraw fee # "withdrawStatus": True, #withdraw status # "depositTip": "Delisted, Deposit Suspended" #reason # }, # "SKY": { # "minWithdrawAmount": "0.02000000", # "depositStatus": True, # "withdrawFee": 0.01, # "withdrawStatus": True # } # } # } # detail = self.safe_value(response, 'assetDetail') ids = list(detail.keys()) withdrawFees = {} for i in range(0, len(ids)): id = ids[i] code = self.common_currency_code(id) withdrawFees[code] = self.safe_float(detail[id], 'withdrawFee') return { 'withdraw': withdrawFees, 'deposit': {}, 'info': response, } def withdraw(self, code, amount, address, tag=None, params={}): self.check_address(address) self.load_markets() currency = self.currency(code) name = address[0:20] request = { 'asset': currency['id'], 'address': address, 'amount': float(amount), 'name': name, } if tag: request['addressTag'] = tag response = self.wapiPostWithdraw(self.extend(request, params)) return { 'info': response, 'id': self.safe_string(response, 'id'), } def sign(self, path, api='public', method='GET', params={}, headers=None, body=None): url = self.urls['api'][api] url += '/' + path if api == 'wapi': url += '.html' # v1 special case for userDataStream if path == 'userDataStream': body = self.urlencode(params) headers = { 'X-MBX-APIKEY': self.apiKey, 'Content-Type': 'application/x-www-form-urlencoded', } elif (api == 'private') or (api == 'wapi'): self.check_required_credentials() query = self.urlencode(self.extend({ 'timestamp': self.nonce(), 'recvWindow': self.options['recvWindow'], }, params)) signature = self.hmac(self.encode(query), self.encode(self.secret)) query += '&' + 'signature=' + signature headers = { 'X-MBX-APIKEY': self.apiKey, } if (method == 'GET') or (method == 'DELETE') or (api == 'wapi'): url += '?' + query else: body = query headers['Content-Type'] = 'application/x-www-form-urlencoded' else: if params: url += '?' + self.urlencode(params) return {'url': url, 'method': method, 'body': body, 'headers': headers} def handle_errors(self, code, reason, url, method, headers, body): if (code == 418) or (code == 429): raise DDoSProtection(self.id + ' ' + str(code) + ' ' + reason + ' ' + body) # error response in a form: {"code": -1013, "msg": "Invalid quantity."} # following block cointains legacy checks against message patterns in "msg" property # will switch "code" checks eventually, when we know all of them if code >= 400: if body.find('Price * QTY is zero or less') >= 0: raise InvalidOrder(self.id + ' order cost = amount * price is zero or less ' + body) if body.find('LOT_SIZE') >= 0: raise InvalidOrder(self.id + ' order amount should be evenly divisible by lot size ' + body) if body.find('PRICE_FILTER') >= 0: raise InvalidOrder(self.id + ' order price is invalid, i.e. exceeds allowed price precision, exceeds min price or max price limits or is invalid float value in general, use self.price_to_precision(symbol, amount) ' + body) if len(body) > 0: if body[0] == '{': response = json.loads(body) # check success value for wapi endpoints # response in format {'msg': 'The coin does not exist.', 'success': True/false} success = self.safe_value(response, 'success', True) if not success: message = self.safe_string(response, 'msg') parsedMessage = None if message is not None: try: parsedMessage = json.loads(message) except Exception as e: # do nothing parsedMessage = None if parsedMessage is not None: response = parsedMessage # checks against error codes error = self.safe_string(response, 'code') if error is not None: exceptions = self.exceptions if error in exceptions: # a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."} # despite that their message is very confusing, it is raised by Binance # on a temporary ban(the API key is valid, but disabled for a while) if (error == '-2015') and self.options['hasAlreadyAuthenticatedSuccessfully']: raise DDoSProtection(self.id + ' temporary banned: ' + body) message = self.safe_string(response, 'msg') if message == 'Order would trigger immediately.': raise InvalidOrder(self.id + ' ' + body) elif message == 'Account has insufficient balance for requested action.': raise InsufficientFunds(self.id + ' ' + body) elif message == 'Rest API trading is not enabled.': raise ExchangeNotAvailable(self.id + ' ' + body) raise exceptions[error](self.id + ' ' + body) else: raise ExchangeError(self.id + ' ' + body) if not success: raise ExchangeError(self.id + ' ' + body) def request(self, path, api='public', method='GET', params={}, headers=None, body=None): response = self.fetch2(path, api, method, params, headers, body) # a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."} if (api == 'private') or (api == 'wapi'): self.options['hasAlreadyAuthenticatedSuccessfully'] = True return response
parse_ticker
jasper_cleanup.go
package units import ( "context" "fmt" "time" "github.com/evergreen-ci/evergreen" "github.com/mongodb/amboy" "github.com/mongodb/amboy/dependency" "github.com/mongodb/amboy/job" "github.com/mongodb/amboy/registry" ) const jasperManagerCleanupJobName = "jasper-manager-cleanup" func init()
type jasperManagerCleanup struct { job.Base `bson:"job_base" json:"job_base" yaml:"job_base"` env evergreen.Environment } // NewJasperManagerCleanup reports basic system information and a // report of the go runtime information, as provided by grip. func NewJasperManagerCleanup(id string, env evergreen.Environment) amboy.Job { j := makeJasperManagerCleanup() j.env = env j.SetID(fmt.Sprintf("%s.%s", jasperManagerCleanupJobName, id)) ti := j.TimeInfo() ti.MaxTime = time.Second j.UpdateTimeInfo(ti) return j } func makeJasperManagerCleanup() *jasperManagerCleanup { j := &jasperManagerCleanup{ Base: job.Base{ JobType: amboy.JobType{ Name: jasperManagerCleanupJobName, Version: 0, }, }, } j.SetDependency(dependency.NewAlways()) return j } func (j *jasperManagerCleanup) Run(ctx context.Context) { defer j.MarkComplete() if j.env == nil { j.env = evergreen.GetEnvironment() } j.env.JasperManager().Clear(ctx) }
{ registry.AddJobType(jasperManagerCleanupJobName, func() amboy.Job { return makeJasperManagerCleanup() }) }
serializers.go
// Code generated by smithy-go-codegen DO NOT EDIT. package evidently import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/evidently/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "math" ) type awsRestjson1_serializeOpBatchEvaluateFeature struct { } func (*awsRestjson1_serializeOpBatchEvaluateFeature) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpBatchEvaluateFeature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*BatchEvaluateFeatureInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/evaluations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsBatchEvaluateFeatureInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentBatchEvaluateFeatureInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsBatchEvaluateFeatureInput(v *BatchEvaluateFeatureInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentBatchEvaluateFeatureInput(v *BatchEvaluateFeatureInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Requests != nil { ok := object.Key("requests") if err := awsRestjson1_serializeDocumentEvaluationRequestsList(v.Requests, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateExperiment struct { } func (*awsRestjson1_serializeOpCreateExperiment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateExperimentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateExperimentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateExperimentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateExperimentInput(v *CreateExperimentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateExperimentInput(v *CreateExperimentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.MetricGoals != nil { ok := object.Key("metricGoals") if err := awsRestjson1_serializeDocumentMetricGoalConfigList(v.MetricGoals, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.OnlineAbConfig != nil { ok := object.Key("onlineAbConfig") if err := awsRestjson1_serializeDocumentOnlineAbConfig(v.OnlineAbConfig, ok); err != nil { return err } } if v.RandomizationSalt != nil { ok := object.Key("randomizationSalt") ok.String(*v.RandomizationSalt) } if v.SamplingRate != 0 { ok := object.Key("samplingRate") ok.Long(v.SamplingRate) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.Treatments != nil { ok := object.Key("treatments") if err := awsRestjson1_serializeDocumentTreatmentConfigList(v.Treatments, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateFeature struct { } func (*awsRestjson1_serializeOpCreateFeature) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateFeature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateFeatureInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/features") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateFeatureInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateFeatureInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateFeatureInput(v *CreateFeatureInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateFeatureInput(v *CreateFeatureInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DefaultVariation != nil { ok := object.Key("defaultVariation") ok.String(*v.DefaultVariation) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.EntityOverrides != nil { ok := object.Key("entityOverrides") if err := awsRestjson1_serializeDocumentEntityOverrideMap(v.EntityOverrides, ok); err != nil { return err } } if len(v.EvaluationStrategy) > 0 { ok := object.Key("evaluationStrategy") ok.String(string(v.EvaluationStrategy)) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if v.Variations != nil { ok := object.Key("variations") if err := awsRestjson1_serializeDocumentVariationConfigsList(v.Variations, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateLaunch struct { } func (*awsRestjson1_serializeOpCreateLaunch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateLaunch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateLaunchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/launches") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateLaunchInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateLaunchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateLaunchInput(v *CreateLaunchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateLaunchInput(v *CreateLaunchInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Groups != nil { ok := object.Key("groups") if err := awsRestjson1_serializeDocumentLaunchGroupConfigList(v.Groups, ok); err != nil { return err } } if v.MetricMonitors != nil { ok := object.Key("metricMonitors") if err := awsRestjson1_serializeDocumentMetricMonitorConfigList(v.MetricMonitors, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RandomizationSalt != nil { ok := object.Key("randomizationSalt") ok.String(*v.RandomizationSalt) } if v.ScheduledSplitsConfig != nil { ok := object.Key("scheduledSplitsConfig") if err := awsRestjson1_serializeDocumentScheduledSplitsLaunchConfig(v.ScheduledSplitsConfig, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateProject struct { } func (*awsRestjson1_serializeOpCreateProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateProjectInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataDelivery != nil { ok := object.Key("dataDelivery") if err := awsRestjson1_serializeDocumentProjectDataDeliveryConfig(v.DataDelivery, ok); err != nil { return err } } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteExperiment struct { } func (*awsRestjson1_serializeOpDeleteExperiment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteExperimentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments/{experiment}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteExperimentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteExperimentInput(v *DeleteExperimentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Experiment == nil || len(*v.Experiment) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member experiment must not be empty")} } if v.Experiment != nil { if err := encoder.SetURI("experiment").String(*v.Experiment); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteFeature struct { } func (*awsRestjson1_serializeOpDeleteFeature) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteFeature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteFeatureInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/features/{feature}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteFeatureInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteFeatureInput(v *DeleteFeatureInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Feature == nil || len(*v.Feature) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member feature must not be empty")} } if v.Feature != nil { if err := encoder.SetURI("feature").String(*v.Feature); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteLaunch struct { } func (*awsRestjson1_serializeOpDeleteLaunch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteLaunch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteLaunchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/launches/{launch}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteLaunchInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteLaunchInput(v *DeleteLaunchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Launch == nil || len(*v.Launch) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member launch must not be empty")} } if v.Launch != nil { if err := encoder.SetURI("launch").String(*v.Launch); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteProject struct { } func (*awsRestjson1_serializeOpDeleteProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(v *DeleteProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpEvaluateFeature struct { } func (*awsRestjson1_serializeOpEvaluateFeature) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEvaluateFeature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EvaluateFeatureInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/evaluations/{feature}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsEvaluateFeatureInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentEvaluateFeatureInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsEvaluateFeatureInput(v *EvaluateFeatureInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Feature == nil || len(*v.Feature) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member feature must not be empty")} } if v.Feature != nil { if err := encoder.SetURI("feature").String(*v.Feature); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentEvaluateFeatureInput(v *EvaluateFeatureInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EntityId != nil { ok := object.Key("entityId") ok.String(*v.EntityId) } if v.EvaluationContext != nil { ok := object.Key("evaluationContext") ok.String(*v.EvaluationContext) } return nil } type awsRestjson1_serializeOpGetExperiment struct { } func (*awsRestjson1_serializeOpGetExperiment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetExperimentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments/{experiment}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetExperimentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetExperimentInput(v *GetExperimentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Experiment == nil || len(*v.Experiment) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member experiment must not be empty")} } if v.Experiment != nil { if err := encoder.SetURI("experiment").String(*v.Experiment); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetExperimentResults struct { } func (*awsRestjson1_serializeOpGetExperimentResults) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetExperimentResults) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetExperimentResultsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments/{experiment}/results") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetExperimentResultsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentGetExperimentResultsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetExperimentResultsInput(v *GetExperimentResultsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Experiment == nil || len(*v.Experiment) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member experiment must not be empty")} } if v.Experiment != nil { if err := encoder.SetURI("experiment").String(*v.Experiment); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentGetExperimentResultsInput(v *GetExperimentResultsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.BaseStat) > 0 { ok := object.Key("baseStat") ok.String(string(v.BaseStat)) } if v.EndTime != nil { ok := object.Key("endTime") ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) } if v.MetricNames != nil { ok := object.Key("metricNames") if err := awsRestjson1_serializeDocumentMetricNameList(v.MetricNames, ok); err != nil { return err } } if v.Period != 0 { ok := object.Key("period") ok.Long(v.Period) } if v.ReportNames != nil { ok := object.Key("reportNames") if err := awsRestjson1_serializeDocumentExperimentReportNameList(v.ReportNames, ok); err != nil { return err } } if v.ResultStats != nil { ok := object.Key("resultStats") if err := awsRestjson1_serializeDocumentExperimentResultRequestTypeList(v.ResultStats, ok); err != nil { return err } } if v.StartTime != nil { ok := object.Key("startTime") ok.Double(smithytime.FormatEpochSeconds(*v.StartTime)) } if v.TreatmentNames != nil { ok := object.Key("treatmentNames") if err := awsRestjson1_serializeDocumentTreatmentNameList(v.TreatmentNames, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetFeature struct { } func (*awsRestjson1_serializeOpGetFeature) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetFeature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetFeatureInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/features/{feature}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetFeatureInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetFeatureInput(v *GetFeatureInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Feature == nil || len(*v.Feature) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member feature must not be empty")} } if v.Feature != nil { if err := encoder.SetURI("feature").String(*v.Feature); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetLaunch struct { } func (*awsRestjson1_serializeOpGetLaunch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetLaunch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetLaunchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/launches/{launch}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetLaunchInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetLaunchInput(v *GetLaunchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Launch == nil || len(*v.Launch) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member launch must not be empty")} } if v.Launch != nil { if err := encoder.SetURI("launch").String(*v.Launch); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetProject struct { } func (*awsRestjson1_serializeOpGetProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetProjectInput(v *GetProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpListExperiments struct { } func (*awsRestjson1_serializeOpListExperiments) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListExperiments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListExperimentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListExperimentsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListExperimentsInput(v *ListExperimentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } if len(v.Status) > 0 { encoder.SetQuery("status").String(string(v.Status)) } return nil } type awsRestjson1_serializeOpListFeatures struct { } func (*awsRestjson1_serializeOpListFeatures) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListFeatures) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListFeaturesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/features") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListFeaturesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListFeaturesInput(v *ListFeaturesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpListLaunches struct { } func (*awsRestjson1_serializeOpListLaunches) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListLaunches) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListLaunchesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/launches") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListLaunchesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListLaunchesInput(v *ListLaunchesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } if len(v.Status) > 0 { encoder.SetQuery("status").String(string(v.Status)) } return nil } type awsRestjson1_serializeOpListProjects struct { } func (*awsRestjson1_serializeOpListProjects) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListProjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListProjectsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListProjectsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpPutProjectEvents struct { } func (*awsRestjson1_serializeOpPutProjectEvents) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutProjectEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutProjectEventsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/events/projects/{project}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsPutProjectEventsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutProjectEventsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsPutProjectEventsInput(v *PutProjectEventsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentPutProjectEventsInput(v *PutProjectEventsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Events != nil { ok := object.Key("events") if err := awsRestjson1_serializeDocumentEventList(v.Events, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartExperiment struct { } func (*awsRestjson1_serializeOpStartExperiment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartExperimentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments/{experiment}/start") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStartExperimentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartExperimentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStartExperimentInput(v *StartExperimentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Experiment == nil || len(*v.Experiment) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member experiment must not be empty")} } if v.Experiment != nil { if err := encoder.SetURI("experiment").String(*v.Experiment); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentStartExperimentInput(v *StartExperimentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AnalysisCompleteTime != nil { ok := object.Key("analysisCompleteTime") ok.Double(smithytime.FormatEpochSeconds(*v.AnalysisCompleteTime)) } return nil } type awsRestjson1_serializeOpStartLaunch struct { } func (*awsRestjson1_serializeOpStartLaunch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartLaunch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartLaunchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/launches/{launch}/start") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStartLaunchInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStartLaunchInput(v *StartLaunchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Launch == nil || len(*v.Launch) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member launch must not be empty")} } if v.Launch != nil { if err := encoder.SetURI("launch").String(*v.Launch); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } type awsRestjson1_serializeOpStopExperiment struct { } func (*awsRestjson1_serializeOpStopExperiment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopExperimentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments/{experiment}/cancel") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStopExperimentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStopExperimentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStopExperimentInput(v *StopExperimentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Experiment == nil || len(*v.Experiment) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member experiment must not be empty")} } if v.Experiment != nil { if err := encoder.SetURI("experiment").String(*v.Experiment); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentStopExperimentInput(v *StopExperimentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DesiredState) > 0 { ok := object.Key("desiredState") ok.String(string(v.DesiredState)) } if v.Reason != nil { ok := object.Key("reason") ok.String(*v.Reason) } return nil } type awsRestjson1_serializeOpStopLaunch struct { } func (*awsRestjson1_serializeOpStopLaunch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopLaunch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopLaunchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/launches/{launch}/cancel") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsStopLaunchInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStopLaunchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStopLaunchInput(v *StopLaunchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Launch == nil || len(*v.Launch) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member launch must not be empty")} } if v.Launch != nil { if err := encoder.SetURI("launch").String(*v.Launch); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentStopLaunchInput(v *StopLaunchInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DesiredState) > 0 { ok := object.Key("desiredState") ok.String(string(v.DesiredState)) } if v.Reason != nil { ok := object.Key("reason") ok.String(*v.Reason) } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateExperiment struct { } func (*awsRestjson1_serializeOpUpdateExperiment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateExperimentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/experiments/{experiment}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateExperimentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateExperimentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateExperimentInput(v *UpdateExperimentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Experiment == nil || len(*v.Experiment) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member experiment must not be empty")} } if v.Experiment != nil { if err := encoder.SetURI("experiment").String(*v.Experiment); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateExperimentInput(v *UpdateExperimentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.MetricGoals != nil { ok := object.Key("metricGoals") if err := awsRestjson1_serializeDocumentMetricGoalConfigList(v.MetricGoals, ok); err != nil { return err } } if v.OnlineAbConfig != nil { ok := object.Key("onlineAbConfig") if err := awsRestjson1_serializeDocumentOnlineAbConfig(v.OnlineAbConfig, ok); err != nil { return err } } if v.RandomizationSalt != nil { ok := object.Key("randomizationSalt") ok.String(*v.RandomizationSalt) } if v.SamplingRate != 0 { ok := object.Key("samplingRate") ok.Long(v.SamplingRate) } if v.Treatments != nil { ok := object.Key("treatments") if err := awsRestjson1_serializeDocumentTreatmentConfigList(v.Treatments, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateFeature struct { } func (*awsRestjson1_serializeOpUpdateFeature) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateFeature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateFeatureInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/features/{feature}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateFeatureInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateFeatureInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateFeatureInput(v *UpdateFeatureInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Feature == nil || len(*v.Feature) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member feature must not be empty")} } if v.Feature != nil { if err := encoder.SetURI("feature").String(*v.Feature); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateFeatureInput(v *UpdateFeatureInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AddOrUpdateVariations != nil { ok := object.Key("addOrUpdateVariations") if err := awsRestjson1_serializeDocumentVariationConfigsList(v.AddOrUpdateVariations, ok); err != nil { return err } } if v.DefaultVariation != nil { ok := object.Key("defaultVariation") ok.String(*v.DefaultVariation) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.EntityOverrides != nil { ok := object.Key("entityOverrides") if err := awsRestjson1_serializeDocumentEntityOverrideMap(v.EntityOverrides, ok); err != nil { return err } } if len(v.EvaluationStrategy) > 0 { ok := object.Key("evaluationStrategy") ok.String(string(v.EvaluationStrategy)) } if v.RemoveVariations != nil { ok := object.Key("removeVariations") if err := awsRestjson1_serializeDocumentVariationNameList(v.RemoveVariations, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateLaunch struct { } func (*awsRestjson1_serializeOpUpdateLaunch) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateLaunch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateLaunchInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/launches/{launch}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateLaunchInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateLaunchInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateLaunchInput(v *UpdateLaunchInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Launch == nil || len(*v.Launch) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member launch must not be empty")} } if v.Launch != nil { if err := encoder.SetURI("launch").String(*v.Launch); err != nil { return err } } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateLaunchInput(v *UpdateLaunchInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Groups != nil { ok := object.Key("groups") if err := awsRestjson1_serializeDocumentLaunchGroupConfigList(v.Groups, ok); err != nil { return err } } if v.MetricMonitors != nil { ok := object.Key("metricMonitors") if err := awsRestjson1_serializeDocumentMetricMonitorConfigList(v.MetricMonitors, ok); err != nil { return err } } if v.RandomizationSalt != nil { ok := object.Key("randomizationSalt") ok.String(*v.RandomizationSalt) } if v.ScheduledSplitsConfig != nil { ok := object.Key("scheduledSplitsConfig") if err := awsRestjson1_serializeDocumentScheduledSplitsLaunchConfig(v.ScheduledSplitsConfig, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateProject struct { } func (*awsRestjson1_serializeOpUpdateProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateProjectInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(v *UpdateProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateProjectInput(v *UpdateProjectInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } return nil } type awsRestjson1_serializeOpUpdateProjectDataDelivery struct { } func (*awsRestjson1_serializeOpUpdateProjectDataDelivery) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateProjectDataDelivery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateProjectDataDeliveryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/projects/{project}/data-delivery") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateProjectDataDeliveryInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateProjectDataDeliveryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateProjectDataDeliveryInput(v *UpdateProjectDataDeliveryInput, encoder *httpbinding.Encoder) error
func awsRestjson1_serializeOpDocumentUpdateProjectDataDeliveryInput(v *UpdateProjectDataDeliveryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloudWatchLogs != nil { ok := object.Key("cloudWatchLogs") if err := awsRestjson1_serializeDocumentCloudWatchLogsDestinationConfig(v.CloudWatchLogs, ok); err != nil { return err } } if v.S3Destination != nil { ok := object.Key("s3Destination") if err := awsRestjson1_serializeDocumentS3DestinationConfig(v.S3Destination, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCloudWatchLogsDestinationConfig(v *types.CloudWatchLogsDestinationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LogGroup != nil { ok := object.Key("logGroup") ok.String(*v.LogGroup) } return nil } func awsRestjson1_serializeDocumentEntityOverrideMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentEvaluationRequest(v *types.EvaluationRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EntityId != nil { ok := object.Key("entityId") ok.String(*v.EntityId) } if v.EvaluationContext != nil { ok := object.Key("evaluationContext") ok.String(*v.EvaluationContext) } if v.Feature != nil { ok := object.Key("feature") ok.String(*v.Feature) } return nil } func awsRestjson1_serializeDocumentEvaluationRequestsList(v []types.EvaluationRequest, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentEvaluationRequest(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentEvent(v *types.Event, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Data != nil { ok := object.Key("data") ok.String(*v.Data) } if v.Timestamp != nil { ok := object.Key("timestamp") ok.Double(smithytime.FormatEpochSeconds(*v.Timestamp)) } if len(v.Type) > 0 { ok := object.Key("type") ok.String(string(v.Type)) } return nil } func awsRestjson1_serializeDocumentEventList(v []types.Event, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentEvent(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentExperimentReportNameList(v []types.ExperimentReportName, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentExperimentResultRequestTypeList(v []types.ExperimentResultRequestType, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsRestjson1_serializeDocumentGroupToWeightMap(v map[string]int64, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.Long(v[key]) } return nil } func awsRestjson1_serializeDocumentLaunchGroupConfig(v *types.LaunchGroupConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Feature != nil { ok := object.Key("feature") ok.String(*v.Feature) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Variation != nil { ok := object.Key("variation") ok.String(*v.Variation) } return nil } func awsRestjson1_serializeDocumentLaunchGroupConfigList(v []types.LaunchGroupConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentLaunchGroupConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMetricDefinitionConfig(v *types.MetricDefinitionConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EntityIdKey != nil { ok := object.Key("entityIdKey") ok.String(*v.EntityIdKey) } if v.EventPattern != nil { ok := object.Key("eventPattern") ok.String(*v.EventPattern) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.UnitLabel != nil { ok := object.Key("unitLabel") ok.String(*v.UnitLabel) } if v.ValueKey != nil { ok := object.Key("valueKey") ok.String(*v.ValueKey) } return nil } func awsRestjson1_serializeDocumentMetricGoalConfig(v *types.MetricGoalConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.DesiredChange) > 0 { ok := object.Key("desiredChange") ok.String(string(v.DesiredChange)) } if v.MetricDefinition != nil { ok := object.Key("metricDefinition") if err := awsRestjson1_serializeDocumentMetricDefinitionConfig(v.MetricDefinition, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMetricGoalConfigList(v []types.MetricGoalConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentMetricGoalConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMetricMonitorConfig(v *types.MetricMonitorConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MetricDefinition != nil { ok := object.Key("metricDefinition") if err := awsRestjson1_serializeDocumentMetricDefinitionConfig(v.MetricDefinition, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMetricMonitorConfigList(v []types.MetricMonitorConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentMetricMonitorConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMetricNameList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentOnlineAbConfig(v *types.OnlineAbConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ControlTreatmentName != nil { ok := object.Key("controlTreatmentName") ok.String(*v.ControlTreatmentName) } if v.TreatmentWeights != nil { ok := object.Key("treatmentWeights") if err := awsRestjson1_serializeDocumentTreatmentToWeightMap(v.TreatmentWeights, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentProjectDataDeliveryConfig(v *types.ProjectDataDeliveryConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloudWatchLogs != nil { ok := object.Key("cloudWatchLogs") if err := awsRestjson1_serializeDocumentCloudWatchLogsDestinationConfig(v.CloudWatchLogs, ok); err != nil { return err } } if v.S3Destination != nil { ok := object.Key("s3Destination") if err := awsRestjson1_serializeDocumentS3DestinationConfig(v.S3Destination, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentS3DestinationConfig(v *types.S3DestinationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("bucket") ok.String(*v.Bucket) } if v.Prefix != nil { ok := object.Key("prefix") ok.String(*v.Prefix) } return nil } func awsRestjson1_serializeDocumentScheduledSplitConfig(v *types.ScheduledSplitConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.GroupWeights != nil { ok := object.Key("groupWeights") if err := awsRestjson1_serializeDocumentGroupToWeightMap(v.GroupWeights, ok); err != nil { return err } } if v.StartTime != nil { ok := object.Key("startTime") ok.Double(smithytime.FormatEpochSeconds(*v.StartTime)) } return nil } func awsRestjson1_serializeDocumentScheduledSplitConfigList(v []types.ScheduledSplitConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentScheduledSplitConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentScheduledSplitsLaunchConfig(v *types.ScheduledSplitsLaunchConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Steps != nil { ok := object.Key("steps") if err := awsRestjson1_serializeDocumentScheduledSplitConfigList(v.Steps, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentTreatmentConfig(v *types.TreatmentConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Feature != nil { ok := object.Key("feature") ok.String(*v.Feature) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Variation != nil { ok := object.Key("variation") ok.String(*v.Variation) } return nil } func awsRestjson1_serializeDocumentTreatmentConfigList(v []types.TreatmentConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTreatmentConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTreatmentNameList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTreatmentToWeightMap(v map[string]int64, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.Long(v[key]) } return nil } func awsRestjson1_serializeDocumentVariableValue(v types.VariableValue, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.VariableValueMemberBoolValue: av := object.Key("boolValue") av.Boolean(uv.Value) case *types.VariableValueMemberDoubleValue: av := object.Key("doubleValue") switch { case math.IsNaN(uv.Value): av.String("NaN") case math.IsInf(uv.Value, 1): av.String("Infinity") case math.IsInf(uv.Value, -1): av.String("-Infinity") default: av.Double(uv.Value) } case *types.VariableValueMemberLongValue: av := object.Key("longValue") av.Long(uv.Value) case *types.VariableValueMemberStringValue: av := object.Key("stringValue") av.String(uv.Value) default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentVariationConfig(v *types.VariationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Value != nil { ok := object.Key("value") if err := awsRestjson1_serializeDocumentVariableValue(v.Value, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVariationConfigsList(v []types.VariationConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentVariationConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVariationNameList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil }
{ if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Project == nil || len(*v.Project) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member project must not be empty")} } if v.Project != nil { if err := encoder.SetURI("project").String(*v.Project); err != nil { return err } } return nil }
selfishagentv4.py
import numpy as np class SelfishAgent(object): def __init__(self, T): self.T = T self.policy = np.asarray([ [0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 2, 2, 0, 0, 0, 0, 0, 0], [2, 1, 2, 2, 2, 0, 0, 0, 0], [2, 2, 1, 2, 2, 2, 0, 0, 0], [2, 2, 2, 1, 2, 2, 2, 0, 0], [2, 2, 2, 2, 1, 2, 2, 2, 0], [2, 2, 2, 2, 2, 1, 2, 2, 0], [2, 2, 2, 2, 2, 2, 1, 2, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1] ]) def act(self, state): a, h = state if h == self.T: return 'adopt' if a == self.T: return 'override' if h > a:
# if (h == a) and (h == 1): # return 'match' if (h == a-1) and (h >= 1): return 'override' return 'wait' def act2(self, state): action = self.policy[state] if action == 0: return 'adopt' if action == 1: return 'override' return 'wait'
return 'adopt'
androidpublisher-gen.go
// Copyright 2021 Google LLC. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated file. DO NOT EDIT. // Package androidpublisher provides access to the Google Play Android Developer API. // // For product documentation, see: https://developers.google.com/android-publisher // // Creating a client // // Usage example: // // import "google.golang.org/api/androidpublisher/v3" // ... // ctx := context.Background() // androidpublisherService, err := androidpublisher.NewService(ctx) // // In this example, Google Application Default Credentials are used for authentication. // // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // Other authentication options // // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: // // androidpublisherService, err := androidpublisher.NewService(ctx, option.WithAPIKey("AIza...")) // // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // androidpublisherService, err := androidpublisher.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // // See https://godoc.org/google.golang.org/api/option/ for details on options. package androidpublisher // import "google.golang.org/api/androidpublisher/v3" import ( "bytes" "context" "encoding/json" "errors" "fmt" "io" "net/http" "net/url" "strconv" "strings" googleapi "google.golang.org/api/googleapi" gensupport "google.golang.org/api/internal/gensupport" option "google.golang.org/api/option" internaloption "google.golang.org/api/option/internaloption" htransport "google.golang.org/api/transport/http" ) // Always reference these packages, just in case the auto-generated code // below doesn't. var _ = bytes.NewBuffer var _ = strconv.Itoa var _ = fmt.Sprintf var _ = json.NewDecoder var _ = io.Copy var _ = url.Parse var _ = gensupport.MarshalJSON var _ = googleapi.Version var _ = errors.New var _ = strings.Replace var _ = context.Canceled var _ = internaloption.WithDefaultEndpoint const apiId = "androidpublisher:v3" const apiName = "androidpublisher" const apiVersion = "v3" const basePath = "https://androidpublisher.googleapis.com/" const mtlsBasePath = "https://androidpublisher.mtls.googleapis.com/" // OAuth2 scopes used by this API. const ( // View and manage your Google Play Developer account AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher" ) // NewService creates a new Service. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { scopesOption := option.WithScopes( "https://www.googleapis.com/auth/androidpublisher", ) // NOTE: prepend, so we don't override user-specified scopes. opts = append([]option.ClientOption{scopesOption}, opts...) opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err } s, err := New(client) if err != nil { return nil, err } if endpoint != "" { s.BasePath = endpoint } return s, nil } // New creates a new Service. It uses the provided http.Client for requests. // // Deprecated: please use NewService instead. // To provide a custom HTTP client, use option.WithHTTPClient. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. func New(client *http.Client) (*Service, error) { if client == nil { return nil, errors.New("client is nil") } s := &Service{client: client, BasePath: basePath} s.Edits = NewEditsService(s) s.Grants = NewGrantsService(s) s.Inappproducts = NewInappproductsService(s) s.Internalappsharingartifacts = NewInternalappsharingartifactsService(s) s.Monetization = NewMonetizationService(s) s.Orders = NewOrdersService(s) s.Purchases = NewPurchasesService(s) s.Reviews = NewReviewsService(s) s.Systemapks = NewSystemapksService(s) s.Users = NewUsersService(s) return s, nil } type Service struct { client *http.Client BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Edits *EditsService Grants *GrantsService Inappproducts *InappproductsService Internalappsharingartifacts *InternalappsharingartifactsService Monetization *MonetizationService Orders *OrdersService Purchases *PurchasesService Reviews *ReviewsService Systemapks *SystemapksService Users *UsersService } func (s *Service) userAgent() string { if s.UserAgent == "" { return googleapi.UserAgent } return googleapi.UserAgent + " " + s.UserAgent } func NewEditsService(s *Service) *EditsService { rs := &EditsService{s: s} rs.Apks = NewEditsApksService(s) rs.Bundles = NewEditsBundlesService(s) rs.Deobfuscationfiles = NewEditsDeobfuscationfilesService(s) rs.Details = NewEditsDetailsService(s) rs.Expansionfiles = NewEditsExpansionfilesService(s) rs.Images = NewEditsImagesService(s) rs.Listings = NewEditsListingsService(s) rs.Testers = NewEditsTestersService(s) rs.Tracks = NewEditsTracksService(s) return rs } type EditsService struct { s *Service Apks *EditsApksService Bundles *EditsBundlesService Deobfuscationfiles *EditsDeobfuscationfilesService Details *EditsDetailsService Expansionfiles *EditsExpansionfilesService Images *EditsImagesService Listings *EditsListingsService Testers *EditsTestersService Tracks *EditsTracksService } func NewEditsApksService(s *Service) *EditsApksService { rs := &EditsApksService{s: s} return rs } type EditsApksService struct { s *Service } func NewEditsBundlesService(s *Service) *EditsBundlesService { rs := &EditsBundlesService{s: s} return rs } type EditsBundlesService struct { s *Service } func NewEditsDeobfuscationfilesService(s *Service) *EditsDeobfuscationfilesService { rs := &EditsDeobfuscationfilesService{s: s} return rs } type EditsDeobfuscationfilesService struct { s *Service } func NewEditsDetailsService(s *Service) *EditsDetailsService { rs := &EditsDetailsService{s: s} return rs } type EditsDetailsService struct { s *Service } func NewEditsExpansionfilesService(s *Service) *EditsExpansionfilesService { rs := &EditsExpansionfilesService{s: s} return rs } type EditsExpansionfilesService struct { s *Service } func NewEditsImagesService(s *Service) *EditsImagesService { rs := &EditsImagesService{s: s} return rs } type EditsImagesService struct { s *Service } func NewEditsListingsService(s *Service) *EditsListingsService { rs := &EditsListingsService{s: s} return rs } type EditsListingsService struct { s *Service } func NewEditsTestersService(s *Service) *EditsTestersService { rs := &EditsTestersService{s: s} return rs } type EditsTestersService struct { s *Service } func NewEditsTracksService(s *Service) *EditsTracksService { rs := &EditsTracksService{s: s} return rs } type EditsTracksService struct { s *Service } func NewGrantsService(s *Service) *GrantsService { rs := &GrantsService{s: s} return rs } type GrantsService struct { s *Service } func NewInappproductsService(s *Service) *InappproductsService { rs := &InappproductsService{s: s} return rs } type InappproductsService struct { s *Service } func NewInternalappsharingartifactsService(s *Service) *InternalappsharingartifactsService { rs := &InternalappsharingartifactsService{s: s} return rs } type InternalappsharingartifactsService struct { s *Service } func NewMonetizationService(s *Service) *MonetizationService { rs := &MonetizationService{s: s} return rs } type MonetizationService struct { s *Service } func NewOrdersService(s *Service) *OrdersService { rs := &OrdersService{s: s} return rs } type OrdersService struct { s *Service } func NewPurchasesService(s *Service) *PurchasesService { rs := &PurchasesService{s: s} rs.Products = NewPurchasesProductsService(s) rs.Subscriptions = NewPurchasesSubscriptionsService(s) rs.Voidedpurchases = NewPurchasesVoidedpurchasesService(s) return rs } type PurchasesService struct { s *Service Products *PurchasesProductsService Subscriptions *PurchasesSubscriptionsService Voidedpurchases *PurchasesVoidedpurchasesService } func NewPurchasesProductsService(s *Service) *PurchasesProductsService { rs := &PurchasesProductsService{s: s} return rs } type PurchasesProductsService struct { s *Service } func NewPurchasesSubscriptionsService(s *Service) *PurchasesSubscriptionsService { rs := &PurchasesSubscriptionsService{s: s} return rs } type PurchasesSubscriptionsService struct { s *Service } func NewPurchasesVoidedpurchasesService(s *Service) *PurchasesVoidedpurchasesService { rs := &PurchasesVoidedpurchasesService{s: s} return rs } type PurchasesVoidedpurchasesService struct { s *Service } func NewReviewsService(s *Service) *ReviewsService { rs := &ReviewsService{s: s} return rs } type ReviewsService struct { s *Service } func NewSystemapksService(s *Service) *SystemapksService { rs := &SystemapksService{s: s} rs.Variants = NewSystemapksVariantsService(s) return rs } type SystemapksService struct { s *Service Variants *SystemapksVariantsService } func NewSystemapksVariantsService(s *Service) *SystemapksVariantsService { rs := &SystemapksVariantsService{s: s} return rs } type SystemapksVariantsService struct { s *Service } func NewUsersService(s *Service) *UsersService { rs := &UsersService{s: s} return rs } type UsersService struct { s *Service } // Apk: Information about an APK. The resource for ApksService. type Apk struct { // Binary: Information about the binary payload of this APK. Binary *ApkBinary `json:"binary,omitempty"` // VersionCode: The version code of the APK, as specified in the // manifest file. VersionCode int64 `json:"versionCode,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Binary") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Binary") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Apk) MarshalJSON() ([]byte, error) { type NoMethod Apk raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ApkBinary: Represents the binary payload of an APK. type ApkBinary struct { // Sha1: A sha1 hash of the APK payload, encoded as a hex string and // matching the output of the sha1sum command. Sha1 string `json:"sha1,omitempty"` // Sha256: A sha256 hash of the APK payload, encoded as a hex string and // matching the output of the sha256sum command. Sha256 string `json:"sha256,omitempty"` // ForceSendFields is a list of field names (e.g. "Sha1") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Sha1") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ApkBinary) MarshalJSON() ([]byte, error) { type NoMethod ApkBinary raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ApksAddExternallyHostedRequest: Request to create a new externally // hosted APK. type ApksAddExternallyHostedRequest struct { // ExternallyHostedApk: The definition of the externally-hosted APK and // where it is located. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"` // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ExternallyHostedApk") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *ApksAddExternallyHostedRequest) MarshalJSON() ([]byte, error) { type NoMethod ApksAddExternallyHostedRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ApksAddExternallyHostedResponse: Response for creating a new // externally hosted APK. type ApksAddExternallyHostedResponse struct { // ExternallyHostedApk: The definition of the externally-hosted APK and // where it is located. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ExternallyHostedApk") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *ApksAddExternallyHostedResponse) MarshalJSON() ([]byte, error) { type NoMethod ApksAddExternallyHostedResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ApksListResponse: Response listing all APKs. type ApksListResponse struct { // Apks: All APKs. Apks []*Apk `json:"apks,omitempty"` // Kind: The kind of this response // ("androidpublisher#apksListResponse"). Kind string `json:"kind,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Apks") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Apks") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ApksListResponse) MarshalJSON() ([]byte, error) { type NoMethod ApksListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // AppDetails: The app details. The resource for DetailsService. type AppDetails struct { // ContactEmail: The user-visible support email for this app. ContactEmail string `json:"contactEmail,omitempty"` // ContactPhone: The user-visible support telephone number for this app. ContactPhone string `json:"contactPhone,omitempty"` // ContactWebsite: The user-visible website for this app. ContactWebsite string `json:"contactWebsite,omitempty"` // DefaultLanguage: Default language code, in BCP 47 format (eg // "en-US"). DefaultLanguage string `json:"defaultLanguage,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "ContactEmail") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ContactEmail") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *AppDetails) MarshalJSON() ([]byte, error) { type NoMethod AppDetails raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // AppEdit: An app edit. The resource for EditsService. type AppEdit struct { // ExpiryTimeSeconds: Output only. The time (as seconds since Epoch) at // which the edit will expire and will be no longer valid for use. ExpiryTimeSeconds string `json:"expiryTimeSeconds,omitempty"` // Id: Output only. Identifier of the edit. Can be used in subsequent // API calls. Id string `json:"id,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "ExpiryTimeSeconds") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ExpiryTimeSeconds") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *AppEdit) MarshalJSON() ([]byte, error) { type NoMethod AppEdit raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Bundle: Information about an app bundle. The resource for // BundlesService. type Bundle struct { // Sha1: A sha1 hash of the upload payload, encoded as a hex string and // matching the output of the sha1sum command. Sha1 string `json:"sha1,omitempty"` // Sha256: A sha256 hash of the upload payload, encoded as a hex string // and matching the output of the sha256sum command. Sha256 string `json:"sha256,omitempty"` // VersionCode: The version code of the Android App Bundle, as specified // in the Android App Bundle's base module APK manifest file. VersionCode int64 `json:"versionCode,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Sha1") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Sha1") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Bundle) MarshalJSON() ([]byte, error) { type NoMethod Bundle raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // BundlesListResponse: Response listing all app bundles. type BundlesListResponse struct { // Bundles: All app bundles. Bundles []*Bundle `json:"bundles,omitempty"` // Kind: The kind of this response // ("androidpublisher#bundlesListResponse"). Kind string `json:"kind,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Bundles") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Bundles") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *BundlesListResponse) MarshalJSON() ([]byte, error) { type NoMethod BundlesListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Comment: An entry of conversation between user and developer. type Comment struct { // DeveloperComment: A comment from a developer. DeveloperComment *DeveloperComment `json:"developerComment,omitempty"` // UserComment: A comment from a user. UserComment *UserComment `json:"userComment,omitempty"` // ForceSendFields is a list of field names (e.g. "DeveloperComment") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DeveloperComment") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *Comment) MarshalJSON() ([]byte, error) { type NoMethod Comment raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ConvertRegionPricesRequest: Request message for ConvertRegionPrices. type ConvertRegionPricesRequest struct { // Price: The intital price to convert other regions from. Tax // exclusive. Price *Money `json:"price,omitempty"` // ForceSendFields is a list of field names (e.g. "Price") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Price") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ConvertRegionPricesRequest) MarshalJSON() ([]byte, error) { type NoMethod ConvertRegionPricesRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ConvertRegionPricesResponse: Response message for // ConvertRegionPrices. type ConvertRegionPricesResponse struct { // ConvertedOtherRegionsPrice: Converted other regions prices in USD and // EUR, to use for countries where Play doesn't support a country's // local currency. ConvertedOtherRegionsPrice *ConvertedOtherRegionsPrice `json:"convertedOtherRegionsPrice,omitempty"` // ConvertedRegionPrices: Map from region code to converted region // price. ConvertedRegionPrices map[string]ConvertedRegionPrice `json:"convertedRegionPrices,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. // "ConvertedOtherRegionsPrice") to unconditionally include in API // requests. By default, fields with empty or default values are omitted // from API requests. However, any non-pointer, non-interface field // appearing in ForceSendFields will be sent to the server regardless of // whether the field is empty or not. This may be used to include empty // fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. // "ConvertedOtherRegionsPrice") to include in API requests with the // JSON null value. By default, fields with empty values are omitted // from API requests. However, any field with an empty value appearing // in NullFields will be sent to the server as null. It is an error if a // field in this list has a non-empty value. This may be used to include // null fields in Patch requests. NullFields []string `json:"-"` } func (s *ConvertRegionPricesResponse) MarshalJSON() ([]byte, error) { type NoMethod ConvertRegionPricesResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ConvertedOtherRegionsPrice: Converted other regions prices. type ConvertedOtherRegionsPrice struct { // EurPrice: Price in EUR to use for the "Other regions" location // exclusive of taxes. EurPrice *Money `json:"eurPrice,omitempty"` // UsdPrice: Price in USD to use for the "Other regions" location // exclusive of taxes. UsdPrice *Money `json:"usdPrice,omitempty"` // ForceSendFields is a list of field names (e.g. "EurPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "EurPrice") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ConvertedOtherRegionsPrice) MarshalJSON() ([]byte, error) { type NoMethod ConvertedOtherRegionsPrice raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ConvertedRegionPrice: A converted region price. type ConvertedRegionPrice struct { // Price: The converted price tax inclusive. Price *Money `json:"price,omitempty"` // RegionCode: The region code of the region. RegionCode string `json:"regionCode,omitempty"` // TaxAmount: The tax amount of the converted price. TaxAmount *Money `json:"taxAmount,omitempty"` // ForceSendFields is a list of field names (e.g. "Price") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Price") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ConvertedRegionPrice) MarshalJSON() ([]byte, error) { type NoMethod ConvertedRegionPrice raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // CountryTargeting: Country targeting specification. type CountryTargeting struct { // Countries: Countries to target, specified as two letter CLDR codes // (https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html). Countries []string `json:"countries,omitempty"` // IncludeRestOfWorld: Include "rest of world" as well as explicitly // targeted countries. IncludeRestOfWorld bool `json:"includeRestOfWorld,omitempty"` // ForceSendFields is a list of field names (e.g. "Countries") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Countries") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *CountryTargeting) MarshalJSON() ([]byte, error) { type NoMethod CountryTargeting raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // DeobfuscationFile: Represents a deobfuscation file. type DeobfuscationFile struct { // SymbolType: The type of the deobfuscation file. // // Possible values: // "deobfuscationFileTypeUnspecified" - Unspecified deobfuscation file // type. // "proguard" - Proguard deobfuscation file type. // "nativeCode" - Native debugging symbols file type. SymbolType string `json:"symbolType,omitempty"` // ForceSendFields is a list of field names (e.g. "SymbolType") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "SymbolType") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *DeobfuscationFile) MarshalJSON() ([]byte, error) { type NoMethod DeobfuscationFile raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // DeobfuscationFilesUploadResponse: Responses for the upload. type DeobfuscationFilesUploadResponse struct { // DeobfuscationFile: The uploaded Deobfuscation File configuration. DeobfuscationFile *DeobfuscationFile `json:"deobfuscationFile,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "DeobfuscationFile") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DeobfuscationFile") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *DeobfuscationFilesUploadResponse) MarshalJSON() ([]byte, error) { type NoMethod DeobfuscationFilesUploadResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // DeveloperComment: Developer entry from conversation between user and // developer. type DeveloperComment struct { // LastModified: The last time at which this comment was updated. LastModified *Timestamp `json:"lastModified,omitempty"` // Text: The content of the comment, i.e. reply body. Text string `json:"text,omitempty"` // ForceSendFields is a list of field names (e.g. "LastModified") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "LastModified") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *DeveloperComment) MarshalJSON() ([]byte, error) { type NoMethod DeveloperComment raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // DeviceMetadata: Characteristics of the user's device. type DeviceMetadata struct { // CpuMake: Device CPU make, e.g. "Qualcomm" CpuMake string `json:"cpuMake,omitempty"` // CpuModel: Device CPU model, e.g. "MSM8974" CpuModel string `json:"cpuModel,omitempty"` // DeviceClass: Device class (e.g. tablet) DeviceClass string `json:"deviceClass,omitempty"` // GlEsVersion: OpenGL version GlEsVersion int64 `json:"glEsVersion,omitempty"` // Manufacturer: Device manufacturer (e.g. Motorola) Manufacturer string `json:"manufacturer,omitempty"` // NativePlatform: Comma separated list of native platforms (e.g. "arm", // "arm7") NativePlatform string `json:"nativePlatform,omitempty"` // ProductName: Device model name (e.g. Droid) ProductName string `json:"productName,omitempty"` // RamMb: Device RAM in Megabytes, e.g. "2048" RamMb int64 `json:"ramMb,omitempty"` // ScreenDensityDpi: Screen density in DPI ScreenDensityDpi int64 `json:"screenDensityDpi,omitempty"` // ScreenHeightPx: Screen height in pixels ScreenHeightPx int64 `json:"screenHeightPx,omitempty"` // ScreenWidthPx: Screen width in pixels ScreenWidthPx int64 `json:"screenWidthPx,omitempty"` // ForceSendFields is a list of field names (e.g. "CpuMake") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CpuMake") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *DeviceMetadata) MarshalJSON() ([]byte, error) { type NoMethod DeviceMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // DeviceSpec: The device spec used to generate a system APK. type DeviceSpec struct { // ScreenDensity: Screen dpi. ScreenDensity int64 `json:"screenDensity,omitempty"` // SupportedAbis: Supported ABI architectures in the order of // preference. The values should be the string as reported by the // platform, e.g. "armeabi-v7a", "x86_64". SupportedAbis []string `json:"supportedAbis,omitempty"` // SupportedLocales: All installed locales represented as BCP-47 // strings, e.g. "en-US". SupportedLocales []string `json:"supportedLocales,omitempty"` // ForceSendFields is a list of field names (e.g. "ScreenDensity") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ScreenDensity") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *DeviceSpec) MarshalJSON() ([]byte, error) { type NoMethod DeviceSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ExpansionFile: An expansion file. The resource for // ExpansionFilesService. type ExpansionFile struct { // FileSize: If set, this field indicates that this APK has an expansion // file uploaded to it: this APK does not reference another APK's // expansion file. The field's value is the size of the uploaded // expansion file in bytes. FileSize int64 `json:"fileSize,omitempty,string"` // ReferencesVersion: If set, this APK's expansion file references // another APK's expansion file. The file_size field will not be set. ReferencesVersion int64 `json:"referencesVersion,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "FileSize") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "FileSize") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ExpansionFile) MarshalJSON() ([]byte, error) { type NoMethod ExpansionFile raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ExpansionFilesUploadResponse: Response for uploading an expansion // file. type ExpansionFilesUploadResponse struct { // ExpansionFile: The uploaded expansion file configuration. ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "ExpansionFile") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ExpansionFile") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) { type NoMethod ExpansionFilesUploadResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ExternallyHostedApk: Defines an APK available for this application // that is hosted externally and not uploaded to Google Play. This // function is only available to organizations using Managed Play whose // application is configured to restrict distribution to the // organizations. type ExternallyHostedApk struct { // ApplicationLabel: The application label. ApplicationLabel string `json:"applicationLabel,omitempty"` // CertificateBase64s: A certificate (or array of certificates if a // certificate-chain is used) used to sign this APK, represented as a // base64 encoded byte array. CertificateBase64s []string `json:"certificateBase64s,omitempty"` // ExternallyHostedUrl: The URL at which the APK is hosted. This must be // an https URL. ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"` // FileSha1Base64: The sha1 checksum of this APK, represented as a // base64 encoded byte array. FileSha1Base64 string `json:"fileSha1Base64,omitempty"` // FileSha256Base64: The sha256 checksum of this APK, represented as a // base64 encoded byte array. FileSha256Base64 string `json:"fileSha256Base64,omitempty"` // FileSize: The file size in bytes of this APK. FileSize int64 `json:"fileSize,omitempty,string"` // IconBase64: The icon image from the APK, as a base64 encoded byte // array. IconBase64 string `json:"iconBase64,omitempty"` // MaximumSdk: The maximum SDK supported by this APK (optional). MaximumSdk int64 `json:"maximumSdk,omitempty"` // MinimumSdk: The minimum SDK targeted by this APK. MinimumSdk int64 `json:"minimumSdk,omitempty"` // NativeCodes: The native code environments supported by this APK // (optional). NativeCodes []string `json:"nativeCodes,omitempty"` // PackageName: The package name. PackageName string `json:"packageName,omitempty"` // UsesFeatures: The features required by this APK (optional). UsesFeatures []string `json:"usesFeatures,omitempty"` // UsesPermissions: The permissions requested by this APK. UsesPermissions []*UsesPermission `json:"usesPermissions,omitempty"` // VersionCode: The version code of this APK. VersionCode int64 `json:"versionCode,omitempty"` // VersionName: The version name of this APK. VersionName string `json:"versionName,omitempty"` // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ApplicationLabel") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) { type NoMethod ExternallyHostedApk raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Grant: An access grant resource. type Grant struct { // AppLevelPermissions: The permissions granted to the user for this // app. // // Possible values: // "APP_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified // permission. // "CAN_ACCESS_APP" - View app information (read-only). // "CAN_VIEW_FINANCIAL_DATA" - View financial data. // "CAN_MANAGE_PERMISSIONS" - Admin (all permissions). // "CAN_REPLY_TO_REVIEWS" - Reply to reviews. // "CAN_MANAGE_PUBLIC_APKS" - Release to production, exclude devices, // and use app signing by Google Play. // "CAN_MANAGE_TRACK_APKS" - Release to testing tracks. // "CAN_MANAGE_TRACK_USERS" - Manage testing tracks and edit tester // lists. // "CAN_MANAGE_PUBLIC_LISTING" - Manage store presence. // "CAN_MANAGE_DRAFT_APPS" - Edit and delete draft apps. // "CAN_MANAGE_ORDERS" - Manage orders and subscriptions. AppLevelPermissions []string `json:"appLevelPermissions,omitempty"` // Name: Required. Resource name for this grant, following the pattern // "developers/{developer}/users/{email}/grants/{package_name}". Name string `json:"name,omitempty"` // PackageName: Immutable. The package name of the app. PackageName string `json:"packageName,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "AppLevelPermissions") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "AppLevelPermissions") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *Grant) MarshalJSON() ([]byte, error) { type NoMethod Grant raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Image: An uploaded image. The resource for ImagesService. type Image struct { // Id: A unique id representing this image. Id string `json:"id,omitempty"` // Sha1: A sha1 hash of the image. Sha1 string `json:"sha1,omitempty"` // Sha256: A sha256 hash of the image. Sha256 string `json:"sha256,omitempty"` // Url: A URL that will serve a preview of the image. Url string `json:"url,omitempty"` // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Id") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Image) MarshalJSON() ([]byte, error) { type NoMethod Image raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ImagesDeleteAllResponse: Response for deleting all images. type ImagesDeleteAllResponse struct { // Deleted: The deleted images. Deleted []*Image `json:"deleted,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Deleted") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Deleted") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) { type NoMethod ImagesDeleteAllResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ImagesListResponse: Response listing all images. type ImagesListResponse struct { // Images: All listed Images. Images []*Image `json:"images,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Images") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Images") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ImagesListResponse) MarshalJSON() ([]byte, error) { type NoMethod ImagesListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ImagesUploadResponse: Response for uploading an image. type ImagesUploadResponse struct { // Image: The uploaded image. Image *Image `json:"image,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Image") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Image") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) { type NoMethod ImagesUploadResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // InAppProduct: An in-app product. The resource for // InappproductsService. type InAppProduct struct { // DefaultLanguage: Default language of the localized data, as defined // by BCP-47. e.g. "en-US". DefaultLanguage string `json:"defaultLanguage,omitempty"` // DefaultPrice: Default price. Cannot be zero, as in-app products are // never free. Always in the developer's Checkout merchant currency. DefaultPrice *Price `json:"defaultPrice,omitempty"` // GracePeriod: Grace period of the subscription, specified in ISO 8601 // format. Allows developers to give their subscribers a grace period // when the payment for the new recurrence period is declined. // Acceptable values are P0D (zero days), P3D (three days), P7D (seven // days), P14D (14 days), and P30D (30 days). GracePeriod string `json:"gracePeriod,omitempty"` // Listings: List of localized title and description data. Map key is // the language of the localized data, as defined by BCP-47, e.g. // "en-US". Listings map[string]InAppProductListing `json:"listings,omitempty"` // ManagedProductTaxesAndComplianceSettings: Details about taxes and // legal compliance. Only applicable to managed products. ManagedProductTaxesAndComplianceSettings *ManagedProductTaxAndComplianceSettings `json:"managedProductTaxesAndComplianceSettings,omitempty"` // PackageName: Package name of the parent app. PackageName string `json:"packageName,omitempty"` // Prices: Prices per buyer region. None of these can be zero, as in-app // products are never free. Map key is region code, as defined by ISO // 3166-2. Prices map[string]Price `json:"prices,omitempty"` // PurchaseType: The type of the product, e.g. a recurring subscription. // // Possible values: // "purchaseTypeUnspecified" - Unspecified purchase type. // "managedUser" - The default product type - one time purchase. // "subscription" - In-app product with a recurring period. PurchaseType string `json:"purchaseType,omitempty"` // Sku: Stock-keeping-unit (SKU) of the product, unique within an app. Sku string `json:"sku,omitempty"` // Status: The status of the product, e.g. whether it's active. // // Possible values: // "statusUnspecified" - Unspecified status. // "active" - The product is published and active in the store. // "inactive" - The product is not published and therefore inactive in // the store. Status string `json:"status,omitempty"` // SubscriptionPeriod: Subscription period, specified in ISO 8601 // format. Acceptable values are P1W (one week), P1M (one month), P3M // (three months), P6M (six months), and P1Y (one year). SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"` // SubscriptionTaxesAndComplianceSettings: Details about taxes and legal // compliance. Only applicable to subscription products. SubscriptionTaxesAndComplianceSettings *SubscriptionTaxAndComplianceSettings `json:"subscriptionTaxesAndComplianceSettings,omitempty"` // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable // values are anything between P7D (seven days) and P999D (999 days). TrialPeriod string `json:"trialPeriod,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DefaultLanguage") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *InAppProduct) MarshalJSON() ([]byte, error) { type NoMethod InAppProduct raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // InAppProductListing: Store listing of a single in-app product. type InAppProductListing struct { // Benefits: Localized entitlement benefits for a subscription. Benefits []string `json:"benefits,omitempty"` // Description: Description for the store listing. Description string `json:"description,omitempty"` // Title: Title for the store listing. Title string `json:"title,omitempty"` // ForceSendFields is a list of field names (e.g. "Benefits") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Benefits") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *InAppProductListing) MarshalJSON() ([]byte, error) { type NoMethod InAppProductListing raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // InappproductsListResponse: Response listing all in-app products. type InappproductsListResponse struct { // Inappproduct: All in-app products. Inappproduct []*InAppProduct `json:"inappproduct,omitempty"` // Kind: The kind of this response // ("androidpublisher#inappproductsListResponse"). Kind string `json:"kind,omitempty"` // PageInfo: Deprecated and unset. PageInfo *PageInfo `json:"pageInfo,omitempty"` // TokenPagination: Pagination token, to handle a number of products // that is over one page. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Inappproduct") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Inappproduct") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) { type NoMethod InappproductsListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // InternalAppSharingArtifact: An artifact resource which gets created // when uploading an APK or Android App Bundle through internal app // sharing. type InternalAppSharingArtifact struct { // CertificateFingerprint: The sha256 fingerprint of the certificate // used to sign the generated artifact. CertificateFingerprint string `json:"certificateFingerprint,omitempty"` // DownloadUrl: The download URL generated for the uploaded artifact. // Users that are authorized to download can follow the link to the Play // Store app to install it. DownloadUrl string `json:"downloadUrl,omitempty"` // Sha256: The sha256 hash of the artifact represented as a lowercase // hexadecimal number, matching the output of the sha256sum command. Sha256 string `json:"sha256,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. // "CertificateFingerprint") to unconditionally include in API requests. // By default, fields with empty or default values are omitted from API // requests. However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the // field is empty or not. This may be used to include empty fields in // Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CertificateFingerprint") // to include in API requests with the JSON null value. By default, // fields with empty values are omitted from API requests. However, any // field with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *InternalAppSharingArtifact) MarshalJSON() ([]byte, error) { type NoMethod InternalAppSharingArtifact raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // IntroductoryPriceInfo: Contains the introductory price information // for a subscription. type IntroductoryPriceInfo struct { // IntroductoryPriceAmountMicros: Introductory price of the // subscription, not including tax. The currency is the same as // price_currency_code. Price is expressed in micro-units, where // 1,000,000 micro-units represents one unit of the currency. For // example, if the subscription price is €1.99, price_amount_micros is // 1990000. IntroductoryPriceAmountMicros int64 `json:"introductoryPriceAmountMicros,omitempty,string"` // IntroductoryPriceCurrencyCode: ISO 4217 currency code for the // introductory subscription price. For example, if the price is // specified in British pounds sterling, price_currency_code is "GBP". IntroductoryPriceCurrencyCode string `json:"introductoryPriceCurrencyCode,omitempty"` // IntroductoryPriceCycles: The number of billing period to offer // introductory pricing. IntroductoryPriceCycles int64 `json:"introductoryPriceCycles,omitempty"` // IntroductoryPricePeriod: Introductory price period, specified in ISO // 8601 format. Common values are (but not limited to) "P1W" (one week), // "P1M" (one month), "P3M" (three months), "P6M" (six months), and // "P1Y" (one year). IntroductoryPricePeriod string `json:"introductoryPricePeriod,omitempty"` // ForceSendFields is a list of field names (e.g. // "IntroductoryPriceAmountMicros") to unconditionally include in API // requests. By default, fields with empty or default values are omitted // from API requests. However, any non-pointer, non-interface field // appearing in ForceSendFields will be sent to the server regardless of // whether the field is empty or not. This may be used to include empty // fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. // "IntroductoryPriceAmountMicros") to include in API requests with the // JSON null value. By default, fields with empty values are omitted // from API requests. However, any field with an empty value appearing // in NullFields will be sent to the server as null. It is an error if a // field in this list has a non-empty value. This may be used to include // null fields in Patch requests. NullFields []string `json:"-"` } func (s *IntroductoryPriceInfo) MarshalJSON() ([]byte, error) { type NoMethod IntroductoryPriceInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ListUsersResponse: A response containing one or more users with // access to an account. type ListUsersResponse struct { // NextPageToken: A token to pass to subsequent calls in order to // retrieve subsequent results. This will not be set if there are no // more results to return. NextPageToken string `json:"nextPageToken,omitempty"` // Users: The resulting users. Users []*User `json:"users,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "NextPageToken") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ListUsersResponse) MarshalJSON() ([]byte, error) { type NoMethod ListUsersResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Listing: A localized store listing. The resource for ListingsService. type Listing struct { // FullDescription: Full description of the app. FullDescription string `json:"fullDescription,omitempty"` // Language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). Language string `json:"language,omitempty"` // ShortDescription: Short description of the app. ShortDescription string `json:"shortDescription,omitempty"` // Title: Localized title of the app. Title string `json:"title,omitempty"` // Video: URL of a promotional YouTube video for the app. Video string `json:"video,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "FullDescription") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "FullDescription") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *Listing) MarshalJSON() ([]byte, error) { type NoMethod Listing raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ListingsListResponse: Response listing all localized listings. type ListingsListResponse struct { // Kind: The kind of this response // ("androidpublisher#listingsListResponse"). Kind string `json:"kind,omitempty"` // Listings: All localized listings. Listings []*Listing `json:"listings,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Kind") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Kind") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ListingsListResponse) MarshalJSON() ([]byte, error) { type NoMethod ListingsListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // LocalizedText: Release notes specification, i.e. language and text. type LocalizedText struct { // Language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). Language string `json:"language,omitempty"` // Text: The text in the given language. Text string `json:"text,omitempty"` // ForceSendFields is a list of field names (e.g. "Language") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Language") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *LocalizedText) MarshalJSON() ([]byte, error) { type NoMethod LocalizedText raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ManagedProductTaxAndComplianceSettings: Details about taxation and // legal compliance for managed products. type ManagedProductTaxAndComplianceSettings struct { // EeaWithdrawalRightType: Digital content or service classification for // products distributed to users in the European Economic Area (EEA). // The withdrawal regime under EEA consumer laws depends on this // classification. Refer to the Help Center article // (https://support.google.com/googleplay/android-developer/answer/10463498) // for more information. // // Possible values: // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" // "WITHDRAWAL_RIGHT_SERVICE" EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` // TaxRateInfoByRegionCode: A mapping from region code to tax rate // details. The keys are region codes as defined by Unicode's "CLDR". TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` // ForceSendFields is a list of field names (e.g. // "EeaWithdrawalRightType") to unconditionally include in API requests. // By default, fields with empty or default values are omitted from API // requests. However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the // field is empty or not. This may be used to include empty fields in // Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") // to include in API requests with the JSON null value. By default, // fields with empty values are omitted from API requests. However, any // field with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *ManagedProductTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { type NoMethod ManagedProductTaxAndComplianceSettings raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Money: Represents an amount of money with its currency type. type Money struct { // CurrencyCode: The three-letter currency code defined in ISO 4217. CurrencyCode string `json:"currencyCode,omitempty"` // Nanos: Number of nano (10^-9) units of the amount. The value must be // between -999,999,999 and +999,999,999 inclusive. If `units` is // positive, `nanos` must be positive or zero. If `units` is zero, // `nanos` can be positive, zero, or negative. If `units` is negative, // `nanos` must be negative or zero. For example $-1.75 is represented // as `units`=-1 and `nanos`=-750,000,000. Nanos int64 `json:"nanos,omitempty"` // Units: The whole units of the amount. For example if `currencyCode` // is "USD", then 1 unit is one US dollar. Units int64 `json:"units,omitempty,string"` // ForceSendFields is a list of field names (e.g. "CurrencyCode") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CurrencyCode") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Money) MarshalJSON() ([]byte, error) { type NoMethod Money raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // PageInfo: Information about the current page. List operations that // supports paging return only one "page" of results. This protocol // buffer message describes the page that has been returned. type PageInfo struct { // ResultPerPage: Maximum number of results returned in one page. ! The // number of results included in the API response. ResultPerPage int64 `json:"resultPerPage,omitempty"` // StartIndex: Index of the first result returned in the current page. StartIndex int64 `json:"startIndex,omitempty"` // TotalResults: Total number of results available on the backend ! The // total number of results in the result set. TotalResults int64 `json:"totalResults,omitempty"` // ForceSendFields is a list of field names (e.g. "ResultPerPage") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ResultPerPage") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *PageInfo) MarshalJSON() ([]byte, error) { type NoMethod PageInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Price: Definition of a price, i.e. currency and units. type Price struct { // Currency: 3 letter Currency code, as defined by ISO 4217. See // java/com/google/common/money/CurrencyCode.java Currency string `json:"currency,omitempty"` // PriceMicros: Price in 1/million of the currency base unit, // represented as a string. PriceMicros string `json:"priceMicros,omitempty"` // ForceSendFields is a list of field names (e.g. "Currency") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Currency") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Price) MarshalJSON() ([]byte, error) { type NoMethod Price raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ProductPurchase: A ProductPurchase resource indicates the status of a // user's inapp product purchase. type ProductPurchase struct { // AcknowledgementState: The acknowledgement state of the inapp product. // Possible values are: 0. Yet to be acknowledged 1. Acknowledged AcknowledgementState int64 `json:"acknowledgementState,omitempty"` // ConsumptionState: The consumption state of the inapp product. // Possible values are: 0. Yet to be consumed 1. Consumed ConsumptionState int64 `json:"consumptionState,omitempty"` // DeveloperPayload: A developer-specified string that contains // supplemental information about an order. DeveloperPayload string `json:"developerPayload,omitempty"` // Kind: This kind represents an inappPurchase object in the // androidpublisher service. Kind string `json:"kind,omitempty"` // ObfuscatedExternalAccountId: An obfuscated version of the id that is // uniquely associated with the user's account in your app. Only present // if specified using // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid // when the purchase was made. ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` // ObfuscatedExternalProfileId: An obfuscated version of the id that is // uniquely associated with the user's profile in your app. Only present // if specified using // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid // when the purchase was made. ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` // OrderId: The order id associated with the purchase of the inapp // product. OrderId string `json:"orderId,omitempty"` // ProductId: The inapp product SKU. ProductId string `json:"productId,omitempty"` // PurchaseState: The purchase state of the order. Possible values are: // 0. Purchased 1. Canceled 2. Pending PurchaseState int64 `json:"purchaseState,omitempty"` // PurchaseTimeMillis: The time the product was purchased, in // milliseconds since the epoch (Jan 1, 1970). PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` // PurchaseToken: The purchase token generated to identify this // purchase. PurchaseToken string `json:"purchaseToken,omitempty"` // PurchaseType: The type of purchase of the inapp product. This field // is only set if this purchase was not made using the standard in-app // billing flow. Possible values are: 0. Test (i.e. purchased from a // license testing account) 1. Promo (i.e. purchased using a promo code) // 2. Rewarded (i.e. from watching a video ad instead of paying) PurchaseType *int64 `json:"purchaseType,omitempty"` // Quantity: The quantity associated with the purchase of the inapp // product. Quantity int64 `json:"quantity,omitempty"` // RegionCode: ISO 3166-1 alpha-2 billing region code of the user at the // time the product was granted. RegionCode string `json:"regionCode,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. // "AcknowledgementState") to unconditionally include in API requests. // By default, fields with empty or default values are omitted from API // requests. However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the // field is empty or not. This may be used to include empty fields in // Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "AcknowledgementState") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *ProductPurchase) MarshalJSON() ([]byte, error) { type NoMethod ProductPurchase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ProductPurchasesAcknowledgeRequest: Request for the // product.purchases.acknowledge API. type ProductPurchasesAcknowledgeRequest struct { // DeveloperPayload: Payload to attach to the purchase. DeveloperPayload string `json:"developerPayload,omitempty"` // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DeveloperPayload") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *ProductPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { type NoMethod ProductPurchasesAcknowledgeRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // RegionalTaxRateInfo: Specified details about taxation in a given // geographical region. type RegionalTaxRateInfo struct { // EligibleForStreamingServiceTaxRate: You must tell us if your app // contains streaming products to correctly charge US state and local // sales tax. Field only supported in United States. EligibleForStreamingServiceTaxRate bool `json:"eligibleForStreamingServiceTaxRate,omitempty"` // TaxTier: Tax tier to specify reduced tax rate. Developers who sell // digital news, magazines, newspapers, books, or audiobooks in various // regions may be eligible for reduced tax rates. Learn more // (https://support.google.com/googleplay/android-developer/answer/10463498). // // Possible values: // "TAX_TIER_UNSPECIFIED" // "TAX_TIER_BOOKS_1" // "TAX_TIER_NEWS_1" // "TAX_TIER_NEWS_2" TaxTier string `json:"taxTier,omitempty"` // ForceSendFields is a list of field names (e.g. // "EligibleForStreamingServiceTaxRate") to unconditionally include in // API requests. By default, fields with empty or default values are // omitted from API requests. However, any non-pointer, non-interface // field appearing in ForceSendFields will be sent to the server // regardless of whether the field is empty or not. This may be used to // include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. // "EligibleForStreamingServiceTaxRate") to include in API requests with // the JSON null value. By default, fields with empty values are omitted // from API requests. However, any field with an empty value appearing // in NullFields will be sent to the server as null. It is an error if a // field in this list has a non-empty value. This may be used to include // null fields in Patch requests. NullFields []string `json:"-"` } func (s *RegionalTaxRateInfo) MarshalJSON() ([]byte, error) { type NoMethod RegionalTaxRateInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Review: An Android app review. type Review struct { // AuthorName: The name of the user who wrote the review. AuthorName string `json:"authorName,omitempty"` // Comments: A repeated field containing comments for the review. Comments []*Comment `json:"comments,omitempty"` // ReviewId: Unique identifier for this review. ReviewId string `json:"reviewId,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "AuthorName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "AuthorName") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Review) MarshalJSON() ([]byte, error) { type NoMethod Review raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ReviewReplyResult: The result of replying/updating a reply to review. type ReviewReplyResult struct { // LastEdited: The time at which the reply took effect. LastEdited *Timestamp `json:"lastEdited,omitempty"` // ReplyText: The reply text that was applied. ReplyText string `json:"replyText,omitempty"` // ForceSendFields is a list of field names (e.g. "LastEdited") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "LastEdited") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) { type NoMethod ReviewReplyResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ReviewsListResponse: Response listing reviews. type ReviewsListResponse struct { // PageInfo: Information about the current page. PageInfo *PageInfo `json:"pageInfo,omitempty"` // Reviews: List of reviews. Reviews []*Review `json:"reviews,omitempty"` // TokenPagination: Pagination token, to handle a number of products // that is over one page. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "PageInfo") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "PageInfo") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) { type NoMethod ReviewsListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ReviewsReplyRequest: Request to reply to review or update existing // reply. type ReviewsReplyRequest struct { // ReplyText: The text to set as the reply. Replies of more than // approximately 350 characters will be rejected. HTML tags will be // stripped. ReplyText string `json:"replyText,omitempty"` // ForceSendFields is a list of field names (e.g. "ReplyText") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ReplyText") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) { type NoMethod ReviewsReplyRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // ReviewsReplyResponse: Response on status of replying to a review. type ReviewsReplyResponse struct { // Result: The result of replying/updating a reply to review. Result *ReviewReplyResult `json:"result,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Result") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Result") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) { type NoMethod ReviewsReplyResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionCancelSurveyResult: Information provided by the user when // they complete the subscription cancellation flow (cancellation reason // survey). type SubscriptionCancelSurveyResult struct { // CancelSurveyReason: The cancellation reason the user chose in the // survey. Possible values are: 0. Other 1. I don't use this service // enough 2. Technical issues 3. Cost-related reasons 4. I found a // better app CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"` // UserInputCancelReason: The customized input cancel reason from the // user. Only present when cancelReason is 0. UserInputCancelReason string `json:"userInputCancelReason,omitempty"` // ForceSendFields is a list of field names (e.g. "CancelSurveyReason") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CancelSurveyReason") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionCancelSurveyResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the // data needed to defer a subscription purchase to a future expiry time. type SubscriptionDeferralInfo struct { // DesiredExpiryTimeMillis: The desired next expiry time to assign to // the subscription, in milliseconds since the Epoch. The given time // must be later/greater than the current expiry time for the // subscription. DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"` // ExpectedExpiryTimeMillis: The expected expiry time for the // subscription. If the current expiry time for the subscription is not // the value specified here, the deferral will not occur. ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"` // ForceSendFields is a list of field names (e.g. // "DesiredExpiryTimeMillis") to unconditionally include in API // requests. By default, fields with empty or default values are omitted // from API requests. However, any non-pointer, non-interface field // appearing in ForceSendFields will be sent to the server regardless of // whether the field is empty or not. This may be used to include empty // fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis") // to include in API requests with the JSON null value. By default, // fields with empty values are omitted from API requests. However, any // field with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionDeferralInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionPriceChange: Contains the price change information for a // subscription that can be used to control the user journey for the // price change in the app. This can be in the form of seeking // confirmation from the user or tailoring the experience for a // successful conversion. type SubscriptionPriceChange struct { // NewPrice: The new price the subscription will renew with if the price // change is accepted by the user. NewPrice *Price `json:"newPrice,omitempty"` // State: The current state of the price change. Possible values are: 0. // Outstanding: State for a pending price change waiting for the user to // agree. In this state, you can optionally seek confirmation from the // user using the In-App API. 1. Accepted: State for an accepted price // change that the subscription will renew with unless it's canceled. // The price change takes effect on a future date when the subscription // renews. Note that the change might not occur when the subscription is // renewed next. State int64 `json:"state,omitempty"` // ForceSendFields is a list of field names (e.g. "NewPrice") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "NewPrice") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *SubscriptionPriceChange) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionPriceChange raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionPurchase: A SubscriptionPurchase resource indicates the // status of a user's subscription purchase. type SubscriptionPurchase struct { // AcknowledgementState: The acknowledgement state of the subscription // product. Possible values are: 0. Yet to be acknowledged 1. // Acknowledged AcknowledgementState int64 `json:"acknowledgementState,omitempty"` // AutoRenewing: Whether the subscription will automatically be renewed // when it reaches its current expiry time. AutoRenewing bool `json:"autoRenewing,omitempty"` // AutoResumeTimeMillis: Time at which the subscription will be // automatically resumed, in milliseconds since the Epoch. Only present // if the user has requested to pause the subscription. AutoResumeTimeMillis int64 `json:"autoResumeTimeMillis,omitempty,string"` // CancelReason: The reason why a subscription was canceled or is not // auto-renewing. Possible values are: 0. User canceled the subscription // 1. Subscription was canceled by the system, for example because of a // billing problem 2. Subscription was replaced with a new subscription // 3. Subscription was canceled by the developer CancelReason int64 `json:"cancelReason,omitempty"` // CancelSurveyResult: Information provided by the user when they // complete the subscription cancellation flow (cancellation reason // survey). CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"` // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the // user at the time the subscription was granted. CountryCode string `json:"countryCode,omitempty"` // DeveloperPayload: A developer-specified string that contains // supplemental information about an order. DeveloperPayload string `json:"developerPayload,omitempty"` // EmailAddress: The email address of the user when the subscription was // purchased. Only present for purchases made with 'Subscribe with // Google'. EmailAddress string `json:"emailAddress,omitempty"` // ExpiryTimeMillis: Time at which the subscription will expire, in // milliseconds since the Epoch. ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"` // ExternalAccountId: User account identifier in the third-party // service. Only present if account linking happened as part of the // subscription purchase flow. ExternalAccountId string `json:"externalAccountId,omitempty"` // FamilyName: The family name of the user when the subscription was // purchased. Only present for purchases made with 'Subscribe with // Google'. FamilyName string `json:"familyName,omitempty"` // GivenName: The given name of the user when the subscription was // purchased. Only present for purchases made with 'Subscribe with // Google'. GivenName string `json:"givenName,omitempty"` // IntroductoryPriceInfo: Introductory price information of the // subscription. This is only present when the subscription was // purchased with an introductory price. This field does not indicate // the subscription is currently in introductory price period. IntroductoryPriceInfo *IntroductoryPriceInfo `json:"introductoryPriceInfo,omitempty"` // Kind: This kind represents a subscriptionPurchase object in the // androidpublisher service. Kind string `json:"kind,omitempty"` // LinkedPurchaseToken: The purchase token of the originating purchase // if this subscription is one of the following: 0. Re-signup of a // canceled but non-lapsed subscription 1. Upgrade/downgrade from a // previous subscription For example, suppose a user originally signs up // and you receive purchase token X, then the user cancels and goes // through the resignup flow (before their subscription lapses) and you // receive purchase token Y, and finally the user upgrades their // subscription and you receive purchase token Z. If you call this API // with purchase token Z, this field will be set to Y. If you call this // API with purchase token Y, this field will be set to X. If you call // this API with purchase token X, this field will not be set. LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"` // ObfuscatedExternalAccountId: An obfuscated version of the id that is // uniquely associated with the user's account in your app. Present for // the following purchases: * If account linking happened as part of the // subscription purchase flow. * It was specified using // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid // when the purchase was made. ObfuscatedExternalAccountId string `json:"obfuscatedExternalAccountId,omitempty"` // ObfuscatedExternalProfileId: An obfuscated version of the id that is // uniquely associated with the user's profile in your app. Only present // if specified using // https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid // when the purchase was made. ObfuscatedExternalProfileId string `json:"obfuscatedExternalProfileId,omitempty"` // OrderId: The order id of the latest recurring order associated with // the purchase of the subscription. If the subscription was canceled // because payment was declined, this will be the order id from the // payment declined order. OrderId string `json:"orderId,omitempty"` // PaymentState: The payment state of the subscription. Possible values // are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending // deferred upgrade/downgrade Not present for canceled, expired // subscriptions. PaymentState int64 `json:"paymentState,omitempty"` // PriceAmountMicros: Price of the subscription, For tax exclusive // countries, the price doesn't include tax. For tax inclusive // countries, the price includes tax. Price is expressed in micro-units, // where 1,000,000 micro-units represents one unit of the currency. For // example, if the subscription price is €1.99, price_amount_micros is // 1990000. PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"` // PriceChange: The latest price change information available. This is // present only when there is an upcoming price change for the // subscription yet to be applied. Once the subscription renews with the // new price or the subscription is canceled, no price change // information will be returned. PriceChange *SubscriptionPriceChange `json:"priceChange,omitempty"` // PriceCurrencyCode: ISO 4217 currency code for the subscription price. // For example, if the price is specified in British pounds sterling, // price_currency_code is "GBP". PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"` // ProfileId: The Google profile id of the user when the subscription // was purchased. Only present for purchases made with 'Subscribe with // Google'. ProfileId string `json:"profileId,omitempty"` // ProfileName: The profile name of the user when the subscription was // purchased. Only present for purchases made with 'Subscribe with // Google'. ProfileName string `json:"profileName,omitempty"` // PromotionCode: The promotion code applied on this purchase. This // field is only set if a vanity code promotion is applied when the // subscription was purchased. PromotionCode string `json:"promotionCode,omitempty"` // PromotionType: The type of promotion applied on this purchase. This // field is only set if a promotion is applied when the subscription was // purchased. Possible values are: 0. One time code 1. Vanity code PromotionType int64 `json:"promotionType,omitempty"` // PurchaseType: The type of purchase of the subscription. This field is // only set if this purchase was not made using the standard in-app // billing flow. Possible values are: 0. Test (i.e. purchased from a // license testing account) 1. Promo (i.e. purchased using a promo code) PurchaseType *int64 `json:"purchaseType,omitempty"` // StartTimeMillis: Time at which the subscription was granted, in // milliseconds since the Epoch. StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` // UserCancellationTimeMillis: The time at which the subscription was // canceled by the user, in milliseconds since the epoch. Only present // if cancelReason is 0. UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. // "AcknowledgementState") to unconditionally include in API requests. // By default, fields with empty or default values are omitted from API // requests. However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the // field is empty or not. This may be used to include empty fields in // Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "AcknowledgementState") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionPurchase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionPurchasesAcknowledgeRequest: Request for the // purchases.subscriptions.acknowledge API. type SubscriptionPurchasesAcknowledgeRequest struct { // DeveloperPayload: Payload to attach to the purchase. DeveloperPayload string `json:"developerPayload,omitempty"` // ForceSendFields is a list of field names (e.g. "DeveloperPayload") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DeveloperPayload") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *SubscriptionPurchasesAcknowledgeRequest) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionPurchasesAcknowledgeRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionPurchasesDeferRequest: Request for the // purchases.subscriptions.defer API. type SubscriptionPurchasesDeferRequest struct { // DeferralInfo: The information about the new desired expiry time for // the subscription. DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"` // ForceSendFields is a list of field names (e.g. "DeferralInfo") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DeferralInfo") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionPurchasesDeferRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionPurchasesDeferResponse: Response for the // purchases.subscriptions.defer API. type SubscriptionPurchasesDeferResponse struct { // NewExpiryTimeMillis: The new expiry time for the subscription in // milliseconds since the Epoch. NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis") // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionPurchasesDeferResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SubscriptionTaxAndComplianceSettings: Details about taxation, Google // Play policy and legal compliance for subscription products. type SubscriptionTaxAndComplianceSettings struct { // EeaWithdrawalRightType: Digital content or service classification for // products distributed to users in the European Economic Area (EEA). // The withdrawal regime under EEA consumer laws depends on this // classification. Refer to the Help Center article // (https://support.google.com/googleplay/android-developer/answer/10463498) // for more information. // // Possible values: // "WITHDRAWAL_RIGHT_TYPE_UNSPECIFIED" // "WITHDRAWAL_RIGHT_DIGITAL_CONTENT" // "WITHDRAWAL_RIGHT_SERVICE" EeaWithdrawalRightType string `json:"eeaWithdrawalRightType,omitempty"` // TaxRateInfoByRegionCode: A mapping from region code to tax rate // details. The keys are region codes as defined by Unicode's "CLDR". TaxRateInfoByRegionCode map[string]RegionalTaxRateInfo `json:"taxRateInfoByRegionCode,omitempty"` // ForceSendFields is a list of field names (e.g. // "EeaWithdrawalRightType") to unconditionally include in API requests. // By default, fields with empty or default values are omitted from API // requests. However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the // field is empty or not. This may be used to include empty fields in // Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "EeaWithdrawalRightType") // to include in API requests with the JSON null value. By default, // fields with empty values are omitted from API requests. However, any // field with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *SubscriptionTaxAndComplianceSettings) MarshalJSON() ([]byte, error) { type NoMethod SubscriptionTaxAndComplianceSettings raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // SystemApksListResponse: Response to list previously created system // APK variants. type SystemApksListResponse struct { // Variants: All system APK variants created. Variants []*Variant `json:"variants,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Variants") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Variants") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *SystemApksListResponse) MarshalJSON() ([]byte, error) { type NoMethod SystemApksListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Testers: The testers of an app. The resource for TestersService. type Testers struct { // GoogleGroups: All testing Google Groups, as email addresses. GoogleGroups []string `json:"googleGroups,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "GoogleGroups") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "GoogleGroups") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Testers) MarshalJSON() ([]byte, error) { type NoMethod Testers raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Timestamp: A Timestamp represents a point in time independent of any // time zone or local calendar, encoded as a count of seconds and // fractions of seconds at nanosecond resolution. The count is relative // to an epoch at UTC midnight on January 1, 1970. type Timestamp struct { // Nanos: Non-negative fractions of a second at nanosecond resolution. // Must be from 0 to 999,999,999 inclusive. Nanos int64 `json:"nanos,omitempty"` // Seconds: Represents seconds of UTC time since Unix epoch. Seconds int64 `json:"seconds,omitempty,string"` // ForceSendFields is a list of field names (e.g. "Nanos") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Nanos") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Timestamp) MarshalJSON() ([]byte, error) { type NoMethod Timestamp raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // TokenPagination: Pagination information returned by a List operation // when token pagination is enabled. List operations that supports // paging return only one "page" of results. This protocol buffer // message describes the page that has been returned. When using token // pagination, clients should use the next/previous token to get another // page of the result. The presence or absence of next/previous token // indicates whether a next/previous page is available and provides a // mean of accessing this page. ListRequest.page_token should be set to // either next_page_token or previous_page_token to access another page. type TokenPagination struct { // NextPageToken: Tokens to pass to the standard list field // 'page_token'. Whenever available, tokens are preferred over // manipulating start_index. NextPageToken string `json:"nextPageToken,omitempty"` PreviousPageToken string `json:"previousPageToken,omitempty"` // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "NextPageToken") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *TokenPagination) MarshalJSON() ([]byte, error) { type NoMethod TokenPagination raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Track: A track configuration. The resource for TracksService. type Track struct { // Releases: In a read request, represents all active releases in the // track. In an update request, represents desired changes. Releases []*TrackRelease `json:"releases,omitempty"` // Track: Identifier of the track. Track string `json:"track,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Releases") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Releases") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Track) MarshalJSON() ([]byte, error) { type NoMethod Track raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // TrackRelease: A release within a track. type TrackRelease struct { // CountryTargeting: Restricts a release to a specific set of countries. CountryTargeting *CountryTargeting `json:"countryTargeting,omitempty"` // InAppUpdatePriority: In-app update priority of the release. All newly // added APKs in the release will be considered at this priority. Can // take values in the range [0, 5], with 5 the highest priority. // Defaults to 0. in_app_update_priority can not be updated once the // release is rolled out. See // https://developer.android.com/guide/playcore/in-app-updates. InAppUpdatePriority int64 `json:"inAppUpdatePriority,omitempty"` // Name: The release name. Not required to be unique. If not set, the // name is generated from the APK's version_name. If the release // contains multiple APKs, the name is generated from the date. Name string `json:"name,omitempty"` // ReleaseNotes: A description of what is new in this release. ReleaseNotes []*LocalizedText `json:"releaseNotes,omitempty"` // Status: The status of the release. // // Possible values: // "statusUnspecified" - Unspecified status. // "draft" - The release's APKs are not being served to users. // "inProgress" - The release's APKs are being served to a fraction of // users, determined by 'user_fraction'. // "halted" - The release's APKs will no longer be served to users. // Users who already have these APKs are unaffected. // "completed" - The release will have no further changes. Its APKs // are being served to all users, unless they are eligible to APKs of a // more recent release. Status string `json:"status,omitempty"` // UserFraction: Fraction of users who are eligible for a staged // release. 0 < fraction < 1. Can only be set when status is // "inProgress" or "halted". UserFraction float64 `json:"userFraction,omitempty"` // VersionCodes: Version codes of all APKs in the release. Must include // version codes to retain from previous releases. VersionCodes googleapi.Int64s `json:"versionCodes,omitempty"` // ForceSendFields is a list of field names (e.g. "CountryTargeting") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "CountryTargeting") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *TrackRelease) MarshalJSON() ([]byte, error) { type NoMethod TrackRelease raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } func (s *TrackRelease) UnmarshalJSON(data []byte) error { type NoMethod TrackRelease var s1 struct { UserFraction gensupport.JSONFloat64 `json:"userFraction"` *NoMethod } s1.NoMethod = (*NoMethod)(s) if err := json.Unmarshal(data, &s1); err != nil { return err } s.UserFraction = float64(s1.UserFraction) return nil } // TracksListResponse: Response listing all tracks. type TracksListResponse struct { // Kind: The kind of this response // ("androidpublisher#tracksListResponse"). Kind string `json:"kind,omitempty"` // Tracks: All tracks. Tracks []*Track `json:"tracks,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Kind") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Kind") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *TracksListResponse) MarshalJSON() ([]byte, error) { type NoMethod TracksListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // User: A user resource. type User struct { // AccessState: Output only. The state of the user's access to the Play // Console. // // Possible values: // "ACCESS_STATE_UNSPECIFIED" - Unknown or unspecified access state. // "INVITED" - User is invited but has not yet accepted the // invitation. // "INVITATION_EXPIRED" - Invitation has expired. // "ACCESS_GRANTED" - User has accepted an invitation and has access // to the Play Console. // "ACCESS_EXPIRED" - Account access has expired. AccessState string `json:"accessState,omitempty"` // DeveloperAccountPermissions: Permissions for the user which apply // across the developer account. // // Possible values: // "DEVELOPER_LEVEL_PERMISSION_UNSPECIFIED" - Unknown or unspecified // permission. // "CAN_SEE_ALL_APPS" - View app information and download bulk reports // (read-only). // "CAN_VIEW_FINANCIAL_DATA_GLOBAL" - View financial data, orders, and // cancellation survey responses. // "CAN_MANAGE_PERMISSIONS_GLOBAL" - Admin (all permissions). // "CAN_EDIT_GAMES_GLOBAL" - Edit Play Games Services projects. // "CAN_PUBLISH_GAMES_GLOBAL" - Publish Play Games Services projects. // "CAN_REPLY_TO_REVIEWS_GLOBAL" - Reply to reviews. // "CAN_MANAGE_PUBLIC_APKS_GLOBAL" - Release to production, exclude // devices, and use app signing by Google Play. // "CAN_MANAGE_TRACK_APKS_GLOBAL" - Release to testing tracks. // "CAN_MANAGE_TRACK_USERS_GLOBAL" - Manage testing tracks and edit // tester lists. // "CAN_MANAGE_PUBLIC_LISTING_GLOBAL" - Manage store presence. // "CAN_MANAGE_DRAFT_APPS_GLOBAL" - Create, edit, and delete draft // apps. // "CAN_CREATE_MANAGED_PLAY_APPS_GLOBAL" - Create and publish private // apps to your organization. // "CAN_CHANGE_MANAGED_PLAY_SETTING_GLOBAL" - Choose whether apps are // public, or only available to your organization. // "CAN_MANAGE_ORDERS_GLOBAL" - Manage orders and subscriptions. DeveloperAccountPermissions []string `json:"developerAccountPermissions,omitempty"` // Email: Immutable. The user's email address. Email string `json:"email,omitempty"` // ExpirationTime: The time at which the user's access expires, if set. ExpirationTime string `json:"expirationTime,omitempty"` // Grants: Output only. Per-app permissions for the user. Grants []*Grant `json:"grants,omitempty"` // Name: Required. Resource name for this user, following the pattern // "developers/{developer}/users/{email}". Name string `json:"name,omitempty"` // Partial: Output only. Whether there are more permissions for the user // that are not represented here. Partial bool `json:"partial,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "AccessState") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "AccessState") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *User) MarshalJSON() ([]byte, error) { type NoMethod User raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
} // UserComment: User entry from conversation between user and developer. type UserComment struct { // AndroidOsVersion: Integer Android SDK version of the user's device at // the time the review was written, e.g. 23 is Marshmallow. May be // absent. AndroidOsVersion int64 `json:"androidOsVersion,omitempty"` // AppVersionCode: Integer version code of the app as installed at the // time the review was written. May be absent. AppVersionCode int64 `json:"appVersionCode,omitempty"` // AppVersionName: String version name of the app as installed at the // time the review was written. May be absent. AppVersionName string `json:"appVersionName,omitempty"` // Device: Codename for the reviewer's device, e.g. klte, flounder. May // be absent. Device string `json:"device,omitempty"` // DeviceMetadata: Information about the characteristics of the user's // device. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"` // LastModified: The last time at which this comment was updated. LastModified *Timestamp `json:"lastModified,omitempty"` // OriginalText: Untranslated text of the review, where the review was // translated. If the review was not translated this is left blank. OriginalText string `json:"originalText,omitempty"` // ReviewerLanguage: Language code for the reviewer. This is taken from // the device settings so is not guaranteed to match the language the // review is written in. May be absent. ReviewerLanguage string `json:"reviewerLanguage,omitempty"` // StarRating: The star rating associated with the review, from 1 to 5. StarRating int64 `json:"starRating,omitempty"` // Text: The content of the comment, i.e. review body. In some cases // users have been able to write a review with separate title and body; // in those cases the title and body are concatenated and separated by a // tab character. Text string `json:"text,omitempty"` // ThumbsDownCount: Number of users who have given this review a thumbs // down. ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"` // ThumbsUpCount: Number of users who have given this review a thumbs // up. ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"` // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "AndroidOsVersion") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` } func (s *UserComment) MarshalJSON() ([]byte, error) { type NoMethod UserComment raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // UsesPermission: A permission used by this APK. type UsesPermission struct { // MaxSdkVersion: Optionally, the maximum SDK version for which the // permission is required. MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"` // Name: The name of the permission requested. Name string `json:"name,omitempty"` // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "MaxSdkVersion") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *UsesPermission) MarshalJSON() ([]byte, error) { type NoMethod UsesPermission raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // Variant: APK that is suitable for inclusion in a system image. The // resource of SystemApksService. type Variant struct { // DeviceSpec: The device spec used to generate the APK. DeviceSpec *DeviceSpec `json:"deviceSpec,omitempty"` // VariantId: Output only. The ID of a previously created system APK // variant. VariantId int64 `json:"variantId,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "DeviceSpec") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "DeviceSpec") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *Variant) MarshalJSON() ([]byte, error) { type NoMethod Variant raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // VoidedPurchase: A VoidedPurchase resource indicates a purchase that // was either canceled/refunded/charged-back. type VoidedPurchase struct { // Kind: This kind represents a voided purchase object in the // androidpublisher service. Kind string `json:"kind,omitempty"` // OrderId: The order id which uniquely identifies a one-time purchase, // subscription purchase, or subscription renewal. OrderId string `json:"orderId,omitempty"` // PurchaseTimeMillis: The time at which the purchase was made, in // milliseconds since the epoch (Jan 1, 1970). PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` // PurchaseToken: The token which uniquely identifies a one-time // purchase or subscription. To uniquely identify subscription renewals // use order_id (available starting from version 3 of the API). PurchaseToken string `json:"purchaseToken,omitempty"` // VoidedReason: The reason why the purchase was voided, possible values // are: 0. Other 1. Remorse 2. Not_received 3. Defective 4. // Accidental_purchase 5. Fraud 6. Friendly_fraud 7. Chargeback VoidedReason int64 `json:"voidedReason,omitempty"` // VoidedSource: The initiator of voided purchase, possible values are: // 0. User 1. Developer 2. Google VoidedSource int64 `json:"voidedSource,omitempty"` // VoidedTimeMillis: The time at which the purchase was // canceled/refunded/charged-back, in milliseconds since the epoch (Jan // 1, 1970). VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"` // ForceSendFields is a list of field names (e.g. "Kind") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "Kind") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *VoidedPurchase) MarshalJSON() ([]byte, error) { type NoMethod VoidedPurchase raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // VoidedPurchasesListResponse: Response for the voidedpurchases.list // API. type VoidedPurchasesListResponse struct { // PageInfo: General pagination information. PageInfo *PageInfo `json:"pageInfo,omitempty"` // TokenPagination: Pagination information for token pagination. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "PageInfo") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "PageInfo") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) { type NoMethod VoidedPurchasesListResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } // method id "androidpublisher.edits.commit": type EditsCommitCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Commit: Commits an app edit. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsService) Commit(packageName string, editId string) *EditsCommitCall { c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // ChangesNotSentForReview sets the optional parameter // "changesNotSentForReview": Indicates that the changes in this edit // will not be reviewed until they are explicitly sent for review from // the Google Play Console UI. These changes will be added to any other // changes that are not yet sent for review. func (c *EditsCommitCall) ChangesNotSentForReview(changesNotSentForReview bool) *EditsCommitCall { c.urlParams_.Set("changesNotSentForReview", fmt.Sprint(changesNotSentForReview)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsCommitCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.commit" call. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *AppEdit.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &AppEdit{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Commits an app edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", // "httpMethod": "POST", // "id": "androidpublisher.edits.commit", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "changesNotSentForReview": { // "description": "Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI. These changes will be added to any other changes that are not yet sent for review.", // "location": "query", // "type": "boolean" // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:commit", // "response": { // "$ref": "AppEdit" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.delete": type EditsDeleteCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Delete: Deletes an app edit. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsService) Delete(packageName string, editId string) *EditsDeleteCall { c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.delete" call. func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Deletes an app edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", // "httpMethod": "DELETE", // "id": "androidpublisher.edits.delete", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.get": type EditsGetCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Gets an app edit. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsService) Get(packageName string, editId string) *EditsGetCall { c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.get" call. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *AppEdit.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &AppEdit{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Gets an app edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}", // "httpMethod": "GET", // "id": "androidpublisher.edits.get", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}", // "response": { // "$ref": "AppEdit" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.insert": type EditsInsertCall struct { s *Service packageName string appedit *AppEdit urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Insert: Creates a new edit for an app. // // - packageName: Package name of the app. func (r *EditsService) Insert(packageName string, appedit *AppEdit) *EditsInsertCall { c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.appedit = appedit return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.insert" call. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *AppEdit.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &AppEdit{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Creates a new edit for an app.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits", // "httpMethod": "POST", // "id": "androidpublisher.edits.insert", // "parameterOrder": [ // "packageName" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits", // "request": { // "$ref": "AppEdit" // }, // "response": { // "$ref": "AppEdit" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.validate": type EditsValidateCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Validate: Validates an app edit. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsService) Validate(packageName string, editId string) *EditsValidateCall { c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsValidateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.validate" call. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *AppEdit.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &AppEdit{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Validates an app edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", // "httpMethod": "POST", // "id": "androidpublisher.edits.validate", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}:validate", // "response": { // "$ref": "AppEdit" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.apks.addexternallyhosted": type EditsApksAddexternallyhostedCall struct { s *Service packageName string editId string apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Addexternallyhosted: Creates a new APK without uploading the APK // itself to Google Play, instead hosting the APK at a specified URL. // This function is only available to organizations using Managed Play // whose application is configured to restrict distribution to the // organizations. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsApksService) Addexternallyhosted(packageName string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall { c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsApksAddexternallyhostedCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.apks.addexternallyhosted" call. // Exactly one of *ApksAddExternallyHostedResponse or error will be // non-nil. Any non-2xx status code is an error. Response headers are in // either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ApksAddExternallyHostedResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to organizations using Managed Play whose application is configured to restrict distribution to the organizations.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", // "httpMethod": "POST", // "id": "androidpublisher.edits.apks.addexternallyhosted", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted", // "request": { // "$ref": "ApksAddExternallyHostedRequest" // }, // "response": { // "$ref": "ApksAddExternallyHostedResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.apks.list": type EditsApksListCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all current APKs of the app and edit. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsApksService) List(packageName string, editId string) *EditsApksListCall { c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsApksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.apks.list" call. // Exactly one of *ApksListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ApksListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ApksListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all current APKs of the app and edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", // "httpMethod": "GET", // "id": "androidpublisher.edits.apks.list", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", // "response": { // "$ref": "ApksListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.apks.upload": type EditsApksUploadCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } // Upload: Uploads an APK and adds to the current edit. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsApksService) Upload(packageName string, editId string) *EditsApksUploadCall { c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Media specifies the media to upload in one or more chunks. The chunk // size may be controlled by supplying a MediaOption generated by // googleapi.ChunkSize. The chunk size defaults to // googleapi.DefaultUploadChunkSize.The Content-Type header used in the // upload request will be determined by sniffing the contents of r, // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } // ResumableMedia specifies the media to upload in chunks and can be // canceled with ctx. // // Deprecated: use Media instead. // // At most one of Media and ResumableMedia may be set. mediaType // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } // ProgressUpdater provides a callback function that will be called // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall { c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsApksUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") if c.mediaInfo_ != nil { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { body = new(bytes.Buffer) reqHeaders.Set("Content-Type", "application/json") } body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.apks.upload" call. // Exactly one of *Apk or error will be non-nil. Any non-2xx status code // is an error. Response headers are in either // *Apk.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) if rx != nil { rx.Client = c.s.client rx.UserAgent = c.s.userAgent() ctx := c.ctx_ if ctx == nil { ctx = context.TODO() } res, err = rx.Upload(ctx) if err != nil { return nil, err } defer res.Body.Close() if err := googleapi.CheckResponse(res); err != nil { return nil, err } } ret := &Apk{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Uploads an APK and adds to the current edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", // "httpMethod": "POST", // "id": "androidpublisher.edits.apks.upload", // "mediaUpload": { // "accept": [ // "application/octet-stream", // "application/vnd.android.package-archive" // ], // "maxSize": "10737418240", // "protocols": { // "resumable": { // "multipart": true, // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" // }, // "simple": { // "multipart": true, // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks" // } // } // }, // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks", // "response": { // "$ref": "Apk" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaUpload": true // } } // method id "androidpublisher.edits.bundles.list": type EditsBundlesListCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all current Android App Bundles of the app and edit. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsBundlesService) List(packageName string, editId string) *EditsBundlesListCall { c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsBundlesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.bundles.list" call. // Exactly one of *BundlesListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *BundlesListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &BundlesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all current Android App Bundles of the app and edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", // "httpMethod": "GET", // "id": "androidpublisher.edits.bundles.list", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", // "response": { // "$ref": "BundlesListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.bundles.upload": type EditsBundlesUploadCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } // Upload: Uploads a new Android App Bundle to this edit. If you are // using the Google API client libraries, please increase the timeout of // the http request before calling this endpoint (a timeout of 2 minutes // is recommended). See Timeouts and Errors // (https://developers.google.com/api-client-library/java/google-api-java-client/errors) // for an example in java. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsBundlesService) Upload(packageName string, editId string) *EditsBundlesUploadCall { c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // AckBundleInstallationWarning sets the optional parameter // "ackBundleInstallationWarning": Must be set to true if the app bundle // installation may trigger a warning on user devices (for example, if // installation size may be over a threshold, typically 100 MB). func (c *EditsBundlesUploadCall) AckBundleInstallationWarning(ackBundleInstallationWarning bool) *EditsBundlesUploadCall { c.urlParams_.Set("ackBundleInstallationWarning", fmt.Sprint(ackBundleInstallationWarning)) return c } // Media specifies the media to upload in one or more chunks. The chunk // size may be controlled by supplying a MediaOption generated by // googleapi.ChunkSize. The chunk size defaults to // googleapi.DefaultUploadChunkSize.The Content-Type header used in the // upload request will be determined by sniffing the contents of r, // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } // ResumableMedia specifies the media to upload in chunks and can be // canceled with ctx. // // Deprecated: use Media instead. // // At most one of Media and ResumableMedia may be set. mediaType // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } // ProgressUpdater provides a callback function that will be called // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall { c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsBundlesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") if c.mediaInfo_ != nil { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { body = new(bytes.Buffer) reqHeaders.Set("Content-Type", "application/json") } body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.bundles.upload" call. // Exactly one of *Bundle or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Bundle.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) if rx != nil { rx.Client = c.s.client rx.UserAgent = c.s.userAgent() ctx := c.ctx_ if ctx == nil { ctx = context.TODO() } res, err = rx.Upload(ctx) if err != nil { return nil, err } defer res.Body.Close() if err := googleapi.CheckResponse(res); err != nil { return nil, err } } ret := &Bundle{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Uploads a new Android App Bundle to this edit. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", // "httpMethod": "POST", // "id": "androidpublisher.edits.bundles.upload", // "mediaUpload": { // "accept": [ // "application/octet-stream" // ], // "maxSize": "10737418240", // "protocols": { // "resumable": { // "multipart": true, // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" // }, // "simple": { // "multipart": true, // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles" // } // } // }, // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "ackBundleInstallationWarning": { // "description": "Must be set to true if the app bundle installation may trigger a warning on user devices (for example, if installation size may be over a threshold, typically 100 MB).", // "location": "query", // "type": "boolean" // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles", // "response": { // "$ref": "Bundle" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaUpload": true // } } // method id "androidpublisher.edits.deobfuscationfiles.upload": type EditsDeobfuscationfilesUploadCall struct { s *Service packageNameid string editId string apkVersionCode int64 deobfuscationFileType string urlParams_ gensupport.URLParams mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } // Upload: Uploads a new deobfuscation file and attaches to the // specified APK. // // - apkVersionCode: The version code of the APK whose Deobfuscation // File is being uploaded. // - deobfuscationFileType: The type of the deobfuscation file. // - editId: Unique identifier for this edit. // - packageName: Unique identifier for the Android app. func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall { c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageNameid = packageNameid c.editId = editId c.apkVersionCode = apkVersionCode c.deobfuscationFileType = deobfuscationFileType return c } // Media specifies the media to upload in one or more chunks. The chunk // size may be controlled by supplying a MediaOption generated by // googleapi.ChunkSize. The chunk size defaults to // googleapi.DefaultUploadChunkSize.The Content-Type header used in the // upload request will be determined by sniffing the contents of r, // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } // ResumableMedia specifies the media to upload in chunks and can be // canceled with ctx. // // Deprecated: use Media instead. // // At most one of Media and ResumableMedia may be set. mediaType // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } // ProgressUpdater provides a callback function that will be called // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall { c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") if c.mediaInfo_ != nil { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { body = new(bytes.Buffer) reqHeaders.Set("Content-Type", "application/json") } body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageNameid, "editId": c.editId, "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), "deobfuscationFileType": c.deobfuscationFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call. // Exactly one of *DeobfuscationFilesUploadResponse or error will be // non-nil. Any non-2xx status code is an error. Response headers are in // either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) if rx != nil { rx.Client = c.s.client rx.UserAgent = c.s.userAgent() ctx := c.ctx_ if ctx == nil { ctx = context.TODO() } res, err = rx.Upload(ctx) if err != nil { return nil, err } defer res.Body.Close() if err := googleapi.CheckResponse(res); err != nil { return nil, err } } ret := &DeobfuscationFilesUploadResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Uploads a new deobfuscation file and attaches to the specified APK.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", // "httpMethod": "POST", // "id": "androidpublisher.edits.deobfuscationfiles.upload", // "mediaUpload": { // "accept": [ // "application/octet-stream" // ], // "maxSize": "629145600", // "protocols": { // "resumable": { // "multipart": true, // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" // }, // "simple": { // "multipart": true, // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}" // } // } // }, // "parameterOrder": [ // "packageName", // "editId", // "apkVersionCode", // "deobfuscationFileType" // ], // "parameters": { // "apkVersionCode": { // "description": "The version code of the APK whose Deobfuscation File is being uploaded.", // "format": "int32", // "location": "path", // "required": true, // "type": "integer" // }, // "deobfuscationFileType": { // "description": "The type of the deobfuscation file.", // "enum": [ // "deobfuscationFileTypeUnspecified", // "proguard", // "nativeCode" // ], // "enumDescriptions": [ // "Unspecified deobfuscation file type.", // "Proguard deobfuscation file type.", // "Native debugging symbols file type." // ], // "location": "path", // "required": true, // "type": "string" // }, // "editId": { // "description": "Unique identifier for this edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Unique identifier for the Android app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}", // "response": { // "$ref": "DeobfuscationFilesUploadResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaUpload": true // } } // method id "androidpublisher.edits.details.get": type EditsDetailsGetCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Gets details of an app. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsDetailsService) Get(packageName string, editId string) *EditsDetailsGetCall { c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsDetailsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.details.get" call. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *AppDetails.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &AppDetails{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Gets details of an app.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "httpMethod": "GET", // "id": "androidpublisher.edits.details.get", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "response": { // "$ref": "AppDetails" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.details.patch": type EditsDetailsPatchCall struct { s *Service packageName string editId string appdetails *AppDetails urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Patches details of an app. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsDetailsService) Patch(packageName string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall { c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.appdetails = appdetails return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsDetailsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.details.patch" call. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *AppDetails.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &AppDetails{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Patches details of an app.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "httpMethod": "PATCH", // "id": "androidpublisher.edits.details.patch", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "request": { // "$ref": "AppDetails" // }, // "response": { // "$ref": "AppDetails" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.details.update": type EditsDetailsUpdateCall struct { s *Service packageName string editId string appdetails *AppDetails urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Update: Updates details of an app. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsDetailsService) Update(packageName string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall { c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.appdetails = appdetails return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsDetailsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/details") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.details.update" call. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *AppDetails.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &AppDetails{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Updates details of an app.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "httpMethod": "PUT", // "id": "androidpublisher.edits.details.update", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/details", // "request": { // "$ref": "AppDetails" // }, // "response": { // "$ref": "AppDetails" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.expansionfiles.get": type EditsExpansionfilesGetCall struct { s *Service packageName string editId string apkVersionCode int64 expansionFileType string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Fetches the expansion file configuration for the specified APK. // // - apkVersionCode: The version code of the APK whose expansion file // configuration is being read or modified. // - editId: Identifier of the edit. // - expansionFileType: The file type of the file configuration which is // being read or modified. // - packageName: Package name of the app. func (r *EditsExpansionfilesService) Get(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall { c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.apkVersionCode = apkVersionCode c.expansionFileType = expansionFileType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsExpansionfilesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.expansionfiles.get" call. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *ExpansionFile.ServerResponse.Header or (if a response was returned // at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Fetches the expansion file configuration for the specified APK.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "httpMethod": "GET", // "id": "androidpublisher.edits.expansionfiles.get", // "parameterOrder": [ // "packageName", // "editId", // "apkVersionCode", // "expansionFileType" // ], // "parameters": { // "apkVersionCode": { // "description": "The version code of the APK whose expansion file configuration is being read or modified.", // "format": "int32", // "location": "path", // "required": true, // "type": "integer" // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "expansionFileType": { // "description": "The file type of the file configuration which is being read or modified.", // "enum": [ // "expansionFileTypeUnspecified", // "main", // "patch" // ], // "enumDescriptions": [ // "Unspecified expansion file type.", // "Main expansion file.", // "Patch expansion file." // ], // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "response": { // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.expansionfiles.patch": type EditsExpansionfilesPatchCall struct { s *Service packageName string editId string apkVersionCode int64 expansionFileType string expansionfile *ExpansionFile urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Patches the APK's expansion file configuration to reference // another APK's expansion file. To add a new expansion file use the // Upload method. // // - apkVersionCode: The version code of the APK whose expansion file // configuration is being read or modified. // - editId: Identifier of the edit. // - expansionFileType: The file type of the expansion file // configuration which is being updated. // - packageName: Package name of the app. func (r *EditsExpansionfilesService) Patch(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall { c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.apkVersionCode = apkVersionCode c.expansionFileType = expansionFileType c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsExpansionfilesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.expansionfiles.patch" call. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *ExpansionFile.ServerResponse.Header or (if a response was returned // at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Patches the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "httpMethod": "PATCH", // "id": "androidpublisher.edits.expansionfiles.patch", // "parameterOrder": [ // "packageName", // "editId", // "apkVersionCode", // "expansionFileType" // ], // "parameters": { // "apkVersionCode": { // "description": "The version code of the APK whose expansion file configuration is being read or modified.", // "format": "int32", // "location": "path", // "required": true, // "type": "integer" // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "expansionFileType": { // "description": "The file type of the expansion file configuration which is being updated.", // "enum": [ // "expansionFileTypeUnspecified", // "main", // "patch" // ], // "enumDescriptions": [ // "Unspecified expansion file type.", // "Main expansion file.", // "Patch expansion file." // ], // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "request": { // "$ref": "ExpansionFile" // }, // "response": { // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.expansionfiles.update": type EditsExpansionfilesUpdateCall struct { s *Service packageName string editId string apkVersionCode int64 expansionFileType string expansionfile *ExpansionFile urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Update: Updates the APK's expansion file configuration to reference // another APK's expansion file. To add a new expansion file use the // Upload method. // // - apkVersionCode: The version code of the APK whose expansion file // configuration is being read or modified. // - editId: Identifier of the edit. // - expansionFileType: The file type of the file configuration which is // being read or modified. // - packageName: Package name of the app. func (r *EditsExpansionfilesService) Update(packageName string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall { c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.apkVersionCode = apkVersionCode c.expansionFileType = expansionFileType c.expansionfile = expansionfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsExpansionfilesUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.expansionfiles.update" call. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *ExpansionFile.ServerResponse.Header or (if a response was returned // at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ExpansionFile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Updates the APK's expansion file configuration to reference another APK's expansion file. To add a new expansion file use the Upload method.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "httpMethod": "PUT", // "id": "androidpublisher.edits.expansionfiles.update", // "parameterOrder": [ // "packageName", // "editId", // "apkVersionCode", // "expansionFileType" // ], // "parameters": { // "apkVersionCode": { // "description": "The version code of the APK whose expansion file configuration is being read or modified.", // "format": "int32", // "location": "path", // "required": true, // "type": "integer" // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "expansionFileType": { // "description": "The file type of the file configuration which is being read or modified.", // "enum": [ // "expansionFileTypeUnspecified", // "main", // "patch" // ], // "enumDescriptions": [ // "Unspecified expansion file type.", // "Main expansion file.", // "Patch expansion file." // ], // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "request": { // "$ref": "ExpansionFile" // }, // "response": { // "$ref": "ExpansionFile" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.expansionfiles.upload": type EditsExpansionfilesUploadCall struct { s *Service packageName string editId string apkVersionCode int64 expansionFileType string urlParams_ gensupport.URLParams mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } // Upload: Uploads a new expansion file and attaches to the specified // APK. // // - apkVersionCode: The version code of the APK whose expansion file // configuration is being read or modified. // - editId: Identifier of the edit. // - expansionFileType: The file type of the expansion file // configuration which is being updated. // - packageName: Package name of the app. func (r *EditsExpansionfilesService) Upload(packageName string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall { c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.apkVersionCode = apkVersionCode c.expansionFileType = expansionFileType return c } // Media specifies the media to upload in one or more chunks. The chunk // size may be controlled by supplying a MediaOption generated by // googleapi.ChunkSize. The chunk size defaults to // googleapi.DefaultUploadChunkSize.The Content-Type header used in the // upload request will be determined by sniffing the contents of r, // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } // ResumableMedia specifies the media to upload in chunks and can be // canceled with ctx. // // Deprecated: use Media instead. // // At most one of Media and ResumableMedia may be set. mediaType // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } // ProgressUpdater provides a callback function that will be called // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall { c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsExpansionfilesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") if c.mediaInfo_ != nil { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { body = new(bytes.Buffer) reqHeaders.Set("Content-Type", "application/json") } body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), "expansionFileType": c.expansionFileType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.expansionfiles.upload" call. // Exactly one of *ExpansionFilesUploadResponse or error will be // non-nil. Any non-2xx status code is an error. Response headers are in // either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a // response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) if rx != nil { rx.Client = c.s.client rx.UserAgent = c.s.userAgent() ctx := c.ctx_ if ctx == nil { ctx = context.TODO() } res, err = rx.Upload(ctx) if err != nil { return nil, err } defer res.Body.Close() if err := googleapi.CheckResponse(res); err != nil { return nil, err } } ret := &ExpansionFilesUploadResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Uploads a new expansion file and attaches to the specified APK.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "httpMethod": "POST", // "id": "androidpublisher.edits.expansionfiles.upload", // "mediaUpload": { // "accept": [ // "application/octet-stream" // ], // "maxSize": "2147483648", // "protocols": { // "resumable": { // "multipart": true, // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" // }, // "simple": { // "multipart": true, // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" // } // } // }, // "parameterOrder": [ // "packageName", // "editId", // "apkVersionCode", // "expansionFileType" // ], // "parameters": { // "apkVersionCode": { // "description": "The version code of the APK whose expansion file configuration is being read or modified.", // "format": "int32", // "location": "path", // "required": true, // "type": "integer" // }, // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "expansionFileType": { // "description": "The file type of the expansion file configuration which is being updated.", // "enum": [ // "expansionFileTypeUnspecified", // "main", // "patch" // ], // "enumDescriptions": [ // "Unspecified expansion file type.", // "Main expansion file.", // "Patch expansion file." // ], // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", // "response": { // "$ref": "ExpansionFilesUploadResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaUpload": true // } } // method id "androidpublisher.edits.images.delete": type EditsImagesDeleteCall struct { s *Service packageName string editId string language string imageType string imageId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Delete: Deletes the image (specified by id) from the edit. // // - editId: Identifier of the edit. // - imageId: Unique identifier an image within the set of images // attached to this edit. // - imageType: Type of the Image. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). // - packageName: Package name of the app. func (r *EditsImagesService) Delete(packageName string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall { c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language c.imageType = imageType c.imageId = imageId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsImagesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, "imageType": c.imageType, "imageId": c.imageId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.images.delete" call. func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Deletes the image (specified by id) from the edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", // "httpMethod": "DELETE", // "id": "androidpublisher.edits.images.delete", // "parameterOrder": [ // "packageName", // "editId", // "language", // "imageType", // "imageId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "imageId": { // "description": "Unique identifier an image within the set of images attached to this edit.", // "location": "path", // "required": true, // "type": "string" // }, // "imageType": { // "description": "Type of the Image.", // "enum": [ // "appImageTypeUnspecified", // "phoneScreenshots", // "sevenInchScreenshots", // "tenInchScreenshots", // "tvScreenshots", // "wearScreenshots", // "icon", // "featureGraphic", // "tvBanner" // ], // "enumDescriptions": [ // "Unspecified type. Do not use.", // "Phone screenshot.", // "Seven inch screenshot.", // "Ten inch screenshot.", // "TV screenshot.", // "Wear screenshot.", // "Icon.", // "Feature graphic.", // "TV banner." // ], // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.images.deleteall": type EditsImagesDeleteallCall struct { s *Service packageName string editId string language string imageType string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Deleteall: Deletes all images for the specified language and image // type. Returns an empty response if no images are found. // // - editId: Identifier of the edit. // - imageType: Type of the Image. Providing an image type that refers // to no images is a no-op. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). Providing a language that is // not supported by the App is a no-op. // - packageName: Package name of the app. func (r *EditsImagesService) Deleteall(packageName string, editId string, language string, imageType string) *EditsImagesDeleteallCall { c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language c.imageType = imageType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsImagesDeleteallCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.images.deleteall" call. // Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ImagesDeleteAllResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Deletes all images for the specified language and image type. Returns an empty response if no images are found.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "httpMethod": "DELETE", // "id": "androidpublisher.edits.images.deleteall", // "parameterOrder": [ // "packageName", // "editId", // "language", // "imageType" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "imageType": { // "description": "Type of the Image. Providing an image type that refers to no images is a no-op.", // "enum": [ // "appImageTypeUnspecified", // "phoneScreenshots", // "sevenInchScreenshots", // "tenInchScreenshots", // "tvScreenshots", // "wearScreenshots", // "icon", // "featureGraphic", // "tvBanner" // ], // "enumDescriptions": [ // "Unspecified type. Do not use.", // "Phone screenshot.", // "Seven inch screenshot.", // "Ten inch screenshot.", // "TV screenshot.", // "Wear screenshot.", // "Icon.", // "Feature graphic.", // "TV banner." // ], // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { // "$ref": "ImagesDeleteAllResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.images.list": type EditsImagesListCall struct { s *Service packageName string editId string language string imageType string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all images. The response may be empty. // // - editId: Identifier of the edit. // - imageType: Type of the Image. Providing an image type that refers // to no images will return an empty response. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). There must be a store // listing for the specified language. // - packageName: Package name of the app. func (r *EditsImagesService) List(packageName string, editId string, language string, imageType string) *EditsImagesListCall { c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language c.imageType = imageType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsImagesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.images.list" call. // Exactly one of *ImagesListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ImagesListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ImagesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all images. The response may be empty.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "httpMethod": "GET", // "id": "androidpublisher.edits.images.list", // "parameterOrder": [ // "packageName", // "editId", // "language", // "imageType" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "imageType": { // "description": "Type of the Image. Providing an image type that refers to no images will return an empty response.", // "enum": [ // "appImageTypeUnspecified", // "phoneScreenshots", // "sevenInchScreenshots", // "tenInchScreenshots", // "tvScreenshots", // "wearScreenshots", // "icon", // "featureGraphic", // "tvBanner" // ], // "enumDescriptions": [ // "Unspecified type. Do not use.", // "Phone screenshot.", // "Seven inch screenshot.", // "Ten inch screenshot.", // "TV screenshot.", // "Wear screenshot.", // "Icon.", // "Feature graphic.", // "TV banner." // ], // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). There must be a store listing for the specified language.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { // "$ref": "ImagesListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.images.upload": type EditsImagesUploadCall struct { s *Service packageName string editId string language string imageType string urlParams_ gensupport.URLParams mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } // Upload: Uploads an image of the specified language and image type, // and adds to the edit. // // - editId: Identifier of the edit. // - imageType: Type of the Image. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). Providing a language that is // not supported by the App is a no-op. // - packageName: Package name of the app. func (r *EditsImagesService) Upload(packageName string, editId string, language string, imageType string) *EditsImagesUploadCall { c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language c.imageType = imageType return c } // Media specifies the media to upload in one or more chunks. The chunk // size may be controlled by supplying a MediaOption generated by // googleapi.ChunkSize. The chunk size defaults to // googleapi.DefaultUploadChunkSize.The Content-Type header used in the // upload request will be determined by sniffing the contents of r, // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } // ResumableMedia specifies the media to upload in chunks and can be // canceled with ctx. // // Deprecated: use Media instead. // // At most one of Media and ResumableMedia may be set. mediaType // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } // ProgressUpdater provides a callback function that will be called // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall { c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsImagesUploadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") if c.mediaInfo_ != nil { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { body = new(bytes.Buffer) reqHeaders.Set("Content-Type", "application/json") } body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, "imageType": c.imageType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.images.upload" call. // Exactly one of *ImagesUploadResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ImagesUploadResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) if rx != nil { rx.Client = c.s.client rx.UserAgent = c.s.userAgent() ctx := c.ctx_ if ctx == nil { ctx = context.TODO() } res, err = rx.Upload(ctx) if err != nil { return nil, err } defer res.Body.Close() if err := googleapi.CheckResponse(res); err != nil { return nil, err } } ret := &ImagesUploadResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Uploads an image of the specified language and image type, and adds to the edit.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "httpMethod": "POST", // "id": "androidpublisher.edits.images.upload", // "mediaUpload": { // "accept": [ // "image/*" // ], // "maxSize": "15728640", // "protocols": { // "resumable": { // "multipart": true, // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" // }, // "simple": { // "multipart": true, // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" // } // } // }, // "parameterOrder": [ // "packageName", // "editId", // "language", // "imageType" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "imageType": { // "description": "Type of the Image.", // "enum": [ // "appImageTypeUnspecified", // "phoneScreenshots", // "sevenInchScreenshots", // "tenInchScreenshots", // "tvScreenshots", // "wearScreenshots", // "icon", // "featureGraphic", // "tvBanner" // ], // "enumDescriptions": [ // "Unspecified type. Do not use.", // "Phone screenshot.", // "Seven inch screenshot.", // "Ten inch screenshot.", // "TV screenshot.", // "Wear screenshot.", // "Icon.", // "Feature graphic.", // "TV banner." // ], // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German). Providing a language that is not supported by the App is a no-op.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", // "response": { // "$ref": "ImagesUploadResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaUpload": true // } } // method id "androidpublisher.edits.listings.delete": type EditsListingsDeleteCall struct { s *Service packageName string editId string language string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Delete: Deletes a localized store listing. // // - editId: Identifier of the edit. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). // - packageName: Package name of the app. func (r *EditsListingsService) Delete(packageName string, editId string, language string) *EditsListingsDeleteCall { c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsListingsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.listings.delete" call. func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Deletes a localized store listing.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "httpMethod": "DELETE", // "id": "androidpublisher.edits.listings.delete", // "parameterOrder": [ // "packageName", // "editId", // "language" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.listings.deleteall": type EditsListingsDeleteallCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Deleteall: Deletes all store listings. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsListingsService) Deleteall(packageName string, editId string) *EditsListingsDeleteallCall { c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsListingsDeleteallCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.listings.deleteall" call. func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Deletes all store listings.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "httpMethod": "DELETE", // "id": "androidpublisher.edits.listings.deleteall", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.listings.get": type EditsListingsGetCall struct { s *Service packageName string editId string language string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Gets a localized store listing. // // - editId: Identifier of the edit. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). // - packageName: Package name of the app. func (r *EditsListingsService) Get(packageName string, editId string, language string) *EditsListingsGetCall { c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsListingsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.listings.get" call. // Exactly one of *Listing or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Listing.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Gets a localized store listing.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "httpMethod": "GET", // "id": "androidpublisher.edits.listings.get", // "parameterOrder": [ // "packageName", // "editId", // "language" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "response": { // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.listings.list": type EditsListingsListCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all localized store listings. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsListingsService) List(packageName string, editId string) *EditsListingsListCall { c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsListingsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.listings.list" call. // Exactly one of *ListingsListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ListingsListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ListingsListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all localized store listings.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "httpMethod": "GET", // "id": "androidpublisher.edits.listings.list", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings", // "response": { // "$ref": "ListingsListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.listings.patch": type EditsListingsPatchCall struct { s *Service packageName string editId string language string listing *Listing urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Patches a localized store listing. // // - editId: Identifier of the edit. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). // - packageName: Package name of the app. func (r *EditsListingsService) Patch(packageName string, editId string, language string, listing *Listing) *EditsListingsPatchCall { c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language c.listing = listing return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsListingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.listings.patch" call. // Exactly one of *Listing or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Listing.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Patches a localized store listing.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "httpMethod": "PATCH", // "id": "androidpublisher.edits.listings.patch", // "parameterOrder": [ // "packageName", // "editId", // "language" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "request": { // "$ref": "Listing" // }, // "response": { // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.listings.update": type EditsListingsUpdateCall struct { s *Service packageName string editId string language string listing *Listing urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Update: Creates or updates a localized store listing. // // - editId: Identifier of the edit. // - language: Language localization code (a BCP-47 language tag; for // example, "de-AT" for Austrian German). // - packageName: Package name of the app. func (r *EditsListingsService) Update(packageName string, editId string, language string, listing *Listing) *EditsListingsUpdateCall { c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.language = language c.listing = listing return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsListingsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "language": c.language, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.listings.update" call. // Exactly one of *Listing or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Listing.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Listing{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Creates or updates a localized store listing.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "httpMethod": "PUT", // "id": "androidpublisher.edits.listings.update", // "parameterOrder": [ // "packageName", // "editId", // "language" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "language": { // "description": "Language localization code (a BCP-47 language tag; for example, \"de-AT\" for Austrian German).", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}", // "request": { // "$ref": "Listing" // }, // "response": { // "$ref": "Listing" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.testers.get": type EditsTestersGetCall struct { s *Service packageName string editId string track string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Gets testers. // // - editId: Identifier of the edit. // - packageName: Package name of the app. // - track: The track to read from. func (r *EditsTestersService) Get(packageName string, editId string, track string) *EditsTestersGetCall { c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.track = track return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsTestersGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.testers.get" call. // Exactly one of *Testers or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Testers.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Gets testers.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "httpMethod": "GET", // "id": "androidpublisher.edits.testers.get", // "parameterOrder": [ // "packageName", // "editId", // "track" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "track": { // "description": "The track to read from.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "response": { // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.testers.patch": type EditsTestersPatchCall struct { s *Service packageName string editId string track string testers *Testers urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Patches testers. // // - editId: Identifier of the edit. // - packageName: Package name of the app. // - track: The track to update. func (r *EditsTestersService) Patch(packageName string, editId string, track string, testers *Testers) *EditsTestersPatchCall { c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.track = track c.testers = testers return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsTestersPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.testers.patch" call. // Exactly one of *Testers or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Testers.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Patches testers.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "httpMethod": "PATCH", // "id": "androidpublisher.edits.testers.patch", // "parameterOrder": [ // "packageName", // "editId", // "track" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "track": { // "description": "The track to update.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "request": { // "$ref": "Testers" // }, // "response": { // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.testers.update": type EditsTestersUpdateCall struct { s *Service packageName string editId string track string testers *Testers urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Update: Updates testers. // // - editId: Identifier of the edit. // - packageName: Package name of the app. // - track: The track to update. func (r *EditsTestersService) Update(packageName string, editId string, track string, testers *Testers) *EditsTestersUpdateCall { c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.track = track c.testers = testers return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsTestersUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.testers.update" call. // Exactly one of *Testers or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Testers.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Testers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Updates testers.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "httpMethod": "PUT", // "id": "androidpublisher.edits.testers.update", // "parameterOrder": [ // "packageName", // "editId", // "track" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "track": { // "description": "The track to update.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}", // "request": { // "$ref": "Testers" // }, // "response": { // "$ref": "Testers" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.tracks.get": type EditsTracksGetCall struct { s *Service packageName string editId string track string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Gets a track. // // - editId: Identifier of the edit. // - packageName: Package name of the app. // - track: Identifier of the track. func (r *EditsTracksService) Get(packageName string, editId string, track string) *EditsTracksGetCall { c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.track = track return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsTracksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.tracks.get" call. // Exactly one of *Track or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Track.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Gets a track.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "httpMethod": "GET", // "id": "androidpublisher.edits.tracks.get", // "parameterOrder": [ // "packageName", // "editId", // "track" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "track": { // "description": "Identifier of the track.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "response": { // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.tracks.list": type EditsTracksListCall struct { s *Service packageName string editId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all tracks. // // - editId: Identifier of the edit. // - packageName: Package name of the app. func (r *EditsTracksService) List(packageName string, editId string) *EditsTracksListCall { c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsTracksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.tracks.list" call. // Exactly one of *TracksListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *TracksListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &TracksListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all tracks.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", // "httpMethod": "GET", // "id": "androidpublisher.edits.tracks.list", // "parameterOrder": [ // "packageName", // "editId" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks", // "response": { // "$ref": "TracksListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.tracks.patch": type EditsTracksPatchCall struct { s *Service packageName string editId string track string track2 *Track urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Patches a track. // // - editId: Identifier of the edit. // - packageName: Package name of the app. // - track: Identifier of the track. func (r *EditsTracksService) Patch(packageName string, editId string, track string, track2 *Track) *EditsTracksPatchCall { c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.track = track c.track2 = track2 return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsTracksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.tracks.patch" call. // Exactly one of *Track or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Track.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Patches a track.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "httpMethod": "PATCH", // "id": "androidpublisher.edits.tracks.patch", // "parameterOrder": [ // "packageName", // "editId", // "track" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "track": { // "description": "Identifier of the track.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "request": { // "$ref": "Track" // }, // "response": { // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.edits.tracks.update": type EditsTracksUpdateCall struct { s *Service packageName string editId string track string track2 *Track urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Update: Updates a track. // // - editId: Identifier of the edit. // - packageName: Package name of the app. // - track: Identifier of the track. func (r *EditsTracksService) Update(packageName string, editId string, track string, track2 *Track) *EditsTracksUpdateCall { c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.editId = editId c.track = track c.track2 = track2 return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *EditsTracksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "editId": c.editId, "track": c.track, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.edits.tracks.update" call. // Exactly one of *Track or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Track.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Track{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Updates a track.", // "flatPath": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "httpMethod": "PUT", // "id": "androidpublisher.edits.tracks.update", // "parameterOrder": [ // "packageName", // "editId", // "track" // ], // "parameters": { // "editId": { // "description": "Identifier of the edit.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "track": { // "description": "Identifier of the track.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}", // "request": { // "$ref": "Track" // }, // "response": { // "$ref": "Track" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.grants.create": type GrantsCreateCall struct { s *Service parent string grant *Grant urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Create: Grant access for a user to the given package. // // - parent: The user which needs permission. Format: // developers/{developer}/users/{user}. func (r *GrantsService) Create(parent string, grant *Grant) *GrantsCreateCall { c := &GrantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent c.grant = grant return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GrantsCreateCall) Fields(s ...googleapi.Field) *GrantsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *GrantsCreateCall) Context(ctx context.Context) *GrantsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *GrantsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *GrantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/grants") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.grants.create" call. // Exactly one of *Grant or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Grant.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *GrantsCreateCall) Do(opts ...googleapi.CallOption) (*Grant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Grant{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Grant access for a user to the given package.", // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants", // "httpMethod": "POST", // "id": "androidpublisher.grants.create", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { // "description": "Required. The user which needs permission. Format: developers/{developer}/users/{user}", // "location": "path", // "pattern": "^developers/[^/]+/users/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/{+parent}/grants", // "request": { // "$ref": "Grant" // }, // "response": { // "$ref": "Grant" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.grants.delete": type GrantsDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Delete: Removes all access for the user to the given package or // developer account. // // - name: The name of the grant to delete. Format: // developers/{developer}/users/{email}/grants/{package_name}. func (r *GrantsService) Delete(name string) *GrantsDeleteCall { c := &GrantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GrantsDeleteCall) Fields(s ...googleapi.Field) *GrantsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *GrantsDeleteCall) Context(ctx context.Context) *GrantsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *GrantsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *GrantsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.grants.delete" call. func (c *GrantsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Removes all access for the user to the given package or developer account.", // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", // "httpMethod": "DELETE", // "id": "androidpublisher.grants.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { // "description": "Required. The name of the grant to delete. Format: developers/{developer}/users/{email}/grants/{package_name}", // "location": "path", // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/{+name}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.grants.patch": type GrantsPatchCall struct { s *Service name string grant *Grant urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Updates access for the user to the given package. // // - name: Resource name for this grant, following the pattern // "developers/{developer}/users/{email}/grants/{package_name}". func (r *GrantsService) Patch(name string, grant *Grant) *GrantsPatchCall { c := &GrantsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name c.grant = grant return c } // UpdateMask sets the optional parameter "updateMask": The list of // fields to be updated. func (c *GrantsPatchCall) UpdateMask(updateMask string) *GrantsPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GrantsPatchCall) Fields(s ...googleapi.Field) *GrantsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *GrantsPatchCall) Context(ctx context.Context) *GrantsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *GrantsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *GrantsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.grant) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.grants.patch" call. // Exactly one of *Grant or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Grant.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *GrantsPatchCall) Do(opts ...googleapi.CallOption) (*Grant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Grant{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Updates access for the user to the given package.", // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}/grants/{grantsId}", // "httpMethod": "PATCH", // "id": "androidpublisher.grants.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { // "description": "Required. Resource name for this grant, following the pattern \"developers/{developer}/users/{email}/grants/{package_name}\".", // "location": "path", // "pattern": "^developers/[^/]+/users/[^/]+/grants/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { // "description": "Optional. The list of fields to be updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, // "path": "androidpublisher/v3/{+name}", // "request": { // "$ref": "Grant" // }, // "response": { // "$ref": "Grant" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.inappproducts.delete": type InappproductsDeleteCall struct { s *Service packageName string skuid string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Delete: Deletes an in-app product (i.e. a managed product or a // subscriptions). // // - packageName: Package name of the app. // - sku: Unique identifier for the in-app product. func (r *InappproductsService) Delete(packageName string, skuid string) *InappproductsDeleteCall { c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.skuid = skuid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InappproductsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.inappproducts.delete" call. func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Deletes an in-app product (i.e. a managed product or a subscriptions).", // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "httpMethod": "DELETE", // "id": "androidpublisher.inappproducts.delete", // "parameterOrder": [ // "packageName", // "sku" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "sku": { // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.inappproducts.get": type InappproductsGetCall struct { s *Service packageName string skuid string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Gets an in-app product, which can be a managed product or a // subscription. // // - packageName: Package name of the app. // - sku: Unique identifier for the in-app product. func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall { c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.skuid = skuid return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InappproductsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.inappproducts.get" call. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *InAppProduct.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Gets an in-app product, which can be a managed product or a subscription.", // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "httpMethod": "GET", // "id": "androidpublisher.inappproducts.get", // "parameterOrder": [ // "packageName", // "sku" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "sku": { // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "response": { // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.inappproducts.insert": type InappproductsInsertCall struct { s *Service packageName string inappproduct *InAppProduct urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Insert: Creates an in-app product (i.e. a managed product or a // subscriptions). // // - packageName: Package name of the app. func (r *InappproductsService) Insert(packageName string, inappproduct *InAppProduct) *InappproductsInsertCall { c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.inappproduct = inappproduct return c } // AutoConvertMissingPrices sets the optional parameter // "autoConvertMissingPrices": If true the prices for all regions // targeted by the parent app that don't have a price specified for this // in-app product will be auto converted to the target currency based on // the default price. Defaults to false. func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall { c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InappproductsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.inappproducts.insert" call. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *InAppProduct.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Creates an in-app product (i.e. a managed product or a subscriptions).", // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", // "httpMethod": "POST", // "id": "androidpublisher.inappproducts.insert", // "parameterOrder": [ // "packageName" // ], // "parameters": { // "autoConvertMissingPrices": { // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", // "location": "query", // "type": "boolean" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", // "request": { // "$ref": "InAppProduct" // }, // "response": { // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.inappproducts.list": type InappproductsListCall struct { s *Service packageName string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all in-app products - both managed products and // subscriptions. If an app has a large number of in-app products, the // response may be paginated. In this case the response field // `tokenPagination.nextPageToken` will be set and the caller should // provide its value as a `token` request parameter to retrieve the next // page. // // - packageName: Package name of the app. func (r *InappproductsService) List(packageName string) *InappproductsListCall { c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName return c } // MaxResults sets the optional parameter "maxResults": Deprecated and // ignored. The page size is determined by the server. func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } // StartIndex sets the optional parameter "startIndex": Deprecated and // ignored. Set the `token` parameter to rertieve the next page. func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall { c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) return c } // Token sets the optional parameter "token": Pagination token. If // empty, list starts at the first product. func (c *InappproductsListCall) Token(token string) *InappproductsListCall { c.urlParams_.Set("token", token) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InappproductsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.inappproducts.list" call. // Exactly one of *InappproductsListResponse or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *InappproductsListResponse.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &InappproductsListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all in-app products - both managed products and subscriptions. If an app has a large number of in-app products, the response may be paginated. In this case the response field `tokenPagination.nextPageToken` will be set and the caller should provide its value as a `token` request parameter to retrieve the next page.", // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts", // "httpMethod": "GET", // "id": "androidpublisher.inappproducts.list", // "parameterOrder": [ // "packageName" // ], // "parameters": { // "maxResults": { // "description": "Deprecated and ignored. The page size is determined by the server.", // "format": "uint32", // "location": "query", // "type": "integer" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "startIndex": { // "description": "Deprecated and ignored. Set the `token` parameter to rertieve the next page.", // "format": "uint32", // "location": "query", // "type": "integer" // }, // "token": { // "description": "Pagination token. If empty, list starts at the first product.", // "location": "query", // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/inappproducts", // "response": { // "$ref": "InappproductsListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.inappproducts.patch": type InappproductsPatchCall struct { s *Service packageName string skuid string inappproduct *InAppProduct urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Patches an in-app product (i.e. a managed product or a // subscriptions). // // - packageName: Package name of the app. // - sku: Unique identifier for the in-app product. func (r *InappproductsService) Patch(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall { c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.skuid = skuid c.inappproduct = inappproduct return c } // AutoConvertMissingPrices sets the optional parameter // "autoConvertMissingPrices": If true the prices for all regions // targeted by the parent app that don't have a price specified for this // in-app product will be auto converted to the target currency based on // the default price. Defaults to false. func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall { c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InappproductsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.inappproducts.patch" call. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *InAppProduct.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Patches an in-app product (i.e. a managed product or a subscriptions).", // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "httpMethod": "PATCH", // "id": "androidpublisher.inappproducts.patch", // "parameterOrder": [ // "packageName", // "sku" // ], // "parameters": { // "autoConvertMissingPrices": { // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", // "location": "query", // "type": "boolean" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "sku": { // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "request": { // "$ref": "InAppProduct" // }, // "response": { // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.inappproducts.update": type InappproductsUpdateCall struct { s *Service packageName string skuid string inappproduct *InAppProduct urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Update: Updates an in-app product (i.e. a managed product or a // subscriptions). // // - packageName: Package name of the app. // - sku: Unique identifier for the in-app product. func (r *InappproductsService) Update(packageName string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall { c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.skuid = skuid c.inappproduct = inappproduct return c } // AllowMissing sets the optional parameter "allowMissing": If set to // true, and the in-app product with the given package_name and sku // doesn't exist, the in-app product will be created. func (c *InappproductsUpdateCall) AllowMissing(allowMissing bool) *InappproductsUpdateCall { c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // AutoConvertMissingPrices sets the optional parameter // "autoConvertMissingPrices": If true the prices for all regions // targeted by the parent app that don't have a price specified for this // in-app product will be auto converted to the target currency based on // the default price. Defaults to false. func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall { c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InappproductsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "sku": c.skuid, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.inappproducts.update" call. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *InAppProduct.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &InAppProduct{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Updates an in-app product (i.e. a managed product or a subscriptions).", // "flatPath": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "httpMethod": "PUT", // "id": "androidpublisher.inappproducts.update", // "parameterOrder": [ // "packageName", // "sku" // ], // "parameters": { // "allowMissing": { // "description": "If set to true, and the in-app product with the given package_name and sku doesn't exist, the in-app product will be created.", // "location": "query", // "type": "boolean" // }, // "autoConvertMissingPrices": { // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", // "location": "query", // "type": "boolean" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "sku": { // "description": "Unique identifier for the in-app product.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/inappproducts/{sku}", // "request": { // "$ref": "InAppProduct" // }, // "response": { // "$ref": "InAppProduct" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.internalappsharingartifacts.uploadapk": type InternalappsharingartifactsUploadapkCall struct { s *Service packageName string urlParams_ gensupport.URLParams mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } // Uploadapk: Uploads an APK to internal app sharing. If you are using // the Google API client libraries, please increase the timeout of the // http request before calling this endpoint (a timeout of 2 minutes is // recommended). See Timeouts and Errors // (https://developers.google.com/api-client-library/java/google-api-java-client/errors) // for an example in java. // // - packageName: Package name of the app. func (r *InternalappsharingartifactsService) Uploadapk(packageName string) *InternalappsharingartifactsUploadapkCall { c := &InternalappsharingartifactsUploadapkCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName return c } // Media specifies the media to upload in one or more chunks. The chunk // size may be controlled by supplying a MediaOption generated by // googleapi.ChunkSize. The chunk size defaults to // googleapi.DefaultUploadChunkSize.The Content-Type header used in the // upload request will be determined by sniffing the contents of r, // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. func (c *InternalappsharingartifactsUploadapkCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadapkCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } // ResumableMedia specifies the media to upload in chunks and can be // canceled with ctx. // // Deprecated: use Media instead. // // At most one of Media and ResumableMedia may be set. mediaType // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. func (c *InternalappsharingartifactsUploadapkCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadapkCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } // ProgressUpdater provides a callback function that will be called // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). func (c *InternalappsharingartifactsUploadapkCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadapkCall { c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InternalappsharingartifactsUploadapkCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadapkCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. func (c *InternalappsharingartifactsUploadapkCall) Context(ctx context.Context) *InternalappsharingartifactsUploadapkCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InternalappsharingartifactsUploadapkCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InternalappsharingartifactsUploadapkCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") if c.mediaInfo_ != nil { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { body = new(bytes.Buffer) reqHeaders.Set("Content-Type", "application/json") } body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.internalappsharingartifacts.uploadapk" call. // Exactly one of *InternalAppSharingArtifact or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *InternalAppSharingArtifact.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *InternalappsharingartifactsUploadapkCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) if rx != nil { rx.Client = c.s.client rx.UserAgent = c.s.userAgent() ctx := c.ctx_ if ctx == nil { ctx = context.TODO() } res, err = rx.Upload(ctx) if err != nil { return nil, err } defer res.Body.Close() if err := googleapi.CheckResponse(res); err != nil { return nil, err } } ret := &InternalAppSharingArtifact{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", // "httpMethod": "POST", // "id": "androidpublisher.internalappsharingartifacts.uploadapk", // "mediaUpload": { // "accept": [ // "application/octet-stream", // "application/vnd.android.package-archive" // ], // "maxSize": "1073741824", // "protocols": { // "resumable": { // "multipart": true, // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" // }, // "simple": { // "multipart": true, // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk" // } // } // }, // "parameterOrder": [ // "packageName" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk", // "response": { // "$ref": "InternalAppSharingArtifact" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaUpload": true // } } // method id "androidpublisher.internalappsharingartifacts.uploadbundle": type InternalappsharingartifactsUploadbundleCall struct { s *Service packageName string urlParams_ gensupport.URLParams mediaInfo_ *gensupport.MediaInfo ctx_ context.Context header_ http.Header } // Uploadbundle: Uploads an app bundle to internal app sharing. If you // are using the Google API client libraries, please increase the // timeout of the http request before calling this endpoint (a timeout // of 2 minutes is recommended). See Timeouts and Errors // (https://developers.google.com/api-client-library/java/google-api-java-client/errors) // for an example in java. // // - packageName: Package name of the app. func (r *InternalappsharingartifactsService) Uploadbundle(packageName string) *InternalappsharingartifactsUploadbundleCall { c := &InternalappsharingartifactsUploadbundleCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName return c } // Media specifies the media to upload in one or more chunks. The chunk // size may be controlled by supplying a MediaOption generated by // googleapi.ChunkSize. The chunk size defaults to // googleapi.DefaultUploadChunkSize.The Content-Type header used in the // upload request will be determined by sniffing the contents of r, // unless a MediaOption generated by googleapi.ContentType is // supplied. // At most one of Media and ResumableMedia may be set. func (c *InternalappsharingartifactsUploadbundleCall) Media(r io.Reader, options ...googleapi.MediaOption) *InternalappsharingartifactsUploadbundleCall { c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) return c } // ResumableMedia specifies the media to upload in chunks and can be // canceled with ctx. // // Deprecated: use Media instead. // // At most one of Media and ResumableMedia may be set. mediaType // identifies the MIME media type of the upload, such as "image/png". If // mediaType is "", it will be auto-detected. The provided ctx will // supersede any context previously provided to the Context method. func (c *InternalappsharingartifactsUploadbundleCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *InternalappsharingartifactsUploadbundleCall { c.ctx_ = ctx c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) return c } // ProgressUpdater provides a callback function that will be called // after every chunk. It should be a low-latency function in order to // not slow down the upload operation. This should only be called when // using ResumableMedia (as opposed to Media). func (c *InternalappsharingartifactsUploadbundleCall) ProgressUpdater(pu googleapi.ProgressUpdater) *InternalappsharingartifactsUploadbundleCall { c.mediaInfo_.SetProgressUpdater(pu) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InternalappsharingartifactsUploadbundleCall) Fields(s ...googleapi.Field) *InternalappsharingartifactsUploadbundleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. // This context will supersede any context previously provided to the // ResumableMedia method. func (c *InternalappsharingartifactsUploadbundleCall) Context(ctx context.Context) *InternalappsharingartifactsUploadbundleCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *InternalappsharingartifactsUploadbundleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *InternalappsharingartifactsUploadbundleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") if c.mediaInfo_ != nil { urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle") c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) } if body == nil { body = new(bytes.Buffer) reqHeaders.Set("Content-Type", "application/json") } body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) defer cleanup() urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders req.GetBody = getBody googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.internalappsharingartifacts.uploadbundle" call. // Exactly one of *InternalAppSharingArtifact or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *InternalAppSharingArtifact.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *InternalappsharingartifactsUploadbundleCall) Do(opts ...googleapi.CallOption) (*InternalAppSharingArtifact, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) if rx != nil { rx.Client = c.s.client rx.UserAgent = c.s.userAgent() ctx := c.ctx_ if ctx == nil { ctx = context.TODO() } res, err = rx.Upload(ctx) if err != nil { return nil, err } defer res.Body.Close() if err := googleapi.CheckResponse(res); err != nil { return nil, err } } ret := &InternalAppSharingArtifact{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.", // "flatPath": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", // "httpMethod": "POST", // "id": "androidpublisher.internalappsharingartifacts.uploadbundle", // "mediaUpload": { // "accept": [ // "application/octet-stream" // ], // "maxSize": "10737418240", // "protocols": { // "resumable": { // "multipart": true, // "path": "/resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" // }, // "simple": { // "multipart": true, // "path": "/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle" // } // } // }, // "parameterOrder": [ // "packageName" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", // "response": { // "$ref": "InternalAppSharingArtifact" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaUpload": true // } } // method id "androidpublisher.monetization.convertRegionPrices": type MonetizationConvertRegionPricesCall struct { s *Service packageName string convertregionpricesrequest *ConvertRegionPricesRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // ConvertRegionPrices: Calculates the region prices, using today's // exchange rate and country-specific pricing patterns, based on the // price in the request for a set of regions. // // - packageName: The app package name. func (r *MonetizationService) ConvertRegionPrices(packageName string, convertregionpricesrequest *ConvertRegionPricesRequest) *MonetizationConvertRegionPricesCall { c := &MonetizationConvertRegionPricesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.convertregionpricesrequest = convertregionpricesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *MonetizationConvertRegionPricesCall) Fields(s ...googleapi.Field) *MonetizationConvertRegionPricesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *MonetizationConvertRegionPricesCall) Context(ctx context.Context) *MonetizationConvertRegionPricesCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *MonetizationConvertRegionPricesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *MonetizationConvertRegionPricesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.convertregionpricesrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.monetization.convertRegionPrices" call. // Exactly one of *ConvertRegionPricesResponse or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *ConvertRegionPricesResponse.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *MonetizationConvertRegionPricesCall) Do(opts ...googleapi.CallOption) (*ConvertRegionPricesResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ConvertRegionPricesResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Calculates the region prices, using today's exchange rate and country-specific pricing patterns, based on the price in the request for a set of regions.", // "flatPath": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", // "httpMethod": "POST", // "id": "androidpublisher.monetization.convertRegionPrices", // "parameterOrder": [ // "packageName" // ], // "parameters": { // "packageName": { // "description": "Required. The app package name.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices", // "request": { // "$ref": "ConvertRegionPricesRequest" // }, // "response": { // "$ref": "ConvertRegionPricesResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.orders.refund": type OrdersRefundCall struct { s *Service packageName string orderId string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Refund: Refunds a user's subscription or in-app purchase order. // Orders older than 1 year cannot be refunded. // // - orderId: The order ID provided to the user when the subscription or // in-app order was purchased. // - packageName: The package name of the application for which this // subscription or in-app item was purchased (for example, // 'com.some.thing'). func (r *OrdersService) Refund(packageName string, orderId string) *OrdersRefundCall { c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.orderId = orderId return c } // Revoke sets the optional parameter "revoke": Whether to revoke the // purchased item. If set to true, access to the subscription or in-app // item will be terminated immediately. If the item is a recurring // subscription, all future payments will also be terminated. Consumed // in-app items need to be handled by developer's app. (optional). func (c *OrdersRefundCall) Revoke(revoke bool) *OrdersRefundCall { c.urlParams_.Set("revoke", fmt.Sprint(revoke)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *OrdersRefundCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/orders/{orderId}:refund") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "orderId": c.orderId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.orders.refund" call. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Refunds a user's subscription or in-app purchase order. Orders older than 1 year cannot be refunded.", // "flatPath": "androidpublisher/v3/applications/{packageName}/orders/{orderId}:refund", // "httpMethod": "POST", // "id": "androidpublisher.orders.refund", // "parameterOrder": [ // "packageName", // "orderId" // ], // "parameters": { // "orderId": { // "description": "The order ID provided to the user when the subscription or in-app order was purchased.", // "location": "path", // "required": true, // "type": "string" // }, // "packageName": { // "description": "The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "revoke": { // "description": "Whether to revoke the purchased item. If set to true, access to the subscription or in-app item will be terminated immediately. If the item is a recurring subscription, all future payments will also be terminated. Consumed in-app items need to be handled by developer's app. (optional).", // "location": "query", // "type": "boolean" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/orders/{orderId}:refund", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.products.acknowledge": type PurchasesProductsAcknowledgeCall struct { s *Service packageName string productId string token string productpurchasesacknowledgerequest *ProductPurchasesAcknowledgeRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Acknowledge: Acknowledges a purchase of an inapp item. // // - packageName: The package name of the application the inapp product // was sold in (for example, 'com.some.thing'). // - productId: The inapp product SKU (for example, // 'com.some.thing.inapp1'). // - token: The token provided to the user's device when the inapp // product was purchased. func (r *PurchasesProductsService) Acknowledge(packageName string, productId string, token string, productpurchasesacknowledgerequest *ProductPurchasesAcknowledgeRequest) *PurchasesProductsAcknowledgeCall { c := &PurchasesProductsAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId c.token = token c.productpurchasesacknowledgerequest = productpurchasesacknowledgerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesProductsAcknowledgeCall) Fields(s ...googleapi.Field) *PurchasesProductsAcknowledgeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesProductsAcknowledgeCall) Context(ctx context.Context) *PurchasesProductsAcknowledgeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesProductsAcknowledgeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesProductsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.productpurchasesacknowledgerequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "productId": c.productId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.products.acknowledge" call. func (c *PurchasesProductsAcknowledgeCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Acknowledges a purchase of an inapp item.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge", // "httpMethod": "POST", // "id": "androidpublisher.purchases.products.acknowledge", // "parameterOrder": [ // "packageName", // "productId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { // "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the inapp product was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge", // "request": { // "$ref": "ProductPurchasesAcknowledgeRequest" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.products.get": type PurchasesProductsGetCall struct { s *Service packageName string productId string token string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Checks the purchase and consumption status of an inapp item. // // - packageName: The package name of the application the inapp product // was sold in (for example, 'com.some.thing'). // - productId: The inapp product SKU (for example, // 'com.some.thing.inapp1'). // - token: The token provided to the user's device when the inapp // product was purchased. func (r *PurchasesProductsService) Get(packageName string, productId string, token string) *PurchasesProductsGetCall { c := &PurchasesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.productId = productId c.token = token return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *PurchasesProductsGetCall) IfNoneMatch(entityTag string) *PurchasesProductsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesProductsGetCall) Context(ctx context.Context) *PurchasesProductsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesProductsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesProductsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "productId": c.productId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.products.get" call. // Exactly one of *ProductPurchase or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *ProductPurchase.ServerResponse.Header or (if a response was returned // at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *PurchasesProductsGetCall) Do(opts ...googleapi.CallOption) (*ProductPurchase, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ProductPurchase{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Checks the purchase and consumption status of an inapp item.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}", // "httpMethod": "GET", // "id": "androidpublisher.purchases.products.get", // "parameterOrder": [ // "packageName", // "productId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "productId": { // "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the inapp product was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}", // "response": { // "$ref": "ProductPurchase" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.subscriptions.acknowledge": type PurchasesSubscriptionsAcknowledgeCall struct { s *Service packageName string subscriptionId string token string subscriptionpurchasesacknowledgerequest *SubscriptionPurchasesAcknowledgeRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Acknowledge: Acknowledges a subscription purchase. // // - packageName: The package name of the application for which this // subscription was purchased (for example, 'com.some.thing'). // - subscriptionId: The purchased subscription ID (for example, // 'monthly001'). // - token: The token provided to the user's device when the // subscription was purchased. func (r *PurchasesSubscriptionsService) Acknowledge(packageName string, subscriptionId string, token string, subscriptionpurchasesacknowledgerequest *SubscriptionPurchasesAcknowledgeRequest) *PurchasesSubscriptionsAcknowledgeCall { c := &PurchasesSubscriptionsAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.subscriptionId = subscriptionId c.token = token c.subscriptionpurchasesacknowledgerequest = subscriptionpurchasesacknowledgerequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesSubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsAcknowledgeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesSubscriptionsAcknowledgeCall) Context(ctx context.Context) *PurchasesSubscriptionsAcknowledgeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesSubscriptionsAcknowledgeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesSubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesacknowledgerequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "subscriptionId": c.subscriptionId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.subscriptions.acknowledge" call. func (c *PurchasesSubscriptionsAcknowledgeCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Acknowledges a subscription purchase.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge", // "httpMethod": "POST", // "id": "androidpublisher.purchases.subscriptions.acknowledge", // "parameterOrder": [ // "packageName", // "subscriptionId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "subscriptionId": { // "description": "The purchased subscription ID (for example, 'monthly001').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the subscription was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge", // "request": { // "$ref": "SubscriptionPurchasesAcknowledgeRequest" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.subscriptions.cancel": type PurchasesSubscriptionsCancelCall struct { s *Service packageName string subscriptionId string token string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Cancel: Cancels a user's subscription purchase. The subscription // remains valid until its expiration time. // // - packageName: The package name of the application for which this // subscription was purchased (for example, 'com.some.thing'). // - subscriptionId: The purchased subscription ID (for example, // 'monthly001'). // - token: The token provided to the user's device when the // subscription was purchased. func (r *PurchasesSubscriptionsService) Cancel(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsCancelCall { c := &PurchasesSubscriptionsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.subscriptionId = subscriptionId c.token = token return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesSubscriptionsCancelCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsCancelCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesSubscriptionsCancelCall) Context(ctx context.Context) *PurchasesSubscriptionsCancelCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesSubscriptionsCancelCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "subscriptionId": c.subscriptionId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.subscriptions.cancel" call. func (c *PurchasesSubscriptionsCancelCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel", // "httpMethod": "POST", // "id": "androidpublisher.purchases.subscriptions.cancel", // "parameterOrder": [ // "packageName", // "subscriptionId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "subscriptionId": { // "description": "The purchased subscription ID (for example, 'monthly001').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the subscription was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.subscriptions.defer": type PurchasesSubscriptionsDeferCall struct { s *Service packageName string subscriptionId string token string subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Defer: Defers a user's subscription purchase until a specified future // expiration time. // // - packageName: The package name of the application for which this // subscription was purchased (for example, 'com.some.thing'). // - subscriptionId: The purchased subscription ID (for example, // 'monthly001'). // - token: The token provided to the user's device when the // subscription was purchased. func (r *PurchasesSubscriptionsService) Defer(packageName string, subscriptionId string, token string, subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest) *PurchasesSubscriptionsDeferCall { c := &PurchasesSubscriptionsDeferCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.subscriptionId = subscriptionId c.token = token c.subscriptionpurchasesdeferrequest = subscriptionpurchasesdeferrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesSubscriptionsDeferCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsDeferCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesSubscriptionsDeferCall) Context(ctx context.Context) *PurchasesSubscriptionsDeferCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesSubscriptionsDeferCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesSubscriptionsDeferCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesdeferrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "subscriptionId": c.subscriptionId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.subscriptions.defer" call. // Exactly one of *SubscriptionPurchasesDeferResponse or error will be // non-nil. Any non-2xx status code is an error. Response headers are in // either *SubscriptionPurchasesDeferResponse.ServerResponse.Header or // (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. func (c *PurchasesSubscriptionsDeferCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchasesDeferResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &SubscriptionPurchasesDeferResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Defers a user's subscription purchase until a specified future expiration time.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer", // "httpMethod": "POST", // "id": "androidpublisher.purchases.subscriptions.defer", // "parameterOrder": [ // "packageName", // "subscriptionId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "subscriptionId": { // "description": "The purchased subscription ID (for example, 'monthly001').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the subscription was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer", // "request": { // "$ref": "SubscriptionPurchasesDeferRequest" // }, // "response": { // "$ref": "SubscriptionPurchasesDeferResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.subscriptions.get": type PurchasesSubscriptionsGetCall struct { s *Service packageName string subscriptionId string token string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Checks whether a user's subscription purchase is valid and // returns its expiry time. // // - packageName: The package name of the application for which this // subscription was purchased (for example, 'com.some.thing'). // - subscriptionId: The purchased subscription ID (for example, // 'monthly001'). // - token: The token provided to the user's device when the // subscription was purchased. func (r *PurchasesSubscriptionsService) Get(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsGetCall { c := &PurchasesSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.subscriptionId = subscriptionId c.token = token return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesSubscriptionsGetCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *PurchasesSubscriptionsGetCall) IfNoneMatch(entityTag string) *PurchasesSubscriptionsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesSubscriptionsGetCall) Context(ctx context.Context) *PurchasesSubscriptionsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesSubscriptionsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "subscriptionId": c.subscriptionId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.subscriptions.get" call. // Exactly one of *SubscriptionPurchase or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *SubscriptionPurchase.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *PurchasesSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchase, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &SubscriptionPurchase{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}", // "httpMethod": "GET", // "id": "androidpublisher.purchases.subscriptions.get", // "parameterOrder": [ // "packageName", // "subscriptionId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "subscriptionId": { // "description": "The purchased subscription ID (for example, 'monthly001').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the subscription was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}", // "response": { // "$ref": "SubscriptionPurchase" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.subscriptions.refund": type PurchasesSubscriptionsRefundCall struct { s *Service packageName string subscriptionId string token string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Refund: Refunds a user's subscription purchase, but the subscription // remains valid until its expiration time and it will continue to // recur. // // - packageName: The package name of the application for which this // subscription was purchased (for example, 'com.some.thing'). // - subscriptionId: "The purchased subscription ID (for example, // 'monthly001'). // - token: The token provided to the user's device when the // subscription was purchased. func (r *PurchasesSubscriptionsService) Refund(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRefundCall { c := &PurchasesSubscriptionsRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.subscriptionId = subscriptionId c.token = token return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesSubscriptionsRefundCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRefundCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesSubscriptionsRefundCall) Context(ctx context.Context) *PurchasesSubscriptionsRefundCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesSubscriptionsRefundCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesSubscriptionsRefundCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "subscriptionId": c.subscriptionId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.subscriptions.refund" call. func (c *PurchasesSubscriptionsRefundCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund", // "httpMethod": "POST", // "id": "androidpublisher.purchases.subscriptions.refund", // "parameterOrder": [ // "packageName", // "subscriptionId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "subscriptionId": { // "description": "\"The purchased subscription ID (for example, 'monthly001').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the subscription was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.subscriptions.revoke": type PurchasesSubscriptionsRevokeCall struct { s *Service packageName string subscriptionId string token string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Revoke: Refunds and immediately revokes a user's subscription // purchase. Access to the subscription will be terminated immediately // and it will stop recurring. // // - packageName: The package name of the application for which this // subscription was purchased (for example, 'com.some.thing'). // - subscriptionId: The purchased subscription ID (for example, // 'monthly001'). // - token: The token provided to the user's device when the // subscription was purchased. func (r *PurchasesSubscriptionsService) Revoke(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRevokeCall { c := &PurchasesSubscriptionsRevokeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.subscriptionId = subscriptionId c.token = token return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesSubscriptionsRevokeCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRevokeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesSubscriptionsRevokeCall) Context(ctx context.Context) *PurchasesSubscriptionsRevokeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesSubscriptionsRevokeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "subscriptionId": c.subscriptionId, "token": c.token, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.subscriptions.revoke" call. func (c *PurchasesSubscriptionsRevokeCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke", // "httpMethod": "POST", // "id": "androidpublisher.purchases.subscriptions.revoke", // "parameterOrder": [ // "packageName", // "subscriptionId", // "token" // ], // "parameters": { // "packageName": { // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "subscriptionId": { // "description": "The purchased subscription ID (for example, 'monthly001').", // "location": "path", // "required": true, // "type": "string" // }, // "token": { // "description": "The token provided to the user's device when the subscription was purchased.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.purchases.voidedpurchases.list": type PurchasesVoidedpurchasesListCall struct { s *Service packageName string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists the purchases that were canceled, refunded or // charged-back. // // - packageName: The package name of the application for which voided // purchases need to be returned (for example, 'com.some.thing'). func (r *PurchasesVoidedpurchasesService) List(packageName string) *PurchasesVoidedpurchasesListCall { c := &PurchasesVoidedpurchasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName return c } // EndTime sets the optional parameter "endTime": The time, in // milliseconds since the Epoch, of the newest voided purchase that you // want to see in the response. The value of this parameter cannot be // greater than the current time and is ignored if a pagination token is // set. Default value is current time. Note: This filter is applied on // the time at which the record is seen as voided by our systems and not // the actual voided time returned in the response. func (c *PurchasesVoidedpurchasesListCall) EndTime(endTime int64) *PurchasesVoidedpurchasesListCall { c.urlParams_.Set("endTime", fmt.Sprint(endTime)) return c } // MaxResults sets the optional parameter "maxResults": Defines how many // results the list operation should return. The default number depends // on the resource collection. func (c *PurchasesVoidedpurchasesListCall) MaxResults(maxResults int64) *PurchasesVoidedpurchasesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } // StartIndex sets the optional parameter "startIndex": Defines the // index of the first element to return. This can only be used if // indexed paging is enabled. func (c *PurchasesVoidedpurchasesListCall) StartIndex(startIndex int64) *PurchasesVoidedpurchasesListCall { c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) return c } // StartTime sets the optional parameter "startTime": The time, in // milliseconds since the Epoch, of the oldest voided purchase that you // want to see in the response. The value of this parameter cannot be // older than 30 days and is ignored if a pagination token is set. // Default value is current time minus 30 days. Note: This filter is // applied on the time at which the record is seen as voided by our // systems and not the actual voided time returned in the response. func (c *PurchasesVoidedpurchasesListCall) StartTime(startTime int64) *PurchasesVoidedpurchasesListCall { c.urlParams_.Set("startTime", fmt.Sprint(startTime)) return c } // Token sets the optional parameter "token": Defines the token of the // page to return, usually taken from TokenPagination. This can only be // used if token paging is enabled. func (c *PurchasesVoidedpurchasesListCall) Token(token string) *PurchasesVoidedpurchasesListCall { c.urlParams_.Set("token", token) return c } // Type sets the optional parameter "type": The type of voided purchases // that you want to see in the response. Possible values are: 0. Only // voided in-app product purchases will be returned in the response. // This is the default value. 1. Both voided in-app purchases and voided // subscription purchases will be returned in the response. Note: Before // requesting to receive voided subscription purchases, you must switch // to use orderId in the response which uniquely identifies one-time // purchases and subscriptions. Otherwise, you will receive multiple // subscription orders with the same PurchaseToken, because subscription // renewal orders share the same PurchaseToken. func (c *PurchasesVoidedpurchasesListCall) Type(type_ int64) *PurchasesVoidedpurchasesListCall { c.urlParams_.Set("type", fmt.Sprint(type_)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *PurchasesVoidedpurchasesListCall) Fields(s ...googleapi.Field) *PurchasesVoidedpurchasesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *PurchasesVoidedpurchasesListCall) IfNoneMatch(entityTag string) *PurchasesVoidedpurchasesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *PurchasesVoidedpurchasesListCall) Context(ctx context.Context) *PurchasesVoidedpurchasesListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *PurchasesVoidedpurchasesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *PurchasesVoidedpurchasesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/purchases/voidedpurchases") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.purchases.voidedpurchases.list" call. // Exactly one of *VoidedPurchasesListResponse or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *VoidedPurchasesListResponse.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *PurchasesVoidedpurchasesListCall) Do(opts ...googleapi.CallOption) (*VoidedPurchasesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &VoidedPurchasesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists the purchases that were canceled, refunded or charged-back.", // "flatPath": "androidpublisher/v3/applications/{packageName}/purchases/voidedpurchases", // "httpMethod": "GET", // "id": "androidpublisher.purchases.voidedpurchases.list", // "parameterOrder": [ // "packageName" // ], // "parameters": { // "endTime": { // "description": "The time, in milliseconds since the Epoch, of the newest voided purchase that you want to see in the response. The value of this parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.", // "format": "int64", // "location": "query", // "type": "string" // }, // "maxResults": { // "description": "Defines how many results the list operation should return. The default number depends on the resource collection.", // "format": "uint32", // "location": "query", // "type": "integer" // }, // "packageName": { // "description": "The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing').", // "location": "path", // "required": true, // "type": "string" // }, // "startIndex": { // "description": "Defines the index of the first element to return. This can only be used if indexed paging is enabled.", // "format": "uint32", // "location": "query", // "type": "integer" // }, // "startTime": { // "description": "The time, in milliseconds since the Epoch, of the oldest voided purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.", // "format": "int64", // "location": "query", // "type": "string" // }, // "token": { // "description": "Defines the token of the page to return, usually taken from TokenPagination. This can only be used if token paging is enabled.", // "location": "query", // "type": "string" // }, // "type": { // "description": "The type of voided purchases that you want to see in the response. Possible values are: 0. Only voided in-app product purchases will be returned in the response. This is the default value. 1. Both voided in-app purchases and voided subscription purchases will be returned in the response. Note: Before requesting to receive voided subscription purchases, you must switch to use orderId in the response which uniquely identifies one-time purchases and subscriptions. Otherwise, you will receive multiple subscription orders with the same PurchaseToken, because subscription renewal orders share the same PurchaseToken.", // "format": "int32", // "location": "query", // "type": "integer" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/purchases/voidedpurchases", // "response": { // "$ref": "VoidedPurchasesListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.reviews.get": type ReviewsGetCall struct { s *Service packageName string reviewId string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Gets a single review. // // - packageName: Package name of the app. // - reviewId: Unique identifier for a review. func (r *ReviewsService) Get(packageName string, reviewId string) *ReviewsGetCall { c := &ReviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.reviewId = reviewId return c } // TranslationLanguage sets the optional parameter // "translationLanguage": Language localization code. func (c *ReviewsGetCall) TranslationLanguage(translationLanguage string) *ReviewsGetCall { c.urlParams_.Set("translationLanguage", translationLanguage) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ReviewsGetCall) Fields(s ...googleapi.Field) *ReviewsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *ReviewsGetCall) IfNoneMatch(entityTag string) *ReviewsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *ReviewsGetCall) Context(ctx context.Context) *ReviewsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *ReviewsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *ReviewsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/reviews/{reviewId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "reviewId": c.reviewId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.reviews.get" call. // Exactly one of *Review or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Review.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *ReviewsGetCall) Do(opts ...googleapi.CallOption) (*Review, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Review{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Gets a single review.", // "flatPath": "androidpublisher/v3/applications/{packageName}/reviews/{reviewId}", // "httpMethod": "GET", // "id": "androidpublisher.reviews.get", // "parameterOrder": [ // "packageName", // "reviewId" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "reviewId": { // "description": "Unique identifier for a review.", // "location": "path", // "required": true, // "type": "string" // }, // "translationLanguage": { // "description": "Language localization code.", // "location": "query", // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/reviews/{reviewId}", // "response": { // "$ref": "Review" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.reviews.list": type ReviewsListCall struct { s *Service packageName string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all reviews. // // - packageName: Package name of the app. func (r *ReviewsService) List(packageName string) *ReviewsListCall { c := &ReviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName return c } // MaxResults sets the optional parameter "maxResults": How many results // the list operation should return. func (c *ReviewsListCall) MaxResults(maxResults int64) *ReviewsListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } // StartIndex sets the optional parameter "startIndex": The index of the // first element to return. func (c *ReviewsListCall) StartIndex(startIndex int64) *ReviewsListCall { c.urlParams_.Set("startIndex", fmt.Sprint(startIndex)) return c } // Token sets the optional parameter "token": Pagination token. If // empty, list starts at the first review. func (c *ReviewsListCall) Token(token string) *ReviewsListCall { c.urlParams_.Set("token", token) return c } // TranslationLanguage sets the optional parameter // "translationLanguage": Language localization code. func (c *ReviewsListCall) TranslationLanguage(translationLanguage string) *ReviewsListCall { c.urlParams_.Set("translationLanguage", translationLanguage) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ReviewsListCall) Fields(s ...googleapi.Field) *ReviewsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *ReviewsListCall) IfNoneMatch(entityTag string) *ReviewsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *ReviewsListCall) Context(ctx context.Context) *ReviewsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *ReviewsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *ReviewsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/reviews") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.reviews.list" call. // Exactly one of *ReviewsListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ReviewsListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *ReviewsListCall) Do(opts ...googleapi.CallOption) (*ReviewsListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ReviewsListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all reviews.", // "flatPath": "androidpublisher/v3/applications/{packageName}/reviews", // "httpMethod": "GET", // "id": "androidpublisher.reviews.list", // "parameterOrder": [ // "packageName" // ], // "parameters": { // "maxResults": { // "description": "How many results the list operation should return.", // "format": "uint32", // "location": "query", // "type": "integer" // }, // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "startIndex": { // "description": "The index of the first element to return.", // "format": "uint32", // "location": "query", // "type": "integer" // }, // "token": { // "description": "Pagination token. If empty, list starts at the first review.", // "location": "query", // "type": "string" // }, // "translationLanguage": { // "description": "Language localization code.", // "location": "query", // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/reviews", // "response": { // "$ref": "ReviewsListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.reviews.reply": type ReviewsReplyCall struct { s *Service packageName string reviewId string reviewsreplyrequest *ReviewsReplyRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Reply: Replies to a single review, or updates an existing reply. // // - packageName: Package name of the app. // - reviewId: Unique identifier for a review. func (r *ReviewsService) Reply(packageName string, reviewId string, reviewsreplyrequest *ReviewsReplyRequest) *ReviewsReplyCall { c := &ReviewsReplyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.reviewId = reviewId c.reviewsreplyrequest = reviewsreplyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ReviewsReplyCall) Fields(s ...googleapi.Field) *ReviewsReplyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *ReviewsReplyCall) Context(ctx context.Context) *ReviewsReplyCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *ReviewsReplyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *ReviewsReplyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.reviewsreplyrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/reviews/{reviewId}:reply") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "reviewId": c.reviewId, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.reviews.reply" call. // Exactly one of *ReviewsReplyResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ReviewsReplyResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *ReviewsReplyCall) Do(opts ...googleapi.CallOption) (*ReviewsReplyResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ReviewsReplyResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Replies to a single review, or updates an existing reply.", // "flatPath": "androidpublisher/v3/applications/{packageName}/reviews/{reviewId}:reply", // "httpMethod": "POST", // "id": "androidpublisher.reviews.reply", // "parameterOrder": [ // "packageName", // "reviewId" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "reviewId": { // "description": "Unique identifier for a review.", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/reviews/{reviewId}:reply", // "request": { // "$ref": "ReviewsReplyRequest" // }, // "response": { // "$ref": "ReviewsReplyResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.systemapks.variants.create": type SystemapksVariantsCreateCall struct { s *Service packageName string versionCode int64 variant *Variant urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Create: Creates an APK which is suitable for inclusion in a system // image from an already uploaded Android App Bundle. // // - packageName: Package name of the app. // - versionCode: The version code of the App Bundle. func (r *SystemapksVariantsService) Create(packageName string, versionCode int64, variant *Variant) *SystemapksVariantsCreateCall { c := &SystemapksVariantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.versionCode = versionCode c.variant = variant return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *SystemapksVariantsCreateCall) Fields(s ...googleapi.Field) *SystemapksVariantsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *SystemapksVariantsCreateCall) Context(ctx context.Context) *SystemapksVariantsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *SystemapksVariantsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *SystemapksVariantsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.variant) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "versionCode": strconv.FormatInt(c.versionCode, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.systemapks.variants.create" call. // Exactly one of *Variant or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Variant.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *SystemapksVariantsCreateCall) Do(opts ...googleapi.CallOption) (*Variant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Variant{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Creates an APK which is suitable for inclusion in a system image from an already uploaded Android App Bundle.", // "flatPath": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants", // "httpMethod": "POST", // "id": "androidpublisher.systemapks.variants.create", // "parameterOrder": [ // "packageName", // "versionCode" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "versionCode": { // "description": "The version code of the App Bundle.", // "format": "int64", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants", // "request": { // "$ref": "Variant" // }, // "response": { // "$ref": "Variant" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.systemapks.variants.download": type SystemapksVariantsDownloadCall struct { s *Service packageName string versionCode int64 variantId int64 urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Download: Downloads a previously created system APK which is suitable // for inclusion in a system image. // // - packageName: Package name of the app. // - variantId: The ID of a previously created system APK variant. // - versionCode: The version code of the App Bundle. func (r *SystemapksVariantsService) Download(packageName string, versionCode int64, variantId int64) *SystemapksVariantsDownloadCall { c := &SystemapksVariantsDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.versionCode = versionCode c.variantId = variantId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *SystemapksVariantsDownloadCall) Fields(s ...googleapi.Field) *SystemapksVariantsDownloadCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *SystemapksVariantsDownloadCall) IfNoneMatch(entityTag string) *SystemapksVariantsDownloadCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do and Download // methods. Any pending HTTP request will be aborted if the provided // context is canceled. func (c *SystemapksVariantsDownloadCall) Context(ctx context.Context) *SystemapksVariantsDownloadCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *SystemapksVariantsDownloadCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *SystemapksVariantsDownloadCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}:download") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "versionCode": strconv.FormatInt(c.versionCode, 10), "variantId": strconv.FormatInt(c.variantId, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Download fetches the API endpoint's "media" value, instead of the normal // API response value. If the returned error is nil, the Response is guaranteed to // have a 2xx status code. Callers must close the Response.Body as usual. func (c *SystemapksVariantsDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("media") if err != nil { return nil, err } if err := googleapi.CheckResponse(res); err != nil { res.Body.Close() return nil, err } return res, nil } // Do executes the "androidpublisher.systemapks.variants.download" call. func (c *SystemapksVariantsDownloadCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Downloads a previously created system APK which is suitable for inclusion in a system image.", // "flatPath": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}:download", // "httpMethod": "GET", // "id": "androidpublisher.systemapks.variants.download", // "parameterOrder": [ // "packageName", // "versionCode", // "variantId" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "variantId": { // "description": "The ID of a previously created system APK variant.", // "format": "uint32", // "location": "path", // "required": true, // "type": "integer" // }, // "versionCode": { // "description": "The version code of the App Bundle.", // "format": "int64", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}:download", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ], // "supportsMediaDownload": true, // "useMediaDownloadService": true // } } // method id "androidpublisher.systemapks.variants.get": type SystemapksVariantsGetCall struct { s *Service packageName string versionCode int64 variantId int64 urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // Get: Returns a previously created system APK variant. // // - packageName: Package name of the app. // - variantId: The ID of a previously created system APK variant. // - versionCode: The version code of the App Bundle. func (r *SystemapksVariantsService) Get(packageName string, versionCode int64, variantId int64) *SystemapksVariantsGetCall { c := &SystemapksVariantsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.versionCode = versionCode c.variantId = variantId return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *SystemapksVariantsGetCall) Fields(s ...googleapi.Field) *SystemapksVariantsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *SystemapksVariantsGetCall) IfNoneMatch(entityTag string) *SystemapksVariantsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *SystemapksVariantsGetCall) Context(ctx context.Context) *SystemapksVariantsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *SystemapksVariantsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *SystemapksVariantsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "versionCode": strconv.FormatInt(c.versionCode, 10), "variantId": strconv.FormatInt(c.variantId, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.systemapks.variants.get" call. // Exactly one of *Variant or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *Variant.ServerResponse.Header or (if a response was returned at all) // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified // was returned. func (c *SystemapksVariantsGetCall) Do(opts ...googleapi.CallOption) (*Variant, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &Variant{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Returns a previously created system APK variant.", // "flatPath": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}", // "httpMethod": "GET", // "id": "androidpublisher.systemapks.variants.get", // "parameterOrder": [ // "packageName", // "versionCode", // "variantId" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "variantId": { // "description": "The ID of a previously created system APK variant.", // "format": "uint32", // "location": "path", // "required": true, // "type": "integer" // }, // "versionCode": { // "description": "The version code of the App Bundle.", // "format": "int64", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}", // "response": { // "$ref": "Variant" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.systemapks.variants.list": type SystemapksVariantsListCall struct { s *Service packageName string versionCode int64 urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Returns the list of previously created system APK variants. // // - packageName: Package name of the app. // - versionCode: The version code of the App Bundle. func (r *SystemapksVariantsService) List(packageName string, versionCode int64) *SystemapksVariantsListCall { c := &SystemapksVariantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.packageName = packageName c.versionCode = versionCode return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *SystemapksVariantsListCall) Fields(s ...googleapi.Field) *SystemapksVariantsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *SystemapksVariantsListCall) IfNoneMatch(entityTag string) *SystemapksVariantsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *SystemapksVariantsListCall) Context(ctx context.Context) *SystemapksVariantsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *SystemapksVariantsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *SystemapksVariantsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "packageName": c.packageName, "versionCode": strconv.FormatInt(c.versionCode, 10), }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.systemapks.variants.list" call. // Exactly one of *SystemApksListResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *SystemApksListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *SystemapksVariantsListCall) Do(opts ...googleapi.CallOption) (*SystemApksListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &SystemApksListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Returns the list of previously created system APK variants.", // "flatPath": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants", // "httpMethod": "GET", // "id": "androidpublisher.systemapks.variants.list", // "parameterOrder": [ // "packageName", // "versionCode" // ], // "parameters": { // "packageName": { // "description": "Package name of the app.", // "location": "path", // "required": true, // "type": "string" // }, // "versionCode": { // "description": "The version code of the App Bundle.", // "format": "int64", // "location": "path", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants", // "response": { // "$ref": "SystemApksListResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.users.create": type UsersCreateCall struct { s *Service parent string user *User urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Create: Grant access for a user to the given developer account. // // - parent: The developer account to add the user to. Format: // developers/{developer}. func (r *UsersService) Create(parent string, user *User) *UsersCreateCall { c := &UsersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent c.user = user return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UsersCreateCall) Fields(s ...googleapi.Field) *UsersCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *UsersCreateCall) Context(ctx context.Context) *UsersCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *UsersCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *UsersCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/users") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.users.create" call. // Exactly one of *User or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *User.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. func (c *UsersCreateCall) Do(opts ...googleapi.CallOption) (*User, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &User{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Grant access for a user to the given developer account.", // "flatPath": "androidpublisher/v3/developers/{developersId}/users", // "httpMethod": "POST", // "id": "androidpublisher.users.create", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { // "description": "Required. The developer account to add the user to. Format: developers/{developer}", // "location": "path", // "pattern": "^developers/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/{+parent}/users", // "request": { // "$ref": "User" // }, // "response": { // "$ref": "User" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.users.delete": type UsersDeleteCall struct { s *Service name string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Delete: Removes all access for the user to the given developer // account. // // - name: The name of the user to delete. Format: // developers/{developer}/users/{email}. func (r *UsersService) Delete(name string) *UsersDeleteCall { c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *UsersDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.users.delete" call. func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if err != nil { return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return err } return nil // { // "description": "Removes all access for the user to the given developer account.", // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}", // "httpMethod": "DELETE", // "id": "androidpublisher.users.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { // "description": "Required. The name of the user to delete. Format: developers/{developer}/users/{email}", // "location": "path", // "pattern": "^developers/[^/]+/users/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/{+name}", // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // method id "androidpublisher.users.list": type UsersListCall struct { s *Service parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } // List: Lists all users with access to a developer account. // // - parent: The developer account to fetch users from. Format: // developers/{developer}. func (r *UsersService) List(parent string) *UsersListCall { c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent return c } // PageSize sets the optional parameter "pageSize": The maximum number // of results to return. This must be set to -1 to disable pagination. func (c *UsersListCall) PageSize(pageSize int64) *UsersListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": A token received // from a previous call to this method, in order to retrieve further // results. func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // IfNoneMatch sets the optional parameter which makes the operation // fail if the object's ETag matches the given value. This is useful for // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *UsersListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+parent}/users") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.users.list" call. // Exactly one of *ListUsersResponse or error will be non-nil. Any // non-2xx status code is an error. Response headers are in either // *ListUsersResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*ListUsersResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &ListUsersResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Lists all users with access to a developer account.", // "flatPath": "androidpublisher/v3/developers/{developersId}/users", // "httpMethod": "GET", // "id": "androidpublisher.users.list", // "parameterOrder": [ // "parent" // ], // "parameters": { // "pageSize": { // "description": "The maximum number of results to return. This must be set to -1 to disable pagination.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { // "description": "A token received from a previous call to this method, in order to retrieve further results.", // "location": "query", // "type": "string" // }, // "parent": { // "description": "Required. The developer account to fetch users from. Format: developers/{developer}", // "location": "path", // "pattern": "^developers/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "androidpublisher/v3/{+parent}/users", // "response": { // "$ref": "ListUsersResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } } // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. func (c *UsersListCall) Pages(ctx context.Context, f func(*ListUsersResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { x, err := c.Do() if err != nil { return err } if err := f(x); err != nil { return err } if x.NextPageToken == "" { return nil } c.PageToken(x.NextPageToken) } } // method id "androidpublisher.users.patch": type UsersPatchCall struct { s *Service name string user *User urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } // Patch: Updates access for the user to the developer account. // // - name: Resource name for this user, following the pattern // "developers/{developer}/users/{email}". func (r *UsersService) Patch(name string, user *User) *UsersPatchCall { c := &UsersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name c.user = user return c } // UpdateMask sets the optional parameter "updateMask": The list of // fields to be updated. func (c *UsersPatchCall) UpdateMask(updateMask string) *UsersPatchCall { c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UsersPatchCall) Fields(s ...googleapi.Field) *UsersPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. func (c *UsersPatchCall) Context(ctx context.Context) *UsersPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. func (c *UsersPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211125") for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "androidpublisher/v3/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "androidpublisher.users.patch" call. // Exactly one of *User or error will be non-nil. Any non-2xx status // code is an error. Response headers are in either // *User.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. func (c *UsersPatchCall) Do(opts ...googleapi.CallOption) (*User, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { if res.Body != nil { res.Body.Close() } return nil, &googleapi.Error{ Code: res.StatusCode, Header: res.Header, } } if err != nil { return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { return nil, err } ret := &User{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, }, } target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } return ret, nil // { // "description": "Updates access for the user to the developer account.", // "flatPath": "androidpublisher/v3/developers/{developersId}/users/{usersId}", // "httpMethod": "PATCH", // "id": "androidpublisher.users.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { // "description": "Required. Resource name for this user, following the pattern \"developers/{developer}/users/{email}\".", // "location": "path", // "pattern": "^developers/[^/]+/users/[^/]+$", // "required": true, // "type": "string" // }, // "updateMask": { // "description": "Optional. The list of fields to be updated.", // "format": "google-fieldmask", // "location": "query", // "type": "string" // } // }, // "path": "androidpublisher/v3/{+name}", // "request": { // "$ref": "User" // }, // "response": { // "$ref": "User" // }, // "scopes": [ // "https://www.googleapis.com/auth/androidpublisher" // ] // } }
openfmri_s3.py
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## """A pipeline for crawling openfmri s3 bucket""" import os from os.path import lexists # Import necessary nodes from ..nodes.misc import switch, assign, sub from ..nodes.s3 import crawl_s3 from ..nodes.annex import Annexificator from ...consts import DATALAD_SPECIAL_REMOTE # Possibly instantiate a logger if you would like to log # during pipeline creation from logging import getLogger lgr = getLogger("datalad.crawler.pipelines.openfmri") # Since all content of openfmri is anyways available openly, no need atm # to use https which complicates proxying etc. Thus provide a node which # would replace s3:// urls with regular http # TODO: we might want to make it an option for crawl_s3 to yield http urls # so then we could just generalize this whole shebang into a single helper # for crawling any S3 bucket. # Right away think about having an 'incoming' branch and handling of versioned files sub_s3_to_http = sub({ 'url': {'^s3://openfmri/': 'http://openfmri.s3.amazonaws.com/', '^s3://openneuro/': 'http://openneuro.s3.amazonaws.com/', } }, ok_missing=True ) def
(prefix=None): """Pipeline to crawl/annex an entire openfmri bucket""" lgr.info("Creating a pipeline for the openfmri bucket") annex = Annexificator( create=False, # must be already initialized etc # Primary purpose of this one is registration of all URLs with our # upcoming "ultimate DB" so we don't get to git anything # options=["-c", "annex.largefiles=exclude=CHANGES* and exclude=changelog.txt and exclude=dataset_description.json and exclude=README* and exclude=*.[mc]"] ) return [ crawl_s3('openfmri', prefix=prefix, recursive=False, strategy='commit-versions', repo=annex.repo), sub_s3_to_http, switch('datalad_action', { # TODO: we should actually deal with subdirs primarily 'commit': annex.finalize(tag=True), # should we bother removing anything? not sure # 'remove': annex.remove, 'annex': annex, 'directory': [ # for initiate_dataset we should replicate filename as handle_name, prefix assign({'prefix': '%(filename)s/', 'handle_name': '%(filename)s'}, interpolate=True), annex.initiate_dataset( template='openfmri_s3', data_fields=['prefix'], ) ] }, missing='skip', # ok to not remove ) ] # TODO: make a unittest for all of this on a simple bucket def pipeline(prefix=None, bucket='openfmri', tag=True, skip_problematic=False): """Pipeline to crawl/annex an entire openfmri bucket""" lgr.info("Creating a pipeline for the openfmri bucket") annex = Annexificator( create=False, # must be already initialized etc #special_remotes=[DATALAD_SPECIAL_REMOTE], backend='MD5E', skip_problematic=skip_problematic, # Primary purpose of this one is registration of all URLs with our # upcoming "ultimate DB" so we don't get to git anything # options=["-c", "annex.largefiles=exclude=CHANGES* and exclude=changelog.txt and exclude=dataset_description.json and exclude=README* and exclude=*.[mc]"] ) return [ crawl_s3(bucket=bucket, prefix=prefix, strategy='commit-versions', repo=annex.repo, recursive=True, exclude='\.git/'), sub_s3_to_http, switch('datalad_action', { 'commit': annex.finalize(tag=tag), 'remove': annex.remove, 'annex': annex, }) ]
collection_pipeline
with_tuple_left.rs
use super::*; #[test] fn with_number_atom_reference_function_port_or_pid_returns_true() { with_process_arc(|arc_process| { TestRunner::new(Config::with_source_file(file!())) .run( &( strategy::term::tuple(arc_process.clone()), strategy::term::number_atom_reference_function_port_or_pid(arc_process.clone()), ), |(left, right)| { prop_assert_eq!(native(left, right), true.into()); Ok(()) }, ) .unwrap(); }); } #[test] fn with_smaller_tuple_right_returns_true() { is_greater_than_or_equal( |_, process| { process .tuple_from_slice(&[process.integer(1).unwrap()]) .unwrap() }, true, ); } #[test] fn with_same_size_tuple_with_greater_elements_returns_true() { is_greater_than_or_equal( |_, process| { process .tuple_from_slice(&[process.integer(1).unwrap(), process.integer(1).unwrap()]) .unwrap() }, true, ); } #[test] fn with_same_value_tuple_returns_true() { is_greater_than_or_equal( |_, process| { process .tuple_from_slice(&[process.integer(1).unwrap(), process.integer(2).unwrap()]) .unwrap() }, true, ); } #[test] fn with_same_size_tuple_with_greater_elements_returns_false() { is_greater_than_or_equal( |_, process| { process .tuple_from_slice(&[process.integer(1).unwrap(), process.integer(3).unwrap()]) .unwrap() }, false, ); } #[test] fn with_greater_size_tuple_returns_false() { is_greater_than_or_equal( |_, process| { process .tuple_from_slice(&[ process.integer(1).unwrap(), process.integer(2).unwrap(), process.integer(3).unwrap(), ]) .unwrap() }, false, ); } #[test] fn with_map_list_or_bitstring_returns_false() { TestRunner::new(Config::with_source_file(file!())) .run( &strategy::process().prop_flat_map(|arc_process| {
( strategy::term::tuple(arc_process.clone()), strategy::term::map_list_or_bitstring(arc_process.clone()), ) }), |(left, right)| { prop_assert_eq!(native(left, right), false.into()); Ok(()) }, ) .unwrap(); } fn is_greater_than_or_equal<R>(right: R, expected: bool) where R: FnOnce(Term, &Process) -> Term, { super::is_greater_than_or_equal( |process| { process .tuple_from_slice(&[process.integer(1).unwrap(), process.integer(2).unwrap()]) .unwrap() }, right, expected, ); }
app.js
/** * First we will load all of this project's JavaScript dependencies which * includes Vue and other libraries. It is a great starting point when * building robust, powerful web applications using Vue and Laravel. */ require('./bootstrap'); import 'jquery-ui/ui/widgets/datepicker.js'; //window.Vue = require('vue');
* Vue components. It will recursively scan this directory for the Vue * components and automatically register them with their "basename". * * Eg. ./components/ExampleComponent.vue -> <example-component></example-component> */ // const files = require.context('./', true, /\.vue$/i); // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)); //Vue.component('example-component', require('./components/ExampleComponent.vue').default); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ /*const app = new Vue({ el: '#app' });*/
/** * The following block of code may be used to automatically register your
cumsum_gpu.d.ts
import { GPGPUProgram } from './gpgpu_math';
userCode: string; constructor(shape: number[], exclusive: boolean, reverse: boolean); }
export declare class CumSumProgram implements GPGPUProgram { variableNames: string[]; outputShape: number[];
post_v1_notes_parameters.go
// Code generated by go-swagger; DO NOT EDIT. package notes // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" "github.com/firehydrant/api-client-go/models" ) // NewPostV1NotesParams creates a new PostV1NotesParams object, // with the default timeout for this client. // // Default values are not hydrated, since defaults are normally applied by the API server side. // // To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPostV1NotesParams() *PostV1NotesParams { return &PostV1NotesParams{ timeout: cr.DefaultTimeout, } } // NewPostV1NotesParamsWithTimeout creates a new PostV1NotesParams object // with the ability to set a timeout on a request. func
(timeout time.Duration) *PostV1NotesParams { return &PostV1NotesParams{ timeout: timeout, } } // NewPostV1NotesParamsWithContext creates a new PostV1NotesParams object // with the ability to set a context for a request. func NewPostV1NotesParamsWithContext(ctx context.Context) *PostV1NotesParams { return &PostV1NotesParams{ Context: ctx, } } // NewPostV1NotesParamsWithHTTPClient creates a new PostV1NotesParams object // with the ability to set a custom HTTPClient for a request. func NewPostV1NotesParamsWithHTTPClient(client *http.Client) *PostV1NotesParams { return &PostV1NotesParams{ HTTPClient: client, } } /* PostV1NotesParams contains all the parameters to send to the API endpoint for the post v1 notes operation. Typically these are written to a http.Request. */ type PostV1NotesParams struct { // V1Notes. V1Notes *models.PostV1Notes timeout time.Duration Context context.Context HTTPClient *http.Client } // WithDefaults hydrates default values in the post v1 notes params (not the query body). // // All values with no default are reset to their zero value. func (o *PostV1NotesParams) WithDefaults() *PostV1NotesParams { o.SetDefaults() return o } // SetDefaults hydrates default values in the post v1 notes params (not the query body). // // All values with no default are reset to their zero value. func (o *PostV1NotesParams) SetDefaults() { // no default values defined for this parameter } // WithTimeout adds the timeout to the post v1 notes params func (o *PostV1NotesParams) WithTimeout(timeout time.Duration) *PostV1NotesParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the post v1 notes params func (o *PostV1NotesParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the post v1 notes params func (o *PostV1NotesParams) WithContext(ctx context.Context) *PostV1NotesParams { o.SetContext(ctx) return o } // SetContext adds the context to the post v1 notes params func (o *PostV1NotesParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the post v1 notes params func (o *PostV1NotesParams) WithHTTPClient(client *http.Client) *PostV1NotesParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the post v1 notes params func (o *PostV1NotesParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithV1Notes adds the v1Notes to the post v1 notes params func (o *PostV1NotesParams) WithV1Notes(v1Notes *models.PostV1Notes) *PostV1NotesParams { o.SetV1Notes(v1Notes) return o } // SetV1Notes adds the v1Notes to the post v1 notes params func (o *PostV1NotesParams) SetV1Notes(v1Notes *models.PostV1Notes) { o.V1Notes = v1Notes } // WriteToRequest writes these params to a swagger request func (o *PostV1NotesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.V1Notes != nil { if err := r.SetBodyParam(o.V1Notes); err != nil { return err } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
NewPostV1NotesParamsWithTimeout
model_niatelemetry_aaa_ldap_provider_details_response.go
/* Cisco Intersight Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advanced ways than the prior generations of tools. Cisco Intersight provides an integrated and intuitive management experience for resources in the traditional data center as well as at the edge. With flexible deployment options to address complex security needs, getting started with Intersight is quick and easy. Cisco Intersight has deep integration with Cisco UCS and HyperFlex systems allowing for remote deployment, configuration, and ongoing maintenance. The model-based deployment works for a single system in a remote location or hundreds of systems in a data center and enables rapid, standardized configuration and deployment. It also streamlines maintaining those systems whether you are working with small or very large configurations. The Intersight OpenAPI document defines the complete set of properties that are returned in the HTTP response. From that perspective, a client can expect that no additional properties are returned, unless these properties are explicitly defined in the OpenAPI document. However, when a client uses an older version of the Intersight OpenAPI document, the server may send additional properties because the software is more recent than the client. In that case, the client may receive properties that it does not know about. Some generated SDKs perform a strict validation of the HTTP response body against the OpenAPI document. API version: 1.0.9-5517 Contact: [email protected] */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package intersight import ( "encoding/json" "fmt" ) // NiatelemetryAaaLdapProviderDetailsResponse - The response body of a HTTP GET request for the 'niatelemetry.AaaLdapProviderDetails' resource. The value may be one of the following types. 1. When 'tag' is specified in the URL query, the response schema is a summary of the tag usage. 1. When '$apply' is specified in the URL query, the response schema is dynamically-generated schema based on the $apply value. 1. When '$count' is specified in the URL query, the response is a simple object providing the count of the resources. 1. In all other cases, the response is a list of 'niatelemetry.AaaLdapProviderDetails' resources. type NiatelemetryAaaLdapProviderDetailsResponse struct { MoAggregateTransform *MoAggregateTransform MoDocumentCount *MoDocumentCount MoTagSummary *MoTagSummary NiatelemetryAaaLdapProviderDetailsList *NiatelemetryAaaLdapProviderDetailsList } // MoAggregateTransformAsNiatelemetryAaaLdapProviderDetailsResponse is a convenience function that returns MoAggregateTransform wrapped in NiatelemetryAaaLdapProviderDetailsResponse func MoAggregateTransformAsNiatelemetryAaaLdapProviderDetailsResponse(v *MoAggregateTransform) NiatelemetryAaaLdapProviderDetailsResponse
// MoDocumentCountAsNiatelemetryAaaLdapProviderDetailsResponse is a convenience function that returns MoDocumentCount wrapped in NiatelemetryAaaLdapProviderDetailsResponse func MoDocumentCountAsNiatelemetryAaaLdapProviderDetailsResponse(v *MoDocumentCount) NiatelemetryAaaLdapProviderDetailsResponse { return NiatelemetryAaaLdapProviderDetailsResponse{ MoDocumentCount: v} } // MoTagSummaryAsNiatelemetryAaaLdapProviderDetailsResponse is a convenience function that returns MoTagSummary wrapped in NiatelemetryAaaLdapProviderDetailsResponse func MoTagSummaryAsNiatelemetryAaaLdapProviderDetailsResponse(v *MoTagSummary) NiatelemetryAaaLdapProviderDetailsResponse { return NiatelemetryAaaLdapProviderDetailsResponse{ MoTagSummary: v} } // NiatelemetryAaaLdapProviderDetailsListAsNiatelemetryAaaLdapProviderDetailsResponse is a convenience function that returns NiatelemetryAaaLdapProviderDetailsList wrapped in NiatelemetryAaaLdapProviderDetailsResponse func NiatelemetryAaaLdapProviderDetailsListAsNiatelemetryAaaLdapProviderDetailsResponse(v *NiatelemetryAaaLdapProviderDetailsList) NiatelemetryAaaLdapProviderDetailsResponse { return NiatelemetryAaaLdapProviderDetailsResponse{ NiatelemetryAaaLdapProviderDetailsList: v} } // Unmarshal JSON data into one of the pointers in the struct func (dst *NiatelemetryAaaLdapProviderDetailsResponse) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup var jsonDict map[string]interface{} err = json.Unmarshal(data, &jsonDict) if err != nil { return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") } // check if the discriminator value is 'mo.AggregateTransform' if jsonDict["ObjectType"] == "mo.AggregateTransform" { // try to unmarshal JSON data into MoAggregateTransform err = json.Unmarshal(data, &dst.MoAggregateTransform) if err == nil { return nil // data stored in dst.MoAggregateTransform, return on the first match } else { dst.MoAggregateTransform = nil return fmt.Errorf("Failed to unmarshal NiatelemetryAaaLdapProviderDetailsResponse as MoAggregateTransform: %s", err.Error()) } } // check if the discriminator value is 'mo.DocumentCount' if jsonDict["ObjectType"] == "mo.DocumentCount" { // try to unmarshal JSON data into MoDocumentCount err = json.Unmarshal(data, &dst.MoDocumentCount) if err == nil { return nil // data stored in dst.MoDocumentCount, return on the first match } else { dst.MoDocumentCount = nil return fmt.Errorf("Failed to unmarshal NiatelemetryAaaLdapProviderDetailsResponse as MoDocumentCount: %s", err.Error()) } } // check if the discriminator value is 'mo.TagSummary' if jsonDict["ObjectType"] == "mo.TagSummary" { // try to unmarshal JSON data into MoTagSummary err = json.Unmarshal(data, &dst.MoTagSummary) if err == nil { return nil // data stored in dst.MoTagSummary, return on the first match } else { dst.MoTagSummary = nil return fmt.Errorf("Failed to unmarshal NiatelemetryAaaLdapProviderDetailsResponse as MoTagSummary: %s", err.Error()) } } // check if the discriminator value is 'niatelemetry.AaaLdapProviderDetails.List' if jsonDict["ObjectType"] == "niatelemetry.AaaLdapProviderDetails.List" { // try to unmarshal JSON data into NiatelemetryAaaLdapProviderDetailsList err = json.Unmarshal(data, &dst.NiatelemetryAaaLdapProviderDetailsList) if err == nil { return nil // data stored in dst.NiatelemetryAaaLdapProviderDetailsList, return on the first match } else { dst.NiatelemetryAaaLdapProviderDetailsList = nil return fmt.Errorf("Failed to unmarshal NiatelemetryAaaLdapProviderDetailsResponse as NiatelemetryAaaLdapProviderDetailsList: %s", err.Error()) } } return nil } // Marshal data from the first non-nil pointers in the struct to JSON func (src NiatelemetryAaaLdapProviderDetailsResponse) MarshalJSON() ([]byte, error) { if src.MoAggregateTransform != nil { return json.Marshal(&src.MoAggregateTransform) } if src.MoDocumentCount != nil { return json.Marshal(&src.MoDocumentCount) } if src.MoTagSummary != nil { return json.Marshal(&src.MoTagSummary) } if src.NiatelemetryAaaLdapProviderDetailsList != nil { return json.Marshal(&src.NiatelemetryAaaLdapProviderDetailsList) } return nil, nil // no data in oneOf schemas } // Get the actual instance func (obj *NiatelemetryAaaLdapProviderDetailsResponse) GetActualInstance() (interface{}) { if obj.MoAggregateTransform != nil { return obj.MoAggregateTransform } if obj.MoDocumentCount != nil { return obj.MoDocumentCount } if obj.MoTagSummary != nil { return obj.MoTagSummary } if obj.NiatelemetryAaaLdapProviderDetailsList != nil { return obj.NiatelemetryAaaLdapProviderDetailsList } // all schemas are nil return nil } type NullableNiatelemetryAaaLdapProviderDetailsResponse struct { value *NiatelemetryAaaLdapProviderDetailsResponse isSet bool } func (v NullableNiatelemetryAaaLdapProviderDetailsResponse) Get() *NiatelemetryAaaLdapProviderDetailsResponse { return v.value } func (v *NullableNiatelemetryAaaLdapProviderDetailsResponse) Set(val *NiatelemetryAaaLdapProviderDetailsResponse) { v.value = val v.isSet = true } func (v NullableNiatelemetryAaaLdapProviderDetailsResponse) IsSet() bool { return v.isSet } func (v *NullableNiatelemetryAaaLdapProviderDetailsResponse) Unset() { v.value = nil v.isSet = false } func NewNullableNiatelemetryAaaLdapProviderDetailsResponse(val *NiatelemetryAaaLdapProviderDetailsResponse) *NullableNiatelemetryAaaLdapProviderDetailsResponse { return &NullableNiatelemetryAaaLdapProviderDetailsResponse{value: val, isSet: true} } func (v NullableNiatelemetryAaaLdapProviderDetailsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableNiatelemetryAaaLdapProviderDetailsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }
{ return NiatelemetryAaaLdapProviderDetailsResponse{ MoAggregateTransform: v} }
component_interface.rs
use crate::errors::Error; use crate::ir::traversal::{Action, Named, VisResult, Visitor}; use crate::ir::{self, LibrarySignatures}; use crate::{build_assignments, guard, structure}; use std::rc::Rc; #[derive(Default)] /// Wires up the `go` and `done` holes for FuTIL programs with a single /// enable to the component `go` and `done` ports. /// /// For example: /// ``` /// component main(go: 1) -> (done: 1) { /// cells { .. } /// wires { /// group only_group { .. } /// } /// control { only_group; } /// } /// ``` /// is transformed into: /// ``` /// component main(go: 1) -> (done: 1) { /// cells { .. } /// wires { /// group only_group { .. } /// only_group[go] = go; /// done = only_group[done]; /// } /// control { only_group; } /// } /// ``` pub struct ComponentInterface; impl Named for ComponentInterface { fn name() -> &'static str { "component-interface-inserter" } fn description() -> &'static str { "wire up a single enable to the go/done interface in a component" } } impl Visitor for ComponentInterface { fn start( &mut self, comp: &mut ir::Component, ctx: &LibrarySignatures, ) -> VisResult { let control_ref = Rc::clone(&comp.control); let control = control_ref.borrow(); if let ir::Control::Enable(data) = &*control { let this = Rc::clone(&comp.signature); let mut builder = ir::Builder::from(comp, ctx, false); let group = &data.group; structure!(builder; let one = constant(1, 1); ); let group_done = guard!(group["done"]); let mut assigns = build_assignments!(builder; group["go"] = ? this["go"]; this["done"] = group_done ? one["out"]; ); comp.continuous_assignments.append(&mut assigns); Ok(Action::Stop) } else if let ir::Control::Empty(..) = &*control { Ok(Action::Stop) } else { Err(Error::MalformedControl( "ComponentInterface: Structure has more than one group" .to_string(), )) } }
}
forms.py
from django import forms from .models import Quests, PACKAGE_SELECTION class QuestCreationForm(forms.ModelForm): """ A form that creates a post, from the given data """ CITY_SELECTION = ( ('Toronto', 'Toronto'), ('Brampton', 'Brampton'), ('Markham', 'Markham'), ('Mississauga', 'Mississauga'), ('Richmond Hill', 'Richmond Hill'), ('Vaughan', 'Vaughan'), ('Oakville', 'Oakville') ) size = forms.ChoiceField( choices=PACKAGE_SELECTION, error_messages={ 'required': 'We need to know how you like your item to be shipped!', 'invalid_choice': 'Please select one of the options available !', }, widget=forms.Select( attrs={ 'class': 'form-control m-b', 'required': 'true' } ) ) srccity = forms.ChoiceField( choices=CITY_SELECTION, error_messages={ 'required': 'Name of the city is required !', 'invalid_choice': 'Please select one of the options available !' }, widget=forms.Select( attrs={ 'class': 'form-control input-lg', 'data-size': '5', 'required': 'true' } ) ) srcaddress = forms.CharField( error_messages={ 'required': 'Street/Apt. Address where the \ shipment is to be picked up from is required !', }, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'Street Address, P.O box, company name, etc', 'required': 'true' } ) ) srcaddress_2 = forms.CharField( required=False, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'Apartment, suite, unit, building, floor, etc.', 'required': 'false' } ) ) srcname = forms.CharField( error_messages={ 'required': 'Name of the sender is required!', }, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'John Doe', 'required': 'true' } ) ) srcphone = forms.CharField( required=False, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'data-mask': '(999) 999-9999', 'placeholder': '(123) 456 - 7890', 'required': 'true' } ) ) srcpostalcode = forms.CharField( error_messages={ 'required': 'Your postcode is required !', }, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'M8V 0A5', 'required': 'true', } ) ) dstcity = forms.ChoiceField( choices=CITY_SELECTION, error_messages={ 'required': 'Name of the city is required !', 'invalid_choice': 'Please select one of the options available !' }, widget=forms.Select( attrs={ 'class': 'form-control input-lg', 'data-size': '5', 'required': 'true', } ) ) dstaddress = forms.CharField( error_messages={ 'required': 'Street/Apt. Address where the \ shipment is to be dropped off from is required !', }, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'Street Address, P.O box, company name, etc', 'required': 'true', } ) ) dstaddress_2 = forms.CharField( required=False, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'Apartment, suite, unit, building, floor, etc.', } ) ) dstname = forms.CharField( error_messages={ 'required': 'Name of the receiver is required!', }, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'John Doe', 'required': 'true', } ) ) dstphone = forms.CharField( required=False, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'data-mask': '(999) 999-9999', 'placeholder': '(123) 456 - 7890', 'required': 'true', } ) ) dstpostalcode = forms.CharField( error_messages={ 'required': 'Your postcode is required !', }, widget=forms.TextInput( attrs={ 'class': 'form-control input-lg', 'placeholder': 'M8V 0A5', 'required': 'true', } ) ) class Meta: model = Quests fields = ['title', 'size', 'description'] def __init__(self, *args, **kwargs): super(QuestCreationForm, self).__init__(*args, **kwargs) self.fields['title'].widget.attrs = { 'class': 'form-control input-lg', 'required': 'true', 'placeholder': 'Name of your shipment.' } self.fields['description'].widget.attrs = { 'class': 'form-control', 'rows': '5', 'required': 'true', 'placeholder': 'Tell us about your shipment.' } class QuestConfirmForm(forms.ModelForm): """ A form that creates a post, from the given data """ CITY_SELECTION = ( ('Toronto', 'Toronto'), ('Brampton', 'Brampton'), ('Markham', 'Markham'), ('Mississauga', 'Mississauga'), ('Richmond Hill', 'Richmond Hill'), ('Vaughan', 'Vaughan'), ('Oakville', 'Oakville') ) size = forms.ChoiceField( choices=PACKAGE_SELECTION, error_messages={ 'required': 'We need to know how you like your item to be shipped!', 'invalid_choice': 'Please select one of the options available !', }, ) srccity = forms.ChoiceField( choices=CITY_SELECTION, error_messages={ 'required': 'Name of the city is required !', 'invalid_choice': 'Please select one of the options available !' }, ) srcaddress = forms.CharField( error_messages={ 'required': 'Street/Apt. Address where the \ shipment is to be picked up from is required !', }, ) srcaddress_2 = forms.CharField( required=False, ) srcname = forms.CharField( error_messages={ 'required': 'Name of the sender is required!', }, ) srcphone = forms.CharField( required=False, ) srcpostalcode = forms.CharField( error_messages={ 'required': 'Your postcode is required !', }, ) dstcity = forms.ChoiceField( choices=CITY_SELECTION, error_messages={ 'required': 'Name of the city is required !', 'invalid_choice': 'Please select one of the options available !' }, ) dstaddress = forms.CharField( error_messages={ 'required': 'Street/Apt. Address where the \ shipment is to be dropped off from is required !', },
) dstname = forms.CharField( error_messages={ 'required': 'Name of the receiver is required!', }, ) dstphone = forms.CharField( required=False, ) dstpostalcode = forms.CharField( error_messages={ 'required': 'Your postcode is required !', }, ) # PICKUP_TIME_SELECTION = (('now','Now'),('not_now','Not_now')) # NOT_NOW_SELECTION = (('Today','Today'),('Tomorrow','Tomorrow')) # pickup_time = forms.ChoiceField(choices=PICKUP_TIME_SELECTION, widget=forms.RadioSelect()) # pickup_when = forms.ChoiceField(required=False, # choices=NOT_NOW_SELECTION, # error_messages={ # 'invalid_choice' : 'Please select one of the options available !' # }) # not_now_pickup_time = forms.CharField(required=False) class Meta: model = Quests exclude = ['questrs','status','creation_date','isaccepted', 'shipper', 'delivery_code', 'pickup', \ 'dropoff', 'delivery_date', 'map_image','available_couriers','tracking_number', 'pickup_time','considered_couriers'] error_messages = { 'size' : { 'required' : 'We need to know how you like your item to be shipped!', 'invalid_choice' : 'Please select one of the options available !', }, 'title' : { 'required' : 'A title is required !', }, 'reward' : { 'required' : 'Every shipment has a price!', 'invalid' : 'There is a limit to how much one pays for a shipment!', }, } # class QuestChangeForm(forms.ModelForm): # """ # A form to edit a quest that has been created already # """ # CITY_SELECTION = (('Toronto','Toronto'),('Brampton','Brampton'),('Markham','Markham'), # ('Mississauga','Mississauga'),('Richmond Hill','Richmond Hill'),('Vaughan','Vaughan'), # ('Oakville','Oakville')) # srccity = forms.ChoiceField( # choices=CITY_SELECTION, # error_messages={ # 'required' : 'Name of the city is required !', # 'invalid_choice' : 'Please select one of the options available !' # } # ) # srcaddress = forms.CharField( # error_messages={'required' : 'Street/Apt. Address where the shipment is to be picked up from is required !',} # ) # srcname = forms.CharField( # error_messages={'required' : 'Name of the sender is required!',} # ) # srcphone = forms.CharField(required=False) # srcpostalcode = forms.CharField( # error_messages={'required' : 'Your postcode is required !',} # ) # dstcity = forms.ChoiceField( # choices=CITY_SELECTION, # error_messages={'required' : 'Name of the city is required !', # 'invalid_choice' : 'Please select one of the options available !', # } # ) # dstaddress = forms.CharField( # error_messages={'required' : 'Street/Apt. Address where the shipment is to be picked up from is required !',} # ) # dstname = forms.CharField( # error_messages={'required' : 'Name of the sender is required!',} # ) # dstphone = forms.CharField(required=False) # dstpostalcode = forms.CharField( # error_messages={'required' : 'Your postcode is required !',} # ) # class Meta: # model = Quests # exclude = ['questrs','reward','status','creation_date','isaccepted', 'shipper', 'distance', 'delivery_code', \ # 'item_images', 'pickup', 'dropoff', 'delivery_date', 'map_image','available_couriers','tracking_number'] # widget = { # 'description' : forms.TextInput(attrs = { 'placeholder': "Description"}), # 'title' : forms.TextInput(attrs = { 'placeholder': 'Title'}), # 'size' : forms.RadioSelect(attrs = { 'default': "backpack"}), # 'srccity' : forms.Select(attrs = { 'placeholder': "toronto"}), # 'srcaddress' : forms.TextInput(attrs = { 'placeholder': "Departure Address"}), # 'srcname' : forms.TextInput(attrs = { 'placeholder': "John Doe"}), # 'srcphone' : forms.TextInput(attrs = { 'placeholder': "+111-222-333"}), # 'srcpostal' : forms.TextInput(attrs = { 'placeholder': "+111-222-333"}), # 'dstcity' : forms.Select(attrs = { 'placeholder': "toronto"}), # 'dstaddress' : forms.TextInput(attrs = { 'placeholder': "Delivery Address"}), # 'dstname' : forms.TextInput(attrs = { 'placeholder': "John Doe"}), # 'dstphone' : forms.TextInput(attrs = { 'placeholder': "+111-222-333"}), # 'dstpostalcode' : forms.TextInput(attrs = { 'placeholder': "+111-222-333"}), # } # error_messages = { # 'size' : { # 'required' : 'We need to know how you like your item to be shipped!', # 'invalid_choice' : 'Please select one of the options available !', # }, # 'title' : { # 'required' : 'A title is required !', # }, # } class DistancePriceForm(forms.Form): """ A form to get distance relative information """ def __init__(self, *args, **kwargs): super(DistancePriceForm, self).__init__(*args, **kwargs) CITY_SELECTION = (('Toronto','Toronto'),('Brampton','Brampton'),('Markham','Markham'), ('Mississauga','Mississauga'),('Richmond Hill','Richmond Hill'),('Vaughan','Vaughan'), ('Oakville','Oakville')) PACKAGE_SELECTION = (('car','Car'),('backpack','Backpack'),('minivan','Minivan')) srccity = forms.ChoiceField( choices=CITY_SELECTION, error_messages={ 'required' : 'Name of the city is required !', 'invalid_choice' : 'Please select one of the options available !' } ) size = forms.ChoiceField( choices=PACKAGE_SELECTION, error_messages={'required' : 'We need to know how you like your item to be shipped!', 'invalid_choice' : 'Please select one of the options available !', } ) srcaddress = forms.CharField( error_messages={'required' : 'Street/Apt. Address where the shipment is to be picked up from is required !',} ) srcpostalcode = forms.CharField( error_messages={'required' : 'Your postcode is required !',} ) dstcity = forms.ChoiceField( choices=CITY_SELECTION, error_messages={'required' : 'Name of the city is required !', 'invalid_choice' : 'Please select one of the options available !', } ) dstaddress = forms.CharField( error_messages={'required' : 'Street/Apt. Address where the shipment is to be picked up from is required !',} ) dstpostalcode = forms.CharField( error_messages={'required' : 'Your postcode is required !',} ) class TrackingNumberSearchForm(forms.Form): """A form to get details of the shipment from the tracking number""" def __init__(self, *args, **kwargs): super(TrackingNumberSearchForm, self).__init__(*args, **kwargs) tracking_number = forms.CharField( error_messages = {'required':'Please provide with a tracking number'} )
) dstaddress_2 = forms.CharField( required=False,
nvic_ipr3.rs
#[doc = "Reader of register NVIC_IPR3"] pub type R = crate::R<u32, super::NVIC_IPR3>; #[doc = "Writer for register NVIC_IPR3"] pub type W = crate::W<u32, super::NVIC_IPR3>; #[doc = "Register NVIC_IPR3 `reset()`'s with value 0"] impl crate::ResetValue for super::NVIC_IPR3 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type
} #[doc = "Reader of field `PRI_0`"] pub type PRI_0_R = crate::R<u8, u8>; #[doc = "Write proxy for field `PRI_0`"] pub struct PRI_0_W<'a> { w: &'a mut W, } impl<'a> PRI_0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); self.w } } #[doc = "Reader of field `PRI_1`"] pub type PRI_1_R = crate::R<u8, u8>; #[doc = "Write proxy for field `PRI_1`"] pub struct PRI_1_W<'a> { w: &'a mut W, } impl<'a> PRI_1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); self.w } } #[doc = "Reader of field `PRI_2`"] pub type PRI_2_R = crate::R<u8, u8>; #[doc = "Write proxy for field `PRI_2`"] pub struct PRI_2_W<'a> { w: &'a mut W, } impl<'a> PRI_2_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0xff << 16)) | (((value as u32) & 0xff) << 16); self.w } } #[doc = "Reader of field `PRI_3`"] pub type PRI_3_R = crate::R<u8, u8>; #[doc = "Write proxy for field `PRI_3`"] pub struct PRI_3_W<'a> { w: &'a mut W, } impl<'a> PRI_3_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0xff << 24)) | (((value as u32) & 0xff) << 24); self.w } } impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] pub fn pri_0(&self) -> PRI_0_R { PRI_0_R::new((self.bits & 0xff) as u8) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] pub fn pri_1(&self) -> PRI_1_R { PRI_1_R::new(((self.bits >> 8) & 0xff) as u8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] pub fn pri_2(&self) -> PRI_2_R { PRI_2_R::new(((self.bits >> 16) & 0xff) as u8) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] pub fn pri_3(&self) -> PRI_3_R { PRI_3_R::new(((self.bits >> 24) & 0xff) as u8) } } impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] pub fn pri_0(&mut self) -> PRI_0_W { PRI_0_W { w: self } } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] pub fn pri_1(&mut self) -> PRI_1_W { PRI_1_W { w: self } } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] pub fn pri_2(&mut self) -> PRI_2_W { PRI_2_W { w: self } } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] pub fn pri_3(&mut self) -> PRI_3_W { PRI_3_W { w: self } } }
{ 0 }
assetupdatefeedproduceroperation.go
package operations //go:generate ffjson $GOFILE import ( "github.com/youthonline/bitshares/types" "github.com/youthonline/bitshares/util" "github.com/juju/errors" ) func
() { types.OperationMap[types.OperationTypeAssetUpdateFeedProducers] = func() types.Operation { op := &AssetUpdateFeedProducersOperation{} return op } } type AssetUpdateFeedProducersOperation struct { types.OperationFee AssetToUpdate types.AssetID `json:"asset_to_update"` Extensions types.Extensions `json:"extensions"` Issuer types.AccountID `json:"issuer"` NewFeedProducers types.AccountIDs `json:"new_feed_producers"` } func (p AssetUpdateFeedProducersOperation) Type() types.OperationType { return types.OperationTypeAssetUpdateFeedProducers } func (p AssetUpdateFeedProducersOperation) Marshal(enc *util.TypeEncoder) error { if err := enc.Encode(int8(p.Type())); err != nil { return errors.Annotate(err, "encode OperationType") } if err := enc.Encode(p.Fee); err != nil { return errors.Annotate(err, "encode Fee") } if err := enc.Encode(p.Issuer); err != nil { return errors.Annotate(err, "encode Issuer") } if err := enc.Encode(p.AssetToUpdate); err != nil { return errors.Annotate(err, "encode AssetToUpdate") } if err := enc.Encode(p.NewFeedProducers); err != nil { return errors.Annotate(err, "encode NewFeedProducers") } if err := enc.Encode(p.Extensions); err != nil { return errors.Annotate(err, "encode Extensions") } return nil }
init
reparent.go
// Copyright 2013, Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package vtctl import ( "flag" "fmt" "time" "github.com/youtube/vitess/go/vt/topo/topoproto" "github.com/youtube/vitess/go/vt/wrangler" "golang.org/x/net/context" ) var ( disableActiveReparents = flag.Bool("disable_active_reparents", false, "if set, do not allow active reparents. Use this to protect a cluster using external reparents.") ) func init() { addCommand("Tablets", command{ "DemoteMaster", commandDemoteMaster, "<tablet alias>", "Demotes a master tablet."}) addCommand("Tablets", command{ "ReparentTablet", commandReparentTablet, "<tablet alias>", "Reparent a tablet to the current master in the shard. This only works if the current slave position matches the last known reparent action."}) addCommand("Shards", command{ "InitShardMaster", commandInitShardMaster, "[-force] [-wait_slave_timeout=<duration>] <keyspace/shard> <tablet alias>", "Sets the initial master for a shard. Will make all other tablets in the shard slaves of the provided master. WARNING: this could cause data loss on an already replicating shard. PlannedReparentShard or EmergencyReparentShard should be used instead."}) addCommand("Shards", command{ "PlannedReparentShard", commandPlannedReparentShard, "<keyspace/shard> <tablet alias>", "Reparents the shard to the new master. Both old and new master need to be up and running."}) addCommand("Shards", command{ "EmergencyReparentShard", commandEmergencyReparentShard, "<keyspace/shard> <tablet alias>", "Reparents the shard to the new master. Assumes the old master is dead and not responsding."}) } func commandDemoteMaster(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { if *disableActiveReparents { return fmt.Errorf("active reparent actions disable in this cluster") } if err := subFlags.Parse(args); err != nil { return err } if subFlags.NArg() != 1 { return fmt.Errorf("action DemoteMaster requires <tablet alias>") } tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0)) if err != nil { return err } tabletInfo, err := wr.TopoServer().GetTablet(ctx, tabletAlias) if err != nil { return err } _, err = wr.TabletManagerClient().DemoteMaster(ctx, tabletInfo) return err } func commandReparentTablet(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { if *disableActiveReparents { return fmt.Errorf("active reparent actions disable in this cluster") } if err := subFlags.Parse(args); err != nil { return err } if subFlags.NArg() != 1 { return fmt.Errorf("action ReparentTablet requires <tablet alias>") } tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0)) if err != nil { return err } return wr.ReparentTablet(ctx, tabletAlias) } func commandInitShardMaster(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { if *disableActiveReparents { return fmt.Errorf("active reparent actions disable in this cluster") } force := subFlags.Bool("force", false, "will force the reparent even if the provided tablet is not a master or the shard master") waitSlaveTimeout := subFlags.Duration("wait_slave_timeout", 30*time.Second, "time to wait for slaves to catch up in reparenting") if err := subFlags.Parse(args); err != nil { return err } if subFlags.NArg() != 2 { return fmt.Errorf("action InitShardMaster requires <keyspace/shard> <tablet alias>") } keyspace, shard, err := topoproto.ParseKeyspaceShard(subFlags.Arg(0)) if err != nil { return err } tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(1)) if err != nil { return err } return wr.InitShardMaster(ctx, keyspace, shard, tabletAlias, *force, *waitSlaveTimeout) } func commandPlannedReparentShard(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { if *disableActiveReparents { return fmt.Errorf("active reparent actions disable in this cluster") } waitSlaveTimeout := subFlags.Duration("wait_slave_timeout", 30*time.Second, "time to wait for slaves to catch up in reparenting") if err := subFlags.Parse(args); err != nil { return err } if subFlags.NArg() != 2 { return fmt.Errorf("action PlannedReparentShard requires <keyspace/shard> <tablet alias>") } keyspace, shard, err := topoproto.ParseKeyspaceShard(subFlags.Arg(0)) if err != nil { return err } tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(1)) if err != nil
return wr.PlannedReparentShard(ctx, keyspace, shard, tabletAlias, *waitSlaveTimeout) } func commandEmergencyReparentShard(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { if *disableActiveReparents { return fmt.Errorf("active reparent actions disable in this cluster") } waitSlaveTimeout := subFlags.Duration("wait_slave_timeout", 30*time.Second, "time to wait for slaves to catch up in reparenting") if err := subFlags.Parse(args); err != nil { return err } if subFlags.NArg() != 2 { return fmt.Errorf("action EmergencyReparentShard requires <keyspace/shard> <tablet alias>") } keyspace, shard, err := topoproto.ParseKeyspaceShard(subFlags.Arg(0)) if err != nil { return err } tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(1)) if err != nil { return err } return wr.EmergencyReparentShard(ctx, keyspace, shard, tabletAlias, *waitSlaveTimeout) }
{ return err }
console.go
package console import ( "context" "fmt" "github.com/fatih/color" "github.com/jedib0t/go-pretty/v6/table" "github.com/smallnest/rpcx/client" "github.com/smallnest/rpcx/protocol" "os" color2 "sabathe/client/color" "sabathe/client/console/listener" "sabathe/client/console/session" "sabathe/client/grumble" "sabathe/server/register" "strings" ) // console and submit command var App = grumble.New(&grumble.Config{ Name: "sabathe", Description: "", PromptColor: color.New(), HelpSubCommands: true, HelpHeadlineUnderline: true, HelpHeadlineColor: color.New(), }) var MsgChan = make(chan *protocol.Message) // use tcp to connect rpc server func ServiceStart(addr string) client.XClient
// create shell server func ServiceConsole(address string) { Salient := ServiceStart(address) var debugSessionID = 0 // use set debug session id // listen lost message go func() { for msg := range MsgChan { if (strings.Contains(string(msg.Payload), "lost a session") || strings.Contains(string(msg.Payload), "session is close")) && strings.Contains(string(msg.Payload), fmt.Sprintf("%v", debugSessionID)) { debugSessionID = 0 App.Commands().Del("background") App.Commands().Del("shell") App.SetDefaultPrompt() } fmt.Println(color2.Clearln + fmt.Sprintf("%v", string(msg.Payload))) } }() // ------[about session]----- App.AddCommand(&grumble.Command{ Name: "session", Help: "Operation session Settings", Flags: func(f *grumble.Flags) { f.BoolL("list", false, "list all alive sessions") f.IntL("kill", 0, "kill a alive session by id") }, Args: func(a *grumble.Args) { a.Int("id", "session id", grumble.Default(0)) }, Run: func(c *grumble.Context) error { if c.Flags.Bool("list") == true { fmt.Println(debugSessionID) return session.ListSessions(Salient) } if c.Args["id"].Value.(int) != 0 { defaultId := debugSessionID err, id := session.UserSession(Salient, c.Args["id"].Value.(int), c, defaultId) debugSessionID = id if debugSessionID != 0 { session.SessionConsole(App, &debugSessionID, Salient) } return err } if c.Flags.Int("kill") != 0 { return session.KillSession(Salient, c.Flags.Int("kill")) } return nil }, }) // ------[about listener]----- App.AddCommand(&grumble.Command{ Name: "khls", Help: "New create kcp-http listener", Flags: func(f *grumble.Flags) { f.StringL("http", "0.0.0.0:8080", "Set the listening address for data return") f.StringL("name", "", "Set the listener alias name") f.StringL("kcp", "0.0.0.0:8081", "Set the listening address for command delivery") f.BoolL("start", false, "Verify that these addresses create listeners") }, Run: func(c *grumble.Context) error { if c.Flags.Bool("start") == true { _ = listener.InitKhlsListner(Salient, c) } return nil }, }) // list all listen App.AddCommand(&grumble.Command{ Name: "listen", Help: "Operation listener Settings", Flags: func(f *grumble.Flags) { f.BoolL("all", true, "list all already set listener") f.IntL("kill", 0, "kill a running listener") }, Run: func(c *grumble.Context) error { var resp register.Response var req register.Requests if c.Flags.Bool("all") == true && c.Flags.Int("kill") == 0 { err := Salient.Call(context.Background(), "GetListeners", nil, &resp) if err != nil { return err } if resp.Error != nil { return resp.Error } else { if len(resp.ActiveJobMsg) > 0 { t := table.NewWriter() t.SetOutputMirror(os.Stdout) t.AppendHeader(table.Row{"ID", "Listener Type", "Alias Name", "Command delivery address", "Message return address"}) for _, l := range resp.ActiveJobMsg { t.AppendRow([]interface{}{l.ID, l.Description, l.Name, l.SendMsgAddress, l.ReturnMsgAddress}) } t.Render() } else { fmt.Println("😊 no set any listener") } } } if c.Flags.Int("kill") != 0 { req.Listener.JobID = c.Flags.Int("kill") err := Salient.Call(context.Background(), "KillListener", &req, &resp) if err != nil { fmt.Println("😰", err) } if resp.Error != nil { fmt.Println("😰", resp.Error) } else { fmt.Println(fmt.Sprintf("😈 kill listener id %v", c.Flags.Int("kill"))) } } return nil }, }) err := App.Run() if err != nil { return } }
{ c, _ := client.NewPeer2PeerDiscovery(fmt.Sprintf("tcp@%v", addr), "") Salient := client.NewBidirectionalXClient("Service", client.Failtry, client.RandomSelect, c, client.DefaultOption, MsgChan) Salient.Auth("TGzv3JOkF0XG5Qx2TlKwi") //token var request register.Requests var response register.Response request.AuthRequest = "kali123" err := Salient.Call(context.Background(), "AuthUserLogin", &request, &response) if err != nil || response.AuthResponse == false { fmt.Println("[!] Auth User Login is failed") os.Exit(1) } fmt.Println("[+] Auth User Login is success") return Salient }
coloring_ip_sat.py
# Copyright 2021 Hakan Kjellerstrand [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. """ Simple coloring problem (MIP approach) in OR-tools CP-SAT Solver. Inspired by the GLPK:s model color.mod ''' COLOR, Graph Coloring Problem Written in GNU MathProg by Andrew Makhorin <[email protected]> Given an undirected loopless graph G = (V, E), where V is a set of nodes, E <= V x V is a set of arcs, the Graph Coloring Problem is to find a mapping (coloring) F: V -> C, where C = {1, 2, ... } is a set of colors whose cardinality is as small as possible, such that F(i) != F(j) for every arc (i,j) in E, that is adjacent nodes must be assigned different colors. ''' This is a port of my old OR-tools CP solver coloring_ip.py This model was created by Hakan Kjellerstrand ([email protected]) Also see my other OR-tols models: http://www.hakank.org/or_tools/ """ from __future__ import print_function from ortools.sat.python import cp_model as cp
import math, sys # from cp_sat_utils import * def main(): model = cp.CpModel() # max number of colors # [we know that 4 suffices for normal maps] nc = 5 # number of nodes n = 11 # set of nodes V = list(range(n)) num_edges = 20 # # Neighbours # # This data correspond to the instance myciel3.col from: # http://mat.gsia.cmu.edu/COLOR/instances.html # # Note: 1-based (adjusted below) E = [[1, 2], [1, 4], [1, 7], [1, 9], [2, 3], [2, 6], [2, 8], [3, 5], [3, 7], [3, 10], [4, 5], [4, 6], [4, 10], [5, 8], [5, 9], [6, 11], [7, 11], [8, 11], [9, 11], [10, 11]] # # declare variables # # x[i,c] = 1 means that node i is assigned color c x = {} for v in V: for j in range(nc): x[v, j] = model.NewIntVar(0, 1, 'v[%i,%i]' % (v, j)) # u[c] = 1 means that color c is used, i.e. assigned to some node u = [model.NewIntVar(0, 1, 'u[%i]' % i) for i in range(nc)] # number of colors used, to minimize num_colors = model.NewIntVar(0,nc, "num_colors") model.Add(num_colors == sum(u)) # # constraints # # each node must be assigned exactly one color for i in V: model.Add(sum([x[i, c] for c in range(nc)]) == 1) # adjacent nodes cannot be assigned the same color # (and adjust to 0-based) for i in range(num_edges): for c in range(nc): model.Add(x[E[i][0] - 1, c] + x[E[i][1] - 1, c] <= u[c]) # objective model.Minimize(num_colors) # # solution # solver = cp.CpSolver() status = solver.Solve(model) if status == cp.OPTIMAL: print() print('number of colors:', solver.Value(num_colors)) print('colors used:', [solver.Value(u[i]) for i in range(nc)]) print() for v in V: print('v%i' % v, ' color ', end=' ') for c in range(nc): if solver.Value(x[v, c]) == 1: print(c) print() print('NumConflicts:', solver.NumConflicts()) print('NumBranches:', solver.NumBranches()) print('WallTime:', solver.WallTime()) if __name__ == '__main__': main()
noam_hook.py
class NoamOptimizer: """ This Hook implements the optimization strategy presented in the "Attention is all you need" paper Section 5.3. """ timing = "pre" name = "NoamOptimizerHook" call_for_each_param = False def
(self, num_warmup_steps, factor, model_size): self.num_warmup_steps = num_warmup_steps self.factor = factor self.model_size = model_size self.iteration = 0 def __call__(self, optimizer): self.iteration += 1 warmup_vs_step_num = min(self.iteration ** (-0.5), self.iteration * self.num_warmup_steps ** (-1.5)) optimizer.alpha = self.factor * self.model_size ** (-0.5) * warmup_vs_step_num
__init__