jquery-ui.min.js 334 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195
  1. /*! jQuery UI - v1.11.2 - 2014-10-16
  2. * http://jqueryui.com
  3. * Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
  4. * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
  5. (function (e) {
  6. "function" == typeof define && define.amd ? define(["jquery"], e) : e(jQuery)
  7. })(function (e) {
  8. function t(t, s) {
  9. var n, a, o, r = t.nodeName.toLowerCase();
  10. return "area" === r ? (n = t.parentNode, a = n.name, t.href && a && "map" === n.nodeName.toLowerCase() ? (o = e("img[usemap='#" + a + "']")[0], !!o && i(o)) : !1) : (/input|select|textarea|button|object/.test(r) ? !t.disabled : "a" === r ? t.href || s : s) && i(t)
  11. }
  12. function i(t) {
  13. return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function () {
  14. return "hidden" === e.css(this, "visibility")
  15. }).length
  16. }
  17. function s(e) {
  18. for (var t, i; e.length && e[0] !== document;) {
  19. if (t = e.css("position"), ("absolute" === t || "relative" === t || "fixed" === t) && (i = parseInt(e.css("zIndex"), 10), !isNaN(i) && 0 !== i)) return i;
  20. e = e.parent()
  21. }
  22. return 0
  23. }
  24. function n() {
  25. this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = "ui-datepicker-div", this._inlineClass = "ui-datepicker-inline", this._appendClass = "ui-datepicker-append", this._triggerClass = "ui-datepicker-trigger", this._dialogClass = "ui-datepicker-dialog", this._disableClass = "ui-datepicker-disabled", this._unselectableClass = "ui-datepicker-unselectable", this._currentClass = "ui-datepicker-current-day", this._dayOverClass = "ui-datepicker-days-cell-over", this.regional = [], this.regional[""] = {
  26. closeText: "Done",
  27. prevText: "Prev",
  28. nextText: "Next",
  29. currentText: "Today",
  30. monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  31. monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  32. dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  33. dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  34. dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  35. weekHeader: "Wk",
  36. dateFormat: "mm/dd/yy",
  37. firstDay: 0,
  38. isRTL: !1,
  39. showMonthAfterYear: !1,
  40. yearSuffix: ""
  41. }, this._defaults = {
  42. showOn: "focus",
  43. showAnim: "fadeIn",
  44. showOptions: {},
  45. defaultDate: null,
  46. appendText: "",
  47. buttonText: "...",
  48. buttonImage: "",
  49. buttonImageOnly: !1,
  50. hideIfNoPrevNext: !1,
  51. navigationAsDateFormat: !1,
  52. gotoCurrent: !1,
  53. changeMonth: !1,
  54. changeYear: !1,
  55. yearRange: "c-10:c+10",
  56. showOtherMonths: !1,
  57. selectOtherMonths: !1,
  58. showWeek: !1,
  59. calculateWeek: this.iso8601Week,
  60. shortYearCutoff: "+10",
  61. minDate: null,
  62. maxDate: null,
  63. duration: "fast",
  64. beforeShowDay: null,
  65. beforeShow: null,
  66. onSelect: null,
  67. onChangeMonthYear: null,
  68. onClose: null,
  69. numberOfMonths: 1,
  70. showCurrentAtPos: 0,
  71. stepMonths: 1,
  72. stepBigMonths: 12,
  73. altField: "",
  74. altFormat: "",
  75. constrainInput: !0,
  76. showButtonPanel: !1,
  77. autoSize: !1,
  78. disabled: !1
  79. }, e.extend(this._defaults, this.regional[""]), this.regional.en = e.extend(!0, {}, this.regional[""]), this.regional["en-US"] = e.extend(!0, {}, this.regional.en), this.dpDiv = a(e("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))
  80. }
  81. function a(t) {
  82. var i = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
  83. return t.delegate(i, "mouseout", function () {
  84. e(this).removeClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).removeClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).removeClass("ui-datepicker-next-hover")
  85. }).delegate(i, "mouseover", o)
  86. }
  87. function o() {
  88. e.datepicker._isDisabledDatepicker(v.inline ? v.dpDiv.parent()[0] : v.input[0]) || (e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), e(this).addClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).addClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).addClass("ui-datepicker-next-hover"))
  89. }
  90. function r(t, i) {
  91. e.extend(t, i);
  92. for (var s in i) null == i[s] && (t[s] = i[s]);
  93. return t
  94. }
  95. function h(e) {
  96. return function () {
  97. var t = this.element.val();
  98. e.apply(this, arguments), this._refresh(), t !== this.element.val() && this._trigger("change")
  99. }
  100. }
  101. e.ui = e.ui || {}, e.extend(e.ui, {
  102. version: "1.11.2",
  103. keyCode: {
  104. BACKSPACE: 8,
  105. COMMA: 188,
  106. DELETE: 46,
  107. DOWN: 40,
  108. END: 35,
  109. ENTER: 13,
  110. ESCAPE: 27,
  111. HOME: 36,
  112. LEFT: 37,
  113. PAGE_DOWN: 34,
  114. PAGE_UP: 33,
  115. PERIOD: 190,
  116. RIGHT: 39,
  117. SPACE: 32,
  118. TAB: 9,
  119. UP: 38
  120. }
  121. }), e.fn.extend({
  122. scrollParent: function (t) {
  123. var i = this.css("position"), s = "absolute" === i, n = t ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
  124. a = this.parents().filter(function () {
  125. var t = e(this);
  126. return s && "static" === t.css("position") ? !1 : n.test(t.css("overflow") + t.css("overflow-y") + t.css("overflow-x"))
  127. }).eq(0);
  128. return "fixed" !== i && a.length ? a : e(this[0].ownerDocument || document)
  129. }, uniqueId: function () {
  130. var e = 0;
  131. return function () {
  132. return this.each(function () {
  133. this.id || (this.id = "ui-id-" + ++e)
  134. })
  135. }
  136. }(), removeUniqueId: function () {
  137. return this.each(function () {
  138. /^ui-id-\d+$/.test(this.id) && e(this).removeAttr("id")
  139. })
  140. }
  141. }), e.extend(e.expr[":"], {
  142. data: e.expr.createPseudo ? e.expr.createPseudo(function (t) {
  143. return function (i) {
  144. return !!e.data(i, t)
  145. }
  146. }) : function (t, i, s) {
  147. return !!e.data(t, s[3])
  148. }, focusable: function (i) {
  149. return t(i, !isNaN(e.attr(i, "tabindex")))
  150. }, tabbable: function (i) {
  151. var s = e.attr(i, "tabindex"), n = isNaN(s);
  152. return (n || s >= 0) && t(i, !n)
  153. }
  154. }), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function (t, i) {
  155. function s(t, i, s, a) {
  156. return e.each(n, function () {
  157. i -= parseFloat(e.css(t, "padding" + this)) || 0, s && (i -= parseFloat(e.css(t, "border" + this + "Width")) || 0), a && (i -= parseFloat(e.css(t, "margin" + this)) || 0)
  158. }), i
  159. }
  160. var n = "Width" === i ? ["Left", "Right"] : ["Top", "Bottom"], a = i.toLowerCase(), o = {
  161. innerWidth: e.fn.innerWidth,
  162. innerHeight: e.fn.innerHeight,
  163. outerWidth: e.fn.outerWidth,
  164. outerHeight: e.fn.outerHeight
  165. };
  166. e.fn["inner" + i] = function (t) {
  167. return void 0 === t ? o["inner" + i].call(this) : this.each(function () {
  168. e(this).css(a, s(this, t) + "px")
  169. })
  170. }, e.fn["outer" + i] = function (t, n) {
  171. return "number" != typeof t ? o["outer" + i].call(this, t) : this.each(function () {
  172. e(this).css(a, s(this, t, !0, n) + "px")
  173. })
  174. }
  175. }), e.fn.addBack || (e.fn.addBack = function (e) {
  176. return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
  177. }), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function (t) {
  178. return function (i) {
  179. return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this)
  180. }
  181. }(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.fn.extend({
  182. focus: function (t) {
  183. return function (i, s) {
  184. return "number" == typeof i ? this.each(function () {
  185. var t = this;
  186. setTimeout(function () {
  187. e(t).focus(), s && s.call(t)
  188. }, i)
  189. }) : t.apply(this, arguments)
  190. }
  191. }(e.fn.focus), disableSelection: function () {
  192. var e = "onselectstart" in document.createElement("div") ? "selectstart" : "mousedown";
  193. return function () {
  194. return this.bind(e + ".ui-disableSelection", function (e) {
  195. e.preventDefault()
  196. })
  197. }
  198. }(), enableSelection: function () {
  199. return this.unbind(".ui-disableSelection")
  200. }, zIndex: function (t) {
  201. if (void 0 !== t) return this.css("zIndex", t);
  202. if (this.length) for (var i, s, n = e(this[0]); n.length && n[0] !== document;) {
  203. if (i = n.css("position"), ("absolute" === i || "relative" === i || "fixed" === i) && (s = parseInt(n.css("zIndex"), 10), !isNaN(s) && 0 !== s)) return s;
  204. n = n.parent()
  205. }
  206. return 0
  207. }
  208. }), e.ui.plugin = {
  209. add: function (t, i, s) {
  210. var n, a = e.ui[t].prototype;
  211. for (n in s) a.plugins[n] = a.plugins[n] || [], a.plugins[n].push([i, s[n]])
  212. }, call: function (e, t, i, s) {
  213. var n, a = e.plugins[t];
  214. if (a && (s || e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType)) for (n = 0; a.length > n; n++) e.options[a[n][0]] && a[n][1].apply(e.element, i)
  215. }
  216. };
  217. var l = 0, u = Array.prototype.slice;
  218. e.cleanData = function (t) {
  219. return function (i) {
  220. var s, n, a;
  221. for (a = 0; null != (n = i[a]); a++) try {
  222. s = e._data(n, "events"), s && s.remove && e(n).triggerHandler("remove")
  223. } catch (o) {
  224. }
  225. t(i)
  226. }
  227. }(e.cleanData), e.widget = function (t, i, s) {
  228. var n, a, o, r, h = {}, l = t.split(".")[0];
  229. return t = t.split(".")[1], n = l + "-" + t, s || (s = i, i = e.Widget), e.expr[":"][n.toLowerCase()] = function (t) {
  230. return !!e.data(t, n)
  231. }, e[l] = e[l] || {}, a = e[l][t], o = e[l][t] = function (e, t) {
  232. return this._createWidget ? (arguments.length && this._createWidget(e, t), void 0) : new o(e, t)
  233. }, e.extend(o, a, {
  234. version: s.version,
  235. _proto: e.extend({}, s),
  236. _childConstructors: []
  237. }), r = new i, r.options = e.widget.extend({}, r.options), e.each(s, function (t, s) {
  238. return e.isFunction(s) ? (h[t] = function () {
  239. var e = function () {
  240. return i.prototype[t].apply(this, arguments)
  241. }, n = function (e) {
  242. return i.prototype[t].apply(this, e)
  243. };
  244. return function () {
  245. var t, i = this._super, a = this._superApply;
  246. return this._super = e, this._superApply = n, t = s.apply(this, arguments), this._super = i, this._superApply = a, t
  247. }
  248. }(), void 0) : (h[t] = s, void 0)
  249. }), o.prototype = e.widget.extend(r, {widgetEventPrefix: a ? r.widgetEventPrefix || t : t}, h, {
  250. constructor: o,
  251. namespace: l,
  252. widgetName: t,
  253. widgetFullName: n
  254. }), a ? (e.each(a._childConstructors, function (t, i) {
  255. var s = i.prototype;
  256. e.widget(s.namespace + "." + s.widgetName, o, i._proto)
  257. }), delete a._childConstructors) : i._childConstructors.push(o), e.widget.bridge(t, o), o
  258. }, e.widget.extend = function (t) {
  259. for (var i, s, n = u.call(arguments, 1), a = 0, o = n.length; o > a; a++) for (i in n[a]) s = n[a][i], n[a].hasOwnProperty(i) && void 0 !== s && (t[i] = e.isPlainObject(s) ? e.isPlainObject(t[i]) ? e.widget.extend({}, t[i], s) : e.widget.extend({}, s) : s);
  260. return t
  261. }, e.widget.bridge = function (t, i) {
  262. var s = i.prototype.widgetFullName || t;
  263. e.fn[t] = function (n) {
  264. var a = "string" == typeof n, o = u.call(arguments, 1), r = this;
  265. return n = !a && o.length ? e.widget.extend.apply(null, [n].concat(o)) : n, a ? this.each(function () {
  266. var i, a = e.data(this, s);
  267. return "instance" === n ? (r = a, !1) : a ? e.isFunction(a[n]) && "_" !== n.charAt(0) ? (i = a[n].apply(a, o), i !== a && void 0 !== i ? (r = i && i.jquery ? r.pushStack(i.get()) : i, !1) : void 0) : e.error("no such method '" + n + "' for " + t + " widget instance") : e.error("cannot call methods on " + t + " prior to initialization; " + "attempted to call method '" + n + "'")
  268. }) : this.each(function () {
  269. var t = e.data(this, s);
  270. t ? (t.option(n || {}), t._init && t._init()) : e.data(this, s, new i(n, this))
  271. }), r
  272. }
  273. }, e.Widget = function () {
  274. }, e.Widget._childConstructors = [], e.Widget.prototype = {
  275. widgetName: "widget",
  276. widgetEventPrefix: "",
  277. defaultElement: "<div>",
  278. options: {disabled: !1, create: null},
  279. _createWidget: function (t, i) {
  280. i = e(i || this.defaultElement || this)[0], this.element = e(i), this.uuid = l++, this.eventNamespace = "." + this.widgetName + this.uuid, this.bindings = e(), this.hoverable = e(), this.focusable = e(), i !== this && (e.data(i, this.widgetFullName, this), this._on(!0, this.element, {
  281. remove: function (e) {
  282. e.target === i && this.destroy()
  283. }
  284. }), this.document = e(i.style ? i.ownerDocument : i.document || i), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init()
  285. },
  286. _getCreateOptions: e.noop,
  287. _getCreateEventData: e.noop,
  288. _create: e.noop,
  289. _init: e.noop,
  290. destroy: function () {
  291. this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")
  292. },
  293. _destroy: e.noop,
  294. widget: function () {
  295. return this.element
  296. },
  297. option: function (t, i) {
  298. var s, n, a, o = t;
  299. if (0 === arguments.length) return e.widget.extend({}, this.options);
  300. if ("string" == typeof t) if (o = {}, s = t.split("."), t = s.shift(), s.length) {
  301. for (n = o[t] = e.widget.extend({}, this.options[t]), a = 0; s.length - 1 > a; a++) n[s[a]] = n[s[a]] || {}, n = n[s[a]];
  302. if (t = s.pop(), 1 === arguments.length) return void 0 === n[t] ? null : n[t];
  303. n[t] = i
  304. } else {
  305. if (1 === arguments.length) return void 0 === this.options[t] ? null : this.options[t];
  306. o[t] = i
  307. }
  308. return this._setOptions(o), this
  309. },
  310. _setOptions: function (e) {
  311. var t;
  312. for (t in e) this._setOption(t, e[t]);
  313. return this
  314. },
  315. _setOption: function (e, t) {
  316. return this.options[e] = t, "disabled" === e && (this.widget().toggleClass(this.widgetFullName + "-disabled", !!t), t && (this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus"))), this
  317. },
  318. enable: function () {
  319. return this._setOptions({disabled: !1})
  320. },
  321. disable: function () {
  322. return this._setOptions({disabled: !0})
  323. },
  324. _on: function (t, i, s) {
  325. var n, a = this;
  326. "boolean" != typeof t && (s = i, i = t, t = !1), s ? (i = n = e(i), this.bindings = this.bindings.add(i)) : (s = i, i = this.element, n = this.widget()), e.each(s, function (s, o) {
  327. function r() {
  328. return t || a.options.disabled !== !0 && !e(this).hasClass("ui-state-disabled") ? ("string" == typeof o ? a[o] : o).apply(a, arguments) : void 0
  329. }
  330. "string" != typeof o && (r.guid = o.guid = o.guid || r.guid || e.guid++);
  331. var h = s.match(/^([\w:-]*)\s*(.*)$/), l = h[1] + a.eventNamespace, u = h[2];
  332. u ? n.delegate(u, l, r) : i.bind(l, r)
  333. })
  334. },
  335. _off: function (t, i) {
  336. i = (i || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, t.unbind(i).undelegate(i), this.bindings = e(this.bindings.not(t).get()), this.focusable = e(this.focusable.not(t).get()), this.hoverable = e(this.hoverable.not(t).get())
  337. },
  338. _delay: function (e, t) {
  339. function i() {
  340. return ("string" == typeof e ? s[e] : e).apply(s, arguments)
  341. }
  342. var s = this;
  343. return setTimeout(i, t || 0)
  344. },
  345. _hoverable: function (t) {
  346. this.hoverable = this.hoverable.add(t), this._on(t, {
  347. mouseenter: function (t) {
  348. e(t.currentTarget).addClass("ui-state-hover")
  349. }, mouseleave: function (t) {
  350. e(t.currentTarget).removeClass("ui-state-hover")
  351. }
  352. })
  353. },
  354. _focusable: function (t) {
  355. this.focusable = this.focusable.add(t), this._on(t, {
  356. focusin: function (t) {
  357. e(t.currentTarget).addClass("ui-state-focus")
  358. }, focusout: function (t) {
  359. e(t.currentTarget).removeClass("ui-state-focus")
  360. }
  361. })
  362. },
  363. _trigger: function (t, i, s) {
  364. var n, a, o = this.options[t];
  365. if (s = s || {}, i = e.Event(i), i.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), i.target = this.element[0], a = i.originalEvent) for (n in a) n in i || (i[n] = a[n]);
  366. return this.element.trigger(i, s), !(e.isFunction(o) && o.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented())
  367. }
  368. }, e.each({show: "fadeIn", hide: "fadeOut"}, function (t, i) {
  369. e.Widget.prototype["_" + t] = function (s, n, a) {
  370. "string" == typeof n && (n = {effect: n});
  371. var o, r = n ? n === !0 || "number" == typeof n ? i : n.effect || i : t;
  372. n = n || {}, "number" == typeof n && (n = {duration: n}), o = !e.isEmptyObject(n), n.complete = a, n.delay && s.delay(n.delay), o && e.effects && e.effects.effect[r] ? s[t](n) : r !== t && s[r] ? s[r](n.duration, n.easing, a) : s.queue(function (i) {
  373. e(this)[t](), a && a.call(s[0]), i()
  374. })
  375. }
  376. }), e.widget;
  377. var d = !1;
  378. e(document).mouseup(function () {
  379. d = !1
  380. }), e.widget("ui.mouse", {
  381. version: "1.11.2",
  382. options: {cancel: "input,textarea,button,select,option", distance: 1, delay: 0},
  383. _mouseInit: function () {
  384. var t = this;
  385. this.element.bind("mousedown." + this.widgetName, function (e) {
  386. return t._mouseDown(e)
  387. }).bind("click." + this.widgetName, function (i) {
  388. return !0 === e.data(i.target, t.widgetName + ".preventClickEvent") ? (e.removeData(i.target, t.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1) : void 0
  389. }), this.started = !1
  390. },
  391. _mouseDestroy: function () {
  392. this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
  393. },
  394. _mouseDown: function (t) {
  395. if (!d) {
  396. this._mouseMoved = !1, this._mouseStarted && this._mouseUp(t), this._mouseDownEvent = t;
  397. var i = this, s = 1 === t.which,
  398. n = "string" == typeof this.options.cancel && t.target.nodeName ? e(t.target).closest(this.options.cancel).length : !1;
  399. return s && !n && this._mouseCapture(t) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () {
  400. i.mouseDelayMet = !0
  401. }, this.options.delay)), this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(t) !== !1, !this._mouseStarted) ? (t.preventDefault(), !0) : (!0 === e.data(t.target, this.widgetName + ".preventClickEvent") && e.removeData(t.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (e) {
  402. return i._mouseMove(e)
  403. }, this._mouseUpDelegate = function (e) {
  404. return i._mouseUp(e)
  405. }, this.document.bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), t.preventDefault(), d = !0, !0)) : !0
  406. }
  407. },
  408. _mouseMove: function (t) {
  409. if (this._mouseMoved) {
  410. if (e.ui.ie && (!document.documentMode || 9 > document.documentMode) && !t.button) return this._mouseUp(t);
  411. if (!t.which) return this._mouseUp(t)
  412. }
  413. return (t.which || t.button) && (this._mouseMoved = !0), this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted)
  414. },
  415. _mouseUp: function (t) {
  416. return this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), d = !1, !1
  417. },
  418. _mouseDistanceMet: function (e) {
  419. return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance
  420. },
  421. _mouseDelayMet: function () {
  422. return this.mouseDelayMet
  423. },
  424. _mouseStart: function () {
  425. },
  426. _mouseDrag: function () {
  427. },
  428. _mouseStop: function () {
  429. },
  430. _mouseCapture: function () {
  431. return !0
  432. }
  433. }), function () {
  434. function t(e, t, i) {
  435. return [parseFloat(e[0]) * (p.test(e[0]) ? t / 100 : 1), parseFloat(e[1]) * (p.test(e[1]) ? i / 100 : 1)]
  436. }
  437. function i(t, i) {
  438. return parseInt(e.css(t, i), 10) || 0
  439. }
  440. function s(t) {
  441. var i = t[0];
  442. return 9 === i.nodeType ? {
  443. width: t.width(),
  444. height: t.height(),
  445. offset: {top: 0, left: 0}
  446. } : e.isWindow(i) ? {
  447. width: t.width(),
  448. height: t.height(),
  449. offset: {top: t.scrollTop(), left: t.scrollLeft()}
  450. } : i.preventDefault ? {
  451. width: 0,
  452. height: 0,
  453. offset: {top: i.pageY, left: i.pageX}
  454. } : {width: t.outerWidth(), height: t.outerHeight(), offset: t.offset()}
  455. }
  456. e.ui = e.ui || {};
  457. var n, a, o = Math.max, r = Math.abs, h = Math.round, l = /left|center|right/, u = /top|center|bottom/,
  458. d = /[\+\-]\d+(\.[\d]+)?%?/, c = /^\w+/, p = /%$/, f = e.fn.position;
  459. e.position = {
  460. scrollbarWidth: function () {
  461. if (void 0 !== n) return n;
  462. var t, i,
  463. s = e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),
  464. a = s.children()[0];
  465. return e("body").append(s), t = a.offsetWidth, s.css("overflow", "scroll"), i = a.offsetWidth, t === i && (i = s[0].clientWidth), s.remove(), n = t - i
  466. }, getScrollInfo: function (t) {
  467. var i = t.isWindow || t.isDocument ? "" : t.element.css("overflow-x"),
  468. s = t.isWindow || t.isDocument ? "" : t.element.css("overflow-y"),
  469. n = "scroll" === i || "auto" === i && t.width < t.element[0].scrollWidth,
  470. a = "scroll" === s || "auto" === s && t.height < t.element[0].scrollHeight;
  471. return {width: a ? e.position.scrollbarWidth() : 0, height: n ? e.position.scrollbarWidth() : 0}
  472. }, getWithinInfo: function (t) {
  473. var i = e(t || window), s = e.isWindow(i[0]), n = !!i[0] && 9 === i[0].nodeType;
  474. return {
  475. element: i,
  476. isWindow: s,
  477. isDocument: n,
  478. offset: i.offset() || {left: 0, top: 0},
  479. scrollLeft: i.scrollLeft(),
  480. scrollTop: i.scrollTop(),
  481. width: s || n ? i.width() : i.outerWidth(),
  482. height: s || n ? i.height() : i.outerHeight()
  483. }
  484. }
  485. }, e.fn.position = function (n) {
  486. if (!n || !n.of) return f.apply(this, arguments);
  487. n = e.extend({}, n);
  488. var p, m, g, v, y, b, _ = e(n.of), x = e.position.getWithinInfo(n.within), w = e.position.getScrollInfo(x),
  489. k = (n.collision || "flip").split(" "), T = {};
  490. return b = s(_), _[0].preventDefault && (n.at = "left top"), m = b.width, g = b.height, v = b.offset, y = e.extend({}, v), e.each(["my", "at"], function () {
  491. var e, t, i = (n[this] || "").split(" ");
  492. 1 === i.length && (i = l.test(i[0]) ? i.concat(["center"]) : u.test(i[0]) ? ["center"].concat(i) : ["center", "center"]), i[0] = l.test(i[0]) ? i[0] : "center", i[1] = u.test(i[1]) ? i[1] : "center", e = d.exec(i[0]), t = d.exec(i[1]), T[this] = [e ? e[0] : 0, t ? t[0] : 0], n[this] = [c.exec(i[0])[0], c.exec(i[1])[0]]
  493. }), 1 === k.length && (k[1] = k[0]), "right" === n.at[0] ? y.left += m : "center" === n.at[0] && (y.left += m / 2), "bottom" === n.at[1] ? y.top += g : "center" === n.at[1] && (y.top += g / 2), p = t(T.at, m, g), y.left += p[0], y.top += p[1], this.each(function () {
  494. var s, l, u = e(this), d = u.outerWidth(), c = u.outerHeight(), f = i(this, "marginLeft"),
  495. b = i(this, "marginTop"), D = d + f + i(this, "marginRight") + w.width,
  496. S = c + b + i(this, "marginBottom") + w.height, M = e.extend({}, y),
  497. C = t(T.my, u.outerWidth(), u.outerHeight());
  498. "right" === n.my[0] ? M.left -= d : "center" === n.my[0] && (M.left -= d / 2), "bottom" === n.my[1] ? M.top -= c : "center" === n.my[1] && (M.top -= c / 2), M.left += C[0], M.top += C[1], a || (M.left = h(M.left), M.top = h(M.top)), s = {
  499. marginLeft: f,
  500. marginTop: b
  501. }, e.each(["left", "top"], function (t, i) {
  502. e.ui.position[k[t]] && e.ui.position[k[t]][i](M, {
  503. targetWidth: m,
  504. targetHeight: g,
  505. elemWidth: d,
  506. elemHeight: c,
  507. collisionPosition: s,
  508. collisionWidth: D,
  509. collisionHeight: S,
  510. offset: [p[0] + C[0], p[1] + C[1]],
  511. my: n.my,
  512. at: n.at,
  513. within: x,
  514. elem: u
  515. })
  516. }), n.using && (l = function (e) {
  517. var t = v.left - M.left, i = t + m - d, s = v.top - M.top, a = s + g - c, h = {
  518. target: {element: _, left: v.left, top: v.top, width: m, height: g},
  519. element: {element: u, left: M.left, top: M.top, width: d, height: c},
  520. horizontal: 0 > i ? "left" : t > 0 ? "right" : "center",
  521. vertical: 0 > a ? "top" : s > 0 ? "bottom" : "middle"
  522. };
  523. d > m && m > r(t + i) && (h.horizontal = "center"), c > g && g > r(s + a) && (h.vertical = "middle"), h.important = o(r(t), r(i)) > o(r(s), r(a)) ? "horizontal" : "vertical", n.using.call(this, e, h)
  524. }), u.offset(e.extend(M, {using: l}))
  525. })
  526. }, e.ui.position = {
  527. fit: {
  528. left: function (e, t) {
  529. var i, s = t.within, n = s.isWindow ? s.scrollLeft : s.offset.left, a = s.width,
  530. r = e.left - t.collisionPosition.marginLeft, h = n - r, l = r + t.collisionWidth - a - n;
  531. t.collisionWidth > a ? h > 0 && 0 >= l ? (i = e.left + h + t.collisionWidth - a - n, e.left += h - i) : e.left = l > 0 && 0 >= h ? n : h > l ? n + a - t.collisionWidth : n : h > 0 ? e.left += h : l > 0 ? e.left -= l : e.left = o(e.left - r, e.left)
  532. }, top: function (e, t) {
  533. var i, s = t.within, n = s.isWindow ? s.scrollTop : s.offset.top, a = t.within.height,
  534. r = e.top - t.collisionPosition.marginTop, h = n - r, l = r + t.collisionHeight - a - n;
  535. t.collisionHeight > a ? h > 0 && 0 >= l ? (i = e.top + h + t.collisionHeight - a - n, e.top += h - i) : e.top = l > 0 && 0 >= h ? n : h > l ? n + a - t.collisionHeight : n : h > 0 ? e.top += h : l > 0 ? e.top -= l : e.top = o(e.top - r, e.top)
  536. }
  537. }, flip: {
  538. left: function (e, t) {
  539. var i, s, n = t.within, a = n.offset.left + n.scrollLeft, o = n.width,
  540. h = n.isWindow ? n.scrollLeft : n.offset.left, l = e.left - t.collisionPosition.marginLeft,
  541. u = l - h, d = l + t.collisionWidth - o - h,
  542. c = "left" === t.my[0] ? -t.elemWidth : "right" === t.my[0] ? t.elemWidth : 0,
  543. p = "left" === t.at[0] ? t.targetWidth : "right" === t.at[0] ? -t.targetWidth : 0,
  544. f = -2 * t.offset[0];
  545. 0 > u ? (i = e.left + c + p + f + t.collisionWidth - o - a, (0 > i || r(u) > i) && (e.left += c + p + f)) : d > 0 && (s = e.left - t.collisionPosition.marginLeft + c + p + f - h, (s > 0 || d > r(s)) && (e.left += c + p + f))
  546. }, top: function (e, t) {
  547. var i, s, n = t.within, a = n.offset.top + n.scrollTop, o = n.height,
  548. h = n.isWindow ? n.scrollTop : n.offset.top, l = e.top - t.collisionPosition.marginTop,
  549. u = l - h, d = l + t.collisionHeight - o - h, c = "top" === t.my[1],
  550. p = c ? -t.elemHeight : "bottom" === t.my[1] ? t.elemHeight : 0,
  551. f = "top" === t.at[1] ? t.targetHeight : "bottom" === t.at[1] ? -t.targetHeight : 0,
  552. m = -2 * t.offset[1];
  553. 0 > u ? (s = e.top + p + f + m + t.collisionHeight - o - a, e.top + p + f + m > u && (0 > s || r(u) > s) && (e.top += p + f + m)) : d > 0 && (i = e.top - t.collisionPosition.marginTop + p + f + m - h, e.top + p + f + m > d && (i > 0 || d > r(i)) && (e.top += p + f + m))
  554. }
  555. }, flipfit: {
  556. left: function () {
  557. e.ui.position.flip.left.apply(this, arguments), e.ui.position.fit.left.apply(this, arguments)
  558. }, top: function () {
  559. e.ui.position.flip.top.apply(this, arguments), e.ui.position.fit.top.apply(this, arguments)
  560. }
  561. }
  562. }, function () {
  563. var t, i, s, n, o, r = document.getElementsByTagName("body")[0], h = document.createElement("div");
  564. t = document.createElement(r ? "div" : "body"), s = {
  565. visibility: "hidden",
  566. width: 0,
  567. height: 0,
  568. border: 0,
  569. margin: 0,
  570. background: "none"
  571. }, r && e.extend(s, {position: "absolute", left: "-1000px", top: "-1000px"});
  572. for (o in s) t.style[o] = s[o];
  573. t.appendChild(h), i = r || document.documentElement, i.insertBefore(t, i.firstChild), h.style.cssText = "position: absolute; left: 10.7432222px;", n = e(h).offset().left, a = n > 10 && 11 > n, t.innerHTML = "", i.removeChild(t)
  574. }()
  575. }(), e.ui.position, e.widget("ui.accordion", {
  576. version: "1.11.2",
  577. options: {
  578. active: 0,
  579. animate: {},
  580. collapsible: !1,
  581. event: "click",
  582. header: "> li > :first-child,> :not(li):even",
  583. heightStyle: "auto",
  584. icons: {activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e"},
  585. activate: null,
  586. beforeActivate: null
  587. },
  588. hideProps: {
  589. borderTopWidth: "hide",
  590. borderBottomWidth: "hide",
  591. paddingTop: "hide",
  592. paddingBottom: "hide",
  593. height: "hide"
  594. },
  595. showProps: {
  596. borderTopWidth: "show",
  597. borderBottomWidth: "show",
  598. paddingTop: "show",
  599. paddingBottom: "show",
  600. height: "show"
  601. },
  602. _create: function () {
  603. var t = this.options;
  604. this.prevShow = this.prevHide = e(), this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role", "tablist"), t.collapsible || t.active !== !1 && null != t.active || (t.active = 0), this._processPanels(), 0 > t.active && (t.active += this.headers.length), this._refresh()
  605. },
  606. _getCreateEventData: function () {
  607. return {header: this.active, panel: this.active.length ? this.active.next() : e()}
  608. },
  609. _createIcons: function () {
  610. var t = this.options.icons;
  611. t && (e("<span>").addClass("ui-accordion-header-icon ui-icon " + t.header).prependTo(this.headers), this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader), this.headers.addClass("ui-accordion-icons"))
  612. },
  613. _destroyIcons: function () {
  614. this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()
  615. },
  616. _destroy: function () {
  617. var e;
  618. this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"), this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(), this._destroyIcons(), e = this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display", "").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(), "content" !== this.options.heightStyle && e.css("height", "")
  619. },
  620. _setOption: function (e, t) {
  621. return "active" === e ? (this._activate(t), void 0) : ("event" === e && (this.options.event && this._off(this.headers, this.options.event), this._setupEvents(t)), this._super(e, t), "collapsible" !== e || t || this.options.active !== !1 || this._activate(0), "icons" === e && (this._destroyIcons(), t && this._createIcons()), "disabled" === e && (this.element.toggleClass("ui-state-disabled", !!t).attr("aria-disabled", t), this.headers.add(this.headers.next()).toggleClass("ui-state-disabled", !!t)), void 0)
  622. },
  623. _keydown: function (t) {
  624. if (!t.altKey && !t.ctrlKey) {
  625. var i = e.ui.keyCode, s = this.headers.length, n = this.headers.index(t.target), a = !1;
  626. switch (t.keyCode) {
  627. case i.RIGHT:
  628. case i.DOWN:
  629. a = this.headers[(n + 1) % s];
  630. break;
  631. case i.LEFT:
  632. case i.UP:
  633. a = this.headers[(n - 1 + s) % s];
  634. break;
  635. case i.SPACE:
  636. case i.ENTER:
  637. this._eventHandler(t);
  638. break;
  639. case i.HOME:
  640. a = this.headers[0];
  641. break;
  642. case i.END:
  643. a = this.headers[s - 1]
  644. }
  645. a && (e(t.target).attr("tabIndex", -1), e(a).attr("tabIndex", 0), a.focus(), t.preventDefault())
  646. }
  647. },
  648. _panelKeyDown: function (t) {
  649. t.keyCode === e.ui.keyCode.UP && t.ctrlKey && e(t.currentTarget).prev().focus()
  650. },
  651. refresh: function () {
  652. var t = this.options;
  653. this._processPanels(), t.active === !1 && t.collapsible === !0 || !this.headers.length ? (t.active = !1, this.active = e()) : t.active === !1 ? this._activate(0) : this.active.length && !e.contains(this.element[0], this.active[0]) ? this.headers.length === this.headers.find(".ui-state-disabled").length ? (t.active = !1, this.active = e()) : this._activate(Math.max(0, t.active - 1)) : t.active = this.headers.index(this.active), this._destroyIcons(), this._refresh()
  654. },
  655. _processPanels: function () {
  656. var e = this.headers, t = this.panels;
  657. this.headers = this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"), this.panels = this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(), t && (this._off(e.not(this.headers)), this._off(t.not(this.panels)))
  658. },
  659. _refresh: function () {
  660. var t, i = this.options, s = i.heightStyle, n = this.element.parent();
  661. this.active = this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"), this.active.next().addClass("ui-accordion-content-active").show(), this.headers.attr("role", "tab").each(function () {
  662. var t = e(this), i = t.uniqueId().attr("id"), s = t.next(), n = s.uniqueId().attr("id");
  663. t.attr("aria-controls", n), s.attr("aria-labelledby", i)
  664. }).next().attr("role", "tabpanel"), this.headers.not(this.active).attr({
  665. "aria-selected": "false",
  666. "aria-expanded": "false",
  667. tabIndex: -1
  668. }).next().attr({"aria-hidden": "true"}).hide(), this.active.length ? this.active.attr({
  669. "aria-selected": "true",
  670. "aria-expanded": "true",
  671. tabIndex: 0
  672. }).next().attr({"aria-hidden": "false"}) : this.headers.eq(0).attr("tabIndex", 0), this._createIcons(), this._setupEvents(i.event), "fill" === s ? (t = n.height(), this.element.siblings(":visible").each(function () {
  673. var i = e(this), s = i.css("position");
  674. "absolute" !== s && "fixed" !== s && (t -= i.outerHeight(!0))
  675. }), this.headers.each(function () {
  676. t -= e(this).outerHeight(!0)
  677. }), this.headers.next().each(function () {
  678. e(this).height(Math.max(0, t - e(this).innerHeight() + e(this).height()))
  679. }).css("overflow", "auto")) : "auto" === s && (t = 0, this.headers.next().each(function () {
  680. t = Math.max(t, e(this).css("height", "").height())
  681. }).height(t))
  682. },
  683. _activate: function (t) {
  684. var i = this._findActive(t)[0];
  685. i !== this.active[0] && (i = i || this.active[0], this._eventHandler({
  686. target: i,
  687. currentTarget: i,
  688. preventDefault: e.noop
  689. }))
  690. },
  691. _findActive: function (t) {
  692. return "number" == typeof t ? this.headers.eq(t) : e()
  693. },
  694. _setupEvents: function (t) {
  695. var i = {keydown: "_keydown"};
  696. t && e.each(t.split(" "), function (e, t) {
  697. i[t] = "_eventHandler"
  698. }), this._off(this.headers.add(this.headers.next())), this._on(this.headers, i), this._on(this.headers.next(), {keydown: "_panelKeyDown"}), this._hoverable(this.headers), this._focusable(this.headers)
  699. },
  700. _eventHandler: function (t) {
  701. var i = this.options, s = this.active, n = e(t.currentTarget), a = n[0] === s[0], o = a && i.collapsible,
  702. r = o ? e() : n.next(), h = s.next(),
  703. l = {oldHeader: s, oldPanel: h, newHeader: o ? e() : n, newPanel: r};
  704. t.preventDefault(), a && !i.collapsible || this._trigger("beforeActivate", t, l) === !1 || (i.active = o ? !1 : this.headers.index(n), this.active = a ? e() : n, this._toggle(l), s.removeClass("ui-accordion-header-active ui-state-active"), i.icons && s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header), a || (n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"), i.icons && n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader), n.next().addClass("ui-accordion-content-active")))
  705. },
  706. _toggle: function (t) {
  707. var i = t.newPanel, s = this.prevShow.length ? this.prevShow : t.oldPanel;
  708. this.prevShow.add(this.prevHide).stop(!0, !0), this.prevShow = i, this.prevHide = s, this.options.animate ? this._animate(i, s, t) : (s.hide(), i.show(), this._toggleComplete(t)), s.attr({"aria-hidden": "true"}), s.prev().attr("aria-selected", "false"), i.length && s.length ? s.prev().attr({
  709. tabIndex: -1,
  710. "aria-expanded": "false"
  711. }) : i.length && this.headers.filter(function () {
  712. return 0 === e(this).attr("tabIndex")
  713. }).attr("tabIndex", -1), i.attr("aria-hidden", "false").prev().attr({
  714. "aria-selected": "true",
  715. tabIndex: 0,
  716. "aria-expanded": "true"
  717. })
  718. },
  719. _animate: function (e, t, i) {
  720. var s, n, a, o = this, r = 0, h = e.length && (!t.length || e.index() < t.index()),
  721. l = this.options.animate || {}, u = h && l.down || l, d = function () {
  722. o._toggleComplete(i)
  723. };
  724. return "number" == typeof u && (a = u), "string" == typeof u && (n = u), n = n || u.easing || l.easing, a = a || u.duration || l.duration, t.length ? e.length ? (s = e.show().outerHeight(), t.animate(this.hideProps, {
  725. duration: a,
  726. easing: n,
  727. step: function (e, t) {
  728. t.now = Math.round(e)
  729. }
  730. }), e.hide().animate(this.showProps, {
  731. duration: a, easing: n, complete: d, step: function (e, i) {
  732. i.now = Math.round(e), "height" !== i.prop ? r += i.now : "content" !== o.options.heightStyle && (i.now = Math.round(s - t.outerHeight() - r), r = 0)
  733. }
  734. }), void 0) : t.animate(this.hideProps, a, n, d) : e.animate(this.showProps, a, n, d)
  735. },
  736. _toggleComplete: function (e) {
  737. var t = e.oldPanel;
  738. t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"), t.length && (t.parent()[0].className = t.parent()[0].className), this._trigger("activate", null, e)
  739. }
  740. }), e.widget("ui.menu", {
  741. version: "1.11.2",
  742. defaultElement: "<ul>",
  743. delay: 300,
  744. options: {
  745. icons: {submenu: "ui-icon-carat-1-e"},
  746. items: "> *",
  747. menus: "ul",
  748. position: {my: "left-1 top", at: "right top"},
  749. role: "menu",
  750. blur: null,
  751. focus: null,
  752. select: null
  753. },
  754. _create: function () {
  755. this.activeMenu = this.element, this.mouseHandled = !1, this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length).attr({
  756. role: this.options.role,
  757. tabIndex: 0
  758. }), this.options.disabled && this.element.addClass("ui-state-disabled").attr("aria-disabled", "true"), this._on({
  759. "mousedown .ui-menu-item": function (e) {
  760. e.preventDefault()
  761. }, "click .ui-menu-item": function (t) {
  762. var i = e(t.target);
  763. !this.mouseHandled && i.not(".ui-state-disabled").length && (this.select(t), t.isPropagationStopped() || (this.mouseHandled = !0), i.has(".ui-menu").length ? this.expand(t) : !this.element.is(":focus") && e(this.document[0].activeElement).closest(".ui-menu").length && (this.element.trigger("focus", [!0]), this.active && 1 === this.active.parents(".ui-menu").length && clearTimeout(this.timer)))
  764. }, "mouseenter .ui-menu-item": function (t) {
  765. if (!this.previousFilter) {
  766. var i = e(t.currentTarget);
  767. i.siblings(".ui-state-active").removeClass("ui-state-active"), this.focus(t, i)
  768. }
  769. }, mouseleave: "collapseAll", "mouseleave .ui-menu": "collapseAll", focus: function (e, t) {
  770. var i = this.active || this.element.find(this.options.items).eq(0);
  771. t || this.focus(e, i)
  772. }, blur: function (t) {
  773. this._delay(function () {
  774. e.contains(this.element[0], this.document[0].activeElement) || this.collapseAll(t)
  775. })
  776. }, keydown: "_keydown"
  777. }), this.refresh(), this._on(this.document, {
  778. click: function (e) {
  779. this._closeOnDocumentClick(e) && this.collapseAll(e), this.mouseHandled = !1
  780. }
  781. })
  782. },
  783. _destroy: function () {
  784. this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(), this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function () {
  785. var t = e(this);
  786. t.data("ui-menu-submenu-carat") && t.remove()
  787. }), this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")
  788. },
  789. _keydown: function (t) {
  790. var i, s, n, a, o = !0;
  791. switch (t.keyCode) {
  792. case e.ui.keyCode.PAGE_UP:
  793. this.previousPage(t);
  794. break;
  795. case e.ui.keyCode.PAGE_DOWN:
  796. this.nextPage(t);
  797. break;
  798. case e.ui.keyCode.HOME:
  799. this._move("first", "first", t);
  800. break;
  801. case e.ui.keyCode.END:
  802. this._move("last", "last", t);
  803. break;
  804. case e.ui.keyCode.UP:
  805. this.previous(t);
  806. break;
  807. case e.ui.keyCode.DOWN:
  808. this.next(t);
  809. break;
  810. case e.ui.keyCode.LEFT:
  811. this.collapse(t);
  812. break;
  813. case e.ui.keyCode.RIGHT:
  814. this.active && !this.active.is(".ui-state-disabled") && this.expand(t);
  815. break;
  816. case e.ui.keyCode.ENTER:
  817. case e.ui.keyCode.SPACE:
  818. this._activate(t);
  819. break;
  820. case e.ui.keyCode.ESCAPE:
  821. this.collapse(t);
  822. break;
  823. default:
  824. o = !1, s = this.previousFilter || "", n = String.fromCharCode(t.keyCode), a = !1, clearTimeout(this.filterTimer), n === s ? a = !0 : n = s + n, i = this._filterMenuItems(n), i = a && -1 !== i.index(this.active.next()) ? this.active.nextAll(".ui-menu-item") : i, i.length || (n = String.fromCharCode(t.keyCode), i = this._filterMenuItems(n)), i.length ? (this.focus(t, i), this.previousFilter = n, this.filterTimer = this._delay(function () {
  825. delete this.previousFilter
  826. }, 1e3)) : delete this.previousFilter
  827. }
  828. o && t.preventDefault()
  829. },
  830. _activate: function (e) {
  831. this.active.is(".ui-state-disabled") || (this.active.is("[aria-haspopup='true']") ? this.expand(e) : this.select(e))
  832. },
  833. refresh: function () {
  834. var t, i, s = this, n = this.options.icons.submenu, a = this.element.find(this.options.menus);
  835. this.element.toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length), a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({
  836. role: this.options.role,
  837. "aria-hidden": "true",
  838. "aria-expanded": "false"
  839. }).each(function () {
  840. var t = e(this), i = t.parent(),
  841. s = e("<span>").addClass("ui-menu-icon ui-icon " + n).data("ui-menu-submenu-carat", !0);
  842. i.attr("aria-haspopup", "true").prepend(s), t.attr("aria-labelledby", i.attr("id"))
  843. }), t = a.add(this.element), i = t.find(this.options.items), i.not(".ui-menu-item").each(function () {
  844. var t = e(this);
  845. s._isDivider(t) && t.addClass("ui-widget-content ui-menu-divider")
  846. }), i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({
  847. tabIndex: -1,
  848. role: this._itemRole()
  849. }), i.filter(".ui-state-disabled").attr("aria-disabled", "true"), this.active && !e.contains(this.element[0], this.active[0]) && this.blur()
  850. },
  851. _itemRole: function () {
  852. return {menu: "menuitem", listbox: "option"}[this.options.role]
  853. },
  854. _setOption: function (e, t) {
  855. "icons" === e && this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu), "disabled" === e && this.element.toggleClass("ui-state-disabled", !!t).attr("aria-disabled", t), this._super(e, t)
  856. },
  857. focus: function (e, t) {
  858. var i, s;
  859. this.blur(e, e && "focus" === e.type), this._scrollIntoView(t), this.active = t.first(), s = this.active.addClass("ui-state-focus").removeClass("ui-state-active"), this.options.role && this.element.attr("aria-activedescendant", s.attr("id")), this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"), e && "keydown" === e.type ? this._close() : this.timer = this._delay(function () {
  860. this._close()
  861. }, this.delay), i = t.children(".ui-menu"), i.length && e && /^mouse/.test(e.type) && this._startOpening(i), this.activeMenu = t.parent(), this._trigger("focus", e, {item: t})
  862. },
  863. _scrollIntoView: function (t) {
  864. var i, s, n, a, o, r;
  865. this._hasScroll() && (i = parseFloat(e.css(this.activeMenu[0], "borderTopWidth")) || 0, s = parseFloat(e.css(this.activeMenu[0], "paddingTop")) || 0, n = t.offset().top - this.activeMenu.offset().top - i - s, a = this.activeMenu.scrollTop(), o = this.activeMenu.height(), r = t.outerHeight(), 0 > n ? this.activeMenu.scrollTop(a + n) : n + r > o && this.activeMenu.scrollTop(a + n - o + r))
  866. },
  867. blur: function (e, t) {
  868. t || clearTimeout(this.timer), this.active && (this.active.removeClass("ui-state-focus"), this.active = null, this._trigger("blur", e, {item: this.active}))
  869. },
  870. _startOpening: function (e) {
  871. clearTimeout(this.timer), "true" === e.attr("aria-hidden") && (this.timer = this._delay(function () {
  872. this._close(), this._open(e)
  873. }, this.delay))
  874. },
  875. _open: function (t) {
  876. var i = e.extend({of: this.active}, this.options.position);
  877. clearTimeout(this.timer), this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden", "true"), t.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(i)
  878. },
  879. collapseAll: function (t, i) {
  880. clearTimeout(this.timer), this.timer = this._delay(function () {
  881. var s = i ? this.element : e(t && t.target).closest(this.element.find(".ui-menu"));
  882. s.length || (s = this.element), this._close(s), this.blur(t), this.activeMenu = s
  883. }, this.delay)
  884. },
  885. _close: function (e) {
  886. e || (e = this.active ? this.active.parent() : this.element), e.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")
  887. },
  888. _closeOnDocumentClick: function (t) {
  889. return !e(t.target).closest(".ui-menu").length
  890. },
  891. _isDivider: function (e) {
  892. return !/[^\-\u2014\u2013\s]/.test(e.text())
  893. },
  894. collapse: function (e) {
  895. var t = this.active && this.active.parent().closest(".ui-menu-item", this.element);
  896. t && t.length && (this._close(), this.focus(e, t))
  897. },
  898. expand: function (e) {
  899. var t = this.active && this.active.children(".ui-menu ").find(this.options.items).first();
  900. t && t.length && (this._open(t.parent()), this._delay(function () {
  901. this.focus(e, t)
  902. }))
  903. },
  904. next: function (e) {
  905. this._move("next", "first", e)
  906. },
  907. previous: function (e) {
  908. this._move("prev", "last", e)
  909. },
  910. isFirstItem: function () {
  911. return this.active && !this.active.prevAll(".ui-menu-item").length
  912. },
  913. isLastItem: function () {
  914. return this.active && !this.active.nextAll(".ui-menu-item").length
  915. },
  916. _move: function (e, t, i) {
  917. var s;
  918. this.active && (s = "first" === e || "last" === e ? this.active["first" === e ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1) : this.active[e + "All"](".ui-menu-item").eq(0)), s && s.length && this.active || (s = this.activeMenu.find(this.options.items)[t]()), this.focus(i, s)
  919. },
  920. nextPage: function (t) {
  921. var i, s, n;
  922. return this.active ? (this.isLastItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.nextAll(".ui-menu-item").each(function () {
  923. return i = e(this), 0 > i.offset().top - s - n
  924. }), this.focus(t, i)) : this.focus(t, this.activeMenu.find(this.options.items)[this.active ? "last" : "first"]())), void 0) : (this.next(t), void 0)
  925. },
  926. previousPage: function (t) {
  927. var i, s, n;
  928. return this.active ? (this.isFirstItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.prevAll(".ui-menu-item").each(function () {
  929. return i = e(this), i.offset().top - s + n > 0
  930. }), this.focus(t, i)) : this.focus(t, this.activeMenu.find(this.options.items).first())), void 0) : (this.next(t), void 0)
  931. },
  932. _hasScroll: function () {
  933. return this.element.outerHeight() < this.element.prop("scrollHeight")
  934. },
  935. select: function (t) {
  936. this.active = this.active || e(t.target).closest(".ui-menu-item");
  937. var i = {item: this.active};
  938. this.active.has(".ui-menu").length || this.collapseAll(t, !0), this._trigger("select", t, i)
  939. },
  940. _filterMenuItems: function (t) {
  941. var i = t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"), s = RegExp("^" + i, "i");
  942. return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function () {
  943. return s.test(e.trim(e(this).text()))
  944. })
  945. }
  946. }), e.widget("ui.autocomplete", {
  947. version: "1.11.2",
  948. defaultElement: "<input>",
  949. options: {
  950. appendTo: null,
  951. autoFocus: !1,
  952. delay: 300,
  953. minLength: 1,
  954. position: {my: "left top", at: "left bottom", collision: "none"},
  955. source: null,
  956. change: null,
  957. close: null,
  958. focus: null,
  959. open: null,
  960. response: null,
  961. search: null,
  962. select: null
  963. },
  964. requestIndex: 0,
  965. pending: 0,
  966. _create: function () {
  967. var t, i, s, n = this.element[0].nodeName.toLowerCase(), a = "textarea" === n, o = "input" === n;
  968. this.isMultiLine = a ? !0 : o ? !1 : this.element.prop("isContentEditable"), this.valueMethod = this.element[a || o ? "val" : "text"], this.isNewMenu = !0, this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off"), this._on(this.element, {
  969. keydown: function (n) {
  970. if (this.element.prop("readOnly")) return t = !0, s = !0, i = !0, void 0;
  971. t = !1, s = !1, i = !1;
  972. var a = e.ui.keyCode;
  973. switch (n.keyCode) {
  974. case a.PAGE_UP:
  975. t = !0, this._move("previousPage", n);
  976. break;
  977. case a.PAGE_DOWN:
  978. t = !0, this._move("nextPage", n);
  979. break;
  980. case a.UP:
  981. t = !0, this._keyEvent("previous", n);
  982. break;
  983. case a.DOWN:
  984. t = !0, this._keyEvent("next", n);
  985. break;
  986. case a.ENTER:
  987. this.menu.active && (t = !0, n.preventDefault(), this.menu.select(n));
  988. break;
  989. case a.TAB:
  990. this.menu.active && this.menu.select(n);
  991. break;
  992. case a.ESCAPE:
  993. this.menu.element.is(":visible") && (this.isMultiLine || this._value(this.term), this.close(n), n.preventDefault());
  994. break;
  995. default:
  996. i = !0, this._searchTimeout(n)
  997. }
  998. }, keypress: function (s) {
  999. if (t) return t = !1, (!this.isMultiLine || this.menu.element.is(":visible")) && s.preventDefault(), void 0;
  1000. if (!i) {
  1001. var n = e.ui.keyCode;
  1002. switch (s.keyCode) {
  1003. case n.PAGE_UP:
  1004. this._move("previousPage", s);
  1005. break;
  1006. case n.PAGE_DOWN:
  1007. this._move("nextPage", s);
  1008. break;
  1009. case n.UP:
  1010. this._keyEvent("previous", s);
  1011. break;
  1012. case n.DOWN:
  1013. this._keyEvent("next", s)
  1014. }
  1015. }
  1016. }, input: function (e) {
  1017. return s ? (s = !1, e.preventDefault(), void 0) : (this._searchTimeout(e), void 0)
  1018. }, focus: function () {
  1019. this.selectedItem = null, this.previous = this._value()
  1020. }, blur: function (e) {
  1021. return this.cancelBlur ? (delete this.cancelBlur, void 0) : (clearTimeout(this.searching), this.close(e), this._change(e), void 0)
  1022. }
  1023. }), this._initSource(), this.menu = e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role: null}).hide().menu("instance"), this._on(this.menu.element, {
  1024. mousedown: function (t) {
  1025. t.preventDefault(), this.cancelBlur = !0, this._delay(function () {
  1026. delete this.cancelBlur
  1027. });
  1028. var i = this.menu.element[0];
  1029. e(t.target).closest(".ui-menu-item").length || this._delay(function () {
  1030. var t = this;
  1031. this.document.one("mousedown", function (s) {
  1032. s.target === t.element[0] || s.target === i || e.contains(i, s.target) || t.close()
  1033. })
  1034. })
  1035. }, menufocus: function (t, i) {
  1036. var s, n;
  1037. return this.isNewMenu && (this.isNewMenu = !1, t.originalEvent && /^mouse/.test(t.originalEvent.type)) ? (this.menu.blur(), this.document.one("mousemove", function () {
  1038. e(t.target).trigger(t.originalEvent)
  1039. }), void 0) : (n = i.item.data("ui-autocomplete-item"), !1 !== this._trigger("focus", t, {item: n}) && t.originalEvent && /^key/.test(t.originalEvent.type) && this._value(n.value), s = i.item.attr("aria-label") || n.value, s && e.trim(s).length && (this.liveRegion.children().hide(), e("<div>").text(s).appendTo(this.liveRegion)), void 0)
  1040. }, menuselect: function (e, t) {
  1041. var i = t.item.data("ui-autocomplete-item"), s = this.previous;
  1042. this.element[0] !== this.document[0].activeElement && (this.element.focus(), this.previous = s, this._delay(function () {
  1043. this.previous = s, this.selectedItem = i
  1044. })), !1 !== this._trigger("select", e, {item: i}) && this._value(i.value), this.term = this._value(), this.close(e), this.selectedItem = i
  1045. }
  1046. }), this.liveRegion = e("<span>", {
  1047. role: "status",
  1048. "aria-live": "assertive",
  1049. "aria-relevant": "additions"
  1050. }).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body), this._on(this.window, {
  1051. beforeunload: function () {
  1052. this.element.removeAttr("autocomplete")
  1053. }
  1054. })
  1055. },
  1056. _destroy: function () {
  1057. clearTimeout(this.searching), this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"), this.menu.element.remove(), this.liveRegion.remove()
  1058. },
  1059. _setOption: function (e, t) {
  1060. this._super(e, t), "source" === e && this._initSource(), "appendTo" === e && this.menu.element.appendTo(this._appendTo()), "disabled" === e && t && this.xhr && this.xhr.abort()
  1061. },
  1062. _appendTo: function () {
  1063. var t = this.options.appendTo;
  1064. return t && (t = t.jquery || t.nodeType ? e(t) : this.document.find(t).eq(0)), t && t[0] || (t = this.element.closest(".ui-front")), t.length || (t = this.document[0].body), t
  1065. },
  1066. _initSource: function () {
  1067. var t, i, s = this;
  1068. e.isArray(this.options.source) ? (t = this.options.source, this.source = function (i, s) {
  1069. s(e.ui.autocomplete.filter(t, i.term))
  1070. }) : "string" == typeof this.options.source ? (i = this.options.source, this.source = function (t, n) {
  1071. s.xhr && s.xhr.abort(), s.xhr = e.ajax({
  1072. url: i, data: t, dataType: "json", success: function (e) {
  1073. n(e)
  1074. }, error: function () {
  1075. n([])
  1076. }
  1077. })
  1078. }) : this.source = this.options.source
  1079. },
  1080. _searchTimeout: function (e) {
  1081. clearTimeout(this.searching), this.searching = this._delay(function () {
  1082. var t = this.term === this._value(), i = this.menu.element.is(":visible"),
  1083. s = e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;
  1084. (!t || t && !i && !s) && (this.selectedItem = null, this.search(null, e))
  1085. }, this.options.delay)
  1086. },
  1087. search: function (e, t) {
  1088. return e = null != e ? e : this._value(), this.term = this._value(), e.length < this.options.minLength ? this.close(t) : this._trigger("search", t) !== !1 ? this._search(e) : void 0
  1089. },
  1090. _search: function (e) {
  1091. this.pending++, this.element.addClass("ui-autocomplete-loading"), this.cancelSearch = !1, this.source({term: e}, this._response())
  1092. },
  1093. _response: function () {
  1094. var t = ++this.requestIndex;
  1095. return e.proxy(function (e) {
  1096. t === this.requestIndex && this.__response(e), this.pending--, this.pending || this.element.removeClass("ui-autocomplete-loading")
  1097. }, this)
  1098. },
  1099. __response: function (e) {
  1100. e && (e = this._normalize(e)), this._trigger("response", null, {content: e}), !this.options.disabled && e && e.length && !this.cancelSearch ? (this._suggest(e), this._trigger("open")) : this._close()
  1101. },
  1102. close: function (e) {
  1103. this.cancelSearch = !0, this._close(e)
  1104. },
  1105. _close: function (e) {
  1106. this.menu.element.is(":visible") && (this.menu.element.hide(), this.menu.blur(), this.isNewMenu = !0, this._trigger("close", e))
  1107. },
  1108. _change: function (e) {
  1109. this.previous !== this._value() && this._trigger("change", e, {item: this.selectedItem})
  1110. },
  1111. _normalize: function (t) {
  1112. return t.length && t[0].label && t[0].value ? t : e.map(t, function (t) {
  1113. return "string" == typeof t ? {label: t, value: t} : e.extend({}, t, {
  1114. label: t.label || t.value,
  1115. value: t.value || t.label
  1116. })
  1117. })
  1118. },
  1119. _suggest: function (t) {
  1120. var i = this.menu.element.empty();
  1121. this._renderMenu(i, t), this.isNewMenu = !0, this.menu.refresh(), i.show(), this._resizeMenu(), i.position(e.extend({of: this.element}, this.options.position)), this.options.autoFocus && this.menu.next()
  1122. },
  1123. _resizeMenu: function () {
  1124. var e = this.menu.element;
  1125. e.outerWidth(Math.max(e.width("").outerWidth() + 1, this.element.outerWidth()))
  1126. },
  1127. _renderMenu: function (t, i) {
  1128. var s = this;
  1129. e.each(i, function (e, i) {
  1130. s._renderItemData(t, i)
  1131. })
  1132. },
  1133. _renderItemData: function (e, t) {
  1134. return this._renderItem(e, t).data("ui-autocomplete-item", t)
  1135. },
  1136. _renderItem: function (t, i) {
  1137. return e("<li>").text(i.label).appendTo(t)
  1138. },
  1139. _move: function (e, t) {
  1140. return this.menu.element.is(":visible") ? this.menu.isFirstItem() && /^previous/.test(e) || this.menu.isLastItem() && /^next/.test(e) ? (this.isMultiLine || this._value(this.term), this.menu.blur(), void 0) : (this.menu[e](t), void 0) : (this.search(null, t), void 0)
  1141. },
  1142. widget: function () {
  1143. return this.menu.element
  1144. },
  1145. _value: function () {
  1146. return this.valueMethod.apply(this.element, arguments)
  1147. },
  1148. _keyEvent: function (e, t) {
  1149. (!this.isMultiLine || this.menu.element.is(":visible")) && (this._move(e, t), t.preventDefault())
  1150. }
  1151. }), e.extend(e.ui.autocomplete, {
  1152. escapeRegex: function (e) {
  1153. return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
  1154. }, filter: function (t, i) {
  1155. var s = RegExp(e.ui.autocomplete.escapeRegex(i), "i");
  1156. return e.grep(t, function (e) {
  1157. return s.test(e.label || e.value || e)
  1158. })
  1159. }
  1160. }), e.widget("ui.autocomplete", e.ui.autocomplete, {
  1161. options: {
  1162. messages: {
  1163. noResults: "No search results.",
  1164. results: function (e) {
  1165. return e + (e > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate."
  1166. }
  1167. }
  1168. }, __response: function (t) {
  1169. var i;
  1170. this._superApply(arguments), this.options.disabled || this.cancelSearch || (i = t && t.length ? this.options.messages.results(t.length) : this.options.messages.noResults, this.liveRegion.children().hide(), e("<div>").text(i).appendTo(this.liveRegion))
  1171. }
  1172. }), e.ui.autocomplete;
  1173. var c, p = "ui-button ui-widget ui-state-default ui-corner-all",
  1174. f = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
  1175. m = function () {
  1176. var t = e(this);
  1177. setTimeout(function () {
  1178. t.find(":ui-button").button("refresh")
  1179. }, 1)
  1180. }, g = function (t) {
  1181. var i = t.name, s = t.form, n = e([]);
  1182. return i && (i = i.replace(/'/g, "\\'"), n = s ? e(s).find("[name='" + i + "'][type=radio]") : e("[name='" + i + "'][type=radio]", t.ownerDocument).filter(function () {
  1183. return !this.form
  1184. })), n
  1185. };
  1186. e.widget("ui.button", {
  1187. version: "1.11.2",
  1188. defaultElement: "<button>",
  1189. options: {disabled: null, text: !0, label: null, icons: {primary: null, secondary: null}},
  1190. _create: function () {
  1191. this.element.closest("form").unbind("reset" + this.eventNamespace).bind("reset" + this.eventNamespace, m), "boolean" != typeof this.options.disabled ? this.options.disabled = !!this.element.prop("disabled") : this.element.prop("disabled", this.options.disabled), this._determineButtonType(), this.hasTitle = !!this.buttonElement.attr("title");
  1192. var t = this, i = this.options, s = "checkbox" === this.type || "radio" === this.type,
  1193. n = s ? "" : "ui-state-active";
  1194. null === i.label && (i.label = "input" === this.type ? this.buttonElement.val() : this.buttonElement.html()), this._hoverable(this.buttonElement), this.buttonElement.addClass(p).attr("role", "button").bind("mouseenter" + this.eventNamespace, function () {
  1195. i.disabled || this === c && e(this).addClass("ui-state-active")
  1196. }).bind("mouseleave" + this.eventNamespace, function () {
  1197. i.disabled || e(this).removeClass(n)
  1198. }).bind("click" + this.eventNamespace, function (e) {
  1199. i.disabled && (e.preventDefault(), e.stopImmediatePropagation())
  1200. }), this._on({
  1201. focus: function () {
  1202. this.buttonElement.addClass("ui-state-focus")
  1203. }, blur: function () {
  1204. this.buttonElement.removeClass("ui-state-focus")
  1205. }
  1206. }), s && this.element.bind("change" + this.eventNamespace, function () {
  1207. t.refresh()
  1208. }), "checkbox" === this.type ? this.buttonElement.bind("click" + this.eventNamespace, function () {
  1209. return i.disabled ? !1 : void 0
  1210. }) : "radio" === this.type ? this.buttonElement.bind("click" + this.eventNamespace, function () {
  1211. if (i.disabled) return !1;
  1212. e(this).addClass("ui-state-active"), t.buttonElement.attr("aria-pressed", "true");
  1213. var s = t.element[0];
  1214. g(s).not(s).map(function () {
  1215. return e(this).button("widget")[0]
  1216. }).removeClass("ui-state-active").attr("aria-pressed", "false")
  1217. }) : (this.buttonElement.bind("mousedown" + this.eventNamespace, function () {
  1218. return i.disabled ? !1 : (e(this).addClass("ui-state-active"), c = this, t.document.one("mouseup", function () {
  1219. c = null
  1220. }), void 0)
  1221. }).bind("mouseup" + this.eventNamespace, function () {
  1222. return i.disabled ? !1 : (e(this).removeClass("ui-state-active"), void 0)
  1223. }).bind("keydown" + this.eventNamespace, function (t) {
  1224. return i.disabled ? !1 : ((t.keyCode === e.ui.keyCode.SPACE || t.keyCode === e.ui.keyCode.ENTER) && e(this).addClass("ui-state-active"), void 0)
  1225. }).bind("keyup" + this.eventNamespace + " blur" + this.eventNamespace, function () {
  1226. e(this).removeClass("ui-state-active")
  1227. }), this.buttonElement.is("a") && this.buttonElement.keyup(function (t) {
  1228. t.keyCode === e.ui.keyCode.SPACE && e(this).click()
  1229. })), this._setOption("disabled", i.disabled), this._resetButton()
  1230. },
  1231. _determineButtonType: function () {
  1232. var e, t, i;
  1233. this.type = this.element.is("[type=checkbox]") ? "checkbox" : this.element.is("[type=radio]") ? "radio" : this.element.is("input") ? "input" : "button", "checkbox" === this.type || "radio" === this.type ? (e = this.element.parents().last(), t = "label[for='" + this.element.attr("id") + "']", this.buttonElement = e.find(t), this.buttonElement.length || (e = e.length ? e.siblings() : this.element.siblings(), this.buttonElement = e.filter(t), this.buttonElement.length || (this.buttonElement = e.find(t))), this.element.addClass("ui-helper-hidden-accessible"), i = this.element.is(":checked"), i && this.buttonElement.addClass("ui-state-active"), this.buttonElement.prop("aria-pressed", i)) : this.buttonElement = this.element
  1234. },
  1235. widget: function () {
  1236. return this.buttonElement
  1237. },
  1238. _destroy: function () {
  1239. this.element.removeClass("ui-helper-hidden-accessible"), this.buttonElement.removeClass(p + " ui-state-active " + f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()), this.hasTitle || this.buttonElement.removeAttr("title")
  1240. },
  1241. _setOption: function (e, t) {
  1242. return this._super(e, t), "disabled" === e ? (this.widget().toggleClass("ui-state-disabled", !!t), this.element.prop("disabled", !!t), t && ("checkbox" === this.type || "radio" === this.type ? this.buttonElement.removeClass("ui-state-focus") : this.buttonElement.removeClass("ui-state-focus ui-state-active")), void 0) : (this._resetButton(), void 0)
  1243. },
  1244. refresh: function () {
  1245. var t = this.element.is("input, button") ? this.element.is(":disabled") : this.element.hasClass("ui-button-disabled");
  1246. t !== this.options.disabled && this._setOption("disabled", t), "radio" === this.type ? g(this.element[0]).each(function () {
  1247. e(this).is(":checked") ? e(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true") : e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false")
  1248. }) : "checkbox" === this.type && (this.element.is(":checked") ? this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true") : this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false"))
  1249. },
  1250. _resetButton: function () {
  1251. if ("input" === this.type) return this.options.label && this.element.val(this.options.label), void 0;
  1252. var t = this.buttonElement.removeClass(f),
  1253. i = e("<span></span>", this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),
  1254. s = this.options.icons, n = s.primary && s.secondary, a = [];
  1255. s.primary || s.secondary ? (this.options.text && a.push("ui-button-text-icon" + (n ? "s" : s.primary ? "-primary" : "-secondary")), s.primary && t.prepend("<span class='ui-button-icon-primary ui-icon " + s.primary + "'></span>"), s.secondary && t.append("<span class='ui-button-icon-secondary ui-icon " + s.secondary + "'></span>"), this.options.text || (a.push(n ? "ui-button-icons-only" : "ui-button-icon-only"), this.hasTitle || t.attr("title", e.trim(i)))) : a.push("ui-button-text-only"), t.addClass(a.join(" "))
  1256. }
  1257. }), e.widget("ui.buttonset", {
  1258. version: "1.11.2",
  1259. options: {items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},
  1260. _create: function () {
  1261. this.element.addClass("ui-buttonset")
  1262. },
  1263. _init: function () {
  1264. this.refresh()
  1265. },
  1266. _setOption: function (e, t) {
  1267. "disabled" === e && this.buttons.button("option", e, t), this._super(e, t)
  1268. },
  1269. refresh: function () {
  1270. var t = "rtl" === this.element.css("direction"), i = this.element.find(this.options.items),
  1271. s = i.filter(":ui-button");
  1272. i.not(":ui-button").button(), s.button("refresh"), this.buttons = i.map(function () {
  1273. return e(this).button("widget")[0]
  1274. }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t ? "ui-corner-right" : "ui-corner-left").end().filter(":last").addClass(t ? "ui-corner-left" : "ui-corner-right").end().end()
  1275. },
  1276. _destroy: function () {
  1277. this.element.removeClass("ui-buttonset"), this.buttons.map(function () {
  1278. return e(this).button("widget")[0]
  1279. }).removeClass("ui-corner-left ui-corner-right").end().button("destroy")
  1280. }
  1281. }), e.ui.button, e.extend(e.ui, {datepicker: {version: "1.11.2"}});
  1282. var v;
  1283. e.extend(n.prototype, {
  1284. markerClassName: "hasDatepicker",
  1285. maxRows: 4,
  1286. _widgetDatepicker: function () {
  1287. return this.dpDiv
  1288. },
  1289. setDefaults: function (e) {
  1290. return r(this._defaults, e || {}), this
  1291. },
  1292. _attachDatepicker: function (t, i) {
  1293. var s, n, a;
  1294. s = t.nodeName.toLowerCase(), n = "div" === s || "span" === s, t.id || (this.uuid += 1, t.id = "dp" + this.uuid), a = this._newInst(e(t), n), a.settings = e.extend({}, i || {}), "input" === s ? this._connectDatepicker(t, a) : n && this._inlineDatepicker(t, a)
  1295. },
  1296. _newInst: function (t, i) {
  1297. var s = t[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
  1298. return {
  1299. id: s,
  1300. input: t,
  1301. selectedDay: 0,
  1302. selectedMonth: 0,
  1303. selectedYear: 0,
  1304. drawMonth: 0,
  1305. drawYear: 0,
  1306. inline: i,
  1307. dpDiv: i ? a(e("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) : this.dpDiv
  1308. }
  1309. },
  1310. _connectDatepicker: function (t, i) {
  1311. var s = e(t);
  1312. i.append = e([]), i.trigger = e([]), s.hasClass(this.markerClassName) || (this._attachments(s, i), s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp), this._autoSize(i), e.data(t, "datepicker", i), i.settings.disabled && this._disableDatepicker(t))
  1313. },
  1314. _attachments: function (t, i) {
  1315. var s, n, a, o = this._get(i, "appendText"), r = this._get(i, "isRTL");
  1316. i.append && i.append.remove(), o && (i.append = e("<span class='" + this._appendClass + "'>" + o + "</span>"), t[r ? "before" : "after"](i.append)), t.unbind("focus", this._showDatepicker), i.trigger && i.trigger.remove(), s = this._get(i, "showOn"), ("focus" === s || "both" === s) && t.focus(this._showDatepicker), ("button" === s || "both" === s) && (n = this._get(i, "buttonText"), a = this._get(i, "buttonImage"), i.trigger = e(this._get(i, "buttonImageOnly") ? e("<img/>").addClass(this._triggerClass).attr({
  1317. src: a,
  1318. alt: n,
  1319. title: n
  1320. }) : e("<button type='button'></button>").addClass(this._triggerClass).html(a ? e("<img/>").attr({
  1321. src: a,
  1322. alt: n,
  1323. title: n
  1324. }) : n)), t[r ? "before" : "after"](i.trigger), i.trigger.click(function () {
  1325. return e.datepicker._datepickerShowing && e.datepicker._lastInput === t[0] ? e.datepicker._hideDatepicker() : e.datepicker._datepickerShowing && e.datepicker._lastInput !== t[0] ? (e.datepicker._hideDatepicker(), e.datepicker._showDatepicker(t[0])) : e.datepicker._showDatepicker(t[0]), !1
  1326. }))
  1327. },
  1328. _autoSize: function (e) {
  1329. if (this._get(e, "autoSize") && !e.inline) {
  1330. var t, i, s, n, a = new Date(2009, 11, 20), o = this._get(e, "dateFormat");
  1331. o.match(/[DM]/) && (t = function (e) {
  1332. for (i = 0, s = 0, n = 0; e.length > n; n++) e[n].length > i && (i = e[n].length, s = n);
  1333. return s
  1334. }, a.setMonth(t(this._get(e, o.match(/MM/) ? "monthNames" : "monthNamesShort"))), a.setDate(t(this._get(e, o.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - a.getDay())), e.input.attr("size", this._formatDate(e, a).length)
  1335. }
  1336. },
  1337. _inlineDatepicker: function (t, i) {
  1338. var s = e(t);
  1339. s.hasClass(this.markerClassName) || (s.addClass(this.markerClassName).append(i.dpDiv), e.data(t, "datepicker", i), this._setDate(i, this._getDefaultDate(i), !0), this._updateDatepicker(i), this._updateAlternate(i), i.settings.disabled && this._disableDatepicker(t), i.dpDiv.css("display", "block"))
  1340. },
  1341. _dialogDatepicker: function (t, i, s, n, a) {
  1342. var o, h, l, u, d, c = this._dialogInst;
  1343. return c || (this.uuid += 1, o = "dp" + this.uuid, this._dialogInput = e("<input type='text' id='" + o + "' style='position: absolute; top: -100px; width: 0px;'/>"), this._dialogInput.keydown(this._doKeyDown), e("body").append(this._dialogInput), c = this._dialogInst = this._newInst(this._dialogInput, !1), c.settings = {}, e.data(this._dialogInput[0], "datepicker", c)), r(c.settings, n || {}), i = i && i.constructor === Date ? this._formatDate(c, i) : i, this._dialogInput.val(i), this._pos = a ? a.length ? a : [a.pageX, a.pageY] : null, this._pos || (h = document.documentElement.clientWidth, l = document.documentElement.clientHeight, u = document.documentElement.scrollLeft || document.body.scrollLeft, d = document.documentElement.scrollTop || document.body.scrollTop, this._pos = [h / 2 - 100 + u, l / 2 - 150 + d]), this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), c.settings.onSelect = s, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), e.blockUI && e.blockUI(this.dpDiv), e.data(this._dialogInput[0], "datepicker", c), this
  1344. },
  1345. _destroyDatepicker: function (t) {
  1346. var i, s = e(t), n = e.data(t, "datepicker");
  1347. s.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), e.removeData(t, "datepicker"), "input" === i ? (n.append.remove(), n.trigger.remove(), s.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)) : ("div" === i || "span" === i) && s.removeClass(this.markerClassName).empty())
  1348. },
  1349. _enableDatepicker: function (t) {
  1350. var i, s, n = e(t), a = e.data(t, "datepicker");
  1351. n.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), "input" === i ? (t.disabled = !1, a.trigger.filter("button").each(function () {
  1352. this.disabled = !1
  1353. }).end().filter("img").css({
  1354. opacity: "1.0",
  1355. cursor: ""
  1356. })) : ("div" === i || "span" === i) && (s = n.children("." + this._inlineClass), s.children().removeClass("ui-state-disabled"), s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !1)), this._disabledInputs = e.map(this._disabledInputs, function (e) {
  1357. return e === t ? null : e
  1358. }))
  1359. },
  1360. _disableDatepicker: function (t) {
  1361. var i, s, n = e(t), a = e.data(t, "datepicker");
  1362. n.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), "input" === i ? (t.disabled = !0, a.trigger.filter("button").each(function () {
  1363. this.disabled = !0
  1364. }).end().filter("img").css({
  1365. opacity: "0.5",
  1366. cursor: "default"
  1367. })) : ("div" === i || "span" === i) && (s = n.children("." + this._inlineClass), s.children().addClass("ui-state-disabled"), s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !0)), this._disabledInputs = e.map(this._disabledInputs, function (e) {
  1368. return e === t ? null : e
  1369. }), this._disabledInputs[this._disabledInputs.length] = t)
  1370. },
  1371. _isDisabledDatepicker: function (e) {
  1372. if (!e) return !1;
  1373. for (var t = 0; this._disabledInputs.length > t; t++) if (this._disabledInputs[t] === e) return !0;
  1374. return !1
  1375. },
  1376. _getInst: function (t) {
  1377. try {
  1378. return e.data(t, "datepicker")
  1379. } catch (i) {
  1380. throw"Missing instance data for this datepicker"
  1381. }
  1382. },
  1383. _optionDatepicker: function (t, i, s) {
  1384. var n, a, o, h, l = this._getInst(t);
  1385. return 2 === arguments.length && "string" == typeof i ? "defaults" === i ? e.extend({}, e.datepicker._defaults) : l ? "all" === i ? e.extend({}, l.settings) : this._get(l, i) : null : (n = i || {}, "string" == typeof i && (n = {}, n[i] = s), l && (this._curInst === l && this._hideDatepicker(), a = this._getDateDatepicker(t, !0), o = this._getMinMaxDate(l, "min"), h = this._getMinMaxDate(l, "max"), r(l.settings, n), null !== o && void 0 !== n.dateFormat && void 0 === n.minDate && (l.settings.minDate = this._formatDate(l, o)), null !== h && void 0 !== n.dateFormat && void 0 === n.maxDate && (l.settings.maxDate = this._formatDate(l, h)), "disabled" in n && (n.disabled ? this._disableDatepicker(t) : this._enableDatepicker(t)), this._attachments(e(t), l), this._autoSize(l), this._setDate(l, a), this._updateAlternate(l), this._updateDatepicker(l)), void 0)
  1386. },
  1387. _changeDatepicker: function (e, t, i) {
  1388. this._optionDatepicker(e, t, i)
  1389. },
  1390. _refreshDatepicker: function (e) {
  1391. var t = this._getInst(e);
  1392. t && this._updateDatepicker(t)
  1393. },
  1394. _setDateDatepicker: function (e, t) {
  1395. var i = this._getInst(e);
  1396. i && (this._setDate(i, t), this._updateDatepicker(i), this._updateAlternate(i))
  1397. },
  1398. _getDateDatepicker: function (e, t) {
  1399. var i = this._getInst(e);
  1400. return i && !i.inline && this._setDateFromField(i, t), i ? this._getDate(i) : null
  1401. },
  1402. _doKeyDown: function (t) {
  1403. var i, s, n, a = e.datepicker._getInst(t.target), o = !0, r = a.dpDiv.is(".ui-datepicker-rtl");
  1404. if (a._keyEvent = !0, e.datepicker._datepickerShowing) switch (t.keyCode) {
  1405. case 9:
  1406. e.datepicker._hideDatepicker(), o = !1;
  1407. break;
  1408. case 13:
  1409. return n = e("td." + e.datepicker._dayOverClass + ":not(." + e.datepicker._currentClass + ")", a.dpDiv), n[0] && e.datepicker._selectDay(t.target, a.selectedMonth, a.selectedYear, n[0]), i = e.datepicker._get(a, "onSelect"), i ? (s = e.datepicker._formatDate(a), i.apply(a.input ? a.input[0] : null, [s, a])) : e.datepicker._hideDatepicker(), !1;
  1410. case 27:
  1411. e.datepicker._hideDatepicker();
  1412. break;
  1413. case 33:
  1414. e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(a, "stepBigMonths") : -e.datepicker._get(a, "stepMonths"), "M");
  1415. break;
  1416. case 34:
  1417. e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(a, "stepBigMonths") : +e.datepicker._get(a, "stepMonths"), "M");
  1418. break;
  1419. case 35:
  1420. (t.ctrlKey || t.metaKey) && e.datepicker._clearDate(t.target), o = t.ctrlKey || t.metaKey;
  1421. break;
  1422. case 36:
  1423. (t.ctrlKey || t.metaKey) && e.datepicker._gotoToday(t.target), o = t.ctrlKey || t.metaKey;
  1424. break;
  1425. case 37:
  1426. (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, r ? 1 : -1, "D"), o = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(a, "stepBigMonths") : -e.datepicker._get(a, "stepMonths"), "M");
  1427. break;
  1428. case 38:
  1429. (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, -7, "D"), o = t.ctrlKey || t.metaKey;
  1430. break;
  1431. case 39:
  1432. (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, r ? -1 : 1, "D"), o = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(a, "stepBigMonths") : +e.datepicker._get(a, "stepMonths"), "M");
  1433. break;
  1434. case 40:
  1435. (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, 7, "D"), o = t.ctrlKey || t.metaKey;
  1436. break;
  1437. default:
  1438. o = !1
  1439. } else 36 === t.keyCode && t.ctrlKey ? e.datepicker._showDatepicker(this) : o = !1;
  1440. o && (t.preventDefault(), t.stopPropagation())
  1441. },
  1442. _doKeyPress: function (t) {
  1443. var i, s, n = e.datepicker._getInst(t.target);
  1444. return e.datepicker._get(n, "constrainInput") ? (i = e.datepicker._possibleChars(e.datepicker._get(n, "dateFormat")), s = String.fromCharCode(null == t.charCode ? t.keyCode : t.charCode), t.ctrlKey || t.metaKey || " " > s || !i || i.indexOf(s) > -1) : void 0
  1445. },
  1446. _doKeyUp: function (t) {
  1447. var i, s = e.datepicker._getInst(t.target);
  1448. if (s.input.val() !== s.lastVal) try {
  1449. i = e.datepicker.parseDate(e.datepicker._get(s, "dateFormat"), s.input ? s.input.val() : null, e.datepicker._getFormatConfig(s)), i && (e.datepicker._setDateFromField(s), e.datepicker._updateAlternate(s), e.datepicker._updateDatepicker(s))
  1450. } catch (n) {
  1451. }
  1452. return !0
  1453. },
  1454. _showDatepicker: function (t) {
  1455. if (t = t.target || t, "input" !== t.nodeName.toLowerCase() && (t = e("input", t.parentNode)[0]), !e.datepicker._isDisabledDatepicker(t) && e.datepicker._lastInput !== t) {
  1456. var i, n, a, o, h, l, u;
  1457. i = e.datepicker._getInst(t), e.datepicker._curInst && e.datepicker._curInst !== i && (e.datepicker._curInst.dpDiv.stop(!0, !0), i && e.datepicker._datepickerShowing && e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])), n = e.datepicker._get(i, "beforeShow"), a = n ? n.apply(t, [t, i]) : {}, a !== !1 && (r(i.settings, a), i.lastVal = null, e.datepicker._lastInput = t, e.datepicker._setDateFromField(i), e.datepicker._inDialog && (t.value = ""), e.datepicker._pos || (e.datepicker._pos = e.datepicker._findPos(t), e.datepicker._pos[1] += t.offsetHeight), o = !1, e(t).parents().each(function () {
  1458. return o |= "fixed" === e(this).css("position"), !o
  1459. }), h = {
  1460. left: e.datepicker._pos[0],
  1461. top: e.datepicker._pos[1]
  1462. }, e.datepicker._pos = null, i.dpDiv.empty(), i.dpDiv.css({
  1463. position: "absolute",
  1464. display: "block",
  1465. top: "-1000px"
  1466. }), e.datepicker._updateDatepicker(i), h = e.datepicker._checkOffset(i, h, o), i.dpDiv.css({
  1467. position: e.datepicker._inDialog && e.blockUI ? "static" : o ? "fixed" : "absolute",
  1468. display: "none",
  1469. left: h.left + "px",
  1470. top: h.top + "px"
  1471. }), i.inline || (l = e.datepicker._get(i, "showAnim"), u = e.datepicker._get(i, "duration"), i.dpDiv.css("z-index", s(e(t)) + 1), e.datepicker._datepickerShowing = !0, e.effects && e.effects.effect[l] ? i.dpDiv.show(l, e.datepicker._get(i, "showOptions"), u) : i.dpDiv[l || "show"](l ? u : null), e.datepicker._shouldFocusInput(i) && i.input.focus(), e.datepicker._curInst = i))
  1472. }
  1473. },
  1474. _updateDatepicker: function (t) {
  1475. this.maxRows = 4, v = t, t.dpDiv.empty().append(this._generateHTML(t)), this._attachHandlers(t);
  1476. var i, s = this._getNumberOfMonths(t), n = s[1], a = 17, r = t.dpDiv.find("." + this._dayOverClass + " a");
  1477. r.length > 0 && o.apply(r.get(0)), t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), n > 1 && t.dpDiv.addClass("ui-datepicker-multi-" + n).css("width", a * n + "em"), t.dpDiv[(1 !== s[0] || 1 !== s[1] ? "add" : "remove") + "Class"]("ui-datepicker-multi"), t.dpDiv[(this._get(t, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), t === e.datepicker._curInst && e.datepicker._datepickerShowing && e.datepicker._shouldFocusInput(t) && t.input.focus(), t.yearshtml && (i = t.yearshtml, setTimeout(function () {
  1478. i === t.yearshtml && t.yearshtml && t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml), i = t.yearshtml = null
  1479. }, 0))
  1480. },
  1481. _shouldFocusInput: function (e) {
  1482. return e.input && e.input.is(":visible") && !e.input.is(":disabled") && !e.input.is(":focus")
  1483. },
  1484. _checkOffset: function (t, i, s) {
  1485. var n = t.dpDiv.outerWidth(), a = t.dpDiv.outerHeight(), o = t.input ? t.input.outerWidth() : 0,
  1486. r = t.input ? t.input.outerHeight() : 0,
  1487. h = document.documentElement.clientWidth + (s ? 0 : e(document).scrollLeft()),
  1488. l = document.documentElement.clientHeight + (s ? 0 : e(document).scrollTop());
  1489. return i.left -= this._get(t, "isRTL") ? n - o : 0, i.left -= s && i.left === t.input.offset().left ? e(document).scrollLeft() : 0, i.top -= s && i.top === t.input.offset().top + r ? e(document).scrollTop() : 0, i.left -= Math.min(i.left, i.left + n > h && h > n ? Math.abs(i.left + n - h) : 0), i.top -= Math.min(i.top, i.top + a > l && l > a ? Math.abs(a + r) : 0), i
  1490. },
  1491. _findPos: function (t) {
  1492. for (var i, s = this._getInst(t), n = this._get(s, "isRTL"); t && ("hidden" === t.type || 1 !== t.nodeType || e.expr.filters.hidden(t));) t = t[n ? "previousSibling" : "nextSibling"];
  1493. return i = e(t).offset(), [i.left, i.top]
  1494. },
  1495. _hideDatepicker: function (t) {
  1496. var i, s, n, a, o = this._curInst;
  1497. !o || t && o !== e.data(t, "datepicker") || this._datepickerShowing && (i = this._get(o, "showAnim"), s = this._get(o, "duration"), n = function () {
  1498. e.datepicker._tidyDialog(o)
  1499. }, e.effects && (e.effects.effect[i] || e.effects[i]) ? o.dpDiv.hide(i, e.datepicker._get(o, "showOptions"), s, n) : o.dpDiv["slideDown" === i ? "slideUp" : "fadeIn" === i ? "fadeOut" : "hide"](i ? s : null, n), i || n(), this._datepickerShowing = !1, a = this._get(o, "onClose"), a && a.apply(o.input ? o.input[0] : null, [o.input ? o.input.val() : "", o]), this._lastInput = null, this._inDialog && (this._dialogInput.css({
  1500. position: "absolute",
  1501. left: "0",
  1502. top: "-100px"
  1503. }), e.blockUI && (e.unblockUI(), e("body").append(this.dpDiv))), this._inDialog = !1)
  1504. },
  1505. _tidyDialog: function (e) {
  1506. e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")
  1507. },
  1508. _checkExternalClick: function (t) {
  1509. if (e.datepicker._curInst) {
  1510. var i = e(t.target), s = e.datepicker._getInst(i[0]);
  1511. (i[0].id !== e.datepicker._mainDivId && 0 === i.parents("#" + e.datepicker._mainDivId).length && !i.hasClass(e.datepicker.markerClassName) && !i.closest("." + e.datepicker._triggerClass).length && e.datepicker._datepickerShowing && (!e.datepicker._inDialog || !e.blockUI) || i.hasClass(e.datepicker.markerClassName) && e.datepicker._curInst !== s) && e.datepicker._hideDatepicker()
  1512. }
  1513. },
  1514. _adjustDate: function (t, i, s) {
  1515. var n = e(t), a = this._getInst(n[0]);
  1516. this._isDisabledDatepicker(n[0]) || (this._adjustInstDate(a, i + ("M" === s ? this._get(a, "showCurrentAtPos") : 0), s), this._updateDatepicker(a))
  1517. },
  1518. _gotoToday: function (t) {
  1519. var i, s = e(t), n = this._getInst(s[0]);
  1520. this._get(n, "gotoCurrent") && n.currentDay ? (n.selectedDay = n.currentDay, n.drawMonth = n.selectedMonth = n.currentMonth, n.drawYear = n.selectedYear = n.currentYear) : (i = new Date, n.selectedDay = i.getDate(), n.drawMonth = n.selectedMonth = i.getMonth(), n.drawYear = n.selectedYear = i.getFullYear()), this._notifyChange(n), this._adjustDate(s)
  1521. },
  1522. _selectMonthYear: function (t, i, s) {
  1523. var n = e(t), a = this._getInst(n[0]);
  1524. a["selected" + ("M" === s ? "Month" : "Year")] = a["draw" + ("M" === s ? "Month" : "Year")] = parseInt(i.options[i.selectedIndex].value, 10), this._notifyChange(a), this._adjustDate(n)
  1525. },
  1526. _selectDay: function (t, i, s, n) {
  1527. var a, o = e(t);
  1528. e(n).hasClass(this._unselectableClass) || this._isDisabledDatepicker(o[0]) || (a = this._getInst(o[0]), a.selectedDay = a.currentDay = e("a", n).html(), a.selectedMonth = a.currentMonth = i, a.selectedYear = a.currentYear = s, this._selectDate(t, this._formatDate(a, a.currentDay, a.currentMonth, a.currentYear)))
  1529. },
  1530. _clearDate: function (t) {
  1531. var i = e(t);
  1532. this._selectDate(i, "")
  1533. },
  1534. _selectDate: function (t, i) {
  1535. var s, n = e(t), a = this._getInst(n[0]);
  1536. i = null != i ? i : this._formatDate(a), a.input && a.input.val(i), this._updateAlternate(a), s = this._get(a, "onSelect"), s ? s.apply(a.input ? a.input[0] : null, [i, a]) : a.input && a.input.trigger("change"), a.inline ? this._updateDatepicker(a) : (this._hideDatepicker(), this._lastInput = a.input[0], "object" != typeof a.input[0] && a.input.focus(), this._lastInput = null)
  1537. },
  1538. _updateAlternate: function (t) {
  1539. var i, s, n, a = this._get(t, "altField");
  1540. a && (i = this._get(t, "altFormat") || this._get(t, "dateFormat"), s = this._getDate(t), n = this.formatDate(i, s, this._getFormatConfig(t)), e(a).each(function () {
  1541. e(this).val(n)
  1542. }))
  1543. },
  1544. noWeekends: function (e) {
  1545. var t = e.getDay();
  1546. return [t > 0 && 6 > t, ""]
  1547. },
  1548. iso8601Week: function (e) {
  1549. var t, i = new Date(e.getTime());
  1550. return i.setDate(i.getDate() + 4 - (i.getDay() || 7)), t = i.getTime(), i.setMonth(0), i.setDate(1), Math.floor(Math.round((t - i) / 864e5) / 7) + 1
  1551. },
  1552. parseDate: function (t, i, s) {
  1553. if (null == t || null == i) throw"Invalid arguments";
  1554. if (i = "object" == typeof i ? "" + i : i + "", "" === i) return null;
  1555. var n, a, o, r, h = 0, l = (s ? s.shortYearCutoff : null) || this._defaults.shortYearCutoff,
  1556. u = "string" != typeof l ? l : (new Date).getFullYear() % 100 + parseInt(l, 10),
  1557. d = (s ? s.dayNamesShort : null) || this._defaults.dayNamesShort,
  1558. c = (s ? s.dayNames : null) || this._defaults.dayNames,
  1559. p = (s ? s.monthNamesShort : null) || this._defaults.monthNamesShort,
  1560. f = (s ? s.monthNames : null) || this._defaults.monthNames, m = -1, g = -1, v = -1, y = -1, b = !1,
  1561. _ = function (e) {
  1562. var i = t.length > n + 1 && t.charAt(n + 1) === e;
  1563. return i && n++, i
  1564. }, x = function (e) {
  1565. var t = _(e), s = "@" === e ? 14 : "!" === e ? 20 : "y" === e && t ? 4 : "o" === e ? 3 : 2,
  1566. n = "y" === e ? s : 1, a = RegExp("^\\d{" + n + "," + s + "}"), o = i.substring(h).match(a);
  1567. if (!o) throw"Missing number at position " + h;
  1568. return h += o[0].length, parseInt(o[0], 10)
  1569. }, w = function (t, s, n) {
  1570. var a = -1, o = e.map(_(t) ? n : s, function (e, t) {
  1571. return [[t, e]]
  1572. }).sort(function (e, t) {
  1573. return -(e[1].length - t[1].length)
  1574. });
  1575. if (e.each(o, function (e, t) {
  1576. var s = t[1];
  1577. return i.substr(h, s.length).toLowerCase() === s.toLowerCase() ? (a = t[0], h += s.length, !1) : void 0
  1578. }), -1 !== a) return a + 1;
  1579. throw"Unknown name at position " + h
  1580. }, k = function () {
  1581. if (i.charAt(h) !== t.charAt(n)) throw"Unexpected literal at position " + h;
  1582. h++
  1583. };
  1584. for (n = 0; t.length > n; n++) if (b) "'" !== t.charAt(n) || _("'") ? k() : b = !1; else switch (t.charAt(n)) {
  1585. case"d":
  1586. v = x("d");
  1587. break;
  1588. case"D":
  1589. w("D", d, c);
  1590. break;
  1591. case"o":
  1592. y = x("o");
  1593. break;
  1594. case"m":
  1595. g = x("m");
  1596. break;
  1597. case"M":
  1598. g = w("M", p, f);
  1599. break;
  1600. case"y":
  1601. m = x("y");
  1602. break;
  1603. case"@":
  1604. r = new Date(x("@")), m = r.getFullYear(), g = r.getMonth() + 1, v = r.getDate();
  1605. break;
  1606. case"!":
  1607. r = new Date((x("!") - this._ticksTo1970) / 1e4), m = r.getFullYear(), g = r.getMonth() + 1, v = r.getDate();
  1608. break;
  1609. case"'":
  1610. _("'") ? k() : b = !0;
  1611. break;
  1612. default:
  1613. k()
  1614. }
  1615. if (i.length > h && (o = i.substr(h), !/^\s+/.test(o))) throw"Extra/unparsed characters found in date: " + o;
  1616. if (-1 === m ? m = (new Date).getFullYear() : 100 > m && (m += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (u >= m ? 0 : -100)), y > -1) for (g = 1, v = y; ;) {
  1617. if (a = this._getDaysInMonth(m, g - 1), a >= v) break;
  1618. g++, v -= a
  1619. }
  1620. if (r = this._daylightSavingAdjust(new Date(m, g - 1, v)), r.getFullYear() !== m || r.getMonth() + 1 !== g || r.getDate() !== v) throw"Invalid date";
  1621. return r
  1622. },
  1623. ATOM: "yy-mm-dd",
  1624. COOKIE: "D, dd M yy",
  1625. ISO_8601: "yy-mm-dd",
  1626. RFC_822: "D, d M y",
  1627. RFC_850: "DD, dd-M-y",
  1628. RFC_1036: "D, d M y",
  1629. RFC_1123: "D, d M yy",
  1630. RFC_2822: "D, d M yy",
  1631. RSS: "D, d M y",
  1632. TICKS: "!",
  1633. TIMESTAMP: "@",
  1634. W3C: "yy-mm-dd",
  1635. _ticksTo1970: 1e7 * 60 * 60 * 24 * (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)),
  1636. formatDate: function (e, t, i) {
  1637. if (!t) return "";
  1638. var s, n = (i ? i.dayNamesShort : null) || this._defaults.dayNamesShort,
  1639. a = (i ? i.dayNames : null) || this._defaults.dayNames,
  1640. o = (i ? i.monthNamesShort : null) || this._defaults.monthNamesShort,
  1641. r = (i ? i.monthNames : null) || this._defaults.monthNames, h = function (t) {
  1642. var i = e.length > s + 1 && e.charAt(s + 1) === t;
  1643. return i && s++, i
  1644. }, l = function (e, t, i) {
  1645. var s = "" + t;
  1646. if (h(e)) for (; i > s.length;) s = "0" + s;
  1647. return s
  1648. }, u = function (e, t, i, s) {
  1649. return h(e) ? s[t] : i[t]
  1650. }, d = "", c = !1;
  1651. if (t) for (s = 0; e.length > s; s++) if (c) "'" !== e.charAt(s) || h("'") ? d += e.charAt(s) : c = !1; else switch (e.charAt(s)) {
  1652. case"d":
  1653. d += l("d", t.getDate(), 2);
  1654. break;
  1655. case"D":
  1656. d += u("D", t.getDay(), n, a);
  1657. break;
  1658. case"o":
  1659. d += l("o", Math.round((new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() - new Date(t.getFullYear(), 0, 0).getTime()) / 864e5), 3);
  1660. break;
  1661. case"m":
  1662. d += l("m", t.getMonth() + 1, 2);
  1663. break;
  1664. case"M":
  1665. d += u("M", t.getMonth(), o, r);
  1666. break;
  1667. case"y":
  1668. d += h("y") ? t.getFullYear() : (10 > t.getYear() % 100 ? "0" : "") + t.getYear() % 100;
  1669. break;
  1670. case"@":
  1671. d += t.getTime();
  1672. break;
  1673. case"!":
  1674. d += 1e4 * t.getTime() + this._ticksTo1970;
  1675. break;
  1676. case"'":
  1677. h("'") ? d += "'" : c = !0;
  1678. break;
  1679. default:
  1680. d += e.charAt(s)
  1681. }
  1682. return d
  1683. },
  1684. _possibleChars: function (e) {
  1685. var t, i = "", s = !1, n = function (i) {
  1686. var s = e.length > t + 1 && e.charAt(t + 1) === i;
  1687. return s && t++, s
  1688. };
  1689. for (t = 0; e.length > t; t++) if (s) "'" !== e.charAt(t) || n("'") ? i += e.charAt(t) : s = !1; else switch (e.charAt(t)) {
  1690. case"d":
  1691. case"m":
  1692. case"y":
  1693. case"@":
  1694. i += "0123456789";
  1695. break;
  1696. case"D":
  1697. case"M":
  1698. return null;
  1699. case"'":
  1700. n("'") ? i += "'" : s = !0;
  1701. break;
  1702. default:
  1703. i += e.charAt(t)
  1704. }
  1705. return i
  1706. },
  1707. _get: function (e, t) {
  1708. return void 0 !== e.settings[t] ? e.settings[t] : this._defaults[t]
  1709. },
  1710. _setDateFromField: function (e, t) {
  1711. if (e.input.val() !== e.lastVal) {
  1712. var i = this._get(e, "dateFormat"), s = e.lastVal = e.input ? e.input.val() : null,
  1713. n = this._getDefaultDate(e), a = n, o = this._getFormatConfig(e);
  1714. try {
  1715. a = this.parseDate(i, s, o) || n
  1716. } catch (r) {
  1717. s = t ? "" : s
  1718. }
  1719. e.selectedDay = a.getDate(), e.drawMonth = e.selectedMonth = a.getMonth(), e.drawYear = e.selectedYear = a.getFullYear(), e.currentDay = s ? a.getDate() : 0, e.currentMonth = s ? a.getMonth() : 0, e.currentYear = s ? a.getFullYear() : 0, this._adjustInstDate(e)
  1720. }
  1721. },
  1722. _getDefaultDate: function (e) {
  1723. return this._restrictMinMax(e, this._determineDate(e, this._get(e, "defaultDate"), new Date))
  1724. },
  1725. _determineDate: function (t, i, s) {
  1726. var n = function (e) {
  1727. var t = new Date;
  1728. return t.setDate(t.getDate() + e), t
  1729. }, a = function (i) {
  1730. try {
  1731. return e.datepicker.parseDate(e.datepicker._get(t, "dateFormat"), i, e.datepicker._getFormatConfig(t))
  1732. } catch (s) {
  1733. }
  1734. for (var n = (i.toLowerCase().match(/^c/) ? e.datepicker._getDate(t) : null) || new Date, a = n.getFullYear(), o = n.getMonth(), r = n.getDate(), h = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, l = h.exec(i); l;) {
  1735. switch (l[2] || "d") {
  1736. case"d":
  1737. case"D":
  1738. r += parseInt(l[1], 10);
  1739. break;
  1740. case"w":
  1741. case"W":
  1742. r += 7 * parseInt(l[1], 10);
  1743. break;
  1744. case"m":
  1745. case"M":
  1746. o += parseInt(l[1], 10), r = Math.min(r, e.datepicker._getDaysInMonth(a, o));
  1747. break;
  1748. case"y":
  1749. case"Y":
  1750. a += parseInt(l[1], 10), r = Math.min(r, e.datepicker._getDaysInMonth(a, o))
  1751. }
  1752. l = h.exec(i)
  1753. }
  1754. return new Date(a, o, r)
  1755. },
  1756. o = null == i || "" === i ? s : "string" == typeof i ? a(i) : "number" == typeof i ? isNaN(i) ? s : n(i) : new Date(i.getTime());
  1757. return o = o && "Invalid Date" == "" + o ? s : o, o && (o.setHours(0), o.setMinutes(0), o.setSeconds(0), o.setMilliseconds(0)), this._daylightSavingAdjust(o)
  1758. },
  1759. _daylightSavingAdjust: function (e) {
  1760. return e ? (e.setHours(e.getHours() > 12 ? e.getHours() + 2 : 0), e) : null
  1761. },
  1762. _setDate: function (e, t, i) {
  1763. var s = !t, n = e.selectedMonth, a = e.selectedYear,
  1764. o = this._restrictMinMax(e, this._determineDate(e, t, new Date));
  1765. e.selectedDay = e.currentDay = o.getDate(), e.drawMonth = e.selectedMonth = e.currentMonth = o.getMonth(), e.drawYear = e.selectedYear = e.currentYear = o.getFullYear(), n === e.selectedMonth && a === e.selectedYear || i || this._notifyChange(e), this._adjustInstDate(e), e.input && e.input.val(s ? "" : this._formatDate(e))
  1766. },
  1767. _getDate: function (e) {
  1768. var t = !e.currentYear || e.input && "" === e.input.val() ? null : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay));
  1769. return t
  1770. },
  1771. _attachHandlers: function (t) {
  1772. var i = this._get(t, "stepMonths"), s = "#" + t.id.replace(/\\\\/g, "\\");
  1773. t.dpDiv.find("[data-handler]").map(function () {
  1774. var t = {
  1775. prev: function () {
  1776. e.datepicker._adjustDate(s, -i, "M")
  1777. }, next: function () {
  1778. e.datepicker._adjustDate(s, +i, "M")
  1779. }, hide: function () {
  1780. e.datepicker._hideDatepicker()
  1781. }, today: function () {
  1782. e.datepicker._gotoToday(s)
  1783. }, selectDay: function () {
  1784. return e.datepicker._selectDay(s, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this), !1
  1785. }, selectMonth: function () {
  1786. return e.datepicker._selectMonthYear(s, this, "M"), !1
  1787. }, selectYear: function () {
  1788. return e.datepicker._selectMonthYear(s, this, "Y"), !1
  1789. }
  1790. };
  1791. e(this).bind(this.getAttribute("data-event"), t[this.getAttribute("data-handler")])
  1792. })
  1793. },
  1794. _generateHTML: function (e) {
  1795. var t, i, s, n, a, o, r, h, l, u, d, c, p, f, m, g, v, y, b, _, x, w, k, T, D, S, M, C, N, A, P, I, z, H, F,
  1796. E, O, j, W, L = new Date,
  1797. R = this._daylightSavingAdjust(new Date(L.getFullYear(), L.getMonth(), L.getDate())),
  1798. Y = this._get(e, "isRTL"), B = this._get(e, "showButtonPanel"), J = this._get(e, "hideIfNoPrevNext"),
  1799. q = this._get(e, "navigationAsDateFormat"), K = this._getNumberOfMonths(e),
  1800. V = this._get(e, "showCurrentAtPos"), U = this._get(e, "stepMonths"), Q = 1 !== K[0] || 1 !== K[1],
  1801. G = this._daylightSavingAdjust(e.currentDay ? new Date(e.currentYear, e.currentMonth, e.currentDay) : new Date(9999, 9, 9)),
  1802. X = this._getMinMaxDate(e, "min"), $ = this._getMinMaxDate(e, "max"), Z = e.drawMonth - V,
  1803. et = e.drawYear;
  1804. if (0 > Z && (Z += 12, et--), $) for (t = this._daylightSavingAdjust(new Date($.getFullYear(), $.getMonth() - K[0] * K[1] + 1, $.getDate())), t = X && X > t ? X : t; this._daylightSavingAdjust(new Date(et, Z, 1)) > t;) Z--, 0 > Z && (Z = 11, et--);
  1805. for (e.drawMonth = Z, e.drawYear = et, i = this._get(e, "prevText"), i = q ? this.formatDate(i, this._daylightSavingAdjust(new Date(et, Z - U, 1)), this._getFormatConfig(e)) : i, s = this._canAdjustMonth(e, -1, et, Z) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "e" : "w") + "'>" + i + "</span></a>" : J ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "e" : "w") + "'>" + i + "</span></a>", n = this._get(e, "nextText"), n = q ? this.formatDate(n, this._daylightSavingAdjust(new Date(et, Z + U, 1)), this._getFormatConfig(e)) : n, a = this._canAdjustMonth(e, 1, et, Z) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='" + n + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "w" : "e") + "'>" + n + "</span></a>" : J ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + n + "'><span class='ui-icon ui-icon-circle-triangle-" + (Y ? "w" : "e") + "'>" + n + "</span></a>", o = this._get(e, "currentText"), r = this._get(e, "gotoCurrent") && e.currentDay ? G : R, o = q ? this.formatDate(o, r, this._getFormatConfig(e)) : o, h = e.inline ? "" : "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(e, "closeText") + "</button>", l = B ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (Y ? h : "") + (this._isInRange(e, r) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>" + o + "</button>" : "") + (Y ? "" : h) + "</div>" : "", u = parseInt(this._get(e, "firstDay"), 10), u = isNaN(u) ? 0 : u, d = this._get(e, "showWeek"), c = this._get(e, "dayNames"), p = this._get(e, "dayNamesMin"), f = this._get(e, "monthNames"), m = this._get(e, "monthNamesShort"), g = this._get(e, "beforeShowDay"), v = this._get(e, "showOtherMonths"), y = this._get(e, "selectOtherMonths"), b = this._getDefaultDate(e), _ = "", w = 0; K[0] > w; w++) {
  1806. for (k = "", this.maxRows = 4, T = 0; K[1] > T; T++) {
  1807. if (D = this._daylightSavingAdjust(new Date(et, Z, e.selectedDay)), S = " ui-corner-all", M = "", Q) {
  1808. if (M += "<div class='ui-datepicker-group", K[1] > 1) switch (T) {
  1809. case 0:
  1810. M += " ui-datepicker-group-first", S = " ui-corner-" + (Y ? "right" : "left");
  1811. break;
  1812. case K[1] - 1:
  1813. M += " ui-datepicker-group-last", S = " ui-corner-" + (Y ? "left" : "right");
  1814. break;
  1815. default:
  1816. M += " ui-datepicker-group-middle", S = ""
  1817. }
  1818. M += "'>"
  1819. }
  1820. for (M += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + S + "'>" + (/all|left/.test(S) && 0 === w ? Y ? a : s : "") + (/all|right/.test(S) && 0 === w ? Y ? s : a : "") + this._generateMonthYearHeader(e, Z, et, X, $, w > 0 || T > 0, f, m) + "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>", C = d ? "<th class='ui-datepicker-week-col'>" + this._get(e, "weekHeader") + "</th>" : "", x = 0; 7 > x; x++) N = (x + u) % 7, C += "<th scope='col'" + ((x + u + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + c[N] + "'>" + p[N] + "</span></th>";
  1821. for (M += C + "</tr></thead><tbody>", A = this._getDaysInMonth(et, Z), et === e.selectedYear && Z === e.selectedMonth && (e.selectedDay = Math.min(e.selectedDay, A)), P = (this._getFirstDayOfMonth(et, Z) - u + 7) % 7, I = Math.ceil((P + A) / 7), z = Q ? this.maxRows > I ? this.maxRows : I : I, this.maxRows = z, H = this._daylightSavingAdjust(new Date(et, Z, 1 - P)), F = 0; z > F; F++) {
  1822. for (M += "<tr>", E = d ? "<td class='ui-datepicker-week-col'>" + this._get(e, "calculateWeek")(H) + "</td>" : "", x = 0; 7 > x; x++) O = g ? g.apply(e.input ? e.input[0] : null, [H]) : [!0, ""], j = H.getMonth() !== Z, W = j && !y || !O[0] || X && X > H || $ && H > $, E += "<td class='" + ((x + u + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (j ? " ui-datepicker-other-month" : "") + (H.getTime() === D.getTime() && Z === e.selectedMonth && e._keyEvent || b.getTime() === H.getTime() && b.getTime() === D.getTime() ? " " + this._dayOverClass : "") + (W ? " " + this._unselectableClass + " ui-state-disabled" : "") + (j && !v ? "" : " " + O[1] + (H.getTime() === G.getTime() ? " " + this._currentClass : "") + (H.getTime() === R.getTime() ? " ui-datepicker-today" : "")) + "'" + (j && !v || !O[2] ? "" : " title='" + O[2].replace(/'/g, "&#39;") + "'") + (W ? "" : " data-handler='selectDay' data-event='click' data-month='" + H.getMonth() + "' data-year='" + H.getFullYear() + "'") + ">" + (j && !v ? "&#xa0;" : W ? "<span class='ui-state-default'>" + H.getDate() + "</span>" : "<a class='ui-state-default" + (H.getTime() === R.getTime() ? " ui-state-highlight" : "") + (H.getTime() === G.getTime() ? " ui-state-active" : "") + (j ? " ui-priority-secondary" : "") + "' href='#'>" + H.getDate() + "</a>") + "</td>", H.setDate(H.getDate() + 1), H = this._daylightSavingAdjust(H);
  1823. M += E + "</tr>"
  1824. }
  1825. Z++, Z > 11 && (Z = 0, et++), M += "</tbody></table>" + (Q ? "</div>" + (K[0] > 0 && T === K[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : ""), k += M
  1826. }
  1827. _ += k
  1828. }
  1829. return _ += l, e._keyEvent = !1, _
  1830. },
  1831. _generateMonthYearHeader: function (e, t, i, s, n, a, o, r) {
  1832. var h, l, u, d, c, p, f, m, g = this._get(e, "changeMonth"), v = this._get(e, "changeYear"),
  1833. y = this._get(e, "showMonthAfterYear"), b = "<div class='ui-datepicker-title'>", _ = "";
  1834. if (a || !g) _ += "<span class='ui-datepicker-month'>" + o[t] + "</span>"; else {
  1835. for (h = s && s.getFullYear() === i, l = n && n.getFullYear() === i, _ += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>", u = 0; 12 > u; u++) (!h || u >= s.getMonth()) && (!l || n.getMonth() >= u) && (_ += "<option value='" + u + "'" + (u === t ? " selected='selected'" : "") + ">" + r[u] + "</option>");
  1836. _ += "</select>"
  1837. }
  1838. if (y || (b += _ + (!a && g && v ? "" : "&#xa0;")), !e.yearshtml) if (e.yearshtml = "", a || !v) b += "<span class='ui-datepicker-year'>" + i + "</span>"; else {
  1839. for (d = this._get(e, "yearRange").split(":"), c = (new Date).getFullYear(), p = function (e) {
  1840. var t = e.match(/c[+\-].*/) ? i + parseInt(e.substring(1), 10) : e.match(/[+\-].*/) ? c + parseInt(e, 10) : parseInt(e, 10);
  1841. return isNaN(t) ? c : t
  1842. }, f = p(d[0]), m = Math.max(f, p(d[1] || "")), f = s ? Math.max(f, s.getFullYear()) : f, m = n ? Math.min(m, n.getFullYear()) : m, e.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; m >= f; f++) e.yearshtml += "<option value='" + f + "'" + (f === i ? " selected='selected'" : "") + ">" + f + "</option>";
  1843. e.yearshtml += "</select>", b += e.yearshtml, e.yearshtml = null
  1844. }
  1845. return b += this._get(e, "yearSuffix"), y && (b += (!a && g && v ? "" : "&#xa0;") + _), b += "</div>"
  1846. },
  1847. _adjustInstDate: function (e, t, i) {
  1848. var s = e.drawYear + ("Y" === i ? t : 0), n = e.drawMonth + ("M" === i ? t : 0),
  1849. a = Math.min(e.selectedDay, this._getDaysInMonth(s, n)) + ("D" === i ? t : 0),
  1850. o = this._restrictMinMax(e, this._daylightSavingAdjust(new Date(s, n, a)));
  1851. e.selectedDay = o.getDate(), e.drawMonth = e.selectedMonth = o.getMonth(), e.drawYear = e.selectedYear = o.getFullYear(), ("M" === i || "Y" === i) && this._notifyChange(e)
  1852. },
  1853. _restrictMinMax: function (e, t) {
  1854. var i = this._getMinMaxDate(e, "min"), s = this._getMinMaxDate(e, "max"), n = i && i > t ? i : t;
  1855. return s && n > s ? s : n
  1856. },
  1857. _notifyChange: function (e) {
  1858. var t = this._get(e, "onChangeMonthYear");
  1859. t && t.apply(e.input ? e.input[0] : null, [e.selectedYear, e.selectedMonth + 1, e])
  1860. },
  1861. _getNumberOfMonths: function (e) {
  1862. var t = this._get(e, "numberOfMonths");
  1863. return null == t ? [1, 1] : "number" == typeof t ? [1, t] : t
  1864. },
  1865. _getMinMaxDate: function (e, t) {
  1866. return this._determineDate(e, this._get(e, t + "Date"), null)
  1867. },
  1868. _getDaysInMonth: function (e, t) {
  1869. return 32 - this._daylightSavingAdjust(new Date(e, t, 32)).getDate()
  1870. },
  1871. _getFirstDayOfMonth: function (e, t) {
  1872. return new Date(e, t, 1).getDay()
  1873. },
  1874. _canAdjustMonth: function (e, t, i, s) {
  1875. var n = this._getNumberOfMonths(e),
  1876. a = this._daylightSavingAdjust(new Date(i, s + (0 > t ? t : n[0] * n[1]), 1));
  1877. return 0 > t && a.setDate(this._getDaysInMonth(a.getFullYear(), a.getMonth())), this._isInRange(e, a)
  1878. },
  1879. _isInRange: function (e, t) {
  1880. var i, s, n = this._getMinMaxDate(e, "min"), a = this._getMinMaxDate(e, "max"), o = null, r = null,
  1881. h = this._get(e, "yearRange");
  1882. return h && (i = h.split(":"), s = (new Date).getFullYear(), o = parseInt(i[0], 10), r = parseInt(i[1], 10), i[0].match(/[+\-].*/) && (o += s), i[1].match(/[+\-].*/) && (r += s)), (!n || t.getTime() >= n.getTime()) && (!a || t.getTime() <= a.getTime()) && (!o || t.getFullYear() >= o) && (!r || r >= t.getFullYear())
  1883. },
  1884. _getFormatConfig: function (e) {
  1885. var t = this._get(e, "shortYearCutoff");
  1886. return t = "string" != typeof t ? t : (new Date).getFullYear() % 100 + parseInt(t, 10), {
  1887. shortYearCutoff: t,
  1888. dayNamesShort: this._get(e, "dayNamesShort"),
  1889. dayNames: this._get(e, "dayNames"),
  1890. monthNamesShort: this._get(e, "monthNamesShort"),
  1891. monthNames: this._get(e, "monthNames")
  1892. }
  1893. },
  1894. _formatDate: function (e, t, i, s) {
  1895. t || (e.currentDay = e.selectedDay, e.currentMonth = e.selectedMonth, e.currentYear = e.selectedYear);
  1896. var n = t ? "object" == typeof t ? t : this._daylightSavingAdjust(new Date(s, i, t)) : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay));
  1897. return this.formatDate(this._get(e, "dateFormat"), n, this._getFormatConfig(e))
  1898. }
  1899. }), e.fn.datepicker = function (t) {
  1900. if (!this.length) return this;
  1901. e.datepicker.initialized || (e(document).mousedown(e.datepicker._checkExternalClick), e.datepicker.initialized = !0), 0 === e("#" + e.datepicker._mainDivId).length && e("body").append(e.datepicker.dpDiv);
  1902. var i = Array.prototype.slice.call(arguments, 1);
  1903. return "string" != typeof t || "isDisabled" !== t && "getDate" !== t && "widget" !== t ? "option" === t && 2 === arguments.length && "string" == typeof arguments[1] ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(i)) : this.each(function () {
  1904. "string" == typeof t ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this].concat(i)) : e.datepicker._attachDatepicker(this, t)
  1905. }) : e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(i))
  1906. }, e.datepicker = new n, e.datepicker.initialized = !1, e.datepicker.uuid = (new Date).getTime(), e.datepicker.version = "1.11.2", e.datepicker, e.widget("ui.draggable", e.ui.mouse, {
  1907. version: "1.11.2",
  1908. widgetEventPrefix: "drag",
  1909. options: {
  1910. addClasses: !0,
  1911. appendTo: "parent",
  1912. axis: !1,
  1913. connectToSortable: !1,
  1914. containment: !1,
  1915. cursor: "auto",
  1916. cursorAt: !1,
  1917. grid: !1,
  1918. handle: !1,
  1919. helper: "original",
  1920. iframeFix: !1,
  1921. opacity: !1,
  1922. refreshPositions: !1,
  1923. revert: !1,
  1924. revertDuration: 500,
  1925. scope: "default",
  1926. scroll: !0,
  1927. scrollSensitivity: 20,
  1928. scrollSpeed: 20,
  1929. snap: !1,
  1930. snapMode: "both",
  1931. snapTolerance: 20,
  1932. stack: !1,
  1933. zIndex: !1,
  1934. drag: null,
  1935. start: null,
  1936. stop: null
  1937. },
  1938. _create: function () {
  1939. "original" === this.options.helper && this._setPositionRelative(), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._setHandleClassName(), this._mouseInit()
  1940. },
  1941. _setOption: function (e, t) {
  1942. this._super(e, t), "handle" === e && (this._removeHandleClassName(), this._setHandleClassName())
  1943. },
  1944. _destroy: function () {
  1945. return (this.helper || this.element).is(".ui-draggable-dragging") ? (this.destroyOnClear = !0, void 0) : (this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._removeHandleClassName(), this._mouseDestroy(), void 0)
  1946. },
  1947. _mouseCapture: function (t) {
  1948. var i = this.options;
  1949. return this._blurActiveElement(t), this.helper || i.disabled || e(t.target).closest(".ui-resizable-handle").length > 0 ? !1 : (this.handle = this._getHandle(t), this.handle ? (this._blockFrames(i.iframeFix === !0 ? "iframe" : i.iframeFix), !0) : !1)
  1950. },
  1951. _blockFrames: function (t) {
  1952. this.iframeBlocks = this.document.find(t).map(function () {
  1953. var t = e(this);
  1954. return e("<div>").css("position", "absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]
  1955. })
  1956. },
  1957. _unblockFrames: function () {
  1958. this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks)
  1959. },
  1960. _blurActiveElement: function (t) {
  1961. var i = this.document[0];
  1962. if (this.handleElement.is(t.target)) try {
  1963. i.activeElement && "body" !== i.activeElement.nodeName.toLowerCase() && e(i.activeElement).blur()
  1964. } catch (s) {
  1965. }
  1966. },
  1967. _mouseStart: function (t) {
  1968. var i = this.options;
  1969. return this.helper = this._createHelper(t), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), e.ui.ddmanager && (e.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(!0), this.offsetParent = this.helper.offsetParent(), this.hasFixedAncestor = this.helper.parents().filter(function () {
  1970. return "fixed" === e(this).css("position")
  1971. }).length > 0, this.positionAbs = this.element.offset(), this._refreshOffsets(t), this.originalPosition = this.position = this._generatePosition(t, !1), this.originalPageX = t.pageX, this.originalPageY = t.pageY, i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt), this._setContainment(), this._trigger("start", t) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), e.ui.ddmanager && !i.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this._normalizeRightBottom(), this._mouseDrag(t, !0), e.ui.ddmanager && e.ui.ddmanager.dragStart(this, t), !0)
  1972. },
  1973. _refreshOffsets: function (e) {
  1974. this.offset = {
  1975. top: this.positionAbs.top - this.margins.top,
  1976. left: this.positionAbs.left - this.margins.left,
  1977. scroll: !1,
  1978. parent: this._getParentOffset(),
  1979. relative: this._getRelativeOffset()
  1980. }, this.offset.click = {left: e.pageX - this.offset.left, top: e.pageY - this.offset.top}
  1981. },
  1982. _mouseDrag: function (t, i) {
  1983. if (this.hasFixedAncestor && (this.offset.parent = this._getParentOffset()), this.position = this._generatePosition(t, !0), this.positionAbs = this._convertPositionTo("absolute"), !i) {
  1984. var s = this._uiHash();
  1985. if (this._trigger("drag", t, s) === !1) return this._mouseUp({}), !1;
  1986. this.position = s.position
  1987. }
  1988. return this.helper[0].style.left = this.position.left + "px", this.helper[0].style.top = this.position.top + "px", e.ui.ddmanager && e.ui.ddmanager.drag(this, t), !1
  1989. },
  1990. _mouseStop: function (t) {
  1991. var i = this, s = !1;
  1992. return e.ui.ddmanager && !this.options.dropBehaviour && (s = e.ui.ddmanager.drop(this, t)), this.dropped && (s = this.dropped, this.dropped = !1), "invalid" === this.options.revert && !s || "valid" === this.options.revert && s || this.options.revert === !0 || e.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? e(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () {
  1993. i._trigger("stop", t) !== !1 && i._clear()
  1994. }) : this._trigger("stop", t) !== !1 && this._clear(), !1
  1995. },
  1996. _mouseUp: function (t) {
  1997. return this._unblockFrames(), e.ui.ddmanager && e.ui.ddmanager.dragStop(this, t), this.handleElement.is(t.target) && this.element.focus(), e.ui.mouse.prototype._mouseUp.call(this, t)
  1998. },
  1999. cancel: function () {
  2000. return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this
  2001. },
  2002. _getHandle: function (t) {
  2003. return this.options.handle ? !!e(t.target).closest(this.element.find(this.options.handle)).length : !0
  2004. },
  2005. _setHandleClassName: function () {
  2006. this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element, this.handleElement.addClass("ui-draggable-handle")
  2007. },
  2008. _removeHandleClassName: function () {
  2009. this.handleElement.removeClass("ui-draggable-handle")
  2010. },
  2011. _createHelper: function (t) {
  2012. var i = this.options, s = e.isFunction(i.helper),
  2013. n = s ? e(i.helper.apply(this.element[0], [t])) : "clone" === i.helper ? this.element.clone().removeAttr("id") : this.element;
  2014. return n.parents("body").length || n.appendTo("parent" === i.appendTo ? this.element[0].parentNode : i.appendTo), s && n[0] === this.element[0] && this._setPositionRelative(), n[0] === this.element[0] || /(fixed|absolute)/.test(n.css("position")) || n.css("position", "absolute"), n
  2015. },
  2016. _setPositionRelative: function () {
  2017. /^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative")
  2018. },
  2019. _adjustOffsetFromHelper: function (t) {
  2020. "string" == typeof t && (t = t.split(" ")), e.isArray(t) && (t = {
  2021. left: +t[0],
  2022. top: +t[1] || 0
  2023. }), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top)
  2024. },
  2025. _isRootNode: function (e) {
  2026. return /(html|body)/i.test(e.tagName) || e === this.document[0]
  2027. },
  2028. _getParentOffset: function () {
  2029. var t = this.offsetParent.offset(), i = this.document[0];
  2030. return "absolute" === this.cssPosition && this.scrollParent[0] !== i && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop()), this._isRootNode(this.offsetParent[0]) && (t = {
  2031. top: 0,
  2032. left: 0
  2033. }), {
  2034. top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
  2035. left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
  2036. }
  2037. },
  2038. _getRelativeOffset: function () {
  2039. if ("relative" !== this.cssPosition) return {top: 0, left: 0};
  2040. var e = this.element.position(), t = this._isRootNode(this.scrollParent[0]);
  2041. return {
  2042. top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + (t ? 0 : this.scrollParent.scrollTop()),
  2043. left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + (t ? 0 : this.scrollParent.scrollLeft())
  2044. }
  2045. },
  2046. _cacheMargins: function () {
  2047. this.margins = {
  2048. left: parseInt(this.element.css("marginLeft"), 10) || 0,
  2049. top: parseInt(this.element.css("marginTop"), 10) || 0,
  2050. right: parseInt(this.element.css("marginRight"), 10) || 0,
  2051. bottom: parseInt(this.element.css("marginBottom"), 10) || 0
  2052. }
  2053. },
  2054. _cacheHelperProportions: function () {
  2055. this.helperProportions = {width: this.helper.outerWidth(), height: this.helper.outerHeight()}
  2056. },
  2057. _setContainment: function () {
  2058. var t, i, s, n = this.options, a = this.document[0];
  2059. return this.relativeContainer = null, n.containment ? "window" === n.containment ? (this.containment = [e(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, e(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, e(window).scrollLeft() + e(window).width() - this.helperProportions.width - this.margins.left, e(window).scrollTop() + (e(window).height() || a.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], void 0) : "document" === n.containment ? (this.containment = [0, 0, e(a).width() - this.helperProportions.width - this.margins.left, (e(a).height() || a.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], void 0) : n.containment.constructor === Array ? (this.containment = n.containment, void 0) : ("parent" === n.containment && (n.containment = this.helper[0].parentNode), i = e(n.containment), s = i[0], s && (t = /(scroll|auto)/.test(i.css("overflow")), this.containment = [(parseInt(i.css("borderLeftWidth"), 10) || 0) + (parseInt(i.css("paddingLeft"), 10) || 0), (parseInt(i.css("borderTopWidth"), 10) || 0) + (parseInt(i.css("paddingTop"), 10) || 0), (t ? Math.max(s.scrollWidth, s.offsetWidth) : s.offsetWidth) - (parseInt(i.css("borderRightWidth"), 10) || 0) - (parseInt(i.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (t ? Math.max(s.scrollHeight, s.offsetHeight) : s.offsetHeight) - (parseInt(i.css("borderBottomWidth"), 10) || 0) - (parseInt(i.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relativeContainer = i), void 0) : (this.containment = null, void 0)
  2060. },
  2061. _convertPositionTo: function (e, t) {
  2062. t || (t = this.position);
  2063. var i = "absolute" === e ? 1 : -1, s = this._isRootNode(this.scrollParent[0]);
  2064. return {
  2065. top: t.top + this.offset.relative.top * i + this.offset.parent.top * i - ("fixed" === this.cssPosition ? -this.offset.scroll.top : s ? 0 : this.offset.scroll.top) * i,
  2066. left: t.left + this.offset.relative.left * i + this.offset.parent.left * i - ("fixed" === this.cssPosition ? -this.offset.scroll.left : s ? 0 : this.offset.scroll.left) * i
  2067. }
  2068. },
  2069. _generatePosition: function (e, t) {
  2070. var i, s, n, a, o = this.options, r = this._isRootNode(this.scrollParent[0]), h = e.pageX, l = e.pageY;
  2071. return r && this.offset.scroll || (this.offset.scroll = {
  2072. top: this.scrollParent.scrollTop(),
  2073. left: this.scrollParent.scrollLeft()
  2074. }), t && (this.containment && (this.relativeContainer ? (s = this.relativeContainer.offset(), i = [this.containment[0] + s.left, this.containment[1] + s.top, this.containment[2] + s.left, this.containment[3] + s.top]) : i = this.containment, e.pageX - this.offset.click.left < i[0] && (h = i[0] + this.offset.click.left), e.pageY - this.offset.click.top < i[1] && (l = i[1] + this.offset.click.top), e.pageX - this.offset.click.left > i[2] && (h = i[2] + this.offset.click.left), e.pageY - this.offset.click.top > i[3] && (l = i[3] + this.offset.click.top)), o.grid && (n = o.grid[1] ? this.originalPageY + Math.round((l - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY, l = i ? n - this.offset.click.top >= i[1] || n - this.offset.click.top > i[3] ? n : n - this.offset.click.top >= i[1] ? n - o.grid[1] : n + o.grid[1] : n, a = o.grid[0] ? this.originalPageX + Math.round((h - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX, h = i ? a - this.offset.click.left >= i[0] || a - this.offset.click.left > i[2] ? a : a - this.offset.click.left >= i[0] ? a - o.grid[0] : a + o.grid[0] : a), "y" === o.axis && (h = this.originalPageX), "x" === o.axis && (l = this.originalPageY)), {
  2075. top: l - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.offset.scroll.top : r ? 0 : this.offset.scroll.top),
  2076. left: h - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.offset.scroll.left : r ? 0 : this.offset.scroll.left)
  2077. }
  2078. },
  2079. _clear: function () {
  2080. this.helper.removeClass("ui-draggable-dragging"), this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1, this.destroyOnClear && this.destroy()
  2081. },
  2082. _normalizeRightBottom: function () {
  2083. "y" !== this.options.axis && "auto" !== this.helper.css("right") && (this.helper.width(this.helper.width()), this.helper.css("right", "auto")), "x" !== this.options.axis && "auto" !== this.helper.css("bottom") && (this.helper.height(this.helper.height()), this.helper.css("bottom", "auto"))
  2084. },
  2085. _trigger: function (t, i, s) {
  2086. return s = s || this._uiHash(), e.ui.plugin.call(this, t, [i, s, this], !0), /^(drag|start|stop)/.test(t) && (this.positionAbs = this._convertPositionTo("absolute"), s.offset = this.positionAbs), e.Widget.prototype._trigger.call(this, t, i, s)
  2087. },
  2088. plugins: {},
  2089. _uiHash: function () {
  2090. return {
  2091. helper: this.helper,
  2092. position: this.position,
  2093. originalPosition: this.originalPosition,
  2094. offset: this.positionAbs
  2095. }
  2096. }
  2097. }), e.ui.plugin.add("draggable", "connectToSortable", {
  2098. start: function (t, i, s) {
  2099. var n = e.extend({}, i, {item: s.element});
  2100. s.sortables = [], e(s.options.connectToSortable).each(function () {
  2101. var i = e(this).sortable("instance");
  2102. i && !i.options.disabled && (s.sortables.push(i), i.refreshPositions(), i._trigger("activate", t, n))
  2103. })
  2104. }, stop: function (t, i, s) {
  2105. var n = e.extend({}, i, {item: s.element});
  2106. s.cancelHelperRemoval = !1, e.each(s.sortables, function () {
  2107. var e = this;
  2108. e.isOver ? (e.isOver = 0, s.cancelHelperRemoval = !0, e.cancelHelperRemoval = !1, e._storedCSS = {
  2109. position: e.placeholder.css("position"),
  2110. top: e.placeholder.css("top"),
  2111. left: e.placeholder.css("left")
  2112. }, e._mouseStop(t), e.options.helper = e.options._helper) : (e.cancelHelperRemoval = !0, e._trigger("deactivate", t, n))
  2113. })
  2114. }, drag: function (t, i, s) {
  2115. e.each(s.sortables, function () {
  2116. var n = !1, a = this;
  2117. a.positionAbs = s.positionAbs, a.helperProportions = s.helperProportions, a.offset.click = s.offset.click, a._intersectsWith(a.containerCache) && (n = !0, e.each(s.sortables, function () {
  2118. return this.positionAbs = s.positionAbs, this.helperProportions = s.helperProportions, this.offset.click = s.offset.click, this !== a && this._intersectsWith(this.containerCache) && e.contains(a.element[0], this.element[0]) && (n = !1), n
  2119. })), n ? (a.isOver || (a.isOver = 1, a.currentItem = i.helper.appendTo(a.element).data("ui-sortable-item", !0), a.options._helper = a.options.helper, a.options.helper = function () {
  2120. return i.helper[0]
  2121. }, t.target = a.currentItem[0], a._mouseCapture(t, !0), a._mouseStart(t, !0, !0), a.offset.click.top = s.offset.click.top, a.offset.click.left = s.offset.click.left, a.offset.parent.left -= s.offset.parent.left - a.offset.parent.left, a.offset.parent.top -= s.offset.parent.top - a.offset.parent.top, s._trigger("toSortable", t), s.dropped = a.element, e.each(s.sortables, function () {
  2122. this.refreshPositions()
  2123. }), s.currentItem = s.element, a.fromOutside = s), a.currentItem && (a._mouseDrag(t), i.position = a.position)) : a.isOver && (a.isOver = 0, a.cancelHelperRemoval = !0, a.options._revert = a.options.revert, a.options.revert = !1, a._trigger("out", t, a._uiHash(a)), a._mouseStop(t, !0), a.options.revert = a.options._revert, a.options.helper = a.options._helper, a.placeholder && a.placeholder.remove(), s._refreshOffsets(t), i.position = s._generatePosition(t, !0), s._trigger("fromSortable", t), s.dropped = !1, e.each(s.sortables, function () {
  2124. this.refreshPositions()
  2125. }))
  2126. })
  2127. }
  2128. }), e.ui.plugin.add("draggable", "cursor", {
  2129. start: function (t, i, s) {
  2130. var n = e("body"), a = s.options;
  2131. n.css("cursor") && (a._cursor = n.css("cursor")), n.css("cursor", a.cursor)
  2132. }, stop: function (t, i, s) {
  2133. var n = s.options;
  2134. n._cursor && e("body").css("cursor", n._cursor)
  2135. }
  2136. }), e.ui.plugin.add("draggable", "opacity", {
  2137. start: function (t, i, s) {
  2138. var n = e(i.helper), a = s.options;
  2139. n.css("opacity") && (a._opacity = n.css("opacity")), n.css("opacity", a.opacity)
  2140. }, stop: function (t, i, s) {
  2141. var n = s.options;
  2142. n._opacity && e(i.helper).css("opacity", n._opacity)
  2143. }
  2144. }), e.ui.plugin.add("draggable", "scroll", {
  2145. start: function (e, t, i) {
  2146. i.scrollParentNotHidden || (i.scrollParentNotHidden = i.helper.scrollParent(!1)), i.scrollParentNotHidden[0] !== i.document[0] && "HTML" !== i.scrollParentNotHidden[0].tagName && (i.overflowOffset = i.scrollParentNotHidden.offset())
  2147. }, drag: function (t, i, s) {
  2148. var n = s.options, a = !1, o = s.scrollParentNotHidden[0], r = s.document[0];
  2149. o !== r && "HTML" !== o.tagName ? (n.axis && "x" === n.axis || (s.overflowOffset.top + o.offsetHeight - t.pageY < n.scrollSensitivity ? o.scrollTop = a = o.scrollTop + n.scrollSpeed : t.pageY - s.overflowOffset.top < n.scrollSensitivity && (o.scrollTop = a = o.scrollTop - n.scrollSpeed)), n.axis && "y" === n.axis || (s.overflowOffset.left + o.offsetWidth - t.pageX < n.scrollSensitivity ? o.scrollLeft = a = o.scrollLeft + n.scrollSpeed : t.pageX - s.overflowOffset.left < n.scrollSensitivity && (o.scrollLeft = a = o.scrollLeft - n.scrollSpeed))) : (n.axis && "x" === n.axis || (t.pageY - e(r).scrollTop() < n.scrollSensitivity ? a = e(r).scrollTop(e(r).scrollTop() - n.scrollSpeed) : e(window).height() - (t.pageY - e(r).scrollTop()) < n.scrollSensitivity && (a = e(r).scrollTop(e(r).scrollTop() + n.scrollSpeed))), n.axis && "y" === n.axis || (t.pageX - e(r).scrollLeft() < n.scrollSensitivity ? a = e(r).scrollLeft(e(r).scrollLeft() - n.scrollSpeed) : e(window).width() - (t.pageX - e(r).scrollLeft()) < n.scrollSensitivity && (a = e(r).scrollLeft(e(r).scrollLeft() + n.scrollSpeed)))), a !== !1 && e.ui.ddmanager && !n.dropBehaviour && e.ui.ddmanager.prepareOffsets(s, t)
  2150. }
  2151. }), e.ui.plugin.add("draggable", "snap", {
  2152. start: function (t, i, s) {
  2153. var n = s.options;
  2154. s.snapElements = [], e(n.snap.constructor !== String ? n.snap.items || ":data(ui-draggable)" : n.snap).each(function () {
  2155. var t = e(this), i = t.offset();
  2156. this !== s.element[0] && s.snapElements.push({
  2157. item: this,
  2158. width: t.outerWidth(),
  2159. height: t.outerHeight(),
  2160. top: i.top,
  2161. left: i.left
  2162. })
  2163. })
  2164. }, drag: function (t, i, s) {
  2165. var n, a, o, r, h, l, u, d, c, p, f = s.options, m = f.snapTolerance, g = i.offset.left,
  2166. v = g + s.helperProportions.width, y = i.offset.top, b = y + s.helperProportions.height;
  2167. for (c = s.snapElements.length - 1; c >= 0; c--) h = s.snapElements[c].left - s.margins.left, l = h + s.snapElements[c].width, u = s.snapElements[c].top - s.margins.top, d = u + s.snapElements[c].height, h - m > v || g > l + m || u - m > b || y > d + m || !e.contains(s.snapElements[c].item.ownerDocument, s.snapElements[c].item) ? (s.snapElements[c].snapping && s.options.snap.release && s.options.snap.release.call(s.element, t, e.extend(s._uiHash(), {snapItem: s.snapElements[c].item})), s.snapElements[c].snapping = !1) : ("inner" !== f.snapMode && (n = m >= Math.abs(u - b), a = m >= Math.abs(d - y), o = m >= Math.abs(h - v), r = m >= Math.abs(l - g), n && (i.position.top = s._convertPositionTo("relative", {
  2168. top: u - s.helperProportions.height,
  2169. left: 0
  2170. }).top), a && (i.position.top = s._convertPositionTo("relative", {
  2171. top: d,
  2172. left: 0
  2173. }).top), o && (i.position.left = s._convertPositionTo("relative", {
  2174. top: 0,
  2175. left: h - s.helperProportions.width
  2176. }).left), r && (i.position.left = s._convertPositionTo("relative", {
  2177. top: 0,
  2178. left: l
  2179. }).left)), p = n || a || o || r, "outer" !== f.snapMode && (n = m >= Math.abs(u - y), a = m >= Math.abs(d - b), o = m >= Math.abs(h - g), r = m >= Math.abs(l - v), n && (i.position.top = s._convertPositionTo("relative", {
  2180. top: u,
  2181. left: 0
  2182. }).top), a && (i.position.top = s._convertPositionTo("relative", {
  2183. top: d - s.helperProportions.height,
  2184. left: 0
  2185. }).top), o && (i.position.left = s._convertPositionTo("relative", {
  2186. top: 0,
  2187. left: h
  2188. }).left), r && (i.position.left = s._convertPositionTo("relative", {
  2189. top: 0,
  2190. left: l - s.helperProportions.width
  2191. }).left)), !s.snapElements[c].snapping && (n || a || o || r || p) && s.options.snap.snap && s.options.snap.snap.call(s.element, t, e.extend(s._uiHash(), {snapItem: s.snapElements[c].item})), s.snapElements[c].snapping = n || a || o || r || p)
  2192. }
  2193. }), e.ui.plugin.add("draggable", "stack", {
  2194. start: function (t, i, s) {
  2195. var n, a = s.options, o = e.makeArray(e(a.stack)).sort(function (t, i) {
  2196. return (parseInt(e(t).css("zIndex"), 10) || 0) - (parseInt(e(i).css("zIndex"), 10) || 0)
  2197. });
  2198. o.length && (n = parseInt(e(o[0]).css("zIndex"), 10) || 0, e(o).each(function (t) {
  2199. e(this).css("zIndex", n + t)
  2200. }), this.css("zIndex", n + o.length))
  2201. }
  2202. }), e.ui.plugin.add("draggable", "zIndex", {
  2203. start: function (t, i, s) {
  2204. var n = e(i.helper), a = s.options;
  2205. n.css("zIndex") && (a._zIndex = n.css("zIndex")), n.css("zIndex", a.zIndex)
  2206. }, stop: function (t, i, s) {
  2207. var n = s.options;
  2208. n._zIndex && e(i.helper).css("zIndex", n._zIndex)
  2209. }
  2210. }), e.ui.draggable, e.widget("ui.resizable", e.ui.mouse, {
  2211. version: "1.11.2",
  2212. widgetEventPrefix: "resize",
  2213. options: {
  2214. alsoResize: !1,
  2215. animate: !1,
  2216. animateDuration: "slow",
  2217. animateEasing: "swing",
  2218. aspectRatio: !1,
  2219. autoHide: !1,
  2220. containment: !1,
  2221. ghost: !1,
  2222. grid: !1,
  2223. handles: "e,s,se",
  2224. helper: !1,
  2225. maxHeight: null,
  2226. maxWidth: null,
  2227. minHeight: 10,
  2228. minWidth: 10,
  2229. zIndex: 90,
  2230. resize: null,
  2231. start: null,
  2232. stop: null
  2233. },
  2234. _num: function (e) {
  2235. return parseInt(e, 10) || 0
  2236. },
  2237. _isNumber: function (e) {
  2238. return !isNaN(parseInt(e, 10))
  2239. },
  2240. _hasScroll: function (t, i) {
  2241. if ("hidden" === e(t).css("overflow")) return !1;
  2242. var s = i && "left" === i ? "scrollLeft" : "scrollTop", n = !1;
  2243. return t[s] > 0 ? !0 : (t[s] = 1, n = t[s] > 0, t[s] = 0, n)
  2244. },
  2245. _create: function () {
  2246. var t, i, s, n, a, o = this, r = this.options;
  2247. if (this.element.addClass("ui-resizable"), e.extend(this, {
  2248. _aspectRatio: !!r.aspectRatio,
  2249. aspectRatio: r.aspectRatio,
  2250. originalElement: this.element,
  2251. _proportionallyResizeElements: [],
  2252. _helper: r.helper || r.ghost || r.animate ? r.helper || "ui-resizable-helper" : null
  2253. }), this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i) && (this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
  2254. position: this.element.css("position"),
  2255. width: this.element.outerWidth(),
  2256. height: this.element.outerHeight(),
  2257. top: this.element.css("top"),
  2258. left: this.element.css("left")
  2259. })), this.element = this.element.parent().data("ui-resizable", this.element.resizable("instance")), this.elementIsWrapper = !0, this.element.css({
  2260. marginLeft: this.originalElement.css("marginLeft"),
  2261. marginTop: this.originalElement.css("marginTop"),
  2262. marginRight: this.originalElement.css("marginRight"),
  2263. marginBottom: this.originalElement.css("marginBottom")
  2264. }), this.originalElement.css({
  2265. marginLeft: 0,
  2266. marginTop: 0,
  2267. marginRight: 0,
  2268. marginBottom: 0
  2269. }), this.originalResizeStyle = this.originalElement.css("resize"), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push(this.originalElement.css({
  2270. position: "static",
  2271. zoom: 1,
  2272. display: "block"
  2273. })), this.originalElement.css({margin: this.originalElement.css("margin")}), this._proportionallyResize()), this.handles = r.handles || (e(".ui-resizable-handle", this.element).length ? {
  2274. n: ".ui-resizable-n",
  2275. e: ".ui-resizable-e",
  2276. s: ".ui-resizable-s",
  2277. w: ".ui-resizable-w",
  2278. se: ".ui-resizable-se",
  2279. sw: ".ui-resizable-sw",
  2280. ne: ".ui-resizable-ne",
  2281. nw: ".ui-resizable-nw"
  2282. } : "e,s,se"), this.handles.constructor === String) for ("all" === this.handles && (this.handles = "n,e,s,w,se,sw,ne,nw"), t = this.handles.split(","), this.handles = {}, i = 0; t.length > i; i++) s = e.trim(t[i]), a = "ui-resizable-" + s, n = e("<div class='ui-resizable-handle " + a + "'></div>"), n.css({zIndex: r.zIndex}), "se" === s && n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[s] = ".ui-resizable-" + s, this.element.append(n);
  2283. this._renderAxis = function (t) {
  2284. var i, s, n, a;
  2285. t = t || this.element;
  2286. for (i in this.handles) this.handles[i].constructor === String && (this.handles[i] = this.element.children(this.handles[i]).first().show()), this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i) && (s = e(this.handles[i], this.element), a = /sw|ne|nw|se|n|s/.test(i) ? s.outerHeight() : s.outerWidth(), n = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join(""), t.css(n, a), this._proportionallyResize()), e(this.handles[i]).length
  2287. }, this._renderAxis(this.element), this._handles = e(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function () {
  2288. o.resizing || (this.className && (n = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), o.axis = n && n[1] ? n[1] : "se")
  2289. }), r.autoHide && (this._handles.hide(), e(this.element).addClass("ui-resizable-autohide").mouseenter(function () {
  2290. r.disabled || (e(this).removeClass("ui-resizable-autohide"), o._handles.show())
  2291. }).mouseleave(function () {
  2292. r.disabled || o.resizing || (e(this).addClass("ui-resizable-autohide"), o._handles.hide())
  2293. })), this._mouseInit()
  2294. },
  2295. _destroy: function () {
  2296. this._mouseDestroy();
  2297. var t, i = function (t) {
  2298. e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()
  2299. };
  2300. return this.elementIsWrapper && (i(this.element), t = this.element, this.originalElement.css({
  2301. position: t.css("position"),
  2302. width: t.outerWidth(),
  2303. height: t.outerHeight(),
  2304. top: t.css("top"),
  2305. left: t.css("left")
  2306. }).insertAfter(t), t.remove()), this.originalElement.css("resize", this.originalResizeStyle), i(this.originalElement), this
  2307. },
  2308. _mouseCapture: function (t) {
  2309. var i, s, n = !1;
  2310. for (i in this.handles) s = e(this.handles[i])[0], (s === t.target || e.contains(s, t.target)) && (n = !0);
  2311. return !this.options.disabled && n
  2312. },
  2313. _mouseStart: function (t) {
  2314. var i, s, n, a = this.options, o = this.element;
  2315. return this.resizing = !0, this._renderProxy(), i = this._num(this.helper.css("left")), s = this._num(this.helper.css("top")), a.containment && (i += e(a.containment).scrollLeft() || 0, s += e(a.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = {
  2316. left: i,
  2317. top: s
  2318. }, this.size = this._helper ? {
  2319. width: this.helper.width(),
  2320. height: this.helper.height()
  2321. } : {width: o.width(), height: o.height()}, this.originalSize = this._helper ? {
  2322. width: o.outerWidth(),
  2323. height: o.outerHeight()
  2324. } : {width: o.width(), height: o.height()}, this.sizeDiff = {
  2325. width: o.outerWidth() - o.width(),
  2326. height: o.outerHeight() - o.height()
  2327. }, this.originalPosition = {left: i, top: s}, this.originalMousePosition = {
  2328. left: t.pageX,
  2329. top: t.pageY
  2330. }, this.aspectRatio = "number" == typeof a.aspectRatio ? a.aspectRatio : this.originalSize.width / this.originalSize.height || 1, n = e(".ui-resizable-" + this.axis).css("cursor"), e("body").css("cursor", "auto" === n ? this.axis + "-resize" : n), o.addClass("ui-resizable-resizing"), this._propagate("start", t), !0
  2331. },
  2332. _mouseDrag: function (t) {
  2333. var i, s, n = this.originalMousePosition, a = this.axis, o = t.pageX - n.left || 0,
  2334. r = t.pageY - n.top || 0, h = this._change[a];
  2335. return this._updatePrevProperties(), h ? (i = h.apply(this, [t, o, r]), this._updateVirtualBoundaries(t.shiftKey), (this._aspectRatio || t.shiftKey) && (i = this._updateRatio(i, t)), i = this._respectSize(i, t), this._updateCache(i), this._propagate("resize", t), s = this._applyChanges(), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), e.isEmptyObject(s) || (this._updatePrevProperties(), this._trigger("resize", t, this.ui()), this._applyChanges()), !1) : !1
  2336. },
  2337. _mouseStop: function (t) {
  2338. this.resizing = !1;
  2339. var i, s, n, a, o, r, h, l = this.options, u = this;
  2340. return this._helper && (i = this._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), n = s && this._hasScroll(i[0], "left") ? 0 : u.sizeDiff.height, a = s ? 0 : u.sizeDiff.width, o = {
  2341. width: u.helper.width() - a,
  2342. height: u.helper.height() - n
  2343. }, r = parseInt(u.element.css("left"), 10) + (u.position.left - u.originalPosition.left) || null, h = parseInt(u.element.css("top"), 10) + (u.position.top - u.originalPosition.top) || null, l.animate || this.element.css(e.extend(o, {
  2344. top: h,
  2345. left: r
  2346. })), u.helper.height(u.size.height), u.helper.width(u.size.width), this._helper && !l.animate && this._proportionallyResize()), e("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", t), this._helper && this.helper.remove(), !1
  2347. },
  2348. _updatePrevProperties: function () {
  2349. this.prevPosition = {
  2350. top: this.position.top,
  2351. left: this.position.left
  2352. }, this.prevSize = {width: this.size.width, height: this.size.height}
  2353. },
  2354. _applyChanges: function () {
  2355. var e = {};
  2356. return this.position.top !== this.prevPosition.top && (e.top = this.position.top + "px"), this.position.left !== this.prevPosition.left && (e.left = this.position.left + "px"), this.size.width !== this.prevSize.width && (e.width = this.size.width + "px"), this.size.height !== this.prevSize.height && (e.height = this.size.height + "px"), this.helper.css(e), e
  2357. },
  2358. _updateVirtualBoundaries: function (e) {
  2359. var t, i, s, n, a, o = this.options;
  2360. a = {
  2361. minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
  2362. maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : 1 / 0,
  2363. minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
  2364. maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : 1 / 0
  2365. }, (this._aspectRatio || e) && (t = a.minHeight * this.aspectRatio, s = a.minWidth / this.aspectRatio, i = a.maxHeight * this.aspectRatio, n = a.maxWidth / this.aspectRatio, t > a.minWidth && (a.minWidth = t), s > a.minHeight && (a.minHeight = s), a.maxWidth > i && (a.maxWidth = i), a.maxHeight > n && (a.maxHeight = n)), this._vBoundaries = a
  2366. },
  2367. _updateCache: function (e) {
  2368. this.offset = this.helper.offset(), this._isNumber(e.left) && (this.position.left = e.left), this._isNumber(e.top) && (this.position.top = e.top), this._isNumber(e.height) && (this.size.height = e.height), this._isNumber(e.width) && (this.size.width = e.width)
  2369. },
  2370. _updateRatio: function (e) {
  2371. var t = this.position, i = this.size, s = this.axis;
  2372. return this._isNumber(e.height) ? e.width = e.height * this.aspectRatio : this._isNumber(e.width) && (e.height = e.width / this.aspectRatio), "sw" === s && (e.left = t.left + (i.width - e.width), e.top = null), "nw" === s && (e.top = t.top + (i.height - e.height), e.left = t.left + (i.width - e.width)), e
  2373. },
  2374. _respectSize: function (e) {
  2375. var t = this._vBoundaries, i = this.axis, s = this._isNumber(e.width) && t.maxWidth && t.maxWidth < e.width,
  2376. n = this._isNumber(e.height) && t.maxHeight && t.maxHeight < e.height,
  2377. a = this._isNumber(e.width) && t.minWidth && t.minWidth > e.width,
  2378. o = this._isNumber(e.height) && t.minHeight && t.minHeight > e.height,
  2379. r = this.originalPosition.left + this.originalSize.width, h = this.position.top + this.size.height,
  2380. l = /sw|nw|w/.test(i), u = /nw|ne|n/.test(i);
  2381. return a && (e.width = t.minWidth), o && (e.height = t.minHeight), s && (e.width = t.maxWidth), n && (e.height = t.maxHeight), a && l && (e.left = r - t.minWidth), s && l && (e.left = r - t.maxWidth), o && u && (e.top = h - t.minHeight), n && u && (e.top = h - t.maxHeight), e.width || e.height || e.left || !e.top ? e.width || e.height || e.top || !e.left || (e.left = null) : e.top = null, e
  2382. },
  2383. _getPaddingPlusBorderDimensions: function (e) {
  2384. for (var t = 0, i = [], s = [e.css("borderTopWidth"), e.css("borderRightWidth"), e.css("borderBottomWidth"), e.css("borderLeftWidth")], n = [e.css("paddingTop"), e.css("paddingRight"), e.css("paddingBottom"), e.css("paddingLeft")]; 4 > t; t++) i[t] = parseInt(s[t], 10) || 0, i[t] += parseInt(n[t], 10) || 0;
  2385. return {height: i[0] + i[2], width: i[1] + i[3]}
  2386. },
  2387. _proportionallyResize: function () {
  2388. if (this._proportionallyResizeElements.length) for (var e, t = 0, i = this.helper || this.element; this._proportionallyResizeElements.length > t; t++) e = this._proportionallyResizeElements[t], this.outerDimensions || (this.outerDimensions = this._getPaddingPlusBorderDimensions(e)), e.css({
  2389. height: i.height() - this.outerDimensions.height || 0,
  2390. width: i.width() - this.outerDimensions.width || 0
  2391. })
  2392. },
  2393. _renderProxy: function () {
  2394. var t = this.element, i = this.options;
  2395. this.elementOffset = t.offset(), this._helper ? (this.helper = this.helper || e("<div style='overflow:hidden;'></div>"), this.helper.addClass(this._helper).css({
  2396. width: this.element.outerWidth() - 1,
  2397. height: this.element.outerHeight() - 1,
  2398. position: "absolute",
  2399. left: this.elementOffset.left + "px",
  2400. top: this.elementOffset.top + "px",
  2401. zIndex: ++i.zIndex
  2402. }), this.helper.appendTo("body").disableSelection()) : this.helper = this.element
  2403. },
  2404. _change: {
  2405. e: function (e, t) {
  2406. return {width: this.originalSize.width + t}
  2407. }, w: function (e, t) {
  2408. var i = this.originalSize, s = this.originalPosition;
  2409. return {left: s.left + t, width: i.width - t}
  2410. }, n: function (e, t, i) {
  2411. var s = this.originalSize, n = this.originalPosition;
  2412. return {top: n.top + i, height: s.height - i}
  2413. }, s: function (e, t, i) {
  2414. return {height: this.originalSize.height + i}
  2415. }, se: function (t, i, s) {
  2416. return e.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [t, i, s]))
  2417. }, sw: function (t, i, s) {
  2418. return e.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [t, i, s]))
  2419. }, ne: function (t, i, s) {
  2420. return e.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [t, i, s]))
  2421. }, nw: function (t, i, s) {
  2422. return e.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [t, i, s]))
  2423. }
  2424. },
  2425. _propagate: function (t, i) {
  2426. e.ui.plugin.call(this, t, [i, this.ui()]), "resize" !== t && this._trigger(t, i, this.ui())
  2427. },
  2428. plugins: {},
  2429. ui: function () {
  2430. return {
  2431. originalElement: this.originalElement,
  2432. element: this.element,
  2433. helper: this.helper,
  2434. position: this.position,
  2435. size: this.size,
  2436. originalSize: this.originalSize,
  2437. originalPosition: this.originalPosition
  2438. }
  2439. }
  2440. }), e.ui.plugin.add("resizable", "animate", {
  2441. stop: function (t) {
  2442. var i = e(this).resizable("instance"), s = i.options, n = i._proportionallyResizeElements,
  2443. a = n.length && /textarea/i.test(n[0].nodeName),
  2444. o = a && i._hasScroll(n[0], "left") ? 0 : i.sizeDiff.height, r = a ? 0 : i.sizeDiff.width,
  2445. h = {width: i.size.width - r, height: i.size.height - o},
  2446. l = parseInt(i.element.css("left"), 10) + (i.position.left - i.originalPosition.left) || null,
  2447. u = parseInt(i.element.css("top"), 10) + (i.position.top - i.originalPosition.top) || null;
  2448. i.element.animate(e.extend(h, u && l ? {top: u, left: l} : {}), {
  2449. duration: s.animateDuration,
  2450. easing: s.animateEasing,
  2451. step: function () {
  2452. var s = {
  2453. width: parseInt(i.element.css("width"), 10),
  2454. height: parseInt(i.element.css("height"), 10),
  2455. top: parseInt(i.element.css("top"), 10),
  2456. left: parseInt(i.element.css("left"), 10)
  2457. };
  2458. n && n.length && e(n[0]).css({
  2459. width: s.width,
  2460. height: s.height
  2461. }), i._updateCache(s), i._propagate("resize", t)
  2462. }
  2463. })
  2464. }
  2465. }), e.ui.plugin.add("resizable", "containment", {
  2466. start: function () {
  2467. var t, i, s, n, a, o, r, h = e(this).resizable("instance"), l = h.options, u = h.element, d = l.containment,
  2468. c = d instanceof e ? d.get(0) : /parent/.test(d) ? u.parent().get(0) : d;
  2469. c && (h.containerElement = e(c), /document/.test(d) || d === document ? (h.containerOffset = {
  2470. left: 0,
  2471. top: 0
  2472. }, h.containerPosition = {left: 0, top: 0}, h.parentData = {
  2473. element: e(document),
  2474. left: 0,
  2475. top: 0,
  2476. width: e(document).width(),
  2477. height: e(document).height() || document.body.parentNode.scrollHeight
  2478. }) : (t = e(c), i = [], e(["Top", "Right", "Left", "Bottom"]).each(function (e, s) {
  2479. i[e] = h._num(t.css("padding" + s))
  2480. }), h.containerOffset = t.offset(), h.containerPosition = t.position(), h.containerSize = {
  2481. height: t.innerHeight() - i[3],
  2482. width: t.innerWidth() - i[1]
  2483. }, s = h.containerOffset, n = h.containerSize.height, a = h.containerSize.width, o = h._hasScroll(c, "left") ? c.scrollWidth : a, r = h._hasScroll(c) ? c.scrollHeight : n, h.parentData = {
  2484. element: c,
  2485. left: s.left,
  2486. top: s.top,
  2487. width: o,
  2488. height: r
  2489. }))
  2490. }, resize: function (t) {
  2491. var i, s, n, a, o = e(this).resizable("instance"), r = o.options, h = o.containerOffset, l = o.position,
  2492. u = o._aspectRatio || t.shiftKey, d = {top: 0, left: 0}, c = o.containerElement, p = !0;
  2493. c[0] !== document && /static/.test(c.css("position")) && (d = h), l.left < (o._helper ? h.left : 0) && (o.size.width = o.size.width + (o._helper ? o.position.left - h.left : o.position.left - d.left), u && (o.size.height = o.size.width / o.aspectRatio, p = !1), o.position.left = r.helper ? h.left : 0), l.top < (o._helper ? h.top : 0) && (o.size.height = o.size.height + (o._helper ? o.position.top - h.top : o.position.top), u && (o.size.width = o.size.height * o.aspectRatio, p = !1), o.position.top = o._helper ? h.top : 0), n = o.containerElement.get(0) === o.element.parent().get(0), a = /relative|absolute/.test(o.containerElement.css("position")), n && a ? (o.offset.left = o.parentData.left + o.position.left, o.offset.top = o.parentData.top + o.position.top) : (o.offset.left = o.element.offset().left, o.offset.top = o.element.offset().top), i = Math.abs(o.sizeDiff.width + (o._helper ? o.offset.left - d.left : o.offset.left - h.left)), s = Math.abs(o.sizeDiff.height + (o._helper ? o.offset.top - d.top : o.offset.top - h.top)), i + o.size.width >= o.parentData.width && (o.size.width = o.parentData.width - i, u && (o.size.height = o.size.width / o.aspectRatio, p = !1)), s + o.size.height >= o.parentData.height && (o.size.height = o.parentData.height - s, u && (o.size.width = o.size.height * o.aspectRatio, p = !1)), p || (o.position.left = o.prevPosition.left, o.position.top = o.prevPosition.top, o.size.width = o.prevSize.width, o.size.height = o.prevSize.height)
  2494. }, stop: function () {
  2495. var t = e(this).resizable("instance"), i = t.options, s = t.containerOffset, n = t.containerPosition,
  2496. a = t.containerElement, o = e(t.helper), r = o.offset(), h = o.outerWidth() - t.sizeDiff.width,
  2497. l = o.outerHeight() - t.sizeDiff.height;
  2498. t._helper && !i.animate && /relative/.test(a.css("position")) && e(this).css({
  2499. left: r.left - n.left - s.left,
  2500. width: h,
  2501. height: l
  2502. }), t._helper && !i.animate && /static/.test(a.css("position")) && e(this).css({
  2503. left: r.left - n.left - s.left,
  2504. width: h,
  2505. height: l
  2506. })
  2507. }
  2508. }), e.ui.plugin.add("resizable", "alsoResize", {
  2509. start: function () {
  2510. var t = e(this).resizable("instance"), i = t.options, s = function (t) {
  2511. e(t).each(function () {
  2512. var t = e(this);
  2513. t.data("ui-resizable-alsoresize", {
  2514. width: parseInt(t.width(), 10),
  2515. height: parseInt(t.height(), 10),
  2516. left: parseInt(t.css("left"), 10),
  2517. top: parseInt(t.css("top"), 10)
  2518. })
  2519. })
  2520. };
  2521. "object" != typeof i.alsoResize || i.alsoResize.parentNode ? s(i.alsoResize) : i.alsoResize.length ? (i.alsoResize = i.alsoResize[0], s(i.alsoResize)) : e.each(i.alsoResize, function (e) {
  2522. s(e)
  2523. })
  2524. }, resize: function (t, i) {
  2525. var s = e(this).resizable("instance"), n = s.options, a = s.originalSize, o = s.originalPosition, r = {
  2526. height: s.size.height - a.height || 0,
  2527. width: s.size.width - a.width || 0,
  2528. top: s.position.top - o.top || 0,
  2529. left: s.position.left - o.left || 0
  2530. }, h = function (t, s) {
  2531. e(t).each(function () {
  2532. var t = e(this), n = e(this).data("ui-resizable-alsoresize"), a = {},
  2533. o = s && s.length ? s : t.parents(i.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
  2534. e.each(o, function (e, t) {
  2535. var i = (n[t] || 0) + (r[t] || 0);
  2536. i && i >= 0 && (a[t] = i || null)
  2537. }), t.css(a)
  2538. })
  2539. };
  2540. "object" != typeof n.alsoResize || n.alsoResize.nodeType ? h(n.alsoResize) : e.each(n.alsoResize, function (e, t) {
  2541. h(e, t)
  2542. })
  2543. }, stop: function () {
  2544. e(this).removeData("resizable-alsoresize")
  2545. }
  2546. }), e.ui.plugin.add("resizable", "ghost", {
  2547. start: function () {
  2548. var t = e(this).resizable("instance"), i = t.options, s = t.size;
  2549. t.ghost = t.originalElement.clone(), t.ghost.css({
  2550. opacity: .25,
  2551. display: "block",
  2552. position: "relative",
  2553. height: s.height,
  2554. width: s.width,
  2555. margin: 0,
  2556. left: 0,
  2557. top: 0
  2558. }).addClass("ui-resizable-ghost").addClass("string" == typeof i.ghost ? i.ghost : ""), t.ghost.appendTo(t.helper)
  2559. }, resize: function () {
  2560. var t = e(this).resizable("instance");
  2561. t.ghost && t.ghost.css({position: "relative", height: t.size.height, width: t.size.width})
  2562. }, stop: function () {
  2563. var t = e(this).resizable("instance");
  2564. t.ghost && t.helper && t.helper.get(0).removeChild(t.ghost.get(0))
  2565. }
  2566. }), e.ui.plugin.add("resizable", "grid", {
  2567. resize: function () {
  2568. var t, i = e(this).resizable("instance"), s = i.options, n = i.size, a = i.originalSize,
  2569. o = i.originalPosition, r = i.axis, h = "number" == typeof s.grid ? [s.grid, s.grid] : s.grid,
  2570. l = h[0] || 1, u = h[1] || 1, d = Math.round((n.width - a.width) / l) * l,
  2571. c = Math.round((n.height - a.height) / u) * u, p = a.width + d, f = a.height + c,
  2572. m = s.maxWidth && p > s.maxWidth, g = s.maxHeight && f > s.maxHeight, v = s.minWidth && s.minWidth > p,
  2573. y = s.minHeight && s.minHeight > f;
  2574. s.grid = h, v && (p += l), y && (f += u), m && (p -= l), g && (f -= u), /^(se|s|e)$/.test(r) ? (i.size.width = p, i.size.height = f) : /^(ne)$/.test(r) ? (i.size.width = p, i.size.height = f, i.position.top = o.top - c) : /^(sw)$/.test(r) ? (i.size.width = p, i.size.height = f, i.position.left = o.left - d) : ((0 >= f - u || 0 >= p - l) && (t = i._getPaddingPlusBorderDimensions(this)), f - u > 0 ? (i.size.height = f, i.position.top = o.top - c) : (f = u - t.height, i.size.height = f, i.position.top = o.top + a.height - f), p - l > 0 ? (i.size.width = p, i.position.left = o.left - d) : (p = u - t.height, i.size.width = p, i.position.left = o.left + a.width - p))
  2575. }
  2576. }), e.ui.resizable, e.widget("ui.dialog", {
  2577. version: "1.11.2",
  2578. options: {
  2579. appendTo: "body",
  2580. autoOpen: !0,
  2581. buttons: [],
  2582. closeOnEscape: !0,
  2583. closeText: "Close",
  2584. dialogClass: "",
  2585. draggable: !0,
  2586. hide: null,
  2587. height: "auto",
  2588. maxHeight: null,
  2589. maxWidth: null,
  2590. minHeight: 150,
  2591. minWidth: 150,
  2592. modal: !1,
  2593. position: {
  2594. my: "center", at: "center", of: window, collision: "fit", using: function (t) {
  2595. var i = e(this).css(t).offset().top;
  2596. 0 > i && e(this).css("top", t.top - i)
  2597. }
  2598. },
  2599. resizable: !0,
  2600. show: null,
  2601. title: null,
  2602. width: 300,
  2603. beforeClose: null,
  2604. close: null,
  2605. drag: null,
  2606. dragStart: null,
  2607. dragStop: null,
  2608. focus: null,
  2609. open: null,
  2610. resize: null,
  2611. resizeStart: null,
  2612. resizeStop: null
  2613. },
  2614. sizeRelatedOptions: {
  2615. buttons: !0,
  2616. height: !0,
  2617. maxHeight: !0,
  2618. maxWidth: !0,
  2619. minHeight: !0,
  2620. minWidth: !0,
  2621. width: !0
  2622. },
  2623. resizableRelatedOptions: {maxHeight: !0, maxWidth: !0, minHeight: !0, minWidth: !0},
  2624. _create: function () {
  2625. this.originalCss = {
  2626. display: this.element[0].style.display,
  2627. width: this.element[0].style.width,
  2628. minHeight: this.element[0].style.minHeight,
  2629. maxHeight: this.element[0].style.maxHeight,
  2630. height: this.element[0].style.height
  2631. }, this.originalPosition = {
  2632. parent: this.element.parent(),
  2633. index: this.element.parent().children().index(this.element)
  2634. }, this.originalTitle = this.element.attr("title"), this.options.title = this.options.title || this.originalTitle, this._createWrapper(), this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog), this._createTitlebar(), this._createButtonPane(), this.options.draggable && e.fn.draggable && this._makeDraggable(), this.options.resizable && e.fn.resizable && this._makeResizable(), this._isOpen = !1, this._trackFocus()
  2635. },
  2636. _init: function () {
  2637. this.options.autoOpen && this.open()
  2638. },
  2639. _appendTo: function () {
  2640. var t = this.options.appendTo;
  2641. return t && (t.jquery || t.nodeType) ? e(t) : this.document.find(t || "body").eq(0)
  2642. },
  2643. _destroy: function () {
  2644. var e, t = this.originalPosition;
  2645. this._destroyOverlay(), this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(), this.uiDialog.stop(!0, !0).remove(), this.originalTitle && this.element.attr("title", this.originalTitle), e = t.parent.children().eq(t.index), e.length && e[0] !== this.element[0] ? e.before(this.element) : t.parent.append(this.element)
  2646. },
  2647. widget: function () {
  2648. return this.uiDialog
  2649. },
  2650. disable: e.noop,
  2651. enable: e.noop,
  2652. close: function (t) {
  2653. var i, s = this;
  2654. if (this._isOpen && this._trigger("beforeClose", t) !== !1) {
  2655. if (this._isOpen = !1, this._focusedElement = null, this._destroyOverlay(), this._untrackInstance(), !this.opener.filter(":focusable").focus().length) try {
  2656. i = this.document[0].activeElement, i && "body" !== i.nodeName.toLowerCase() && e(i).blur()
  2657. } catch (n) {
  2658. }
  2659. this._hide(this.uiDialog, this.options.hide, function () {
  2660. s._trigger("close", t)
  2661. })
  2662. }
  2663. },
  2664. isOpen: function () {
  2665. return this._isOpen
  2666. },
  2667. moveToTop: function () {
  2668. this._moveToTop()
  2669. },
  2670. _moveToTop: function (t, i) {
  2671. var s = !1, n = this.uiDialog.siblings(".ui-front:visible").map(function () {
  2672. return +e(this).css("z-index")
  2673. }).get(), a = Math.max.apply(null, n);
  2674. return a >= +this.uiDialog.css("z-index") && (this.uiDialog.css("z-index", a + 1), s = !0), s && !i && this._trigger("focus", t), s
  2675. },
  2676. open: function () {
  2677. var t = this;
  2678. return this._isOpen ? (this._moveToTop() && this._focusTabbable(), void 0) : (this._isOpen = !0, this.opener = e(this.document[0].activeElement), this._size(), this._position(), this._createOverlay(), this._moveToTop(null, !0), this.overlay && this.overlay.css("z-index", this.uiDialog.css("z-index") - 1), this._show(this.uiDialog, this.options.show, function () {
  2679. t._focusTabbable(), t._trigger("focus")
  2680. }), this._makeFocusTarget(), this._trigger("open"), void 0)
  2681. },
  2682. _focusTabbable: function () {
  2683. var e = this._focusedElement;
  2684. e || (e = this.element.find("[autofocus]")), e.length || (e = this.element.find(":tabbable")), e.length || (e = this.uiDialogButtonPane.find(":tabbable")), e.length || (e = this.uiDialogTitlebarClose.filter(":tabbable")), e.length || (e = this.uiDialog), e.eq(0).focus()
  2685. },
  2686. _keepFocus: function (t) {
  2687. function i() {
  2688. var t = this.document[0].activeElement, i = this.uiDialog[0] === t || e.contains(this.uiDialog[0], t);
  2689. i || this._focusTabbable()
  2690. }
  2691. t.preventDefault(), i.call(this), this._delay(i)
  2692. },
  2693. _createWrapper: function () {
  2694. this.uiDialog = e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " + this.options.dialogClass).hide().attr({
  2695. tabIndex: -1,
  2696. role: "dialog"
  2697. }).appendTo(this._appendTo()), this._on(this.uiDialog, {
  2698. keydown: function (t) {
  2699. if (this.options.closeOnEscape && !t.isDefaultPrevented() && t.keyCode && t.keyCode === e.ui.keyCode.ESCAPE) return t.preventDefault(), this.close(t), void 0;
  2700. if (t.keyCode === e.ui.keyCode.TAB && !t.isDefaultPrevented()) {
  2701. var i = this.uiDialog.find(":tabbable"), s = i.filter(":first"), n = i.filter(":last");
  2702. t.target !== n[0] && t.target !== this.uiDialog[0] || t.shiftKey ? t.target !== s[0] && t.target !== this.uiDialog[0] || !t.shiftKey || (this._delay(function () {
  2703. n.focus()
  2704. }), t.preventDefault()) : (this._delay(function () {
  2705. s.focus()
  2706. }), t.preventDefault())
  2707. }
  2708. }, mousedown: function (e) {
  2709. this._moveToTop(e) && this._focusTabbable()
  2710. }
  2711. }), this.element.find("[aria-describedby]").length || this.uiDialog.attr({"aria-describedby": this.element.uniqueId().attr("id")})
  2712. },
  2713. _createTitlebar: function () {
  2714. var t;
  2715. this.uiDialogTitlebar = e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog), this._on(this.uiDialogTitlebar, {
  2716. mousedown: function (t) {
  2717. e(t.target).closest(".ui-dialog-titlebar-close") || this.uiDialog.focus()
  2718. }
  2719. }), this.uiDialogTitlebarClose = e("<button type='button'></button>").button({
  2720. label: this.options.closeText,
  2721. icons: {primary: "ui-icon-closethick"},
  2722. text: !1
  2723. }).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar), this._on(this.uiDialogTitlebarClose, {
  2724. click: function (e) {
  2725. e.preventDefault(), this.close(e)
  2726. }
  2727. }), t = e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar), this._title(t), this.uiDialog.attr({"aria-labelledby": t.attr("id")})
  2728. },
  2729. _title: function (e) {
  2730. this.options.title || e.html("&#160;"), e.text(this.options.title)
  2731. },
  2732. _createButtonPane: function () {
  2733. this.uiDialogButtonPane = e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"), this.uiButtonSet = e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane), this._createButtons()
  2734. },
  2735. _createButtons: function () {
  2736. var t = this, i = this.options.buttons;
  2737. return this.uiDialogButtonPane.remove(), this.uiButtonSet.empty(), e.isEmptyObject(i) || e.isArray(i) && !i.length ? (this.uiDialog.removeClass("ui-dialog-buttons"), void 0) : (e.each(i, function (i, s) {
  2738. var n, a;
  2739. s = e.isFunction(s) ? {
  2740. click: s,
  2741. text: i
  2742. } : s, s = e.extend({type: "button"}, s), n = s.click, s.click = function () {
  2743. n.apply(t.element[0], arguments)
  2744. }, a = {
  2745. icons: s.icons,
  2746. text: s.showText
  2747. }, delete s.icons, delete s.showText, e("<button></button>", s).button(a).appendTo(t.uiButtonSet)
  2748. }), this.uiDialog.addClass("ui-dialog-buttons"), this.uiDialogButtonPane.appendTo(this.uiDialog), void 0)
  2749. },
  2750. _makeDraggable: function () {
  2751. function t(e) {
  2752. return {position: e.position, offset: e.offset}
  2753. }
  2754. var i = this, s = this.options;
  2755. this.uiDialog.draggable({
  2756. cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
  2757. handle: ".ui-dialog-titlebar",
  2758. containment: "document",
  2759. start: function (s, n) {
  2760. e(this).addClass("ui-dialog-dragging"), i._blockFrames(), i._trigger("dragStart", s, t(n))
  2761. },
  2762. drag: function (e, s) {
  2763. i._trigger("drag", e, t(s))
  2764. },
  2765. stop: function (n, a) {
  2766. var o = a.offset.left - i.document.scrollLeft(), r = a.offset.top - i.document.scrollTop();
  2767. s.position = {
  2768. my: "left top",
  2769. at: "left" + (o >= 0 ? "+" : "") + o + " " + "top" + (r >= 0 ? "+" : "") + r,
  2770. of: i.window
  2771. }, e(this).removeClass("ui-dialog-dragging"), i._unblockFrames(), i._trigger("dragStop", n, t(a))
  2772. }
  2773. })
  2774. },
  2775. _makeResizable: function () {
  2776. function t(e) {
  2777. return {
  2778. originalPosition: e.originalPosition,
  2779. originalSize: e.originalSize,
  2780. position: e.position,
  2781. size: e.size
  2782. }
  2783. }
  2784. var i = this, s = this.options, n = s.resizable, a = this.uiDialog.css("position"),
  2785. o = "string" == typeof n ? n : "n,e,s,w,se,sw,ne,nw";
  2786. this.uiDialog.resizable({
  2787. cancel: ".ui-dialog-content",
  2788. containment: "document",
  2789. alsoResize: this.element,
  2790. maxWidth: s.maxWidth,
  2791. maxHeight: s.maxHeight,
  2792. minWidth: s.minWidth,
  2793. minHeight: this._minHeight(),
  2794. handles: o,
  2795. start: function (s, n) {
  2796. e(this).addClass("ui-dialog-resizing"), i._blockFrames(), i._trigger("resizeStart", s, t(n))
  2797. },
  2798. resize: function (e, s) {
  2799. i._trigger("resize", e, t(s))
  2800. },
  2801. stop: function (n, a) {
  2802. var o = i.uiDialog.offset(), r = o.left - i.document.scrollLeft(),
  2803. h = o.top - i.document.scrollTop();
  2804. s.height = i.uiDialog.height(), s.width = i.uiDialog.width(), s.position = {
  2805. my: "left top",
  2806. at: "left" + (r >= 0 ? "+" : "") + r + " " + "top" + (h >= 0 ? "+" : "") + h,
  2807. of: i.window
  2808. }, e(this).removeClass("ui-dialog-resizing"), i._unblockFrames(), i._trigger("resizeStop", n, t(a))
  2809. }
  2810. }).css("position", a)
  2811. },
  2812. _trackFocus: function () {
  2813. this._on(this.widget(), {
  2814. focusin: function (t) {
  2815. this._makeFocusTarget(), this._focusedElement = e(t.target)
  2816. }
  2817. })
  2818. },
  2819. _makeFocusTarget: function () {
  2820. this._untrackInstance(), this._trackingInstances().unshift(this)
  2821. },
  2822. _untrackInstance: function () {
  2823. var t = this._trackingInstances(), i = e.inArray(this, t);
  2824. -1 !== i && t.splice(i, 1)
  2825. },
  2826. _trackingInstances: function () {
  2827. var e = this.document.data("ui-dialog-instances");
  2828. return e || (e = [], this.document.data("ui-dialog-instances", e)), e
  2829. },
  2830. _minHeight: function () {
  2831. var e = this.options;
  2832. return "auto" === e.height ? e.minHeight : Math.min(e.minHeight, e.height)
  2833. },
  2834. _position: function () {
  2835. var e = this.uiDialog.is(":visible");
  2836. e || this.uiDialog.show(), this.uiDialog.position(this.options.position), e || this.uiDialog.hide()
  2837. },
  2838. _setOptions: function (t) {
  2839. var i = this, s = !1, n = {};
  2840. e.each(t, function (e, t) {
  2841. i._setOption(e, t), e in i.sizeRelatedOptions && (s = !0), e in i.resizableRelatedOptions && (n[e] = t)
  2842. }), s && (this._size(), this._position()), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", n)
  2843. },
  2844. _setOption: function (e, t) {
  2845. var i, s, n = this.uiDialog;
  2846. "dialogClass" === e && n.removeClass(this.options.dialogClass).addClass(t), "disabled" !== e && (this._super(e, t), "appendTo" === e && this.uiDialog.appendTo(this._appendTo()), "buttons" === e && this._createButtons(), "closeText" === e && this.uiDialogTitlebarClose.button({label: "" + t}), "draggable" === e && (i = n.is(":data(ui-draggable)"), i && !t && n.draggable("destroy"), !i && t && this._makeDraggable()), "position" === e && this._position(), "resizable" === e && (s = n.is(":data(ui-resizable)"), s && !t && n.resizable("destroy"), s && "string" == typeof t && n.resizable("option", "handles", t), s || t === !1 || this._makeResizable()), "title" === e && this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))
  2847. },
  2848. _size: function () {
  2849. var e, t, i, s = this.options;
  2850. this.element.show().css({
  2851. width: "auto",
  2852. minHeight: 0,
  2853. maxHeight: "none",
  2854. height: 0
  2855. }), s.minWidth > s.width && (s.width = s.minWidth), e = this.uiDialog.css({
  2856. height: "auto",
  2857. width: s.width
  2858. }).outerHeight(), t = Math.max(0, s.minHeight - e), i = "number" == typeof s.maxHeight ? Math.max(0, s.maxHeight - e) : "none", "auto" === s.height ? this.element.css({
  2859. minHeight: t,
  2860. maxHeight: i,
  2861. height: "auto"
  2862. }) : this.element.height(Math.max(0, s.height - e)), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", "minHeight", this._minHeight())
  2863. },
  2864. _blockFrames: function () {
  2865. this.iframeBlocks = this.document.find("iframe").map(function () {
  2866. var t = e(this);
  2867. return e("<div>").css({
  2868. position: "absolute",
  2869. width: t.outerWidth(),
  2870. height: t.outerHeight()
  2871. }).appendTo(t.parent()).offset(t.offset())[0]
  2872. })
  2873. },
  2874. _unblockFrames: function () {
  2875. this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks)
  2876. },
  2877. _allowInteraction: function (t) {
  2878. return e(t.target).closest(".ui-dialog").length ? !0 : !!e(t.target).closest(".ui-datepicker").length
  2879. },
  2880. _createOverlay: function () {
  2881. if (this.options.modal) {
  2882. var t = !0;
  2883. this._delay(function () {
  2884. t = !1
  2885. }), this.document.data("ui-dialog-overlays") || this._on(this.document, {
  2886. focusin: function (e) {
  2887. t || this._allowInteraction(e) || (e.preventDefault(), this._trackingInstances()[0]._focusTabbable())
  2888. }
  2889. }), this.overlay = e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()), this._on(this.overlay, {mousedown: "_keepFocus"}), this.document.data("ui-dialog-overlays", (this.document.data("ui-dialog-overlays") || 0) + 1)
  2890. }
  2891. },
  2892. _destroyOverlay: function () {
  2893. if (this.options.modal && this.overlay) {
  2894. var e = this.document.data("ui-dialog-overlays") - 1;
  2895. e ? this.document.data("ui-dialog-overlays", e) : this.document.unbind("focusin").removeData("ui-dialog-overlays"), this.overlay.remove(), this.overlay = null
  2896. }
  2897. }
  2898. }), e.widget("ui.droppable", {
  2899. version: "1.11.2",
  2900. widgetEventPrefix: "drop",
  2901. options: {
  2902. accept: "*",
  2903. activeClass: !1,
  2904. addClasses: !0,
  2905. greedy: !1,
  2906. hoverClass: !1,
  2907. scope: "default",
  2908. tolerance: "intersect",
  2909. activate: null,
  2910. deactivate: null,
  2911. drop: null,
  2912. out: null,
  2913. over: null
  2914. },
  2915. _create: function () {
  2916. var t, i = this.options, s = i.accept;
  2917. this.isover = !1, this.isout = !0, this.accept = e.isFunction(s) ? s : function (e) {
  2918. return e.is(s)
  2919. }, this.proportions = function () {
  2920. return arguments.length ? (t = arguments[0], void 0) : t ? t : t = {
  2921. width: this.element[0].offsetWidth,
  2922. height: this.element[0].offsetHeight
  2923. }
  2924. }, this._addToManager(i.scope), i.addClasses && this.element.addClass("ui-droppable")
  2925. },
  2926. _addToManager: function (t) {
  2927. e.ui.ddmanager.droppables[t] = e.ui.ddmanager.droppables[t] || [], e.ui.ddmanager.droppables[t].push(this)
  2928. },
  2929. _splice: function (e) {
  2930. for (var t = 0; e.length > t; t++) e[t] === this && e.splice(t, 1)
  2931. },
  2932. _destroy: function () {
  2933. var t = e.ui.ddmanager.droppables[this.options.scope];
  2934. this._splice(t), this.element.removeClass("ui-droppable ui-droppable-disabled")
  2935. },
  2936. _setOption: function (t, i) {
  2937. if ("accept" === t) this.accept = e.isFunction(i) ? i : function (e) {
  2938. return e.is(i)
  2939. }; else if ("scope" === t) {
  2940. var s = e.ui.ddmanager.droppables[this.options.scope];
  2941. this._splice(s), this._addToManager(i)
  2942. }
  2943. this._super(t, i)
  2944. },
  2945. _activate: function (t) {
  2946. var i = e.ui.ddmanager.current;
  2947. this.options.activeClass && this.element.addClass(this.options.activeClass), i && this._trigger("activate", t, this.ui(i))
  2948. },
  2949. _deactivate: function (t) {
  2950. var i = e.ui.ddmanager.current;
  2951. this.options.activeClass && this.element.removeClass(this.options.activeClass), i && this._trigger("deactivate", t, this.ui(i))
  2952. },
  2953. _over: function (t) {
  2954. var i = e.ui.ddmanager.current;
  2955. i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this.options.hoverClass && this.element.addClass(this.options.hoverClass), this._trigger("over", t, this.ui(i)))
  2956. },
  2957. _out: function (t) {
  2958. var i = e.ui.ddmanager.current;
  2959. i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("out", t, this.ui(i)))
  2960. },
  2961. _drop: function (t, i) {
  2962. var s = i || e.ui.ddmanager.current, n = !1;
  2963. return s && (s.currentItem || s.element)[0] !== this.element[0] ? (this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function () {
  2964. var i = e(this).droppable("instance");
  2965. return i.options.greedy && !i.options.disabled && i.options.scope === s.options.scope && i.accept.call(i.element[0], s.currentItem || s.element) && e.ui.intersect(s, e.extend(i, {offset: i.element.offset()}), i.options.tolerance, t) ? (n = !0, !1) : void 0
  2966. }), n ? !1 : this.accept.call(this.element[0], s.currentItem || s.element) ? (this.options.activeClass && this.element.removeClass(this.options.activeClass), this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("drop", t, this.ui(s)), this.element) : !1) : !1
  2967. },
  2968. ui: function (e) {
  2969. return {
  2970. draggable: e.currentItem || e.element,
  2971. helper: e.helper,
  2972. position: e.position,
  2973. offset: e.positionAbs
  2974. }
  2975. }
  2976. }), e.ui.intersect = function () {
  2977. function e(e, t, i) {
  2978. return e >= t && t + i > e
  2979. }
  2980. return function (t, i, s, n) {
  2981. if (!i.offset) return !1;
  2982. var a = (t.positionAbs || t.position.absolute).left + t.margins.left,
  2983. o = (t.positionAbs || t.position.absolute).top + t.margins.top, r = a + t.helperProportions.width,
  2984. h = o + t.helperProportions.height, l = i.offset.left, u = i.offset.top, d = l + i.proportions().width,
  2985. c = u + i.proportions().height;
  2986. switch (s) {
  2987. case"fit":
  2988. return a >= l && d >= r && o >= u && c >= h;
  2989. case"intersect":
  2990. return a + t.helperProportions.width / 2 > l && d > r - t.helperProportions.width / 2 && o + t.helperProportions.height / 2 > u && c > h - t.helperProportions.height / 2;
  2991. case"pointer":
  2992. return e(n.pageY, u, i.proportions().height) && e(n.pageX, l, i.proportions().width);
  2993. case"touch":
  2994. return (o >= u && c >= o || h >= u && c >= h || u > o && h > c) && (a >= l && d >= a || r >= l && d >= r || l > a && r > d);
  2995. default:
  2996. return !1
  2997. }
  2998. }
  2999. }(), e.ui.ddmanager = {
  3000. current: null, droppables: {"default": []}, prepareOffsets: function (t, i) {
  3001. var s, n, a = e.ui.ddmanager.droppables[t.options.scope] || [], o = i ? i.type : null,
  3002. r = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
  3003. e:for (s = 0; a.length > s; s++) if (!(a[s].options.disabled || t && !a[s].accept.call(a[s].element[0], t.currentItem || t.element))) {
  3004. for (n = 0; r.length > n; n++) if (r[n] === a[s].element[0]) {
  3005. a[s].proportions().height = 0;
  3006. continue e
  3007. }
  3008. a[s].visible = "none" !== a[s].element.css("display"), a[s].visible && ("mousedown" === o && a[s]._activate.call(a[s], i), a[s].offset = a[s].element.offset(), a[s].proportions({
  3009. width: a[s].element[0].offsetWidth,
  3010. height: a[s].element[0].offsetHeight
  3011. }))
  3012. }
  3013. }, drop: function (t, i) {
  3014. var s = !1;
  3015. return e.each((e.ui.ddmanager.droppables[t.options.scope] || []).slice(), function () {
  3016. this.options && (!this.options.disabled && this.visible && e.ui.intersect(t, this, this.options.tolerance, i) && (s = this._drop.call(this, i) || s), !this.options.disabled && this.visible && this.accept.call(this.element[0], t.currentItem || t.element) && (this.isout = !0, this.isover = !1, this._deactivate.call(this, i)))
  3017. }), s
  3018. }, dragStart: function (t, i) {
  3019. t.element.parentsUntil("body").bind("scroll.droppable", function () {
  3020. t.options.refreshPositions || e.ui.ddmanager.prepareOffsets(t, i)
  3021. })
  3022. }, drag: function (t, i) {
  3023. t.options.refreshPositions && e.ui.ddmanager.prepareOffsets(t, i), e.each(e.ui.ddmanager.droppables[t.options.scope] || [], function () {
  3024. if (!this.options.disabled && !this.greedyChild && this.visible) {
  3025. var s, n, a, o = e.ui.intersect(t, this, this.options.tolerance, i),
  3026. r = !o && this.isover ? "isout" : o && !this.isover ? "isover" : null;
  3027. r && (this.options.greedy && (n = this.options.scope, a = this.element.parents(":data(ui-droppable)").filter(function () {
  3028. return e(this).droppable("instance").options.scope === n
  3029. }), a.length && (s = e(a[0]).droppable("instance"), s.greedyChild = "isover" === r)), s && "isover" === r && (s.isover = !1, s.isout = !0, s._out.call(s, i)), this[r] = !0, this["isout" === r ? "isover" : "isout"] = !1, this["isover" === r ? "_over" : "_out"].call(this, i), s && "isout" === r && (s.isout = !1, s.isover = !0, s._over.call(s, i)))
  3030. }
  3031. })
  3032. }, dragStop: function (t, i) {
  3033. t.element.parentsUntil("body").unbind("scroll.droppable"), t.options.refreshPositions || e.ui.ddmanager.prepareOffsets(t, i)
  3034. }
  3035. }, e.ui.droppable;
  3036. var y = "ui-effects-", b = e;
  3037. e.effects = {effect: {}}, function (e, t) {
  3038. function i(e, t, i) {
  3039. var s = d[t.type] || {};
  3040. return null == e ? i || !t.def ? null : t.def : (e = s.floor ? ~~e : parseFloat(e), isNaN(e) ? t.def : s.mod ? (e + s.mod) % s.mod : 0 > e ? 0 : e > s.max ? s.max : e)
  3041. }
  3042. function s(i) {
  3043. var s = l(), n = s._rgba = [];
  3044. return i = i.toLowerCase(), f(h, function (e, a) {
  3045. var o, r = a.re.exec(i), h = r && a.parse(r), l = a.space || "rgba";
  3046. return h ? (o = s[l](h), s[u[l].cache] = o[u[l].cache], n = s._rgba = o._rgba, !1) : t
  3047. }), n.length ? ("0,0,0,0" === n.join() && e.extend(n, a.transparent), s) : a[i]
  3048. }
  3049. function n(e, t, i) {
  3050. return i = (i + 1) % 1, 1 > 6 * i ? e + 6 * (t - e) * i : 1 > 2 * i ? t : 2 > 3 * i ? e + 6 * (t - e) * (2 / 3 - i) : e
  3051. }
  3052. var a,
  3053. o = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
  3054. r = /^([\-+])=\s*(\d+\.?\d*)/, h = [{
  3055. re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  3056. parse: function (e) {
  3057. return [e[1], e[2], e[3], e[4]]
  3058. }
  3059. }, {
  3060. re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  3061. parse: function (e) {
  3062. return [2.55 * e[1], 2.55 * e[2], 2.55 * e[3], e[4]]
  3063. }
  3064. }, {
  3065. re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, parse: function (e) {
  3066. return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
  3067. }
  3068. }, {
  3069. re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, parse: function (e) {
  3070. return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
  3071. }
  3072. }, {
  3073. re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
  3074. space: "hsla",
  3075. parse: function (e) {
  3076. return [e[1], e[2] / 100, e[3] / 100, e[4]]
  3077. }
  3078. }], l = e.Color = function (t, i, s, n) {
  3079. return new e.Color.fn.parse(t, i, s, n)
  3080. }, u = {
  3081. rgba: {
  3082. props: {
  3083. red: {idx: 0, type: "byte"},
  3084. green: {idx: 1, type: "byte"},
  3085. blue: {idx: 2, type: "byte"}
  3086. }
  3087. },
  3088. hsla: {
  3089. props: {
  3090. hue: {idx: 0, type: "degrees"},
  3091. saturation: {idx: 1, type: "percent"},
  3092. lightness: {idx: 2, type: "percent"}
  3093. }
  3094. }
  3095. }, d = {"byte": {floor: !0, max: 255}, percent: {max: 1}, degrees: {mod: 360, floor: !0}}, c = l.support = {},
  3096. p = e("<p>")[0], f = e.each;
  3097. p.style.cssText = "background-color:rgba(1,1,1,.5)", c.rgba = p.style.backgroundColor.indexOf("rgba") > -1, f(u, function (e, t) {
  3098. t.cache = "_" + e, t.props.alpha = {idx: 3, type: "percent", def: 1}
  3099. }), l.fn = e.extend(l.prototype, {
  3100. parse: function (n, o, r, h) {
  3101. if (n === t) return this._rgba = [null, null, null, null], this;
  3102. (n.jquery || n.nodeType) && (n = e(n).css(o), o = t);
  3103. var d = this, c = e.type(n), p = this._rgba = [];
  3104. return o !== t && (n = [n, o, r, h], c = "array"), "string" === c ? this.parse(s(n) || a._default) : "array" === c ? (f(u.rgba.props, function (e, t) {
  3105. p[t.idx] = i(n[t.idx], t)
  3106. }), this) : "object" === c ? (n instanceof l ? f(u, function (e, t) {
  3107. n[t.cache] && (d[t.cache] = n[t.cache].slice())
  3108. }) : f(u, function (t, s) {
  3109. var a = s.cache;
  3110. f(s.props, function (e, t) {
  3111. if (!d[a] && s.to) {
  3112. if ("alpha" === e || null == n[e]) return;
  3113. d[a] = s.to(d._rgba)
  3114. }
  3115. d[a][t.idx] = i(n[e], t, !0)
  3116. }), d[a] && 0 > e.inArray(null, d[a].slice(0, 3)) && (d[a][3] = 1, s.from && (d._rgba = s.from(d[a])))
  3117. }), this) : t
  3118. }, is: function (e) {
  3119. var i = l(e), s = !0, n = this;
  3120. return f(u, function (e, a) {
  3121. var o, r = i[a.cache];
  3122. return r && (o = n[a.cache] || a.to && a.to(n._rgba) || [], f(a.props, function (e, i) {
  3123. return null != r[i.idx] ? s = r[i.idx] === o[i.idx] : t
  3124. })), s
  3125. }), s
  3126. }, _space: function () {
  3127. var e = [], t = this;
  3128. return f(u, function (i, s) {
  3129. t[s.cache] && e.push(i)
  3130. }), e.pop()
  3131. }, transition: function (e, t) {
  3132. var s = l(e), n = s._space(), a = u[n], o = 0 === this.alpha() ? l("transparent") : this,
  3133. r = o[a.cache] || a.to(o._rgba), h = r.slice();
  3134. return s = s[a.cache], f(a.props, function (e, n) {
  3135. var a = n.idx, o = r[a], l = s[a], u = d[n.type] || {};
  3136. null !== l && (null === o ? h[a] = l : (u.mod && (l - o > u.mod / 2 ? o += u.mod : o - l > u.mod / 2 && (o -= u.mod)), h[a] = i((l - o) * t + o, n)))
  3137. }), this[n](h)
  3138. }, blend: function (t) {
  3139. if (1 === this._rgba[3]) return this;
  3140. var i = this._rgba.slice(), s = i.pop(), n = l(t)._rgba;
  3141. return l(e.map(i, function (e, t) {
  3142. return (1 - s) * n[t] + s * e
  3143. }))
  3144. }, toRgbaString: function () {
  3145. var t = "rgba(", i = e.map(this._rgba, function (e, t) {
  3146. return null == e ? t > 2 ? 1 : 0 : e
  3147. });
  3148. return 1 === i[3] && (i.pop(), t = "rgb("), t + i.join() + ")"
  3149. }, toHslaString: function () {
  3150. var t = "hsla(", i = e.map(this.hsla(), function (e, t) {
  3151. return null == e && (e = t > 2 ? 1 : 0), t && 3 > t && (e = Math.round(100 * e) + "%"), e
  3152. });
  3153. return 1 === i[3] && (i.pop(), t = "hsl("), t + i.join() + ")"
  3154. }, toHexString: function (t) {
  3155. var i = this._rgba.slice(), s = i.pop();
  3156. return t && i.push(~~(255 * s)), "#" + e.map(i, function (e) {
  3157. return e = (e || 0).toString(16), 1 === e.length ? "0" + e : e
  3158. }).join("")
  3159. }, toString: function () {
  3160. return 0 === this._rgba[3] ? "transparent" : this.toRgbaString()
  3161. }
  3162. }), l.fn.parse.prototype = l.fn, u.hsla.to = function (e) {
  3163. if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]];
  3164. var t, i, s = e[0] / 255, n = e[1] / 255, a = e[2] / 255, o = e[3], r = Math.max(s, n, a),
  3165. h = Math.min(s, n, a), l = r - h, u = r + h, d = .5 * u;
  3166. return t = h === r ? 0 : s === r ? 60 * (n - a) / l + 360 : n === r ? 60 * (a - s) / l + 120 : 60 * (s - n) / l + 240, i = 0 === l ? 0 : .5 >= d ? l / u : l / (2 - u), [Math.round(t) % 360, i, d, null == o ? 1 : o]
  3167. }, u.hsla.from = function (e) {
  3168. if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]];
  3169. var t = e[0] / 360, i = e[1], s = e[2], a = e[3], o = .5 >= s ? s * (1 + i) : s + i - s * i, r = 2 * s - o;
  3170. return [Math.round(255 * n(r, o, t + 1 / 3)), Math.round(255 * n(r, o, t)), Math.round(255 * n(r, o, t - 1 / 3)), a]
  3171. }, f(u, function (s, n) {
  3172. var a = n.props, o = n.cache, h = n.to, u = n.from;
  3173. l.fn[s] = function (s) {
  3174. if (h && !this[o] && (this[o] = h(this._rgba)), s === t) return this[o].slice();
  3175. var n, r = e.type(s), d = "array" === r || "object" === r ? s : arguments, c = this[o].slice();
  3176. return f(a, function (e, t) {
  3177. var s = d["object" === r ? e : t.idx];
  3178. null == s && (s = c[t.idx]), c[t.idx] = i(s, t)
  3179. }), u ? (n = l(u(c)), n[o] = c, n) : l(c)
  3180. }, f(a, function (t, i) {
  3181. l.fn[t] || (l.fn[t] = function (n) {
  3182. var a, o = e.type(n), h = "alpha" === t ? this._hsla ? "hsla" : "rgba" : s, l = this[h](),
  3183. u = l[i.idx];
  3184. return "undefined" === o ? u : ("function" === o && (n = n.call(this, u), o = e.type(n)), null == n && i.empty ? this : ("string" === o && (a = r.exec(n), a && (n = u + parseFloat(a[2]) * ("+" === a[1] ? 1 : -1))), l[i.idx] = n, this[h](l)))
  3185. })
  3186. })
  3187. }), l.hook = function (t) {
  3188. var i = t.split(" ");
  3189. f(i, function (t, i) {
  3190. e.cssHooks[i] = {
  3191. set: function (t, n) {
  3192. var a, o, r = "";
  3193. if ("transparent" !== n && ("string" !== e.type(n) || (a = s(n)))) {
  3194. if (n = l(a || n), !c.rgba && 1 !== n._rgba[3]) {
  3195. for (o = "backgroundColor" === i ? t.parentNode : t; ("" === r || "transparent" === r) && o && o.style;) try {
  3196. r = e.css(o, "backgroundColor"), o = o.parentNode
  3197. } catch (h) {
  3198. }
  3199. n = n.blend(r && "transparent" !== r ? r : "_default")
  3200. }
  3201. n = n.toRgbaString()
  3202. }
  3203. try {
  3204. t.style[i] = n
  3205. } catch (h) {
  3206. }
  3207. }
  3208. }, e.fx.step[i] = function (t) {
  3209. t.colorInit || (t.start = l(t.elem, i), t.end = l(t.end), t.colorInit = !0), e.cssHooks[i].set(t.elem, t.start.transition(t.end, t.pos))
  3210. }
  3211. })
  3212. }, l.hook(o), e.cssHooks.borderColor = {
  3213. expand: function (e) {
  3214. var t = {};
  3215. return f(["Top", "Right", "Bottom", "Left"], function (i, s) {
  3216. t["border" + s + "Color"] = e
  3217. }), t
  3218. }
  3219. }, a = e.Color.names = {
  3220. aqua: "#00ffff",
  3221. black: "#000000",
  3222. blue: "#0000ff",
  3223. fuchsia: "#ff00ff",
  3224. gray: "#808080",
  3225. green: "#008000",
  3226. lime: "#00ff00",
  3227. maroon: "#800000",
  3228. navy: "#000080",
  3229. olive: "#808000",
  3230. purple: "#800080",
  3231. red: "#ff0000",
  3232. silver: "#c0c0c0",
  3233. teal: "#008080",
  3234. white: "#ffffff",
  3235. yellow: "#ffff00",
  3236. transparent: [null, null, null, 0],
  3237. _default: "#ffffff"
  3238. }
  3239. }(b), function () {
  3240. function t(t) {
  3241. var i, s,
  3242. n = t.ownerDocument.defaultView ? t.ownerDocument.defaultView.getComputedStyle(t, null) : t.currentStyle,
  3243. a = {};
  3244. if (n && n.length && n[0] && n[n[0]]) for (s = n.length; s--;) i = n[s], "string" == typeof n[i] && (a[e.camelCase(i)] = n[i]); else for (i in n) "string" == typeof n[i] && (a[i] = n[i]);
  3245. return a
  3246. }
  3247. function i(t, i) {
  3248. var s, a, o = {};
  3249. for (s in i) a = i[s], t[s] !== a && (n[s] || (e.fx.step[s] || !isNaN(parseFloat(a))) && (o[s] = a));
  3250. return o
  3251. }
  3252. var s = ["add", "remove", "toggle"], n = {
  3253. border: 1,
  3254. borderBottom: 1,
  3255. borderColor: 1,
  3256. borderLeft: 1,
  3257. borderRight: 1,
  3258. borderTop: 1,
  3259. borderWidth: 1,
  3260. margin: 1,
  3261. padding: 1
  3262. };
  3263. e.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (t, i) {
  3264. e.fx.step[i] = function (e) {
  3265. ("none" !== e.end && !e.setAttr || 1 === e.pos && !e.setAttr) && (b.style(e.elem, i, e.end), e.setAttr = !0)
  3266. }
  3267. }), e.fn.addBack || (e.fn.addBack = function (e) {
  3268. return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
  3269. }), e.effects.animateClass = function (n, a, o, r) {
  3270. var h = e.speed(a, o, r);
  3271. return this.queue(function () {
  3272. var a, o = e(this), r = o.attr("class") || "", l = h.children ? o.find("*").addBack() : o;
  3273. l = l.map(function () {
  3274. var i = e(this);
  3275. return {el: i, start: t(this)}
  3276. }), a = function () {
  3277. e.each(s, function (e, t) {
  3278. n[t] && o[t + "Class"](n[t])
  3279. })
  3280. }, a(), l = l.map(function () {
  3281. return this.end = t(this.el[0]), this.diff = i(this.start, this.end), this
  3282. }), o.attr("class", r), l = l.map(function () {
  3283. var t = this, i = e.Deferred(), s = e.extend({}, h, {
  3284. queue: !1, complete: function () {
  3285. i.resolve(t)
  3286. }
  3287. });
  3288. return this.el.animate(this.diff, s), i.promise()
  3289. }), e.when.apply(e, l.get()).done(function () {
  3290. a(), e.each(arguments, function () {
  3291. var t = this.el;
  3292. e.each(this.diff, function (e) {
  3293. t.css(e, "")
  3294. })
  3295. }), h.complete.call(o[0])
  3296. })
  3297. })
  3298. }, e.fn.extend({
  3299. addClass: function (t) {
  3300. return function (i, s, n, a) {
  3301. return s ? e.effects.animateClass.call(this, {add: i}, s, n, a) : t.apply(this, arguments)
  3302. }
  3303. }(e.fn.addClass), removeClass: function (t) {
  3304. return function (i, s, n, a) {
  3305. return arguments.length > 1 ? e.effects.animateClass.call(this, {remove: i}, s, n, a) : t.apply(this, arguments)
  3306. }
  3307. }(e.fn.removeClass), toggleClass: function (t) {
  3308. return function (i, s, n, a, o) {
  3309. return "boolean" == typeof s || void 0 === s ? n ? e.effects.animateClass.call(this, s ? {add: i} : {remove: i}, n, a, o) : t.apply(this, arguments) : e.effects.animateClass.call(this, {toggle: i}, s, n, a)
  3310. }
  3311. }(e.fn.toggleClass), switchClass: function (t, i, s, n, a) {
  3312. return e.effects.animateClass.call(this, {add: i, remove: t}, s, n, a)
  3313. }
  3314. })
  3315. }(), function () {
  3316. function t(t, i, s, n) {
  3317. return e.isPlainObject(t) && (i = t, t = t.effect), t = {effect: t}, null == i && (i = {}), e.isFunction(i) && (n = i, s = null, i = {}), ("number" == typeof i || e.fx.speeds[i]) && (n = s, s = i, i = {}), e.isFunction(s) && (n = s, s = null), i && e.extend(t, i), s = s || i.duration, t.duration = e.fx.off ? 0 : "number" == typeof s ? s : s in e.fx.speeds ? e.fx.speeds[s] : e.fx.speeds._default, t.complete = n || i.complete, t
  3318. }
  3319. function i(t) {
  3320. return !t || "number" == typeof t || e.fx.speeds[t] ? !0 : "string" != typeof t || e.effects.effect[t] ? e.isFunction(t) ? !0 : "object" != typeof t || t.effect ? !1 : !0 : !0
  3321. }
  3322. e.extend(e.effects, {
  3323. version: "1.11.2", save: function (e, t) {
  3324. for (var i = 0; t.length > i; i++) null !== t[i] && e.data(y + t[i], e[0].style[t[i]])
  3325. }, restore: function (e, t) {
  3326. var i, s;
  3327. for (s = 0; t.length > s; s++) null !== t[s] && (i = e.data(y + t[s]), void 0 === i && (i = ""), e.css(t[s], i))
  3328. }, setMode: function (e, t) {
  3329. return "toggle" === t && (t = e.is(":hidden") ? "show" : "hide"), t
  3330. }, getBaseline: function (e, t) {
  3331. var i, s;
  3332. switch (e[0]) {
  3333. case"top":
  3334. i = 0;
  3335. break;
  3336. case"middle":
  3337. i = .5;
  3338. break;
  3339. case"bottom":
  3340. i = 1;
  3341. break;
  3342. default:
  3343. i = e[0] / t.height
  3344. }
  3345. switch (e[1]) {
  3346. case"left":
  3347. s = 0;
  3348. break;
  3349. case"center":
  3350. s = .5;
  3351. break;
  3352. case"right":
  3353. s = 1;
  3354. break;
  3355. default:
  3356. s = e[1] / t.width
  3357. }
  3358. return {x: s, y: i}
  3359. }, createWrapper: function (t) {
  3360. if (t.parent().is(".ui-effects-wrapper")) return t.parent();
  3361. var i = {width: t.outerWidth(!0), height: t.outerHeight(!0), "float": t.css("float")},
  3362. s = e("<div></div>").addClass("ui-effects-wrapper").css({
  3363. fontSize: "100%",
  3364. background: "transparent",
  3365. border: "none",
  3366. margin: 0,
  3367. padding: 0
  3368. }), n = {width: t.width(), height: t.height()}, a = document.activeElement;
  3369. try {
  3370. a.id
  3371. } catch (o) {
  3372. a = document.body
  3373. }
  3374. return t.wrap(s), (t[0] === a || e.contains(t[0], a)) && e(a).focus(), s = t.parent(), "static" === t.css("position") ? (s.css({position: "relative"}), t.css({position: "relative"})) : (e.extend(i, {
  3375. position: t.css("position"),
  3376. zIndex: t.css("z-index")
  3377. }), e.each(["top", "left", "bottom", "right"], function (e, s) {
  3378. i[s] = t.css(s), isNaN(parseInt(i[s], 10)) && (i[s] = "auto")
  3379. }), t.css({
  3380. position: "relative",
  3381. top: 0,
  3382. left: 0,
  3383. right: "auto",
  3384. bottom: "auto"
  3385. })), t.css(n), s.css(i).show()
  3386. }, removeWrapper: function (t) {
  3387. var i = document.activeElement;
  3388. return t.parent().is(".ui-effects-wrapper") && (t.parent().replaceWith(t), (t[0] === i || e.contains(t[0], i)) && e(i).focus()), t
  3389. }, setTransition: function (t, i, s, n) {
  3390. return n = n || {}, e.each(i, function (e, i) {
  3391. var a = t.cssUnit(i);
  3392. a[0] > 0 && (n[i] = a[0] * s + a[1])
  3393. }), n
  3394. }
  3395. }), e.fn.extend({
  3396. effect: function () {
  3397. function i(t) {
  3398. function i() {
  3399. e.isFunction(a) && a.call(n[0]), e.isFunction(t) && t()
  3400. }
  3401. var n = e(this), a = s.complete, r = s.mode;
  3402. (n.is(":hidden") ? "hide" === r : "show" === r) ? (n[r](), i()) : o.call(n[0], s, i)
  3403. }
  3404. var s = t.apply(this, arguments), n = s.mode, a = s.queue, o = e.effects.effect[s.effect];
  3405. return e.fx.off || !o ? n ? this[n](s.duration, s.complete) : this.each(function () {
  3406. s.complete && s.complete.call(this)
  3407. }) : a === !1 ? this.each(i) : this.queue(a || "fx", i)
  3408. }, show: function (e) {
  3409. return function (s) {
  3410. if (i(s)) return e.apply(this, arguments);
  3411. var n = t.apply(this, arguments);
  3412. return n.mode = "show", this.effect.call(this, n)
  3413. }
  3414. }(e.fn.show), hide: function (e) {
  3415. return function (s) {
  3416. if (i(s)) return e.apply(this, arguments);
  3417. var n = t.apply(this, arguments);
  3418. return n.mode = "hide", this.effect.call(this, n)
  3419. }
  3420. }(e.fn.hide), toggle: function (e) {
  3421. return function (s) {
  3422. if (i(s) || "boolean" == typeof s) return e.apply(this, arguments);
  3423. var n = t.apply(this, arguments);
  3424. return n.mode = "toggle", this.effect.call(this, n)
  3425. }
  3426. }(e.fn.toggle), cssUnit: function (t) {
  3427. var i = this.css(t), s = [];
  3428. return e.each(["em", "px", "%", "pt"], function (e, t) {
  3429. i.indexOf(t) > 0 && (s = [parseFloat(i), t])
  3430. }), s
  3431. }
  3432. })
  3433. }(), function () {
  3434. var t = {};
  3435. e.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (e, i) {
  3436. t[i] = function (t) {
  3437. return Math.pow(t, e + 2)
  3438. }
  3439. }), e.extend(t, {
  3440. Sine: function (e) {
  3441. return 1 - Math.cos(e * Math.PI / 2)
  3442. }, Circ: function (e) {
  3443. return 1 - Math.sqrt(1 - e * e)
  3444. }, Elastic: function (e) {
  3445. return 0 === e || 1 === e ? e : -Math.pow(2, 8 * (e - 1)) * Math.sin((80 * (e - 1) - 7.5) * Math.PI / 15)
  3446. }, Back: function (e) {
  3447. return e * e * (3 * e - 2)
  3448. }, Bounce: function (e) {
  3449. for (var t, i = 4; ((t = Math.pow(2, --i)) - 1) / 11 > e;) ;
  3450. return 1 / Math.pow(4, 3 - i) - 7.5625 * Math.pow((3 * t - 2) / 22 - e, 2)
  3451. }
  3452. }), e.each(t, function (t, i) {
  3453. e.easing["easeIn" + t] = i, e.easing["easeOut" + t] = function (e) {
  3454. return 1 - i(1 - e)
  3455. }, e.easing["easeInOut" + t] = function (e) {
  3456. return .5 > e ? i(2 * e) / 2 : 1 - i(-2 * e + 2) / 2
  3457. }
  3458. })
  3459. }(), e.effects, e.effects.effect.blind = function (t, i) {
  3460. var s, n, a, o = e(this), r = /up|down|vertical/, h = /up|left|vertical|horizontal/,
  3461. l = ["position", "top", "bottom", "left", "right", "height", "width"],
  3462. u = e.effects.setMode(o, t.mode || "hide"), d = t.direction || "up", c = r.test(d),
  3463. p = c ? "height" : "width", f = c ? "top" : "left", m = h.test(d), g = {}, v = "show" === u;
  3464. o.parent().is(".ui-effects-wrapper") ? e.effects.save(o.parent(), l) : e.effects.save(o, l), o.show(), s = e.effects.createWrapper(o).css({overflow: "hidden"}), n = s[p](), a = parseFloat(s.css(f)) || 0, g[p] = v ? n : 0, m || (o.css(c ? "bottom" : "right", 0).css(c ? "top" : "left", "auto").css({position: "absolute"}), g[f] = v ? a : n + a), v && (s.css(p, 0), m || s.css(f, a + n)), s.animate(g, {
  3465. duration: t.duration,
  3466. easing: t.easing,
  3467. queue: !1,
  3468. complete: function () {
  3469. "hide" === u && o.hide(), e.effects.restore(o, l), e.effects.removeWrapper(o), i()
  3470. }
  3471. })
  3472. }, e.effects.effect.bounce = function (t, i) {
  3473. var s, n, a, o = e(this), r = ["position", "top", "bottom", "left", "right", "height", "width"],
  3474. h = e.effects.setMode(o, t.mode || "effect"), l = "hide" === h, u = "show" === h, d = t.direction || "up",
  3475. c = t.distance, p = t.times || 5, f = 2 * p + (u || l ? 1 : 0), m = t.duration / f, g = t.easing,
  3476. v = "up" === d || "down" === d ? "top" : "left", y = "up" === d || "left" === d, b = o.queue(),
  3477. _ = b.length;
  3478. for ((u || l) && r.push("opacity"), e.effects.save(o, r), o.show(), e.effects.createWrapper(o), c || (c = o["top" === v ? "outerHeight" : "outerWidth"]() / 3), u && (a = {opacity: 1}, a[v] = 0, o.css("opacity", 0).css(v, y ? 2 * -c : 2 * c).animate(a, m, g)), l && (c /= Math.pow(2, p - 1)), a = {}, a[v] = 0, s = 0; p > s; s++) n = {}, n[v] = (y ? "-=" : "+=") + c, o.animate(n, m, g).animate(a, m, g), c = l ? 2 * c : c / 2;
  3479. l && (n = {opacity: 0}, n[v] = (y ? "-=" : "+=") + c, o.animate(n, m, g)), o.queue(function () {
  3480. l && o.hide(), e.effects.restore(o, r), e.effects.removeWrapper(o), i()
  3481. }), _ > 1 && b.splice.apply(b, [1, 0].concat(b.splice(_, f + 1))), o.dequeue()
  3482. }, e.effects.effect.clip = function (t, i) {
  3483. var s, n, a, o = e(this), r = ["position", "top", "bottom", "left", "right", "height", "width"],
  3484. h = e.effects.setMode(o, t.mode || "hide"), l = "show" === h, u = t.direction || "vertical",
  3485. d = "vertical" === u, c = d ? "height" : "width", p = d ? "top" : "left", f = {};
  3486. e.effects.save(o, r), o.show(), s = e.effects.createWrapper(o).css({overflow: "hidden"}), n = "IMG" === o[0].tagName ? s : o, a = n[c](), l && (n.css(c, 0), n.css(p, a / 2)), f[c] = l ? a : 0, f[p] = l ? 0 : a / 2, n.animate(f, {
  3487. queue: !1,
  3488. duration: t.duration,
  3489. easing: t.easing,
  3490. complete: function () {
  3491. l || o.hide(), e.effects.restore(o, r), e.effects.removeWrapper(o), i()
  3492. }
  3493. })
  3494. }, e.effects.effect.drop = function (t, i) {
  3495. var s, n = e(this), a = ["position", "top", "bottom", "left", "right", "opacity", "height", "width"],
  3496. o = e.effects.setMode(n, t.mode || "hide"), r = "show" === o, h = t.direction || "left",
  3497. l = "up" === h || "down" === h ? "top" : "left", u = "up" === h || "left" === h ? "pos" : "neg",
  3498. d = {opacity: r ? 1 : 0};
  3499. e.effects.save(n, a), n.show(), e.effects.createWrapper(n), s = t.distance || n["top" === l ? "outerHeight" : "outerWidth"](!0) / 2, r && n.css("opacity", 0).css(l, "pos" === u ? -s : s), d[l] = (r ? "pos" === u ? "+=" : "-=" : "pos" === u ? "-=" : "+=") + s, n.animate(d, {
  3500. queue: !1,
  3501. duration: t.duration,
  3502. easing: t.easing,
  3503. complete: function () {
  3504. "hide" === o && n.hide(), e.effects.restore(n, a), e.effects.removeWrapper(n), i()
  3505. }
  3506. })
  3507. }, e.effects.effect.explode = function (t, i) {
  3508. function s() {
  3509. b.push(this), b.length === d * c && n()
  3510. }
  3511. function n() {
  3512. p.css({visibility: "visible"}), e(b).remove(), m || p.hide(), i()
  3513. }
  3514. var a, o, r, h, l, u, d = t.pieces ? Math.round(Math.sqrt(t.pieces)) : 3, c = d, p = e(this),
  3515. f = e.effects.setMode(p, t.mode || "hide"), m = "show" === f,
  3516. g = p.show().css("visibility", "hidden").offset(), v = Math.ceil(p.outerWidth() / c),
  3517. y = Math.ceil(p.outerHeight() / d), b = [];
  3518. for (a = 0; d > a; a++) for (h = g.top + a * y, u = a - (d - 1) / 2, o = 0; c > o; o++) r = g.left + o * v, l = o - (c - 1) / 2, p.clone().appendTo("body").wrap("<div></div>").css({
  3519. position: "absolute",
  3520. visibility: "visible",
  3521. left: -o * v,
  3522. top: -a * y
  3523. }).parent().addClass("ui-effects-explode").css({
  3524. position: "absolute",
  3525. overflow: "hidden",
  3526. width: v,
  3527. height: y,
  3528. left: r + (m ? l * v : 0),
  3529. top: h + (m ? u * y : 0),
  3530. opacity: m ? 0 : 1
  3531. }).animate({
  3532. left: r + (m ? 0 : l * v),
  3533. top: h + (m ? 0 : u * y),
  3534. opacity: m ? 1 : 0
  3535. }, t.duration || 500, t.easing, s)
  3536. }, e.effects.effect.fade = function (t, i) {
  3537. var s = e(this), n = e.effects.setMode(s, t.mode || "toggle");
  3538. s.animate({opacity: n}, {queue: !1, duration: t.duration, easing: t.easing, complete: i})
  3539. }, e.effects.effect.fold = function (t, i) {
  3540. var s, n, a = e(this), o = ["position", "top", "bottom", "left", "right", "height", "width"],
  3541. r = e.effects.setMode(a, t.mode || "hide"), h = "show" === r, l = "hide" === r, u = t.size || 15,
  3542. d = /([0-9]+)%/.exec(u), c = !!t.horizFirst, p = h !== c, f = p ? ["width", "height"] : ["height", "width"],
  3543. m = t.duration / 2, g = {}, v = {};
  3544. e.effects.save(a, o), a.show(), s = e.effects.createWrapper(a).css({overflow: "hidden"}), n = p ? [s.width(), s.height()] : [s.height(), s.width()], d && (u = parseInt(d[1], 10) / 100 * n[l ? 0 : 1]), h && s.css(c ? {
  3545. height: 0,
  3546. width: u
  3547. } : {
  3548. height: u,
  3549. width: 0
  3550. }), g[f[0]] = h ? n[0] : u, v[f[1]] = h ? n[1] : 0, s.animate(g, m, t.easing).animate(v, m, t.easing, function () {
  3551. l && a.hide(), e.effects.restore(a, o), e.effects.removeWrapper(a), i()
  3552. })
  3553. }, e.effects.effect.highlight = function (t, i) {
  3554. var s = e(this), n = ["backgroundImage", "backgroundColor", "opacity"],
  3555. a = e.effects.setMode(s, t.mode || "show"), o = {backgroundColor: s.css("backgroundColor")};
  3556. "hide" === a && (o.opacity = 0), e.effects.save(s, n), s.show().css({
  3557. backgroundImage: "none",
  3558. backgroundColor: t.color || "#ffff99"
  3559. }).animate(o, {
  3560. queue: !1, duration: t.duration, easing: t.easing, complete: function () {
  3561. "hide" === a && s.hide(), e.effects.restore(s, n), i()
  3562. }
  3563. })
  3564. }, e.effects.effect.size = function (t, i) {
  3565. var s, n, a, o = e(this),
  3566. r = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"],
  3567. h = ["position", "top", "bottom", "left", "right", "overflow", "opacity"],
  3568. l = ["width", "height", "overflow"], u = ["fontSize"],
  3569. d = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"],
  3570. c = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"],
  3571. p = e.effects.setMode(o, t.mode || "effect"), f = t.restore || "effect" !== p, m = t.scale || "both",
  3572. g = t.origin || ["middle", "center"], v = o.css("position"), y = f ? r : h,
  3573. b = {height: 0, width: 0, outerHeight: 0, outerWidth: 0};
  3574. "show" === p && o.show(), s = {
  3575. height: o.height(),
  3576. width: o.width(),
  3577. outerHeight: o.outerHeight(),
  3578. outerWidth: o.outerWidth()
  3579. }, "toggle" === t.mode && "show" === p ? (o.from = t.to || b, o.to = t.from || s) : (o.from = t.from || ("show" === p ? b : s), o.to = t.to || ("hide" === p ? b : s)), a = {
  3580. from: {
  3581. y: o.from.height / s.height,
  3582. x: o.from.width / s.width
  3583. }, to: {y: o.to.height / s.height, x: o.to.width / s.width}
  3584. }, ("box" === m || "both" === m) && (a.from.y !== a.to.y && (y = y.concat(d), o.from = e.effects.setTransition(o, d, a.from.y, o.from), o.to = e.effects.setTransition(o, d, a.to.y, o.to)), a.from.x !== a.to.x && (y = y.concat(c), o.from = e.effects.setTransition(o, c, a.from.x, o.from), o.to = e.effects.setTransition(o, c, a.to.x, o.to))), ("content" === m || "both" === m) && a.from.y !== a.to.y && (y = y.concat(u).concat(l), o.from = e.effects.setTransition(o, u, a.from.y, o.from), o.to = e.effects.setTransition(o, u, a.to.y, o.to)), e.effects.save(o, y), o.show(), e.effects.createWrapper(o), o.css("overflow", "hidden").css(o.from), g && (n = e.effects.getBaseline(g, s), o.from.top = (s.outerHeight - o.outerHeight()) * n.y, o.from.left = (s.outerWidth - o.outerWidth()) * n.x, o.to.top = (s.outerHeight - o.to.outerHeight) * n.y, o.to.left = (s.outerWidth - o.to.outerWidth) * n.x), o.css(o.from), ("content" === m || "both" === m) && (d = d.concat(["marginTop", "marginBottom"]).concat(u), c = c.concat(["marginLeft", "marginRight"]), l = r.concat(d).concat(c), o.find("*[width]").each(function () {
  3585. var i = e(this),
  3586. s = {height: i.height(), width: i.width(), outerHeight: i.outerHeight(), outerWidth: i.outerWidth()};
  3587. f && e.effects.save(i, l), i.from = {
  3588. height: s.height * a.from.y,
  3589. width: s.width * a.from.x,
  3590. outerHeight: s.outerHeight * a.from.y,
  3591. outerWidth: s.outerWidth * a.from.x
  3592. }, i.to = {
  3593. height: s.height * a.to.y,
  3594. width: s.width * a.to.x,
  3595. outerHeight: s.height * a.to.y,
  3596. outerWidth: s.width * a.to.x
  3597. }, a.from.y !== a.to.y && (i.from = e.effects.setTransition(i, d, a.from.y, i.from), i.to = e.effects.setTransition(i, d, a.to.y, i.to)), a.from.x !== a.to.x && (i.from = e.effects.setTransition(i, c, a.from.x, i.from), i.to = e.effects.setTransition(i, c, a.to.x, i.to)), i.css(i.from), i.animate(i.to, t.duration, t.easing, function () {
  3598. f && e.effects.restore(i, l)
  3599. })
  3600. })), o.animate(o.to, {
  3601. queue: !1, duration: t.duration, easing: t.easing, complete: function () {
  3602. 0 === o.to.opacity && o.css("opacity", o.from.opacity), "hide" === p && o.hide(), e.effects.restore(o, y), f || ("static" === v ? o.css({
  3603. position: "relative",
  3604. top: o.to.top,
  3605. left: o.to.left
  3606. }) : e.each(["top", "left"], function (e, t) {
  3607. o.css(t, function (t, i) {
  3608. var s = parseInt(i, 10), n = e ? o.to.left : o.to.top;
  3609. return "auto" === i ? n + "px" : s + n + "px"
  3610. })
  3611. })), e.effects.removeWrapper(o), i()
  3612. }
  3613. })
  3614. }, e.effects.effect.scale = function (t, i) {
  3615. var s = e(this), n = e.extend(!0, {}, t), a = e.effects.setMode(s, t.mode || "effect"),
  3616. o = parseInt(t.percent, 10) || (0 === parseInt(t.percent, 10) ? 0 : "hide" === a ? 0 : 100),
  3617. r = t.direction || "both", h = t.origin,
  3618. l = {height: s.height(), width: s.width(), outerHeight: s.outerHeight(), outerWidth: s.outerWidth()},
  3619. u = {y: "horizontal" !== r ? o / 100 : 1, x: "vertical" !== r ? o / 100 : 1};
  3620. n.effect = "size", n.queue = !1, n.complete = i, "effect" !== a && (n.origin = h || ["middle", "center"], n.restore = !0), n.from = t.from || ("show" === a ? {
  3621. height: 0,
  3622. width: 0,
  3623. outerHeight: 0,
  3624. outerWidth: 0
  3625. } : l), n.to = {
  3626. height: l.height * u.y,
  3627. width: l.width * u.x,
  3628. outerHeight: l.outerHeight * u.y,
  3629. outerWidth: l.outerWidth * u.x
  3630. }, n.fade && ("show" === a && (n.from.opacity = 0, n.to.opacity = 1), "hide" === a && (n.from.opacity = 1, n.to.opacity = 0)), s.effect(n)
  3631. }, e.effects.effect.puff = function (t, i) {
  3632. var s = e(this), n = e.effects.setMode(s, t.mode || "hide"), a = "hide" === n,
  3633. o = parseInt(t.percent, 10) || 150, r = o / 100,
  3634. h = {height: s.height(), width: s.width(), outerHeight: s.outerHeight(), outerWidth: s.outerWidth()};
  3635. e.extend(t, {
  3636. effect: "scale",
  3637. queue: !1,
  3638. fade: !0,
  3639. mode: n,
  3640. complete: i,
  3641. percent: a ? o : 100,
  3642. from: a ? h : {
  3643. height: h.height * r,
  3644. width: h.width * r,
  3645. outerHeight: h.outerHeight * r,
  3646. outerWidth: h.outerWidth * r
  3647. }
  3648. }), s.effect(t)
  3649. }, e.effects.effect.pulsate = function (t, i) {
  3650. var s, n = e(this), a = e.effects.setMode(n, t.mode || "show"), o = "show" === a, r = "hide" === a,
  3651. h = o || "hide" === a, l = 2 * (t.times || 5) + (h ? 1 : 0), u = t.duration / l, d = 0, c = n.queue(),
  3652. p = c.length;
  3653. for ((o || !n.is(":visible")) && (n.css("opacity", 0).show(), d = 1), s = 1; l > s; s++) n.animate({opacity: d}, u, t.easing), d = 1 - d;
  3654. n.animate({opacity: d}, u, t.easing), n.queue(function () {
  3655. r && n.hide(), i()
  3656. }), p > 1 && c.splice.apply(c, [1, 0].concat(c.splice(p, l + 1))), n.dequeue()
  3657. }, e.effects.effect.shake = function (t, i) {
  3658. var s, n = e(this), a = ["position", "top", "bottom", "left", "right", "height", "width"],
  3659. o = e.effects.setMode(n, t.mode || "effect"), r = t.direction || "left", h = t.distance || 20,
  3660. l = t.times || 3, u = 2 * l + 1, d = Math.round(t.duration / u),
  3661. c = "up" === r || "down" === r ? "top" : "left", p = "up" === r || "left" === r, f = {}, m = {}, g = {},
  3662. v = n.queue(), y = v.length;
  3663. for (e.effects.save(n, a), n.show(), e.effects.createWrapper(n), f[c] = (p ? "-=" : "+=") + h, m[c] = (p ? "+=" : "-=") + 2 * h, g[c] = (p ? "-=" : "+=") + 2 * h, n.animate(f, d, t.easing), s = 1; l > s; s++) n.animate(m, d, t.easing).animate(g, d, t.easing);
  3664. n.animate(m, d, t.easing).animate(f, d / 2, t.easing).queue(function () {
  3665. "hide" === o && n.hide(), e.effects.restore(n, a), e.effects.removeWrapper(n), i()
  3666. }), y > 1 && v.splice.apply(v, [1, 0].concat(v.splice(y, u + 1))), n.dequeue()
  3667. }, e.effects.effect.slide = function (t, i) {
  3668. var s, n = e(this), a = ["position", "top", "bottom", "left", "right", "width", "height"],
  3669. o = e.effects.setMode(n, t.mode || "show"), r = "show" === o, h = t.direction || "left",
  3670. l = "up" === h || "down" === h ? "top" : "left", u = "up" === h || "left" === h, d = {};
  3671. e.effects.save(n, a), n.show(), s = t.distance || n["top" === l ? "outerHeight" : "outerWidth"](!0), e.effects.createWrapper(n).css({overflow: "hidden"}), r && n.css(l, u ? isNaN(s) ? "-" + s : -s : s), d[l] = (r ? u ? "+=" : "-=" : u ? "-=" : "+=") + s, n.animate(d, {
  3672. queue: !1,
  3673. duration: t.duration,
  3674. easing: t.easing,
  3675. complete: function () {
  3676. "hide" === o && n.hide(), e.effects.restore(n, a), e.effects.removeWrapper(n), i()
  3677. }
  3678. })
  3679. }, e.effects.effect.transfer = function (t, i) {
  3680. var s = e(this), n = e(t.to), a = "fixed" === n.css("position"), o = e("body"), r = a ? o.scrollTop() : 0,
  3681. h = a ? o.scrollLeft() : 0, l = n.offset(),
  3682. u = {top: l.top - r, left: l.left - h, height: n.innerHeight(), width: n.innerWidth()}, d = s.offset(),
  3683. c = e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({
  3684. top: d.top - r,
  3685. left: d.left - h,
  3686. height: s.innerHeight(),
  3687. width: s.innerWidth(),
  3688. position: a ? "fixed" : "absolute"
  3689. }).animate(u, t.duration, t.easing, function () {
  3690. c.remove(), i()
  3691. })
  3692. }, e.widget("ui.progressbar", {
  3693. version: "1.11.2", options: {max: 100, value: 0, change: null, complete: null}, min: 0, _create: function () {
  3694. this.oldValue = this.options.value = this._constrainedValue(), this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({
  3695. role: "progressbar",
  3696. "aria-valuemin": this.min
  3697. }), this.valueDiv = e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element), this._refreshValue()
  3698. }, _destroy: function () {
  3699. this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"), this.valueDiv.remove()
  3700. }, value: function (e) {
  3701. return void 0 === e ? this.options.value : (this.options.value = this._constrainedValue(e), this._refreshValue(), void 0)
  3702. }, _constrainedValue: function (e) {
  3703. return void 0 === e && (e = this.options.value), this.indeterminate = e === !1, "number" != typeof e && (e = 0), this.indeterminate ? !1 : Math.min(this.options.max, Math.max(this.min, e))
  3704. }, _setOptions: function (e) {
  3705. var t = e.value;
  3706. delete e.value, this._super(e), this.options.value = this._constrainedValue(t), this._refreshValue()
  3707. }, _setOption: function (e, t) {
  3708. "max" === e && (t = Math.max(this.min, t)), "disabled" === e && this.element.toggleClass("ui-state-disabled", !!t).attr("aria-disabled", t), this._super(e, t)
  3709. }, _percentage: function () {
  3710. return this.indeterminate ? 100 : 100 * (this.options.value - this.min) / (this.options.max - this.min)
  3711. }, _refreshValue: function () {
  3712. var t = this.options.value, i = this._percentage();
  3713. this.valueDiv.toggle(this.indeterminate || t > this.min).toggleClass("ui-corner-right", t === this.options.max).width(i.toFixed(0) + "%"), this.element.toggleClass("ui-progressbar-indeterminate", this.indeterminate), this.indeterminate ? (this.element.removeAttr("aria-valuenow"), this.overlayDiv || (this.overlayDiv = e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))) : (this.element.attr({
  3714. "aria-valuemax": this.options.max,
  3715. "aria-valuenow": t
  3716. }), this.overlayDiv && (this.overlayDiv.remove(), this.overlayDiv = null)), this.oldValue !== t && (this.oldValue = t, this._trigger("change")), t === this.options.max && this._trigger("complete")
  3717. }
  3718. }), e.widget("ui.selectable", e.ui.mouse, {
  3719. version: "1.11.2",
  3720. options: {
  3721. appendTo: "body",
  3722. autoRefresh: !0,
  3723. distance: 0,
  3724. filter: "*",
  3725. tolerance: "touch",
  3726. selected: null,
  3727. selecting: null,
  3728. start: null,
  3729. stop: null,
  3730. unselected: null,
  3731. unselecting: null
  3732. },
  3733. _create: function () {
  3734. var t, i = this;
  3735. this.element.addClass("ui-selectable"), this.dragged = !1, this.refresh = function () {
  3736. t = e(i.options.filter, i.element[0]), t.addClass("ui-selectee"), t.each(function () {
  3737. var t = e(this), i = t.offset();
  3738. e.data(this, "selectable-item", {
  3739. element: this,
  3740. $element: t,
  3741. left: i.left,
  3742. top: i.top,
  3743. right: i.left + t.outerWidth(),
  3744. bottom: i.top + t.outerHeight(),
  3745. startselected: !1,
  3746. selected: t.hasClass("ui-selected"),
  3747. selecting: t.hasClass("ui-selecting"),
  3748. unselecting: t.hasClass("ui-unselecting")
  3749. })
  3750. })
  3751. }, this.refresh(), this.selectees = t.addClass("ui-selectee"), this._mouseInit(), this.helper = e("<div class='ui-selectable-helper'></div>")
  3752. },
  3753. _destroy: function () {
  3754. this.selectees.removeClass("ui-selectee").removeData("selectable-item"), this.element.removeClass("ui-selectable ui-selectable-disabled"), this._mouseDestroy()
  3755. },
  3756. _mouseStart: function (t) {
  3757. var i = this, s = this.options;
  3758. this.opos = [t.pageX, t.pageY], this.options.disabled || (this.selectees = e(s.filter, this.element[0]), this._trigger("start", t), e(s.appendTo).append(this.helper), this.helper.css({
  3759. left: t.pageX,
  3760. top: t.pageY,
  3761. width: 0,
  3762. height: 0
  3763. }), s.autoRefresh && this.refresh(), this.selectees.filter(".ui-selected").each(function () {
  3764. var s = e.data(this, "selectable-item");
  3765. s.startselected = !0, t.metaKey || t.ctrlKey || (s.$element.removeClass("ui-selected"), s.selected = !1, s.$element.addClass("ui-unselecting"), s.unselecting = !0, i._trigger("unselecting", t, {unselecting: s.element}))
  3766. }), e(t.target).parents().addBack().each(function () {
  3767. var s, n = e.data(this, "selectable-item");
  3768. return n ? (s = !t.metaKey && !t.ctrlKey || !n.$element.hasClass("ui-selected"), n.$element.removeClass(s ? "ui-unselecting" : "ui-selected").addClass(s ? "ui-selecting" : "ui-unselecting"), n.unselecting = !s, n.selecting = s, n.selected = s, s ? i._trigger("selecting", t, {selecting: n.element}) : i._trigger("unselecting", t, {unselecting: n.element}), !1) : void 0
  3769. }))
  3770. },
  3771. _mouseDrag: function (t) {
  3772. if (this.dragged = !0, !this.options.disabled) {
  3773. var i, s = this, n = this.options, a = this.opos[0], o = this.opos[1], r = t.pageX, h = t.pageY;
  3774. return a > r && (i = r, r = a, a = i), o > h && (i = h, h = o, o = i), this.helper.css({
  3775. left: a,
  3776. top: o,
  3777. width: r - a,
  3778. height: h - o
  3779. }), this.selectees.each(function () {
  3780. var i = e.data(this, "selectable-item"), l = !1;
  3781. i && i.element !== s.element[0] && ("touch" === n.tolerance ? l = !(i.left > r || a > i.right || i.top > h || o > i.bottom) : "fit" === n.tolerance && (l = i.left > a && r > i.right && i.top > o && h > i.bottom), l ? (i.selected && (i.$element.removeClass("ui-selected"), i.selected = !1), i.unselecting && (i.$element.removeClass("ui-unselecting"), i.unselecting = !1), i.selecting || (i.$element.addClass("ui-selecting"), i.selecting = !0, s._trigger("selecting", t, {selecting: i.element}))) : (i.selecting && ((t.metaKey || t.ctrlKey) && i.startselected ? (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.$element.addClass("ui-selected"), i.selected = !0) : (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.startselected && (i.$element.addClass("ui-unselecting"), i.unselecting = !0), s._trigger("unselecting", t, {unselecting: i.element}))), i.selected && (t.metaKey || t.ctrlKey || i.startselected || (i.$element.removeClass("ui-selected"), i.selected = !1, i.$element.addClass("ui-unselecting"), i.unselecting = !0, s._trigger("unselecting", t, {unselecting: i.element})))))
  3782. }), !1
  3783. }
  3784. },
  3785. _mouseStop: function (t) {
  3786. var i = this;
  3787. return this.dragged = !1, e(".ui-unselecting", this.element[0]).each(function () {
  3788. var s = e.data(this, "selectable-item");
  3789. s.$element.removeClass("ui-unselecting"), s.unselecting = !1, s.startselected = !1, i._trigger("unselected", t, {unselected: s.element})
  3790. }), e(".ui-selecting", this.element[0]).each(function () {
  3791. var s = e.data(this, "selectable-item");
  3792. s.$element.removeClass("ui-selecting").addClass("ui-selected"), s.selecting = !1, s.selected = !0, s.startselected = !0, i._trigger("selected", t, {selected: s.element})
  3793. }), this._trigger("stop", t), this.helper.remove(), !1
  3794. }
  3795. }), e.widget("ui.selectmenu", {
  3796. version: "1.11.2",
  3797. defaultElement: "<select>",
  3798. options: {
  3799. appendTo: null,
  3800. disabled: null,
  3801. icons: {button: "ui-icon-triangle-1-s"},
  3802. position: {my: "left top", at: "left bottom", collision: "none"},
  3803. width: null,
  3804. change: null,
  3805. close: null,
  3806. focus: null,
  3807. open: null,
  3808. select: null
  3809. },
  3810. _create: function () {
  3811. var e = this.element.uniqueId().attr("id");
  3812. this.ids = {
  3813. element: e,
  3814. button: e + "-button",
  3815. menu: e + "-menu"
  3816. }, this._drawButton(), this._drawMenu(), this.options.disabled && this.disable()
  3817. },
  3818. _drawButton: function () {
  3819. var t = this, i = this.element.attr("tabindex");
  3820. this.label = e("label[for='" + this.ids.element + "']").attr("for", this.ids.button), this._on(this.label, {
  3821. click: function (e) {
  3822. this.button.focus(), e.preventDefault()
  3823. }
  3824. }), this.element.hide(), this.button = e("<span>", {
  3825. "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
  3826. tabindex: i || this.options.disabled ? -1 : 0,
  3827. id: this.ids.button,
  3828. role: "combobox",
  3829. "aria-expanded": "false",
  3830. "aria-autocomplete": "list",
  3831. "aria-owns": this.ids.menu,
  3832. "aria-haspopup": "true"
  3833. }).insertAfter(this.element), e("<span>", {"class": "ui-icon " + this.options.icons.button}).prependTo(this.button), this.buttonText = e("<span>", {"class": "ui-selectmenu-text"}).appendTo(this.button), this._setText(this.buttonText, this.element.find("option:selected").text()), this._resizeButton(), this._on(this.button, this._buttonEvents), this.button.one("focusin", function () {
  3834. t.menuItems || t._refreshMenu()
  3835. }), this._hoverable(this.button), this._focusable(this.button)
  3836. },
  3837. _drawMenu: function () {
  3838. var t = this;
  3839. this.menu = e("<ul>", {
  3840. "aria-hidden": "true",
  3841. "aria-labelledby": this.ids.button,
  3842. id: this.ids.menu
  3843. }), this.menuWrap = e("<div>", {"class": "ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()), this.menuInstance = this.menu.menu({
  3844. role: "listbox",
  3845. select: function (e, i) {
  3846. e.preventDefault(), t._setSelection(), t._select(i.item.data("ui-selectmenu-item"), e)
  3847. },
  3848. focus: function (e, i) {
  3849. var s = i.item.data("ui-selectmenu-item");
  3850. null != t.focusIndex && s.index !== t.focusIndex && (t._trigger("focus", e, {item: s}), t.isOpen || t._select(s, e)), t.focusIndex = s.index, t.button.attr("aria-activedescendant", t.menuItems.eq(s.index).attr("id"))
  3851. }
  3852. }).menu("instance"), this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"), this.menuInstance._off(this.menu, "mouseleave"), this.menuInstance._closeOnDocumentClick = function () {
  3853. return !1
  3854. }, this.menuInstance._isDivider = function () {
  3855. return !1
  3856. }
  3857. },
  3858. refresh: function () {
  3859. this._refreshMenu(), this._setText(this.buttonText, this._getSelectedItem().text()), this.options.width || this._resizeButton()
  3860. },
  3861. _refreshMenu: function () {
  3862. this.menu.empty();
  3863. var e, t = this.element.find("option");
  3864. t.length && (this._parseOptions(t), this._renderMenu(this.menu, this.items), this.menuInstance.refresh(), this.menuItems = this.menu.find("li").not(".ui-selectmenu-optgroup"), e = this._getSelectedItem(), this.menuInstance.focus(null, e), this._setAria(e.data("ui-selectmenu-item")), this._setOption("disabled", this.element.prop("disabled")))
  3865. },
  3866. open: function (e) {
  3867. this.options.disabled || (this.menuItems ? (this.menu.find(".ui-state-focus").removeClass("ui-state-focus"), this.menuInstance.focus(null, this._getSelectedItem())) : this._refreshMenu(), this.isOpen = !0, this._toggleAttr(), this._resizeMenu(), this._position(), this._on(this.document, this._documentClick), this._trigger("open", e))
  3868. },
  3869. _position: function () {
  3870. this.menuWrap.position(e.extend({of: this.button}, this.options.position))
  3871. },
  3872. close: function (e) {
  3873. this.isOpen && (this.isOpen = !1, this._toggleAttr(), this.range = null, this._off(this.document), this._trigger("close", e))
  3874. },
  3875. widget: function () {
  3876. return this.button
  3877. },
  3878. menuWidget: function () {
  3879. return this.menu
  3880. },
  3881. _renderMenu: function (t, i) {
  3882. var s = this, n = "";
  3883. e.each(i, function (i, a) {
  3884. a.optgroup !== n && (e("<li>", {
  3885. "class": "ui-selectmenu-optgroup ui-menu-divider" + (a.element.parent("optgroup").prop("disabled") ? " ui-state-disabled" : ""),
  3886. text: a.optgroup
  3887. }).appendTo(t), n = a.optgroup), s._renderItemData(t, a)
  3888. })
  3889. },
  3890. _renderItemData: function (e, t) {
  3891. return this._renderItem(e, t).data("ui-selectmenu-item", t)
  3892. },
  3893. _renderItem: function (t, i) {
  3894. var s = e("<li>");
  3895. return i.disabled && s.addClass("ui-state-disabled"), this._setText(s, i.label), s.appendTo(t)
  3896. },
  3897. _setText: function (e, t) {
  3898. t ? e.text(t) : e.html("&#160;")
  3899. },
  3900. _move: function (e, t) {
  3901. var i, s, n = ".ui-menu-item";
  3902. this.isOpen ? i = this.menuItems.eq(this.focusIndex) : (i = this.menuItems.eq(this.element[0].selectedIndex), n += ":not(.ui-state-disabled)"), s = "first" === e || "last" === e ? i["first" === e ? "prevAll" : "nextAll"](n).eq(-1) : i[e + "All"](n).eq(0), s.length && this.menuInstance.focus(t, s)
  3903. },
  3904. _getSelectedItem: function () {
  3905. return this.menuItems.eq(this.element[0].selectedIndex)
  3906. },
  3907. _toggle: function (e) {
  3908. this[this.isOpen ? "close" : "open"](e)
  3909. },
  3910. _setSelection: function () {
  3911. var e;
  3912. this.range && (window.getSelection ? (e = window.getSelection(), e.removeAllRanges(), e.addRange(this.range)) : this.range.select(), this.button.focus())
  3913. },
  3914. _documentClick: {
  3915. mousedown: function (t) {
  3916. this.isOpen && (e(t.target).closest(".ui-selectmenu-menu, #" + this.ids.button).length || this.close(t))
  3917. }
  3918. },
  3919. _buttonEvents: {
  3920. mousedown: function () {
  3921. var e;
  3922. window.getSelection ? (e = window.getSelection(), e.rangeCount && (this.range = e.getRangeAt(0))) : this.range = document.selection.createRange()
  3923. }, click: function (e) {
  3924. this._setSelection(), this._toggle(e)
  3925. }, keydown: function (t) {
  3926. var i = !0;
  3927. switch (t.keyCode) {
  3928. case e.ui.keyCode.TAB:
  3929. case e.ui.keyCode.ESCAPE:
  3930. this.close(t), i = !1;
  3931. break;
  3932. case e.ui.keyCode.ENTER:
  3933. this.isOpen && this._selectFocusedItem(t);
  3934. break;
  3935. case e.ui.keyCode.UP:
  3936. t.altKey ? this._toggle(t) : this._move("prev", t);
  3937. break;
  3938. case e.ui.keyCode.DOWN:
  3939. t.altKey ? this._toggle(t) : this._move("next", t);
  3940. break;
  3941. case e.ui.keyCode.SPACE:
  3942. this.isOpen ? this._selectFocusedItem(t) : this._toggle(t);
  3943. break;
  3944. case e.ui.keyCode.LEFT:
  3945. this._move("prev", t);
  3946. break;
  3947. case e.ui.keyCode.RIGHT:
  3948. this._move("next", t);
  3949. break;
  3950. case e.ui.keyCode.HOME:
  3951. case e.ui.keyCode.PAGE_UP:
  3952. this._move("first", t);
  3953. break;
  3954. case e.ui.keyCode.END:
  3955. case e.ui.keyCode.PAGE_DOWN:
  3956. this._move("last", t);
  3957. break;
  3958. default:
  3959. this.menu.trigger(t), i = !1
  3960. }
  3961. i && t.preventDefault()
  3962. }
  3963. },
  3964. _selectFocusedItem: function (e) {
  3965. var t = this.menuItems.eq(this.focusIndex);
  3966. t.hasClass("ui-state-disabled") || this._select(t.data("ui-selectmenu-item"), e)
  3967. },
  3968. _select: function (e, t) {
  3969. var i = this.element[0].selectedIndex;
  3970. this.element[0].selectedIndex = e.index, this._setText(this.buttonText, e.label), this._setAria(e), this._trigger("select", t, {item: e}), e.index !== i && this._trigger("change", t, {item: e}), this.close(t)
  3971. },
  3972. _setAria: function (e) {
  3973. var t = this.menuItems.eq(e.index).attr("id");
  3974. this.button.attr({
  3975. "aria-labelledby": t,
  3976. "aria-activedescendant": t
  3977. }), this.menu.attr("aria-activedescendant", t)
  3978. },
  3979. _setOption: function (e, t) {
  3980. "icons" === e && this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button), this._super(e, t), "appendTo" === e && this.menuWrap.appendTo(this._appendTo()), "disabled" === e && (this.menuInstance.option("disabled", t), this.button.toggleClass("ui-state-disabled", t).attr("aria-disabled", t), this.element.prop("disabled", t), t ? (this.button.attr("tabindex", -1), this.close()) : this.button.attr("tabindex", 0)), "width" === e && this._resizeButton()
  3981. },
  3982. _appendTo: function () {
  3983. var t = this.options.appendTo;
  3984. return t && (t = t.jquery || t.nodeType ? e(t) : this.document.find(t).eq(0)), t && t[0] || (t = this.element.closest(".ui-front")), t.length || (t = this.document[0].body), t
  3985. },
  3986. _toggleAttr: function () {
  3987. this.button.toggleClass("ui-corner-top", this.isOpen).toggleClass("ui-corner-all", !this.isOpen).attr("aria-expanded", this.isOpen), this.menuWrap.toggleClass("ui-selectmenu-open", this.isOpen), this.menu.attr("aria-hidden", !this.isOpen)
  3988. },
  3989. _resizeButton: function () {
  3990. var e = this.options.width;
  3991. e || (e = this.element.show().outerWidth(), this.element.hide()), this.button.outerWidth(e)
  3992. },
  3993. _resizeMenu: function () {
  3994. this.menu.outerWidth(Math.max(this.button.outerWidth(), this.menu.width("").outerWidth() + 1))
  3995. },
  3996. _getCreateOptions: function () {
  3997. return {disabled: this.element.prop("disabled")}
  3998. },
  3999. _parseOptions: function (t) {
  4000. var i = [];
  4001. t.each(function (t, s) {
  4002. var n = e(s), a = n.parent("optgroup");
  4003. i.push({
  4004. element: n,
  4005. index: t,
  4006. value: n.attr("value"),
  4007. label: n.text(),
  4008. optgroup: a.attr("label") || "",
  4009. disabled: a.prop("disabled") || n.prop("disabled")
  4010. })
  4011. }), this.items = i
  4012. },
  4013. _destroy: function () {
  4014. this.menuWrap.remove(), this.button.remove(), this.element.show(), this.element.removeUniqueId(), this.label.attr("for", this.ids.element)
  4015. }
  4016. }), e.widget("ui.slider", e.ui.mouse, {
  4017. version: "1.11.2",
  4018. widgetEventPrefix: "slide",
  4019. options: {
  4020. animate: !1,
  4021. distance: 0,
  4022. max: 100,
  4023. min: 0,
  4024. orientation: "horizontal",
  4025. range: !1,
  4026. step: 1,
  4027. value: 0,
  4028. values: null,
  4029. change: null,
  4030. slide: null,
  4031. start: null,
  4032. stop: null
  4033. },
  4034. numPages: 5,
  4035. _create: function () {
  4036. this._keySliding = !1, this._mouseSliding = !1, this._animateOff = !0, this._handleIndex = null, this._detectOrientation(), this._mouseInit(), this._calculateNewMax(), this.element.addClass("ui-slider ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all"), this._refresh(), this._setOption("disabled", this.options.disabled), this._animateOff = !1
  4037. },
  4038. _refresh: function () {
  4039. this._createRange(), this._createHandles(), this._setupEvents(), this._refreshValue()
  4040. },
  4041. _createHandles: function () {
  4042. var t, i, s = this.options,
  4043. n = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),
  4044. a = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>", o = [];
  4045. for (i = s.values && s.values.length || 1, n.length > i && (n.slice(i).remove(), n = n.slice(0, i)), t = n.length; i > t; t++) o.push(a);
  4046. this.handles = n.add(e(o.join("")).appendTo(this.element)), this.handle = this.handles.eq(0), this.handles.each(function (t) {
  4047. e(this).data("ui-slider-handle-index", t)
  4048. })
  4049. },
  4050. _createRange: function () {
  4051. var t = this.options, i = "";
  4052. t.range ? (t.range === !0 && (t.values ? t.values.length && 2 !== t.values.length ? t.values = [t.values[0], t.values[0]] : e.isArray(t.values) && (t.values = t.values.slice(0)) : t.values = [this._valueMin(), this._valueMin()]), this.range && this.range.length ? this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({
  4053. left: "",
  4054. bottom: ""
  4055. }) : (this.range = e("<div></div>").appendTo(this.element), i = "ui-slider-range ui-widget-header ui-corner-all"), this.range.addClass(i + ("min" === t.range || "max" === t.range ? " ui-slider-range-" + t.range : ""))) : (this.range && this.range.remove(), this.range = null)
  4056. },
  4057. _setupEvents: function () {
  4058. this._off(this.handles), this._on(this.handles, this._handleEvents), this._hoverable(this.handles), this._focusable(this.handles)
  4059. },
  4060. _destroy: function () {
  4061. this.handles.remove(), this.range && this.range.remove(), this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"), this._mouseDestroy()
  4062. },
  4063. _mouseCapture: function (t) {
  4064. var i, s, n, a, o, r, h, l, u = this, d = this.options;
  4065. return d.disabled ? !1 : (this.elementSize = {
  4066. width: this.element.outerWidth(),
  4067. height: this.element.outerHeight()
  4068. }, this.elementOffset = this.element.offset(), i = {
  4069. x: t.pageX,
  4070. y: t.pageY
  4071. }, s = this._normValueFromMouse(i), n = this._valueMax() - this._valueMin() + 1, this.handles.each(function (t) {
  4072. var i = Math.abs(s - u.values(t));
  4073. (n > i || n === i && (t === u._lastChangedValue || u.values(t) === d.min)) && (n = i, a = e(this), o = t)
  4074. }), r = this._start(t, o), r === !1 ? !1 : (this._mouseSliding = !0, this._handleIndex = o, a.addClass("ui-state-active").focus(), h = a.offset(), l = !e(t.target).parents().addBack().is(".ui-slider-handle"), this._clickOffset = l ? {
  4075. left: 0,
  4076. top: 0
  4077. } : {
  4078. left: t.pageX - h.left - a.width() / 2,
  4079. top: t.pageY - h.top - a.height() / 2 - (parseInt(a.css("borderTopWidth"), 10) || 0) - (parseInt(a.css("borderBottomWidth"), 10) || 0) + (parseInt(a.css("marginTop"), 10) || 0)
  4080. }, this.handles.hasClass("ui-state-hover") || this._slide(t, o, s), this._animateOff = !0, !0))
  4081. },
  4082. _mouseStart: function () {
  4083. return !0
  4084. },
  4085. _mouseDrag: function (e) {
  4086. var t = {x: e.pageX, y: e.pageY}, i = this._normValueFromMouse(t);
  4087. return this._slide(e, this._handleIndex, i), !1
  4088. },
  4089. _mouseStop: function (e) {
  4090. return this.handles.removeClass("ui-state-active"), this._mouseSliding = !1, this._stop(e, this._handleIndex), this._change(e, this._handleIndex), this._handleIndex = null, this._clickOffset = null, this._animateOff = !1, !1
  4091. },
  4092. _detectOrientation: function () {
  4093. this.orientation = "vertical" === this.options.orientation ? "vertical" : "horizontal"
  4094. },
  4095. _normValueFromMouse: function (e) {
  4096. var t, i, s, n, a;
  4097. return "horizontal" === this.orientation ? (t = this.elementSize.width, i = e.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)) : (t = this.elementSize.height, i = e.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)), s = i / t, s > 1 && (s = 1), 0 > s && (s = 0), "vertical" === this.orientation && (s = 1 - s), n = this._valueMax() - this._valueMin(), a = this._valueMin() + s * n, this._trimAlignValue(a)
  4098. },
  4099. _start: function (e, t) {
  4100. var i = {handle: this.handles[t], value: this.value()};
  4101. return this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._trigger("start", e, i)
  4102. },
  4103. _slide: function (e, t, i) {
  4104. var s, n, a;
  4105. this.options.values && this.options.values.length ? (s = this.values(t ? 0 : 1), 2 === this.options.values.length && this.options.range === !0 && (0 === t && i > s || 1 === t && s > i) && (i = s), i !== this.values(t) && (n = this.values(), n[t] = i, a = this._trigger("slide", e, {
  4106. handle: this.handles[t],
  4107. value: i,
  4108. values: n
  4109. }), s = this.values(t ? 0 : 1), a !== !1 && this.values(t, i))) : i !== this.value() && (a = this._trigger("slide", e, {
  4110. handle: this.handles[t],
  4111. value: i
  4112. }), a !== !1 && this.value(i))
  4113. },
  4114. _stop: function (e, t) {
  4115. var i = {handle: this.handles[t], value: this.value()};
  4116. this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._trigger("stop", e, i)
  4117. },
  4118. _change: function (e, t) {
  4119. if (!this._keySliding && !this._mouseSliding) {
  4120. var i = {handle: this.handles[t], value: this.value()};
  4121. this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._lastChangedValue = t, this._trigger("change", e, i)
  4122. }
  4123. },
  4124. value: function (e) {
  4125. return arguments.length ? (this.options.value = this._trimAlignValue(e), this._refreshValue(), this._change(null, 0), void 0) : this._value()
  4126. },
  4127. values: function (t, i) {
  4128. var s, n, a;
  4129. if (arguments.length > 1) return this.options.values[t] = this._trimAlignValue(i), this._refreshValue(), this._change(null, t), void 0;
  4130. if (!arguments.length) return this._values();
  4131. if (!e.isArray(arguments[0])) return this.options.values && this.options.values.length ? this._values(t) : this.value();
  4132. for (s = this.options.values, n = arguments[0], a = 0; s.length > a; a += 1) s[a] = this._trimAlignValue(n[a]), this._change(null, a);
  4133. this._refreshValue()
  4134. },
  4135. _setOption: function (t, i) {
  4136. var s, n = 0;
  4137. switch ("range" === t && this.options.range === !0 && ("min" === i ? (this.options.value = this._values(0), this.options.values = null) : "max" === i && (this.options.value = this._values(this.options.values.length - 1), this.options.values = null)), e.isArray(this.options.values) && (n = this.options.values.length), "disabled" === t && this.element.toggleClass("ui-state-disabled", !!i), this._super(t, i), t) {
  4138. case"orientation":
  4139. this._detectOrientation(), this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation), this._refreshValue(), this.handles.css("horizontal" === i ? "bottom" : "left", "");
  4140. break;
  4141. case"value":
  4142. this._animateOff = !0, this._refreshValue(), this._change(null, 0), this._animateOff = !1;
  4143. break;
  4144. case"values":
  4145. for (this._animateOff = !0, this._refreshValue(), s = 0; n > s; s += 1) this._change(null, s);
  4146. this._animateOff = !1;
  4147. break;
  4148. case"step":
  4149. case"min":
  4150. case"max":
  4151. this._animateOff = !0, this._calculateNewMax(), this._refreshValue(), this._animateOff = !1;
  4152. break;
  4153. case"range":
  4154. this._animateOff = !0, this._refresh(), this._animateOff = !1
  4155. }
  4156. },
  4157. _value: function () {
  4158. var e = this.options.value;
  4159. return e = this._trimAlignValue(e)
  4160. },
  4161. _values: function (e) {
  4162. var t, i, s;
  4163. if (arguments.length) return t = this.options.values[e], t = this._trimAlignValue(t);
  4164. if (this.options.values && this.options.values.length) {
  4165. for (i = this.options.values.slice(), s = 0; i.length > s; s += 1) i[s] = this._trimAlignValue(i[s]);
  4166. return i
  4167. }
  4168. return []
  4169. },
  4170. _trimAlignValue: function (e) {
  4171. if (this._valueMin() >= e) return this._valueMin();
  4172. if (e >= this._valueMax()) return this._valueMax();
  4173. var t = this.options.step > 0 ? this.options.step : 1, i = (e - this._valueMin()) % t, s = e - i;
  4174. return 2 * Math.abs(i) >= t && (s += i > 0 ? t : -t), parseFloat(s.toFixed(5))
  4175. },
  4176. _calculateNewMax: function () {
  4177. var e = (this.options.max - this._valueMin()) % this.options.step;
  4178. this.max = this.options.max - e
  4179. },
  4180. _valueMin: function () {
  4181. return this.options.min
  4182. },
  4183. _valueMax: function () {
  4184. return this.max
  4185. },
  4186. _refreshValue: function () {
  4187. var t, i, s, n, a, o = this.options.range, r = this.options, h = this,
  4188. l = this._animateOff ? !1 : r.animate, u = {};
  4189. this.options.values && this.options.values.length ? this.handles.each(function (s) {
  4190. i = 100 * ((h.values(s) - h._valueMin()) / (h._valueMax() - h._valueMin())), u["horizontal" === h.orientation ? "left" : "bottom"] = i + "%", e(this).stop(1, 1)[l ? "animate" : "css"](u, r.animate), h.options.range === !0 && ("horizontal" === h.orientation ? (0 === s && h.range.stop(1, 1)[l ? "animate" : "css"]({left: i + "%"}, r.animate), 1 === s && h.range[l ? "animate" : "css"]({width: i - t + "%"}, {
  4191. queue: !1,
  4192. duration: r.animate
  4193. })) : (0 === s && h.range.stop(1, 1)[l ? "animate" : "css"]({bottom: i + "%"}, r.animate), 1 === s && h.range[l ? "animate" : "css"]({height: i - t + "%"}, {
  4194. queue: !1,
  4195. duration: r.animate
  4196. }))), t = i
  4197. }) : (s = this.value(), n = this._valueMin(), a = this._valueMax(), i = a !== n ? 100 * ((s - n) / (a - n)) : 0, u["horizontal" === this.orientation ? "left" : "bottom"] = i + "%", this.handle.stop(1, 1)[l ? "animate" : "css"](u, r.animate), "min" === o && "horizontal" === this.orientation && this.range.stop(1, 1)[l ? "animate" : "css"]({width: i + "%"}, r.animate), "max" === o && "horizontal" === this.orientation && this.range[l ? "animate" : "css"]({width: 100 - i + "%"}, {
  4198. queue: !1,
  4199. duration: r.animate
  4200. }), "min" === o && "vertical" === this.orientation && this.range.stop(1, 1)[l ? "animate" : "css"]({height: i + "%"}, r.animate), "max" === o && "vertical" === this.orientation && this.range[l ? "animate" : "css"]({height: 100 - i + "%"}, {
  4201. queue: !1,
  4202. duration: r.animate
  4203. }))
  4204. },
  4205. _handleEvents: {
  4206. keydown: function (t) {
  4207. var i, s, n, a, o = e(t.target).data("ui-slider-handle-index");
  4208. switch (t.keyCode) {
  4209. case e.ui.keyCode.HOME:
  4210. case e.ui.keyCode.END:
  4211. case e.ui.keyCode.PAGE_UP:
  4212. case e.ui.keyCode.PAGE_DOWN:
  4213. case e.ui.keyCode.UP:
  4214. case e.ui.keyCode.RIGHT:
  4215. case e.ui.keyCode.DOWN:
  4216. case e.ui.keyCode.LEFT:
  4217. if (t.preventDefault(), !this._keySliding && (this._keySliding = !0, e(t.target).addClass("ui-state-active"), i = this._start(t, o), i === !1)) return
  4218. }
  4219. switch (a = this.options.step, s = n = this.options.values && this.options.values.length ? this.values(o) : this.value(), t.keyCode) {
  4220. case e.ui.keyCode.HOME:
  4221. n = this._valueMin();
  4222. break;
  4223. case e.ui.keyCode.END:
  4224. n = this._valueMax();
  4225. break;
  4226. case e.ui.keyCode.PAGE_UP:
  4227. n = this._trimAlignValue(s + (this._valueMax() - this._valueMin()) / this.numPages);
  4228. break;
  4229. case e.ui.keyCode.PAGE_DOWN:
  4230. n = this._trimAlignValue(s - (this._valueMax() - this._valueMin()) / this.numPages);
  4231. break;
  4232. case e.ui.keyCode.UP:
  4233. case e.ui.keyCode.RIGHT:
  4234. if (s === this._valueMax()) return;
  4235. n = this._trimAlignValue(s + a);
  4236. break;
  4237. case e.ui.keyCode.DOWN:
  4238. case e.ui.keyCode.LEFT:
  4239. if (s === this._valueMin()) return;
  4240. n = this._trimAlignValue(s - a)
  4241. }
  4242. this._slide(t, o, n)
  4243. }, keyup: function (t) {
  4244. var i = e(t.target).data("ui-slider-handle-index");
  4245. this._keySliding && (this._keySliding = !1, this._stop(t, i), this._change(t, i), e(t.target).removeClass("ui-state-active"))
  4246. }
  4247. }
  4248. }), e.widget("ui.sortable", e.ui.mouse, {
  4249. version: "1.11.2",
  4250. widgetEventPrefix: "sort",
  4251. ready: !1,
  4252. options: {
  4253. appendTo: "parent",
  4254. axis: !1,
  4255. connectWith: !1,
  4256. containment: !1,
  4257. cursor: "auto",
  4258. cursorAt: !1,
  4259. dropOnEmpty: !0,
  4260. forcePlaceholderSize: !1,
  4261. forceHelperSize: !1,
  4262. grid: !1,
  4263. handle: !1,
  4264. helper: "original",
  4265. items: "> *",
  4266. opacity: !1,
  4267. placeholder: !1,
  4268. revert: !1,
  4269. scroll: !0,
  4270. scrollSensitivity: 20,
  4271. scrollSpeed: 20,
  4272. scope: "default",
  4273. tolerance: "intersect",
  4274. zIndex: 1e3,
  4275. activate: null,
  4276. beforeStop: null,
  4277. change: null,
  4278. deactivate: null,
  4279. out: null,
  4280. over: null,
  4281. receive: null,
  4282. remove: null,
  4283. sort: null,
  4284. start: null,
  4285. stop: null,
  4286. update: null
  4287. },
  4288. _isOverAxis: function (e, t, i) {
  4289. return e >= t && t + i > e
  4290. },
  4291. _isFloating: function (e) {
  4292. return /left|right/.test(e.css("float")) || /inline|table-cell/.test(e.css("display"))
  4293. },
  4294. _create: function () {
  4295. var e = this.options;
  4296. this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = this.items.length ? "x" === e.axis || this._isFloating(this.items[0].item) : !1, this.offset = this.element.offset(), this._mouseInit(), this._setHandleClassName(), this.ready = !0
  4297. },
  4298. _setOption: function (e, t) {
  4299. this._super(e, t), "handle" === e && this._setHandleClassName()
  4300. },
  4301. _setHandleClassName: function () {
  4302. this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"), e.each(this.items, function () {
  4303. (this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item).addClass("ui-sortable-handle")
  4304. })
  4305. },
  4306. _destroy: function () {
  4307. this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"), this._mouseDestroy();
  4308. for (var e = this.items.length - 1; e >= 0; e--) this.items[e].item.removeData(this.widgetName + "-item");
  4309. return this
  4310. },
  4311. _mouseCapture: function (t, i) {
  4312. var s = null, n = !1, a = this;
  4313. return this.reverting ? !1 : this.options.disabled || "static" === this.options.type ? !1 : (this._refreshItems(t), e(t.target).parents().each(function () {
  4314. return e.data(this, a.widgetName + "-item") === a ? (s = e(this), !1) : void 0
  4315. }), e.data(t.target, a.widgetName + "-item") === a && (s = e(t.target)), s ? !this.options.handle || i || (e(this.options.handle, s).find("*").addBack().each(function () {
  4316. this === t.target && (n = !0)
  4317. }), n) ? (this.currentItem = s, this._removeCurrentsFromItems(), !0) : !1 : !1)
  4318. },
  4319. _mouseStart: function (t, i, s) {
  4320. var n, a, o = this.options;
  4321. if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(t), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = {
  4322. top: this.offset.top - this.margins.top,
  4323. left: this.offset.left - this.margins.left
  4324. }, e.extend(this.offset, {
  4325. click: {left: t.pageX - this.offset.left, top: t.pageY - this.offset.top},
  4326. parent: this._getParentOffset(),
  4327. relative: this._getRelativeOffset()
  4328. }), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt), this.domPosition = {
  4329. prev: this.currentItem.prev()[0],
  4330. parent: this.currentItem.parent()[0]
  4331. }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), o.containment && this._setContainment(), o.cursor && "auto" !== o.cursor && (a = this.document.find("body"), this.storedCursor = a.css("cursor"), a.css("cursor", o.cursor), this.storedStylesheet = e("<style>*{ cursor: " + o.cursor + " !important; }</style>").appendTo(a)), o.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", o.opacity)), o.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", o.zIndex)), this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", t, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) for (n = this.containers.length - 1; n >= 0; n--) this.containers[n]._trigger("activate", t, this._uiHash(this));
  4332. return e.ui.ddmanager && (e.ui.ddmanager.current = this), e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(t), !0
  4333. },
  4334. _mouseDrag: function (t) {
  4335. var i, s, n, a, o = this.options, r = !1;
  4336. for (this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < o.scrollSensitivity ? this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + o.scrollSpeed : t.pageY - this.overflowOffset.top < o.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - o.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < o.scrollSensitivity ? this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + o.scrollSpeed : t.pageX - this.overflowOffset.left < o.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - o.scrollSpeed)) : (t.pageY - e(document).scrollTop() < o.scrollSensitivity ? r = e(document).scrollTop(e(document).scrollTop() - o.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < o.scrollSensitivity && (r = e(document).scrollTop(e(document).scrollTop() + o.scrollSpeed)), t.pageX - e(document).scrollLeft() < o.scrollSensitivity ? r = e(document).scrollLeft(e(document).scrollLeft() - o.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < o.scrollSensitivity && (r = e(document).scrollLeft(e(document).scrollLeft() + o.scrollSpeed))), r !== !1 && e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t)), this.positionAbs = this._convertPositionTo("absolute"), this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), i = this.items.length - 1; i >= 0; i--) if (s = this.items[i], n = s.item[0], a = this._intersectsWithPointer(s), a && s.instance === this.currentContainer && n !== this.currentItem[0] && this.placeholder[1 === a ? "next" : "prev"]()[0] !== n && !e.contains(this.placeholder[0], n) && ("semi-dynamic" === this.options.type ? !e.contains(this.element[0], n) : !0)) {
  4337. if (this.direction = 1 === a ? "down" : "up", "pointer" !== this.options.tolerance && !this._intersectsWithSides(s)) break;
  4338. this._rearrange(t, s), this._trigger("change", t, this._uiHash());
  4339. break
  4340. }
  4341. return this._contactContainers(t), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), this._trigger("sort", t, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1
  4342. },
  4343. _mouseStop: function (t, i) {
  4344. if (t) {
  4345. if (e.ui.ddmanager && !this.options.dropBehaviour && e.ui.ddmanager.drop(this, t), this.options.revert) {
  4346. var s = this, n = this.placeholder.offset(), a = this.options.axis, o = {};
  4347. a && "x" !== a || (o.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft)), a && "y" !== a || (o.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, e(this.helper).animate(o, parseInt(this.options.revert, 10) || 500, function () {
  4348. s._clear(t)
  4349. })
  4350. } else this._clear(t, i);
  4351. return !1
  4352. }
  4353. },
  4354. cancel: function () {
  4355. if (this.dragging) {
  4356. this._mouseUp({target: null}), "original" === this.options.helper ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show();
  4357. for (var t = this.containers.length - 1; t >= 0; t--) this.containers[t]._trigger("deactivate", null, this._uiHash(this)), this.containers[t].containerCache.over && (this.containers[t]._trigger("out", null, this._uiHash(this)), this.containers[t].containerCache.over = 0)
  4358. }
  4359. return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), "original" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), e.extend(this, {
  4360. helper: null,
  4361. dragging: !1,
  4362. reverting: !1,
  4363. _noFinalSort: null
  4364. }), this.domPosition.prev ? e(this.domPosition.prev).after(this.currentItem) : e(this.domPosition.parent).prepend(this.currentItem)), this
  4365. },
  4366. serialize: function (t) {
  4367. var i = this._getItemsAsjQuery(t && t.connected), s = [];
  4368. return t = t || {}, e(i).each(function () {
  4369. var i = (e(t.item || this).attr(t.attribute || "id") || "").match(t.expression || /(.+)[\-=_](.+)/);
  4370. i && s.push((t.key || i[1] + "[]") + "=" + (t.key && t.expression ? i[1] : i[2]))
  4371. }), !s.length && t.key && s.push(t.key + "="), s.join("&")
  4372. },
  4373. toArray: function (t) {
  4374. var i = this._getItemsAsjQuery(t && t.connected), s = [];
  4375. return t = t || {}, i.each(function () {
  4376. s.push(e(t.item || this).attr(t.attribute || "id") || "")
  4377. }), s
  4378. },
  4379. _intersectsWith: function (e) {
  4380. var t = this.positionAbs.left, i = t + this.helperProportions.width, s = this.positionAbs.top,
  4381. n = s + this.helperProportions.height, a = e.left, o = a + e.width, r = e.top, h = r + e.height,
  4382. l = this.offset.click.top, u = this.offset.click.left,
  4383. d = "x" === this.options.axis || s + l > r && h > s + l,
  4384. c = "y" === this.options.axis || t + u > a && o > t + u, p = d && c;
  4385. return "pointer" === this.options.tolerance || this.options.forcePointerForContainers || "pointer" !== this.options.tolerance && this.helperProportions[this.floating ? "width" : "height"] > e[this.floating ? "width" : "height"] ? p : t + this.helperProportions.width / 2 > a && o > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > r && h > n - this.helperProportions.height / 2
  4386. },
  4387. _intersectsWithPointer: function (e) {
  4388. var t = "x" === this.options.axis || this._isOverAxis(this.positionAbs.top + this.offset.click.top, e.top, e.height),
  4389. i = "y" === this.options.axis || this._isOverAxis(this.positionAbs.left + this.offset.click.left, e.left, e.width),
  4390. s = t && i, n = this._getDragVerticalDirection(), a = this._getDragHorizontalDirection();
  4391. return s ? this.floating ? a && "right" === a || "down" === n ? 2 : 1 : n && ("down" === n ? 2 : 1) : !1
  4392. },
  4393. _intersectsWithSides: function (e) {
  4394. var t = this._isOverAxis(this.positionAbs.top + this.offset.click.top, e.top + e.height / 2, e.height),
  4395. i = this._isOverAxis(this.positionAbs.left + this.offset.click.left, e.left + e.width / 2, e.width),
  4396. s = this._getDragVerticalDirection(), n = this._getDragHorizontalDirection();
  4397. return this.floating && n ? "right" === n && i || "left" === n && !i : s && ("down" === s && t || "up" === s && !t)
  4398. },
  4399. _getDragVerticalDirection: function () {
  4400. var e = this.positionAbs.top - this.lastPositionAbs.top;
  4401. return 0 !== e && (e > 0 ? "down" : "up")
  4402. },
  4403. _getDragHorizontalDirection: function () {
  4404. var e = this.positionAbs.left - this.lastPositionAbs.left;
  4405. return 0 !== e && (e > 0 ? "right" : "left")
  4406. },
  4407. refresh: function (e) {
  4408. return this._refreshItems(e), this._setHandleClassName(), this.refreshPositions(), this
  4409. },
  4410. _connectWith: function () {
  4411. var e = this.options;
  4412. return e.connectWith.constructor === String ? [e.connectWith] : e.connectWith
  4413. },
  4414. _getItemsAsjQuery: function (t) {
  4415. function i() {
  4416. r.push(this)
  4417. }
  4418. var s, n, a, o, r = [], h = [], l = this._connectWith();
  4419. if (l && t) for (s = l.length - 1; s >= 0; s--) for (a = e(l[s]), n = a.length - 1; n >= 0; n--) o = e.data(a[n], this.widgetFullName), o && o !== this && !o.options.disabled && h.push([e.isFunction(o.options.items) ? o.options.items.call(o.element) : e(o.options.items, o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), o]);
  4420. for (h.push([e.isFunction(this.options.items) ? this.options.items.call(this.element, null, {
  4421. options: this.options,
  4422. item: this.currentItem
  4423. }) : e(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]), s = h.length - 1; s >= 0; s--) h[s][0].each(i);
  4424. return e(r)
  4425. },
  4426. _removeCurrentsFromItems: function () {
  4427. var t = this.currentItem.find(":data(" + this.widgetName + "-item)");
  4428. this.items = e.grep(this.items, function (e) {
  4429. for (var i = 0; t.length > i; i++) if (t[i] === e.item[0]) return !1;
  4430. return !0
  4431. })
  4432. },
  4433. _refreshItems: function (t) {
  4434. this.items = [], this.containers = [this];
  4435. var i, s, n, a, o, r, h, l, u = this.items,
  4436. d = [[e.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, {item: this.currentItem}) : e(this.options.items, this.element), this]],
  4437. c = this._connectWith();
  4438. if (c && this.ready) for (i = c.length - 1; i >= 0; i--) for (n = e(c[i]), s = n.length - 1; s >= 0; s--) a = e.data(n[s], this.widgetFullName), a && a !== this && !a.options.disabled && (d.push([e.isFunction(a.options.items) ? a.options.items.call(a.element[0], t, {item: this.currentItem}) : e(a.options.items, a.element), a]), this.containers.push(a));
  4439. for (i = d.length - 1; i >= 0; i--) for (o = d[i][1], r = d[i][0], s = 0, l = r.length; l > s; s++) h = e(r[s]), h.data(this.widgetName + "-item", o), u.push({
  4440. item: h,
  4441. instance: o,
  4442. width: 0,
  4443. height: 0,
  4444. left: 0,
  4445. top: 0
  4446. })
  4447. },
  4448. refreshPositions: function (t) {
  4449. this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset());
  4450. var i, s, n, a;
  4451. for (i = this.items.length - 1; i >= 0; i--) s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (n = this.options.toleranceElement ? e(this.options.toleranceElement, s.item) : s.item, t || (s.width = n.outerWidth(), s.height = n.outerHeight()), a = n.offset(), s.left = a.left, s.top = a.top);
  4452. if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (i = this.containers.length - 1; i >= 0; i--) a = this.containers[i].element.offset(), this.containers[i].containerCache.left = a.left, this.containers[i].containerCache.top = a.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
  4453. return this
  4454. },
  4455. _createPlaceholder: function (t) {
  4456. t = t || this;
  4457. var i, s = t.options;
  4458. s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = {
  4459. element: function () {
  4460. var s = t.currentItem[0].nodeName.toLowerCase(),
  4461. n = e("<" + s + ">", t.document[0]).addClass(i || t.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper");
  4462. return "tr" === s ? t.currentItem.children().each(function () {
  4463. e("<td>&#160;</td>", t.document[0]).attr("colspan", e(this).attr("colspan") || 1).appendTo(n)
  4464. }) : "img" === s && n.attr("src", t.currentItem.attr("src")), i || n.css("visibility", "hidden"), n
  4465. }, update: function (e, n) {
  4466. (!i || s.forcePlaceholderSize) && (n.height() || n.height(t.currentItem.innerHeight() - parseInt(t.currentItem.css("paddingTop") || 0, 10) - parseInt(t.currentItem.css("paddingBottom") || 0, 10)), n.width() || n.width(t.currentItem.innerWidth() - parseInt(t.currentItem.css("paddingLeft") || 0, 10) - parseInt(t.currentItem.css("paddingRight") || 0, 10)))
  4467. }
  4468. }), t.placeholder = e(s.placeholder.element.call(t.element, t.currentItem)), t.currentItem.after(t.placeholder), s.placeholder.update(t, t.placeholder)
  4469. },
  4470. _contactContainers: function (t) {
  4471. var i, s, n, a, o, r, h, l, u, d, c = null, p = null;
  4472. for (i = this.containers.length - 1; i >= 0; i--) if (!e.contains(this.currentItem[0], this.containers[i].element[0])) if (this._intersectsWith(this.containers[i].containerCache)) {
  4473. if (c && e.contains(this.containers[i].element[0], c.element[0])) continue;
  4474. c = this.containers[i], p = i
  4475. } else this.containers[i].containerCache.over && (this.containers[i]._trigger("out", t, this._uiHash(this)), this.containers[i].containerCache.over = 0);
  4476. if (c) if (1 === this.containers.length) this.containers[p].containerCache.over || (this.containers[p]._trigger("over", t, this._uiHash(this)), this.containers[p].containerCache.over = 1); else {
  4477. for (n = 1e4, a = null, u = c.floating || this._isFloating(this.currentItem), o = u ? "left" : "top", r = u ? "width" : "height", d = u ? "clientX" : "clientY", s = this.items.length - 1; s >= 0; s--) e.contains(this.containers[p].element[0], this.items[s].item[0]) && this.items[s].item[0] !== this.currentItem[0] && (h = this.items[s].item.offset()[o], l = !1, t[d] - h > this.items[s][r] / 2 && (l = !0), n > Math.abs(t[d] - h) && (n = Math.abs(t[d] - h), a = this.items[s], this.direction = l ? "up" : "down"));
  4478. if (!a && !this.options.dropOnEmpty) return;
  4479. if (this.currentContainer === this.containers[p]) return this.currentContainer.containerCache.over || (this.containers[p]._trigger("over", t, this._uiHash()), this.currentContainer.containerCache.over = 1), void 0;
  4480. a ? this._rearrange(t, a, null, !0) : this._rearrange(t, null, this.containers[p].element, !0), this._trigger("change", t, this._uiHash()), this.containers[p]._trigger("change", t, this._uiHash(this)), this.currentContainer = this.containers[p], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[p]._trigger("over", t, this._uiHash(this)), this.containers[p].containerCache.over = 1
  4481. }
  4482. },
  4483. _createHelper: function (t) {
  4484. var i = this.options,
  4485. s = e.isFunction(i.helper) ? e(i.helper.apply(this.element[0], [t, this.currentItem])) : "clone" === i.helper ? this.currentItem.clone() : this.currentItem;
  4486. return s.parents("body").length || e("parent" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = {
  4487. width: this.currentItem[0].style.width,
  4488. height: this.currentItem[0].style.height,
  4489. position: this.currentItem.css("position"),
  4490. top: this.currentItem.css("top"),
  4491. left: this.currentItem.css("left")
  4492. }), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s
  4493. },
  4494. _adjustOffsetFromHelper: function (t) {
  4495. "string" == typeof t && (t = t.split(" ")), e.isArray(t) && (t = {
  4496. left: +t[0],
  4497. top: +t[1] || 0
  4498. }), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top)
  4499. },
  4500. _getParentOffset: function () {
  4501. this.offsetParent = this.helper.offsetParent();
  4502. var t = this.offsetParent.offset();
  4503. return "absolute" === this.cssPosition && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && e.ui.ie) && (t = {
  4504. top: 0,
  4505. left: 0
  4506. }), {
  4507. top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
  4508. left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
  4509. }
  4510. },
  4511. _getRelativeOffset: function () {
  4512. if ("relative" === this.cssPosition) {
  4513. var e = this.currentItem.position();
  4514. return {
  4515. top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
  4516. left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
  4517. }
  4518. }
  4519. return {top: 0, left: 0}
  4520. },
  4521. _cacheMargins: function () {
  4522. this.margins = {
  4523. left: parseInt(this.currentItem.css("marginLeft"), 10) || 0,
  4524. top: parseInt(this.currentItem.css("marginTop"), 10) || 0
  4525. }
  4526. },
  4527. _cacheHelperProportions: function () {
  4528. this.helperProportions = {width: this.helper.outerWidth(), height: this.helper.outerHeight()}
  4529. },
  4530. _setContainment: function () {
  4531. var t, i, s, n = this.options;
  4532. "parent" === n.containment && (n.containment = this.helper[0].parentNode), ("document" === n.containment || "window" === n.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, e("document" === n.containment ? document : window).width() - this.helperProportions.width - this.margins.left, (e("document" === n.containment ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (t = e(n.containment)[0], i = e(n.containment).offset(), s = "hidden" !== e(t).css("overflow"), this.containment = [i.left + (parseInt(e(t).css("borderLeftWidth"), 10) || 0) + (parseInt(e(t).css("paddingLeft"), 10) || 0) - this.margins.left, i.top + (parseInt(e(t).css("borderTopWidth"), 10) || 0) + (parseInt(e(t).css("paddingTop"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(e(t).css("borderLeftWidth"), 10) || 0) - (parseInt(e(t).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(e(t).css("borderTopWidth"), 10) || 0) - (parseInt(e(t).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top])
  4533. },
  4534. _convertPositionTo: function (t, i) {
  4535. i || (i = this.position);
  4536. var s = "absolute" === t ? 1 : -1,
  4537. n = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
  4538. a = /(html|body)/i.test(n[0].tagName);
  4539. return {
  4540. top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : a ? 0 : n.scrollTop()) * s,
  4541. left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : a ? 0 : n.scrollLeft()) * s
  4542. }
  4543. },
  4544. _generatePosition: function (t) {
  4545. var i, s, n = this.options, a = t.pageX, o = t.pageY,
  4546. r = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
  4547. h = /(html|body)/i.test(r[0].tagName);
  4548. return "relative" !== this.cssPosition || this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (t.pageX - this.offset.click.left < this.containment[0] && (a = this.containment[0] + this.offset.click.left), t.pageY - this.offset.click.top < this.containment[1] && (o = this.containment[1] + this.offset.click.top), t.pageX - this.offset.click.left > this.containment[2] && (a = this.containment[2] + this.offset.click.left), t.pageY - this.offset.click.top > this.containment[3] && (o = this.containment[3] + this.offset.click.top)), n.grid && (i = this.originalPageY + Math.round((o - this.originalPageY) / n.grid[1]) * n.grid[1], o = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - n.grid[1] : i + n.grid[1] : i, s = this.originalPageX + Math.round((a - this.originalPageX) / n.grid[0]) * n.grid[0], a = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - n.grid[0] : s + n.grid[0] : s)), {
  4549. top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : h ? 0 : r.scrollTop()),
  4550. left: a - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : h ? 0 : r.scrollLeft())
  4551. }
  4552. },
  4553. _rearrange: function (e, t, i, s) {
  4554. i ? i[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore(this.placeholder[0], "down" === this.direction ? t.item[0] : t.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1;
  4555. var n = this.counter;
  4556. this._delay(function () {
  4557. n === this.counter && this.refreshPositions(!s)
  4558. })
  4559. },
  4560. _clear: function (e, t) {
  4561. function i(e, t, i) {
  4562. return function (s) {
  4563. i._trigger(e, s, t._uiHash(t))
  4564. }
  4565. }
  4566. this.reverting = !1;
  4567. var s, n = [];
  4568. if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) {
  4569. for (s in this._storedCSS) ("auto" === this._storedCSS[s] || "static" === this._storedCSS[s]) && (this._storedCSS[s] = "");
  4570. this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")
  4571. } else this.currentItem.show();
  4572. for (this.fromOutside && !t && n.push(function (e) {
  4573. this._trigger("receive", e, this._uiHash(this.fromOutside))
  4574. }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(".ui-sortable-helper")[0] && this.domPosition.parent === this.currentItem.parent()[0] || t || n.push(function (e) {
  4575. this._trigger("update", e, this._uiHash())
  4576. }), this !== this.currentContainer && (t || (n.push(function (e) {
  4577. this._trigger("remove", e, this._uiHash())
  4578. }), n.push(function (e) {
  4579. return function (t) {
  4580. e._trigger("receive", t, this._uiHash(this))
  4581. }
  4582. }.call(this, this.currentContainer)), n.push(function (e) {
  4583. return function (t) {
  4584. e._trigger("update", t, this._uiHash(this))
  4585. }
  4586. }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--) t || n.push(i("deactivate", this, this.containers[s])), this.containers[s].containerCache.over && (n.push(i("out", this, this.containers[s])), this.containers[s].containerCache.over = 0);
  4587. if (this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", "auto" === this._storedZIndex ? "" : this._storedZIndex), this.dragging = !1, t || this._trigger("beforeStop", e, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.cancelHelperRemoval || (this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null), !t) {
  4588. for (s = 0; n.length > s; s++) n[s].call(this, e);
  4589. this._trigger("stop", e, this._uiHash())
  4590. }
  4591. return this.fromOutside = !1, !this.cancelHelperRemoval
  4592. },
  4593. _trigger: function () {
  4594. e.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel()
  4595. },
  4596. _uiHash: function (t) {
  4597. var i = t || this;
  4598. return {
  4599. helper: i.helper,
  4600. placeholder: i.placeholder || e([]),
  4601. position: i.position,
  4602. originalPosition: i.originalPosition,
  4603. offset: i.positionAbs,
  4604. item: i.currentItem,
  4605. sender: t ? t.element : null
  4606. }
  4607. }
  4608. }), e.widget("ui.spinner", {
  4609. version: "1.11.2",
  4610. defaultElement: "<input>",
  4611. widgetEventPrefix: "spin",
  4612. options: {
  4613. culture: null,
  4614. icons: {down: "ui-icon-triangle-1-s", up: "ui-icon-triangle-1-n"},
  4615. incremental: !0,
  4616. max: null,
  4617. min: null,
  4618. numberFormat: null,
  4619. page: 10,
  4620. step: 1,
  4621. change: null,
  4622. spin: null,
  4623. start: null,
  4624. stop: null
  4625. },
  4626. _create: function () {
  4627. this._setOption("max", this.options.max), this._setOption("min", this.options.min), this._setOption("step", this.options.step), "" !== this.value() && this._value(this.element.val(), !0), this._draw(), this._on(this._events), this._refresh(), this._on(this.window, {
  4628. beforeunload: function () {
  4629. this.element.removeAttr("autocomplete")
  4630. }
  4631. })
  4632. },
  4633. _getCreateOptions: function () {
  4634. var t = {}, i = this.element;
  4635. return e.each(["min", "max", "step"], function (e, s) {
  4636. var n = i.attr(s);
  4637. void 0 !== n && n.length && (t[s] = n)
  4638. }), t
  4639. },
  4640. _events: {
  4641. keydown: function (e) {
  4642. this._start(e) && this._keydown(e) && e.preventDefault()
  4643. }, keyup: "_stop", focus: function () {
  4644. this.previous = this.element.val()
  4645. }, blur: function (e) {
  4646. return this.cancelBlur ? (delete this.cancelBlur, void 0) : (this._stop(), this._refresh(), this.previous !== this.element.val() && this._trigger("change", e), void 0)
  4647. }, mousewheel: function (e, t) {
  4648. if (t) {
  4649. if (!this.spinning && !this._start(e)) return !1;
  4650. this._spin((t > 0 ? 1 : -1) * this.options.step, e), clearTimeout(this.mousewheelTimer), this.mousewheelTimer = this._delay(function () {
  4651. this.spinning && this._stop(e)
  4652. }, 100), e.preventDefault()
  4653. }
  4654. }, "mousedown .ui-spinner-button": function (t) {
  4655. function i() {
  4656. var e = this.element[0] === this.document[0].activeElement;
  4657. e || (this.element.focus(), this.previous = s, this._delay(function () {
  4658. this.previous = s
  4659. }))
  4660. }
  4661. var s;
  4662. s = this.element[0] === this.document[0].activeElement ? this.previous : this.element.val(), t.preventDefault(), i.call(this), this.cancelBlur = !0, this._delay(function () {
  4663. delete this.cancelBlur, i.call(this)
  4664. }), this._start(t) !== !1 && this._repeat(null, e(t.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, t)
  4665. }, "mouseup .ui-spinner-button": "_stop", "mouseenter .ui-spinner-button": function (t) {
  4666. return e(t.currentTarget).hasClass("ui-state-active") ? this._start(t) === !1 ? !1 : (this._repeat(null, e(t.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, t), void 0) : void 0
  4667. }, "mouseleave .ui-spinner-button": "_stop"
  4668. },
  4669. _draw: function () {
  4670. var e = this.uiSpinner = this.element.addClass("ui-spinner-input").attr("autocomplete", "off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());
  4671. this.element.attr("role", "spinbutton"), this.buttons = e.find(".ui-spinner-button").attr("tabIndex", -1).button().removeClass("ui-corner-all"), this.buttons.height() > Math.ceil(.5 * e.height()) && e.height() > 0 && e.height(e.height()), this.options.disabled && this.disable()
  4672. },
  4673. _keydown: function (t) {
  4674. var i = this.options, s = e.ui.keyCode;
  4675. switch (t.keyCode) {
  4676. case s.UP:
  4677. return this._repeat(null, 1, t), !0;
  4678. case s.DOWN:
  4679. return this._repeat(null, -1, t), !0;
  4680. case s.PAGE_UP:
  4681. return this._repeat(null, i.page, t), !0;
  4682. case s.PAGE_DOWN:
  4683. return this._repeat(null, -i.page, t), !0
  4684. }
  4685. return !1
  4686. },
  4687. _uiSpinnerHtml: function () {
  4688. return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"
  4689. },
  4690. _buttonHtml: function () {
  4691. return "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" + "</a>" + "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" + "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" + "</a>"
  4692. },
  4693. _start: function (e) {
  4694. return this.spinning || this._trigger("start", e) !== !1 ? (this.counter || (this.counter = 1), this.spinning = !0, !0) : !1
  4695. },
  4696. _repeat: function (e, t, i) {
  4697. e = e || 500, clearTimeout(this.timer), this.timer = this._delay(function () {
  4698. this._repeat(40, t, i)
  4699. }, e), this._spin(t * this.options.step, i)
  4700. },
  4701. _spin: function (e, t) {
  4702. var i = this.value() || 0;
  4703. this.counter || (this.counter = 1), i = this._adjustValue(i + e * this._increment(this.counter)), this.spinning && this._trigger("spin", t, {value: i}) === !1 || (this._value(i), this.counter++)
  4704. },
  4705. _increment: function (t) {
  4706. var i = this.options.incremental;
  4707. return i ? e.isFunction(i) ? i(t) : Math.floor(t * t * t / 5e4 - t * t / 500 + 17 * t / 200 + 1) : 1
  4708. },
  4709. _precision: function () {
  4710. var e = this._precisionOf(this.options.step);
  4711. return null !== this.options.min && (e = Math.max(e, this._precisionOf(this.options.min))), e
  4712. },
  4713. _precisionOf: function (e) {
  4714. var t = "" + e, i = t.indexOf(".");
  4715. return -1 === i ? 0 : t.length - i - 1
  4716. },
  4717. _adjustValue: function (e) {
  4718. var t, i, s = this.options;
  4719. return t = null !== s.min ? s.min : 0, i = e - t, i = Math.round(i / s.step) * s.step, e = t + i, e = parseFloat(e.toFixed(this._precision())), null !== s.max && e > s.max ? s.max : null !== s.min && s.min > e ? s.min : e
  4720. },
  4721. _stop: function (e) {
  4722. this.spinning && (clearTimeout(this.timer), clearTimeout(this.mousewheelTimer), this.counter = 0, this.spinning = !1, this._trigger("stop", e))
  4723. },
  4724. _setOption: function (e, t) {
  4725. if ("culture" === e || "numberFormat" === e) {
  4726. var i = this._parse(this.element.val());
  4727. return this.options[e] = t, this.element.val(this._format(i)), void 0
  4728. }
  4729. ("max" === e || "min" === e || "step" === e) && "string" == typeof t && (t = this._parse(t)), "icons" === e && (this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up), this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)), this._super(e, t), "disabled" === e && (this.widget().toggleClass("ui-state-disabled", !!t), this.element.prop("disabled", !!t), this.buttons.button(t ? "disable" : "enable"))
  4730. },
  4731. _setOptions: h(function (e) {
  4732. this._super(e)
  4733. }),
  4734. _parse: function (e) {
  4735. return "string" == typeof e && "" !== e && (e = window.Globalize && this.options.numberFormat ? Globalize.parseFloat(e, 10, this.options.culture) : +e), "" === e || isNaN(e) ? null : e
  4736. },
  4737. _format: function (e) {
  4738. return "" === e ? "" : window.Globalize && this.options.numberFormat ? Globalize.format(e, this.options.numberFormat, this.options.culture) : e
  4739. },
  4740. _refresh: function () {
  4741. this.element.attr({
  4742. "aria-valuemin": this.options.min,
  4743. "aria-valuemax": this.options.max,
  4744. "aria-valuenow": this._parse(this.element.val())
  4745. })
  4746. },
  4747. isValid: function () {
  4748. var e = this.value();
  4749. return null === e ? !1 : e === this._adjustValue(e)
  4750. },
  4751. _value: function (e, t) {
  4752. var i;
  4753. "" !== e && (i = this._parse(e), null !== i && (t || (i = this._adjustValue(i)), e = this._format(i))), this.element.val(e), this._refresh()
  4754. },
  4755. _destroy: function () {
  4756. this.element.removeClass("ui-spinner-input").prop("disabled", !1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"), this.uiSpinner.replaceWith(this.element)
  4757. },
  4758. stepUp: h(function (e) {
  4759. this._stepUp(e)
  4760. }),
  4761. _stepUp: function (e) {
  4762. this._start() && (this._spin((e || 1) * this.options.step), this._stop())
  4763. },
  4764. stepDown: h(function (e) {
  4765. this._stepDown(e)
  4766. }),
  4767. _stepDown: function (e) {
  4768. this._start() && (this._spin((e || 1) * -this.options.step), this._stop())
  4769. },
  4770. pageUp: h(function (e) {
  4771. this._stepUp((e || 1) * this.options.page)
  4772. }),
  4773. pageDown: h(function (e) {
  4774. this._stepDown((e || 1) * this.options.page)
  4775. }),
  4776. value: function (e) {
  4777. return arguments.length ? (h(this._value).call(this, e), void 0) : this._parse(this.element.val())
  4778. },
  4779. widget: function () {
  4780. return this.uiSpinner
  4781. }
  4782. }), e.widget("ui.tabs", {
  4783. version: "1.11.2",
  4784. delay: 300,
  4785. options: {
  4786. active: null,
  4787. collapsible: !1,
  4788. event: "click",
  4789. heightStyle: "content",
  4790. hide: null,
  4791. show: null,
  4792. activate: null,
  4793. beforeActivate: null,
  4794. beforeLoad: null,
  4795. load: null
  4796. },
  4797. _isLocal: function () {
  4798. var e = /#.*$/;
  4799. return function (t) {
  4800. var i, s;
  4801. t = t.cloneNode(!1), i = t.href.replace(e, ""), s = location.href.replace(e, "");
  4802. try {
  4803. i = decodeURIComponent(i)
  4804. } catch (n) {
  4805. }
  4806. try {
  4807. s = decodeURIComponent(s)
  4808. } catch (n) {
  4809. }
  4810. return t.hash.length > 1 && i === s
  4811. }
  4812. }(),
  4813. _create: function () {
  4814. var t = this, i = this.options;
  4815. this.running = !1, this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible", i.collapsible), this._processTabs(), i.active = this._initialActive(), e.isArray(i.disabled) && (i.disabled = e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"), function (e) {
  4816. return t.tabs.index(e)
  4817. }))).sort()), this.active = this.options.active !== !1 && this.anchors.length ? this._findActive(i.active) : e(), this._refresh(), this.active.length && this.load(i.active)
  4818. },
  4819. _initialActive: function () {
  4820. var t = this.options.active, i = this.options.collapsible, s = location.hash.substring(1);
  4821. return null === t && (s && this.tabs.each(function (i, n) {
  4822. return e(n).attr("aria-controls") === s ? (t = i, !1) : void 0
  4823. }), null === t && (t = this.tabs.index(this.tabs.filter(".ui-tabs-active"))), (null === t || -1 === t) && (t = this.tabs.length ? 0 : !1)), t !== !1 && (t = this.tabs.index(this.tabs.eq(t)), -1 === t && (t = i ? !1 : 0)), !i && t === !1 && this.anchors.length && (t = 0), t
  4824. },
  4825. _getCreateEventData: function () {
  4826. return {tab: this.active, panel: this.active.length ? this._getPanelForTab(this.active) : e()}
  4827. },
  4828. _tabKeydown: function (t) {
  4829. var i = e(this.document[0].activeElement).closest("li"), s = this.tabs.index(i), n = !0;
  4830. if (!this._handlePageNav(t)) {
  4831. switch (t.keyCode) {
  4832. case e.ui.keyCode.RIGHT:
  4833. case e.ui.keyCode.DOWN:
  4834. s++;
  4835. break;
  4836. case e.ui.keyCode.UP:
  4837. case e.ui.keyCode.LEFT:
  4838. n = !1, s--;
  4839. break;
  4840. case e.ui.keyCode.END:
  4841. s = this.anchors.length - 1;
  4842. break;
  4843. case e.ui.keyCode.HOME:
  4844. s = 0;
  4845. break;
  4846. case e.ui.keyCode.SPACE:
  4847. return t.preventDefault(), clearTimeout(this.activating), this._activate(s), void 0;
  4848. case e.ui.keyCode.ENTER:
  4849. return t.preventDefault(), clearTimeout(this.activating), this._activate(s === this.options.active ? !1 : s), void 0;
  4850. default:
  4851. return
  4852. }
  4853. t.preventDefault(), clearTimeout(this.activating), s = this._focusNextTab(s, n), t.ctrlKey || (i.attr("aria-selected", "false"), this.tabs.eq(s).attr("aria-selected", "true"), this.activating = this._delay(function () {
  4854. this.option("active", s)
  4855. }, this.delay))
  4856. }
  4857. },
  4858. _panelKeydown: function (t) {
  4859. this._handlePageNav(t) || t.ctrlKey && t.keyCode === e.ui.keyCode.UP && (t.preventDefault(), this.active.focus())
  4860. },
  4861. _handlePageNav: function (t) {
  4862. return t.altKey && t.keyCode === e.ui.keyCode.PAGE_UP ? (this._activate(this._focusNextTab(this.options.active - 1, !1)), !0) : t.altKey && t.keyCode === e.ui.keyCode.PAGE_DOWN ? (this._activate(this._focusNextTab(this.options.active + 1, !0)), !0) : void 0
  4863. },
  4864. _findNextTab: function (t, i) {
  4865. function s() {
  4866. return t > n && (t = 0), 0 > t && (t = n), t
  4867. }
  4868. for (var n = this.tabs.length - 1; -1 !== e.inArray(s(), this.options.disabled);) t = i ? t + 1 : t - 1;
  4869. return t
  4870. },
  4871. _focusNextTab: function (e, t) {
  4872. return e = this._findNextTab(e, t), this.tabs.eq(e).focus(), e
  4873. },
  4874. _setOption: function (e, t) {
  4875. return "active" === e ? (this._activate(t), void 0) : "disabled" === e ? (this._setupDisabled(t), void 0) : (this._super(e, t), "collapsible" === e && (this.element.toggleClass("ui-tabs-collapsible", t), t || this.options.active !== !1 || this._activate(0)), "event" === e && this._setupEvents(t), "heightStyle" === e && this._setupHeightStyle(t), void 0)
  4876. },
  4877. _sanitizeSelector: function (e) {
  4878. return e ? e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&") : ""
  4879. },
  4880. refresh: function () {
  4881. var t = this.options, i = this.tablist.children(":has(a[href])");
  4882. t.disabled = e.map(i.filter(".ui-state-disabled"), function (e) {
  4883. return i.index(e)
  4884. }), this._processTabs(), t.active !== !1 && this.anchors.length ? this.active.length && !e.contains(this.tablist[0], this.active[0]) ? this.tabs.length === t.disabled.length ? (t.active = !1, this.active = e()) : this._activate(this._findNextTab(Math.max(0, t.active - 1), !1)) : t.active = this.tabs.index(this.active) : (t.active = !1, this.active = e()), this._refresh()
  4885. },
  4886. _refresh: function () {
  4887. this._setupDisabled(this.options.disabled), this._setupEvents(this.options.event), this._setupHeightStyle(this.options.heightStyle), this.tabs.not(this.active).attr({
  4888. "aria-selected": "false",
  4889. "aria-expanded": "false",
  4890. tabIndex: -1
  4891. }), this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden": "true"}), this.active.length ? (this.active.addClass("ui-tabs-active ui-state-active").attr({
  4892. "aria-selected": "true",
  4893. "aria-expanded": "true",
  4894. tabIndex: 0
  4895. }), this._getPanelForTab(this.active).show().attr({"aria-hidden": "false"})) : this.tabs.eq(0).attr("tabIndex", 0)
  4896. },
  4897. _processTabs: function () {
  4898. var t = this, i = this.tabs, s = this.anchors, n = this.panels;
  4899. this.tablist = this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role", "tablist").delegate("> li", "mousedown" + this.eventNamespace, function (t) {
  4900. e(this).is(".ui-state-disabled") && t.preventDefault()
  4901. }).delegate(".ui-tabs-anchor", "focus" + this.eventNamespace, function () {
  4902. e(this).closest("li").is(".ui-state-disabled") && this.blur()
  4903. }), this.tabs = this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({
  4904. role: "tab",
  4905. tabIndex: -1
  4906. }), this.anchors = this.tabs.map(function () {
  4907. return e("a", this)[0]
  4908. }).addClass("ui-tabs-anchor").attr({
  4909. role: "presentation",
  4910. tabIndex: -1
  4911. }), this.panels = e(), this.anchors.each(function (i, s) {
  4912. var n, a, o, r = e(s).uniqueId().attr("id"), h = e(s).closest("li"), l = h.attr("aria-controls");
  4913. t._isLocal(s) ? (n = s.hash, o = n.substring(1), a = t.element.find(t._sanitizeSelector(n))) : (o = h.attr("aria-controls") || e({}).uniqueId()[0].id, n = "#" + o, a = t.element.find(n), a.length || (a = t._createPanel(o), a.insertAfter(t.panels[i - 1] || t.tablist)), a.attr("aria-live", "polite")), a.length && (t.panels = t.panels.add(a)), l && h.data("ui-tabs-aria-controls", l), h.attr({
  4914. "aria-controls": o,
  4915. "aria-labelledby": r
  4916. }), a.attr("aria-labelledby", r)
  4917. }), this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role", "tabpanel"), i && (this._off(i.not(this.tabs)), this._off(s.not(this.anchors)), this._off(n.not(this.panels)))
  4918. },
  4919. _getList: function () {
  4920. return this.tablist || this.element.find("ol,ul").eq(0)
  4921. },
  4922. _createPanel: function (t) {
  4923. return e("<div>").attr("id", t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy", !0)
  4924. },
  4925. _setupDisabled: function (t) {
  4926. e.isArray(t) && (t.length ? t.length === this.anchors.length && (t = !0) : t = !1);
  4927. for (var i, s = 0; i = this.tabs[s]; s++) t === !0 || -1 !== e.inArray(s, t) ? e(i).addClass("ui-state-disabled").attr("aria-disabled", "true") : e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");
  4928. this.options.disabled = t
  4929. },
  4930. _setupEvents: function (t) {
  4931. var i = {};
  4932. t && e.each(t.split(" "), function (e, t) {
  4933. i[t] = "_eventHandler"
  4934. }), this._off(this.anchors.add(this.tabs).add(this.panels)), this._on(!0, this.anchors, {
  4935. click: function (e) {
  4936. e.preventDefault()
  4937. }
  4938. }), this._on(this.anchors, i), this._on(this.tabs, {keydown: "_tabKeydown"}), this._on(this.panels, {keydown: "_panelKeydown"}), this._focusable(this.tabs), this._hoverable(this.tabs)
  4939. },
  4940. _setupHeightStyle: function (t) {
  4941. var i, s = this.element.parent();
  4942. "fill" === t ? (i = s.height(), i -= this.element.outerHeight() - this.element.height(), this.element.siblings(":visible").each(function () {
  4943. var t = e(this), s = t.css("position");
  4944. "absolute" !== s && "fixed" !== s && (i -= t.outerHeight(!0))
  4945. }), this.element.children().not(this.panels).each(function () {
  4946. i -= e(this).outerHeight(!0)
  4947. }), this.panels.each(function () {
  4948. e(this).height(Math.max(0, i - e(this).innerHeight() + e(this).height()))
  4949. }).css("overflow", "auto")) : "auto" === t && (i = 0, this.panels.each(function () {
  4950. i = Math.max(i, e(this).height("").height())
  4951. }).height(i))
  4952. },
  4953. _eventHandler: function (t) {
  4954. var i = this.options, s = this.active, n = e(t.currentTarget), a = n.closest("li"), o = a[0] === s[0],
  4955. r = o && i.collapsible, h = r ? e() : this._getPanelForTab(a),
  4956. l = s.length ? this._getPanelForTab(s) : e(),
  4957. u = {oldTab: s, oldPanel: l, newTab: r ? e() : a, newPanel: h};
  4958. t.preventDefault(), a.hasClass("ui-state-disabled") || a.hasClass("ui-tabs-loading") || this.running || o && !i.collapsible || this._trigger("beforeActivate", t, u) === !1 || (i.active = r ? !1 : this.tabs.index(a), this.active = o ? e() : a, this.xhr && this.xhr.abort(), l.length || h.length || e.error("jQuery UI Tabs: Mismatching fragment identifier."), h.length && this.load(this.tabs.index(a), t), this._toggle(t, u))
  4959. },
  4960. _toggle: function (t, i) {
  4961. function s() {
  4962. a.running = !1, a._trigger("activate", t, i)
  4963. }
  4964. function n() {
  4965. i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"), o.length && a.options.show ? a._show(o, a.options.show, s) : (o.show(), s())
  4966. }
  4967. var a = this, o = i.newPanel, r = i.oldPanel;
  4968. this.running = !0, r.length && this.options.hide ? this._hide(r, this.options.hide, function () {
  4969. i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), n()
  4970. }) : (i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), r.hide(), n()), r.attr("aria-hidden", "true"), i.oldTab.attr({
  4971. "aria-selected": "false",
  4972. "aria-expanded": "false"
  4973. }), o.length && r.length ? i.oldTab.attr("tabIndex", -1) : o.length && this.tabs.filter(function () {
  4974. return 0 === e(this).attr("tabIndex")
  4975. }).attr("tabIndex", -1), o.attr("aria-hidden", "false"), i.newTab.attr({
  4976. "aria-selected": "true",
  4977. "aria-expanded": "true",
  4978. tabIndex: 0
  4979. })
  4980. },
  4981. _activate: function (t) {
  4982. var i, s = this._findActive(t);
  4983. s[0] !== this.active[0] && (s.length || (s = this.active), i = s.find(".ui-tabs-anchor")[0], this._eventHandler({
  4984. target: i,
  4985. currentTarget: i,
  4986. preventDefault: e.noop
  4987. }))
  4988. },
  4989. _findActive: function (t) {
  4990. return t === !1 ? e() : this.tabs.eq(t)
  4991. },
  4992. _getIndex: function (e) {
  4993. return "string" == typeof e && (e = this.anchors.index(this.anchors.filter("[href$='" + e + "']"))), e
  4994. },
  4995. _destroy: function () {
  4996. this.xhr && this.xhr.abort(), this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"), this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"), this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(), this.tablist.unbind(this.eventNamespace), this.tabs.add(this.panels).each(function () {
  4997. e.data(this, "ui-tabs-destroy") ? e(this).remove() : e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")
  4998. }), this.tabs.each(function () {
  4999. var t = e(this), i = t.data("ui-tabs-aria-controls");
  5000. i ? t.attr("aria-controls", i).removeData("ui-tabs-aria-controls") : t.removeAttr("aria-controls")
  5001. }), this.panels.show(), "content" !== this.options.heightStyle && this.panels.css("height", "")
  5002. },
  5003. enable: function (t) {
  5004. var i = this.options.disabled;
  5005. i !== !1 && (void 0 === t ? i = !1 : (t = this._getIndex(t), i = e.isArray(i) ? e.map(i, function (e) {
  5006. return e !== t ? e : null
  5007. }) : e.map(this.tabs, function (e, i) {
  5008. return i !== t ? i : null
  5009. })), this._setupDisabled(i))
  5010. },
  5011. disable: function (t) {
  5012. var i = this.options.disabled;
  5013. if (i !== !0) {
  5014. if (void 0 === t) i = !0; else {
  5015. if (t = this._getIndex(t), -1 !== e.inArray(t, i)) return;
  5016. i = e.isArray(i) ? e.merge([t], i).sort() : [t]
  5017. }
  5018. this._setupDisabled(i)
  5019. }
  5020. },
  5021. load: function (t, i) {
  5022. t = this._getIndex(t);
  5023. var s = this, n = this.tabs.eq(t), a = n.find(".ui-tabs-anchor"), o = this._getPanelForTab(n),
  5024. r = {tab: n, panel: o};
  5025. this._isLocal(a[0]) || (this.xhr = e.ajax(this._ajaxSettings(a, i, r)), this.xhr && "canceled" !== this.xhr.statusText && (n.addClass("ui-tabs-loading"), o.attr("aria-busy", "true"), this.xhr.success(function (e) {
  5026. setTimeout(function () {
  5027. o.html(e), s._trigger("load", i, r)
  5028. }, 1)
  5029. }).complete(function (e, t) {
  5030. setTimeout(function () {
  5031. "abort" === t && s.panels.stop(!1, !0), n.removeClass("ui-tabs-loading"), o.removeAttr("aria-busy"), e === s.xhr && delete s.xhr
  5032. }, 1)
  5033. })))
  5034. },
  5035. _ajaxSettings: function (t, i, s) {
  5036. var n = this;
  5037. return {
  5038. url: t.attr("href"), beforeSend: function (t, a) {
  5039. return n._trigger("beforeLoad", i, e.extend({jqXHR: t, ajaxSettings: a}, s))
  5040. }
  5041. }
  5042. },
  5043. _getPanelForTab: function (t) {
  5044. var i = e(t).attr("aria-controls");
  5045. return this.element.find(this._sanitizeSelector("#" + i))
  5046. }
  5047. }), e.widget("ui.tooltip", {
  5048. version: "1.11.2", options: {
  5049. content: function () {
  5050. var t = e(this).attr("title") || "";
  5051. return e("<a>").text(t).html()
  5052. },
  5053. hide: !0,
  5054. items: "[title]:not([disabled])",
  5055. position: {my: "left top+15", at: "left bottom", collision: "flipfit flip"},
  5056. show: !0,
  5057. tooltipClass: null,
  5058. track: !1,
  5059. close: null,
  5060. open: null
  5061. }, _addDescribedBy: function (t, i) {
  5062. var s = (t.attr("aria-describedby") || "").split(/\s+/);
  5063. s.push(i), t.data("ui-tooltip-id", i).attr("aria-describedby", e.trim(s.join(" ")))
  5064. }, _removeDescribedBy: function (t) {
  5065. var i = t.data("ui-tooltip-id"), s = (t.attr("aria-describedby") || "").split(/\s+/), n = e.inArray(i, s);
  5066. -1 !== n && s.splice(n, 1), t.removeData("ui-tooltip-id"), s = e.trim(s.join(" ")), s ? t.attr("aria-describedby", s) : t.removeAttr("aria-describedby")
  5067. }, _create: function () {
  5068. this._on({
  5069. mouseover: "open",
  5070. focusin: "open"
  5071. }), this.tooltips = {}, this.parents = {}, this.options.disabled && this._disable(), this.liveRegion = e("<div>").attr({
  5072. role: "log",
  5073. "aria-live": "assertive",
  5074. "aria-relevant": "additions"
  5075. }).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)
  5076. }, _setOption: function (t, i) {
  5077. var s = this;
  5078. return "disabled" === t ? (this[i ? "_disable" : "_enable"](), this.options[t] = i, void 0) : (this._super(t, i), "content" === t && e.each(this.tooltips, function (e, t) {
  5079. s._updateContent(t.element)
  5080. }), void 0)
  5081. }, _disable: function () {
  5082. var t = this;
  5083. e.each(this.tooltips, function (i, s) {
  5084. var n = e.Event("blur");
  5085. n.target = n.currentTarget = s.element[0], t.close(n, !0)
  5086. }), this.element.find(this.options.items).addBack().each(function () {
  5087. var t = e(this);
  5088. t.is("[title]") && t.data("ui-tooltip-title", t.attr("title")).removeAttr("title")
  5089. })
  5090. }, _enable: function () {
  5091. this.element.find(this.options.items).addBack().each(function () {
  5092. var t = e(this);
  5093. t.data("ui-tooltip-title") && t.attr("title", t.data("ui-tooltip-title"))
  5094. })
  5095. }, open: function (t) {
  5096. var i = this, s = e(t ? t.target : this.element).closest(this.options.items);
  5097. s.length && !s.data("ui-tooltip-id") && (s.attr("title") && s.data("ui-tooltip-title", s.attr("title")), s.data("ui-tooltip-open", !0), t && "mouseover" === t.type && s.parents().each(function () {
  5098. var t, s = e(this);
  5099. s.data("ui-tooltip-open") && (t = e.Event("blur"), t.target = t.currentTarget = this, i.close(t, !0)), s.attr("title") && (s.uniqueId(), i.parents[this.id] = {
  5100. element: this,
  5101. title: s.attr("title")
  5102. }, s.attr("title", ""))
  5103. }), this._updateContent(s, t))
  5104. }, _updateContent: function (e, t) {
  5105. var i, s = this.options.content, n = this, a = t ? t.type : null;
  5106. return "string" == typeof s ? this._open(t, e, s) : (i = s.call(e[0], function (i) {
  5107. e.data("ui-tooltip-open") && n._delay(function () {
  5108. t && (t.type = a), this._open(t, e, i)
  5109. })
  5110. }), i && this._open(t, e, i), void 0)
  5111. }, _open: function (t, i, s) {
  5112. function n(e) {
  5113. u.of = e, o.is(":hidden") || o.position(u)
  5114. }
  5115. var a, o, r, h, l, u = e.extend({}, this.options.position);
  5116. if (s) {
  5117. if (a = this._find(i)) return a.tooltip.find(".ui-tooltip-content").html(s), void 0;
  5118. i.is("[title]") && (t && "mouseover" === t.type ? i.attr("title", "") : i.removeAttr("title")), a = this._tooltip(i), o = a.tooltip, this._addDescribedBy(i, o.attr("id")), o.find(".ui-tooltip-content").html(s), this.liveRegion.children().hide(), s.clone ? (l = s.clone(), l.removeAttr("id").find("[id]").removeAttr("id")) : l = s, e("<div>").html(l).appendTo(this.liveRegion), this.options.track && t && /^mouse/.test(t.type) ? (this._on(this.document, {mousemove: n}), n(t)) : o.position(e.extend({of: i}, this.options.position)), o.hide(), this._show(o, this.options.show), this.options.show && this.options.show.delay && (h = this.delayedShow = setInterval(function () {
  5119. o.is(":visible") && (n(u.of), clearInterval(h))
  5120. }, e.fx.interval)), this._trigger("open", t, {tooltip: o}), r = {
  5121. keyup: function (t) {
  5122. if (t.keyCode === e.ui.keyCode.ESCAPE) {
  5123. var s = e.Event(t);
  5124. s.currentTarget = i[0], this.close(s, !0)
  5125. }
  5126. }
  5127. }, i[0] !== this.element[0] && (r.remove = function () {
  5128. this._removeTooltip(o)
  5129. }), t && "mouseover" !== t.type || (r.mouseleave = "close"), t && "focusin" !== t.type || (r.focusout = "close"), this._on(!0, i, r)
  5130. }
  5131. }, close: function (t) {
  5132. var i, s = this, n = e(t ? t.currentTarget : this.element), a = this._find(n);
  5133. a && (i = a.tooltip, a.closing || (clearInterval(this.delayedShow), n.data("ui-tooltip-title") && !n.attr("title") && n.attr("title", n.data("ui-tooltip-title")), this._removeDescribedBy(n), a.hiding = !0, i.stop(!0), this._hide(i, this.options.hide, function () {
  5134. s._removeTooltip(e(this))
  5135. }), n.removeData("ui-tooltip-open"), this._off(n, "mouseleave focusout keyup"), n[0] !== this.element[0] && this._off(n, "remove"), this._off(this.document, "mousemove"), t && "mouseleave" === t.type && e.each(this.parents, function (t, i) {
  5136. e(i.element).attr("title", i.title), delete s.parents[t]
  5137. }), a.closing = !0, this._trigger("close", t, {tooltip: i}), a.hiding || (a.closing = !1)))
  5138. }, _tooltip: function (t) {
  5139. var i = e("<div>").attr("role", "tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass || "")),
  5140. s = i.uniqueId().attr("id");
  5141. return e("<div>").addClass("ui-tooltip-content").appendTo(i), i.appendTo(this.document[0].body), this.tooltips[s] = {
  5142. element: t,
  5143. tooltip: i
  5144. }
  5145. }, _find: function (e) {
  5146. var t = e.data("ui-tooltip-id");
  5147. return t ? this.tooltips[t] : null
  5148. }, _removeTooltip: function (e) {
  5149. e.remove(), delete this.tooltips[e.attr("id")]
  5150. }, _destroy: function () {
  5151. var t = this;
  5152. e.each(this.tooltips, function (i, s) {
  5153. var n = e.Event("blur"), a = s.element;
  5154. n.target = n.currentTarget = a[0], t.close(n, !0), e("#" + i).remove(), a.data("ui-tooltip-title") && (a.attr("title") || a.attr("title", a.data("ui-tooltip-title")), a.removeData("ui-tooltip-title"))
  5155. }), this.liveRegion.remove()
  5156. }
  5157. })
  5158. });