-
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathmain.js
1 lines (1 loc) · 111 KB
/
main.js
1
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("scenegraph"),require("application"),require("uxp"),require("commands"),require("viewport"));else if("function"==typeof define&&define.amd)define(["scenegraph","application","uxp","commands","viewport"],t);else{var n="object"==typeof exports?t(require("scenegraph"),require("application"),require("uxp"),require("commands"),require("viewport")):t(e.scenegraph,e.application,e.uxp,e.commands,e.viewport);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(e,t,n,r,o){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){let n={init:function(e,t,r){n._data=e,n._language=t.toUpperCase(),n._fallback=r},get:function(e){let t;return n._data[e]&&(t=(t=n._data[e][n._language])||n._data[e][n._fallback]),t||(t=` [${e.toUpperCase()}] `),t}};e.exports={Localisation:n}},function(e,t,n){const{Logger:r}=n(8),o=(r.get("XdCommons::file"),{downloadImageAsBase64:async e=>{try{return function(e){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(e),o=r.byteLength,i=o%3,a=o-i;let s,l,c,u,d;for(let e=0;e<a;e+=3)t+=n[s=(16515072&(d=r[e]<<16|r[e+1]<<8|r[e+2]))>>18]+n[l=(258048&d)>>12]+n[c=(4032&d)>>6]+n[u=63&d];return 1===i?t+=`${n[s=(252&(d=r[a]))>>2]}${n[l=(3&d)<<4]}==`:2===i&&(t+=`${n[s=(64512&(d=r[a]<<8|r[a+1]))>>10]}${n[l=(1008&d)>>4]}${n[c=(15&d)<<2]}=`),t}(await function(e){return new Promise((t,n)=>{const r=new XMLHttpRequest;r.onload=(()=>{if(200===r.status)try{const e=new Uint8Array(r.response);t(e)}catch(e){n(`xhrBinary() Couldnt parse response as Uint8Array. ${e.message}, ${r.response}`)}else n(`xhrBinary() Request had an error. status: ${r.status}`)}),r.onerror=(()=>{n(`xhrBinary() Request error (HTTP Status: ${r.status})`)}),r.onabort=n,r.open("GET",e,!0),r.responseType="arraybuffer",r.send()})}(e))}catch(t){const n=`Failed loading image from url: ${e} (${t.message})`;throw new Error(n)}}});e.exports={file:o,Logger:r}},function(t,n){t.exports=e},function(e,t){e.exports={endpoints:[{url:"http://142.93.249.174:8080/copycat/v1"}],feed:{url:"https://tourdexd.com/api_plugin_mimic_feed"},fallbackLanguage:"EN",localisation:{VERSION:{EN:"1.2.0"},DESCRIPTION:{EN:"Extract colors, font names and images from the web. Useful plugin to kickstart designs based off of something out in the wild.",DE:"Extrahiert Farben, Schriftfamilien und Bilder aus dem Web. Nützliches Plugin um auf Bestehendem aufzubauen.",FR:"Extrayez des couleurs, noms de polices et images du web. Un plug-in utile pour créer rapidement des designs à partir des éléments qui vous entourent.",JA:"Web からカラー、フォント名、画像を抽出します。Web から取得した素材を元にデザインを開始する際に役立つプラグインです。",KO:"웹에서 색상, 글꼴 이름 및 이미지를 추출합니다. 다듬어지지 않은 재료로 디자인을 시작하는 데 유용한 플러그인입니다.",ZH:"从网络中提取颜色、字体名称和图像。有用的插件,可以基于野外的东西来启动设计。"},DIALOG_ENTER_URL:{EN:'Enter a URL below and hit "Extract" to extract colors, font names and images from the web.',DE:'Geben Sie unten eine URL ein und drücken Sie auf "Los geht\'s", um Farben, Schriftfamilien und Bilder aus dem Web zu extrahieren.',FR:'Saisissez l’URL ci-dessous et sélectionnez "Extraire" pour extraire les couleurs, noms de polices et images du web.',JA:"Web からカラー、フォント名、画像を抽出するには、下に URL を入力して、「抽出」を押します。",KO:'아래에 URL을 입력하고 "추출" 버튼을 눌러 웹에서 색상, 글꼴 이름 및 이미지를 추출하십시오.',ZH:'在下面输入一个网址,然后点击"提取"以从网络中提取颜色、字体名称和图像。'},DIALOG_HELP_FEEDBACK:{EN:"Got Feedback?",DE:"Fragen/Feedback?",FR:"Des commentaires ?",JA:"ご意見をお寄せください",KO:"피드백을 받으셨습니까?",ZH:"获得反馈?"},DIALOG_CANCEL:{EN:"Cancel",DE:"Abbrechen",FR:"Annuler",JA:"取消",KO:"취소(&C)",ZH:"取消"},DIALOG_START:{EN:"Extract",DE:"Los geht's",FR:"Extraire",JA:"抽出",KO:"추출",ZH:"提取"},DIALOG_OK:{EN:"OK",DE:"OK",FR:"OK",JA:"OK",KO:"OK",ZH:"OK"},DIALOG_SUCCESS_MESSAGE:{EN:"Your artboards with extracted colors, font names and mockup images are ready!",DE:"Arbeitsflächen mit gefundenen Farben, Schriftfamilien und Bildern wurden erfolgreich erstellt!",FR:"Your artboards with extracted colors, font names and mockup images are ready!",JA:"Your artboards with extracted colors, font names and mockup images are ready!",KO:"Your artboards with extracted colors, font names and mockup images are ready!",ZH:"Your artboards with extracted colors, font names and mockup images are ready!"},DIALOG_PROGRESS_MESSAGE:{EN:"Extracting colors, character styles and images. Please wait...",DE:"Farben, Schriftfamilien und Bilder werden extrahiert. Bitte warten...",FR:"Extraction des couleurs, styles de caractères et images en cours. Veuillez patienter…",JA:"カラー、文字スタイル、画像を抽出しています。お待ちください...",KO:"색상, 문자 스타일 및 이미지를 추출하는 중입니다. 잠시만 기다려 주십시오…",ZH:"正在提取颜色、字符样式和图像。请稍候…"},DIALOG_ERROR_SORRY:{EN:"Our apologies, but Mimic encountered an error:",DE:"Wir sind untröstlich, aber Mimic ist auf einen Fehler gestoßen:",FR:"Veuillez nous excuser, Mimic a rencontré une erreur :",JA:"Mimic が問題を検出しました。",KO:"죄송합니다. Mimic에 다음과 같은 오류가 발생했습니다.",ZH:"很抱歉,Mimic 遇到了错误:"},COLORS:{EN:"Colors",DE:"Farben",FR:"Couleurs",JA:"カラー",KO:"색상",ZH:"颜色"},FONTS:{EN:"Font Names",DE:"Schriftfamilien",FR:"Noms de polices",JA:"フォント名",KO:"글꼴 이름",ZH:"字体名称"},IMAGES:{EN:"Images",DE:"Bilder",FR:"Images",JA:"画像",KO:"이미지",ZH:"图像"},COPYRIGHT_NOTE:{EN:"Images may be subject to copyright. Check the given source URL for more details.",DE:"Bilder können urheberrechtlich geschützt sein. Aufschluss darüber gibt die Quell-URL.",FR:"Les images peuvent faire l’objet de droits d’auteur. Vérifiez l’URL source indiquée pour plus de détails.",JA:"画像には著作権保護の対象である場合があります。詳細については、指定されたソース URL を確認してください。",KO:"이미지가 저작권의 적용을 받을 수 있습니다. 자세한 내용은 입력하신 소스 URL에서 확인하십시오.",ZH:"图像可能受版权保护。检查给定的源 URL 以获取更多详细信息。"},BYLINE:{EN:"Developed by Simon Widjaja, Daniel Connerth and Andre Jay Meissner",DE:"Entwickelt von Simon Widjaja, Daniel Connerth und Andre Jay Meissner",FR:"Développé par Simon Widjaja, Daniel Connerth et Andre Jay Meissner",JA:"開発者: Simon Widjaja、Daniel Connerth、Andre Jay Meissner",KO:"개발자: Simon Widjaja, Daniel Connerth 및 Andre Jay Meissner",ZH:"由 Simon Widjaja、Daniel Connerth 和 Andre Jay Meissner 开发"},COPYRIGHT:{EN:"© 2019 Trendspurt GmbH. All rights reserved.",DE:"© 2019 Trendspurt GmbH. Alle Rechte vorbehalten.",FR:"© 2019 Trendspurt GmbH. Tous droits réservés.",JA:"© 2019 Trendspurt GmbH. All rights reserved.",KO:"© 2019 Trendspurt GmbH. 무단 전재 및 재배포 금지.",ZH:"© 2019 Trendspurt GmbH. All rights reserved."}}}},function(e,t,n){var r={"./assets/banner_default.gif":31,"./assets/icon.png":32,"./assets/icon_144.png":33,"./assets/icon_192.png":34,"./assets/icon_24.png":35,"./assets/icon_48.png":36,"./assets/icon_96.png":37,"./assets/spinner.gif":38,"./assets/success_explainer.gif":39,"./config":3,"./config.js":3,"./dialogs/MainDialog":9,"./dialogs/MainDialog.js":9,"./dialogs/MainDialog/Step1":10,"./dialogs/MainDialog/Step1.js":10,"./dialogs/MainDialog/Step2":11,"./dialogs/MainDialog/Step2.js":11,"./dialogs/MainDialog/Step3":12,"./dialogs/MainDialog/Step3.js":12,"./dialogs/MainDialog/Step4":13,"./dialogs/MainDialog/Step4.js":13,"./dialogs/MainDialog/StepError":14,"./dialogs/MainDialog/StepError.js":14,"./libs/LocalisationPRE":0,"./libs/LocalisationPRE.js":0,"./libs/XDCommons/XDCommons":28,"./libs/XDCommons/XDCommons.js":28,"./libs/XDCommons/core/XDCommons":5,"./libs/XDCommons/core/XDCommons.js":5,"./libs/XDCommons/dialogs/DialogBase":15,"./libs/XDCommons/dialogs/DialogBase.js":15,"./libs/XDCommons/expressions/Expressions":17,"./libs/XDCommons/expressions/Expressions.js":17,"./libs/XDCommons/xdtpl/XDTpl":16,"./libs/XDCommons/xdtpl/XDTpl.js":16,"./libs/XdCommonsPRE":1,"./libs/XdCommonsPRE.js":1,"./libs/jquery":18,"./libs/jquery.js":18,"./libs/logger/Logger":8,"./libs/logger/Logger.js":8,"./main":7,"./main.js":7,"./manifest":29,"./manifest.json":29,"./services/extract.service":19,"./services/extract.service.js":19,"./services/feed.service":20,"./services/feed.service.js":20,"./services/init.service":21,"./services/init.service.js":21,"./services/present.service":22,"./services/present.service.js":22,"./services/present/imagesRenderer":23,"./services/present/imagesRenderer.js":23,"./templates/colors":25,"./templates/colors.js":25,"./templates/fonts":24,"./templates/fonts.js":24,"./templates/images":26,"./templates/images.js":26};function o(e){var t=i(e);return n(t)}function i(e){var t=r[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=4},function(e,t){class n{static init(e){n.scenegraph=e.scenegraph,n.root=e.root,n.fs=e.fs}static countArtboardsInSelection(e){let t=0;return e.items.forEach(e=>{"Artboard"==e.constructor.name&&t++}),t}static getBounds(e,t){t="global"!=t&&"local"!=t?"parent":t;let n={left:null,top:null,right:null,bottom:null,width:null,height:null};return e.forEach(e=>{const r="global"==t?e.globalBounds:"parent"==t?e.boundsInParent:e.localBounds;(null==n.left||r.x<n.left)&&(n.left=r.x),(null==n.top||r.y<n.top)&&(n.top=r.y),(null==n.right||r.x+r.width>n.right)&&(n.right=r.x+r.width),(null==n.bottom||r.y+r.height>n.bottom)&&(n.bottom=r.y+r.height)}),n.width=n.right-n.left,n.height=n.bottom-n.top,n}static getAllArtboards(){if(!n.root)return void console.error("Set root first: XDCommons.init(...)");let e=[];return n.root.children.forEach(t=>{"Artboard"==t.constructor.name&&e.push(t)}),e}static getFirstArtboard(){if(n.root)return n.getAllArtboards().shift();console.error("Set root first: XDCommons.init(...)")}static getLastArtboard(){if(n.root)return n.getAllArtboards().pop();console.error("Set root first: XDCommons.init(...)")}static addArtboard(e){n.root?n.root.addChildAfter(e,n.getLastArtboard()):console.error("Set root first: XDCommons.init(...)")}static getAllArtboardsBounds(){let e={left:null,top:null,right:null,bottom:null,width:null,height:null};return n.getAllArtboards().forEach(t=>{const n=t.globalBounds;(null==e.left||n.x<e.left)&&(e.left=n.x),(null==e.top||n.y<e.top)&&(e.top=n.y),(null==e.right||n.x+n.width>e.right)&&(e.right=n.x+n.width),(null==e.bottom||n.y+n.height>e.bottom)&&(e.bottom=n.y+n.height)}),e.width=e.right-e.left,e.height=e.bottom-e.top,e}static adjustArtboardSize(e,t,r,o){t=void 0==t||t,r=void 0==r||r;const i=n.getBounds(e.children);t&&(e.height=i.bottom+(o.marginBottom||0)),r&&(e.width=i.right+(o.marginRight||0))}}n.VERSION="2.0.2",e.exports={XDCommons:n}},function(e,n){e.exports=t},function(e,t,n){(function(t){t.setTimeout=(e=>{e()}),t.clearTimeout=(e=>{});const r=n(6),o=n(2),{file:i,Logger:a}=n(1),s=n(3);t.XDCPATH="libs/XDCommons/XDCommons.js";const{XDCommons:l}=n(4)(`./${t.XDCPATH}`),{Localisation:c}=n(0),u=n(19),d=n(22),f=n(20),p=n(21),h=n(9);t.$=n(18),a.setLevel(a.DEBUG);const g=a.get("main.js");e.exports={commands:{runCommand:async function(e,t){return p(),l.init({scenegraph:o,root:t}),c.init(s.localisation,s.forceLanguage||r.appLanguage,s.fallbackLanguage),new Promise(async(n,r)=>{try{await new h({extractService:u,presentService:d,feedService:f,selection:e,root:t}).open().catch(()=>{console.log("MainDialog catch"),n()}),n()}catch(e){g.error(e.toString()),resolveAndClose()}})}}}}).call(this,n(30))},function(e,t){!function(e){"use strict";var t={},n=function(e,t){this.context=e,this.active=t},r=n.prototype;r.get=function(e){return new n(this.context+" : "+e)},r._log=function(e,t){e.prio>=a.level.prio&&(this.active||a.filters&&a.filters.indexOf(this.context)>-1)&&a._log(e,this.context,t)},r.attention=function(){this._log(a.ATTENTION,arguments)},r.debug=function(){this._log(a.DEBUG,arguments)},r.info=function(){this._log(a.INFO,arguments)},r.warn=function(){this._log(a.WARN,arguments)},r.error=function(){this._log(a.ERROR,arguments)};var o=new n("no context"),i=function(){this.console=console,this.attention=console.debug,this.debug=console.debug,this.info=console.info,this.warn=console.warn,this.error=console.error};i.prototype.log=function(e,t,n){for(var r=[e.label+" [ "+t+" ]"],o=0;o<n.length;o++)r.push(n[o]);this[e.func].apply(this.console,r)};var a=e.Logger={ATTENTION:{prio:1,func:"attention",label:"ATTENTION",color:"green"},DEBUG:{prio:1,func:"debug",label:"DEBUG",color:"lightgray"},INFO:{prio:2,func:"info",label:"INFO ",color:"lightgray"},WARN:{prio:4,func:"warn",label:"WARN ",color:"red"},ERROR:{prio:5,func:"error",label:"ERROR",color:"red"},OFF:{prio:99,func:null,label:"OFF",color:""},logTargets:[new i],get:function(e,r){return r=!1!==r,t[e]||(t[e]=new n(e,r))},_log:function(e,t,n){for(var r=0;r<a.logTargets.length;r++){a.logTargets[r].log(e,t,n)}},attention:function(){o._log(a.ATTENTION,arguments)},debug:function(){o._log(a.DEBUG,arguments)},info:function(){o._log(a.INFO,arguments)},warn:function(){o._log(a.WARN,arguments)},error:function(){o._log(a.ERROR,arguments)},hijack:function(t){return a.muteDefaultLogging=t,t&&(e.console.log("Custom Logger hijacked default console logger"),e.console.__log=e.console.log,e.console.log=function(){!t&&e.console.__log.apply(e.console,arguments)},e.console.__debug=e.console.debug,e.console.debug=function(){!t&&e.console.__debug.apply(e.console,arguments)},e.console.__info=e.console.info,e.console.info=function(){!t&&e.console.__info.apply(e.console,arguments)},e.console.__warn=e.console.warn,e.console.__error=e.console.error),a},setColor:function(e){return a.color=e,a},setLevel:function(e){return a.level=e,a},filter:function(e){Array.isArray(e)?a.filters=e:console.error("Looger.filter() expects one argument of type Array")}};a.setLevel(a.DEBUG)}(window),e.exports={Logger:window.Logger}},function(e,t,n){const{DialogBase:r}=n(4)(`./${global.XDCPATH}`),o=n(10),i=n(11),a=n(12),s=n(13),l=n(14);e.exports=class extends r{constructor(e){super(),this.currentStep=1,this.options=e,this.data={url:null},this.steps=[new o(this.data,this.options),new i(this.data,this.options),new a(this.data,this.options),new s(this.data,this.options),new l(this.data,this.options)]}css(){return"\n <style>\n body {\n min-height: 100%;\n }\n .dialog-base {\n width: 500px;\n height: 350px;\n }\n </style>\n "}markup(){return super.markup()}wire(){super.wire(),this.dialog$.on("value",(e,t)=>{this.data[t.key]=t.value})}async open(){return super.open()}}},function(e,t,n){const{Localisation:r}=n(0),{Logger:o}=n(1);o.get("Step1.js");e.exports=class{constructor(e,t){this.data=e,this.options=t,this.instance$=$(this.markup()),this.instance$.append(this.css()),this.wire()}css(){return"\n <style>\n .hidden {\n opacity: 0;\n }\n </style>\n "}markup(){return`\n <form>\n <h1>Mimic</h1>\n <p></p>\n <p id="label--no-internet"></p>\n <p></p><p></p>\n <p></p><p></p>\n <footer>\n <button class="hidden" id="submit" uxp-variant="cta">${r.get("DIALOG_OK")}</button>\n </footer>\n </form>\n `}wire(){this.instance$.find("button#submit").on("click",e=>{this.instance$.trigger($.Event("submit"))})}async update(e){const t=await this.options.feedService().catch(e=>{"CC401"==e.code||"CC402"==e.code?this.instance$.trigger($.Event("next")):(this.instance$.find("#label--no-internet").text(e.message),this.instance$.find("#submit").css("opacity",1))});t&&(this.data.feed=t,this.instance$.trigger($.Event("next")))}instance(){return this.instance$}}},function(e,t,n){const{Localisation:r}=n(0),{Logger:o}=n(1);o.get("Step2.js");e.exports=class{constructor(e,t){this.data=e,this.options=t,this.instance$=$(this.markup()),this.instance$.append(this.css()),this.wire()}css(){return"\n <style>\n form {\n border: 1px solid rgba(0,0,0,0); /*WORKAROUND: OTHERWISE BUTTONS ARE NOT CLICKABLE. WTF?*/\n width: 100%;\n max-height: 400px;\n overflow: auto;\n }\n\n #main-form {\n overflow: hidden;\n }\n\n /*\n #title {\n font-weight: bold;\n font-size: 14px;\n }\n */\n\n #footer {\n position: absolute;\n /*left: 0; right: 0; bottom: 80px;*/\n left: 0; right: 0; top: 200px;\n height: 60px;\n padding-left: 40px;\n padding-right: 40px;\n }\n\n #banner {\n position: absolute;\n width: 100%;\n left: 0; right: 0; bottom: 10px;\n height: 100px;\n padding-left: 40px;\n padding-right: 40px;\n }\n #banner img {\n width: 414px;\n height: 60px;\n opacity: 0.7;\n }\n #banner img:hover {\n opacity: 1;\n }\n\n #about {\n position: absolute;\n width: 100%;\n left: 0; right: 0; bottom: 0;\n height: 40px;\n padding-left: 40px;\n padding-right: 40px;\n color: #BBB;\n font-size: 10px;\n }\n #about div {\n width: 100%;\n margin: 0 !important;\n padding: 0 !important;\n text-align: right;\n }\n\n #url {\n width: 92%;\n margin-top: 10px;\n margin-left: 0;\n margin-right: 0;\n }\n\n #spinner {\n margin: auto;\n }\n </style>\n "}markup(){return`\n <form id="main-form" method="dialog">\n \x3c!--<div class="title">Mimic</div>--\x3e\n <h1 style="padding: 0; margin-left: 0;">Mimic</h1>\n <p></p>\n <label>\n <span>${r.get("DIALOG_ENTER_URL")}</span>\n \x3c!--<input type="text" id="url" placeholder="www.IxDA.org" value="www.bruceleetea.com" />--\x3e\n <input type="text" id="url" placeholder="www.IxDA.org" />\n </label>\n <footer id="buttons">\n \x3c!--<button id="help-feedback">${r.get("DIALOG_HELP_FEEDBACK")}</button>--\x3e\n <button id="cancel">${r.get("DIALOG_CANCEL")}</button>\n <button id="ok" uxp-variant="cta" disabled>${r.get("DIALOG_START")}</button>\n </footer>\n <footer id="banner"><div><img id="cta1--img" src="" width="416" /></div></footer>\n <footer id="about"><div>(v${r.get("VERSION")}) ${r.get("BYLINE")}<br/>${r.get("COPYRIGHT")}</div></footer>\n </form>\n `}wire(){const e=()=>{if(!this.checkUrl())return;const e=this.instance$.find("input#url").val();e&&(this.instance$.trigger($.Event("value"),{key:"url",value:e}),this.instance$.trigger($.Event("next")))};this.instance$.find("form").on("submit",t=>{t.preventDefault(),e()}),this.instance$.find("input").on("keydown",t=>{13==t.which&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e())}),this.instance$.find("button#ok").on("click",t=>{e()}),this.setupInputCheck()}async update(e){e.feed&&e.feed.cta1&&(this.instance$.find("#cta1--img").attr("src",e.feed.cta1.banner),this.instance$.find("#cta1--img").on("click",t=>{n(27).shell.openExternal(e.feed.cta1.url)}))}instance(){return this.instance$}checkUrl(){const e=this.instance$.find("input#url").val();return e&&-1!=e.toString().indexOf(".")&&-1==e.toString().indexOf(" ")?(this.instance$.find("#ok").removeAttr("disabled"),!0):(this.instance$.find("#ok").attr("disabled",!0),!1)}setupInputCheck(){this.instance$.find("input#url").on("keydown",e=>{this.checkUrl()}),this.instance$.on("pointermove",e=>{this.checkUrl()})}}},function(e,t,n){const{Localisation:r}=n(0),{Logger:o}=n(1),i=o.get("Step3.js");e.exports=class{constructor(e,t){this.data=e,this.options=t,this.instance$=$(this.markup()),this.instance$.append(this.css()),this.wire()}css(){return"\n <style>\n form {\n border: 1px solid rgba(0,0,0,0); /*WORKAROUND: OTHERWISE BUTTONS ARE NOT CLICKABLE. WTF?*/\n width: 100%;\n max-height: 400px;\n overflow: auto;\n }\n\n #footer {\n position: absolute;\n /*left: 0; right: 0; bottom: 80px;*/\n left: 0; right: 0; top: 200px;\n height: 60px;\n padding-left: 40px;\n padding-right: 40px;\n }\n\n </style>\n "}markup(){return`\n <form id="main-form" method="dialog">\n <h1>Mimic</h1>\n <p></p>\n <p>${r.get("DIALOG_PROGRESS_MESSAGE")}</p>\n <p></p><p></p>\n <p></p><p></p>\n <img id="spinner" src="assets/spinner.gif" width="30px"/>\n <p></p><p></p>\n <p></p><p></p>\n \x3c!--<p id="label--url">...</p>--\x3e\n \x3c!--<p>#PROMO_BANNER</p>--\x3e\n </form>\n `}wire(){this.instance$.find("button#ok").on("click",e=>{this.instance$.trigger($.Event("next"))})}async update(e){i.debug("update()"),await this.options.extractService(e.url).then(async t=>{i.debug("extracted data:",t),t&&"error"==t.type?(i.error("error",t.code,t.message),e.errorCode=t.code,e.errorMessage=t.message,this.instance$.trigger($.Event("next")),this.instance$.trigger($.Event("next"))):(await this.options.presentService(this.options.selection,this.options.root,t),this.instance$.trigger($.Event("next")))}).catch(e=>{console.error("my error",e),showError(e.code,e.message)})}instance(){return this.instance$}}},function(e,t,n){const{Localisation:r}=n(0),{Logger:o}=n(1);o.get("Step4.js");e.exports=class{constructor(e,t){this.data=e,this.options=t,this.instance$=$(this.markup()),this.instance$.append(this.css()),this.wire()}css(){return"\n <style>\n form {\n border: 1px solid rgba(0,0,0,0); /*WORKAROUND: OTHERWISE BUTTONS ARE NOT CLICKABLE. WTF?*/\n width: 100%;\n max-height: 400px;\n overflow: auto;\n }\n\n #footer {\n position: absolute;\n /*left: 0; right: 0; bottom: 80px;*/\n left: 0; right: 0; top: 200px;\n height: 60px;\n padding-left: 40px;\n padding-right: 40px;\n }\n\n #success-explainer {\n /*\n position: absolute;\n left: 0; right: 0; bottom: 10px;\n padding-left: 40px;\n padding-right: 40px;\n */\n margin: auto;\n width: 300px;\n }\n </style>\n "}markup(){return`\n <form id="main-form" method="dialog">\n <h1>Mimic</h1>\n <p></p>\n <p>${r.get("DIALOG_SUCCESS_MESSAGE")}</p>\n <p></p>\n\n <img id="success-explainer" src="./assets/success_explainer.gif" width="300" />\n\n <footer id="buttons">\n <button id="submit" uxp-variant="cta">${r.get("DIALOG_OK")}</button>\n </footer>\n </form>\n `}wire(){this.instance$.find("button#submit").on("click",e=>{this.instance$.trigger($.Event("submit"))})}async update(e){}instance(){return this.instance$}}},function(e,t,n){const{Localisation:r}=n(0),{Logger:o}=n(1);o.get("StepError.js");e.exports=class{constructor(e,t){this.data=e,this.options=t,this.instance$=$(this.markup()),this.instance$.append(this.css()),this.wire()}css(){return"\n <style>\n form {\n border: 1px solid rgba(0,0,0,0); /*WORKAROUND: OTHERWISE BUTTONS ARE NOT CLICKABLE. WTF?*/\n width: 100%;\n max-height: 400px;\n overflow: auto;\n }\n\n #footer {\n position: absolute;\n /*left: 0; right: 0; bottom: 80px;*/\n left: 0; right: 0; top: 200px;\n height: 60px;\n padding-left: 40px;\n padding-right: 40px;\n }\n </style>\n "}markup(){return`\n <form id="main-form" method="dialog">\n <h1>Mimic</h1>\n <p></p>\n <h2>Error</h2>\n <p>${r.get("DIALOG_ERROR_SORRY")}</p>\n <p id="error-message"></p>\n\n <footer id="buttons">\n <button id="submit" uxp-variant="cta">${r.get("DIALOG_OK")}</button>\n </footer>\n </form>\n `}wire(){this.instance$.find("button#submit").on("click",e=>{this.instance$.trigger($.Event("submit"))})}async update(e){const t=e.code?`(${e.code})`:"";this.instance$.find("#error-message").text(e.errorMessage+t)}instance(){return this.instance$}}},function(e,t){e.exports={DialogBase:class{constructor(){this.dialog,this.dialog$,this.currentStep=2,this.steps=[],this.data={}}markup(){return'<dialog class="dialog-base"></dialog>'}wire(){this.dialog$.on("back",e=>{this.showStep(--this.currentStep)}),this.dialog$.on("next",e=>{this.showStep(++this.currentStep)})}showStep(e){this.dialog$.find("form").hide(),this.dialog$.find(`form:nth-child(${e})`)[0].style.display="block",this.steps[e-1].update&&this.steps[e-1].update(this.data),this.currentStep=e}async open(){return new Promise(async(e,t)=>{try{var n=(n,r)=>{this.dialog.close(),this.dialog.remove(),1==n?e(r):t(r)};this.dialog$=$(this.markup()),this.dialog=this.dialog$.get(1),this.steps.forEach(e=>{this.dialog$.append(e.instance())}),$(document.body).append(this.css()),$(document.body).append(this.dialog),this.wire(),this.dialog$.on("submit",(e,t)=>{n(!0,this.data)}),this.dialog$.find("button#cancel").on("click",e=>{n()}),this.showStep(this.currentStep),this.dialog.addEventListener("cancel",()=>{n()}),await this.dialog.showModal().catch(()=>{n()})}catch(e){console.error(e.message)}})}}}},function(e,t,n){const{XDCommons:r}=n(5);e.exports={XDTpl:class{constructor(e){this.scenegraph=e}export(e){console.log("XDTpl:export()");const t={type:"XDTPL",version:"1.0",sets:[]};return e.forEach((e,n)=>{const r={name:`set_${n}`,type:"Set",children:[]};r.children.push(this._exportNode(e)),t.sets.push(r)}),JSON.stringify(t,null,0)}_exportNode(e){const t={type:e.constructor.name};if([{property:"name"},{property:"width"},{property:"height"},{property:"text"},{property:"textAlign"},{property:"lineSpacing"},{property:"radiusX"},{property:"radiusY"}].forEach(n=>{void 0!=e[n.property]&&(t[n.property]=e[n.property])}),e.topLeftInParent&&(t.x=e.topLeftInParent.x-e.localBounds.x),e.topLeftInParent&&(t.y=e.topLeftInParent.y-e.localBounds.y),e.styleRanges&&e.styleRanges.length&&(t.styleRanges=[],e.styleRanges.forEach(e=>{t.styleRanges.push({length:e.length,fontFamily:e.fontFamily,fontStyle:e.fontStyle,fontSize:e.fontSize,fill:e.fill.toHex()})})),e.cornerRadii&&0!=e.cornerRadii.topLeft&&0!=e.cornerRadii.topRight&&0!=e.cornerRadii.bottomRight&&0!=e.cornerRadii.bottomLeft&&(t.cornerRadii={topLeft:e.cornerRadii.topLeft,topRight:e.cornerRadii.topRight,bottomRight:e.cornerRadii.bottomRight,bottomLeft:e.cornerRadii.bottomLeft}),e.transform&&0!=e.transform.getRotation()&&(t.transform=e.transform),e.opacity<1&&(t.opacity=e.opacity),e.fillEnabled&&(t.fillEnabled=e.fillEnabled,e.fill))switch(t.fill={type:e.fill.constructor.name},e.fill.constructor.name){case"Color":t.fill.hex=e.fill.toHex(),t.fill.alpha=Math.round(e.fill.a/255*100)/100;break;case"LinearGradientFill":t.fill.startX=e.fill.startX,t.fill.startY=e.fill.startY,t.fill.endX=e.fill.endX,t.fill.endY=e.fill.endY,t.fill.colorStops=[],e.fill.colorStops.forEach(e=>{t.fill.colorStops.push({color:e.color.toHex(),alpha:e.color.a/255,stop:e.stop})});break;case"BitmapFill":t.fill.base64=e.fill.getBase64Representation()}return e.strokeEnabled&&(t.strokeEnabled=e.strokeEnabled,e.stroke&&(t.stroke=e.stroke.toHex(),t.strokeWidth=e.strokeWidth,t.strokePosition=e.strokePosition,t.strokeDashOffset=e.strokeDashOffset,e.strokeDashArray.length&&(t.strokeDashArray=[],e.strokeDashArray.forEach(e=>t.strokeDashArray.push(e))))),"Line"==e.constructor.name&&(t.startX=e.start.x,t.startY=e.start.y,t.endX=e.end.x,t.endY=e.end.y),"Path"==e.constructor.name&&(t.pathData=e.pathData),e.children&&e.children.length&&(t.children=[],e.children.forEach((e,n)=>{t.children.push(this._exportNode(e))})),t}import(e,t){const n=[];return t.sets.forEach((t,r)=>{t.children.forEach((t,r)=>{n.push(this._createNode(t,e))})}),n}_createNode(e,t){let n;return"Group"!=e.type&&"RepeatGrid"!=e.type&&"SymbolInstance"!=e.type&&"BooleanGroup"!=e.type&&((n=new this.scenegraph[e.type]).name=e.name,this._addTypeSpecificProperties(n,e),n.placeInParentCoordinates({x:0,y:0},{x:e.x,y:e.y}),"Artboard"==e.type?(r.addArtboard(n),t=n):t.addChild(n)),e.children&&e.children.length&&e.children.forEach(e=>{this._createNode(e,t)}),n}_addTypeSpecificProperties(e,t){switch(t.type){case"Artboard":case"Rectangle":e.width=t.width,e.height=t.height}if(t.transform){const n=t.transform;e.transform=new this.scenegraph.Matrix(n.a,n.b,n.c,n.d,n.e,n.f)}switch(t.type){case"Artboard":this._addFillAndStroke(e,t);break;case"Line":case"Rectangle":case"Ellipse":case"Path":e.opacity=t.opacity||1,this._addFillAndStroke(e,t)}switch(t.type){case"Line":e.setStartEnd(t.startX,t.startY,t.endX,t.endY);break;case"Rectangle":t.cornerRadii&&(e.cornerRadii=t.cornerRadii);break;case"Ellipse":e.radiusX=t.radiusX,e.radiusY=t.radiusY;break;case"Path":e.pathData=t.pathData;break;case"Text":e.text=t.text;let n=JSON.parse(JSON.stringify(t.styleRanges));n.forEach(e=>{e.fill=new this.scenegraph.Color(e.fill)}),e.styleRanges=n,e.textAlign=t.textAlign,e.lineSpacing=t.lineSpacing}}_addFillAndStroke(e,t){switch(e.fillEnabled=t.fillEnabled||!1,t.fill?t.fill.type:null){case"Color":e.fill=new this.scenegraph.Color(t.fill.hex,t.fill.alpha);break;case"LinearGradientFill":const n=new this.scenegraph.LinearGradient;n.setEndPoints(t.fill.startX,t.fill.startY,t.fill.endX,t.fill.endY);const r=[];t.fill.colorStops.forEach(e=>{r.push({color:new this.scenegraph.Color(e.color,e.color.alpha),stop:e.stop})}),n.colorStops=r,e.fill=n;break;case"BitmapFill":const o=this.scenegraph.BitmapFill.create({scaleBehavior:this.scenegraph.BitmapFill.SCALE_NORMAL});o.loadBase64Image(`data:image/jpeg;base64,${t.fill.base64}`),e.fill=o}e.strokeEnabled=t.strokeEnabled||!1,t.stroke&&(e.stroke=new this.scenegraph.Color(t.stroke),e.strokeWidth=t.strokeWidth,e.strokePosition=t.strokePosition,e.strokeDashOffset=t.strokeDashOffset,t.strokeDashArray&&(e.strokeDashArray=t.strokeDashArray))}}}},function(e,t,n){const{XDCommons:r}=n(5);e.exports={Expressions:class{constructor(e){console.log("Expressions::constructor()")}static find(e,t){try{let n=[];return function e(r){const o=new RegExp(`^#!(${t})`).exec(r.name);if(o){const e=o[1],t=new RegExp("^([a-zA-Z]+)\\((\\d+)\\)").exec(e),i=t[1],a=t[2];n.push({command:i,args:[a],node:r})}r.children&&r.children.length&&r.children.forEach(t=>{e(t)})}(e),n}catch(e){console.error(e.message)}}static async fill(e,t){for(var n=0;n<e.children.length;n++){const o=e.children.at(n),i=new RegExp(/^#!([A-Z]+)/).exec(o.name);if(i){let e=t[i[1]];if(e)switch(o.constructor.name){case"Text":o.text=e;break;case"Rectangle":if("BitmapFill"==o.fill.constructor.name)try{const e=await(await r.fs.getPluginFolder()).getEntry(t.IMAGE),n=new r.scenegraph.BitmapFill;await n.loadFromURL(e.nativePath),o.fill=n}catch(e){console.error("#TODO_ERROR",e.toString())}}}}}}}},function(e,t,n){var r;/*! jQuery v3.3.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector | (c) JS Foundation and other contributors | jquery.org/license */!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(o,i){"use strict";var a=[],s=o.document,l=Object.getPrototypeOf,c=a.slice,u=a.concat,d=a.push,f=a.indexOf,p={},h=p.toString,g=p.hasOwnProperty,m=g.toString,y=m.call(Object),v={},b=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},w={type:!0,src:!0,noModule:!0};function E(e,t,n){var r,o=(t=t||s).createElement("script");if(o.text=e,n)for(r in w)n[r]&&(o[r]=n[r]);t.head.appendChild(o).parentNode.removeChild(o)}function C(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[h.call(e)]||"object":typeof e}var A="3.3.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector",S=function(e,t){return new S.fn.init(e,t)},D=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function T(e){var t=!!e&&"length"in e&&e.length,n=C(e);return!b(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:A,constructor:S,length:0,toArray:function(){return c.call(this)},get:function(e){return null==e?c.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(c.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:d,sort:a.sort,splice:a.splice},S.extend=S.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[s]||{},s++),"object"==typeof a||b(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(c&&r&&(S.isPlainObject(r)||(o=Array.isArray(r)))?(o?(o=!1,i=n&&Array.isArray(n)?n:[]):i=n&&S.isPlainObject(n)?n:{},a[t]=S.extend(c,i,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(A+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==h.call(e)||(t=l(e))&&("function"!=typeof(n=g.call(t,"constructor")&&t.constructor)||m.call(n)!==y))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){E(e)},each:function(e,t){var n,r=0;if(T(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(D,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(T(Object(e))?S.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:f.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;r<n;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r=[],o=0,i=e.length,a=!n;o<i;o++)!t(e[o],o)!==a&&r.push(e[o]);return r},map:function(e,t,n){var r,o,i=0,a=[];if(T(e))for(r=e.length;i<r;i++)null!=(o=t(e[i],i,n))&&a.push(o);else for(i in e)null!=(o=t(e[i],i,n))&&a.push(o);return u.apply([],a)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=a[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){p["[object "+t+"]"]=t.toLowerCase()});var k=function(e){var t,n,r,o,i,a,s,l,c,u,d,f,p,h,g,m,y,v,b,x="sizzle"+1*new Date,w=e.document,E=0,C=0,A=ae(),S=ae(),D=ae(),T=function(e,t){return e===t&&(d=!0),0},k={}.hasOwnProperty,L=[],N=L.pop,R=L.push,O=L.push,$=L.slice,j=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},I="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",_="\\["+P+"*("+M+")(?:"+P+"*([*^$|!~]?=)"+P+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+P+"*\\]",H=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+_+")*)|.*)\\)|)",B=new RegExp(P+"+","g"),F=new RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),q=new RegExp("^"+P+"*,"+P+"*"),X=new RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),W=new RegExp("="+P+"*([^\\]'\"]*?)"+P+"*\\]","g"),U=new RegExp(H),G=new RegExp("^"+M+"$"),z={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+_),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,Q=new RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){f()},oe=ve(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{O.apply(L=$.call(w.childNodes),w.childNodes),L[w.childNodes.length].nodeType}catch(e){O={apply:L.length?function(e,t){R.apply(e,$.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function ie(e,t,r,o){var i,s,c,u,d,h,y,v=t&&t.ownerDocument,E=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==E&&9!==E&&11!==E)return r;if(!o&&((t?t.ownerDocument||t:w)!==p&&f(t),t=t||p,g)){if(11!==E&&(d=V.exec(e)))if(i=d[1]){if(9===E){if(!(c=t.getElementById(i)))return r;if(c.id===i)return r.push(c),r}else if(v&&(c=v.getElementById(i))&&b(t,c)&&c.id===i)return r.push(c),r}else{if(d[2])return O.apply(r,t.getElementsByTagName(e)),r;if((i=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(i)),r}if(n.qsa&&!D[e+" "]&&(!m||!m.test(e))){if(1!==E)v=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(te,ne):t.setAttribute("id",u=x),s=(h=a(e)).length;s--;)h[s]="#"+u+" "+ye(h[s]);y=h.join(","),v=Z.test(e)&&ge(t.parentNode)||t}if(y)try{return O.apply(r,v.querySelectorAll(y)),r}catch(e){}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(F,"$1"),t,r,o)}function ae(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function se(e){return e[x]=!0,e}function le(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function ue(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&oe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ie.support={},i=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},f=ie.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,g=!i(p),w!==p&&(o=p.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",re,!1):o.attachEvent&&o.attachEvent("onunload",re)),n.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=le(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(p.getElementsByClassName),n.getById=le(function(e){return h.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],m=[],(n.qsa=J.test(p.querySelectorAll))&&(le(function(e){h.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+P+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+x+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||m.push(".#.+[+~]")}),le(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+P+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=J.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&le(function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",H)}),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),t=J.test(h.compareDocumentPosition),b=t||J.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},T=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===p||e.ownerDocument===w&&b(w,e)?-1:t===p||t.ownerDocument===w&&b(w,t)?1:u?j(u,e)-j(u,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!o||!i)return e===p?-1:t===p?1:o?-1:i?1:u?j(u,e)-j(u,t):0;if(o===i)return ue(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ue(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},p):p},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&f(e),t=t.replace(W,"='$1']"),n.matchesSelector&&g&&!D[t+" "]&&(!y||!y.test(t))&&(!m||!m.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return ie(t,p,null,[e]).length>0},ie.contains=function(e,t){return(e.ownerDocument||e)!==p&&f(e),b(e,t)},ie.attr=function(e,t){(e.ownerDocument||e)!==p&&f(e);var o=r.attrHandle[t.toLowerCase()],i=o&&k.call(r.attrHandle,t.toLowerCase())?o(e,t,!g):void 0;return void 0!==i?i:n.attributes||!g?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},ie.escape=function(e){return(e+"").replace(te,ne)},ie.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ie.uniqueSort=function(e){var t,r=[],o=0,i=0;if(d=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(T),d){for(;t=e[i++];)t===e[i]&&(o=r.push(i));for(;o--;)e.splice(r[o],1)}return u=null,e},o=ie.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(r=ie.selectors={cacheLength:50,createPseudo:se,match:z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Q,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Q,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ie.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return z.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&U.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Q,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=A[e+" "];return t||(t=new RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&A(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=ie.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(B," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,h,g=i!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s,b=!1;if(m){if(i){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(b=(p=(c=(u=(d=(f=m)[x]||(f[x]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===E&&c[1])&&c[2],f=p&&m.childNodes[p];f=++p&&f&&f[g]||(b=p=0)||h.pop();)if(1===f.nodeType&&++b&&f===t){u[e]=[E,p,b];break}}else if(v&&(b=p=(c=(u=(d=(f=t)[x]||(f[x]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===E&&c[1]),!1===b)for(;(f=++p&&f&&f[g]||(b=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++b||(v&&((u=(d=f[x]||(f[x]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[E,b]),f!==t)););return(b-=o)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ie.error("unsupported pseudo: "+e);return o[x]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)e[r=j(e,i[a])]=!(n[r]=i[a])}):function(e){return o(e,0,n)}):o}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(F,"$1"));return r[x]?se(function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return ie(e,t).length>0}}),contains:se(function(e){return e=e.replace(Q,ee),function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:se(function(e){return G.test(e||"")||ie.error("unsupported lang: "+e),e=e.replace(Q,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=fe(t);function me(){}function ye(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,o=t.next,i=o||r,a=n&&"parentNode"===i,s=C++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,o);return!1}:function(t,n,l){var c,u,d,f=[E,s];if(l){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(u=(d=t[x]||(t[x]={}))[t.uniqueID]||(d[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=u[i])&&c[0]===E&&c[1]===s)return f[2]=c[2];if(u[i]=f,f[2]=e(t,n,l))return!0}return!1}}function be(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function xe(e,t,n,r,o){for(var i,a=[],s=0,l=e.length,c=null!=t;s<l;s++)(i=e[s])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(s)));return a}function we(e,t,n,r,o,i){return r&&!r[x]&&(r=we(r)),o&&!o[x]&&(o=we(o,i)),se(function(i,a,s,l){var c,u,d,f=[],p=[],h=a.length,g=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)ie(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),m=!e||!i&&t?g:xe(g,f,e,s,l),y=n?o||(i?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r)for(c=xe(y,p),r(c,[],s,l),u=c.length;u--;)(d=c[u])&&(y[p[u]]=!(m[p[u]]=d));if(i){if(o||e){if(o){for(c=[],u=y.length;u--;)(d=y[u])&&c.push(m[u]=d);o(null,y=[],c,l)}for(u=y.length;u--;)(d=y[u])&&(c=o?j(i,d):f[u])>-1&&(i[c]=!(a[c]=d))}}else y=xe(y===a?y.splice(h,y.length):y),o?o(null,a,y,l):O.apply(a,y)})}function Ee(e){for(var t,n,o,i=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,u=ve(function(e){return e===t},s,!0),d=ve(function(e){return j(t,e)>-1},s,!0),f=[function(e,n,r){var o=!a&&(r||n!==c)||((t=n).nodeType?u(e,n,r):d(e,n,r));return t=null,o}];l<i;l++)if(n=r.relative[e[l].type])f=[ve(be(f),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(o=++l;o<i&&!r.relative[e[o].type];o++);return we(l>1&&be(f),l>1&&ye(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(F,"$1"),n,l<o&&Ee(e.slice(l,o)),o<i&&Ee(e=e.slice(o)),o<i&&ye(e))}f.push(n)}return be(f)}function Ce(e,t){var n=t.length>0,o=e.length>0,i=function(i,a,s,l,u){var d,h,m,y=0,v="0",b=i&&[],x=[],w=c,C=i||o&&r.find.TAG("*",u),A=E+=null==w?1:Math.random()||.1,S=C.length;for(u&&(c=a===p||a||u);v!==S&&null!=(d=C[v]);v++){if(o&&d){for(h=0,a||d.ownerDocument===p||(f(d),s=!g);m=e[h++];)if(m(d,a||p,s)){l.push(d);break}u&&(E=A)}n&&((d=!m&&d)&&y--,i&&b.push(d))}if(y+=v,n&&v!==y){for(h=0;m=t[h++];)m(b,x,a,s);if(i){if(y>0)for(;v--;)b[v]||x[v]||(x[v]=N.call(l));x=xe(x)}O.apply(l,x),u&&!i&&x.length>0&&y+t.length>1&&ie.uniqueSort(l)}return u&&(E=A,c=w),b};return n?se(i):i}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=ie.tokenize=function(e,t){var n,o,i,a,s,l,c,u=S[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=r.preFilter;s;){for(a in n&&!(o=q.exec(s))||(o&&(s=s.slice(o[0].length)||s),l.push(i=[])),n=!1,(o=X.exec(s))&&(n=o.shift(),i.push({value:n,type:o[0].replace(F," ")}),s=s.slice(n.length)),r.filter)!(o=z[a].exec(s))||c[a]&&!(o=c[a](o))||(n=o.shift(),i.push({value:n,type:a,matches:o}),s=s.slice(n.length));if(!n)break}return t?s.length:s?ie.error(e):S(e,l).slice(0)},s=ie.compile=function(e,t){var n,r=[],o=[],i=D[e+" "];if(!i){for(t||(t=a(e)),n=t.length;n--;)(i=Ee(t[n]))[x]?r.push(i):o.push(i);(i=D(e,Ce(o,r))).selector=e}return i},l=ie.select=function(e,t,n,o){var i,l,c,u,d,f="function"==typeof e&&e,p=!o&&a(e=f.selector||e);if(n=n||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&g&&r.relative[l[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(Q,ee),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(i=z.needsContext.test(e)?0:l.length;i--&&(c=l[i],!r.relative[u=c.type]);)if((d=r.find[u])&&(o=d(c.matches[0].replace(Q,ee),Z.test(l[0].type)&&ge(t.parentNode)||t))){if(l.splice(i,1),!(e=o.length&&ye(l)))return O.apply(n,o),n;break}}return(f||s(e,p))(o,t,!g,n,!t||Z.test(e)&&ge(t.parentNode)||t),n},n.sortStable=x.split("").sort(T).join("")===x,n.detectDuplicates=!!d,f(),n.sortDetached=le(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),le(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ce("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&le(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ce("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||ce(I,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),ie}(o);S.find=k,S.expr=k.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=k.uniqueSort,S.text=k.getText,S.isXMLDoc=k.isXML,S.contains=k.contains,S.escapeSelector=k.escape;var L=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&S(e).is(n))break;r.push(e)}return r},N=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},R=S.expr.match.needsContext;function O(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var $=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return b(t)?S.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return f.call(t,e)>-1!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(o[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,o[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&R.test(e)?S(e):e||[],!1).length}});var I,P=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||I,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:P.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:s,!0)),$.test(r[1])&&S.isPlainObject(t))for(r in t)b(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=s.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):b(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,I=S(s);var M=/^(?:parents|prev(?:Until|All))/,_={children:!0,contents:!0,next:!0,prev:!0};function H(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,o=this.length,i=[],a="string"!=typeof e&&S(e);if(!R.test(e))for(;r<o;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?S.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?f.call(S(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return L(e,"parentNode")},parentsUntil:function(e,t,n){return L(e,"parentNode",n)},next:function(e){return H(e,"nextSibling")},prev:function(e){return H(e,"previousSibling")},nextAll:function(e){return L(e,"nextSibling")},prevAll:function(e){return L(e,"previousSibling")},nextUntil:function(e,t,n){return L(e,"nextSibling",n)},prevUntil:function(e,t,n){return L(e,"previousSibling",n)},siblings:function(e){return N((e.parentNode||{}).firstChild,e)},children:function(e){return N(e.firstChild)},contents:function(e){return O(e,"iframe")?e.contentDocument:(O(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,r){var o=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=S.filter(r,o)),this.length>1&&(_[e]||S.uniqueSort(o),M.test(e)&&o.reverse()),this.pushStack(o)}});var B=/[^\x20\t\r\n\f]+/g;function F(e){return e}function q(e){throw e}function X(e,t,n,r){var o;try{e&&b(o=e.promise)?o.call(e).done(t).fail(n):e&&b(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(B)||[],function(e,n){t[n]=!0}),t}(e):S.extend({},e);var t,n,r,o,i=[],a=[],s=-1,l=function(){for(o=o||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<i.length;)!1===i[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=i.length,n=!1);e.memory||(n=!1),t=!1,o&&(i=n?[]:"")},c={add:function(){return i&&(n&&!t&&(s=i.length-1,a.push(n)),function t(n){S.each(n,function(n,r){b(r)?e.unique&&c.has(r)||i.push(r):r&&r.length&&"string"!==C(r)&&t(r)})}(arguments),n&&!t&&l()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,i,n))>-1;)i.splice(n,1),n<=s&&s--}),this},has:function(e){return e?S.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return S.Deferred(function(n){S.each(t,function(t,r){var o=b(e[r[4]])&&e[r[4]];i[r[1]](function(){var e=o&&o.apply(this,arguments);e&&b(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(e,n,r){var i=0;function a(e,t,n,r){return function(){var s=this,l=arguments,c=function(){var o,c;if(!(e<i)){if((o=n.apply(s,l))===t.promise())throw new TypeError("Thenable self-resolution");c=o&&("object"==typeof o||"function"==typeof o)&&o.then,b(c)?r?c.call(o,a(i,t,F,r),a(i,t,q,r)):(i++,c.call(o,a(i,t,F,r),a(i,t,q,r),a(i,t,F,t.notifyWith))):(n!==F&&(s=void 0,l=[o]),(r||t.resolveWith)(s,l))}},u=r?c:function(){try{c()}catch(r){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(r,u.stackTrace),e+1>=i&&(n!==q&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?u():(S.Deferred.getStackHook&&(u.stackTrace=S.Deferred.getStackHook()),o.setTimeout(u))}}return S.Deferred(function(o){t[0][3].add(a(0,o,b(r)?r:F,o.notifyWith)),t[1][3].add(a(0,o,b(e)?e:F)),t[2][3].add(a(0,o,b(n)?n:q))}).promise()},promise:function(e){return null!=e?S.extend(e,r):r}},i={};return S.each(t,function(e,o){var a=o[2],s=o[5];r[o[1]]=a.add,s&&a.add(function(){n=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(o[3].fire),i[o[0]]=function(){return i[o[0]+"With"](this===i?void 0:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),o=c.call(arguments),i=S.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?c.call(arguments):n,--t||i.resolveWith(r,o)}};if(t<=1&&(X(e,i.done(a(n)).resolve,i.reject,!t),"pending"===i.state()||b(o[n]&&o[n].then)))return i.then();for(;n--;)X(o[n],a(n),i.reject);return i.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){o.console&&o.console.warn&&e&&W.test(e.name)&&o.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){o.setTimeout(function(){throw e})};var U=S.Deferred();function G(){s.removeEventListener("DOMContentLoaded",G),o.removeEventListener("load",G),S.ready()}S.fn.ready=function(e){return U.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||U.resolveWith(s,[S]))}}),S.ready.then=U.then,"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?o.setTimeout(S.ready):(s.addEventListener("DOMContentLoaded",G),o.addEventListener("load",G));var z=function(e,t,n,r,o,i,a){var s=0,l=e.length,c=null==n;if("object"===C(n))for(s in o=!0,n)z(e,t,s,n[s],!0,i,a);else if(void 0!==r&&(o=!0,b(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(S(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return o?e:c?t.call(e):l?t(e[0],n):i},Y=/^-ms-/,K=/-([a-z])/g;function J(e,t){return t.toUpperCase()}function V(e){return e.replace(Y,"ms-").replace(K,J)}var Z=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=S.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Z(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,o=this.cache(e);if("string"==typeof t)o[V(t)]=n;else for(r in t)o[V(r)]=t[r];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(B)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var ee=new Q,te=new Q,ne=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,re=/[A-Z]/g;function oe(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(re,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ne.test(e)?JSON.parse(e):e)}(n)}catch(e){}te.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return te.hasData(e)||ee.hasData(e)},data:function(e,t,n){return te.access(e,t,n)},removeData:function(e,t){te.remove(e,t)},_data:function(e,t,n){return ee.access(e,t,n)},_removeData:function(e,t){ee.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===e){if(this.length&&(o=te.get(i),1===i.nodeType&&!ee.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=V(r.slice(5)),oe(i,r,o[r]));ee.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){te.set(this,e)}):z(this,function(t){var n;if(i&&void 0===t){if(void 0!==(n=te.get(i,e)))return n;if(void 0!==(n=oe(i,e)))return n}else this.each(function(){te.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){te.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ee.get(e,t),n&&(!r||Array.isArray(n)?r=ee.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,o=n.shift(),i=S._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,function(){S.dequeue(e,t)},i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ee.get(e,n)||ee.access(e,n,{empty:S.Callbacks("once memory").add(function(){ee.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,o=S.Deferred(),i=this,a=this.length,s=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=ee.get(i[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),o.promise(t)}});var ie=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ae=new RegExp("^(?:([+-])=|)("+ie+")([a-z%]*)$","i"),se=["Top","Right","Bottom","Left"],le=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&S.contains(e.ownerDocument,e)&&"none"===S.css(e,"display")},ce=function(e,t,n,r){var o,i,a={};for(i in t)a[i]=e.style[i],e.style[i]=t[i];for(i in o=n.apply(e,r||[]),t)e.style[i]=a[i];return o};var ue={};function de(e){var t,n=e.ownerDocument,r=e.nodeName,o=ue[r];return o||(t=n.body.appendChild(n.createElement(r)),o=S.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),ue[r]=o,o)}function fe(e,t){for(var n,r,o=[],i=0,a=e.length;i<a;i++)(r=e[i]).style&&(n=r.style.display,t?("none"===n&&(o[i]=ee.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&le(r)&&(o[i]=de(r))):"none"!==n&&(o[i]="none",ee.set(r,"display",n)));for(i=0;i<a;i++)null!=o[i]&&(e[i].style.display=o[i]);return e}S.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){le(this)?S(this).show():S(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,he=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ge=/^$|^module$|\/(?:java|ecma)script/i,me={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&O(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)ee.set(e[n],"globalEval",!t||ee.get(t[n],"globalEval"))}me.optgroup=me.option,me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td;var be=/<|&#?\w+;/;function xe(e,t,n,r,o){for(var i,a,s,l,c,u,d=t.createDocumentFragment(),f=[],p=0,h=e.length;p<h;p++)if((i=e[p])||0===i)if("object"===C(i))S.merge(f,i.nodeType?[i]:i);else if(be.test(i)){for(a=a||d.appendChild(t.createElement("div")),s=(he.exec(i)||["",""])[1].toLowerCase(),l=me[s]||me._default,a.innerHTML=l[1]+S.htmlPrefilter(i)+l[2],u=l[0];u--;)a=a.lastChild;S.merge(f,a.childNodes),(a=d.firstChild).textContent=""}else f.push(t.createTextNode(i));for(d.textContent="",p=0;i=f[p++];)if(r&&S.inArray(i,r)>-1)o&&o.push(i);else if(c=S.contains(i.ownerDocument,i),a=ye(d.appendChild(i),"script"),c&&ve(a),n)for(u=0;i=a[u++];)ge.test(i.type||"")&&n.push(i);return d}!function(){var e=s.createDocumentFragment().appendChild(s.createElement("div")),t=s.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),v.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var we=s.documentElement,Ee=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ae=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function De(){return!1}function Te(){try{return s.activeElement}catch(e){}}function ke(e,t,n,r,o,i){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=De;else if(!o)return e;return 1===i&&(a=o,(o=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,o,r,n)})}S.event={global:{},add:function(e,t,n,r,o){var i,a,s,l,c,u,d,f,p,h,g,m=ee.get(e);if(m)for(n.handler&&(n=(i=n).handler,o=i.selector),o&&S.find.matchesSelector(we,o),n.guid||(n.guid=S.guid++),(l=m.events)||(l=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(B)||[""]).length;c--;)p=g=(s=Ae.exec(t[c])||[])[1],h=(s[2]||"").split(".").sort(),p&&(d=S.event.special[p]||{},p=(o?d.delegateType:d.bindType)||p,d=S.event.special[p]||{},u=S.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&S.expr.match.needsContext.test(o),namespace:h.join(".")},i),(f=l[p])||((f=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),o?f.splice(f.delegateCount++,0,u):f.push(u),S.event.global[p]=!0)},remove:function(e,t,n,r,o){var i,a,s,l,c,u,d,f,p,h,g,m=ee.hasData(e)&&ee.get(e);if(m&&(l=m.events)){for(c=(t=(t||"").match(B)||[""]).length;c--;)if(p=g=(s=Ae.exec(t[c])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=S.event.special[p]||{},f=l[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=f.length;i--;)u=f[i],!o&&g!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(f.splice(i,1),u.selector&&f.delegateCount--,d.remove&&d.remove.call(e,u));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||S.removeEvent(e,p,m.handle),delete l[p])}else for(p in l)S.event.remove(e,p+t[c],n,r,!0);S.isEmptyObject(l)&&ee.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,s=S.event.fix(e),l=new Array(arguments.length),c=(ee.get(this,"events")||{})[s.type]||[],u=S.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,s)){for(a=S.event.handlers.call(this,s,c),t=0;(o=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(r=((S.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,o,i,a,s=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(i=[],a={},n=0;n<l;n++)void 0===a[o=(r=t[n]).selector+" "]&&(a[o]=r.needsContext?S(o,this).index(c)>-1:S.find(o,this,null,[c]).length),a[o]&&i.push(r);i.length&&s.push({elem:c,handlers:i})}return c=this,l<t.length&&s.push({elem:c,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:b(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Te()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Te()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&O(this,"input"))return this.click(),!1},_default:function(e){return O(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Se:De,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:De,isPropagationStopped:De,isImmediatePropagationStopped:De,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Se,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Se,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Se,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Ee.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,o=e.handleObj;return r&&(r===this||S.contains(this,r))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=De),this.each(function(){S.event.remove(this,e,n,t)})}});var Le=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ne=/<script|<style|<link/i,Re=/checked\s*(?:[^=]|=\s*.checked.)/i,Oe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function $e(e,t){return O(e,"table")&&O(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function je(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ie(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,o,i,a,s,l,c;if(1===t.nodeType){if(ee.hasData(e)&&(i=ee.access(e),a=ee.set(t,i),c=i.events))for(o in delete a.handle,a.events={},c)for(n=0,r=c[o].length;n<r;n++)S.event.add(t,o,c[o][n]);te.hasData(e)&&(s=te.access(e),l=S.extend({},s),te.set(t,l))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function _e(e,t,n,r){t=u.apply([],t);var o,i,a,s,l,c,d=0,f=e.length,p=f-1,h=t[0],g=b(h);if(g||f>1&&"string"==typeof h&&!v.checkClone&&Re.test(h))return e.each(function(o){var i=e.eq(o);g&&(t[0]=h.call(this,o,i.html())),_e(i,t,n,r)});if(f&&(i=(o=xe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(s=(a=S.map(ye(o,"script"),je)).length;d<f;d++)l=o,d!==p&&(l=S.clone(l,!0,!0),s&&S.merge(a,ye(l,"script"))),n.call(e[d],l,d);if(s)for(c=a[a.length-1].ownerDocument,S.map(a,Ie),d=0;d<s;d++)l=a[d],ge.test(l.type||"")&&!ee.access(l,"globalEval")&&S.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?S._evalUrl&&S._evalUrl(l.src):E(l.textContent.replace(Oe,""),c,l))}return e}function He(e,t,n){for(var r,o=t?S.filter(t,e):e,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||S.cleanData(ye(r)),r.parentNode&&(n&&S.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e.replace(Le,"<$1></$2>")},clone:function(e,t,n){var r,o,i,a,s=e.cloneNode(!0),l=S.contains(e.ownerDocument,e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ye(s),r=0,o=(i=ye(e)).length;r<o;r++)Me(i[r],a[r]);if(t)if(n)for(i=i||ye(e),a=a||ye(s),r=0,o=i.length;r<o;r++)Pe(i[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!l&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,o=S.event.special,i=0;void 0!==(n=e[i]);i++)if(Z(n)){if(t=n[ee.expando]){if(t.events)for(r in t.events)o[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[ee.expando]=void 0}n[te.expando]&&(n[te.expando]=void 0)}}}),S.fn.extend({detach:function(e){return He(this,e,!0)},remove:function(e){return He(this,e)},text:function(e){return z(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return _e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||$e(this,e).appendChild(e)})},prepend:function(){return _e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=$e(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return _e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return _e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!me[(he.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return _e(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,r=[],o=S(e),i=o.length-1,a=0;a<=i;a++)n=a===i?this:this.clone(!0),S(o[a])[t](n),d.apply(r,n.get());return this.pushStack(r)}});var Be=new RegExp("^("+ie+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=o),t.getComputedStyle(e)},qe=new RegExp(se.join("|"),"i");function Xe(e,t,n){var r,o,i,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||S.contains(e.ownerDocument,e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Be.test(a)&&qe.test(t)&&(r=s.width,o=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=o,s.maxWidth=i)),void 0!==a?a+"":a}function We(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",we.appendChild(c).appendChild(u);var e=o.getComputedStyle(u);n="1%"!==e.top,l=12===t(e.marginLeft),u.style.right="60%",a=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=36===u.offsetWidth||"absolute",we.removeChild(c),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,a,l,c=s.createElement("div"),u=s.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===u.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),i}}))}();var Ue=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,ze={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"},Ke=["Webkit","Moz","ms"],Je=s.createElement("div").style;function Ve(e){var t=S.cssProps[e];return t||(t=S.cssProps[e]=function(e){if(e in Je)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Ke.length;n--;)if((e=Ke[n]+t)in Je)return e}(e)||e),t}function Ze(e,t,n){var r=ae.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,o,i){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=S.css(e,n+se[a],!0,o)),r?("content"===n&&(l-=S.css(e,"padding"+se[a],!0,o)),"margin"!==n&&(l-=S.css(e,"border"+se[a]+"Width",!0,o))):(l+=S.css(e,"padding"+se[a],!0,o),"padding"!==n?l+=S.css(e,"border"+se[a]+"Width",!0,o):s+=S.css(e,"border"+se[a]+"Width",!0,o));return!r&&i>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-l-s-.5))),l}function et(e,t,n){var r=Fe(e),o=Xe(e,t,r),i="border-box"===S.css(e,"boxSizing",!1,r),a=i;if(Be.test(o)){if(!n)return o;o="auto"}return a=a&&(v.boxSizingReliable()||o===e.style[t]),("auto"===o||!parseFloat(o)&&"inline"===S.css(e,"display",!1,r))&&(o=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(o=parseFloat(o)||0)+Qe(e,t,n||(i?"border":"content"),a,r,o)+"px"}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Xe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,s=V(t),l=Ge.test(t),c=e.style;if(l||(t=Ve(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:c[t];"string"==(i=typeof n)&&(o=ae.exec(n))&&o[1]&&(n=function(e,t,n,r){var o,i,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},l=s(),c=n&&n[3]||(S.cssNumber[t]?"":"px"),u=(S.cssNumber[t]||"px"!==c&&+l)&&ae.exec(S.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;a--;)S.style(e,t,u+c),(1-i)*(1-(i=s()/l||.5))<=0&&(a=0),u/=i;u*=2,S.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,o=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=o)),o}(e,t,o),i="number"),null!=n&&n==n&&("number"===i&&(n+=o&&o[3]||(S.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var o,i,a,s=V(t);return Ge.test(t)||(t=Ve(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=Xe(e,t,r)),"normal"===o&&t in Ye&&(o=Ye[t]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):ce(e,ze,function(){return et(e,t,r)})},set:function(e,n,r){var o,i=Fe(e),a="border-box"===S.css(e,"boxSizing",!1,i),s=r&&Qe(e,t,r,a,i);return a&&v.scrollboxSize()===i.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-Qe(e,t,"border",!1,i)-.5)),s&&(o=ae.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),Ze(0,n,s)}}}),S.cssHooks.marginLeft=We(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Xe(e,"marginLeft"))||e.getBoundingClientRect().left-ce(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+se[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(S.cssHooks[e+t].set=Ze)}),S.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=Fe(e),o=t.length;a<o;a++)i[t[a]]=S.css(e,t[a],!1,r);return i}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,arguments.length>1)}}),S.fn.delay=function(e,t){return e=S.fx&&S.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,n){var r=o.setTimeout(t,e);n.stop=function(){o.clearTimeout(r)}})},function(){var e=s.createElement("input"),t=s.createElement("select").appendChild(s.createElement("option"));e.type="checkbox",v.checkOn=""!==e.value,v.optSelected=t.selected,(e=s.createElement("input")).value="t",e.type="radio",v.radioValue="t"===e.value}();var tt,nt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return z(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?S.prop(e,t,n):(1===i&&S.isXMLDoc(e)||(o=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?tt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&O(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(B);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),tt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=nt[t]||S.find.attr;nt[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=nt[a],nt[a]=o,o=null!=n(e,t,r)?a:null,nt[a]=i),o}});var rt=/^(?:input|select|textarea|button)$/i,ot=/^(?:a|area)$/i;function it(e){return(e.match(B)||[]).join(" ")}function at(e){return e.getAttribute&&e.getAttribute("class")||""}function st(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(B)||[]}S.fn.extend({prop:function(e,t){return z(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(e)||(t=S.propFix[t]||t,o=S.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):rt.test(e.nodeName)||ot.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,r,o,i,a,s,l=0;if(b(e))return this.each(function(t){S(this).addClass(e.call(this,t,at(this)))});if((t=st(e)).length)for(;n=this[l++];)if(o=at(n),r=1===n.nodeType&&" "+it(o)+" "){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(s=it(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,o,i,a,s,l=0;if(b(e))return this.each(function(t){S(this).removeClass(e.call(this,t,at(this)))});if(!arguments.length)return this.attr("class","");if((t=st(e)).length)for(;n=this[l++];)if(o=at(n),r=1===n.nodeType&&" "+it(o)+" "){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(s=it(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):b(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,at(this),t),t)}):this.each(function(){var t,o,i,a;if(r)for(o=0,i=S(this),a=st(e);t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=at(this))&&ee.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":ee.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+it(at(n))+" ").indexOf(t)>-1)return!0;return!1}});var lt=/\r/g;S.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=b(e),this.each(function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,S(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=S.map(o,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=S.valHooks[o.type]||S.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(lt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:it(S.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?i+1:o.length;for(r=i<0?l:a?i:0;r<l;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!O(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,o=e.options,i=S.makeArray(t),a=o.length;a--;)((r=o[a]).selected=S.inArray(S.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in o;var ct=/^(?:focusinfocus|focusoutblur)$/,ut=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,a,l,c,u,d,f,p,h=[n||s],m=g.call(e,"type")?e.type:e,y=g.call(e,"namespace")?e.namespace.split("."):[];if(a=p=l=n=n||s,3!==n.nodeType&&8!==n.nodeType&&!ct.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(m=(y=m.split(".")).shift(),y.sort()),u=m.indexOf(":")<0&&"on"+m,(e=e[S.expando]?e:new S.Event(m,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=y.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),f=S.event.special[m]||{},r||!f.trigger||!1!==f.trigger.apply(n,t))){if(!r&&!f.noBubble&&!x(n)){for(c=f.delegateType||m,ct.test(c+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),l=a;l===(n.ownerDocument||s)&&h.push(l.defaultView||l.parentWindow||o)}for(i=0;(a=h[i++])&&!e.isPropagationStopped();)p=a,e.type=i>1?c:f.bindType||m,(d=(ee.get(a,"events")||{})[e.type]&&ee.get(a,"handle"))&&d.apply(a,t),(d=u&&a[u])&&d.apply&&Z(a)&&(e.result=d.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,r||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(h.pop(),t)||!Z(n)||u&&b(n[m])&&!x(n)&&((l=n[u])&&(n[u]=null),S.event.triggered=m,e.isPropagationStopped()&&p.addEventListener(m,ut),n[m](),e.isPropagationStopped()&&p.removeEventListener(m,ut),S.event.triggered=void 0,l&&(n[u]=l)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this,o=ee.access(r,t);o||r.addEventListener(e,n,!0),ee.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=ee.access(r,t)-1;o?ee.access(r,t,o):(r.removeEventListener(e,n,!0),ee.remove(r,t))}}});var dt=/\[\]$/,ft=/\r?\n/g,pt=/^(?:submit|button|image|reset|file)$/i,ht=/^(?:input|select|textarea|keygen)/i;function gt(e,t,n,r){var o;if(Array.isArray(t))S.each(t,function(t,o){n||dt.test(e)?r(e,o):gt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==C(t))r(e,t);else for(o in t)gt(e+"["+o+"]",t[o],n,r)}S.param=function(e,t){var n,r=[],o=function(e,t){var n=b(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){o(this.name,this.value)});else for(n in e)gt(n,e[n],t,o);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&ht.test(this.nodeName)&&!pt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(ft,"\r\n")}}):{name:t.name,value:n.replace(ft,"\r\n")}}).get()}}),S.fn.extend({wrapAll:function(e){var t;return this[0]&&(b(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return b(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},v.createHTMLDocument=function(){var e=s.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=s.implementation.createHTMLDocument("")).createElement("base")).href=s.location.href,t.head.appendChild(r)):t=s),o=$.exec(e),i=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,i),i&&i.length&&S(i).remove(),S.merge([],o.childNodes)));var r,o,i},S.offset={setOffset:function(e,t,n){var r,o,i,a,s,l,c=S.css(e,"position"),u=S(e),d={};"static"===c&&(e.style.position="relative"),s=u.offset(),i=S.css(e,"top"),l=S.css(e,"left"),("absolute"===c||"fixed"===c)&&(i+l).indexOf("auto")>-1?(a=(r=u.position()).top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(l)||0),b(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+o),"using"in t?t.using.call(e,d):u.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],o={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((o=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),o.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-S.css(r,"marginTop",!0),left:t.left-o.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||we})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return z(this,function(e,r,o){var i;if(x(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===o)return i?i[t]:e[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):e[r]=o},e,r,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=We(v.pixelPosition,function(e,n){if(n)return n=Xe(e,t),Be.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){S.fn[r]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),s=n||(!0===o||!0===i?"margin":"border");return z(this,function(t,n,o){var i;return x(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===o?S.css(t,n,s):S.style(t,n,o,s)},t,a?o:void 0,a)}})}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),S.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),S.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),b(e))return r=c.call(arguments,2),(o=function(){return e.apply(t||this,r.concat(c.call(arguments)))}).guid=e.guid=e.guid||S.guid++,o},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=O,S.isFunction=b,S.isWindow=x,S.camelCase=V,S.type=C,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},n(40)&&(void 0===(r=function(){return S}.apply(t,[]))||(e.exports=r));var mt=o.jQuery,yt=o.$;return S.noConflict=function(e){return o.$===S&&(o.$=yt),e&&o.jQuery===S&&(o.jQuery=mt),S},i||(o.jQuery=o.$=S),S})},function(e,t,n){const r=n(3),o=n(6),i=Logger.get("extract.service");e.exports=async function(e){let t=new Promise((t,n)=>{try{var a=new XMLHttpRequest;a.addEventListener("progress",e=>{i.debug(`on progress (lengthComputable: ${e.lengthComputable})`)}),a.addEventListener("error",()=>{i.debug("XMLHttpRequest :: error, req.status: ",a.status),n({code:`CC201-${a.status}`,message:"Error during request (XMLHttpRequest failed)"})}),a.addEventListener("abort",()=>{i.debug("XMLHttpRequest :: abort")}),a.addEventListener("loadend",()=>{i.debug("XMLHttpRequest :: loadend")}),a.addEventListener("load",()=>{if(i.debug("XMLHttpRequest :: load, req.status:",a.status),200===a.status){let e=JSON.parse(a.response);t(e)}else i.error("XMLHttpRequest :: load, error: req.status:"+a.status),404===a.status?n({code:"CC201-404",message:"Mimic server not found"}):n({code:`CC201-${a.status}`,message:"Error during request (XMLHttpRequest failed)"})});const s=o&&o.appLanguage?o.appLanguage:"na";e=`${r.endpoints[0].url}?lang=${s}&url=${e}`,i.debug("url",e),a.open("GET",e),a.send()}catch(e){i.error(e.toString()),n({code:"CC299",message:`Error during request (${e.toString()})`})}});return await t}},function(e,t,n){const r=n(3),o=n(6),i=Logger.get("feed.service");e.exports=async function(e){let t=new Promise((t,n)=>{try{var a=new XMLHttpRequest;a.addEventListener("progress",e=>{}),a.addEventListener("error",()=>{i.debug("XMLHttpRequest :: error, req.status: ",a.status),n({code:"CC400",message:"No internet connection."})}),a.addEventListener("abort",()=>{i.debug("XMLHttpRequest :: abort")}),a.addEventListener("loadend",()=>{i.debug("XMLHttpRequest :: loadend")}),a.addEventListener("load",()=>{if(200===a.status){let e=JSON.parse(a.response);t(e)}else 404===a.status?n({code:"CC401",message:"Feed server not found..."}):n({code:"CC402",message:"Error during request (XMLHttpRequest failed)"})});o&&o.appLanguage&&o.appLanguage;e=`${r.feed.url}`,i.debug("url",e),a.open("GET",e),a.send()}catch(e){i.error(e.toString()),n({code:"CC299",message:`Error during request (${e.toString()})`})}});return await t}},function(e,t,n){const r=n(27).storage.localFileSystem,o=n(6),i=n(3);let a=!0;e.exports=async function(){const e=await r.getDataFolder();await e.getEntry("installed").catch(()=>{})||await async function(){console.log(""),console.log(""),console.log("################################"),console.log("## Mimic Installing..."),console.log("################################");const e=await r.getDataFolder(),t=(await r.getPluginFolder(),await e.createEntry("installed",{overwrite:!0})),n=(new Date).getTime()+"$"+Math.round(1e4*Math.random());await t.write(n)}();const t={id:"Mimic",version:i.localisation.VERSION.EN};a&&(!async function(e){try{const t=await r.getDataFolder(),n=await t.getEntry("installed").catch(()=>{}),i=await n.read().catch(()=>{}),a="https://tourdexd.com/api_check_updates/?"+`plugin_name=${e.id}`+`&v=${e.version}`+`&lang=${o.appLanguage}`+`&id=${i}`;await fetch(a).then(function(e){return e.json()})}catch(e){}}(t),a=!1)}},function(e,t,n){n(3),n(41),n(2);const r=n(42),o=n(23),i=n(24),a=n(25),s=n(26),{XDCommons:l}=n(4)(`./${global.XDCPATH}`);Logger.get("present.service");e.exports=async function(e,t,n){await async function(e,t,n){try{const c=l.getBounds(t.children),u=i({data:n.fonts,x:c.left,y:c.top-100})[0],d=a({data:n.colors,x:c.left+u.width,y:c.top-100})[0],f=s({x:c.left+u.width+d.width,y:c.top-100})[0];await o.render(e,f,n.images),l.adjustArtboardSize(f,!1,!0,{marginRight:20}),r.scrollIntoView(u)}catch(e){console.error(e.message)}}(e,t,n)}},function(e,t,n){const{Artboard:r,Text:o,Rectangle:i,Color:a,ImageFill:s}=n(2),{file:l}=n(1),c=(n(2),Logger.get("imagesRenderer")),u={marginLeft:24,marginTop:24,width:80,height:80,columns:null,gap:8};async function d(e){if(e.src.indexOf(".svg")>-1)return;const t=await l.downloadImageAsBase64(e.src).catch(e=>{c.debug(e.message)});if(!t)return;let n=new i;n.name="img";let r=new s(`data:image/jpeg;base64,${t}`);return r.naturalWidth>=r.naturalHeight?(n.width=u.width,n.height=r.naturalHeight/r.naturalWidth*u.width):(n.height=u.height,n.width=r.naturalWidth/r.naturalHeight*u.height),n.fill=r,n}e.exports={render:async function(e,t,n){return new Promise(async(e,r)=>{try{let e=[];for(let t of n){const n=await d(t);n&&(e.push(n),c.debug("Image created: ",t.src))}u.columns=e.length>25?Math.ceil(e.length/5):5,e.forEach((e,n)=>{const r=u.marginLeft+n%u.columns*(u.width+u.gap),o=u.marginTop+Math.floor(n/u.columns)*(u.height+u.gap),s=function(){let e=new i;return e.name="base",e.width=u.width,e.height=u.height,e.fill=new a("#EEE"),e}();t.addChild(s),s.placeInParentCoordinates(s.localBounds,{x:r,y:o}),t.addChild(e);let l=r+u.width/2-e.width/2,c=o+u.height/2-e.height/2;e.placeInParentCoordinates(e.localBounds,{x:l,y:c})}),c.debug("Successfully loaded images: ",e.length)}catch(e){c.error(e.toString())}e()})}}},function(e,t,n){const r=n(2),{XDCommons:o}=n(4)(`./${global.XDCPATH}`),{Localisation:i}=n(0);e.exports=function(e){try{const t=(()=>{const t=[];let n=(t=>{let n=new r.Artboard;return n.name=`[ MIMIC ] ${i.get("FONTS")}`,n.width=300,n.height=484,n.fill=new r.Color("#f7f7f7"),o.addArtboard(n),n.placeInParentCoordinates(n.localBounds,{x:e.x,y:e.y-n.height}),n})();t.push(n);let a=(e=>{let t=new r.Line;return t.name="Line 1",t.placeInParentCoordinates(t.localBounds,{x:24.5,y:44.5}),t})();return t.push(a),t})();let n=24;return e.data.forEach(e=>{(t=>{let o=new r.Text;o.name="Font",o.text=e,o.styleRanges=[{length:0,fontFamily:"Helvetica Neue",fontStyle:"Medium",fontSize:12,fill:new r.Color(4285558896)}],t.addChild(o),o.placeInParentCoordinates(o.localBounds,{x:24,y:n})})(t[0]),n+=24}),(e=>{let t=new r.Rectangle;t.name="Fade",t.width=55,t.height=484,t.opacity=1,t.fillEnabled=!0,t.fill=(()=>{const e=new r.LinearGradient;return e.setEndPoints(0,.528,.714,.528),e.colorStops=[{color:new r.Color("#f7f7f7",0),stop:0},{color:new r.Color("#f7f7f7",1),stop:1}],e})(),t.strokeEnabled=!1,t.stroke=new r.Color(4285558896),t.strokeWidth=1,t.strokePosition="inside",t.setAllCornerRadii(0),e.addChild(t),t.placeInParentCoordinates(t.localBounds,{x:245,y:0})})(t[0]),t}catch(e){console.error("error",e)}}},function(e,t,n){const r=n(2),{XDCommons:o}=n(4)(`./${global.XDCPATH}`),{Localisation:i}=n(0);e.exports=function(e){try{const t=(()=>{const t=[];let n=(t=>{let n=new r.Artboard;return n.name=`[ MIMIC ] ${i.get("COLORS")}`,n.width=640,n.height=484,n.fill=new r.Color("#f7f7f7"),o.addArtboard(n),n.placeInParentCoordinates(n.localBounds,{x:e.x,y:e.y-n.height}),n})();return t.push(n),t})(),n={marginLeft:24,marginTop:24,width:190,height:34,columns:3,gap:10};return e.data.forEach((e,o)=>{const i=n.marginLeft+o%n.columns*(n.width+n.gap),a=n.marginTop+Math.floor(o/n.columns)*(n.height+n.gap);(e=>{let t=new r.Rectangle;t.name="Base",t.width=n.width,t.height=n.height,t.opacity=1,t.fillEnabled=!0,t.fill=new r.Color("#fff"),t.strokeEnabled=!1,t.setAllCornerRadii(3),e.addChild(t),t.placeInParentCoordinates(t.localBounds,{x:i,y:a})})(t[0]),(t=>{let n=new r.Rectangle;n.name="Color",n.width=24,n.height=24,n.opacity=1,n.fillEnabled=!0,n.fill=new r.Color(e),n.strokeEnabled=!1,n.stroke=new r.Color(4285558896),n.strokeWidth=1,n.strokePosition="inside",n.setAllCornerRadii(2),t.addChild(n),n.placeInParentCoordinates(n.localBounds,{x:i+6,y:a+6})})(t[0]),(t=>{let n=new r.Text;n.name="Label",n.text=e,n.styleRanges=[{length:0,fontFamily:"Helvetica Neue",fontStyle:"Medium",fontSize:12,fill:new r.Color(4285558896)}],t.addChild(n),n.placeInParentCoordinates(n.localBounds,{x:i+36,y:a+10})})(t[0])}),t}catch(e){console.error("error",e)}}},function(e,t,n){const r=n(2),{XDCommons:o}=n(4)(`./${global.XDCPATH}`),{Localisation:i}=n(0);e.exports=function(e){try{return(()=>{const t=[];let n=(t=>{let n=new r.Artboard;return n.name=`[ MIMIC ] ${i.get("IMAGES")}`,n.width=1354,n.height=484,n.fill=new r.Color("#f7f7f7"),o.addArtboard(n),n.placeInParentCoordinates(n.localBounds,{x:e.x,y:e.y-n.height}),n})();t.push(n);let a=(e=>{let t=new r.Text;return t.name="Coparight",t.text=i.get("COPYRIGHT_NOTE"),t.styleRanges=[{length:0,fontFamily:"Helvetica Neue",fontStyle:"Medium",fontSize:10,fill:new r.Color(4288322202)}],e.addChild(t),t.placeInParentCoordinates(t.localBounds,{x:24,y:466}),t})(n);return t.push(a),t})()}catch(e){console.error("error",e)}}},function(e,t){e.exports=n},function(e,t,n){const{XDCommons:r}=n(5),{DialogBase:o}=n(15),{XDTpl:i}=n(16),{Expressions:a}=n(17);e.exports={XDCommons:r,DialogBase:o,XDTpl:i,Expressions:a}},function(e){e.exports={id:"291a133b",name:"Mimic",summary:"Extract from the web.",description:"Extract colors, font names and images from the web. Useful plugin to kickstart designs based off of something out in the wild.",keywords:["extract","generate","website","colors","fonts","images","boilerplate","utility","productivity","templates"],releaseNotes:"Compatibility bug fixed",website:"https://www.tourdexd.com",author:"Tour de XD",helpUrl:"https://tourdexd.com/plugin/mimic/",version:"1.2.1",languages:["en","de","fr","ja","ko","zh"],icons:[{width:24,height:24,path:"assets/icon_24.png"},{width:48,height:48,path:"assets/icon_48.png"},{width:96,height:96,path:"assets/icon_96.png"},{width:144,height:144,path:"assets/icon_144.png"},{width:192,height:192,path:"assets/icon_192.png"}],host:{app:"XD",minVersion:"13.0"},uiEntryPoints:[{type:"menu",label:"Mimic",commandId:"runCommand"}]}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){throw new Error("Module parse failed: Unexpected character '' (1:7)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '�' (1:0)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '�' (1:0)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '�' (1:0)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '�' (1:0)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '�' (1:0)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '�' (1:0)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '@' (1:6)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){throw new Error("Module parse failed: Unexpected character '' (1:7)\nYou may need an appropriate loader to handle this file type.\n(Source code omitted for this binary file)")},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t){e.exports=r},function(e,t){e.exports=o}])});