This repository has been archived by the owner on Dec 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathjs9support.min.js
4708 lines (4271 loc) · 961 KB
/
js9support.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// fix to allow jquery to be loaded into an electron.js app
// http://electron.atom.io/docs/faq/
//
// Due to the Node.js integration of Electron, there are some extra
// symbols inserted into the DOM like module, exports, require. This
// causes problems for some libraries since they want to insert the
// symbols with the same names.
//
// The electron solution does not work for JS9, since some plugins use require.
//
// So we use this solution:
//
// http://stackoverflow.com/questions/32621988/electron-jquery-is-not-defined
// https://github.com/electron/electron/issues/254#issuecomment-183483641
if (typeof module === 'object') {window.module = module; module = undefined;}
/*! jQuery v3.5.0 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t=Object.create(null),V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",y.checkOn=""!==rt.value,y.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
/*
jQuery UI - v1.12.1 - 2017-08-09
http://jqueryui.com
Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
Copyright jQuery Foundation and other contributors; Licensed MIT jQuery UI Widget 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Position 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
http://api.jqueryui.com/position/
jQuery UI :data 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Disable Selection 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Focusable 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Form Reset Mixin 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Support for jQuery core 1.7.x 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Keycode 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Labels 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Scroll Parent 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Tabbable 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Unique ID 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Mouse 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Draggable 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Droppable 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Resizable 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Selectable 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Sortable 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Accordion 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Menu 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Autocomplete 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Controlgroup 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Checkboxradio 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Button 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Datepicker 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Dialog 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Progressbar 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Selectmenu 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Slider 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Spinner 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Tabs 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
jQuery UI Tooltip 1.12.1
http://jqueryui.com
Copyright jQuery Foundation and other contributors
Released under the MIT license.
http://jquery.org/license
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,q,t){d instanceof String&&(d=String(d));for(var w=d.length,C=0;C<w;C++){var F=d[C];if(q.call(t,F,C,d))return{i:C,v:F}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,q,t){d!=Array.prototype&&d!=Object.prototype&&(d[q]=t.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(d,q,t,w){if(q){t=$jscomp.global;d=d.split(".");for(w=0;w<d.length-1;w++){var C=d[w];C in t||(t[C]={});t=t[C]}d=d[d.length-1];w=t[d];q=q(w);q!=w&&null!=q&&$jscomp.defineProperty(t,d,{configurable:!0,writable:!0,value:q})}};$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,t){return $jscomp.findInternal(this,d,t).v}},"es6","es3");$jscomp.arrayIteratorImpl=function(d){var q=0;return function(){return q<d.length?{done:!1,value:d[q++]}:{done:!0}}};
$jscomp.arrayIterator=function(d){return{next:$jscomp.arrayIteratorImpl(d)}};$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.SymbolClass=function(d,q){this.$jscomp$symbol$id_=d;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:q})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};
$jscomp.Symbol=function(){function d(t){if(this instanceof d)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(t||"")+"_"+q++,t)}var q=0;return d}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.iterator;d||(d=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[d]&&$jscomp.defineProperty(Array.prototype,d,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var d=$jscomp.global.Symbol.asyncIterator;d||(d=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(d){$jscomp.initSymbolIterator();d={next:d};d[$jscomp.global.Symbol.iterator]=function(){return this};return d};
$jscomp.iteratorFromArray=function(d,q){$jscomp.initSymbolIterator();d instanceof String&&(d+="");var t=0,w={next:function(){if(t<d.length){var C=t++;return{value:q(C,d[C]),done:!1}}w.next=function(){return{done:!0,value:void 0}};return w.next()}};w[Symbol.iterator]=function(){return w};return w};$jscomp.polyfill("Array.prototype.values",function(d){return d?d:function(){return $jscomp.iteratorFromArray(this,function(d,t){return t})}},"es8","es3");
(function(d){"function"===typeof define&&define.amd?define(["jquery"],d):d(jQuery)})(function(d){function q(a){for(var b;a.length&&a[0]!==document;){b=a.css("position");if("absolute"===b||"relative"===b||"fixed"===b)if(b=parseInt(a.css("zIndex"),10),!isNaN(b)&&0!==b)return b;a=a.parent()}return 0}function t(){this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!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[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:"January February March April May June July August September October November December".split(" "),
monthNamesShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dayNames:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),dayNamesShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dayNamesMin:"Su Mo Tu We Th Fr Sa".split(" "),weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,
navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1};d.extend(this._defaults,
this.regional[""]);this.regional.en=d.extend(!0,{},this.regional[""]);this.regional["en-US"]=d.extend(!0,{},this.regional.en);this.dpDiv=w(d("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function w(a){return a.on("mouseout","button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a",function(){d(this).removeClass("ui-state-hover");-1!==this.className.indexOf("ui-datepicker-prev")&&d(this).removeClass("ui-datepicker-prev-hover");
-1!==this.className.indexOf("ui-datepicker-next")&&d(this).removeClass("ui-datepicker-next-hover")}).on("mouseover","button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a",C)}function C(){d.datepicker._isDisabledDatepicker(I.inline?I.dpDiv.parent()[0]:I.input[0])||(d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&d(this).addClass("ui-datepicker-prev-hover"),
-1!==this.className.indexOf("ui-datepicker-next")&&d(this).addClass("ui-datepicker-next-hover"))}function F(a,b){d.extend(a,b);for(var c in b)null==b[c]&&(a[c]=b[c]);return a}function G(a){return function(){var b=this.element.val();a.apply(this,arguments);this._refresh();b!==this.element.val()&&this._trigger("change")}}d.ui=d.ui||{};d.ui.version="1.12.1";var U=0,K=Array.prototype.slice;d.cleanData=function(a){return function(b){var c,e,f;for(f=0;null!=(e=b[f]);f++)try{(c=d._data(e,"events"))&&c.remove&&
d(e).triggerHandler("remove")}catch(g){}a(b)}}(d.cleanData);d.widget=function(a,b,c){var e={},f=a.split(".")[0];a=a.split(".")[1];var g=f+"-"+a;c||(c=b,b=d.Widget);d.isArray(c)&&(c=d.extend.apply(null,[{}].concat(c)));d.expr[":"][g.toLowerCase()]=function(a){return!!d.data(a,g)};d[f]=d[f]||{};var h=d[f][a];var k=d[f][a]=function(a,b){if(!this._createWidget)return new k(a,b);arguments.length&&this._createWidget(a,b)};d.extend(k,h,{version:c.version,_proto:d.extend({},c),_childConstructors:[]});var m=
new b;m.options=d.widget.extend({},m.options);d.each(c,function(a,c){d.isFunction(c)?e[a]=function(){function d(){return b.prototype[a].apply(this,arguments)}function e(c){return b.prototype[a].apply(this,c)}return function(){var a=this._super,b=this._superApply;this._super=d;this._superApply=e;var f=c.apply(this,arguments);this._super=a;this._superApply=b;return f}}():e[a]=c});k.prototype=d.widget.extend(m,{widgetEventPrefix:h?m.widgetEventPrefix||a:a},e,{constructor:k,namespace:f,widgetName:a,widgetFullName:g});
h?(d.each(h._childConstructors,function(a,b){a=b.prototype;d.widget(a.namespace+"."+a.widgetName,k,b._proto)}),delete h._childConstructors):b._childConstructors.push(k);d.widget.bridge(a,k);return k};d.widget.extend=function(a){for(var b=K.call(arguments,1),c=0,e=b.length,f,g;c<e;c++)for(f in b[c])g=b[c][f],b[c].hasOwnProperty(f)&&void 0!==g&&(d.isPlainObject(g)?a[f]=d.isPlainObject(a[f])?d.widget.extend({},a[f],g):d.widget.extend({},g):a[f]=g);return a};d.widget.bridge=function(a,b){var c=b.prototype.widgetFullName||
a;d.fn[a]=function(e){var f="string"===typeof e,g=K.call(arguments,1),h=this;f?this.length||"instance"!==e?this.each(function(){var b=d.data(this,c);if("instance"===e)return h=b,!1;if(!b)return d.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+e+"'");if(!d.isFunction(b[e])||"_"===e.charAt(0))return d.error("no such method '"+e+"' for "+a+" widget instance");var f=b[e].apply(b,g);if(f!==b&&void 0!==f)return h=f&&f.jquery?h.pushStack(f.get()):f,!1}):h=void 0:
(g.length&&(e=d.widget.extend.apply(null,[e].concat(g))),this.each(function(){var a=d.data(this,c);a?(a.option(e||{}),a._init&&a._init()):d.data(this,c,new b(e,this))}));return h}};d.Widget=function(){};d.Widget._childConstructors=[];d.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(a,b){b=d(b||this.defaultElement||this)[0];this.element=d(b);this.uuid=U++;this.eventNamespace="."+this.widgetName+this.uuid;
this.bindings=d();this.hoverable=d();this.focusable=d();this.classesElementLookup={};b!==this&&(d.data(b,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===b&&this.destroy()}}),this.document=d(b.style?b.ownerDocument:b.document||b),this.window=d(this.document[0].defaultView||this.document[0].parentWindow));this.options=d.widget.extend({},this.options,this._getCreateOptions(),a);this._create();this.options.disabled&&this._setOptionDisabled(this.options.disabled);this._trigger("create",
null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:d.noop,_create:d.noop,_init:d.noop,destroy:function(){var a=this;this._destroy();d.each(this.classesElementLookup,function(b,c){a._removeClass(c,b)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:d.noop,widget:function(){return this.element},option:function(a,
b){var c=a,e;if(0===arguments.length)return d.widget.extend({},this.options);if("string"===typeof a){c={};var f=a.split(".");a=f.shift();if(f.length){var g=c[a]=d.widget.extend({},this.options[a]);for(e=0;e<f.length-1;e++)g[f[e]]=g[f[e]]||{},g=g[f[e]];a=f.pop();if(1===arguments.length)return void 0===g[a]?null:g[a];g[a]=b}else{if(1===arguments.length)return void 0===this.options[a]?null:this.options[a];c[a]=b}}this._setOptions(c);return this},_setOptions:function(a){for(var b in a)this._setOption(b,
a[b]);return this},_setOption:function(a,b){"classes"===a&&this._setOptionClasses(b);this.options[a]=b;"disabled"===a&&this._setOptionDisabled(b);return this},_setOptionClasses:function(a){var b;for(b in a){var c=this.classesElementLookup[b];if(a[b]!==this.options.classes[b]&&c&&c.length){var e=d(c.get());this._removeClass(c,b);e.addClass(this._classes({element:e,keys:b,classes:a,add:!0}))}}},_setOptionDisabled:function(a){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!a);
a&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(a){function b(b,g){var f;for(f=0;f<b.length;f++){var k=e.classesElementLookup[b[f]]||d();k=a.add?d(d.unique(k.get().concat(a.element.get()))):d(k.not(a.element).get());e.classesElementLookup[b[f]]=k;c.push(b[f]);g&&a.classes[b[f]]&&c.push(a.classes[b[f]])}}
var c=[],e=this;a=d.extend({element:this.element,classes:this.options.classes||{}},a);this._on(a.element,{remove:"_untrackClassesElement"});a.keys&&b(a.keys.match(/\S+/g)||[],!0);a.extra&&b(a.extra.match(/\S+/g)||[]);return c.join(" ")},_untrackClassesElement:function(a){var b=this;d.each(b.classesElementLookup,function(c,e){-1!==d.inArray(a.target,e)&&(b.classesElementLookup[c]=d(e.not(a.target).get()))})},_removeClass:function(a,b,c){return this._toggleClass(a,b,c,!1)},_addClass:function(a,b,c){return this._toggleClass(a,
b,c,!0)},_toggleClass:function(a,b,c,d){d="boolean"===typeof d?d:c;var e="string"===typeof a||null===a;a={extra:e?b:c,keys:e?a:b,element:e?this.element:a,add:d};a.element.toggleClass(this._classes(a),d);return this},_on:function(a,b,c){var e,f=this;"boolean"!==typeof a&&(c=b,b=a,a=!1);c?(b=e=d(b),this.bindings=this.bindings.add(b)):(c=b,b=this.element,e=this.widget());d.each(c,function(c,h){function g(){if(a||!0!==f.options.disabled&&!d(this).hasClass("ui-state-disabled"))return("string"===typeof h?
f[h]:h).apply(f,arguments)}"string"!==typeof h&&(g.guid=h.guid=h.guid||g.guid||d.guid++);var m=c.match(/^([\w:-]*)\s*(.*)$/);c=m[1]+f.eventNamespace;if(m=m[2])e.on(c,m,g);else b.on(c,g)})},_off:function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;a.off(b).off(b);this.bindings=d(this.bindings.not(a).get());this.focusable=d(this.focusable.not(a).get());this.hoverable=d(this.hoverable.not(a).get())},_delay:function(a,b){var c=this;return setTimeout(function(){return("string"===
typeof a?c[a]:a).apply(c,arguments)},b||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._on(a,{mouseenter:function(a){this._addClass(d(a.currentTarget),null,"ui-state-hover")},mouseleave:function(a){this._removeClass(d(a.currentTarget),null,"ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._on(a,{focusin:function(a){this._addClass(d(a.currentTarget),null,"ui-state-focus")},focusout:function(a){this._removeClass(d(a.currentTarget),null,"ui-state-focus")}})},
_trigger:function(a,b,c){var e,f=this.options[a];c=c||{};b=d.Event(b);b.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();b.target=this.element[0];if(a=b.originalEvent)for(e in a)e in b||(b[e]=a[e]);this.element.trigger(b,c);return!(d.isFunction(f)&&!1===f.apply(this.element[0],[b].concat(c))||b.isDefaultPrevented())}};d.each({show:"fadeIn",hide:"fadeOut"},function(a,b){d.Widget.prototype["_"+a]=function(c,e,f){"string"===typeof e&&(e={effect:e});var g=e?!0===e||"number"===
typeof e?b:e.effect||b:a;e=e||{};"number"===typeof e&&(e={duration:e});var h=!d.isEmptyObject(e);e.complete=f;e.delay&&c.delay(e.delay);if(h&&d.effects&&d.effects.effect[g])c[a](e);else if(g!==a&&c[g])c[g](e.duration,e.easing,f);else c.queue(function(b){d(this)[a]();f&&f.call(c[0]);b()})}});(function(){function a(a,b,c){return[parseFloat(a[0])*(l.test(a[0])?b/100:1),parseFloat(a[1])*(l.test(a[1])?c/100:1)]}function b(a){var b=a[0];return 9===b.nodeType?{width:a.width(),height:a.height(),offset:{top:0,
left:0}}:d.isWindow(b)?{width:a.width(),height:a.height(),offset:{top:a.scrollTop(),left:a.scrollLeft()}}:b.preventDefault?{width:0,height:0,offset:{top:b.pageY,left:b.pageX}}:{width:a.outerWidth(),height:a.outerHeight(),offset:a.offset()}}var c,e=Math.max,f=Math.abs,g=/left|center|right/,h=/top|center|bottom/,k=/[\+\-]\d+(\.[\d]+)?%?/,m=/^\w+/,l=/%$/,n=d.fn.position;d.position={scrollbarWidth:function(){if(void 0!==c)return c;var a=d("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>");
var b=a.children()[0];d("body").append(a);var e=b.offsetWidth;a.css("overflow","scroll");b=b.offsetWidth;e===b&&(b=a[0].clientWidth);a.remove();return c=e-b},getScrollInfo:function(a){var b=a.isWindow||a.isDocument?"":a.element.css("overflow-x"),c=a.isWindow||a.isDocument?"":a.element.css("overflow-y");b="scroll"===b||"auto"===b&&a.width<a.element[0].scrollWidth;return{width:"scroll"===c||"auto"===c&&a.height<a.element[0].scrollHeight?d.position.scrollbarWidth():0,height:b?d.position.scrollbarWidth():
0}},getWithinInfo:function(a){var b=d(a||window),c=d.isWindow(b[0]),e=!!b[0]&&9===b[0].nodeType;return{element:b,isWindow:c,isDocument:e,offset:c||e?{left:0,top:0}:d(a).offset(),scrollLeft:b.scrollLeft(),scrollTop:b.scrollTop(),width:b.outerWidth(),height:b.outerHeight()}}};d.fn.position=function(c){if(!c||!c.of)return n.apply(this,arguments);c=d.extend({},c);var p=d(c.of),l=d.position.getWithinInfo(c.within),P=d.position.getScrollInfo(l),v=(c.collision||"flip").split(" "),y={};var r=b(p);p[0].preventDefault&&
(c.at="left top");var u=r.width;var A=r.height;var t=r.offset;var q=d.extend({},t);d.each(["my","at"],function(){var a=(c[this]||"").split(" ");1===a.length&&(a=g.test(a[0])?a.concat(["center"]):h.test(a[0])?["center"].concat(a):["center","center"]);a[0]=g.test(a[0])?a[0]:"center";a[1]=h.test(a[1])?a[1]:"center";var b=k.exec(a[0]);var d=k.exec(a[1]);y[this]=[b?b[0]:0,d?d[0]:0];c[this]=[m.exec(a[0])[0],m.exec(a[1])[0]]});1===v.length&&(v[1]=v[0]);"right"===c.at[0]?q.left+=u:"center"===c.at[0]&&(q.left+=
u/2);"bottom"===c.at[1]?q.top+=A:"center"===c.at[1]&&(q.top+=A/2);var w=a(y.at,u,A);q.left+=w[0];q.top+=w[1];return this.each(function(){var b,g=d(this),h=g.outerWidth(),k=g.outerHeight(),m=parseInt(d.css(this,"marginLeft"),10)||0,x=parseInt(d.css(this,"marginTop"),10)||0,n=h+m+(parseInt(d.css(this,"marginRight"),10)||0)+P.width,H=k+x+(parseInt(d.css(this,"marginBottom"),10)||0)+P.height,r=d.extend({},q),M=a(y.my,g.outerWidth(),g.outerHeight());"right"===c.my[0]?r.left-=h:"center"===c.my[0]&&(r.left-=
h/2);"bottom"===c.my[1]?r.top-=k:"center"===c.my[1]&&(r.top-=k/2);r.left+=M[0];r.top+=M[1];var z={marginLeft:m,marginTop:x};d.each(["left","top"],function(a,b){if(d.ui.position[v[a]])d.ui.position[v[a]][b](r,{targetWidth:u,targetHeight:A,elemWidth:h,elemHeight:k,collisionPosition:z,collisionWidth:n,collisionHeight:H,offset:[w[0]+M[0],w[1]+M[1]],my:c.my,at:c.at,within:l,elem:g})});c.using&&(b=function(a){var b=t.left-r.left,d=b+u-h,m=t.top-r.top,l=m+A-k,x={target:{element:p,left:t.left,top:t.top,width:u,
height:A},element:{element:g,left:r.left,top:r.top,width:h,height:k},horizontal:0>d?"left":0<b?"right":"center",vertical:0>l?"top":0<m?"bottom":"middle"};u<h&&f(b+d)<u&&(x.horizontal="center");A<k&&f(m+l)<A&&(x.vertical="middle");e(f(b),f(d))>e(f(m),f(l))?x.important="horizontal":x.important="vertical";c.using.call(this,a,x)});g.offset(d.extend(r,{using:b}))})};d.ui.position={fit:{left:function(a,b){var c=b.within,d=c.isWindow?c.scrollLeft:c.offset.left,f=c.width,g=a.left-b.collisionPosition.marginLeft;
c=d-g;var h=g+b.collisionWidth-f-d;b.collisionWidth>f?0<c&&0>=h?(b=a.left+c+b.collisionWidth-f-d,a.left+=c-b):a.left=0<h&&0>=c?d:c>h?d+f-b.collisionWidth:d:a.left=0<c?a.left+c:0<h?a.left-h:e(a.left-g,a.left)},top:function(a,b){var c=b.within,d=c.isWindow?c.scrollTop:c.offset.top,f=b.within.height,g=a.top-b.collisionPosition.marginTop;c=d-g;var h=g+b.collisionHeight-f-d;b.collisionHeight>f?0<c&&0>=h?(b=a.top+c+b.collisionHeight-f-d,a.top+=c-b):a.top=0<h&&0>=c?d:c>h?d+f-b.collisionHeight:d:a.top=0<
c?a.top+c:0<h?a.top-h:e(a.top-g,a.top)}},flip:{left:function(a,b){var c=b.within,d=c.offset.left+c.scrollLeft,e=c.width,g=c.isWindow?c.scrollLeft:c.offset.left,h=a.left-b.collisionPosition.marginLeft;c=h-g;var k=h+b.collisionWidth-e-g;h="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0;var m="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,l=-2*b.offset[0];if(0>c){if(b=a.left+h+m+l+b.collisionWidth-e-d,0>b||b<f(c))a.left+=h+m+l}else 0<k&&(b=a.left-b.collisionPosition.marginLeft+
h+m+l-g,0<b||f(b)<k)&&(a.left+=h+m+l)},top:function(a,b){var c=b.within,d=c.offset.top+c.scrollTop,e=c.height,g=c.isWindow?c.scrollTop:c.offset.top,h=a.top-b.collisionPosition.marginTop;c=h-g;var k=h+b.collisionHeight-e-g;h="top"===b.my[1]?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0;var m="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,l=-2*b.offset[1];if(0>c){if(b=a.top+h+m+l+b.collisionHeight-e-d,0>b||b<f(c))a.top+=h+m+l}else 0<k&&(b=a.top-b.collisionPosition.marginTop+h+
m+l-g,0<b||f(b)<k)&&(a.top+=h+m+l)}},flipfit:{left:function(){d.ui.position.flip.left.apply(this,arguments);d.ui.position.fit.left.apply(this,arguments)},top:function(){d.ui.position.flip.top.apply(this,arguments);d.ui.position.fit.top.apply(this,arguments)}}}})();d.extend(d.expr[":"],{data:d.expr.createPseudo?d.expr.createPseudo(function(a){return function(b){return!!d.data(b,a)}}):function(a,b,c){return!!d.data(a,c[3])}});d.fn.extend({disableSelection:function(){var a="onselectstart"in document.createElement("div")?
"selectstart":"mousedown";return function(){return this.on(a+".ui-disableSelection",function(a){a.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});d.ui.focusable=function(a,b){var c=a.nodeName.toLowerCase();if("area"===c){b=a.parentNode;c=b.name;if(!a.href||!c||"map"!==b.nodeName.toLowerCase())return!1;a=d("img[usemap='#"+c+"']");return 0<a.length&&a.is(":visible")}/^(input|select|textarea|button|object)$/.test(c)?(b=!a.disabled)&&(c=d(a).closest("fieldset")[0])&&
(b=!c.disabled):b="a"===c?a.href||b:b;if(b=b&&d(a).is(":visible")){a=d(a);for(b=a.css("visibility");"inherit"===b;)a=a.parent(),b=a.css("visibility");b="hidden"!==b}return b};d.extend(d.expr[":"],{focusable:function(a){return d.ui.focusable(a,null!=d.attr(a,"tabindex"))}});d.fn.form=function(){return"string"===typeof this[0].form?this.closest("form"):d(this[0].form)};d.ui.formResetMixin={_formResetHandler:function(){var a=d(this);setTimeout(function(){var b=a.data("ui-form-reset-instances");d.each(b,
function(){this.refresh()})})},_bindFormResetHandler:function(){this.form=this.element.form();if(this.form.length){var a=this.form.data("ui-form-reset-instances")||[];if(!a.length)this.form.on("reset.ui-form-reset",this._formResetHandler);a.push(this);this.form.data("ui-form-reset-instances",a)}},_unbindFormResetHandler:function(){if(this.form.length){var a=this.form.data("ui-form-reset-instances");a.splice(d.inArray(this,a),1);a.length?this.form.data("ui-form-reset-instances",a):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}};
"1.7"===d.fn.jquery.substring(0,3)&&(d.each(["Width","Height"],function(a,b){function c(a,b,c,f){d.each(e,function(){b-=parseFloat(d.css(a,"padding"+this))||0;c&&(b-=parseFloat(d.css(a,"border"+this+"Width"))||0);f&&(b-=parseFloat(d.css(a,"margin"+this))||0)});return b}var e="Width"===b?["Left","Right"]:["Top","Bottom"],f=b.toLowerCase(),g={innerWidth:d.fn.innerWidth,innerHeight:d.fn.innerHeight,outerWidth:d.fn.outerWidth,outerHeight:d.fn.outerHeight};d.fn["inner"+b]=function(a){return void 0===a?
g["inner"+b].call(this):this.each(function(){d(this).css(f,c(this,a)+"px")})};d.fn["outer"+b]=function(a,e){return"number"!==typeof a?g["outer"+b].call(this,a):this.each(function(){d(this).css(f,c(this,a,!0,e)+"px")})}}),d.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))});d.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38};d.ui.escapeSelector=function(){var a=
/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(b){return b.replace(a,"\\$1")}}();d.fn.labels=function(){var a;if(this[0].labels&&this[0].labels.length)return this.pushStack(this[0].labels);var b=this.eq(0).parents("label");if(a=this.attr("id")){var c=this.eq(0).parents().last();c=c.add(c.length?c.siblings():this.siblings());a="label[for='"+d.ui.escapeSelector(a)+"']";b=b.add(c.find(a).addBack(a))}return this.pushStack(b)};d.fn.scrollParent=function(a){var b=this.css("position"),c="absolute"===
b,e=a?/(auto|scroll|hidden)/:/(auto|scroll)/;a=this.parents().filter(function(){var a=d(this);return c&&"static"===a.css("position")?!1:e.test(a.css("overflow")+a.css("overflow-y")+a.css("overflow-x"))}).eq(0);return"fixed"!==b&&a.length?a:d(this[0].ownerDocument||document)};d.extend(d.expr[":"],{tabbable:function(a){var b=d.attr(a,"tabindex"),c=null!=b;return(!c||0<=b)&&d.ui.focusable(a,c)}});d.fn.extend({uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id=
"ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&d(this).removeAttr("id")})}});d.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var J=!1;d(document).on("mouseup",function(){J=!1});d.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.on("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).on("click."+this.widgetName,
function(b){if(!0===d.data(b.target,a.widgetName+".preventClickEvent"))return d.removeData(b.target,a.widgetName+".preventClickEvent"),b.stopImmediatePropagation(),!1});this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName);this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(a){if(!J){this._mouseMoved=!1;this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=
a;var b=this,c=1===a.which,e="string"===typeof this.options.cancel&&a.target.nodeName?d(a.target).closest(this.options.cancel).length:!1;if(!c||e||!this._mouseCapture(a))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=!1!==this._mouseStart(a),!this._mouseStarted))return a.preventDefault(),!0;!0===d.data(a.target,this.widgetName+
".preventClickEvent")&&d.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(a){return b._mouseMove(a)};this._mouseUpDelegate=function(a){return b._mouseUp(a)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return J=!0}},_mouseMove:function(a){if(this._mouseMoved){if(d.ui.ie&&(!document.documentMode||9>document.documentMode)&&!a.button)return this._mouseUp(a);if(!a.which)if(a.originalEvent.altKey||
a.originalEvent.ctrlKey||a.originalEvent.metaKey||a.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(a)}if(a.which||a.button)this._mouseMoved=!0;if(this._mouseStarted)return this._mouseDrag(a),a.preventDefault();this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&((this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,a))?this._mouseDrag(a):this._mouseUp(a));return!this._mouseStarted},_mouseUp:function(a){this.document.off("mousemove."+
this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);this._mouseStarted&&(this._mouseStarted=!1,a.target===this._mouseDownEvent.target&&d.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a));this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer);J=this.ignoreMissingWhich=!1;a.preventDefault()},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-
a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});d.ui.plugin={add:function(a,b,c){var e;a=d.ui[a].prototype;for(e in c)a.plugins[e]=a.plugins[e]||[],a.plugins[e].push([b,c[e]])},call:function(a,b,c,d){if((b=a.plugins[b])&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(d=0;d<b.length;d++)a.options[b[d][0]]&&b[d][1].apply(a.element,
c)}};d.ui.safeActiveElement=function(a){try{var b=a.activeElement}catch(c){b=a.body}b||(b=a.body);b.nodeName||(b=a.body);return b};d.ui.safeBlur=function(a){a&&"body"!==a.nodeName.toLowerCase()&&d(a).trigger("blur")};d.widget("ui.draggable",d.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,
scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative();this.options.addClasses&&this._addClass("ui-draggable");this._setHandleClassName();this._mouseInit()},_setOption:function(a,b){this._super(a,b);"handle"===a&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?
this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(a){var b=this.options;if(this.helper||b.disabled||0<d(a.target).closest(".ui-resizable-handle").length)return!1;this.handle=this._getHandle(a);if(!this.handle)return!1;this._blurActiveElement(a);this._blockFrames(!0===b.iframeFix?"iframe":b.iframeFix);return!0},_blockFrames:function(a){this.iframeBlocks=this.document.find(a).map(function(){var a=d(this);return d("<div>").css("position","absolute").appendTo(a.parent()).outerWidth(a.outerWidth()).outerHeight(a.outerHeight()).offset(a.offset())[0]})},
_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(a){var b=d.ui.safeActiveElement(this.document[0]);d(a.target).closest(b).length||d.ui.safeBlur(b)},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();d.ui.ddmanager&&(d.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=0<this.helper.parents().filter(function(){return"fixed"===d(this).css("position")}).length;this.positionAbs=this.element.offset();this._refreshOffsets(a);this.originalPosition=this.position=this._generatePosition(a,!1);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this._setContainment();if(!1===this._trigger("start",a))return this._clear(),!1;
this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this._mouseDrag(a,!0);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return!0},_refreshOffsets:function(a){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top}},_mouseDrag:function(a,b){this.hasFixedAncestor&&
(this.offset.parent=this._getParentOffset());this.position=this._generatePosition(a,!0);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(!1===this._trigger("drag",a,b))return this._mouseUp(new d.Event("mouseup",a)),!1;this.position=b.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return!1},_mouseStop:function(a){var b=this,c=!1;d.ui.ddmanager&&!this.options.dropBehaviour&&
(c=d.ui.ddmanager.drop(this,a));this.dropped&&(c=this.dropped,this.dropped=!1);"invalid"===this.options.revert&&!c||"valid"===this.options.revert&&c||!0===this.options.revert||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)?d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==b._trigger("stop",a)&&b._clear()}):!1!==this._trigger("stop",a)&&this._clear();return!1},_mouseUp:function(a){this._unblockFrames();d.ui.ddmanager&&
d.ui.ddmanager.dragStop(this,a);this.handleElement.is(a.target)&&this.element.trigger("focus");return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp(new d.Event("mouseup",{target:this.element[0]})):this._clear();return this},_getHandle:function(a){return this.options.handle?!!d(a.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):
this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(a){var b=this.options,c=d.isFunction(b.helper);a=c?d(b.helper.apply(this.element[0],[a])):"clone"===b.helper?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo("parent"===b.appendTo?this.element[0].parentNode:b.appendTo);c&&a[0]===this.element[0]&&this._setPositionRelative();
a[0]===this.element[0]||/(fixed|absolute)/.test(a.css("position"))||a.css("position","absolute");return a},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(a){"string"===typeof a&&(a=a.split(" "));d.isArray(a)&&(a={left:+a[0],top:+a[1]||0});"left"in a&&(this.offset.click.left=a.left+this.margins.left);"right"in a&&(this.offset.click.left=this.helperProportions.width-a.right+this.margins.left);
"top"in a&&(this.offset.click.top=a.top+this.margins.top);"bottom"in a&&(this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top)},_isRootNode:function(a){return/(html|body)/i.test(a.tagName)||a===this.document[0]},_getParentOffset:function(){var a=this.offsetParent.offset(),b=this.document[0];"absolute"===this.cssPosition&&this.scrollParent[0]!==b&&d.contains(this.scrollParent[0],this.offsetParent[0])&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop());
this._isRootNode(this.offsetParent[0])&&(a={top:0,left:0});return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var a=this.element.position(),b=this._isRootNode(this.scrollParent[0]);return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+(b?0:this.scrollParent.scrollTop()),left:a.left-(parseInt(this.helper.css("left"),
10)||0)+(b?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a;var b=this.options;var c=this.document[0];this.relativeContainer=
null;if(b.containment)if("window"===b.containment)this.containment=[d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,d(window).scrollLeft()+d(window).width()-this.helperProportions.width-this.margins.left,d(window).scrollTop()+(d(window).height()||c.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];else if("document"===b.containment)this.containment=[0,0,d(c).width()-this.helperProportions.width-
this.margins.left,(d(c).height()||c.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];else if(b.containment.constructor===Array)this.containment=b.containment;else{if("parent"===b.containment&&(b.containment=this.helper[0].parentNode),c=d(b.containment),a=c[0])b=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),
10)||0),(b?Math.max(a.scrollWidth,a.offsetWidth):a.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(b?Math.max(a.scrollHeight,a.offsetHeight):a.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c}else this.containment=null},_convertPositionTo:function(a,
b){b||(b=this.position);a="absolute"===a?1:-1;var c=this._isRootNode(this.scrollParent[0]);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-("fixed"===this.cssPosition?-this.offset.scroll.top:c?0:this.offset.scroll.top)*a,left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-("fixed"===this.cssPosition?-this.offset.scroll.left:c?0:this.offset.scroll.left)*a}},_generatePosition:function(a,b){var c=this.options,d=this._isRootNode(this.scrollParent[0]);var f=a.pageX;var g=
a.pageY;d&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()});if(b){if(this.containment){if(this.relativeContainer){var h=this.relativeContainer.offset();h=[this.containment[0]+h.left,this.containment[1]+h.top,this.containment[2]+h.left,this.containment[3]+h.top]}else h=this.containment;a.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left);a.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top);a.pageX-this.offset.click.left>
h[2]&&(f=h[2]+this.offset.click.left);a.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}c.grid&&(g=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY,g=h?g-this.offset.click.top>=h[1]||g-this.offset.click.top>h[3]?g:g-this.offset.click.top>=h[1]?g-c.grid[1]:g+c.grid[1]:g,f=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX,f=h?f-this.offset.click.left>=h[0]||f-this.offset.click.left>
h[2]?f:f-this.offset.click.left>=h[0]?f-c.grid[0]:f+c.grid[0]:f);"y"===c.axis&&(f=this.originalPageX);"x"===c.axis&&(g=this.originalPageY)}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:d?0:this.offset.scroll.top),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:d?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,
"ui-draggable-dragging");this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove();this.helper=null;this.cancelHelperRemoval=!1;this.destroyOnClear&&this.destroy()},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c,this],!0);/^(drag|start|stop)/.test(a)&&(this.positionAbs=this._convertPositionTo("absolute"),c.offset=this.positionAbs);return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,
originalPosition:this.originalPosition,offset:this.positionAbs}}});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b,c){var e=d.extend({},b,{item:c.element});c.sortables=[];d(c.options.connectToSortable).each(function(){var b=d(this).sortable("instance");b&&!b.options.disabled&&(c.sortables.push(b),b.refreshPositions(),b._trigger("activate",a,e))})},stop:function(a,b,c){var e=d.extend({},b,{item:c.element});c.cancelHelperRemoval=!1;d.each(c.sortables,function(){this.isOver?(this.isOver=
0,c.cancelHelperRemoval=!0,this.cancelHelperRemoval=!1,this._storedCSS={position:this.placeholder.css("position"),top:this.placeholder.css("top"),left:this.placeholder.css("left")},this._mouseStop(a),this.options.helper=this.options._helper):(this.cancelHelperRemoval=!0,this._trigger("deactivate",a,e))})},drag:function(a,b,c){d.each(c.sortables,function(){var e=!1,f=this;f.positionAbs=c.positionAbs;f.helperProportions=c.helperProportions;f.offset.click=c.offset.click;f._intersectsWith(f.containerCache)&&
(e=!0,d.each(c.sortables,function(){this.positionAbs=c.positionAbs;this.helperProportions=c.helperProportions;this.offset.click=c.offset.click;this!==f&&this._intersectsWith(this.containerCache)&&d.contains(f.element[0],this.element[0])&&(e=!1);return e}));e?(f.isOver||(f.isOver=1,c._parent=b.helper.parent(),f.currentItem=b.helper.appendTo(f.element).data("ui-sortable-item",!0),f.options._helper=f.options.helper,f.options.helper=function(){return b.helper[0]},a.target=f.currentItem[0],f._mouseCapture(a,
!0),f._mouseStart(a,!0,!0),f.offset.click.top=c.offset.click.top,f.offset.click.left=c.offset.click.left,f.offset.parent.left-=c.offset.parent.left-f.offset.parent.left,f.offset.parent.top-=c.offset.parent.top-f.offset.parent.top,c._trigger("toSortable",a),c.dropped=f.element,d.each(c.sortables,function(){this.refreshPositions()}),c.currentItem=c.element,f.fromOutside=c),f.currentItem&&(f._mouseDrag(a),b.position=f.position)):f.isOver&&(f.isOver=0,f.cancelHelperRemoval=!0,f.options._revert=f.options.revert,
f.options.revert=!1,f._trigger("out",a,f._uiHash(f)),f._mouseStop(a,!0),f.options.revert=f.options._revert,f.options.helper=f.options._helper,f.placeholder&&f.placeholder.remove(),b.helper.appendTo(c._parent),c._refreshOffsets(a),b.position=c._generatePosition(a,!0),c._trigger("fromSortable",a),c.dropped=!1,d.each(c.sortables,function(){this.refreshPositions()}))})}});d.ui.plugin.add("draggable","cursor",{start:function(a,b,c){a=d("body");c=c.options;a.css("cursor")&&(c._cursor=a.css("cursor"));a.css("cursor",
c.cursor)},stop:function(a,b,c){a=c.options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b,c){a=d(b.helper);c=c.options;a.css("opacity")&&(c._opacity=a.css("opacity"));a.css("opacity",c.opacity)},stop:function(a,b,c){a=c.options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(a,b,c){c.scrollParentNotHidden||(c.scrollParentNotHidden=c.helper.scrollParent(!1));c.scrollParentNotHidden[0]!==
c.document[0]&&"HTML"!==c.scrollParentNotHidden[0].tagName&&(c.overflowOffset=c.scrollParentNotHidden.offset())},drag:function(a,b,c){b=c.options;var e=!1,f=c.scrollParentNotHidden[0],g=c.document[0];f!==g&&"HTML"!==f.tagName?(b.axis&&"x"===b.axis||(c.overflowOffset.top+f.offsetHeight-a.pageY<b.scrollSensitivity?f.scrollTop=e=f.scrollTop+b.scrollSpeed:a.pageY-c.overflowOffset.top<b.scrollSensitivity&&(f.scrollTop=e=f.scrollTop-b.scrollSpeed)),b.axis&&"y"===b.axis||(c.overflowOffset.left+f.offsetWidth-
a.pageX<b.scrollSensitivity?f.scrollLeft=e=f.scrollLeft+b.scrollSpeed:a.pageX-c.overflowOffset.left<b.scrollSensitivity&&(f.scrollLeft=e=f.scrollLeft-b.scrollSpeed))):(b.axis&&"x"===b.axis||(a.pageY-d(g).scrollTop()<b.scrollSensitivity?e=d(g).scrollTop(d(g).scrollTop()-b.scrollSpeed):d(window).height()-(a.pageY-d(g).scrollTop())<b.scrollSensitivity&&(e=d(g).scrollTop(d(g).scrollTop()+b.scrollSpeed))),b.axis&&"y"===b.axis||(a.pageX-d(g).scrollLeft()<b.scrollSensitivity?e=d(g).scrollLeft(d(g).scrollLeft()-
b.scrollSpeed):d(window).width()-(a.pageX-d(g).scrollLeft())<b.scrollSensitivity&&(e=d(g).scrollLeft(d(g).scrollLeft()+b.scrollSpeed))));!1!==e&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(c,a)}});d.ui.plugin.add("draggable","snap",{start:function(a,b,c){a=c.options;c.snapElements=[];d(a.snap.constructor!==String?a.snap.items||":data(ui-draggable)":a.snap).each(function(){var a=d(this),b=a.offset();this!==c.element[0]&&c.snapElements.push({item:this,width:a.outerWidth(),height:a.outerHeight(),
top:b.top,left:b.left})})},drag:function(a,b,c){var e,f=c.options,g=f.snapTolerance,h=b.offset.left,k=h+c.helperProportions.width,m=b.offset.top,l=m+c.helperProportions.height;for(e=c.snapElements.length-1;0<=e;e--){var n=c.snapElements[e].left-c.margins.left;var p=n+c.snapElements[e].width;var x=c.snapElements[e].top-c.margins.top;var H=x+c.snapElements[e].height;if(k<n-g||h>p+g||l<x-g||m>H+g||!d.contains(c.snapElements[e].item.ownerDocument,c.snapElements[e].item))c.snapElements[e].snapping&&c.options.snap.release&&
c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[e].item})),c.snapElements[e].snapping=!1;else{if("inner"!==f.snapMode){var q=Math.abs(x-l)<=g;var v=Math.abs(H-m)<=g;var y=Math.abs(n-k)<=g;var r=Math.abs(p-h)<=g;q&&(b.position.top=c._convertPositionTo("relative",{top:x-c.helperProportions.height,left:0}).top);v&&(b.position.top=c._convertPositionTo("relative",{top:H,left:0}).top);y&&(b.position.left=c._convertPositionTo("relative",{top:0,left:n-c.helperProportions.width}).left);
r&&(b.position.left=c._convertPositionTo("relative",{top:0,left:p}).left)}var u=q||v||y||r;"outer"!==f.snapMode&&(q=Math.abs(x-m)<=g,v=Math.abs(H-l)<=g,y=Math.abs(n-h)<=g,r=Math.abs(p-k)<=g,q&&(b.position.top=c._convertPositionTo("relative",{top:x,left:0}).top),v&&(b.position.top=c._convertPositionTo("relative",{top:H-c.helperProportions.height,left:0}).top),y&&(b.position.left=c._convertPositionTo("relative",{top:0,left:n}).left),r&&(b.position.left=c._convertPositionTo("relative",{top:0,left:p-
c.helperProportions.width}).left));!c.snapElements[e].snapping&&(q||v||y||r||u)&&c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[e].item}));c.snapElements[e].snapping=q||v||y||r||u}}}});d.ui.plugin.add("draggable","stack",{start:function(a,b,c){a=d.makeArray(d(c.options.stack)).sort(function(a,b){return(parseInt(d(a).css("zIndex"),10)||0)-(parseInt(d(b).css("zIndex"),10)||0)});if(a.length){var e=parseInt(d(a[0]).css("zIndex"),10)||0;d(a).each(function(a){d(this).css("zIndex",
e+a)});this.css("zIndex",e+a.length)}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b,c){a=d(b.helper);c=c.options;a.css("zIndex")&&(c._zIndex=a.css("zIndex"));a.css("zIndex",c.zIndex)},stop:function(a,b,c){a=c.options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}});d.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var a,
b=this.options,c=b.accept;this.isover=!1;this.isout=!0;this.accept=d.isFunction(c)?c:function(a){return a.is(c)};this.proportions=function(){if(arguments.length)a=arguments[0];else return a?a:a={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}};this._addToManager(b.scope);b.addClasses&&this._addClass("ui-droppable")},_addToManager:function(a){d.ui.ddmanager.droppables[a]=d.ui.ddmanager.droppables[a]||[];d.ui.ddmanager.droppables[a].push(this)},_splice:function(a){for(var b=0;b<
a.length;b++)a[b]===this&&a.splice(b,1)},_destroy:function(){this._splice(d.ui.ddmanager.droppables[this.options.scope])},_setOption:function(a,b){"accept"===a?this.accept=d.isFunction(b)?b:function(a){return a.is(b)}:"scope"===a&&(this._splice(d.ui.ddmanager.droppables[this.options.scope]),this._addToManager(b));this._super(a,b)},_activate:function(a){var b=d.ui.ddmanager.current;this._addActiveClass();b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;
this._removeActiveClass();b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;b&&(b.currentItem||b.element)[0]!==this.element[0]&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this._addHoverClass(),this._trigger("over",a,this.ui(b)))},_out:function(a){var b=d.ui.ddmanager.current;b&&(b.currentItem||b.element)[0]!==this.element[0]&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this._removeHoverClass(),this._trigger("out",a,this.ui(b)))},
_drop:function(a,b){var c=b||d.ui.ddmanager.current,e=!1;if(!c||(c.currentItem||c.element)[0]===this.element[0])return!1;this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var b=d(this).droppable("instance");if(b.options.greedy&&!b.options.disabled&&b.options.scope===c.options.scope&&b.accept.call(b.element[0],c.currentItem||c.element)&&L(c,d.extend(b,{offset:b.element.offset()}),b.options.tolerance,a))return e=!0,!1});return e?!1:this.accept.call(this.element[0],
c.currentItem||c.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",a,this.ui(c)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});
var L=d.ui.intersect=function(){return function(a,b,c,d){if(!b.offset)return!1;var e=(a.positionAbs||a.position.absolute).left+a.margins.left,g=(a.positionAbs||a.position.absolute).top+a.margins.top,h=e+a.helperProportions.width,k=g+a.helperProportions.height,m=b.offset.left,l=b.offset.top,n=m+b.proportions().width,p=l+b.proportions().height;switch(c){case "fit":return m<=e&&h<=n&&l<=g&&k<=p;case "intersect":return m<e+a.helperProportions.width/2&&h-a.helperProportions.width/2<n&&l<g+a.helperProportions.height/
2&&k-a.helperProportions.height/2<p;case "pointer":a=d.pageY;c=b.proportions().height;if(l=a>=l&&a<l+c)d=d.pageX,b=b.proportions().width,l=d>=m&&d<m+b;return l;case "touch":return(g>=l&&g<=p||k>=l&&k<=p||g<l&&k>p)&&(e>=m&&e<=n||h>=m&&h<=n||e<m&&h>n);default:return!1}}}();d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c,e=d.ui.ddmanager.droppables[a.options.scope]||[],f=b?b.type:null,g=(a.currentItem||a.element).find(":data(ui-droppable)").addBack();var h=0;
a:for(;h<e.length;h++)if(!(e[h].options.disabled||a&&!e[h].accept.call(e[h].element[0],a.currentItem||a.element))){for(c=0;c<g.length;c++)if(g[c]===e[h].element[0]){e[h].proportions().height=0;continue a}e[h].visible="none"!==e[h].element.css("display");e[h].visible&&("mousedown"===f&&e[h]._activate.call(e[h],b),e[h].offset=e[h].element.offset(),e[h].proportions({width:e[h].element[0].offsetWidth,height:e[h].element[0].offsetHeight}))}},drop:function(a,b){var c=!1;d.each((d.ui.ddmanager.droppables[a.options.scope]||
[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&L(a,this,this.options.tolerance,b)&&(c=this._drop.call(this,b)||c),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||a.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,b)))});return c},dragStart:function(a,b){a.element.parentsUntil("body").on("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&
d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var c=L(a,this,this.options.tolerance,b);var e=!c&&this.isover?"isout":c&&!this.isover?"isover":null;if(e){if(this.options.greedy){var f=this.options.scope;c=this.element.parents(":data(ui-droppable)").filter(function(){return d(this).droppable("instance").options.scope===f});if(c.length){var g=d(c[0]).droppable("instance");g.greedyChild="isover"===
e}}g&&"isover"===e&&(g.isover=!1,g.isout=!0,g._out.call(g,b));this[e]=!0;this["isout"===e?"isover":"isout"]=!1;this["isover"===e?"_over":"_out"].call(this,b);g&&"isout"===e&&(g.isout=!1,g.isover=!0,g._over.call(g,b))}}})},dragStop:function(a,b){a.element.parentsUntil("body").off("scroll.droppable");a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}};!1!==d.uiBackCompat&&d.widget("ui.droppable",d.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super();
this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super();this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super();this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super();this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});d.widget("ui.resizable",d.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",
options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(a){return parseFloat(a)||0},_isNumber:function(a){return!isNaN(parseFloat(a))},_hasScroll:function(a,b){if("hidden"===d(a).css("overflow"))return!1;b=b&&"left"===
b?"scrollLeft":"scrollTop";if(0<a[b])return!0;a[b]=1;var c=0<a[b];a[b]=0;return c},_create:function(){var a=this.options,b=this;this._addClass("ui-resizable");d.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(d("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),
width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=!0;var c={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(c);this.originalElement.css("margin",
0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(c);this._proportionallyResize()}this._setupHandles();if(a.autoHide)d(this.element).on("mouseenter",function(){a.disabled||(b._removeClass("ui-resizable-autohide"),b._handles.show())}).on("mouseleave",function(){a.disabled||b.resizing||(b._addClass("ui-resizable-autohide"),
b._handles.hide())});this._mouseInit()},_destroy:function(){this._mouseDestroy();var a=function(a){d(a).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){a(this.element);var b=this.element;this.originalElement.css({position:b.css("position"),width:b.outerWidth(),height:b.outerHeight(),top:b.css("top"),left:b.css("left")}).insertAfter(b);b.remove()}this.originalElement.css("resize",this.originalResizeStyle);a(this.originalElement);
return this},_setOption:function(a,b){this._super(a,b);switch(a){case "handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var a=this.options,b,c=this;this.handles=a.handles||(d(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");this._handles=d();if(this.handles.constructor===String){"all"===this.handles&&
(this.handles="n,e,s,w,se,sw,ne,nw");var e=this.handles.split(",");this.handles={};for(b=0;b<e.length;b++){var f=d.trim(e[b]);var g="ui-resizable-"+f;var h=d("<div>");this._addClass(h,"ui-resizable-handle "+g);h.css({zIndex:a.zIndex});this.handles[f]=".ui-resizable-"+f;this.element.append(h)}}this._renderAxis=function(a){var b;a=a||this.element;for(b in this.handles){if(this.handles[b].constructor===String)this.handles[b]=this.element.children(this.handles[b]).first().show();else if(this.handles[b].jquery||
this.handles[b].nodeType)this.handles[b]=d(this.handles[b]),this._on(this.handles[b],{mousedown:c._mouseDown});if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){var e=d(this.handles[b],this.element);var f=/sw|ne|nw|se|n|s/.test(b)?e.outerHeight():e.outerWidth();e=["padding",/ne|nw|n/.test(b)?"Top":/se|sw|s/.test(b)?"Bottom":/^e$/.test(b)?"Right":"Left"].join("");a.css(e,f);this._proportionallyResize()}this._handles=this._handles.add(this.handles[b])}};
this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){c.resizing||(this.className&&(h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),c.axis=h&&h[1]?h[1]:"se")});a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(a){var b,c=!1;for(b in this.handles){var e=d(this.handles[b])[0];
if(e===a.target||d.contains(e,a.target))c=!0}return!this.options.disabled&&c},_mouseStart:function(a){var b=this.options,c=this.element;this.resizing=!0;this._renderProxy();var e=this._num(this.helper.css("left"));var f=this._num(this.helper.css("top"));b.containment&&(e+=d(b.containment).scrollLeft()||0,f+=d(b.containment).scrollTop()||0);this.offset=this.helper.offset();this.position={left:e,top:f};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:c.width(),height:c.height()};
this.originalSize=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()};this.sizeDiff={width:c.outerWidth()-c.width(),height:c.outerHeight()-c.height()};this.originalPosition={left:e,top:f};this.originalMousePosition={left:a.pageX,top:a.pageY};this.aspectRatio="number"===typeof b.aspectRatio?b.aspectRatio:this.originalSize.width/this.originalSize.height||1;e=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor","auto"===e?this.axis+"-resize":e);
this._addClass("ui-resizable-resizing");this._propagate("start",a);return!0},_mouseDrag:function(a){var b=this.originalMousePosition;var c=a.pageX-b.left||0;b=a.pageY-b.top||0;var e=this._change[this.axis];this._updatePrevProperties();if(!e)return!1;c=e.apply(this,[a,c,b]);this._updateVirtualBoundaries(a.shiftKey);if(this._aspectRatio||a.shiftKey)c=this._updateRatio(c,a);c=this._respectSize(c,a);this._updateCache(c);this._propagate("resize",a);c=this._applyChanges();!this._helper&&this._proportionallyResizeElements.length&&
this._proportionallyResize();d.isEmptyObject(c)||(this._updatePrevProperties(),this._trigger("resize",a,this.ui()),this._applyChanges());return!1},_mouseStop:function(a){this.resizing=!1;var b,c=this.options;if(this._helper){var e=this._proportionallyResizeElements;e=(b=e.length&&/textarea/i.test(e[0].nodeName))&&this._hasScroll(e[0],"left")?0:this.sizeDiff.height;b=b?0:this.sizeDiff.width;b={width:this.helper.width()-b,height:this.helper.height()-e};e=parseFloat(this.element.css("left"))+(this.position.left-
this.originalPosition.left)||null;var f=parseFloat(this.element.css("top"))+(this.position.top-this.originalPosition.top)||null;c.animate||this.element.css(d.extend(b,{top:f,left:e}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!c.animate&&this._proportionallyResize()}d("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",a);this._helper&&this.helper.remove();return!1},_updatePrevProperties:function(){this.prevPosition=
{top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var a={};this.position.top!==this.prevPosition.top&&(a.top=this.position.top+"px");this.position.left!==this.prevPosition.left&&(a.left=this.position.left+"px");this.size.width!==this.prevSize.width&&(a.width=this.size.width+"px");this.size.height!==this.prevSize.height&&(a.height=this.size.height+"px");this.helper.css(a);return a},_updateVirtualBoundaries:function(a){var b=
this.options;b={minWidth:this._isNumber(b.minWidth)?b.minWidth:0,maxWidth:this._isNumber(b.maxWidth)?b.maxWidth:Infinity,minHeight:this._isNumber(b.minHeight)?b.minHeight:0,maxHeight:this._isNumber(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a){a=b.minHeight*this.aspectRatio;var c=b.minWidth/this.aspectRatio;var d=b.maxHeight*this.aspectRatio;var f=b.maxWidth/this.aspectRatio;a>b.minWidth&&(b.minWidth=a);c>b.minHeight&&(b.minHeight=c);d<b.maxWidth&&(b.maxWidth=d);f<b.maxHeight&&(b.maxHeight=
f)}this._vBoundaries=b},_updateCache:function(a){this.offset=this.helper.offset();this._isNumber(a.left)&&(this.position.left=a.left);this._isNumber(a.top)&&(this.position.top=a.top);this._isNumber(a.height)&&(this.size.height=a.height);this._isNumber(a.width)&&(this.size.width=a.width)},_updateRatio:function(a){var b=this.position,c=this.size,d=this.axis;this._isNumber(a.height)?a.width=a.height*this.aspectRatio:this._isNumber(a.width)&&(a.height=a.width/this.aspectRatio);"sw"===d&&(a.left=b.left+
(c.width-a.width),a.top=null);"nw"===d&&(a.top=b.top+(c.height-a.height),a.left=b.left+(c.width-a.width));return a},_respectSize:function(a){var b=this._vBoundaries,c=this.axis,d=this._isNumber(a.width)&&b.maxWidth&&b.maxWidth<a.width,f=this._isNumber(a.height)&&b.maxHeight&&b.maxHeight<a.height,g=this._isNumber(a.width)&&b.minWidth&&b.minWidth>a.width,h=this._isNumber(a.height)&&b.minHeight&&b.minHeight>a.height,k=this.originalPosition.left+this.originalSize.width,m=this.originalPosition.top+this.originalSize.height,
l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);g&&(a.width=b.minWidth);h&&(a.height=b.minHeight);d&&(a.width=b.maxWidth);f&&(a.height=b.maxHeight);g&&l&&(a.left=k-b.minWidth);d&&l&&(a.left=k-b.maxWidth);h&&c&&(a.top=m-b.minHeight);f&&c&&(a.top=m-b.maxHeight);a.width||a.height||a.left||!a.top?a.width||a.height||a.top||!a.left||(a.left=null):a.top=null;return a},_getPaddingPlusBorderDimensions:function(a){var b=0,c=[],d=[a.css("borderTopWidth"),a.css("borderRightWidth"),a.css("borderBottomWidth"),a.css("borderLeftWidth")];
for(a=[a.css("paddingTop"),a.css("paddingRight"),a.css("paddingBottom"),a.css("paddingLeft")];4>b;b++)c[b]=parseFloat(d[b])||0,c[b]+=parseFloat(a[b])||0;return{height:c[0]+c[2],width:c[1]+c[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var a,b=0,c=this.helper||this.element;b<this._proportionallyResizeElements.length;b++)a=this._proportionallyResizeElements[b],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(a)),a.css({height:c.height()-
this.outerDimensions.height||0,width:c.width()-this.outerDimensions.width||0})},_renderProxy:function(){var a=this.options;this.elementOffset=this.element.offset();this._helper?(this.helper=this.helper||d("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++a.zIndex}),this.helper.appendTo("body").disableSelection()):
this.helper=this.element},_change:{e:function(a,b){return{width:this.originalSize.width+b}},w:function(a,b){return{left:this.originalPosition.left+b,width:this.originalSize.width-b}},n:function(a,b,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(a,b,c){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[a,b,c]))},sw:function(a,b,c){return d.extend(this._change.s.apply(this,
arguments),this._change.w.apply(this,[a,b,c]))},ne:function(a,b,c){return d.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[a,b,c]))},nw:function(a,b,c){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[a,b,c]))}},_propagate:function(a,b){d.ui.plugin.call(this,a,[b,this.ui()]);"resize"!==a&&this._trigger(a,b,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,
size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});d.ui.plugin.add("resizable","animate",{stop:function(a){var b=d(this).resizable("instance"),c=b.options,e=b._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&b._hasScroll(e[0],"left")?0:b.sizeDiff.height;f={width:b.size.width-(f?0:b.sizeDiff.width),height:b.size.height-g};g=parseFloat(b.element.css("left"))+(b.position.left-b.originalPosition.left)||null;var h=parseFloat(b.element.css("top"))+
(b.position.top-b.originalPosition.top)||null;b.element.animate(d.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var c={width:parseFloat(b.element.css("width")),height:parseFloat(b.element.css("height")),top:parseFloat(b.element.css("top")),left:parseFloat(b.element.css("left"))};e&&e.length&&d(e[0]).css({width:c.width,height:c.height});b._updateCache(c);b._propagate("resize",a)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var a=
d(this).resizable("instance"),b=a.element;var c=a.options.containment;if(b=c instanceof d?c.get(0):/parent/.test(c)?b.parent().get(0):c)if(a.containerElement=d(b),/document/.test(c)||c===document)a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight};else{var e=d(b);var f=[];d(["Top","Right","Left","Bottom"]).each(function(b,c){f[b]=a._num(e.css("padding"+
c))});a.containerOffset=e.offset();a.containerPosition=e.position();a.containerSize={height:e.innerHeight()-f[3],width:e.innerWidth()-f[1]};c=a.containerOffset;var g=a.containerSize.height;var h=a.containerSize.width;h=a._hasScroll(b,"left")?b.scrollWidth:h;g=a._hasScroll(b)?b.scrollHeight:g;a.parentData={element:b,left:c.left,top:c.top,width:h,height:g}}},resize:function(a){var b=d(this).resizable("instance");var c=b.options;var e=b.containerOffset;var f=b.position;a=b._aspectRatio||a.shiftKey;var g=
{top:0,left:0},h=b.containerElement,k=!0;h[0]!==document&&/static/.test(h.css("position"))&&(g=e);f.left<(b._helper?e.left:0)&&(b.size.width+=b._helper?b.position.left-e.left:b.position.left-g.left,a&&(b.size.height=b.size.width/b.aspectRatio,k=!1),b.position.left=c.helper?e.left:0);f.top<(b._helper?e.top:0)&&(b.size.height+=b._helper?b.position.top-e.top:b.position.top,a&&(b.size.width=b.size.height*b.aspectRatio,k=!1),b.position.top=b._helper?e.top:0);c=b.containerElement.get(0)===b.element.parent().get(0);
f=/relative|absolute/.test(b.containerElement.css("position"));c&&f?(b.offset.left=b.parentData.left+b.position.left,b.offset.top=b.parentData.top+b.position.top):(b.offset.left=b.element.offset().left,b.offset.top=b.element.offset().top);c=Math.abs(b.sizeDiff.width+(b._helper?b.offset.left-g.left:b.offset.left-e.left));e=Math.abs(b.sizeDiff.height+(b._helper?b.offset.top-g.top:b.offset.top-e.top));c+b.size.width>=b.parentData.width&&(b.size.width=b.parentData.width-c,a&&(b.size.height=b.size.width/
b.aspectRatio,k=!1));e+b.size.height>=b.parentData.height&&(b.size.height=b.parentData.height-e,a&&(b.size.width=b.size.height*b.aspectRatio,k=!1));k||(b.position.left=b.prevPosition.left,b.position.top=b.prevPosition.top,b.size.width=b.prevSize.width,b.size.height=b.prevSize.height)},stop:function(){var a=d(this).resizable("instance"),b=a.options,c=a.containerOffset,e=a.containerPosition,f=a.containerElement,g=d(a.helper),h=g.offset(),k=g.outerWidth()-a.sizeDiff.width;g=g.outerHeight()-a.sizeDiff.height;
a._helper&&!b.animate&&/relative/.test(f.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:k,height:g});a._helper&&!b.animate&&/static/.test(f.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:k,height:g})}});d.ui.plugin.add("resizable","alsoResize",{start:function(){var a=d(this).resizable("instance").options;d(a.alsoResize).each(function(){var a=d(this);a.data("ui-resizable-alsoresize",{width:parseFloat(a.width()),height:parseFloat(a.height()),left:parseFloat(a.css("left")),
top:parseFloat(a.css("top"))})})},resize:function(a,b){a=d(this).resizable("instance");var c=a.originalSize,e=a.originalPosition,f={height:a.size.height-c.height||0,width:a.size.width-c.width||0,top:a.position.top-e.top||0,left:a.position.left-e.left||0};d(a.options.alsoResize).each(function(){var a=d(this),c=d(this).data("ui-resizable-alsoresize"),e={},m=a.parents(b.originalElement[0]).length?["width","height"]:["width","height","top","left"];d.each(m,function(a,b){(a=(c[b]||0)+(f[b]||0))&&0<=a&&
(e[b]=a||null)});a.css(e)})},stop:function(){d(this).removeData("ui-resizable-alsoresize")}});d.ui.plugin.add("resizable","ghost",{start:function(){var a=d(this).resizable("instance"),b=a.size;a.ghost=a.originalElement.clone();a.ghost.css({opacity:.25,display:"block",position:"relative",height:b.height,width:b.width,margin:0,left:0,top:0});a._addClass(a.ghost,"ui-resizable-ghost");!1!==d.uiBackCompat&&"string"===typeof a.options.ghost&&a.ghost.addClass(this.options.ghost);a.ghost.appendTo(a.helper)},
resize:function(){var a=d(this).resizable("instance");a.ghost&&a.ghost.css({position:"relative",height:a.size.height,width:a.size.width})},stop:function(){var a=d(this).resizable("instance");a.ghost&&a.helper&&a.helper.get(0).removeChild(a.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var a=d(this).resizable("instance"),b=a.options,c=a.size,e=a.originalSize,f=a.originalPosition,g=a.axis,h="number"===typeof b.grid?[b.grid,b.grid]:b.grid,k=h[0]||1,m=h[1]||1,l=Math.round((c.width-
e.width)/k)*k;c=Math.round((c.height-e.height)/m)*m;var n=e.width+l,p=e.height+c,x=b.maxWidth&&b.maxWidth<n,H=b.maxHeight&&b.maxHeight<p,q=b.minWidth&&b.minWidth>n,v=b.minHeight&&b.minHeight>p;b.grid=h;q&&(n+=k);v&&(p+=m);x&&(n-=k);H&&(p-=m);if(/^(se|s|e)$/.test(g))a.size.width=n,a.size.height=p;else if(/^(ne)$/.test(g))a.size.width=n,a.size.height=p,a.position.top=f.top-c;else if(/^(sw)$/.test(g))a.size.width=n,a.size.height=p,a.position.left=f.left-l;else{if(0>=p-m||0>=n-k)var y=a._getPaddingPlusBorderDimensions(this);
0<p-m?(a.size.height=p,a.position.top=f.top-c):(p=m-y.height,a.size.height=p,a.position.top=f.top+e.height-p);0<n-k?(a.size.width=n,a.position.left=f.left-l):(n=k-y.width,a.size.width=n,a.position.left=f.left+e.width-n)}}});d.widget("ui.selectable",d.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var a=this;this._addClass("ui-selectable");
this.dragged=!1;this.refresh=function(){a.elementPos=d(a.element[0]).offset();a.selectees=d(a.options.filter,a.element[0]);a._addClass(a.selectees,"ui-selectee");a.selectees.each(function(){var b=d(this),c=b.offset(),e=c.left-a.elementPos.left;c=c.top-a.elementPos.top;d.data(this,"selectable-item",{element:this,$element:b,left:e,top:c,right:e+b.outerWidth(),bottom:c+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})};
this.refresh();this._mouseInit();this.helper=d("<div>");this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item");this._mouseDestroy()},_mouseStart:function(a){var b=this,c=this.options;this.opos=[a.pageX,a.pageY];this.elementPos=d(this.element[0]).offset();this.options.disabled||(this.selectees=d(c.filter,this.element[0]),this._trigger("start",a),d(c.appendTo).append(this.helper),this.helper.css({left:a.pageX,top:a.pageY,width:0,height:0}),
c.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var c=d.data(this,"selectable-item");c.startselected=!0;a.metaKey||a.ctrlKey||(b._removeClass(c.$element,"ui-selected"),c.selected=!1,b._addClass(c.$element,"ui-unselecting"),c.unselecting=!0,b._trigger("unselecting",a,{unselecting:c.element}))}),d(a.target).parents().addBack().each(function(){var c=d.data(this,"selectable-item");if(c){var f=!a.metaKey&&!a.ctrlKey||!c.$element.hasClass("ui-selected");b._removeClass(c.$element,
f?"ui-unselecting":"ui-selected")._addClass(c.$element,f?"ui-selecting":"ui-unselecting");c.unselecting=!f;c.selecting=f;(c.selected=f)?b._trigger("selecting",a,{selecting:c.element}):b._trigger("unselecting",a,{unselecting:c.element});return!1}}))},_mouseDrag:function(a){this.dragged=!0;if(!this.options.disabled){var b=this,c=this.options,e=this.opos[0],f=this.opos[1],g=a.pageX,h=a.pageY;if(e>g){var k=g;g=e;e=k}f>h&&(k=h,h=f,f=k);this.helper.css({left:e,top:f,width:g-e,height:h-f});this.selectees.each(function(){var k=
d.data(this,"selectable-item"),l=!1;if(k&&k.element!==b.element[0]){var n=k.left+b.elementPos.left;var p=k.right+b.elementPos.left;var x=k.top+b.elementPos.top;var q=k.bottom+b.elementPos.top;"touch"===c.tolerance?l=!(n>g||p<e||x>h||q<f):"fit"===c.tolerance&&(l=n>e&&p<g&&x>f&&q<h);l?(k.selected&&(b._removeClass(k.$element,"ui-selected"),k.selected=!1),k.unselecting&&(b._removeClass(k.$element,"ui-unselecting"),k.unselecting=!1),k.selecting||(b._addClass(k.$element,"ui-selecting"),k.selecting=!0,b._trigger("selecting",
a,{selecting:k.element}))):(k.selecting&&((a.metaKey||a.ctrlKey)&&k.startselected?(b._removeClass(k.$element,"ui-selecting"),k.selecting=!1,b._addClass(k.$element,"ui-selected"),k.selected=!0):(b._removeClass(k.$element,"ui-selecting"),k.selecting=!1,k.startselected&&(b._addClass(k.$element,"ui-unselecting"),k.unselecting=!0),b._trigger("unselecting",a,{unselecting:k.element}))),!k.selected||a.metaKey||a.ctrlKey||k.startselected||(b._removeClass(k.$element,"ui-selected"),k.selected=!1,b._addClass(k.$element,
"ui-unselecting"),k.unselecting=!0,b._trigger("unselecting",a,{unselecting:k.element})))}});return!1}},_mouseStop:function(a){var b=this;this.dragged=!1;d(".ui-unselecting",this.element[0]).each(function(){var c=d.data(this,"selectable-item");b._removeClass(c.$element,"ui-unselecting");c.unselecting=!1;c.startselected=!1;b._trigger("unselected",a,{unselected:c.element})});d(".ui-selecting",this.element[0]).each(function(){var c=d.data(this,"selectable-item");b._removeClass(c.$element,"ui-selecting")._addClass(c.$element,
"ui-selected");c.selecting=!1;c.selected=!0;c.startselected=!0;b._trigger("selected",a,{selected:c.element})});this._trigger("stop",a);this.helper.remove();return!1}});d.widget("ui.sortable",d.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,
scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(a,b,c){return a>=b&&a<b+c},_isFloating:function(a){return/left|right/.test(a.css("float"))||/inline|table-cell/.test(a.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();
this._setHandleClassName();this.ready=!0},_setOption:function(a,b){this._super(a,b);"handle"===a&&this._setHandleClassName()},_setHandleClassName:function(){var a=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");d.each(this.items,function(){a._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var a=this.items.length-1;0<=a;a--)this.items[a].item.removeData(this.widgetName+
"-item");return this},_mouseCapture:function(a,b){var c=null,e=!1,f=this;if(this.reverting||this.options.disabled||"static"===this.options.type)return!1;this._refreshItems(a);d(a.target).parents().each(function(){if(d.data(this,f.widgetName+"-item")===f)return c=d(this),!1});d.data(a.target,f.widgetName+"-item")===f&&(c=d(a.target));if(!c||this.options.handle&&!b&&(d(this.options.handle,c).find("*").addBack().each(function(){this===a.target&&(e=!0)}),!e))return!1;this.currentItem=c;this._removeCurrentsFromItems();
return!0},_mouseStart:function(a,b,c){b=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!==this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor&&"auto"!==b.cursor){var e=this.document.find("body");
this.storedCursor=e.css("cursor");e.css("cursor",b.cursor);this.storedStylesheet=d("<style>*{ cursor: "+b.cursor+" !important; }</style>").appendTo(e)}b.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",b.opacity));b.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",b.zIndex));this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset());
this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;0<=c;c--)this.containers[c]._trigger("activate",a,this._uiHash(this));d.ui.ddmanager&&(d.ui.ddmanager.current=this);d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=!0;this._addClass(this.helper,"ui-sortable-helper");this._mouseDrag(a);return!0},_mouseDrag:function(a){var b;var c=this.options;var e=!1;this.position=this._generatePosition(a);
this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=e=this.scrollParent[0].scrollTop+c.scrollSpeed:a.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=e=this.scrollParent[0].scrollTop-c.scrollSpeed),
this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft+c.scrollSpeed:a.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(a.pageY-this.document.scrollTop()<c.scrollSensitivity?e=this.document.scrollTop(this.document.scrollTop()-c.scrollSpeed):this.window.height()-(a.pageY-this.document.scrollTop())<c.scrollSensitivity&&
(e=this.document.scrollTop(this.document.scrollTop()+c.scrollSpeed)),a.pageX-this.document.scrollLeft()<c.scrollSensitivity?e=this.document.scrollLeft(this.document.scrollLeft()-c.scrollSpeed):this.window.width()-(a.pageX-this.document.scrollLeft())<c.scrollSensitivity&&(e=this.document.scrollLeft(this.document.scrollLeft()+c.scrollSpeed))),!1!==e&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a));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");for(c=this.items.length-1;0<=c;c--){e=this.items[c];var f=e.item[0];if((b=this._intersectsWithPointer(e))&&e.instance===this.currentContainer&&f!==this.currentItem[0]&&this.placeholder[1===b?"next":"prev"]()[0]!==f&&!d.contains(this.placeholder[0],f)&&("semi-dynamic"===this.options.type?!d.contains(this.element[0],f):1)){this.direction=
1===b?"down":"up";if("pointer"===this.options.tolerance||this._intersectsWithSides(e))this._rearrange(a,e);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=this.placeholder.offset();var e=this.options.axis,
f={};e&&"x"!==e||(f.left=b.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft));e&&"y"!==e||(f.top=b.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop));this.reverting=!0;d(this.helper).animate(f,parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new d.Event("mouseup",
{target:null}));"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var a=this.containers.length-1;0<=a;a--)this.containers[a]._trigger("deactivate",null,this._uiHash(this)),this.containers[a].containerCache.over&&(this.containers[a]._trigger("out",null,this._uiHash(this)),this.containers[a].containerCache.over=0)}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(),d.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var b=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[\-=_](.+)/);b&&c.push((a.key||
b[1]+"[]")+"="+(a.key&&a.expression?b[1]:b[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,f=d+this.helperProportions.height,g=a.left,h=g+a.width,k=a.top,m=k+a.height,l=this.offset.click.top,n=this.offset.click.left;
l="x"===this.options.axis||d+l>k&&d+l<m;n="y"===this.options.axis||b+n>g&&b+n<h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l&&n:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&k<d+this.helperProportions.height/2&&f-this.helperProportions.height/2<m},_intersectsWithPointer:function(a){var b="x"===this.options.axis||
this._isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);if(!b||!a)return!1;b=this._getDragVerticalDirection();a=this._getDragHorizontalDirection();return this.floating?"right"===a||"down"===b?2:1:b&&("down"===b?2:1)},_intersectsWithSides:function(a){var b=this._isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=this._isOverAxis(this.positionAbs.left+
this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),d=this._getDragHorizontalDirection();return this.floating&&d?"right"===d&&a||"left"===d&&!a:c&&("down"===c&&b||"up"===c&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return 0!==a&&(0<a?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return 0!==a&&(0<a?"right":"left")},refresh:function(a){this._refreshItems(a);
this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor===String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){function b(){f.push(this)}var c,e,f=[],g=[],h=this._connectWith();if(h&&a)for(a=h.length-1;0<=a;a--){var k=d(h[a],this.document[0]);for(c=k.length-1;0<=c;c--)(e=d.data(k[c],this.widgetFullName))&&e!==this&&!e.options.disabled&&g.push([d.isFunction(e.options.items)?e.options.items.call(e.element):
d(e.options.items,e.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),e])}g.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=g.length-1;0<=a;a--)g[a][0].each(b);return d(f)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=d.grep(this.items,
function(b){for(var c=0;c<a.length;c++)if(a[c]===b.item[0])return!1;return!0})},_refreshItems:function(a){this.items=[];this.containers=[this];var b,c,e,f,g=this.items,h=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]];if((f=this._connectWith())&&this.ready)for(b=f.length-1;0<=b;b--){var k=d(f[b],this.document[0]);for(c=k.length-1;0<=c;c--)(e=d.data(k[c],this.widgetFullName))&&e!==this&&!e.options.disabled&&
(h.push([d.isFunction(e.options.items)?e.options.items.call(e.element[0],a,{item:this.currentItem}):d(e.options.items,e.element),e]),this.containers.push(e))}for(b=h.length-1;0<=b;b--)for(a=h[b][1],k=h[b][0],c=0,f=k.length;c<f;c++)e=d(k[c]),e.data(this.widgetName+"-item",a),g.push({item:e,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(a){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1;this.offsetParent&&this.helper&&(this.offset.parent=
this._getParentOffset());var b;for(b=this.items.length-1;0<=b;b--){var c=this.items[b];if(c.instance===this.currentContainer||!this.currentContainer||c.item[0]===this.currentItem[0]){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;a||(c.width=e.outerWidth(),c.height=e.outerHeight());e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-
1;0<=b;b--)e=this.containers[b].element.offset(),this.containers[b].containerCache.left=e.left,this.containers[b].containerCache.top=e.top,this.containers[b].containerCache.width=this.containers[b].element.outerWidth(),this.containers[b].containerCache.height=this.containers[b].element.outerHeight();return this},_createPlaceholder:function(a){a=a||this;var b=a.options;if(!b.placeholder||b.placeholder.constructor===String){var c=b.placeholder;b.placeholder={element:function(){var b=a.currentItem[0].nodeName.toLowerCase(),
f=d("<"+b+">",a.document[0]);a._addClass(f,"ui-sortable-placeholder",c||a.currentItem[0].className)._removeClass(f,"ui-sortable-helper");"tbody"===b?a._createTrPlaceholder(a.currentItem.find("tr").eq(0),d("<tr>",a.document[0]).appendTo(f)):"tr"===b?a._createTrPlaceholder(a.currentItem,f):"img"===b&&f.attr("src",a.currentItem.attr("src"));c||f.css("visibility","hidden");return f},update:function(d,f){if(!c||b.forcePlaceholderSize)f.height()||f.height(a.currentItem.innerHeight()-parseInt(a.currentItem.css("paddingTop")||
0,10)-parseInt(a.currentItem.css("paddingBottom")||0,10)),f.width()||f.width(a.currentItem.innerWidth()-parseInt(a.currentItem.css("paddingLeft")||0,10)-parseInt(a.currentItem.css("paddingRight")||0,10))}}}a.placeholder=d(b.placeholder.element.call(a.element,a.currentItem));a.currentItem.after(a.placeholder);b.placeholder.update(a,a.placeholder)},_createTrPlaceholder:function(a,b){var c=this;a.children().each(function(){d("<td> </td>",c.document[0]).attr("colspan",d(this).attr("colspan")||1).appendTo(b)})},
_contactContainers:function(a){var b,c,e,f=e=null;for(b=this.containers.length-1;0<=b;b--)d.contains(this.currentItem[0],this.containers[b].element[0])||(this._intersectsWith(this.containers[b].containerCache)?e&&d.contains(this.containers[b].element[0],e.element[0])||(e=this.containers[b],f=b):this.containers[b].containerCache.over&&(this.containers[b]._trigger("out",a,this._uiHash(this)),this.containers[b].containerCache.over=0));if(e)if(1===this.containers.length)this.containers[f].containerCache.over||
(this.containers[f]._trigger("over",a,this._uiHash(this)),this.containers[f].containerCache.over=1);else{b=1E4;var g=null;e=(c=e.floating||this._isFloating(this.currentItem))?"left":"top";var h=c?"width":"height";var k=c?"pageX":"pageY";for(c=this.items.length-1;0<=c;c--)if(d.contains(this.containers[f].element[0],this.items[c].item[0])&&this.items[c].item[0]!==this.currentItem[0]){var m=this.items[c].item.offset()[e];var l=!1;a[k]-m>this.items[c][h]/2&&(l=!0);Math.abs(a[k]-m)<b&&(b=Math.abs(a[k]-
m),g=this.items[c],this.direction=l?"up":"down")}if(g||this.options.dropOnEmpty)this.currentContainer===this.containers[f]?this.currentContainer.containerCache.over||(this.containers[f]._trigger("over",a,this._uiHash()),this.currentContainer.containerCache.over=1):(g?this._rearrange(a,g,null,!0):this._rearrange(a,null,this.containers[f].element,!0),this._trigger("change",a,this._uiHash()),this.containers[f]._trigger("change",a,this._uiHash(this)),this.currentContainer=this.containers[f],this.options.placeholder.update(this.currentContainer,
this.placeholder),this.containers[f]._trigger("over",a,this._uiHash(this)),this.containers[f].containerCache.over=1)}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):"clone"===b.helper?this.currentItem.clone():this.currentItem;a.parents("body").length||d("parent"!==b.appendTo?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);a[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,
height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")});a[0].style.width&&!b.forceHelperSize||a.width(this.currentItem.width());a[0].style.height&&!b.forceHelperSize||a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){"string"===typeof a&&(a=a.split(" "));d.isArray(a)&&(a={left:+a[0],top:+a[1]||0});"left"in a&&(this.offset.click.left=a.left+this.margins.left);"right"in a&&(this.offset.click.left=
this.helperProportions.width-a.right+this.margins.left);"top"in a&&(this.offset.click.top=a.top+this.margins.top);"bottom"in a&&(this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&d.contains(this.scrollParent[0],this.offsetParent[0])&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop());
if(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&d.ui.ie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-
(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;"parent"===a.containment&&(a.containment=this.helper[0].parentNode);if("document"===
a.containment||"window"===a.containment)this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===a.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===a.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=
d(a.containment)[0];a=d(a.containment).offset();var c="hidden"!==d(b).css("overflow");this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-
this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){b||(b=this.position);a="absolute"===a?1:-1;var c="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&d.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(c[0].tagName);
return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a,left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a}},_generatePosition:function(a){var b=this.options;var c=a.pageX;var e=a.pageY;var f="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&d.contains(this.scrollParent[0],this.offsetParent[0])?
this.scrollParent:this.offsetParent,g=/(html|body)/i.test(f[0].tagName);"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());this.originalPosition&&(this.containment&&(a.pageX-this.offset.click.left<this.containment[0]&&(c=this.containment[0]+this.offset.click.left),a.pageY-this.offset.click.top<this.containment[1]&&(e=this.containment[1]+this.offset.click.top),a.pageX-this.offset.click.left>
this.containment[2]&&(c=this.containment[2]+this.offset.click.left),a.pageY-this.offset.click.top>this.containment[3]&&(e=this.containment[3]+this.offset.click.top)),b.grid&&(e=this.originalPageY+Math.round((e-this.originalPageY)/b.grid[1])*b.grid[1],e=this.containment?e-this.offset.click.top>=this.containment[1]&&e-this.offset.click.top<=this.containment[3]?e:e-this.offset.click.top>=this.containment[1]?e-b.grid[1]:e+b.grid[1]:e,c=this.originalPageX+Math.round((c-this.originalPageX)/b.grid[0])*b.grid[0],
c=this.containment?c-this.offset.click.left>=this.containment[0]&&c-this.offset.click.left<=this.containment[2]?c:c-this.offset.click.left>=this.containment[0]?c-b.grid[0]:c+b.grid[0]:c));return{top:e-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():g?0:f.scrollTop()),left:c-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())}},
_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?b.item[0]:b.item[0].nextSibling);var e=this.counter=this.counter?++this.counter:1;this._delay(function(){e===this.counter&&this.refreshPositions(!d)})},_clear:function(a,b){function c(a,b,c){return function(d){c._trigger(a,d,b._uiHash(b))}}this.reverting=!1;var d,f=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);
this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(d in this._storedCSS)if("auto"===this._storedCSS[d]||"static"===this._storedCSS[d])this._storedCSS[d]="";this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&f.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))});!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===
this.currentItem.parent()[0]||b||f.push(function(a){this._trigger("update",a,this._uiHash())});this===this.currentContainer||b||(f.push(function(a){this._trigger("remove",a,this._uiHash())}),f.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.currentContainer)),f.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.currentContainer)));for(d=this.containers.length-1;0<=d;d--)b||f.push(c("deactivate",this,this.containers[d])),
this.containers[d].containerCache.over&&(f.push(c("out",this,this.containers[d])),this.containers[d].containerCache.over=0);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;b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null);if(!b){for(d=0;d<f.length;d++)f[d].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=!1;return!this.cancelHelperRemoval},_trigger:function(){!1===d.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,
item:b.currentItem,sender:a?a.element:null}}});d.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",
paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var a=this.options;this.prevShow=this.prevHide=d();this._addClass("ui-accordion","ui-widget ui-helper-reset");this.element.attr("role","tablist");a.collapsible||!1!==a.active&&null!=a.active||(a.active=0);this._processPanels();0>a.active&&(a.active+=this.headers.length);this._refresh()},_getCreateEventData:function(){return{header:this.active,
panel:this.active.length?this.active.next():d()}},_createIcons:function(){var a=this.options.icons;if(a){var b=d("<span>");this._addClass(b,"ui-accordion-header-icon","ui-icon "+a.header);b.prependTo(this.headers);b=this.active.children(".ui-accordion-header-icon");this._removeClass(b,a.header)._addClass(b,null,a.activeHeader)._addClass(this.headers,"ui-accordion-icons")}},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons");this.headers.children(".ui-accordion-header-icon").remove()},
_destroy:function(){this.element.removeAttr("role");this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId();this._destroyIcons();var a=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId();"content"!==this.options.heightStyle&&a.css("height","")},_setOption:function(a,b){"active"===a?this._activate(b):("event"===a&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(b)),this._super(a,
b),"collapsible"!==a||b||!1!==this.options.active||this._activate(0),"icons"===a&&(this._destroyIcons(),b&&this._createIcons()))},_setOptionDisabled:function(a){this._super(a);this.element.attr("aria-disabled",a);this._toggleClass(null,"ui-state-disabled",!!a);this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!a)},_keydown:function(a){if(!a.altKey&&!a.ctrlKey){var b=d.ui.keyCode,c=this.headers.length,e=this.headers.index(a.target),f=!1;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=
this.headers[(e+1)%c];break;case b.LEFT:case b.UP:f=this.headers[(e-1+c)%c];break;case b.SPACE:case b.ENTER:this._eventHandler(a);break;case b.HOME:f=this.headers[0];break;case b.END:f=this.headers[c-1]}f&&(d(a.target).attr("tabIndex",-1),d(f).attr("tabIndex",0),d(f).trigger("focus"),a.preventDefault())}},_panelKeyDown:function(a){a.keyCode===d.ui.keyCode.UP&&a.ctrlKey&&d(a.currentTarget).prev().trigger("focus")},refresh:function(){var a=this.options;this._processPanels();!1===a.active&&!0===a.collapsible||
!this.headers.length?(a.active=!1,this.active=d()):!1===a.active?this._activate(0):this.active.length&&!d.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(a.active=!1,this.active=d()):this._activate(Math.max(0,a.active-1)):a.active=this.headers.index(this.active);this._destroyIcons();this._refresh()},_processPanels:function(){var a=this.headers,b=this.panels;this.headers=this.element.find(this.options.header);this._addClass(this.headers,
"ui-accordion-header ui-accordion-header-collapsed","ui-state-default");this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide();this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content");b&&(this._off(a.not(this.headers)),this._off(b.not(this.panels)))},_refresh:function(){var a=this.options,b=a.heightStyle,c=this.element.parent();this.active=this._findActive(a.active);this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,
"ui-accordion-header-collapsed");this._addClass(this.active.next(),"ui-accordion-content-active");this.active.next().show();this.headers.attr("role","tab").each(function(){var a=d(this),b=a.uniqueId().attr("id"),c=a.next(),e=c.uniqueId().attr("id");a.attr("aria-controls",e);c.attr("aria-labelledby",b)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();this.active.length?this.active.attr({"aria-selected":"true",
"aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0);this._createIcons();this._setupEvents(a.event);if("fill"===b){var e=c.height();this.element.siblings(":visible").each(function(){var a=d(this),b=a.css("position");"absolute"!==b&&"fixed"!==b&&(e-=a.outerHeight(!0))});this.headers.each(function(){e-=d(this).outerHeight(!0)});this.headers.next().each(function(){d(this).height(Math.max(0,e-d(this).innerHeight()+d(this).height()))}).css("overflow",
"auto")}else"auto"===b&&(e=0,this.headers.next().each(function(){var a=d(this).is(":visible");a||d(this).show();e=Math.max(e,d(this).css("height","").height());a||d(this).hide()}).height(e))},_activate:function(a){a=this._findActive(a)[0];a!==this.active[0]&&(a=a||this.active[0],this._eventHandler({target:a,currentTarget:a,preventDefault:d.noop}))},_findActive:function(a){return"number"===typeof a?this.headers.eq(a):d()},_setupEvents:function(a){var b={keydown:"_keydown"};a&&d.each(a.split(" "),function(a,
d){b[d]="_eventHandler"});this._off(this.headers.add(this.headers.next()));this._on(this.headers,b);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers)},_eventHandler:function(a){var b,c=this.options,e=this.active,f=d(a.currentTarget),g=(b=f[0]===e[0])&&c.collapsible,h=g?d():f.next(),k=e.next();h={oldHeader:e,oldPanel:k,newHeader:g?d():f,newPanel:h};a.preventDefault();b&&!c.collapsible||!1===this._trigger("beforeActivate",a,h)||(c.active=
g?!1:this.headers.index(f),this.active=b?d():f,this._toggle(h),this._removeClass(e,"ui-accordion-header-active","ui-state-active"),c.icons&&(a=e.children(".ui-accordion-header-icon"),this._removeClass(a,null,c.icons.activeHeader)._addClass(a,null,c.icons.header)),b||(this._removeClass(f,"ui-accordion-header-collapsed")._addClass(f,"ui-accordion-header-active","ui-state-active"),c.icons&&(b=f.children(".ui-accordion-header-icon"),this._removeClass(b,null,c.icons.header)._addClass(b,null,c.icons.activeHeader)),
this._addClass(f.next(),"ui-accordion-content-active")))},_toggle:function(a){var b=a.newPanel,c=this.prevShow.length?this.prevShow:a.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0);this.prevShow=b;this.prevHide=c;this.options.animate?this._animate(b,c,a):(c.hide(),b.show(),this._toggleComplete(a));c.attr({"aria-hidden":"true"});c.prev().attr({"aria-selected":"false","aria-expanded":"false"});b.length&&c.length?c.prev().attr({tabIndex:-1,"aria-expanded":"false"}):b.length&&this.headers.filter(function(){return 0===
parseInt(d(this).attr("tabIndex"),10)}).attr("tabIndex",-1);b.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(a,b,c){var d,f,g=this,h=0,k=a.css("box-sizing"),m=a.length&&(!b.length||a.index()<b.index()),l=this.options.animate||{};m=m&&l.down||l;var n=function(){g._toggleComplete(c)};"number"===typeof m&&(f=m);"string"===typeof m&&(d=m);d=d||m.easing||l.easing;f=f||m.duration||l.duration;if(!b.length)return a.animate(this.showProps,
f,d,n);if(!a.length)return b.animate(this.hideProps,f,d,n);var p=a.show().outerHeight();b.animate(this.hideProps,{duration:f,easing:d,step:function(a,b){b.now=Math.round(a)}});a.hide().animate(this.showProps,{duration:f,easing:d,complete:n,step:function(a,c){c.now=Math.round(a);"height"!==c.prop?"content-box"===k&&(h+=c.now):"content"!==g.options.heightStyle&&(c.now=Math.round(p-b.outerHeight()-h),h=0)}})},_toggleComplete:function(a){var b=a.oldPanel,c=b.prev();this._removeClass(b,"ui-accordion-content-active");
this._removeClass(c,"ui-accordion-header-active")._addClass(c,"ui-accordion-header-collapsed");b.length&&(b.parent()[0].className=b.parent()[0].className);this._trigger("activate",null,a)}});d.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=!1;this.element.uniqueId().attr({role:this.options.role,
tabIndex:0});this._addClass("ui-menu","ui-widget ui-widget-content");this._on({"mousedown .ui-menu-item":function(a){a.preventDefault()},"click .ui-menu-item":function(a){var b=d(a.target),c=d(d.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&b.not(".ui-state-disabled").length&&(this.select(a),a.isPropagationStopped()||(this.mouseHandled=!0),b.has(".ui-menu").length?this.expand(a):!this.element.is(":focus")&&c.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&
1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(a){if(!this.previousFilter){var b=d(a.target).closest(".ui-menu-item"),c=d(a.currentTarget);b[0]===c[0]&&(this._removeClass(c.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(a,c))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(a,b){var c=this.active||this.element.find(this.options.items).eq(0);b||this.focus(a,c)},blur:function(a){this._delay(function(){d.contains(this.element[0],
d.ui.safeActiveElement(this.document[0]))||this.collapseAll(a)})},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(a){this._closeOnDocumentClick(a)&&this.collapseAll(a);this.mouseHandled=!1}})},_destroy:function(){var a=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show();
a.children().each(function(){var a=d(this);a.data("ui-menu-submenu-caret")&&a.remove()})},_keydown:function(a){var b=!0;switch(a.keyCode){case d.ui.keyCode.PAGE_UP:this.previousPage(a);break;case d.ui.keyCode.PAGE_DOWN:this.nextPage(a);break;case d.ui.keyCode.HOME:this._move("first","first",a);break;case d.ui.keyCode.END:this._move("last","last",a);break;case d.ui.keyCode.UP:this.previous(a);break;case d.ui.keyCode.DOWN:this.next(a);break;case d.ui.keyCode.LEFT:this.collapse(a);break;case d.ui.keyCode.RIGHT:this.active&&
!this.active.is(".ui-state-disabled")&&this.expand(a);break;case d.ui.keyCode.ENTER:case d.ui.keyCode.SPACE:this._activate(a);break;case d.ui.keyCode.ESCAPE:this.collapse(a);break;default:b=!1;var c=this.previousFilter||"";var e=!1;var f=96<=a.keyCode&&105>=a.keyCode?(a.keyCode-96).toString():String.fromCharCode(a.keyCode);clearTimeout(this.filterTimer);f===c?e=!0:f=c+f;c=this._filterMenuItems(f);c=e&&-1!==c.index(this.active.next())?this.active.nextAll(".ui-menu-item"):c;c.length||(f=String.fromCharCode(a.keyCode),
c=this._filterMenuItems(f));c.length?(this.focus(a,c),this.previousFilter=f,this.filterTimer=this._delay(function(){delete this.previousFilter},1E3)):delete this.previousFilter}b&&a.preventDefault()},_activate:function(a){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(a):this.select(a))},refresh:function(){var a=this,b=this.options.icons.submenu;var c=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,
!!this.element.find(".ui-icon").length);var e=c.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var c=d(this),e=c.prev(),f=d("<span>").data("ui-menu-submenu-caret",!0);a._addClass(f,"ui-menu-icon","ui-icon "+b);e.attr("aria-haspopup","true").prepend(f);c.attr("aria-labelledby",e.attr("id"))});this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front");e=c.add(this.element).find(this.options.items);e.not(".ui-menu-item").each(function(){var b=
d(this);a._isDivider(b)&&a._addClass(b,"ui-menu-divider","ui-widget-content")});c=e.not(".ui-menu-item, .ui-menu-divider");var f=c.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()});this._addClass(c,"ui-menu-item")._addClass(f,"ui-menu-item-wrapper");e.filter(".ui-state-disabled").attr("aria-disabled","true");this.active&&!d.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(a,
b){if("icons"===a){var c=this.element.find(".ui-menu-icon");this._removeClass(c,null,this.options.icons.submenu)._addClass(c,null,b.submenu)}this._super(a,b)},_setOptionDisabled:function(a){this._super(a);this.element.attr("aria-disabled",String(a));this._toggleClass(null,"ui-state-disabled",!!a)},focus:function(a,b){this.blur(a,a&&"focus"===a.type);this._scrollIntoView(b);this.active=b.first();var c=this.active.children(".ui-menu-item-wrapper");this._addClass(c,null,"ui-state-active");this.options.role&&
this.element.attr("aria-activedescendant",c.attr("id"));c=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper");this._addClass(c,null,"ui-state-active");a&&"keydown"===a.type?this._close():this.timer=this._delay(function(){this._close()},this.delay);c=b.children(".ui-menu");c.length&&a&&/^mouse/.test(a.type)&&this._startOpening(c);this.activeMenu=b.parent();this._trigger("focus",a,{item:b})},_scrollIntoView:function(a){if(this._hasScroll()){var b=parseFloat(d.css(this.activeMenu[0],
"borderTopWidth"))||0;var c=parseFloat(d.css(this.activeMenu[0],"paddingTop"))||0;b=a.offset().top-this.activeMenu.offset().top-b-c;c=this.activeMenu.scrollTop();var e=this.activeMenu.height();a=a.outerHeight();0>b?this.activeMenu.scrollTop(c+b):b+a>e&&this.activeMenu.scrollTop(c+b-e+a)}},blur:function(a,b){b||clearTimeout(this.timer);this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",a,{item:this.active}),this.active=null)},
_startOpening:function(a){clearTimeout(this.timer);"true"===a.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close();this._open(a)},this.delay))},_open:function(a){var b=d.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(a.parents(".ui-menu")).hide().attr("aria-hidden","true");a.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(b)},collapseAll:function(a,b){clearTimeout(this.timer);this.timer=this._delay(function(){var c=
b?this.element:d(a&&a.target).closest(this.element.find(".ui-menu"));c.length||(c=this.element);this._close(c);this.blur(a);this._removeClass(c.find(".ui-state-active"),null,"ui-state-active");this.activeMenu=c},this.delay)},_close:function(a){a||(a=this.active?this.active.parent():this.element);a.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(a){return!d(a.target).closest(".ui-menu").length},_isDivider:function(a){return!/[^\-\u2014\u2013\s]/.test(a.text())},
collapse:function(a){var b=this.active&&this.active.parent().closest(".ui-menu-item",this.element);b&&b.length&&(this._close(),this.focus(a,b))},expand:function(a){var b=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();b&&b.length&&(this._open(b.parent()),this._delay(function(){this.focus(a,b)}))},next:function(a){this._move("next","first",a)},previous:function(a){this._move("prev","last",a)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},
isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(a,b,c){var d;this.active&&(d="first"===a||"last"===a?this.active["first"===a?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[a+"All"](".ui-menu-item").eq(0));d&&d.length&&this.active||(d=this.activeMenu.find(this.options.items)[b]());this.focus(c,d)},nextPage:function(a){var b;if(!this.active)this.next(a);else if(!this.isLastItem())if(this._hasScroll()){var c=this.active.offset().top;var e=
this.element.height();this.active.nextAll(".ui-menu-item").each(function(){b=d(this);return 0>b.offset().top-c-e});this.focus(a,b)}else this.focus(a,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())},previousPage:function(a){var b;if(!this.active)this.next(a);else if(!this.isFirstItem())if(this._hasScroll()){var c=this.active.offset().top;var e=this.element.height();this.active.prevAll(".ui-menu-item").each(function(){b=d(this);return 0<b.offset().top-c+e});this.focus(a,b)}else this.focus(a,
this.activeMenu.find(this.options.items).first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(a){this.active=this.active||d(a.target).closest(".ui-menu-item");var b={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(a,!0);this._trigger("select",a,b)},_filterMenuItems:function(a){a=a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");var b=new RegExp("^"+a,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return b.test(d.trim(d(this).children(".ui-menu-item-wrapper").text()))})}});
d.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var a,b,c,e=this.element[0].nodeName.toLowerCase(),f="textarea"===e;e="input"===e;this.isMultiLine=f||!e&&this._isContentEditable(this.element);this.valueMethod=this.element[f||
e?"val":"text"];this.isNewMenu=!0;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly"))b=c=a=!0;else{b=c=a=!1;var f=d.ui.keyCode;switch(e.keyCode){case f.PAGE_UP:a=!0;this._move("previousPage",e);break;case f.PAGE_DOWN:a=!0;this._move("nextPage",e);break;case f.UP:a=!0;this._keyEvent("previous",e);break;case f.DOWN:a=!0;this._keyEvent("next",e);break;case f.ENTER:this.menu.active&&(a=!0,e.preventDefault(),
this.menu.select(e));break;case f.TAB:this.menu.active&&this.menu.select(e);break;case f.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(e),e.preventDefault());break;default:b=!0,this._searchTimeout(e)}}},keypress:function(c){if(a)a=!1,this.isMultiLine&&!this.menu.element.is(":visible")||c.preventDefault();else if(!b){var e=d.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:this._move("previousPage",c);break;case e.PAGE_DOWN:this._move("nextPage",c);break;
case e.UP:this._keyEvent("previous",c);break;case e.DOWN:this._keyEvent("next",c)}}},input:function(a){c?(c=!1,a.preventDefault()):this._searchTimeout(a)},focus:function(){this.selectedItem=null;this.previous=this._value()},blur:function(a){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(a),this._change(a))}});this._initSource();this.menu=d("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance");this._addClass(this.menu.element,"ui-autocomplete",
"ui-front");this._on(this.menu.element,{mousedown:function(a){a.preventDefault();this.cancelBlur=!0;this._delay(function(){delete this.cancelBlur;this.element[0]!==d.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(a,b){if(this.isNewMenu&&(this.isNewMenu=!1,a.originalEvent&&/^mouse/.test(a.originalEvent.type))){this.menu.blur();this.document.one("mousemove",function(){d(a.target).trigger(a.originalEvent)});return}var c=b.item.data("ui-autocomplete-item");
!1!==this._trigger("focus",a,{item:c})&&a.originalEvent&&/^key/.test(a.originalEvent.type)&&this._value(c.value);(b=b.item.attr("aria-label")||c.value)&&d.trim(b).length&&(this.liveRegion.children().hide(),d("<div>").text(b).appendTo(this.liveRegion))},menuselect:function(a,b){var c=b.item.data("ui-autocomplete-item"),e=this.previous;this.element[0]!==d.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e;this.selectedItem=c}));
!1!==this._trigger("select",a,{item:c})&&this._value(c.value);this.term=this._value();this.close(a);this.selectedItem=c}});this.liveRegion=d("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();
this.liveRegion.remove()},_setOption:function(a,b){this._super(a,b);"source"===a&&this._initSource();"appendTo"===a&&this.menu.element.appendTo(this._appendTo());"disabled"===a&&b&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(a){var b=this.menu.element[0];return a.target===this.element[0]||a.target===b||d.contains(b,a.target)},_closeOnClickOutside:function(a){this._isEventTargetInWidget(a)||this.close()},_appendTo:function(){var a=this.options.appendTo;a&&(a=a.jquery||a.nodeType?d(a):
this.document.find(a).eq(0));a&&a[0]||(a=this.element.closest(".ui-front, dialog"));a.length||(a=this.document[0].body);return a},_initSource:function(){var a=this;if(d.isArray(this.options.source)){var b=this.options.source;this.source=function(a,c){c(d.ui.autocomplete.filter(b,a.term))}}else if("string"===typeof this.options.source){var c=this.options.source;this.source=function(b,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:c,data:b,dataType:"json",success:function(a){f(a)},error:function(){f([])}})}}else this.source=
this.options.source},_searchTimeout:function(a){clearTimeout(this.searching);this.searching=this._delay(function(){var b=this.term===this._value(),c=this.menu.element.is(":visible"),d=a.altKey||a.ctrlKey||a.metaKey||a.shiftKey;if(!b||b&&!c&&!d)this.selectedItem=null,this.search(null,a)},this.options.delay)},search:function(a,b){a=null!=a?a:this._value();this.term=this._value();if(a.length<this.options.minLength)return this.close(b);if(!1!==this._trigger("search",b))return this._search(a)},_search:function(a){this.pending++;
this._addClass("ui-autocomplete-loading");this.cancelSearch=!1;this.source({term:a},this._response())},_response:function(){var a=++this.requestIndex;return d.proxy(function(b){a===this.requestIndex&&this.__response(b);this.pending--;this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(a){a&&(a=this._normalize(a));this._trigger("response",null,{content:a});!this.options.disabled&&a&&a.length&&!this.cancelSearch?(this._suggest(a),this._trigger("open")):this._close()},
close:function(a){this.cancelSearch=!0;this._close(a)},_close:function(a){this._off(this.document,"mousedown");this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",a))},_change:function(a){this.previous!==this._value()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].value?a:d.map(a,function(a){return"string"===typeof a?{label:a,value:a}:d.extend({},a,{label:a.label||a.value,
value:a.value||a.label})})},_suggest:function(a){var b=this.menu.element.empty();this._renderMenu(b,a);this.isNewMenu=!0;this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next();this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(a,b){var c=this;d.each(b,
function(b,d){c._renderItemData(a,d)})},_renderItemData:function(a,b){return this._renderItem(a,b).data("ui-autocomplete-item",b)},_renderItem:function(a,b){return d("<li>").append(d("<div>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.isFirstItem()&&/^previous/.test(a)||this.menu.isLastItem()&&/^next/.test(a))this.isMultiLine||this._value(this.term),this.menu.blur();else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element},
_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()},_isContentEditable:function(a){if(!a.length)return!1;var b=a.prop("contentEditable");return"inherit"===b?this._isContentEditable(a.parent()):"true"===b}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(a,b){var c=new RegExp(d.ui.autocomplete.escapeRegex(b),
"i");return d.grep(a,function(a){return c.test(a.label||a.value||a)})}});d.widget("ui.autocomplete",d.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(a){return a+(1<a?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(a){this._superApply(arguments);if(!this.options.disabled&&!this.cancelSearch){var b=a&&a.length?this.options.messages.results(a.length):this.options.messages.noResults;this.liveRegion.children().hide();
d("<div>").text(b).appendTo(this.liveRegion)}}});var V=/ui-corner-([a-z]){2,6}/g;d.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role",
"toolbar");this.refresh()},_destroy:function(){this._callChildMethod("destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var a=this,b=[];d.each(this.options.items,function(c,e){var f={};e&&("controlgroupLabel"===c?(e=a.element.find(e),e.each(function(){var a=d(this);a.children(".ui-controlgroup-label-contents").length||
a.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),a._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),b=b.concat(e.get())):d.fn[c]&&(f=a["_"+c+"Options"]?a["_"+c+"Options"]("middle"):{classes:{}},a.element.find(e).each(function(){var e=d(this),h=e[c]("instance"),k=d.widget.extend({},f);"button"===c&&e.parent(".ui-spinner").length||(h||(h=e[c]()[c]("instance")),h&&(k.classes=a._resolveClassesValues(k.classes,h)),e[c](k),k=e[c]("widget"),d.data(k[0],"ui-controlgroup-data",
h?h:e[c]("instance")),b.push(k[0]))})))});this.childWidgets=d(d.unique(b));this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(a){this.childWidgets.each(function(){var b=d(this).data("ui-controlgroup-data");if(b&&b[a])b[a]()})},_updateCornerClass:function(a,b){b=this._buildSimpleOptions(b,"label").classes.label;this._removeClass(a,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all");this._addClass(a,null,b)},_buildSimpleOptions:function(a,
b){var c="vertical"===this.options.direction,d={classes:{}};d.classes[b]={middle:"",first:"ui-corner-"+(c?"top":"left"),last:"ui-corner-"+(c?"bottom":"right"),only:"ui-corner-all"}[a];return d},_spinnerOptions:function(a){a=this._buildSimpleOptions(a,"ui-spinner");a.classes["ui-spinner-up"]="";a.classes["ui-spinner-down"]="";return a},_buttonOptions:function(a){return this._buildSimpleOptions(a,"ui-button")},_checkboxradioOptions:function(a){return this._buildSimpleOptions(a,"ui-checkboxradio-label")},
_selectmenuOptions:function(a){var b="vertical"===this.options.direction;return{width:b?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(b?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(b?"top":"left")},last:{"ui-selectmenu-button-open":b?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(b?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[a]}},
_resolveClassesValues:function(a,b){var c={};d.each(a,function(e){var f=b.options.classes[e]||"";f=d.trim(f.replace(V,""));c[e]=(f+" "+a[e]).replace(/\s+/g," ")});return c},_setOption:function(a,b){"direction"===a&&this._removeClass("ui-controlgroup-"+this.options.direction);this._super(a,b);"disabled"===a?this._callChildMethod(b?"disable":"enable"):this.refresh()},refresh:function(){var a=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);"horizontal"===this.options.direction&&
this._addClass(null,"ui-helper-clearfix");this._initWidgets();var b=this.childWidgets;this.options.onlyVisible&&(b=b.filter(":visible"));b.length&&(d.each(["first","last"],function(c,d){(c=b[d]().data("ui-controlgroup-data"))&&a["_"+c.widgetName+"Options"]?(d=a["_"+c.widgetName+"Options"](1===b.length?"only":d),d.classes=a._resolveClassesValues(d.classes,c),c.element[c.widgetName](d)):a._updateCornerClass(b[d](),d)}),this._callChildMethod("refresh"))}});d.widget("ui.checkboxradio",[d.ui.formResetMixin,
{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var a=this,b=this._super()||{};this._readType();var c=this.element.labels();this.label=d(c[c.length-1]);this.label.length||d.error("No label found for checkboxradio widget");this.originalLabel="";this.label.contents().not(this.element[0]).each(function(){a.originalLabel+=3===this.nodeType?d(this).text():this.outerHTML});
this.originalLabel&&(b.label=this.originalLabel);c=this.element[0].disabled;null!=c&&(b.disabled=c);return b},_create:function(){var a=this.element[0].checked;this._bindFormResetHandler();null==this.options.disabled&&(this.options.disabled=this.element[0].disabled);this._setOption("disabled",this.options.disabled);this._addClass("ui-checkboxradio","ui-helper-hidden-accessible");this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget");"radio"===this.type&&this._addClass(this.label,
"ui-checkboxradio-radio-label");this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel);this._enhance();a&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover"));this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},
_readType:function(){var a=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type;"input"===a&&/radio|checkbox/.test(this.type)||d.error("Can't create checkboxradio on element.nodeName="+a+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var a=this.element[0].name,b="input[name='"+d.ui.escapeSelector(a)+"']";return a?(this.form.length?d(this.form[0].elements).filter(b):d(b).filter(function(){return 0===
d(this).form().length})).not(this.element):d([])},_toggleClasses:function(){var a=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",a);this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",a)._toggleClass(this.icon,null,"ui-icon-blank",!a);"radio"===this.type&&this._getRadioGroup().each(function(){var a=d(this).checkboxradio("instance");a&&a._removeClass(a.label,"ui-checkboxradio-checked","ui-state-active")})},
_destroy:function(){this._unbindFormResetHandler();this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(a,b){if("label"!==a||b)this._super(a,b),"disabled"===a?(this._toggleClass(this.label,null,"ui-state-disabled",b),this.element[0].disabled=b):this.refresh()},_updateIcon:function(a){var b="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=d("<span>"),this.iconSpace=d("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===
this.type?(b+=a?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,a?"ui-icon-blank":"ui-icon-check")):b+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",b),a||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var a=this.label.contents().not(this.element[0]);this.icon&&(a=a.not(this.icon[0]));
this.iconSpace&&(a=a.not(this.iconSpace[0]));a.remove();this.label.append(this.options.label)},refresh:function(){var a=this.element[0].checked,b=this.element[0].disabled;this._updateIcon(a);this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",a);null!==this.options.label&&this._updateLabel();b!==this.options.disabled&&this._setOptions({disabled:b})}}]);d.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,
icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var a=this._super()||{};this.isInput=this.element.is("input");var b=this.element[0].disabled;null!=b&&(a.disabled=b);if(this.originalLabel=this.isInput?this.element.val():this.element.html())a.label=this.originalLabel;return a},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0);null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1);this.hasTitle=
!!this.element.attr("title");this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label));this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();this.element.is("a")&&this._on({keyup:function(a){a.keyCode===d.ui.keyCode.SPACE&&(a.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||
this.element.attr("role","button");this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title");this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(a,b){var c=(a="iconPosition"!==a)?this.options.iconPosition:b,e="top"===c||"bottom"===c;this.icon?a&&this._removeClass(this.icon,null,this.options.icon):(this.icon=d("<span>"),this._addClass(this.icon,"ui-button-icon",
"ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only"));a&&this._addClass(this.icon,null,b);this._attachIcon(c);e?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=d("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(c))},_destroy:function(){this.element.removeAttr("role");this.icon&&this.icon.remove();
this.iconSpace&&this.iconSpace.remove();this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(a){this.icon[/^(?:end|bottom)/.test(a)?"before":"after"](this.iconSpace)},_attachIcon:function(a){this.element[/^(?:end|bottom)/.test(a)?"append":"prepend"](this.icon)},_setOptions:function(a){var b=void 0===a.icon?this.options.icon:a.icon;(void 0===a.showLabel?this.options.showLabel:a.showLabel)||b||(a.showLabel=!0);this._super(a)},_setOption:function(a,b){"icon"===a&&(b?this._updateIcon(a,
b):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove()));"iconPosition"===a&&this._updateIcon(a,b);"showLabel"===a&&(this._toggleClass("ui-button-icon-only",null,!b),this._updateTooltip());"label"===a&&(this.isInput?this.element.val(b):(this.element.html(b),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition))));this._super(a,b);"disabled"===a&&(this._toggleClass(null,"ui-state-disabled",b),(this.element[0].disabled=b)&&this.element.blur())},
refresh:function(){var a=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");a!==this.options.disabled&&this._setOptions({disabled:a});this._updateTooltip()}});!1!==d.uiBackCompat&&(d.widget("ui.button",d.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text);!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel);
this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end");this._super()},_setOption:function(a,b){"text"===a?this._super("showLabel",b):("showLabel"===a&&(this.options.text=b),"icon"===a&&(this.options.icons.primary=b),"icons"===a&&(b.primary?(this._super("icon",
b.primary),this._super("iconPosition","beginning")):b.secondary&&(this._super("icon",b.secondary),this._super("iconPosition","end"))),this._superApply(arguments))}}),d.fn.button=function(a){return function(){if(!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type"))return a.apply(this,arguments);d.ui.checkboxradio||d.error("Checkboxradio widget missing");return 0===arguments.length?this.checkboxradio({icon:!1}):
this.checkboxradio.apply(this,arguments)}}(d.fn.button),d.fn.buttonset=function(){d.ui.controlgroup||d.error("Controlgroup widget missing");if("option"===arguments[0]&&"items"===arguments[1]&&arguments[2])return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]);if("option"===arguments[0]&&"items"===arguments[1])return this.controlgroup.apply(this,[arguments[0],"items.button"]);"object"===typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items});
return this.controlgroup.apply(this,arguments)});d.extend(d.ui,{datepicker:{version:"1.12.1"}});var I;d.extend(t.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){F(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=a.nodeName.toLowerCase();var e="div"===c||"span"===c;a.id||(this.uuid+=1,a.id="dp"+this.uuid);var f=this._newInst(d(a),e);f.settings=d.extend({},b||{});"input"===c?this._connectDatepicker(a,
f):e&&this._inlineDatepicker(a,f)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?w(d("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).on("keydown",
this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(b),d.data(a,"datepicker",b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText");var e=this._get(b,"isRTL");b.append&&b.append.remove();c&&(b.append=d("<span class='"+this._appendClass+"'>"+c+"</span>"),a[e?"before":"after"](b.append));a.off("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if("focus"===c||"both"===c)a.on("focus",
this._showDatepicker);if("button"===c||"both"===c){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d("<button type='button'></button>").addClass(this._triggerClass).html(f?d("<img/>").attr({src:f,alt:c,title:c}):c));a[e?"before":"after"](b.trigger);b.trigger.on("click",function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput===a[0]?d.datepicker._hideDatepicker():
(d.datepicker._datepickerShowing&&d.datepicker._lastInput!==a[0]&&d.datepicker._hideDatepicker(),d.datepicker._showDatepicker(a[0]));return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b,c,d,f=new Date(2009,11,20),g=this._get(a,"dateFormat");if(g.match(/[DM]/)){var h=function(a){for(d=c=b=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};f.setMonth(h(this._get(a,g.match(/MM/)?"monthNames":"monthNamesShort")));f.setDate(h(this._get(a,g.match(/DD/)?"dayNames":"dayNamesShort"))+
20-f.getDay())}a.input.attr("size",this._formatDate(a,f).length)}},_inlineDatepicker:function(a,b){var c=d(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv),d.data(a,"datepicker",b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;a||(this.uuid+=1,a="dp"+this.uuid,this._dialogInput=
d("<input type='text' id='"+a+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),d("body").append(this._dialogInput),a=this._dialogInst=this._newInst(this._dialogInput,!1),a.settings={},d.data(this._dialogInput[0],"datepicker",a));F(a.settings,e||{});b=b&&b.constructor===Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos){b=document.documentElement.clientWidth;e=document.documentElement.clientHeight;
f=document.documentElement.scrollLeft||document.body.scrollLeft;var g=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[b/2-100+f,e/2-150+g]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=!0;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,
"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");"input"===e?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||b.removeClass(this.markerClassName).empty();I===c&&(I=null)}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=
a.nodeName.toLowerCase();if("input"===e)a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"===e||"span"===e)e=b.children("."+this._inlineClass),e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1);this._disabledInputs=d.map(this._disabledInputs,function(b){return b===a?null:b})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");
if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if("input"===e)a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"===e||"span"===e)e=b.children("."+this._inlineClass),e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0);this._disabledInputs=d.map(this._disabledInputs,function(b){return b===a?null:b});this._disabledInputs[this._disabledInputs.length]=
a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]===a)return!0;return!1},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(2===arguments.length&&"string"===typeof b)return"defaults"===b?d.extend({},d.datepicker._defaults):e?"all"===b?d.extend({},e.settings):this._get(e,b):null;var f=b||{};"string"===
typeof b&&(f={},f[b]=c);if(e){this._curInst===e&&this._hideDatepicker();var g=this._getDateDatepicker(a,!0);var h=this._getMinMaxDate(e,"min");var k=this._getMinMaxDate(e,"max");F(e.settings,f);null!==h&&void 0!==f.dateFormat&&void 0===f.minDate&&(e.settings.minDate=this._formatDate(e,h));null!==k&&void 0!==f.dateFormat&&void 0===f.maxDate&&(e.settings.maxDate=this._formatDate(e,k));"disabled"in f&&(f.disabled?this._disableDatepicker(a):this._enableDatepicker(a));this._attachments(d(a),e);this._autoSize(e);
this._setDate(e,g);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a))this._setDate(a,b),this._updateDatepicker(a),this._updateAlternate(a)},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target);
var c=!0;var e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=!1;break;case 13:return c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv),c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]),(a=d.datepicker._get(b,"onSelect"))?(c=d.datepicker._formatDate(b),a.apply(b.input?b.input[0]:null,[c,b])):d.datepicker._hideDatepicker(),!1;case 27:d.datepicker._hideDatepicker();
break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,
e?1:-1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,e?-1:1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,
"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,7,"D");c=a.ctrlKey||a.metaKey;break;default:c=!1}else 36===a.keyCode&&a.ctrlKey?d.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(null==a.charCode?a.keyCode:a.charCode);return a.ctrlKey||
a.metaKey||" ">c||!b||-1<b.indexOf(c)}},_doKeyUp:function(a){var b;a=d.datepicker._getInst(a.target);if(a.input.val()!==a.lastVal)try{if(b=d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a)))d.datepicker._setDateFromField(a),d.datepicker._updateAlternate(a),d.datepicker._updateDatepicker(a)}catch(c){}return!0},_showDatepicker:function(a){a=a.target||a;"input"!==a.nodeName.toLowerCase()&&(a=d("input",a.parentNode)[0]);if(!d.datepicker._isDisabledDatepicker(a)&&
d.datepicker._lastInput!==a){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!==b&&(d.datepicker._curInst.dpDiv.stop(!0,!0),b&&d.datepicker._datepickerShowing&&d.datepicker._hideDatepicker(d.datepicker._curInst.input[0]));var c=(c=d.datepicker._get(b,"beforeShow"))?c.apply(a,[a,b]):{};if(!1!==c){F(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);d.datepicker._inDialog&&(a.value="");d.datepicker._pos||(d.datepicker._pos=d.datepicker._findPos(a),
d.datepicker._pos[1]+=a.offsetHeight);var e=!1;d(a).parents().each(function(){e|="fixed"===d(this).css("position");return!e});c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=
d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration");b.dpDiv.css("z-index",q(d(a))+1);d.datepicker._datepickerShowing=!0;if(d.effects&&d.effects.effect[c])b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f);else b.dpDiv[c||"show"](c?f:null);d.datepicker._shouldFocusInput(b)&&b.input.trigger("focus");d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;I=a;a.dpDiv.empty().append(this._generateHTML(a));this._attachHandlers(a);var b=this._getNumberOfMonths(a),c=
b[1],e=a.dpDiv.find("."+this._dayOverClass+" a");0<e.length&&C.apply(e.get(0));a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");1<c&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(1!==b[0]||1!==b[1]?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a===d.datepicker._curInst&&d.datepicker._datepickerShowing&&d.datepicker._shouldFocusInput(a)&&a.input.trigger("focus");
if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_shouldFocusInput:function(a){return a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&!a.input.is(":focus")},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),g=a.input?a.input.outerWidth():0,h=a.input?a.input.outerHeight():0,k=document.documentElement.clientWidth+(c?0:d(document).scrollLeft()),
m=document.documentElement.clientHeight+(c?0:d(document).scrollTop());b.left-=this._get(a,"isRTL")?e-g:0;b.left-=c&&b.left===a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top===a.input.offset().top+h?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>k&&k>e?Math.abs(b.left+e-k):0);b.top-=Math.min(b.top,b.top+f>m&&m>f?Math.abs(f+h):0);return b},_findPos:function(a){var b=this._getInst(a);for(b=this._get(b,"isRTL");a&&("hidden"===a.type||1!==a.nodeType||d.expr.filters.hidden(a));)a=
a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(b&&(!a||b===d.data(a,"datepicker"))&&this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration");var e=function(){d.datepicker._tidyDialog(b)};if(d.effects&&(d.effects.effect[a]||d.effects[a]))b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e);else b.dpDiv["slideDown"===a?"slideUp":"fadeIn"===a?"fadeOut":"hide"](a?c:null,e);a||e();this._datepickerShowing=
!1;(a=this._get(b,"onClose"))&&a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._lastInput=null;this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),d.blockUI&&(d.unblockUI(),d("body").append(this.dpDiv)));this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);var b=d.datepicker._getInst(a[0]);(!(a[0].id===d.datepicker._mainDivId||
0!==a.parents("#"+d.datepicker._mainDivId).length||a.hasClass(d.datepicker.markerClassName)||a.closest("."+d.datepicker._triggerClass).length||!d.datepicker._datepickerShowing||d.datepicker._inDialog&&d.blockUI)||a.hasClass(d.datepicker.markerClassName)&&d.datepicker._curInst!==b)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);this._isDisabledDatepicker(a[0])||(this._adjustInstDate(e,b+("M"===c?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},
_gotoToday:function(a){var b=d(a),c=this._getInst(b[0]);this._get(c,"gotoCurrent")&&c.currentDay?(c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear):(a=new Date,c.selectedDay=a.getDate(),c.drawMonth=c.selectedMonth=a.getMonth(),c.drawYear=c.selectedYear=a.getFullYear());this._notifyChange(c);this._adjustDate(b)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+("M"===c?"Month":"Year")]=e["draw"+("M"===c?"Month":
"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0])||(f=this._getInst(f[0]),f.selectedDay=f.currentDay=d("a",e).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(a){a=d(a);this._selectDate(a,"")},_selectDate:function(a,
b){a=d(a);var c=this._getInst(a[0]);b=null!=b?b:this._formatDate(c);c.input&&c.input.val(b);this._updateAlternate(c);(a=this._get(c,"onSelect"))?a.apply(c.input?c.input[0]:null,[b,c]):c.input&&c.input.trigger("change");c.inline?this._updateDatepicker(c):(this._hideDatepicker(),this._lastInput=c.input[0],"object"!==typeof c.input[0]&&c.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat");
var e=this._getDate(a);a=this.formatDate(c,e,this._getFormatConfig(a));d(b).val(a)}},noWeekends:function(a){a=a.getDay();return[0<a&&6>a,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));a=b.getTime();b.setMonth(0);b.setDate(1);return Math.floor(Math.round((a-b)/864E5)/7)+1},parseDate:function(a,b,c){if(null==a||null==b)throw"Invalid arguments";b="object"===typeof b?b.toString():b+"";if(""===b)return null;var e,f=0;var g=(c?c.shortYearCutoff:null)||
this._defaults.shortYearCutoff;g="string"!==typeof g?g:(new Date).getFullYear()%100+parseInt(g,10);var h=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort;var k=(c?c.dayNames:null)||this._defaults.dayNames,m=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,l=(c?c.monthNames:null)||this._defaults.monthNames,n=c=-1,p=-1,x=-1,q=!1,t=function(b){(b=e+1<a.length&&a.charAt(e+1)===b)&&e++;return b},v=function(a){var c=t(a);c="@"===a?14:"!"===a?20:"y"===a&&c?4:"o"===a?3:2;a=new RegExp("^\\d{"+
("y"===a?c:1)+","+c+"}");a=b.substring(f).match(a);if(!a)throw"Missing number at position "+f;f+=a[0].length;return parseInt(a[0],10)},y=function(a,c,e){var g=-1;a=d.map(t(a)?e:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)});d.each(a,function(a,c){a=c[1];if(b.substr(f,a.length).toLowerCase()===a.toLowerCase())return g=c[0],f+=a.length,!1});if(-1!==g)return g+1;throw"Unknown name at position "+f;},r=function(){if(b.charAt(f)!==a.charAt(e))throw"Unexpected literal at position "+
f;f++};for(e=0;e<a.length;e++)if(q)"'"!==a.charAt(e)||t("'")?r():q=!1;else switch(a.charAt(e)){case "d":p=v("d");break;case "D":y("D",h,k);break;case "o":x=v("o");break;case "m":n=v("m");break;case "M":n=y("M",m,l);break;case "y":c=v("y");break;case "@":var u=new Date(v("@"));c=u.getFullYear();n=u.getMonth()+1;p=u.getDate();break;case "!":u=new Date((v("!")-this._ticksTo1970)/1E4);c=u.getFullYear();n=u.getMonth()+1;p=u.getDate();break;case "'":t("'")?r():q=!0;break;default:r()}if(f<b.length&&(h=b.substr(f),
!/^\s+/.test(h)))throw"Extra/unparsed characters found in date: "+h;-1===c?c=(new Date).getFullYear():100>c&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=g?0:-100));if(-1<x){n=1;p=x;do{g=this._getDaysInMonth(c,n-1);if(p<=g)break;n++;p-=g}while(1)}u=this._daylightSavingAdjust(new Date(c,n-1,p));if(u.getFullYear()!==c||u.getMonth()+1!==n||u.getDate()!==p)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",
RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:62135596800*1E7,formatDate:function(a,b,c){if(!b)return"";var d,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,g=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var k=function(b){(b=d+1<a.length&&a.charAt(d+1)===b)&&d++;return b},m=function(a,b,c){b=""+b;if(k(a))for(;b.length<
c;)b="0"+b;return b},l=function(a,b,c,d){return k(a)?d[b]:c[b]},n="",p=!1;if(b)for(d=0;d<a.length;d++)if(p)"'"!==a.charAt(d)||k("'")?n+=a.charAt(d):p=!1;else switch(a.charAt(d)){case "d":n+=m("d",b.getDate(),2);break;case "D":n+=l("D",b.getDay(),f,g);break;case "o":n+=m("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":n+=m("m",b.getMonth()+1,2);break;case "M":n+=l("M",b.getMonth(),h,c);break;case "y":n+=
k("y")?b.getFullYear():(10>b.getFullYear()%100?"0":"")+b.getFullYear()%100;break;case "@":n+=b.getTime();break;case "!":n+=1E4*b.getTime()+this._ticksTo1970;break;case "'":k("'")?n+="'":p=!0;break;default:n+=a.charAt(d)}return n},_possibleChars:function(a){var b,c="",d=!1,f=function(c){(c=b+1<a.length&&a.charAt(b+1)===c)&&b++;return c};for(b=0;b<a.length;b++)if(d)"'"!==a.charAt(b)||f("'")?c+=a.charAt(b):d=!1;else switch(a.charAt(b)){case "d":case "m":case "y":case "@":c+="0123456789";break;case "D":case "M":return null;
case "'":f("'")?c+="'":d=!0;break;default:c+=a.charAt(b)}return c},_get:function(a,b){return void 0!==a.settings[b]?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!==a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,f=this._getDefaultDate(a),g=f,h=this._getFormatConfig(a);try{g=this.parseDate(c,d,h)||f}catch(k){d=b?"":d}a.selectedDay=g.getDate();a.drawMonth=a.selectedMonth=g.getMonth();a.drawYear=a.selectedYear=g.getFullYear();a.currentDay=
d?g.getDate():0;a.currentMonth=d?g.getMonth():0;a.currentYear=d?g.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},f=function(b){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),b,d.datepicker._getFormatConfig(a))}catch(p){}var c=(b.toLowerCase().match(/^c/)?d.datepicker._getDate(a):
null)||new Date,e=c.getFullYear(),f=c.getMonth();c=c.getDate();for(var g=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,n=g.exec(b);n;){switch(n[2]||"d"){case "d":case "D":c+=parseInt(n[1],10);break;case "w":case "W":c+=7*parseInt(n[1],10);break;case "m":case "M":f+=parseInt(n[1],10);c=Math.min(c,d.datepicker._getDaysInMonth(e,f));break;case "y":case "Y":e+=parseInt(n[1],10),c=Math.min(c,d.datepicker._getDaysInMonth(e,f))}n=g.exec(b)}return new Date(e,f,c)};if(b=(b=null==b||""===b?c:"string"===typeof b?f(b):
"number"===typeof b?isNaN(b)?c:e(b):new Date(b.getTime()))&&"Invalid Date"===b.toString()?c:b)b.setHours(0),b.setMinutes(0),b.setSeconds(0),b.setMilliseconds(0);return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(12<a.getHours()?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,f=a.selectedMonth,g=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=
a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();f===a.selectedMonth&&g===a.selectedYear||c||this._notifyChange(a);this._adjustInstDate(a);a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&""===a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_attachHandlers:function(a){var b=this._get(a,"stepMonths"),c="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){d(this).on(this.getAttribute("data-event"),
{prev:function(){d.datepicker._adjustDate(c,-b,"M")},next:function(){d.datepicker._adjustDate(c,+b,"M")},hide:function(){d.datepicker._hideDatepicker()},today:function(){d.datepicker._gotoToday(c)},selectDay:function(){d.datepicker._selectDay(c,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return!1},selectMonth:function(){d.datepicker._selectMonthYear(c,this,"M");return!1},selectYear:function(){d.datepicker._selectMonthYear(c,this,"Y");return!1}}[this.getAttribute("data-handler")])})},
_generateHTML:function(a){var b,c,d,f,g=new Date;g=this._daylightSavingAdjust(new Date(g.getFullYear(),g.getMonth(),g.getDate()));var h=this._get(a,"isRTL");var k=this._get(a,"showButtonPanel");var m=this._get(a,"hideIfNoPrevNext");var l=this._get(a,"navigationAsDateFormat");var n=this._getNumberOfMonths(a),p=this._get(a,"showCurrentAtPos");var q=this._get(a,"stepMonths");var t=1!==n[0]||1!==n[1],w=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,
9,9)),v=this._getMinMaxDate(a,"min"),y=this._getMinMaxDate(a,"max");p=a.drawMonth-p;var r=a.drawYear;0>p&&(p+=12,r--);if(y){var u=this._daylightSavingAdjust(new Date(y.getFullYear(),y.getMonth()-n[0]*n[1]+1,y.getDate()));for(u=v&&u<v?v:u;this._daylightSavingAdjust(new Date(r,p,1))>u;)p--,0>p&&(p=11,r--)}a.drawMonth=p;a.drawYear=r;u=this._get(a,"prevText");u=l?this.formatDate(u,this._daylightSavingAdjust(new Date(r,p-q,1)),this._getFormatConfig(a)):u;u=this._canAdjustMonth(a,-1,r,p)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+
u+"'><span class='ui-icon ui-icon-circle-triangle-"+(h?"e":"w")+"'>"+u+"</span></a>":m?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+u+"'><span class='ui-icon ui-icon-circle-triangle-"+(h?"e":"w")+"'>"+u+"</span></a>";var A=this._get(a,"nextText");A=l?this.formatDate(A,this._daylightSavingAdjust(new Date(r,p+q,1)),this._getFormatConfig(a)):A;m=this._canAdjustMonth(a,1,r,p)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+A+"'><span class='ui-icon ui-icon-circle-triangle-"+
(h?"w":"e")+"'>"+A+"</span></a>":m?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+A+"'><span class='ui-icon ui-icon-circle-triangle-"+(h?"w":"e")+"'>"+A+"</span></a>";q=this._get(a,"currentText");A=this._get(a,"gotoCurrent")&&a.currentDay?w:g;q=l?this.formatDate(q,A,this._getFormatConfig(a)):q;l=a.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(a,"closeText")+
"</button>";k=k?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(h?l:"")+(this._isInRange(a,A)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+q+"</button>":"")+(h?"":l)+"</div>":"";l=parseInt(this._get(a,"firstDay"),10);l=isNaN(l)?0:l;q=this._get(a,"showWeek");A=this._get(a,"dayNames");var C=this._get(a,"dayNamesMin");var F=this._get(a,"monthNames");var I=this._get(a,"monthNamesShort");
var G=this._get(a,"beforeShowDay");var J=this._get(a,"showOtherMonths");var L=this._get(a,"selectOtherMonths");var K=this._getDefaultDate(a);var Q="";for(b=0;b<n[0];b++){var R="";this.maxRows=4;for(c=0;c<n[1];c++){var S=this._daylightSavingAdjust(new Date(r,p,a.selectedDay));var B=" ui-corner-all";var D="";if(t){D+="<div class='ui-datepicker-group";if(1<n[1])switch(c){case 0:D+=" ui-datepicker-group-first";B=" ui-corner-"+(h?"right":"left");break;case n[1]-1:D+=" ui-datepicker-group-last";B=" ui-corner-"+
(h?"left":"right");break;default:D+=" ui-datepicker-group-middle",B=""}D+="'>"}D+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+B+"'>"+(/all|left/.test(B)&&0===b?h?m:u:"")+(/all|right/.test(B)&&0===b?h?u:m:"")+this._generateMonthYearHeader(a,p,r,v,y,0<b||0<c,F,I)+"</div><table class='ui-datepicker-calendar'><thead><tr>";var E=q?"<th class='ui-datepicker-week-col'>"+this._get(a,"weekHeader")+"</th>":"";for(B=0;7>B;B++){var z=(B+l)%7;E+="<th scope='col'"+(5<=(B+l+6)%7?" class='ui-datepicker-week-end'":
"")+"><span title='"+A[z]+"'>"+C[z]+"</span></th>"}D+=E+"</tr></thead><tbody>";E=this._getDaysInMonth(r,p);r===a.selectedYear&&p===a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,E));B=(this._getFirstDayOfMonth(r,p)-l+7)%7;E=Math.ceil((B+E)/7);this.maxRows=E=t?this.maxRows>E?this.maxRows:E:E;z=this._daylightSavingAdjust(new Date(r,p,1-B));for(d=0;d<E;d++){D+="<tr>";var T=q?"<td class='ui-datepicker-week-col'>"+this._get(a,"calculateWeek")(z)+"</td>":"";for(B=0;7>B;B++){var N=G?G.apply(a.input?
a.input[0]:null,[z]):[!0,""];var O=(f=z.getMonth()!==p)&&!L||!N[0]||v&&z<v||y&&z>y;T+="<td class='"+(5<=(B+l+6)%7?" ui-datepicker-week-end":"")+(f?" ui-datepicker-other-month":"")+(z.getTime()===S.getTime()&&p===a.selectedMonth&&a._keyEvent||K.getTime()===z.getTime()&&K.getTime()===S.getTime()?" "+this._dayOverClass:"")+(O?" "+this._unselectableClass+" ui-state-disabled":"")+(f&&!J?"":" "+N[1]+(z.getTime()===w.getTime()?" "+this._currentClass:"")+(z.getTime()===g.getTime()?" ui-datepicker-today":
""))+"'"+(f&&!J||!N[2]?"":" title='"+N[2].replace(/'/g,"'")+"'")+(O?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(f&&!J?" ":O?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===g.getTime()?" ui-state-highlight":"")+(z.getTime()===w.getTime()?" ui-state-active":"")+(f?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>";z.setDate(z.getDate()+1);z=this._daylightSavingAdjust(z)}D+=
T+"</tr>"}p++;11<p&&(p=0,r++);D+="</tbody></table>"+(t?"</div>"+(0<n[0]&&c===n[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"");R+=D}Q+=R}a._keyEvent=!1;return Q+k},_generateMonthYearHeader:function(a,b,c,d,f,g,h,k){var e,l=this._get(a,"changeMonth"),n=this._get(a,"changeYear"),p=this._get(a,"showMonthAfterYear"),q="<div class='ui-datepicker-title'>",t="";if(g||!l)t+="<span class='ui-datepicker-month'>"+h[b]+"</span>";else{h=d&&d.getFullYear()===c;var w=f&&f.getFullYear()===c;t+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
for(e=0;12>e;e++)(!h||e>=d.getMonth())&&(!w||e<=f.getMonth())&&(t+="<option value='"+e+"'"+(e===b?" selected='selected'":"")+">"+k[e]+"</option>");t+="</select>"}p||(q+=t+(!g&&l&&n?"":" "));if(!a.yearshtml)if(a.yearshtml="",g||!n)q+="<span class='ui-datepicker-year'>"+c+"</span>";else{k=this._get(a,"yearRange").split(":");var v=(new Date).getFullYear();h=function(a){a=a.match(/c[+\-].*/)?c+parseInt(a.substring(1),10):a.match(/[+\-].*/)?v+parseInt(a,10):parseInt(a,10);return isNaN(a)?v:a};b=h(k[0]);
k=Math.max(b,h(k[1]||""));b=d?Math.max(b,d.getFullYear()):b;k=f?Math.min(k,f.getFullYear()):k;for(a.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";b<=k;b++)a.yearshtml+="<option value='"+b+"'"+(b===c?" selected='selected'":"")+">"+b+"</option>";a.yearshtml+="</select>";q+=a.yearshtml;a.yearshtml=null}q+=this._get(a,"yearSuffix");p&&(q+=(!g&&l&&n?"":" ")+t);return q+"</div>"},_adjustInstDate:function(a,b,c){var d=a.selectedYear+("Y"===c?b:0),f=a.selectedMonth+
("M"===c?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(d,f))+("D"===c?b:0);d=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,f,b)));a.selectedDay=d.getDate();a.drawMonth=a.selectedMonth=d.getMonth();a.drawYear=a.selectedYear=d.getFullYear();"M"!==c&&"Y"!==c||this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?
a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return null==a?[1,1]:"number"===typeof a?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,
d+(0>b?b:e[0]*e[1]),1));0>b&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),f=null,g=null;if(a=this._get(a,"yearRange")){a=a.split(":");var h=(new Date).getFullYear();f=parseInt(a[0],10);g=parseInt(a[1],10);a[0].match(/[+\-].*/)&&(f+=h);a[1].match(/[+\-].*/)&&(g+=h)}return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())&&(!f||b.getFullYear()>=f)&&(!g||
b.getFullYear()<=g)},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b="string"!==typeof b?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);b=b?"object"===typeof b?b:this._daylightSavingAdjust(new Date(d,
c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;d.datepicker.initialized||(d(document).on("mousedown",d.datepicker._checkExternalClick),d.datepicker.initialized=!0);0===d("#"+d.datepicker._mainDivId).length&&d("body").append(d.datepicker.dpDiv);var b=Array.prototype.slice.call(arguments,1);return"string"===typeof a&&("isDisabled"===
a||"getDate"===a||"widget"===a)||"option"===a&&2===arguments.length&&"string"===typeof arguments[1]?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)):this.each(function(){"string"===typeof a?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new t;d.datepicker.initialized=!1;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.12.1";d.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",
autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(a){var b=d(this).css(a).offset().top;0>b&&d(this).css("top",a.top-b)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,
open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};this.originalPosition={parent:this.element.parent(),
index:this.element.parent().children().index(this.element)};this.originalTitle=this.element.attr("title");null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle);this.options.disabled&&(this.options.disabled=!1);this._createWrapper();this.element.show().removeAttr("title").appendTo(this.uiDialog);this._addClass("ui-dialog-content","ui-widget-content");this._createTitlebar();this._createButtonPane();this.options.draggable&&d.fn.draggable&&this._makeDraggable();this.options.resizable&&
d.fn.resizable&&this._makeResizable();this._isOpen=!1;this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var a=this.options.appendTo;return a&&(a.jquery||a.nodeType)?d(a):this.document.find(a||"body").eq(0)},_destroy:function(){var a=this.originalPosition;this._untrackInstance();this._destroyOverlay();this.element.removeUniqueId().css(this.originalCss).detach();this.uiDialog.remove();this.originalTitle&&this.element.attr("title",this.originalTitle);var b=
a.parent.children().eq(a.index);b.length&&b[0]!==this.element[0]?b.before(this.element):a.parent.append(this.element)},widget:function(){return this.uiDialog},disable:d.noop,enable:d.noop,close:function(a){var b=this;this._isOpen&&!1!==this._trigger("beforeClose",a)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||d.ui.safeBlur(d.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,
function(){b._trigger("close",a)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(a,b){var c=!1,e=this.uiDialog.siblings(".ui-front:visible").map(function(){return+d(this).css("z-index")}).get();e=Math.max.apply(null,e);e>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",e+1),c=!0);c&&!b&&this._trigger("focus",a);return c},open:function(){var a=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=d(d.ui.safeActiveElement(this.document[0])),
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(){a._focusTabbable();a._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var a=this._focusedElement;a||(a=this.element.find("[autofocus]"));a.length||(a=this.element.find(":tabbable"));a.length||(a=this.uiDialogButtonPane.find(":tabbable"));a.length||(a=this.uiDialogTitlebarClose.filter(":tabbable"));
a.length||(a=this.uiDialog);a.eq(0).trigger("focus")},_keepFocus:function(a){function b(){var a=d.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===a||d.contains(this.uiDialog[0],a)||this._focusTabbable()}a.preventDefault();b.call(this);this._delay(b)},_createWrapper:function(){this.uiDialog=d("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front");this._on(this.uiDialog,{keydown:function(a){if(this.options.closeOnEscape&&
!a.isDefaultPrevented()&&a.keyCode&&a.keyCode===d.ui.keyCode.ESCAPE)a.preventDefault(),this.close(a);else if(a.keyCode===d.ui.keyCode.TAB&&!a.isDefaultPrevented()){var b=this.uiDialog.find(":tabbable"),c=b.filter(":first"),e=b.filter(":last");a.target!==e[0]&&a.target!==this.uiDialog[0]||a.shiftKey?a.target!==c[0]&&a.target!==this.uiDialog[0]||!a.shiftKey||(this._delay(function(){e.trigger("focus")}),a.preventDefault()):(this._delay(function(){c.trigger("focus")}),a.preventDefault())}},mousedown:function(a){this._moveToTop(a)&&
this._focusTabbable()}});this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){this.uiDialogTitlebar=d("<div>");this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix");this._on(this.uiDialogTitlebar,{mousedown:function(a){d(a.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}});this.uiDialogTitlebarClose=d("<button type='button'></button>").button({label:d("<a>").text(this.options.closeText).html(),
icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar);this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close");this._on(this.uiDialogTitlebarClose,{click:function(a){a.preventDefault();this.close(a)}});var a=d("<span>").uniqueId().prependTo(this.uiDialogTitlebar);this._addClass(a,"ui-dialog-title");this._title(a);this.uiDialogTitlebar.prependTo(this.uiDialog);this.uiDialog.attr({"aria-labelledby":a.attr("id")})},_title:function(a){this.options.title?a.text(this.options.title):
a.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=d("<div>");this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix");this.uiButtonSet=d("<div>").appendTo(this.uiDialogButtonPane);this._addClass(this.uiButtonSet,"ui-dialog-buttonset");this._createButtons()},_createButtons:function(){var a=this,b=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();d.isEmptyObject(b)||d.isArray(b)&&!b.length?this._removeClass(this.uiDialog,
"ui-dialog-buttons"):(d.each(b,function(b,e){e=d.isFunction(e)?{click:e,text:b}:e;e=d.extend({type:"button"},e);var c=e.click;b={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text};delete e.click;delete e.icon;delete e.iconPosition;delete e.showLabel;delete e.icons;"boolean"===typeof e.text&&delete e.text;d("<button></button>",e).button(b).appendTo(a.uiButtonSet).on("click",function(){c.apply(a.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),
this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function a(a){return{position:a.position,offset:a.offset}}var b=this,c=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(c,f){b._addClass(d(this),"ui-dialog-dragging");b._blockFrames();b._trigger("dragStart",c,a(f))},drag:function(c,d){b._trigger("drag",c,a(d))},stop:function(e,f){var g=f.offset.left-b.document.scrollLeft(),
h=f.offset.top-b.document.scrollTop();c.position={my:"left top",at:"left"+(0<=g?"+":"")+g+" top"+(0<=h?"+":"")+h,of:b.window};b._removeClass(d(this),"ui-dialog-dragging");b._unblockFrames();b._trigger("dragStop",e,a(f))}})},_makeResizable:function(){function a(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}var b=this,c=this.options,e=c.resizable,f=this.uiDialog.css("position");e="string"===typeof e?e:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",
containment:"document",alsoResize:this.element,maxWidth:c.maxWidth,maxHeight:c.maxHeight,minWidth:c.minWidth,minHeight:this._minHeight(),handles:e,start:function(c,e){b._addClass(d(this),"ui-dialog-resizing");b._blockFrames();b._trigger("resizeStart",c,a(e))},resize:function(c,d){b._trigger("resize",c,a(d))},stop:function(e,f){var g=b.uiDialog.offset(),h=g.left-b.document.scrollLeft();g=g.top-b.document.scrollTop();c.height=b.uiDialog.height();c.width=b.uiDialog.width();c.position={my:"left top",
at:"left"+(0<=h?"+":"")+h+" top"+(0<=g?"+":"")+g,of:b.window};b._removeClass(d(this),"ui-dialog-resizing");b._unblockFrames();b._trigger("resizeStop",e,a(f))}}).css("position",f)},_trackFocus:function(){this._on(this.widget(),{focusin:function(a){this._makeFocusTarget();this._focusedElement=d(a.target)}})},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this)},_untrackInstance:function(){var a=this._trackingInstances(),b=d.inArray(this,a);-1!==b&&a.splice(b,1)},
_trackingInstances:function(){var a=this.document.data("ui-dialog-instances");a||(a=[],this.document.data("ui-dialog-instances",a));return a},_minHeight:function(){var a=this.options;return"auto"===a.height?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(){var a=this.uiDialog.is(":visible");a||this.uiDialog.show();this.uiDialog.position(this.options.position);a||this.uiDialog.hide()},_setOptions:function(a){var b=this,c=!1,e={};d.each(a,function(a,d){b._setOption(a,d);a in b.sizeRelatedOptions&&
(c=!0);a in b.resizableRelatedOptions&&(e[a]=d)});c&&(this._size(),this._position());this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",e)},_setOption:function(a,b){var c,e=this.uiDialog;"disabled"!==a&&(this._super(a,b),"appendTo"===a&&this.uiDialog.appendTo(this._appendTo()),"buttons"===a&&this._createButtons(),"closeText"===a&&this.uiDialogTitlebarClose.button({label:d("<a>").text(""+this.options.closeText).html()}),"draggable"===a&&((c=e.is(":data(ui-draggable)"))&&!b&&
e.draggable("destroy"),!c&&b&&this._makeDraggable()),"position"===a&&this._position(),"resizable"===a&&((c=e.is(":data(ui-resizable)"))&&!b&&e.resizable("destroy"),c&&"string"===typeof b&&e.resizable("option","handles",b),c||!1===b||this._makeResizable()),"title"===a&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});a.minWidth>a.width&&(a.width=a.minWidth);var b=this.uiDialog.css({height:"auto",
width:a.width}).outerHeight();var c=Math.max(0,a.minHeight-b);var d="number"===typeof a.maxHeight?Math.max(0,a.maxHeight-b):"none";"auto"===a.height?this.element.css({minHeight:c,maxHeight:d,height:"auto"}):this.element.height(Math.max(0,a.height-b));this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var a=d(this);return d("<div>").css({position:"absolute",width:a.outerWidth(),
height:a.outerHeight()}).appendTo(a.parent()).offset(a.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(a){return d(a.target).closest(".ui-dialog").length?!0:!!d(a.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var a=!0;this._delay(function(){a=!1});this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(b){a||this._allowInteraction(b)||
(b.preventDefault(),this._trackingInstances()[0]._focusTabbable())}});this.overlay=d("<div>").appendTo(this._appendTo());this._addClass(this.overlay,null,"ui-widget-overlay ui-front");this._on(this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var a=this.document.data("ui-dialog-overlays")-1;a?this.document.data("ui-dialog-overlays",a):(this._off(this.document,
"focusin"),this.document.removeData("ui-dialog-overlays"));this.overlay.remove();this.overlay=null}}});!1!==d.uiBackCompat&&d.widget("ui.dialog",d.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super();this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(a,b){"dialogClass"===a&&this.uiDialog.removeClass(this.options.dialogClass).addClass(b);this._superApply(arguments)}});d.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all",
"ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue();this.element.attr({role:"progressbar","aria-valuemin":this.min});this._addClass("ui-progressbar","ui-widget ui-widget-content");this.valueDiv=d("<div>").appendTo(this.element);this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header");this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow");
this.valueDiv.remove()},value:function(a){if(void 0===a)return this.options.value;this.options.value=this._constrainedValue(a);this._refreshValue()},_constrainedValue:function(a){void 0===a&&(a=this.options.value);this.indeterminate=!1===a;"number"!==typeof a&&(a=0);return this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,a))},_setOptions:function(a){var b=a.value;delete a.value;this._super(a);this.options.value=this._constrainedValue(b);this._refreshValue()},_setOption:function(a,
b){"max"===a&&(b=Math.max(this.min,b));this._super(a,b)},_setOptionDisabled:function(a){this._super(a);this.element.attr("aria-disabled",a);this._toggleClass(null,"ui-state-disabled",!!a)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var a=this.options.value,b=this._percentage();this.valueDiv.toggle(this.indeterminate||a>this.min).width(b.toFixed(0)+"%");this._toggleClass(this.valueDiv,"ui-progressbar-complete",
null,a===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate);this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=d("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":a}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null));this.oldValue!==a&&(this.oldValue=a,this._trigger("change"));a===this.options.max&&
this._trigger("complete")}});d.widget("ui.selectmenu",[d.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var a=this.element.uniqueId().attr("id");this.ids={element:a,button:a+
"-button",menu:a+"-menu"};this._drawButton();this._drawMenu();this._bindFormResetHandler();this._rendered=!1;this.menuItems=d()},_drawButton:function(){var a=this,b=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button);this._on(this.labels,{click:function(a){this.button.focus();a.preventDefault()}});this.element.hide();this.button=d("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox",
"aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element);this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget");var c=d("<span>").appendTo(this.button);this._addClass(c,"ui-selectmenu-icon","ui-icon "+this.options.icons.button);this.buttonItem=this._renderButtonItem(b).appendTo(this.button);!1!==this.options.width&&this._resizeButton();this._on(this.button,
this._buttonEvents);this.button.one("focusin",function(){a._rendered||a._refreshMenu()})},_drawMenu:function(){var a=this;this.menu=d("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=d("<div>").append(this.menu);this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front");this.menuWrap.appendTo(this._appendTo());this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(b,c){b.preventDefault();a._setSelection();
a._select(c.item.data("ui-selectmenu-item"),b)},focus:function(b,c){c=c.item.data("ui-selectmenu-item");null!=a.focusIndex&&c.index!==a.focusIndex&&(a._trigger("focus",b,{item:c}),a.isOpen||a._select(c,b));a.focusIndex=c.index;a.button.attr("aria-activedescendant",a.menuItems.eq(c.index).attr("id"))}}).menu("instance");this.menuInstance._off(this.menu,"mouseleave");this.menuInstance._closeOnDocumentClick=function(){return!1};this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu();
this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{}));null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var a=this.element.find("option");this.menu.empty();this._parseOptions(a);this._renderMenu(this.menu,this.items);this.menuInstance.refresh();this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper");this._rendered=!0;a.length&&(a=this._getSelectedItem(),this.menuInstance.focus(null,
a),this._setAria(a.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(a){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",a)))},_position:function(){this.menuWrap.position(d.extend({of:this.button},
this.options.position))},close:function(a){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",a))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(a){var b=d("<span>");this._setText(b,a.label);this._addClass(b,"ui-selectmenu-text");return b},_renderMenu:function(a,b){var c=this,e="";d.each(b,function(b,g){g.optgroup!==e&&(b=d("<li>",{text:g.optgroup}),c._addClass(b,"ui-selectmenu-optgroup",
"ui-menu-divider"+(g.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),b.appendTo(a),e=g.optgroup);c._renderItemData(a,g)})},_renderItemData:function(a,b){return this._renderItem(a,b).data("ui-selectmenu-item",b)},_renderItem:function(a,b){var c=d("<li>"),e=d("<div>",{title:b.element.attr("title")});b.disabled&&this._addClass(c,null,"ui-state-disabled");this._setText(e,b.label);return c.append(e).appendTo(a)},_setText:function(a,b){b?a.text(b):a.html(" ")},_move:function(a,
b){var c=".ui-menu-item";if(this.isOpen)var d=this.menuItems.eq(this.focusIndex).parent("li");else d=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),c+=":not(.ui-state-disabled)";a="first"===a||"last"===a?d["first"===a?"prevAll":"nextAll"](c).eq(-1):d[a+"All"](c).eq(0);a.length&&this.menuInstance.focus(b,a)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(a){this[this.isOpen?"close":"open"](a)},_setSelection:function(){if(this.range){if(window.getSelection){var a=
window.getSelection();a.removeAllRanges();a.addRange(this.range)}else this.range.select();this.button.focus()}},_documentClick:{mousedown:function(a){this.isOpen&&(d(a.target).closest(".ui-selectmenu-menu, #"+d.ui.escapeSelector(this.ids.button)).length||this.close(a))}},_buttonEvents:{mousedown:function(){if(window.getSelection){var a=window.getSelection();a.rangeCount&&(this.range=a.getRangeAt(0))}else this.range=document.selection.createRange()},click:function(a){this._setSelection();this._toggle(a)},
keydown:function(a){var b=!0;switch(a.keyCode){case d.ui.keyCode.TAB:case d.ui.keyCode.ESCAPE:this.close(a);b=!1;break;case d.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(a);break;case d.ui.keyCode.UP:a.altKey?this._toggle(a):this._move("prev",a);break;case d.ui.keyCode.DOWN:a.altKey?this._toggle(a):this._move("next",a);break;case d.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(a):this._toggle(a);break;case d.ui.keyCode.LEFT:this._move("prev",a);break;case d.ui.keyCode.RIGHT:this._move("next",
a);break;case d.ui.keyCode.HOME:case d.ui.keyCode.PAGE_UP:this._move("first",a);break;case d.ui.keyCode.END:case d.ui.keyCode.PAGE_DOWN:this._move("last",a);break;default:this.menu.trigger(a),b=!1}b&&a.preventDefault()}},_selectFocusedItem:function(a){var b=this.menuItems.eq(this.focusIndex).parent("li");b.hasClass("ui-state-disabled")||this._select(b.data("ui-selectmenu-item"),a)},_select:function(a,b){var c=this.element[0].selectedIndex;this.element[0].selectedIndex=a.index;this.buttonItem.replaceWith(this.buttonItem=
this._renderButtonItem(a));this._setAria(a);this._trigger("select",b,{item:a});a.index!==c&&this._trigger("change",b,{item:a});this.close(b)},_setAria:function(a){a=this.menuItems.eq(a.index).attr("id");this.button.attr({"aria-labelledby":a,"aria-activedescendant":a});this.menu.attr("aria-activedescendant",a)},_setOption:function(a,b){if("icons"===a){var c=this.button.find("span.ui-icon");this._removeClass(c,null,this.options.icons.button)._addClass(c,null,b.button)}this._super(a,b);"appendTo"===
a&&this.menuWrap.appendTo(this._appendTo());"width"===a&&this._resizeButton()},_setOptionDisabled:function(a){this._super(a);this.menuInstance.option("disabled",a);this.button.attr("aria-disabled",a);this._toggleClass(this.button,null,"ui-state-disabled",a);this.element.prop("disabled",a);a?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var a=this.options.appendTo;a&&(a=a.jquery||a.nodeType?d(a):this.document.find(a).eq(0));a&&a[0]||(a=this.element.closest(".ui-front, dialog"));
a.length||(a=this.document[0].body);return a},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen);this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen);this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var a=this.options.width;!1===a?this.button.css("width",""):(null===a&&(a=this.element.show().outerWidth(),
this.element.hide()),this.button.outerWidth(a))},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var a=this._super();a.disabled=this.element.prop("disabled");return a},_parseOptions:function(a){var b=this,c=[];a.each(function(a,f){c.push(b._parseOption(d(f),a))});this.items=c},_parseOption:function(a,b){var c=a.parent("optgroup");return{element:a,index:b,value:a.val(),label:a.text(),optgroup:c.attr("label")||
"",disabled:c.prop("disabled")||a.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler();this.menuWrap.remove();this.button.remove();this.element.show();this.element.removeUniqueId();this.labels.attr("for",this.ids.element)}}]);d.widget("ui.slider",d.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",
range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._mouseSliding=this._keySliding=!1;this._animateOff=!0;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content");this._refresh();this._animateOff=!1},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var a=
this.options;var b=this.element.find(".ui-slider-handle"),c=[];var e=a.values&&a.values.length||1;b.length>e&&(b.slice(e).remove(),b=b.slice(0,e));for(a=b.length;a<e;a++)c.push("<span tabindex='0'></span>");this.handles=b.add(d(c.join("")).appendTo(this.element));this._addClass(this.handles,"ui-slider-handle","ui-state-default");this.handle=this.handles.eq(0);this.handles.each(function(a){d(this).data("ui-slider-handle-index",a).attr("tabIndex",0)})},_createRange:function(){var a=this.options;a.range?
(!0===a.range&&(a.values?a.values.length&&2!==a.values.length?a.values=[a.values[0],a.values[0]]:d.isArray(a.values)&&(a.values=a.values.slice(0)):a.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=d("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==a.range&&"max"!==a.range||this._addClass(this.range,"ui-slider-range-"+
a.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles)},_destroy:function(){this.handles.remove();this.range&&this.range.remove();this._mouseDestroy()},_mouseCapture:function(a){var b,c,e=this,f=this.options;if(f.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();
var g=this._normValueFromMouse({x:a.pageX,y:a.pageY});var h=this._valueMax()-this._valueMin()+1;this.handles.each(function(a){var k=Math.abs(g-e.values(a));if(h>k||h===k&&(a===e._lastChangedValue||e.values(a)===f.min))h=k,b=d(this),c=a});if(!1===this._start(a,c))return!1;this._mouseSliding=!0;this._handleIndex=c;this._addClass(b,null,"ui-state-active");b.trigger("focus");var k=b.offset();this._clickOffset=d(a.target).parents().addBack().is(".ui-slider-handle")?{left:a.pageX-k.left-b.width()/2,top:a.pageY-
k.top-b.height()/2-(parseInt(b.css("borderTopWidth"),10)||0)-(parseInt(b.css("borderBottomWidth"),10)||0)+(parseInt(b.css("marginTop"),10)||0)}:{left:0,top:0};this.handles.hasClass("ui-state-hover")||this._slide(a,c,g);return this._animateOff=!0},_mouseStart:function(){return!0},_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return!1},_mouseStop:function(a){this._removeClass(this.handles,null,"ui-state-active");this._mouseSliding=!1;
this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){if("horizontal"===this.orientation){var b=this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else b=this.elementSize.height,a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:
0);b=a/b;1<b&&(b=1);0>b&&(b=0);"vertical"===this.orientation&&(b=1-b);a=this._valueMax()-this._valueMin();b=this._valueMin()+b*a;return this._trimAlignValue(b)},_uiHash:function(a,b,c){var d={handle:this.handles[a],handleIndex:a,value:void 0!==b?b:this.value()};this._hasMultipleValues()&&(d.value=void 0!==b?b:this.values(a),d.values=c||this.values());return d},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(a,b){return this._trigger("start",a,
this._uiHash(b))},_slide:function(a,b,c){var d=this.value(),f=this.values();if(this._hasMultipleValues()){var g=this.values(b?0:1);d=this.values(b);2===this.options.values.length&&!0===this.options.range&&(c=0===b?Math.min(g,c):Math.max(g,c));f[b]=c}c!==d&&!1!==this._trigger("slide",a,this._uiHash(b,c,f))&&(this._hasMultipleValues()?this.values(b,c):this.value(c))},_stop:function(a,b){this._trigger("stop",a,this._uiHash(b))},_change:function(a,b){this._keySliding||this._mouseSliding||(this._lastChangedValue=
b,this._trigger("change",a,this._uiHash(b)))},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(a,b){var c;if(1<arguments.length)this.options.values[a]=this._trimAlignValue(b),this._refreshValue(),this._change(null,a);else if(arguments.length)if(d.isArray(arguments[0])){var e=this.options.values;var f=arguments[0];for(c=0;c<e.length;c+=1)e[c]=this._trimAlignValue(f[c]),this._change(null,
c);this._refreshValue()}else return this._hasMultipleValues()?this._values(a):this.value();else return this._values()},_setOption:function(a,b){var c=0;"range"===a&&!0===this.options.range&&("min"===b?(this.options.value=this._values(0),this.options.values=null):"max"===b&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null));d.isArray(this.options.values)&&(c=this.options.values.length);this._super(a,b);switch(a){case "orientation":this._detectOrientation();this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+
this.orientation);this._refreshValue();this.options.range&&this._refreshRange(b);this.handles.css("horizontal"===b?"bottom":"left","");break;case "value":this._animateOff=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(a=c-1;0<=a;a--)this._change(null,a);this._animateOff=!1;break;case "step":case "min":case "max":this._animateOff=!0;this._calculateNewMax();this._refreshValue();this._animateOff=!1;break;case "range":this._animateOff=
!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(a){this._super(a);this._toggleClass(null,"ui-state-disabled",!!a)},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b;if(arguments.length){var c=this.options.values[a];return c=this._trimAlignValue(c)}if(this._hasMultipleValues()){c=this.options.values.slice();for(b=0;b<c.length;b+=1)c[b]=this._trimAlignValue(c[b]);return c}return[]},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();
if(a>=this._valueMax())return this._valueMax();var b=0<this.options.step?this.options.step:1,c=(a-this._valueMin())%b;a-=c;2*Math.abs(c)>=b&&(a+=0<c?b:-b);return parseFloat(a.toFixed(5))},_calculateNewMax:function(){var a=this.options.max,b=this._valueMin(),c=this.options.step;a=Math.round((a-b)/c)*c+b;a>this.options.max&&(a-=c);this.max=parseFloat(a.toFixed(this._precision()))},_precision:function(){var a=this._precisionOf(this.options.step);null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min)));
return a},_precisionOf:function(a){a=a.toString();var b=a.indexOf(".");return-1===b?0:a.length-b-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(a){"vertical"===a&&this.range.css({width:"",left:""});"horizontal"===a&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var a,b=this.options.range,c=this.options,e=this,f=this._animateOff?!1:c.animate,g={};if(this._hasMultipleValues())this.handles.each(function(b){l=(e.values(b)-
e._valueMin())/(e._valueMax()-e._valueMin())*100;g["horizontal"===e.orientation?"left":"bottom"]=l+"%";d(this).stop(1,1)[f?"animate":"css"](g,c.animate);if(!0===e.options.range)if("horizontal"===e.orientation){if(0===b)e.range.stop(1,1)[f?"animate":"css"]({left:l+"%"},c.animate);if(1===b)e.range[f?"animate":"css"]({width:l-a+"%"},{queue:!1,duration:c.animate})}else{if(0===b)e.range.stop(1,1)[f?"animate":"css"]({bottom:l+"%"},c.animate);if(1===b)e.range[f?"animate":"css"]({height:l-a+"%"},{queue:!1,
duration:c.animate})}a=l});else{var h=this.value();var k=this._valueMin();var m=this._valueMax();var l=m!==k?(h-k)/(m-k)*100:0;g["horizontal"===this.orientation?"left":"bottom"]=l+"%";this.handle.stop(1,1)[f?"animate":"css"](g,c.animate);if("min"===b&&"horizontal"===this.orientation)this.range.stop(1,1)[f?"animate":"css"]({width:l+"%"},c.animate);if("max"===b&&"horizontal"===this.orientation)this.range.stop(1,1)[f?"animate":"css"]({width:100-l+"%"},c.animate);if("min"===b&&"vertical"===this.orientation)this.range.stop(1,
1)[f?"animate":"css"]({height:l+"%"},c.animate);if("max"===b&&"vertical"===this.orientation)this.range.stop(1,1)[f?"animate":"css"]({height:100-l+"%"},c.animate)}},_handleEvents:{keydown:function(a){var b,c=d(a.target).data("ui-slider-handle-index");switch(a.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(a.preventDefault(),!this._keySliding){this._keySliding=
!0;this._addClass(d(a.target),null,"ui-state-active");var e=this._start(a,c);if(!1===e)return}}var f=this.options.step;e=this._hasMultipleValues()?b=this.values(c):b=this.value();switch(a.keyCode){case d.ui.keyCode.HOME:b=this._valueMin();break;case d.ui.keyCode.END:b=this._valueMax();break;case d.ui.keyCode.PAGE_UP:b=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;case d.ui.keyCode.PAGE_DOWN:b=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);
break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(e===this._valueMax())return;b=this._trimAlignValue(e+f);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(e===this._valueMin())return;b=this._trimAlignValue(e-f)}this._slide(a,c,b)},keyup:function(a){var b=d(a.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(a,b),this._change(a,b),this._removeClass(d(a.target),null,"ui-state-active"))}}});d.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",
widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){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,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var a=this._super(),b=this.element;d.each(["min","max","step"],function(c,d){c=b.attr(d);null!=c&&c.length&&(a[d]=c)});return a},_events:{keydown:function(a){this._start(a)&&this._keydown(a)&&a.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(a){this.cancelBlur?delete this.cancelBlur:
(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",a))},mousewheel:function(a,b){if(b){if(!this.spinning&&!this._start(a))return!1;this._spin((0<b?1:-1)*this.options.step,a);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(a)},100);a.preventDefault()}},"mousedown .ui-spinner-button":function(a){function b(){this.element[0]!==d.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=
c,this._delay(function(){this.previous=c}))}var c=this.element[0]===d.ui.safeActiveElement(this.document[0])?this.previous:this.element.val();a.preventDefault();b.call(this);this.cancelBlur=!0;this._delay(function(){delete this.cancelBlur;b.call(this)});!1!==this._start(a)&&this._repeat(null,d(a.currentTarget).hasClass("ui-spinner-up")?1:-1,a)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(a){if(d(a.currentTarget).hasClass("ui-state-active")){if(!1===this._start(a))return!1;
this._repeat(null,d(a.currentTarget).hasClass("ui-spinner-up")?1:-1,a)}},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance();this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content");this._addClass("ui-spinner-input");this.element.attr("role","spinbutton");this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",
!0).button({classes:{"ui-button":""}});this._removeClass(this.buttons,"ui-corner-all");this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up");this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down");this.buttons.first().button({icon:this.options.icons.up,showLabel:!1});this.buttons.last().button({icon:this.options.icons.down,showLabel:!1});this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},
_keydown:function(a){var b=this.options,c=d.ui.keyCode;switch(a.keyCode){case c.UP:return this._repeat(null,1,a),!0;case c.DOWN:return this._repeat(null,-1,a),!0;case c.PAGE_UP:return this._repeat(null,b.page,a),!0;case c.PAGE_DOWN:return this._repeat(null,-b.page,a),!0}return!1},_start:function(a){if(!this.spinning&&!1===this._trigger("start",a))return!1;this.counter||(this.counter=1);return this.spinning=!0},_repeat:function(a,b,c){a=a||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,
b,c)},a);this._spin(b*this.options.step,c)},_spin:function(a,b){var c=this.value()||0;this.counter||(this.counter=1);c=this._adjustValue(c+a*this._increment(this.counter));this.spinning&&!1===this._trigger("spin",b,{value:c})||(this._value(c),this.counter++)},_increment:function(a){var b=this.options.incremental;return b?d.isFunction(b)?b(a):Math.floor(a*a*a/5E4-a*a/500+17*a/200+1):1},_precision:function(){var a=this._precisionOf(this.options.step);null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min)));
return a},_precisionOf:function(a){a=a.toString();var b=a.indexOf(".");return-1===b?0:a.length-b-1},_adjustValue:function(a){var b=this.options;var c=null!==b.min?b.min:0;a=c+Math.round((a-c)/b.step)*b.step;a=parseFloat(a.toFixed(this._precision()));return null!==b.max&&a>b.max?b.max:null!==b.min&&a<b.min?b.min:a},_stop:function(a){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",a))},_setOption:function(a,b){if("culture"===
a||"numberFormat"===a){var c=this._parse(this.element.val());this.options[a]=b;this.element.val(this._format(c))}else"max"!==a&&"min"!==a&&"step"!==a||"string"!==typeof b||(b=this._parse(b)),"icons"===a&&(c=this.buttons.first().find(".ui-icon"),this._removeClass(c,null,this.options.icons.up),this._addClass(c,null,b.up),c=this.buttons.last().find(".ui-icon"),this._removeClass(c,null,this.options.icons.down),this._addClass(c,null,b.down)),this._super(a,b)},_setOptionDisabled:function(a){this._super(a);
this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!a);this.element.prop("disabled",!!a);this.buttons.button(a?"disable":"enable")},_setOptions:G(function(a){this._super(a)}),_parse:function(a){"string"===typeof a&&""!==a&&(a=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(a,10,this.options.culture):+a);return""===a||isNaN(a)?null:a},_format:function(a){return""===a?"":window.Globalize&&this.options.numberFormat?Globalize.format(a,this.options.numberFormat,this.options.culture):
a},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var a=this.value();return null===a?!1:a===this._adjustValue(a)},_value:function(a,b){if(""!==a){var c=this._parse(a);null!==c&&(b||(c=this._adjustValue(c)),a=this._format(c))}this.element.val(a);this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow");
this.uiSpinner.replaceWith(this.element)},stepUp:G(function(a){this._stepUp(a)}),_stepUp:function(a){this._start()&&(this._spin((a||1)*this.options.step),this._stop())},stepDown:G(function(a){this._stepDown(a)}),_stepDown:function(a){this._start()&&(this._spin((a||1)*-this.options.step),this._stop())},pageUp:G(function(a){this._stepUp((a||1)*this.options.page)}),pageDown:G(function(a){this._stepDown((a||1)*this.options.page)}),value:function(a){if(!arguments.length)return this._parse(this.element.val());
G(this._value).call(this,a)},widget:function(){return this.uiSpinner}});!1!==d.uiBackCompat&&d.widget("ui.spinner",d.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});d.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom",
"ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var a=/#.*$/;return function(b){var c=b.href.replace(a,"");var d=location.href.replace(a,"");try{c=decodeURIComponent(c)}catch(f){}try{d=decodeURIComponent(d)}catch(f){}return 1<b.hash.length&&c===d}}(),_create:function(){var a=this,b=this.options;this.running=!1;this._addClass("ui-tabs","ui-widget ui-widget-content");
this._toggleClass("ui-tabs-collapsible",null,b.collapsible);this._processTabs();b.active=this._initialActive();d.isArray(b.disabled)&&(b.disabled=d.unique(b.disabled.concat(d.map(this.tabs.filter(".ui-state-disabled"),function(b){return a.tabs.index(b)}))).sort());this.active=!1!==this.options.active&&this.anchors.length?this._findActive(b.active):d();this._refresh();this.active.length&&this.load(b.active)},_initialActive:function(){var a=this.options.active,b=this.options.collapsible,c=location.hash.substring(1);
null===a&&(c&&this.tabs.each(function(b,f){if(d(f).attr("aria-controls")===c)return a=b,!1}),null===a&&(a=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null===a||-1===a)&&(a=this.tabs.length?0:!1);!1!==a&&(a=this.tabs.index(this.tabs.eq(a)),-1===a&&(a=b?!1:0));!b&&!1===a&&this.anchors.length&&(a=0);return a},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):d()}},_tabKeydown:function(a){var b=d(d.ui.safeActiveElement(this.document[0])).closest("li"),
c=this.tabs.index(b),e=!0;if(!this._handlePageNav(a)){switch(a.keyCode){case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:c++;break;case d.ui.keyCode.UP:case d.ui.keyCode.LEFT:e=!1;c--;break;case d.ui.keyCode.END:c=this.anchors.length-1;break;case d.ui.keyCode.HOME:c=0;break;case d.ui.keyCode.SPACE:a.preventDefault();clearTimeout(this.activating);this._activate(c);return;case d.ui.keyCode.ENTER:a.preventDefault();clearTimeout(this.activating);this._activate(c===this.options.active?!1:c);return;default:return}a.preventDefault();
clearTimeout(this.activating);c=this._focusNextTab(c,e);a.ctrlKey||a.metaKey||(b.attr("aria-selected","false"),this.tabs.eq(c).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",c)},this.delay))}},_panelKeydown:function(a){!this._handlePageNav(a)&&a.ctrlKey&&a.keyCode===d.ui.keyCode.UP&&(a.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(a){if(a.altKey&&a.keyCode===d.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-
1,!1)),!0;if(a.altKey&&a.keyCode===d.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(a,b){function c(){a>e&&(a=0);0>a&&(a=e);return a}for(var e=this.tabs.length-1;-1!==d.inArray(c(),this.options.disabled);)a=b?a+1:a-1;return a},_focusNextTab:function(a,b){a=this._findNextTab(a,b);this.tabs.eq(a).trigger("focus");return a},_setOption:function(a,b){"active"===a?this._activate(b):(this._super(a,b),"collapsible"===a&&(this._toggleClass("ui-tabs-collapsible",
null,b),b||!1!==this.options.active||this._activate(0)),"event"===a&&this._setupEvents(b),"heightStyle"===a&&this._setupHeightStyle(b))},_sanitizeSelector:function(a){return a?a.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var a=this.options,b=this.tablist.children(":has(a[href])");a.disabled=d.map(b.filter(".ui-state-disabled"),function(a){return b.index(a)});this._processTabs();!1!==a.active&&this.anchors.length?this.active.length&&!d.contains(this.tablist[0],this.active[0])?
this.tabs.length===a.disabled.length?(a.active=!1,this.active=d()):this._activate(this._findNextTab(Math.max(0,a.active-1),!1)):a.active=this.tabs.index(this.active):(a.active=!1,this.active=d());this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});
this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var a=this,b=this.tabs,c=this.anchors,e=this.panels;this.tablist=this._getList().attr("role","tablist");this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header");this.tablist.on("mousedown"+
this.eventNamespace,"> li",function(a){d(this).is(".ui-state-disabled")&&a.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){d(this).closest("li").is(".ui-state-disabled")&&this.blur()});this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1});this._addClass(this.tabs,"ui-tabs-tab","ui-state-default");this.anchors=this.tabs.map(function(){return d("a",this)[0]}).attr({role:"presentation",tabIndex:-1});this._addClass(this.anchors,"ui-tabs-anchor");
this.panels=d();this.anchors.each(function(b,c){var e=d(c).uniqueId().attr("id"),f=d(c).closest("li"),g=f.attr("aria-controls");if(a._isLocal(c)){b=c.hash;c=b.substring(1);var l=a.element.find(a._sanitizeSelector(b))}else c=f.attr("aria-controls")||d({}).uniqueId()[0].id,l=a.element.find("#"+c),l.length||(l=a._createPanel(c),l.insertAfter(a.panels[b-1]||a.tablist)),l.attr("aria-live","polite");l.length&&(a.panels=a.panels.add(l));g&&f.data("ui-tabs-aria-controls",g);f.attr({"aria-controls":c,"aria-labelledby":e});
l.attr("aria-labelledby",e)});this.panels.attr("role","tabpanel");this._addClass(this.panels,"ui-tabs-panel","ui-widget-content");b&&(this._off(b.not(this.tabs)),this._off(c.not(this.anchors)),this._off(e.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(a){return d("<div>").attr("id",a).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(a){var b,c;d.isArray(a)&&(a.length?a.length===this.anchors.length&&(a=!0):a=!1);for(c=0;b=
this.tabs[c];c++)b=d(b),!0===a||-1!==d.inArray(c,a)?(b.attr("aria-disabled","true"),this._addClass(b,null,"ui-state-disabled")):(b.removeAttr("aria-disabled"),this._removeClass(b,null,"ui-state-disabled"));this.options.disabled=a;this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===a)},_setupEvents:function(a){var b={};a&&d.each(a.split(" "),function(a,d){b[d]="_eventHandler"});this._off(this.anchors.add(this.tabs).add(this.panels));this._on(!0,this.anchors,{click:function(a){a.preventDefault()}});
this._on(this.anchors,b);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},_setupHeightStyle:function(a){var b=this.element.parent();if("fill"===a){var c=b.height();c-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var a=d(this),b=a.css("position");"absolute"!==b&&"fixed"!==b&&(c-=a.outerHeight(!0))});this.element.children().not(this.panels).each(function(){c-=
d(this).outerHeight(!0)});this.panels.each(function(){d(this).height(Math.max(0,c-d(this).innerHeight()+d(this).height()))}).css("overflow","auto")}else"auto"===a&&(c=0,this.panels.each(function(){c=Math.max(c,d(this).height("").height())}).height(c))},_eventHandler:function(a){var b=this.options,c=this.active,e=d(a.currentTarget).closest("li"),f=e[0]===c[0],g=f&&b.collapsible,h=g?d():this._getPanelForTab(e),k=c.length?this._getPanelForTab(c):d();c={oldTab:c,oldPanel:k,newTab:g?d():e,newPanel:h};
a.preventDefault();e.hasClass("ui-state-disabled")||e.hasClass("ui-tabs-loading")||this.running||f&&!b.collapsible||!1===this._trigger("beforeActivate",a,c)||(b.active=g?!1:this.tabs.index(e),this.active=f?d():e,this.xhr&&this.xhr.abort(),k.length||h.length||d.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(e),a),this._toggle(a,c))},_toggle:function(a,b){function c(){f.running=!1;f._trigger("activate",a,b)}function e(){f._addClass(b.newTab.closest("li"),
"ui-tabs-active","ui-state-active");g.length&&f.options.show?f._show(g,f.options.show,c):(g.show(),c())}var f=this,g=b.newPanel,h=b.oldPanel;this.running=!0;h.length&&this.options.hide?this._hide(h,this.options.hide,function(){f._removeClass(b.oldTab.closest("li"),"ui-tabs-active","ui-state-active");e()}):(this._removeClass(b.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),h.hide(),e());h.attr("aria-hidden","true");b.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});g.length&&
h.length?b.oldTab.attr("tabIndex",-1):g.length&&this.tabs.filter(function(){return 0===d(this).attr("tabIndex")}).attr("tabIndex",-1);g.attr("aria-hidden","false");b.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(a){a=this._findActive(a);a[0]!==this.active[0]&&(a.length||(a=this.active),a=a.find(".ui-tabs-anchor")[0],this._eventHandler({target:a,currentTarget:a,preventDefault:d.noop}))},_findActive:function(a){return!1===a?d():this.tabs.eq(a)},_getIndex:function(a){"string"===
typeof a&&(a=this.anchors.index(this.anchors.filter("[href$='"+d.ui.escapeSelector(a)+"']")));return a},_destroy:function(){this.xhr&&this.xhr.abort();this.tablist.removeAttr("role").off(this.eventNamespace);this.anchors.removeAttr("role tabIndex").removeUniqueId();this.tabs.add(this.panels).each(function(){d.data(this,"ui-tabs-destroy")?d(this).remove():d(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")});this.tabs.each(function(){var a=
d(this),b=a.data("ui-tabs-aria-controls");b?a.attr("aria-controls",b).removeData("ui-tabs-aria-controls"):a.removeAttr("aria-controls")});this.panels.show();"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(a){var b=this.options.disabled;!1!==b&&(void 0===a?b=!1:(a=this._getIndex(a),b=d.isArray(b)?d.map(b,function(b){return b!==a?b:null}):d.map(this.tabs,function(b,d){return d!==a?d:null})),this._setOptionDisabled(b))},disable:function(a){var b=this.options.disabled;
if(!0!==b){if(void 0===a)b=!0;else{a=this._getIndex(a);if(-1!==d.inArray(a,b))return;b=d.isArray(b)?d.merge([a],b).sort():[a]}this._setOptionDisabled(b)}},load:function(a,b){a=this._getIndex(a);var c=this,e=this.tabs.eq(a);a=e.find(".ui-tabs-anchor");var f=this._getPanelForTab(e),g={tab:e,panel:f},h=function(a,b){"abort"===b&&c.panels.stop(!1,!0);c._removeClass(e,"ui-tabs-loading");f.removeAttr("aria-busy");a===c.xhr&&delete c.xhr};this._isLocal(a[0])||(this.xhr=d.ajax(this._ajaxSettings(a,b,g)))&&
"canceled"!==this.xhr.statusText&&(this._addClass(e,"ui-tabs-loading"),f.attr("aria-busy","true"),this.xhr.done(function(a,d,e){setTimeout(function(){f.html(a);c._trigger("load",b,g);h(e,d)},1)}).fail(function(a,b){setTimeout(function(){h(a,b)},1)}))},_ajaxSettings:function(a,b,c){var e=this;return{url:a.attr("href").replace(/#.*$/,""),beforeSend:function(a,g){return e._trigger("beforeLoad",b,d.extend({jqXHR:a,ajaxSettings:g},c))}}},_getPanelForTab:function(a){a=d(a).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+
a))}});!1!==d.uiBackCompat&&d.widget("ui.tabs",d.ui.tabs,{_processTabs:function(){this._superApply(arguments);this._addClass(this.tabs,"ui-tab")}});d.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var a=d(this).attr("title")||"";return d("<a>").text(a).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(a,
b){var c=(a.attr("aria-describedby")||"").split(/\s+/);c.push(b);a.data("ui-tooltip-id",b).attr("aria-describedby",d.trim(c.join(" ")))},_removeDescribedBy:function(a){var b=a.data("ui-tooltip-id"),c=(a.attr("aria-describedby")||"").split(/\s+/);b=d.inArray(b,c);-1!==b&&c.splice(b,1);a.removeData("ui-tooltip-id");(c=d.trim(c.join(" ")))?a.attr("aria-describedby",c):a.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};this.liveRegion=
d("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this.disabledTitles=d([])},_setOption:function(a,b){var c=this;this._super(a,b);"content"===a&&d.each(this.tooltips,function(a,b){c._updateContent(b.element)})},_setOptionDisabled:function(a){this[a?"_disable":"_enable"]()},_disable:function(){var a=this;d.each(this.tooltips,function(b,c){b=d.Event("blur");b.target=b.currentTarget=
c.element[0];a.close(b,!0)});this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var a=d(this);if(a.is("[title]"))return a.data("ui-tooltip-title",a.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var a=d(this);a.data("ui-tooltip-title")&&a.attr("title",a.data("ui-tooltip-title"))});this.disabledTitles=d([])},open:function(a){var b=this,c=d(a?a.target:this.element).closest(this.options.items);c.length&&
!c.data("ui-tooltip-id")&&(c.attr("title")&&c.data("ui-tooltip-title",c.attr("title")),c.data("ui-tooltip-open",!0),a&&"mouseover"===a.type&&c.parents().each(function(){var a=d(this);if(a.data("ui-tooltip-open")){var c=d.Event("blur");c.target=c.currentTarget=this;b.close(c,!0)}a.attr("title")&&(a.uniqueId(),b.parents[this.id]={element:this,title:a.attr("title")},a.attr("title",""))}),this._registerCloseHandlers(a,c),this._updateContent(c,a))},_updateContent:function(a,b){var c=this.options.content;
var d=this,f=b?b.type:null;if("string"===typeof c||c.nodeType||c.jquery)return this._open(b,a,c);(c=c.call(a[0],function(c){d._delay(function(){a.data("ui-tooltip-open")&&(b&&(b.type=f),this._open(b,a,c))})}))&&this._open(b,a,c)},_open:function(a,b,c){function e(a){g.of=a;h.is(":hidden")||h.position(g)}var f,g=d.extend({},this.options.position);if(c)if(f=this._find(b))f.tooltip.find(".ui-tooltip-content").html(c);else{b.is("[title]")&&(a&&"mouseover"===a.type?b.attr("title",""):b.removeAttr("title"));
f=this._tooltip(b);var h=f.tooltip;this._addDescribedBy(b,h.attr("id"));h.find(".ui-tooltip-content").html(c);this.liveRegion.children().hide();c=d("<div>").html(h.find(".ui-tooltip-content").html());c.removeAttr("name").find("[name]").removeAttr("name");c.removeAttr("id").find("[id]").removeAttr("id");c.appendTo(this.liveRegion);this.options.track&&a&&/^mouse/.test(a.type)?(this._on(this.document,{mousemove:e}),e(a)):h.position(d.extend({of:b},this.options.position));h.hide();this._show(h,this.options.show);
if(this.options.track&&this.options.show&&this.options.show.delay)var k=this.delayedShow=setInterval(function(){h.is(":visible")&&(e(g.of),clearInterval(k))},d.fx.interval);this._trigger("open",a,{tooltip:h})}},_registerCloseHandlers:function(a,b){var c={keyup:function(a){a.keyCode===d.ui.keyCode.ESCAPE&&(a=d.Event(a),a.currentTarget=b[0],this.close(a,!0))}};b[0]!==this.element[0]&&(c.remove=function(){this._removeTooltip(this._find(b).tooltip)});a&&"mouseover"!==a.type||(c.mouseleave="close");a&&
"focusin"!==a.type||(c.focusout="close");this._on(!0,b,c)},close:function(a){var b=this,c=d(a?a.currentTarget:this.element),e=this._find(c);if(e){var f=e.tooltip;e.closing||(clearInterval(this.delayedShow),c.data("ui-tooltip-title")&&!c.attr("title")&&c.attr("title",c.data("ui-tooltip-title")),this._removeDescribedBy(c),e.hiding=!0,f.stop(!0),this._hide(f,this.options.hide,function(){b._removeTooltip(d(this))}),c.removeData("ui-tooltip-open"),this._off(c,"mouseleave focusout keyup"),c[0]!==this.element[0]&&
this._off(c,"remove"),this._off(this.document,"mousemove"),a&&"mouseleave"===a.type&&d.each(this.parents,function(a,c){d(c.element).attr("title",c.title);delete b.parents[a]}),e.closing=!0,this._trigger("close",a,{tooltip:f}),e.hiding||(e.closing=!1))}else c.removeData("ui-tooltip-open")},_tooltip:function(a){var b=d("<div>").attr("role","tooltip"),c=d("<div>").appendTo(b),e=b.uniqueId().attr("id");this._addClass(c,"ui-tooltip-content");this._addClass(b,"ui-tooltip","ui-widget ui-widget-content");
b.appendTo(this._appendTo(a));return this.tooltips[e]={element:a,tooltip:b}},_find:function(a){return(a=a.data("ui-tooltip-id"))?this.tooltips[a]:null},_removeTooltip:function(a){a.remove();delete this.tooltips[a.attr("id")]},_appendTo:function(a){a=a.closest(".ui-front, dialog");a.length||(a=this.document[0].body);return a},_destroy:function(){var a=this;d.each(this.tooltips,function(b,c){var e=d.Event("blur");c=c.element;e.target=e.currentTarget=c[0];a.close(e,!0);d("#"+b).remove();c.data("ui-tooltip-title")&&
(c.attr("title")||c.attr("title",c.data("ui-tooltip-title")),c.removeData("ui-tooltip-title"))});this.liveRegion.remove()}});!1!==d.uiBackCompat&&d.widget("ui.tooltip",d.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var a=this._superApply(arguments);this.options.tooltipClass&&a.tooltip.addClass(this.options.tooltipClass);return a}})});
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,n,r){c instanceof String&&(c=String(c));for(var t=c.length,u=0;u<t;u++){var m=c[u];if(n.call(r,m,u,c))return{i:u,v:m}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,n,r){c!=Array.prototype&&c!=Object.prototype&&(c[n]=r.value)};$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(c,n,r,t){if(n){r=$jscomp.global;c=c.split(".");for(t=0;t<c.length-1;t++){var u=c[t];u in r||(r[u]={});r=r[u]}c=c[c.length-1];t=r[c];n=n(t);n!=t&&null!=n&&$jscomp.defineProperty(r,c,{configurable:!0,writable:!0,value:n})}};$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,r){return $jscomp.findInternal(this,c,r).v}},"es6","es3");
(function(c,n){function r(b){b=b.split(/\s+/);for(var a=[],e=0,f;f=b[e];e++)f=f.charAt(0).toUpperCase(),a.push(f);return a}function t(b){return b.id&&c('label[for="'+b.id+'"]').val()||b.name}function u(b,a,e){e||(e=0);a.each(function(){var a=c(this),d=this,k=this.nodeName.toLowerCase();if("label"===k&&a.find("input, textarea, select").length){var g=a.text();a=a.children().first();d=a.get(0);k=d.nodeName.toLowerCase()}switch(k){case "menu":var h={name:a.attr("label"),items:{}};e=u(h.items,a.children(),
e);break;case "a":case "button":h={name:a.text(),disabled:!!a.attr("disabled"),callback:function(){return function(){a.get(0).click()}}()};break;case "menuitem":case "command":switch(a.attr("type")){case n:case "command":case "menuitem":h={name:a.attr("label"),disabled:!!a.attr("disabled"),icon:a.attr("icon"),callback:function(){return function(){a.get(0).click()}}()};break;case "checkbox":h={type:"checkbox",disabled:!!a.attr("disabled"),name:a.attr("label"),selected:!!a.attr("checked")};break;case "radio":h=
{type:"radio",disabled:!!a.attr("disabled"),name:a.attr("label"),radio:a.attr("radiogroup"),value:a.attr("id"),selected:!!a.attr("checked")};break;default:h=n}break;case "hr":h="-------";break;case "input":switch(a.attr("type")){case "text":h={type:"text",name:g||t(d),disabled:!!a.attr("disabled"),value:a.val()};break;case "checkbox":h={type:"checkbox",name:g||t(d),disabled:!!a.attr("disabled"),selected:!!a.attr("checked")};break;case "radio":h={type:"radio",name:g||t(d),disabled:!!a.attr("disabled"),
radio:!!a.attr("name"),value:a.val(),selected:!!a.attr("checked")};break;default:h=n}break;case "select":h={type:"select",name:g||t(d),disabled:!!a.attr("disabled"),selected:a.val(),options:{}};a.children().each(function(){h.options[this.value]=c(this).text()});break;case "textarea":h={type:"textarea",name:g||t(d),disabled:!!a.attr("disabled"),value:a.val()};break;case "label":break;default:h={type:"html",html:a.clone(!0)}}h&&(e++,b["key"+e]=h)});return e}c.support.htmlMenuitem="HTMLMenuItemElement"in
window;c.support.htmlCommand="HTMLCommandElement"in window;c.support.eventSelectstart="onselectstart"in document.documentElement;c.ui&&c.widget||(c.cleanData=function(b){return function(a){var e,f;for(f=0;null!=a[f];f++){var d=a[f];try{(e=c._data(d,"events"))&&e.remove&&c(d).triggerHandler("remove")}catch(k){}}b(a)}}(c.cleanData));var m=null,z=!1,v=c(window),A=0,w={},q={},B={},C={selector:null,appendTo:null,trigger:"right",autoHide:!1,delay:200,reposition:!0,hideOnSecondTrigger:!1,selectableSubMenu:!1,
classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",visible:"context-menu-visible",notSelectable:"context-menu-not-selectable",icon:"context-menu-icon",iconEdit:"context-menu-icon-edit",iconCut:"context-menu-icon-cut",iconCopy:"context-menu-icon-copy",iconPaste:"context-menu-icon-paste",iconDelete:"context-menu-icon-delete",iconAdd:"context-menu-icon-add",iconQuit:"context-menu-icon-quit",iconLoadingClass:"context-menu-icon-loading"},determinePosition:function(b){if(c.ui&&c.ui.position)b.css("display",
"block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none");else{var a=this.offset();a.top+=this.outerHeight();a.left+=this.outerWidth()/2-b.outerWidth()/2;b.css(a)}},position:function(b,a,e){if(a||e){if("maintain"===a&&"maintain"===e)a=b.$menu.position();else{var c=b.$menu.offsetParent().offset();a={top:e-c.top,left:a-c.left}}e=v.scrollTop()+v.height();c=v.scrollLeft()+v.width();var d=b.$menu.outerHeight(),k=b.$menu.outerWidth();a.top+d>e&&(a.top-=
d);0>a.top&&(a.top=0);a.left+k>c&&(a.left-=k);0>a.left&&(a.left=0);b.$menu.css(a)}else b.determinePosition.call(this,b.$menu)},positionSubmenu:function(b){if("undefined"!==typeof b)if(c.ui&&c.ui.position)b.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display","");else{var a={top:-9,left:this.outerWidth()-5};b.css(a)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{preShow:c.noop,show:c.noop,hide:c.noop,activated:c.noop},
callback:null,items:{}},y=null,D=null,E=null,F,G=function(b){for(var a=0;a=Math.max(a,parseInt(b.css("z-index"),10)||0),b=b.parent(),b&&b.length&&!(-1<"html body".indexOf(b.prop("nodeName").toLowerCase())););return a},l={abortevent:function(b){b.preventDefault();b.stopImmediatePropagation()},contextmenu:function(b){var a=c(this);if(!1!==b.data.events.preShow(a,b)&&("right"===b.data.trigger&&(b.preventDefault(),b.stopImmediatePropagation()),!("right"!==b.data.trigger&&"demand"!==b.data.trigger&&b.originalEvent||
"undefined"!==typeof b.mouseButton&&b.data&&!("left"===b.data.trigger&&0===b.mouseButton||"right"===b.data.trigger&&2===b.mouseButton)||a.hasClass("context-menu-active")||a.hasClass("context-menu-disabled")))){m=a;if(b.data.build){var e=b.data.build(m,b);if(!1===e)return;b.data=c.extend(!0,{},C,b.data,e||{});if(!b.data.items||c.isEmptyObject(b.data.items))throw window.console&&(console.error||console.log).call(console,"No items specified to show in contextMenu"),Error("No Items specified");b.data.$trigger=
m;p.create(b.data)}p.show.call(a,b.data,b.pageX,b.pageY)}},click:function(b){b.preventDefault();b.stopImmediatePropagation();c(this).trigger(c.Event("contextmenu",{data:b.data,pageX:b.pageX,pageY:b.pageY}))},mousedown:function(b){var a=c(this);m&&m.length&&!m.is(a)&&m.data("contextMenu").$menu.trigger("contextmenu:hide");2===b.button&&(m=a.data("contextMenuActive",!0))},mouseup:function(b){var a=c(this);a.data("contextMenuActive")&&m&&m.length&&m.is(a)&&!a.hasClass("context-menu-disabled")&&(b.preventDefault(),
b.stopImmediatePropagation(),m=a,a.trigger(c.Event("contextmenu",{data:b.data,pageX:b.pageX,pageY:b.pageY})));a.removeData("contextMenuActive")},mouseenter:function(b){var a=c(this),e=c(b.relatedTarget),f=c(document);e.is(".context-menu-list")||e.closest(".context-menu-list").length||m&&m.length||(D=b.pageX,E=b.pageY,F=b.data,f.on("mousemove.contextMenuShow",l.mousemove),y=setTimeout(function(){y=null;f.off("mousemove.contextMenuShow");m=a;a.trigger(c.Event("contextmenu",{data:F,pageX:D,pageY:E}))},
b.data.delay))},mousemove:function(b){D=b.pageX;E=b.pageY},mouseleave:function(b){b=c(b.relatedTarget);if(!b.is(".context-menu-list")&&!b.closest(".context-menu-list").length){try{clearTimeout(y)}catch(a){}y=null}},layerClick:function(b){var a=c(this).data("contextMenuRoot"),e=b.button,f=b.pageX,d=b.pageY,k=f===n,g,h;b.preventDefault();setTimeout(function(){if(k)null!==a&&"undefined"!==typeof a&&null!==a.$menu&&"undefined"!==typeof a.$menu&&a.$menu.trigger("contextmenu:hide");else{var l="left"===
a.trigger&&0===e||"right"===a.trigger&&2===e;if(document.elementFromPoint&&a.$layer){a.$layer.hide();g=document.elementFromPoint(f-v.scrollLeft(),d-v.scrollTop());if(g.isContentEditable){var m=document.createRange();var x=window.getSelection();m.selectNode(g);m.collapse(!0);x.removeAllRanges();x.addRange(m)}c(g).trigger(b);a.$layer.show()}if(a.hideOnSecondTrigger&&l&&null!==a.$menu&&"undefined"!==typeof a.$menu)a.$menu.trigger("contextmenu:hide");else{if(a.reposition&&l)if(document.elementFromPoint){if(a.$trigger.is(g)){a.position.call(a.$trigger,
a,f,d);return}}else if(h=a.$trigger.offset(),m=c(window),h.top+=m.scrollTop(),h.top<=b.pageY&&(h.left+=m.scrollLeft(),h.left<=b.pageX&&(h.bottom=h.top+a.$trigger.outerHeight(),h.bottom>=b.pageY&&(h.right=h.left+a.$trigger.outerWidth(),h.right>=b.pageX)))){a.position.call(a.$trigger,a,f,d);return}if(g&&l)a.$trigger.one("contextmenu:hidden",function(){c(g).contextMenu({x:f,y:d,button:e})});null!==a&&"undefined"!==typeof a&&null!==a.$menu&&"undefined"!==typeof a.$menu&&a.$menu.trigger("contextmenu:hide")}}},
50)},keyStop:function(b,a){a.isInput||b.preventDefault();b.stopPropagation()},key:function(b){var a={};m&&(a=m.data("contextMenu")||{});"undefined"===typeof a.zIndex&&(a.zIndex=0);var c=0,f=function(a){""!==a.style.zIndex?c=a.style.zIndex:null!==a.offsetParent&&"undefined"!==typeof a.offsetParent?f(a.offsetParent):null!==a.parentElement&&"undefined"!==typeof a.parentElement&&f(a.parentElement)};f(b.target);if(!(a.$menu&&parseInt(c,10)>parseInt(a.$menu.css("zIndex"),10))){switch(b.keyCode){case 9:case 38:l.keyStop(b,
a);if(a.isInput){if(9===b.keyCode&&b.shiftKey){b.preventDefault();a.$selected&&a.$selected.find("input, textarea, select").blur();null!==a.$menu&&"undefined"!==typeof a.$menu&&a.$menu.trigger("prevcommand");return}if(38===b.keyCode&&"checkbox"===a.$selected.find("input, textarea, select").prop("type")){b.preventDefault();return}}else if(9!==b.keyCode||b.shiftKey){null!==a.$menu&&"undefined"!==typeof a.$menu&&a.$menu.trigger("prevcommand");return}break;case 40:l.keyStop(b,a);if(a.isInput){if(9===b.keyCode){b.preventDefault();
a.$selected&&a.$selected.find("input, textarea, select").blur();null!==a.$menu&&"undefined"!==typeof a.$menu&&a.$menu.trigger("nextcommand");return}if(40===b.keyCode&&"checkbox"===a.$selected.find("input, textarea, select").prop("type")){b.preventDefault();return}}else{null!==a.$menu&&"undefined"!==typeof a.$menu&&a.$menu.trigger("nextcommand");return}break;case 37:l.keyStop(b,a);if(a.isInput||!a.$selected||!a.$selected.length)break;if(!a.$selected.parent().hasClass("context-menu-root")){b=a.$selected.parent().parent();
a.$selected.trigger("contextmenu:blur");a.$selected=b;return}break;case 39:l.keyStop(b,a);if(a.isInput||!a.$selected||!a.$selected.length)break;var d=a.$selected.data("contextMenu")||{};if(d.$menu&&a.$selected.hasClass("context-menu-submenu")){a.$selected=null;d.$selected=null;d.$menu.trigger("nextcommand");return}break;case 35:case 36:a.$selected&&a.$selected.find("input, textarea, select").length||((a.$selected&&a.$selected.parent()||a.$menu).children(":not(."+a.classNames.disabled+", ."+a.classNames.notSelectable+
")")[36===b.keyCode?"first":"last"]().trigger("contextmenu:focus"),b.preventDefault());return;case 13:l.keyStop(b,a);if(a.isInput){if(a.$selected&&!a.$selected.is("textarea, select")){b.preventDefault();return}break}"undefined"!==typeof a.$selected&&null!==a.$selected&&a.$selected.trigger("mouseup");return;case 32:case 33:case 34:l.keyStop(b,a);return;case 27:l.keyStop(b,a);null!==a.$menu&&"undefined"!==typeof a.$menu&&a.$menu.trigger("contextmenu:hide");return;default:if(d=String.fromCharCode(b.keyCode).toUpperCase(),
a.accesskeys&&a.accesskeys[d]){a.accesskeys[d].$node.trigger(a.accesskeys[d].$menu?"contextmenu:focus":"mouseup");return}}b.stopPropagation();"undefined"!==typeof a.$selected&&null!==a.$selected&&a.$selected.trigger(b)}},prevItem:function(b){b.stopPropagation();var a=c(this).data("contextMenu")||{},e=c(this).data("contextMenuRoot")||{};if(a.$selected){var f=a.$selected;a=a.$selected.parent().data("contextMenu")||{};a.$selected=f}f=a.$menu.children();for(var d=a.$selected&&a.$selected.prev().length?
a.$selected.prev():f.last(),k=d;d.hasClass(e.classNames.disabled)||d.hasClass(e.classNames.notSelectable)||d.is(":hidden");)if(d=d.prev().length?d.prev():f.last(),d.is(k))return;a.$selected&&l.itemMouseleave.call(a.$selected.get(0),b);l.itemMouseenter.call(d.get(0),b);b=d.find("input, textarea, select");b.length&&b.focus()},nextItem:function(b){b.stopPropagation();var a=c(this).data("contextMenu")||{},e=c(this).data("contextMenuRoot")||{};if(a.$selected){var f=a.$selected;a=a.$selected.parent().data("contextMenu")||
{};a.$selected=f}f=a.$menu.children();for(var d=a.$selected&&a.$selected.next().length?a.$selected.next():f.first(),k=d;d.hasClass(e.classNames.disabled)||d.hasClass(e.classNames.notSelectable)||d.is(":hidden");)if(d=d.next().length?d.next():f.first(),d.is(k))return;a.$selected&&l.itemMouseleave.call(a.$selected.get(0),b);l.itemMouseenter.call(d.get(0),b);b=d.find("input, textarea, select");b.length&&b.focus()},focusInput:function(){var b=c(this).closest(".context-menu-item"),a=b.data(),e=a.contextMenu;
a=a.contextMenuRoot;a.$selected=e.$selected=b;a.isInput=e.isInput=!0},blurInput:function(){var b=c(this).closest(".context-menu-item").data();b.contextMenuRoot.isInput=b.contextMenu.isInput=!1},menuMouseenter:function(){c(this).data().contextMenuRoot.hovering=!0},menuMouseleave:function(b){var a=c(this).data().contextMenuRoot;a.$layer&&a.$layer.is(b.relatedTarget)&&(a.hovering=!1)},itemMouseenter:function(b){var a=c(this),e=a.data(),f=e.contextMenu;e=e.contextMenuRoot;e.hovering=!0;b&&e.$layer&&e.$layer.is(b.relatedTarget)&&
(b.preventDefault(),b.stopImmediatePropagation());(f.$menu?f:e).$menu.children("."+e.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur");a.hasClass(e.classNames.disabled)||a.hasClass(e.classNames.notSelectable)?f.$selected=null:a.trigger("contextmenu:focus")},itemMouseleave:function(b){var a=c(this),e=a.data(),f=e.contextMenu;e=e.contextMenuRoot;e!==f&&e.$layer&&e.$layer.is(b.relatedTarget)?("undefined"!==typeof e.$selected&&null!==e.$selected&&e.$selected.trigger("contextmenu:blur"),
b.preventDefault(),b.stopImmediatePropagation(),e.$selected=f.$selected=f.$node):f&&f.$menu&&f.$menu.hasClass("context-menu-visible")||a.trigger("contextmenu:blur")},itemClick:function(b){var a=c(this),e=a.data(),f=e.contextMenu,d=e.contextMenuRoot;e=e.contextMenuKey;if(!(!f.items[e]||a.is("."+d.classNames.disabled+", .context-menu-separator, ."+d.classNames.notSelectable)||a.is(".context-menu-submenu")&&!1===d.selectableSubMenu)){b.preventDefault();b.stopImmediatePropagation();if(c.isFunction(f.callbacks[e])&&
Object.prototype.hasOwnProperty.call(f.callbacks,e))a=f.callbacks[e];else if(c.isFunction(d.callback))a=d.callback;else return;!1!==a.call(d.$trigger,e,d,b)?d.$menu.trigger("contextmenu:hide"):d.$menu.parent().length&&p.update.call(d.$trigger,d)}},inputClick:function(b){b.stopImmediatePropagation()},hideMenu:function(b,a){b=c(this).data("contextMenuRoot");p.hide.call(b.$trigger,b,a&&a.force)},focusItem:function(b){b.stopPropagation();b=c(this);var a=b.data(),e=a.contextMenu;a=a.contextMenuRoot;b.hasClass(a.classNames.disabled)||
b.hasClass(a.classNames.notSelectable)||(b.addClass([a.classNames.hover,a.classNames.visible].join(" ")).parent().find(".context-menu-item").not(b).removeClass(a.classNames.visible).filter("."+a.classNames.hover).trigger("contextmenu:blur"),e.$selected=a.$selected=b,e&&e.$node&&e.$node.hasClass("context-menu-submenu")&&e.$node.addClass(a.classNames.hover),e.$node&&a.positionSubmenu.call(e.$node,e.$menu))},blurItem:function(b){b.stopPropagation();b=c(this);var a=b.data(),e=a.contextMenu;a=a.contextMenuRoot;
e.autoHide&&b.removeClass(a.classNames.visible);b.removeClass(a.classNames.hover);e.$selected=null}},p={show:function(b,a,e){var f=c(this),d={};c("#context-menu-layer").trigger("mousedown");b.$trigger=f;if(!1===b.events.show.call(f,b))m=null;else if(!1===p.update.call(f,b))m=null;else if(b.position.call(f,b,a,e),b.zIndex&&(a=b.zIndex,"function"===typeof b.zIndex&&(a=b.zIndex.call(f,b)),d.zIndex=G(f)+a),p.layer.call(b.$menu,b,d.zIndex),b.$menu.find("ul").css("zIndex",d.zIndex+1),b.$menu.css(d)[b.animation.show](b.animation.duration,
function(){f.trigger("contextmenu:visible");p.activated(b);b.events.activated(b)}),f.data("contextMenu",b).addClass("context-menu-active"),c(document).off("keydown.contextMenu").on("keydown.contextMenu",l.key),b.autoHide)c(document).on("mousemove.contextMenuAutoHide",function(a){var d=f.offset();d.right=d.left+f.outerWidth();d.bottom=d.top+f.outerHeight();!b.$layer||b.hovering||a.pageX>=d.left&&a.pageX<=d.right&&a.pageY>=d.top&&a.pageY<=d.bottom||setTimeout(function(){b.hovering||null===b.$menu||
"undefined"===typeof b.$menu||b.$menu.trigger("contextmenu:hide")},50)})},hide:function(b,a){var e=c(this);b||(b=e.data("contextMenu")||{});if(a||!b.events||!1!==b.events.hide.call(e,b)){e.removeData("contextMenu").removeClass("context-menu-active");if(b.$layer){setTimeout(function(a){return function(){a.remove()}}(b.$layer),10);try{delete b.$layer}catch(f){b.$layer=null}}m=null;b.$menu.find("."+b.classNames.hover).trigger("contextmenu:blur");b.$selected=null;b.$menu.find("."+b.classNames.visible).removeClass(b.classNames.visible);
c(document).off(".contextMenuAutoHide").off("keydown.contextMenu");if(b.$menu)b.$menu[b.animation.hide](b.animation.duration,function(){b.build&&(b.$menu.remove(),c.each(b,function(a){switch(a){case "ns":case "selector":case "build":case "trigger":return!0;default:b[a]=n;try{delete b[a]}catch(d){}return!0}}));setTimeout(function(){e.trigger("contextmenu:hidden")},10)})}},create:function(b,a){function e(a){var b=c("<span></span>");if(a._accesskey)a._beforeAccesskey&&b.append(document.createTextNode(a._beforeAccesskey)),
c("<span></span>").addClass("context-menu-accesskey").text(a._accesskey).appendTo(b),a._afterAccesskey&&b.append(document.createTextNode(a._afterAccesskey));else if(a.isHtmlName){if("undefined"!==typeof a.accesskey)throw Error("accesskeys are not compatible with HTML names and cannot be used together in the same item");b.html(a.name)}else b.text(a.name);return b}"undefined"===typeof a&&(a=b);b.$menu=c('<ul class="context-menu-list"></ul>').addClass(b.className||"").data({contextMenu:b,contextMenuRoot:a});
c.each(["callbacks","commands","inputs"],function(c,d){b[d]={};a[d]||(a[d]={})});a.accesskeys||(a.accesskeys={});c.each(b.items,function(f,d){var k=c('<li class="context-menu-item"></li>').addClass(d.className||""),g=null,h=null;k.on("click",c.noop);if("string"===typeof d||"cm_separator"===d.type)d={type:"cm_seperator"};d.$node=k.data({contextMenu:b,contextMenuRoot:a,contextMenuKey:f});if("undefined"!==typeof d.accesskey)for(var m=r(d.accesskey),n=0,x;x=m[n];n++)if(!a.accesskeys[x]){a.accesskeys[x]=
d;if(m=d.name.match(new RegExp("^(.*?)("+x+")(.*)$","i")))d._beforeAccesskey=m[1],d._accesskey=m[2],d._afterAccesskey=m[3];break}if(d.type&&B[d.type])B[d.type].call(k,d,b,a),c.each([b,a],function(a,e){e.commands[f]=d;!c.isFunction(d.callback)||"undefined"!==typeof e.callbacks[f]&&"undefined"!==typeof b.type||(e.callbacks[f]=d.callback)});else{"cm_seperator"===d.type?k.addClass("context-menu-separator "+a.classNames.notSelectable):"html"===d.type?k.addClass("context-menu-html "+a.classNames.notSelectable):
"sub"!==d.type&&d.type?(g=c("<label></label>").appendTo(k),e(d).appendTo(g),k.addClass("context-menu-input"),b.hasTypes=!0,c.each([b,a],function(a,b){b.commands[f]=d;b.inputs[f]=d})):d.items&&(d.type="sub");switch(d.type){case "cm_seperator":break;case "text":h=c('<input type="text" value="1" name="" />').attr("name","context-menu-input-"+f).val(d.value||"").appendTo(g);break;case "textarea":h=c('<textarea name=""></textarea>').attr("name","context-menu-input-"+f).val(d.value||"").appendTo(g);d.height&&
h.height(d.height);break;case "checkbox":h=c('<input type="checkbox" value="1" name="" />').attr("name","context-menu-input-"+f).val(d.value||"").prop("checked",!!d.selected).prependTo(g);break;case "radio":h=c('<input type="radio" value="1" name="" />').attr("name","context-menu-input-"+d.radio).val(d.value||"").prop("checked",!!d.selected).prependTo(g);break;case "select":h=c('<select name=""></select>').attr("name","context-menu-input-"+f).appendTo(g);d.options&&(c.each(d.options,function(a,b){c("<option></option>").val(a).text(b).appendTo(h)}),
h.val(d.selected));break;case "sub":e(d).appendTo(k);d.appendTo=d.$node;k.data("contextMenu",d).addClass("context-menu-submenu");d.callback=null;"function"===typeof d.items.then?p.processPromises(d,a,d.items):p.create(d,a);break;case "html":c(d.html).appendTo(k);break;default:c.each([b,a],function(a,e){e.commands[f]=d;!c.isFunction(d.callback)||"undefined"!==typeof e.callbacks[f]&&"undefined"!==typeof b.type||(e.callbacks[f]=d.callback)}),e(d).appendTo(k)}if(d.type&&"sub"!==d.type&&"html"!==d.type&&
"cm_seperator"!==d.type&&(h.on("focus",l.focusInput).on("blur",l.blurInput),d.events))h.on(d.events,b);d.icon&&(c.isFunction(d.icon)?d._icon=d.icon.call(this,this,k,f,d):"string"!==typeof d.icon||"fab "!==d.icon.substring(0,4)&&"fas "!==d.icon.substring(0,4)&&"far "!==d.icon.substring(0,4)&&"fal "!==d.icon.substring(0,4)?"string"===typeof d.icon&&"fa-"===d.icon.substring(0,3)?d._icon=a.classNames.icon+" "+a.classNames.icon+"--fa fa "+d.icon:d._icon=a.classNames.icon+" "+a.classNames.icon+"-"+d.icon:
(k.addClass(a.classNames.icon+" "+a.classNames.icon+"--fa5"),d._icon=c('<i class="'+d.icon+'"></i>')),"string"===typeof d._icon?k.addClass(d._icon):k.prepend(d._icon))}d.$input=h;d.$label=g;k.appendTo(b.$menu);if(!b.hasTypes&&c.support.eventSelectstart)k.on("selectstart.disableTextSelect",l.abortevent)});b.$node||b.$menu.css("display","none").addClass("context-menu-root");b.$menu.appendTo(b.appendTo||document.body)},resize:function(b,a){var e;b.css({position:"absolute",display:"block"});b.data("width",
(e=b.get(0)).getBoundingClientRect?Math.ceil(e.getBoundingClientRect().width):b.outerWidth()+1);b.css({position:"static",minWidth:"0px",maxWidth:"100000px"});b.find("> li > ul").each(function(){p.resize(c(this),!0)});a||b.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return c(this).data("width")})},update:function(b,a){var e=this;"undefined"===typeof a&&(a=b,p.resize(b.$menu));var f=!1;b.$menu.children().each(function(){var d=c(this),k=d.data("contextMenuKey"),
g=b.items[k],h=c.isFunction(g.disabled)&&g.disabled.call(e,k,a)||!0===g.disabled,l;(l=c.isFunction(g.visible)?g.visible.call(e,k,a):"undefined"!==typeof g.visible?!0===g.visible:!0)&&(f=!0);d[l?"show":"hide"]();d[h?"addClass":"removeClass"](a.classNames.disabled);c.isFunction(g.icon)&&(d.removeClass(g._icon),k=g.icon.call(this,e,d,k,g),"string"===typeof k?d.addClass(k):d.prepend(k));if(g.type)switch(d.find("input, select, textarea").prop("disabled",h),g.type){case "text":case "textarea":g.$input.val(g.value||
"");break;case "checkbox":case "radio":g.$input.val(g.value||"").prop("checked",!!g.selected);break;case "select":g.$input.val((0===g.selected?"0":g.selected)||"")}g.$menu&&p.update.call(e,g,a)&&(f=!0)});return f},layer:function(b,a){b=b.$layer=c('<div id="context-menu-layer"></div>').css({height:v.height(),width:v.width(),display:"block",position:"fixed","z-index":a,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",b).insertBefore(this).on("contextmenu",
l.abortevent).on("mousedown",l.layerClick);"undefined"===typeof document.body.style.maxWidth&&b.css({position:"absolute",height:c(document).height()});return b},processPromises:function(b,a,e){function c(a,b,c){"undefined"===typeof c?(c={error:{name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}},window.console&&(console.error||console.log).call(console,'When you reject a promise, provide an "items" object, equal to normal sub-menu items')):"string"===typeof c&&(c={error:{name:c}});
d(a,b,c)}function d(a,b,d){"undefined"!==typeof b.$menu&&b.$menu.is(":visible")&&(a.$node.removeClass(b.classNames.iconLoadingClass),a.items=d,p.create(a,b,!0),p.update(a,b),b.positionSubmenu.call(a.$node,a.$menu))}b.$node.addClass(a.classNames.iconLoadingClass);e.then(function(a,b,e){"undefined"===typeof e&&c(n);d(a,b,e)}.bind(this,b,a),c.bind(this,b,a))},activated:function(b){b=b.$menu;var a=b.offset(),e=c(window).height(),f=c(window).scrollTop(),d=b.height();d>e?b.css({height:e+"px","overflow-x":"hidden",
"overflow-y":"auto",top:f+"px"}):(a.top<f||a.top+d>f+e)&&b.css({top:f+"px"})}};c.fn.contextMenu=function(b){var a=this;if(0<this.length)if("undefined"===typeof b)this.first().trigger("contextmenu");else if("undefined"!==typeof b.x&&"undefined"!==typeof b.y)this.first().trigger(c.Event("contextmenu",{pageX:b.x,pageY:b.y,mouseButton:b.button}));else if("hide"===b){var e=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null;e&&e.trigger("contextmenu:hide")}else"destroy"===b?c.contextMenu("destroy",
{context:this}):c.isPlainObject(b)?(b.context=this,c.contextMenu("create",b)):b?this.removeClass("context-menu-disabled"):b||this.addClass("context-menu-disabled");else c.each(q,function(){this.selector===a.selector&&(b.data=this,c.extend(b.data,{trigger:"demand"}))}),l.contextmenu.call(b.target,b);return this};c.contextMenu=function(b,a){"string"!==typeof b&&(a=b,b="create");"string"===typeof a?a={selector:a}:"undefined"===typeof a&&(a={});var e=c.extend(!0,{},C,a||{}),f=c(document),d=f,k=!1;e.context&&
e.context.length?(d=c(e.context).first(),e.context=d.get(0),k=!c(e.context).is(document)):e.context=document;switch(b){case "update":if(k)p.update(d);else for(var g in q)q.hasOwnProperty(g)&&p.update(q[g]);break;case "create":if(!e.selector)throw Error("No selector specified");if(e.selector.match(/.context-menu-(list|item|input)($|\s)/))throw Error('Cannot bind to selector "'+e.selector+'" as it contains a reserved className');if(!e.build&&(!e.items||c.isEmptyObject(e.items)))throw Error("No Items specified");
A++;e.ns=".contextMenu"+A;k||(w[e.selector]=e.ns);q[e.ns]=e;e.trigger||(e.trigger="right");z||(b={"contextmenu:focus.contextMenu":l.focusItem,"contextmenu:blur.contextMenu":l.blurItem,"contextmenu.contextMenu":l.abortevent,"mouseenter.contextMenu":l.itemMouseenter,"mouseleave.contextMenu":l.itemMouseleave},b["click"===e.itemClickEvent?"click.contextMenu":"mouseup.contextMenu"]=l.itemClick,f.on({"contextmenu:hide.contextMenu":l.hideMenu,"prevcommand.contextMenu":l.prevItem,"nextcommand.contextMenu":l.nextItem,
"contextmenu.contextMenu":l.abortevent,"mouseenter.contextMenu":l.menuMouseenter,"mouseleave.contextMenu":l.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",l.inputClick).on(b,".context-menu-item"),z=!0);d.on("contextmenu"+e.ns,e.selector,e,l.contextmenu);if(k)d.on("remove"+e.ns,function(){c(this).contextMenu("destroy")});switch(e.trigger){case "hover":d.on("mouseenter"+e.ns,e.selector,e,l.mouseenter).on("mouseleave"+e.ns,e.selector,e,l.mouseleave);break;case "left":d.on("click"+
e.ns,e.selector,e,l.click);break;case "touchstart":d.on("touchstart"+e.ns,e.selector,e,l.click)}e.build||p.create(e);break;case "destroy":if(k){var h=e.context;c.each(q,function(a,b){if(!b||!c(h).is(b.selector))return!0;m=c(".context-menu-list").filter(":visible");m.length&&m.data().contextMenuRoot.$trigger.is(c(b.context).find(b.selector))&&m.trigger("contextmenu:hide",{force:!0});try{q[b.ns].$menu&&q[b.ns].$menu.remove(),delete q[b.ns]}catch(I){q[b.ns]=null}c(b.context).off(b.ns);return!0})}else if(!e.selector)f.off(".contextMenu .contextMenuAutoHide"),
c.each(q,function(a,b){c(b.context).off(b.ns)}),w={},q={},A=0,z=!1,c("#context-menu-layer, .context-menu-list").remove();else if(w[e.selector]){var m=c(".context-menu-list").filter(":visible");m.length&&m.data().contextMenuRoot.$trigger.is(e.selector)&&m.trigger("contextmenu:hide",{force:!0});try{q[w[e.selector]].$menu&&q[w[e.selector]].$menu.remove(),delete q[w[e.selector]]}catch(H){q[w[e.selector]]=null}f.off(w[e.selector])}break;case "html5":(!c.support.htmlCommand&&!c.support.htmlMenuitem||"boolean"===
typeof a&&a)&&c('menu[type="context"]').each(function(){this.id&&c.contextMenu({selector:"[contextmenu="+this.id+"]",items:c.contextMenu.fromMenu(this)})}).css("display","none");break;default:throw Error('Unknown operation "'+b+'"');}return this};c.contextMenu.setInputValues=function(b,a){"undefined"===typeof a&&(a={});c.each(b.inputs,function(b,c){switch(c.type){case "text":case "textarea":c.value=a[b]||"";break;case "checkbox":c.selected=a[b]?!0:!1;break;case "radio":c.selected=(a[c.radio]||"")===
c.value;break;case "select":c.selected=a[b]||""}})};c.contextMenu.getInputValues=function(b,a){"undefined"===typeof a&&(a={});c.each(b.inputs,function(b,c){switch(c.type){case "text":case "textarea":case "select":a[b]=c.$input.val();break;case "checkbox":a[b]=c.$input.prop("checked");break;case "radio":c.$input.prop("checked")&&(a[c.radio]=c.value)}});return a};c.contextMenu.fromMenu=function(b){b=c(b);var a={};u(a,b.children());return a};c.contextMenu.defaults=C;c.contextMenu.types=B;c.contextMenu.handle=
l;c.contextMenu.op=p;c.contextMenu.menus=q})(jQuery);
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(k,w,r){k!=Array.prototype&&k!=Object.prototype&&(k[w]=r.value)};$jscomp.getGlobal=function(k){return"undefined"!=typeof window&&window===k?k:"undefined"!=typeof global&&null!=global?global:k};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(k,w,r,g){if(w){r=$jscomp.global;k=k.split(".");for(g=0;g<k.length-1;g++){var h=k[g];h in r||(r[h]={});r=r[h]}k=k[k.length-1];g=r[k];w=w(g);w!=g&&null!=w&&$jscomp.defineProperty(r,k,{configurable:!0,writable:!0,value:w})}};$jscomp.polyfill("Array.prototype.fill",function(k){return k?k:function(k,r,g){var h=this.length||0;0>r&&(r=Math.max(0,h+r));if(null==g||g>h)g=h;g=Number(g);0>g&&(g=Math.max(0,h+g));for(r=Number(r||0);r<g;r++)this[r]=k;return this}},"es6","es3");
$jscomp.findInternal=function(k,w,r){k instanceof String&&(k=String(k));for(var g=k.length,h=0;h<g;h++){var v=k[h];if(w.call(r,v,h,k))return{i:h,v:v}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(k){return k?k:function(k,r){return $jscomp.findInternal(this,k,r).v}},"es6","es3");
(function(k){k.color={};k.color.make=function(r,g,h,v){var n={};n.r=r||0;n.g=g||0;n.b=h||0;n.a=null!=v?v:1;n.add=function(h,k){for(var g=0;g<h.length;++g)n[h.charAt(g)]+=k;return n.normalize()};n.scale=function(h,k){for(var g=0;g<h.length;++g)n[h.charAt(g)]*=k;return n.normalize()};n.toString=function(){return 1<=n.a?"rgb("+[n.r,n.g,n.b].join()+")":"rgba("+[n.r,n.g,n.b,n.a].join()+")"};n.normalize=function(){function h(h,k,n){return k<h?h:k>n?n:k}n.r=h(0,parseInt(n.r),255);n.g=h(0,parseInt(n.g),255);
n.b=h(0,parseInt(n.b),255);n.a=h(0,n.a,1);return n};n.clone=function(){return k.color.make(n.r,n.b,n.g,n.a)};return n.normalize()};k.color.extract=function(r,g){do{var h=r.css(g).toLowerCase();if(""!=h&&"transparent"!=h)break;r=r.parent()}while(r.length&&!k.nodeName(r.get(0),"body"));"rgba(0, 0, 0, 0)"==h&&(h="transparent");return k.color.parse(h)};k.color.parse=function(r){var g,h=k.color.make;if(g=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(r))return h(parseInt(g[1],10),
parseInt(g[2],10),parseInt(g[3],10));if(g=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(r))return h(parseInt(g[1],10),parseInt(g[2],10),parseInt(g[3],10),parseFloat(g[4]));if(g=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(r))return h(2.55*parseFloat(g[1]),2.55*parseFloat(g[2]),2.55*parseFloat(g[3]));if(g=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(r))return h(2.55*
parseFloat(g[1]),2.55*parseFloat(g[2]),2.55*parseFloat(g[3]),parseFloat(g[4]));if(g=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(r))return h(parseInt(g[1],16),parseInt(g[2],16),parseInt(g[3],16));if(g=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(r))return h(parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16),parseInt(g[3]+g[3],16));r=k.trim(r).toLowerCase();if("transparent"==r)return h(255,255,255,0);g=w[r]||[0,0,0];return h(g[0],g[1],g[2])};var w={aqua:[0,255,255],azure:[240,255,255],beige:[245,
245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,
144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
(function(k){function w(h,g){var n=g.children("."+h)[0];if(null==n&&(n=document.createElement("canvas"),n.className=h,k(n).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(g),!n.getContext))if(window.G_vmlCanvasManager)n=window.G_vmlCanvasManager.initElement(n);else throw Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");this.element=
n;h=this.context=n.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(h.webkitBackingStorePixelRatio||h.mozBackingStorePixelRatio||h.msBackingStorePixelRatio||h.oBackingStorePixelRatio||h.backingStorePixelRatio||1);this.resize(g.width(),g.height());this.textContainer=null;this.text={};this._textCache={}}function r(h,g,n,r){function v(a,b){b=[x].concat(b);for(var c=0;c<a.length;++c)a[c].apply(this,b)}function E(a){for(var b=[],c=0;c<a.length;++c){var e=k.extend(!0,{},f.series);null!=a[c].data?
(e.data=a[c].data,delete a[c].data,k.extend(!0,e,a[c]),a[c].data=e.data):e.data=a[c];b.push(e)}y=b;c=y.length;b=-1;for(a=0;a<y.length;++a)e=y[a].color,null!=e&&(c--,"number"==typeof e&&e>b&&(b=e));c<=b&&(c=b+1);b=[];var d=f.colors,u=d.length,p=0;for(a=0;a<c;a++)e=k.color.parse(d[a%u]||"#666"),0==a%u&&a&&(p=0<=p?.5>p?-p-.2:0:-p),b[a]=e.scale("rgb",1+p);for(a=c=0;a<y.length;++a){e=y[a];null==e.color?(e.color=b[c].toString(),++c):"number"==typeof e.color&&(e.color=b[e.color].toString());if(null==e.lines.show){var t;
d=!0;for(t in e)if(e[t]&&e[t].show){d=!1;break}d&&(e.lines.show=!0)}null==e.lines.zero&&(e.lines.zero=!!e.lines.fill);e.xaxis=K(A,F(e,"x"));e.yaxis=K(I,F(e,"y"))}ma()}function F(a,b){a=a[b+"axis"];"object"==typeof a&&(a=a.n);"number"!=typeof a&&(a=1);return a}function B(){return k.grep(A.concat(I),function(a){return a})}function L(a){var b={},c,e;for(c=0;c<A.length;++c)(e=A[c])&&e.used&&(b["x"+e.n]=e.c2p(a.left));for(c=0;c<I.length;++c)(e=I[c])&&e.used&&(b["y"+e.n]=e.c2p(a.top));void 0!==b.x1&&(b.x=
b.x1);void 0!==b.y1&&(b.y=b.y1);return b}function K(a,b){a[b-1]||(a[b-1]={n:b,direction:a==A?"x":"y",options:k.extend(!0,{},a==A?f.xaxis:f.yaxis)});return a[b-1]}function ma(){function a(a,b,d){b<a.datamin&&b!=-e&&(a.datamin=b);d>a.datamax&&d!=e&&(a.datamax=d)}var b=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,e=Number.MAX_VALUE,d,u,p,t,f;k.each(B(),function(a,d){d.datamin=b;d.datamax=c;d.used=!1});for(d=0;d<y.length;++d){var m=y[d];m.datapoints={points:[]};v(H.processRawData,[m,m.data,m.datapoints])}for(d=
0;d<y.length;++d){m=y[d];var h=m.data;var l=m.datapoints.format;if(!l){l=[];l.push({x:!0,number:!0,required:!0});l.push({y:!0,number:!0,required:!0});if(m.bars.show||m.lines.show&&m.lines.fill)l.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:!!(m.bars.show&&m.bars.zero||m.lines.show&&m.lines.zero)}),m.bars.horizontal&&(delete l[l.length-1].y,l[l.length-1].x=!0);m.datapoints.format=l}if(null==m.datapoints.pointsize){m.datapoints.pointsize=l.length;var n=m.datapoints.pointsize;var g=m.datapoints.points;
var q=m.lines.show&&m.lines.steps;m.xaxis.used=m.yaxis.used=!0;for(u=p=0;u<h.length;++u,p+=n){var Q=h[u];var U=null==Q;if(!U)for(t=0;t<n;++t){var z=Q[t];if(f=l[t])f.number&&null!=z&&(z=+z,isNaN(z)?z=null:Infinity==z?z=e:-Infinity==z&&(z=-e)),null==z&&(f.required&&(U=!0),null!=f.defaultValue&&(z=f.defaultValue));g[p+t]=z}if(U)for(t=0;t<n;++t)z=g[p+t],null!=z&&(f=l[t],!1!==f.autoscale&&(f.x&&a(m.xaxis,z,z),f.y&&a(m.yaxis,z,z))),g[p+t]=null;else if(q&&0<p&&null!=g[p-n]&&g[p-n]!=g[p]&&g[p-n+1]!=g[p+1]){for(t=
0;t<n;++t)g[p+n+t]=g[p+t];g[p+1]=g[p-n+1];p+=n}}}}for(d=0;d<y.length;++d)m=y[d],v(H.processDatapoints,[m,m.datapoints]);for(d=0;d<y.length;++d){m=y[d];g=m.datapoints.points;n=m.datapoints.pointsize;l=m.datapoints.format;Q=p=b;q=h=c;for(u=0;u<g.length;u+=n)if(null!=g[u])for(t=0;t<n;++t)z=g[u+t],(f=l[t])&&!1!==f.autoscale&&z!=e&&z!=-e&&(f.x&&(z<p&&(p=z),z>h&&(h=z)),f.y&&(z<Q&&(Q=z),z>q&&(q=z)));if(m.bars.show){switch(m.bars.align){case "left":u=0;break;case "right":u=-m.bars.barWidth;break;default:u=
-m.bars.barWidth/2}m.bars.horizontal?(Q+=u,q+=u+m.bars.barWidth):(p+=u,h+=u+m.bars.barWidth)}a(m.xaxis,p,h);a(m.yaxis,Q,q)}k.each(B(),function(a,d){d.datamin==b&&(d.datamin=null);d.datamax==c&&(d.datamax=null)})}function X(){S&&clearTimeout(S);M.unbind("mousemove",Y);M.unbind("mouseleave",Z);M.unbind("click",aa);v(H.shutdown,[M])}function na(a){function b(a){return a}var c=a.options.transform||b,e=a.options.inverseTransform;if("x"==a.direction){var d=a.scale=N/Math.abs(c(a.max)-c(a.min));var u=Math.min(c(a.max),
c(a.min))}else d=a.scale=J/Math.abs(c(a.max)-c(a.min)),d=-d,u=Math.max(c(a.max),c(a.min));a.p2c=c==b?function(a){return(a-u)*d}:function(a){return(c(a)-u)*d};a.c2p=e?function(a){return e(u+a/d)}:function(a){return u+a/d}}function oa(a){var b=a.labelWidth,c=a.labelHeight,e=a.options.position,d="x"===a.direction,u=a.options.tickLength,p=f.grid.axisMargin,t=f.grid.labelMargin,h=!0,m=!0,l=!0,n=!1;k.each(d?A:I,function(b,d){d&&(d.show||d.reserveSpace)&&(d===a?n=!0:d.options.position===e&&(n?m=!1:h=!1),
n||(l=!1))});m&&(p=0);null==u&&(u=l?"full":5);isNaN(+u)||(t+=+u);d?(c+=t,"bottom"==e?(q.bottom+=c+p,a.box={top:C.height-q.bottom,height:c}):(a.box={top:q.top+p,height:c},q.top+=c+p)):(b+=t,"left"==e?(a.box={left:q.left+p,width:b},q.left+=b+p):(q.right+=b+p,a.box={left:C.width-q.right,width:b}));a.position=e;a.tickLength=u;a.box.padding=t;a.innermost=h}function pa(){var a=f.grid.minBorderMargin,b;if(null==a)for(b=a=0;b<y.length;++b)a=Math.max(a,2*(y[b].points.radius+y[b].points.lineWidth/2));var c=
a,e=a,d=a,u=a;k.each(B(),function(a,b){b.reserveSpace&&b.ticks&&b.ticks.length&&("x"===b.direction?(c=Math.max(c,b.labelWidth/2),e=Math.max(e,b.labelWidth/2)):(u=Math.max(u,b.labelHeight/2),d=Math.max(d,b.labelHeight/2)))});q.left=Math.ceil(Math.max(c,q.left));q.right=Math.ceil(Math.max(e,q.right));q.top=Math.ceil(Math.max(d,q.top));q.bottom=Math.ceil(Math.max(u,q.bottom))}function ba(){var a,b=B(),c=f.grid.show;for(a in q){var e=f.grid.margin||0;q[a]="number"==typeof e?e:e[a]||0}v(H.processOffset,
[q]);for(a in q)q[a]="object"==typeof f.grid.borderWidth?q[a]+(c?f.grid.borderWidth[a]:0):q[a]+(c?f.grid.borderWidth:0);k.each(b,function(a,b){a=b.options;b.show=null==a.show?b.used:a.show;b.reserveSpace=null==a.reserveSpace?b.show:a.reserveSpace;a=b.options;var d=+(null!=a.min?a.min:b.datamin),c=+(null!=a.max?a.max:b.datamax),e=c-d;if(0==e){if(e=0==c?1:.01,null==a.min&&(d-=e),null==a.max||null!=a.min)c+=e}else{var m=a.autoscaleMargin;null!=m&&(null==a.min&&(d-=e*m,0>d&&null!=b.datamin&&0<=b.datamin&&
(d=0)),null==a.max&&(c+=e*m,0<c&&null!=b.datamax&&0>=b.datamax&&(c=0)))}b.min=d;b.max=c});if(c){e=k.grep(b,function(a){return a.show||a.reserveSpace});k.each(e,function(a,b){qa(b);var c=b.options.ticks;a=[];null==c||"number"==typeof c&&0<c?a=b.tickGenerator(b):c&&(a=k.isFunction(c)?c(b):c);b.ticks=[];for(c=0;c<a.length;++c){var d=null,e=a[c];if("object"==typeof e){var m=+e[0];1<e.length&&(d=e[1])}else m=+e;null==d&&(d=b.tickFormatter(m,b));isNaN(m)||b.ticks.push({v:m,label:d})}a=b.ticks;b.options.autoscaleMargin&&
0<a.length&&(null==b.options.min&&(b.min=Math.min(b.min,a[0].v)),null==b.options.max&&1<a.length&&(b.max=Math.max(b.max,a[a.length-1].v)));a=b.options;c=b.ticks||[];m=a.labelWidth||0;d=a.labelHeight||0;e=m||("x"==b.direction?Math.floor(C.width/(c.length||1)):null);for(var f="flot-"+b.direction+"-axis flot-"+b.direction+b.n+"-axis "+(b.direction+"Axis "+b.direction+b.n+"Axis"),h=a.font||"flot-tick-label tickLabel",l=0;l<c.length;++l){var u=c[l];u.label&&(u=C.getTextInfo(f,u.label,h,null,e),m=Math.max(m,
u.width),d=Math.max(d,u.height))}b.labelWidth=a.labelWidth||m;b.labelHeight=a.labelHeight||d});for(a=e.length-1;0<=a;--a)oa(e[a]);pa();k.each(e,function(a,b){"x"==b.direction?(b.box.left=q.left-b.labelWidth/2,b.box.width=C.width-q.left-q.right+b.labelWidth):(b.box.top=q.top-b.labelHeight/2,b.box.height=C.height-q.bottom-q.top+b.labelHeight)})}N=C.width-q.left-q.right;J=C.height-q.bottom-q.top;k.each(b,function(a,b){na(b)});c&&ra();sa()}function qa(a){var b=a.options,c=(a.max-a.min)/("number"==typeof b.ticks&&
0<b.ticks?b.ticks:.3*Math.sqrt("x"==a.direction?C.width:C.height)),e=-Math.floor(Math.log(c)/Math.LN10),d=b.tickDecimals;null!=d&&e>d&&(e=d);var f=Math.pow(10,-e),p=c/f;if(1.5>p)var h=1;else 3>p?(h=2,2.25<p&&(null==d||e+1<=d)&&(h=2.5,++e)):h=7.5>p?5:10;h*=f;null!=b.minTickSize&&h<b.minTickSize&&(h=b.minTickSize);a.delta=c;a.tickDecimals=Math.max(0,null!=d?d:e);a.tickSize=b.tickSize||h;if("time"==b.mode&&!a.tickGenerator)throw Error("Time mode requires the flot.time plugin.");a.tickGenerator||(a.tickGenerator=
function(a){var b=[];var c=a.tickSize;c*=Math.floor(a.min/c);var d=0,e=Number.NaN;do{var f=e;e=c+d*a.tickSize;b.push(e);++d}while(e<a.max&&e!=f);return b},a.tickFormatter=function(a,b){var c=b.tickDecimals?Math.pow(10,b.tickDecimals):1;a=""+Math.round(a*c)/c;if(null!=b.tickDecimals){var d=a.indexOf(".");d=-1==d?0:a.length-d-1;if(d<b.tickDecimals)return(d?a:a+".")+(""+c).substr(1,b.tickDecimals-d)}return a});k.isFunction(b.tickFormatter)&&(a.tickFormatter=function(a,c){return""+b.tickFormatter(a,c)});
if(null!=b.alignTicksWithAxis){var l=("x"==a.direction?A:I)[b.alignTicksWithAxis-1];l&&l.used&&l!=a&&(c=a.tickGenerator(a),0<c.length&&(null==b.min&&(a.min=Math.min(a.min,c[0])),null==b.max&&1<c.length&&(a.max=Math.max(a.max,c[c.length-1]))),a.tickGenerator=function(a){var b=[],c;for(c=0;c<l.ticks.length;++c){var d=(l.ticks[c].v-l.min)/(l.max-l.min);d=a.min+d*(a.max-a.min);b.push(d)}return b},a.mode||null!=b.tickDecimals||(c=Math.max(0,-Math.floor(Math.log(a.delta)/Math.LN10)+1),e=a.tickGenerator(a),
1<e.length&&/\..*0$/.test((e[1]-e[0]).toFixed(c))||(a.tickDecimals=c)))}}function ca(){C.clear();v(H.drawBackground,[l]);var a=f.grid;a.show&&a.backgroundColor&&(l.save(),l.translate(q.left,q.top),l.fillStyle=da(f.grid.backgroundColor,J,0,"rgba(255, 255, 255, 0)"),l.fillRect(0,0,N,J),l.restore());a.show&&!a.aboveData&&ea();for(var b=0;b<y.length;++b){v(H.drawSeries,[l,y[b]]);var c=y[b];c.lines.show&&ta(c);c.bars.show&&ua(c);c.points.show&&va(c)}v(H.draw,[l]);a.show&&a.aboveData&&ea();C.render();T()}
function fa(a,b){for(var c,e,d,f,l=B(),h=0;h<l.length;++h)if(c=l[h],c.direction==b&&(f=b+c.n+"axis",a[f]||1!=c.n||(f=b+"axis"),a[f])){e=a[f].from;d=a[f].to;break}a[f]||(c="x"==b?A[0]:I[0],e=a[b+"1"],d=a[b+"2"]);null!=e&&null!=d&&e>d&&(a=e,e=d,d=a);return{from:e,to:d,axis:c}}function ea(){var a,b;l.save();l.translate(q.left,q.top);if(b=f.grid.markings){if(k.isFunction(b)){var c=x.getAxes();c.xmin=c.xaxis.min;c.xmax=c.xaxis.max;c.ymin=c.yaxis.min;c.ymax=c.yaxis.max;b=b(c)}for(a=0;a<b.length;++a){c=
b[a];var e=fa(c,"x"),d=fa(c,"y");null==e.from&&(e.from=e.axis.min);null==e.to&&(e.to=e.axis.max);null==d.from&&(d.from=d.axis.min);null==d.to&&(d.to=d.axis.max);if(!(e.to<e.axis.min||e.from>e.axis.max||d.to<d.axis.min||d.from>d.axis.max)){e.from=Math.max(e.from,e.axis.min);e.to=Math.min(e.to,e.axis.max);d.from=Math.max(d.from,d.axis.min);d.to=Math.min(d.to,d.axis.max);var h=e.from===e.to,p=d.from===d.to;if(!h||!p)if(e.from=Math.floor(e.axis.p2c(e.from)),e.to=Math.floor(e.axis.p2c(e.to)),d.from=Math.floor(d.axis.p2c(d.from)),
d.to=Math.floor(d.axis.p2c(d.to)),h||p){p=c.lineWidth||f.grid.markingsLineWidth;var n=p%2?.5:0;l.beginPath();l.strokeStyle=c.color||f.grid.markingsColor;l.lineWidth=p;h?(l.moveTo(e.to+n,d.from),l.lineTo(e.to+n,d.to)):(l.moveTo(e.from,d.to+n),l.lineTo(e.to,d.to+n));l.stroke()}else l.fillStyle=c.color||f.grid.markingsColor,l.fillRect(e.from,d.to,e.to-e.from,d.from-d.to)}}}c=B();b=f.grid.borderWidth;for(e=0;e<c.length;++e){d=c[e];a=d.box;h=d.tickLength;var g;if(d.show&&0!=d.ticks.length){l.lineWidth=
1;"x"==d.direction?(p=0,n="full"==h?"top"==d.position?0:J:a.top-q.top+("top"==d.position?a.height:0)):(n=0,p="full"==h?"left"==d.position?0:N:a.left-q.left+("left"==d.position?a.width:0));if(!d.innermost){l.strokeStyle=d.options.color;l.beginPath();var m=g=0;"x"==d.direction?m=N+1:g=J+1;1==l.lineWidth&&("x"==d.direction?n=Math.floor(n)+.5:p=Math.floor(p)+.5);l.moveTo(p,n);l.lineTo(p+m,n+g);l.stroke()}l.strokeStyle=d.options.tickColor;l.beginPath();for(a=0;a<d.ticks.length;++a){var v=d.ticks[a].v;
m=g=0;isNaN(v)||v<d.min||v>d.max||"full"==h&&("object"==typeof b&&0<b[d.position]||0<b)&&(v==d.min||v==d.max)||("x"==d.direction?(p=d.p2c(v),g="full"==h?-J:h,"top"==d.position&&(g=-g)):(n=d.p2c(v),m="full"==h?-N:h,"left"==d.position&&(m=-m)),1==l.lineWidth&&("x"==d.direction?p=Math.floor(p)+.5:n=Math.floor(n)+.5),l.moveTo(p,n),l.lineTo(p+m,n+g))}l.stroke()}}b&&(a=f.grid.borderColor,"object"==typeof b||"object"==typeof a?("object"!==typeof b&&(b={top:b,right:b,bottom:b,left:b}),"object"!==typeof a&&
(a={top:a,right:a,bottom:a,left:a}),0<b.top&&(l.strokeStyle=a.top,l.lineWidth=b.top,l.beginPath(),l.moveTo(0-b.left,-(b.top/2)),l.lineTo(N,-(b.top/2)),l.stroke()),0<b.right&&(l.strokeStyle=a.right,l.lineWidth=b.right,l.beginPath(),l.moveTo(N+b.right/2,0-b.top),l.lineTo(N+b.right/2,J),l.stroke()),0<b.bottom&&(l.strokeStyle=a.bottom,l.lineWidth=b.bottom,l.beginPath(),l.moveTo(N+b.right,J+b.bottom/2),l.lineTo(0,J+b.bottom/2),l.stroke()),0<b.left&&(l.strokeStyle=a.left,l.lineWidth=b.left,l.beginPath(),
l.moveTo(-(b.left/2),J+b.bottom),l.lineTo(-(b.left/2),0),l.stroke())):(l.lineWidth=b,l.strokeStyle=f.grid.borderColor,l.strokeRect(-b/2,-b/2,N+b,J+b)));l.restore()}function ra(){k.each(B(),function(a,b){a=b.box;var c="flot-"+b.direction+"-axis flot-"+b.direction+b.n+"-axis "+(b.direction+"Axis "+b.direction+b.n+"Axis"),e=b.options.font||"flot-tick-label tickLabel";C.removeText(c);if(b.show&&0!=b.ticks.length)for(var d=0;d<b.ticks.length;++d){var f=b.ticks[d];if(!(!f.label||f.v<b.min||f.v>b.max)){if("x"==
b.direction){var h="center";var l=q.left+b.p2c(f.v);if("bottom"==b.position)var n=a.top+a.padding;else{n=a.top+a.height-a.padding;var m="bottom"}}else m="middle",n=q.top+b.p2c(f.v),"left"==b.position?(l=a.left+a.width-a.padding,h="right"):l=a.left+a.padding;C.addText(c,l,n,f.label,e,null,null,h,m)}}})}function ta(a){function b(a,b,c,d,e){var f=a.points;a=a.pointsize;var h=null,p=null;l.beginPath();for(var n=a;n<f.length;n+=a){var m=f[n-a],k=f[n-a+1],g=f[n],t=f[n+1];if(null!=m&&null!=g){if(k<=t&&k<
e.min){if(t<e.min)continue;m=(e.min-k)/(t-k)*(g-m)+m;k=e.min}else if(t<=k&&t<e.min){if(k<e.min)continue;g=(e.min-k)/(t-k)*(g-m)+m;t=e.min}if(k>=t&&k>e.max){if(t>e.max)continue;m=(e.max-k)/(t-k)*(g-m)+m;k=e.max}else if(t>=k&&t>e.max){if(k>e.max)continue;g=(e.max-k)/(t-k)*(g-m)+m;t=e.max}if(m<=g&&m<d.min){if(g<d.min)continue;k=(d.min-m)/(g-m)*(t-k)+k;m=d.min}else if(g<=m&&g<d.min){if(m<d.min)continue;t=(d.min-m)/(g-m)*(t-k)+k;g=d.min}if(m>=g&&m>d.max){if(g>d.max)continue;k=(d.max-m)/(g-m)*(t-k)+k;m=
d.max}else if(g>=m&&g>d.max){if(m>d.max)continue;t=(d.max-m)/(g-m)*(t-k)+k;g=d.max}m==h&&k==p||l.moveTo(d.p2c(m)+b,e.p2c(k)+c);h=g;p=t;l.lineTo(d.p2c(g)+b,e.p2c(t)+c)}}l.stroke()}function c(a,b,c){var d=a.points;a=a.pointsize;for(var e=Math.min(Math.max(0,c.min),c.max),f=0,h=!1,k=1,n=0,g=0;!(0<a&&f>d.length+a);){f+=a;var p=d[f-a],t=d[f-a+k],q=d[f],u=d[f+k];if(h){if(0<a&&null!=p&&null==q){g=f;a=-a;k=2;continue}if(0>a&&f==n+a){l.fill();h=!1;a=-a;k=1;f=n=g+a;continue}}if(null!=p&&null!=q){if(p<=q&&p<
b.min){if(q<b.min)continue;t=(b.min-p)/(q-p)*(u-t)+t;p=b.min}else if(q<=p&&q<b.min){if(p<b.min)continue;u=(b.min-p)/(q-p)*(u-t)+t;q=b.min}if(p>=q&&p>b.max){if(q>b.max)continue;t=(b.max-p)/(q-p)*(u-t)+t;p=b.max}else if(q>=p&&q>b.max){if(p>b.max)continue;u=(b.max-p)/(q-p)*(u-t)+t;q=b.max}h||(l.beginPath(),l.moveTo(b.p2c(p),c.p2c(e)),h=!0);if(t>=c.max&&u>=c.max)l.lineTo(b.p2c(p),c.p2c(c.max)),l.lineTo(b.p2c(q),c.p2c(c.max));else if(t<=c.min&&u<=c.min)l.lineTo(b.p2c(p),c.p2c(c.min)),l.lineTo(b.p2c(q),
c.p2c(c.min));else{var v=p,r=q;t<=u&&t<c.min&&u>=c.min?(p=(c.min-t)/(u-t)*(q-p)+p,t=c.min):u<=t&&u<c.min&&t>=c.min&&(q=(c.min-t)/(u-t)*(q-p)+p,u=c.min);t>=u&&t>c.max&&u<=c.max?(p=(c.max-t)/(u-t)*(q-p)+p,t=c.max):u>=t&&u>c.max&&t<=c.max&&(q=(c.max-t)/(u-t)*(q-p)+p,u=c.max);p!=v&&l.lineTo(b.p2c(v),c.p2c(t));l.lineTo(b.p2c(p),c.p2c(t));l.lineTo(b.p2c(q),c.p2c(u));q!=r&&(l.lineTo(b.p2c(q),c.p2c(u)),l.lineTo(b.p2c(r),c.p2c(u)))}}}}l.save();l.translate(q.left,q.top);l.lineJoin="round";var e=a.lines.lineWidth,
d=a.shadowSize;if(0<e&&0<d){l.lineWidth=d;l.strokeStyle="rgba(0,0,0,0.1)";var f=Math.PI/18;b(a.datapoints,Math.sin(f)*(e/2+d/2),Math.cos(f)*(e/2+d/2),a.xaxis,a.yaxis);l.lineWidth=d/2;b(a.datapoints,Math.sin(f)*(e/2+d/4),Math.cos(f)*(e/2+d/4),a.xaxis,a.yaxis)}l.lineWidth=e;l.strokeStyle=a.color;if(d=V(a.lines,a.color,0,J))l.fillStyle=d,c(a.datapoints,a.xaxis,a.yaxis);0<e&&b(a.datapoints,0,0,a.xaxis,a.yaxis);l.restore()}function va(a){function b(a,b,c,d,e,f,h,k){var p=a.points;a=a.pointsize;for(var m=
0;m<p.length;m+=a){var n=p[m],g=p[m+1];null==n||n<f.min||n>f.max||g<h.min||g>h.max||(l.beginPath(),n=f.p2c(n),g=h.p2c(g)+d,"circle"==k?l.arc(n,g,b,0,e?Math.PI:2*Math.PI,!1):k(l,n,g,b,e),l.closePath(),c&&(l.fillStyle=c,l.fill()),l.stroke())}}l.save();l.translate(q.left,q.top);var c=a.points.lineWidth,e=a.shadowSize,d=a.points.radius,f=a.points.symbol;0==c&&(c=1E-4);0<c&&0<e&&(e/=2,l.lineWidth=e,l.strokeStyle="rgba(0,0,0,0.1)",b(a.datapoints,d,null,e+e/2,!0,a.xaxis,a.yaxis,f),l.strokeStyle="rgba(0,0,0,0.2)",
b(a.datapoints,d,null,e/2,!0,a.xaxis,a.yaxis,f));l.lineWidth=c;l.strokeStyle=a.color;b(a.datapoints,d,V(a.points,a.color),0,!1,a.xaxis,a.yaxis,f);l.restore()}function ha(a,b,c,e,d,f,h,k,l,m,n){var p,g;if(m){var q=p=g=!0;var t=!1;m=c;c=b+e;d=b+d;a<m&&(b=a,a=m,m=b,t=!0,p=!1)}else t=p=g=!0,q=!1,m=a+e,a+=d,d=c,c=b,c<d&&(b=c,c=d,d=b,q=!0,g=!1);a<h.min||m>h.max||c<k.min||d>k.max||(m<h.min&&(m=h.min,t=!1),a>h.max&&(a=h.max,p=!1),d<k.min&&(d=k.min,q=!1),c>k.max&&(c=k.max,g=!1),m=h.p2c(m),d=k.p2c(d),a=h.p2c(a),
c=k.p2c(c),f&&(l.fillStyle=f(d,c),l.fillRect(m,c,a-m,d-c)),0<n&&(t||p||g||q)&&(l.beginPath(),l.moveTo(m,d),t?l.lineTo(m,c):l.moveTo(m,c),g?l.lineTo(a,c):l.moveTo(a,c),p?l.lineTo(a,d):l.moveTo(a,d),q?l.lineTo(m,d):l.moveTo(m,d),l.stroke()))}function ua(a){l.save();l.translate(q.left,q.top);l.lineWidth=a.bars.lineWidth;l.strokeStyle=a.color;switch(a.bars.align){case "left":var b=0;break;case "right":b=-a.bars.barWidth;break;default:b=-a.bars.barWidth/2}(function(b,e,d,f,h,k){var c=b.points;b=b.pointsize;
for(var m=0;m<c.length;m+=b)null!=c[m]&&ha(c[m],c[m+1],c[m+2],e,d,f,h,k,l,a.bars.horizontal,a.bars.lineWidth)})(a.datapoints,b,b+a.bars.barWidth,a.bars.fill?function(b,e){return V(a.bars,a.color,b,e)}:null,a.xaxis,a.yaxis);l.restore()}function V(a,b,c,e){var d=a.fill;if(!d)return null;if(a.fillColor)return da(a.fillColor,c,e,b);a=k.color.parse(b);a.a="number"==typeof d?d:.4;a.normalize();return a.toString()}function sa(){null!=f.legend.container?k(f.legend.container).html(""):h.find(".legend").remove();
if(f.legend.show){for(var a=[],b=[],c=!1,e=f.legend.labelFormatter,d,l,g=0;g<y.length;++g)d=y[g],d.label&&(l=e?e(d.label,d):d.label)&&b.push({label:l,color:d.color});if(f.legend.sorted)if(k.isFunction(f.legend.sorted))b.sort(f.legend.sorted);else if("reverse"==f.legend.sorted)b.reverse();else{var n="descending"!=f.legend.sorted;b.sort(function(a,b){return a.label==b.label?0:a.label<b.label!=n?1:-1})}for(g=0;g<b.length;++g)e=b[g],0==g%f.legend.noColumns&&(c&&a.push("</tr>"),a.push("<tr>"),c=!0),a.push('<td class="legendColorBox"><div style="border:1px solid '+
f.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+e.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+e.label+"</td>");c&&a.push("</tr>");0!=a.length&&(b='<table style="font-size:smaller;color:'+f.grid.color+'">'+a.join("")+"</table>",null!=f.legend.container?k(f.legend.container).html(b):(a="",c=f.legend.position,g=f.legend.margin,null==g[0]&&(g=[g,g]),"n"==c.charAt(0)?a+="top:"+(g[1]+q.top)+"px;":"s"==c.charAt(0)&&(a+="bottom:"+(g[1]+
q.bottom)+"px;"),"e"==c.charAt(1)?a+="right:"+(g[0]+q.right)+"px;":"w"==c.charAt(1)&&(a+="left:"+(g[0]+q.left)+"px;"),b=k('<div class="legend">'+b.replace('style="','style="position:absolute;'+a+";")+"</div>").appendTo(h),0!=f.legend.backgroundOpacity&&(c=f.legend.backgroundColor,null==c&&(c=(c=f.grid.backgroundColor)&&"string"==typeof c?k.color.parse(c):k.color.extract(b,"background-color"),c.a=1,c=c.toString()),g=b.children(),k('<div style="position:absolute;width:'+g.width()+"px;height:"+g.height()+
"px;"+a+"background-color:"+c+';"> </div>').prependTo(b).css("opacity",f.legend.backgroundOpacity))))}}function Y(a){f.grid.hoverable&&W("plothover",a,function(a){return 0!=a.hoverable})}function Z(a){f.grid.hoverable&&W("plothover",a,function(a){return!1})}function aa(a){W("plotclick",a,function(a){return 0!=a.clickable})}function W(a,b,c){var e=M.offset(),d=b.pageX-e.left-q.left,l=b.pageY-e.top-q.top,g=L({left:d,top:l});g.pageX=b.pageX;g.pageY=b.pageY;b=f.grid.mouseActiveRadius;var k=b*b+1,n=null,
m,v;for(m=y.length-1;0<=m;--m)if(c(y[m])){var r=y[m],E=r.xaxis,x=r.yaxis,P=r.datapoints.points,w=E.c2p(d),F=x.c2p(l),z=b/E.scale,C=b/x.scale;var B=r.datapoints.pointsize;E.options.inverseTransform&&(z=Number.MAX_VALUE);x.options.inverseTransform&&(C=Number.MAX_VALUE);if(r.lines.show||r.points.show)for(v=0;v<P.length;v+=B){var D=P[v],A=P[v+1];null==D||D-w>z||D-w<-z||A-F>C||A-F<-C||(D=Math.abs(E.p2c(D)-d),A=Math.abs(x.p2c(A)-l),A=D*D+A*A,A<k&&(k=A,n=[m,v/B]))}if(r.bars.show&&!n){switch(r.bars.align){case "left":E=
0;break;case "right":E=-r.bars.barWidth;break;default:E=-r.bars.barWidth/2}r=E+r.bars.barWidth;for(v=0;v<P.length;v+=B)D=P[v],A=P[v+1],x=P[v+2],null!=D&&(y[m].bars.horizontal?w<=Math.max(x,D)&&w>=Math.min(x,D)&&F>=A+E&&F<=A+r:w>=D+E&&w<=D+r&&F>=Math.min(x,A)&&F<=Math.max(x,A))&&(n=[m,v/B])}}n?(m=n[0],v=n[1],B=y[m].datapoints.pointsize,c={datapoint:y[m].datapoints.points.slice(v*B,(v+1)*B),dataIndex:v,series:y[m],seriesIndex:m}):c=null;c&&(c.pageX=parseInt(c.series.xaxis.p2c(c.datapoint[0])+e.left+
q.left,10),c.pageY=parseInt(c.series.yaxis.p2c(c.datapoint[1])+e.top+q.top,10));if(f.grid.autoHighlight){for(e=0;e<O.length;++e)d=O[e],d.auto!=a||c&&d.series==c.series&&d.point[0]==c.datapoint[0]&&d.point[1]==c.datapoint[1]||ia(d.series,d.point);c&&ja(c.series,c.datapoint,a)}h.trigger(a,[g,c])}function T(){var a=f.interaction.redrawOverlayInterval;-1==a?ka():S||(S=setTimeout(ka,a))}function ka(){S=null;G.save();R.clear();G.translate(q.left,q.top);var a;for(a=0;a<O.length;++a){var b=O[a];if(b.series.bars.show)wa(b.series,
b.point);else{var c=b.series,e=b.point;b=e[0];e=e[1];var d=c.xaxis,f=c.yaxis,h="string"===typeof c.highlightColor?c.highlightColor:k.color.parse(c.color).scale("a",.5).toString();if(!(b<d.min||b>d.max||e<f.min||e>f.max)){var l=c.points.radius+c.points.lineWidth/2;G.lineWidth=l;G.strokeStyle=h;h=1.5*l;b=d.p2c(b);e=f.p2c(e);G.beginPath();"circle"==c.points.symbol?G.arc(b,e,h,0,2*Math.PI,!1):c.points.symbol(G,b,e,h,!1);G.closePath();G.stroke()}}}G.restore();v(H.drawOverlay,[G])}function ja(a,b,c){"number"==
typeof a&&(a=y[a]);if("number"==typeof b){var e=a.datapoints.pointsize;b=a.datapoints.points.slice(e*b,e*(b+1))}e=la(a,b);-1==e?(O.push({series:a,point:b,auto:c}),T()):c||(O[e].auto=!1)}function ia(a,b){if(null==a&&null==b)O=[],T();else{"number"==typeof a&&(a=y[a]);if("number"==typeof b){var c=a.datapoints.pointsize;b=a.datapoints.points.slice(c*b,c*(b+1))}a=la(a,b);-1!=a&&(O.splice(a,1),T())}}function la(a,b){for(var c=0;c<O.length;++c){var e=O[c];if(e.series==a&&e.point[0]==b[0]&&e.point[1]==b[1])return c}return-1}
function wa(a,b){var c="string"===typeof a.highlightColor?a.highlightColor:k.color.parse(a.color).scale("a",.5).toString();switch(a.bars.align){case "left":var e=0;break;case "right":e=-a.bars.barWidth;break;default:e=-a.bars.barWidth/2}G.lineWidth=a.bars.lineWidth;G.strokeStyle=c;ha(b[0],b[1],b[2]||0,e,e+a.bars.barWidth,function(){return c},a.xaxis,a.yaxis,G,a.bars.horizontal,a.bars.lineWidth)}function da(a,b,c,e){if("string"==typeof a)return a;b=l.createLinearGradient(0,c,0,b);c=0;for(var d=a.colors.length;c<
d;++c){var f=a.colors[c];if("string"!=typeof f){var h=k.color.parse(e);null!=f.brightness&&(h=h.scale("rgb",f.brightness));null!=f.opacity&&(h.a*=f.opacity);f=h.toString()}b.addColorStop(c/(d-1),f)}return b}var y=[],f={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,
color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,
barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1E3/60},hooks:{}},C=null,R=null,M=null,l=null,G=null,A=[],I=[],q={left:0,
right:0,top:0,bottom:0},N=0,J=0,H={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},x=this;x.setData=E;x.setupGrid=ba;x.draw=ca;x.getPlaceholder=function(){return h};x.getCanvas=function(){return C.element};x.getPlotOffset=function(){return q};x.width=function(){return N};x.height=function(){return J};x.offset=function(){var a=M.offset();a.left+=q.left;a.top+=q.top;return a};x.getData=function(){return y};
x.getAxes=function(){var a={};k.each(A.concat(I),function(b,c){c&&(a[c.direction+(1!=c.n?c.n:"")+"axis"]=c)});return a};x.getXAxes=function(){return A};x.getYAxes=function(){return I};x.c2p=L;x.p2c=function(a){var b={},c,e;for(c=0;c<A.length;++c)if((e=A[c])&&e.used){var d="x"+e.n;null==a[d]&&1==e.n&&(d="x");if(null!=a[d]){b.left=e.p2c(a[d]);break}}for(c=0;c<I.length;++c)if((e=I[c])&&e.used&&(d="y"+e.n,null==a[d]&&1==e.n&&(d="y"),null!=a[d])){b.top=e.p2c(a[d]);break}return b};x.getOptions=function(){return f};
x.highlight=ja;x.unhighlight=ia;x.triggerRedrawOverlay=T;x.pointOffset=function(a){return{left:parseInt(A[F(a,"x")-1].p2c(+a.x)+q.left,10),top:parseInt(I[F(a,"y")-1].p2c(+a.y)+q.top,10)}};x.shutdown=X;x.destroy=function(){X();h.removeData("plot").empty();y=[];G=l=M=R=C=f=null;A=[];I=[];H=null;O=[];x=null};x.resize=function(){var a=h.width(),b=h.height();C.resize(a,b);R.resize(a,b)};x.hooks=H;(function(){for(var a={Canvas:w},b=0;b<r.length;++b){var c=r[b];c.init(x,a);c.options&&k.extend(!0,f,c.options)}})(x);
(function(a){k.extend(!0,f,a);a&&a.colors&&(f.colors=a.colors);null==f.xaxis.color&&(f.xaxis.color=k.color.parse(f.grid.color).scale("a",.22).toString());null==f.yaxis.color&&(f.yaxis.color=k.color.parse(f.grid.color).scale("a",.22).toString());null==f.xaxis.tickColor&&(f.xaxis.tickColor=f.grid.tickColor||f.xaxis.color);null==f.yaxis.tickColor&&(f.yaxis.tickColor=f.grid.tickColor||f.yaxis.color);null==f.grid.borderColor&&(f.grid.borderColor=f.grid.color);null==f.grid.tickColor&&(f.grid.tickColor=
k.color.parse(f.grid.color).scale("a",.22).toString());var b;a=(a=h.css("font-size"))?+a.replace("px",""):13;var c={style:h.css("font-style"),size:Math.round(.8*a),variant:h.css("font-variant"),weight:h.css("font-weight"),family:h.css("font-family")};var e=f.xaxes.length||1;for(a=0;a<e;++a)(b=f.xaxes[a])&&!b.tickColor&&(b.tickColor=b.color),b=k.extend(!0,{},f.xaxis,b),f.xaxes[a]=b,b.font&&(b.font=k.extend({},c,b.font),b.font.color||(b.font.color=b.color),b.font.lineHeight||(b.font.lineHeight=Math.round(1.15*
b.font.size)));e=f.yaxes.length||1;for(a=0;a<e;++a)(b=f.yaxes[a])&&!b.tickColor&&(b.tickColor=b.color),b=k.extend(!0,{},f.yaxis,b),f.yaxes[a]=b,b.font&&(b.font=k.extend({},c,b.font),b.font.color||(b.font.color=b.color),b.font.lineHeight||(b.font.lineHeight=Math.round(1.15*b.font.size)));f.xaxis.noTicks&&null==f.xaxis.ticks&&(f.xaxis.ticks=f.xaxis.noTicks);f.yaxis.noTicks&&null==f.yaxis.ticks&&(f.yaxis.ticks=f.yaxis.noTicks);f.x2axis&&(f.xaxes[1]=k.extend(!0,{},f.xaxis,f.x2axis),f.xaxes[1].position=
"top",null==f.x2axis.min&&(f.xaxes[1].min=null),null==f.x2axis.max&&(f.xaxes[1].max=null));f.y2axis&&(f.yaxes[1]=k.extend(!0,{},f.yaxis,f.y2axis),f.yaxes[1].position="right",null==f.y2axis.min&&(f.yaxes[1].min=null),null==f.y2axis.max&&(f.yaxes[1].max=null));f.grid.coloredAreas&&(f.grid.markings=f.grid.coloredAreas);f.grid.coloredAreasColor&&(f.grid.markingsColor=f.grid.coloredAreasColor);f.lines&&k.extend(!0,f.series.lines,f.lines);f.points&&k.extend(!0,f.series.points,f.points);f.bars&&k.extend(!0,
f.series.bars,f.bars);null!=f.shadowSize&&(f.series.shadowSize=f.shadowSize);null!=f.highlightColor&&(f.series.highlightColor=f.highlightColor);for(a=0;a<f.xaxes.length;++a)K(A,a+1).options=f.xaxes[a];for(a=0;a<f.yaxes.length;++a)K(I,a+1).options=f.yaxes[a];for(var d in H)f.hooks[d]&&f.hooks[d].length&&(H[d]=H[d].concat(f.hooks[d]));v(H.processOptions,[f])})(n);(function(){h.css("padding",0).children().filter(function(){return!k(this).hasClass("flot-overlay")&&!k(this).hasClass("flot-base")}).remove();
"static"==h.css("position")&&h.css("position","relative");C=new w("flot-base",h);R=new w("flot-overlay",h);l=C.context;G=R.context;M=k(R.element).unbind();var a=h.data("plot");a&&(a.shutdown(),R.clear());h.data("plot",x)})();E(g);ba();ca();f.grid.hoverable&&(M.mousemove(Y),M.bind("mouseleave",Z));f.grid.clickable&&M.click(aa);v(H.bindEvents,[M]);var O=[],S=null}var g=Object.prototype.hasOwnProperty;k.fn.detach||(k.fn.detach=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})});
w.prototype.resize=function(h,g){if(0>=h||0>=g)throw Error("Invalid dimensions for plot, width = "+h+", height = "+g);var k=this.element,v=this.context,r=this.pixelRatio;this.width!=h&&(k.width=h*r,k.style.width=h+"px",this.width=h);this.height!=g&&(k.height=g*r,k.style.height=g+"px",this.height=g);v.restore();v.save();v.scale(r,r)};w.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};w.prototype.render=function(){var h=this._textCache,k;for(k in h)if(g.call(h,k)){var n=
this.getTextLayer(k),r=h[k];n.hide();for(var w in r)if(g.call(r,w)){var D=r[w],F;for(F in D)if(g.call(D,F)){for(var B=D[F].positions,L=0,K;K=B[L];L++)K.active?K.rendered||(n.append(K.element),K.rendered=!0):(B.splice(L--,1),K.rendered&&K.element.detach());0==B.length&&delete D[F]}}n.show()}};w.prototype.getTextLayer=function(h){var g=this.text[h];null==g&&(null==this.textContainer&&(this.textContainer=k("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",
color:"#545454"}).insertAfter(this.element)),g=this.text[h]=k("<div></div>").addClass(h).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer));return g};w.prototype.getTextInfo=function(h,g,n,r,w){g=""+g;r="object"===typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n;var v=this._textCache[h];null==v&&(v=this._textCache[h]={});var E=v[r];null==E&&(E=v[r]={});v=E[g];null==v&&(h=k("<div></div>").html(g).css({position:"absolute",
"max-width":w,top:-9999}).appendTo(this.getTextLayer(h)),"object"===typeof n?h.css({font:r,color:n.color}):"string"===typeof n&&h.addClass(n),v=E[g]={width:h.outerWidth(!0),height:h.outerHeight(!0),element:h,positions:[]},h.detach());return v};w.prototype.addText=function(h,g,k,r,w,D,F,B,L){h=this.getTextInfo(h,r,w,D,F);r=h.positions;"center"==B?g-=h.width/2:"right"==B&&(g-=h.width);"middle"==L?k-=h.height/2:"bottom"==L&&(k-=h.height);for(L=0;w=r[L];L++)if(w.x==g&&w.y==k){w.active=!0;return}w={active:!0,
rendered:!1,element:r.length?h.element.clone():h.element,x:g,y:k};r.push(w);w.element.css({top:Math.round(k),left:Math.round(g),"text-align":B})};w.prototype.removeText=function(h,k,n,r,w,D){if(null==r){if(k=this._textCache[h],null!=k)for(var v in k)if(g.call(k,v)){n=k[v];for(var B in n)if(g.call(n,B))for(h=n[B].positions,r=0;w=h[r];r++)w.active=!1}}else for(h=this.getTextInfo(h,r,w,D).positions,r=0;w=h[r];r++)w.x==k&&w.y==n&&(w.active=!1)};k.plot=function(h,g,n){return new r(k(h),g,n,k.plot.plugins)};
k.plot.version="0.8.3";k.plot.plugins=[];k.fn.plot=function(g,r){return this.each(function(){k.plot(this,g,r)})}})(jQuery);
(function(w){function D(c,b,f,k){if(b.points.errorbars){c=[{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}];f=b.points.errorbars;if("x"==f||"xy"==f)b.points.xerr.asymmetric&&c.push({x:!0,number:!0,required:!0}),c.push({x:!0,number:!0,required:!0});if("y"==f||"xy"==f)b.points.yerr.asymmetric&&c.push({y:!0,number:!0,required:!0}),c.push({y:!0,number:!0,required:!0});k.format=c}}function A(c,b,f,k,e,u,h,B,a,C,n){k+=C;e+=C;u+=C;"x"==b.err?(e>f+a?v(c,[[e,k],[Math.max(f+a,n[0]),k]]):h=!1,u<f-
a?v(c,[[Math.min(f-a,n[1]),k],[u,k]]):B=!1):(e<k-a?v(c,[[f,e],[f,Math.min(k-a,n[0])]]):h=!1,u>k+a?v(c,[[f,Math.max(k+a,n[1])],[f,u]]):B=!1);a=null!=b.radius?b.radius:a;h&&("-"==b.upperCap?"x"==b.err?v(c,[[e,k-a],[e,k+a]]):v(c,[[f-a,e],[f+a,e]]):w.isFunction(b.upperCap)&&("x"==b.err?b.upperCap(c,e,k,a):b.upperCap(c,f,e,a)));B&&("-"==b.lowerCap?"x"==b.err?v(c,[[u,k-a],[u,k+a]]):v(c,[[f-a,u],[f+a,u]]):w.isFunction(b.lowerCap)&&("x"==b.err?b.lowerCap(c,u,k,a):b.lowerCap(c,f,u,a)))}function v(c,b){c.beginPath();
c.moveTo(b[0][0],b[0][1]);for(var f=1;f<b.length;f++)c.lineTo(b[f][0],b[f][1]);c.stroke()}function E(c,b){var f=c.getPlotOffset();b.save();b.translate(f.left,f.top);w.each(c.getData(),function(c,e){if(e.points.errorbars&&(e.points.xerr.show||e.points.yerr.show)){c=e.datapoints.points;var f=e.datapoints.pointsize,h=[e.xaxis,e.yaxis],k=e.points.radius,a=[e.points.xerr,e.points.yerr],v=!1;if(h[0].p2c(h[0].max)<h[0].p2c(h[0].min)){v=!0;var n=a[0].lowerCap;a[0].lowerCap=a[0].upperCap;a[0].upperCap=n}var w=
!1;h[1].p2c(h[1].min)<h[1].p2c(h[1].max)&&(w=!0,n=a[1].lowerCap,a[1].lowerCap=a[1].upperCap,a[1].upperCap=n);for(var p=0;p<e.datapoints.points.length;p+=f){var d=e.datapoints.points,q=null,r=null,l=null,m=null;var x=e.points.xerr;var g=e.points.yerr,t=e.points.errorbars;"x"==t||"xy"==t?x.asymmetric?(q=d[p+2],r=d[p+3],"xy"==t&&(g.asymmetric?(l=d[p+4],m=d[p+5]):l=d[p+4])):(q=d[p+2],"xy"==t&&(g.asymmetric?(l=d[p+3],m=d[p+4]):l=d[p+3])):"y"==t&&(g.asymmetric?(l=d[p+2],m=d[p+3]):l=d[p+2]);null==r&&(r=
q);null==m&&(m=l);d=[q,r,l,m];x.show||(d[0]=null,d[1]=null);g.show||(d[2]=null,d[3]=null);x=d;for(g=0;g<a.length;g++)if(d=[h[g].min,h[g].max],x[g*a.length]&&(q=c[p],r=c[p+1],l=[q,r][g]+x[g*a.length+1],m=[q,r][g]-x[g*a.length],"x"!=a[g].err||!(r>h[1].max||r<h[1].min||l<h[0].min||m>h[0].max)))if("y"!=a[g].err||!(q>h[0].max||q<h[0].min||l<h[1].min||m>h[1].max)){var y=t=!0;l>d[1]&&(t=!1,l=d[1]);m<d[0]&&(y=!1,m=d[0]);if("x"==a[g].err&&v||"y"==a[g].err&&w)n=m,m=l,l=n,n=y,y=t,t=n,n=d[0],d[0]=d[1],d[1]=n;
q=h[0].p2c(q);r=h[1].p2c(r);l=h[g].p2c(l);m=h[g].p2c(m);d[0]=h[g].p2c(d[0]);d[1]=h[g].p2c(d[1]);n=a[g].lineWidth?a[g].lineWidth:e.points.lineWidth;var z=null!=e.points.shadowSize?e.points.shadowSize:e.shadowSize;0<n&&0<z&&(z/=2,b.lineWidth=z,b.strokeStyle="rgba(0,0,0,0.1)",A(b,a[g],q,r,l,m,t,y,k,z+z/2,d),b.strokeStyle="rgba(0,0,0,0.2)",A(b,a[g],q,r,l,m,t,y,k,z/2,d));b.strokeStyle=a[g].color?a[g].color:e.color;b.lineWidth=n;A(b,a[g],q,r,l,m,t,y,k,0,d)}}}});b.restore()}w.plot.plugins.push({init:function(c){c.hooks.processRawData.push(D);
c.hooks.draw.push(E)},options:{series:{points:{errorbars:null,xerr:{err:"x",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null},yerr:{err:"y",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null}}}},name:"errorbars",version:"1.0"})})(jQuery);
(function(e){function a(b){var h=this,f=b.data||{};if(f.elem)h=b.dragTarget=f.elem,b.dragProxy=c.proxy||h,b.cursorOffsetX=f.pageX-f.left,b.cursorOffsetY=f.pageY-f.top,b.offsetX=b.pageX-b.cursorOffsetX,b.offsetY=b.pageY-b.cursorOffsetY;else if(c.dragging||0<f.which&&b.which!=f.which||e(b.target).is(f.not))return;switch(b.type){case "mousedown":return e.extend(f,e(h).offset(),{elem:h,target:b.target,pageX:b.pageX,pageY:b.pageY}),g.add(document,"mousemove mouseup",a,f),m(h,!1),c.dragging=null,!1;case !c.dragging&&
"mousemove":if(Math.pow(b.pageX-f.pageX,2)+Math.pow(b.pageY-f.pageY,2)<f.distance)break;b.target=f.target;var d=k(b,"dragstart",h);!1!==d&&(c.dragging=h,c.proxy=b.dragProxy=e(d||h)[0]);case "mousemove":if(c.dragging){if(d=k(b,"drag",h),l.drop&&(l.drop.allowed=!1!==d,l.drop.handler(b)),!1!==d)break;b.type="mouseup"}case "mouseup":g.remove(document,"mousemove mouseup",a),c.dragging&&(l.drop&&l.drop.handler(b),k(b,"dragend",h)),m(h,!0),c.dragging=c.proxy=f.elem=!1}return!0}function k(b,a,f){b.type=a;
a=e.event.dispatch.call(f,b);return!1===a?!1:a||b.result}function n(){return!1===c.dragging}function m(b,a){b&&(b.unselectable=a?"off":"on",b.onselectstart=function(){return a},b.style&&(b.style.MozUserSelect=a?"":"none"))}e.fn.drag=function(b,a,f){return a&&this.bind("dragstart",b),f&&this.bind("dragend",f),b?this.bind("drag",a?a:b):this.trigger("drag")};var g=e.event,l=g.special,c=l.drag={not:":input",distance:0,which:1,dragging:!1,setup:function(b){b=e.extend({distance:c.distance,which:c.which,
not:c.not},b||{});b.distance=Math.pow(b.distance,2);g.add(this,"mousedown",a,b);this.attachEvent&&this.attachEvent("ondragstart",n)},teardown:function(){g.remove(this,"mousedown",a);this===c.dragging&&(c.dragging=c.proxy=!1);m(this,!0);this.detachEvent&&this.detachEvent("ondragstart",n)}};l.dragstart=l.dragend={setup:function(){},teardown:function(){}}})(jQuery);
(function(e){function a(a){var g=a||window.event,m=[].slice.call(arguments,1),c=0,b=0;a=e.event.fix(g);a.type="mousewheel";g.wheelDelta&&(c=g.wheelDelta/120);g.detail&&(c=-g.detail/3);var h=c;void 0!==g.axis&&g.axis===g.HORIZONTAL_AXIS&&(h=0,b=-1*c);void 0!==g.wheelDeltaY&&(h=g.wheelDeltaY/120);void 0!==g.wheelDeltaX&&(b=-1*g.wheelDeltaX/120);m.unshift(a,c,b,h);return(e.event.dispatch||e.event.handle).apply(this,m)}var k=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var n=k.length;n;)e.event.fixHooks[k[--n]]=
e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=k.length;e;)this.addEventListener(k[--e],a,!1);else this.onmousewheel=a},teardown:function(){if(this.removeEventListener)for(var e=k.length;e;)this.removeEventListener(k[--e],a,!1);else this.onmousewheel=null}};e.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
(function(e){e.plot.plugins.push({init:function(a){function k(b,p){var d=a.offset();d.left=b.pageX-d.left;d.top=b.pageY-d.top;p?a.zoomOut({center:d}):a.zoom({center:d})}function n(a,b){a.preventDefault();k(a,0>b);return!1}function m(d){if(1!=d.which)return!1;var p=a.getPlaceholder().css("cursor");p&&(c=p);a.getPlaceholder().css("cursor",a.getOptions().pan.cursor);b=d.pageX;h=d.pageY}function g(d){var p=a.getOptions().pan.frameRate;!f&&p&&(f=setTimeout(function(){a.pan({left:b-d.pageX,top:h-d.pageY});
b=d.pageX;h=d.pageY;f=null},1/p*1E3))}function l(d){f&&(clearTimeout(f),f=null);a.getPlaceholder().css("cursor",c);a.pan({left:b-d.pageX,top:h-d.pageY})}var c="default",b=0,h=0,f=null;a.zoomOut=function(b){b||(b={});b.amount||(b.amount=a.getOptions().zoom.amount);b.amount=1/b.amount;a.zoom(b)};a.zoom=function(b){b||(b={});var d=b.center,f=b.amount||a.getOptions().zoom.amount,c=a.width(),g=a.height();d||(d={left:c/2,top:g/2});var h=d.left/c,k=d.top/g,l={x:{min:d.left-h*c/f,max:d.left+(1-h)*c/f},y:{min:d.top-
k*g/f,max:d.top+(1-k)*g/f}};e.each(a.getAxes(),function(b,a){b=a.options;var d=l[a.direction].min,c=l[a.direction].max,e=b.zoomRange,g=b.panRange;!1!==e&&(d=a.c2p(d),c=a.c2p(c),d>c&&(a=d,d=c,c=a),g&&(null!=g[0]&&d<g[0]&&(d=g[0]),null!=g[1]&&c>g[1]&&(c=g[1])),a=c-d,e&&(null!=e[0]&&a<e[0]&&1<f||null!=e[1]&&a>e[1]&&1>f)||(b.min=d,b.max=c))});a.setupGrid();a.draw();b.preventEvent||a.getPlaceholder().trigger("plotzoom",[a,b])};a.pan=function(b){var d={x:+b.left,y:+b.top};isNaN(d.x)&&(d.x=0);isNaN(d.y)&&
(d.y=0);e.each(a.getAxes(),function(b,a){b=a.options;var c=d[a.direction];var f=a.c2p(a.p2c(a.min)+c);a=a.c2p(a.p2c(a.max)+c);var e=b.panRange;!1!==e&&(e&&(null!=e[0]&&e[0]>f&&(c=e[0]-f,f+=c,a+=c),null!=e[1]&&e[1]<a&&(c=e[1]-a,f+=c,a+=c)),b.min=f,b.max=a)});a.setupGrid();a.draw();b.preventEvent||a.getPlaceholder().trigger("plotpan",[a,b])};a.hooks.bindEvents.push(function(b,a){b=b.getOptions();b.zoom.interactive&&(a[b.zoom.trigger](k),a.mousewheel(n));b.pan.interactive&&(a.bind("dragstart",{distance:10},
m),a.bind("drag",g),a.bind("dragend",l))});a.hooks.shutdown.push(function(b,a){a.unbind(b.getOptions().zoom.trigger,k);a.unbind("mousewheel",n);a.unbind("dragstart",m);a.unbind("drag",g);a.unbind("dragend",l);f&&clearTimeout(f)})},options:{xaxis:{zoomRange:null,panRange:null},zoom:{interactive:!1,trigger:"dblclick",amount:1.5},pan:{interactive:!1,cursor:"move",frameRate:20}},name:"navigate",version:"1.3"})})(jQuery);
(function(b,a,l){function m(n){!0===g&&(g=n||1);for(var d=c.length-1;0<=d;d--){var h=b(c[d]);if(h[0]==a||h.is(":visible")){var l=h.width(),p=h.height(),e=h.data("resize-special-event");!e||l===e.w&&p===e.h||(h.trigger("resize",[e.w=l,e.h=p]),g=n||!0)}else e=h.data("resize-special-event"),e.w=0,e.h=0}null!==k&&(g&&(null==n||1E3>n-g)?k=a.requestAnimationFrame(m):(k=setTimeout(m,f.pendingDelay),g=!1))}"$:nomunge";var c=[],f=b.resize=b.extend(b.resize,{}),k,g=!1;f.pendingDelay=200;f.activeDelay=20;f.throttleWindow=
!0;b.event.special.resize={setup:function(){if(!f.throttleWindow&&this.setTimeout)return!1;var a=b(this);c.push(this);a.data("resize-special-event",{w:a.width(),h:a.height()});1===c.length&&(k=l,m())},teardown:function(){if(!f.throttleWindow&&this.setTimeout)return!1;for(var a=b(this),d=c.length-1;0<=d;d--)if(c[d]==this){c.splice(d,1);break}a.removeData("resize-special-event");c.length||(g?cancelAnimationFrame(k):clearTimeout(k),k=null)},add:function(a){function d(a,d,e){var c=b(this),f=c.data("resize-special-event")||
{};f.w=d!==l?d:c.width();f.h=e!==l?e:c.height();m.apply(this,arguments)}if(!f.throttleWindow&&this.setTimeout)return!1;if(b.isFunction(a)){var m=a;return d}m=a.handler;a.handler=d}};a.requestAnimationFrame||(a.requestAnimationFrame=function(){return a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(c,d){return a.setTimeout(function(){c((new Date).getTime())},f.activeDelay)}}());a.cancelAnimationFrame||(a.cancelAnimationFrame=a.webkitCancelRequestAnimationFrame||
a.mozCancelRequestAnimationFrame||a.oCancelRequestAnimationFrame||a.msCancelRequestAnimationFrame||clearTimeout)})(jQuery,this);(function(b){b.plot.plugins.push({init:function(a){function b(){var b=a.getPlaceholder();0!=b.width()&&0!=b.height()&&(a.resize(),a.setupGrid(),a.draw())}a.hooks.bindEvents.push(function(a,c){a.getPlaceholder().resize(b)});a.hooks.shutdown.push(function(a,c){a.getPlaceholder().unbind("resize",b)})},options:{},name:"resize",version:"1.0"})})(jQuery);
(function(m){m.plot.plugins.push({init:function(b){function r(a){c.active&&(t(a),b.getPlaceholder().trigger("plotselecting",[q()]))}function u(a){1==a.which&&(document.body.focus(),void 0!==document.onselectstart&&null==f.onselectstart&&(f.onselectstart=document.onselectstart,document.onselectstart=function(){return!1}),void 0!==document.ondrag&&null==f.ondrag&&(f.ondrag=document.ondrag,document.ondrag=function(){return!1}),v(c.first,a),c.active=!0,n=function(a){n=null;void 0!==document.onselectstart&&
(document.onselectstart=f.onselectstart);void 0!==document.ondrag&&(document.ondrag=f.ondrag);c.active=!1;t(a);p()?w():(b.getPlaceholder().trigger("plotunselected",[]),b.getPlaceholder().trigger("plotselecting",[null]))},m(document).one("mouseup",n))}function q(){if(!p()||!c.show)return null;var a={},e=c.first,l=c.second;m.each(b.getAxes(),function(c,b){if(b.used){var d=b.c2p(e[b.direction]);b=b.c2p(l[b.direction]);a[c]={from:Math.min(d,b),to:Math.max(d,b)}}});return a}function w(){var a=q();b.getPlaceholder().trigger("plotselected",
[a]);a.xaxis&&a.yaxis&&b.getPlaceholder().trigger("selected",[{x1:a.xaxis.from,y1:a.yaxis.from,x2:a.xaxis.to,y2:a.yaxis.to}])}function v(a,e){var l=b.getOptions(),d=b.getPlaceholder().offset(),k=b.getPlotOffset(),g=e.pageX-d.left-k.left,h=b.width();a.x=0>g?0:g>h?h:g;e=e.pageY-d.top-k.top;d=b.height();a.y=0>e?0:e>d?d:e;"y"==l.selection.mode&&(a.x=a==c.first?0:b.width());"x"==l.selection.mode&&(a.y=a==c.first?0:b.height())}function t(a){null!=a.pageX&&(v(c.second,a),p()?(c.show=!0,b.triggerRedrawOverlay()):
x(!0))}function x(a){c.show&&(c.show=!1,b.triggerRedrawOverlay(),a||b.getPlaceholder().trigger("plotunselected",[]))}function y(a,c){var e=b.getAxes(),d;for(d in e){var k=e[d];if(k.direction==c){var g=c+k.n+"axis";a[g]||1!=k.n||(g=c+"axis");if(a[g]){var h=a[g].from;var f=a[g].to;break}}}a[g]||(k="x"==c?b.getXAxes()[0]:b.getYAxes()[0],h=a[c+"1"],f=a[c+"2"]);null!=h&&null!=f&&h>f&&(a=h,h=f,f=a);return{from:h,to:f,axis:k}}function p(){var a=b.getOptions().selection.minSize;return Math.abs(c.second.x-
c.first.x)>=a&&Math.abs(c.second.y-c.first.y)>=a}var c={first:{x:-1,y:-1},second:{x:-1,y:-1},show:!1,active:!1},f={},n=null;b.clearSelection=x;b.setSelection=function(a,e){var l=b.getOptions();if("y"==l.selection.mode)c.first.x=0,c.second.x=b.width();else{var d=y(a,"x");c.first.x=d.axis.p2c(d.from);c.second.x=d.axis.p2c(d.to)}"x"==l.selection.mode?(c.first.y=0,c.second.y=b.height()):(d=y(a,"y"),c.first.y=d.axis.p2c(d.from),c.second.y=d.axis.p2c(d.to));c.show=!0;b.triggerRedrawOverlay();!e&&p()&&w()};
b.getSelection=q;b.hooks.bindEvents.push(function(a,c){null!=a.getOptions().selection.mode&&(c.mousemove(r),c.mousedown(u))});b.hooks.drawOverlay.push(function(a,b){if(c.show&&p()){var e=a.getPlotOffset();a=a.getOptions();b.save();b.translate(e.left,e.top);e=m.color.parse(a.selection.color);b.strokeStyle=e.scale("a",.8).toString();b.lineWidth=1;b.lineJoin=a.selection.shape;b.fillStyle=e.scale("a",.4).toString();e=Math.min(c.first.x,c.second.x)+.5;a=Math.min(c.first.y,c.second.y)+.5;var d=Math.abs(c.second.x-
c.first.x)-1,f=Math.abs(c.second.y-c.first.y)-1;b.fillRect(e,a,d,f);b.strokeRect(e,a,d,f);b.restore()}});b.hooks.shutdown.push(function(a,b){b.unbind("mousemove",r);b.unbind("mousedown",u);n&&m(document).unbind("mouseup",n)})},options:{selection:{mode:null,color:"#e8cfac",shape:"round",minSize:5}},name:"selection",version:"1.1"})})(jQuery);
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var e=a.length,f=0;f<e;f++){var d=a[f];if(c.call(b,d,f,a))return{i:f,v:d}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,c,b,e){if(c){b=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var f=a[e];f in b||(b[f]={});b=b[f]}a=a[a.length-1];e=b[a];c=c(e);c!=e&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
(function(a){function c(d,b){e&&(d.stack=[],b=d.getPlaceholder(),a(b).append("<div style='position:relative'><div style='z-index:100;position:absolute;right:12;top:12;z-index:2'>\t\t <img class='zoomout' width='16' height='16' title='' alt='' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABYlBMVEU9m+Y6l+I8meQ+nehAn+o/nuk8muU3luEujdgsi9Yujdcwj9ogf8ojgs0ce8YYd8IaecQZa7YbbrkabbgWZ7IVZrEIVaAMWqUQYKsCFSgAAAA/nehAn+pAn+o9m+ZVru09m+Y8meQ+neg8meRUruxQquo6l+I/nulVr+44l+JMqOg3luEsi9ZqyfYujdcgf8o2mNpgxPQjgs0ce8YaecQbesUZa7YabbgabLcWZ7IcfcQpq+sVZrEQX6oepuoQYKsMWqUPcrwMWqUIVJ8UcbgKbbcJVqEIVaANb7gFUJsPbLQEPXUDKU8JarQBFCYCTJcCN2wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACZ5f+V5P+U5P+I3/9Qm9GY5f+W5P9Pm9F93P+T4/+R4/+N4f+L4f9k1P9f0v9Tzv9OzP8zisgivf8Xuv8xishAx/8zw/8jvv8Wuv8twf8Uuf////9LFEt0AAAAWnRSTlMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzzHDM2XAzM3DZ2YXM2XDZzIXzzDPZ88wzzJkzzJkz2fPMhfPMcNnMcNnZhczZzNlwM9lAzIMyLioiGx0mKy/TF9BpAAAAAWJLR0R1qGqY+wAAAPtJREFUGNMVxedfQVEYAOD3cm8iDm84114l2SuyZ5LcjHaKop3R/P9/nft8ecDucAKnUPK8UsGB02EH18jt4bw+nvd5OY975IKt7Vv/jj8gCAHW3a4T1oKh8eQ+rFKFHybjUFCAdXVkOovGNJpYdDaNqDdAG088Jp9SOl3qOfmSiGuBpPeYDCEZ+TQBQvSMgRCDPCGAuMkYEY3yiIDZfSaHmJPPIpjyhdfiW8lsLr0XPwp5E1CxPF9UqhZLtbKYl0UKtFZfrj4botj4Wi3rNQrNg+/WYatNaZv1c9SEzu9x1ypJNpskWbsnfx3o9QfD07Pzi8ur65vhoN/7B9wsL7lanTVQAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTA0LTAzVDE3OjE4OjAxKzA4OjAw0kcQ3gAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMS0wNS0xOFQyMzoyNzowMCswODowMPWTeDEAAABNdEVYdHNvZnR3YXJlAEltYWdlTWFnaWNrIDYuOC44LTcgUTE2IHg4Nl82NCAyMDE0LTAyLTI4IGh0dHA6Ly93d3cuaW1hZ2VtYWdpY2sub3JnWaRffwAAABh0RVh0VGh1bWI6OkRvY3VtZW50OjpQYWdlcwAxp/+7LwAAABd0RVh0VGh1bWI6OkltYWdlOjpIZWlnaHQAMTYdr15vAAAAFnRFWHRUaHVtYjo6SW1hZ2U6OldpZHRoADE25QCe4gAAABl0RVh0VGh1bWI6Ok1pbWV0eXBlAGltYWdlL3BuZz+yVk4AAAAXdEVYdFRodW1iOjpNVGltZQAxMzA1NzMyNDIw3zNdNgAAABF0RVh0VGh1bWI6OlNpemUANzcxQkKQmHCaAAAAYHRFWHRUaHVtYjo6VVJJAGZpbGU6Ly8vaG9tZS9mdHAvMTUyMC9lYXN5aWNvbi5jbi9lYXN5aWNvbi5jbi9jZG4taW1nLmVhc3lpY29uLmNuL3BuZy81MTIyLzUxMjIzMy5wbmelXfH0AAAAAElFTkSuQmCC' /></div></div>"),a(b).bind("plotselected",
function(b,e){b=f.zoomFunc;var c=d.getAxes(),h=d.getPlaceholder(),g={};g.xmin=c.xaxis.min;g.xmax=c.xaxis.max;g.ymin=c.yaxis.min;g.ymax=c.yaxis.max;d.stack.push(g);c.xaxis.options.min=e.xaxis.from;c.xaxis.options.max=e.xaxis.to;c.yaxis.options.min=e.yaxis.from;c.yaxis.options.max=e.yaxis.to;d.clearSelection(!0);d.setupGrid();d.draw();a(h).find(".zoomout").css("visibility","visible");void 0!==b&&b(d,g)}),a(b).find(".zoomout").click(function(){var b=f.zoomFunc,c=d.stack.pop(),e=d.getPlaceholder();0===
d.stack.length&&a(e).find(".zoomout").css("visibility","hidden");d.getAxes().xaxis.options.min=c.xmin;d.getAxes().xaxis.options.max=c.xmax;d.getAxes().yaxis.options.min=c.ymin;d.getAxes().yaxis.options.max=c.ymax;d.clearSelection(!0);d.setupGrid();d.draw();void 0!==b&&b(d,c)}),a(b).find(".zoomout").css("visibility","hidden"),e=0)}function b(a,b){b&&b.zoomStack&&("object"===typeof b.zoomStack?(f.zoomStack=b.zoomStack.enabled,f.zoomFunc=b.zoomStack.func):f.zoomStack=b.zoomStack);f.zoomStack&&(e=1,a.hooks.drawOverlay.push(c))}
var e=0,f={zoomStack:0,zoomFunc:void 0};a.plot.plugins.push({init:function(a){a.hooks.processOptions.push(b)},options:f,name:"zoomStack",version:.1})})($);
function sprintf(){var l=arguments,r=0,t=function(b,a,f,c){f||(f=" ");a=b.length>=a?"":Array(1+a-b.length>>>0).join(f);return c?b+a:a+b},p=function(b,a,f,c,g,d){var e=c-b.length;0<e&&(b=f||!g?t(b,c,d,f):b.slice(0,a.length)+t("",e,"0",!0)+b.slice(a.length));return b},q=function(b,a,f,c,g,d,e){b>>>=0;f=f&&b&&{2:"0b",8:"0",16:"0x"}[a]||"";b=f+t(b.toString(a),d||0,"0",!1);return p(b,f,c,g,e)};return l[r++].replace(/%%|%(\d+\$)?([-+'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g,function(b,
a,f,c,g,d,e){if("%%"==b)return"%";var h=!1;var m="";var n=g=!1;var k=" ";for(var v=f.length,u=0;f&&u<v;u++)switch(f.charAt(u)){case " ":m=" ";break;case "+":m="+";break;case "-":h=!0;break;case "'":k=f.charAt(u+1);break;case "0":g=!0;break;case "#":n=!0}c=c?"*"==c?+l[r++]:"*"==c.charAt(0)?+l[c.slice(1,-1)]:+c:0;0>c&&(c=-c,h=!0);if(!isFinite(c))throw Error("sprintf: (minimum-)width must be finite");d=d?"*"==d?+l[r++]:"*"==d.charAt(0)?+l[d.slice(1,-1)]:+d:-1<"fFeE".indexOf(e)?6:"d"==e?0:void 0;a=a?
l[a.slice(0,-1)]:l[r++];switch(e){case "s":return e=String(a),null!=d&&(e=e.slice(0,d)),p(e,"",h,c,g,k);case "c":return e=String.fromCharCode(+a),null!=d&&(e=e.slice(0,d)),p(e,"",h,c,g,void 0);case "b":return q(a,2,n,h,c,d,g);case "o":return q(a,8,n,h,c,d,g);case "x":return q(a,16,n,h,c,d,g);case "X":return q(a,16,n,h,c,d,g).toUpperCase();case "u":return q(a,10,n,h,c,d,g);case "i":case "d":return k=+a|0,b=0>k?"-":m,a=b+t(String(Math.abs(k)),d,"0",!1),p(a,b,h,c,g);case "e":case "E":case "f":case "F":case "g":case "G":return k=
+a,b=0>k?"-":m,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(e.toLowerCase())],e=["toString","toUpperCase"]["eEfFgG".indexOf(e)%2],a=b+Math.abs(k)[m](d),p(a,b,h,c,g)[e]();default:return b}})};
var dhtmlwindow={imagefiles:["windowfiles/min.gif","windowfiles/close.gif","windowfiles/restore.gif","windowfiles/resize.gif"],ajaxbustcache:!0,ajaxloadinghtml:"<b>Loading Page. Please wait...</b>",minimizeorder:0,zIndexvalue:100,tobjects:[],lastactivet:{},init:function(a){var b=document.createElement("div");b.id=a;b.className="dhtmlwindow";var c="";c='<div class="drag-handle">';c=navigator.platform.match(/^Win/)?c+('DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimize" /><img src="'+
this.imagefiles[1]+'" title="Close" /></div>'):c+'DHTML Window <div class="drag-controls"><div class="osxButtons"><div class="osxClose"><a class="osxA osxClosebutton" href="#"><span class="osxSpan"><strong title="Close">\u00d7</strong></span></a></div><div class="osxMinimize"><a class="osxA osxMinimizebutton" href="#"><span class="osxSpan"><strong title="Minimize">–</strong></span></a></div></div></div>';c=c+'</div><div class="drag-contentarea"></div><div class="drag-statusarea"><div class="drag-resizearea" style="background: transparent url('+
(this.imagefiles[3]+') top right no-repeat;"> </div></div>');b.innerHTML=c+"</div>";document.getElementById("dhtmlwindowholder").appendChild(b);a=document.getElementById(a);b=a.getElementsByTagName("div");for(c=0;c<b.length;c++)/drag-/.test(b[c].className)&&(a[b[c].className.replace(/drag-/,"")]=b[c]);a.handle._parent=a;a.resizearea._parent=a;a.controls._parent=a;a.onclose=function(){return!0};a.onmousedown=function(){dhtmlwindow.setfocus(this)};a.ontouchstart=function(){dhtmlwindow.setfocus(this)};
a.handle.onmousedown=dhtmlwindow.setupdrag;a.handle.ontouchstart=dhtmlwindow.setupdrag;a.resizearea.onmousedown=dhtmlwindow.setupdrag;a.resizearea.ontouchstart=dhtmlwindow.setupdrag;a.controls.onclick=dhtmlwindow.enablecontrols;a.show=function(){dhtmlwindow.show(this)};a.hide=function(){dhtmlwindow.hide(this)};a.close=function(){dhtmlwindow.close(this)};a.setSize=function(a,b){dhtmlwindow.setSize(this,a,b)};a.moveTo=function(a,b){dhtmlwindow.moveTo(this,a,b)};a.isResize=function(a){dhtmlwindow.isResize(this,
a)};a.isScrolling=function(a){dhtmlwindow.isScrolling(this,a)};a.load=function(a,b,c){dhtmlwindow.load(this,a,b,c)};return this.tobjects[this.tobjects.length]=a},open:function(a,b,c,e,k,f){function d(a){return(new RegExp(a+"=([^,]+)","i")).test(k)?parseInt(RegExp.$1):0}a=null==document.getElementById(a)?this.init(a):document.getElementById(a);this.setfocus(a);a.setSize(d("width"),d("height"));var g=d("center")?"middle":d("left"),h=d("center")?"middle":d("top");"undefined"!=typeof f&&"recal"==f&&0==
this.scroll_top&&(window.attachEvent&&!window.opera?this.addEvent(window,function(){setTimeout(function(){a.moveTo(g,h)},400)},"load"):this.addEvent(window,function(){a.moveTo(g,h)},"load"));a.isResize(d("resize"));a.isScrolling(d("scrolling"));a.style.visibility="visible";a.style.display="block";a.contentarea.style.display="block";a.moveTo(g,h);a.load(b,c,e);"minimized"==a.state&&"Restore"==a.controls.firstChild.title&&(a.controls.firstChild.setAttribute("src",dhtmlwindow.imagefiles[0]),a.controls.firstChild.setAttribute("title",
"Minimize"),a.state="fullview");return a},setSize:function(a,b,c){a.style.width=Math.max(parseInt(b),150)+"px";a.contentarea.style.height=Math.max(parseInt(c),20)+"px"},moveTo:function(a,b,c){this.getviewpoint();a.style.left="middle"==b?this.scroll_left+(this.docwidth-a.offsetWidth)/2+"px":this.scroll_left+parseInt(b)+"px";a.style.top="middle"==c?this.scroll_top+(this.docheight-a.offsetHeight)/2+"px":this.scroll_top+parseInt(c)+"px"},isResize:function(a,b){a.statusarea.style.display=b?"block":"none";
a.resizeBool=b?1:0},isScrolling:function(a,b){a.contentarea.style.overflow=b?"auto":"hidden"},load:function(a,b,c,e){a.isClosed?alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again."):(b=b.toLowerCase(),"undefined"!=typeof e&&(a.handle.firstChild.nodeValue=e),"inline"==b?a.contentarea.innerHTML=c:"div"==b?(c=document.getElementById(c),a.contentarea.innerHTML=c.defaultHTML||c.innerHTML,c.defaultHTML||(c.defaultHTML=c.innerHTML),c.innerHTML="",c.style.display=
"none"):"iframe"==b?(a.contentarea.style.overflow="hidden",a.contentarea.firstChild&&"IFRAME"==a.contentarea.firstChild.tagName||(a.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+a.id+'"></iframe>'),window.frames["_iframe-"+a.id].location.replace(c)):"ajax"==b&&this.ajax_connect(c,a),a.contentarea.datatype=b)},setupdrag:function(a){var b=dhtmlwindow,c=this._parent;b.etarget=this;a=window.event||a;a.touches&&a.touches.length?(b.initmousex=
a.touches[0].clientX,b.initmousey=a.touches[0].clientY):(b.initmousex=a.clientX,b.initmousey=a.clientY);b.initx=parseInt(c.offsetLeft);b.inity=parseInt(c.offsetTop);b.width=parseInt(c.offsetWidth);b.contentheight=parseInt(c.contentarea.offsetHeight);"iframe"==c.contentarea.datatype&&(c.style.backgroundColor="#F8F8F8",c.contentarea.style.visibility="hidden");document.onmousemove=b.getdistance;document.ontouchmove=b.getdistance;document.onmouseup=function(){"iframe"==c.contentarea.datatype&&(c.contentarea.style.backgroundColor=
"white",c.contentarea.style.visibility="visible");b.stop()};document.ontouchend=function(){"iframe"==c.contentarea.datatype&&(c.contentarea.style.backgroundColor="white",c.contentarea.style.visibility="visible");b.stop()};return!1},getdistance:function(a){var b=dhtmlwindow,c=b.etarget;a=window.event||a;a.touches&&a.touches.length?(b.distancex=a.touches[0].clientX-b.initmousex,b.distancey=a.touches[0].clientY-b.initmousey):(b.distancex=a.clientX-b.initmousex,b.distancey=a.clientY-b.initmousey);"drag-handle"==
c.className?b.move(c._parent,a):"drag-resizearea"==c.className&&b.resize(c._parent,a);return!1},getviewpoint:function(){var a=document.all&&!window.opera,b=document.documentElement&&parseInt(document.documentElement.clientWidth)||1E5;this.standardbody="CSS1Compat"==document.compatMode?document.documentElement:document.body;this.scroll_top=a?this.standardbody.scrollTop:window.pageYOffset;this.scroll_left=a?this.standardbody.scrollLeft:window.pageXOffset;this.docwidth=a?this.standardbody.clientWidth:
/Safari/i.test(navigator.userAgent)?window.innerWidth:Math.min(b,window.innerWidth-16);this.docheight=a?this.standardbody.clientHeight:window.innerHeight},rememberattrs:function(a){this.getviewpoint();a.lastx=parseInt(a.style.left||a.offsetLeft)-dhtmlwindow.scroll_left;a.lasty=parseInt(a.style.top||a.offsetTop)-dhtmlwindow.scroll_top;a.lastwidth=parseInt(a.style.width)},move:function(a,b){a.style.left=Math.max(0,dhtmlwindow.distancex+dhtmlwindow.initx)+"px";a.style.top=Math.max(0,dhtmlwindow.distancey+
dhtmlwindow.inity)+"px"},resize:function(a,b){a.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex,150)+"px";a.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey,20)+"px"},enablecontrols:function(a){var b=dhtmlwindow;a=window.event?window.event.srcElement:a.target;/Minimize/i.test(a.getAttribute("title"))?b.minimize(a,this._parent):/Restore/i.test(a.getAttribute("title"))?b.restore(a,this._parent):/Close/i.test(a.getAttribute("title"))&&b.close(this._parent);
return!1},minimize:function(a,b){dhtmlwindow.rememberattrs(b);a.setAttribute("src",dhtmlwindow.imagefiles[2]);a.setAttribute("title","Restore");b.state="minimized";b.contentarea.style.display="none";b.statusarea.style.display="none";"undefined"==typeof b.minimizeorder&&(dhtmlwindow.minimizeorder++,b.minimizeorder=dhtmlwindow.minimizeorder);b.style.left="10px";b.style.width="200px";b.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-b.handle.offsetHeight*b.minimizeorder-10*b.minimizeorder+"px"},
restore:function(a,b){dhtmlwindow.getviewpoint();a.setAttribute("src",dhtmlwindow.imagefiles[0]);a.setAttribute("title","Minimize");b.state="fullview";b.style.display="block";b.contentarea.style.display="block";b.resizeBool&&(b.statusarea.style.display="block");b.style.left=parseInt(b.lastx)+dhtmlwindow.scroll_left+"px";b.style.top=parseInt(b.lasty)+dhtmlwindow.scroll_top+"px";b.style.width=parseInt(b.lastwidth)+"px"},close:function(a){try{var b=a.onclose()}catch(c){b=!0}finally{"undefined"==typeof b&&
(alert('An error has occured somwhere inside your "onclose" event handler'),b=!0)}b&&("minimized"!=a.state&&dhtmlwindow.rememberattrs(a),window.frames["_iframe-"+a.id]?window.frames["_iframe-"+a.id].location.replace("about:blank"):a.contentarea.innerHTML="",a.style.display="none",a.isClosed=!0);return b},setopacity:function(a,b){a&&(a.filters&&a.filters[0]?"number"==typeof a.filters[0].opacity?a.filters[0].opacity=100*b:a.style.filter="alpha(opacity="+100*b+")":"undefined"!=typeof a.style.MozOpacity?
a.style.MozOpacity=b:"undefined"!=typeof a.style.opacity&&(a.style.opacity=b))},setfocus:function(a){this.zIndexvalue++;a.style.zIndex=this.zIndexvalue;a.isClosed=!1;this.setopacity(this.lastactivet.handle,.5);this.setopacity(a.handle,1);this.lastactivet=a},show:function(a){a.isClosed?alert("DHTML Window has been closed, so nothing to show. Open/Create the window again."):(a.lastx?dhtmlwindow.restore(a.controls.firstChild,a):a.style.display="block",this.setfocus(a),a.state="fullview")},hide:function(a){a.style.display=
"none"},ajax_connect:function(a,b){var c=!1,e="";if(window.XMLHttpRequest)c=new XMLHttpRequest;else if(window.ActiveXObject)try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(k){try{c=new ActiveXObject("Microsoft.XMLHTTP")}catch(f){}}else return!1;b.contentarea.innerHTML=this.ajaxloadinghtml;c.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(c,b)};this.ajaxbustcache&&(e=-1!=a.indexOf("?")?"&"+(new Date).getTime():"?"+(new Date).getTime());c.open("GET",a+e,!0);c.send(null)},ajax_loadpage:function(a,
b){4!=a.readyState||200!=a.status&&-1!=window.location.href.indexOf("http")||(b.contentarea.innerHTML=a.responseText)},stop:function(){dhtmlwindow.etarget=null;dhtmlwindow.distancex=0;dhtmlwindow.distancey=0;document.onmousemove=null;document.ontouchmove=null;document.onmouseup=null;document.ontouchend=null},addEvent:function(a,b,c){c=window.addEventListener?c:"on"+c;a.addEventListener?a.addEventListener(c,b,!1):a.attachEvent&&a.attachEvent(c,b)},cleanup:function(){for(var a=0;a<dhtmlwindow.tobjects.length;a++)dhtmlwindow.tobjects[a].handle._parent=
dhtmlwindow.tobjects[a].resizearea._parent=dhtmlwindow.tobjects[a].controls._parent=null;window.onload=null}};window.onunload=dhtmlwindow.cleanup;
/***********************************************
* DHTML Window Widget- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var fabric=fabric||{version:"5.2.1"};if("undefined"!=typeof exports?exports.fabric=fabric:"function"==typeof define&&define.amd&&define([],function(){return fabric}),"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?fabric.document=document:fabric.document=document.implementation.createHTMLDocument(""),fabric.window=window;else{var jsdom=require("jsdom"),virtualWindow=new jsdom.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;fabric.document=virtualWindow.document,fabric.jsdomImplForWrapper=require("jsdom/lib/jsdom/living/generated/utils").implForWrapper,fabric.nodeCanvas=require("jsdom/lib/jsdom/utils").Canvas,fabric.window=virtualWindow,DOMParser=fabric.window.DOMParser}function resizeCanvasIfNeeded(t){var e=t.targetCanvas,i=e.width,r=e.height,n=t.destinationWidth,s=t.destinationHeight;i===n&&r===s||(e.width=n,e.height=s)}function copyGLTo2DDrawImage(t,e){var i=t.canvas,r=e.targetCanvas,n=r.getContext("2d");n.translate(0,r.height),n.scale(1,-1);var s=i.height-r.height;n.drawImage(i,0,s,r.width,r.height,0,0,r.width,r.height)}function copyGLTo2DPutImageData(t,e){var i=e.targetCanvas.getContext("2d"),r=e.destinationWidth,n=e.destinationHeight,s=r*n*4,o=new Uint8Array(this.imageBuffer,0,s),a=new Uint8ClampedArray(this.imageBuffer,0,s);t.readPixels(0,0,r,n,t.RGBA,t.UNSIGNED_BYTE,o);var c=new ImageData(a,r,n);i.putImageData(c,0,0)}fabric.isTouchSupported="ontouchstart"in fabric.window||"ontouchstart"in fabric.document||fabric.window&&fabric.window.navigator&&0<fabric.window.navigator.maxTouchPoints,fabric.isLikelyNode="undefined"!=typeof Buffer&&"undefined"==typeof window,fabric.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],fabric.DPI=96,fabric.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",fabric.commaWsp="(?:\\s+,?\\s*|,\\s*)",fabric.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,fabric.reNonWord=/[ \n\.,;!\?\-]/,fabric.fontPaths={},fabric.iMatrix=[1,0,0,1,0,0],fabric.svgNS="http://www.w3.org/2000/svg",fabric.perfLimitSizeTotal=2097152,fabric.maxCacheSideLimit=4096,fabric.minCacheSideLimit=256,fabric.charWidthsCache={},fabric.textureSize=2048,fabric.disableStyleCopyPaste=!1,fabric.enableGLFiltering=!0,fabric.devicePixelRatio=fabric.window.devicePixelRatio||fabric.window.webkitDevicePixelRatio||fabric.window.mozDevicePixelRatio||1,fabric.browserShadowBlurConstant=1,fabric.arcToSegmentsCache={},fabric.boundsOfCurveCache={},fabric.cachesBoundsOfCurve=!0,fabric.forceGLPutImageData=!1,fabric.initFilterBackend=function(){return fabric.enableGLFiltering&&fabric.isWebglSupported&&fabric.isWebglSupported(fabric.textureSize)?(console.log("max texture size: "+fabric.maxTextureSize),new fabric.WebglFilterBackend({tileSize:fabric.textureSize})):fabric.Canvas2dFilterBackend?new fabric.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=fabric),function(){function r(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:fabric.util.array.fill(i,!1)}}function n(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);this.on(t,i)}fabric.Observable={fire:function(t,e){if(!this.__eventListeners)return this;var i=this.__eventListeners[t];if(!i)return this;for(var r=0,n=i.length;r<n;r++)i[r]&&i[r].call(this,e||{});return this.__eventListeners[t]=i.filter(function(t){return!1!==t}),this},on:function(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in t)this.on(i,t[i]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this},once:function(t,e){if(1===arguments.length)for(var i in t)n.call(this,i,t[i]);else n.call(this,t,e);return this},off:function(t,e){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)r.call(this,t);else if(1===arguments.length&&"object"==typeof t)for(var i in t)r.call(this,i,t[i]);else r.call(this,t,e);return this}}}(),fabric.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var t=0,e=arguments.length;t<e;t++)this._onObjectAdded(arguments[t]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(t,e,i){var r=this._objects;return i?r[e]=t:r.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var t,e=this._objects,i=!1,r=0,n=arguments.length;r<n;r++)-1!==(t=e.indexOf(arguments[r]))&&(i=!0,e.splice(t,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[r]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(t,e){for(var i=this.getObjects(),r=0,n=i.length;r<n;r++)t.call(e,i[r],r,i);return this},getObjects:function(e){return void 0===e?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(t){return this._objects[t]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return-1<this._objects.indexOf(e)||!!t&&this._objects.some(function(t){return"function"==typeof t.contains&&t.contains(e,!0)})},complexity:function(){return this._objects.reduce(function(t,e){return t+=e.complexity?e.complexity():0},0)}},fabric.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof fabric.Gradient||this.set(e,new fabric.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof fabric.Pattern?i&&i():this.set(e,new fabric.Pattern(t,i))},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this},_set:function(t,e){this[t]=e},toggle:function(t){var e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this},get:function(t){return this[t]}},function(s){var o=Math.sqrt,a=Math.atan2,c=Math.pow,h=Math.PI/180,i=Math.PI/2;fabric.util={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/i){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=1;switch(t<0&&(e=-1),t/i){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){var i=t.indexOf(e);return-1!==i&&t.splice(i,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*h},radiansToDegrees:function(t){return t/h},rotatePoint:function(t,e,i){var r=new fabric.Point(t.x-e.x,t.y-e.y),n=fabric.util.rotateVector(r,i);return new fabric.Point(n.x,n.y).addEquals(e)},rotateVector:function(t,e){var i=fabric.util.sin(e),r=fabric.util.cos(e);return{x:t.x*r-t.y*i,y:t.x*i+t.y*r}},createVector:function(t,e){return new fabric.Point(e.x-t.x,e.y-t.y)},calcAngleBetweenVectors:function(t,e){return Math.acos((t.x*e.x+t.y*e.y)/(Math.hypot(t.x,t.y)*Math.hypot(e.x,e.y)))},getHatVector:function(t){return new fabric.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,e,i){var r=fabric.util.createVector(t,e),n=fabric.util.createVector(t,i),s=fabric.util.calcAngleBetweenVectors(r,n),o=s*(0===fabric.util.calcAngleBetweenVectors(fabric.util.rotateVector(r,s),n)?1:-1)/2;return{vector:fabric.util.getHatVector(fabric.util.rotateVector(r,o)),angle:s}},projectStrokeOnPoints:function(l,u,f){var d=[],g=u.strokeWidth/2,p=u.strokeUniform?new fabric.Point(1/u.scaleX,1/u.scaleY):new fabric.Point(1,1),v=function(t){var e=g/Math.hypot(t.x,t.y);return new fabric.Point(t.x*e*p.x,t.y*e*p.y)};return l.length<=1||l.forEach(function(t,e){var i,r,n=new fabric.Point(t.x,t.y);0===e?(r=l[e+1],i=f?v(fabric.util.createVector(r,n)).addEquals(n):l[l.length-1]):e===l.length-1?(i=l[e-1],r=f?v(fabric.util.createVector(i,n)).addEquals(n):l[0]):(i=l[e-1],r=l[e+1]);var s,o,a=fabric.util.getBisector(n,i,r),c=a.vector,h=a.angle;if("miter"===u.strokeLineJoin&&(s=-g/Math.sin(h/2),o=new fabric.Point(c.x*s*p.x,c.y*s*p.y),Math.hypot(o.x,o.y)/g<=u.strokeMiterLimit))return d.push(n.add(o)),void d.push(n.subtract(o));s=-g*Math.SQRT2,o=new fabric.Point(c.x*s*p.x,c.y*s*p.y),d.push(n.add(o)),d.push(n.subtract(o))}),d},transformPoint:function(t,e,i){return i?new fabric.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new fabric.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var i=0;i<t.length;i++)t[i]=fabric.util.transformPoint(t[i],e);var r=[t[0].x,t[1].x,t[2].x,t[3].x],n=fabric.util.array.min(r),s=fabric.util.array.max(r)-n,o=[t[0].y,t[1].y,t[2].y,t[3].y],a=fabric.util.array.min(o);return{left:n,top:a,width:s,height:fabric.util.array.max(o)-a}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),i=[e*t[3],-e*t[1],-e*t[2],e*t[0]],r=fabric.util.transformPoint({x:t[4],y:t[5]},i,!0);return i[4]=-r.x,i[5]=-r.y,i},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var i=/\D{0,2}$/.exec(t),r=parseFloat(t);switch(e||(e=fabric.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return r*fabric.DPI/25.4;case"cm":return r*fabric.DPI/2.54;case"in":return r*fabric.DPI;case"pt":return r*fabric.DPI/72;case"pc":return r*fabric.DPI/72*12;case"em":return r*e;default:return r}},falseFunction:function(){return!1},getKlass:function(t,e){return t=fabric.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),fabric.util.resolveNamespace(e)[t]},getSvgAttributes:function(t){var e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":e=e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":e=e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":e=e.concat(["offset","stop-color","stop-opacity"])}return e},resolveNamespace:function(t){if(!t)return fabric;var e,i=t.split("."),r=i.length,n=s||fabric.window;for(e=0;e<r;++e)n=n[i[e]];return n},loadImage:function(t,e,i,r){if(t){var n=fabric.util.createImage(),s=function(){e&&e.call(i,n,!1),n=n.onload=n.onerror=null};n.onload=s,n.onerror=function(){fabric.log("Error loading "+n.src),e&&e.call(i,null,!0),n=n.onload=n.onerror=null},0!==t.indexOf("data")&&null!=r&&(n.crossOrigin=r),"data:image/svg"===t.substring(0,14)&&(n.onload=null,fabric.util.loadImageInDom(n,s)),n.src=t}else e&&e.call(i,t)},loadImageInDom:function(t,e){var i=fabric.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(t),fabric.document.querySelector("body").appendChild(i),t.onload=function(){e(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(t,e,n,s){var o=[],i=0,r=(t=t||[]).length;function a(){++i===r&&e&&e(o.filter(function(t){return t}))}r?t.forEach(function(i,r){i&&i.type?fabric.util.getKlass(i.type,n).fromObject(i,function(t,e){e||(o[r]=t),s&&s(i,t,e),a()}):a()}):e&&e(o)},enlivenObjectEnlivables:function(e,n,t){var s=fabric.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});fabric.util.enlivenObjects(s.map(function(t){return e[t]}),function(i){var r={};s.forEach(function(t,e){r[t]=i[e],n&&(n[t]=i[e])}),t&&t(r)})},enlivenPatterns:function(t,e){function i(){++n===s&&e&&e(r)}var r=[],n=0,s=(t=t||[]).length;s?t.forEach(function(t,e){t&&t.source?new fabric.Pattern(t,function(t){r[e]=t,i()}):(r[e]=t,i())}):e&&e(r)},groupSVGElements:function(t,e,i){var r;return t&&1===t.length?t[0]:(e&&(e.width&&e.height?e.centerPoint={x:e.width/2,y:e.height/2}:(delete e.width,delete e.height)),r=new fabric.Group(t,e),void 0!==i&&(r.sourcePath=i),r)},populateWithProperties:function(t,e,i){if(i&&Array.isArray(i))for(var r=0,n=i.length;r<n;r++)i[r]in t&&(e[i[r]]=t[i[r]])},createCanvasElement:function(){return fabric.document.createElement("canvas")},copyCanvasElement:function(t){var e=fabric.util.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,i){return t.toDataURL("image/"+e,i)},createImage:function(){return fabric.document.createElement("img")},multiplyTransformMatrices:function(t,e,i){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],i?0:t[0]*e[4]+t[2]*e[5]+t[4],i?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var e=a(t[1],t[0]),i=c(t[0],2)+c(t[1],2),r=o(i),n=(t[0]*t[3]-t[2]*t[1])/r,s=a(t[0]*t[2]+t[1]*t[3],i);return{angle:e/h,scaleX:r,scaleY:n,skewX:s/h,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return fabric.iMatrix.concat();var e=fabric.util.degreesToRadians(t.angle),i=fabric.util.cos(e),r=fabric.util.sin(e);return[i,r,-r,i,0,0]},calcDimensionsMatrix:function(t){var e=void 0===t.scaleX?1:t.scaleX,i=void 0===t.scaleY?1:t.scaleY,r=[t.flipX?-e:e,0,0,t.flipY?-i:i,0,0],n=fabric.util.multiplyTransformMatrices,s=fabric.util.degreesToRadians;return t.skewX&&(r=n(r,[1,0,Math.tan(s(t.skewX)),1],!0)),t.skewY&&(r=n(r,[1,Math.tan(s(t.skewY)),0,1],!0)),r},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],i=fabric.util.multiplyTransformMatrices;return t.angle&&(e=i(e,fabric.util.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=i(e,fabric.util.calcDimensionsMatrix(t))),e},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,e,i,r){0<r&&(r<e?e-=r:e=0,r<i?i-=r:i=0);var n,s=!0,o=t.getImageData(e,i,2*r||1,2*r||1),a=o.data.length;for(n=3;n<a&&!1!==(s=o.data[n]<=0);n+=4);return o=null,s},parsePreserveAspectRatioAttribute:function(t){var e,i="meet",r=t.split(" ");return r&&r.length&&("meet"!==(i=r.pop())&&"slice"!==i?(e=i,i="meet"):r.length&&(e=r.pop())),{meetOrSlice:i,alignX:"none"!==e?e.slice(1,4):"none",alignY:"none"!==e?e.slice(5,8):"none"}},clearFabricFontCache:function(t){(t=(t||"").toLowerCase())?fabric.charWidthsCache[t]&&delete fabric.charWidthsCache[t]:fabric.charWidthsCache={}},limitDimsByArea:function(t,e){var i=Math.sqrt(e*t),r=Math.floor(e/i);return{x:Math.floor(i),y:r}},capValue:function(t,e,i){return Math.max(t,Math.min(e,i))},findScaleToFit:function(t,e){return Math.min(e.width/t.width,e.height/t.height)},findScaleToCover:function(t,e){return Math.max(e.width/t.width,e.height/t.height)},matrixToSVG:function(t){return"matrix("+t.map(function(t){return fabric.util.toFixed(t,fabric.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(t,e){var i=fabric.util.invertTransform(e),r=fabric.util.multiplyTransformMatrices(i,t.calcOwnMatrix());fabric.util.applyTransformToObject(t,r)},addTransformToObject:function(t,e){fabric.util.applyTransformToObject(t,fabric.util.multiplyTransformMatrices(e,t.calcOwnMatrix()))},applyTransformToObject:function(t,e){var i=fabric.util.qrDecompose(e),r=new fabric.Point(i.translateX,i.translateY);t.flipX=!1,t.flipY=!1,t.set("scaleX",i.scaleX),t.set("scaleY",i.scaleY),t.skewX=i.skewX,t.skewY=i.skewY,t.angle=i.angle,t.setPositionByOrigin(r,"center","center")},sizeAfterTransform:function(t,e,i){var r=t/2,n=e/2,s=[{x:-r,y:-n},{x:r,y:-n},{x:-r,y:n},{x:r,y:n}],o=fabric.util.calcDimensionsMatrix(i),a=fabric.util.makeBoundingBoxFromPoints(s,o);return{x:a.width,y:a.height}},mergeClipPaths:function(t,e){var i=t,r=e;i.inverted&&!r.inverted&&(i=e,r=t),fabric.util.applyTransformToObject(r,fabric.util.multiplyTransformMatrices(fabric.util.invertTransform(i.calcTransformMatrix()),r.calcTransformMatrix()));var n=i.inverted&&r.inverted;return n&&(i.inverted=r.inverted=!1),new fabric.Group([i],{clipPath:r,inverted:n})}}}("undefined"!=typeof exports?exports:this),function(){var D=Array.prototype.join,T={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},w={m:"l",M:"L"};function Z(t,e,i,r){var n=Math.atan2(e,t),s=Math.atan2(r,i);return n<=s?s-n:2*Math.PI-(n-s)}function d(t,e,i){for(var r=i[1],n=i[2],s=i[3],o=i[4],a=i[5],c=function(t,e,i,r,n,s,o){var a=Math.PI,c=o*a/180,h=fabric.util.sin(c),l=fabric.util.cos(c),u=0,f=0,d=-l*t*.5-h*e*.5,g=-l*e*.5+h*t*.5,p=(i=Math.abs(i))*i,v=(r=Math.abs(r))*r,m=g*g,b=d*d,y=p*v-p*m-v*b,_=0;if(y<0){var x=Math.sqrt(1-y/(p*v));i*=x,r*=x}else _=(n===s?-1:1)*Math.sqrt(y/(p*m+v*b));var C=_*i*g/r,S=-_*r*d/i,T=l*C-h*S+.5*t,w=h*C+l*S+.5*e,O=Z(1,0,(d-C)/i,(g-S)/r),k=Z((d-C)/i,(g-S)/r,(-d-C)/i,(-g-S)/r);0===s&&0<k?k-=2*a:1===s&&k<0&&(k+=2*a);for(var P,E,D,j,A,M,F,I,L,R,B,X,W,Y,H,z,G,U=Math.ceil(Math.abs(k/a*2)),V=[],N=k/U,q=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),K=O+N,J=0;J<U;J++)V[J]=(P=O,E=K,D=l,j=h,A=i,M=r,F=T,I=w,L=q,R=u,B=f,X=fabric.util.cos(P),W=fabric.util.sin(P),Y=fabric.util.cos(E),H=fabric.util.sin(E),["C",R+L*(-D*A*W-j*M*X),B+L*(-j*A*W+D*M*X),(z=D*A*Y-j*M*H+F)+L*(D*A*H+j*M*Y),(G=j*A*Y+D*M*H+I)+L*(j*A*H-D*M*Y),z,G]),u=V[J][5],f=V[J][6],O=K,K+=N;return V}(i[6]-t,i[7]-e,r,n,o,a,s),h=0,l=c.length;h<l;h++)c[h][1]+=t,c[h][2]+=e,c[h][3]+=t,c[h][4]+=e,c[h][5]+=t,c[h][6]+=e;return c}function g(t,e,i,r){return Math.sqrt((i-t)*(i-t)+(r-e)*(r-e))}function p(h,l,u,f,d,g,p,v){return function(t){var e,i,r,n,s=(n=t)*n*n,o=3*(r=t)*r*(1-r),a=3*(i=t)*(1-i)*(1-i),c=(1-(e=t))*(1-e)*(1-e);return{x:p*s+d*o+u*a+h*c,y:v*s+g*o+f*a+l*c}}}function v(n,s,o,a,c,h,l,u){return function(t){var e=1-t,i=3*e*e*(o-n)+6*e*t*(c-o)+3*t*t*(l-c),r=3*e*e*(a-s)+6*e*t*(h-a)+3*t*t*(u-h);return Math.atan2(r,i)}}function m(a,c,h,l,u,f){return function(t){var e,i,r,n=(r=t)*r,s=2*(i=t)*(1-i),o=(1-(e=t))*(1-e);return{x:u*n+h*s+a*o,y:f*n+l*s+c*o}}}function b(n,s,o,a,c,h){return function(t){var e=1-t,i=2*e*(o-n)+2*t*(c-o),r=2*e*(a-s)+2*t*(h-a);return Math.atan2(r,i)}}function y(t,e,i){var r,n,s={x:e,y:i},o=0;for(n=1;n<=100;n+=1)r=t(n/100),o+=g(s.x,s.y,r.x,r.y),s=r;return o}function h(t,e){for(var i,r,n,s=0,o=0,a=t.iterator,c={x:t.x,y:t.y},h=.01,l=t.angleFinder;o<e&&1e-4<h;)i=a(s),n=s,e<(r=g(c.x,c.y,i.x,i.y))+o?(s-=h,h/=2):(c=i,s+=h,o+=r);return i.angle=l(n),i}function l(t){for(var e,i,r,n,s=0,o=t.length,a=0,c=0,h=0,l=0,u=[],f=0;f<o;f++){switch(r={x:a,y:c,command:(e=t[f])[0]},e[0]){case"M":r.length=0,h=a=e[1],l=c=e[2];break;case"L":r.length=g(a,c,e[1],e[2]),a=e[1],c=e[2];break;case"C":i=p(a,c,e[1],e[2],e[3],e[4],e[5],e[6]),n=v(a,c,e[1],e[2],e[3],e[4],e[5],e[6]),r.iterator=i,r.angleFinder=n,r.length=y(i,a,c),a=e[5],c=e[6];break;case"Q":i=m(a,c,e[1],e[2],e[3],e[4]),n=b(a,c,e[1],e[2],e[3],e[4]),r.iterator=i,r.angleFinder=n,r.length=y(i,a,c),a=e[3],c=e[4];break;case"Z":case"z":r.destX=h,r.destY=l,r.length=g(a,c,h,l),a=h,c=l}s+=r.length,u.push(r)}return u.push({length:s,x:a,y:c}),u}fabric.util.joinPath=function(t){return t.map(function(t){return t.join(" ")}).join(" ")},fabric.util.parsePath=function(t){var e,i,r,n,s,o=[],a=[],c=fabric.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",l="("+h+")"+fabric.commaWsp,u="([01])"+fabric.commaWsp+"?",f=new RegExp(l+"?"+l+"?"+l+u+u+l+"?("+h+")","g");if(!t||!t.match)return o;for(var d,g=0,p=(s=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;g<p;g++){n=(e=s[g]).slice(1).trim(),a.length=0;var v=e.charAt(0);if(d=[v],"a"===v.toLowerCase())for(var m;m=f.exec(n);)for(var b=1;b<m.length;b++)a.push(m[b]);else for(;r=c.exec(n);)a.push(r[0]);b=0;for(var y=a.length;b<y;b++)i=parseFloat(a[b]),isNaN(i)||d.push(i);var _=T[v.toLowerCase()],x=w[v]||v;if(d.length-1>_)for(var C=1,S=d.length;C<S;C+=_)o.push([v].concat(d.slice(C,C+_))),v=x;else o.push(d)}return o},fabric.util.makePathSimpler=function(t){var e,i,r,n,s,o,a=0,c=0,h=t.length,l=0,u=0,f=[];for(i=0;i<h;++i){switch(r=!1,(e=t[i].slice(0))[0]){case"l":e[0]="L",e[1]+=a,e[2]+=c;case"L":a=e[1],c=e[2];break;case"h":e[1]+=a;case"H":e[0]="L",e[2]=c,a=e[1];break;case"v":e[1]+=c;case"V":e[0]="L",c=e[1],e[1]=a,e[2]=c;break;case"m":e[0]="M",e[1]+=a,e[2]+=c;case"M":a=e[1],c=e[2],l=e[1],u=e[2];break;case"c":e[0]="C",e[1]+=a,e[2]+=c,e[3]+=a,e[4]+=c,e[5]+=a,e[6]+=c;case"C":s=e[3],o=e[4],a=e[5],c=e[6];break;case"s":e[0]="S",e[1]+=a,e[2]+=c,e[3]+=a,e[4]+=c;case"S":"C"===n?(s=2*a-s,o=2*c-o):(s=a,o=c),a=e[3],c=e[4],e[0]="C",e[5]=e[3],e[6]=e[4],e[3]=e[1],e[4]=e[2],e[1]=s,e[2]=o,s=e[3],o=e[4];break;case"q":e[0]="Q",e[1]+=a,e[2]+=c,e[3]+=a,e[4]+=c;case"Q":s=e[1],o=e[2],a=e[3],c=e[4];break;case"t":e[0]="T",e[1]+=a,e[2]+=c;case"T":"Q"===n?(s=2*a-s,o=2*c-o):(s=a,o=c),e[0]="Q",a=e[1],c=e[2],e[1]=s,e[2]=o,e[3]=a,e[4]=c;break;case"a":e[0]="A",e[6]+=a,e[7]+=c;case"A":r=!0,f=f.concat(d(a,c,e)),a=e[6],c=e[7];break;case"z":case"Z":a=l,c=u}r||f.push(e),n=e[0]}return f},fabric.util.getSmoothPathFromPoints=function(t,e){var i,r=[],n=new fabric.Point(t[0].x,t[0].y),s=new fabric.Point(t[1].x,t[1].y),o=t.length,a=1,c=0,h=2<o;for(e=e||0,h&&(a=t[2].x<s.x?-1:t[2].x===s.x?0:1,c=t[2].y<s.y?-1:t[2].y===s.y?0:1),r.push(["M",n.x-a*e,n.y-c*e]),i=1;i<o;i++){if(!n.eq(s)){var l=n.midPointFrom(s);r.push(["Q",n.x,n.y,l.x,l.y])}n=t[i],i+1<t.length&&(s=t[i+1])}return h&&(a=n.x>t[i-2].x?1:n.x===t[i-2].x?0:-1,c=n.y>t[i-2].y?1:n.y===t[i-2].y?0:-1),r.push(["L",n.x+a*e,n.y+c*e]),r},fabric.util.getPathSegmentsInfo=l,fabric.util.getBoundsOfCurve=function(t,e,i,r,n,s,o,a){var c;if(fabric.cachesBoundsOfCurve&&(c=D.call(arguments),fabric.boundsOfCurveCache[c]))return fabric.boundsOfCurveCache[c];var h,l,u,f,d,g,p,v,m=Math.sqrt,b=Math.min,y=Math.max,_=Math.abs,x=[],C=[[],[]];l=6*t-12*i+6*n,h=-3*t+9*i-9*n+3*o,u=3*i-3*t;for(var S=0;S<2;++S)if(0<S&&(l=6*e-12*r+6*s,h=-3*e+9*r-9*s+3*a,u=3*r-3*e),_(h)<1e-12){if(_(l)<1e-12)continue;0<(f=-u/l)&&f<1&&x.push(f)}else(p=l*l-4*u*h)<0||(0<(d=(-l+(v=m(p)))/(2*h))&&d<1&&x.push(d),0<(g=(-l-v)/(2*h))&&g<1&&x.push(g));for(var T,w,O,k=x.length,P=k;k--;)T=(O=1-(f=x[k]))*O*O*t+3*O*O*f*i+3*O*f*f*n+f*f*f*o,C[0][k]=T,w=O*O*O*e+3*O*O*f*r+3*O*f*f*s+f*f*f*a,C[1][k]=w;C[0][P]=t,C[1][P]=e,C[0][P+1]=o,C[1][P+1]=a;var E=[{x:b.apply(null,C[0]),y:b.apply(null,C[1])},{x:y.apply(null,C[0]),y:y.apply(null,C[1])}];return fabric.cachesBoundsOfCurve&&(fabric.boundsOfCurveCache[c]=E),E},fabric.util.getPointOnPath=function(t,e,i){i||(i=l(t));for(var r=0;0<e-i[r].length&&r<i.length-2;)e-=i[r].length,r++;var n,s=i[r],o=e/s.length,a=s.command,c=t[r];switch(a){case"M":return{x:s.x,y:s.y,angle:0};case"Z":case"z":return(n=new fabric.Point(s.x,s.y).lerp(new fabric.Point(s.destX,s.destY),o)).angle=Math.atan2(s.destY-s.y,s.destX-s.x),n;case"L":return(n=new fabric.Point(s.x,s.y).lerp(new fabric.Point(c[1],c[2]),o)).angle=Math.atan2(c[2]-s.y,c[1]-s.x),n;case"C":case"Q":return h(s,e)}},fabric.util.transformPath=function(t,n,e){return e&&(n=fabric.util.multiplyTransformMatrices(n,[1,0,0,1,-e.x,-e.y])),t.map(function(t){for(var e=t.slice(0),i={},r=1;r<t.length-1;r+=2)i.x=t[r],i.y=t[r+1],i=fabric.util.transformPoint(i,n),e[r]=i.x,e[r+1]=i.y;return e})}}(),function(){var o=Array.prototype.slice;function i(t,e,i){if(t&&0!==t.length){var r=t.length-1,n=e?t[r][e]:t[r];if(e)for(;r--;)i(t[r][e],n)&&(n=t[r][e]);else for(;r--;)i(t[r],n)&&(n=t[r]);return n}}fabric.util.array={fill:function(t,e){for(var i=t.length;i--;)t[i]=e;return t},invoke:function(t,e){for(var i=o.call(arguments,2),r=[],n=0,s=t.length;n<s;n++)r[n]=i.length?t[n][e].apply(t[n],i):t[n][e].call(t[n]);return r},min:function(t,e){return i(t,e,function(t,e){return t<e})},max:function(t,e){return i(t,e,function(t,e){return e<=t})}}}(),function(){function o(t,e,i){if(i)if(!fabric.isLikelyNode&&e instanceof Element)t=e;else if(e instanceof Array){t=[];for(var r=0,n=e.length;r<n;r++)t[r]=o({},e[r],i)}else if(e&&"object"==typeof e)for(var s in e)"canvas"===s||"group"===s?t[s]=null:e.hasOwnProperty(s)&&(t[s]=o({},e[s],i));else t=e;else for(var s in e)t[s]=e[s];return t}fabric.util.object={extend:o,clone:function(t,e){return o({},t,e)}},fabric.util.object.extend(fabric.util,fabric.Observable)}(),function(){function n(t,e){var i=t.charCodeAt(e);if(isNaN(i))return"";if(i<55296||57343<i)return t.charAt(e);if(55296<=i&&i<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var r=t.charCodeAt(e+1);if(r<56320||57343<r)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";var n=t.charCodeAt(e-1);if(n<55296||56319<n)throw"Low surrogate without preceding high surrogate";return!1}fabric.util.string={camelize:function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},capitalize:function(t,e){return t.charAt(0).toUpperCase()+(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:function(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(t){var e,i=0,r=[];for(i=0;i<t.length;i++)!1!==(e=n(t,i))&&r.push(e);return r}}}(),function(){var s=Array.prototype.slice,o=function(){},i=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),a=function(t,r,n){for(var e in r)e in t.prototype&&"function"==typeof t.prototype[e]&&-1<(r[e]+"").indexOf("callSuper")?t.prototype[e]=function(i){return function(){var t=this.constructor.superclass;this.constructor.superclass=n;var e=r[i].apply(this,arguments);if(this.constructor.superclass=t,"initialize"!==i)return e}}(e):t.prototype[e]=r[e],i&&(r.toString!==Object.prototype.toString&&(t.prototype.toString=r.toString),r.valueOf!==Object.prototype.valueOf&&(t.prototype.valueOf=r.valueOf))};function c(){}function h(t){for(var e=null,i=this;i.constructor.superclass;){var r=i.constructor.superclass.prototype[t];if(i[t]!==r){e=r;break}i=i.constructor.superclass.prototype}return e?1<arguments.length?e.apply(this,s.call(arguments,1)):e.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}fabric.util.createClass=function(){var t=null,e=s.call(arguments,0);function i(){this.initialize.apply(this,arguments)}"function"==typeof e[0]&&(t=e.shift()),i.superclass=t,i.subclasses=[],t&&(c.prototype=t.prototype,i.prototype=new c,t.subclasses.push(i));for(var r=0,n=e.length;r<n;r++)a(i,e[r],t);return i.prototype.initialize||(i.prototype.initialize=o),(i.prototype.constructor=i).prototype.callSuper=h,i}}(),function(){var n=!!fabric.document.createElement("div").attachEvent,e=["touchstart","touchmove","touchend"];fabric.util.addListener=function(t,e,i,r){t&&t.addEventListener(e,i,!n&&r)},fabric.util.removeListener=function(t,e,i,r){t&&t.removeEventListener(e,i,!n&&r)},fabric.util.getPointer=function(t){var e,i,r=t.target,n=fabric.util.getScrollLeftTop(r),s=(i=(e=t).changedTouches)&&i[0]?i[0]:e;return{x:s.clientX+n.left,y:s.clientY+n.top}},fabric.util.isTouchEvent=function(t){return-1<e.indexOf(t.type)||"touch"===t.pointerType}}(),function(){var t=fabric.document.createElement("div"),e="string"==typeof t.style.opacity,i="string"==typeof t.style.filter,r=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,n=function(t){return t};e?n=function(t,e){return t.style.opacity=e,t}:i&&(n=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),r.test(i.filter)?(e=.9999<=e?"":"alpha(opacity="+100*e+")",i.filter=i.filter.replace(r,e)):i.filter+=" alpha(opacity="+100*e+")",t}),fabric.util.setStyle=function(t,e){var i=t.style;if(!i)return t;if("string"==typeof e)return t.style.cssText+=";"+e,-1<e.indexOf("opacity")?n(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var r in e)"opacity"===r?n(t,e[r]):i["float"===r||"cssFloat"===r?void 0===i.styleFloat?"cssFloat":"styleFloat":r]=e[r];return t}}(),function(){var e=Array.prototype.slice;var t,c,i,r,n=function(t){return e.call(t,0)};try{t=n(fabric.document.childNodes)instanceof Array}catch(t){}function s(t,e){var i=fabric.document.createElement(t);for(var r in e)"class"===r?i.className=e[r]:"for"===r?i.htmlFor=e[r]:i.setAttribute(r,e[r]);return i}function h(t){for(var e=0,i=0,r=fabric.document.documentElement,n=fabric.document.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===fabric.document?(e=n.scrollLeft||r.scrollLeft||0,i=n.scrollTop||r.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:i}}t||(n=function(t){for(var e=new Array(t.length),i=t.length;i--;)e[i]=t[i];return e}),c=fabric.document.defaultView&&fabric.document.defaultView.getComputedStyle?function(t,e){var i=fabric.document.defaultView.getComputedStyle(t,null);return i?i[e]:void 0}:function(t,e){var i=t.style[e];return!i&&t.currentStyle&&(i=t.currentStyle[e]),i},i=fabric.document.documentElement.style,r="userSelect"in i?"userSelect":"MozUserSelect"in i?"MozUserSelect":"WebkitUserSelect"in i?"WebkitUserSelect":"KhtmlUserSelect"in i?"KhtmlUserSelect":"",fabric.util.makeElementUnselectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=fabric.util.falseFunction),r?t.style[r]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},fabric.util.makeElementSelectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=null),r?t.style[r]="":"string"==typeof t.unselectable&&(t.unselectable=""),t},fabric.util.setImageSmoothing=function(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e},fabric.util.getById=function(t){return"string"==typeof t?fabric.document.getElementById(t):t},fabric.util.toArray=n,fabric.util.addClass=function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},fabric.util.makeElement=s,fabric.util.wrapElement=function(t,e,i){return"string"==typeof e&&(e=s(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},fabric.util.getScrollLeftTop=h,fabric.util.getElementOffset=function(t){var e,i,r=t&&t.ownerDocument,n={left:0,top:0},s={left:0,top:0},o={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return s;for(var a in o)s[o[a]]+=parseInt(c(t,a),10)||0;return e=r.documentElement,void 0!==t.getBoundingClientRect&&(n=t.getBoundingClientRect()),i=h(t),{left:n.left+i.left-(e.clientLeft||0)+s.left,top:n.top+i.top-(e.clientTop||0)+s.top}},fabric.util.getNodeCanvas=function(t){var e=fabric.jsdomImplForWrapper(t);return e._canvas||e._image},fabric.util.cleanUpJsdomNode=function(t){if(fabric.isLikelyNode){var e=fabric.jsdomImplForWrapper(t);e&&(e._image=null,e._canvas=null,e._currentSrc=null,e._attributes=null,e._classList=null)}}}(),function(){function c(){}fabric.util.request=function(t,e){e||(e={});var i,r,n=e.method?e.method.toUpperCase():"GET",s=e.onComplete||function(){},o=new fabric.window.XMLHttpRequest,a=e.body||e.parameters;return o.onreadystatechange=function(){4===o.readyState&&(s(o),o.onreadystatechange=c)},"GET"===n&&(a=null,"string"==typeof e.parameters&&(i=t,r=e.parameters,t=i+(/\?/.test(i)?"&":"?")+r)),o.open(n,t,!0),"POST"!==n&&"PUT"!==n||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(a),o}}(),fabric.log=console.log,fabric.warn=console.warn,function(){var t=fabric.util.object.extend,i=fabric.util.object.clone,e=[];function r(){return!1}function n(t,e,i,r){return-i*Math.cos(t/r*(Math.PI/2))+i+e}fabric.util.object.extend(e,{cancelAll:function(){var t=this.splice(0);return t.forEach(function(t){t.cancel()}),t},cancelByCanvas:function(e){if(!e)return[];var t=this.filter(function(t){return"object"==typeof t.target&&t.target.canvas===e});return t.forEach(function(t){t.cancel()}),t},cancelByTarget:function(t){var e=this.findAnimationsByTarget(t);return e.forEach(function(t){t.cancel()}),e},findAnimationIndex:function(t){return this.indexOf(this.findAnimation(t))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}});var s=fabric.window.requestAnimationFrame||fabric.window.webkitRequestAnimationFrame||fabric.window.mozRequestAnimationFrame||fabric.window.oRequestAnimationFrame||fabric.window.msRequestAnimationFrame||function(t){return fabric.window.setTimeout(t,1e3/60)},o=fabric.window.cancelAnimationFrame||fabric.window.clearTimeout;function x(){return s.apply(fabric.window,arguments)}fabric.util.animate=function(e){e||(e={});var b,y=!1,_=function(){var t=fabric.runningAnimations.indexOf(b);return-1<t&&fabric.runningAnimations.splice(t,1)[0]};return b=t(i(e),{cancel:function(){return y=!0,_()},currentValue:"startValue"in e?e.startValue:0,completionRate:0,durationRate:0}),fabric.runningAnimations.push(b),x(function(t){var o,a=t||+new Date,c=e.duration||500,h=a+c,l=e.onChange||r,u=e.abort||r,f=e.onComplete||r,d=e.easing||n,g="startValue"in e&&0<e.startValue.length,p="startValue"in e?e.startValue:0,v="endValue"in e?e.endValue:100,m=e.byValue||(g?p.map(function(t,e){return v[e]-p[e]}):v-p);e.onStart&&e.onStart(),function t(e){o=e||+new Date;var i=h<o?c:o-a,r=i/c,n=g?p.map(function(t,e){return d(i,p[e],m[e],c)}):d(i,p,m,c),s=g?Math.abs((n[0]-p[0])/m[0]):Math.abs((n-p)/m);if(b.currentValue=g?n.slice():n,b.completionRate=s,b.durationRate=r,!y){if(!u(n,s,r))return h<o?(b.currentValue=g?v.slice():v,b.completionRate=1,b.durationRate=1,l(g?v.slice():v,1,1),f(v,1,1),void _()):(l(n,s,r),void x(t));_()}}(a)}),b.cancel},fabric.util.requestAnimFrame=x,fabric.util.cancelAnimFrame=function(){return o.apply(fabric.window,arguments)},fabric.runningAnimations=e}(),function(){function c(t,e,i){var r="rgba("+parseInt(t[0]+i*(e[0]-t[0]),10)+","+parseInt(t[1]+i*(e[1]-t[1]),10)+","+parseInt(t[2]+i*(e[2]-t[2]),10);return r+=","+(t&&e?parseFloat(t[3]+i*(e[3]-t[3])):1),r+=")"}fabric.util.animateColor=function(t,e,i,n){var r=new fabric.Color(t).getSource(),s=new fabric.Color(e).getSource(),o=n.onComplete,a=n.onChange;return n=n||{},fabric.util.animate(fabric.util.object.extend(n,{duration:i||500,startValue:r,endValue:s,byValue:s,easing:function(t,e,i,r){return c(e,i,n.colorEasing?n.colorEasing(t,r):1-Math.cos(t/r*(Math.PI/2)))},onComplete:function(t,e,i){if(o)return o(c(s,s,0),e,i)},onChange:function(t,e,i){if(a){if(Array.isArray(t))return a(c(t,t,0),e,i);a(t,e,i)}}}))}}(),function(){function o(t,e,i,r){return t<Math.abs(e)?(t=e,r=i/4):r=0===e&&0===t?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(e/t),{a:t,c:e,p:i,s:r}}function a(t,e,i){return t.a*Math.pow(2,10*(e-=1))*Math.sin((e*i-t.s)*(2*Math.PI)/t.p)}function n(t,e,i,r){return i-s(r-t,0,i,r)+e}function s(t,e,i,r){return(t/=r)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e}fabric.util.ease={easeInQuad:function(t,e,i,r){return i*(t/=r)*t+e},easeOutQuad:function(t,e,i,r){return-i*(t/=r)*(t-2)+e},easeInOutQuad:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,r){return i*(t/=r)*t*t+e},easeOutCubic:function(t,e,i,r){return i*((t=t/r-1)*t*t+1)+e},easeInOutCubic:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,i,r){return i*(t/=r)*t*t*t+e},easeOutQuart:function(t,e,i,r){return-i*((t=t/r-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,i,r){return i*(t/=r)*t*t*t*t+e},easeOutQuint:function(t,e,i,r){return i*((t=t/r-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,i,r){return-i*Math.cos(t/r*(Math.PI/2))+i+e},easeOutSine:function(t,e,i,r){return i*Math.sin(t/r*(Math.PI/2))+e},easeInOutSine:function(t,e,i,r){return-i/2*(Math.cos(Math.PI*t/r)-1)+e},easeInExpo:function(t,e,i,r){return 0===t?e:i*Math.pow(2,10*(t/r-1))+e},easeOutExpo:function(t,e,i,r){return t===r?e+i:i*(1-Math.pow(2,-10*t/r))+e},easeInOutExpo:function(t,e,i,r){return 0===t?e:t===r?e+i:(t/=r/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,i,r){return-i*(Math.sqrt(1-(t/=r)*t)-1)+e},easeOutCirc:function(t,e,i,r){return i*Math.sqrt(1-(t=t/r-1)*t)+e},easeInOutCirc:function(t,e,i,r){return(t/=r/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,i,r){var n=0;return 0===t?e:1==(t/=r)?e+i:(n||(n=.3*r),-a(o(i,i,n,1.70158),t,r)+e)},easeOutElastic:function(t,e,i,r){var n=0;if(0===t)return e;if(1==(t/=r))return e+i;n||(n=.3*r);var s=o(i,i,n,1.70158);return s.a*Math.pow(2,-10*t)*Math.sin((t*r-s.s)*(2*Math.PI)/s.p)+s.c+e},easeInOutElastic:function(t,e,i,r){var n=0;if(0===t)return e;if(2==(t/=r/2))return e+i;n||(n=r*(.3*1.5));var s=o(i,i,n,1.70158);return t<1?-.5*a(s,t,r)+e:s.a*Math.pow(2,-10*(t-=1))*Math.sin((t*r-s.s)*(2*Math.PI)/s.p)*.5+s.c+e},easeInBack:function(t,e,i,r,n){return void 0===n&&(n=1.70158),i*(t/=r)*t*((n+1)*t-n)+e},easeOutBack:function(t,e,i,r,n){return void 0===n&&(n=1.70158),i*((t=t/r-1)*t*((n+1)*t+n)+1)+e},easeInOutBack:function(t,e,i,r,n){return void 0===n&&(n=1.70158),(t/=r/2)<1?i/2*(t*t*((1+(n*=1.525))*t-n))+e:i/2*((t-=2)*t*((1+(n*=1.525))*t+n)+2)+e},easeInBounce:n,easeOutBounce:s,easeInOutBounce:function(t,e,i,r){return t<r/2?.5*n(2*t,0,i,r)+e:.5*s(2*t-r,0,i,r)+.5*i+e}}}(),function(t){"use strict";var C=t.fabric||(t.fabric={}),p=C.util.object.extend,f=C.util.object.clone,v=C.util.toFixed,S=C.util.parseUnit,c=C.util.multiplyTransformMatrices,m={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},b={stroke:"strokeOpacity",fill:"fillOpacity"},y="font-size",_="clip-path";function x(t,e,i,r){var n,s=Array.isArray(e);if("fill"!==t&&"stroke"!==t||"none"!==e){if("strokeUniform"===t)return"non-scaling-stroke"===e;if("strokeDashArray"===t)e="none"===e?null:e.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)e=i&&i.transformMatrix?c(i.transformMatrix,C.parseTransformAttribute(e)):C.parseTransformAttribute(e);else if("visible"===t)e="none"!==e&&"hidden"!==e,i&&!1===i.visible&&(e=!1);else if("opacity"===t)e=parseFloat(e),i&&void 0!==i.opacity&&(e*=i.opacity);else if("textAnchor"===t)e="start"===e?"left":"end"===e?"right":"center";else if("charSpacing"===t)n=S(e,r)/r*1e3;else if("paintFirst"===t){var o=e.indexOf("fill"),a=e.indexOf("stroke");e="fill";-1<o&&-1<a&&a<o?e="stroke":-1===o&&-1<a&&(e="stroke")}else{if("href"===t||"xlink:href"===t||"font"===t)return e;if("imageSmoothing"===t)return"optimizeQuality"===e;n=s?e.map(S):S(e,r)}}else e="";return!s&&isNaN(n)?e:n}function e(t){return new RegExp("^("+t.join("|")+")\\b","i")}function T(t,e){var i,r,n,s,o=[];for(n=0,s=e.length;n<s;n++)i=e[n],r=t.getElementsByTagName(i),o=o.concat(Array.prototype.slice.call(r));return o}function w(t,e){var i,r=!0;return(i=n(t,e.pop()))&&e.length&&(r=function(t,e){var i,r=!0;for(;t.parentNode&&1===t.parentNode.nodeType&&e.length;)r&&(i=e.pop()),t=t.parentNode,r=n(t,i);return 0===e.length}(t,e)),i&&r&&0===e.length}function n(t,e){var i,r,n=t.nodeName,s=t.getAttribute("class"),o=t.getAttribute("id");if(i=new RegExp("^"+n,"i"),e=e.replace(i,""),o&&e.length&&(i=new RegExp("#"+o+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"")),s&&e.length)for(r=(s=s.split(" ")).length;r--;)i=new RegExp("\\."+s[r]+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"");return 0===e.length}function O(t,e){var i;if(t.getElementById&&(i=t.getElementById(e)),i)return i;var r,n,s,o=t.getElementsByTagName("*");for(n=0,s=o.length;n<s;n++)if(e===(r=o[n]).getAttribute("id"))return r}C.svgValidTagNamesRegEx=e(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),C.svgViewBoxElementsRegEx=e(["symbol","image","marker","pattern","view","svg"]),C.svgInvalidAncestorsRegEx=e(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),C.svgValidParentsRegEx=e(["symbol","g","a","svg","clipPath","defs"]),C.cssRules={},C.gradientDefs={},C.clipPaths={},C.parseTransformAttribute=function(){function b(t,e,i){t[i]=Math.tan(C.util.degreesToRadians(e[0]))}var y=C.iMatrix,t=C.reNum,e=C.commaWsp,_="(?:"+("(?:(matrix)\\s*\\(\\s*("+t+")"+e+"("+t+")"+e+"("+t+")"+e+"("+t+")"+e+"("+t+")"+e+"("+t+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+t+")(?:"+e+"("+t+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+t+")(?:"+e+"("+t+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+t+")(?:"+e+"("+t+")"+e+"("+t+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+t+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+t+")\\s*\\))")+")",i=new RegExp("^\\s*(?:"+("(?:"+_+"(?:"+e+"*"+_+")*)")+"?)\\s*$"),r=new RegExp(_,"g");return function(t){var v=y.concat(),m=[];if(!t||t&&!i.test(t))return v;t.replace(r,function(t){var e,i,r,n,s,o,a,c,h,l,u,f,d=new RegExp(_).exec(t).filter(function(t){return!!t}),g=d[1],p=d.slice(2).map(parseFloat);switch(g){case"translate":f=p,(u=v)[4]=f[0],2===f.length&&(u[5]=f[1]);break;case"rotate":p[0]=C.util.degreesToRadians(p[0]),s=v,o=p,a=C.util.cos(o[0]),c=C.util.sin(o[0]),l=h=0,3===o.length&&(h=o[1],l=o[2]),s[0]=a,s[1]=c,s[2]=-c,s[3]=a,s[4]=h-(a*h-c*l),s[5]=l-(c*h+a*l);break;case"scale":e=v,r=(i=p)[0],n=2===i.length?i[1]:i[0],e[0]=r,e[3]=n;break;case"skewX":b(v,p,2);break;case"skewY":b(v,p,1);break;case"matrix":v=p}m.push(v.concat()),v=y.concat()});for(var e=m[0];1<m.length;)m.shift(),e=C.util.multiplyTransformMatrices(e,m[0]);return e}}();var k=new RegExp("^\\s*("+C.reNum+"+)\\s*,?\\s*("+C.reNum+"+)\\s*,?\\s*("+C.reNum+"+)\\s*,?\\s*("+C.reNum+"+)\\s*$");function P(t){if(!C.svgViewBoxElementsRegEx.test(t.nodeName))return{};var e,i,r,n,s,o,a=t.getAttribute("viewBox"),c=1,h=1,l=t.getAttribute("width"),u=t.getAttribute("height"),f=t.getAttribute("x")||0,d=t.getAttribute("y")||0,g=t.getAttribute("preserveAspectRatio")||"",p=!a||!(a=a.match(k)),v=!l||!u||"100%"===l||"100%"===u,m=p&&v,b={},y="",_=0,x=0;if(b.width=0,b.height=0,b.toBeParsed=m,p&&(f||d)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(y=" translate("+S(f)+" "+S(d)+") ",s=(t.getAttribute("transform")||"")+y,t.setAttribute("transform",s),t.removeAttribute("x"),t.removeAttribute("y")),m)return b;if(p)return b.width=S(l),b.height=S(u),b;if(e=-parseFloat(a[1]),i=-parseFloat(a[2]),r=parseFloat(a[3]),n=parseFloat(a[4]),b.minX=e,b.minY=i,b.viewBoxWidth=r,b.viewBoxHeight=n,v?(b.width=r,b.height=n):(b.width=S(l),b.height=S(u),c=b.width/r,h=b.height/n),"none"!==(g=C.util.parsePreserveAspectRatioAttribute(g)).alignX&&("meet"===g.meetOrSlice&&(h=c=h<c?h:c),"slice"===g.meetOrSlice&&(h=c=h<c?c:h),_=b.width-r*c,x=b.height-n*c,"Mid"===g.alignX&&(_/=2),"Mid"===g.alignY&&(x/=2),"Min"===g.alignX&&(_=0),"Min"===g.alignY&&(x=0)),1===c&&1===h&&0===e&&0===i&&0===f&&0===d)return b;if((f||d)&&"#document"!==t.parentNode.nodeName&&(y=" translate("+S(f)+" "+S(d)+") "),s=y+" matrix("+c+" 0 0 "+h+" "+(e*c+_)+" "+(i*h+x)+") ","svg"===t.nodeName){for(o=t.ownerDocument.createElementNS(C.svgNS,"g");t.firstChild;)o.appendChild(t.firstChild);t.appendChild(o)}else(o=t).removeAttribute("x"),o.removeAttribute("y"),s=o.getAttribute("transform")+s;return o.setAttribute("transform",s),b}function s(t,e){var i="xlink:href",r=O(t,e.getAttribute(i).slice(1));if(r&&r.getAttribute(i)&&s(t,r),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach(function(t){r&&!e.hasAttribute(t)&&r.hasAttribute(t)&&e.setAttribute(t,r.getAttribute(t))}),!e.children.length)for(var n=r.cloneNode(!0);n.firstChild;)e.appendChild(n.firstChild);e.removeAttribute(i)}C.parseSVGDocument=function(t,i,e,r){if(t){!function(t){for(var e=T(t,["use","svg:use"]),i=0;e.length&&i<e.length;){var r=e[i],n=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===n)return;var s,o,a,c,h=n.slice(1),l=r.getAttribute("x")||0,u=r.getAttribute("y")||0,f=O(t,h).cloneNode(!0),d=(f.getAttribute("transform")||"")+" translate("+l+", "+u+")",g=e.length,p=C.svgNS;if(P(f),/^svg$/i.test(f.nodeName)){var v=f.ownerDocument.createElementNS(p,"g");for(o=0,c=(a=f.attributes).length;o<c;o++)s=a.item(o),v.setAttributeNS(p,s.nodeName,s.nodeValue);for(;f.firstChild;)v.appendChild(f.firstChild);f=v}for(o=0,c=(a=r.attributes).length;o<c;o++)"x"!==(s=a.item(o)).nodeName&&"y"!==s.nodeName&&"xlink:href"!==s.nodeName&&"href"!==s.nodeName&&("transform"===s.nodeName?d=s.nodeValue+" "+d:f.setAttribute(s.nodeName,s.nodeValue));f.setAttribute("transform",d),f.setAttribute("instantiated_by_use","1"),f.removeAttribute("id"),r.parentNode.replaceChild(f,r),e.length===g&&i++}}(t);var n,s,o=C.Object.__uid++,a=P(t),c=C.util.toArray(t.getElementsByTagName("*"));if(a.crossOrigin=r&&r.crossOrigin,a.svgUid=o,0===c.length&&C.isLikelyNode){var h=[];for(n=0,s=(c=t.selectNodes('//*[name(.)!="svg"]')).length;n<s;n++)h[n]=c[n];c=h}var l=c.filter(function(t){return P(t),C.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))&&!function(t,e){for(;t&&(t=t.parentNode);)if(t.nodeName&&e.test(t.nodeName.replace("svg:",""))&&!t.getAttribute("instantiated_by_use"))return!0;return!1}(t,C.svgInvalidAncestorsRegEx)});if(!l||l&&!l.length)i&&i([],{});else{var u={};c.filter(function(t){return"clipPath"===t.nodeName.replace("svg:","")}).forEach(function(t){var e=t.getAttribute("id");u[e]=C.util.toArray(t.getElementsByTagName("*")).filter(function(t){return C.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))})}),C.gradientDefs[o]=C.getGradientDefs(t),C.cssRules[o]=C.getCSSRules(t),C.clipPaths[o]=u,C.parseElements(l,function(t,e){i&&(i(t,a,e,c),delete C.gradientDefs[o],delete C.cssRules[o],delete C.clipPaths[o])},f(a),e,r)}}};var h=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+C.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+C.reNum+"))?\\s+(.*)");p(C,{parseFontDeclaration:function(t,e){var i=t.match(h);if(i){var r=i[1],n=i[3],s=i[4],o=i[5],a=i[6];r&&(e.fontStyle=r),n&&(e.fontWeight=isNaN(parseFloat(n))?n:parseFloat(n)),s&&(e.fontSize=S(s)),a&&(e.fontFamily=a),o&&(e.lineHeight="normal"===o?1:o)}},getGradientDefs:function(t){var e,i=T(t,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),r=0,n={};for(r=i.length;r--;)(e=i[r]).getAttribute("xlink:href")&&s(t,e),n[e.getAttribute("id")]=e;return n},parseAttributes:function(i,t,e){if(i){var r,n,s,o={};void 0===e&&(e=i.getAttribute("svgUid")),i.parentNode&&C.svgValidParentsRegEx.test(i.parentNode.nodeName)&&(o=C.parseAttributes(i.parentNode,t,e));var a=t.reduce(function(t,e){return(r=i.getAttribute(e))&&(t[e]=r),t},{}),c=p(function(t,e){var i={};for(var r in C.cssRules[e])if(w(t,r.split(" ")))for(var n in C.cssRules[e][r])i[n]=C.cssRules[e][r][n];return i}(i,e),C.parseStyleAttribute(i));a=p(a,c),c[_]&&i.setAttribute(_,c[_]),n=s=o.fontSize||C.Text.DEFAULT_SVG_FONT_SIZE,a[y]&&(a[y]=n=S(a[y],s));var h,l,u,f={};for(var d in a)l=x(h=(u=d)in m?m[u]:u,a[d],o,n),f[h]=l;f&&f.font&&C.parseFontDeclaration(f.font,f);var g=p(o,f);return C.svgValidParentsRegEx.test(i.nodeName)?g:function(t){for(var e in b)if(void 0!==t[b[e]]&&""!==t[e]){if(void 0===t[e]){if(!C.Object.prototype[e])continue;t[e]=C.Object.prototype[e]}if(0!==t[e].indexOf("url(")){var i=new C.Color(t[e]);t[e]=i.setAlpha(v(i.getAlpha()*t[b[e]],2)).toRgba()}}return t}(g)}},parseElements:function(t,e,i,r,n){new C.ElementsParser(t,e,i,r,n).parse()},parseStyleAttribute:function(t){var i,r,n,e={},s=t.getAttribute("style");return s&&("string"==typeof s?(i=e,s.replace(/;\s*$/,"").split(";").forEach(function(t){var e=t.split(":");r=e[0].trim().toLowerCase(),n=e[1].trim(),i[r]=n})):function(t,e){var i,r;for(var n in t)void 0!==t[n]&&(i=n.toLowerCase(),r=t[n],e[i]=r)}(s,e)),e},parsePointsAttribute:function(t){if(!t)return null;var e,i,r=[];for(e=0,i=(t=(t=t.replace(/,/g," ").trim()).split(/\s+/)).length;e<i;e+=2)r.push({x:parseFloat(t[e]),y:parseFloat(t[e+1])});return r},getCSSRules:function(t){var a,c,e=t.getElementsByTagName("style"),h={};for(a=0,c=e.length;a<c;a++){var i=e[a].textContent;""!==(i=i.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&i.split("}").filter(function(t){return t.trim()}).forEach(function(t){var e=t.split("{"),i={},r=e[1].trim().split(";").filter(function(t){return t.trim()});for(a=0,c=r.length;a<c;a++){var n=r[a].split(":"),s=n[0].trim(),o=n[1].trim();i[s]=o}(t=e[0].trim()).split(",").forEach(function(t){""!==(t=t.replace(/^svg/i,"").trim())&&(h[t]?C.util.object.extend(h[t],i):h[t]=C.util.object.clone(i))})})}return h},loadSVGFromURL:function(t,n,i,r){t=t.replace(/^\n\s*/,"").trim(),new C.util.request(t,{method:"get",onComplete:function(t){var e=t.responseXML;if(!e||!e.documentElement)return n&&n(null),!1;C.parseSVGDocument(e.documentElement,function(t,e,i,r){n&&n(t,e,i,r)},i,r)}})},loadSVGFromString:function(t,n,e,i){var r=(new C.window.DOMParser).parseFromString(t.trim(),"text/xml");C.parseSVGDocument(r.documentElement,function(t,e,i,r){n(t,e,i,r)},e,i)}})}("undefined"!=typeof exports?exports:this),fabric.ElementsParser=function(t,e,i,r,n,s){this.elements=t,this.callback=e,this.options=i,this.reviver=r,this.svgUid=i&&i.svgUid||0,this.parsingOptions=n,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=s},function(t){t.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},t.createObjects=function(){var i=this;this.elements.forEach(function(t,e){t.setAttribute("svgUid",i.svgUid),i.createObject(t,e)})},t.findTag=function(t){return fabric[fabric.util.string.capitalize(t.tagName.replace("svg:",""))]},t.createObject=function(t,e){var i=this.findTag(t);if(i&&i.fromElement)try{i.fromElement(t,this.createCallback(e,t),this.options)}catch(t){fabric.log(t)}else this.checkIfDone()},t.createCallback=function(i,r){var n=this;return function(t){var e;n.resolveGradient(t,r,"fill"),n.resolveGradient(t,r,"stroke"),t instanceof fabric.Image&&t._originalElement&&(e=t.parsePreserveAspectRatioAttribute(r)),t._removeTransformMatrix(e),n.resolveClipPath(t,r),n.reviver&&n.reviver(r,t),n.instances[i]=t,n.checkIfDone()}},t.extractPropertyDefinition=function(t,e,i){var r=t[e],n=this.regexUrl;if(n.test(r)){n.lastIndex=0;var s=n.exec(r)[1];return n.lastIndex=0,fabric[i][this.svgUid][s]}},t.resolveGradient=function(t,e,i){var r=this.extractPropertyDefinition(t,i,"gradientDefs");if(r){var n=e.getAttribute(i+"-opacity"),s=fabric.Gradient.fromElement(r,t,n,this.options);t.set(i,s)}},t.createClipPathCallback=function(t,e){return function(t){t._removeTransformMatrix(),t.fillRule=t.clipRule,e.push(t)}},t.resolveClipPath=function(t,e){var i,r,n,s,o=this.extractPropertyDefinition(t,"clipPath","clipPaths");if(o){n=[],r=fabric.util.invertTransform(t.calcTransformMatrix());for(var a=o[0].parentNode,c=e;c.parentNode&&c.getAttribute("clip-path")!==t.clipPath;)c=c.parentNode;c.parentNode.appendChild(a);for(var h=0;h<o.length;h++)i=o[h],this.findTag(i).fromElement(i,this.createClipPathCallback(t,n),this.options);o=1===n.length?n[0]:new fabric.Group(n),s=fabric.util.multiplyTransformMatrices(r,o.calcTransformMatrix()),o.clipPath&&this.resolveClipPath(o,c);var l=fabric.util.qrDecompose(s);o.flipX=!1,o.flipY=!1,o.set("scaleX",l.scaleX),o.set("scaleY",l.scaleY),o.angle=l.angle,o.skewX=l.skewX,o.skewY=0,o.setPositionByOrigin({x:l.translateX,y:l.translateY},"center","center"),t.clipPath=o}else delete t.clipPath},t.checkIfDone=function(){0==--this.numElements&&(this.instances=this.instances.filter(function(t){return null!=t}),this.callback(this.instances,this.elements))}}(fabric.ElementsParser.prototype),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t,e){this.x=t,this.y=e}e.Point?e.warn("fabric.Point is already defined"):(e.Point=i).prototype={type:"point",constructor:i,add:function(t){return new i(this.x+t.x,this.y+t.y)},addEquals:function(t){return this.x+=t.x,this.y+=t.y,this},scalarAdd:function(t){return new i(this.x+t,this.y+t)},scalarAddEquals:function(t){return this.x+=t,this.y+=t,this},subtract:function(t){return new i(this.x-t.x,this.y-t.y)},subtractEquals:function(t){return this.x-=t.x,this.y-=t.y,this},scalarSubtract:function(t){return new i(this.x-t,this.y-t)},scalarSubtractEquals:function(t){return this.x-=t,this.y-=t,this},multiply:function(t){return new i(this.x*t,this.y*t)},multiplyEquals:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return new i(this.x/t,this.y/t)},divideEquals:function(t){return this.x/=t,this.y/=t,this},eq:function(t){return this.x===t.x&&this.y===t.y},lt:function(t){return this.x<t.x&&this.y<t.y},lte:function(t){return this.x<=t.x&&this.y<=t.y},gt:function(t){return this.x>t.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return void 0===e&&(e=.5),e=Math.max(Math.min(1,e),0),new i(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},distanceFrom:function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},midPointFrom:function(t){return this.lerp(t)},min:function(t){return new i(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new i(Math.max(this.x,t.x),Math.max(this.y,t.y))},toString:function(){return this.x+","+this.y},setXY:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setFromPoint:function(t){return this.x=t.x,this.y=t.y,this},swap:function(t){var e=this.x,i=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=i},clone:function(){return new i(this.x,this.y)}}}("undefined"!=typeof exports?exports:this),function(t){"use strict";var f=t.fabric||(t.fabric={});function d(t){this.status=t,this.points=[]}f.Intersection?f.warn("fabric.Intersection is already defined"):(f.Intersection=d,f.Intersection.prototype={constructor:d,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},f.Intersection.intersectLineLine=function(t,e,i,r){var n,s=(r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x),o=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),a=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==a){var c=s/a,h=o/a;0<=c&&c<=1&&0<=h&&h<=1?(n=new d("Intersection")).appendPoint(new f.Point(t.x+c*(e.x-t.x),t.y+c*(e.y-t.y))):n=new d}else n=new d(0===s||0===o?"Coincident":"Parallel");return n},f.Intersection.intersectLinePolygon=function(t,e,i){var r,n,s,o,a=new d,c=i.length;for(o=0;o<c;o++)r=i[o],n=i[(o+1)%c],s=d.intersectLineLine(t,e,r,n),a.appendPoints(s.points);return 0<a.points.length&&(a.status="Intersection"),a},f.Intersection.intersectPolygonPolygon=function(t,e){var i,r=new d,n=t.length;for(i=0;i<n;i++){var s=t[i],o=t[(i+1)%n],a=d.intersectLinePolygon(s,o,e);r.appendPoints(a.points)}return 0<r.points.length&&(r.status="Intersection"),r},f.Intersection.intersectPolygonRectangle=function(t,e,i){var r=e.min(i),n=e.max(i),s=new f.Point(n.x,r.y),o=new f.Point(r.x,n.y),a=d.intersectLinePolygon(r,s,t),c=d.intersectLinePolygon(s,n,t),h=d.intersectLinePolygon(n,o,t),l=d.intersectLinePolygon(o,r,t),u=new d;return u.appendPoints(a.points),u.appendPoints(c.points),u.appendPoints(h.points),u.appendPoints(l.points),0<u.points.length&&(u.status="Intersection"),u})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var h=t.fabric||(t.fabric={});function l(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}function u(t,e,i){return i<0&&(i+=1),1<i&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}h.Color?h.warn("fabric.Color is already defined."):(h.Color=l,h.Color.prototype={_tryParsingColor:function(t){var e;t in l.colorNameMap&&(t=l.colorNameMap[t]),"transparent"===t&&(e=[255,255,255,0]),e||(e=l.sourceFromHex(t)),e||(e=l.sourceFromRgb(t)),e||(e=l.sourceFromHsl(t)),e||(e=[0,0,0,1]),e&&this.setSource(e)},_rgbToHsl:function(t,e,i){t/=255,e/=255,i/=255;var r,n,s,o=h.util.array.max([t,e,i]),a=h.util.array.min([t,e,i]);if(s=(o+a)/2,o===a)r=n=0;else{var c=o-a;switch(n=.5<s?c/(2-o-a):c/(o+a),o){case t:r=(e-i)/c+(e<i?6:0);break;case e:r=(i-t)/c+2;break;case i:r=(t-e)/c+4}r/=6}return[Math.round(360*r),Math.round(100*n),Math.round(100*s)]},getSource:function(){return this._source},setSource:function(t){this._source=t},toRgb:function(){var t=this.getSource();return"rgb("+t[0]+","+t[1]+","+t[2]+")"},toRgba:function(){var t=this.getSource();return"rgba("+t[0]+","+t[1]+","+t[2]+","+t[3]+")"},toHsl:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsl("+e[0]+","+e[1]+"%,"+e[2]+"%)"},toHsla:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsla("+e[0]+","+e[1]+"%,"+e[2]+"%,"+t[3]+")"},toHex:function(){var t,e,i,r=this.getSource();return t=1===(t=r[0].toString(16)).length?"0"+t:t,e=1===(e=r[1].toString(16)).length?"0"+e:e,i=1===(i=r[2].toString(16)).length?"0"+i:i,t.toUpperCase()+e.toUpperCase()+i.toUpperCase()},toHexa:function(){var t,e=this.getSource();return t=1===(t=(t=Math.round(255*e[3])).toString(16)).length?"0"+t:t,this.toHex()+t.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(t){var e=this.getSource();return e[3]=t,this.setSource(e),this},toGrayscale:function(){var t=this.getSource(),e=parseInt((.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),10),i=t[3];return this.setSource([e,e,e,i]),this},toBlackWhite:function(t){var e=this.getSource(),i=(.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),r=e[3];return t=t||127,i=Number(i)<Number(t)?0:255,this.setSource([i,i,i,r]),this},overlayWith:function(t){t instanceof l||(t=new l(t));var e,i=[],r=this.getAlpha(),n=this.getSource(),s=t.getSource();for(e=0;e<3;e++)i.push(Math.round(.5*n[e]+.5*s[e]));return i[3]=r,this.setSource(i),this}},h.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,h.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,h.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,h.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},h.Color.fromRgb=function(t){return l.fromSource(l.sourceFromRgb(t))},h.Color.sourceFromRgb=function(t){var e=t.match(l.reRGBa);if(e){var i=parseInt(e[1],10)/(/%$/.test(e[1])?100:1)*(/%$/.test(e[1])?255:1),r=parseInt(e[2],10)/(/%$/.test(e[2])?100:1)*(/%$/.test(e[2])?255:1),n=parseInt(e[3],10)/(/%$/.test(e[3])?100:1)*(/%$/.test(e[3])?255:1);return[parseInt(i,10),parseInt(r,10),parseInt(n,10),e[4]?parseFloat(e[4]):1]}},h.Color.fromRgba=l.fromRgb,h.Color.fromHsl=function(t){return l.fromSource(l.sourceFromHsl(t))},h.Color.sourceFromHsl=function(t){var e=t.match(l.reHSLa);if(e){var i,r,n,s=(parseFloat(e[1])%360+360)%360/360,o=parseFloat(e[2])/(/%$/.test(e[2])?100:1),a=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(0===o)i=r=n=a;else{var c=a<=.5?a*(o+1):a+o-a*o,h=2*a-c;i=u(h,c,s+1/3),r=u(h,c,s),n=u(h,c,s-1/3)}return[Math.round(255*i),Math.round(255*r),Math.round(255*n),e[4]?parseFloat(e[4]):1]}},h.Color.fromHsla=l.fromHsl,h.Color.fromHex=function(t){return l.fromSource(l.sourceFromHex(t))},h.Color.sourceFromHex=function(t){if(t.match(l.reHex)){var e=t.slice(t.indexOf("#")+1),i=3===e.length||4===e.length,r=8===e.length||4===e.length,n=i?e.charAt(0)+e.charAt(0):e.substring(0,2),s=i?e.charAt(1)+e.charAt(1):e.substring(2,4),o=i?e.charAt(2)+e.charAt(2):e.substring(4,6),a=r?i?e.charAt(3)+e.charAt(3):e.substring(6,8):"FF";return[parseInt(n,16),parseInt(s,16),parseInt(o,16),parseFloat((parseInt(a,16)/255).toFixed(2))]}},h.Color.fromSource=function(t){var e=new l;return e.setSource(t),e})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var l=t.fabric||(t.fabric={}),o=["e","se","s","sw","w","nw","n","ne","e"],s=["ns","nesw","ew","nwse"],n={},f="left",d="top",g="right",p="bottom",c="center",S={top:p,bottom:d,left:g,right:f,center:c},v=l.util.radiansToDegrees,T=Math.sign||function(t){return(0<t)-(t<0)||+t};function a(t,e){var i=t.angle+v(Math.atan2(e.y,e.x))+360;return Math.round(i%360/45)}function h(t,e){var i=e.transform.target,r=i.canvas,n=l.util.object.clone(e);n.target=i,r&&r.fire("object:"+t,n),i.fire(t,e)}function w(t,e){var i=e.canvas,r=t[i.uniScaleKey];return i.uniformScaling&&!r||!i.uniformScaling&&r}function O(t){return t.originX===c&&t.originY===c}function k(t,e,i){var r=t.lockScalingX,n=t.lockScalingY;return!(!r||!n)||(!(e||!r&&!n||!i)||(!(!r||"x"!==e)||!(!n||"y"!==e)))}function u(t,e,i,r){return{e:t,transform:e,pointer:{x:i,y:r}}}function m(c){return function(t,e,i,r){var n=e.target,s=n.getCenterPoint(),o=n.translateToOriginPoint(s,e.originX,e.originY),a=c(t,e,i,r);return n.setPositionByOrigin(o,e.originX,e.originY),a}}function b(s,o){return function(t,e,i,r){var n=o(t,e,i,r);return n&&h(s,u(t,e,i,r)),n}}function P(t,e,i,r,n){var s=t.target,o=s.controls[t.corner],a=s.canvas.getZoom(),c=s.padding/a,h=s.toLocalPoint(new l.Point(r,n),e,i);return h.x>=c&&(h.x-=c),h.x<=-c&&(h.x+=c),h.y>=c&&(h.y-=c),h.y<=c&&(h.y+=c),h.x-=o.offsetX,h.y-=o.offsetY,h}function y(t){return t.flipX!==t.flipY}function _(t,e,i,r,n){if(0!==t[e]){var s=n/t._getTransformedDimensions()[r]*t[i];t.set(i,s)}}function x(t,e,i,r){var n,s=e.target,o=s._getTransformedDimensions(0,s.skewY),a=P(e,e.originX,e.originY,i,r),c=Math.abs(2*a.x)-o.x,h=s.skewX;c<2?n=0:(n=v(Math.atan2(c/s.scaleX,o.y/s.scaleY)),e.originX===f&&e.originY===p&&(n=-n),e.originX===g&&e.originY===d&&(n=-n),y(s)&&(n=-n));var l=h!==n;if(l){var u=s._getTransformedDimensions().y;s.set("skewX",n),_(s,"skewY","scaleY","y",u)}return l}function C(t,e,i,r){var n,s=e.target,o=s._getTransformedDimensions(s.skewX,0),a=P(e,e.originX,e.originY,i,r),c=Math.abs(2*a.y)-o.y,h=s.skewY;c<2?n=0:(n=v(Math.atan2(c/s.scaleY,o.x/s.scaleX)),e.originX===f&&e.originY===p&&(n=-n),e.originX===g&&e.originY===d&&(n=-n),y(s)&&(n=-n));var l=h!==n;if(l){var u=s._getTransformedDimensions().x;s.set("skewY",n),_(s,"skewX","scaleX","x",u)}return l}function E(t,e,i,r,n){n=n||{};var s,o,a,c,h,l,u=e.target,f=u.lockScalingX,d=u.lockScalingY,g=n.by,p=w(t,u),v=k(u,g,p),m=e.gestureScale;if(v)return!1;if(m)o=e.scaleX*m,a=e.scaleY*m;else{if(s=P(e,e.originX,e.originY,i,r),h="y"!==g?T(s.x):1,l="x"!==g?T(s.y):1,e.signX||(e.signX=h),e.signY||(e.signY=l),u.lockScalingFlip&&(e.signX!==h||e.signY!==l))return!1;if(c=u._getTransformedDimensions(),p&&!g){var b=Math.abs(s.x)+Math.abs(s.y),y=e.original,_=b/(Math.abs(c.x*y.scaleX/u.scaleX)+Math.abs(c.y*y.scaleY/u.scaleY));o=y.scaleX*_,a=y.scaleY*_}else o=Math.abs(s.x*u.scaleX/c.x),a=Math.abs(s.y*u.scaleY/c.y);O(e)&&(o*=2,a*=2),e.signX!==h&&"y"!==g&&(e.originX=S[e.originX],o*=-1,e.signX=h),e.signY!==l&&"x"!==g&&(e.originY=S[e.originY],a*=-1,e.signY=l)}var x=u.scaleX,C=u.scaleY;return g?("x"===g&&u.set("scaleX",o),"y"===g&&u.set("scaleY",a)):(!f&&u.set("scaleX",o),!d&&u.set("scaleY",a)),x!==u.scaleX||C!==u.scaleY}n.scaleCursorStyleHandler=function(t,e,i){var r=w(t,i),n="";if(0!==e.x&&0===e.y?n="x":0===e.x&&0!==e.y&&(n="y"),k(i,n,r))return"not-allowed";var s=a(i,e);return o[s]+"-resize"},n.skewCursorStyleHandler=function(t,e,i){var r="not-allowed";if(0!==e.x&&i.lockSkewingY)return r;if(0!==e.y&&i.lockSkewingX)return r;var n=a(i,e)%4;return s[n]+"-resize"},n.scaleSkewCursorStyleHandler=function(t,e,i){return t[i.canvas.altActionKey]?n.skewCursorStyleHandler(t,e,i):n.scaleCursorStyleHandler(t,e,i)},n.rotationWithSnapping=b("rotating",m(function(t,e,i,r){var n=e,s=n.target,o=s.translateToOriginPoint(s.getCenterPoint(),n.originX,n.originY);if(s.lockRotation)return!1;var a,c=Math.atan2(n.ey-o.y,n.ex-o.x),h=Math.atan2(r-o.y,i-o.x),l=v(h-c+n.theta);if(0<s.snapAngle){var u=s.snapAngle,f=s.snapThreshold||u,d=Math.ceil(l/u)*u,g=Math.floor(l/u)*u;Math.abs(l-g)<f?l=g:Math.abs(l-d)<f&&(l=d)}return l<0&&(l=360+l),l%=360,a=s.angle!==l,s.angle=l,a})),n.scalingEqually=b("scaling",m(function(t,e,i,r){return E(t,e,i,r)})),n.scalingX=b("scaling",m(function(t,e,i,r){return E(t,e,i,r,{by:"x"})})),n.scalingY=b("scaling",m(function(t,e,i,r){return E(t,e,i,r,{by:"y"})})),n.scalingYOrSkewingX=function(t,e,i,r){return t[e.target.canvas.altActionKey]?n.skewHandlerX(t,e,i,r):n.scalingY(t,e,i,r)},n.scalingXOrSkewingY=function(t,e,i,r){return t[e.target.canvas.altActionKey]?n.skewHandlerY(t,e,i,r):n.scalingX(t,e,i,r)},n.changeWidth=b("resizing",m(function(t,e,i,r){var n=e.target,s=P(e,e.originX,e.originY,i,r),o=n.strokeWidth/(n.strokeUniform?n.scaleX:1),a=O(e)?2:1,c=n.width,h=Math.abs(s.x*a/n.scaleX)-o;return n.set("width",Math.max(h,0)),c!==h})),n.skewHandlerX=function(t,e,i,r){var n,s=e.target,o=s.skewX,a=e.originY;return!s.lockSkewingX&&(0===o?n=0<P(e,c,c,i,r).x?f:g:(0<o&&(n=a===d?f:g),o<0&&(n=a===d?g:f),y(s)&&(n=n===f?g:f)),e.originX=n,b("skewing",m(x))(t,e,i,r))},n.skewHandlerY=function(t,e,i,r){var n,s=e.target,o=s.skewY,a=e.originX;return!s.lockSkewingY&&(0===o?n=0<P(e,c,c,i,r).y?d:p:(0<o&&(n=a===f?d:p),o<0&&(n=a===f?p:d),y(s)&&(n=n===d?p:d)),e.originY=n,b("skewing",m(C))(t,e,i,r))},n.dragHandler=function(t,e,i,r){var n=e.target,s=i-e.offsetX,o=r-e.offsetY,a=!n.get("lockMovementX")&&n.left!==s,c=!n.get("lockMovementY")&&n.top!==o;return a&&n.set("left",s),c&&n.set("top",o),(a||c)&&h("moving",u(t,e,i,r)),a||c},n.scaleOrSkewActionName=function(t,e,i){var r=t[i.canvas.altActionKey];return 0===e.x?r?"skewX":"scaleY":0===e.y?r?"skewY":"scaleX":void 0},n.rotationStyleHandler=function(t,e,i){return i.lockRotation?"not-allowed":e.cursorStyle},n.fireEvent=h,n.wrapWithFixedAnchor=m,n.wrapWithFireEvent=b,n.getLocalPoint=P,l.controlsUtils=n}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),f=e.util.degreesToRadians,i=e.controlsUtils;i.renderCircleControl=function(t,e,i,r,n){r=r||{};var s,o=this.sizeX||r.cornerSize||n.cornerSize,a=this.sizeY||r.cornerSize||n.cornerSize,c=void 0!==r.transparentCorners?r.transparentCorners:n.transparentCorners,h=c?"stroke":"fill",l=!c&&(r.cornerStrokeColor||n.cornerStrokeColor),u=e,f=i;t.save(),t.fillStyle=r.cornerColor||n.cornerColor,t.strokeStyle=r.cornerStrokeColor||n.cornerStrokeColor,a<o?(s=o,t.scale(1,a/o),f=i*o/a):o<a?(s=a,t.scale(o/a,1),u=e*a/o):s=o,t.lineWidth=1,t.beginPath(),t.arc(u,f,s/2,0,2*Math.PI,!1),t[h](),l&&t.stroke(),t.restore()},i.renderSquareControl=function(t,e,i,r,n){r=r||{};var s=this.sizeX||r.cornerSize||n.cornerSize,o=this.sizeY||r.cornerSize||n.cornerSize,a=void 0!==r.transparentCorners?r.transparentCorners:n.transparentCorners,c=a?"stroke":"fill",h=!a&&(r.cornerStrokeColor||n.cornerStrokeColor),l=s/2,u=o/2;t.save(),t.fillStyle=r.cornerColor||n.cornerColor,t.strokeStyle=r.cornerStrokeColor||n.cornerStrokeColor,t.lineWidth=1,t.translate(e,i),t.rotate(f(n.angle)),t[c+"Rect"](-l,-u,s,o),h&&t.strokeRect(-l,-u,s,o),t.restore()}}("undefined"!=typeof exports?exports:this),function(t){"use strict";var p=t.fabric||(t.fabric={});p.Control=function(t){for(var e in t)this[e]=t[e]},p.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(t,e){return e.cursorStyle},getActionName:function(t,e){return e.actionName},getVisibility:function(t,e){var i=t._controlsVisibility;return i&&void 0!==i[e]?i[e]:this.visible},setVisibility:function(t){this.visible=t},positionHandler:function(t,e){return p.util.transformPoint({x:this.x*t.x+this.offsetX,y:this.y*t.y+this.offsetY},e)},calcCornerCoords:function(t,e,i,r,n){var s,o,a,c,h=n?this.touchSizeX:this.sizeX,l=n?this.touchSizeY:this.sizeY;if(h&&l&&h!==l){var u=Math.atan2(l,h),f=Math.sqrt(h*h+l*l)/2,d=u-p.util.degreesToRadians(t),g=Math.PI/2-u-p.util.degreesToRadians(t);s=f*p.util.cos(d),o=f*p.util.sin(d),a=f*p.util.cos(g),c=f*p.util.sin(g)}else{f=.7071067812*(h&&l?h:e);d=p.util.degreesToRadians(45-t);s=a=f*p.util.cos(d),o=c=f*p.util.sin(d)}return{tl:{x:i-c,y:r-a},tr:{x:i+s,y:r-o},bl:{x:i-s,y:r+o},br:{x:i+c,y:r+a}}},render:function(t,e,i,r,n){switch((r=r||{}).cornerStyle||n.cornerStyle){case"circle":p.controlsUtils.renderCircleControl.call(this,t,e,i,r,n);break;default:p.controlsUtils.renderSquareControl.call(this,t,e,i,r,n)}}}}("undefined"!=typeof exports?exports:this),function(){function C(t,e){var i,r,n,s,o=t.getAttribute("style"),a=t.getAttribute("offset")||0;if(a=(a=parseFloat(a)/(/%$/.test(a)?100:1))<0?0:1<a?1:a,o){var c=o.split(/\s*;\s*/);for(""===c[c.length-1]&&c.pop(),s=c.length;s--;){var h=c[s].split(/\s*:\s*/),l=h[0].trim(),u=h[1].trim();"stop-color"===l?i=u:"stop-opacity"===l&&(n=u)}}return i||(i=t.getAttribute("stop-color")||"rgb(0,0,0)"),n||(n=t.getAttribute("stop-opacity")),r=(i=new fabric.Color(i)).getAlpha(),n=isNaN(parseFloat(n))?1:parseFloat(n),n*=r*e,{offset:a,color:i.toRgb(),opacity:n}}var m=fabric.util.object.clone;fabric.Gradient=fabric.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var t,i=this;Object.keys(e).forEach(function(t){i[t]=e[t]}),this.id?this.id+="_"+fabric.Object.__uid++:this.id=fabric.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(t){for(var e in t){var i=new fabric.Color(t[e]);this.colorStops.push({offset:parseFloat(e),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(t){var e={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return fabric.util.populateWithProperties(this,e,t),e},toSVG:function(t,e){var i,r,n,s,o=m(this.coords,!0),a=(e=e||{},m(this.colorStops,!0)),c=o.r1>o.r2,h=this.gradientTransform?this.gradientTransform.concat():fabric.iMatrix.concat(),l=-this.offsetX,u=-this.offsetY,f=!!e.additionalTransform,d="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(a.sort(function(t,e){return t.offset-e.offset}),"objectBoundingBox"===d?(l/=t.width,u/=t.height):(l+=t.width/2,u+=t.height/2),"path"===t.type&&"percentage"!==this.gradientUnits&&(l-=t.pathOffset.x,u-=t.pathOffset.y),h[4]-=l,h[5]-=u,s='id="SVGID_'+this.id+'" gradientUnits="'+d+'"',s+=' gradientTransform="'+(f?e.additionalTransform+" ":"")+fabric.util.matrixToSVG(h)+'" ',"linear"===this.type?n=["<linearGradient ",s,' x1="',o.x1,'" y1="',o.y1,'" x2="',o.x2,'" y2="',o.y2,'">\n']:"radial"===this.type&&(n=["<radialGradient ",s,' cx="',c?o.x1:o.x2,'" cy="',c?o.y1:o.y2,'" r="',c?o.r1:o.r2,'" fx="',c?o.x2:o.x1,'" fy="',c?o.y2:o.y1,'">\n']),"radial"===this.type){if(c)for((a=a.concat()).reverse(),i=0,r=a.length;i<r;i++)a[i].offset=1-a[i].offset;var g=Math.min(o.r1,o.r2);if(0<g){var p=g/Math.max(o.r1,o.r2);for(i=0,r=a.length;i<r;i++)a[i].offset+=p*(1-a[i].offset)}}for(i=0,r=a.length;i<r;i++){var v=a[i];n.push("<stop ",'offset="',100*v.offset+"%",'" style="stop-color:',v.color,void 0!==v.opacity?";stop-opacity: "+v.opacity:";",'"/>\n')}return n.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),n.join("")},toLive:function(t){var e,i,r,n=fabric.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(n.x1,n.y1,n.x2,n.y2):"radial"===this.type&&(e=t.createRadialGradient(n.x1,n.y1,n.r1,n.x2,n.y2,n.r2)),i=0,r=this.colorStops.length;i<r;i++){var s=this.colorStops[i].color,o=this.colorStops[i].opacity,a=this.colorStops[i].offset;void 0!==o&&(s=new fabric.Color(s).setAlpha(o).toRgba()),e.addColorStop(a,s)}return e}}}),fabric.util.object.extend(fabric.Gradient,{fromElement:function(t,e,i,r){var n=parseFloat(i)/(/%$/.test(i)?100:1);n=n<0?0:1<n?1:n,isNaN(n)&&(n=1);var s,o,a,c,h,l,u,f,d,g,p,v=t.getElementsByTagName("stop"),m="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",b=t.getAttribute("gradientTransform")||"",y=[],_=0,x=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(s="linear",o={x1:(l=t).getAttribute("x1")||0,y1:l.getAttribute("y1")||0,x2:l.getAttribute("x2")||"100%",y2:l.getAttribute("y2")||0}):(s="radial",o={x1:(h=t).getAttribute("fx")||h.getAttribute("cx")||"50%",y1:h.getAttribute("fy")||h.getAttribute("cy")||"50%",r1:0,x2:h.getAttribute("cx")||"50%",y2:h.getAttribute("cy")||"50%",r2:h.getAttribute("r")||"50%"}),a=v.length;a--;)y.push(C(v[a],n));return c=fabric.parseTransformAttribute(b),u=o,f=r,d=m,Object.keys(u).forEach(function(t){"Infinity"===(g=u[t])?p=1:"-Infinity"===g?p=0:(p=parseFloat(u[t],10),"string"==typeof g&&/^(\d+\.\d+)%|(\d+)%$/.test(g)&&(p*=.01,"pixels"===d&&("x1"!==t&&"x2"!==t&&"r2"!==t||(p*=f.viewBoxWidth||f.width),"y1"!==t&&"y2"!==t||(p*=f.viewBoxHeight||f.height)))),u[t]=p}),"pixels"===m&&(_=-e.left,x=-e.top),new fabric.Gradient({id:t.getAttribute("id"),type:s,coords:o,colorStops:y,gradientUnits:m,gradientTransform:c,offsetX:_,offsetY:x})}})}(),function(){"use strict";var n=fabric.util.toFixed;fabric.Pattern=fabric.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,i){if(t||(t={}),this.id=fabric.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!=typeof t.source)i&&i(this);else{var r=this;this.source=fabric.util.createImage(),fabric.util.loadImage(t.source,function(t,e){r.source=t,i&&i(r,e)},null,this.crossOrigin)}},toObject:function(t){var e,i,r=fabric.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?e=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(e=this.source.toDataURL()),i={type:"pattern",source:e,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:n(this.offsetX,r),offsetY:n(this.offsetY,r),patternTransform:this.patternTransform?this.patternTransform.concat():null},fabric.util.populateWithProperties(this,i,t),i},toSVG:function(t){var e="function"==typeof this.source?this.source():this.source,i=e.width/t.width,r=e.height/t.height,n=this.offsetX/t.width,s=this.offsetY/t.height,o="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(r=1,s&&(r+=Math.abs(s))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,n&&(i+=Math.abs(n))),e.src?o=e.src:e.toDataURL&&(o=e.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+n+'" y="'+s+'" width="'+i+'" height="'+r+'">\n<image x="0" y="0" width="'+e.width+'" height="'+e.height+'" xlink:href="'+o+'"></image>\n</pattern>\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;if(!e)return"";if(void 0!==e.src){if(!e.complete)return"";if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}})}(),function(t){"use strict";var o=t.fabric||(t.fabric={}),a=o.util.toFixed;o.Shadow?o.warn("fabric.Shadow is already defined."):(o.Shadow=o.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(t){for(var e in"string"==typeof t&&(t=this._parseShadow(t)),t)this[e]=t[e];this.id=o.Object.__uid++},_parseShadow:function(t){var e=t.trim(),i=o.Shadow.reOffsetsAndBlur.exec(e)||[];return{color:(e.replace(o.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(i[1],10)||0,offsetY:parseFloat(i[2],10)||0,blur:parseFloat(i[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var e=40,i=40,r=o.Object.NUM_FRACTION_DIGITS,n=o.util.rotateVector({x:this.offsetX,y:this.offsetY},o.util.degreesToRadians(-t.angle)),s=new o.Color(this.color);return t.width&&t.height&&(e=100*a((Math.abs(n.x)+this.blur)/t.width,r)+20,i=100*a((Math.abs(n.y)+this.blur)/t.height,r)+20),t.flipX&&(n.x*=-1),t.flipY&&(n.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+i+'%" height="'+(100+2*i)+'%" x="-'+e+'%" width="'+(100+2*e)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+a(this.blur?this.blur/2:0,r)+'"></feGaussianBlur>\n\t<feOffset dx="'+a(n.x,r)+'" dy="'+a(n.y,r)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},i=o.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(t){this[t]!==i[t]&&(e[t]=this[t])},this),e}}),o.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}("undefined"!=typeof exports?exports:this),function(){"use strict";if(fabric.StaticCanvas)fabric.warn("fabric.StaticCanvas is already defined.");else{var n=fabric.util.object.extend,t=fabric.util.getElementOffset,h=fabric.util.removeFromArray,a=fabric.util.toFixed,s=fabric.util.transformPoint,o=fabric.util.invertTransform,i=fabric.util.getNodeCanvas,r=fabric.util.createCanvasElement,e=new Error("Could not initialize `canvas` element");fabric.StaticCanvas=fabric.util.createClass(fabric.CommonMethods,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:fabric.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,i),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,i),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,i),e.overlayColor&&this.setOverlayColor(e.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1<fabric.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,fabric.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var t=fabric.devicePixelRatio;this.__initRetinaScaling(t,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(t,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(t,e,i){e.setAttribute("width",this.width*t),e.setAttribute("height",this.height*t),i.scale(t,t)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(t,e,i){return this.__setBgOverlayImage("overlayImage",t,e,i)},setBackgroundImage:function(t,e,i){return this.__setBgOverlayImage("backgroundImage",t,e,i)},setOverlayColor:function(t,e){return this.__setBgOverlayColor("overlayColor",t,e)},setBackgroundColor:function(t,e){return this.__setBgOverlayColor("backgroundColor",t,e)},__setBgOverlayImage:function(r,t,n,s){return"string"==typeof t?fabric.util.loadImage(t,function(t,e){if(t){var i=new fabric.Image(t,s);(this[r]=i).canvas=this}n&&n(t,e)},this,s&&s.crossOrigin):(s&&t.setOptions(s),(this[r]=t)&&(t.canvas=this),n&&n(t,!1)),this},__setBgOverlayColor:function(t,e,i){return this[t]=e,this._initGradient(e,t),this._initPattern(e,t,i),this},_createCanvasElement:function(){var t=r();if(!t)throw e;if(t.style||(t.style={}),void 0===t.getContext)throw e;return t},_initOptions:function(t){var e=this.lowerCanvasEl;this._setOptions(t),this.width=this.width||parseInt(e.width,10)||0,this.height=this.height||parseInt(e.height,10)||0,this.lowerCanvasEl.style&&(e.width=this.width,e.height=this.height,e.style.width=this.width+"px",e.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=fabric.util.getById(t)||this._createCanvasElement(),fabric.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(t,e){return this.setDimensions({width:t},e)},setHeight:function(t,e){return this.setDimensions({height:t},e)},setDimensions:function(t,e){var i;for(var r in e=e||{},t)i=t[r],e.cssOnly||(this._setBackstoreDimension(r,t[r]),i+="px",this.hasLostContext=!0),e.backstoreOnly||this._setCssDimension(r,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),e.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(t,e){return this.lowerCanvasEl[t]=e,this.upperCanvasEl&&(this.upperCanvasEl[t]=e),this.cacheCanvasEl&&(this.cacheCanvasEl[t]=e),this[t]=e,this},_setCssDimension:function(t,e){return this.lowerCanvasEl.style[t]=e,this.upperCanvasEl&&(this.upperCanvasEl.style[t]=e),this.wrapperEl&&(this.wrapperEl.style[t]=e),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(t){var e,i,r,n=this._activeObject,s=this.backgroundImage,o=this.overlayImage;for(this.viewportTransform=t,i=0,r=this._objects.length;i<r;i++)(e=this._objects[i]).group||e.setCoords(!0);return n&&n.setCoords(),s&&s.setCoords(!0),o&&o.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(t,e){var i=t,r=this.viewportTransform.slice(0);t=s(t,o(this.viewportTransform)),r[0]=e,r[3]=e;var n=s(t,r);return r[4]+=i.x-n.x,r[5]+=i.y-n.y,this.setViewportTransform(r)},setZoom:function(t){return this.zoomToPoint(new fabric.Point(0,0),t),this},absolutePan:function(t){var e=this.viewportTransform.slice(0);return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)},relativePan:function(t){return this.absolutePan(new fabric.Point(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(t){this.stateful&&t.setupState(),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added")},_onObjectRemoved:function(t){this.fire("object:removed",{target:t}),t.fire("removed"),delete t.canvas},clearContext:function(t){return t.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var t=this.contextContainer;return this.renderCanvas(t,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=fabric.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var t={},e=this.width,i=this.height,r=o(this.viewportTransform);return t.tl=s({x:0,y:0},r),t.br=s({x:e,y:i},r),t.tr=new fabric.Point(t.br.x,t.tl.y),t.bl=new fabric.Point(t.tl.x,t.br.y),this.vptCoords=t},cancelRequestedRender:function(){this.isRendering&&(fabric.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(t,e){var i=this.viewportTransform,r=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(t),fabric.util.setImageSmoothing(t,this.imageSmoothingEnabled),this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(t,e),t.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),r&&(r.canvas=this,r.shouldCache(),r._transformDone=!0,r.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t)),this._renderOverlay(t),this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),this.fire("after:render",{ctx:t})},drawClipPathOnCanvas:function(t){var e=this.viewportTransform,i=this.clipPath;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t.globalCompositeOperation="destination-in",i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},_renderObjects:function(t,e){var i,r;for(i=0,r=e.length;i<r;++i)e[i]&&e[i].render(t)},_renderBackgroundOrOverlay:function(t,e){var i=this[e+"Color"],r=this[e+"Image"],n=this.viewportTransform,s=this[e+"Vpt"];if(i||r){if(i){t.save(),t.beginPath(),t.moveTo(0,0),t.lineTo(this.width,0),t.lineTo(this.width,this.height),t.lineTo(0,this.height),t.closePath(),t.fillStyle=i.toLive?i.toLive(t,this):i,s&&t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),t.transform(1,0,0,1,i.offsetX||0,i.offsetY||0);var o=i.gradientTransform||i.patternTransform;o&&t.transform(o[0],o[1],o[2],o[3],o[4],o[5]),t.fill(),t.restore()}r&&(t.save(),s&&t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),r.render(t),t.restore())}},_renderBackground:function(t){this._renderBackgroundOrOverlay(t,"background")},_renderOverlay:function(t){this._renderBackgroundOrOverlay(t,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new fabric.Point(this.width/2,this.height/2)},centerObjectH:function(t){return this._centerObject(t,new fabric.Point(this.getCenterPoint().x,t.getCenterPoint().y))},centerObjectV:function(t){return this._centerObject(t,new fabric.Point(t.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(t){var e=this.getCenterPoint();return this._centerObject(t,e)},viewportCenterObject:function(t){var e=this.getVpCenter();return this._centerObject(t,e)},viewportCenterObjectH:function(t){var e=this.getVpCenter();return this._centerObject(t,new fabric.Point(e.x,t.getCenterPoint().y)),this},viewportCenterObjectV:function(t){var e=this.getVpCenter();return this._centerObject(t,new fabric.Point(t.getCenterPoint().x,e.y))},getVpCenter:function(){var t=this.getCenterPoint(),e=o(this.viewportTransform);return s(t,e)},_centerObject:function(t,e){return t.setPositionByOrigin(e,"center","center"),t.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(t){return this.toDatalessObject(t)},toObject:function(t){return this._toObjectMethod("toObject",t)},toDatalessObject:function(t){return this._toObjectMethod("toDatalessObject",t)},_toObjectMethod:function(t,e){var i=this.clipPath,r={version:fabric.version,objects:this._toObjects(t,e)};return i&&!i.excludeFromExport&&(r.clipPath=this._toObject(this.clipPath,t,e)),n(r,this.__serializeBgOverlay(t,e)),fabric.util.populateWithProperties(this,r,e),r},_toObjects:function(e,i){return this._objects.filter(function(t){return!t.excludeFromExport}).map(function(t){return this._toObject(t,e,i)},this)},_toObject:function(t,e,i){var r;this.includeDefaultValues||(r=t.includeDefaultValues,t.includeDefaultValues=!1);var n=t[e](i);return this.includeDefaultValues||(t.includeDefaultValues=r),n},__serializeBgOverlay:function(t,e){var i={},r=this.backgroundImage,n=this.overlayImage,s=this.backgroundColor,o=this.overlayColor;return s&&s.toObject?s.excludeFromExport||(i.background=s.toObject(e)):s&&(i.background=s),o&&o.toObject?o.excludeFromExport||(i.overlay=o.toObject(e)):o&&(i.overlay=o),r&&!r.excludeFromExport&&(i.backgroundImage=this._toObject(r,t,e)),n&&!n.excludeFromExport&&(i.overlayImage=this._toObject(n,t,e)),i},svgViewportTransformation:!0,toSVG:function(t,e){t||(t={}),t.reviver=e;var i=[];return this._setSVGPreamble(i,t),this._setSVGHeader(i,t),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push("</svg>"),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('<?xml version="1.0" encoding="',e.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(t,e){var i,r=e.width||this.width,n=e.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',o=fabric.Object.NUM_FRACTION_DIGITS;e.viewBox?s='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,s='viewBox="'+a(-i[4]/i[0],o)+" "+a(-i[5]/i[3],o)+" "+a(this.width/i[0],o)+" "+a(this.height/i[3],o)+'" '),t.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',r,'" ','height="',n,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",fabric.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"</defs>\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+fabric.Object.__uid++,'<clipPath id="'+e.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(t.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var s=this;return["background","overlay"].map(function(t){var e=s[t+"Color"];if(e&&e.toLive){var i=s[t+"Vpt"],r=s.viewportTransform,n={width:s.width/(i?r[0]:1),height:s.height/(i?r[3]:1)};return e.toSVG(n,{additionalTransform:i?fabric.util.matrixToSVG(r):""})}}).join("")},createSVGFontFacesMarkup:function(){var t,e,i,r,n,s,o,a,c="",h={},l=fabric.fontPaths,u=[];for(this._objects.forEach(function t(e){u.push(e),e._objects&&e._objects.forEach(t)}),o=0,a=u.length;o<a;o++)if(e=(t=u[o]).fontFamily,-1!==t.type.indexOf("text")&&!h[e]&&l[e]&&(h[e]=!0,t.styles))for(n in i=t.styles)for(s in r=i[n])!h[e=r[s].fontFamily]&&l[e]&&(h[e]=!0);for(var f in h)c+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",l[f],"');\n","\t\t}\n"].join("");return c&&(c=['\t<style type="text/css">',"<![CDATA[\n",c,"]]>","</style>\n"].join("")),c},_setSVGObjects:function(t,e){var i,r,n,s=this._objects;for(r=0,n=s.length;r<n;r++)(i=s[r]).excludeFromExport||this._setSVGObject(t,i,e)},_setSVGObject:function(t,e,i){t.push(e.toSVG(i))},_setSVGBgOverlayImage:function(t,e,i){this[e]&&!this[e].excludeFromExport&&this[e].toSVG&&t.push(this[e].toSVG(i))},_setSVGBgOverlayColor:function(t,e){var i=this[e+"Color"],r=this.viewportTransform,n=this.width,s=this.height;if(i)if(i.toLive){var o=i.repeat,a=fabric.util.invertTransform(r),c=this[e+"Vpt"]?fabric.util.matrixToSVG(a):"";t.push('<rect transform="'+c+" translate(",n/2,",",s/2,')"',' x="',i.offsetX-n/2,'" y="',i.offsetY-s/2,'" ','width="',"repeat-y"===o||"no-repeat"===o?i.source.width:n,'" height="',"repeat-x"===o||"no-repeat"===o?i.source.height:s,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else t.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',i,'"',"></rect>\n")},sendToBack:function(t){if(!t)return this;var e,i,r,n=this._activeObject;if(t===n&&"activeSelection"===t.type)for(e=(r=n._objects).length;e--;)i=r[e],h(this._objects,i),this._objects.unshift(i);else h(this._objects,t),this._objects.unshift(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(t){if(!t)return this;var e,i,r,n=this._activeObject;if(t===n&&"activeSelection"===t.type)for(r=n._objects,e=0;e<r.length;e++)i=r[e],h(this._objects,i),this._objects.push(i);else h(this._objects,t),this._objects.push(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(t,e){if(!t)return this;var i,r,n,s,o,a=this._activeObject,c=0;if(t===a&&"activeSelection"===t.type)for(o=a._objects,i=0;i<o.length;i++)r=o[i],0+c<(n=this._objects.indexOf(r))&&(s=n-1,h(this._objects,r),this._objects.splice(s,0,r)),c++;else 0!==(n=this._objects.indexOf(t))&&(s=this._findNewLowerIndex(t,n,e),h(this._objects,t),this._objects.splice(s,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(t,e,i){var r,n;if(i)for(n=(r=e)-1;0<=n;--n){if(t.intersectsWithObject(this._objects[n])||t.isContainedWithinObject(this._objects[n])||this._objects[n].isContainedWithinObject(t)){r=n;break}}else r=e-1;return r},bringForward:function(t,e){if(!t)return this;var i,r,n,s,o,a=this._activeObject,c=0;if(t===a&&"activeSelection"===t.type)for(i=(o=a._objects).length;i--;)r=o[i],(n=this._objects.indexOf(r))<this._objects.length-1-c&&(s=n+1,h(this._objects,r),this._objects.splice(s,0,r)),c++;else(n=this._objects.indexOf(t))!==this._objects.length-1&&(s=this._findNewUpperIndex(t,n,e),h(this._objects,t),this._objects.splice(s,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(t,e,i){var r,n,s;if(i)for(n=(r=e)+1,s=this._objects.length;n<s;++n){if(t.intersectsWithObject(this._objects[n])||t.isContainedWithinObject(this._objects[n])||this._objects[n].isContainedWithinObject(t)){r=n;break}}else r=e+1;return r},moveTo:function(t,e){return h(this._objects,t),this._objects.splice(e,0,t),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(fabric.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(t){t.dispose&&t.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),fabric.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),fabric.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),n(fabric.StaticCanvas.prototype,fabric.Observable),n(fabric.StaticCanvas.prototype,fabric.Collection),n(fabric.StaticCanvas.prototype,fabric.DataURLExporter),n(fabric.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=r();if(!e||!e.getContext)return null;var i=e.getContext("2d");if(!i)return null;switch(t){case"setLineDash":return void 0!==i.setLineDash;default:return null}}}),fabric.StaticCanvas.prototype.toJSON=fabric.StaticCanvas.prototype.toObject,fabric.isLikelyNode&&(fabric.StaticCanvas.prototype.createPNGStream=function(){var t=i(this.lowerCanvasEl);return t&&t.createPNGStream()},fabric.StaticCanvas.prototype.createJPEGStream=function(t){var e=i(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}}(),fabric.BaseBrush=fabric.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(t){t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(t){var e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},_setShadow:function(){if(this.shadow){var t=this.canvas,e=this.shadow,i=t.contextTop,r=t.getZoom();t&&t._isRetinaScaling()&&(r*=fabric.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*r,i.shadowOffsetX=e.offsetX*r,i.shadowOffsetY=e.offsetY*r}},needsFullRender:function(){return new fabric.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0},_isOutSideCanvas:function(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}}),fabric.PencilBrush=fabric.util.createClass(fabric.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(t){this.canvas=t,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(t,e,i){var r=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,r.x,r.y),r},onMouseDown:function(t,e){this.canvas._isMainEvent(e.e)&&(this.drawStraightLine=e.e[this.straightLineKey],this._prepareForDrawing(t),this._captureDrawingPath(t),this._render())},onMouseMove:function(t,e){if(this.canvas._isMainEvent(e.e)&&(this.drawStraightLine=e.e[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._captureDrawingPath(t)&&1<this._points.length))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,r=i.length,n=this.canvas.contextTop;this._saveAndTransform(n),this.oldEnd&&(n.beginPath(),n.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(n,i[r-2],i[r-1],!0),n.stroke(),n.restore()}},onMouseUp:function(t){return!this.canvas._isMainEvent(t.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(t){var e=new fabric.Point(t.x,t.y);this._reset(),this._addPoint(e),this.canvas.contextTop.moveTo(e.x,e.y)},_addPoint:function(t){return!(1<this._points.length&&t.eq(this._points[this._points.length-1])||(this.drawStraightLine&&1<this._points.length&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(t),0))},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(t){var e=new fabric.Point(t.x,t.y);return this._addPoint(e)},_render:function(t){var e,i,r=this._points[0],n=this._points[1];if(t=t||this.canvas.contextTop,this._saveAndTransform(t),t.beginPath(),2===this._points.length&&r.x===n.x&&r.y===n.y){var s=this.width/1e3;r=new fabric.Point(r.x,r.y),n=new fabric.Point(n.x,n.y),r.x-=s,n.x+=s}for(t.moveTo(r.x,r.y),e=1,i=this._points.length;e<i;e++)this._drawSegment(t,r,n),r=this._points[e],n=this._points[e+1];t.lineTo(r.x,r.y),t.stroke(),t.restore()},convertPointsToSVGPath:function(t){var e=this.width/1e3;return fabric.util.getSmoothPathFromPoints(t,e)},_isEmptySVGPath:function(t){return"M 0 0 Q 0 0 0 0 L 0 0"===fabric.util.joinPath(t)},createPath:function(t){var e=new fabric.Path(t,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,e.shadow=new fabric.Shadow(this.shadow)),e},decimatePoints:function(t,e){if(t.length<=2)return t;var i,r=this.canvas.getZoom(),n=Math.pow(e/r,2),s=t.length-1,o=t[0],a=[o];for(i=1;i<s-1;i++)n<=Math.pow(o.x-t[i].x,2)+Math.pow(o.y-t[i].y,2)&&(o=t[i],a.push(o));return a.push(t[s]),a},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var t=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(t))this.canvas.requestRenderAll();else{var e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:e}),this.canvas.add(e),this.canvas.requestRenderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}}}),fabric.CircleBrush=fabric.util.createClass(fabric.BaseBrush,{width:10,initialize:function(t){this.canvas=t,this.points=[]},drawDot:function(t){var e=this.addPoint(t),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,e),i.restore()},dot:function(t,e){t.fillStyle=e.fill,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!1),t.closePath(),t.fill()},onMouseDown:function(t){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(t)},_render:function(){var t,e,i=this.canvas.contextTop,r=this.points;for(this._saveAndTransform(i),t=0,e=r.length;t<e;t++)this.dot(i,r[t]);i.restore()},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(t),this._render()):this.drawDot(t))},onMouseUp:function(){var t,e,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var r=[];for(t=0,e=this.points.length;t<e;t++){var n=this.points[t],s=new fabric.Circle({radius:n.radius,left:n.x,top:n.y,originX:"center",originY:"center",fill:n.fill});this.shadow&&(s.shadow=new fabric.Shadow(this.shadow)),r.push(s)}var o=new fabric.Group(r);o.canvas=this.canvas,this.canvas.fire("before:path:created",{path:o}),this.canvas.add(o),this.canvas.fire("path:created",{path:o}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(t){var e=new fabric.Point(t.x,t.y),i=fabric.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,r=new fabric.Color(this.color).setAlpha(fabric.util.getRandomInt(0,100)/100).toRgba();return e.radius=i,e.fill=r,this.points.push(e),e}}),fabric.SprayBrush=fabric.util.createClass(fabric.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(t){this.canvas=t,this.sprayChunks=[]},onMouseDown:function(t){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(t),this.render(this.sprayChunkPoints)},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.addSprayChunk(t),this.render(this.sprayChunkPoints))},onMouseUp:function(){var t=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var e=[],i=0,r=this.sprayChunks.length;i<r;i++)for(var n=this.sprayChunks[i],s=0,o=n.length;s<o;s++){var a=new fabric.Rect({width:n[s].width,height:n[s].width,left:n[s].x+1,top:n[s].y+1,originX:"center",originY:"center",fill:this.color});e.push(a)}this.optimizeOverlapping&&(e=this._getOptimizedRects(e));var c=new fabric.Group(e);this.shadow&&c.set("shadow",new fabric.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:c}),this.canvas.add(c),this.canvas.fire("path:created",{path:c}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=t,this.canvas.requestRenderAll()},_getOptimizedRects:function(t){var e,i,r,n={};for(i=0,r=t.length;i<r;i++)n[e=t[i].left+""+t[i].top]||(n[e]=t[i]);var s=[];for(e in n)s.push(n[e]);return s},render:function(t){var e,i,r=this.canvas.contextTop;for(r.fillStyle=this.color,this._saveAndTransform(r),e=0,i=t.length;e<i;e++){var n=t[e];void 0!==n.opacity&&(r.globalAlpha=n.opacity),r.fillRect(n.x,n.y,n.width,n.width)}r.restore()},_render:function(){var t,e,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),t=0,e=this.sprayChunks.length;t<e;t++)this.render(this.sprayChunks[t]);i.restore()},addSprayChunk:function(t){this.sprayChunkPoints=[];var e,i,r,n,s=this.width/2;for(n=0;n<this.density;n++){e=fabric.util.getRandomInt(t.x-s,t.x+s),i=fabric.util.getRandomInt(t.y-s,t.y+s),r=this.dotWidthVariance?fabric.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var o=new fabric.Point(e,i);o.width=r,this.randomOpacity&&(o.opacity=fabric.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(o)}this.sprayChunks.push(this.sprayChunkPoints)}}),fabric.PatternBrush=fabric.util.createClass(fabric.PencilBrush,{getPatternSrc:function(){var t=fabric.util.createCanvasElement(),e=t.getContext("2d");return t.width=t.height=25,e.fillStyle=this.color,e.beginPath(),e.arc(10,10,10,0,2*Math.PI,!1),e.closePath(),e.fill(),t},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(t){return t.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(t){this.callSuper("_setBrushStyles",t),t.strokeStyle=this.getPattern(t)},createPath:function(t){var e=this.callSuper("createPath",t),i=e._getLeftTopCoords().scalarAdd(e.strokeWidth/2);return e.stroke=new fabric.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),e}}),function(){var h=fabric.util.getPointer,u=fabric.util.degreesToRadians,l=fabric.util.isTouchEvent;for(var t in fabric.Canvas=fabric.util.createClass(fabric.StaticCanvas,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=fabric.PencilBrush&&new fabric.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var t,e,i,r=this.getActiveObjects();if(0<r.length&&!this.preserveObjectStacking){e=[],i=[];for(var n=0,s=this._objects.length;n<s;n++)t=this._objects[n],-1===r.indexOf(t)?e.push(t):i.push(t);1<r.length&&(this._activeObject._objects=i),e.push.apply(e,i)}else e=this._objects;return e},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this},_normalizePointer:function(t,e){var i=t.calcTransformMatrix(),r=fabric.util.invertTransform(i),n=this.restorePointerVpt(e);return fabric.util.transformPoint(n,r)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject){var r=this._normalizePointer(t,{x:e,y:i}),n=Math.max(t.cacheTranslationX+r.x*t.zoomX,0),s=Math.max(t.cacheTranslationY+r.y*t.zoomY,0);return fabric.util.isTransparent(t._cacheContext,Math.round(n),Math.round(s),this.targetFindTolerance)}var o=this.contextCache,a=t.selectionBackgroundColor,c=this.viewportTransform;return t.selectionBackgroundColor="",this.clearContext(o),o.save(),o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),t.render(o),o.restore(),t.selectionBackgroundColor=a,fabric.util.isTransparent(o,e,i,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return!0===e[t]}):e[this.selectionKey]},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),r=this._activeObject;return!e||e&&r&&1<i.length&&-1===i.indexOf(e)&&r!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&r&&r!==e},_shouldCenterTransform:function(t,e,i){var r;if(t)return"scale"===e||"scaleX"===e||"scaleY"===e||"resizing"===e?r=this.centeredScaling||t.centeredScaling:"rotate"===e&&(r=this.centeredRotation||t.centeredRotation),r?!i:i},_getOriginFromCorner:function(t,e){var i={x:t.originX,y:t.originY};return"ml"===e||"tl"===e||"bl"===e?i.x="right":"mr"!==e&&"tr"!==e&&"br"!==e||(i.x="left"),"tl"===e||"mt"===e||"tr"===e?i.y="bottom":"bl"!==e&&"mb"!==e&&"br"!==e||(i.y="top"),i},_getActionFromCorner:function(t,e,i,r){if(!e||!t)return"drag";var n=r.controls[e];return n.getActionName(i,n,r)},_setupCurrentTransform:function(t,e,i){if(e){var r=this.getPointer(t),n=e.__corner,s=e.controls[n],o=i&&n?s.getActionHandler(t,e,s):fabric.controlsUtils.dragHandler,a=this._getActionFromCorner(i,n,t,e),c=this._getOriginFromCorner(e,n),h=t[this.centeredKey],l={target:e,action:a,actionHandler:o,corner:n,scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,offsetX:r.x-e.left,offsetY:r.y-e.top,originX:c.x,originY:c.y,ex:r.x,ey:r.y,lastX:r.x,lastY:r.y,theta:u(e.angle),width:e.width*e.scaleX,shiftKey:t.shiftKey,altKey:h,original:fabric.util.saveObjectTransform(e)};this._shouldCenterTransform(e,a,h)&&(l.originX="center",l.originY="center"),l.original.originX=c.x,l.original.originY=c.y,this._currentTransform=l,this._beforeTransform(t)}},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new fabric.Point(e.ex,e.ey),r=fabric.util.transformPoint(i,this.viewportTransform),n=new fabric.Point(e.ex+e.left,e.ey+e.top),s=fabric.util.transformPoint(n,this.viewportTransform),o=Math.min(r.x,s.x),a=Math.min(r.y,s.y),c=Math.max(r.x,s.x),h=Math.max(r.y,s.y),l=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(o,a,c-o,h-a)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,o+=l,a+=l,c-=l,h-=l,fabric.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(o,a,c-o,h-a))},findTarget:function(t,e){if(!this.skipTargetFind){var i,r,n=this.getPointer(t,!0),s=this._activeObject,o=this.getActiveObjects(),a=l(t),c=1<o.length&&!e||1===o.length;if(this.targets=[],c&&s._findTargetCorner(n,a))return s;if(1<o.length&&!e&&s===this._searchPossibleTargets([s],n))return s;if(1===o.length&&s===this._searchPossibleTargets([s],n)){if(!this.preserveObjectStacking)return s;i=s,r=this.targets,this.targets=[]}var h=this._searchPossibleTargets(this._objects,n);return t[this.altSelectionKey]&&h&&i&&h!==i&&(h=i,this.targets=r),h}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t)){if(!this.perPixelTargetFind&&!e.perPixelTargetFind||e.isEditing)return!0;if(!this.isTargetTransparent(e,i.x,i.y))return!0}},_searchPossibleTargets:function(t,e){for(var i,r,n=t.length;n--;){var s=t[n],o=s.group?this._normalizePointer(s.group,e):e;if(this._checkTarget(o,s,e)){(i=t[n]).subTargetCheck&&i instanceof fabric.Group&&(r=this._searchPossibleTargets(i._objects,e))&&this.targets.push(r);break}}return i},restorePointerVpt:function(t){return fabric.util.transformPoint(t,fabric.util.invertTransform(this.viewportTransform))},getPointer:function(t,e){if(this._absolutePointer&&!e)return this._absolutePointer;if(this._pointer&&e)return this._pointer;var i,r=h(t),n=this.upperCanvasEl,s=n.getBoundingClientRect(),o=s.width||0,a=s.height||0;o&&a||("top"in s&&"bottom"in s&&(a=Math.abs(s.top-s.bottom)),"right"in s&&"left"in s&&(o=Math.abs(s.right-s.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,e||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),i=0===o||0===a?{width:1,height:1}:{width:n.width/o,height:n.height/a},{x:r.x*i.width,y:r.y*i.height}},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),e=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),fabric.util.addClass(i,"upper-canvas "+t),this.wrapperEl.appendChild(i),this._copyCanvasStyle(e,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=fabric.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),fabric.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),fabric.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;fabric.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,fabric.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var t=this._activeObject;return t?"activeSelection"===t.type&&t._objects?t._objects.slice(0):[t]:[]},_onObjectRemoved:function(t){t===this._activeObject&&(this.fire("before:selection:cleared",{target:t}),this._discardActiveObject(),this.fire("selection:cleared",{target:t}),t.fire("deselected")),t===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(e,i){var r=!1,n=this.getActiveObjects(),s=[],o=[];e.forEach(function(t){-1===n.indexOf(t)&&(r=!0,t.fire("deselected",{e:i,target:t}),o.push(t))}),n.forEach(function(t){-1===e.indexOf(t)&&(r=!0,t.fire("selected",{e:i,target:t}),s.push(t))}),0<e.length&&0<n.length?r&&this.fire("selection:updated",{e:i,selected:s,deselected:o}):0<n.length?this.fire("selection:created",{e:i,selected:s}):0<e.length&&this.fire("selection:cleared",{e:i,deselected:o})},setActiveObject:function(t,e){var i=this.getActiveObjects();return this._setActiveObject(t,e),this._fireSelectionEvents(i,e),this},_setActiveObject:function(t,e){return this._activeObject!==t&&(!!this._discardActiveObject(e,t)&&(!t.onSelect({e:e})&&(this._activeObject=t,!0)))},_discardActiveObject:function(t,e){var i=this._activeObject;if(i){if(i.onDeselect({e:t,object:e}))return!1;this._activeObject=null}return!0},discardActiveObject:function(t){var e=this.getActiveObjects(),i=this.getActiveObject();return e.length&&this.fire("before:selection:cleared",{target:i,e:t}),this._discardActiveObject(t),this._fireSelectionEvents(e,t),this},dispose:function(){var t=this.wrapperEl;return this.removeListeners(),t.removeChild(this.upperCanvasEl),t.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(t){fabric.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,fabric.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(t){var e=this._activeObject;e&&e._renderControls(t)},_toObject:function(t,e,i){var r=this._realizeGroupTransformOnObject(t),n=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,r),n},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var i={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(t){i[t]=e[t]}),fabric.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),i}return null},_unwindGroupTransformOnObject:function(t,e){e&&t.set(e)},_setSVGObject:function(t,e,i){var r=this._realizeGroupTransformOnObject(e);this.callSuper("_setSVGObject",t,e,i),this._unwindGroupTransformOnObject(e,r)},setViewportTransform:function(t){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),fabric.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),fabric.StaticCanvas)"prototype"!==t&&(fabric.Canvas[t]=fabric.StaticCanvas[t])}(),function(){var r=fabric.util.addListener,n=fabric.util.removeListener,s={passive:!1};function d(t,e){return t.button&&t.button===e-1}fabric.util.object.extend(fabric.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(r,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(t,e){var i=this.upperCanvasEl,r=this._getEventPrefix();t(fabric.window,"resize",this._onResize),t(i,r+"down",this._onMouseDown),t(i,r+"move",this._onMouseMove,s),t(i,r+"out",this._onMouseOut),t(i,r+"enter",this._onMouseEnter),t(i,"wheel",this._onMouseWheel),t(i,"contextmenu",this._onContextMenu),t(i,"dblclick",this._onDoubleClick),t(i,"dragover",this._onDragOver),t(i,"dragenter",this._onDragEnter),t(i,"dragleave",this._onDragLeave),t(i,"drop",this._onDrop),this.enablePointerEvents||t(i,"touchstart",this._onTouchStart,s),"undefined"!=typeof eventjs&&e in eventjs&&(eventjs[e](i,"gesture",this._onGesture),eventjs[e](i,"drag",this._onDrag),eventjs[e](i,"orientation",this._onOrientationChange),eventjs[e](i,"shake",this._onShake),eventjs[e](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(n,"remove");var t=this._getEventPrefix();n(fabric.document,t+"up",this._onMouseUp),n(fabric.document,"touchend",this._onTouchEnd,s),n(fabric.document,t+"move",this._onMouseMove,s),n(fabric.document,"touchmove",this._onMouseMove,s)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(t,e){this.__onTransformGesture&&this.__onTransformGesture(t,e)},_onDrag:function(t,e){this.__onDrag&&this.__onDrag(t,e)},_onMouseWheel:function(t){this.__onMouseWheel(t)},_onMouseOut:function(e){var i=this._hoveredTarget;this.fire("mouse:out",{target:i,e:e}),this._hoveredTarget=null,i&&i.fire("mouseout",{e:e});var r=this;this._hoveredTargets.forEach(function(t){r.fire("mouse:out",{target:i,e:e}),t&&i.fire("mouseout",{e:e})}),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach(function(t){t.isEditing&&t.hiddenTextarea.focus()})},_onMouseEnter:function(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",{target:null,e:t}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(t,e){this.__onOrientationChange&&this.__onOrientationChange(t,e)},_onShake:function(t,e){this.__onShake&&this.__onShake(t,e)},_onLongPress:function(t,e){this.__onLongPress&&this.__onLongPress(t,e)},_onDragOver:function(t){t.preventDefault();var e=this._simpleEventHandler("dragover",t);this._fireEnterLeaveEvents(e,t)},_onDrop:function(t){return this._simpleEventHandler("drop:before",t),this._simpleEventHandler("drop",t)},_onContextMenu:function(t){return this.stopContextMenu&&(t.stopPropagation(),t.preventDefault()),!1},_onDoubleClick:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"dblclick"),this._resetTransformEventData(t)},getPointerId:function(t){var e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1},_isMainEvent:function(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||(!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(t){t.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(t)),this.__onMouseDown(t),this._resetTransformEventData();var e=this.upperCanvasEl,i=this._getEventPrefix();r(fabric.document,"touchend",this._onTouchEnd,s),r(fabric.document,"touchmove",this._onMouseMove,s),n(e,i+"down",this._onMouseDown)},_onMouseDown:function(t){this.__onMouseDown(t),this._resetTransformEventData();var e=this.upperCanvasEl,i=this._getEventPrefix();n(e,i+"move",this._onMouseMove,s),r(fabric.document,i+"up",this._onMouseUp),r(fabric.document,i+"move",this._onMouseMove,s)},_onTouchEnd:function(t){if(!(0<t.touches.length)){this.__onMouseUp(t),this._resetTransformEventData(),this.mainTouchId=null;var e=this._getEventPrefix();n(fabric.document,"touchend",this._onTouchEnd,s),n(fabric.document,"touchmove",this._onMouseMove,s);var i=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){r(i.upperCanvasEl,e+"down",i._onMouseDown),i._willAddMouseDown=0},400)}},_onMouseUp:function(t){this.__onMouseUp(t),this._resetTransformEventData();var e=this.upperCanvasEl,i=this._getEventPrefix();this._isMainEvent(t)&&(n(fabric.document,i+"up",this._onMouseUp),n(fabric.document,i+"move",this._onMouseMove,s),r(e,i+"move",this._onMouseMove,s))},_onMouseMove:function(t){!this.allowTouchScrolling&&t.preventDefault&&t.preventDefault(),this.__onMouseMove(t)},_onResize:function(){this.calcOffset()},_shouldRender:function(t){var e=this._activeObject;return!!(!!e!=!!t||e&&t&&e!==t)||(e&&e.isEditing,!1)},__onMouseUp:function(t){var e,i=this._currentTransform,r=this._groupSelector,n=!1,s=!r||0===r.left&&0===r.top;if(this._cacheTransformEventData(t),e=this._target,this._handleEvent(t,"up:before"),d(t,3))this.fireRightClick&&this._handleEvent(t,"up",3,s);else{if(d(t,2))return this.fireMiddleClick&&this._handleEvent(t,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(t);else if(this._isMainEvent(t)){if(i&&(this._finalizeCurrentTransform(t),n=i.actionPerformed),!s){var o=e===this._activeObject;this._maybeGroupObjects(t),n||(n=this._shouldRender(e)||!o&&e===this._activeObject)}var a,c;if(e){if(a=e._findTargetCorner(this.getPointer(t,!0),fabric.util.isTouchEvent(t)),e.selectable&&e!==this._activeObject&&"up"===e.activeOn)this.setActiveObject(e,t),n=!0;else{var h=e.controls[a],l=h&&h.getMouseUpHandler(t,e,h);l&&l(t,i,(c=this.getPointer(t)).x,c.y)}e.isMoving=!1}if(i&&(i.target!==e||i.corner!==a)){var u=i.target&&i.target.controls[i.corner],f=u&&u.getMouseUpHandler(t,e,h);c=c||this.getPointer(t),f&&f(t,i,c.x,c.y)}this._setCursorFromEvent(t,e),this._handleEvent(t,"up",1,s),this._groupSelector=null,this._currentTransform=null,e&&(e.__corner=0),n?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(t,e){var i=this.findTarget(e),r=this.targets,n={e:e,target:i,subTargets:r};if(this.fire(t,n),i&&i.fire(t,n),!r)return i;for(var s=0;s<r.length;s++)r[s].fire(t,n);return i},_handleEvent:function(t,e,i,r){var n=this._target,s=this.targets||[],o={e:t,target:n,subTargets:s,button:i||1,isClick:r||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===e&&(o.currentTarget=this.findTarget(t),o.currentSubTargets=this.targets),this.fire("mouse:"+e,o),n&&n.fire("mouse"+e,o);for(var a=0;a<s.length;a++)s[a].fire("mouse"+e,o)},_finalizeCurrentTransform:function(t){var e=this._currentTransform,i=e.target,r={e:t,target:i,transform:e,action:e.action};i._scaling&&(i._scaling=!1),i.setCoords(),(e.actionPerformed||this.stateful&&i.hasStateChanged())&&this._fire("modified",r)},_onMouseDownInDrawingMode:function(t){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(t).requestRenderAll();var e=this.getPointer(t);this.freeDrawingBrush.onMouseDown(e,{e:t,pointer:e}),this._handleEvent(t,"down")},_onMouseMoveInDrawingMode:function(t){if(this._isCurrentlyDrawing){var e=this.getPointer(t);this.freeDrawingBrush.onMouseMove(e,{e:t,pointer:e})}this.setCursor(this.freeDrawingCursor),this._handleEvent(t,"move")},_onMouseUpInDrawingMode:function(t){var e=this.getPointer(t);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:t,pointer:e}),this._handleEvent(t,"up")},__onMouseDown:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"down:before");var e=this._target;if(d(t,3))this.fireRightClick&&this._handleEvent(t,"down",3);else if(d(t,2))this.fireMiddleClick&&this._handleEvent(t,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(t);else if(this._isMainEvent(t)&&!this._currentTransform){var i=this._pointer;this._previousPointer=i;var r=this._shouldRender(e),n=this._shouldGroup(t,e);if(this._shouldClearSelection(t,e)?this.discardActiveObject(t):n&&(this._handleGrouping(t,e),e=this._activeObject),!this.selection||e&&(e.selectable||e.isEditing||e===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),e){var s=e===this._activeObject;e.selectable&&"down"===e.activeOn&&this.setActiveObject(e,t);var o=e._findTargetCorner(this.getPointer(t,!0),fabric.util.isTouchEvent(t));if(e.__corner=o,e===this._activeObject&&(o||!n)){this._setupCurrentTransform(t,e,s);var a=e.controls[o],c=(i=this.getPointer(t),a&&a.getMouseDownHandler(t,e,a));c&&c(t,this._currentTransform,i.x,i.y)}}this._handleEvent(t,"down"),(r||n)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(t){this._resetTransformEventData(),this._pointer=this.getPointer(t,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(t)||null},_beforeTransform:function(t){var e=this._currentTransform;this.stateful&&e.target.saveState(),this.fire("before:transform",{e:t,transform:e})},__onMouseMove:function(t){var e,i;if(this._handleEvent(t,"move:before"),this._cacheTransformEventData(t),this.isDrawingMode)this._onMouseMoveInDrawingMode(t);else if(this._isMainEvent(t)){var r=this._groupSelector;r?(i=this._absolutePointer,r.left=i.x-r.ex,r.top=i.y-r.ey,this.renderTop()):this._currentTransform?this._transformObject(t):(e=this.findTarget(t)||null,this._setCursorFromEvent(t,e),this._fireOverOutEvents(e,t)),this._handleEvent(t,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(t,e){var i=this._hoveredTarget,r=this._hoveredTargets,n=this.targets,s=Math.max(r.length,n.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var o=0;o<s;o++)this.fireSyntheticInOutEvents(n[o],e,{oldTarget:r[o],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=t,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(t,e){var i=this._draggedoverTarget,r=this._hoveredTargets,n=this.targets,s=Math.max(r.length,n.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var o=0;o<s;o++)this.fireSyntheticInOutEvents(n[o],e,{oldTarget:r[o],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=t},fireSyntheticInOutEvents:function(t,e,i){var r,n,s,o=i.oldTarget,a=o!==t,c=i.canvasEvtIn,h=i.canvasEvtOut;a&&(r={e:e,target:t,previousTarget:o},n={e:e,target:o,nextTarget:t}),s=t&&a,o&&a&&(h&&this.fire(h,n),o.fire(i.evtOut,n)),s&&(c&&this.fire(c,r),t.fire(i.evtIn,r))},__onMouseWheel:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"wheel"),this._resetTransformEventData()},_transformObject:function(t){var e=this.getPointer(t),i=this._currentTransform;i.reset=!1,i.shiftKey=t.shiftKey,i.altKey=t[this.centeredKey],this._performTransformAction(t,i,e),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(t,e,i){var r=i.x,n=i.y,s=e.action,o=!1,a=e.actionHandler;a&&(o=a(t,e,r,n)),"drag"===s&&o&&(e.target.isMoving=!0,this.setCursor(e.target.moveCursor||this.moveCursor)),e.actionPerformed=e.actionPerformed||o},_fire:fabric.controlsUtils.fireEvent,_setCursorFromEvent:function(t,e){if(!e)return this.setCursor(this.defaultCursor),!1;var i=e.hoverCursor||this.hoverCursor,r=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,n=(!r||!r.contains(e))&&e._findTargetCorner(this.getPointer(t,!0));n?this.setCursor(this.getCornerCursor(n,e,t)):(e.subTargetCheck&&this.targets.concat().reverse().map(function(t){i=t.hoverCursor||i}),this.setCursor(i))},getCornerCursor:function(t,e,i){var r=e.controls[t];return r.cursorStyleHandler(i,r,e)}})}(),function(){var f=Math.min,d=Math.max;fabric.util.object.extend(fabric.Canvas.prototype,{_shouldGroup:function(t,e){var i=this._activeObject;return i&&this._isSelectionKeyPressed(t)&&e&&e.selectable&&this.selection&&(i!==e||"activeSelection"===i.type)&&!e.onSelect({e:t})},_handleGrouping:function(t,e){var i=this._activeObject;i.__corner||(e!==i||(e=this.findTarget(t,!0))&&e.selectable)&&(i&&"activeSelection"===i.type?this._updateActiveSelection(e,t):this._createActiveSelection(e,t))},_updateActiveSelection:function(t,e){var i=this._activeObject,r=i._objects.slice(0);i.contains(t)?(i.removeWithUpdate(t),this._hoveredTarget=t,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),e)):(i.addWithUpdate(t),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(r,e)},_createActiveSelection:function(t,e){var i=this.getActiveObjects(),r=this._createGroup(t);this._hoveredTarget=r,this._setActiveObject(r,e),this._fireSelectionEvents(i,e)},_createGroup:function(t){var e=this._objects,i=e.indexOf(this._activeObject)<e.indexOf(t)?[this._activeObject,t]:[t,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new fabric.ActiveSelection(i,{canvas:this})},_groupSelectedObjects:function(t){var e,i=this._collectObjects(t);1===i.length?this.setActiveObject(i[0],t):1<i.length&&(e=new fabric.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(e){for(var t,i=[],r=this._groupSelector.ex,n=this._groupSelector.ey,s=r+this._groupSelector.left,o=n+this._groupSelector.top,a=new fabric.Point(f(r,s),f(n,o)),c=new fabric.Point(d(r,s),d(n,o)),h=!this.selectionFullyContained,l=r===s&&n===o,u=this._objects.length;u--&&!((t=this._objects[u])&&t.selectable&&t.visible&&(h&&t.intersectsWithRect(a,c,!0)||t.isContainedWithinRect(a,c,!0)||h&&t.containsPoint(a,null,!0)||h&&t.containsPoint(c,null,!0))&&(i.push(t),l)););return 1<i.length&&(i=i.filter(function(t){return!t.onSelect({e:e})})),i},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),fabric.util.object.extend(fabric.StaticCanvas.prototype,{toDataURL:function(t){t||(t={});var e=t.format||"png",i=t.quality||1,r=(t.multiplier||1)*(t.enableRetinaScaling?this.getRetinaScaling():1),n=this.toCanvasElement(r,t);return fabric.util.toDataURL(n,e,i)},toCanvasElement:function(t,e){t=t||1;var i=((e=e||{}).width||this.width)*t,r=(e.height||this.height)*t,n=this.getZoom(),s=this.width,o=this.height,a=n*t,c=this.viewportTransform,h=(c[4]-(e.left||0))*t,l=(c[5]-(e.top||0))*t,u=this.interactive,f=[a,0,0,a,h,l],d=this.enableRetinaScaling,g=fabric.util.createCanvasElement(),p=this.contextTop;return g.width=i,g.height=r,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=i,this.height=r,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=c,this.width=s,this.height=o,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=d,this.contextTop=p,g}}),fabric.util.object.extend(fabric.StaticCanvas.prototype,{loadFromJSON:function(t,i,e){if(t){var r="string"==typeof t?JSON.parse(t):fabric.util.object.clone(t),n=this,s=r.clipPath,o=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete r.clipPath,this._enlivenObjects(r.objects,function(e){n.clear(),n._setBgOverlay(r,function(){s?n._enlivenObjects([s],function(t){n.clipPath=t[0],n.__setupCanvas.call(n,r,e,o,i)}):n.__setupCanvas.call(n,r,e,o,i)})},e),this}},__setupCanvas:function(t,e,i,r){var n=this;e.forEach(function(t,e){n.insertAt(t,e)}),this.renderOnAddRemove=i,delete t.objects,delete t.backgroundImage,delete t.overlayImage,delete t.background,delete t.overlay,this._setOptions(t),this.renderAll(),r&&r()},_setBgOverlay:function(t,e){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(t.backgroundImage||t.overlayImage||t.background||t.overlay){var r=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&e&&e()};this.__setBgOverlay("backgroundImage",t.backgroundImage,i,r),this.__setBgOverlay("overlayImage",t.overlayImage,i,r),this.__setBgOverlay("backgroundColor",t.background,i,r),this.__setBgOverlay("overlayColor",t.overlay,i,r)}else e&&e()},__setBgOverlay:function(e,t,i,r){var n=this;if(!t)return i[e]=!0,void(r&&r());"backgroundImage"===e||"overlayImage"===e?fabric.util.enlivenObjects([t],function(t){n[e]=t[0],i[e]=!0,r&&r()}):this["set"+fabric.util.string.capitalize(e,!0)](t,function(){i[e]=!0,r&&r()})},_enlivenObjects:function(t,e,i){t&&0!==t.length?fabric.util.enlivenObjects(t,function(t){e&&e(t)},null,i):e&&e([])},_toDataURL:function(e,i){this.clone(function(t){i(t.toDataURL(e))})},_toDataURLWithMultiplier:function(e,i,r){this.clone(function(t){r(t.toDataURLWithMultiplier(e,i))})},clone:function(e,t){var i=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(i,function(){e&&e(t)})})},cloneWithoutData:function(t){var e=fabric.util.createCanvasElement();e.width=this.width,e.height=this.height;var i=new fabric.Canvas(e);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,function(){i.renderAll(),t&&t(i)}),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):t&&t(i)}}),function(t){"use strict";var x=t.fabric||(t.fabric={}),e=x.util.object.extend,s=x.util.object.clone,r=x.util.toFixed,i=x.util.string.capitalize,a=x.util.degreesToRadians,n=!x.isLikelyNode;x.Object||(x.Object=x.util.createClass(x.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:n,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(t){t&&this.setOptions(t)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=x.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(t){var e=x.perfLimitSizeTotal,i=t.width,r=t.height,n=x.maxCacheSideLimit,s=x.minCacheSideLimit;if(i<=n&&r<=n&&i*r<=e)return i<s&&(t.width=s),r<s&&(t.height=s),t;var o=i/r,a=x.util.limitDimsByArea(o,e),c=x.util.capValue,h=c(s,a.x,n),l=c(s,a.y,n);return h<i&&(t.zoomX/=i/h,t.width=h,t.capped=!0),l<r&&(t.zoomY/=r/l,t.height=l,t.capped=!0),t},_getCacheCanvasDimensions:function(){var t=this.getTotalObjectScaling(),e=this._getTransformedDimensions(0,0),i=e.x*t.scaleX/this.scaleX,r=e.y*t.scaleY/this.scaleY;return{width:i+2,height:r+2,zoomX:t.scaleX,zoomY:t.scaleY,x:i,y:r}},_updateCacheCanvas:function(){var t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){var e=t._currentTransform.target,i=t._currentTransform.action;if(this===e&&i.slice&&"scale"===i.slice(0,5))return!1}var r,n,s=this._cacheCanvas,o=this._limitCacheSize(this._getCacheCanvasDimensions()),a=x.minCacheSideLimit,c=o.width,h=o.height,l=o.zoomX,u=o.zoomY,f=c!==this.cacheWidth||h!==this.cacheHeight,d=this.zoomX!==l||this.zoomY!==u,g=f||d,p=0,v=0,m=!1;if(f){var b=this._cacheCanvas.width,y=this._cacheCanvas.height,_=b<c||y<h;m=_||(c<.9*b||h<.9*y)&&a<b&&a<y,_&&!o.capped&&(a<c||a<h)&&(p=.1*c,v=.1*h)}return this instanceof x.Text&&this.path&&(m=g=!0,p+=this.getHeightOfLine(0)*this.zoomX,v+=this.getHeightOfLine(0)*this.zoomY),!!g&&(m?(s.width=Math.ceil(c+p),s.height=Math.ceil(h+v)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,s.width,s.height)),r=o.x/2,n=o.y/2,this.cacheTranslationX=Math.round(s.width/2-r)+r,this.cacheTranslationY=Math.round(s.height/2-n)+n,this.cacheWidth=c,this.cacheHeight=h,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(l,u),this.zoomX=l,this.zoomY=u,!0)},setOptions:function(t){this._setOptions(t),this._initGradient(t.fill,"fill"),this._initGradient(t.stroke,"stroke"),this._initPattern(t.fill,"fill"),this._initPattern(t.stroke,"stroke")},transform:function(t){var e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,i=this.calcTransformMatrix(!e);t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(t){var e=x.Object.NUM_FRACTION_DIGITS,i={type:this.type,version:x.version,originX:this.originX,originY:this.originY,left:r(this.left,e),top:r(this.top,e),width:r(this.width,e),height:r(this.height,e),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,e),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,e),scaleX:r(this.scaleX,e),scaleY:r(this.scaleY,e),angle:r(this.angle,e),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,e),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,e),skewY:r(this.skewY,e)};return this.clipPath&&!this.clipPath.excludeFromExport&&(i.clipPath=this.clipPath.toObject(t),i.clipPath.inverted=this.clipPath.inverted,i.clipPath.absolutePositioned=this.clipPath.absolutePositioned),x.util.populateWithProperties(this,i,t),this.includeDefaultValues||(i=this._removeDefaultValues(i)),i},toDatalessObject:function(t){return this.toObject(t)},_removeDefaultValues:function(e){var i=x.util.getKlass(e.type).prototype;return i.stateProperties.forEach(function(t){"left"!==t&&"top"!==t&&(e[t]===i[t]&&delete e[t],Array.isArray(e[t])&&Array.isArray(i[t])&&0===e[t].length&&0===i[t].length&&delete e[t])}),e},toString:function(){return"#<fabric."+i(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var t=x.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(t.scaleX),scaleY:Math.abs(t.scaleY)}},getTotalObjectScaling:function(){var t=this.getObjectScaling(),e=t.scaleX,i=t.scaleY;if(this.canvas){var r=this.canvas.getZoom(),n=this.canvas.getRetinaScaling();e*=r*n,i*=r*n}return{scaleX:e,scaleY:i}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,e){var i="scaleX"===t||"scaleY"===t,r=this[t]!==e,n=!1;return i&&(e=this._constrainScale(e)),"scaleX"===t&&e<0?(this.flipX=!this.flipX,e*=-1):"scaleY"===t&&e<0?(this.flipY=!this.flipY,e*=-1):"shadow"!==t||!e||e instanceof x.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",e):e=new x.Shadow(e),this[t]=e,r&&(n=this.group&&this.group.isOnACache(),-1<this.cacheProperties.indexOf(t)?(this.dirty=!0,n&&this.group.set("dirty",!0)):n&&-1<this.stateProperties.indexOf(t)&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:x.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(t){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(t.save(),this._setupCompositeOperation(t),this.drawSelectionBackground(t),this.transform(t),this._setOpacity(t),this._setShadow(t,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(t)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(t),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),t.restore())},renderCache:function(t){t=t||{},this._cacheCanvas&&this._cacheContext||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,t.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!=typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(t,e){if(t.save(),e.inverted?t.globalCompositeOperation="destination-out":t.globalCompositeOperation="destination-in",e.absolutePositioned){var i=x.util.invertTransform(this.calcTransformMatrix());t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}e.transform(t),t.scale(1/e.zoomX,1/e.zoomY),t.drawImage(e._cacheCanvas,-e.cacheTranslationX,-e.cacheTranslationY),t.restore()},drawObject:function(t,e){var i=this.fill,r=this.stroke;e?(this.fill="black",this.stroke="",this._setClippingProperties(t)):this._renderBackground(t),this._render(t),this._drawClipPath(t,this.clipPath),this.fill=i,this.stroke=r},_drawClipPath:function(t,e){e&&(e.canvas=this.canvas,e.shouldCache(),e._transformDone=!0,e.renderCache({forClipping:!0}),this.drawClipPathOnCache(t,e))},drawCacheOnCanvas:function(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(t){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!t&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!t){var e=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-e/2,-i/2,e,i)}return!0}return!1},_renderBackground:function(t){if(this.backgroundColor){var e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}},_setOpacity:function(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity},_setStrokeStyles:function(t,e){var i=e.stroke;i&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(t,i):(t.strokeStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):t.strokeStyle=e.stroke)},_setFillStyles:function(t,e){var i=e.fill;i&&(i.toLive?(t.fillStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,e.fill)):t.fillStyle=i)},_setClippingProperties:function(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"},_setLineDash:function(t,e){e&&0!==e.length&&(1&e.length&&e.push.apply(e,e),t.setLineDash(e))},_renderControls:function(t,e){var i,r,n,s=this.getViewportTransform(),o=this.calcTransformMatrix();r=void 0!==(e=e||{}).hasBorders?e.hasBorders:this.hasBorders,n=void 0!==e.hasControls?e.hasControls:this.hasControls,o=x.util.multiplyTransformMatrices(s,o),i=x.util.qrDecompose(o),t.save(),t.translate(i.translateX,i.translateY),t.lineWidth=1*this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(i.angle-=180),t.rotate(a(this.group?i.angle:this.angle)),e.forActiveSelection||this.group?r&&this.drawBordersInGroup(t,i,e):r&&this.drawBorders(t,e),n&&this.drawControls(t,e),t.restore()},_setShadow:function(t){if(this.shadow){var e,i=this.shadow,r=this.canvas,n=r&&r.viewportTransform[0]||1,s=r&&r.viewportTransform[3]||1;e=i.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(n*=x.devicePixelRatio,s*=x.devicePixelRatio),t.shadowColor=i.color,t.shadowBlur=i.blur*x.browserShadowBlurConstant*(n+s)*(e.scaleX+e.scaleY)/4,t.shadowOffsetX=i.offsetX*n*e.scaleX,t.shadowOffsetY=i.offsetY*s*e.scaleY}},_removeShadow:function(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)},_applyPatternGradientTransform:function(t,e){if(!e||!e.toLive)return{offsetX:0,offsetY:0};var i=e.gradientTransform||e.patternTransform,r=-this.width/2+e.offsetX||0,n=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,r,n):t.transform(1,0,0,1,r,n),i&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:r,offsetY:n}},_renderPaintInOrder:function(t){"stroke"===this.paintFirst?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))},_render:function(){},_renderFill:function(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())},_renderStroke:function(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform&&this.group){var e=this.getObjectScaling();t.scale(1/e.scaleX,1/e.scaleY)}else this.strokeUniform&&t.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}},_applyPatternForTransformedGradient:function(t,e){var i,r=this._limitCacheSize(this._getCacheCanvasDimensions()),n=x.util.createCanvasElement(),s=this.canvas.getRetinaScaling(),o=r.x/this.scaleX/s,a=r.y/this.scaleY/s;n.width=o,n.height=a,(i=n.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(o,0),i.lineTo(o,a),i.lineTo(0,a),i.closePath(),i.translate(o/2,a/2),i.scale(r.zoomX/this.scaleX/s,r.zoomY/this.scaleY/s),this._applyPatternGradientTransform(i,e),i.fillStyle=e.toLive(t),i.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(s*this.scaleX/r.zoomX,s*this.scaleY/r.zoomY),t.strokeStyle=i.createPattern(n,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var t=x.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",t.scaleX),this.set("scaleY",t.scaleY),this.angle=t.angle,this.skewX=t.skewX,this.skewY=0}},_removeTransformMatrix:function(t){var e=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),e=x.util.transformPoint(e,this.transformMatrix)),this.transformMatrix=null,t&&(this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this.cropX=t.cropX,this.cropY=t.cropY,e.x+=t.offsetLeft,e.y+=t.offsetTop,this.width=t.width,this.height=t.height),this.setPositionByOrigin(e,"center","center")},clone:function(t,e){var i=this.toObject(e);this.constructor.fromObject?this.constructor.fromObject(i,t):x.Object._fromObject("Object",i,t)},cloneAsImage:function(t,e){var i=this.toCanvasElement(e);return t&&t(new x.Image(i)),this},toCanvasElement:function(t){t||(t={});var e=x.util,i=e.saveObjectTransform(this),r=this.group,n=this.shadow,s=Math.abs,o=(t.multiplier||1)*(t.enableRetinaScaling?x.devicePixelRatio:1);delete this.group,t.withoutTransform&&e.resetObjectTransform(this),t.withoutShadow&&(this.shadow=null);var a,c,h,l,u=x.util.createCanvasElement(),f=this.getBoundingRect(!0,!0),d=this.shadow,g={x:0,y:0};d&&(c=d.blur,a=d.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(s(d.offsetX)+c)*s(a.scaleX),g.y=2*Math.round(s(d.offsetY)+c)*s(a.scaleY)),h=f.width+g.x,l=f.height+g.y,u.width=Math.ceil(h),u.height=Math.ceil(l);var p=new x.StaticCanvas(u,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===t.format&&(p.backgroundColor="#fff"),this.setPositionByOrigin(new x.Point(p.width/2,p.height/2),"center","center");var v=this.canvas;p.add(this);var m=p.toCanvasElement(o||1,t);return this.shadow=n,this.set("canvas",v),r&&(this.group=r),this.set(i).setCoords(),p._objects=[],p.dispose(),p=null,m},toDataURL:function(t){return t||(t={}),x.util.toDataURL(this.toCanvasElement(t),t.format||"png",t.quality||1)},isType:function(t){return 1<arguments.length?Array.from(arguments).includes(this.type):this.type===t},complexity:function(){return 1},toJSON:function(t){return this.toObject(t)},rotate:function(t){var e=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return e&&this._setOriginToCenter(),this.set("angle",t),e&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(t,e){e=e||this.canvas.getPointer(t);var i=new x.Point(e.x,e.y),r=this._getLeftTopCoords();return this.angle&&(i=x.util.rotatePoint(i,r,a(-this.angle))),{x:i.x-r.x,y:i.y-r.y}},_setupCompositeOperation:function(t){this.globalCompositeOperation&&(t.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){x.runningAnimations&&x.runningAnimations.cancelByTarget(this)}}),x.util.createAccessors&&x.util.createAccessors(x.Object),e(x.Object.prototype,x.Observable),x.Object.NUM_FRACTION_DIGITS=2,x.Object.ENLIVEN_PROPS=["clipPath"],x.Object._fromObject=function(t,e,i,r){var n=x[t];e=s(e,!0),x.util.enlivenPatterns([e.fill,e.stroke],function(t){void 0!==t[0]&&(e.fill=t[0]),void 0!==t[1]&&(e.stroke=t[1]),x.util.enlivenObjectEnlivables(e,e,function(){var t=r?new n(e[r],e):new n(e);i&&i(t)})})},x.Object.__uid=0)}("undefined"!=typeof exports?exports:this),function(){var a=fabric.util.degreesToRadians,l={left:-.5,center:0,right:.5},u={top:-.5,center:0,bottom:.5};fabric.util.object.extend(fabric.Object.prototype,{translateToGivenOrigin:function(t,e,i,r,n){var s,o,a,c=t.x,h=t.y;return"string"==typeof e?e=l[e]:e-=.5,"string"==typeof r?r=l[r]:r-=.5,"string"==typeof i?i=u[i]:i-=.5,"string"==typeof n?n=u[n]:n-=.5,o=n-i,((s=r-e)||o)&&(a=this._getTransformedDimensions(),c=t.x+s*a.x,h=t.y+o*a.y),new fabric.Point(c,h)},translateToCenterPoint:function(t,e,i){var r=this.translateToGivenOrigin(t,e,i,"center","center");return this.angle?fabric.util.rotatePoint(r,t,a(this.angle)):r},translateToOriginPoint:function(t,e,i){var r=this.translateToGivenOrigin(t,"center","center",e,i);return this.angle?fabric.util.rotatePoint(r,t,a(this.angle)):r},getCenterPoint:function(){var t=new fabric.Point(this.left,this.top);return this.translateToCenterPoint(t,this.originX,this.originY)},getPointByOrigin:function(t,e){var i=this.getCenterPoint();return this.translateToOriginPoint(i,t,e)},toLocalPoint:function(t,e,i){var r,n,s=this.getCenterPoint();return r=void 0!==e&&void 0!==i?this.translateToGivenOrigin(s,"center","center",e,i):new fabric.Point(this.left,this.top),n=new fabric.Point(t.x,t.y),this.angle&&(n=fabric.util.rotatePoint(n,s,-a(this.angle))),n.subtractEquals(r)},setPositionByOrigin:function(t,e,i){var r=this.translateToCenterPoint(t,e,i),n=this.translateToOriginPoint(r,this.originX,this.originY);this.set("left",n.x),this.set("top",n.y)},adjustPosition:function(t){var e,i,r=a(this.angle),n=this.getScaledWidth(),s=fabric.util.cos(r)*n,o=fabric.util.sin(r)*n;e="string"==typeof this.originX?l[this.originX]:this.originX-.5,i="string"==typeof t?l[t]:t-.5,this.left+=s*(i-e),this.top+=o*(i-e),this.setCoords(),this.originX=t},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var t=this.getCenterPoint();this.originX="center",this.originY="center",this.left=t.x,this.top=t.y},_resetOrigin:function(){var t=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=t.x,this.top=t.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){var h=fabric.util,l=h.degreesToRadians,a=h.multiplyTransformMatrices,u=h.transformPoint;h.object.extend(fabric.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(t,e){return e?t?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),t?this.aCoords:this.lineCoords)},getCoords:function(t,e){return i=this._getCoords(t,e),[new fabric.Point(i.tl.x,i.tl.y),new fabric.Point(i.tr.x,i.tr.y),new fabric.Point(i.br.x,i.br.y),new fabric.Point(i.bl.x,i.bl.y)];var i},intersectsWithRect:function(t,e,i,r){var n=this.getCoords(i,r);return"Intersection"===fabric.Intersection.intersectPolygonRectangle(n,t,e).status},intersectsWithObject:function(t,e,i){return"Intersection"===fabric.Intersection.intersectPolygonPolygon(this.getCoords(e,i),t.getCoords(e,i)).status||t.isContainedWithinObject(this,e,i)||this.isContainedWithinObject(t,e,i)},isContainedWithinObject:function(t,e,i){for(var r=this.getCoords(e,i),n=e?t.aCoords:t.lineCoords,s=0,o=t._getImageLines(n);s<4;s++)if(!t.containsPoint(r[s],o))return!1;return!0},isContainedWithinRect:function(t,e,i,r){var n=this.getBoundingRect(i,r);return n.left>=t.x&&n.left+n.width<=e.x&&n.top>=t.y&&n.top+n.height<=e.y},containsPoint:function(t,e,i,r){var n=this._getCoords(i,r),s=(e=e||this._getImageLines(n),this._findCrossPoints(t,e));return 0!==s&&s%2==1},isOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.getCoords(!0,t).some(function(t){return t.x<=i.x&&t.x>=e.x&&t.y<=i.y&&t.y>=e.y})||(!!this.intersectsWithRect(e,i,!0,t)||this._containsCenterOfCanvas(e,i,t))},_containsCenterOfCanvas:function(t,e,i){var r={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(r,null,!0,i)},isPartiallyOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(e,i,!0,t)||this.getCoords(!0,t).every(function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)})&&this._containsCenterOfCanvas(e,i,t)},_getImageLines:function(t){return{topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}}},_findCrossPoints:function(t,e){var i,r,n,s=0;for(var o in e)if(!((n=e[o]).o.y<t.y&&n.d.y<t.y||n.o.y>=t.y&&n.d.y>=t.y||(n.o.x===n.d.x&&n.o.x>=t.x?r=n.o.x:(0,i=(n.d.y-n.o.y)/(n.d.x-n.o.x),r=-(t.y-0*t.x-(n.o.y-i*n.o.x))/(0-i)),r>=t.x&&(s+=1),2!==s)))break;return s},getBoundingRect:function(t,e){var i=this.getCoords(t,e);return h.makeBoundingBoxFromPoints(i)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){return Math.abs(t)<this.minScaleLimit?t<0?-this.minScaleLimit:this.minScaleLimit:0===t?1e-4:t},scale:function(t){return this._set("scaleX",t),this._set("scaleY",t),this.setCoords()},scaleToWidth:function(t,e){var i=this.getBoundingRect(e).width/this.getScaledWidth();return this.scale(t/this.width/i)},scaleToHeight:function(t,e){var i=this.getBoundingRect(e).height/this.getScaledHeight();return this.scale(t/this.height/i)},calcLineCoords:function(){var t=this.getViewportTransform(),e=this.padding,i=l(this.angle),r=h.cos(i)*e,n=h.sin(i)*e,s=r+n,o=r-n,a=this.calcACoords(),c={tl:u(a.tl,t),tr:u(a.tr,t),bl:u(a.bl,t),br:u(a.br,t)};return e&&(c.tl.x-=o,c.tl.y-=s,c.tr.x+=s,c.tr.y-=o,c.bl.x-=s,c.bl.y+=o,c.br.x+=o,c.br.y+=s),c},calcOCoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),i=this.getViewportTransform(),r=a(i,e),n=a(r,t),s=(n=a(n,[1/i[0],0,0,1/i[3],0,0]),this._calculateCurrentDimensions()),o={};return this.forEachControl(function(t,e,i){o[e]=t.positionHandler(s,n,i)}),o},calcACoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),i=a(e,t),r=this._getTransformedDimensions(),n=r.x/2,s=r.y/2;return{tl:u({x:-n,y:-s},i),tr:u({x:n,y:-s},i),bl:u({x:-n,y:s},i),br:u({x:n,y:s},i)}},setCoords:function(t){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),t||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return h.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var t=this.getCenterPoint();return[1,0,0,1,t.x,t.y]},transformMatrixKey:function(t){var e="_",i="";return!t&&this.group&&(i=this.group.transformMatrixKey(t)+e),i+this.top+e+this.left+e+this.scaleX+e+this.scaleY+e+this.skewX+e+this.skewY+e+this.angle+e+this.originX+e+this.originY+e+this.width+e+this.height+e+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(t){var e=this.calcOwnMatrix();if(t||!this.group)return e;var i=this.transformMatrixKey(t),r=this.matrixCache||(this.matrixCache={});return r.key===i?r.value:(this.group&&(e=a(this.group.calcTransformMatrix(!1),e)),r.key=i,r.value=e)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),e=this.ownMatrixCache||(this.ownMatrixCache={});if(e.key===t)return e.value;var i=this._calcTranslateMatrix(),r={angle:this.angle,translateX:i[4],translateY:i[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return e.key=t,e.value=h.composeMatrix(r),e.value},_getNonTransformedDimensions:function(){var t=this.strokeWidth;return{x:this.width+t,y:this.height+t}},_getTransformedDimensions:function(t,e){void 0===t&&(t=this.skewX),void 0===e&&(e=this.skewY);var i,r,n,s=0===t&&0===e;if(this.strokeUniform?(r=this.width,n=this.height):(r=(i=this._getNonTransformedDimensions()).x,n=i.y),s)return this._finalizeDimensions(r*this.scaleX,n*this.scaleY);var o=h.sizeAfterTransform(r,n,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:e});return this._finalizeDimensions(o.x,o.y)},_finalizeDimensions:function(t,e){return this.strokeUniform?{x:t+this.strokeWidth,y:e+this.strokeWidth}:{x:t,y:e}},_calculateCurrentDimensions:function(){var t=this.getViewportTransform(),e=this._getTransformedDimensions();return u(e,t,!0).scalarAdd(2*this.padding)}})}(),fabric.util.object.extend(fabric.Object.prototype,{sendToBack:function(){return this.group?fabric.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?fabric.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(t){return this.group?fabric.StaticCanvas.prototype.sendBackwards.call(this.group,this,t):this.canvas&&this.canvas.sendBackwards(this,t),this},bringForward:function(t){return this.group?fabric.StaticCanvas.prototype.bringForward.call(this.group,this,t):this.canvas&&this.canvas.bringForward(this,t),this},moveTo:function(t){return this.group&&"activeSelection"!==this.group.type?fabric.StaticCanvas.prototype.moveTo.call(this.group,this,t):this.canvas&&this.canvas.moveTo(this,t),this}}),function(){function f(t,e){if(e){if(e.toLive)return t+": url(#SVGID_"+e.id+"); ";var i=new fabric.Color(e),r=t+": "+i.toRgb()+"; ",n=i.getAlpha();return 1!==n&&(r+=t+"-opacity: "+n.toString()+"; "),r}return t+": none; "}var i=fabric.util.toFixed;fabric.util.object.extend(fabric.Object.prototype,{getSvgStyles:function(t){var e=this.fillRule?this.fillRule:"nonzero",i=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",n=this.strokeDashOffset?this.strokeDashOffset:"0",s=this.strokeLineCap?this.strokeLineCap:"butt",o=this.strokeLineJoin?this.strokeLineJoin:"miter",a=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",l=t?"":this.getSvgFilter(),u=f("fill",this.fill);return[f("stroke",this.stroke),"stroke-width: ",i,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",s,"; ","stroke-dashoffset: ",n,"; ","stroke-linejoin: ",o,"; ","stroke-miterlimit: ",a,"; ",u,"fill-rule: ",e,"; ","opacity: ",c,";",l,h].join("")},getSvgSpanStyles:function(t,e){var i="; ",r=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+i:"",n=t.strokeWidth?"stroke-width: "+t.strokeWidth+i:"",s=(r=r,t.fontSize?"font-size: "+t.fontSize+"px"+i:""),o=t.fontStyle?"font-style: "+t.fontStyle+i:"",a=t.fontWeight?"font-weight: "+t.fontWeight+i:"",c=t.fill?f("fill",t.fill):"",h=t.stroke?f("stroke",t.stroke):"",l=this.getSvgTextDecoration(t);return l&&(l="text-decoration: "+l+i),[h,n,r,s,o,a,l,c,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",e?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter(function(t){return e[t.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(t,e){var i=t?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+fabric.util.matrixToSVG(i)+(e||"")+'" '},_setSVGBg:function(t){if(this.backgroundColor){var e=fabric.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',i(-this.width/2,e),'" y="',i(-this.height/2,e),'" width="',i(this.width,e),'" height="',i(this.height,e),'"></rect>\n')}},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})},toClipPathSVG:function(t){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})},_createBaseClipPathSVGMarkup:function(t,e){var i=(e=e||{}).reviver,r=e.additionalTransform||"",n=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),s=t.indexOf("COMMON_PARTS");return t[s]=n,i?i(t.join("")):t.join("")},_createBaseSVGMarkup:function(t,e){var i,r,n=(e=e||{}).noStyle,s=e.reviver,o=n?"":'style="'+this.getSvgStyles()+'" ',a=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",c=this.clipPath,h=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",l=c&&c.absolutePositioned,u=this.stroke,f=this.fill,d=this.shadow,g=[],p=t.indexOf("COMMON_PARTS"),v=e.additionalTransform;return c&&(c.clipPathId="CLIPPATH_"+fabric.Object.__uid++,r='<clipPath id="'+c.clipPathId+'" >\n'+c.toClipPathSVG(s)+"</clipPath>\n"),l&&g.push("<g ",a,this.getSvgCommons()," >\n"),g.push("<g ",this.getSvgTransform(!1),l?"":a+this.getSvgCommons()," >\n"),i=[o,h,n?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),t[p]=i,f&&f.toLive&&g.push(f.toSVG(this)),u&&u.toLive&&g.push(u.toSVG(this)),d&&g.push(d.toSVG(this)),c&&g.push(r),g.push(t.join("")),g.push("</g>\n"),l&&g.push("</g>\n"),s?s(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var n=fabric.util.object.extend,r="stateProperties";function s(e,t,i){var r={};i.forEach(function(t){r[t]=e[t]}),n(e[t],r,!0)}fabric.util.object.extend(fabric.Object.prototype,{hasStateChanged:function(t){var e="_"+(t=t||r);return Object.keys(this[e]).length<this[t].length||!function t(e,i,r){if(e===i)return!0;if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(var n=0,s=e.length;n<s;n++)if(!t(e[n],i[n]))return!1;return!0}if(e&&"object"==typeof e){var o,a=Object.keys(e);if(!i||"object"!=typeof i||!r&&a.length!==Object.keys(i).length)return!1;for(n=0,s=a.length;n<s;n++)if("canvas"!==(o=a[n])&&"group"!==o&&!t(e[o],i[o]))return!1;return!0}}(this[e],this,!0)},saveState:function(t){var e=t&&t.propertySet||r,i="_"+e;return this[i]?(s(this,i,this[e]),t&&t.stateProperties&&s(this,i,t.stateProperties),this):this.setupState(t)},setupState:function(t){var e=(t=t||{}).propertySet||r;return this["_"+(t.propertySet=e)]={},this.saveState(t),this}})}(),function(){var n=fabric.util.degreesToRadians;fabric.util.object.extend(fabric.Object.prototype,{_findTargetCorner:function(t,e){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var i,r,n,s=t.x,o=t.y,a=Object.keys(this.oCoords),c=a.length-1;for(this.__corner=0;0<=c;c--)if(n=a[c],this.isControlVisible(n)&&(r=this._getImageLines(e?this.oCoords[n].touchCorner:this.oCoords[n].corner),0!==(i=this._findCrossPoints({x:s,y:o},r))&&i%2==1))return this.__corner=n;return!1},forEachControl:function(t){for(var e in this.controls)t(this.controls[e],e,this)},_setCornerCoords:function(){var t=this.oCoords;for(var e in t){var i=this.controls[e];t[e].corner=i.calcCornerCoords(this.angle,this.cornerSize,t[e].x,t[e].y,!1),t[e].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,t[e].x,t[e].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var e=this.getCenterPoint(),i=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return t.translate(e.x,e.y),t.scale(1/r[0],1/r[3]),t.rotate(n(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-i.x/2,-i.y/2,i.x,i.y),t.restore(),this},drawBorders:function(r,t){t=t||{};var e=this._calculateCurrentDimensions(),i=this.borderScaleFactor,n=e.x+i,s=e.y+i,o=void 0!==t.hasControls?t.hasControls:this.hasControls,a=!1;return r.save(),r.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(r,t.borderDashArray||this.borderDashArray),r.strokeRect(-n/2,-s/2,n,s),o&&(r.beginPath(),this.forEachControl(function(t,e,i){t.withConnection&&t.getVisibility(i,e)&&(a=!0,r.moveTo(t.x*n,t.y*s),r.lineTo(t.x*n+t.offsetX,t.y*s+t.offsetY))}),a&&r.stroke()),r.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var r=fabric.util.sizeAfterTransform(this.width,this.height,e),n=this.strokeWidth,s=this.strokeUniform,o=this.borderScaleFactor,a=r.x+n*(s?this.canvas.getZoom():e.scaleX)+o,c=r.y+n*(s?this.canvas.getZoom():e.scaleY)+o;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-a/2,-c/2,a,c),t.restore(),this},drawControls:function(r,n){n=n||{},r.save();var s,o,t=this.canvas.getRetinaScaling();return r.setTransform(t,0,0,t,0,0),r.strokeStyle=r.fillStyle=n.cornerColor||this.cornerColor,this.transparentCorners||(r.strokeStyle=n.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(r,n.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(s=this.group.calcTransformMatrix()),this.forEachControl(function(t,e,i){o=i.oCoords[e],t.getVisibility(i,e)&&(s&&(o=fabric.util.transformPoint(o,s)),t.render(r,o.x,o.y,n,i))}),r.restore(),this},isControlVisible:function(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)},setControlVisible:function(t,e){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e,this},setControlsVisibility:function(t){for(var e in t||(t={}),t)this.setControlVisible(e,t[e]);return this},onDeselect:function(){},onSelect:function(){}})}(),fabric.util.object.extend(fabric.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){var i=function(){},r=(t=t||{}).onComplete||i,n=t.onChange||i,s=this;return fabric.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),s.requestRenderAll(),n()},onComplete:function(){e.setCoords(),r()}})},fxCenterObjectV:function(e,t){var i=function(){},r=(t=t||{}).onComplete||i,n=t.onChange||i,s=this;return fabric.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),s.requestRenderAll(),n()},onComplete:function(){e.setCoords(),r()}})},fxRemove:function(e,t){var i=function(){},r=(t=t||{}).onComplete||i,n=t.onChange||i,s=this;return fabric.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),s.requestRenderAll(),n()},onComplete:function(){s.remove(e),r()}})}}),fabric.util.object.extend(fabric.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var t,e,i=[],r=[];for(t in arguments[0])i.push(t);for(var n=0,s=i.length;n<s;n++)t=i[n],e=n!==s-1,r.push(this._animate(t,arguments[0][t],arguments[1],e));return r}return this._animate.apply(this,arguments)},_animate:function(r,t,n,s){var o,a=this;t=t.toString(),n=n?fabric.util.object.clone(n):{},~r.indexOf(".")&&(o=r.split("."));var e=-1<a.colorProperties.indexOf(r)||o&&-1<a.colorProperties.indexOf(o[1]),i=o?this.get(o[0])[o[1]]:this.get(r);"from"in n||(n.from=i),e||(t=~t.indexOf("=")?i+parseFloat(t.replace("=","")):parseFloat(t));var c={target:this,startValue:n.from,endValue:t,byValue:n.by,easing:n.easing,duration:n.duration,abort:n.abort&&function(t,e,i){return n.abort.call(a,t,e,i)},onChange:function(t,e,i){o?a[o[0]][o[1]]=t:a.set(r,t),s||n.onChange&&n.onChange(t,e,i)},onComplete:function(t,e,i){s||(a.setCoords(),n.onComplete&&n.onComplete(t,e,i))}};return e?fabric.util.animateColor(c.startValue,c.endValue,c.duration,c):fabric.util.animate(c)}}),function(t){"use strict";var s=t.fabric||(t.fabric={}),o=s.util.object.extend,r=s.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function e(t,e){var i=t.origin,r=t.axis1,n=t.axis2,s=t.dimension,o=e.nearest,a=e.center,c=e.farthest;return function(){switch(this.get(i)){case o:return Math.min(this.get(r),this.get(n));case a:return Math.min(this.get(r),this.get(n))+.5*this.get(s);case c:return Math.max(this.get(r),this.get(n))}}}s.Line?s.warn("fabric.Line is already defined"):(s.Line=s.util.createClass(s.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:s.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,e){t||(t=[0,0,0,0]),this.callSuper("initialize",e),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(e)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,e){return this.callSuper("_set",t,e),void 0!==i[t]&&this._setWidthHeight(),this},_getLeftToOriginX:e({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:e({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var e=this.calcLinePoints();t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineWidth=this.strokeWidth;var i=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return o(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,e=this.y1<=this.y2?-1:1,i=t*this.width*.5,r=e*this.height*.5;return{x1:i,x2:t*this.width*-.5,y1:r,y2:e*this.height*-.5}},_toSVG:function(){var t=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',t.x1,'" y1="',t.y1,'" x2="',t.x2,'" y2="',t.y2,'" />\n']}}),s.Line.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),s.Line.fromElement=function(t,e,i){i=i||{};var r=s.parseAttributes(t,s.Line.ATTRIBUTE_NAMES),n=[r.x1||0,r.y1||0,r.x2||0,r.y2||0];e(new s.Line(n,o(r,i)))},s.Line.fromObject=function(t,e){var i=r(t,!0);i.points=[t.x1,t.y1,t.x2,t.y2],s.Object._fromObject("Line",i,function(t){delete t.points,e&&e(t)},"points")})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var s=t.fabric||(t.fabric={}),o=s.util.degreesToRadians;s.Circle?s.warn("fabric.Circle is already defined."):(s.Circle=s.util.createClass(s.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:s.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),"radius"===t&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,e=(this.endAngle-this.startAngle)%360;if(0===e)t=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var i=o(this.startAngle),r=o(this.endAngle),n=this.radius;t=['<path d="M '+s.util.cos(i)*n+" "+s.util.sin(i)*n," A "+n+" "+n," 0 ",+(180<e?"1":"0")+" 1"," "+s.util.cos(r)*n+" "+s.util.sin(r)*n,'" ',"COMMON_PARTS"," />\n"]}return t},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,o(this.startAngle),o(this.endAngle),!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",2*t).set("height",2*t)}}),s.Circle.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),s.Circle.fromElement=function(t,e){var i,r=s.parseAttributes(t,s.Circle.ATTRIBUTE_NAMES);if(!("radius"in(i=r)&&0<=i.radius))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,e(new s.Circle(r))},s.Circle.fromObject=function(t,e){s.Object._fromObject("Circle",t,e)})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var i=t.fabric||(t.fabric={});i.Triangle?i.warn("fabric.Triangle is already defined"):(i.Triangle=i.util.createClass(i.Object,{type:"triangle",width:100,height:100,_render:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,i),t.lineTo(0,-i),t.lineTo(e,i),t.closePath(),this._renderPaintInOrder(t)},_toSVG:function(){var t=this.width/2,e=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-t+" "+e,"0 "+-e,t+" "+e].join(","),'" />']}}),i.Triangle.fromObject=function(t,e){return i.Object._fromObject("Triangle",t,e)})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var r=t.fabric||(t.fabric={}),e=2*Math.PI;r.Ellipse?r.warn("fabric.Ellipse is already defined."):(r.Ellipse=r.util.createClass(r.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:r.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this.set("rx",t&&t.rx||0),this.set("ry",t&&t.ry||0)},_set:function(t,e){switch(this.callSuper("_set",t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,e,!1),t.restore(),this._renderPaintInOrder(t)}}),r.Ellipse.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),r.Ellipse.fromElement=function(t,e){var i=r.parseAttributes(t,r.Ellipse.ATTRIBUTE_NAMES);i.left=(i.left||0)-i.rx,i.top=(i.top||0)-i.ry,e(new r.Ellipse(i))},r.Ellipse.fromObject=function(t,e){r.Object._fromObject("Ellipse",t,e)})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var s=t.fabric||(t.fabric={}),o=s.util.object.extend;s.Rect?s.warn("fabric.Rect is already defined"):(s.Rect=s.util.createClass(s.Object,{stateProperties:s.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(t){var e=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,r=this.width,n=this.height,s=-this.width/2,o=-this.height/2,a=0!==e||0!==i,c=.4477152502;t.beginPath(),t.moveTo(s+e,o),t.lineTo(s+r-e,o),a&&t.bezierCurveTo(s+r-c*e,o,s+r,o+c*i,s+r,o+i),t.lineTo(s+r,o+n-i),a&&t.bezierCurveTo(s+r,o+n-c*i,s+r-c*e,o+n,s+r-e,o+n),t.lineTo(s+e,o+n),a&&t.bezierCurveTo(s+c*e,o+n,s,o+n-c*i,s,o+n-i),t.lineTo(s,o+i),a&&t.bezierCurveTo(s,o+c*i,s+c*e,o,s+e,o),t.closePath(),this._renderPaintInOrder(t)},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),s.Rect.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),s.Rect.fromElement=function(t,e,i){if(!t)return e(null);i=i||{};var r=s.parseAttributes(t,s.Rect.ATTRIBUTE_NAMES);r.left=r.left||0,r.top=r.top||0,r.height=r.height||0,r.width=r.width||0;var n=new s.Rect(o(i?s.util.object.clone(i):{},r));n.visible=n.visible&&0<n.width&&0<n.height,e(n)},s.Rect.fromObject=function(t,e){return s.Object._fromObject("Rect",t,e)})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var o=t.fabric||(t.fabric={}),a=o.util.object.extend,r=o.util.array.min,n=o.util.array.max,c=o.util.toFixed,e=o.util.projectStrokeOnPoints;o.Polyline?o.warn("fabric.Polyline is already defined"):(o.Polyline=o.util.createClass(o.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:o.Object.prototype.cacheProperties.concat("points"),initialize:function(t,e){e=e||{},this.points=t||[],this.callSuper("initialize",e),this._setPositionDimensions(e)},_projectStrokeOnPoints:function(){return e(this.points,this,!0)},_setPositionDimensions:function(t){var e,i=this._calcDimensions(t),r=this.exactBoundingBox?this.strokeWidth:0;this.width=i.width-r,this.height=i.height-r,t.fromSVG||(e=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2+r/2,y:i.top-this.strokeWidth/2+r/2},"left","top",this.originX,this.originY)),void 0===t.left&&(this.left=t.fromSVG?i.left:e.x),void 0===t.top&&(this.top=t.fromSVG?i.top:e.y),this.pathOffset={x:i.left+this.width/2+r/2,y:i.top+this.height/2+r/2}},_calcDimensions:function(){var t=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,e=r(t,"x")||0,i=r(t,"y")||0;return{left:e,top:i,width:(n(t,"x")||0)-e,height:(n(t,"y")||0)-i}},toObject:function(t){return a(this.callSuper("toObject",t),{points:this.points.concat()})},_toSVG:function(){for(var t=[],e=this.pathOffset.x,i=this.pathOffset.y,r=o.Object.NUM_FRACTION_DIGITS,n=0,s=this.points.length;n<s;n++)t.push(c(this.points[n].x-e,r),",",c(this.points[n].y-i,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',t.join(""),'" />\n']},commonRender:function(t){var e,i=this.points.length,r=this.pathOffset.x,n=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;t.beginPath(),t.moveTo(this.points[0].x-r,this.points[0].y-n);for(var s=0;s<i;s++)e=this.points[s],t.lineTo(e.x-r,e.y-n);return!0},_render:function(t){this.commonRender(t)&&this._renderPaintInOrder(t)},complexity:function(){return this.get("points").length}}),o.Polyline.ATTRIBUTE_NAMES=o.SHARED_ATTRIBUTES.concat(),o.Polyline.fromElementGenerator=function(s){return function(t,e,i){if(!t)return e(null);i||(i={});var r=o.parsePointsAttribute(t.getAttribute("points")),n=o.parseAttributes(t,o[s].ATTRIBUTE_NAMES);n.fromSVG=!0,e(new o[s](r,a(n,i)))}},o.Polyline.fromElement=o.Polyline.fromElementGenerator("Polyline"),o.Polyline.fromObject=function(t,e){return o.Object._fromObject("Polyline",t,e,"points")})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var i=t.fabric||(t.fabric={}),e=i.util.projectStrokeOnPoints;i.Polygon?i.warn("fabric.Polygon is already defined"):(i.Polygon=i.util.createClass(i.Polyline,{type:"polygon",_projectStrokeOnPoints:function(){return e(this.points,this)},_render:function(t){this.commonRender(t)&&(t.closePath(),this._renderPaintInOrder(t))}}),i.Polygon.ATTRIBUTE_NAMES=i.SHARED_ATTRIBUTES.concat(),i.Polygon.fromElement=i.Polyline.fromElementGenerator("Polygon"),i.Polygon.fromObject=function(t,e){i.Object._fromObject("Polygon",t,e,"points")})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var f=t.fabric||(t.fabric={}),d=f.util.array.min,g=f.util.array.max,n=f.util.object.extend,i=f.util.object.clone,e=f.util.toFixed;f.Path?f.warn("fabric.Path is already defined"):(f.Path=f.util.createClass(f.Object,{type:"path",path:null,cacheProperties:f.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:f.Object.prototype.stateProperties.concat("path"),initialize:function(t,e){delete(e=i(e||{})).path,this.callSuper("initialize",e),this._setPath(t||[],e)},_setPath:function(t,e){this.path=f.util.makePathSimpler(Array.isArray(t)?t:f.util.parsePath(t)),f.Polyline.prototype._setPositionDimensions.call(this,e||{})},_renderPathCommands:function(t){var e,i=0,r=0,n=0,s=0,o=0,a=0,c=-this.pathOffset.x,h=-this.pathOffset.y;t.beginPath();for(var l=0,u=this.path.length;l<u;++l)switch((e=this.path[l])[0]){case"L":n=e[1],s=e[2],t.lineTo(n+c,s+h);break;case"M":i=n=e[1],r=s=e[2],t.moveTo(n+c,s+h);break;case"C":n=e[5],s=e[6],o=e[3],a=e[4],t.bezierCurveTo(e[1]+c,e[2]+h,o+c,a+h,n+c,s+h);break;case"Q":t.quadraticCurveTo(e[1]+c,e[2]+h,e[3]+c,e[4]+h),n=e[3],s=e[4],o=e[1],a=e[2];break;case"z":case"Z":n=i,s=r,t.closePath()}},_render:function(t){this._renderPathCommands(t),this._renderPaintInOrder(t)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(t){return n(this.callSuper("toObject",t),{path:this.path.map(function(t){return t.slice()})})},toDatalessObject:function(t){var e=this.toObject(["sourcePath"].concat(t));return e.sourcePath&&delete e.path,e},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',f.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var t=f.Object.NUM_FRACTION_DIGITS;return" translate("+e(-this.pathOffset.x,t)+", "+e(-this.pathOffset.y,t)+")"},toClipPathSVG:function(t){var e=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},toSVG:function(t){var e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var t,e,i=[],r=[],n=0,s=0,o=0,a=0,c=0,h=this.path.length;c<h;++c){switch((t=this.path[c])[0]){case"L":o=t[1],a=t[2],e=[];break;case"M":n=o=t[1],s=a=t[2],e=[];break;case"C":e=f.util.getBoundsOfCurve(o,a,t[1],t[2],t[3],t[4],t[5],t[6]),o=t[5],a=t[6];break;case"Q":e=f.util.getBoundsOfCurve(o,a,t[1],t[2],t[1],t[2],t[3],t[4]),o=t[3],a=t[4];break;case"z":case"Z":o=n,a=s}e.forEach(function(t){i.push(t.x),r.push(t.y)}),i.push(o),r.push(a)}var l=d(i)||0,u=d(r)||0;return{left:l,top:u,width:(g(i)||0)-l,height:(g(r)||0)-u}}}),f.Path.fromObject=function(i,r){if("string"==typeof i.sourcePath){var t=i.sourcePath;f.loadSVGFromURL(t,function(t){var e=t[0];e.setOptions(i),r&&r(e)})}else f.Object._fromObject("Path",i,r,"path")},f.Path.ATTRIBUTE_NAMES=f.SHARED_ATTRIBUTES.concat(["d"]),f.Path.fromElement=function(t,e,i){var r=f.parseAttributes(t,f.Path.ATTRIBUTE_NAMES);r.fromSVG=!0,e(new f.Path(r.d,n(r,i)))})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var h=t.fabric||(t.fabric={}),l=h.util.array.min,u=h.util.array.max;h.Group||(h.Group=h.util.createClass(h.Object,h.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(t,e,i){e=e||{},this._objects=[],i&&this.callSuper("initialize",e),this._objects=t||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;if(i)this._updateObjectsACoords();else{var n=e&&e.centerPoint;void 0!==e.originX&&(this.originX=e.originX),void 0!==e.originY&&(this.originY=e.originY),n||this._calcBounds(),this._updateObjectsCoords(n),delete e.centerPoint,this.callSuper("initialize",e)}this.setCoords()},_updateObjectsACoords:function(){for(var t=this._objects.length;t--;)this._objects[t].setCoords(!0)},_updateObjectsCoords:function(t){t=t||this.getCenterPoint();for(var e=this._objects.length;e--;)this._updateObjectCoords(this._objects[e],t)},_updateObjectCoords:function(t,e){var i=t.left,r=t.top;t.set({left:i-e.x,top:r-e.y}),t.group=this,t.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(t){var e=!!this.group;return this._restoreObjectsState(),h.util.resetObjectTransform(this),t&&(e&&h.util.removeTransformFromObject(t,this.group.calcTransformMatrix()),this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,e?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),h.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,e){var i=this._objects.length;if(this.useSetOnGroup)for(;i--;)this._objects[i].setOnGroup(t,e);if("canvas"===t)for(;i--;)this._objects[i]._set(t,e);h.Object.prototype._set.call(this,t,e)},toObject:function(r){var n=this.includeDefaultValues,t=this._objects.filter(function(t){return!t.excludeFromExport}).map(function(t){var e=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toObject(r);return t.includeDefaultValues=e,i}),e=h.Object.prototype.toObject.call(this,r);return e.objects=t,e},toDatalessObject:function(r){var t,e=this.sourcePath;if(e)t=e;else{var n=this.includeDefaultValues;t=this._objects.map(function(t){var e=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toDatalessObject(r);return t.includeDefaultValues=e,i})}var i=h.Object.prototype.toDatalessObject.call(this,r);return i.objects=t,i},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=h.Object.prototype.shouldCache.call(this);if(t)for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].willDrawShadow())return this.ownCaching=!1;return t},willDrawShadow:function(){if(h.Object.prototype.willDrawShadow.call(this))return!0;for(var t=0,e=this._objects.length;t<e;t++)if(this._objects[t].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(t){for(var e=0,i=this._objects.length;e<i;e++)this._objects[e].render(t);this._drawClipPath(t,this.clipPath)},isCacheDirty:function(t){if(this.callSuper("isCacheDirty",t))return!0;if(!this.statefullCache)return!1;for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].isCacheDirty(!0)){if(this._cacheCanvas){var r=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-r/2,-n/2,r,n)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(t){h.util.addTransformToObject(t,e),delete t.group,t.setCoords()}),this},destroy:function(){return this._objects.forEach(function(t){t.set("dirty",!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper("dispose"),this.forEachObject(function(t){t.dispose&&t.dispose()}),this._objects=[]},toActiveSelection:function(){if(this.canvas){var t=this._objects,e=this.canvas;this._objects=[];var i=this.toObject();delete i.objects;var r=new h.ActiveSelection([]);return r.set(i),r.type="activeSelection",e.remove(this),t.forEach(function(t){t.group=r,t.dirty=!0,e.add(t)}),r.canvas=e,r._objects=t,(e._activeObject=r).setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(t){t.setCoords(!0)}),this},_calcBounds:function(t){for(var e,i,r,n,s=[],o=[],a=["tr","br","bl","tl"],c=0,h=this._objects.length,l=a.length;c<h;++c){for(r=(e=this._objects[c]).calcACoords(),n=0;n<l;n++)i=a[n],s.push(r[i].x),o.push(r[i].y);e.aCoords=r}this._getBounds(s,o,t)},_getBounds:function(t,e,i){var r=new h.Point(l(t),l(e)),n=new h.Point(u(t),u(e)),s=r.y||0,o=r.x||0,a=n.x-r.x||0,c=n.y-r.y||0;this.width=a,this.height=c,i||this.setPositionByOrigin({x:o,y:s},"left","top")},_toSVG:function(t){for(var e=["<g ","COMMON_PARTS"," >\n"],i=0,r=this._objects.length;i<r;i++)e.push("\t\t",this._objects[i].toSVG(t));return e.push("</g>\n"),e},getSvgStyles:function(){var t=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,r=this._objects.length;i<r;i++)e.push("\t",this._objects[i].toClipPathSVG(t));return this._createBaseClipPathSVGMarkup(e,{reviver:t})}}),h.Group.fromObject=function(i,r){var n=i.objects,s=h.util.object.clone(i,!0);delete s.objects,"string"!=typeof n?h.util.enlivenObjects(n,function(t){var e=h.util.object.clone(i,!0);delete e.objects,h.util.enlivenObjectEnlivables(i,e,function(){r&&r(new h.Group(t,e,!0))})}):h.loadSVGFromURL(n,function(t){var e=h.util.groupSVGElements(t,i,n);e.set(s),r&&r(e)})})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var n=t.fabric||(t.fabric={});n.ActiveSelection||(n.ActiveSelection=n.util.createClass(n.Group,{type:"activeSelection",initialize:function(t,e){e=e||{},this._objects=t||[];for(var i=this._objects.length;i--;)this._objects[i].group=this;e.originX&&(this.originX=e.originX),e.originY&&(this.originY=e.originY),this._calcBounds(),this._updateObjectsCoords(),n.Object.prototype.initialize.call(this,e),this.setCoords()},toGroup:function(){var t=this._objects.concat();this._objects=[];var e=n.Object.prototype.toObject.call(this),i=new n.Group([]);if(delete e.type,i.set(e),t.forEach(function(t){t.canvas.remove(t),t.group=i}),i._objects=t,!this.canvas)return i;var r=this.canvas;return r.add(i),(r._activeObject=i).setCoords(),i},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(t,e,i){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",t,e),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var r=0,n=this._objects.length;r<n;r++)this._objects[r]._renderControls(t,i);t.restore()}}),n.ActiveSelection.fromObject=function(e,i){n.util.enlivenObjects(e.objects,function(t){delete e.objects,i&&i(new n.ActiveSelection(t,e,!0))})})}("undefined"!=typeof exports?exports:this),function(t){"use strict";var n=fabric.util.object.extend;t.fabric||(t.fabric={}),t.fabric.Image?fabric.warn("fabric.Image is already defined."):(fabric.Image=fabric.util.createClass(fabric.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:fabric.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:fabric.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(t,e){e||(e={}),this.filters=[],this.cacheKey="texture"+fabric.Object.__uid++,this.callSuper("initialize",e),this._initElement(t,e)},getElement:function(){return this._element||{}},setElement:function(t,e){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=t,this._originalElement=t,this._initConfig(e),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(t){var e=fabric.filterBackend;e&&e.evictCachesForKey&&e.evictCachesForKey(t)},dispose:function(){this.callSuper("dispose"),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(t){fabric.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var t=this.getElement();return{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}},_stroke:function(t){if(this.stroke&&0!==this.strokeWidth){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,-i),t.lineTo(e,-i),t.lineTo(e,i),t.lineTo(-e,i),t.lineTo(-e,-i),t.closePath()}},toObject:function(t){var e=[];this.filters.forEach(function(t){t&&e.push(t.toObject())});var i=n(this.callSuper("toObject",["cropX","cropY"].concat(t)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:e});return this.resizeFilter&&(i.resizeFilter=this.resizeFilter.toObject()),i},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var t,e=[],i=[],r=this._element,n=-this.width/2,s=-this.height/2,o="",a="";if(!r)return[];if(this.hasCrop()){var c=fabric.Object.__uid++;e.push('<clipPath id="imageCrop_'+c+'">\n','\t<rect x="'+n+'" y="'+s+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),o=' clip-path="url(#imageCrop_'+c+')" '}if(this.imageSmoothing||(a='" image-rendering="optimizeSpeed'),i.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',n-this.cropX,'" y="',s-this.cropY,'" width="',r.width||r.naturalWidth,'" height="',r.height||r.height,a,'"',o,"></image>\n"),this.stroke||this.strokeDashArray){var h=this.fill;this.fill=null,t=["\t<rect ",'x="',n,'" y="',s,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=h}return e="fill"!==this.paintFirst?e.concat(t,i):e.concat(i,t)},getSrc:function(t){var e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src"):e.src:this.src||""},setSrc:function(t,i,r){return fabric.util.loadImage(t,function(t,e){this.setElement(t,r),this._setWidthHeight(),i&&i(this,e)},this,r&&r.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),r=i.scaleX,n=i.scaleY,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||e<r&&e<n)return this._element=s,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=r,void(this._lastScaleY=n);fabric.filterBackend||(fabric.filterBackend=fabric.initFilterBackend());var o=fabric.util.createCanvasElement(),a=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,c=s.width,h=s.height;o.width=c,o.height=h,this._element=o,this._lastScaleX=t.scaleX=r,this._lastScaleY=t.scaleY=n,fabric.filterBackend.applyFilters([t],s,c,h,this._element,a),this._filterScalingX=o.width/this._originalElement.width,this._filterScalingY=o.height/this._originalElement.height},applyFilters:function(t){if(t=(t=t||this.filters||[]).filter(function(t){return t&&!t.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===t.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var e=this._originalElement,i=e.naturalWidth||e.width,r=e.naturalHeight||e.height;if(this._element===this._originalElement){var n=fabric.util.createCanvasElement();n.width=i,n.height=r,this._element=n,this._filteredEl=n}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,r),this._lastScaleX=1,this._lastScaleY=1;return fabric.filterBackend||(fabric.filterBackend=fabric.initFilterBackend()),fabric.filterBackend.applyFilters(t,this._originalElement,i,r,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(t){fabric.util.setImageSmoothing(t,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)},drawCacheOnCanvas:function(t){fabric.util.setImageSmoothing(t,this.imageSmoothing),fabric.Object.prototype.drawCacheOnCanvas.call(this,t)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(t){var e=this._element;if(e){var i=this._filterScalingX,r=this._filterScalingY,n=this.width,s=this.height,o=Math.min,a=Math.max,c=a(this.cropX,0),h=a(this.cropY,0),l=e.naturalWidth||e.width,u=e.naturalHeight||e.height,f=c*i,d=h*r,g=o(n*i,l-f),p=o(s*r,u-d),v=-n/2,m=-s/2,b=o(n,l/i-c),y=o(s,u/r-h);e&&t.drawImage(e,f,d,g,p,v,m,b,y)}},_needsResize:function(){var t=this.getTotalObjectScaling();return t.scaleX!==this._lastScaleX||t.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(t,e){this.setElement(fabric.util.getById(t),e),fabric.util.addClass(this.getElement(),fabric.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t)},_initFilters:function(t,e){t&&t.length?fabric.util.enlivenObjects(t,function(t){e&&e(t)},"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){t||(t={});var e=this.getElement();this.width=t.width||e.naturalWidth||e.width||0,this.height=t.height||e.naturalHeight||e.height||0},parsePreserveAspectRatioAttribute:function(){var t,e=fabric.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,r=this._element.height,n=1,s=1,o=0,a=0,c=0,h=0,l=this.width,u=this.height,f={width:l,height:u};return!e||"none"===e.alignX&&"none"===e.alignY?(n=l/i,s=u/r):("meet"===e.meetOrSlice&&(t=(l-i*(n=s=fabric.util.findScaleToFit(this._element,f)))/2,"Min"===e.alignX&&(o=-t),"Max"===e.alignX&&(o=t),t=(u-r*s)/2,"Min"===e.alignY&&(a=-t),"Max"===e.alignY&&(a=t)),"slice"===e.meetOrSlice&&(t=i-l/(n=s=fabric.util.findScaleToCover(this._element,f)),"Mid"===e.alignX&&(c=t/2),"Max"===e.alignX&&(c=t),t=r-u/s,"Mid"===e.alignY&&(h=t/2),"Max"===e.alignY&&(h=t),i=l/n,r=u/s)),{width:i,height:r,scaleX:n,scaleY:s,offsetLeft:o,offsetTop:a,cropX:c,cropY:h}}}),fabric.Image.CSS_CANVAS="canvas-img",fabric.Image.prototype.getSvgSrc=fabric.Image.prototype.getSrc,fabric.Image.fromObject=function(t,i){var r=fabric.util.object.clone(t);fabric.util.loadImage(r.src,function(e,t){t?i&&i(null,!0):fabric.Image.prototype._initFilters.call(r,r.filters,function(t){r.filters=t||[],fabric.Image.prototype._initFilters.call(r,[r.resizeFilter],function(t){r.resizeFilter=t[0],fabric.util.enlivenObjectEnlivables(r,r,function(){var t=new fabric.Image(e,r);i(t,!1)})})})},null,r.crossOrigin)},fabric.Image.fromURL=function(t,i,r){fabric.util.loadImage(t,function(t,e){i&&i(new fabric.Image(t,r),e)},null,r&&r.crossOrigin)},fabric.Image.ATTRIBUTE_NAMES=fabric.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),fabric.Image.fromElement=function(t,e,i){var r=fabric.parseAttributes(t,fabric.Image.ATTRIBUTE_NAMES);fabric.Image.fromURL(r["xlink:href"],e,n(i?fabric.util.object.clone(i):{},r))})}("undefined"!=typeof exports?exports:this),fabric.util.object.extend(fabric.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.angle%360;return 0<t?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(t){var e=function(){},i=(t=t||{}).onComplete||e,r=t.onChange||e,n=this;return fabric.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){n.rotate(t),r()},onComplete:function(){n.setCoords(),i()}})}}),fabric.util.object.extend(fabric.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){"use strict";function t(t){t&&t.tileSize&&(this.tileSize=t.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}fabric.isWebglSupported=function(t){if(fabric.isLikelyNode)return!1;t=t||fabric.WebglFilterBackend.prototype.tileSize;var e,i,r,n=document.createElement("canvas"),s=n.getContext("webgl")||n.getContext("experimental-webgl"),o=!1;if(s){fabric.maxTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),o=fabric.maxTextureSize>=t;for(var a=["highp","mediump","lowp"],c=0;c<3;c++)if(void 0,i="precision "+a[c]+" float;\nvoid main(){}",r=(e=s).createShader(e.FRAGMENT_SHADER),e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)){fabric.webGlPrecision=a[c];break}}return this.isSupported=o},(fabric.WebglFilterBackend=t).prototype={tileSize:2048,resources:{},setupGLContext:function(t,e){this.dispose(),this.createWebGLCanvas(t,e),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(t,e)},chooseFastestCopyGLTo2DMethod:function(t,e){var i,r=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(t){i=!1}var n="undefined"!=typeof ArrayBuffer,s="undefined"!=typeof Uint8ClampedArray;if(r&&i&&n&&s){var o=fabric.util.createCanvasElement(),a=new ArrayBuffer(t*e*4);if(fabric.forceGLPutImageData)return this.imageBuffer=a,void(this.copyGLTo2D=copyGLTo2DPutImageData);var c,h,l={imageBuffer:a,destinationWidth:t,destinationHeight:e,targetCanvas:o};o.width=t,o.height=e,c=window.performance.now(),copyGLTo2DDrawImage.call(l,this.gl,l),h=window.performance.now()-c,c=window.performance.now(),copyGLTo2DPutImageData.call(l,this.gl,l),window.performance.now()-c<h?(this.imageBuffer=a,this.copyGLTo2D=copyGLTo2DPutImageData):this.copyGLTo2D=copyGLTo2DDrawImage}},createWebGLCanvas:function(t,e){var i=fabric.util.createCanvasElement();i.width=t,i.height=e;var r={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},n=i.getContext("webgl",r);n||(n=i.getContext("experimental-webgl",r)),n&&(n.clearColor(0,0,0,0),this.canvas=i,this.gl=n)},applyFilters:function(t,e,i,r,n,s){var o,a=this.gl;s&&(o=this.getCachedTexture(s,e));var c={originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,sourceWidth:i,sourceHeight:r,destinationWidth:i,destinationHeight:r,context:a,sourceTexture:this.createTexture(a,i,r,!o&&e),targetTexture:this.createTexture(a,i,r),originalTexture:o||this.createTexture(a,i,r,!o&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:n},h=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,h),t.forEach(function(t){t&&t.applyTo(c)}),resizeCanvasIfNeeded(c),this.copyGLTo2D(a,c),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(c.sourceTexture),a.deleteTexture(c.targetTexture),a.deleteFramebuffer(h),n.getContext("2d").setTransform(1,0,0,1,0,0),c},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(t,e,i,r){var n=t.createTexture();return t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),n},getCachedTexture:function(t,e){if(this.textureCache[t])return this.textureCache[t];var i=this.createTexture(this.gl,e.width,e.height,e);return this.textureCache[t]=i},evictCachesForKey:function(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])},copyGLTo2D:copyGLTo2DDrawImage,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var t=this.gl,e={renderer:"",vendor:""};if(!t)return e;var i=t.getExtension("WEBGL_debug_renderer_info");if(i){var r=t.getParameter(i.UNMASKED_RENDERER_WEBGL),n=t.getParameter(i.UNMASKED_VENDOR_WEBGL);r&&(e.renderer=r.toLowerCase()),n&&(e.vendor=n.toLowerCase())}return this.gpuInfo=e}}}(),function(){"use strict";var t=function(){};function e(){}(fabric.Canvas2dFilterBackend=e).prototype={evictCachesForKey:t,dispose:t,clearWebGLCaches:t,resources:{},applyFilters:function(t,e,i,r,n){var s=n.getContext("2d");s.drawImage(e,0,0,i,r);var o={sourceWidth:i,sourceHeight:r,imageData:s.getImageData(0,0,i,r),originalEl:e,originalImageData:s.getImageData(0,0,i,r),canvasEl:n,ctx:s,filterBackend:this};return t.forEach(function(t){t.applyTo(o)}),o.imageData.width===i&&o.imageData.height===r||(n.width=o.imageData.width,n.height=o.imageData.height),s.putImageData(o.imageData,0,0),o}}}(),fabric.Image=fabric.Image||{},fabric.Image.filters=fabric.Image.filters||{},fabric.Image.filters.BaseFilter=fabric.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(t){t&&this.setOptions(t)},setOptions:function(t){for(var e in t)this[e]=t[e]},createProgram:function(t,e,i){e=e||this.fragmentSource,i=i||this.vertexSource,"highp"!==fabric.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+fabric.webGlPrecision+" float"));var r=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+t.getShaderInfoLog(r));var n=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(n,e),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(n));var s=t.createProgram();if(t.attachShader(s,r),t.attachShader(s,n),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(s));var o=this.getAttributeLocations(t,s),a=this.getUniformLocations(t,s)||{};return a.uStepW=t.getUniformLocation(s,"uStepW"),a.uStepH=t.getUniformLocation(s,"uStepH"),{program:s,attributeLocations:o,uniformLocations:a}},getAttributeLocations:function(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(t,e,i){var r=e.aPosition,n=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,n),t.enableVertexAttribArray(r),t.vertexAttribPointer(r,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW)},_setupFrameBuffer:function(t){var e,i,r=t.context;1<t.passes?(e=t.destinationWidth,i=t.destinationHeight,t.sourceWidth===e&&t.sourceHeight===i||(r.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(r,e,i)),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t.targetTexture,0)):(r.bindFramebuffer(r.FRAMEBUFFER,null),r.finish())},_swapTextures:function(t){t.passes--,t.pass++;var e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e},isNeutralState:function(){var t=this.mainParameter,e=fabric.Image.filters[this.type].prototype;if(t){if(Array.isArray(e[t])){for(var i=e[t].length;i--;)if(this[t][i]!==e[t][i])return!1;return!0}return e[t]===this[t]}return!1},applyTo:function(t){t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},retrieveShader:function(t){return t.programCache.hasOwnProperty(this.type)||(t.programCache[this.type]=this.createProgram(t.context)),t.programCache[this.type]},applyToWebGL:function(t){var e=t.context,i=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(i.program),this.sendAttributeData(e,i.attributeLocations,t.aPosition),e.uniform1f(i.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(i.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,i.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(t,e,i){t.activeTexture(i),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)},unbindAdditionalTexture:function(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(t){this[this.mainParameter]=t},sendUniformData:function(){},createHelpLayer:function(t){if(!t.helpLayer){var e=document.createElement("canvas");e.width=t.sourceWidth,e.height=t.sourceHeight,t.helpLayer=e}},toObject:function(){var t={type:this.type},e=this.mainParameter;return e&&(t[e]=this[e]),t},toJSON:function(){return this.toObject()}}),fabric.Image.filters.BaseFilter.fromObject=function(t,e){var i=new fabric.Image.filters[t.type](t);return e&&e(i),i},function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.ColorMatrix=r(i.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(t){this.callSuper("initialize",t),this.matrix=this.matrix.slice(0)},applyTo2d:function(t){var e,i,r,n,s,o=t.imageData.data,a=o.length,c=this.matrix,h=this.colorsOnly;for(s=0;s<a;s+=4)e=o[s],i=o[s+1],r=o[s+2],h?(o[s]=e*c[0]+i*c[1]+r*c[2]+255*c[4],o[s+1]=e*c[5]+i*c[6]+r*c[7]+255*c[9],o[s+2]=e*c[10]+i*c[11]+r*c[12]+255*c[14]):(n=o[s+3],o[s]=e*c[0]+i*c[1]+r*c[2]+n*c[3]+255*c[4],o[s+1]=e*c[5]+i*c[6]+r*c[7]+n*c[8]+255*c[9],o[s+2]=e*c[10]+i*c[11]+r*c[12]+n*c[13]+255*c[14],o[s+3]=e*c[15]+i*c[16]+r*c[17]+n*c[18]+255*c[19])},getUniformLocations:function(t,e){return{uColorMatrix:t.getUniformLocation(e,"uColorMatrix"),uConstants:t.getUniformLocation(e,"uConstants")}},sendUniformData:function(t,e){var i=this.matrix,r=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],n=[i[4],i[9],i[14],i[19]];t.uniformMatrix4fv(e.uColorMatrix,!1,r),t.uniform4fv(e.uConstants,n)}}),e.Image.filters.ColorMatrix.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Brightness=r(i.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(t){if(0!==this.brightness){var e,i=t.imageData.data,r=i.length,n=Math.round(255*this.brightness);for(e=0;e<r;e+=4)i[e]=i[e]+n,i[e+1]=i[e+1]+n,i[e+2]=i[e+2]+n}},getUniformLocations:function(t,e){return{uBrightness:t.getUniformLocation(e,"uBrightness")}},sendUniformData:function(t,e){t.uniform1f(e.uBrightness,this.brightness)}}),e.Image.filters.Brightness.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,r=e.Image.filters,n=e.util.createClass;r.Convolute=n(r.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(t){var e=Math.sqrt(this.matrix.length),i=this.type+"_"+e+"_"+(this.opaque?1:0),r=this.fragmentSource[i];return t.programCache.hasOwnProperty(i)||(t.programCache[i]=this.createProgram(t.context,r)),t.programCache[i]},applyTo2d:function(t){var e,i,r,n,s,o,a,c,h,l,u,f,d,g=t.imageData,p=g.data,v=this.matrix,m=Math.round(Math.sqrt(v.length)),b=Math.floor(m/2),y=g.width,_=g.height,x=t.ctx.createImageData(y,_),C=x.data,S=this.opaque?1:0;for(u=0;u<_;u++)for(l=0;l<y;l++){for(s=4*(u*y+l),d=n=r=i=e=0;d<m;d++)for(f=0;f<m;f++)o=l+f-b,(a=u+d-b)<0||_<=a||o<0||y<=o||(c=4*(a*y+o),h=v[d*m+f],e+=p[c]*h,i+=p[c+1]*h,r+=p[c+2]*h,S||(n+=p[c+3]*h));C[s]=e,C[s+1]=i,C[s+2]=r,C[s+3]=S?p[s+3]:n}t.imageData=x},getUniformLocations:function(t,e){return{uMatrix:t.getUniformLocation(e,"uMatrix"),uOpaque:t.getUniformLocation(e,"uOpaque"),uHalfSize:t.getUniformLocation(e,"uHalfSize"),uSize:t.getUniformLocation(e,"uSize")}},sendUniformData:function(t,e){t.uniform1fv(e.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),e.Image.filters.Convolute.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Grayscale=r(i.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(t){var e,i,r=t.imageData.data,n=r.length,s=this.mode;for(e=0;e<n;e+=4)"average"===s?i=(r[e]+r[e+1]+r[e+2])/3:"lightness"===s?i=(Math.min(r[e],r[e+1],r[e+2])+Math.max(r[e],r[e+1],r[e+2]))/2:"luminosity"===s&&(i=.21*r[e]+.72*r[e+1]+.07*r[e+2]),r[e]=i,r[e+1]=i,r[e+2]=i},retrieveShader:function(t){var e=this.type+"_"+this.mode;if(!t.programCache.hasOwnProperty(e)){var i=this.fragmentSource[this.mode];t.programCache[e]=this.createProgram(t.context,i)}return t.programCache[e]},getUniformLocations:function(t,e){return{uMode:t.getUniformLocation(e,"uMode")}},sendUniformData:function(t,e){t.uniform1i(e.uMode,1)},isNeutralState:function(){return!1}}),e.Image.filters.Grayscale.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Invert=r(i.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(t){var e,i=t.imageData.data,r=i.length;for(e=0;e<r;e+=4)i[e]=255-i[e],i[e+1]=255-i[e+1],i[e+2]=255-i[e+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(t,e){return{uInvert:t.getUniformLocation(e,"uInvert")}},sendUniformData:function(t,e){t.uniform1i(e.uInvert,this.invert)}}),e.Image.filters.Invert.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,r=e.Image.filters,n=e.util.createClass;r.Noise=n(r.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(t){if(0!==this.noise){var e,i,r=t.imageData.data,n=r.length,s=this.noise;for(e=0,n=r.length;e<n;e+=4)i=(.5-Math.random())*s,r[e]+=i,r[e+1]+=i,r[e+2]+=i}},getUniformLocations:function(t,e){return{uNoise:t.getUniformLocation(e,"uNoise"),uSeed:t.getUniformLocation(e,"uSeed")}},sendUniformData:function(t,e){t.uniform1f(e.uNoise,this.noise/255),t.uniform1f(e.uSeed,Math.random())},toObject:function(){return i(this.callSuper("toObject"),{noise:this.noise})}}),e.Image.filters.Noise.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Pixelate=r(i.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(t){var e,i,r,n,s,o,a,c,h,l,u,f=t.imageData,d=f.data,g=f.height,p=f.width;for(i=0;i<g;i+=this.blocksize)for(r=0;r<p;r+=this.blocksize)for(n=d[e=4*i*p+4*r],s=d[e+1],o=d[e+2],a=d[e+3],l=Math.min(i+this.blocksize,g),u=Math.min(r+this.blocksize,p),c=i;c<l;c++)for(h=r;h<u;h++)d[e=4*c*p+4*h]=n,d[e+1]=s,d[e+2]=o,d[e+3]=a},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(t,e){return{uBlocksize:t.getUniformLocation(e,"uBlocksize"),uStepW:t.getUniformLocation(e,"uStepW"),uStepH:t.getUniformLocation(e,"uStepH")}},sendUniformData:function(t,e){t.uniform1f(e.uBlocksize,this.blocksize)}}),e.Image.filters.Pixelate.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var l=t.fabric||(t.fabric={}),e=l.util.object.extend,i=l.Image.filters,r=l.util.createClass;i.RemoveColor=r(i.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(t){var e,i,r,n,s=t.imageData.data,o=255*this.distance,a=new l.Color(this.color).getSource(),c=[a[0]-o,a[1]-o,a[2]-o],h=[a[0]+o,a[1]+o,a[2]+o];for(e=0;e<s.length;e+=4)i=s[e],r=s[e+1],n=s[e+2],c[0]<i&&c[1]<r&&c[2]<n&&i<h[0]&&r<h[1]&&n<h[2]&&(s[e+3]=0)},getUniformLocations:function(t,e){return{uLow:t.getUniformLocation(e,"uLow"),uHigh:t.getUniformLocation(e,"uHigh")}},sendUniformData:function(t,e){var i=new l.Color(this.color).getSource(),r=parseFloat(this.distance),n=[0+i[0]/255-r,0+i[1]/255-r,0+i[2]/255-r,1],s=[i[0]/255+r,i[1]/255+r,i[2]/255+r,1];t.uniform4fv(e.uLow,n),t.uniform4fv(e.uHigh,s)},toObject:function(){return e(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),l.Image.filters.RemoveColor.fromObject=l.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass,n={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var s in n)i[s]=r(i.ColorMatrix,{type:s,matrix:n[s],mainParameter:!1,colorsOnly:!0}),e.Image.filters[s].fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var f=t.fabric,e=f.Image.filters,i=f.util.createClass;e.BlendColor=i(e.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(t){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[t]+"}\n}"},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.buildSource(this.mode),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},applyTo2d:function(t){var e,i,r,n,s,o,a,c=t.imageData.data,h=c.length,l=1-this.alpha;e=(a=new f.Color(this.color).getSource())[0]*this.alpha,i=a[1]*this.alpha,r=a[2]*this.alpha;for(var u=0;u<h;u+=4)switch(n=c[u],s=c[u+1],o=c[u+2],this.mode){case"multiply":c[u]=n*e/255,c[u+1]=s*i/255,c[u+2]=o*r/255;break;case"screen":c[u]=255-(255-n)*(255-e)/255,c[u+1]=255-(255-s)*(255-i)/255,c[u+2]=255-(255-o)*(255-r)/255;break;case"add":c[u]=n+e,c[u+1]=s+i,c[u+2]=o+r;break;case"diff":case"difference":c[u]=Math.abs(n-e),c[u+1]=Math.abs(s-i),c[u+2]=Math.abs(o-r);break;case"subtract":c[u]=n-e,c[u+1]=s-i,c[u+2]=o-r;break;case"darken":c[u]=Math.min(n,e),c[u+1]=Math.min(s,i),c[u+2]=Math.min(o,r);break;case"lighten":c[u]=Math.max(n,e),c[u+1]=Math.max(s,i),c[u+2]=Math.max(o,r);break;case"overlay":c[u]=e<128?2*n*e/255:255-2*(255-n)*(255-e)/255,c[u+1]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255,c[u+2]=r<128?2*o*r/255:255-2*(255-o)*(255-r)/255;break;case"exclusion":c[u]=e+n-2*e*n/255,c[u+1]=i+s-2*i*s/255,c[u+2]=r+o-2*r*o/255;break;case"tint":c[u]=e+n*l,c[u+1]=i+s*l,c[u+2]=r+o*l}},getUniformLocations:function(t,e){return{uColor:t.getUniformLocation(e,"uColor")}},sendUniformData:function(t,e){var i=new f.Color(this.color).getSource();i[0]=this.alpha*i[0]/255,i[1]=this.alpha*i[1]/255,i[2]=this.alpha*i[2]/255,i[3]=this.alpha,t.uniform4fv(e.uColor,i)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),f.Image.filters.BlendColor.fromObject=f.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var _=t.fabric,e=_.Image.filters,i=_.util.createClass;e.BlendImage=i(e.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(t){var e=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return t.programCache.hasOwnProperty(e)||(t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyToWebGL:function(t){var e=t.context,i=this.createTexture(t.filterBackend,this.image);this.bindAdditionalTexture(e,i,e.TEXTURE1),this.callSuper("applyToWebGL",t),this.unbindAdditionalTexture(e,e.TEXTURE1)},createTexture:function(t,e){return t.getCachedTexture(e.cacheKey,e._element)},calculateMatrix:function(){var t=this.image,e=t._element.width,i=t._element.height;return[1/t.scaleX,0,0,0,1/t.scaleY,0,-t.left/e,-t.top/i,1]},applyTo2d:function(t){var e,i,r,n,s,o,a,c,h,l,u,f=t.imageData,d=t.filterBackend.resources,g=f.data,p=g.length,v=f.width,m=f.height,b=this.image;d.blendImage||(d.blendImage=_.util.createCanvasElement()),l=(h=d.blendImage).getContext("2d"),h.width!==v||h.height!==m?(h.width=v,h.height=m):l.clearRect(0,0,v,m),l.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),l.drawImage(b._element,0,0,v,m),u=l.getImageData(0,0,v,m).data;for(var y=0;y<p;y+=4)switch(s=g[y],o=g[y+1],a=g[y+2],c=g[y+3],e=u[y],i=u[y+1],r=u[y+2],n=u[y+3],this.mode){case"multiply":g[y]=s*e/255,g[y+1]=o*i/255,g[y+2]=a*r/255,g[y+3]=c*n/255;break;case"mask":g[y+3]=n}},getUniformLocations:function(t,e){return{uTransformMatrix:t.getUniformLocation(e,"uTransformMatrix"),uImage:t.getUniformLocation(e,"uImage")}},sendUniformData:function(t,e){var i=this.calculateMatrix();t.uniform1i(e.uImage,1),t.uniformMatrix3fv(e.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),_.Image.filters.BlendImage.fromObject=function(i,r){_.Image.fromObject(i.image,function(t){var e=_.util.object.clone(i);e.image=t,r(new _.Image.filters.BlendImage(e))})}}("undefined"!=typeof exports?exports:this),function(t){"use strict";var m=t.fabric||(t.fabric={}),j=Math.pow,A=Math.floor,M=Math.sqrt,F=Math.abs,h=Math.round,r=Math.sin,I=Math.ceil,e=m.Image.filters,i=m.util.createClass;e.Resize=i(e.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(t,e){return{uDelta:t.getUniformLocation(e,"uDelta"),uTaps:t.getUniformLocation(e,"uTaps")}},sendUniformData:function(t,e){t.uniform2fv(e.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),t.uniform1fv(e.uTaps,this.taps)},retrieveShader:function(t){var e=this.getFilterWindow(),i=this.type+"_"+e;if(!t.programCache.hasOwnProperty(i)){var r=this.generateShader(e);t.programCache[i]=this.createProgram(t.context,r)}return t.programCache[i]},getFilterWindow:function(){var t=this.tempScale;return Math.ceil(this.lanczosLobes/t)},getTaps:function(){for(var t=this.lanczosCreate(this.lanczosLobes),e=this.tempScale,i=this.getFilterWindow(),r=new Array(i),n=1;n<=i;n++)r[n-1]=t(n*e);return r},generateShader:function(t){for(var e=new Array(t),i=this.fragmentSourceTOP,r=1;r<=t;r++)e[r-1]=r+".0 * uDelta";return i+="uniform float uTaps["+t+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",e.forEach(function(t,e){i+=" color += texture2D(uTexture, vTexCoord + "+t+") * uTaps["+e+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+t+") * uTaps["+e+"];\n",i+=" sum += 2.0 * uTaps["+e+"];\n"}),i+=" gl_FragColor = color / sum;\n",i+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(t){t.webgl?(t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceHeight=t.destinationHeight):this.applyTo2d(t)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(i){return function(t){if(i<=t||t<=-i)return 0;if(t<1.1920929e-7&&-1.1920929e-7<t)return 1;var e=(t*=Math.PI)/i;return r(t)/t*r(e)/e}},applyTo2d:function(t){var e=t.imageData,i=this.scaleX,r=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/r;var n,s=e.width,o=e.height,a=h(s*i),c=h(o*r);"sliceHack"===this.resizeType?n=this.sliceByTwo(t,s,o,a,c):"hermite"===this.resizeType?n=this.hermiteFastResize(t,s,o,a,c):"bilinear"===this.resizeType?n=this.bilinearFiltering(t,s,o,a,c):"lanczos"===this.resizeType&&(n=this.lanczosResize(t,s,o,a,c)),t.imageData=n},sliceByTwo:function(t,e,i,r,n){var s,o,a=t.imageData,c=!1,h=!1,l=.5*e,u=.5*i,f=m.filterBackend.resources,d=0,g=0,p=e,v=0;for(f.sliceByTwo||(f.sliceByTwo=document.createElement("canvas")),((s=f.sliceByTwo).width<1.5*e||s.height<i)&&(s.width=1.5*e,s.height=i),(o=s.getContext("2d")).clearRect(0,0,1.5*e,i),o.putImageData(a,0,0),r=A(r),n=A(n);!c||!h;)i=u,r<A(.5*(e=l))?l=A(.5*l):(l=r,c=!0),n<A(.5*u)?u=A(.5*u):(u=n,h=!0),o.drawImage(s,d,g,e,i,p,v,l,u),d=p,g=v,v+=u;return o.getImageData(d,g,r,n)},lanczosResize:function(t,g,p,v,m){var b=t.imageData.data,y=t.ctx.createImageData(v,m),_=y.data,x=this.lanczosCreate(this.lanczosLobes),C=this.rcpScaleX,S=this.rcpScaleY,T=2/this.rcpScaleX,w=2/this.rcpScaleY,O=I(C*this.lanczosLobes/2),k=I(S*this.lanczosLobes/2),P={},E={},D={};return function t(e){var i,r,n,s,o,a,c,h,l,u,f;for(E.x=(e+.5)*C,D.x=A(E.x),i=0;i<m;i++){for(E.y=(i+.5)*S,D.y=A(E.y),l=h=c=a=o=0,r=D.x-O;r<=D.x+O;r++)if(!(r<0||g<=r)){u=A(1e3*F(r-E.x)),P[u]||(P[u]={});for(var d=D.y-k;d<=D.y+k;d++)d<0||p<=d||(f=A(1e3*F(d-E.y)),P[u][f]||(P[u][f]=x(M(j(u*T,2)+j(f*w,2))/1e3)),0<(n=P[u][f])&&(o+=n,a+=n*b[s=4*(d*g+r)],c+=n*b[s+1],h+=n*b[s+2],l+=n*b[s+3]))}_[s=4*(i*v+e)]=a/o,_[s+1]=c/o,_[s+2]=h/o,_[s+3]=l/o}return++e<v?t(e):y}(0)},bilinearFiltering:function(t,e,i,r,n){var s,o,a,c,h,l,u,f,d,g=0,p=this.rcpScaleX,v=this.rcpScaleY,m=4*(e-1),b=t.imageData.data,y=t.ctx.createImageData(r,n),_=y.data;for(a=0;a<n;a++)for(c=0;c<r;c++)for(h=p*c-(s=A(p*c)),l=v*a-(o=A(v*a)),d=4*(o*e+s),u=0;u<4;u++)f=b[d+u]*(1-h)*(1-l)+b[d+4+u]*h*(1-l)+b[d+m+u]*l*(1-h)+b[d+m+4+u]*h*l,_[g++]=f;return y},hermiteFastResize:function(t,e,i,r,n){for(var s=this.rcpScaleX,o=this.rcpScaleY,a=I(s/2),c=I(o/2),h=t.imageData.data,l=t.ctx.createImageData(r,n),u=l.data,f=0;f<n;f++)for(var d=0;d<r;d++){for(var g=4*(d+f*r),p=0,v=0,m=0,b=0,y=0,_=0,x=0,C=(f+.5)*o,S=A(f*o);S<(f+1)*o;S++)for(var T=F(C-(S+.5))/c,w=(d+.5)*s,O=T*T,k=A(d*s);k<(d+1)*s;k++){var P=F(w-(k+.5))/a,E=M(O+P*P);1<E&&E<-1||0<(p=2*E*E*E-3*E*E+1)&&(x+=p*h[(P=4*(k+S*e))+3],m+=p,h[P+3]<255&&(p=p*h[P+3]/250),b+=p*h[P],y+=p*h[P+1],_+=p*h[P+2],v+=p)}u[g]=b/v,u[g+1]=y/v,u[g+2]=_/v,u[g+3]=x/m}return l},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),m.Image.filters.Resize.fromObject=m.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Contrast=r(i.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(t){if(0!==this.contrast){var e,i=t.imageData.data,r=i.length,n=Math.floor(255*this.contrast),s=259*(n+255)/(255*(259-n));for(e=0;e<r;e+=4)i[e]=s*(i[e]-128)+128,i[e+1]=s*(i[e+1]-128)+128,i[e+2]=s*(i[e+2]-128)+128}},getUniformLocations:function(t,e){return{uContrast:t.getUniformLocation(e,"uContrast")}},sendUniformData:function(t,e){t.uniform1f(e.uContrast,this.contrast)}}),e.Image.filters.Contrast.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Saturation=r(i.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(t){if(0!==this.saturation){var e,i,r=t.imageData.data,n=r.length,s=-this.saturation;for(e=0;e<n;e+=4)i=Math.max(r[e],r[e+1],r[e+2]),r[e]+=i!==r[e]?(i-r[e])*s:0,r[e+1]+=i!==r[e+1]?(i-r[e+1])*s:0,r[e+2]+=i!==r[e+2]?(i-r[e+2])*s:0}},getUniformLocations:function(t,e){return{uSaturation:t.getUniformLocation(e,"uSaturation")}},sendUniformData:function(t,e){t.uniform1f(e.uSaturation,-this.saturation)}}),e.Image.filters.Saturation.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Vibrance=r(i.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(t){if(0!==this.vibrance){var e,i,r,n,s=t.imageData.data,o=s.length,a=-this.vibrance;for(e=0;e<o;e+=4)i=Math.max(s[e],s[e+1],s[e+2]),r=(s[e]+s[e+1]+s[e+2])/3,n=2*Math.abs(i-r)/255*a,s[e]+=i!==s[e]?(i-s[e])*n:0,s[e+1]+=i!==s[e+1]?(i-s[e+1])*n:0,s[e+2]+=i!==s[e+2]?(i-s[e+2])*n:0}},getUniformLocations:function(t,e){return{uVibrance:t.getUniformLocation(e,"uVibrance")}},sendUniformData:function(t,e){t.uniform1f(e.uVibrance,-this.vibrance)}}),e.Image.filters.Vibrance.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var g=t.fabric||(t.fabric={}),e=g.Image.filters,i=g.util.createClass;e.Blur=i(e.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(t){t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},applyTo2d:function(t){t.imageData=this.simpleBlur(t)},simpleBlur:function(t){var e,i,r=t.filterBackend.resources,n=t.imageData.width,s=t.imageData.height;r.blurLayer1||(r.blurLayer1=g.util.createCanvasElement(),r.blurLayer2=g.util.createCanvasElement()),e=r.blurLayer1,i=r.blurLayer2,e.width===n&&e.height===s||(i.width=e.width=n,i.height=e.height=s);var o,a,c,h,l=e.getContext("2d"),u=i.getContext("2d"),f=.06*this.blur*.5;for(l.putImageData(t.imageData,0,0),u.clearRect(0,0,n,s),h=-15;h<=15;h++)c=f*(a=h/15)*n+(o=(Math.random()-.5)/4),u.globalAlpha=1-Math.abs(a),u.drawImage(e,c,o),l.drawImage(i,0,0),u.globalAlpha=1,u.clearRect(0,0,i.width,i.height);for(h=-15;h<=15;h++)c=f*(a=h/15)*s+(o=(Math.random()-.5)/4),u.globalAlpha=1-Math.abs(a),u.drawImage(e,o,c),l.drawImage(i,0,0),u.globalAlpha=1,u.clearRect(0,0,i.width,i.height);t.ctx.drawImage(e,0,0);var d=t.ctx.getImageData(0,0,e.width,e.height);return l.globalAlpha=1,l.clearRect(0,0,e.width,e.height),d},getUniformLocations:function(t,e){return{delta:t.getUniformLocation(e,"uDelta")}},sendUniformData:function(t,e){var i=this.chooseRightDelta();t.uniform2fv(e.delta,i)},chooseRightDelta:function(){var t,e=1,i=[0,0];return this.horizontal?1<this.aspectRatio&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?i[0]=t:i[1]=t,i}}),e.Blur.fromObject=g.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,r=e.util.createClass;i.Gamma=r(i.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(t){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e,i=t.imageData.data,r=this.gamma,n=i.length,s=1/r[0],o=1/r[1],a=1/r[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,n=256;e<n;e++)this.rVals[e]=255*Math.pow(e/255,s),this.gVals[e]=255*Math.pow(e/255,o),this.bVals[e]=255*Math.pow(e/255,a);for(e=0,n=i.length;e<n;e+=4)i[e]=this.rVals[i[e]],i[e+1]=this.gVals[i[e+1]],i[e+2]=this.bVals[i[e+2]]},getUniformLocations:function(t,e){return{uGamma:t.getUniformLocation(e,"uGamma")}},sendUniformData:function(t,e){t.uniform3fv(e.uGamma,this.gamma)}}),e.Image.filters.Gamma.fromObject=e.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var n=t.fabric||(t.fabric={}),e=n.Image.filters,i=n.util.createClass;e.Composed=i(e.BaseFilter,{type:"Composed",subFilters:[],initialize:function(t){this.callSuper("initialize",t),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return n.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(t){return t.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(t){return!t.isNeutralState()})}}),n.Image.filters.Composed.fromObject=function(t,e){var i=(t.subFilters||[]).map(function(t){return new n.Image.filters[t.type](t)}),r=new n.Image.filters.Composed({subFilters:i});return e&&e(r),r}}("undefined"!=typeof exports?exports:this),function(t){"use strict";var s=t.fabric||(t.fabric={}),e=s.Image.filters,i=s.util.createClass;e.HueRotation=i(e.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var t=this.rotation*Math.PI,e=s.util.cos(t),i=s.util.sin(t),r=Math.sqrt(1/3)*i,n=1-e;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=e+n/3,this.matrix[1]=1/3*n-r,this.matrix[2]=1/3*n+r,this.matrix[5]=1/3*n+r,this.matrix[6]=e+1/3*n,this.matrix[7]=1/3*n-r,this.matrix[10]=1/3*n-r,this.matrix[11]=1/3*n+r,this.matrix[12]=e+1/3*n},isNeutralState:function(t){return this.calculateMatrix(),e.BaseFilter.prototype.isNeutralState.call(this,t)},applyTo:function(t){this.calculateMatrix(),e.BaseFilter.prototype.applyTo.call(this,t)}}),s.Image.filters.HueRotation.fromObject=s.Image.filters.BaseFilter.fromObject}("undefined"!=typeof exports?exports:this),function(t){"use strict";var d=t.fabric||(t.fabric={}),g=d.util.object.clone;if(d.Text)d.warn("fabric.Text is already defined");else{var r="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign".split(" ");d.Text=d.util.createClass(d.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:d.Object.prototype.stateProperties.concat(r),cacheProperties:d.Object.prototype.cacheProperties.concat(r),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(t,e){this.styles=e&&e.styles||{},this.text=t,this.__skipDimension=!0,this.callSuper("initialize",e),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var t=this.path;t&&(t.segmentsInfo=d.util.getPathSegmentsInfo(t.path))},getMeasuringContext:function(){return d._measuringContext||(d._measuringContext=this.canvas&&this.canvas.contextCache||d.util.createCanvasElement().getContext("2d")),d._measuringContext},_splitText:function(){var t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var t,e,i,r,n,s,o,a=0,c=this._textLines.length;a<c;a++)if(("justify"===this.textAlign||a!==c-1&&!this.isEndOfWrapping(a))&&(r=0,n=this._textLines[a],(e=this.getLineWidth(a))<this.width&&(o=this.textLines[a].match(this._reSpacesAndTabs)))){i=o.length,t=(this.width-e)/i;for(var h=0,l=n.length;h<=l;h++)s=this.__charBounds[a][h],this._reSpaceAndTab.test(n[h])?(s.width+=t,s.kernedWidth+=t,s.left+=r,r+=t):s.left+=r}},isEndOfWrapping:function(t){return t===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){var e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){"stroke"===this.paintFirst?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){if(t.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":t.textBaseline="middle";break;case"ascender":t.textBaseline="top";break;case"descender":t.textBaseline="bottom"}t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;e<i;e++){var r=this.getLineWidth(e);t<r&&(t=r)}return t},_renderTextLine:function(t,e,i,r,n,s){this._renderChars(t,e,i,r,n,s)},_renderTextLinesBackground:function(t){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var e,i,r,n,s,o,a,c=t.fillStyle,h=this._getLeftOffset(),l=this._getTopOffset(),u=0,f=0,d=this.path,g=0,p=this._textLines.length;g<p;g++)if(e=this.getHeightOfLine(g),this.textBackgroundColor||this.styleHas("textBackgroundColor",g)){r=this._textLines[g],i=this._getLineLeftOffset(g),u=f=0,n=this.getValueOfPropertyAt(g,0,"textBackgroundColor");for(var v=0,m=r.length;v<m;v++)s=this.__charBounds[g][v],o=this.getValueOfPropertyAt(g,v,"textBackgroundColor"),d?(t.save(),t.translate(s.renderLeft,s.renderTop),t.rotate(s.angle),(t.fillStyle=o)&&t.fillRect(-s.width/2,-e/this.lineHeight*(1-this._fontSizeFraction),s.width,e/this.lineHeight),t.restore()):o!==n?(a=h+i+u,"rtl"===this.direction&&(a=this.width-a-f),(t.fillStyle=n)&&t.fillRect(a,l,f,e/this.lineHeight),u=s.left,f=s.width,n=o):f+=s.kernedWidth;o&&!d&&(a=h+i+u,"rtl"===this.direction&&(a=this.width-a-f),t.fillStyle=o,t.fillRect(a,l,f,e/this.lineHeight)),l+=e}else l+=e;t.fillStyle=c,this._removeShadow(t)}},getFontCache:function(t){var e=t.fontFamily.toLowerCase();d.charWidthsCache[e]||(d.charWidthsCache[e]={});var i=d.charWidthsCache[e],r=t.fontStyle.toLowerCase()+"_"+(t.fontWeight+"").toLowerCase();return i[r]||(i[r]={}),i[r]},_measureChar:function(t,e,i,r){var n,s,o,a,c=this.getFontCache(e),h=i+t,l=this._getFontDeclaration(e)===this._getFontDeclaration(r),u=e.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==c[i]&&(o=c[i]),void 0!==c[t]&&(a=n=c[t]),l&&void 0!==c[h]&&(a=(s=c[h])-o),void 0===n||void 0===o||void 0===s){var f=this.getMeasuringContext();this._setTextStyles(f,e,!0)}return void 0===n&&(a=n=f.measureText(t).width,c[t]=n),void 0===o&&l&&i&&(o=f.measureText(i).width,c[i]=o),l&&void 0===s&&(s=f.measureText(h).width,a=(c[h]=s)-o),{width:n*u,kernedWidth:a*u}},getHeightOfChar:function(t,e){return this.getValueOfPropertyAt(t,e,"fontSize")},measureLine:function(t){var e=this._measureLine(t);return 0!==this.charSpacing&&(e.width-=this._getWidthOfCharSpacing()),e.width<0&&(e.width=0),e},_measureLine:function(t){var e,i,r,n,s,o,a=0,c=this._textLines[t],h=new Array(c.length),l=0,u=this.path,f="right"===this.pathSide;for(this.__charBounds[t]=h,e=0;e<c.length;e++)i=c[e],n=this._getGraphemeBox(i,t,e,r),a+=(h[e]=n).kernedWidth,r=i;if(h[e]={left:n?n.left+n.width:0,width:0,kernedWidth:0,height:this.fontSize},u){switch(o=u.segmentsInfo[u.segmentsInfo.length-1].length,(s=d.util.getPointOnPath(u.path,0,u.segmentsInfo)).x+=u.pathOffset.x,s.y+=u.pathOffset.y,this.textAlign){case"left":l=f?o-a:0;break;case"center":l=(o-a)/2;break;case"right":l=f?0:o-a}for(l+=this.pathStartOffset*(f?-1:1),e=f?c.length-1:0;f?0<=e:e<c.length;f?e--:e++)n=h[e],o<l?l%=o:l<0&&(l+=o),this._setGraphemeOnPath(l,n,s),l+=n.kernedWidth}return{width:a,numOfSpaces:0}},_setGraphemeOnPath:function(t,e,i){var r=t+e.kernedWidth/2,n=this.path,s=d.util.getPointOnPath(n.path,r,n.segmentsInfo);e.renderLeft=s.x-i.x,e.renderTop=s.y-i.y,e.angle=s.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(t,e,i,r,n){var s,o=this.getCompleteStyleDeclaration(e,i),a=r?this.getCompleteStyleDeclaration(e,i-1):{},c=this._measureChar(t,o,r,a),h=c.kernedWidth,l=c.width;0!==this.charSpacing&&(l+=s=this._getWidthOfCharSpacing(),h+=s);var u={width:l,left:0,height:o.fontSize,kernedWidth:h,deltaY:o.deltaY};if(0<i&&!n){var f=this.__charBounds[e][i-1];u.left=f.left+f.width+c.kernedWidth-c.width}return u},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),r=1,n=e.length;r<n;r++)i=Math.max(this.getHeightOfChar(t,r),i);return this.__lineHeights[t]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var t,e=0,i=0,r=this._textLines.length;i<r;i++)t=this.getHeightOfLine(i),e+=i===r-1?t/this.lineHeight:t;return e},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(t,e){t.save();for(var i=0,r=this._getLeftOffset(),n=this._getTopOffset(),s=0,o=this._textLines.length;s<o;s++){var a=this.getHeightOfLine(s),c=a/this.lineHeight,h=this._getLineLeftOffset(s);this._renderTextLine(e,t,this._textLines[s],r+h,n+i+c,s),i+=a}t.restore()},_renderTextFill:function(t){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(t,"fillText")},_renderTextStroke:function(t){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this._setLineDash(t,this.strokeDashArray),t.beginPath(),this._renderTextCommon(t,"strokeText"),t.closePath(),t.restore())},_renderChars:function(t,e,i,r,n,s){var o,a,c,h,l,u=this.getHeightOfLine(s),f=-1!==this.textAlign.indexOf("justify"),d="",g=0,p=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(s)&&!p,m="ltr"===this.direction,b="ltr"===this.direction?1:-1,y=e.canvas.getAttribute("dir");if(e.save(),y!==this.direction&&(e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right"),n-=u*this._fontSizeFraction/this.lineHeight,v)return this._renderChar(t,e,s,0,i.join(""),r,n,u),void e.restore();for(var _=0,x=i.length-1;_<=x;_++)h=_===x||this.charSpacing||p,d+=i[_],c=this.__charBounds[s][_],0===g?(r+=b*(c.kernedWidth-c.width),g+=c.width):g+=c.kernedWidth,f&&!h&&this._reSpaceAndTab.test(i[_])&&(h=!0),h||(o=o||this.getCompleteStyleDeclaration(s,_),a=this.getCompleteStyleDeclaration(s,_+1),h=this._hasStyleChanged(o,a)),h&&(p?(e.save(),e.translate(c.renderLeft,c.renderTop),e.rotate(c.angle),this._renderChar(t,e,s,_,d,-g/2,0,u),e.restore()):(l=r,this._renderChar(t,e,s,_,d,l,n,u)),d="",o=a,r+=b*g,g=0);e.restore()},_applyPatternGradientTransformText:function(t){var e,i=d.util.createCanvasElement(),r=this.width+this.strokeWidth,n=this.height+this.strokeWidth;return i.width=r,i.height=n,(e=i.getContext("2d")).beginPath(),e.moveTo(0,0),e.lineTo(r,0),e.lineTo(r,n),e.lineTo(0,n),e.closePath(),e.translate(r/2,n/2),e.fillStyle=t.toLive(e),this._applyPatternGradientTransform(e,t),e.fill(),e.createPattern(i,"no-repeat")},handleFiller:function(t,e,i){var r,n;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(r=-this.width/2,n=-this.height/2,t.translate(r,n),t[e]=this._applyPatternGradientTransformText(i),{offsetX:r,offsetY:n}):(t[e]=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):(t[e]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(t,e){return t.lineWidth=e.strokeWidth,t.lineCap=this.strokeLineCap,t.lineDashOffset=this.strokeDashOffset,t.lineJoin=this.strokeLineJoin,t.miterLimit=this.strokeMiterLimit,this.handleFiller(t,"strokeStyle",e.stroke)},_setFillStyles:function(t,e){return this.handleFiller(t,"fillStyle",e.fill)},_renderChar:function(t,e,i,r,n,s,o){var a,c,h=this._getStyleDeclaration(i,r),l=this.getCompleteStyleDeclaration(i,r),u="fillText"===t&&l.fill,f="strokeText"===t&&l.stroke&&l.strokeWidth;(f||u)&&(e.save(),u&&(a=this._setFillStyles(e,l)),f&&(c=this._setStrokeStyles(e,l)),e.font=this._getFontDeclaration(l),h&&h.textBackgroundColor&&this._removeShadow(e),h&&h.deltaY&&(o+=h.deltaY),u&&e.fillText(n,s-a.offsetX,o-a.offsetY),f&&e.strokeText(n,s-c.offsetX,o-c.offsetY),e.restore())},setSuperscript:function(t,e){return this._setScript(t,e,this.superscript)},setSubscript:function(t,e){return this._setScript(t,e,this.subscript)},_setScript:function(t,e,i){var r=this.get2DCursorLocation(t,!0),n=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,"fontSize"),s=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,"deltaY"),o={fontSize:n*i.size,deltaY:s+n*i.baseline};return this.setSelectionStyles(o,t,e),this},_hasStyleChanged:function(t,e){return t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.deltaY!==e.deltaY},_hasStyleChangedForSvg:function(t,e){return this._hasStyleChanged(t,e)||t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough},_getLineLeftOffset:function(t){var e=this.getLineWidth(t),i=this.width-e,r=this.textAlign,n=this.direction,s=0,o=this.isEndOfWrapping(t);return"justify"===r||"justify-center"===r&&!o||"justify-right"===r&&!o||"justify-left"===r&&!o?0:("center"===r&&(s=i/2),"right"===r&&(s=i),"justify-center"===r&&(s=i/2),"justify-right"===r&&(s=i),"rtl"===n&&(s-=i),s)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var t=this._forceClearCache;return t||(t=this.hasStateChanged("_dimensionAffectingProps")),t&&(this.dirty=!0,this._forceClearCache=!1),t},getLineWidth:function(t){if(void 0!==this.__lineWidths[t])return this.__lineWidths[t];var e=this.measureLine(t).width;return this.__lineWidths[t]=e},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(t,e,i){var r=this._getStyleDeclaration(t,e);return r&&void 0!==r[i]?r[i]:this[i]},_renderTextDecoration:function(t,e){if(this[e]||this.styleHas(e)){for(var i,r,n,s,o,a,c,h,l,u,f,d,g,p,v,m,b=this._getLeftOffset(),y=this._getTopOffset(),_=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[e],S=0,T=this._textLines.length;S<T;S++)if(i=this.getHeightOfLine(S),this[e]||this.styleHas(e,S)){c=this._textLines[S],p=i/this.lineHeight,s=this._getLineLeftOffset(S),f=u=0,h=this.getValueOfPropertyAt(S,0,e),m=this.getValueOfPropertyAt(S,0,"fill"),l=y+p*(1-this._fontSizeFraction),r=this.getHeightOfChar(S,0),o=this.getValueOfPropertyAt(S,0,"deltaY");for(var w=0,O=c.length;w<O;w++)if(d=this.__charBounds[S][w],g=this.getValueOfPropertyAt(S,w,e),v=this.getValueOfPropertyAt(S,w,"fill"),n=this.getHeightOfChar(S,w),a=this.getValueOfPropertyAt(S,w,"deltaY"),_&&g&&v)t.save(),t.fillStyle=m,t.translate(d.renderLeft,d.renderTop),t.rotate(d.angle),t.fillRect(-d.kernedWidth/2,C*n+a,d.kernedWidth,this.fontSize/15),t.restore();else if((g!==h||v!==m||n!==r||a!==o)&&0<f){var k=b+s+u;"rtl"===this.direction&&(k=this.width-k-f),h&&m&&(t.fillStyle=m,t.fillRect(k,l+C*r+o,f,this.fontSize/15)),u=d.left,f=d.width,h=g,m=v,r=n,o=a}else f+=d.kernedWidth;k=b+s+u;"rtl"===this.direction&&(k=this.width-k-f),t.fillStyle=v,g&&v&&t.fillRect(k,l+C*r+o,f-x,this.fontSize/15),y+=i}else y+=i;this._removeShadow(t)}},_getFontDeclaration:function(t,e){var i=t||this,r=this.fontFamily,n=-1<d.Text.genericFonts.indexOf(r.toLowerCase()),s=void 0===r||-1<r.indexOf("'")||-1<r.indexOf(",")||-1<r.indexOf('"')||n?i.fontFamily:'"'+i.fontFamily+'"';return[d.isLikelyNode?i.fontWeight:i.fontStyle,d.isLikelyNode?i.fontStyle:i.fontWeight,e?this.CACHE_FONT_SIZE+"px":i.fontSize+"px",s].join(" ")},render:function(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",t)))},_splitTextIntoLines:function(t){for(var e=t.split(this._reNewline),i=new Array(e.length),r=["\n"],n=[],s=0;s<e.length;s++)i[s]=d.util.string.graphemeSplit(e[s]),n=n.concat(i[s],r);return n.pop(),{_unwrappedLines:i,lines:e,graphemeText:n,graphemeLines:i}},toObject:function(t){var e=r.concat(t),i=this.callSuper("toObject",e);return i.styles=g(this.styles,!0),i.path&&(i.path=this.path.toObject()),i},set:function(t,e){this.callSuper("set",t,e);var i=!1,r=!1;if("object"==typeof t)for(var n in t)"path"===n&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(n),r=r||"path"===n;else i=-1!==this._dimensionAffectingProps.indexOf(t),r="path"===t;return r&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),d.Text.ATTRIBUTE_NAMES=d.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),d.Text.DEFAULT_SVG_FONT_SIZE=16,d.Text.fromElement=function(t,e,i){if(!t)return e(null);var r=d.parseAttributes(t,d.Text.ATTRIBUTE_NAMES),n=r.textAnchor||"left";if((i=d.util.object.extend(i?g(i):{},r)).top=i.top||0,i.left=i.left||0,r.textDecoration){var s=r.textDecoration;-1!==s.indexOf("underline")&&(i.underline=!0),-1!==s.indexOf("overline")&&(i.overline=!0),-1!==s.indexOf("line-through")&&(i.linethrough=!0),delete i.textDecoration}"dx"in r&&(i.left+=r.dx),"dy"in r&&(i.top+=r.dy),"fontSize"in i||(i.fontSize=d.Text.DEFAULT_SVG_FONT_SIZE);var o="";"textContent"in t?o=t.textContent:"firstChild"in t&&null!==t.firstChild&&"data"in t.firstChild&&null!==t.firstChild.data&&(o=t.firstChild.data),o=o.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var a=i.strokeWidth;i.strokeWidth=0;var c=new d.Text(o,i),h=c.getScaledHeight()/c.height,l=((c.height+c.strokeWidth)*c.lineHeight-c.height)*h,u=c.getScaledHeight()+l,f=0;"center"===n&&(f=c.getScaledWidth()/2),"right"===n&&(f=c.getScaledWidth()),c.set({left:c.left-f,top:c.top-(u-c.fontSize*(.07+c._fontSizeFraction))/c.lineHeight,strokeWidth:void 0!==a?a:1}),e(c)},d.Text.fromObject=function(t,i){var e=g(t),r=t.path;return delete e.path,d.Object._fromObject("Text",e,function(e){r?d.Object._fromObject("Path",r,function(t){e.set("path",t),i(e)},"path"):i(e)},"text")},d.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],d.util.createAccessors&&d.util.createAccessors(d.Text)}}("undefined"!=typeof exports?exports:this),fabric.util.object.extend(fabric.Text.prototype,{isEmptyStyles:function(t){if(!this.styles)return!0;if(void 0!==t&&!this.styles[t])return!0;var e=void 0===t?this.styles:{line:this.styles[t]};for(var i in e)for(var r in e[i])for(var n in e[i][r])return!1;return!0},styleHas:function(t,e){if(!this.styles||!t||""===t)return!1;if(void 0!==e&&!this.styles[e])return!1;var i=void 0===e?this.styles:{0:this.styles[e]};for(var r in i)for(var n in i[r])if(void 0!==i[r][n][t])return!0;return!1},cleanStyle:function(t){if(!this.styles||!t||""===t)return!1;var e,i,r=this.styles,n=0,s=!0,o=0;for(var a in r){for(var c in e=0,r[a]){var h;n++,(h=r[a][c]).hasOwnProperty(t)?(i?h[t]!==i&&(s=!1):i=h[t],h[t]===this[t]&&delete h[t]):s=!1,0!==Object.keys(h).length?e++:delete r[a][c]}0===e&&delete r[a]}for(var l=0;l<this._textLines.length;l++)o+=this._textLines[l].length;s&&n===o&&(this[t]=i,this.removeStyle(t))},removeStyle:function(t){if(this.styles&&t&&""!==t){var e,i,r,n=this.styles;for(i in n){for(r in e=n[i])delete e[r][t],0===Object.keys(e[r]).length&&delete e[r];0===Object.keys(e).length&&delete n[i]}}},_extendStyles:function(t,e){var i=this.get2DCursorLocation(t);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),fabric.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),e)},get2DCursorLocation:function(t,e){void 0===t&&(t=this.selectionStart);for(var i=e?this._unwrappedTextLines:this._textLines,r=i.length,n=0;n<r;n++){if(t<=i[n].length)return{lineIndex:n,charIndex:t};t-=i[n].length+this.missingNewlineOffset(n)}return{lineIndex:n-1,charIndex:i[n-1].length<t?i[n-1].length:t}},getSelectionStyles:function(t,e,i){void 0===t&&(t=this.selectionStart||0),void 0===e&&(e=this.selectionEnd||t);for(var r=[],n=t;n<e;n++)r.push(this.getStyleAtPosition(n,i));return r},getStyleAtPosition:function(t,e){var i=this.get2DCursorLocation(t);return(e?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.charIndex))||{}},setSelectionStyles:function(t,e,i){void 0===e&&(e=this.selectionStart||0),void 0===i&&(i=this.selectionEnd||e);for(var r=e;r<i;r++)this._extendStyles(r,t);return this._forceClearCache=!0,this},_getStyleDeclaration:function(t,e){var i=this.styles&&this.styles[t];return i?i[e]:null},getCompleteStyleDeclaration:function(t,e){for(var i,r=this._getStyleDeclaration(t,e)||{},n={},s=0;s<this._styleProperties.length;s++)n[i=this._styleProperties[s]]=void 0===r[i]?this[i]:r[i];return n},_setStyleDeclaration:function(t,e,i){this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){delete this.styles[t][e]},_getLineStyle:function(t){return!!this.styles[t]},_setLineStyle:function(t){this.styles[t]={}},_deleteLineStyle:function(t){delete this.styles[t]}}),function(){function n(t){t.textDecoration&&(-1<t.textDecoration.indexOf("underline")&&(t.underline=!0),-1<t.textDecoration.indexOf("line-through")&&(t.linethrough=!0),-1<t.textDecoration.indexOf("overline")&&(t.overline=!0),delete t.textDecoration)}fabric.IText=fabric.util.createClass(fabric.Text,fabric.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(t,e){this.callSuper("initialize",t,e),this.initBehavior()},setSelectionStart:function(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)},setSelectionEnd:function(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)},_updateAndFire:function(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(t){this.clearContextTop(),this.callSuper("render",t),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(t){this.callSuper("_render",t)},clearContextTop:function(t){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this.canvas.contextTop,i=this.canvas.viewportTransform;e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(e),this._clearTextArea(e),t||e.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this._getCursorBoundaries(),e=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(t,e):this.renderSelection(t,e),e.restore()}},_clearTextArea:function(t){var e=this.width+4,i=this.height+4;t.clearRect(-e/2,-i/2,e,i)},_getCursorBoundaries:function(t){void 0===t&&(t=this.selectionStart);var e=this._getLeftOffset(),i=this._getTopOffset(),r=this._getCursorBoundariesOffsets(t);return{left:e,top:i,leftOffset:r.left,topOffset:r.top}},_getCursorBoundariesOffsets:function(t){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var e,i,r,n,s=0,o=0,a=this.get2DCursorLocation(t);r=a.charIndex,i=a.lineIndex;for(var c=0;c<i;c++)s+=this.getHeightOfLine(c);e=this._getLineLeftOffset(i);var h=this.__charBounds[i][r];return h&&(o=h.left),0!==this.charSpacing&&r===this._textLines[i].length&&(o-=this._getWidthOfCharSpacing()),n={top:s,left:e+(0<o?o:0)},"rtl"===this.direction&&(n.left*=-1),this.cursorOffsetCache=n,this.cursorOffsetCache},renderCursor:function(t,e){var i=this.get2DCursorLocation(),r=i.lineIndex,n=0<i.charIndex?i.charIndex-1:0,s=this.getValueOfPropertyAt(r,n,"fontSize"),o=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/o,c=t.topOffset,h=this.getValueOfPropertyAt(r,n,"deltaY");c+=(1-this._fontSizeFraction)*this.getHeightOfLine(r)/this.lineHeight-s*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(t,e),e.fillStyle=this.cursorColor||this.getValueOfPropertyAt(r,n,"fill"),e.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,e.fillRect(t.left+t.leftOffset-a/2,c+t.top+h,a,s)},renderSelection:function(t,e){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,r=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,n=-1!==this.textAlign.indexOf("justify"),s=this.get2DCursorLocation(i),o=this.get2DCursorLocation(r),a=s.lineIndex,c=o.lineIndex,h=s.charIndex<0?0:s.charIndex,l=o.charIndex<0?0:o.charIndex,u=a;u<=c;u++){var f,d=this._getLineLeftOffset(u)||0,g=this.getHeightOfLine(u),p=0,v=0;if(u===a&&(p=this.__charBounds[a][h].left),a<=u&&u<c)v=n&&!this.isEndOfWrapping(u)?this.width:this.getLineWidth(u)||5;else if(u===c)if(0===l)v=this.__charBounds[c][l].left;else{var m=this._getWidthOfCharSpacing();v=this.__charBounds[c][l-1].left+this.__charBounds[c][l-1].width-m}f=g,(this.lineHeight<1||u===c&&1<this.lineHeight)&&(g/=this.lineHeight);var b=t.left+d+p,y=v-p,_=g,x=0;this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",_=1,x=g):e.fillStyle=this.selectionColor,"rtl"===this.direction&&(b=this.width-b-y),e.fillRect(b,t.top+t.topOffset+x,y,_),t.topOffset+=f}},getCurrentCharFontSize:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")},getCurrentCharColor:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fill")},_getCurrentCharIndex:function(){var t=this.get2DCursorLocation(this.selectionStart,!0),e=0<t.charIndex?t.charIndex-1:0;return{l:t.lineIndex,c:e}}}),fabric.IText.fromObject=function(t,e){if(n(t),t.styles)for(var i in t.styles)for(var r in t.styles[i])n(t.styles[i][r]);fabric.Object._fromObject("IText",t,e,"text")}}(),function(){var u=fabric.util.object.clone;fabric.util.object.extend(fabric.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on("removed",function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],fabric.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t)))})},_initCanvasHandlers:function(t){t._mouseUpITextHandler=function(){t._iTextInstances&&t._iTextInstances.forEach(function(t){t.__isMousedown=!1})},t.on("mouse:up",t._mouseUpITextHandler)},_removeCanvasHandlers:function(t){t.off("mouse:up",t._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(t,e,i,r){var n;return n={isAborted:!1,abort:function(){this.isAborted=!0}},t.animate("_currentCursorOpacity",e,{duration:i,onComplete:function(){n.isAborted||t[r]()},onChange:function(){t.canvas&&t.selectionStart===t.selectionEnd&&t.renderCursorOrSelection()},abort:function(){return n.isAborted}}),n},_onTickComplete:function(){var t=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){t._currentTickCompleteState=t._animateCursor(t,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(t){var e=this,i=t?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){e._tick()},i)},abortCursorAnimation:function(){var t=this._currentTickState||this._currentTickCompleteState,e=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,t&&e&&e.clearContext(e.contextTop||e.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(t){var e=0,i=t-1;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i--;for(;/\S/.test(this._text[i])&&-1<i;)e++,i--;return t-e},findWordBoundaryRight:function(t){var e=0,i=t;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i++;for(;/\S/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},findLineBoundaryLeft:function(t){for(var e=0,i=t-1;!/\n/.test(this._text[i])&&-1<i;)e++,i--;return t-e},findLineBoundaryRight:function(t){for(var e=0,i=t;!/\n/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},searchWordBoundary:function(t,e){for(var i=this._text,r=this._reSpace.test(i[t])?t-1:t,n=i[r],s=fabric.reNonWord;!s.test(n)&&0<r&&r<i.length;)n=i[r+=e];return s.test(n)&&(r+=1===e?0:1),r},selectWord:function(t){t=t||this.selectionStart;var e=this.searchWordBoundary(t,-1),i=this.searchWordBoundary(t,1);this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(t){t=t||this.selectionStart;var e=this.findLineBoundaryLeft(t),i=this.findLineBoundaryRight(t);return this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(t){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(t),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas&&(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll()),this},exitEditingOnOthers:function(t){t._iTextInstances&&t._iTextInstances.forEach(function(t){t.selected=!1,t.isEditing&&t.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(t){if(this.__isMousedown&&this.isEditing){var e=this.getSelectionStartFromPointer(t.e),i=this.selectionStart,r=this.selectionEnd;(e===this.__selectionStartOnMouseDown&&i!==r||i!==e&&r!==e)&&(e>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=e):(this.selectionStart=e,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===r||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(t,e,i){var r=i.slice(0,t),n=fabric.util.string.graphemeSplit(r).length;if(t===e)return{selectionStart:n,selectionEnd:n};var s=i.slice(t,e);return{selectionStart:n,selectionEnd:n+fabric.util.string.graphemeSplit(s).length}},fromGraphemeToStringSelection:function(t,e,i){var r=i.slice(0,t).join("").length;return t===e?{selectionStart:r,selectionEnd:r}:{selectionStart:r,selectionEnd:r+i.slice(t,e).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var t=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=t.selectionEnd,this.inCompositionMode||(this.selectionStart=t.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),i=this.get2DCursorLocation(t),r=i.lineIndex,n=i.charIndex,s=this.getValueOfPropertyAt(r,n,"fontSize")*this.lineHeight,o=e.leftOffset,a=this.calcTransformMatrix(),c={x:e.left+o,y:e.top+e.topOffset+s},h=this.canvas.getRetinaScaling(),l=this.canvas.upperCanvasEl,u=l.width/h,f=l.height/h,d=u-s,g=f-s,p=l.clientWidth/u,v=l.clientHeight/f;return c=fabric.util.transformPoint(c,a),(c=fabric.util.transformPoint(c,this.canvas.viewportTransform)).x*=p,c.y*=v,c.x<0&&(c.x=0),c.x>d&&(c.x=d),c.y<0&&(c.y=0),c.y>g&&(c.y=g),c.x+=this.canvas._offset.left,c.y+=this.canvas._offset.top,{left:c.x+"px",top:c.y+"px",fontSize:s+"px",charHeight:s}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var t=this._textBeforeEdit!==this.text,e=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,e&&(e.blur&&e.blur(),e.parentNode&&e.parentNode.removeChild(e)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var t in this.styles)this._textLines[t]||delete this.styles[t]},removeStyleFromTo:function(t,e){var i,r,n=this.get2DCursorLocation(t,!0),s=this.get2DCursorLocation(e,!0),o=n.lineIndex,a=n.charIndex,c=s.lineIndex,h=s.charIndex;if(o!==c){if(this.styles[o])for(i=a;i<this._unwrappedTextLines[o].length;i++)delete this.styles[o][i];if(this.styles[c])for(i=h;i<this._unwrappedTextLines[c].length;i++)(r=this.styles[c][i])&&(this.styles[o]||(this.styles[o]={}),this.styles[o][a+i-h]=r);for(i=o+1;i<=c;i++)delete this.styles[i];this.shiftLineStyles(c,o-c)}else if(this.styles[o]){r=this.styles[o];var l,u,f=h-a;for(i=a;i<h;i++)delete r[i];for(u in this.styles[o])h<=(l=parseInt(u,10))&&(r[l-f]=r[u],delete r[u])}},shiftLineStyles:function(t,e){var i=u(this.styles);for(var r in this.styles){var n=parseInt(r,10);t<n&&(this.styles[n+e]=i[n],i[n-e]||delete this.styles[n])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(t,e,i,r){var n,s={},o=!1,a=this._unwrappedTextLines[t].length===e;for(var c in i||(i=1),this.shiftLineStyles(t,i),this.styles[t]&&(n=this.styles[t][0===e?e:e-1]),this.styles[t]){var h=parseInt(c,10);e<=h&&(o=!0,s[h-e]=this.styles[t][c],a&&0===e||delete this.styles[t][c])}var l=!1;for(o&&!a&&(this.styles[t+i]=s,l=!0),l&&i--;0<i;)r&&r[i-1]?this.styles[t+i]={0:u(r[i-1])}:n?this.styles[t+i]={0:u(n)}:delete this.styles[t+i],i--;this._forceClearCache=!0},insertCharStyleObject:function(t,e,i,r){this.styles||(this.styles={});var n=this.styles[t],s=n?u(n):{};for(var o in i||(i=1),s){var a=parseInt(o,10);e<=a&&(n[a+i]=s[a],s[a-i]||delete n[a])}if(this._forceClearCache=!0,r)for(;i--;)Object.keys(r[i]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+i]=u(r[i]));else if(n)for(var c=n[e?e-1:1];c&&i--;)this.styles[t][e+i]=u(c)},insertNewStyleBlock:function(t,e,i){for(var r=this.get2DCursorLocation(e,!0),n=[0],s=0,o=0;o<t.length;o++)"\n"===t[o]?n[++s]=0:n[s]++;0<n[0]&&(this.insertCharStyleObject(r.lineIndex,r.charIndex,n[0],i),i=i&&i.slice(n[0]+1)),s&&this.insertNewlineStyleObject(r.lineIndex,r.charIndex+n[0],s);for(o=1;o<s;o++)0<n[o]?this.insertCharStyleObject(r.lineIndex+o,0,n[o],i):i&&this.styles[r.lineIndex+o]&&i[0]&&(this.styles[r.lineIndex+o][0]=i[0]),i=i&&i.slice(n[o]+1);0<n[o]&&this.insertCharStyleObject(r.lineIndex+o,0,n[o],i)},setSelectionStartEndWithShift:function(t,e,i){i<=t?(e===t?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=t),this.selectionStart=i):t<i&&i<e?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(e===t?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=e),this.selectionEnd=i)},setSelectionInBoundaries:function(){var t=this.text.length;this.selectionStart>t?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),fabric.util.object.extend(fabric.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){if(this.canvas){this.__newClickTime=+new Date;var e=t.pointer;this.isTripleClick(e)&&(this.fire("tripleclick",t),this._stopEvent(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y},_stopEvent:function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))},tripleClickHandler:function(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(t.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(t){if(this.__isMousedown=!1,!(!this.editable||this.group||t.transform&&t.transform.actionPerformed||t.e.button&&1!==t.e.button)){if(this.canvas){var e=this.canvas._activeObject;if(e&&e!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(t.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(t){var e=this.getSelectionStartFromPointer(t),i=this.selectionStart,r=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(i,r,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(t){for(var e,i=this.getLocalPointer(t),r=0,n=0,s=0,o=0,a=0,c=0,h=this._textLines.length;c<h&&s<=i.y;c++)s+=this.getHeightOfLine(c)*this.scaleY,0<(a=c)&&(o+=this._textLines[c-1].length+this.missingNewlineOffset(c-1));n=this._getLineLeftOffset(a)*this.scaleX,e=this._textLines[a],"rtl"===this.direction&&(i.x=this.width*this.scaleX-i.x+n);for(var l=0,u=e.length;l<u&&(r=n,(n+=this.__charBounds[a][l].kernedWidth*this.scaleX)<=i.x);l++)o++;return this._getNewSelectionStartFromOffset(i,r,n,o,u)},_getNewSelectionStartFromOffset:function(t,e,i,r,n){var s=t.x-e,o=i-t.x,a=r+(s<o||o<0?0:1);return this.flipX&&(a=n-a),a>this._text.length&&(a=this._text.length),a}}),fabric.util.object.extend(fabric.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=fabric.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var t=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+t.top+"; left: "+t.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+t.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):fabric.document.body.appendChild(this.hiddenTextarea),fabric.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),fabric.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),fabric.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),fabric.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),fabric.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),fabric.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),fabric.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),fabric.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),fabric.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(fabric.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(t){if(this.isEditing){var e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown&&(t.ctrlKey||t.metaKey)))return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),33<=t.keyCode&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(t){var e=this.fromPaste;if(this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing){var i,r,n,s,o,a=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,c=this._text.length,h=a.length,l=h-c,u=this.selectionStart,f=this.selectionEnd,d=u!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),p=u>g.selectionStart;d?(i=this._text.slice(u,f),l+=f-u):h<c&&(i=p?this._text.slice(f+l,f):this._text.slice(u,u-l)),r=a.slice(g.selectionEnd-l,g.selectionEnd),i&&i.length&&(r.length&&(n=this.getSelectionStyles(u,u+1,!1),n=r.map(function(){return n[0]})),d?(s=u,o=f):p?(s=f-i.length,o=f):o=(s=f)+i.length,this.removeStyleFromTo(s,o)),r.length&&(e&&r.join("")===fabric.copiedText&&!fabric.disableStyleCopyPaste&&(n=fabric.copiedTextStyle),this.insertNewStyleBlock(r,u,n)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(t){this.compositionStart=t.target.selectionStart,this.compositionEnd=t.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(fabric.copiedText=this.getSelectedText(),fabric.disableStyleCopyPaste?fabric.copiedTextStyle=null:fabric.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(t){return t&&t.clipboardData||fabric.window.clipboardData},_getWidthBeforeCursor:function(t,e){var i,r=this._getLineLeftOffset(t);return 0<e&&(r+=(i=this.__charBounds[t][e-1]).left+i.width),r},getDownCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),r=this.get2DCursorLocation(i),n=r.lineIndex;if(n===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-i;var s=r.charIndex,o=this._getWidthBeforeCursor(n,s),a=this._getIndexOnLine(n+1,o);return this._textLines[n].slice(s).length+a+1+this.missingNewlineOffset(n)},_getSelectionForOffset:function(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),r=this.get2DCursorLocation(i),n=r.lineIndex;if(0===n||t.metaKey||33===t.keyCode)return-i;var s=r.charIndex,o=this._getWidthBeforeCursor(n,s),a=this._getIndexOnLine(n-1,o),c=this._textLines[n].slice(0,s),h=this.missingNewlineOffset(n-1);return-this._textLines[n-1].length+a-c.length+(1-h)},_getIndexOnLine:function(t,e){for(var i,r,n=this._textLines[t],s=this._getLineLeftOffset(t),o=0,a=0,c=n.length;a<c;a++)if(e<(s+=i=this.__charBounds[t][a].width)){r=!0;var h=s-i,l=s,u=Math.abs(h-e);o=Math.abs(l-e)<u?a:a-1;break}return r||(o=n.length-1),o},moveCursorDown:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)},moveCursorUp:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)},_moveCursorUpOrDown:function(t,e){var i=this["get"+t+"CursorOffset"](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(t){var e="left"===this._selectionDirection?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t},moveCursorWithoutShift:function(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t},moveCursorLeft:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)},_move:function(t,e,i){var r;if(t.altKey)r=this["findWordBoundary"+i](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===i?-1:1,!0;r=this["findLineBoundary"+i](this[e])}if(void 0!==typeof r&&this[e]!==r)return this[e]=r,!0},_moveLeft:function(t,e){return this._move(t,e,"Left")},_moveRight:function(t,e){return this._move(t,e,"Right")},moveCursorLeftWithoutShift:function(t){var e=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e},moveCursorLeftWithShift:function(t){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(t,"selectionStart")):void 0},moveCursorRight:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)},_moveCursorLeftOrRight:function(t,e){var i="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?i+="Shift":i+="outShift",this[i](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(t){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(t,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(t){var e=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e},removeChars:function(t,e){void 0===e&&(e=t+1),this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(t,e,i,r){void 0===r&&(r=i),i<r&&this.removeStyleFromTo(i,r);var n=fabric.util.string.graphemeSplit(t);this.insertNewStyleBlock(n,i,e),this._text=[].concat(this._text.slice(0,i),n,this._text.slice(r)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var l=fabric.util.toFixed,u=/ +/g;fabric.util.object.extend(fabric.Text.prototype,{_toSVG:function(){var t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(t){var e=this.getSvgTextDecoration(this);return[t.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",e?'text-decoration="'+e+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",t.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(t,e){var i,r=[],n=[],s=t;this._setSVGBg(n);for(var o=0,a=this._textLines.length;o<a;o++)i=this._getLineLeftOffset(o),(this.textBackgroundColor||this.styleHas("textBackgroundColor",o))&&this._setSVGTextLineBg(n,o,e+i,s),this._setSVGTextLineText(r,o,e+i,s),s+=this.getHeightOfLine(o);return{textSpans:r,textBgRects:n}},_createTextCharSpan:function(t,e,i,r){var n=t!==t.trim()||t.match(u),s=this.getSvgSpanStyles(e,n),o=s?'style="'+s+'"':"",a=e.deltaY,c="",h=fabric.Object.NUM_FRACTION_DIGITS;return a&&(c=' dy="'+l(a,h)+'" '),['<tspan x="',l(i,h),'" y="',l(r,h),'" ',c,o,">",fabric.util.string.escapeXml(t),"</tspan>"].join("")},_setSVGTextLineText:function(t,e,i,r){var n,s,o,a,c,h=this.getHeightOfLine(e),l=-1!==this.textAlign.indexOf("justify"),u="",f=0,d=this._textLines[e];r+=h*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,p=d.length-1;g<=p;g++)c=g===p||this.charSpacing,u+=d[g],o=this.__charBounds[e][g],0===f?(i+=o.kernedWidth-o.width,f+=o.width):f+=o.kernedWidth,l&&!c&&this._reSpaceAndTab.test(d[g])&&(c=!0),c||(n=n||this.getCompleteStyleDeclaration(e,g),s=this.getCompleteStyleDeclaration(e,g+1),c=this._hasStyleChangedForSvg(n,s)),c&&(a=this._getStyleDeclaration(e,g)||{},t.push(this._createTextCharSpan(u,a,i,r)),u="",n=s,i+=f,f=0)},_pushTextBgRect:function(t,e,i,r,n,s){var o=fabric.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(e),' x="',l(i,o),'" y="',l(r,o),'" width="',l(n,o),'" height="',l(s,o),'"></rect>\n')},_setSVGTextLineBg:function(t,e,i,r){for(var n,s,o=this._textLines[e],a=this.getHeightOfLine(e)/this.lineHeight,c=0,h=0,l=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),u=0,f=o.length;u<f;u++)n=this.__charBounds[e][u],(s=this.getValueOfPropertyAt(e,u,"textBackgroundColor"))!==l?(l&&this._pushTextBgRect(t,l,i+h,r,c,a),h=n.left,c=n.width,l=s):c+=n.kernedWidth;s&&this._pushTextBgRect(t,s,i+h,r,c,a)},_getFillAttributes:function(t){var e=t&&"string"==typeof t?new fabric.Color(t):"";return e&&e.getSource()&&1!==e.getAlpha()?'opacity="'+e.getAlpha()+'" fill="'+e.setAlpha(1).toRgb()+'"':'fill="'+t+'"'},_getSVGLineTopOffset:function(t){for(var e,i=0,r=0;r<t;r++)i+=this.getHeightOfLine(r);return e=this.getHeightOfLine(r),{lineTop:i,offset:(this._fontSizeMult-this._fontSizeFraction)*e/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(t){return fabric.Object.prototype.getSvgStyles.call(this,t)+" white-space: pre;"}})}(),function(t){"use strict";var b=t.fabric||(t.fabric={});b.Textbox=b.util.createClass(b.IText,b.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:b.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,r=0,n={},s=0;s<t.graphemeLines.length;s++)"\n"===t.graphemeText[r]&&0<s?(i=0,r++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[r])&&0<s&&(i++,r++),n[s]={line:e,offset:i},r+=t.graphemeLines[s].length,i+=t.graphemeLines[s].length;return n},styleHas:function(t,e){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[e];i&&(e=i.line)}return b.Text.prototype.styleHas.call(this,t,e)},isEmptyStyles:function(t){if(!this.styles)return!0;var e,i,r=0,n=!1,s=this._styleMap[t],o=this._styleMap[t+1];for(var a in s&&(t=s.line,r=s.offset),o&&(n=o.line===t,e=o.offset),i=void 0===t?this.styles:{line:this.styles[t]})for(var c in i[a])if(r<=c&&(!n||c<e))for(var h in i[a][c])return!1;return!0},_getStyleDeclaration:function(t,e){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[t];if(!i)return null;t=i.line,e=i.offset+e}return this.callSuper("_getStyleDeclaration",t,e)},_setStyleDeclaration:function(t,e,i){var r=this._styleMap[t];t=r.line,e=r.offset+e,this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){var i=this._styleMap[t];t=i.line,e=i.offset+e,delete this.styles[t][e]},_getLineStyle:function(t){var e=this._styleMap[t];return!!this.styles[e.line]},_setLineStyle:function(t){var e=this._styleMap[t];this.styles[e.line]={}},_wrapText:function(t,e){var i,r=[];for(this.isWrapping=!0,i=0;i<t.length;i++)r=r.concat(this._wrapLine(t[i],i,e));return this.isWrapping=!1,r},_measureWord:function(t,e,i){var r,n=0;i=i||0;for(var s=0,o=t.length;s<o;s++){n+=this._getGraphemeBox(t[s],e,s+i,r,!0).kernedWidth,r=t[s]}return n},_wrapLine:function(t,e,i,r){var n=0,s=this.splitByGrapheme,o=[],a=[],c=s?b.util.string.graphemeSplit(t):t.split(this._wordJoiners),h="",l=0,u=s?"":" ",f=0,d=0,g=0,p=!0,v=this._getWidthOfCharSpacing();r=r||0;0===c.length&&c.push([]),i-=r;for(var m=0;m<c.length;m++)h=s?c[m]:b.util.string.graphemeSplit(c[m]),f=this._measureWord(h,e,l),l+=h.length,i<(n+=d+f-v)&&!p?(o.push(a),a=[],n=f,p=!0):n+=v,p||s||a.push(u),a=a.concat(h),d=s?0:this._measureWord([u],e,l),l++,p=!1,g<f&&(g=f);return m&&o.push(a),g+r>this.dynamicMinWidth&&(this.dynamicMinWidth=g-v+r),o},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},missingNewlineOffset:function(t){return this.splitByGrapheme?this.isEndOfWrapping(t)?1:0:1},_splitTextIntoLines:function(t){for(var e=b.Text.prototype._splitTextIntoLines.call(this,t),i=this._wrapText(e.lines,this.width),r=new Array(i.length),n=0;n<i.length;n++)r[n]=i[n].join("");return e.lines=r,e.graphemeLines=i,e},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var t={};for(var e in this._styleMap)this._textLines[e]&&(t[this._styleMap[e].line]=1);for(var e in this.styles)t[e]||delete this.styles[e]},toObject:function(t){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(t))}}),b.Textbox.fromObject=function(t,e){return b.Object._fromObject("Textbox",t,e,"text")}}("undefined"!=typeof exports?exports:this),function(){var t=fabric.controlsUtils,e=t.scaleSkewCursorStyleHandler,i=t.scaleCursorStyleHandler,r=t.scalingEqually,n=t.scalingYOrSkewingX,s=t.scalingXOrSkewingY,o=t.scaleOrSkewActionName,a=fabric.Object.prototype.controls;if(a.ml=new fabric.Control({x:-.5,y:0,cursorStyleHandler:e,actionHandler:s,getActionName:o}),a.mr=new fabric.Control({x:.5,y:0,cursorStyleHandler:e,actionHandler:s,getActionName:o}),a.mb=new fabric.Control({x:0,y:.5,cursorStyleHandler:e,actionHandler:n,getActionName:o}),a.mt=new fabric.Control({x:0,y:-.5,cursorStyleHandler:e,actionHandler:n,getActionName:o}),a.tl=new fabric.Control({x:-.5,y:-.5,cursorStyleHandler:i,actionHandler:r}),a.tr=new fabric.Control({x:.5,y:-.5,cursorStyleHandler:i,actionHandler:r}),a.bl=new fabric.Control({x:-.5,y:.5,cursorStyleHandler:i,actionHandler:r}),a.br=new fabric.Control({x:.5,y:.5,cursorStyleHandler:i,actionHandler:r}),a.mtr=new fabric.Control({x:0,y:-.5,actionHandler:t.rotationWithSnapping,cursorStyleHandler:t.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),fabric.Textbox){var c=fabric.Textbox.prototype.controls={};c.mtr=a.mtr,c.tr=a.tr,c.br=a.br,c.tl=a.tl,c.bl=a.bl,c.mt=a.mt,c.mb=a.mb,c.mr=new fabric.Control({x:.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"}),c.ml=new fabric.Control({x:-.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"})}}();!function(O){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=O();else if("function"==typeof define&&define.amd)define([],O);else{var u;"undefined"!=typeof window?u=window:"undefined"!=typeof global?u=global:"undefined"!=typeof self&&(u=self);u.pako=O()}}(function(){return function C(u,y,e){function z(l,h){if(!y[l]){if(!u[l]){var c="function"==typeof require&&require;if(!h&&c)return c(l,!0);if(m)return m(l,!0);throw Error("Cannot find module '"+l+"'");}h=y[l]={exports:{}};u[l][0].call(h.exports,
function(c){var d=u[l][1][c];return z(d?d:c)},h,h.exports,C,u,y,e)}return y[l].exports}for(var m="function"==typeof require&&require,q=0;q<e.length;q++)z(e[q]);return z}({1:[function(u,y,e){function C(c,d){d=new A(d);d.push(c,!0);if(d.err)throw d.msg;return d.result}var z=u("./zlib/inflate.js"),m=u("./utils/common"),q=u("./utils/strings"),l=u("./zlib/constants"),h=u("./zlib/messages"),c=u("./zlib/zstream"),d=u("./zlib/gzheader"),A=function(q){var v=this.options=m.assign({chunkSize:16384,windowBits:0,
to:""},q||{});v.raw&&0<=v.windowBits&&16>v.windowBits&&(v.windowBits=-v.windowBits,0===v.windowBits&&(v.windowBits=-15));!(0<=v.windowBits&&16>v.windowBits)||q&&q.windowBits||(v.windowBits+=32);15<v.windowBits&&48>v.windowBits&&0===(v.windowBits&15)&&(v.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new c;this.strm.avail_out=0;q=z.inflateInit2(this.strm,v.windowBits);if(q!==l.Z_OK)throw Error(h[q]);this.header=new d;z.inflateGetHeader(this.strm,this.header)};A.prototype.push=
function(c,d){var h=this.strm,v=this.options.chunkSize;if(this.ended)return!1;d=d===~~d?d:!0===d?l.Z_FINISH:l.Z_NO_FLUSH;h.input="string"===typeof c?q.binstring2buf(c):c;h.next_in=0;h.avail_in=h.input.length;do{0===h.avail_out&&(h.output=new m.Buf8(v),h.next_out=0,h.avail_out=v);c=z.inflate(h,l.Z_NO_FLUSH);if(c!==l.Z_STREAM_END&&c!==l.Z_OK)return this.onEnd(c),this.ended=!0,!1;if(h.next_out&&(0===h.avail_out||c===l.Z_STREAM_END||0===h.avail_in&&d===l.Z_FINISH))if("string"===this.options.to){var e=
q.utf8border(h.output,h.next_out);var b=h.next_out-e;var p=q.buf2string(h.output,e);h.next_out=b;h.avail_out=v-b;b&&m.arraySet(h.output,h.output,e,b,0);this.onData(p)}else this.onData(m.shrinkBuf(h.output,h.next_out))}while((0<h.avail_in||0===h.avail_out)&&c!==l.Z_STREAM_END);c===l.Z_STREAM_END&&(d=l.Z_FINISH);return d===l.Z_FINISH?(c=z.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===l.Z_OK):!0};A.prototype.onData=function(c){this.chunks.push(c)};A.prototype.onEnd=function(c){c===l.Z_OK&&(this.result=
"string"===this.options.to?this.chunks.join(""):m.flattenChunks(this.chunks));this.chunks=[];this.err=c;this.msg=this.strm.msg};e.Inflate=A;e.inflate=C;e.inflateRaw=function(c,d){d=d||{};d.raw=!0;return C(c,d)};e.ungzip=C},{"./utils/common":2,"./utils/strings":3,"./zlib/constants":5,"./zlib/gzheader":7,"./zlib/inflate.js":9,"./zlib/messages":11,"./zlib/zstream":12}],2:[function(u,y,e){u="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;e.assign=function(m){for(var q=
Array.prototype.slice.call(arguments,1);q.length;){var l=q.shift();if(l){if("object"!==typeof l)throw new TypeError(l+"must be non-object");for(var h in l)l.hasOwnProperty(h)&&(m[h]=l[h])}}return m};e.shrinkBuf=function(m,q){if(m.length===q)return m;if(m.subarray)return m.subarray(0,q);m.length=q;return m};var C={arraySet:function(m,q,l,h,c){if(q.subarray&&m.subarray)m.set(q.subarray(l,l+h),c);else for(var d=0;d<h;d++)m[c+d]=q[l+d]},flattenChunks:function(m){var q,l;var h=l=0;for(q=m.length;h<q;h++)l+=
m[h].length;var c=new Uint8Array(l);h=l=0;for(q=m.length;h<q;h++){var d=m[h];c.set(d,l);l+=d.length}return c}},z={arraySet:function(m,q,l,h,c){for(var d=0;d<h;d++)m[c+d]=q[l+d]},flattenChunks:function(m){return[].concat.apply([],m)}};e.setTyped=function(m){m?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,C)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,z))};e.setTyped(u)},{}],3:[function(u,y,e){function C(h,c){if(65537>c&&(h.subarray&&q||!h.subarray&&m))return String.fromCharCode.apply(null,
z.shrinkBuf(h,c));for(var d="",l=0;l<c;l++)d+=String.fromCharCode(h[l]);return d}var z=u("./common"),m=!0,q=!0;try{String.fromCharCode.apply(null,[0])}catch(h){m=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){q=!1}var l=new z.Buf8(256);for(u=0;256>u;u++)l[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;l[254]=l[254]=1;e.string2buf=function(h){var c,d,l=h.length,m=0;for(c=0;c<l;c++){var v=h.charCodeAt(c);if(55296===(v&64512)&&c+1<l){var q=h.charCodeAt(c+1);56320===(q&64512)&&(v=
65536+(v-55296<<10)+(q-56320),c++)}m+=128>v?1:2048>v?2:65536>v?3:4}var e=new z.Buf8(m);for(c=d=0;d<m;c++)v=h.charCodeAt(c),55296===(v&64512)&&c+1<l&&(q=h.charCodeAt(c+1),56320===(q&64512)&&(v=65536+(v-55296<<10)+(q-56320),c++)),128>v?e[d++]=v:(2048>v?e[d++]=192|v>>>6:(65536>v?e[d++]=224|v>>>12:(e[d++]=240|v>>>18,e[d++]=128|v>>>12&63),e[d++]=128|v>>>6&63),e[d++]=128|v&63);return e};e.buf2binstring=function(h){return C(h,h.length)};e.binstring2buf=function(h){for(var c=new z.Buf8(h.length),d=0,l=c.length;d<
l;d++)c[d]=h.charCodeAt(d);return c};e.buf2string=function(h,c){var d,m=c||h.length,q=Array(2*m);for(c=d=0;c<m;){var v=h[c++];if(128>v)q[d++]=v;else{var e=l[v];if(4<e)q[d++]=65533,c+=e-1;else{for(v&=2===e?31:3===e?15:7;1<e&&c<m;)v=v<<6|h[c++]&63,e--;1<e?q[d++]=65533:65536>v?q[d++]=v:(v-=65536,q[d++]=55296|v>>10&1023,q[d++]=56320|v&1023)}}}return C(q,d)};e.utf8border=function(h,c){var d;c=c||h.length;c>h.length&&(c=h.length);for(d=c-1;0<=d&&128===(h[d]&192);)d--;return 0>d||0===d?c:d+l[h[d]]>c?d:c}},
{"./common":2}],4:[function(u,y,e){y.exports=function(e,u,m,q){var l=e&65535|0;e=e>>>16&65535|0;for(var h;0!==m;){h=2E3<m?2E3:m;m-=h;do l=l+u[q++]|0,e=e+l|0;while(--h);l%=65521;e%=65521}return l|e<<16|0}},{}],5:[function(u,y,e){y.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,
Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],6:[function(u,y,e){var C=function(){for(var e,m=[],q=0;256>q;q++){e=q;for(var l=0;8>l;l++)e=e&1?3988292384^e>>>1:e>>>1;m[q]=e}return m}();y.exports=function(e,m,q,l){q=l+q;for(e^=-1;l<q;l++)e=e>>>8^C[(e^m[l])&255];return e^-1}},{}],7:[function(u,y,e){y.exports=function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=
0;this.done=!1}},{}],8:[function(u,y,e){y.exports=function(e,u){var m=e.state;var q=e.next_in;var l=e.input;var h=q+(e.avail_in-5);var c=e.next_out;var d=e.output;u=c-(u-e.avail_out);var A=c+(e.avail_out-257);var y=m.dmax;var v=m.wsize;var z=m.whave;var C=m.wnext;var J=m.window;var b=m.hold;var p=m.bits;var Q=m.lencode;var E=m.distcode;var G=(1<<m.lenbits)-1;var a=(1<<m.distbits)-1;a:do{15>p&&(b+=l[q++]<<p,p+=8,b+=l[q++]<<p,p+=8);var D=Q[b&G];b:for(;;){var w=D>>>24;b>>>=w;p-=w;w=D>>>16&255;if(0===
w)d[c++]=D&65535;else if(w&16){var n=D&65535;if(w&=15)p<w&&(b+=l[q++]<<p,p+=8),n+=b&(1<<w)-1,b>>>=w,p-=w;15>p&&(b+=l[q++]<<p,p+=8,b+=l[q++]<<p,p+=8);D=E[b&a];c:for(;;){w=D>>>24;b>>>=w;p-=w;w=D>>>16&255;if(w&16){D&=65535;w&=15;p<w&&(b+=l[q++]<<p,p+=8,p<w&&(b+=l[q++]<<p,p+=8));D+=b&(1<<w)-1;if(D>y){e.msg="invalid distance too far back";m.mode=30;break a}b>>>=w;p-=w;w=c-u;if(D>w){w=D-w;if(w>z&&m.sane){e.msg="invalid distance too far back";m.mode=30;break a}var t=0;var I=J;if(0===C){if(t+=v-w,w<n){n-=
w;do d[c++]=J[t++];while(--w);t=c-D;I=d}}else if(C<w){if(t+=v+C-w,w-=C,w<n){n-=w;do d[c++]=J[t++];while(--w);t=0;if(C<n){w=C;n-=w;do d[c++]=J[t++];while(--w);t=c-D;I=d}}}else if(t+=C-w,w<n){n-=w;do d[c++]=J[t++];while(--w);t=c-D;I=d}for(;2<n;)d[c++]=I[t++],d[c++]=I[t++],d[c++]=I[t++],n-=3;n&&(d[c++]=I[t++],1<n&&(d[c++]=I[t++]))}else{t=c-D;do d[c++]=d[t++],d[c++]=d[t++],d[c++]=d[t++],n-=3;while(2<n);n&&(d[c++]=d[t++],1<n&&(d[c++]=d[t++]))}}else if(0===(w&64)){D=E[(D&65535)+(b&(1<<w)-1)];continue c}else{e.msg=
"invalid distance code";m.mode=30;break a}break}}else if(0===(w&64)){D=Q[(D&65535)+(b&(1<<w)-1)];continue b}else{w&32?m.mode=12:(e.msg="invalid literal/length code",m.mode=30);break a}break}}while(q<h&&c<A);n=p>>3;q-=n;p-=n<<3;e.next_in=q;e.next_out=c;e.avail_in=q<h?5+(h-q):5-(q-h);e.avail_out=c<A?257+(A-c):257-(c-A);m.hold=b&(1<<p)-1;m.bits=p}},{}],9:[function(u,y,e){function C(b){return(b>>>24&255)+(b>>>8&65280)+((b&65280)<<8)+((b&255)<<24)}function z(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=
!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new c.Buf16(320);this.work=new c.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function m(b){if(!b||!b.state)return-2;var d=b.state;b.total_in=b.total_out=d.total=0;
b.msg="";d.wrap&&(b.adler=d.wrap&1);d.mode=1;d.last=0;d.havedict=0;d.dmax=32768;d.head=null;d.hold=0;d.bits=0;d.lencode=d.lendyn=new c.Buf32(852);d.distcode=d.distdyn=new c.Buf32(592);d.sane=1;d.back=-1;return 0}function q(b){if(!b||!b.state)return-2;var c=b.state;c.wsize=0;c.whave=0;c.wnext=0;return m(b)}function l(b,c){if(!b||!b.state)return-2;var d=b.state;if(0>c){var e=0;c=-c}else e=(c>>4)+1,48>c&&(c&=15);if(c&&(8>c||15<c))return-2;null!==d.window&&d.wbits!==c&&(d.window=null);d.wrap=e;d.wbits=
c;return q(b)}function h(b,c){if(!b)return-2;var d=new z;b.state=d;d.window=null;c=l(b,c);0!==c&&(b.state=null);return c}var c=u("../utils/common"),d=u("./adler32"),A=u("./crc32"),R=u("./inffast"),v=u("./inftrees"),H=!0,K,J;e.inflateReset=q;e.inflateReset2=l;e.inflateResetKeep=m;e.inflateInit=function(b){return h(b,15)};e.inflateInit2=h;e.inflate=function(b,e){var h,l=new c.Buf8(4),q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!b||!b.state||!b.output||!b.input&&0!==b.avail_in)return-2;var a=
b.state;12===a.mode&&(a.mode=13);var m=b.next_out;var w=b.output;var n=b.avail_out;var t=b.next_in;var p=b.input;var r=b.avail_in;var g=a.hold;var f=a.bits;var u=r;var y=n;var z=0;a:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;16>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}if(a.wrap&2&&35615===g){a.check=0;l[0]=g&255;l[1]=g>>>8&255;a.check=A(a.check,l,2,0);f=g=0;a.mode=2;break}a.flags=0;a.head&&(a.head.done=!1);if(!(a.wrap&1)||(((g&255)<<8)+(g>>8))%31){b.msg="incorrect header check";
a.mode=30;break}if(8!==(g&15)){b.msg="unknown compression method";a.mode=30;break}g>>>=4;f-=4;var x=(g&15)+8;if(0===a.wbits)a.wbits=x;else if(x>a.wbits){b.msg="invalid window size";a.mode=30;break}a.dmax=1<<x;b.adler=a.check=1;a.mode=g&512?10:12;f=g=0;break;case 2:for(;16>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}a.flags=g;if(8!==(a.flags&255)){b.msg="unknown compression method";a.mode=30;break}if(a.flags&57344){b.msg="unknown header flags set";a.mode=30;break}a.head&&(a.head.text=g>>8&1);a.flags&
512&&(l[0]=g&255,l[1]=g>>>8&255,a.check=A(a.check,l,2,0));f=g=0;a.mode=3;case 3:for(;32>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}a.head&&(a.head.time=g);a.flags&512&&(l[0]=g&255,l[1]=g>>>8&255,l[2]=g>>>16&255,l[3]=g>>>24&255,a.check=A(a.check,l,4,0));f=g=0;a.mode=4;case 4:for(;16>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}a.head&&(a.head.xflags=g&255,a.head.os=g>>8);a.flags&512&&(l[0]=g&255,l[1]=g>>>8&255,a.check=A(a.check,l,2,0));f=g=0;a.mode=5;case 5:if(a.flags&1024){for(;16>f;){if(0===r)break a;
r--;g+=p[t++]<<f;f+=8}a.length=g;a.head&&(a.head.extra_len=g);a.flags&512&&(l[0]=g&255,l[1]=g>>>8&255,a.check=A(a.check,l,2,0));f=g=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(a.flags&1024){var k=a.length;k>r&&(k=r);k&&(a.head&&(x=a.head.extra_len-a.length,a.head.extra||(a.head.extra=Array(a.head.extra_len)),c.arraySet(a.head.extra,p,t,k,x)),a.flags&512&&(a.check=A(a.check,p,k,t)),r-=k,t+=k,a.length-=k);if(a.length)break a}a.length=0;a.mode=7;case 7:if(a.flags&2048){if(0===r)break a;k=0;
do x=p[t+k++],a.head&&x&&65536>a.length&&(a.head.name+=String.fromCharCode(x));while(x&&k<r);a.flags&512&&(a.check=A(a.check,p,k,t));r-=k;t+=k;if(x)break a}else a.head&&(a.head.name=null);a.length=0;a.mode=8;case 8:if(a.flags&4096){if(0===r)break a;k=0;do x=p[t+k++],a.head&&x&&65536>a.length&&(a.head.comment+=String.fromCharCode(x));while(x&&k<r);a.flags&512&&(a.check=A(a.check,p,k,t));r-=k;t+=k;if(x)break a}else a.head&&(a.head.comment=null);a.mode=9;case 9:if(a.flags&512){for(;16>f;){if(0===r)break a;
r--;g+=p[t++]<<f;f+=8}if(g!==(a.check&65535)){b.msg="header crc mismatch";a.mode=30;break}f=g=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0);b.adler=a.check=0;a.mode=12;break;case 10:for(;32>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}b.adler=a.check=C(g);f=g=0;a.mode=11;case 11:if(0===a.havedict)return b.next_out=m,b.avail_out=n,b.next_in=t,b.avail_in=r,a.hold=g,a.bits=f,2;b.adler=a.check=1;a.mode=12;case 12:if(5===e||6===e)break a;case 13:if(a.last){g>>>=f&7;f-=f&7;a.mode=27;break}for(;3>f;){if(0===
r)break a;r--;g+=p[t++]<<f;f+=8}a.last=g&1;g>>>=1;--f;switch(g&3){case 0:a.mode=14;break;case 1:x=a;if(H){K=new c.Buf32(512);J=new c.Buf32(32);for(k=0;144>k;)x.lens[k++]=8;for(;256>k;)x.lens[k++]=9;for(;280>k;)x.lens[k++]=7;for(;288>k;)x.lens[k++]=8;v(1,x.lens,0,288,K,0,x.work,{bits:9});for(k=0;32>k;)x.lens[k++]=5;v(2,x.lens,0,32,J,0,x.work,{bits:5});H=!1}x.lencode=K;x.lenbits=9;x.distcode=J;x.distbits=5;a.mode=20;if(6===e){g>>>=2;f-=2;break a}break;case 2:a.mode=17;break;case 3:b.msg="invalid block type",
a.mode=30}g>>>=2;f-=2;break;case 14:g>>>=f&7;for(f-=f&7;32>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}if((g&65535)!==(g>>>16^65535)){b.msg="invalid stored block lengths";a.mode=30;break}a.length=g&65535;f=g=0;a.mode=15;if(6===e)break a;case 15:a.mode=16;case 16:if(k=a.length){k>r&&(k=r);k>n&&(k=n);if(0===k)break a;c.arraySet(w,p,t,k,m);r-=k;t+=k;n-=k;m+=k;a.length-=k;break}a.mode=12;break;case 17:for(;14>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}a.nlen=(g&31)+257;g>>>=5;f-=5;a.ndist=(g&31)+1;g>>>=
5;f-=5;a.ncode=(g&15)+4;g>>>=4;f-=4;if(286<a.nlen||30<a.ndist){b.msg="too many length or distance symbols";a.mode=30;break}a.have=0;a.mode=18;case 18:for(;a.have<a.ncode;){for(;3>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}a.lens[q[a.have++]]=g&7;g>>>=3;f-=3}for(;19>a.have;)a.lens[q[a.have++]]=0;a.lencode=a.lendyn;a.lenbits=7;k={bits:a.lenbits};z=v(0,a.lens,0,19,a.lencode,0,a.work,k);a.lenbits=k.bits;if(z){b.msg="invalid code lengths set";a.mode=30;break}a.have=0;a.mode=19;case 19:for(;a.have<a.nlen+
a.ndist;){for(;;){var B=a.lencode[g&(1<<a.lenbits)-1];k=B>>>24;B&=65535;if(k<=f)break;if(0===r)break a;r--;g+=p[t++]<<f;f+=8}if(16>B)g>>>=k,f-=k,a.lens[a.have++]=B;else{if(16===B){for(x=k+2;f<x;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}g>>>=k;f-=k;if(0===a.have){b.msg="invalid bit length repeat";a.mode=30;break}x=a.lens[a.have-1];k=3+(g&3);g>>>=2;f-=2}else if(17===B){for(x=k+3;f<x;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}g>>>=k;f-=k;x=0;k=3+(g&7);g>>>=3;f-=3}else{for(x=k+7;f<x;){if(0===r)break a;r--;
g+=p[t++]<<f;f+=8}g>>>=k;f-=k;x=0;k=11+(g&127);g>>>=7;f-=7}if(a.have+k>a.nlen+a.ndist){b.msg="invalid bit length repeat";a.mode=30;break}for(;k--;)a.lens[a.have++]=x}}if(30===a.mode)break;if(0===a.lens[256]){b.msg="invalid code -- missing end-of-block";a.mode=30;break}a.lenbits=9;k={bits:a.lenbits};z=v(1,a.lens,0,a.nlen,a.lencode,0,a.work,k);a.lenbits=k.bits;if(z){b.msg="invalid literal/lengths set";a.mode=30;break}a.distbits=6;a.distcode=a.distdyn;k={bits:a.distbits};z=v(2,a.lens,a.nlen,a.ndist,
a.distcode,0,a.work,k);a.distbits=k.bits;if(z){b.msg="invalid distances set";a.mode=30;break}a.mode=20;if(6===e)break a;case 20:a.mode=21;case 21:if(6<=r&&258<=n){b.next_out=m;b.avail_out=n;b.next_in=t;b.avail_in=r;a.hold=g;a.bits=f;R(b,y);m=b.next_out;w=b.output;n=b.avail_out;t=b.next_in;p=b.input;r=b.avail_in;g=a.hold;f=a.bits;12===a.mode&&(a.back=-1);break}for(a.back=0;;){B=a.lencode[g&(1<<a.lenbits)-1];k=B>>>24;x=B>>>16&255;B&=65535;if(k<=f)break;if(0===r)break a;r--;g+=p[t++]<<f;f+=8}if(x&&0===
(x&240)){var F=k;var L=x;for(h=B;;){B=a.lencode[h+((g&(1<<F+L)-1)>>F)];k=B>>>24;x=B>>>16&255;B&=65535;if(F+k<=f)break;if(0===r)break a;r--;g+=p[t++]<<f;f+=8}g>>>=F;f-=F;a.back+=F}g>>>=k;f-=k;a.back+=k;a.length=B;if(0===x){a.mode=26;break}if(x&32){a.back=-1;a.mode=12;break}if(x&64){b.msg="invalid literal/length code";a.mode=30;break}a.extra=x&15;a.mode=22;case 22:if(a.extra){for(x=a.extra;f<x;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}a.length+=g&(1<<a.extra)-1;g>>>=a.extra;f-=a.extra;a.back+=a.extra}a.was=
a.length;a.mode=23;case 23:for(;;){B=a.distcode[g&(1<<a.distbits)-1];k=B>>>24;x=B>>>16&255;B&=65535;if(k<=f)break;if(0===r)break a;r--;g+=p[t++]<<f;f+=8}if(0===(x&240)){F=k;L=x;for(h=B;;){B=a.distcode[h+((g&(1<<F+L)-1)>>F)];k=B>>>24;x=B>>>16&255;B&=65535;if(F+k<=f)break;if(0===r)break a;r--;g+=p[t++]<<f;f+=8}g>>>=F;f-=F;a.back+=F}g>>>=k;f-=k;a.back+=k;if(x&64){b.msg="invalid distance code";a.mode=30;break}a.offset=B;a.extra=x&15;a.mode=24;case 24:if(a.extra){for(x=a.extra;f<x;){if(0===r)break a;r--;
g+=p[t++]<<f;f+=8}a.offset+=g&(1<<a.extra)-1;g>>>=a.extra;f-=a.extra;a.back+=a.extra}if(a.offset>a.dmax){b.msg="invalid distance too far back";a.mode=30;break}a.mode=25;case 25:if(0===n)break a;k=y-n;if(a.offset>k){k=a.offset-k;if(k>a.whave&&a.sane){b.msg="invalid distance too far back";a.mode=30;break}k>a.wnext?(k-=a.wnext,x=a.wsize-k):x=a.wnext-k;k>a.length&&(k=a.length);F=a.window}else F=w,x=m-a.offset,k=a.length;k>n&&(k=n);n-=k;a.length-=k;do w[m++]=F[x++];while(--k);0===a.length&&(a.mode=21);
break;case 26:if(0===n)break a;w[m++]=a.length;n--;a.mode=21;break;case 27:if(a.wrap){for(;32>f;){if(0===r)break a;r--;g|=p[t++]<<f;f+=8}y-=n;b.total_out+=y;a.total+=y;y&&(b.adler=a.check=a.flags?A(a.check,w,y,m-y):d(a.check,w,y,m-y));y=n;if((a.flags?g:C(g))!==a.check){b.msg="incorrect data check";a.mode=30;break}f=g=0}a.mode=28;case 28:if(a.wrap&&a.flags){for(;32>f;){if(0===r)break a;r--;g+=p[t++]<<f;f+=8}if(g!==(a.total&4294967295)){b.msg="incorrect length check";a.mode=30;break}f=g=0}a.mode=29;
case 29:z=1;break a;case 30:z=-3;break a;case 31:return-4;default:return-2}b.next_out=m;b.avail_out=n;b.next_in=t;b.avail_in=r;a.hold=g;a.bits=f;if(a.wsize||y!==b.avail_out&&30>a.mode&&(27>a.mode||4!==e))p=b.output,t=b.next_out,m=y-b.avail_out,n=b.state,null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new c.Buf8(n.wsize)),m>=n.wsize?(c.arraySet(n.window,p,t-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):(r=n.wsize-n.wnext,r>m&&(r=m),c.arraySet(n.window,p,t-m,r,n.wnext),(m-=r)?(c.arraySet(n.window,
p,t-m,m,0),n.wnext=m,n.whave=n.wsize):(n.wnext+=r,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=r)));u-=b.avail_in;y-=b.avail_out;b.total_in+=u;b.total_out+=y;a.total+=y;a.wrap&&y&&(b.adler=a.check=a.flags?A(a.check,w,y,b.next_out-y):d(a.check,w,y,b.next_out-y));b.data_type=a.bits+(a.last?64:0)+(12===a.mode?128:0)+(20===a.mode||15===a.mode?256:0);(0===u&&0===y||4===e)&&0===z&&(z=-5);return z};e.inflateEnd=function(b){if(!b||!b.state)return-2;var c=b.state;c.window&&(c.window=null);b.state=
null;return 0};e.inflateGetHeader=function(b,c){if(!b||!b.state)return-2;b=b.state;if(0===(b.wrap&2))return-2;b.head=c;c.done=!1;return 0};e.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":2,"./adler32":4,"./crc32":6,"./inffast":8,"./inftrees":10}],10:[function(u,y,e){var C=u("../utils/common"),z=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],m=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,
72,78],q=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];y.exports=function(e,c,d,u,y,v,H,K){var h=K.bits,b,p,A,E,G,a,D=0,w=new C.Buf16(16);var n=new C.Buf16(16);var t,I=0;for(b=0;15>=b;b++)w[b]=0;for(p=0;p<u;p++)w[c[d+p]]++;var r=h;for(A=15;1<=A&&0===w[A];A--);r>A&&(r=A);if(0===A)return y[v++]=20971520,y[v++]=20971520,K.bits=1,0;
for(h=1;h<A&&0===w[h];h++);r<h&&(r=h);for(b=E=1;15>=b;b++)if(E<<=1,E-=w[b],0>E)return-1;if(0<E&&(0===e||1!==A))return-1;n[1]=0;for(b=1;15>b;b++)n[b+1]=n[b]+w[b];for(p=0;p<u;p++)0!==c[d+p]&&(H[n[c[d+p]]++]=p);switch(e){case 0:var g=t=H;var f=19;break;case 1:g=z;D-=257;t=m;I-=257;f=256;break;default:g=q,t=l,f=-1}p=G=0;b=h;var N=v;u=r;n=0;var P=-1;var M=1<<r;var x=M-1;if(1===e&&852<M||2===e&&592<M)return 1;for(var k=0;;){k++;var B=b-n;if(H[p]<f){var F=0;var L=H[p]}else H[p]>f?(F=t[I+H[p]],L=g[D+H[p]]):
(F=96,L=0);E=1<<b-n;h=a=1<<u;do a-=E,y[N+(G>>n)+a]=B<<24|F<<16|L|0;while(0!==a);for(E=1<<b-1;G&E;)E>>=1;0!==E?(G&=E-1,G+=E):G=0;p++;if(0===--w[b]){if(b===A)break;b=c[d+H[p]]}if(b>r&&(G&x)!==P){0===n&&(n=r);N+=h;u=b-n;for(E=1<<u;u+n<A;){E-=w[u+n];if(0>=E)break;u++;E<<=1}M+=1<<u;if(1===e&&852<M||2===e&&592<M)return 1;P=G&x;y[P]=r<<24|u<<16|N-v|0}}0!==G&&(y[N+G]=b-n<<24|4194304);K.bits=r;return 0}},{"../utils/common":2}],11:[function(u,y,e){y.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error",
"-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],12:[function(u,y,e){y.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}]},{},[1])(1)});
(function(h,k){"function"===typeof define&&define.amd&&"undefined"===typeof Jupyter?define([],k):"undefined"!==typeof exports?k():(k(),h.FileSaver={})})(this,function(){function h(a,b){"undefined"===typeof b?b={autoBom:!1}:"object"!==typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b});return b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob([String.fromCharCode(65279),a],{type:a.type}):a}function k(a,
b,e){var c=new XMLHttpRequest;c.open("GET",a);c.responseType="blob";c.onload=function(){g(c.response,b,e)};c.onerror=function(){console.error("could not download file")};c.send()}function m(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(e){}return 200<=b.status&&299>=b.status}function l(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(e){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null);a.dispatchEvent(b)}}var f=
"object"===typeof window&&window.window===window?window:"object"===typeof self&&self.self===self?self:"object"===typeof global&&global.global===global?global:void 0,n=/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!==typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!n?function(a,b,e){var c=f.URL||f.webkitURL,d=document.createElement("a");b=b||a.name||"download";d.download=b;d.rel=
"noopener";"string"===typeof a?(d.href=a,d.origin!==location.origin?m(d.href)?k(a,b,e):l(d,d.target="_blank"):l(d)):(d.href=c.createObjectURL(a),setTimeout(function(){c.revokeObjectURL(d.href)},4E4),setTimeout(function(){l(d)},0))}:"msSaveOrOpenBlob"in navigator?function(a,b,e){b=b||a.name||"download";if("string"===typeof a)if(m(a))k(a,b,e);else{var c=document.createElement("a");c.href=a;c.target="_blank";setTimeout(function(){l(c)})}else navigator.msSaveOrOpenBlob(h(a,e),b)}:function(a,b,e,c){if(c=
c||open("","_blank"))c.document.title=c.document.body.innerText="downloading...";if("string"===typeof a)return k(a,b,e);b="application/octet-stream"===a.type;e=/constructor/i.test(f.HTMLElement)||f.safari;var d=/CriOS\/[\d]+/.test(navigator.userAgent);if((d||b&&e||n)&&"undefined"!==typeof FileReader){var g=new FileReader;g.onloadend=function(){var a=g.result;a=d?a:a.replace(/^data:[^;]*;/,"data:attachment/file;");c?c.location.href=a:location=a;c=null};g.readAsDataURL(a)}else{var l=f.URL||f.webkitURL,
h=l.createObjectURL(a);c?c.location=h:location.href=h;c=null;setTimeout(function(){l.revokeObjectURL(h)},4E4)}});f.saveAs=g.saveAs=g;"undefined"!==typeof module&&(module.exports=g)});
/* canvas-toBlob.js
* A canvas.toBlob() implementation.
* 2013-12-27
*
* By Eli Grey, http://eligrey.com and Devin Samarin, https://github.com/eboyjr
* License: X11/MIT
* See https://github.com/eligrey/canvas-toBlob.js/blob/master/LICENSE.md
*/
/*global self */
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
plusplus: true */
/*! @source http://purl.eligrey.com/github/canvas-toBlob.js/blob/master/canvas-toBlob.js */
(function(view) {
"use strict";
var
Uint8Array = view.Uint8Array
, HTMLCanvasElement = view.HTMLCanvasElement
, canvas_proto = HTMLCanvasElement && HTMLCanvasElement.prototype
, is_base64_regex = /\s*;\s*base64\s*(?:;|$)/i
, to_data_url = "toDataURL"
, base64_ranks
, decode_base64 = function(base64) {
var
len = base64.length
, buffer = new Uint8Array(len / 4 * 3 | 0)
, i = 0
, outptr = 0
, last = [0, 0]
, state = 0
, save = 0
, rank
, code
, undef
;
while (len--) {
code = base64.charCodeAt(i++);
rank = base64_ranks[code-43];
if (rank !== 255 && rank !== undef) {
last[1] = last[0];
last[0] = code;
save = (save << 6) | rank;
state++;
if (state === 4) {
buffer[outptr++] = save >>> 16;
if (last[1] !== 61 /* padding character */) {
buffer[outptr++] = save >>> 8;
}
if (last[0] !== 61 /* padding character */) {
buffer[outptr++] = save;
}
state = 0;
}
}
}
// 2/3 chance there's going to be some null bytes at the end, but that
// doesn't really matter with most image formats.
// If it somehow matters for you, truncate the buffer up outptr.
return buffer;
}
;
if (Uint8Array) {
base64_ranks = new Uint8Array([
62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1
, -1, -1, 0, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
]);
}
if (HTMLCanvasElement && !canvas_proto.toBlob) {
canvas_proto.toBlob = function(callback, type /*, ...args*/) {
if (!type) {
type = "image/png";
} if (this.mozGetAsFile) {
callback(this.mozGetAsFile("canvas", type));
return;
} if (this.msToBlob && /^\s*image\/png\s*(?:$|;)/i.test(type)) {
callback(this.msToBlob());
return;
}
var
args = Array.prototype.slice.call(arguments, 1)