diff --git a/data/core.telegram.org/api/animated-emojis.html b/data/core.telegram.org/api/animated-emojis.html new file mode 100644 index 0000000000..b88fa154f4 --- /dev/null +++ b/data/core.telegram.org/api/animated-emojis.html @@ -0,0 +1,148 @@ + + + + + Animated Emojis + + + + + + + + + + + + + +
+ +
+
+
+ +

Animated Emojis

+ +

Graphical telegram clients should transform emojis into their respective animated version.

+
inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+---functions---
+
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+

On startup, clients should fetch the animated emoji stickerset by calling the messages.getStickerSet method, providing inputStickerSetAnimatedEmoji to the stickerset field.
+The returned stickerset will contain a set of animated stickers, one for each of the supported emojis.

+

Clients should substitute messages containing only one instance of one of the allowed emojis with the respective animated sticker.

+

Animated emojis should loop only once when first sent or received, or when clicked.

+

For special dice emojis like 🎲, 🎯, or 🏀, clients are supposed to behave differently both when sending and receiving such emojis: click here for more info ».

+

Emojis with sounds

+

Certained animated emojis should play sound when clicked, as specified by server-side configuration.

+

The returned JSON object will contain the following map, with a list of file IDs to download:

+
    "emojies_sounds": {
+        "\ud83c\udf83": {
+            "id": "4956223179606458539",
+            "access_hash": "-2107001400913062971",
+            "file_reference_base64": "AF-4ApC7ukC0UWEPZN0TeSJURe7T"
+        },
+        "\u26b0": {
+            "id": "4956223179606458540",
+            "access_hash": "-1498869544183595185",
+            "file_reference_base64": "AF-4ApCLKMGt96WCvLm58kbqZHd3"
+        },
+        "\ud83e\udddf\u200d\u2642": {
+            "id": "4960929110848176331",
+            "access_hash": "3986395821757915468",
+            "file_reference_base64": "AF-4ApAedNln3IMEHH-SUQuH8L9g"
+        },
+    }
+

The file reference field should be base64-decoded before downloading the file

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/api/files.html b/data/core.telegram.org/api/files.html new file mode 100644 index 0000000000..5d3ebb8eff --- /dev/null +++ b/data/core.telegram.org/api/files.html @@ -0,0 +1,550 @@ + + + + + Uploading and Downloading Files + + + + + + + + + + + + + +
+ +
+
+
+ +

Uploading and Downloading Files

+ +
+ +

When working with the API, it is sometimes necessary to send a relatively large file to the server. For example, when sending a message with a photo/video attachment or when setting the current user’s profile picture.

+

Uploading files

+

There are a number of API methods to save files. The schema of the types and methods used is presented below:

+
inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+inputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;
+inputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;
+
+inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+
+inputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;
+
+
+---functions---
+
+messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int = Updates;
+messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;
+messages.sendEncryptedFile#5559481d flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+
+photos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;    
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+

Before transmitting the contents of the file itself, the file has to be assigned a unique 64-bit client identifier: file_id.

+

The file’s binary content is then split into parts. All parts must have the same size ( part_size ) and the following conditions must be met:

+
    +
  • part_size % 1024 = 0 (divisible by 1KB)
  • +
  • 524288 % part_size = 0 (512KB must be evenly divisible by part_size)
  • +
+

The last part does not have to satisfy these conditions, provided its size is less than part_size.

+

Each part should have a sequence number, file_part, with a value ranging from 0 to 2,999.

+

After the file has been partitioned you need to choose a method for saving it on the server. Use upload.saveBigFilePart in case the full size of the file is more than 10 MB and upload.saveFilePart for smaller files.

+

Each call saves a portion of the data in a temporary location on the server to be used later. The storage life of each portion of data is between several minutes and several hours (depending on how busy the storage area is). After this time, the file part will become unavailable. To increase the time efficiency of a file save operation, we recommend using a call queue, so X pieces of the file are being saved at any given moment in time. Each successful operation to save a part invokes the method call to save the next part. The value of X can be tuned to achieve maximum performance.

+

When using one of the methods mentioned above to save file parts, one of the following data input errors may be returned:

+
    +
  • FILE_PARTS_INVALID - Invalid number of parts. The value is not between 1..3000
  • +
  • FILE_PART_INVALID: The file part number is invalid. The value is not between 0 and 2,999.
  • +
  • FILE_PART_TOO_BIG: The size limit (512 KB) for the content of the file part has been exceeded
  • +
  • FILE_PART_EMPTY: The file part sent is empty
  • +
  • FILE_PART_SIZE_INVALID - 512KB cannot be evenly divided by part_size
  • +
  • FILE_PART_SIZE_CHANGED - The part size is different from the size of one of the previous parts in the same file
  • +
+

While the parts are being uploaded, an MD5 hash of the file contents can also be computed to be used later as the md5_checksum parameter in the inputFile constructor (since it is checked only by the server, for encrypted secret chat files it must be generated from the encrypted file). +After the entire file is successfully saved, the final method may be called and passed the generated inputFile object. In case the upload.saveBigFilePart method is used, the inputFileBig constructor must be passed, in other cases use inputFile.

+ +

The file save operation may return one of the following data input errors:

+
    +
  • FILE_PARTS_INVALID: The number of file parts is invalid The value is not between 1 and 3,000.
  • +
  • FILE_PART_Х_MISSING: Part X (where X is a number) of the file is missing from storage. Try repeating the method call to resave the part.
  • +
  • MD5_CHECKSUM_INVALID: The file’s checksum did not match the md5_checksum parameter
  • +
+

Albums, grouped media

+
inputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+inputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;
+
+inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;
+
+---functions---
+
+messages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int = Updates;
+

Telegram allows grouping photos into albums and generic files (audio, docuemnts) into media groups.

+

To do this, messages.sendMultiMedia is used, wrapping each InputMedia constructor (uploaded or pre-existing, maximum 10 per media group) into an inputSingleMedia constructor, optionally providing a custom per-file caption in message.

+

For photo albums, clients should display an album caption only if exactly one photo in the group has a caption, otherwise no album caption should be displayed, and only when viewing in detail a specific photo of the group the caption should be shown.
+Other grouped media can display a caption under each file.

+

Re-using pre-uploaded files

+
document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
+
+---functions---
+
+messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;
+

For some types of documents like GIFs, messages.getDocumentByHash can be used to search for the document on Telegram servers. +The SHA256 hash of the file is computed, and it is passed along with the file's mime type and size to the method: if the file type is correct and the file is found, a document is returned.

+

Uploading profile or chat pictures

+
photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+inputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;
+inputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;
+
+---functions---
+
+photos.updateProfilePhoto#72d4742c id:InputPhoto = photos.Photo;
+photos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;
+
+messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
+
+channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
+

User profile pictures can be uploaded using the photos.uploadProfilePhoto method: the actual profile picture has to be uploaded as for normal files.
+photos.uploadProfilePhoto can also be used to reupload previously uploaded profile pictures.

+

Animated profile pictures

+

Animated profile pictures are also supported, by populating the video constructor: square MPEG4 videos up to 1080x1080 are supported, 800x800 is the recommended resolution.
+The video_start_ts is a floating point UNIX timestamp in seconds, indicating the frame of the video that should be used as static preview.

+

Chat, channel and supergroup profile photos and videos can be uploaded using messages.editChatPhoto (legacy groups) or channels.editPhoto (channels, supergroups).
+Use the inputChatPhoto to reuse previously uploaded profile pictures.

+

Downloading files

+

There are methods available to download files which have been successfully uploaded. The schema of the types and methods used is presented below:

+
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+upload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector<FileHash> = upload.File;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+---functions---
+
+upload.getFile#b15a9afc flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:int limit:int = upload.File;
+

Any file can be downloaded by calling upload.getFile. +The data for the input parameter of the InputFileLocation type is generated as follows:

+
inputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
+inputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;
+inputTakeoutFileLocation#29be5899 = InputFileLocation;
+inputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;
+inputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;
+inputPeerPhotoFileLocation#27d69997 flags:# big:flags.0?true peer:InputPeer volume_id:long local_id:int = InputFileLocation;
+inputStickerSetThumb#dbaeae9 stickerset:InputStickerSet volume_id:long local_id:int = InputFileLocation;
+
+inputStickerSetEmpty#ffb62b95 = InputStickerSet;
+inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
+inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
+
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;
+inputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;
+
+photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
+document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
+
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
    +
  • +

    For photos, inputPhotoFileLocation is used:

    +
      +
    • id, file_reference and access_hash taken from the photo constructor
    • +
    • thumb_size taken from the type field of the desired PhotoSize of the photo
    • +
    +
  • +
  • +

    For profile pictures of users, channels, supergroups and groups, since in most occasions they are encountered as simple fileLocationToBeDeprecated constructors without an associated photo, inputPeerPhotoFileLocation has to be used:

    +
      +
    • peer is the identifier of the peer whose photo we want to download
    • +
    • volume_id and local_id are extracted from the fileLocationToBeDeprecated of the desired quality (the logic for selecting the quality of profile pictures will be changed soon)
    • +
    +
  • +
  • +

    For documents, inputDocumentFileLocation is used:

    +
      +
    • id, file_reference and access_hash taken from the document constructor
    • +
    • If downloading the thumbnail of a document, thumb_size should be taken from the type field of the desired PhotoSize of the photo; otherwise, provide an empty string.
    • +
    +
  • +
  • +

    For encrypted secret chat and telegram passport documents, respectively inputEncryptedFileLocation and inputSecureFileLocation have to be used, with parameters extracted from encryptedFile and secureFile (passport docs).

    +
  • +
  • +

    For previews of sticker sets, inputStickerSetThumb is used (note: to download stickers and previews of stickers use the document method described above):

    + +
  • +
  • +

    For old deprecated photos, if the client has cached some old fileLocations with the deprecated secret identifier, inputFileLocation is used (this is mainly used for backwards compatiblity with bot API file IDs, all user clients must use the modern inputPhotoFileLocation file IDs):

    +
      +
    • All fields are taken from the previously cached fileLocation except for id, file_reference and access_hash taken from the photo constructor
    • +
    +
  • +
+

The size of each file in bytes is available, which makes it possible to download the file in parts using the parameters offset and limit, similar to the way files are uploaded.

+

If precise flag is not specified, then

+
    +
  • The parameter offset must be divisible by 4 KB.
  • +
  • The parameter limit must be divisible by 4 KB.
  • +
  • 1048576 (1 MB) must be divisible by limit.
  • +
+

If precise is specified, then

+
    +
  • The parameter offset must be divisible by 1 KB.
  • +
  • The parameter limit must be divisible by 1 KB.
  • +
  • limit must not exceed 1048576 (1 MB).
  • +
+

In any case the requested part should be within one 1 MB chunk from the beginning of the file, i. e.

+
    +
  • offset / (1024 * 1024) == (offset + limit - 1) / (1024 * 1024).
  • +
+

The file download operation may return a FILE_REFERENCE_EXPIRED error (or another error starting with FILE_REFERENCE_): in this case, the file_reference field of the input location must be refreshed. +The file download operation may return an upload.fileCdnRedirect constructor: in this case, these instructions must be followed for downloading CDN files. +The file download operation may also return one of the following data input errors:

+
    +
  • FILE_ID_INVALID: The file address is invalid
  • +
  • OFFSET_INVALID: The offset value is invalid
  • +
  • LIMIT_INVALID: The limit value is invalid
  • +
  • FILE_MIGRATE_X: The file is in the datacenter No. X
  • +
+

Verifying downloaded chunks

+
fileHash#6242c773 offset:int limit:int hash:bytes = FileHash;
+
+---functions---
+
+upload.getFileHashes#c7025931 location:InputFileLocation offset:int = Vector<FileHash>;
+

In order to confirm the integrity of the downloaded file, clients are recommended to verify hashes for each downloaded part, as for CDN DCs. +upload.getFileHashes contain FileHash constructors. Each of these constructors contains the SHA-256 hash of a part of the file that starts with offset and takes limit bytes.

+

Before saving each portion of the data received from the DC into the file, the client can confirm that its hash matches the hash that was received from the master DC. If missing a hash for any file part, client developers must use the upload.getFileHashes method to obtain the missing hash.

+

Handling audio, video and vector previews

+

Scheme:

+
photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
+photoSizeProgressive#5aa86a51 type:string location:FileLocation w:int h:int sizes:Vector<int> = PhotoSize;
+photoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;
+
+videoSize#e831c556 flags:# type:string location:FileLocation w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
+
+document#1e87342b flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:int thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;
+photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
+
+photo#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;
+

Telegram attaches a vector of thumbnails with reduced resolution to all uploaded media.
+The server also generates a trimmed and scaled down video preview for videos, GIFs and animated profile pictures.

+

Image thumbnail types

+

Each photo preview has a specific type, indicating the resolution and image transform that was applied server-side.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeImage filterSize
sbox100x100
mbox320x320
xbox800x800
ybox1280x1280
wbox2560x2560
acrop160x160
bcrop320x320
ccrop640x640
dcrop1280x1280
+

Special types:

+ + + + + + + + + + + + + + + + + +
TypeImage filter
istrip
joutline
+

Stripped thumbnails

+
photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;
+

A photoStrippedSize (with type i) is an extremely low-res thumbnail, embedded directly inside media location objects.
+It should be shown to the user in chat message previews, or while still downloading the most appropriately sized photoSize through the media DCs as described above.

+

The stripped bytes payload should be inflated to a JPG payload as seen here ».

+

Vector thumbnails

+
photoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;
+

Messages with animated stickers can have a compressed svg (< 300 bytes) to show the outline of the sticker before fetching the actual lottie animation. +Animated sticker outlines will have a j type photoPathSize thumbnail.

+

This specific vector thumbnail consists in an SVG path, specially encoded to save space.
+This path will be the outline of the animated sticker, and should be shown to the user while downloading the actual sticker.

+

As for stripped sizes, the payload should be inflated using the following algorithm:

+
encoded := photoPathSize.bytes
+
+lookup := "AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"
+
+path := "M"
+
+len := strlen(encoded)
+for (i = 0; i < len; i++) {
+  num := ord(encoded[i])
+  if (num >= 128 + 64) {
+    path += lookup[num - 128 - 64]
+  } else {
+    if (num >= 128) {
+      path += ','
+    } else if (num >= 64) {
+      path += '-'
+    }
+    path += itoa(num & 63)
+  }
+}
+path += "z"
+

path will contain the actual SVG path that can be directly inserted in the d attribute of an svg <path> element:

+
<?xml version="1.0" encoding="utf-8"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+   viewBox="0 0 512 512" xml:space="preserve">
+<path d="{$path}"/>
+</svg>
+

Video types

+
videoSize#e831c556 flags:# type:string location:FileLocation w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
+

A videoSize constructor is typically used for [animated profile pictures]() and video previews.

+ + + + + + + + + + + + + + + + + + + + +
TypeDescriptionFormat
uAnimated profile pictureMPEG4
vVideo previewMPEG4
+

Downloading webfiles

+

Remote HTTP files sent by inline bots in response to inline queries and in other places are represented by WebDocument constructors. +When forwarding such remote HTTP files, they should be sent using external InputMedia constructors. +Remote HTTP files can only be downloaded directly by the client if contained in a webDocumentNoProxy constructor: in this case, the file is deemed safe to download (this is the case for HTTPS files from certain trusted domains).

+

However, if the remote file is contained in a webDocument, to avoid leaking sensitive information the file must be downloaded through telegram's servers. +This can be done in a manner similar to normal files, with the difference that upload.getWebFile must be used, instead.

+
upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+ ---functions---
+
+upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
+

The InputWebFileLocation constructor is generated as follows.

+
inputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;
+inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;
+
+webDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;
+
+inputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;
+
+geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;
+
    +
  • inputWebFileLocation is simply generated by taking the url and access_hash fields of the webDocument constructor.
  • +
  • inputWebFileGeoPointLocation is used to download a server-generated image with the map preview from a geoPoint.
      +
    • geo_point is generated from the lat, long accuracy_radius parameters of the geoPoint
    • +
    • access_hash is the access hash of the geoPoint
    • +
    • w - Map width in pixels before applying scale; 16-1024
    • +
    • h - Map height in pixels before applying scale; 16-1024
    • +
    • zoom - Map zoom level; 13-20
    • +
    • scale - Map scale; 1-3
    • +
    +
  • +
+

General Considerations

+

It is recommended that large queries (upload.getFile, upload.saveFilePart, upload.getWebFile) be handled through a separate session and a separate connection, in which no methods other than these should be executed. If this is done, then data transfer will cause less interference with getting updates and other method calls.

+

Related articles

+

Handling file references

+

How to handle file references.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/tsf.telegram.org/css/billboard.css b/data/tsf.telegram.org/css/billboard.css new file mode 100644 index 0000000000..7b02ca0698 --- /dev/null +++ b/data/tsf.telegram.org/css/billboard.css @@ -0,0 +1,359 @@ +/*! + * Copyright (c) 2017 ~ present NAVER Corp. + * billboard.js project is licensed under the MIT license + * + * billboard.js, JavaScript chart library + * http://naver.github.io/billboard.js/ + * + * @version 1.7.1 + */ +.bb-color-pattern{background-image:url(#00c73c;#fa7171;#2ad0ff;#7294ce;#e3e448;#cc7e6e;#fb6ccf;#c98dff;#4aea99;#bbbbbb;)}.bb svg{font-size:12px;font-family:Meiryo,sans-serif,Arial,nanumgothic,Dotum;line-height:1}.bb line,.bb path{fill:none;stroke:#c4c4c4}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:#555;font-size:11px}.bb-axis,.bb-bars path,.bb-event-rect,.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-axis-y2 text,.bb-axis-y text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid line{stroke:#f1f1f1}.bb-grid .bb-ygrid:last-child{stroke:#e9e9e9}.bb-xgrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_{fill:#fff!important;stroke-width:2px;stroke:red}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:1px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-target.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused{opacity:.3!important}.bb-region{fill:#4682b4;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font-size:14px}.bb-tooltip-container{z-index:10;font-family:Meiryo,sans-serif,Arial,nanumgothic,Dotum;position:absolute}.bb-tooltip{border-collapse:separate;border-spacing:0;empty-cells:show;border:1px solid #999;background-color:#fff;text-align:left;font-size:11px}.bb-tooltip th{font-size:12px;padding:4px 8px;text-align:left;border-bottom:1px solid #eee}.bb-tooltip td{padding:4px 6px;background-color:#fff}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:10px;height:10px;margin-right:6px;border-radius:5px;vertical-align:middle}.bb-tooltip td.value{border-left:1px solid transparent}.bb-tooltip .bb-tooltip-title{display:inline-block;color:#aaa;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;line-height:13px;padding:4px 0 3px;color:#444;text-align:left;font-weight:400}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{padding-left:5px;font-weight:800;font-size:12px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{font-size:16px!important;fill:#000;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{border:1px solid #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer} + + +.bb svg, +.bb-tooltip-container { + font-size: 12px; + font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; +} +.bb .bb-axis-x g.tick text tspan { + font-size: 11px; +} +.bb text.bb-axis-x-label { + font-size: 11px; +} +.bb .bb-axis-y g.tick line { + stroke: none; +} +.bb .bb-axis-y2 path.domain { + stroke: none; +} +.bb .bb-axis-y path.domain { + stroke: none; +} +.bb .bb-axis-y2 path.domain { + stroke: none; +} +.bb .bb-axis-x path.domain { + stroke: #DBDBDB; +} +.dark .bb .bb-axis-x path.domain { + stroke: #283442; +} +.bb .bb-grid .bb-ygrids line { + stroke: none; +} +.bb .bb-ygrid-line line { + stroke: #E9E9E9; + stroke-width: 1px; +} +.dark .bb .bb-ygrid-line line { + stroke: #293544; +} +.dark .bb .bb-xgrid-focus line.bb-xgrid-focus { + stroke: #3b4a5a; +} +.dark .bb-circle._expanded_ { + fill: #242f3e !important; +} +.bb-axis-x g.tick line { + stroke: none; +} +.bb g.tick { + font-size: 14px; +} +.bb text.bb-axis-x-label, +.bb g.tick text tspan { + fill: #7A8A93; + -webkit-text-stroke: 2px #fff; + text-shadow: + -1px -1px 0 #fff, + 1px -1px 0 #fff, + -1px 1px 0 #fff, + 1px 1px 0 #fff; +} +.dark .bb text.bb-axis-x-label, +.dark .bb g.tick text tspan { + fill: #546778; + -webkit-text-stroke: 2px #242f3e; + text-shadow: + -1px -1px 0 #242f3e, + 1px -1px 0 #242f3e, + -1px 1px 0 #242f3e, + 1px 1px 0 #242f3e; +} +.bb-axis-y2 g.tick line { + stroke: none; +} +.chart_wrap { + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently + supported by Chrome and Opera */ +} +.chart_wrap > svg rect.selection { + fill: #1F8CED; + fill-opacity: 0.1; + stroke: none; + /*stroke: #1F8CED;*/ + /*stroke-width: 2px;*/ + /*stroke-dasharray: 0,50,150;*/ +} +.chart_wrap > svg rect.handle { + stroke: none; + /*width: 3px;*/ + /*fill: #1F8CED;*/ +} +.bb .bb-brush-handle { + stroke: #1F8CED; + stroke-width: 4px; + pointer-events: none; +} +.dark .bb .bb-brush-handle { + stroke: #4d96cd; +} + +.chart_wrap > svg > g:nth-child(3) > g.bb-axis-x .tick { + display: none; +} +.bb-area { + stroke-width:0; + opacity: 0.8; +} +.bb-chart-lines g.bb-lines path.bb-line { + stroke-width: 2px; +} +svg > g:nth-child(3) .bb-chart-lines g.bb-lines path.bb-line { + stroke-width: 1px; +} +.bb-chart-lines g.bb-target-chart-type--area g.bb-lines path.bb-line, +.bb-chart-lines g.bb-target-chart-type--area-step g.bb-lines path.bb-line { + stroke-width: 0; +} + +.bb-circles circle { + visibility: hidden; +} +.bb-circles circle._expanded_, +.bb-target-chart-type--bubble .bb-circles circle { + visibility: visible; +} +.bb-legend-item text { + fill: #7A8A93; + font-size: 14px; +} +.dark .bb-legend-item text { + fill: #546778; +} + +.bb-tooltip { + border-radius: 2px; + overflow: hidden; + border: 0; + /*border-color: #CCC;*/ + /*-webkit-box-shadow: 1px 1px 0 0px rgba(0,0,0,0.1), -1px -1px 0 0px rgba(0,0,0,0.1); + -moz-box-shadow: 1px 1px 0 0px rgba(0,0,0,0.1), -1px -1px 0 0px rgba(0,0,0,0.1); + box-shadow: 1px 1px 0 0px rgba(0,0,0,0.1), -1px -1px 0 0px rgba(0,0,0,0.1);*/ + + -webkit-box-shadow: 1px 0px 1px 0px rgba(0,0,0,0.1), + -1px 0px 1px 0px rgba(0,0,0,0.1), + 0px 1px 1px 0px rgba(0,0,0,0.1), + 0px -1px 0 0px rgba(0,0,0,0.1); + box-shadow: 1px 0px 1px 0px rgba(0,0,0,0.1), + -1px 0px 1px 0px rgba(0,0,0,0.1), + 0px 1px 1px 0px rgba(0,0,0,0.1), + 0px -1px 0 0px rgba(0,0,0,0.1); +} +.dark .bb-tooltip, +.dark .bb-tooltip td { + background-color: #283442; +} +.bb-tooltip th { + border-bottom: 0; + padding-top: 10px; + padding-left: 10px; + padding-right: 10px; +} +.bb-tooltip td:first-child { + padding-left: 10px; +} +.bb-tooltip td:last-child { + padding-right: 10px; +} +.bb-tooltip tr:first-child td { + padding-top: 10px; +} +.bb-tooltip tr:last-child td { + padding-bottom: 10px; +} +.bb-tooltip td.value { + font-weight: bold; +} +.bb-tooltip td.name, +.bb-tooltip td.value { + font-size: 12px; +} +.bb-tooltip td>span, .bb-tooltip td>svg { + width: 11px; + height: 11px; +} +.piechart .bb-tooltip td:first-child { + padding-left: 8px; +} +.piechart .bb-tooltip td:last-child { + padding-right: 8px; +} +.piechart .bb-tooltip tr:first-child td { + padding-top: 5px; + padding-bottom: 5px; +} +.bb-chart-arc text { + font-size: 12px; + font-weight: bold; +} +.dark .bb-chart-arc path { + stroke: #242f3e; +} + + +.chart_wrap_loading { + color: #7A8A93; + font-size: 16px; + text-align: center; + + display: flex; + align-items: center; + justify-content: center; + padding: 40px 20px; +} +.dark .chart_wrap_loading { + color: #546778; +} + +.bbchart-custom-legend { + padding: 0 10px; + margin: -11px 0 7px; +} +.bbchart_wrap_noslider .bbchart-custom-legend { + margin-top: 0; +} +.bbchart-custom-legend-label { + display: inline-block; + padding: 6px 12px 6px 7px; + border-radius: 18px; + height: 34px; + line-height: 32px; + /*background: #f1f5f8;*/ + margin-right: 5px; + margin-bottom: 3px; + font-size: 12px; + vertical-align: middle; + border: 1px solid #e6ecf0; +} +.dark .bbchart-custom-legend-label { + /*background: #4788ba;*/ + border-color: #344658; +} +.bbchart-custom-legend-label-icon { + display: inline-block; + width: 20px; + height: 20px; + border-radius: 10px; + overflow: hidden; + margin-right: 10px; + line-height: 20px; + vertical-align: top; +} +.bbchart-custom-legend-label-icon-tick { + display: inline-block; + height: 8px; + width: 11px; + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMSIgaGVpZ2h0PSI4Ij48cGF0aCBkPSJNMy42OTcxNjcxIDUuMjM4NDUwN0w4LjUwNDYwMTkuNDMxMDE1OWMuMzkwNTcwOS0uMzkwNTcxIDEuMDIzODExNi0uMzkwNTcxIDEuNDE0MzgyNiAwIC4zOTA1NzA5LjM5MDU3MS4zOTA1NzA5IDEuMDIzODExNiAwIDEuNDE0MzgyNmwtNS40MjE4IDUuNDIxNzk5OWMtLjIyNjczMzQuMjI2NzMzNS0uNTM1MjQ2OC4zMjE4NDQxLS44MzA1OTA3LjI4NTMzMTktLjExOTQzOS4wMDQwOTMzLS4yNDE1ODEzLS4wMjA1NDU0LS4zNTYxNTA0LS4wNzczNzc4YS43NDU0NTgwNy43NDU0NTgwNyAwIDAgMS0uMTc4ODYxNy0uMTI0MjMzMUwuNDE2NjM4NyA0LjgwMzAxNzZDLjAzNDc4MDQgNC40NDQ2NTM3LjAxNTczNDQgMy44NDQ1ODUxLjM3NDA5ODMgMy40NjI3MjY4YS45NDc5NTA1NS45NDc5NTA1NSAwIDAgMSAuMDE1NTg0Mi0uMDE2MjE2MWMuMzc4MzA1MS0uMzg0NDE0MS45OTQ2NDgzLS4zOTU0NzAzIDEuMzg2NDk3MS0uMDI0ODcxNmwxLjkyMDk4NzUgMS44MTY4MTE2eiIgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+); + transform: translateX(5px) translateY(1px); +} +.bbchart-custom-legend-label-hidden .bbchart-custom-legend-label-icon-tick { + height: 16px; + width: 16px; + border-radius: 8px; + background: #ffffff; + border: 0; + transform: none; + margin: 2px 2px; +} +.dark .bbchart-custom-legend-label-hidden .bbchart-custom-legend-label-icon-tick { + /*background: #4788ba;*/ + background: #242f3e; +} +.bbchart-custom-legend-label-text { + line-height: 20px; + display: inline-block; + vertical-align: top; +} + + + + +.button-item.ripple-handler { + position: relative; +} +.ripple-mask { + position: absolute; + left: 0; right: 0; + top: 0; bottom: 0; + transform: translateZ(0); + overflow: hidden; + pointer-events: none; +} +.radio-item .ripple-mask, +.checkbox-item .ripple-mask { + width: 32px; + height: 32px; + left: -6px; + top: -6px; + border-radius: 16px; +} +.button-item .ripple-mask { + border-radius: 19px; +} +.radio-item .ripple, +.checkbox-item .ripple { + position: absolute; + width: 80px; + height: 80px; + left: -24px; + top: -24px; + border-radius: 50%; + background-color: rgba(179, 179, 179, .2); + transition: transform .65s ease-out, opacity .65s ease-out, background-color .65s ease-out; + opacity: 0; +} +.radio-item input.radio:checked + .radio-input .ripple, +.checkbox-item input.checkbox:checked + .checkbox-input .ripple { + background-color: rgba(84, 169, 235, .2); +} +.button-item .ripple { + position: absolute; + width: 200%; + left: 50%; top: 50%; + margin: -100% 0 0 -100%; + padding-top: 200%; + border-radius: 50%; + /*background-color: rgba(179, 179, 179, .2);*/ + background-color: rgba(55, 144, 207, .2); + /*background-color: #3790cf;*/ + transition: transform .65s ease-out, opacity .65s ease-out, background-color .65s ease-out; + opacity: 0; +} +/*.button-item-flat .ripple { + background-color: #d9ebf7; +}*/ + +.bbchart-custom-legend-label .ripple { + background-color: rgba(119, 160, 191, .08); +} + +.dark .bbchart-custom-legend-label .ripple { + background-color: rgba(121, 153, 185, .08); +} diff --git a/data/tsf.telegram.org/js/billboard.min.js b/data/tsf.telegram.org/js/billboard.min.js new file mode 100644 index 0000000000..55e2c536e2 --- /dev/null +++ b/data/tsf.telegram.org/js/billboard.min.js @@ -0,0 +1,13 @@ +/*! + * Copyright (c) 2017 ~ present NAVER Corp. + * billboard.js project is licensed under the MIT license + * + * billboard.js, JavaScript chart library + * http://naver.github.io/billboard.js/ + * + * @version 1.7.1-snapshot + * + * All-in-one packaged file for ease use of 'billboard.js' with below dependency. + * - d3 ^5.9.1 + */ +!function webpackUniversalModuleDefinition(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,function(){return function(n){var i={};function __webpack_require__(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,__webpack_require__),e.l=!0,e.exports}return __webpack_require__.m=n,__webpack_require__.c=i,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(n,i,function(t){return e[t]}.bind(null,i));return n},__webpack_require__.n=function(t){var e=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=11)}([function(t,e){t.exports=function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){var i=n(2),a=n(3),r=n(4);t.exports=function _slicedToArray(t,e){return i(t)||a(t,e)||r()}},function(t,e){t.exports=function _arrayWithHoles(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function _iterableToArrayLimit(t,e){var n=[],i=!0,a=!1,r=undefined;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(c){a=!0,r=c}finally{try{i||null==s["return"]||s["return"]()}finally{if(a)throw r}}return n}},function(t,e){t.exports=function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){function _defineProperties(t,e){for(var n=0;n=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(t){return new FormatSpecifier(t)}function FormatSpecifier(t){if(!(e=vt.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var bt,Tt,wt,At,kt=function(t,e){var n=xt(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")},Ct={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return kt(100*t,e)},r:kt,s:function(t,e){var n=xt(t,e);if(!n)return t+"";var i=n[0],a=n[1],r=a-(bt=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,o=i.length;return r===o?i:oe));)r=s[a=(a+1)%s.length];return i.reverse().join(c)}):St,n=t.currency,w=t.decimal,A=t.numerals?(e=t.numerals,function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}):St,i=t.percent||"%";function newFormat(t){var u=(t=formatSpecifier(t)).fill,l=t.align,h=t.sign,e=t.symbol,d=t.zero,f=t.width,g=t.comma,p=t.precision,_=t.trim,m=t.type;"n"===m?(g=!0,m="g"):Ct[m]||(null==p&&(p=12),_=!0,m="g"),(d||"0"===u&&"="===l)&&(d=!0,u="0",l="=");var x="$"===e?n[0]:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",y="$"===e?n[1]:/[%p]/.test(m)?i:"",v=Ct[m],b=/[defgprs%]/.test(m);function format(t){var e,n,i,a=x,r=y;if("c"===m)r=v(t)+r,t="";else{var o=(t=+t)<0;if(t=v(Math.abs(t),p),_&&(t=function(t){t:for(var e,n=t.length,i=1,a=-1;i>1)+a+t+r+c.slice(s);break;default:t=c+a+t+r}return A(t)}return p=null==p?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),format.toString=function(){return t+""},format}return{format:newFormat,formatPrefix:function formatPrefix(t,e){var n=newFormat(((t=formatSpecifier(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(yt(e)/3))),a=Math.pow(10,-i),r=Mt[8+i/3];return function(t){return n(a*t)+r}}}};!function defaultLocale_defaultLocale(t){return Tt=Lt(t),wt=Tt.format,At=Tt.formatPrefix,Tt}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Dt=n(0),Ft=n.n(Dt),Rt=n(1),zt=n.n(Rt),Xt=n(5),It=n.n(Xt),Et={value:function(){}};function dispatch_dispatch(){for(var t,e=0,n=arguments.length,i={};en._time&&(i=n._time),(t=n)._next):(e=n._next,n._next=null,t?t._next=e:Ot=e);Pt=t,sleep(i)}(),Wt=0}}function poke(){var t=jt.now(),e=t-Ut;VtJt)throw new Error("too late; already scheduled");return n}function schedule_set(t,e){var n=schedule_get(t,e);if(n.state>Qt)throw new Error("too late; already running");return n}function schedule_get(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var ee=function(t,e){var n,i,a,r=t.__transition,o=!0;if(r){for(a in e=null==e?null:e+"",r)(n=r[a]).name===e?(i=2>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=ce.exec(t))?rgbn(parseInt(e[1],16)):(e=ue.exec(t))?new Rgb(e[1],e[2],e[3],1):(e=le.exec(t))?new Rgb(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=he.exec(t))?rgba(e[1],e[2],e[3],e[4]):(e=de.exec(t))?rgba(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=fe.exec(t))?hsla(e[1],e[2]/100,e[3]/100,1):(e=ge.exec(t))?hsla(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?rgbn(pe[t]):"transparent"===t?new Rgb(NaN,NaN,NaN,0):null}function rgbn(t){return new Rgb(t>>16&255,t>>8&255,255&t,1)}function rgba(t,e,n,i){return i<=0&&(t=e=n=NaN),new Rgb(t,e,n,i)}function rgbConvert(t){return t instanceof Color||(t=color_color(t)),t?new Rgb((t=t.rgb()).r,t.g,t.b,t.opacity):new Rgb}function color_rgb(t,e,n,i){return 1===arguments.length?rgbConvert(t):new Rgb(t,e,n,null==i?1:i)}function Rgb(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function hex(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function hsla(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Hsl(t,e,n,i)}function hsl(t,e,n,i){return 1===arguments.length?function hslConvert(t){if(t instanceof Hsl)return new Hsl(t.h,t.s,t.l,t.opacity);if(t instanceof Color||(t=color_color(t)),!t)return new Hsl;if(t instanceof Hsl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,a=Math.min(e,n,i),r=Math.max(e,n,i),o=NaN,s=r-a,c=(r+a)/2;return s?(o=e===r?(n-i)/s+6*(nr&&(a=i.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(e=e[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,c.push({i:o,x:Xe(e,n)})),r=Ee.lastIndex;return rMath.abs(t[1]-S[1])?f=!0:d=!0),S=t,h=!0,wn(),move()}function move(){var t;switch(u=S[0]-C[0],l=S[1]-C[1],_){case kn:case An:m&&(u=Math.max(b-e,Math.min(w-r,u)),n=e+u,o=r+u),x&&(l=Math.max(T-i,Math.min(A-s,l)),a=i+l,c=s+l);break;case Cn:m<0?(u=Math.max(b-e,Math.min(w-e,u)),n=e+u,o=r):0/g,">"):t},Qn=function(t){var e=t.getBBox(),n=e.x,i=e.y,a=e.width,r=e.height;return[{x:n,y:i+r},{x:n,y:i},{x:n+a,y:i},{x:n+a,y:i+r}]},ti=function(t){var e=null,n=E,i=t.context||t.main;return n&&"BrushEvent"===n.constructor.name?e=n.selection:i&&(e=i.select(".".concat(dn.brush)).node())&&(e=function brushSelection(t){var e=t.__brush;return e?e.dim.output(e.selection):null}(e)),e},ei=function(){var t=!(0>>1;r(t[a],e)<0?n=a+1:i=a}return n},right:function(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;0i&&(i=(e=t).values.length)}):e=n?t[0]:null,e},mapToIds:function mapToIds(t){return t.map(function(t){return t.id})},mapToTargetIds:function mapToTargetIds(t){return t?qn(t)?t.concat():[t]:this.mapToIds(this.data.targets)},hasTarget:function hasTarget(t,e){for(var n,i=this.mapToIds(t),a=0;n=i[a];a++)if(n===e)return!0;return!1},isTargetToShow:function isTargetToShow(t){return this.hiddenTargetIds.indexOf(t)<0},isLegendToShow:function isLegendToShow(t){return this.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow:function filterTargetsToShow(t){var e=this;return t.filter(function(t){return e.isTargetToShow(t.id)})},mapTargetsToUniqueXs:function mapTargetsToUniqueXs(t){var e=[],n=this.x.domain();return t&&t.length&&(e=oi(t.map(function(t){return t.values.map(function(t){return+t.x})})).filter(function(t,e,n){return n.indexOf(t)===e}),e=this.isTimeSeries()?e.map(function(t){return new Date(+t)}):e.map(function(t){return+t})),e=e.filter(function(t){return t>=n[0]&&t<=n[1]}),si(e)},addHiddenTargetIds:function addHiddenTargetIds(t){this.hiddenTargetIds=this.hiddenTargetIds.concat(t)},removeHiddenTargetIds:function removeHiddenTargetIds(e){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(t){return e.indexOf(t)<0})},addHiddenLegendIds:function addHiddenLegendIds(t){this.hiddenLegendIds=this.hiddenLegendIds.concat(t)},removeHiddenLegendIds:function removeHiddenLegendIds(e){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(t){return e.indexOf(t)<0})},getValuesAsIdKeyed:function getValuesAsIdKeyed(t){var i=this,e={},a=i.isMultipleX(),r=a?i.mapTargetsToUniqueXs(t).map(function(t){return On(t)?t:+t}):null;return t.forEach(function(t){var n=[];t.values.forEach(function(t){var e=t.value;qn(e)?n.push.apply(n,gn()(e)):Zn(e)&&"high"in e?n.push.apply(n,gn()(Object.values(e))):a?n[i.getIndexByX(t.x,r)]=e:n.push(e)}),e[t.id]=n}),e},checkValueInTargets:function checkValueInTargets(t,e){for(var n,i=Object.keys(t),a=0;a=a?s=!0:10===(e=i.charCodeAt(r++))?c=!0:13===e&&(c=!0,10===i.charCodeAt(r)&&++r),i.slice(n+1,t-1).replace(/""/g,'"')}for(;r=h)&&(a=!0,t.preventDefault()),u(this)}else o.unselectRect(),o.callOverOutForTouch()}).on("touchend.eventRect",function(){var t=c();!t.empty()&&t.classed(dn.eventRect)&&(o.hasArcType()||!o.toggleShape||o.cancelClick)&&o.cancelClick&&(o.cancelClick=!1)})},updateEventRect:function updateEventRect(t){var e,n,i,a,r=this,o=r.config,s=r.zoomScale||r.x,c=t||r.eventRect.data(),u=o.axis_rotated;if(r.isMultipleX())n=e=0,i=r.width,a=r.height;else{var l,h;if(r.isCategorized())l=r.getEventRectWidth(),h=function(t){return s(t.x)-l/2};else{r.updateXs();var d=function(t){var e=t.index;return{prev:r.getPrevX(e),next:r.getNextX(e)}};l=function(t){var e=d(t);return null===e.prev&&null===e.next?u?r.height:r.width:(null===e.prev&&(e.prev=s.domain()[0]),null===e.next&&(e.next=s.domain()[1]),Math.max(0,(s(e.next)-s(e.prev))/2))},h=function(t){var e=d(t),n=r.data.xs[t.id][t.index];return null===e.prev&&null===e.next?0:(null===e.prev&&(e.prev=s.domain()[0]),(s(n)+s(e.prev))/2)}}e=u?0:h,n=u?h:0,i=u?r.width:l,a=u?l:r.height}c.attr("class",r.classEvent.bind(r)).attr("x",e).attr("y",n).attr("width",i).attr("height",a)},selectRectForSingle:function selectRectForSingle(n,i,a){var r=this,o=r.config,s=o.data_selection_enabled,c=o.data_selection_grouped,u=o.tooltip_grouped,t=r.getAllValuesOnIndex(a);u&&(r.showTooltip(t,n),r.showXGridFocus(t),!s||c)||r.main.selectAll(".".concat(dn.shape,"-").concat(a)).each(function(){O(this).classed(dn.EXPANDED,!0),s&&i.style("cursor",c?"pointer":null),u||(r.hideXGridFocus(),r.hideTooltip(),!c&&r.expandCirclesBars(a))}).filter(function(t){return r.isWithinShape(this,t)}).call(function(t){var e=t.data();s&&(c||o.data_selection_isselectable(e))&&i.style("cursor","pointer"),u||(r.showTooltip(e,n),r.showXGridFocus(e),r.unexpandCircles(),t.each(function(t){return r.expandCirclesBars(a,t.id)}))})},expandCirclesBars:function expandCirclesBars(t,e,n){this.config.point_focus_expand_enabled&&this.expandCircles(t,e,n),this.expandBars(t,e,n)},selectRectForMultipleXs:function selectRectForMultipleXs(t){var e=this,n=e.config,i=e.filterTargetsToShow(e.data.targets);if(!e.dragging&&!e.hasArcType(i)){var a=P(t),r=e.findClosestFromTargets(i,a);if(e.mouseover&&(!r||r.id!==e.mouseover.id)&&(n.data_onout.call(e.api,e.mouseover),e.mouseover=undefined),!r)return void e.unselectRect();var o=(e.isBubbleType(r)||e.isScatterType(r)||!n.tooltip_grouped?[r]:e.filterByX(i,r.x)).map(function(t){return e.addName(t)});e.showTooltip(o,t),e.expandCirclesBars(r.index,r.id,!0),e.showXGridFocus(o),(e.isBarType(r.id)||e.dist(r,a)ra&&a){var d=n-r,f=i-o,g=s*s+c*c,p=d*d+f*f,_=Math.sqrt(g),m=Math.sqrt(h),x=a*Math.tan((ia-Math.acos((g+h-p)/(2*_*m)))/2),y=x/m,v=x/_;Math.abs(y-1)>ra&&(this._+="L"+(t+y*u)+","+(e+y*l)),this._+="A"+a+","+a+",0,0,"+ +(u*fra||Math.abs(this._y1-u)>ra)&&(this._+="L"+c+","+u),n&&(h<0&&(h=h%aa+aa),oa_a?(d+=b*=s?1:-1,f-=b):(g=0,d=f=(a+r)/2),(p-=2*T)>_a?(l+=T*=s?1:-1,h-=T):(p=0,l=h=(a+r)/2)}var w=i*ha(l),A=i*ga(l),k=n*ha(f),C=n*ga(f);if(_a_a){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>_a){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*u+t._x1*t._l23_2a-e*t._l12_2a)/l,o=(o*u+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(i,a,r,o,t._x2,t._y2)}function CatmullRom(t,e){this._context=t,this._alpha=e}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ia=function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomClosed(t,e){this._context=t,this._alpha=e}CatmullRomClosed.prototype={areaStart:Sa,areaEnd:Sa,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ea=function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomOpen(t,e){this._context=t,this._alpha=e}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Oa=function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function LinearClosed(t){this._context=t}LinearClosed.prototype={areaStart:Sa,areaEnd:Sa,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var Pa=function(t){return new LinearClosed(t)};function monotone_sign(t){return t<0?-1:1}function slope3(t,e,n){var i=t._x1-t._x0,a=e-t._x1,r=(t._y1-t._y0)/(i||a<0&&-0),o=(n-t._y1)/(a||i<0&&-0),s=(r*a+o*i)/(i+a);return(monotone_sign(r)+monotone_sign(o))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs(s))||0}function slope2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function monotone_point(t,e,n){var i=t._x0,a=t._y0,r=t._x1,o=t._y1,s=(r-i)/3;t._context.bezierCurveTo(i+s,a+s*e,r-s,o-s*n,r,o)}function MonotoneX(t){this._context=t}function MonotoneY(t){this._context=new ReflectContext(t)}function ReflectContext(t){this._context=t}function monotoneX(t){return new MonotoneX(t)}function monotoneY(t){return new MonotoneY(t)}function Natural(t){this._context=t}function controlPoints(t){var e,n,i=t.length-1,a=new Array(i),r=new Array(i),o=new Array(i);for(r[a[0]=0]=2,o[0]=t[0]+2*t[1],e=1;ethis.width?i=this.width-n.getBoundingClientRect().width:i<0&&(i=4)),i+(r.data_labels_position.x||0)},getYForText:function getYForText(t,e,n){var i,a=this,r=a.config,o=r.point_r,s=3;if(r.axis_rotated)i=(t[0][0]+t[2][0]+.6*n.getBoundingClientRect().height)/2;else if(i=t[2][1],Pn(o)&&5this.height&&(i=this.height-4)}return i+(r.data_labels_position.y||0)}});var Ha={Area:["area","area-spline","area-spline-range","area-line-range","area-step"],AreaRange:["area-spline-range","area-line-range"],Arc:["pie","donut","gauge","radar"],Line:["line","spline","area","area-spline","area-spline-range","area-line-range","step","area-step"],Step:["step","area-step"],Spline:["spline","area-spline","area-spline-range"]};ii(Wi.prototype,{setTargetType:function setTargetType(t,e){var n=this,i=n.config;n.mapToTargetIds(t).forEach(function(t){n.withoutFadeIn[t]=e===i.data_types[t],i.data_types[t]=e}),t||(i.data_type=e)},hasType:function hasType(n,t){var i=this.config.data_types,e=t||this.data.targets,a=!1;return e&&e.length?e.forEach(function(t){var e=i[t.id];(e&&0<=e.indexOf(n)||!e&&"line"===n)&&(a=!0)}):Object.keys(i).length?Object.keys(i).forEach(function(t){i[t]===n&&(a=!0)}):a=this.config.data_type===n,a},hasTypeOf:function hasTypeOf(t,e){var n=this,i=2n&&(i=i.filter(function(t){return(t+"").indexOf(".")<0}));return i},getGridFilterToRemove:function getGridFilterToRemove(t){return t?function(e){var n=!1;return(qn(t)?t.concat():[t]).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e["class"]===t["class"])&&(n=!0)}),n}:function(){return!0}},removeGridLines:function removeGridLines(t,e){var n=this.config,i=this.getGridFilterToRemove(t),a=e?dn.xgridLines:dn.ygridLines,r=e?dn.xgridLine:dn.ygridLine;this.main.select(".".concat(a)).selectAll(".".concat(r)).filter(i).transition().duration(n.transition_duration).style("opacity","0").remove();var o="grid_".concat(e?"x":"y","_lines");n[o]=n[o].filter(function toShow(t){return!i(t)})}}),ii(Wi.prototype,{initTooltip:function initTooltip(){var e=this,n=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",dn.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),n.tooltip_init_show){if(e.isTimeSeries()&&On(n.tooltip_init_x)){var t,i,a=e.data.targets[0];for(n.tooltip_init_x=e.parseDate(n.tooltip_init_x),t=0;(i=a.values[t])&&i.x-n.tooltip_init_x!=0;t++);n.tooltip_init_x=t}e.tooltip.html(n.tooltip_contents.call(e,e.data.targets.map(function(t){return e.addName(t.values[n.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType(null,["radar"])),e.color)),e.tooltip.style("top",n.tooltip_init_position.top).style("left",n.tooltip_init_position.left).style("display","block")}},getTooltipContent:function getTooltipContent(t,e,n,i){var a,r,o,s,c=this,u=c.config,l=u.tooltip_format_title||e,h=u.tooltip_format_name||function(t){return t},d=u.tooltip_format_value||(c.isStackNormalized()?function(t,e){return"".concat((100*e).toFixed(2),"%")}:n),f=u.tooltip_order,g=function(t){return c.getBaseValue(t)},p=c.levelColor?function(t){return c.levelColor(t.value)}:function(t){return i(t.id)};if(null===f&&u.data_groups.length){var _=c.orderTargets(c.data.targets).map(function(t){return t.id}).reverse();t.sort(function(t,e){var n=t?t.value:null,i=e?e.value:null;return 0').concat(In(y)?''.concat(y,""):"")}if(o=[r.ratio,r.id,r.index,t],s=Jn(d.apply(void 0,[g(r)].concat(gn()(o)))),c.isAreaRangeType(r)){var v=["high","low"].map(function(t){return Jn(d.apply(void 0,[c.getAreaRangeData(r,t)].concat(gn()(o))))}),b=zt()(v,2),T=b[0],w=b[1];s="Mid: ".concat(s," High: ").concat(T," Low: ").concat(w)}if(s!==undefined){if(null===r.name)continue;var A=Jn(h.apply(void 0,[r.name].concat(gn()(o)))),k=p(r);a+=''),a+=c.patterns?''):''),a+="".concat(A,'').concat(s,"")}}return"".concat(a,"")},tooltipPosition:function tooltipPosition(t,e,n,i){var a=this,r=a.config,o=P(i),s=zt()(o,2),c=s[0],u=s[1],l=a.getSvgLeft(!0),h=l+a.currentWidth-a.getCurrentPaddingRight();if(u+=20,a.hasArcType()){"touch"===a.inputType||a.hasType("radar")||(u+=a.height/2,c+=(a.width-(a.isLegendRight?a.getLegendWidth():0))/2)}else{var d=a.x(t[0].x);r.axis_rotated?(u=d+20,c+=l+100,h-=l):(u-=5,c=l+a.getCurrentPaddingLeft(!0)+20+(a.zoomScale?c:d))}return ha.currentHeight&&(u-=n+30),u<0&&(u=0),c<0&&(c=0),{top:u,left:c}},showTooltip:function showTooltip(t,e){var n=this,i=n.config,a=n.hasArcType(null,["radar"]),r=t.filter(function(t){return t&&In(n.getBaseValue(t))}),o=i.tooltip_position||n.tooltipPosition;if(0!==r.length&&i.tooltip_show){var s=n.tooltip.datum(),c=JSON.stringify(t),u=s&&s.width||0,l=s&&s.height||0;if(!s||s.current!==c){var h=t.concat().sort()[0].index,d=i.tooltip_contents.call(n,t,n.axis.getXAxisTickFormat(),n.getYFormat(a),n.color);Kn(i.tooltip_onshow,n),n.tooltip.html(d).style("display","block").datum({index:h,current:c,width:u=n.tooltip.property("offsetWidth"),height:l=n.tooltip.property("offsetHeight")}),Kn(i.tooltip_onshown,n),n._handleLinkedCharts(!0,h)}var f=o.call(this,r,u,l,e);n.tooltip.style("top","".concat(f.top,"px")).style("left","".concat(f.left,"px"))}},hideTooltip:function hideTooltip(){var t=this.config;Kn(t.tooltip_onhide,this),this.tooltip.style("display","none").datum(null),Kn(t.tooltip_onhidden,this)},_handleLinkedCharts:function _handleLinkedCharts(c,u){var l=this;if(l.config.tooltip_linked){var h=l.config.tooltip_linked_name;(l.api.internal.charts||[]).forEach(function(t){if(t!==l.api){var e=t.internal.config,n=e.tooltip_linked,i=e.tooltip_linked_name,a=document.body.contains(t.element);if(n&&h===i&&a){var r=t.internal.tooltip.data()[0],o=u!==(r&&r.index);try{c&&o?t.tooltip.show({index:u}):!c&&t.tooltip.hide()}catch(s){}}}})}}}),ii(Wi.prototype,{initLegend:function initLegend(){var t=this,e=t.config;t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g"),e.legend_show?(t.legend.attr("transform",t.getTranslate("legend")),t.updateLegend()):(t.legend.style("visibility","hidden"),t.hiddenLegendIds=t.mapToIds(t.data.targets))},updateLegend:function updateLegend(t,e,n){var i=this,a=i.config,r=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};r.withTransition=$n(r,"withTransition",!0),r.withTransitionForTransform=$n(r,"withTransitionForTransform",!0),a.legend_contents_bindto&&a.legend_contents_template?i.updateLegendTemplate():i.updateLegendElement(t||i.mapToIds(i.data.targets),r,n),i.updateSizes(),i.updateScales(!r.withTransition),i.updateSvgSize(),i.transformAll(r.withTransitionForTransform,n),i.legendHasRendered=!0},updateLegendTemplate:function updateLegendTemplate(){var n=this,t=n.config,e=O(t.legend_contents_bindto),i=t.legend_contents_template;if(!e.empty()){var a=n.data.targets,r=[],o="";n.mapToIds(a).forEach(function(t){var e=En(i)?i.call(n,t,n.color(t),n.api.data(t)[0].values):i.replace(/{=COLOR}/g,n.color(t)).replace(/{=TITLE}/g,t);e&&(r.push(t),o+=e)});var s=e.html(o).selectAll(function(){return this.childNodes}).data(r);n.setLegendItem(s)}},updateSizeForLegend:function updateSizeForLegend(t){var e=this,n=e.config,i=t.width,a=t.height,r={top:e.isLegendTop?e.getCurrentPaddingTop()+n.legend_inset_y+5.5:e.currentHeight-a-e.getCurrentPaddingBottom()-n.legend_inset_y,left:e.isLegendLeft?e.getCurrentPaddingLeft()+n.legend_inset_x+.5:e.currentWidth-i-e.getCurrentPaddingRight()-n.legend_inset_x+.5};e.margin3={top:e.isLegendRight?0:e.isLegendInset?r.top:e.currentHeight-a,right:NaN,bottom:0,left:e.isLegendRight?e.currentWidth-i:e.isLegendInset?r.left:0}},transformLegend:function transformLegend(t){(t?this.legend.transition():this.legend).attr("transform",this.getTranslate("legend"))},updateLegendStep:function updateLegendStep(t){this.legendStep=t},updateLegendItemWidth:function updateLegendItemWidth(t){this.legendItemWidth=t},updateLegendItemHeight:function updateLegendItemHeight(t){this.legendItemHeight=t},getLegendWidth:function getLegendWidth(){return this.config.legend_show?this.isLegendRight||this.isLegendInset?this.legendItemWidth*(this.legendStep+1):this.currentWidth:0},getLegendHeight:function getLegendHeight(){return this.config.legend_show?this.isLegendRight?this.currentHeight:Math.max(20,this.legendItemHeight)*(this.legendStep+1):0},opacityForLegend:function opacityForLegend(t){return t.classed(dn.legendItemHidden)?null:"1"},opacityForUnfocusedLegend:function opacityForUnfocusedLegend(t){return t.classed(dn.legendItemHidden)?null:"0.3"},toggleFocusLegend:function toggleFocusLegend(t,e){var n=this,i=n.mapToTargetIds(t);n.legend.selectAll(".".concat(dn.legendItem)).filter(function(t){return 0<=i.indexOf(t)}).classed(dn.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?n.opacityForLegend:n.opacityForUnfocusedLegend).call(n,O(this))})},revertLegend:function revertLegend(){var t=this;t.legend.selectAll(".".concat(dn.legendItem)).classed(dn.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(O(this))})},showLegend:function showLegend(t){var e=this,n=e.config;n.legend_show||(n.legend_show=!0,e.legend.style("visibility","visible"),!e.legendHasRendered&&e.updateLegend()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(O(this))})},hideLegend:function hideLegend(t){var e=this.config;e.legend_show&&Gn(t)&&(e.legend_show=!1,this.legend.style("visibility","hidden")),this.addHiddenLegendIds(t),this.legend.selectAll(this.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},clearLegendItemTextBoxCache:function clearLegendItemTextBoxCache(){this.legendItemTextBox={}},setLegendItem:function setLegendItem(t){var n=this,e=n.config,i="touch"===n.inputType;t.attr("class",function(t){var e=O(this);return(!e.empty()&&e.attr("class")||"")+n.generateClass(dn.legendItem,t)}).style("visibility",function(t){return n.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on("click",function(t){Kn(e.legend_item_onclick,n,t)||(E.altKey?(n.api.hide(),n.api.show(t)):(n.api.toggle(t),!i&&n.isTargetToShow(t)?n.api.focus(t):n.api.revert())),i&&n.hideTooltip()}),i||t.on("mouseout",function(t){Kn(e.legend_item_onout,n,t)||(O(this).classed(dn.legendItemFocused,!1),n.api.revert())}).on("mouseover",function(t){Kn(e.legend_item_onover,n,t)||(O(this).classed(dn.legendItemFocused,!0),!n.transiting&&n.isTargetToShow(t)&&n.api.focus(t))})},updateLegendElement:function updateLegendElement(t,e){var n,i,a,g=this,p=g.config,_=p.legend_item_tile_width+5,m=0,x=0,y=0,v={},b={},T={},w=[0],A={},k=0,C=g.isLegendRight||g.isLegendInset,S=t.filter(function(t){return!Nn(p.data_names[t])||null!==p.data_names[t]}),r=e.withTransition,o=function(t,e,n){var i,a,r,o=n===S.length-1,s=(a=t,r=e,g.legendItemTextBox[r]||(g.legendItemTextBox[r]=g.getTextRect(a,dn.legendItem)),g.legendItemTextBox[r]),c=s.width+_+(o&&!C?0:10)+p.legend_padding,u=s.height+4,l=C?u:c,h=C?g.getLegendHeight():g.getLegendWidth(),d=function(t,e){e||(i=(h-y-l)/2)<10&&(i=(h-l)/2,y=0,k++),A[t]=k,w[k]=g.isLegendInset?10:i,v[t]=y,y+=l};if(0===n&&(x=m=k=y=0),p.legend_show&&!g.isLegendToShow(e))return b[e]=0,T[e]=0,A[e]=0,void(v[e]=0);b[e]=c,T[e]=u,(!m||m<=c)&&(m=c),(!x||x<=u)&&(x=u);var f=C?x:m;p.legend_equally?(Object.keys(b).forEach(function(t){return b[t]=m}),Object.keys(T).forEach(function(t){return T[t]=x}),(i=(h-f*S.length)/2)<10?(k=y=0,S.forEach(function(t){return d(t)})):d(e,!0)):d(e)};g.isLegendInset&&(k=p.legend_inset_step?p.legend_inset_step:S.length,g.updateLegendStep(k)),i=g.isLegendRight?(n=function(t){return m*A[t]},function(t){return w[A[t]]+v[t]}):g.isLegendInset?(n=function(t){return m*A[t]+10},function(t){return w[A[t]]+v[t]}):(n=function(t){return w[A[t]]+v[t]},function(t){return x*A[t]});var s=function(t,e){return n(t,e)+4+p.legend_item_tile_width},c=function(t,e){return n(t,e)},h=function(t,e){return n(t,e)-2},u=function(t,e){return n(t,e)-2+p.legend_item_tile_width},l=function(t,e){return i(t,e)+9},d=function(t,e){return i(t,e)-5},f=function(t,e){return i(t,e)+4},M=g.legend.selectAll(".".concat(dn.legendItem)).data(S).enter().append("g");g.setLegendItem(M),M.append("text").text(function(t){return Nn(p.data_names[t])?p.data_names[t]:t}).each(function(t,e){o(this,t,e)}).style("pointer-events","none").attr("x",C?s:-200).attr("y",C?-200:l),M.append("rect").attr("class",dn.legendItemEvent).style("fill-opacity","0").attr("x",C?c:-200).attr("y",C?-200:d);var L=g.config.legend_usePoint;if(L){var D=[];M.append(function(t){var e=jn(p.point_pattern)?p.point_pattern:[p.point_type];-1===D.indexOf(t)&&D.push(t);var n=e[D.indexOf(t)%e.length];return"rectangle"===n&&(n="rect"),document.createElementNS(I.svg,g.hasValidPointType(n)?n:"use")}).attr("class",dn.legendItemPoint).style("fill",function(t){return g.color(t)}).style("pointer-events","none").attr("href",function(t,e,n){return"use"===n[e].nodeName.toLowerCase()?"#".concat(g.datetimeId,"-point-").concat(t):undefined})}else M.append("line").attr("class",dn.legendItemTile).style("stroke",g.color).style("pointer-events","none").attr("x1",C?h:-200).attr("y1",C?-200:f).attr("x2",C?u:-200).attr("y2",C?-200:f).attr("stroke-width",p.legend_item_tile_height);a=g.legend.select(".".concat(dn.legendBackground," rect")),g.isLegendInset&&0'":;\[\]\/|~`{}\\]/g,"-"):""},selectorTarget:function selectorTarget(t,e){return"".concat(e||"",".").concat(dn.target+this.getTargetSelectorSuffix(t))},selectorTargets:function selectorTargets(t,e){var n=this,i=t||[];return i.length?i.map(function(t){return n.selectorTarget(t,e)}):null},selectorLegend:function selectorLegend(t){return".".concat(dn.legendItem+this.getTargetSelectorSuffix(t))},selectorLegends:function selectorLegends(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null}}),ii(Gi.prototype,{focus:function focus(t){var e=this.internal,n=e.mapToTargetIds(t),i=e.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),i.classed(dn.focused,!0).classed(dn.defocused,!1),e.hasArcType()&&e.expandArc(n),e.toggleFocusLegend(n,!0),e.focusedTargetIds=n,e.defocusedTargetIds=e.defocusedTargetIds.filter(function(t){return n.indexOf(t)<0})},defocus:function defocus(t){var e=this.internal,n=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e))).classed(dn.focused,!1).classed(dn.defocused,!0),e.hasArcType()&&e.unexpandArc(n),e.toggleFocusLegend(n,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(t){return n.indexOf(t)<0}),e.defocusedTargetIds=n},revert:function revert(t){var e=this.internal,n=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(n)).classed(dn.focused,!1).classed(dn.defocused,!1),e.hasArcType()&&e.unexpandArc(n),e.config.legend_show&&(e.showLegend(n.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(n)).filter(function(){return O(this).classed(dn.legendItemFocused)}).classed(dn.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]}}),ii(Gi.prototype,{_showHide:function _showHide(t,e,n){var i=this.internal,a=i.mapToTargetIds(e);i["".concat(t?"remove":"add","HiddenTargetIds")](a);var r=i.svg.selectAll(i.selectorTargets(a)),o=t?"1":"0";r.transition().style("opacity",o,"important").call(i.endall,function(){r.style("opacity",null).style("opacity",o)}),n.withLegend&&i["".concat(t?"show":"hide","Legend")](a),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},show:function show(t){var e=1=0)&&e(i,!n)}}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var i,s,n=t(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}};var s=0,n=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r,l={},h=e.split(".")[0];return e=e.split(".")[1],n=h+"-"+e,s||(s=i,i=t.Widget),t.expr[":"][n.toLowerCase()]=function(e){return!!t.data(e,n)},t[h]=t[h]||{},o=t[h][e],a=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new a(t,e)},t.extend(a,o,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(s,function(e,s){return t.isFunction(s)?(l[e]=function(){var t=function(){return i.prototype[e].apply(this,arguments)},n=function(t){return i.prototype[e].apply(this,t)};return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(l[e]=s,void 0)}),a.prototype=t.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix||e:e},l,{constructor:a,namespace:h,widgetName:e,widgetFullName:n}),o?(t.each(o._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),t.widget.bridge(e,a),a},t.widget.extend=function(e){for(var i,s,o=n.call(arguments,1),a=0,r=o.length;r>a;a++)for(i in o[a])s=o[a][i],o[a].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=n.call(arguments,1),l=this;return a?this.each(function(){var i,n=t.data(this,s);return"instance"===o?(l=n,!1):n?t.isFunction(n[o])&&"_"!==o.charAt(0)?(i=n[o].apply(n,r),i!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,s);e?(e.option(o||{}),e._init&&e._init()):t.data(this,s,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!e),e&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.delegate(c,h,r):i.bind(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(i).undelegate(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget;var o=!1;t(document).mouseup(function(){o=!1}),t.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!o){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),o=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),o=!1,!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.widget("ui.draggable",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this._blurActiveElement(e),this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("
").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=this.document[0];if(this.handleElement.is(e.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&t(i.activeElement).blur()}catch(s){}},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._normalizeRightBottom(),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.focus(),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(l=this.originalPageX),"x"===a.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY=0;d--)l=s.snapElements[d].left-s.margins.left,h=l+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,l-g>_||m>h+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(l-_),r=g>=Math.abs(h-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(l-m),r=g>=Math.abs(h-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseInt(t,10)||0 +},_isNumber:function(t){return!isNaN(parseInt(t,10))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i,s,n,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),o="ui-resizable-"+s,n=t("
"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(t(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),a.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,l=this._change[o];return this._updatePrevProperties(),l?(i=l.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,l,h=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,l=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,h.animate||this.element.css(t.extend(a,{top:l,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!h.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&c&&(t.top=l-e.minHeight),n&&c&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseInt(s[e],10)||0,i[e]+=parseInt(n[e],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,l={width:i.size.width-r,height:i.size.height-a},h=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,c&&h?{top:c,left:h}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,l=t(this).resizable("instance"),h=l.options,c=l.element,u=h.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(l.containerElement=t(d),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=l._num(e.css("padding"+s))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=l.containerOffset,n=l.containerSize.height,o=l.containerSize.width,a=l._hasScroll(d,"left")?d.scrollWidth:o,r=l._hasScroll(d)?d.scrollHeight:n,l.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,l=a.containerOffset,h=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=l),h.left<(a._helper?l.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-l.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?l.left:0),h.top<(a._helper?l.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-l.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?l.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-l.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-l.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),l=a.outerWidth()-e.sizeDiff.width,h=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,l="number"==typeof s.grid?[s.grid,s.grid]:s.grid,h=l[0]||1,c=l[1]||1,u=Math.round((n.width-o.width)/h)*h,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=l,_&&(p+=h),v&&(f+=c),g&&(p-=h),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-h)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-h>0?(i.size.width=p,i.position.left=a.left-u):(p=h-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.sortable",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),t.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>r&&l>s+h,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),s=e&&i,n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return s?this.floating?o&&"right"===o||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,h=r.length;h>s;s++)l=t(r[s]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t(" ",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue; +d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"clientX":"clientY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[a],h=!1,e[u]-l>this.items[s][r]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.slider",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("
").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,l,h,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),l=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),o!==!1&&this.values(e,i))):i!==this.value()&&(o=this._trigger("slide",t,{handle:this.handles[e],value:i}),o!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!i),this._super(e,i),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.floor(+(t-e).toFixed(this._precision())/i)*i;t=s+e,this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](c,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(e.target).addClass("ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}});var a="ui-effects-",r=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,o){var a,r=o.re.exec(i),l=r&&o.parse(r),h=o.space||"rgba";return l?(a=s[h](l),s[c[h].cache]=a[c[h].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("

")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,a,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,l],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),o=c[n],a=0===this.alpha()?h("transparent"):this,r=a[o.cache]||o.to(a._rgba),l=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],h=s[o],c=u[n.type]||{};null!==h&&(null===a?l[o]=h:(c.mod&&(h-a>c.mod/2?a+=c.mod:a-h>c.mod/2&&(a-=c.mod)),l[o]=i((h-a)*e+a,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),l=Math.min(s,n,o),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-o)/h+360:n===r?60*(o-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[a]&&(this[a]=l(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[a]=d,n):h(d)},f(o,function(e,i){h.fn[e]||(h.fn[e]=function(n){var o,a=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=h(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(r),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(r.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var l=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.11.4",save:function(t,e){for(var i=0;e.length>i;i++)null!==e[i]&&t.data(a+e[i],t[0].style[e[i]])},restore:function(t,e){var i,s;for(s=0;e.length>s;s++)null!==e[s]&&(i=t.data(a+e[s]),void 0===i&&(i=""),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):a.call(n[0],s,i)}var s=e.apply(this,arguments),n=s.mode,o=s.queue,a=t.effects.effect[s.effect]; +return t.fx.off||!a?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):o===!1?this.each(i):this.queue(o||"fx",i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}(),t.effects,t.effects.effect.slide=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","width","height"],a=t.effects.setMode(n,e.mode||"show"),r="show"===a,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,o),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}); \ No newline at end of file diff --git a/data/tsf.telegram.org/manuals/answering_questions.html b/data/tsf.telegram.org/manuals/answering_questions.html new file mode 100644 index 0000000000..faae32817f --- /dev/null +++ b/data/tsf.telegram.org/manuals/answering_questions.html @@ -0,0 +1,265 @@ + + + + + Telegram Support Force + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +

Answering Questions

+ +

We answer questions. This document holds general ideas on how to handle them.
This was intended for volunteers of the Telegram Support Force, but anyone else is free to take a look as well.

+

General

+
    +
  1. Our goal is to bring human support to human beings. To achieve this goal, we rely on volunteers. Your pay is perfection in what you do, so be cool.

    +
  2. +
  3. Corporate support standards do not apply here. Treat people in a kind, personal, informal manner. No need to pretend to be something you are not (unless you're a dog in disguise — keep human appearances in this case).

    +
  4. +
  5. Never lie to people.

    +
  6. +
  7. Check everything before you reply. Things change or may no longer work the way you remember. This includes interface details, links (!) and, well, everything.

    +
  8. +
  9. Support is a form of Art, so be fun and creative.

    +
  10. +
+

The result

+

As support volunteers, we need to provide a solution for the user. Remember, that this doesn't always have to be the solution the user was asking for. So first, we want to understand the problem that drove them to ask the question. And then find a way of solving — completely or partially — that problem.

+

For example, some users ask us for an option to send sketches or drawings to their friends. While this is not possible directly, one could take a photo with their thumb on the camera (to get a black picture), then use the drawing tools built into the photo editor to make their doodle.

+

This isn‘t what the user was looking for, but it solves the problem — and it is even more flexible and customizable than the original idea (since you could also add stickers and emoji out of the box). Some solutions are less elegant. For example, right now you can’t email your Telegram conversations. While there is much less need to do so, since you can access everything in the cloud from any of your devices, this may be a problem in some cases. What one could do then, is open the conversation in Telegram Web (or any other desktop client), select multiple messages with the mouse, then copy and paste them into a text document. Any solution is better than no solution at all.

+

There will be cases, when it is not possible to solve the problem at all. As a user in this situation, I want that people on the other end of the line understand me and care about the whole thing. Therefore, two things become important:

+
    +
  • Make it clear that you understand the issue. ‘No, you can’t do that‘ is not a good answer. ’No, I‘m afraid it is not possible to make Telegram wash your dishes in a fast and securely encrypted way’ — is better.
  • +
  • Be gentle. Gentle doesn‘t mean soft — if we really can’t do something, it means just that — we can‘t. But adding ’Sorry about that' helps a lot.
  • +
+

Lastly, whatever the outcome, I always look for help from a human being, not a dumb interface. When you're casual and witty, the user feels more at ease. On the other hand, human beings, as opposed to dumb interfaces, usually understand what is appropriate in which situation. For example, when a user is in distress, he most likely needs help first — and jokes can wait until the crisis has been dealt with.

+
+

To sum up, we need to be: smart (to identify the problem and find an approach to the user), inventive (to find a solution, not always the obvious one), compassionate (in case there is no immediate solution) — and witty (otherwise it gets boring). I'm sure we are.

+

What if I don't know the answer

+

Happens to all. Don't worry, you can always find one. The TSF BIOS will tell you what to do in most situations. In case it doesn‘t or you’re not sure, ask your fellow volunteers in the group — they should know. If worst comes to worst, consult Markus.

+

Admitting you don't know something is infinitely better than trying to cover it up. So when cornered use this mantra: ‘I’m afraid I don‘t know this. Will ask my teammates and get back to you’. Just make sure that the question is not in the FAQs before you say this.

+

Handling user suggestions

+

The three rules for requests and suggestions are: don‘t lie, don’t promise anything, and don't give an exact timeframe.

+
    +
  • The internal Suggestions board on Trello has a list of most frequently suggested features together with estimations on how likely, when and why they will be introduced.
  • +
  • For insights into the decision making process, check our Feature Philosophy.
  • +
+

Plans change frequently, so it‘s best if we only talk about things that exist. Never say that something will be done. ’We may do this‘, ’we will definitely add this at some point in the future‘ or ’this is coming soon' — is as far as we can go.

+

Same applies to the negative: never say we will never do something (except steal users‘ spouses and enslave their children, as mentioned in the general FAQ). The worst thing that can happen is ’we are currently not working on this‘, ’we may consider this', etc.

+

Even if you know something is happening tomorrow, say ‘in the next few days’. People love it when they get things earlier than they expected — and get downright angry if we get 5 minutes (or a few months) late.

+

Reporting bugs in Telegram

+

Every now and then you will get actual bug-reports. We have an internal board on trello, so you will be able to search all known issues and get the relevant info.

+
    +
  • The Handling Bugs manual covers all you need to know about bug reporting in Telegram.
  • +
  • The internal Issues board on Trello lists all known issues.
  • +
+

If you are not part of the team and are looking for advanced troubleshooting tips, you may find the Troubleshooting section interesting.

+

Chatting

+

Truth is, most users come to simply say ‘hello’. Hello them back if you have the time. Sometimes these users do have a question after all. In other cases they may be new to Telegram, without many friends to chat with or show them around. So you can tell them more about Telegram, point to interesting features — or even other Telegram apps. No need to advertise, just explain what needs explaining.

+

Remember: we’re here to help those we can help and talk to others that we feel we have the time to talk to, but not more. If kids get too insistent without any real needs, it’s ok to ignore them after a few replies. If somebody seems to be a nice conversation partner, it’s always a good idea to discuss Telegram, see what the user thinks is missing. Maybe tell them about our Support Initiative.

+

Real-life problems

+

Unfortunately, we cannot really help people with real-life problems. A few kind words wouldn‘t hurt, but generally we should send those users to places where they can get actual help, like a crisis line or chat. (Now, if you want to be a member of the TSF and read this far, go send a picture of a kangaroo to the auditions account. No, this is not a joke. It is a test that helps us understand whether or not you actually read this. And don’t tell others. If you're already a member, you know what to do: humpa viceroy squid)

+

Insults

+

Yep, everyone gets their share of those. First of all, remember that these people are not really talking to you. They just see an abstract ‘Telegram’ entity. My advice is to humor them — I usually send a ‘well, that escalated quickly’ picture and it helps many users. Joke around with them and you’ll be surprised how that can humble people. And never insult back, even if they manage to get you angry for some reason. Nonviolent irony is always your best — and only — weapon.

+
+
Other TSF documents:
+

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + +