Advertisement
RomanIceman

Untitled

Apr 3rd, 2020
935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
  3.  * v1.5.3
  4.  *
  5.  * Copyright 2013, Moxiecode Systems AB
  6.  * Released under GPL License.
  7.  *
  8.  * License: http://www.plupload.com/license
  9.  * Contributing: http://www.plupload.com/contributing
  10.  *
  11.  * Date: 2017-02-02
  12.  */
  13. !function (e, t) {
  14.   var i = function () {
  15.     var e = {
  16.     };
  17.     return t.apply(e, arguments),
  18.     e.moxie
  19.   };
  20.   'function' == typeof define && define.amd ? define('moxie', [
  21.   ], i)  : 'object' == typeof module && module.exports ? module.exports = i()  : e.moxie = i()
  22. }(this || window, function () {
  23.   !function (e, t) {
  24.     'use strict';
  25.     function i(e, t) {
  26.       for (var i, n = [
  27.       ], r = 0; r < e.length; ++r) {
  28.         if (i = s[e[r]] || o(e[r]), !i) throw 'module definition dependecy not found: ' + e[r];
  29.         n.push(i)
  30.       }
  31.       t.apply(null, n)
  32.     }
  33.     function n(e, n, r) {
  34.       if ('string' != typeof e) throw 'invalid module definition, module id must be defined and be a string';
  35.       if (n === t) throw 'invalid module definition, dependencies must be specified';
  36.       if (r === t) throw 'invalid module definition, definition function must be specified';
  37.       i(n, function () {
  38.         s[e] = r.apply(null, arguments)
  39.       })
  40.     }
  41.     function r(e) {
  42.       return !!s[e]
  43.     }
  44.     function o(t) {
  45.       for (var i = e, n = t.split(/[.\/]/), r = 0; r < n.length; ++r) {
  46.         if (!i[n[r]]) return;
  47.         i = i[n[r]]
  48.       }
  49.       return i
  50.     }
  51.     function a(i) {
  52.       for (var n = 0; n < i.length; n++) {
  53.         for (var r = e, o = i[n], a = o.split(/[.\/]/), u = 0; u < a.length - 1; ++u) r[a[u]] === t && (r[a[u]] = {
  54.         }),
  55.         r = r[a[u]];
  56.         r[a[a.length - 1]] = s[o]
  57.       }
  58.     }
  59.     var s = {
  60.     };
  61.     n('moxie/core/utils/Basic', [
  62.     ], function () {
  63.       function e(e) {
  64.         var t;
  65.         return e === t ? 'undefined' : null === e ? 'null' : e.nodeType ? 'node' : {
  66.         }.toString.call(e).match(/\s([a-z|A-Z]+)/) [1].toLowerCase()
  67.       }
  68.       function t() {
  69.         return a(!1, !1, arguments)
  70.       }
  71.       function i() {
  72.         return a(!0, !1, arguments)
  73.       }
  74.       function n() {
  75.         return a(!1, !0, arguments)
  76.       }
  77.       function r() {
  78.         return a(!0, !0, arguments)
  79.       }
  80.       function o(i) {
  81.         switch (e(i)) {
  82.           case 'array':
  83.             return Array.prototype.slice.call(i);
  84.           case 'object':
  85.             return t({
  86.             }, i)
  87.         }
  88.         return i
  89.       }
  90.       function a(t, i, n) {
  91.         var r,
  92.         s = n[0];
  93.         return u(n, function (n, c) {
  94.           c > 0 && u(n, function (n, u) {
  95.             var c = - 1 !== m(e(n), [
  96.               'array',
  97.               'object'
  98.             ]);
  99.             return n === r || t && s[u] === r ? !0 : (c && i && (n = o(n)), e(s[u]) === e(n) && c ? a(t, i, [
  100.               s[u],
  101.               n
  102.             ])  : s[u] = n, void 0)
  103.           })
  104.         }),
  105.         s
  106.       }
  107.       function s(e, t) {
  108.         function i() {
  109.           this.constructor = e
  110.         }
  111.         for (var n in t) ({
  112.         }).hasOwnProperty.call(t, n) && (e[n] = t[n]);
  113.         return i.prototype = t.prototype,
  114.         e.prototype = new i,
  115.         e.__parent__ = t.prototype,
  116.         e
  117.       }
  118.       function u(e, t) {
  119.         var i,
  120.         n,
  121.         r,
  122.         o;
  123.         if (e) {
  124.           try {
  125.             i = e.length
  126.           } catch (a) {
  127.             i = o
  128.           }
  129.           if (i === o || 'number' != typeof i) {
  130.             for (n in e) if (e.hasOwnProperty(n) && t(e[n], n) === !1) return
  131.           } else for (r = 0; i > r; r++) if (t(e[r], r) === !1) return
  132.         }
  133.       }
  134.       function c(t) {
  135.         var i;
  136.         if (!t || 'object' !== e(t)) return !0;
  137.         for (i in t) return !1;
  138.         return !0
  139.       }
  140.       function l(t, i) {
  141.         function n(r) {
  142.           'function' === e(t[r]) && t[r](function (e) {
  143.             ++r < o && !e ? n(r)  : i(e)
  144.           })
  145.         }
  146.         var r = 0,
  147.         o = t.length;
  148.         'function' !== e(i) && (i = function () {
  149.         }),
  150.         t && t.length || i(),
  151.         n(r)
  152.       }
  153.       function d(e, t) {
  154.         var i = 0,
  155.         n = e.length,
  156.         r = new Array(n);
  157.         u(e, function (e, o) {
  158.           e(function (e) {
  159.             if (e) return t(e);
  160.             var a = [
  161.             ].slice.call(arguments);
  162.             a.shift(),
  163.             r[o] = a,
  164.             i++,
  165.             i === n && (r.unshift(null), t.apply(this, r))
  166.           })
  167.         })
  168.       }
  169.       function m(e, t) {
  170.         if (t) {
  171.           if (Array.prototype.indexOf) return Array.prototype.indexOf.call(t, e);
  172.           for (var i = 0, n = t.length; n > i; i++) if (t[i] === e) return i
  173.         }
  174.         return - 1
  175.       }
  176.       function h(t, i) {
  177.         var n = [
  178.         ];
  179.         'array' !== e(t) && (t = [
  180.           t
  181.         ]),
  182.         'array' !== e(i) && (i = [
  183.           i
  184.         ]);
  185.         for (var r in t) - 1 === m(t[r], i) && n.push(t[r]);
  186.         return n.length ? n : !1
  187.       }
  188.       function f(e, t) {
  189.         var i = [
  190.         ];
  191.         return u(e, function (e) {
  192.           - 1 !== m(e, t) && i.push(e)
  193.         }),
  194.         i.length ? i : null
  195.       }
  196.       function p(e) {
  197.         var t,
  198.         i = [
  199.         ];
  200.         for (t = 0; t < e.length; t++) i[t] = e[t];
  201.         return i
  202.       }
  203.       function g(e) {
  204.         return e ? String.prototype.trim ? String.prototype.trim.call(e)  : e.toString().replace(/^\s*/, '').replace(/\s*$/, '')  : e
  205.       }
  206.       function x(e) {
  207.         if ('string' != typeof e) return e;
  208.         var t,
  209.         i = {
  210.           t: 1099511627776,
  211.           g: 1073741824,
  212.           m: 1048576,
  213.           k: 1024
  214.         };
  215.         return e = /^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g, '')),
  216.         t = e[2],
  217.         e = + e[1],
  218.         i.hasOwnProperty(t) && (e *= i[t]),
  219.         Math.floor(e)
  220.       }
  221.       function v(t) {
  222.         var i = [
  223.         ].slice.call(arguments, 1);
  224.         return t.replace(/%[a-z]/g, function () {
  225.           var t = i.shift();
  226.           return 'undefined' !== e(t) ? t : ''
  227.         })
  228.       }
  229.       function w(e, t) {
  230.         var i = this;
  231.         setTimeout(function () {
  232.           e.call(i)
  233.         }, t || 1)
  234.       }
  235.       var y = function () {
  236.         var e = 0;
  237.         return function (t) {
  238.           var i,
  239.           n = (new Date).getTime().toString(32);
  240.           for (i = 0; 5 > i; i++) n += Math.floor(65535 * Math.random()).toString(32);
  241.           return (t || 'o_') + n + (e++).toString(32)
  242.         }
  243.       }();
  244.       return {
  245.         guid: y,
  246.         typeOf: e,
  247.         extend: t,
  248.         extendIf: i,
  249.         extendImmutable: n,
  250.         extendImmutableIf: r,
  251.         inherit: s,
  252.         each: u,
  253.         isEmptyObj: c,
  254.         inSeries: l,
  255.         inParallel: d,
  256.         inArray: m,
  257.         arrayDiff: h,
  258.         arrayIntersect: f,
  259.         toArray: p,
  260.         trim: g,
  261.         sprintf: v,
  262.         parseSizeStr: x,
  263.         delay: w
  264.       }
  265.     }), n('moxie/core/utils/Encode', [
  266.     ], function () {
  267.       var e = function (e) {
  268.         return unescape(encodeURIComponent(e))
  269.       },
  270.       t = function (e) {
  271.         return decodeURIComponent(escape(e))
  272.       },
  273.       i = function (e, i) {
  274.         if ('function' == typeof window.atob) return i ? t(window.atob(e))  : window.atob(e);
  275.         var n,
  276.         r,
  277.         o,
  278.         a,
  279.         s,
  280.         u,
  281.         c,
  282.         l,
  283.         d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  284.         m = 0,
  285.         h = 0,
  286.         f = '',
  287.         p = [
  288.         ];
  289.         if (!e) return e;
  290.         e += '';
  291.         do a = d.indexOf(e.charAt(m++)),
  292.         s = d.indexOf(e.charAt(m++)),
  293.         u = d.indexOf(e.charAt(m++)),
  294.         c = d.indexOf(e.charAt(m++)),
  295.         l = a << 18 | s << 12 | u << 6 | c,
  296.         n = 255 & l >> 16,
  297.         r = 255 & l >> 8,
  298.         o = 255 & l,
  299.         p[h++] = 64 == u ? String.fromCharCode(n)  : 64 == c ? String.fromCharCode(n, r)  : String.fromCharCode(n, r, o);
  300.         while (m < e.length);
  301.         return f = p.join(''),
  302.         i ? t(f)  : f
  303.       },
  304.       n = function (t, i) {
  305.         if (i && (t = e(t)), 'function' == typeof window.btoa) return window.btoa(t);
  306.         var n,
  307.         r,
  308.         o,
  309.         a,
  310.         s,
  311.         u,
  312.         c,
  313.         l,
  314.         d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  315.         m = 0,
  316.         h = 0,
  317.         f = '',
  318.         p = [
  319.         ];
  320.         if (!t) return t;
  321.         do n = t.charCodeAt(m++),
  322.         r = t.charCodeAt(m++),
  323.         o = t.charCodeAt(m++),
  324.         l = n << 16 | r << 8 | o,
  325.         a = 63 & l >> 18,
  326.         s = 63 & l >> 12,
  327.         u = 63 & l >> 6,
  328.         c = 63 & l,
  329.         p[h++] = d.charAt(a) + d.charAt(s) + d.charAt(u) + d.charAt(c);
  330.         while (m < t.length);
  331.         f = p.join('');
  332.         var g = t.length % 3;
  333.         return (g ? f.slice(0, g - 3)  : f) + '==='.slice(g || 3)
  334.       };
  335.       return {
  336.         utf8_encode: e,
  337.         utf8_decode: t,
  338.         atob: i,
  339.         btoa: n
  340.       }
  341.     }), n('moxie/core/utils/Env', [
  342.       'moxie/core/utils/Basic'
  343.     ], function (e) {
  344.       function t(e, t, i) {
  345.         var n = 0,
  346.         r = 0,
  347.         o = 0,
  348.         a = {
  349.           dev: - 6,
  350.           alpha: - 5,
  351.           a: - 5,
  352.           beta: - 4,
  353.           b: - 4,
  354.           RC: - 3,
  355.           rc: - 3,
  356.           '#': - 2,
  357.           p: 1,
  358.           pl: 1
  359.         },
  360.         s = function (e) {
  361.           return e = ('' + e).replace(/[_\-+]/g, '.'),
  362.           e = e.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'),
  363.           e.length ? e.split('.')  : [
  364.             - 8
  365.           ]
  366.         },
  367.         u = function (e) {
  368.           return e ? isNaN(e) ? a[e] || - 7 : parseInt(e, 10)  : 0
  369.         };
  370.         for (e = s(e), t = s(t), r = Math.max(e.length, t.length), n = 0; r > n; n++) if (e[n] != t[n]) {
  371.           if (e[n] = u(e[n]), t[n] = u(t[n]), e[n] < t[n]) {
  372.             o = - 1;
  373.             break
  374.           }
  375.           if (e[n] > t[n]) {
  376.             o = 1;
  377.             break
  378.           }
  379.         }
  380.         if (!i) return o;
  381.         switch (i) {
  382.           case '>':
  383.           case 'gt':
  384.             return o > 0;
  385.           case '>=':
  386.           case 'ge':
  387.             return o >= 0;
  388.           case '<=':
  389.           case 'le':
  390.             return 0 >= o;
  391.           case '==':
  392.           case '=':
  393.           case 'eq':
  394.             return 0 === o;
  395.           case '<>':
  396.           case '!=':
  397.           case 'ne':
  398.             return 0 !== o;
  399.           case '':
  400.           case '<':
  401.           case 'lt':
  402.             return 0 > o;
  403.           default:
  404.             return null
  405.         }
  406.       }
  407.       var i = function (e) {
  408.         var t = '',
  409.         i = '?',
  410.         n = 'function',
  411.         r = 'undefined',
  412.         o = 'object',
  413.         a = 'name',
  414.         s = 'version',
  415.         u = {
  416.           has: function (e, t) {
  417.             return - 1 !== t.toLowerCase().indexOf(e.toLowerCase())
  418.           },
  419.           lowerize: function (e) {
  420.             return e.toLowerCase()
  421.           }
  422.         },
  423.         c = {
  424.           rgx: function () {
  425.             for (var t, i, a, s, u, c, l, d = 0, m = arguments; d < m.length; d += 2) {
  426.               var h = m[d],
  427.               f = m[d + 1];
  428.               if (typeof t === r) {
  429.                 t = {
  430.                 };
  431.                 for (s in f) u = f[s],
  432.                 typeof u === o ? t[u[0]] = e : t[u] = e
  433.               }
  434.               for (i = a = 0; i < h.length; i++) if (c = h[i].exec(this.getUA())) {
  435.                 for (s = 0; s < f.length; s++) l = c[++a],
  436.                 u = f[s],
  437.                 typeof u === o && u.length > 0 ? 2 == u.length ? t[u[0]] = typeof u[1] == n ? u[1].call(this, l)  : u[1] : 3 == u.length ? t[u[0]] = typeof u[1] !== n || u[1].exec && u[1].test ? l ? l.replace(u[1], u[2])  : e : l ? u[1].call(this, l, u[2])  : e : 4 == u.length && (t[u[0]] = l ? u[3].call(this, l.replace(u[1], u[2]))  : e)  : t[u] = l ? l : e;
  438.                 break
  439.               }
  440.               if (c) break
  441.             }
  442.             return t
  443.           },
  444.           str: function (t, n) {
  445.             for (var r in n) if (typeof n[r] === o && n[r].length > 0) {
  446.               for (var a = 0; a < n[r].length; a++) if (u.has(n[r][a], t)) return r === i ? e : r
  447.             } else if (u.has(n[r], t)) return r === i ? e : r;
  448.             return t
  449.           }
  450.         },
  451.         l = {
  452.           browser: {
  453.             oldsafari: {
  454.               major: {
  455.                 1: [
  456.                   '/8',
  457.                   '/1',
  458.                   '/3'
  459.                 ],
  460.                 2: '/4',
  461.                 '?': '/'
  462.               },
  463.               version: {
  464.                 '1.0': '/8',
  465.                 1.2: '/1',
  466.                 1.3: '/3',
  467.                 '2.0': '/412',
  468.                 '2.0.2': '/416',
  469.                 '2.0.3': '/417',
  470.                 '2.0.4': '/419',
  471.                 '?': '/'
  472.               }
  473.             }
  474.           },
  475.           device: {
  476.             sprint: {
  477.               model: {
  478.                 'Evo Shift 4G': '7373KT'
  479.               },
  480.               vendor: {
  481.                 HTC: 'APA',
  482.                 Sprint: 'Sprint'
  483.               }
  484.             }
  485.           },
  486.           os: {
  487.             windows: {
  488.               version: {
  489.                 ME: '4.90',
  490.                 'NT 3.11': 'NT3.51',
  491.                 'NT 4.0': 'NT4.0',
  492.                 2000: 'NT 5.0',
  493.                 XP: [
  494.                   'NT 5.1',
  495.                   'NT 5.2'
  496.                 ],
  497.                 Vista: 'NT 6.0',
  498.                 7: 'NT 6.1',
  499.                 8: 'NT 6.2',
  500.                 8.1: 'NT 6.3',
  501.                 RT: 'ARM'
  502.               }
  503.             }
  504.           }
  505.         },
  506.         d = {
  507.           browser: [
  508.             [/(opera\smini)\/([\w\.-]+)/i,
  509.             /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,
  510.             /(opera).+version\/([\w\.]+)/i,
  511.             /(opera)[\/\s]+([\w\.]+)/i],
  512.             [
  513.               a,
  514.               s
  515.             ],
  516.             [
  517.               /\s(opr)\/([\w\.]+)/i
  518.             ],
  519.             [
  520.               [a,
  521.               'Opera'],
  522.               s
  523.             ],
  524.             [
  525.               /(kindle)\/([\w\.]+)/i,
  526.               /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,
  527.               /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,
  528.               /(?:ms|\()(ie)\s([\w\.]+)/i,
  529.               /(rekonq)\/([\w\.]+)*/i,
  530.               /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i
  531.             ],
  532.             [
  533.               a,
  534.               s
  535.             ],
  536.             [
  537.               /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i
  538.             ],
  539.             [
  540.               [a,
  541.               'IE'],
  542.               s
  543.             ],
  544.             [
  545.               /(edge)\/((\d+)?[\w\.]+)/i
  546.             ],
  547.             [
  548.               a,
  549.               s
  550.             ],
  551.             [
  552.               /(yabrowser)\/([\w\.]+)/i
  553.             ],
  554.             [
  555.               [a,
  556.               'Yandex'],
  557.               s
  558.             ],
  559.             [
  560.               /(comodo_dragon)\/([\w\.]+)/i
  561.             ],
  562.             [
  563.               [a,
  564.               /_/g,
  565.               ' '],
  566.               s
  567.             ],
  568.             [
  569.               /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,
  570.               /(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i
  571.             ],
  572.             [
  573.               a,
  574.               s
  575.             ],
  576.             [
  577.               /(dolfin)\/([\w\.]+)/i
  578.             ],
  579.             [
  580.               [a,
  581.               'Dolphin'],
  582.               s
  583.             ],
  584.             [
  585.               /((?:android.+)crmo|crios)\/([\w\.]+)/i
  586.             ],
  587.             [
  588.               [a,
  589.               'Chrome'],
  590.               s
  591.             ],
  592.             [
  593.               /XiaoMi\/MiuiBrowser\/([\w\.]+)/i
  594.             ],
  595.             [
  596.               s,
  597.               [
  598.                 a,
  599.                 'MIUI Browser'
  600.               ]
  601.             ],
  602.             [
  603.               /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i
  604.             ],
  605.             [
  606.               s,
  607.               [
  608.                 a,
  609.                 'Android Browser'
  610.               ]
  611.             ],
  612.             [
  613.               /FBAV\/([\w\.]+);/i
  614.             ],
  615.             [
  616.               s,
  617.               [
  618.                 a,
  619.                 'Facebook'
  620.               ]
  621.             ],
  622.             [
  623.               /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i
  624.             ],
  625.             [
  626.               s,
  627.               [
  628.                 a,
  629.                 'Mobile Safari'
  630.               ]
  631.             ],
  632.             [
  633.               /version\/([\w\.]+).+?(mobile\s?safari|safari)/i
  634.             ],
  635.             [
  636.               s,
  637.               a
  638.             ],
  639.             [
  640.               /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i
  641.             ],
  642.             [
  643.               a,
  644.               [
  645.                 s,
  646.                 c.str,
  647.                 l.browser.oldsafari.version
  648.               ]
  649.             ],
  650.             [
  651.               /(konqueror)\/([\w\.]+)/i,
  652.               /(webkit|khtml)\/([\w\.]+)/i
  653.             ],
  654.             [
  655.               a,
  656.               s
  657.             ],
  658.             [
  659.               /(navigator|netscape)\/([\w\.-]+)/i
  660.             ],
  661.             [
  662.               [a,
  663.               'Netscape'],
  664.               s
  665.             ],
  666.             [
  667.               /(swiftfox)/i,
  668.               /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
  669.               /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,
  670.               /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,
  671.               /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,
  672.               /(links)\s\(([\w\.]+)/i,
  673.               /(gobrowser)\/?([\w\.]+)*/i,
  674.               /(ice\s?browser)\/v?([\w\._]+)/i,
  675.               /(mosaic)[\/\s]([\w\.]+)/i
  676.             ],
  677.             [
  678.               a,
  679.               s
  680.             ]
  681.           ],
  682.           engine: [
  683.             [/windows.+\sedge\/([\w\.]+)/i],
  684.             [
  685.               s,
  686.               [
  687.                 a,
  688.                 'EdgeHTML'
  689.               ]
  690.             ],
  691.             [
  692.               /(presto)\/([\w\.]+)/i,
  693.               /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,
  694.               /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,
  695.               /(icab)[\/\s]([23]\.[\d\.]+)/i
  696.             ],
  697.             [
  698.               a,
  699.               s
  700.             ],
  701.             [
  702.               /rv\:([\w\.]+).*(gecko)/i
  703.             ],
  704.             [
  705.               s,
  706.               a
  707.             ]
  708.           ],
  709.           os: [
  710.             [/microsoft\s(windows)\s(vista|xp)/i],
  711.             [
  712.               a,
  713.               s
  714.             ],
  715.             [
  716.               /(windows)\snt\s6\.2;\s(arm)/i,
  717.               /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
  718.             ],
  719.             [
  720.               a,
  721.               [
  722.                 s,
  723.                 c.str,
  724.                 l.os.windows.version
  725.               ]
  726.             ],
  727.             [
  728.               /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
  729.             ],
  730.             [
  731.               [a,
  732.               'Windows'],
  733.               [
  734.                 s,
  735.                 c.str,
  736.                 l.os.windows.version
  737.               ]
  738.             ],
  739.             [
  740.               /\((bb)(10);/i
  741.             ],
  742.             [
  743.               [a,
  744.               'BlackBerry'],
  745.               s
  746.             ],
  747.             [
  748.               /(blackberry)\w*\/?([\w\.]+)*/i,
  749.               /(tizen)[\/\s]([\w\.]+)/i,
  750.               /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
  751.               /linux;.+(sailfish);/i
  752.             ],
  753.             [
  754.               a,
  755.               s
  756.             ],
  757.             [
  758.               /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i
  759.             ],
  760.             [
  761.               [a,
  762.               'Symbian'],
  763.               s
  764.             ],
  765.             [
  766.               /\((series40);/i
  767.             ],
  768.             [
  769.               a
  770.             ],
  771.             [
  772.               /mozilla.+\(mobile;.+gecko.+firefox/i
  773.             ],
  774.             [
  775.               [a,
  776.               'Firefox OS'],
  777.               s
  778.             ],
  779.             [
  780.               /(nintendo|playstation)\s([wids3portablevu]+)/i,
  781.               /(mint)[\/\s\(]?(\w+)*/i,
  782.               /(mageia|vectorlinux)[;\s]/i,
  783.               /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,
  784.               /(hurd|linux)\s?([\w\.]+)*/i,
  785.               /(gnu)\s?([\w\.]+)*/i
  786.             ],
  787.             [
  788.               a,
  789.               s
  790.             ],
  791.             [
  792.               /(cros)\s[\w]+\s([\w\.]+\w)/i
  793.             ],
  794.             [
  795.               [a,
  796.               'Chromium OS'],
  797.               s
  798.             ],
  799.             [
  800.               /(sunos)\s?([\w\.]+\d)*/i
  801.             ],
  802.             [
  803.               [a,
  804.               'Solaris'],
  805.               s
  806.             ],
  807.             [
  808.               /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i
  809.             ],
  810.             [
  811.               a,
  812.               s
  813.             ],
  814.             [
  815.               /(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i
  816.             ],
  817.             [
  818.               [a,
  819.               'iOS'],
  820.               [
  821.                 s,
  822.                 /_/g,
  823.                 '.'
  824.               ]
  825.             ],
  826.             [
  827.               /(mac\sos\sx)\s?([\w\s\.]+\w)*/i,
  828.               /(macintosh|mac(?=_powerpc)\s)/i
  829.             ],
  830.             [
  831.               [a,
  832.               'Mac OS'],
  833.               [
  834.                 s,
  835.                 /_/g,
  836.                 '.'
  837.               ]
  838.             ],
  839.             [
  840.               /((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,
  841.               /(haiku)\s(\w+)/i,
  842.               /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,
  843.               /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,
  844.               /(unix)\s?([\w\.]+)*/i
  845.             ],
  846.             [
  847.               a,
  848.               s
  849.             ]
  850.           ]
  851.         },
  852.         m = function (e) {
  853.           var i = e || (window && window.navigator && window.navigator.userAgent ? window.navigator.userAgent : t);
  854.           this.getBrowser = function () {
  855.             return c.rgx.apply(this, d.browser)
  856.           },
  857.           this.getEngine = function () {
  858.             return c.rgx.apply(this, d.engine)
  859.           },
  860.           this.getOS = function () {
  861.             return c.rgx.apply(this, d.os)
  862.           },
  863.           this.getResult = function () {
  864.             return {
  865.               ua: this.getUA(),
  866.               browser: this.getBrowser(),
  867.               engine: this.getEngine(),
  868.               os: this.getOS()
  869.             }
  870.           },
  871.           this.getUA = function () {
  872.             return i
  873.           },
  874.           this.setUA = function (e) {
  875.             return i = e,
  876.             this
  877.           },
  878.           this.setUA(i)
  879.         };
  880.         return m
  881.       }(),
  882.       n = function () {
  883.         var t = {
  884.           define_property: function () {
  885.             return !1
  886.           }(),
  887.           create_canvas: function () {
  888.             var e = document.createElement('canvas');
  889.             return !(!e.getContext || !e.getContext('2d'))
  890.           }(),
  891.           return_response_type: function (t) {
  892.             try {
  893.               if ( - 1 !== e.inArray(t, [
  894.                 '',
  895.                 'text',
  896.                 'document'
  897.               ])) return !0;
  898.               if (window.XMLHttpRequest) {
  899.                 var i = new XMLHttpRequest;
  900.                 if (i.open('get', '/'), 'responseType' in i) return i.responseType = t,
  901.                 i.responseType !== t ? !1 : !0
  902.               }
  903.             } catch (n) {
  904.             }
  905.             return !1
  906.           },
  907.           use_data_uri: function () {
  908.             var e = new Image;
  909.             return e.onload = function () {
  910.               t.use_data_uri = 1 === e.width && 1 === e.height
  911.             },
  912.             setTimeout(function () {
  913.               e.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='
  914.             }, 1),
  915.             !1
  916.           }(),
  917.           use_data_uri_over32kb: function () {
  918.             return t.use_data_uri && ('IE' !== o.browser || o.version >= 9)
  919.           },
  920.           use_data_uri_of: function (e) {
  921.             return t.use_data_uri && 33000 > e || t.use_data_uri_over32kb()
  922.           },
  923.           use_fileinput: function () {
  924.             if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) return !1;
  925.             var e = document.createElement('input');
  926.             return e.setAttribute('type', 'file'),
  927.             !e.disabled
  928.           }
  929.         };
  930.         return function (i) {
  931.           var n = [
  932.           ].slice.call(arguments);
  933.           return n.shift(),
  934.           'function' === e.typeOf(t[i]) ? t[i].apply(this, n)  : !!t[i]
  935.         }
  936.       }(),
  937.       r = (new i).getResult(),
  938.       o = {
  939.         can: n,
  940.         uaParser: i,
  941.         browser: r.browser.name,
  942.         version: r.browser.version,
  943.         os: r.os.name,
  944.         osVersion: r.os.version,
  945.         verComp: t,
  946.         swf_url: '../flash/Moxie.swf',
  947.         xap_url: '../silverlight/Moxie.xap',
  948.         global_event_dispatcher: 'moxie.core.EventTarget.instance.dispatchEvent'
  949.       };
  950.       return o.OS = o.os,
  951.       o
  952.     }), n('moxie/core/Exceptions', [
  953.       'moxie/core/utils/Basic'
  954.     ], function (e) {
  955.       function t(e, t) {
  956.         var i;
  957.         for (i in e) if (e[i] === t) return i;
  958.         return null
  959.       }
  960.       return {
  961.         RuntimeError: function () {
  962.           function i(e, i) {
  963.             this.code = e,
  964.             this.name = t(n, e),
  965.             this.message = this.name + (i || ': RuntimeError ' + this.code)
  966.           }
  967.           var n = {
  968.             NOT_INIT_ERR: 1,
  969.             EXCEPTION_ERR: 3,
  970.             NOT_SUPPORTED_ERR: 9,
  971.             JS_ERR: 4
  972.           };
  973.           return e.extend(i, n),
  974.           i.prototype = Error.prototype,
  975.           i
  976.         }(),
  977.         OperationNotAllowedException: function () {
  978.           function t(e) {
  979.             this.code = e,
  980.             this.name = 'OperationNotAllowedException'
  981.           }
  982.           return e.extend(t, {
  983.             NOT_ALLOWED_ERR: 1
  984.           }),
  985.           t.prototype = Error.prototype,
  986.           t
  987.         }(),
  988.         ImageError: function () {
  989.           function i(e) {
  990.             this.code = e,
  991.             this.name = t(n, e),
  992.             this.message = this.name + ': ImageError ' + this.code
  993.           }
  994.           var n = {
  995.             WRONG_FORMAT: 1,
  996.             MAX_RESOLUTION_ERR: 2,
  997.             INVALID_META_ERR: 3
  998.           };
  999.           return e.extend(i, n),
  1000.           i.prototype = Error.prototype,
  1001.           i
  1002.         }(),
  1003.         FileException: function () {
  1004.           function i(e) {
  1005.             this.code = e,
  1006.             this.name = t(n, e),
  1007.             this.message = this.name + ': FileException ' + this.code
  1008.           }
  1009.           var n = {
  1010.             NOT_FOUND_ERR: 1,
  1011.             SECURITY_ERR: 2,
  1012.             ABORT_ERR: 3,
  1013.             NOT_READABLE_ERR: 4,
  1014.             ENCODING_ERR: 5,
  1015.             NO_MODIFICATION_ALLOWED_ERR: 6,
  1016.             INVALID_STATE_ERR: 7,
  1017.             SYNTAX_ERR: 8
  1018.           };
  1019.           return e.extend(i, n),
  1020.           i.prototype = Error.prototype,
  1021.           i
  1022.         }(),
  1023.         DOMException: function () {
  1024.           function i(e) {
  1025.             this.code = e,
  1026.             this.name = t(n, e),
  1027.             this.message = this.name + ': DOMException ' + this.code
  1028.           }
  1029.           var n = {
  1030.             INDEX_SIZE_ERR: 1,
  1031.             DOMSTRING_SIZE_ERR: 2,
  1032.             HIERARCHY_REQUEST_ERR: 3,
  1033.             WRONG_DOCUMENT_ERR: 4,
  1034.             INVALID_CHARACTER_ERR: 5,
  1035.             NO_DATA_ALLOWED_ERR: 6,
  1036.             NO_MODIFICATION_ALLOWED_ERR: 7,
  1037.             NOT_FOUND_ERR: 8,
  1038.             NOT_SUPPORTED_ERR: 9,
  1039.             INUSE_ATTRIBUTE_ERR: 10,
  1040.             INVALID_STATE_ERR: 11,
  1041.             SYNTAX_ERR: 12,
  1042.             INVALID_MODIFICATION_ERR: 13,
  1043.             NAMESPACE_ERR: 14,
  1044.             INVALID_ACCESS_ERR: 15,
  1045.             VALIDATION_ERR: 16,
  1046.             TYPE_MISMATCH_ERR: 17,
  1047.             SECURITY_ERR: 18,
  1048.             NETWORK_ERR: 19,
  1049.             ABORT_ERR: 20,
  1050.             URL_MISMATCH_ERR: 21,
  1051.             QUOTA_EXCEEDED_ERR: 22,
  1052.             TIMEOUT_ERR: 23,
  1053.             INVALID_NODE_TYPE_ERR: 24,
  1054.             DATA_CLONE_ERR: 25
  1055.           };
  1056.           return e.extend(i, n),
  1057.           i.prototype = Error.prototype,
  1058.           i
  1059.         }(),
  1060.         EventException: function () {
  1061.           function t(e) {
  1062.             this.code = e,
  1063.             this.name = 'EventException'
  1064.           }
  1065.           return e.extend(t, {
  1066.             UNSPECIFIED_EVENT_TYPE_ERR: 0
  1067.           }),
  1068.           t.prototype = Error.prototype,
  1069.           t
  1070.         }()
  1071.       }
  1072.     }), n('moxie/core/utils/Dom', [
  1073.       'moxie/core/utils/Env'
  1074.     ], function (e) {
  1075.       var t = function (e) {
  1076.         return 'string' != typeof e ? e : document.getElementById(e)
  1077.       },
  1078.       i = function (e, t) {
  1079.         if (!e.className) return !1;
  1080.         var i = new RegExp('(^|\\s+)' + t + '(\\s+|$)');
  1081.         return i.test(e.className)
  1082.       },
  1083.       n = function (e, t) {
  1084.         i(e, t) || (e.className = e.className ? e.className.replace(/\s+$/, '') + ' ' + t : t)
  1085.       },
  1086.       r = function (e, t) {
  1087.         if (e.className) {
  1088.           var i = new RegExp('(^|\\s+)' + t + '(\\s+|$)');
  1089.           e.className = e.className.replace(i, function (e, t, i) {
  1090.             return ' ' === t && ' ' === i ? ' ' : ''
  1091.           })
  1092.         }
  1093.       },
  1094.       o = function (e, t) {
  1095.         return e.currentStyle ? e.currentStyle[t] : window.getComputedStyle ? window.getComputedStyle(e, null) [t] : void 0
  1096.       },
  1097.       a = function (t, i) {
  1098.         function n(e) {
  1099.           var t,
  1100.           i,
  1101.           n = 0,
  1102.           r = 0;
  1103.           return e && (i = e.getBoundingClientRect(), t = 'CSS1Compat' === c.compatMode ? c.documentElement : c.body, n = i.left + t.scrollLeft, r = i.top + t.scrollTop),
  1104.           {
  1105.             x: n,
  1106.             y: r
  1107.           }
  1108.         }
  1109.         var r,
  1110.         o,
  1111.         a,
  1112.         s = 0,
  1113.         u = 0,
  1114.         c = document;
  1115.         if (t = t, i = i || c.body, t && t.getBoundingClientRect && 'IE' === e.browser && (!c.documentMode || c.documentMode < 8)) return o = n(t),
  1116.         a = n(i),
  1117.         {
  1118.           x: o.x - a.x,
  1119.           y: o.y - a.y
  1120.         };
  1121.         for (r = t; r && r != i && r.nodeType; ) s += r.offsetLeft || 0,
  1122.         u += r.offsetTop || 0,
  1123.         r = r.offsetParent;
  1124.         for (r = t.parentNode; r && r != i && r.nodeType; ) s -= r.scrollLeft || 0,
  1125.         u -= r.scrollTop || 0,
  1126.         r = r.parentNode;
  1127.         return {
  1128.           x: s,
  1129.           y: u
  1130.         }
  1131.       },
  1132.       s = function (e) {
  1133.         return {
  1134.           w: e.offsetWidth || e.clientWidth,
  1135.           h: e.offsetHeight || e.clientHeight
  1136.         }
  1137.       };
  1138.       return {
  1139.         get: t,
  1140.         hasClass: i,
  1141.         addClass: n,
  1142.         removeClass: r,
  1143.         getStyle: o,
  1144.         getPos: a,
  1145.         getSize: s
  1146.       }
  1147.     }), n('moxie/core/EventTarget', [
  1148.       'moxie/core/utils/Env',
  1149.       'moxie/core/Exceptions',
  1150.       'moxie/core/utils/Basic'
  1151.     ], function (e, t, i) {
  1152.       function n() {
  1153.         this.uid = i.guid()
  1154.       }
  1155.       var r = {
  1156.       };
  1157.       return i.extend(n.prototype, {
  1158.         init: function () {
  1159.           this.uid || (this.uid = i.guid('uid_'))
  1160.         },
  1161.         addEventListener: function (e, t, n, o) {
  1162.           var a,
  1163.           s = this;
  1164.           return this.hasOwnProperty('uid') || (this.uid = i.guid('uid_')),
  1165.           e = i.trim(e),
  1166.           /\s/.test(e) ? (i.each(e.split(/\s+/), function (e) {
  1167.             s.addEventListener(e, t, n, o)
  1168.           }), void 0)  : (e = e.toLowerCase(), n = parseInt(n, 10) || 0, a = r[this.uid] && r[this.uid][e] || [
  1169.           ], a.push({
  1170.             fn: t,
  1171.             priority: n,
  1172.             scope: o || this
  1173.           }), r[this.uid] || (r[this.uid] = {
  1174.           }), r[this.uid][e] = a, void 0)
  1175.         },
  1176.         hasEventListener: function (e) {
  1177.           var t;
  1178.           return e ? (e = e.toLowerCase(), t = r[this.uid] && r[this.uid][e])  : t = r[this.uid],
  1179.           t ? t : !1
  1180.         },
  1181.         removeEventListener: function (e, t) {
  1182.           var n,
  1183.           o,
  1184.           a = this;
  1185.           if (e = e.toLowerCase(), /\s/.test(e)) return i.each(e.split(/\s+/), function (e) {
  1186.             a.removeEventListener(e, t)
  1187.           }),
  1188.           void 0;
  1189.           if (n = r[this.uid] && r[this.uid][e]) {
  1190.             if (t) {
  1191.               for (o = n.length - 1; o >= 0; o--) if (n[o].fn === t) {
  1192.                 n.splice(o, 1);
  1193.                 break
  1194.               }
  1195.             } else n = [
  1196.             ];
  1197.             n.length || (delete r[this.uid][e], i.isEmptyObj(r[this.uid]) && delete r[this.uid])
  1198.           }
  1199.         },
  1200.         removeAllEventListeners: function () {
  1201.           r[this.uid] && delete r[this.uid]
  1202.         },
  1203.         dispatchEvent: function (e) {
  1204.           var n,
  1205.           o,
  1206.           a,
  1207.           s,
  1208.           u,
  1209.           c = {
  1210.           },
  1211.           l = !0;
  1212.           if ('string' !== i.typeOf(e)) {
  1213.             if (s = e, 'string' !== i.typeOf(s.type)) throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);
  1214.             e = s.type,
  1215.             s.total !== u && s.loaded !== u && (c.total = s.total, c.loaded = s.loaded),
  1216.             c.async = s.async || !1
  1217.           }
  1218.           if ( - 1 !== e.indexOf('::') ? function (t) {
  1219.             n = t[0],
  1220.             e = t[1]
  1221.           }(e.split('::'))  : n = this.uid, e = e.toLowerCase(), o = r[n] && r[n][e]) {
  1222.             o.sort(function (e, t) {
  1223.               return t.priority - e.priority
  1224.             }),
  1225.             a = [
  1226.             ].slice.call(arguments),
  1227.             a.shift(),
  1228.             c.type = e,
  1229.             a.unshift(c);
  1230.             var d = [
  1231.             ];
  1232.             i.each(o, function (e) {
  1233.               a[0].target = e.scope,
  1234.               c.async ? d.push(function (t) {
  1235.                 setTimeout(function () {
  1236.                   t(e.fn.apply(e.scope, a) === !1)
  1237.                 }, 1)
  1238.               })  : d.push(function (t) {
  1239.                 t(e.fn.apply(e.scope, a) === !1)
  1240.               })
  1241.             }),
  1242.             d.length && i.inSeries(d, function (e) {
  1243.               l = !e
  1244.             })
  1245.           }
  1246.           return l
  1247.         },
  1248.         bindOnce: function (e, t, i, n) {
  1249.           var r = this;
  1250.           r.bind.call(this, e, function o() {
  1251.             return r.unbind(e, o),
  1252.             t.apply(this, arguments)
  1253.           }, i, n)
  1254.         },
  1255.         bind: function () {
  1256.           this.addEventListener.apply(this, arguments)
  1257.         },
  1258.         unbind: function () {
  1259.           this.removeEventListener.apply(this, arguments)
  1260.         },
  1261.         unbindAll: function () {
  1262.           this.removeAllEventListeners.apply(this, arguments)
  1263.         },
  1264.         trigger: function () {
  1265.           return this.dispatchEvent.apply(this, arguments)
  1266.         },
  1267.         handleEventProps: function (e) {
  1268.           var t = this;
  1269.           this.bind(e.join(' '), function (e) {
  1270.             var t = 'on' + e.type.toLowerCase();
  1271.             'function' === i.typeOf(this[t]) && this[t].apply(this, arguments)
  1272.           }),
  1273.           i.each(e, function (e) {
  1274.             e = 'on' + e.toLowerCase(e),
  1275.             'undefined' === i.typeOf(t[e]) && (t[e] = null)
  1276.           })
  1277.         }
  1278.       }),
  1279.       n.instance = new n,
  1280.       n
  1281.     }), n('moxie/runtime/Runtime', [
  1282.       'moxie/core/utils/Env',
  1283.       'moxie/core/utils/Basic',
  1284.       'moxie/core/utils/Dom',
  1285.       'moxie/core/EventTarget'
  1286.     ], function (e, t, i, n) {
  1287.       function r(e, n, o, s, u) {
  1288.         var c,
  1289.         l = this,
  1290.         d = t.guid(n + '_'),
  1291.         m = u || 'browser';
  1292.         e = e || {
  1293.         },
  1294.         a[d] = this,
  1295.         o = t.extend({
  1296.           access_binary: !1,
  1297.           access_image_binary: !1,
  1298.           display_media: !1,
  1299.           do_cors: !1,
  1300.           drag_and_drop: !1,
  1301.           filter_by_extension: !0,
  1302.           resize_image: !1,
  1303.           report_upload_progress: !1,
  1304.           return_response_headers: !1,
  1305.           return_response_type: !1,
  1306.           return_status_code: !0,
  1307.           send_custom_headers: !1,
  1308.           select_file: !1,
  1309.           select_folder: !1,
  1310.           select_multiple: !0,
  1311.           send_binary_string: !1,
  1312.           send_browser_cookies: !0,
  1313.           send_multipart: !0,
  1314.           slice_blob: !1,
  1315.           stream_upload: !1,
  1316.           summon_file_dialog: !1,
  1317.           upload_filesize: !0,
  1318.           use_http_method: !0
  1319.         }, o),
  1320.         e.preferred_caps && (m = r.getMode(s, e.preferred_caps, m)),
  1321.         c = function () {
  1322.           var e = {
  1323.           };
  1324.           return {
  1325.             exec: function (t, i, n, r) {
  1326.               return c[i] && (e[t] || (e[t] = {
  1327.                 context: this,
  1328.                 instance: new c[i]
  1329.               }), e[t].instance[n]) ? e[t].instance[n].apply(this, r)  : void 0
  1330.             },
  1331.             removeInstance: function (t) {
  1332.               delete e[t]
  1333.             },
  1334.             removeAllInstances: function () {
  1335.               var i = this;
  1336.               t.each(e, function (e, n) {
  1337.                 'function' === t.typeOf(e.instance.destroy) && e.instance.destroy.call(e.context),
  1338.                 i.removeInstance(n)
  1339.               })
  1340.             }
  1341.           }
  1342.         }(),
  1343.         t.extend(this, {
  1344.           initialized: !1,
  1345.           uid: d,
  1346.           type: n,
  1347.           mode: r.getMode(s, e.required_caps, m),
  1348.           shimid: d + '_container',
  1349.           clients: 0,
  1350.           options: e,
  1351.           can: function (e, i) {
  1352.             var n = arguments[2] || o;
  1353.             if ('string' === t.typeOf(e) && 'undefined' === t.typeOf(i) && (e = r.parseCaps(e)), 'object' === t.typeOf(e)) {
  1354.               for (var a in e) if (!this.can(a, e[a], n)) return !1;
  1355.               return !0
  1356.             }
  1357.             return 'function' === t.typeOf(n[e]) ? n[e].call(this, i)  : i === n[e]
  1358.           },
  1359.           getShimContainer: function () {
  1360.             var e,
  1361.             n = i.get(this.shimid);
  1362.             return n || (e = i.get(this.options.container) || document.body, n = document.createElement('div'), n.id = this.shimid, n.className = 'moxie-shim moxie-shim-' + this.type, t.extend(n.style, {
  1363.               position: 'absolute',
  1364.               top: '0px',
  1365.               left: '0px',
  1366.               width: '1px',
  1367.               height: '1px',
  1368.               overflow: 'hidden'
  1369.             }), e.appendChild(n), e = null),
  1370.             n
  1371.           },
  1372.           getShim: function () {
  1373.             return c
  1374.           },
  1375.           shimExec: function (e, t) {
  1376.             var i = [
  1377.             ].slice.call(arguments, 2);
  1378.             return l.getShim().exec.call(this, this.uid, e, t, i)
  1379.           },
  1380.           exec: function (e, t) {
  1381.             var i = [
  1382.             ].slice.call(arguments, 2);
  1383.             return l[e] && l[e][t] ? l[e][t].apply(this, i)  : l.shimExec.apply(this, arguments)
  1384.           },
  1385.           destroy: function () {
  1386.             if (l) {
  1387.               var e = i.get(this.shimid);
  1388.               e && e.parentNode.removeChild(e),
  1389.               c && c.removeAllInstances(),
  1390.               this.unbindAll(),
  1391.               delete a[this.uid],
  1392.               this.uid = null,
  1393.               d = l = c = e = null
  1394.             }
  1395.           }
  1396.         }),
  1397.         this.mode && e.required_caps && !this.can(e.required_caps) && (this.mode = !1)
  1398.       }
  1399.       var o = {
  1400.       },
  1401.       a = {
  1402.       };
  1403.       return r.order = 'html5,flash,silverlight,html4',
  1404.       r.getRuntime = function (e) {
  1405.         return a[e] ? a[e] : !1
  1406.       },
  1407.       r.addConstructor = function (e, t) {
  1408.         t.prototype = n.instance,
  1409.         o[e] = t
  1410.       },
  1411.       r.getConstructor = function (e) {
  1412.         return o[e] || null
  1413.       },
  1414.       r.getInfo = function (e) {
  1415.         var t = r.getRuntime(e);
  1416.         return t ? {
  1417.           uid: t.uid,
  1418.           type: t.type,
  1419.           mode: t.mode,
  1420.           can: function () {
  1421.             return t.can.apply(t, arguments)
  1422.           }
  1423.         }
  1424.          : null
  1425.       },
  1426.       r.parseCaps = function (e) {
  1427.         var i = {
  1428.         };
  1429.         return 'string' !== t.typeOf(e) ? e || {
  1430.         }
  1431.          : (t.each(e.split(','), function (e) {
  1432.           i[e] = !0
  1433.         }), i)
  1434.       },
  1435.       r.can = function (e, t) {
  1436.         var i,
  1437.         n,
  1438.         o = r.getConstructor(e);
  1439.         return o ? (i = new o({
  1440.           required_caps: t
  1441.         }), n = i.mode, i.destroy(), !!n)  : !1
  1442.       },
  1443.       r.thatCan = function (e, t) {
  1444.         var i = (t || r.order).split(/\s*,\s*/);
  1445.         for (var n in i) if (r.can(i[n], e)) return i[n];
  1446.         return null
  1447.       },
  1448.       r.getMode = function (e, i, n) {
  1449.         var r = null;
  1450.         if ('undefined' === t.typeOf(n) && (n = 'browser'), i && !t.isEmptyObj(e)) {
  1451.           if (t.each(i, function (i, n) {
  1452.             if (e.hasOwnProperty(n)) {
  1453.               var o = e[n](i);
  1454.               if ('string' == typeof o && (o = [
  1455.                 o
  1456.               ]), r) {
  1457.                 if (!(r = t.arrayIntersect(r, o))) return r = !1
  1458.               } else r = o
  1459.             }
  1460.           }), r) return - 1 !== t.inArray(n, r) ? n : r[0];
  1461.           if (r === !1) return !1
  1462.         }
  1463.         return n
  1464.       },
  1465.       r.capTrue = function () {
  1466.         return !0
  1467.       },
  1468.       r.capFalse = function () {
  1469.         return !1
  1470.       },
  1471.       r.capTest = function (e) {
  1472.         return function () {
  1473.           return !!e
  1474.         }
  1475.       },
  1476.       r
  1477.     }), n('moxie/runtime/RuntimeClient', [
  1478.       'moxie/core/utils/Env',
  1479.       'moxie/core/Exceptions',
  1480.       'moxie/core/utils/Basic',
  1481.       'moxie/runtime/Runtime'
  1482.     ], function (e, t, i, n) {
  1483.       return function () {
  1484.         var e;
  1485.         i.extend(this, {
  1486.           connectRuntime: function (r) {
  1487.             function o(i) {
  1488.               var a,
  1489.               u;
  1490.               return i.length ? (a = i.shift().toLowerCase(), (u = n.getConstructor(a)) ? (e = new u(r), e.bind('Init', function () {
  1491.                 e.initialized = !0,
  1492.                 setTimeout(function () {
  1493.                   e.clients++,
  1494.                   s.ruid = e.uid,
  1495.                   s.trigger('RuntimeInit', e)
  1496.                 }, 1)
  1497.               }), e.bind('Error', function () {
  1498.                 e.destroy(),
  1499.                 o(i)
  1500.               }), e.bind('Exception', function (e, i) {
  1501.                 var n = i.name + '(#' + i.code + ')' + (i.message ? ', from: ' + i.message : '');
  1502.                 s.trigger('RuntimeError', new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR, n))
  1503.               }), e.mode ? (e.init(), void 0)  : (e.trigger('Error'), void 0))  : (o(i), void 0))  : (s.trigger('RuntimeError', new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)), e = null, void 0)
  1504.             }
  1505.             var a,
  1506.             s = this;
  1507.             if ('string' === i.typeOf(r) ? a = r : 'string' === i.typeOf(r.ruid) && (a = r.ruid), a) {
  1508.               if (e = n.getRuntime(a)) return s.ruid = a,
  1509.               e.clients++,
  1510.               e;
  1511.               throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)
  1512.             }
  1513.             o((r.runtime_order || n.order).split(/\s*,\s*/))
  1514.           },
  1515.           disconnectRuntime: function () {
  1516.             e && --e.clients <= 0 && e.destroy(),
  1517.             e = null
  1518.           },
  1519.           getRuntime: function () {
  1520.             return e && e.uid ? e : e = null
  1521.           },
  1522.           exec: function () {
  1523.             return e ? e.exec.apply(this, arguments)  : null
  1524.           },
  1525.           can: function (t) {
  1526.             return e ? e.can(t)  : !1
  1527.           }
  1528.         })
  1529.       }
  1530.     }), n('moxie/file/Blob', [
  1531.       'moxie/core/utils/Basic',
  1532.       'moxie/core/utils/Encode',
  1533.       'moxie/runtime/RuntimeClient'
  1534.     ], function (e, t, i) {
  1535.       function n(o, a) {
  1536.         function s(t, i, o) {
  1537.           var a,
  1538.           s = r[this.uid];
  1539.           return 'string' === e.typeOf(s) && s.length ? (a = new n(null, {
  1540.             type: o,
  1541.             size: i - t
  1542.           }), a.detach(s.substr(t, a.size)), a)  : null
  1543.         }
  1544.         i.call(this),
  1545.         o && this.connectRuntime(o),
  1546.         a ? 'string' === e.typeOf(a) && (a = {
  1547.           data: a
  1548.         })  : a = {
  1549.         },
  1550.         e.extend(this, {
  1551.           uid: a.uid || e.guid('uid_'),
  1552.           ruid: o,
  1553.           size: a.size || 0,
  1554.           type: a.type || '',
  1555.           slice: function (e, t, i) {
  1556.             return this.isDetached() ? s.apply(this, arguments)  : this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), e, t, i)
  1557.           },
  1558.           getSource: function () {
  1559.             return r[this.uid] ? r[this.uid] : null
  1560.           },
  1561.           detach: function (e) {
  1562.             if (this.ruid && (this.getRuntime().exec.call(this, 'Blob', 'destroy'), this.disconnectRuntime(), this.ruid = null), e = e || '', 'data:' == e.substr(0, 5)) {
  1563.               var i = e.indexOf(';base64,');
  1564.               this.type = e.substring(5, i),
  1565.               e = t.atob(e.substring(i + 8))
  1566.             }
  1567.             this.size = e.length,
  1568.             r[this.uid] = e
  1569.           },
  1570.           isDetached: function () {
  1571.             return !this.ruid && 'string' === e.typeOf(r[this.uid])
  1572.           },
  1573.           destroy: function () {
  1574.             this.detach(),
  1575.             delete r[this.uid]
  1576.           }
  1577.         }),
  1578.         a.data ? this.detach(a.data)  : r[this.uid] = a
  1579.       }
  1580.       var r = {
  1581.       };
  1582.       return n
  1583.     }), n('moxie/core/I18n', [
  1584.       'moxie/core/utils/Basic'
  1585.     ], function (e) {
  1586.       var t = {
  1587.       };
  1588.       return {
  1589.         addI18n: function (i) {
  1590.           return e.extend(t, i)
  1591.         },
  1592.         translate: function (e) {
  1593.           return t[e] || e
  1594.         },
  1595.         _: function (e) {
  1596.           return this.translate(e)
  1597.         },
  1598.         sprintf: function (t) {
  1599.           var i = [
  1600.           ].slice.call(arguments, 1);
  1601.           return t.replace(/%[a-z]/g, function () {
  1602.             var t = i.shift();
  1603.             return 'undefined' !== e.typeOf(t) ? t : ''
  1604.           })
  1605.         }
  1606.       }
  1607.     }), n('moxie/core/utils/Mime', [
  1608.       'moxie/core/utils/Basic',
  1609.       'moxie/core/I18n'
  1610.     ], function (e, t) {
  1611.       var i = 'application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe',
  1612.       n = {
  1613.         mimes: {
  1614.         },
  1615.         extensions: {
  1616.         },
  1617.         addMimeType: function (e) {
  1618.           var t,
  1619.           i,
  1620.           n,
  1621.           r = e.split(/,/);
  1622.           for (t = 0; t < r.length; t += 2) {
  1623.             for (n = r[t + 1].split(/ /), i = 0; i < n.length; i++) this.mimes[n[i]] = r[t];
  1624.             this.extensions[r[t]] = n
  1625.           }
  1626.         },
  1627.         extList2mimes: function (t, i) {
  1628.           var n,
  1629.           r,
  1630.           o,
  1631.           a,
  1632.           s = this,
  1633.           u = [
  1634.           ];
  1635.           for (r = 0; r < t.length; r++) for (n = t[r].extensions.toLowerCase().split(/\s*,\s*/), o = 0; o < n.length; o++) {
  1636.             if ('*' === n[o]) return [];
  1637.             if (a = s.mimes[n[o]], i && /^\w+$/.test(n[o])) u.push('.' + n[o]);
  1638.              else if (a && - 1 === e.inArray(a, u)) u.push(a);
  1639.              else if (!a) return []
  1640.           }
  1641.           return u
  1642.         },
  1643.         mimes2exts: function (t) {
  1644.           var i = this,
  1645.           n = [
  1646.           ];
  1647.           return e.each(t, function (t) {
  1648.             if (t = t.toLowerCase(), '*' === t) return n = [
  1649.             ],
  1650.             !1;
  1651.             var r = t.match(/^(\w+)\/(\*|\w+)$/);
  1652.             r && ('*' === r[2] ? e.each(i.extensions, function (e, t) {
  1653.               new RegExp('^' + r[1] + '/').test(t) && [
  1654.               ].push.apply(n, i.extensions[t])
  1655.             })  : i.extensions[t] && [
  1656.             ].push.apply(n, i.extensions[t]))
  1657.           }),
  1658.           n
  1659.         },
  1660.         mimes2extList: function (i) {
  1661.           var n = [
  1662.           ],
  1663.           r = [
  1664.           ];
  1665.           return 'string' === e.typeOf(i) && (i = e.trim(i).split(/\s*,\s*/)),
  1666.           r = this.mimes2exts(i),
  1667.           n.push({
  1668.             title: t.translate('Files'),
  1669.             extensions: r.length ? r.join(',')  : '*'
  1670.           }),
  1671.           n.mimes = i,
  1672.           n
  1673.         },
  1674.         getFileExtension: function (e) {
  1675.           var t = e && e.match(/\.([^.]+)$/);
  1676.           return t ? t[1].toLowerCase()  : ''
  1677.         },
  1678.         getFileMime: function (e) {
  1679.           return this.mimes[this.getFileExtension(e)] || ''
  1680.         }
  1681.       };
  1682.       return n.addMimeType(i),
  1683.       n
  1684.     }), n('moxie/file/FileInput', [
  1685.       'moxie/core/utils/Basic',
  1686.       'moxie/core/utils/Env',
  1687.       'moxie/core/utils/Mime',
  1688.       'moxie/core/utils/Dom',
  1689.       'moxie/core/Exceptions',
  1690.       'moxie/core/EventTarget',
  1691.       'moxie/core/I18n',
  1692.       'moxie/runtime/Runtime',
  1693.       'moxie/runtime/RuntimeClient'
  1694.     ], function (e, t, i, n, r, o, a, s, u) {
  1695.       function c(t) {
  1696.         var o,
  1697.         c,
  1698.         d;
  1699.         if ( - 1 !== e.inArray(e.typeOf(t), [
  1700.           'string',
  1701.           'node'
  1702.         ]) && (t = {
  1703.           browse_button: t
  1704.         }), c = n.get(t.browse_button), !c) throw new r.DOMException(r.DOMException.NOT_FOUND_ERR);
  1705.         d = {
  1706.           accept: [
  1707.             {
  1708.               title: a.translate('All Files'),
  1709.               extensions: '*'
  1710.             }
  1711.           ],
  1712.           multiple: !1,
  1713.           required_caps: !1,
  1714.           container: c.parentNode || document.body
  1715.         },
  1716.         t = e.extend({
  1717.         }, d, t),
  1718.         'string' == typeof t.required_caps && (t.required_caps = s.parseCaps(t.required_caps)),
  1719.         'string' == typeof t.accept && (t.accept = i.mimes2extList(t.accept)),
  1720.         o = n.get(t.container),
  1721.         o || (o = document.body),
  1722.         'static' === n.getStyle(o, 'position') && (o.style.position = 'relative'),
  1723.         o = c = null,
  1724.         u.call(this),
  1725.         e.extend(this, {
  1726.           uid: e.guid('uid_'),
  1727.           ruid: null,
  1728.           shimid: null,
  1729.           files: null,
  1730.           init: function () {
  1731.             var i = this;
  1732.             i.bind('RuntimeInit', function (r, o) {
  1733.               i.ruid = o.uid,
  1734.               i.shimid = o.shimid,
  1735.               i.bind('Ready', function () {
  1736.                 i.trigger('Refresh')
  1737.               }, 999),
  1738.               i.bind('Refresh', function () {
  1739.                 var i,
  1740.                 r,
  1741.                 a,
  1742.                 s,
  1743.                 u;
  1744.                 a = n.get(t.browse_button),
  1745.                 s = n.get(o.shimid),
  1746.                 a && (i = n.getPos(a, n.get(t.container)), r = n.getSize(a), u = parseInt(n.getStyle(a, 'z-index'), 10) || 0, s && e.extend(s.style, {
  1747.                   top: i.y + 'px',
  1748.                   left: i.x + 'px',
  1749.                   width: r.w + 'px',
  1750.                   height: r.h + 'px',
  1751.                   zIndex: u + 1
  1752.                 })),
  1753.                 s = a = null
  1754.               }),
  1755.               o.exec.call(i, 'FileInput', 'init', t)
  1756.             }),
  1757.             i.connectRuntime(e.extend({
  1758.             }, t, {
  1759.               required_caps: {
  1760.                 select_file: !0
  1761.               }
  1762.             }))
  1763.           },
  1764.           getOption: function (e) {
  1765.             return t[e]
  1766.           },
  1767.           setOption: function (e, n) {
  1768.             if (t.hasOwnProperty(e)) {
  1769.               var o = t[e];
  1770.               switch (e) {
  1771.                 case 'accept':
  1772.                   'string' == typeof n && (n = i.mimes2extList(n));
  1773.                   break;
  1774.                 case 'container':
  1775.                 case 'required_caps':
  1776.                   throw new r.FileException(r.FileException.NO_MODIFICATION_ALLOWED_ERR)
  1777.               }
  1778.               t[e] = n,
  1779.               this.exec('FileInput', 'setOption', e, n),
  1780.               this.trigger('OptionChanged', e, n, o)
  1781.             }
  1782.           },
  1783.           disable: function (t) {
  1784.             var i = this.getRuntime();
  1785.             i && this.exec('FileInput', 'disable', 'undefined' === e.typeOf(t) ? !0 : t)
  1786.           },
  1787.           refresh: function () {
  1788.             this.trigger('Refresh')
  1789.           },
  1790.           destroy: function () {
  1791.             var t = this.getRuntime();
  1792.             t && (t.exec.call(this, 'FileInput', 'destroy'), this.disconnectRuntime()),
  1793.             'array' === e.typeOf(this.files) && e.each(this.files, function (e) {
  1794.               e.destroy()
  1795.             }),
  1796.             this.files = null,
  1797.             this.unbindAll()
  1798.           }
  1799.         }), this.handleEventProps(l)
  1800.       }
  1801.       var l = [
  1802.         'ready',
  1803.         'change',
  1804.         'cancel',
  1805.         'mouseenter',
  1806.         'mouseleave',
  1807.         'mousedown',
  1808.         'mouseup'
  1809.       ];
  1810.       return c.prototype = o.instance,
  1811.       c
  1812.     }), n('moxie/file/File', [
  1813.       'moxie/core/utils/Basic',
  1814.       'moxie/core/utils/Mime',
  1815.       'moxie/file/Blob'
  1816.     ], function (e, t, i) {
  1817.       function n(n, r) {
  1818.         r || (r = {
  1819.         }),
  1820.         i.apply(this, arguments),
  1821.         this.type || (this.type = t.getFileMime(r.name));
  1822.         var o;
  1823.         if (r.name) o = r.name.replace(/\\/g, '/'),
  1824.         o = o.substr(o.lastIndexOf('/') + 1);
  1825.          else if (this.type) {
  1826.           var a = this.type.split('/') [0];
  1827.           o = e.guid(('' !== a ? a : 'file') + '_'),
  1828.           t.extensions[this.type] && (o += '.' + t.extensions[this.type][0])
  1829.         }
  1830.         e.extend(this, {
  1831.           name: o || e.guid('file_'),
  1832.           relativePath: '',
  1833.           lastModifiedDate: r.lastModifiedDate || (new Date).toLocaleString()
  1834.         })
  1835.       }
  1836.       return n.prototype = i.prototype,
  1837.       n
  1838.     }), n('moxie/file/FileDrop', [
  1839.       'moxie/core/I18n',
  1840.       'moxie/core/utils/Dom',
  1841.       'moxie/core/Exceptions',
  1842.       'moxie/core/utils/Basic',
  1843.       'moxie/core/utils/Env',
  1844.       'moxie/file/File',
  1845.       'moxie/runtime/RuntimeClient',
  1846.       'moxie/core/EventTarget',
  1847.       'moxie/core/utils/Mime'
  1848.     ], function (e, t, i, n, r, o, a, s, u) {
  1849.       function c(i) {
  1850.         var r,
  1851.         o = this;
  1852.         'string' == typeof i && (i = {
  1853.           drop_zone: i
  1854.         }),
  1855.         r = {
  1856.           accept: [
  1857.             {
  1858.               title: e.translate('All Files'),
  1859.               extensions: '*'
  1860.             }
  1861.           ],
  1862.           required_caps: {
  1863.             drag_and_drop: !0
  1864.           }
  1865.         },
  1866.         i = 'object' == typeof i ? n.extend({
  1867.         }, r, i)  : r,
  1868.         i.container = t.get(i.drop_zone) || document.body,
  1869.         'static' === t.getStyle(i.container, 'position') && (i.container.style.position = 'relative'),
  1870.         'string' == typeof i.accept && (i.accept = u.mimes2extList(i.accept)),
  1871.         a.call(o),
  1872.         n.extend(o, {
  1873.           uid: n.guid('uid_'),
  1874.           ruid: null,
  1875.           files: null,
  1876.           init: function () {
  1877.             o.bind('RuntimeInit', function (e, t) {
  1878.               o.ruid = t.uid,
  1879.               t.exec.call(o, 'FileDrop', 'init', i),
  1880.               o.dispatchEvent('ready')
  1881.             }),
  1882.             o.connectRuntime(i)
  1883.           },
  1884.           destroy: function () {
  1885.             var e = this.getRuntime();
  1886.             e && (e.exec.call(this, 'FileDrop', 'destroy'), this.disconnectRuntime()),
  1887.             this.files = null,
  1888.             this.unbindAll()
  1889.           }
  1890.         }),
  1891.         this.handleEventProps(l)
  1892.       }
  1893.       var l = [
  1894.         'ready',
  1895.         'dragenter',
  1896.         'dragleave',
  1897.         'drop',
  1898.         'error'
  1899.       ];
  1900.       return c.prototype = s.instance,
  1901.       c
  1902.     }), n('moxie/file/FileReader', [
  1903.       'moxie/core/utils/Basic',
  1904.       'moxie/core/utils/Encode',
  1905.       'moxie/core/Exceptions',
  1906.       'moxie/core/EventTarget',
  1907.       'moxie/file/Blob',
  1908.       'moxie/runtime/RuntimeClient'
  1909.     ], function (e, t, i, n, r, o) {
  1910.       function a() {
  1911.         function n(e, n) {
  1912.           if (this.trigger('loadstart'), this.readyState === a.LOADING) return this.trigger('error', new i.DOMException(i.DOMException.INVALID_STATE_ERR)),
  1913.           this.trigger('loadend'),
  1914.           void 0;
  1915.           if (!(n instanceof r)) return this.trigger('error', new i.DOMException(i.DOMException.NOT_FOUND_ERR)),
  1916.           this.trigger('loadend'),
  1917.           void 0;
  1918.           if (this.result = null, this.readyState = a.LOADING, n.isDetached()) {
  1919.             var o = n.getSource();
  1920.             switch (e) {
  1921.               case 'readAsText':
  1922.               case 'readAsBinaryString':
  1923.                 this.result = o;
  1924.                 break;
  1925.               case 'readAsDataURL':
  1926.                 this.result = 'data:' + n.type + ';base64,' + t.btoa(o)
  1927.             }
  1928.             this.readyState = a.DONE,
  1929.             this.trigger('load'),
  1930.             this.trigger('loadend')
  1931.           } else this.connectRuntime(n.ruid),
  1932.           this.exec('FileReader', 'read', e, n)
  1933.         }
  1934.         o.call(this),
  1935.         e.extend(this, {
  1936.           uid: e.guid('uid_'),
  1937.           readyState: a.EMPTY,
  1938.           result: null,
  1939.           error: null,
  1940.           readAsBinaryString: function (e) {
  1941.             n.call(this, 'readAsBinaryString', e)
  1942.           },
  1943.           readAsDataURL: function (e) {
  1944.             n.call(this, 'readAsDataURL', e)
  1945.           },
  1946.           readAsText: function (e) {
  1947.             n.call(this, 'readAsText', e)
  1948.           },
  1949.           abort: function () {
  1950.             this.result = null,
  1951.             - 1 === e.inArray(this.readyState, [
  1952.               a.EMPTY,
  1953.               a.DONE
  1954.             ]) && (this.readyState === a.LOADING && (this.readyState = a.DONE), this.exec('FileReader', 'abort'), this.trigger('abort'), this.trigger('loadend'))
  1955.           },
  1956.           destroy: function () {
  1957.             this.abort(),
  1958.             this.exec('FileReader', 'destroy'),
  1959.             this.disconnectRuntime(),
  1960.             this.unbindAll()
  1961.           }
  1962.         }),
  1963.         this.handleEventProps(s),
  1964.         this.bind('Error', function (e, t) {
  1965.           this.readyState = a.DONE,
  1966.           this.error = t
  1967.         }, 999),
  1968.         this.bind('Load', function () {
  1969.           this.readyState = a.DONE
  1970.         }, 999)
  1971.       }
  1972.       var s = [
  1973.         'loadstart',
  1974.         'progress',
  1975.         'load',
  1976.         'abort',
  1977.         'error',
  1978.         'loadend'
  1979.       ];
  1980.       return a.EMPTY = 0,
  1981.       a.LOADING = 1,
  1982.       a.DONE = 2,
  1983.       a.prototype = n.instance,
  1984.       a
  1985.     }), n('moxie/core/utils/Url', [
  1986.       'moxie/core/utils/Basic'
  1987.     ], function (e) {
  1988.       var t = function (i, n) {
  1989.         var r,
  1990.         o = [
  1991.           'source',
  1992.           'scheme',
  1993.           'authority',
  1994.           'userInfo',
  1995.           'user',
  1996.           'pass',
  1997.           'host',
  1998.           'port',
  1999.           'relative',
  2000.           'path',
  2001.           'directory',
  2002.           'file',
  2003.           'query',
  2004.           'fragment'
  2005.         ],
  2006.         a = o.length,
  2007.         s = {
  2008.           http: 80,
  2009.           https: 443
  2010.         },
  2011.         u = {
  2012.         },
  2013.         c = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?(\[[\da-fA-F:]+\]|[^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,
  2014.         l = c.exec(i || ''),
  2015.         d = /^\/\/\w/.test(i);
  2016.         switch (e.typeOf(n)) {
  2017.           case 'undefined':
  2018.             n = t(document.location.href, !1);
  2019.             break;
  2020.           case 'string':
  2021.             n = t(n, !1)
  2022.         }
  2023.         for (; a--; ) l[a] && (u[o[a]] = l[a]);
  2024.         if (r = !d && !u.scheme, (d || r) && (u.scheme = n.scheme), r) {
  2025.           u.host = n.host,
  2026.           u.port = n.port;
  2027.           var m = '';
  2028.           /^[^\/]/.test(u.path) && (m = n.path, m = /\/[^\/]*\.[^\/]*$/.test(m) ? m.replace(/\/[^\/]+$/, '/')  : m.replace(/\/?$/, '/')),
  2029.           u.path = m + (u.path || '')
  2030.       }
  2031.       return u.port || (u.port = s[u.scheme] || 80),
  2032.       u.port = parseInt(u.port, 10),
  2033.       u.path || (u.path = '/'),
  2034.       delete u.source,
  2035.       u
  2036.     },
  2037.     i = function (e) {
  2038.       var i = {
  2039.         http: 80,
  2040.         https: 443
  2041.       },
  2042.       n = 'object' == typeof e ? e : t(e);
  2043.       return n.scheme + '://' + n.host + (n.port !== i[n.scheme] ? ':' + n.port : '') + n.path + (n.query ? n.query : '')
  2044.     },
  2045.     n = function (e) {
  2046.       function i(e) {
  2047.         return [e.scheme,
  2048.         e.host,
  2049.         e.port].join('/')
  2050.       }
  2051.       return 'string' == typeof e && (e = t(e)),
  2052.       i(t()) === i(e)
  2053.     };
  2054.     return {
  2055.       parseUrl: t,
  2056.       resolveUrl: i,
  2057.       hasSameOrigin: n
  2058.     }
  2059.   }), n('moxie/runtime/RuntimeTarget', [
  2060.     'moxie/core/utils/Basic',
  2061.     'moxie/runtime/RuntimeClient',
  2062.     'moxie/core/EventTarget'
  2063.   ], function (e, t, i) {
  2064.     function n() {
  2065.       this.uid = e.guid('uid_'),
  2066.       t.call(this),
  2067.       this.destroy = function () {
  2068.         this.disconnectRuntime(),
  2069.         this.unbindAll()
  2070.       }
  2071.     }
  2072.     return n.prototype = i.instance,
  2073.     n
  2074.   }), n('moxie/file/FileReaderSync', [
  2075.     'moxie/core/utils/Basic',
  2076.     'moxie/runtime/RuntimeClient',
  2077.     'moxie/core/utils/Encode'
  2078.   ], function (e, t, i) {
  2079.     return function () {
  2080.       function n(e, t) {
  2081.         if (!t.isDetached()) {
  2082.           var n = this.connectRuntime(t.ruid).exec.call(this, 'FileReaderSync', 'read', e, t);
  2083.           return this.disconnectRuntime(),
  2084.           n
  2085.         }
  2086.         var r = t.getSource();
  2087.         switch (e) {
  2088.           case 'readAsBinaryString':
  2089.             return r;
  2090.           case 'readAsDataURL':
  2091.             return 'data:' + t.type + ';base64,' + i.btoa(r);
  2092.           case 'readAsText':
  2093.             for (var o = '', a = 0, s = r.length; s > a; a++) o += String.fromCharCode(r[a]);
  2094.             return o
  2095.         }
  2096.       }
  2097.       t.call(this),
  2098.       e.extend(this, {
  2099.         uid: e.guid('uid_'),
  2100.         readAsBinaryString: function (e) {
  2101.           return n.call(this, 'readAsBinaryString', e)
  2102.         },
  2103.         readAsDataURL: function (e) {
  2104.           return n.call(this, 'readAsDataURL', e)
  2105.         },
  2106.         readAsText: function (e) {
  2107.           return n.call(this, 'readAsText', e)
  2108.         }
  2109.       })
  2110.     }
  2111.   }), n('moxie/xhr/FormData', [
  2112.     'moxie/core/Exceptions',
  2113.     'moxie/core/utils/Basic',
  2114.     'moxie/file/Blob'
  2115.   ], function (e, t, i) {
  2116.     function n() {
  2117.       var e,
  2118.       n = [
  2119.       ];
  2120.       t.extend(this, {
  2121.         append: function (r, o) {
  2122.           var a = this,
  2123.           s = t.typeOf(o);
  2124.           o instanceof i ? e = {
  2125.             name: r,
  2126.             value: o
  2127.           }
  2128.            : 'array' === s ? (r += '[]', t.each(o, function (e) {
  2129.             a.append(r, e)
  2130.           }))  : 'object' === s ? t.each(o, function (e, t) {
  2131.             a.append(r + '[' + t + ']', e)
  2132.           })  : 'null' === s || 'undefined' === s || 'number' === s && isNaN(o) ? a.append(r, 'false')  : n.push({
  2133.             name: r,
  2134.             value: o.toString()
  2135.           })
  2136.         },
  2137.         hasBlob: function () {
  2138.           return !!this.getBlob()
  2139.         },
  2140.         getBlob: function () {
  2141.           return e && e.value || null
  2142.         },
  2143.         getBlobName: function () {
  2144.           return e && e.name || null
  2145.         },
  2146.         each: function (i) {
  2147.           t.each(n, function (e) {
  2148.             i(e.value, e.name)
  2149.           }),
  2150.           e && i(e.value, e.name)
  2151.         },
  2152.         destroy: function () {
  2153.           e = null,
  2154.           n = [
  2155.           ]
  2156.         }
  2157.       })
  2158.     }
  2159.     return n
  2160.   }), n('moxie/xhr/XMLHttpRequest', [
  2161.     'moxie/core/utils/Basic',
  2162.     'moxie/core/Exceptions',
  2163.     'moxie/core/EventTarget',
  2164.     'moxie/core/utils/Encode',
  2165.     'moxie/core/utils/Url',
  2166.     'moxie/runtime/Runtime',
  2167.     'moxie/runtime/RuntimeTarget',
  2168.     'moxie/file/Blob',
  2169.     'moxie/file/FileReaderSync',
  2170.     'moxie/xhr/FormData',
  2171.     'moxie/core/utils/Env',
  2172.     'moxie/core/utils/Mime'
  2173.   ], function (e, t, i, n, r, o, a, s, u, c, l, d) {
  2174.     function m() {
  2175.       this.uid = e.guid('uid_')
  2176.     }
  2177.     function h() {
  2178.       function i(e, t) {
  2179.         return I.hasOwnProperty(e) ? 1 === arguments.length ? l.can('define_property') ? I[e] : A[e] : (l.can('define_property') ? I[e] = t : A[e] = t, void 0)  : void 0
  2180.       }
  2181.       function u(t) {
  2182.         function n() {
  2183.           R && (R.destroy(), R = null),
  2184.           s.dispatchEvent('loadend'),
  2185.           s = null
  2186.         }
  2187.         function r(r) {
  2188.           R.bind('LoadStart', function (e) {
  2189.             i('readyState', h.LOADING),
  2190.             s.dispatchEvent('readystatechange'),
  2191.             s.dispatchEvent(e),
  2192.             L && s.upload.dispatchEvent(e)
  2193.           }),
  2194.           R.bind('Progress', function (e) {
  2195.             i('readyState') !== h.LOADING && (i('readyState', h.LOADING), s.dispatchEvent('readystatechange')),
  2196.             s.dispatchEvent(e)
  2197.           }),
  2198.           R.bind('UploadProgress', function (e) {
  2199.             L && s.upload.dispatchEvent({
  2200.               type: 'progress',
  2201.               lengthComputable: !1,
  2202.               total: e.total,
  2203.               loaded: e.loaded
  2204.             })
  2205.           }),
  2206.           R.bind('Load', function (t) {
  2207.             i('readyState', h.DONE),
  2208.             i('status', Number(r.exec.call(R, 'XMLHttpRequest', 'getStatus') || 0)),
  2209.             i('statusText', f[i('status')] || ''),
  2210.             i('response', r.exec.call(R, 'XMLHttpRequest', 'getResponse', i('responseType'))),
  2211.             ~e.inArray(i('responseType'), [
  2212.               'text',
  2213.               ''
  2214.             ]) ? i('responseText', i('response'))  : 'document' === i('responseType') && i('responseXML', i('response')),
  2215.             U = r.exec.call(R, 'XMLHttpRequest', 'getAllResponseHeaders'),
  2216.             s.dispatchEvent('readystatechange'),
  2217.             i('status') > 0 ? (L && s.upload.dispatchEvent(t), s.dispatchEvent(t))  : (F = !0, s.dispatchEvent('error')),
  2218.             n()
  2219.           }),
  2220.           R.bind('Abort', function (e) {
  2221.             s.dispatchEvent(e),
  2222.             n()
  2223.           }),
  2224.           R.bind('Error', function (e) {
  2225.             F = !0,
  2226.             i('readyState', h.DONE),
  2227.             s.dispatchEvent('readystatechange'),
  2228.             M = !0,
  2229.             s.dispatchEvent(e),
  2230.             n()
  2231.           }),
  2232.           r.exec.call(R, 'XMLHttpRequest', 'send', {
  2233.             url: x,
  2234.             method: v,
  2235.             async: T,
  2236.             user: w,
  2237.             password: y,
  2238.             headers: S,
  2239.             mimeType: D,
  2240.             encoding: O,
  2241.             responseType: s.responseType,
  2242.             withCredentials: s.withCredentials,
  2243.             options: k
  2244.           }, t)
  2245.         }
  2246.         var s = this;
  2247.         E = (new Date).getTime(),
  2248.         R = new a,
  2249.         'string' == typeof k.required_caps && (k.required_caps = o.parseCaps(k.required_caps)),
  2250.         k.required_caps = e.extend({
  2251.         }, k.required_caps, {
  2252.           return_response_type: s.responseType
  2253.         }),
  2254.         t instanceof c && (k.required_caps.send_multipart = !0),
  2255.         e.isEmptyObj(S) || (k.required_caps.send_custom_headers = !0),
  2256.         B || (k.required_caps.do_cors = !0),
  2257.         k.ruid ? r(R.connectRuntime(k))  : (R.bind('RuntimeInit', function (e, t) {
  2258.           r(t)
  2259.         }), R.bind('RuntimeError', function (e, t) {
  2260.           s.dispatchEvent('RuntimeError', t)
  2261.         }), R.connectRuntime(k))
  2262.       }
  2263.       function g() {
  2264.         i('responseText', ''),
  2265.         i('responseXML', null),
  2266.         i('response', null),
  2267.         i('status', 0),
  2268.         i('statusText', ''),
  2269.         E = b = null
  2270.       }
  2271.       var x,
  2272.       v,
  2273.       w,
  2274.       y,
  2275.       E,
  2276.       b,
  2277.       R,
  2278.       _,
  2279.       A = this,
  2280.       I = {
  2281.         timeout: 0,
  2282.         readyState: h.UNSENT,
  2283.         withCredentials: !1,
  2284.         status: 0,
  2285.         statusText: '',
  2286.         responseType: '',
  2287.         responseXML: null,
  2288.         responseText: null,
  2289.         response: null
  2290.       },
  2291.       T = !0,
  2292.       S = {
  2293.       },
  2294.       O = null,
  2295.       D = null,
  2296.       N = !1,
  2297.       C = !1,
  2298.       L = !1,
  2299.       M = !1,
  2300.       F = !1,
  2301.       B = !1,
  2302.       P = null,
  2303.       H = null,
  2304.       k = {
  2305.       },
  2306.       U = '';
  2307.       e.extend(this, I, {
  2308.         uid: e.guid('uid_'),
  2309.         upload: new m,
  2310.         open: function (o, a, s, u, c) {
  2311.           var l;
  2312.           if (!o || !a) throw new t.DOMException(t.DOMException.SYNTAX_ERR);
  2313.           if (/[\u0100-\uffff]/.test(o) || n.utf8_encode(o) !== o) throw new t.DOMException(t.DOMException.SYNTAX_ERR);
  2314.           if (~e.inArray(o.toUpperCase(), [
  2315.             'CONNECT',
  2316.             'DELETE',
  2317.             'GET',
  2318.             'HEAD',
  2319.             'OPTIONS',
  2320.             'POST',
  2321.             'PUT',
  2322.             'TRACE',
  2323.             'TRACK'
  2324.           ]) && (v = o.toUpperCase()), ~e.inArray(v, [
  2325.             'CONNECT',
  2326.             'TRACE',
  2327.             'TRACK'
  2328.           ])) throw new t.DOMException(t.DOMException.SECURITY_ERR);
  2329.           if (a = n.utf8_encode(a), l = r.parseUrl(a), B = r.hasSameOrigin(l), x = r.resolveUrl(a), (u || c) && !B) throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);
  2330.           if (w = u || l.user, y = c || l.pass, T = s || !0, T === !1 && (i('timeout') || i('withCredentials') || '' !== i('responseType'))) throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);
  2331.           N = !T,
  2332.           C = !1,
  2333.           S = {
  2334.           },
  2335.           g.call(this),
  2336.           i('readyState', h.OPENED),
  2337.           this.dispatchEvent('readystatechange')
  2338.         },
  2339.         setRequestHeader: function (r, o) {
  2340.           var a = [
  2341.             'accept-charset',
  2342.             'accept-encoding',
  2343.             'access-control-request-headers',
  2344.             'access-control-request-method',
  2345.             'connection',
  2346.             'content-length',
  2347.             'cookie',
  2348.             'cookie2',
  2349.             'content-transfer-encoding',
  2350.             'date',
  2351.             'expect',
  2352.             'host',
  2353.             'keep-alive',
  2354.             'origin',
  2355.             'referer',
  2356.             'te',
  2357.             'trailer',
  2358.             'transfer-encoding',
  2359.             'upgrade',
  2360.             'user-agent',
  2361.             'via'
  2362.           ];
  2363.           if (i('readyState') !== h.OPENED || C) throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
  2364.           if (/[\u0100-\uffff]/.test(r) || n.utf8_encode(r) !== r) throw new t.DOMException(t.DOMException.SYNTAX_ERR);
  2365.           return r = e.trim(r).toLowerCase(),
  2366.           ~e.inArray(r, a) || /^(proxy\-|sec\-)/.test(r) ? !1 : (S[r] ? S[r] += ', ' + o : S[r] = o, !0)
  2367.         },
  2368.         hasRequestHeader: function (e) {
  2369.           return e && S[e.toLowerCase()] || !1
  2370.         },
  2371.         getAllResponseHeaders: function () {
  2372.           return U || ''
  2373.         },
  2374.         getResponseHeader: function (t) {
  2375.           return t = t.toLowerCase(),
  2376.           F || ~e.inArray(t, [
  2377.             'set-cookie',
  2378.             'set-cookie2'
  2379.           ]) ? null : U && '' !== U && (_ || (_ = {
  2380.           }, e.each(U.split(/\r\n/), function (t) {
  2381.             var i = t.split(/:\s+/);
  2382.             2 === i.length && (i[0] = e.trim(i[0]), _[i[0].toLowerCase()] = {
  2383.               header: i[0],
  2384.               value: e.trim(i[1])
  2385.             })
  2386.           })), _.hasOwnProperty(t)) ? _[t].header + ': ' + _[t].value : null
  2387.         },
  2388.         overrideMimeType: function (n) {
  2389.           var r,
  2390.           o;
  2391.           if (~e.inArray(i('readyState'), [
  2392.             h.LOADING,
  2393.             h.DONE
  2394.           ])) throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
  2395.           if (n = e.trim(n.toLowerCase()), /;/.test(n) && (r = n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/)) && (n = r[1], r[2] && (o = r[2])), !d.mimes[n]) throw new t.DOMException(t.DOMException.SYNTAX_ERR);
  2396.           P = n,
  2397.           H = o
  2398.         },
  2399.         send: function (i, r) {
  2400.           if (k = 'string' === e.typeOf(r) ? {
  2401.             ruid: r
  2402.           }
  2403.            : r ? r : {
  2404.           }, this.readyState !== h.OPENED || C) throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
  2405.           if (i instanceof s) k.ruid = i.ruid,
  2406.           D = i.type || 'application/octet-stream';
  2407.            else if (i instanceof c) {
  2408.             if (i.hasBlob()) {
  2409.               var o = i.getBlob();
  2410.               k.ruid = o.ruid,
  2411.               D = o.type || 'application/octet-stream'
  2412.             }
  2413.           } else 'string' == typeof i && (O = 'UTF-8', D = 'text/plain;charset=UTF-8', i = n.utf8_encode(i));
  2414.           this.withCredentials || (this.withCredentials = k.required_caps && k.required_caps.send_browser_cookies && !B),
  2415.           L = !N && this.upload.hasEventListener(),
  2416.           F = !1,
  2417.           M = !i,
  2418.           N || (C = !0),
  2419.           u.call(this, i)
  2420.         },
  2421.         abort: function () {
  2422.           if (F = !0, N = !1, ~e.inArray(i('readyState'), [
  2423.             h.UNSENT,
  2424.             h.OPENED,
  2425.             h.DONE
  2426.           ])) i('readyState', h.UNSENT);
  2427.            else {
  2428.             if (i('readyState', h.DONE), C = !1, !R) throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
  2429.             R.getRuntime().exec.call(R, 'XMLHttpRequest', 'abort', M),
  2430.             M = !0
  2431.           }
  2432.         },
  2433.         destroy: function () {
  2434.           R && ('function' === e.typeOf(R.destroy) && R.destroy(), R = null),
  2435.           this.unbindAll(),
  2436.           this.upload && (this.upload.unbindAll(), this.upload = null)
  2437.         }
  2438.       }),
  2439.       this.handleEventProps(p.concat(['readystatechange'])),
  2440.       this.upload.handleEventProps(p)
  2441.     }
  2442.     var f = {
  2443.       100: 'Continue',
  2444.       101: 'Switching Protocols',
  2445.       102: 'Processing',
  2446.       200: 'OK',
  2447.       201: 'Created',
  2448.       202: 'Accepted',
  2449.       203: 'Non-Authoritative Information',
  2450.       204: 'No Content',
  2451.       205: 'Reset Content',
  2452.       206: 'Partial Content',
  2453.       207: 'Multi-Status',
  2454.       226: 'IM Used',
  2455.       300: 'Multiple Choices',
  2456.       301: 'Moved Permanently',
  2457.       302: 'Found',
  2458.       303: 'See Other',
  2459.       304: 'Not Modified',
  2460.       305: 'Use Proxy',
  2461.       306: 'Reserved',
  2462.       307: 'Temporary Redirect',
  2463.       400: 'Bad Request',
  2464.       401: 'Unauthorized',
  2465.       402: 'Payment Required',
  2466.       403: 'Forbidden',
  2467.       404: 'Not Found',
  2468.       405: 'Method Not Allowed',
  2469.       406: 'Not Acceptable',
  2470.       407: 'Proxy Authentication Required',
  2471.       408: 'Request Timeout',
  2472.       409: 'Conflict',
  2473.       410: 'Gone',
  2474.       411: 'Length Required',
  2475.       412: 'Precondition Failed',
  2476.       413: 'Request Entity Too Large',
  2477.       414: 'Request-URI Too Long',
  2478.       415: 'Unsupported Media Type',
  2479.       416: 'Requested Range Not Satisfiable',
  2480.       417: 'Expectation Failed',
  2481.       422: 'Unprocessable Entity',
  2482.       423: 'Locked',
  2483.       424: 'Failed Dependency',
  2484.       426: 'Upgrade Required',
  2485.       500: 'Internal Server Error',
  2486.       501: 'Not Implemented',
  2487.       502: 'Bad Gateway',
  2488.       503: 'Service Unavailable',
  2489.       504: 'Gateway Timeout',
  2490.       505: 'HTTP Version Not Supported',
  2491.       506: 'Variant Also Negotiates',
  2492.       507: 'Insufficient Storage',
  2493.       510: 'Not Extended'
  2494.     };
  2495.     m.prototype = i.instance;
  2496.     var p = [
  2497.       'loadstart',
  2498.       'progress',
  2499.       'abort',
  2500.       'error',
  2501.       'load',
  2502.       'timeout',
  2503.       'loadend'
  2504.     ];
  2505.     return h.UNSENT = 0,
  2506.     h.OPENED = 1,
  2507.     h.HEADERS_RECEIVED = 2,
  2508.     h.LOADING = 3,
  2509.     h.DONE = 4,
  2510.     h.prototype = i.instance,
  2511.     h
  2512.   }), n('moxie/runtime/Transporter', [
  2513.     'moxie/core/utils/Basic',
  2514.     'moxie/core/utils/Encode',
  2515.     'moxie/runtime/RuntimeClient',
  2516.     'moxie/core/EventTarget'
  2517.   ], function (e, t, i, n) {
  2518.     function r() {
  2519.       function n() {
  2520.         l = d = 0,
  2521.         c = this.result = null
  2522.       }
  2523.       function o(t, i) {
  2524.         var n = this;
  2525.         u = i,
  2526.         n.bind('TransportingProgress', function (t) {
  2527.           d = t.loaded,
  2528.           l > d && - 1 === e.inArray(n.state, [
  2529.             r.IDLE,
  2530.             r.DONE
  2531.           ]) && a.call(n)
  2532.         }, 999),
  2533.         n.bind('TransportingComplete', function () {
  2534.           d = l,
  2535.           n.state = r.DONE,
  2536.           c = null,
  2537.           n.result = u.exec.call(n, 'Transporter', 'getAsBlob', t || '')
  2538.         }, 999),
  2539.         n.state = r.BUSY,
  2540.         n.trigger('TransportingStarted'),
  2541.         a.call(n)
  2542.       }
  2543.       function a() {
  2544.         var e,
  2545.         i = this,
  2546.         n = l - d;
  2547.         m > n && (m = n),
  2548.         e = t.btoa(c.substr(d, m)),
  2549.         u.exec.call(i, 'Transporter', 'receive', e, l)
  2550.       }
  2551.       var s,
  2552.       u,
  2553.       c,
  2554.       l,
  2555.       d,
  2556.       m;
  2557.       i.call(this),
  2558.       e.extend(this, {
  2559.         uid: e.guid('uid_'),
  2560.         state: r.IDLE,
  2561.         result: null,
  2562.         transport: function (t, i, r) {
  2563.           var a = this;
  2564.           if (r = e.extend({
  2565.             chunk_size: 204798
  2566.           }, r), (s = r.chunk_size % 3) && (r.chunk_size += 3 - s), m = r.chunk_size, n.call(this), c = t, l = t.length, 'string' === e.typeOf(r) || r.ruid) o.call(a, i, this.connectRuntime(r));
  2567.            else {
  2568.             var u = function (e, t) {
  2569.               a.unbind('RuntimeInit', u),
  2570.               o.call(a, i, t)
  2571.             };
  2572.             this.bind('RuntimeInit', u),
  2573.             this.connectRuntime(r)
  2574.           }
  2575.         },
  2576.         abort: function () {
  2577.           var e = this;
  2578.           e.state = r.IDLE,
  2579.           u && (u.exec.call(e, 'Transporter', 'clear'), e.trigger('TransportingAborted')),
  2580.           n.call(e)
  2581.         },
  2582.         destroy: function () {
  2583.           this.unbindAll(),
  2584.           u = null,
  2585.           this.disconnectRuntime(),
  2586.           n.call(this)
  2587.         }
  2588.       })
  2589.     }
  2590.     return r.IDLE = 0,
  2591.     r.BUSY = 1,
  2592.     r.DONE = 2,
  2593.     r.prototype = n.instance,
  2594.     r
  2595.   }), n('moxie/image/Image', [
  2596.     'moxie/core/utils/Basic',
  2597.     'moxie/core/utils/Dom',
  2598.     'moxie/core/Exceptions',
  2599.     'moxie/file/FileReaderSync',
  2600.     'moxie/xhr/XMLHttpRequest',
  2601.     'moxie/runtime/Runtime',
  2602.     'moxie/runtime/RuntimeClient',
  2603.     'moxie/runtime/Transporter',
  2604.     'moxie/core/utils/Env',
  2605.     'moxie/core/EventTarget',
  2606.     'moxie/file/Blob',
  2607.     'moxie/file/File',
  2608.     'moxie/core/utils/Encode'
  2609.   ], function (e, t, i, n, r, o, a, s, u, c, l, d, m) {
  2610.     function h() {
  2611.       function n(e) {
  2612.         try {
  2613.           return e || (e = this.exec('Image', 'getInfo')),
  2614.           this.size = e.size,
  2615.           this.width = e.width,
  2616.           this.height = e.height,
  2617.           this.type = e.type,
  2618.           this.meta = e.meta,
  2619.           '' === this.name && (this.name = e.name),
  2620.           !0
  2621.         } catch (t) {
  2622.           return this.trigger('error', t.code),
  2623.           !1
  2624.         }
  2625.       }
  2626.       function c(t) {
  2627.         var n = e.typeOf(t);
  2628.         alert();
  2629.         try {
  2630.           if (t instanceof h) {
  2631.             if (!t.size) throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);
  2632.             p.apply(this, arguments)
  2633.           } else if (t instanceof l) {
  2634.             if (!~e.inArray(t.type, [
  2635.               'image/jpeg',
  2636.               'image/png'
  2637.             ])) throw new i.ImageError(i.ImageError.WRONG_FORMAT);
  2638.             g.apply(this, arguments)
  2639.           } else if ( - 1 !== e.inArray(n, [
  2640.             'blob',
  2641.             'file'
  2642.           ])) c.call(this, new d(null, t), arguments[1]);
  2643.            else if ('string' === n) 'data:' === t.substr(0, 5) ? c.call(this, new l(null, {
  2644.             data: t
  2645.           }), arguments[1])  : x.apply(this, arguments);
  2646.            else {
  2647.             if ('node' !== n || 'img' !== t.nodeName.toLowerCase()) throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);
  2648.             c.call(this, t.src, arguments[1])
  2649.           }
  2650.         } catch (r) {
  2651.           this.trigger('error', r.code)
  2652.         }
  2653.       }
  2654.       function p(t, i) {
  2655.         var n = this.connectRuntime(t.ruid);
  2656.         this.ruid = n.uid,
  2657.         n.exec.call(this, 'Image', 'loadFromImage', t, 'undefined' === e.typeOf(i) ? !0 : i)
  2658.       }
  2659.       function g(t, i) {
  2660.         function n(e) {
  2661.           r.ruid = e.uid,
  2662.           e.exec.call(r, 'Image', 'loadFromBlob', t)
  2663.         }
  2664.         var r = this;
  2665.         r.name = t.name || '',
  2666.         t.isDetached() ? (this.bind('RuntimeInit', function (e, t) {
  2667.           n(t)
  2668.         }), i && 'string' == typeof i.required_caps && (i.required_caps = o.parseCaps(i.required_caps)), this.connectRuntime(e.extend({
  2669.           required_caps: {
  2670.             access_image_binary: !0,
  2671.             resize_image: !0
  2672.           }
  2673.         }, i)))  : n(this.connectRuntime(t.ruid))
  2674.       }
  2675.       function x(e, t) {
  2676.         var i,
  2677.         n = this;
  2678.         i = new r,
  2679.         i.open('get', e),
  2680.         i.responseType = 'blob',
  2681.         i.onprogress = function (e) {
  2682.           n.trigger(e)
  2683.         },
  2684.         i.onload = function () {
  2685.           g.call(n, i.response, !0)
  2686.         },
  2687.         i.onerror = function (e) {
  2688.           n.trigger(e)
  2689.         },
  2690.         i.onloadend = function () {
  2691.           i.destroy()
  2692.         },
  2693.         i.bind('RuntimeError', function (e, t) {
  2694.           n.trigger('RuntimeError', t)
  2695.         }),
  2696.         i.send(null, t)
  2697.       }
  2698.       a.call(this),
  2699.       e.extend(this, {
  2700.         uid: e.guid('uid_'),
  2701.         ruid: null,
  2702.         name: '',
  2703.         size: 0,
  2704.         width: 0,
  2705.         height: 0,
  2706.         type: '',
  2707.         meta: {
  2708.         },
  2709.         clone: function () {
  2710.           this.load.apply(this, arguments)
  2711.         },
  2712.         load: function () {
  2713.           c.apply(this, arguments)
  2714.         },
  2715.         resize: function (t) {
  2716.           var n,
  2717.           r,
  2718.           o = this,
  2719.           a = {
  2720.             x: 0,
  2721.             y: 0,
  2722.             width: o.width,
  2723.             height: o.height
  2724.           },
  2725.           s = e.extendIf({
  2726.             width: o.width,
  2727.             height: o.height,
  2728.             type: o.type || 'image/jpeg',
  2729.             quality: 90,
  2730.             crop: !1,
  2731.             fit: !0,
  2732.             preserveHeaders: !0,
  2733.             resample: 'default',
  2734.             multipass: !0
  2735.           }, t);
  2736.           try {
  2737.             if (!o.size) throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);
  2738.             if (o.width > h.MAX_RESIZE_WIDTH || o.height > h.MAX_RESIZE_HEIGHT) throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);
  2739.             if (n = o.meta && o.meta.tiff && o.meta.tiff.Orientation || 1, - 1 !== e.inArray(n, [
  2740.               5,
  2741.               6,
  2742.               7,
  2743.               8
  2744.             ])) {
  2745.               var u = s.width;
  2746.               s.width = s.height,
  2747.               s.height = u
  2748.             }
  2749.             if (s.crop) {
  2750.               switch (r = Math.max(s.width / o.width, s.height / o.height), t.fit ? (a.width = Math.min(Math.ceil(s.width / r), o.width), a.height = Math.min(Math.ceil(s.height / r), o.height), r = s.width / a.width)  : (a.width = Math.min(s.width, o.width), a.height = Math.min(s.height, o.height), r = 1), 'boolean' == typeof s.crop && (s.crop = 'cc'), s.crop.toLowerCase().replace(/_/, '-')) {
  2751.                 case 'rb':
  2752.                 case 'right-bottom':
  2753.                   a.x = o.width - a.width,
  2754.                   a.y = o.height - a.height;
  2755.                   break;
  2756.                 case 'cb':
  2757.                 case 'center-bottom':
  2758.                   a.x = Math.floor((o.width - a.width) / 2),
  2759.                   a.y = o.height - a.height;
  2760.                   break;
  2761.                 case 'lb':
  2762.                 case 'left-bottom':
  2763.                   a.x = 0,
  2764.                   a.y = o.height - a.height;
  2765.                   break;
  2766.                 case 'lt':
  2767.                 case 'left-top':
  2768.                   a.x = 0,
  2769.                   a.y = 0;
  2770.                   break;
  2771.                 case 'ct':
  2772.                 case 'center-top':
  2773.                   a.x = Math.floor((o.width - a.width) / 2),
  2774.                   a.y = 0;
  2775.                   break;
  2776.                 case 'rt':
  2777.                 case 'right-top':
  2778.                   a.x = o.width - a.width,
  2779.                   a.y = 0;
  2780.                   break;
  2781.                 case 'rc':
  2782.                 case 'right-center':
  2783.                 case 'right-middle':
  2784.                   a.x = o.width - a.width,
  2785.                   a.y = Math.floor((o.height - a.height) / 2);
  2786.                   break;
  2787.                 case 'lc':
  2788.                 case 'left-center':
  2789.                 case 'left-middle':
  2790.                   a.x = 0,
  2791.                   a.y = Math.floor((o.height - a.height) / 2);
  2792.                   break;
  2793.                 case 'cc':
  2794.                 case 'center-center':
  2795.                 case 'center-middle':
  2796.                 default:
  2797.                   a.x = Math.floor((o.width - a.width) / 2),
  2798.                   a.y = Math.floor((o.height - a.height) / 2)
  2799.               }
  2800.               a.x = Math.max(a.x, 0),
  2801.               a.y = Math.max(a.y, 0)
  2802.             } else r = Math.min(s.width / o.width, s.height / o.height);
  2803.             this.exec('Image', 'resize', a, r, s)
  2804.           } catch (c) {
  2805.             o.trigger('error', c.code)
  2806.           }
  2807.         },
  2808.         downsize: function (t) {
  2809.           var i,
  2810.           n = {
  2811.             width: this.width,
  2812.             height: this.height,
  2813.             type: this.type || 'image/jpeg',
  2814.             quality: 90,
  2815.             crop: !1,
  2816.             preserveHeaders: !0,
  2817.             resample: 'default'
  2818.           };
  2819.           i = 'object' == typeof t ? e.extend(n, t)  : e.extend(n, {
  2820.             width: arguments[0],
  2821.             height: arguments[1],
  2822.             crop: arguments[2],
  2823.             preserveHeaders: arguments[3]
  2824.           }),
  2825.           this.resize(i)
  2826.         },
  2827.         crop: function (e, t, i) {
  2828.           this.downsize(e, t, !0, i)
  2829.         },
  2830.         getAsCanvas: function () {
  2831.           if (!u.can('create_canvas')) throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);
  2832.           return this.exec('Image', 'getAsCanvas')
  2833.         },
  2834.         getAsBlob: function (e, t) {
  2835.           if (!this.size) throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);
  2836.           return this.exec('Image', 'getAsBlob', e || 'image/jpeg', t || 90)
  2837.         },
  2838.         getAsDataURL: function (e, t) {
  2839.           if (!this.size) throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);
  2840.           return this.exec('Image', 'getAsDataURL', e || 'image/jpeg', t || 90)
  2841.         },
  2842.         getAsBinaryString: function (e, t) {
  2843.           var i = this.getAsDataURL(e, t);
  2844.           return m.atob(i.substring(i.indexOf('base64,') + 7))
  2845.         },
  2846.         embed: function (n, r) {
  2847.           function o(t, r) {
  2848.             var o = this;
  2849.             if (u.can('create_canvas')) {
  2850.               var l = o.getAsCanvas();
  2851.               if (l) return n.appendChild(l),
  2852.               l = null,
  2853.               o.destroy(),
  2854.               c.trigger('embedded'),
  2855.               void 0
  2856.             }
  2857.             var d = o.getAsDataURL(t, r);
  2858.             if (!d) throw new i.ImageError(i.ImageError.WRONG_FORMAT);
  2859.             if (u.can('use_data_uri_of', d.length)) n.innerHTML = '<img src="' + d + '" width="' + o.width + '" height="' + o.height + '" />',
  2860.             o.destroy(),
  2861.             c.trigger('embedded');
  2862.              else {
  2863.               var h = new s;
  2864.               h.bind('TransportingComplete', function () {
  2865.                 a = c.connectRuntime(this.result.ruid),
  2866.                 c.bind('Embedded', function () {
  2867.                   e.extend(a.getShimContainer().style, {
  2868.                     top: '0px',
  2869.                     left: '0px',
  2870.                     width: o.width + 'px',
  2871.                     height: o.height + 'px'
  2872.                   }),
  2873.                   a = null
  2874.                 }, 999),
  2875.                 a.exec.call(c, 'ImageView', 'display', this.result.uid, width, height),
  2876.                 o.destroy()
  2877.               }),
  2878.               h.transport(m.atob(d.substring(d.indexOf('base64,') + 7)), t, {
  2879.                 required_caps: {
  2880.                   display_media: !0
  2881.                 },
  2882.                 runtime_order: 'flash,silverlight',
  2883.                 container: n
  2884.               })
  2885.             }
  2886.           }
  2887.           var a,
  2888.           c = this,
  2889.           l = e.extend({
  2890.             width: this.width,
  2891.             height: this.height,
  2892.             type: this.type || 'image/jpeg',
  2893.             quality: 90
  2894.           }, r);
  2895.           try {
  2896.             if (!(n = t.get(n))) throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);
  2897.             if (!this.size) throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);
  2898.             this.width > h.MAX_RESIZE_WIDTH || this.height > h.MAX_RESIZE_HEIGHT;
  2899.             var d = new h;
  2900.             return d.bind('Resize', function () {
  2901.               o.call(this, l.type, l.quality)
  2902.             }),
  2903.             d.bind('Load', function () {
  2904.               this.downsize(l)
  2905.             }),
  2906.             this.meta.thumb && this.meta.thumb.width >= l.width && this.meta.thumb.height >= l.height ? d.load(this.meta.thumb.data)  : d.clone(this, !1),
  2907.             d
  2908.           } catch (f) {
  2909.             this.trigger('error', f.code)
  2910.           }
  2911.         },
  2912.         destroy: function () {
  2913.           this.ruid && (this.getRuntime().exec.call(this, 'Image', 'destroy'), this.disconnectRuntime()),
  2914.           this.meta && this.meta.thumb && this.meta.thumb.data.destroy(),
  2915.           this.unbindAll()
  2916.         }
  2917.       }), this.handleEventProps(f), this.bind('Load Resize', function () {
  2918.         return n.call(this)
  2919.       }, 999)
  2920.     }
  2921.     var f = [
  2922.       'progress',
  2923.       'load',
  2924.       'error',
  2925.       'resize',
  2926.       'embedded'
  2927.     ];
  2928.     return h.MAX_RESIZE_WIDTH = 8192,
  2929.     h.MAX_RESIZE_HEIGHT = 8192,
  2930.     h.prototype = c.instance,
  2931.     h
  2932.   }), n('moxie/runtime/html5/Runtime', [
  2933.     'moxie/core/utils/Basic',
  2934.     'moxie/core/Exceptions',
  2935.     'moxie/runtime/Runtime',
  2936.     'moxie/core/utils/Env'
  2937.   ], function (e, t, i, n) {
  2938.     function o(t) {
  2939.       var o = this,
  2940.       u = i.capTest,
  2941.       c = i.capTrue,
  2942.       l = e.extend({
  2943.         access_binary: u(window.FileReader || window.File && window.File.getAsDataURL),
  2944.         access_image_binary: function () {
  2945.           return o.can('access_binary') && !!s.Image
  2946.         },
  2947.         display_media: u((n.can('create_canvas') || n.can('use_data_uri_over32kb')) && r('moxie/image/Image')),
  2948.         do_cors: u(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest),
  2949.         drag_and_drop: u(function () {
  2950.           var e = document.createElement('div');
  2951.           return ('draggable' in e || 'ondragstart' in e && 'ondrop' in e) && ('IE' !== n.browser || n.verComp(n.version, 9, '>'))
  2952.         }()),
  2953.         filter_by_extension: u(function () {
  2954.           return !('Chrome' === n.browser && n.verComp(n.version, 28, '<') || 'IE' === n.browser && n.verComp(n.version, 10, '<') || 'Safari' === n.browser && n.verComp(n.version, 7, '<') || 'Firefox' === n.browser && n.verComp(n.version, 37, '<'))
  2955.         }()),
  2956.         return_response_headers: c,
  2957.         return_response_type: function (e) {
  2958.           return 'json' === e && window.JSON ? !0 : n.can('return_response_type', e)
  2959.         },
  2960.         return_status_code: c,
  2961.         report_upload_progress: u(window.XMLHttpRequest && (new XMLHttpRequest).upload),
  2962.         resize_image: function () {
  2963.           return o.can('access_binary') && n.can('create_canvas')
  2964.         },
  2965.         select_file: function () {
  2966.           return n.can('use_fileinput') && window.File
  2967.         },
  2968.         select_folder: function () {
  2969.           return o.can('select_file') && ('Chrome' === n.browser && n.verComp(n.version, 21, '>=') || 'Firefox' === n.browser && n.verComp(n.version, 42, '>='))
  2970.         },
  2971.         select_multiple: function () {
  2972.           return !(!o.can('select_file') || 'Safari' === n.browser && 'Windows' === n.os || 'iOS' === n.os && n.verComp(n.osVersion, '7.0.0', '>') && n.verComp(n.osVersion, '8.0.0', '<'))
  2973.         },
  2974.         send_binary_string: u(window.XMLHttpRequest && ((new XMLHttpRequest).sendAsBinary || window.Uint8Array && window.ArrayBuffer)),
  2975.         send_custom_headers: u(window.XMLHttpRequest),
  2976.         send_multipart: function () {
  2977.           return !!(window.XMLHttpRequest && (new XMLHttpRequest).upload && window.FormData) || o.can('send_binary_string')
  2978.         },
  2979.         slice_blob: u(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)),
  2980.         stream_upload: function () {
  2981.           return o.can('slice_blob') && o.can('send_multipart')
  2982.         },
  2983.         summon_file_dialog: function () {
  2984.           return o.can('select_file') && ('Firefox' === n.browser && n.verComp(n.version, 4, '>=') || 'Opera' === n.browser && n.verComp(n.version, 12, '>=') || 'IE' === n.browser && n.verComp(n.version, 10, '>=') || !!~e.inArray(n.browser, [
  2985.             'Chrome',
  2986.             'Safari',
  2987.             'Edge'
  2988.           ]))
  2989.         },
  2990.         upload_filesize: c,
  2991.         use_http_method: c
  2992.       }, arguments[2]);
  2993.       i.call(this, t, arguments[1] || a, l),
  2994.       e.extend(this, {
  2995.         init: function () {
  2996.           this.trigger('Init')
  2997.         },
  2998.         destroy: function (e) {
  2999.           return function () {
  3000.             e.call(o),
  3001.             e = o = null
  3002.           }
  3003.         }(this.destroy)
  3004.       }),
  3005.       e.extend(this.getShim(), s)
  3006.     }
  3007.     var a = 'html5',
  3008.     s = {
  3009.     };
  3010.     return i.addConstructor(a, o),
  3011.     s
  3012.   }), n('moxie/runtime/html5/file/Blob', [
  3013.     'moxie/runtime/html5/Runtime',
  3014.     'moxie/file/Blob'
  3015.   ], function (e, t) {
  3016.     function i() {
  3017.       function e(e, t, i) {
  3018.         var n;
  3019.         if (!window.File.prototype.slice) return (n = window.File.prototype.webkitSlice || window.File.prototype.mozSlice) ? n.call(e, t, i)  : null;
  3020.         try {
  3021.           return e.slice(),
  3022.           e.slice(t, i)
  3023.         } catch (r) {
  3024.           return e.slice(t, i - t)
  3025.         }
  3026.       }
  3027.       this.slice = function () {
  3028.         return new t(this.getRuntime().uid, e.apply(this, arguments))
  3029.       }
  3030.     }
  3031.     return e.Blob = i
  3032.   }), n('moxie/core/utils/Events', [
  3033.     'moxie/core/utils/Basic'
  3034.   ], function (e) {
  3035.     function t() {
  3036.       this.returnValue = !1
  3037.     }
  3038.     function i() {
  3039.       this.cancelBubble = !0
  3040.     }
  3041.     var n = {
  3042.     },
  3043.     r = 'moxie_' + e.guid(),
  3044.     o = function (o, a, s, u) {
  3045.       var c,
  3046.       l;
  3047.       a = a.toLowerCase(),
  3048.       o.addEventListener ? (c = s, o.addEventListener(a, c, !1))  : o.attachEvent && (c = function () {
  3049.         var e = window.event;
  3050.         e.target || (e.target = e.srcElement),
  3051.         e.preventDefault = t,
  3052.         e.stopPropagation = i,
  3053.         s(e)
  3054.       }, o.attachEvent('on' + a, c)),
  3055.       o[r] || (o[r] = e.guid()),
  3056.       n.hasOwnProperty(o[r]) || (n[o[r]] = {
  3057.       }),
  3058.       l = n[o[r]],
  3059.       l.hasOwnProperty(a) || (l[a] = [
  3060.       ]),
  3061.       l[a].push({
  3062.         func: c,
  3063.         orig: s,
  3064.         key: u
  3065.       })
  3066.     },
  3067.     a = function (t, i, o) {
  3068.       var a,
  3069.       s;
  3070.       if (i = i.toLowerCase(), t[r] && n[t[r]] && n[t[r]][i]) {
  3071.         a = n[t[r]][i];
  3072.         for (var u = a.length - 1; u >= 0 && (a[u].orig !== o && a[u].key !== o || (t.removeEventListener ? t.removeEventListener(i, a[u].func, !1)  : t.detachEvent && t.detachEvent('on' + i, a[u].func), a[u].orig = null, a[u].func = null, a.splice(u, 1), o === s)); u--);
  3073.         if (a.length || delete n[t[r]][i], e.isEmptyObj(n[t[r]])) {
  3074.           delete n[t[r]];
  3075.           try {
  3076.             delete t[r]
  3077.           } catch (c) {
  3078.             t[r] = s
  3079.           }
  3080.         }
  3081.       }
  3082.     },
  3083.     s = function (t, i) {
  3084.       t && t[r] && e.each(n[t[r]], function (e, n) {
  3085.         a(t, n, i)
  3086.       })
  3087.     };
  3088.     return {
  3089.       addEvent: o,
  3090.       removeEvent: a,
  3091.       removeAllEvents: s
  3092.     }
  3093.   }), n('moxie/runtime/html5/file/FileInput', [
  3094.     'moxie/runtime/html5/Runtime',
  3095.     'moxie/file/File',
  3096.     'moxie/core/utils/Basic',
  3097.     'moxie/core/utils/Dom',
  3098.     'moxie/core/utils/Events',
  3099.     'moxie/core/utils/Mime',
  3100.     'moxie/core/utils/Env'
  3101.   ], function (e, t, i, n, r, o, a) {
  3102.     function s() {
  3103.       var e,
  3104.       s;
  3105.       i.extend(this, {
  3106.         init: function (u) {
  3107.           var c,
  3108.           l,
  3109.           d,
  3110.           m,
  3111.           h,
  3112.           f,
  3113.           p = this,
  3114.           g = p.getRuntime();
  3115.           e = u,
  3116.           d = e.accept.mimes || o.extList2mimes(e.accept, g.can('filter_by_extension')),
  3117.           l = g.getShimContainer(),
  3118.           l.innerHTML = '<input id="' + g.uid + '" type="file" style="font-size:999px;opacity:0;"' + (e.multiple && g.can('select_multiple') ? 'multiple' : '') + (e.directory && g.can('select_folder') ? 'webkitdirectory directory' : '') + (d ? ' accept="' + d.join(',') + '"' : '') + ' />',
  3119.           c = n.get(g.uid),
  3120.           i.extend(c.style, {
  3121.             position: 'absolute',
  3122.             top: 0,
  3123.             left: 0,
  3124.             width: '100%',
  3125.             height: '100%'
  3126.           }),
  3127.           m = n.get(e.browse_button),
  3128.           s = n.getStyle(m, 'z-index') || 'auto',
  3129.           // Тригер клика
  3130.           g.can('summon_file_dialog') && ('static' === n.getStyle(m, 'position') && (m.style.position = 'relative'), r.addEvent(m, 'click', function (e) {
  3131.             alert('1');
  3132.             var t = n.get(g.uid);
  3133.             t && !t.disabled && t.click(),
  3134.             e.preventDefault()
  3135.           }, p.uid), p.bind('Refresh', function () {
  3136.             h = parseInt(s, 10) || 1,
  3137.             n.get(e.browse_button).style.zIndex = h,
  3138.             this.getRuntime().getShimContainer().style.zIndex = h - 1
  3139.           })),
  3140.           f = g.can('summon_file_dialog') ? m : l,
  3141.           r.addEvent(f, 'mouseover', function () {
  3142.             p.trigger('mouseenter')
  3143.           }, p.uid),
  3144.           r.addEvent(f, 'mouseout', function () {
  3145.             p.trigger('mouseleave')
  3146.           }, p.uid),
  3147.           r.addEvent(f, 'mousedown', function () {
  3148.             p.trigger('mousedown')
  3149.           }, p.uid),
  3150.           r.addEvent(n.get(e.container), 'mouseup', function () {
  3151.             p.trigger('mouseup')
  3152.           }, p.uid),
  3153.           c.onchange = function x() {
  3154.             alert('2');
  3155.             if (p.files = [
  3156.             ], i.each(this.files, function (i) {
  3157.               var n = '';
  3158.               return e.directory && '.' == i.name ? !0 : (i.webkitRelativePath && (n = '/' + i.webkitRelativePath.replace(/^\//, '')), i = new t(g.uid, i), i.relativePath = n, p.files.push(i), void 0)
  3159.             }), 'IE' !== a.browser && 'IEMobile' !== a.browser) this.value = '';
  3160.              else {
  3161.               var n = this.cloneNode(!0);
  3162.               this.parentNode.replaceChild(n, this),
  3163.               n.onchange = x
  3164.             }
  3165.             p.files.length && p.trigger('change')
  3166.           },
  3167.           p.trigger({
  3168.             type: 'ready',
  3169.             async: !0
  3170.           }),
  3171.           l = null
  3172.         },
  3173.         setOption: function (e, t) {
  3174.           var i = this.getRuntime(),
  3175.           r = n.get(i.uid);
  3176.           switch (e) {
  3177.             case 'accept':
  3178.               if (t) {
  3179.                 var a = t.mimes || o.extList2mimes(t, i.can('filter_by_extension'));
  3180.                 r.setAttribute('accept', a.join(','))
  3181.               } else r.removeAttribute('accept');
  3182.               break;
  3183.             case 'directory':
  3184.               t && i.can('select_folder') ? (r.setAttribute('directory', ''), r.setAttribute('webkitdirectory', ''))  : (r.removeAttribute('directory'), r.removeAttribute('webkitdirectory'));
  3185.               break;
  3186.             case 'multiple':
  3187.               t && i.can('select_multiple') ? r.setAttribute('multiple', '')  : r.removeAttribute('multiple')
  3188.           }
  3189.         },
  3190.         disable: function (e) {
  3191.           var t,
  3192.           i = this.getRuntime();
  3193.           (t = n.get(i.uid)) && (t.disabled = !!e)
  3194.         },
  3195.         destroy: function () {
  3196.           var t = this.getRuntime(),
  3197.           i = t.getShim(),
  3198.           o = t.getShimContainer(),
  3199.           a = e && n.get(e.container),
  3200.           u = e && n.get(e.browse_button);
  3201.           a && r.removeAllEvents(a, this.uid),
  3202.           u && (r.removeAllEvents(u, this.uid), u.style.zIndex = s),
  3203.           o && (r.removeAllEvents(o, this.uid), o.innerHTML = ''),
  3204.           i.removeInstance(this.uid),
  3205.           e = o = a = u = i = null
  3206.         }
  3207.       })
  3208.     }
  3209.     return e.FileInput = s
  3210.   }), n('moxie/runtime/html5/file/FileDrop', [
  3211.     'moxie/runtime/html5/Runtime',
  3212.     'moxie/file/File',
  3213.     'moxie/core/utils/Basic',
  3214.     'moxie/core/utils/Dom',
  3215.     'moxie/core/utils/Events',
  3216.     'moxie/core/utils/Mime'
  3217.   ], function (e, t, i, n, r, o) {
  3218.     function a() {
  3219.       function e(e) {
  3220.         if (!e.dataTransfer || !e.dataTransfer.types) return !1;
  3221.         var t = i.toArray(e.dataTransfer.types || [
  3222.         ]);
  3223.         return - 1 !== i.inArray('Files', t) || - 1 !== i.inArray('public.file-url', t) || - 1 !== i.inArray('application/x-moz-file', t)
  3224.       }
  3225.       function a(e, i) {
  3226.         if (u(e)) {
  3227.           var n = new t(f, e);
  3228.           n.relativePath = i || '',
  3229.           p.push(n)
  3230.         }
  3231.       }
  3232.       function s(e) {
  3233.         for (var t = [
  3234.         ], n = 0; n < e.length; n++) [].push.apply(t, e[n].extensions.split(/\s*,\s*/));
  3235.         return - 1 === i.inArray('*', t) ? t : [
  3236.         ]
  3237.       }
  3238.       function u(e) {
  3239.         if (!g.length) return !0;
  3240.         var t = o.getFileExtension(e.name);
  3241.         return !t || - 1 !== i.inArray(t, g)
  3242.       }
  3243.       function c(e, t) {
  3244.         var n = [
  3245.         ];
  3246.         i.each(e, function (e) {
  3247.           var t = e.webkitGetAsEntry();
  3248.           t && (t.isFile ? a(e.getAsFile(), t.fullPath)  : n.push(t))
  3249.         }),
  3250.         n.length ? l(n, t)  : t()
  3251.       }
  3252.       function l(e, t) {
  3253.         var n = [
  3254.         ];
  3255.         i.each(e, function (e) {
  3256.           n.push(function (t) {
  3257.             d(e, t)
  3258.           })
  3259.         }),
  3260.         i.inSeries(n, function () {
  3261.           t()
  3262.         })
  3263.       }
  3264.       function d(e, t) {
  3265.         e.isFile ? e.file(function (i) {
  3266.           a(i, e.fullPath),
  3267.           t()
  3268.         }, function () {
  3269.           t()
  3270.         })  : e.isDirectory ? m(e, t)  : t()
  3271.       }
  3272.       function m(e, t) {
  3273.         function i(e) {
  3274.           r.readEntries(function (t) {
  3275.             t.length ? ([].push.apply(n, t), i(e))  : e()
  3276.           }, e)
  3277.         }
  3278.         var n = [
  3279.         ],
  3280.         r = e.createReader();
  3281.         i(function () {
  3282.           l(n, t)
  3283.         })
  3284.       }
  3285.       var h,
  3286.       f,
  3287.       p = [
  3288.       ],
  3289.       g = [
  3290.       ];
  3291.       i.extend(this, {
  3292.         init: function (t) {
  3293.           var n,
  3294.           o = this;
  3295.           h = t,
  3296.           f = o.ruid,
  3297.           g = s(h.accept),
  3298.           n = h.container,
  3299.           r.addEvent(n, 'dragover', function (t) {
  3300.             e(t) && (t.preventDefault(), t.dataTransfer.dropEffect = 'copy')
  3301.           }, o.uid),
  3302.           r.addEvent(n, 'drop', function (t) {
  3303.             e(t) && (t.preventDefault(), p = [
  3304.             ], t.dataTransfer.items && t.dataTransfer.items[0].webkitGetAsEntry ? c(t.dataTransfer.items, function () {
  3305.               o.files = p,
  3306.               o.trigger('drop')
  3307.             })  : (i.each(t.dataTransfer.files, function (e) {
  3308.               a(e)
  3309.             }), o.files = p, o.trigger('drop')))
  3310.           }, o.uid),
  3311.           r.addEvent(n, 'dragenter', function () {
  3312.             o.trigger('dragenter')
  3313.           }, o.uid),
  3314.           r.addEvent(n, 'dragleave', function () {
  3315.             o.trigger('dragleave')
  3316.           }, o.uid)
  3317.         },
  3318.         destroy: function () {
  3319.           r.removeAllEvents(h && n.get(h.container), this.uid),
  3320.           f = p = g = h = null
  3321.         }
  3322.       })
  3323.     }
  3324.     return e.FileDrop = a
  3325.   }), n('moxie/runtime/html5/file/FileReader', [
  3326.     'moxie/runtime/html5/Runtime',
  3327.     'moxie/core/utils/Encode',
  3328.     'moxie/core/utils/Basic'
  3329.   ], function (e, t, i) {
  3330.     function n() {
  3331.       function e(e) {
  3332.         return t.atob(e.substring(e.indexOf('base64,') + 7))
  3333.       }
  3334.       var n,
  3335.       r = !1;
  3336.       i.extend(this, {
  3337.         read: function (t, o) {
  3338.           var a = this;
  3339.           a.result = '',
  3340.           n = new window.FileReader,
  3341.           n.addEventListener('progress', function (e) {
  3342.             a.trigger(e)
  3343.           }),
  3344.           n.addEventListener('load', function (t) {
  3345.             a.result = r ? e(n.result)  : n.result,
  3346.             a.trigger(t)
  3347.           }),
  3348.           n.addEventListener('error', function (e) {
  3349.             a.trigger(e, n.error)
  3350.           }),
  3351.           n.addEventListener('loadend', function (e) {
  3352.             n = null,
  3353.             a.trigger(e)
  3354.           }),
  3355.           'function' === i.typeOf(n[t]) ? (r = !1, n[t](o.getSource()))  : 'readAsBinaryString' === t && (r = !0, n.readAsDataURL(o.getSource()))
  3356.         },
  3357.         abort: function () {
  3358.           n && n.abort()
  3359.         },
  3360.         destroy: function () {
  3361.           n = null
  3362.         }
  3363.       })
  3364.     }
  3365.     return e.FileReader = n
  3366.   }), n('moxie/runtime/html5/xhr/XMLHttpRequest', [
  3367.     'moxie/runtime/html5/Runtime',
  3368.     'moxie/core/utils/Basic',
  3369.     'moxie/core/utils/Mime',
  3370.     'moxie/core/utils/Url',
  3371.     'moxie/file/File',
  3372.     'moxie/file/Blob',
  3373.     'moxie/xhr/FormData',
  3374.     'moxie/core/Exceptions',
  3375.     'moxie/core/utils/Env'
  3376.   ], function (e, t, i, n, r, o, a, s, u) {
  3377.     function c() {
  3378.       function e(e, t) {
  3379.         var i,
  3380.         n,
  3381.         r = this;
  3382.         i = t.getBlob().getSource(),
  3383.         n = new window.FileReader,
  3384.         n.onload = function () {
  3385.           t.append(t.getBlobName(), new o(null, {
  3386.             type: i.type,
  3387.             data: n.result
  3388.           })),
  3389.           f.send.call(r, e, t)
  3390.         },
  3391.         n.readAsBinaryString(i)
  3392.       }
  3393.       function c() {
  3394.         return !window.XMLHttpRequest || 'IE' === u.browser && u.verComp(u.version, 8, '<') ? function () {
  3395.           for (var e = [
  3396.             'Msxml2.XMLHTTP.6.0',
  3397.             'Microsoft.XMLHTTP'
  3398.           ], t = 0; t < e.length; t++) try {
  3399.             return new ActiveXObject(e[t])
  3400.           } catch (i) {
  3401.           }
  3402.         }()  : new window.XMLHttpRequest
  3403.       }
  3404.       function l(e) {
  3405.         var t = e.responseXML,
  3406.         i = e.responseText;
  3407.         return 'IE' === u.browser && i && t && !t.documentElement && /[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader('Content-Type')) && (t = new window.ActiveXObject('Microsoft.XMLDOM'), t.async = !1, t.validateOnParse = !1, t.loadXML(i)),
  3408.         t && ('IE' === u.browser && 0 !== t.parseError || !t.documentElement || 'parsererror' === t.documentElement.tagName) ? null : t
  3409.       }
  3410.       function d(e) {
  3411.         var t = '----moxieboundary' + (new Date).getTime(),
  3412.         i = '--',
  3413.         n = '\r\n',
  3414.         r = '',
  3415.         a = this.getRuntime();
  3416.         if (!a.can('send_binary_string')) throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);
  3417.         return m.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + t),
  3418.         e.each(function (e, a) {
  3419.           r += e instanceof o ? i + t + n + 'Content-Disposition: form-data; name="' + a + '"; filename="' + unescape(encodeURIComponent(e.name || 'blob')) + '"' + n + 'Content-Type: ' + (e.type || 'application/octet-stream') + n + n + e.getSource() + n : i + t + n + 'Content-Disposition: form-data; name="' + a + '"' + n + n + unescape(encodeURIComponent(e)) + n
  3420.         }),
  3421.         r += i + t + i + n
  3422.       }
  3423.       var m,
  3424.       h,
  3425.       f = this;
  3426.       t.extend(this, {
  3427.         send: function (i, r) {
  3428.           var s = this,
  3429.           l = 'Mozilla' === u.browser && u.verComp(u.version, 4, '>=') && u.verComp(u.version, 7, '<'),
  3430.           f = 'Android Browser' === u.browser,
  3431.           p = !1;
  3432.           if (h = i.url.replace(/^.+?\/([\w\-\.]+)$/, '$1').toLowerCase(), m = c(), m.open(i.method, i.url, i.async, i.user, i.password), r instanceof o) r.isDetached() && (p = !0),
  3433.           r = r.getSource();
  3434.            else if (r instanceof a) {
  3435.             if (r.hasBlob()) if (r.getBlob().isDetached()) r = d.call(s, r),
  3436.             p = !0;
  3437.              else if ((l || f) && 'blob' === t.typeOf(r.getBlob().getSource()) && window.FileReader) return e.call(s, i, r),
  3438.             void 0;
  3439.             if (r instanceof a) {
  3440.               var g = new window.FormData;
  3441.               r.each(function (e, t) {
  3442.                 e instanceof o ? g.append(t, e.getSource())  : g.append(t, e)
  3443.               }),
  3444.               r = g
  3445.             }
  3446.           }
  3447.           m.upload ? (i.withCredentials && (m.withCredentials = !0), m.addEventListener('load', function (e) {
  3448.             s.trigger(e)
  3449.           }), m.addEventListener('error', function (e) {
  3450.             s.trigger(e)
  3451.           }), m.addEventListener('progress', function (e) {
  3452.             s.trigger(e)
  3453.           }), m.upload.addEventListener('progress', function (e) {
  3454.             s.trigger({
  3455.               type: 'UploadProgress',
  3456.               loaded: e.loaded,
  3457.               total: e.total
  3458.             })
  3459.           }))  : m.onreadystatechange = function () {
  3460.             switch (m.readyState) {
  3461.               case 1:
  3462.                 break;
  3463.               case 2:
  3464.                 break;
  3465.               case 3:
  3466.                 var e,
  3467.                 t;
  3468.                 try {
  3469.                   n.hasSameOrigin(i.url) && (e = m.getResponseHeader('Content-Length') || 0),
  3470.                   m.responseText && (t = m.responseText.length)
  3471.                 } catch (r) {
  3472.                   e = t = 0
  3473.                 }
  3474.                 s.trigger({
  3475.                   type: 'progress',
  3476.                   lengthComputable: !!e,
  3477.                   total: parseInt(e, 10),
  3478.                   loaded: t
  3479.                 });
  3480.                 break;
  3481.               case 4:
  3482.                 m.onreadystatechange = function () {
  3483.                 },
  3484.                 0 === m.status ? s.trigger('error')  : s.trigger('load')
  3485.             }
  3486.           },
  3487.           t.isEmptyObj(i.headers) || t.each(i.headers, function (e, t) {
  3488.             m.setRequestHeader(t, e)
  3489.           }),
  3490.           '' !== i.responseType && 'responseType' in m && (m.responseType = 'json' !== i.responseType || u.can('return_response_type', 'json') ? i.responseType : 'text'),
  3491.           p ? m.sendAsBinary ? m.sendAsBinary(r)  : function () {
  3492.             for (var e = new Uint8Array(r.length), t = 0; t < r.length; t++) e[t] = 255 & r.charCodeAt(t);
  3493.             m.send(e.buffer)
  3494.           }()  : m.send(r),
  3495.           s.trigger('loadstart')
  3496.         },
  3497.         getStatus: function () {
  3498.           try {
  3499.             if (m) return m.status
  3500.           } catch (e) {
  3501.           }
  3502.           return 0
  3503.         },
  3504.         getResponse: function (e) {
  3505.           var t = this.getRuntime();
  3506.           try {
  3507.             switch (e) {
  3508.               case 'blob':
  3509.                 var n = new r(t.uid, m.response),
  3510.                 o = m.getResponseHeader('Content-Disposition');
  3511.                 if (o) {
  3512.                   var a = o.match(/filename=([\'\"'])([^\1]+)\1/);
  3513.                   a && (h = a[2])
  3514.                 }
  3515.                 return n.name = h,
  3516.                 n.type || (n.type = i.getFileMime(h)),
  3517.                 n;
  3518.               case 'json':
  3519.                 return u.can('return_response_type', 'json') ? m.response : 200 === m.status && window.JSON ? JSON.parse(m.responseText)  : null;
  3520.               case 'document':
  3521.                 return l(m);
  3522.               default:
  3523.                 return '' !== m.responseText ? m.responseText : null
  3524.             }
  3525.           } catch (s) {
  3526.             return null
  3527.           }
  3528.         },
  3529.         getAllResponseHeaders: function () {
  3530.           try {
  3531.             return m.getAllResponseHeaders()
  3532.           } catch (e) {
  3533.           }
  3534.           return ''
  3535.         },
  3536.         abort: function () {
  3537.           m && m.abort()
  3538.         },
  3539.         destroy: function () {
  3540.           f = h = null
  3541.         }
  3542.       })
  3543.     }
  3544.     return e.XMLHttpRequest = c
  3545.   }),
  3546.   n('moxie/runtime/html5/utils/BinaryReader', [
  3547.     'moxie/core/utils/Basic'
  3548.   ], function (e) {
  3549.     function t(e) {
  3550.       e instanceof ArrayBuffer ? i.apply(this, arguments)  : n.apply(this, arguments)
  3551.     }
  3552.     function i(t) {
  3553.       var i = new DataView(t);
  3554.       e.extend(this, {
  3555.         readByteAt: function (e) {
  3556.           return i.getUint8(e)
  3557.         },
  3558.         writeByteAt: function (e, t) {
  3559.           i.setUint8(e, t)
  3560.         },
  3561.         SEGMENT: function (e, n, r) {
  3562.           switch (arguments.length) {
  3563.             case 2:
  3564.               return t.slice(e, e + n);
  3565.             case 1:
  3566.               return t.slice(e);
  3567.             case 3:
  3568.               if (null === r && (r = new ArrayBuffer), r instanceof ArrayBuffer) {
  3569.                 var o = new Uint8Array(this.length() - n + r.byteLength);
  3570.                 e > 0 && o.set(new Uint8Array(t.slice(0, e)), 0),
  3571.                 o.set(new Uint8Array(r), e),
  3572.                 o.set(new Uint8Array(t.slice(e + n)), e + r.byteLength),
  3573.                 this.clear(),
  3574.                 t = o.buffer,
  3575.                 i = new DataView(t);
  3576.                 break
  3577.               }
  3578.             default:
  3579.               return t
  3580.           }
  3581.         },
  3582.         length: function () {
  3583.           return t ? t.byteLength : 0
  3584.         },
  3585.         clear: function () {
  3586.           i = t = null
  3587.         }
  3588.       })
  3589.     }
  3590.     function n(t) {
  3591.       function i(e, i, n) {
  3592.         n = 3 === arguments.length ? n : t.length - i - 1,
  3593.         t = t.substr(0, i) + e + t.substr(n + i)
  3594.       }
  3595.       e.extend(this, {
  3596.         readByteAt: function (e) {
  3597.           return t.charCodeAt(e)
  3598.         },
  3599.         writeByteAt: function (e, t) {
  3600.           i(String.fromCharCode(t), e, 1)
  3601.         },
  3602.         SEGMENT: function (e, n, r) {
  3603.           switch (arguments.length) {
  3604.             case 1:
  3605.               return t.substr(e);
  3606.             case 2:
  3607.               return t.substr(e, n);
  3608.             case 3:
  3609.               i(null !== r ? r : '', e, n);
  3610.               break;
  3611.             default:
  3612.               return t
  3613.           }
  3614.         },
  3615.         length: function () {
  3616.           return t ? t.length : 0
  3617.         },
  3618.         clear: function () {
  3619.           t = null
  3620.         }
  3621.       })
  3622.     }
  3623.     return e.extend(t.prototype, {
  3624.       littleEndian: !1,
  3625.       read: function (e, t) {
  3626.         var i,
  3627.         n,
  3628.         r;
  3629.         if (e + t > this.length()) throw new Error('You are trying to read outside the source boundaries.');
  3630.         for (n = this.littleEndian ? 0 : - 8 * (t - 1), r = 0, i = 0; t > r; r++) i |= this.readByteAt(e + r) << Math.abs(n + 8 * r);
  3631.         return i
  3632.       },
  3633.       write: function (e, t, i) {
  3634.         var n,
  3635.         r;
  3636.         if (e > this.length()) throw new Error('You are trying to write outside the source boundaries.');
  3637.         for (n = this.littleEndian ? 0 : - 8 * (i - 1), r = 0; i > r; r++) this.writeByteAt(e + r, 255 & t >> Math.abs(n + 8 * r))
  3638.       },
  3639.       BYTE: function (e) {
  3640.         return this.read(e, 1)
  3641.       },
  3642.       SHORT: function (e) {
  3643.         return this.read(e, 2)
  3644.       },
  3645.       LONG: function (e) {
  3646.         return this.read(e, 4)
  3647.       },
  3648.       SLONG: function (e) {
  3649.         var t = this.read(e, 4);
  3650.         return t > 2147483647 ? t - 4294967296 : t
  3651.       },
  3652.       CHAR: function (e) {
  3653.         return String.fromCharCode(this.read(e, 1))
  3654.       },
  3655.       STRING: function (e, t) {
  3656.         return this.asArray('CHAR', e, t).join('')
  3657.       },
  3658.       asArray: function (e, t, i) {
  3659.         for (var n = [
  3660.         ], r = 0; i > r; r++) n[r] = this[e](t + r);
  3661.         return n
  3662.       }
  3663.     }),
  3664.     t
  3665.   }),
  3666.   n('moxie/runtime/html5/image/JPEGHeaders', [
  3667.     'moxie/runtime/html5/utils/BinaryReader',
  3668.     'moxie/core/Exceptions'
  3669.   ], function (e, t) {
  3670.     return function i(n) {
  3671.       var r,
  3672.       o,
  3673.       a,
  3674.       s = [
  3675.       ],
  3676.       u = 0;
  3677.       if (r = new e(n), 65496 !== r.SHORT(0)) throw r.clear(),
  3678.       new t.ImageError(t.ImageError.WRONG_FORMAT);
  3679.       for (o = 2; o <= r.length(); ) if (a = r.SHORT(o), a >= 65488 && 65495 >= a) o += 2;
  3680.        else {
  3681.         if (65498 === a || 65497 === a) break;
  3682.         u = r.SHORT(o + 2) + 2,
  3683.         a >= 65505 && 65519 >= a && s.push({
  3684.           hex: a,
  3685.           name: 'APP' + (15 & a),
  3686.           start: o,
  3687.           length: u,
  3688.           segment: r.SEGMENT(o, u)
  3689.         }),
  3690.         o += u
  3691.       }
  3692.       return r.clear(),
  3693.       {
  3694.         headers: s,
  3695.         restore: function (t) {
  3696.           var i,
  3697.           n,
  3698.           r;
  3699.           for (r = new e(t), o = 65504 == r.SHORT(2) ? 4 + r.SHORT(4)  : 2, n = 0, i = s.length; i > n; n++) r.SEGMENT(o, 0, s[n].segment),
  3700.           o += s[n].length;
  3701.           return t = r.SEGMENT(),
  3702.           r.clear(),
  3703.           t
  3704.         },
  3705.         strip: function (t) {
  3706.           var n,
  3707.           r,
  3708.           o,
  3709.           a;
  3710.           for (o = new i(t), r = o.headers, o.purge(), n = new e(t), a = r.length; a--; ) n.SEGMENT(r[a].start, r[a].length, '');
  3711.           return t = n.SEGMENT(),
  3712.           n.clear(),
  3713.           t
  3714.         },
  3715.         get: function (e) {
  3716.           for (var t = [
  3717.           ], i = 0, n = s.length; n > i; i++) s[i].name === e.toUpperCase() && t.push(s[i].segment);
  3718.           return t
  3719.         },
  3720.         set: function (e, t) {
  3721.           var i,
  3722.           n,
  3723.           r,
  3724.           o = [
  3725.           ];
  3726.           for ('string' == typeof t ? o.push(t)  : o = t, i = n = 0, r = s.length; r > i && (s[i].name === e.toUpperCase() && (s[i].segment = o[n], s[i].length = o[n].length, n++), !(n >= o.length)); i++);
  3727.         },
  3728.         purge: function () {
  3729.           this.headers = s = [
  3730.           ]
  3731.         }
  3732.       }
  3733.     }
  3734.   }),
  3735.   n('moxie/runtime/html5/image/ExifParser', [
  3736.     'moxie/core/utils/Basic',
  3737.     'moxie/runtime/html5/utils/BinaryReader',
  3738.     'moxie/core/Exceptions'
  3739.   ], function (e, i, n) {
  3740.     function r(o) {
  3741.       function a(i, r) {
  3742.         var o,
  3743.         a,
  3744.         s,
  3745.         u,
  3746.         c,
  3747.         m,
  3748.         h,
  3749.         f,
  3750.         p = this,
  3751.         g = [
  3752.         ],
  3753.         x = {
  3754.         },
  3755.         v = {
  3756.           1: 'BYTE',
  3757.           7: 'UNDEFINED',
  3758.           2: 'ASCII',
  3759.           3: 'SHORT',
  3760.           4: 'LONG',
  3761.           5: 'RATIONAL',
  3762.           9: 'SLONG',
  3763.           10: 'SRATIONAL'
  3764.         },
  3765.         w = {
  3766.           BYTE: 1,
  3767.           UNDEFINED: 1,
  3768.           ASCII: 1,
  3769.           SHORT: 2,
  3770.           LONG: 4,
  3771.           RATIONAL: 8,
  3772.           SLONG: 4,
  3773.           SRATIONAL: 8
  3774.         };
  3775.         for (o = p.SHORT(i), a = 0; o > a; a++) if (g = [
  3776.         ], h = i + 2 + 12 * a, s = r[p.SHORT(h)], s !== t) {
  3777.           if (u = v[p.SHORT(h += 2)], c = p.LONG(h += 2), m = w[u], !m) throw new n.ImageError(n.ImageError.INVALID_META_ERR);
  3778.           if (h += 4, m * c > 4 && (h = p.LONG(h) + d.tiffHeader), h + m * c >= this.length()) throw new n.ImageError(n.ImageError.INVALID_META_ERR);
  3779.           'ASCII' !== u ? (g = p.asArray(u, h, c), f = 1 == c ? g[0] : g, x[s] = l.hasOwnProperty(s) && 'object' != typeof f ? l[s][f] : f)  : x[s] = e.trim(p.STRING(h, c).replace(/\0$/, ''))
  3780.         }
  3781.         return x
  3782.       }
  3783.       function s(e, t, i) {
  3784.         var n,
  3785.         r,
  3786.         o,
  3787.         a = 0;
  3788.         if ('string' == typeof t) {
  3789.           var s = c[e.toLowerCase()];
  3790.           for (var u in s) if (s[u] === t) {
  3791.             t = u;
  3792.             break
  3793.           }
  3794.         }
  3795.         n = d[e.toLowerCase() + 'IFD'],
  3796.         r = this.SHORT(n);
  3797.         for (var l = 0; r > l; l++) if (o = n + 12 * l + 2, this.SHORT(o) == t) {
  3798.           a = o + 8;
  3799.           break
  3800.         }
  3801.         if (!a) return !1;
  3802.         try {
  3803.           this.write(a, i, 4)
  3804.         } catch (m) {
  3805.           return !1
  3806.         }
  3807.         return !0
  3808.       }
  3809.       var u,
  3810.       c,
  3811.       l,
  3812.       d,
  3813.       m,
  3814.       h;
  3815.       if (i.call(this, o), c = {
  3816.         tiff: {
  3817.           274: 'Orientation',
  3818.           270: 'ImageDescription',
  3819.           271: 'Make',
  3820.           272: 'Model',
  3821.           305: 'Software',
  3822.           34665: 'ExifIFDPointer',
  3823.           34853: 'GPSInfoIFDPointer'
  3824.         },
  3825.         exif: {
  3826.           36864: 'ExifVersion',
  3827.           40961: 'ColorSpace',
  3828.           40962: 'PixelXDimension',
  3829.           40963: 'PixelYDimension',
  3830.           36867: 'DateTimeOriginal',
  3831.           33434: 'ExposureTime',
  3832.           33437: 'FNumber',
  3833.           34855: 'ISOSpeedRatings',
  3834.           37377: 'ShutterSpeedValue',
  3835.           37378: 'ApertureValue',
  3836.           37383: 'MeteringMode',
  3837.           37384: 'LightSource',
  3838.           37385: 'Flash',
  3839.           37386: 'FocalLength',
  3840.           41986: 'ExposureMode',
  3841.           41987: 'WhiteBalance',
  3842.           41990: 'SceneCaptureType',
  3843.           41988: 'DigitalZoomRatio',
  3844.           41992: 'Contrast',
  3845.           41993: 'Saturation',
  3846.           41994: 'Sharpness'
  3847.         },
  3848.         gps: {
  3849.           0: 'GPSVersionID',
  3850.           1: 'GPSLatitudeRef',
  3851.           2: 'GPSLatitude',
  3852.           3: 'GPSLongitudeRef',
  3853.           4: 'GPSLongitude'
  3854.         },
  3855.         thumb: {
  3856.           513: 'JPEGInterchangeFormat',
  3857.           514: 'JPEGInterchangeFormatLength'
  3858.         }
  3859.       }, l = {
  3860.         ColorSpace: {
  3861.           1: 'sRGB',
  3862.           0: 'Uncalibrated'
  3863.         },
  3864.         MeteringMode: {
  3865.           0: 'Unknown',
  3866.           1: 'Average',
  3867.           2: 'CenterWeightedAverage',
  3868.           3: 'Spot',
  3869.           4: 'MultiSpot',
  3870.           5: 'Pattern',
  3871.           6: 'Partial',
  3872.           255: 'Other'
  3873.         },
  3874.         LightSource: {
  3875.           1: 'Daylight',
  3876.           2: 'Fliorescent',
  3877.           3: 'Tungsten',
  3878.           4: 'Flash',
  3879.           9: 'Fine weather',
  3880.           10: 'Cloudy weather',
  3881.           11: 'Shade',
  3882.           12: 'Daylight fluorescent (D 5700 - 7100K)',
  3883.           13: 'Day white fluorescent (N 4600 -5400K)',
  3884.           14: 'Cool white fluorescent (W 3900 - 4500K)',
  3885.           15: 'White fluorescent (WW 3200 - 3700K)',
  3886.           17: 'Standard light A',
  3887.           18: 'Standard light B',
  3888.           19: 'Standard light C',
  3889.           20: 'D55',
  3890.           21: 'D65',
  3891.           22: 'D75',
  3892.           23: 'D50',
  3893.           24: 'ISO studio tungsten',
  3894.           255: 'Other'
  3895.         },
  3896.         Flash: {
  3897.           0: 'Flash did not fire',
  3898.           1: 'Flash fired',
  3899.           5: 'Strobe return light not detected',
  3900.           7: 'Strobe return light detected',
  3901.           9: 'Flash fired, compulsory flash mode',
  3902.           13: 'Flash fired, compulsory flash mode, return light not detected',
  3903.           15: 'Flash fired, compulsory flash mode, return light detected',
  3904.           16: 'Flash did not fire, compulsory flash mode',
  3905.           24: 'Flash did not fire, auto mode',
  3906.           25: 'Flash fired, auto mode',
  3907.           29: 'Flash fired, auto mode, return light not detected',
  3908.           31: 'Flash fired, auto mode, return light detected',
  3909.           32: 'No flash function',
  3910.           65: 'Flash fired, red-eye reduction mode',
  3911.           69: 'Flash fired, red-eye reduction mode, return light not detected',
  3912.           71: 'Flash fired, red-eye reduction mode, return light detected',
  3913.           73: 'Flash fired, compulsory flash mode, red-eye reduction mode',
  3914.           77: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',
  3915.           79: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',
  3916.           89: 'Flash fired, auto mode, red-eye reduction mode',
  3917.           93: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',
  3918.           95: 'Flash fired, auto mode, return light detected, red-eye reduction mode'
  3919.         },
  3920.         ExposureMode: {
  3921.           0: 'Auto exposure',
  3922.           1: 'Manual exposure',
  3923.           2: 'Auto bracket'
  3924.         },
  3925.         WhiteBalance: {
  3926.           0: 'Auto white balance',
  3927.           1: 'Manual white balance'
  3928.         },
  3929.         SceneCaptureType: {
  3930.           0: 'Standard',
  3931.           1: 'Landscape',
  3932.           2: 'Portrait',
  3933.           3: 'Night scene'
  3934.         },
  3935.         Contrast: {
  3936.           0: 'Normal',
  3937.           1: 'Soft',
  3938.           2: 'Hard'
  3939.         },
  3940.         Saturation: {
  3941.           0: 'Normal',
  3942.           1: 'Low saturation',
  3943.           2: 'High saturation'
  3944.         },
  3945.         Sharpness: {
  3946.           0: 'Normal',
  3947.           1: 'Soft',
  3948.           2: 'Hard'
  3949.         },
  3950.         GPSLatitudeRef: {
  3951.           N: 'North latitude',
  3952.           S: 'South latitude'
  3953.         },
  3954.         GPSLongitudeRef: {
  3955.           E: 'East longitude',
  3956.           W: 'West longitude'
  3957.         }
  3958.       }, d = {
  3959.         tiffHeader: 10
  3960.       }, m = d.tiffHeader, u = {
  3961.         clear: this.clear
  3962.       }, e.extend(this, {
  3963.         read: function () {
  3964.           try {
  3965.             return r.prototype.read.apply(this, arguments)
  3966.           } catch (e) {
  3967.             throw new n.ImageError(n.ImageError.INVALID_META_ERR)
  3968.           }
  3969.         },
  3970.         write: function () {
  3971.           try {
  3972.             return r.prototype.write.apply(this, arguments)
  3973.           } catch (e) {
  3974.             throw new n.ImageError(n.ImageError.INVALID_META_ERR)
  3975.           }
  3976.         },
  3977.         UNDEFINED: function () {
  3978.           return this.BYTE.apply(this, arguments)
  3979.         },
  3980.         RATIONAL: function (e) {
  3981.           return this.LONG(e) / this.LONG(e + 4)
  3982.         },
  3983.         SRATIONAL: function (e) {
  3984.           return this.SLONG(e) / this.SLONG(e + 4)
  3985.         },
  3986.         ASCII: function (e) {
  3987.           return this.CHAR(e)
  3988.         },
  3989.         TIFF: function () {
  3990.           return h || null
  3991.         },
  3992.         EXIF: function () {
  3993.           var t = null;
  3994.           if (d.exifIFD) {
  3995.             try {
  3996.               t = a.call(this, d.exifIFD, c.exif)
  3997.             } catch (i) {
  3998.               return null
  3999.             }
  4000.             if (t.ExifVersion && 'array' === e.typeOf(t.ExifVersion)) {
  4001.               for (var n = 0, r = ''; n < t.ExifVersion.length; n++) r += String.fromCharCode(t.ExifVersion[n]);
  4002.               t.ExifVersion = r
  4003.             }
  4004.           }
  4005.           return t
  4006.         },
  4007.         GPS: function () {
  4008.           var t = null;
  4009.           if (d.gpsIFD) {
  4010.             try {
  4011.               t = a.call(this, d.gpsIFD, c.gps)
  4012.             } catch (i) {
  4013.               return null
  4014.             }
  4015.             t.GPSVersionID && 'array' === e.typeOf(t.GPSVersionID) && (t.GPSVersionID = t.GPSVersionID.join('.'))
  4016.           }
  4017.           return t
  4018.         },
  4019.         thumb: function () {
  4020.           if (d.IFD1) try {
  4021.             var e = a.call(this, d.IFD1, c.thumb);
  4022.             if ('JPEGInterchangeFormat' in e) return this.SEGMENT(d.tiffHeader + e.JPEGInterchangeFormat, e.JPEGInterchangeFormatLength)
  4023.           } catch (t) {
  4024.           }
  4025.           return null
  4026.         },
  4027.         setExif: function (e, t) {
  4028.           return 'PixelXDimension' !== e && 'PixelYDimension' !== e ? !1 : s.call(this, 'exif', e, t)
  4029.         },
  4030.         clear: function () {
  4031.           u.clear(),
  4032.           o = c = l = h = d = u = null
  4033.         }
  4034.       }), 65505 !== this.SHORT(0) || 'EXIF\0' !== this.STRING(4, 5).toUpperCase()) throw new n.ImageError(n.ImageError.INVALID_META_ERR);
  4035.       if (this.littleEndian = 18761 == this.SHORT(m), 42 !== this.SHORT(m += 2)) throw new n.ImageError(n.ImageError.INVALID_META_ERR);
  4036.       d.IFD0 = d.tiffHeader + this.LONG(m += 2),
  4037.       h = a.call(this, d.IFD0, c.tiff),
  4038.       'ExifIFDPointer' in h && (d.exifIFD = d.tiffHeader + h.ExifIFDPointer, delete h.ExifIFDPointer),
  4039.       'GPSInfoIFDPointer' in h && (d.gpsIFD = d.tiffHeader + h.GPSInfoIFDPointer, delete h.GPSInfoIFDPointer),
  4040.       e.isEmptyObj(h) && (h = null);
  4041.       var f = this.LONG(d.IFD0 + 12 * this.SHORT(d.IFD0) + 2);
  4042.       f && (d.IFD1 = d.tiffHeader + f)
  4043.     }
  4044.     return r.prototype = i.prototype,
  4045.     r
  4046.   }),
  4047.   n('moxie/runtime/html5/image/JPEG', [
  4048.     'moxie/core/utils/Basic',
  4049.     'moxie/core/Exceptions',
  4050.     'moxie/runtime/html5/image/JPEGHeaders',
  4051.     'moxie/runtime/html5/utils/BinaryReader',
  4052.     'moxie/runtime/html5/image/ExifParser'
  4053.   ], function (e, t, i, n, r) {
  4054.     function o(o) {
  4055.       function a(e) {
  4056.         var t,
  4057.         i,
  4058.         n = 0;
  4059.         for (e || (e = c); n <= e.length(); ) {
  4060.           if (t = e.SHORT(n += 2), t >= 65472 && 65475 >= t) return n += 5,
  4061.           {
  4062.             height: e.SHORT(n),
  4063.             width: e.SHORT(n += 2)
  4064.           };
  4065.           i = e.SHORT(n += 2),
  4066.           n += i - 2
  4067.         }
  4068.         return null
  4069.       }
  4070.       function s() {
  4071.         var e,
  4072.         t,
  4073.         i = d.thumb();
  4074.         return i && (e = new n(i), t = a(e), e.clear(), t) ? (t.data = i, t)  : null
  4075.       }
  4076.       function u() {
  4077.         d && l && c && (d.clear(), l.purge(), c.clear(), m = l = d = c = null)
  4078.       }
  4079.       var c,
  4080.       l,
  4081.       d,
  4082.       m;
  4083.       if (c = new n(o), 65496 !== c.SHORT(0)) throw new t.ImageError(t.ImageError.WRONG_FORMAT);
  4084.       l = new i(o);
  4085.       try {
  4086.         d = new r(l.get('app1') [0])
  4087.       } catch (h) {
  4088.       }
  4089.       m = a.call(this),
  4090.       e.extend(this, {
  4091.         type: 'image/jpeg',
  4092.         size: c.length(),
  4093.         width: m && m.width || 0,
  4094.         height: m && m.height || 0,
  4095.         setExif: function (t, i) {
  4096.           return d ? ('object' === e.typeOf(t) ? e.each(t, function (e, t) {
  4097.             d.setExif(t, e)
  4098.           })  : d.setExif(t, i), l.set('app1', d.SEGMENT()), void 0)  : !1
  4099.         },
  4100.         writeHeaders: function () {
  4101.           return arguments.length ? l.restore(arguments[0])  : l.restore(o)
  4102.         },
  4103.         stripHeaders: function (e) {
  4104.           return l.strip(e)
  4105.         },
  4106.         purge: function () {
  4107.           u.call(this)
  4108.         }
  4109.       }),
  4110.       d && (this.meta = {
  4111.         tiff: d.TIFF(),
  4112.         exif: d.EXIF(),
  4113.         gps: d.GPS(),
  4114.         thumb: s()
  4115.       })
  4116.     }
  4117.     return o
  4118.   }),
  4119.   n('moxie/runtime/html5/image/PNG', [
  4120.     'moxie/core/Exceptions',
  4121.     'moxie/core/utils/Basic',
  4122.     'moxie/runtime/html5/utils/BinaryReader'
  4123.   ], function (e, t, i) {
  4124.     function n(n) {
  4125.       function r() {
  4126.         var e,
  4127.         t;
  4128.         return e = a.call(this, 8),
  4129.         'IHDR' == e.type ? (t = e.start, {
  4130.           width: s.LONG(t),
  4131.           height: s.LONG(t += 4)
  4132.         })  : null
  4133.       }
  4134.       function o() {
  4135.         s && (s.clear(), n = l = u = c = s = null)
  4136.       }
  4137.       function a(e) {
  4138.         var t,
  4139.         i,
  4140.         n,
  4141.         r;
  4142.         return t = s.LONG(e),
  4143.         i = s.STRING(e += 4, 4),
  4144.         n = e += 4,
  4145.         r = s.LONG(e + t),
  4146.         {
  4147.           length: t,
  4148.           type: i,
  4149.           start: n,
  4150.           CRC: r
  4151.         }
  4152.       }
  4153.       var s,
  4154.       u,
  4155.       c,
  4156.       l;
  4157.       s = new i(n),
  4158.       function () {
  4159.         var t = 0,
  4160.         i = 0,
  4161.         n = [
  4162.           35152,
  4163.           20039,
  4164.           3338,
  4165.           6666
  4166.         ];
  4167.         for (i = 0; i < n.length; i++, t += 2) if (n[i] != s.SHORT(t)) throw new e.ImageError(e.ImageError.WRONG_FORMAT)
  4168.       }(),
  4169.       l = r.call(this),
  4170.       t.extend(this, {
  4171.         type: 'image/png',
  4172.         size: s.length(),
  4173.         width: l.width,
  4174.         height: l.height,
  4175.         purge: function () {
  4176.           o.call(this)
  4177.         }
  4178.       }),
  4179.       o.call(this)
  4180.     }
  4181.     return n
  4182.   }),
  4183.   n('moxie/runtime/html5/image/ImageInfo', [
  4184.     'moxie/core/utils/Basic',
  4185.     'moxie/core/Exceptions',
  4186.     'moxie/runtime/html5/image/JPEG',
  4187.     'moxie/runtime/html5/image/PNG'
  4188.   ], function (e, t, i, n) {
  4189.     return function (r) {
  4190.       var o,
  4191.       a = [
  4192.         i,
  4193.         n
  4194.       ];
  4195.       o = function () {
  4196.         for (var e = 0; e < a.length; e++) try {
  4197.           return new a[e](r)
  4198.         } catch (i) {
  4199.         }
  4200.         throw new t.ImageError(t.ImageError.WRONG_FORMAT)
  4201.       }(),
  4202.       e.extend(this, {
  4203.         type: '',
  4204.         size: 0,
  4205.         width: 0,
  4206.         height: 0,
  4207.         setExif: function () {
  4208.         },
  4209.         writeHeaders: function (e) {
  4210.           return e
  4211.         },
  4212.         stripHeaders: function (e) {
  4213.           return e
  4214.         },
  4215.         purge: function () {
  4216.           r = null
  4217.         }
  4218.       }),
  4219.       e.extend(this, o),
  4220.       this.purge = function () {
  4221.         o.purge(),
  4222.         o = null
  4223.       }
  4224.     }
  4225.   }),
  4226.   n('moxie/runtime/html5/image/ResizerCanvas', [
  4227.   ], function () {
  4228.     function e(i, n) {
  4229.       var r = i.width,
  4230.       o = Math.floor(r * n),
  4231.       a = !1;
  4232.       (0.5 > n || n > 2) && (n = 0.5 > n ? 0.5 : 2, a = !0);
  4233.       var s = t(i, n);
  4234.       return a ? e(s, o / s.width)  : s
  4235.     }
  4236.     function t(e, t) {
  4237.       var i = e.width,
  4238.       n = e.height,
  4239.       r = Math.floor(i * t),
  4240.       o = Math.floor(n * t),
  4241.       a = document.createElement('canvas');
  4242.       return a.width = r,
  4243.       a.height = o,
  4244.       a.getContext('2d').drawImage(e, 0, 0, i, n, 0, 0, r, o),
  4245.       e = null,
  4246.       a
  4247.     }
  4248.     return {
  4249.       scale: e
  4250.     }
  4251.   }),
  4252.   n('moxie/runtime/html5/image/Image', [
  4253.     'moxie/runtime/html5/Runtime',
  4254.     'moxie/core/utils/Basic',
  4255.     'moxie/core/Exceptions',
  4256.     'moxie/core/utils/Encode',
  4257.     'moxie/file/Blob',
  4258.     'moxie/file/File',
  4259.     'moxie/runtime/html5/image/ImageInfo',
  4260.     'moxie/runtime/html5/image/ResizerCanvas',
  4261.     'moxie/core/utils/Mime',
  4262.     'moxie/core/utils/Env'
  4263.   ], function (e, t, i, n, r, o, a, s, u) {
  4264.     function c() {
  4265.       function e() {
  4266.         if (!v && !g) throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);
  4267.         return v || g
  4268.       }
  4269.       function c() {
  4270.         var t = e();
  4271.         return 'canvas' == t.nodeName.toLowerCase() ? t : (v = document.createElement('canvas'), v.width = t.width, v.height = t.height, v.getContext('2d').drawImage(t, 0, 0), v)
  4272.       }
  4273.       function l(e) {
  4274.         return n.atob(e.substring(e.indexOf('base64,') + 7))
  4275.       }
  4276.       function d(e, t) {
  4277.         return 'data:' + (t || '') + ';base64,' + n.btoa(e)
  4278.       }
  4279.       function m(e) {
  4280.         var t = this;
  4281.         alert('image');
  4282.         g = new Image,
  4283.         g.onerror = function () {
  4284.           p.call(this),
  4285.           t.trigger('error', i.ImageError.WRONG_FORMAT)
  4286.         },
  4287.         g.onload = function () {
  4288.           t.trigger('load')
  4289.         },
  4290.         g.src = 'data:' == e.substr(0, 5) ? e : d(e, y.type)
  4291.       }
  4292.       function h(e, t) {
  4293.         var n,
  4294.         r = this;
  4295.         return window.FileReader ? (n = new FileReader, n.onload = function () {
  4296.           t.call(r, this.result)
  4297.         }, n.onerror = function () {
  4298.           r.trigger('error', i.ImageError.WRONG_FORMAT)
  4299.         }, n.readAsDataURL(e), void 0)  : t.call(this, e.getAsDataURL())
  4300.       }
  4301.       function f(e, i) {
  4302.         var n = Math.PI / 180,
  4303.         r = document.createElement('canvas'),
  4304.         o = r.getContext('2d'),
  4305.         a = e.width,
  4306.         s = e.height;
  4307.         switch (t.inArray(i, [
  4308.             5,
  4309.             6,
  4310.             7,
  4311.             8
  4312.           ]) > - 1 ? (r.width = s, r.height = a)  : (r.width = a, r.height = s), i) {
  4313.           case 2:
  4314.             o.translate(a, 0),
  4315.             o.scale( - 1, 1);
  4316.             break;
  4317.           case 3:
  4318.             o.translate(a, s),
  4319.             o.rotate(180 * n);
  4320.             break;
  4321.           case 4:
  4322.             o.translate(0, s),
  4323.             o.scale(1, - 1);
  4324.             break;
  4325.           case 5:
  4326.             o.rotate(90 * n),
  4327.             o.scale(1, - 1);
  4328.             break;
  4329.           case 6:
  4330.             o.rotate(90 * n),
  4331.             o.translate(0, - s);
  4332.             break;
  4333.           case 7:
  4334.             o.rotate(90 * n),
  4335.             o.translate(a, - s),
  4336.             o.scale( - 1, 1);
  4337.             break;
  4338.           case 8:
  4339.             o.rotate( - 90 * n),
  4340.             o.translate( - a, 0)
  4341.         }
  4342.         return o.drawImage(e, 0, 0, a, s),
  4343.         r
  4344.       }
  4345.       function p() {
  4346.         x && (x.purge(), x = null),
  4347.         w = g = v = y = null,
  4348.         b = !1
  4349.       }
  4350.       var g,
  4351.       x,
  4352.       v,
  4353.       w,
  4354.       y,
  4355.       E = this,
  4356.       b = !1,
  4357.       R = !0;
  4358.       t.extend(this, {
  4359.         loadFromBlob: function (e) {
  4360.           var t = this.getRuntime(),
  4361.           n = arguments.length > 1 ? arguments[1] : !0;
  4362.           if (!t.can('access_binary')) throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);
  4363.           return y = e,
  4364.           e.isDetached() ? (w = e.getSource(), m.call(this, w), void 0)  : (h.call(this, e.getSource(), function (e) {
  4365.             n && (w = l(e)),
  4366.             m.call(this, e)
  4367.           }), void 0)
  4368.         },
  4369.         loadFromImage: function (e, t) {
  4370.           this.meta = e.meta,
  4371.           y = new o(null, {
  4372.             name: e.name,
  4373.             size: e.size,
  4374.             type: e.type
  4375.           }),
  4376.           m.call(this, t ? w = e.getAsBinaryString()  : e.getAsDataURL())
  4377.         },
  4378.         getInfo: function () {
  4379.           var t,
  4380.           i = this.getRuntime();
  4381.           return !x && w && i.can('access_image_binary') && (x = new a(w)),
  4382.           t = {
  4383.             width: e().width || 0,
  4384.             height: e().height || 0,
  4385.             type: y.type || u.getFileMime(y.name),
  4386.             size: w && w.length || y.size || 0,
  4387.             name: y.name || '',
  4388.             meta: null
  4389.           },
  4390.           R && (t.meta = x && x.meta || this.meta || {
  4391.           }, !t.meta || !t.meta.thumb || t.meta.thumb.data instanceof r || (t.meta.thumb.data = new r(null, {
  4392.             type: 'image/jpeg',
  4393.             data: t.meta.thumb.data
  4394.           }))),
  4395.           t
  4396.         },
  4397.         resize: function (t, i, n) {
  4398.           var r = document.createElement('canvas');
  4399.           if (r.width = t.width, r.height = t.height, r.getContext('2d').drawImage(e(), t.x, t.y, t.width, t.height, 0, 0, r.width, r.height), v = s.scale(r, i), R = n.preserveHeaders, !R) {
  4400.             var o = this.meta && this.meta.tiff && this.meta.tiff.Orientation || 1;
  4401.             v = f(v, o)
  4402.           }
  4403.           this.width = v.width,
  4404.           this.height = v.height,
  4405.           b = !0,
  4406.           this.trigger('Resize')
  4407.         },
  4408.         getAsCanvas: function () {
  4409.           return v || (v = c()),
  4410.           v.id = this.uid + '_canvas',
  4411.           v
  4412.         },
  4413.         getAsBlob: function (e, t) {
  4414.           return e !== this.type ? (b = !0, new o(null, {
  4415.             name: y.name || '',
  4416.             type: e,
  4417.             data: E.getAsDataURL(e, t)
  4418.           }))  : new o(null, {
  4419.             name: y.name || '',
  4420.             type: e,
  4421.             data: E.getAsBinaryString(e, t)
  4422.           })
  4423.         },
  4424.         getAsDataURL: function (e) {
  4425.           var t = arguments[1] || 90;
  4426.           if (!b) return g.src;
  4427.           if (c(), 'image/jpeg' !== e) return v.toDataURL('image/png');
  4428.           try {
  4429.             return v.toDataURL('image/jpeg', t / 100)
  4430.           } catch (i) {
  4431.             return v.toDataURL('image/jpeg')
  4432.           }
  4433.         },
  4434.         getAsBinaryString: function (e, t) {
  4435.           if (!b) return w || (w = l(E.getAsDataURL(e, t))),
  4436.           w;
  4437.           if ('image/jpeg' !== e) w = l(E.getAsDataURL(e, t));
  4438.            else {
  4439.             var i;
  4440.             t || (t = 90),
  4441.             c();
  4442.             try {
  4443.               i = v.toDataURL('image/jpeg', t / 100)
  4444.             } catch (n) {
  4445.               i = v.toDataURL('image/jpeg')
  4446.             }
  4447.             w = l(i),
  4448.             x && (w = x.stripHeaders(w), R && (x.meta && x.meta.exif && x.setExif({
  4449.               PixelXDimension: this.width,
  4450.               PixelYDimension: this.height
  4451.             }), w = x.writeHeaders(w)), x.purge(), x = null)
  4452.           }
  4453.           return b = !1,
  4454.           w
  4455.         },
  4456.         destroy: function () {
  4457.           E = null,
  4458.           p.call(this),
  4459.           this.getRuntime().getShim().removeInstance(this.uid)
  4460.         }
  4461.       })
  4462.     }
  4463.     return e.Image = c
  4464.   }), n('moxie/runtime/flash/Runtime', [
  4465.     'moxie/core/utils/Basic',
  4466.     'moxie/core/utils/Env',
  4467.     'moxie/core/utils/Dom',
  4468.     'moxie/core/Exceptions',
  4469.     'moxie/runtime/Runtime'
  4470.   ], function (e, t, i, n, o) {
  4471.     function a() {
  4472.       var e;
  4473.       try {
  4474.         e = navigator.plugins['Shockwave Flash'],
  4475.         e = e.description
  4476.       } catch (t) {
  4477.         try {
  4478.           e = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version')
  4479.         } catch (i) {
  4480.           e = '0.0'
  4481.         }
  4482.       }
  4483.       return e = e.match(/\d+/g),
  4484.       parseFloat(e[0] + '.' + e[1])
  4485.     }
  4486.     function s(e) {
  4487.       var n = i.get(e);
  4488.       n && 'OBJECT' == n.nodeName && ('IE' === t.browser ? (n.style.display = 'none', function r() {
  4489.         4 == n.readyState ? u(e)  : setTimeout(r, 10)
  4490.       }())  : n.parentNode.removeChild(n))
  4491.     }
  4492.     function u(e) {
  4493.       var t = i.get(e);
  4494.       if (t) {
  4495.         for (var n in t) 'function' == typeof t[n] && (t[n] = null);
  4496.         t.parentNode.removeChild(t)
  4497.       }
  4498.     }
  4499.     function c(u) {
  4500.       var c,
  4501.       m = this;
  4502.       u = e.extend({
  4503.         swf_url: t.swf_url
  4504.       }, u),
  4505.       o.call(this, u, l, {
  4506.         access_binary: function (e) {
  4507.           return e && 'browser' === m.mode
  4508.         },
  4509.         access_image_binary: function (e) {
  4510.           return e && 'browser' === m.mode
  4511.         },
  4512.         display_media: o.capTest(r('moxie/image/Image')),
  4513.         do_cors: o.capTrue,
  4514.         drag_and_drop: !1,
  4515.         report_upload_progress: function () {
  4516.           return 'client' === m.mode
  4517.         },
  4518.         resize_image: o.capTrue,
  4519.         return_response_headers: !1,
  4520.         return_response_type: function (t) {
  4521.           return 'json' === t && window.JSON ? !0 : !e.arrayDiff(t, [
  4522.             '',
  4523.             'text',
  4524.             'document'
  4525.           ]) || 'browser' === m.mode
  4526.         },
  4527.         return_status_code: function (t) {
  4528.           return 'browser' === m.mode || !e.arrayDiff(t, [
  4529.             200,
  4530.             404
  4531.           ])
  4532.         },
  4533.         select_file: o.capTrue,
  4534.         select_multiple: o.capTrue,
  4535.         send_binary_string: function (e) {
  4536.           return e && 'browser' === m.mode
  4537.         },
  4538.         send_browser_cookies: function (e) {
  4539.           return e && 'browser' === m.mode
  4540.         },
  4541.         send_custom_headers: function (e) {
  4542.           return e && 'browser' === m.mode
  4543.         },
  4544.         send_multipart: o.capTrue,
  4545.         slice_blob: function (e) {
  4546.           return e && 'browser' === m.mode
  4547.         },
  4548.         stream_upload: function (e) {
  4549.           return e && 'browser' === m.mode
  4550.         },
  4551.         summon_file_dialog: !1,
  4552.         upload_filesize: function (t) {
  4553.           return e.parseSizeStr(t) <= 2097152 || 'client' === m.mode
  4554.         },
  4555.         use_http_method: function (t) {
  4556.           return !e.arrayDiff(t, [
  4557.             'GET',
  4558.             'POST'
  4559.           ])
  4560.         }
  4561.       }, {
  4562.         access_binary: function (e) {
  4563.           return e ? 'browser' : 'client'
  4564.         },
  4565.         access_image_binary: function (e) {
  4566.           return e ? 'browser' : 'client'
  4567.         },
  4568.         report_upload_progress: function (e) {
  4569.           return e ? 'browser' : 'client'
  4570.         },
  4571.         return_response_type: function (t) {
  4572.           return e.arrayDiff(t, [
  4573.             '',
  4574.             'text',
  4575.             'json',
  4576.             'document'
  4577.           ]) ? 'browser' : [
  4578.             'client',
  4579.             'browser'
  4580.           ]
  4581.         },
  4582.         return_status_code: function (t) {
  4583.           return e.arrayDiff(t, [
  4584.             200,
  4585.             404
  4586.           ]) ? 'browser' : [
  4587.             'client',
  4588.             'browser'
  4589.           ]
  4590.         },
  4591.         send_binary_string: function (e) {
  4592.           return e ? 'browser' : 'client'
  4593.         },
  4594.         send_browser_cookies: function (e) {
  4595.           return e ? 'browser' : 'client'
  4596.         },
  4597.         send_custom_headers: function (e) {
  4598.           return e ? 'browser' : 'client'
  4599.         },
  4600.         slice_blob: function (e) {
  4601.           return e ? 'browser' : 'client'
  4602.         },
  4603.         stream_upload: function (e) {
  4604.           return e ? 'client' : 'browser'
  4605.         },
  4606.         upload_filesize: function (t) {
  4607.           return e.parseSizeStr(t) >= 2097152 ? 'client' : 'browser'
  4608.         }
  4609.       }, 'client'),
  4610.       a() < 11.3 && (this.mode = !1),
  4611.       e.extend(this, {
  4612.         getShim: function () {
  4613.           return i.get(this.uid)
  4614.         },
  4615.         shimExec: function (e, t) {
  4616.           var i = [
  4617.           ].slice.call(arguments, 2);
  4618.           return m.getShim().exec(this.uid, e, t, i)
  4619.         },
  4620.         init: function () {
  4621.           var i,
  4622.           r,
  4623.           o;
  4624.           o = this.getShimContainer(),
  4625.           e.extend(o.style, {
  4626.             position: 'absolute',
  4627.             top: '-8px',
  4628.             left: '-8px',
  4629.             width: '9px',
  4630.             height: '9px',
  4631.             overflow: 'hidden'
  4632.           }),
  4633.           i = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + u.swf_url + '" ',
  4634.           'IE' === t.browser && (i += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),
  4635.           i += 'width="100%" height="100%" style="outline:0"><param name="movie" value="' + u.swf_url + '" />' + '<param name="flashvars" value="uid=' + escape(this.uid) + '&target=' + t.global_event_dispatcher + '" />' + '<param name="wmode" value="transparent" />' + '<param name="allowscriptaccess" value="always" />' + '</object>',
  4636.           'IE' === t.browser ? (r = document.createElement('div'), o.appendChild(r), r.outerHTML = i, r = o = null)  : o.innerHTML = i,
  4637.           c = setTimeout(function () {
  4638.             m && !m.initialized && m.trigger('Error', new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))
  4639.           }, 5000)
  4640.         },
  4641.         destroy: function (e) {
  4642.           return function () {
  4643.             s(m.uid),
  4644.             e.call(m),
  4645.             clearTimeout(c),
  4646.             u = c = e = m = null
  4647.           }
  4648.         }(this.destroy)
  4649.       }, d)
  4650.     }
  4651.     var l = 'flash',
  4652.     d = {
  4653.     };
  4654.     return o.addConstructor(l, c),
  4655.     d
  4656.   }), n('moxie/runtime/flash/file/Blob', [
  4657.     'moxie/runtime/flash/Runtime',
  4658.     'moxie/file/Blob'
  4659.   ], function (e, t) {
  4660.     var i = {
  4661.       slice: function (e, i, n, r) {
  4662.         var o = this.getRuntime();
  4663.         return 0 > i ? i = Math.max(e.size + i, 0)  : i > 0 && (i = Math.min(i, e.size)),
  4664.         0 > n ? n = Math.max(e.size + n, 0)  : n > 0 && (n = Math.min(n, e.size)),
  4665.         e = o.shimExec.call(this, 'Blob', 'slice', i, n, r || ''),
  4666.         e && (e = new t(o.uid, e)),
  4667.         e
  4668.       }
  4669.     };
  4670.     return e.Blob = i
  4671.   }), n('moxie/runtime/flash/file/FileInput', [
  4672.     'moxie/runtime/flash/Runtime',
  4673.     'moxie/file/File',
  4674.     'moxie/core/utils/Basic'
  4675.   ], function (e, t, i) {
  4676.     var n = {
  4677.       init: function (e) {
  4678.         var n = this,
  4679.         r = this.getRuntime();
  4680.         this.bind('Change', function () {
  4681.           var e = r.shimExec.call(n, 'FileInput', 'getFiles');
  4682.           n.files = [
  4683.           ],
  4684.           i.each(e, function (e) {
  4685.             n.files.push(new t(r.uid, e))
  4686.           })
  4687.         }, 999),
  4688.         this.getRuntime().shimExec.call(this, 'FileInput', 'init', {
  4689.           accept: e.accept,
  4690.           multiple: e.multiple
  4691.         }),
  4692.         this.trigger('ready')
  4693.       }
  4694.     };
  4695.     return e.FileInput = n
  4696.   }), n('moxie/runtime/flash/file/FileReader', [
  4697.     'moxie/runtime/flash/Runtime',
  4698.     'moxie/core/utils/Encode'
  4699.   ], function (e, t) {
  4700.     function i(e, i) {
  4701.       switch (i) {
  4702.         case 'readAsText':
  4703.           return t.atob(e, 'utf8');
  4704.         case 'readAsBinaryString':
  4705.           return t.atob(e);
  4706.         case 'readAsDataURL':
  4707.           return e
  4708.       }
  4709.       return null
  4710.     }
  4711.     var n = {
  4712.       read: function (e, t) {
  4713.         var n = this;
  4714.         return n.result = '',
  4715.         'readAsDataURL' === e && (n.result = 'data:' + (t.type || '') + ';base64,'),
  4716.         n.bind('Progress', function (t, r) {
  4717.           r && (n.result += i(r, e))
  4718.         }, 999),
  4719.         n.getRuntime().shimExec.call(this, 'FileReader', 'readAsBase64', t.uid)
  4720.       }
  4721.     };
  4722.     return e.FileReader = n
  4723.   }), n('moxie/runtime/flash/file/FileReaderSync', [
  4724.     'moxie/runtime/flash/Runtime',
  4725.     'moxie/core/utils/Encode'
  4726.   ], function (e, t) {
  4727.     function i(e, i) {
  4728.       switch (i) {
  4729.         case 'readAsText':
  4730.           return t.atob(e, 'utf8');
  4731.         case 'readAsBinaryString':
  4732.           return t.atob(e);
  4733.         case 'readAsDataURL':
  4734.           return e
  4735.       }
  4736.       return null
  4737.     }
  4738.     var n = {
  4739.       read: function (e, t) {
  4740.         var n,
  4741.         r = this.getRuntime();
  4742.         return (n = r.shimExec.call(this, 'FileReaderSync', 'readAsBase64', t.uid)) ? ('readAsDataURL' === e && (n = 'data:' + (t.type || '') + ';base64,' + n), i(n, e, t.type))  : null
  4743.       }
  4744.     };
  4745.     return e.FileReaderSync = n
  4746.   }), n('moxie/runtime/flash/runtime/Transporter', [
  4747.     'moxie/runtime/flash/Runtime',
  4748.     'moxie/file/Blob'
  4749.   ], function (e, t) {
  4750.     var i = {
  4751.       getAsBlob: function (e) {
  4752.         var i = this.getRuntime(),
  4753.         n = i.shimExec.call(this, 'Transporter', 'getAsBlob', e);
  4754.         return n ? new t(i.uid, n)  : null
  4755.       }
  4756.     };
  4757.     return e.Transporter = i
  4758.   }), n('moxie/runtime/flash/xhr/XMLHttpRequest', [
  4759.     'moxie/runtime/flash/Runtime',
  4760.     'moxie/core/utils/Basic',
  4761.     'moxie/file/Blob',
  4762.     'moxie/file/File',
  4763.     'moxie/file/FileReaderSync',
  4764.     'moxie/runtime/flash/file/FileReaderSync',
  4765.     'moxie/xhr/FormData',
  4766.     'moxie/runtime/Transporter',
  4767.     'moxie/runtime/flash/runtime/Transporter'
  4768.   ], function (e, t, i, n, r, o, a, s) {
  4769.     var u = {
  4770.       send: function (e, n) {
  4771.         function r() {
  4772.           e.transport = l.mode,
  4773.           l.shimExec.call(c, 'XMLHttpRequest', 'send', e, n)
  4774.         }
  4775.         function o(e, t) {
  4776.           l.shimExec.call(c, 'XMLHttpRequest', 'appendBlob', e, t.uid),
  4777.           n = null,
  4778.           r()
  4779.         }
  4780.         function u(e, t) {
  4781.           var i = new s;
  4782.           i.bind('TransportingComplete', function () {
  4783.             t(this.result)
  4784.           }),
  4785.           i.transport(e.getSource(), e.type, {
  4786.             ruid: l.uid
  4787.           })
  4788.         }
  4789.         var c = this,
  4790.         l = c.getRuntime();
  4791.         if (t.isEmptyObj(e.headers) || t.each(e.headers, function (e, t) {
  4792.           l.shimExec.call(c, 'XMLHttpRequest', 'setRequestHeader', t, e.toString())
  4793.         }), n instanceof a) {
  4794.           var d;
  4795.           if (n.each(function (e, t) {
  4796.             e instanceof i ? d = t : l.shimExec.call(c, 'XMLHttpRequest', 'append', t, e)
  4797.           }), n.hasBlob()) {
  4798.             var m = n.getBlob();
  4799.             m.isDetached() ? u(m, function (e) {
  4800.               m.destroy(),
  4801.               o(d, e)
  4802.             })  : o(d, m)
  4803.           } else n = null,
  4804.           r()
  4805.         } else n instanceof i ? n.isDetached() ? u(n, function (e) {
  4806.           n.destroy(),
  4807.           n = e.uid,
  4808.           r()
  4809.         })  : (n = n.uid, r())  : r()
  4810.       },
  4811.       getResponse: function (e) {
  4812.         var i,
  4813.         o,
  4814.         a = this.getRuntime();
  4815.         if (o = a.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob')) {
  4816.           if (o = new n(a.uid, o), 'blob' === e) return o;
  4817.           try {
  4818.             if (i = new r, ~t.inArray(e, [
  4819.               '',
  4820.               'text'
  4821.             ])) return i.readAsText(o);
  4822.             if ('json' === e && window.JSON) return JSON.parse(i.readAsText(o))
  4823.           } finally {
  4824.             o.destroy()
  4825.           }
  4826.         }
  4827.         return null
  4828.       },
  4829.       abort: function () {
  4830.         var e = this.getRuntime();
  4831.         e.shimExec.call(this, 'XMLHttpRequest', 'abort'),
  4832.         this.dispatchEvent('readystatechange'),
  4833.         this.dispatchEvent('abort')
  4834.       }
  4835.     };
  4836.     return e.XMLHttpRequest = u
  4837.   }), n('moxie/runtime/flash/image/Image', [
  4838.     'moxie/runtime/flash/Runtime',
  4839.     'moxie/core/utils/Basic',
  4840.     'moxie/runtime/Transporter',
  4841.     'moxie/file/Blob',
  4842.     'moxie/file/FileReaderSync'
  4843.   ], function (e, t, i, n, r) {
  4844.     var o = {
  4845.       loadFromBlob: function (e) {
  4846.         function t(e) {
  4847.           r.shimExec.call(n, 'Image', 'loadFromBlob', e.uid),
  4848.           n = r = null
  4849.         }
  4850.         var n = this,
  4851.         r = n.getRuntime();
  4852.         if (e.isDetached()) {
  4853.           var o = new i;
  4854.           o.bind('TransportingComplete', function () {
  4855.             t(o.result.getSource())
  4856.           }),
  4857.           o.transport(e.getSource(), e.type, {
  4858.             ruid: r.uid
  4859.           })
  4860.         } else t(e.getSource())
  4861.       },
  4862.       loadFromImage: function (e) {
  4863.         var t = this.getRuntime();
  4864.         return t.shimExec.call(this, 'Image', 'loadFromImage', e.uid)
  4865.       },
  4866.       getInfo: function () {
  4867.         var e = this.getRuntime(),
  4868.         t = e.shimExec.call(this, 'Image', 'getInfo');
  4869.         return t.meta && t.meta.thumb && t.meta.thumb.data && !(e.meta.thumb.data instanceof n) && (t.meta.thumb.data = new n(e.uid, t.meta.thumb.data)),
  4870.         t
  4871.       },
  4872.       getAsBlob: function (e, t) {
  4873.         var i = this.getRuntime(),
  4874.         r = i.shimExec.call(this, 'Image', 'getAsBlob', e, t);
  4875.         return r ? new n(i.uid, r)  : null
  4876.       },
  4877.       getAsDataURL: function () {
  4878.         var e,
  4879.         t = this.getRuntime(),
  4880.         i = t.Image.getAsBlob.apply(this, arguments);
  4881.         return i ? (e = new r, e.readAsDataURL(i))  : null
  4882.       }
  4883.     };
  4884.     return e.Image = o
  4885.   }), n('moxie/runtime/silverlight/Runtime', [
  4886.     'moxie/core/utils/Basic',
  4887.     'moxie/core/utils/Env',
  4888.     'moxie/core/utils/Dom',
  4889.     'moxie/core/Exceptions',
  4890.     'moxie/runtime/Runtime'
  4891.   ], function (e, t, i, n, o) {
  4892.     function a(e) {
  4893.       var t,
  4894.       i,
  4895.       n,
  4896.       r,
  4897.       o,
  4898.       a = !1,
  4899.       s = null,
  4900.       u = 0;
  4901.       try {
  4902.         try {
  4903.           s = new ActiveXObject('AgControl.AgControl'),
  4904.           s.IsVersionSupported(e) && (a = !0),
  4905.           s = null
  4906.         } catch (c) {
  4907.           var l = navigator.plugins['Silverlight Plug-In'];
  4908.           if (l) {
  4909.             for (t = l.description, '1.0.30226.2' === t && (t = '2.0.30226.2'), i = t.split('.'); i.length > 3; ) i.pop();
  4910.             for (; i.length < 4; ) i.push(0);
  4911.             for (n = e.split('.'); n.length > 4; ) n.pop();
  4912.             do r = parseInt(n[u], 10),
  4913.             o = parseInt(i[u], 10),
  4914.             u++;
  4915.             while (u < n.length && r === o);
  4916.             o >= r && !isNaN(r) && (a = !0)
  4917.           }
  4918.         }
  4919.       } catch (d) {
  4920.         a = !1
  4921.       }
  4922.       return a
  4923.     }
  4924.     function s(s) {
  4925.       var l,
  4926.       d = this;
  4927.       s = e.extend({
  4928.         xap_url: t.xap_url
  4929.       }, s),
  4930.       o.call(this, s, u, {
  4931.         access_binary: o.capTrue,
  4932.         access_image_binary: o.capTrue,
  4933.         display_media: o.capTest(r('moxie/image/Image')),
  4934.         do_cors: o.capTrue,
  4935.         drag_and_drop: !1,
  4936.         report_upload_progress: o.capTrue,
  4937.         resize_image: o.capTrue,
  4938.         return_response_headers: function (e) {
  4939.           return e && 'client' === d.mode
  4940.         },
  4941.         return_response_type: function (e) {
  4942.           return 'json' !== e ? !0 : !!window.JSON
  4943.         },
  4944.         return_status_code: function (t) {
  4945.           return 'client' === d.mode || !e.arrayDiff(t, [
  4946.             200,
  4947.             404
  4948.           ])
  4949.         },
  4950.         select_file: o.capTrue,
  4951.         select_multiple: o.capTrue,
  4952.         send_binary_string: o.capTrue,
  4953.         send_browser_cookies: function (e) {
  4954.           return e && 'browser' === d.mode
  4955.         },
  4956.         send_custom_headers: function (e) {
  4957.           return e && 'client' === d.mode
  4958.         },
  4959.         send_multipart: o.capTrue,
  4960.         slice_blob: o.capTrue,
  4961.         stream_upload: !0,
  4962.         summon_file_dialog: !1,
  4963.         upload_filesize: o.capTrue,
  4964.         use_http_method: function (t) {
  4965.           return 'client' === d.mode || !e.arrayDiff(t, [
  4966.             'GET',
  4967.             'POST'
  4968.           ])
  4969.         }
  4970.       }, {
  4971.         return_response_headers: function (e) {
  4972.           return e ? 'client' : 'browser'
  4973.         },
  4974.         return_status_code: function (t) {
  4975.           return e.arrayDiff(t, [
  4976.             200,
  4977.             404
  4978.           ]) ? 'client' : [
  4979.             'client',
  4980.             'browser'
  4981.           ]
  4982.         },
  4983.         send_browser_cookies: function (e) {
  4984.           return e ? 'browser' : 'client'
  4985.         },
  4986.         send_custom_headers: function (e) {
  4987.           return e ? 'client' : 'browser'
  4988.         },
  4989.         use_http_method: function (t) {
  4990.           return e.arrayDiff(t, [
  4991.             'GET',
  4992.             'POST'
  4993.           ]) ? 'client' : [
  4994.             'client',
  4995.             'browser'
  4996.           ]
  4997.         }
  4998.       }),
  4999.       a('2.0.31005.0') && 'Opera' !== t.browser || (this.mode = !1),
  5000.       e.extend(this, {
  5001.         getShim: function () {
  5002.           return i.get(this.uid).content.Moxie
  5003.         },
  5004.         shimExec: function (e, t) {
  5005.           var i = [
  5006.           ].slice.call(arguments, 2);
  5007.           return d.getShim().exec(this.uid, e, t, i)
  5008.         },
  5009.         init: function () {
  5010.           var e;
  5011.           e = this.getShimContainer(),
  5012.           e.innerHTML = '<object id="' + this.uid + '" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">' + '<param name="source" value="' + s.xap_url + '"/>' + '<param name="background" value="Transparent"/>' + '<param name="windowless" value="true"/>' + '<param name="enablehtmlaccess" value="true"/>' + '<param name="initParams" value="uid=' + this.uid + ',target=' + t.global_event_dispatcher + '"/>' + '</object>',
  5013.           l = setTimeout(function () {
  5014.             d && !d.initialized && d.trigger('Error', new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))
  5015.           }, 'Windows' !== t.OS ? 10000 : 5000)
  5016.         },
  5017.         destroy: function (e) {
  5018.           return function () {
  5019.             e.call(d),
  5020.             clearTimeout(l),
  5021.             s = l = e = d = null
  5022.           }
  5023.         }(this.destroy)
  5024.       }, c)
  5025.     }
  5026.     var u = 'silverlight',
  5027.     c = {
  5028.     };
  5029.     return o.addConstructor(u, s),
  5030.     c
  5031.   }), n('moxie/runtime/silverlight/file/Blob', [
  5032.     'moxie/runtime/silverlight/Runtime',
  5033.     'moxie/core/utils/Basic',
  5034.     'moxie/runtime/flash/file/Blob'
  5035.   ], function (e, t, i) {
  5036.     return e.Blob = t.extend({
  5037.     }, i)
  5038.   }), n('moxie/runtime/silverlight/file/FileInput', [
  5039.     'moxie/runtime/silverlight/Runtime',
  5040.     'moxie/file/File',
  5041.     'moxie/core/utils/Basic'
  5042.   ], function (e, t, i) {
  5043.     function n(e) {
  5044.       for (var t = '', i = 0; i < e.length; i++) t += ('' !== t ? '|' : '') + e[i].title + ' | *.' + e[i].extensions.replace(/,/g, ';*.');
  5045.       return t
  5046.     }
  5047.     var r = {
  5048.       init: function (e) {
  5049.         var r = this,
  5050.         o = this.getRuntime();
  5051.         this.bind('Change', function () {
  5052.           var e = o.shimExec.call(r, 'FileInput', 'getFiles');
  5053.           r.files = [
  5054.           ],
  5055.           i.each(e, function (e) {
  5056.             r.files.push(new t(o.uid, e))
  5057.           })
  5058.         }, 999),
  5059.         o.shimExec.call(this, 'FileInput', 'init', n(e.accept), e.multiple),
  5060.         this.trigger('ready')
  5061.       },
  5062.       setOption: function (e, t) {
  5063.         'accept' == e && (t = n(t)),
  5064.         this.getRuntime().shimExec.call(this, 'FileInput', 'setOption', e, t)
  5065.       }
  5066.     };
  5067.     return e.FileInput = r
  5068.   }), n('moxie/runtime/silverlight/file/FileDrop', [
  5069.     'moxie/runtime/silverlight/Runtime',
  5070.     'moxie/core/utils/Dom',
  5071.     'moxie/core/utils/Events'
  5072.   ], function (e, t, i) {
  5073.     var n = {
  5074.       init: function () {
  5075.         var e,
  5076.         n = this,
  5077.         r = n.getRuntime();
  5078.         return e = r.getShimContainer(),
  5079.         i.addEvent(e, 'dragover', function (e) {
  5080.           e.preventDefault(),
  5081.           e.stopPropagation(),
  5082.           e.dataTransfer.dropEffect = 'copy'
  5083.         }, n.uid),
  5084.         i.addEvent(e, 'dragenter', function (e) {
  5085.           e.preventDefault();
  5086.           var i = t.get(r.uid).dragEnter(e);
  5087.           i && e.stopPropagation()
  5088.         }, n.uid),
  5089.         i.addEvent(e, 'drop', function (e) {
  5090.           e.preventDefault();
  5091.           var i = t.get(r.uid).dragDrop(e);
  5092.           i && e.stopPropagation()
  5093.         }, n.uid),
  5094.         r.shimExec.call(this, 'FileDrop', 'init')
  5095.       }
  5096.     };
  5097.     return e.FileDrop = n
  5098.   }), n('moxie/runtime/silverlight/file/FileReader', [
  5099.     'moxie/runtime/silverlight/Runtime',
  5100.     'moxie/core/utils/Basic',
  5101.     'moxie/runtime/flash/file/FileReader'
  5102.   ], function (e, t, i) {
  5103.     return e.FileReader = t.extend({
  5104.     }, i)
  5105.   }), n('moxie/runtime/silverlight/file/FileReaderSync', [
  5106.     'moxie/runtime/silverlight/Runtime',
  5107.     'moxie/core/utils/Basic',
  5108.     'moxie/runtime/flash/file/FileReaderSync'
  5109.   ], function (e, t, i) {
  5110.     return e.FileReaderSync = t.extend({
  5111.     }, i)
  5112.   }), n('moxie/runtime/silverlight/runtime/Transporter', [
  5113.     'moxie/runtime/silverlight/Runtime',
  5114.     'moxie/core/utils/Basic',
  5115.     'moxie/runtime/flash/runtime/Transporter'
  5116.   ], function (e, t, i) {
  5117.     return e.Transporter = t.extend({
  5118.     }, i)
  5119.   }), n('moxie/runtime/silverlight/xhr/XMLHttpRequest', [
  5120.     'moxie/runtime/silverlight/Runtime',
  5121.     'moxie/core/utils/Basic',
  5122.     'moxie/runtime/flash/xhr/XMLHttpRequest',
  5123.     'moxie/runtime/silverlight/file/FileReaderSync',
  5124.     'moxie/runtime/silverlight/runtime/Transporter'
  5125.   ], function (e, t, i) {
  5126.     return e.XMLHttpRequest = t.extend({
  5127.     }, i)
  5128.   }), n('moxie/runtime/silverlight/image/Image', [
  5129.     'moxie/runtime/silverlight/Runtime',
  5130.     'moxie/core/utils/Basic',
  5131.     'moxie/file/Blob',
  5132.     'moxie/runtime/flash/image/Image'
  5133.   ], function (e, t, i, n) {
  5134.     return e.Image = t.extend({
  5135.     }, n, {
  5136.       getInfo: function () {
  5137.         var e = this.getRuntime(),
  5138.         n = [
  5139.           'tiff',
  5140.           'exif',
  5141.           'gps',
  5142.           'thumb'
  5143.         ],
  5144.         r = {
  5145.           meta: {
  5146.           }
  5147.         },
  5148.         o = e.shimExec.call(this, 'Image', 'getInfo');
  5149.         return o.meta && (t.each(n, function (e) {
  5150.           var t,
  5151.           i,
  5152.           n,
  5153.           a,
  5154.           s = o.meta[e];
  5155.           if (s && s.keys) for (r.meta[e] = {
  5156.           }, i = 0, n = s.keys.length; n > i; i++) t = s.keys[i],
  5157.           a = s[t],
  5158.           a && (/^(\d|[1-9]\d+)$/.test(a) ? a = parseInt(a, 10)  : /^\d*\.\d+$/.test(a) && (a = parseFloat(a)), r.meta[e][t] = a)
  5159.         }), r.meta && r.meta.thumb && r.meta.thumb.data && !(e.meta.thumb.data instanceof i) && (r.meta.thumb.data = new i(e.uid, r.meta.thumb.data))),
  5160.         r.width = parseInt(o.width, 10),
  5161.         r.height = parseInt(o.height, 10),
  5162.         r.size = parseInt(o.size, 10),
  5163.         r.type = o.type,
  5164.         r.name = o.name,
  5165.         r
  5166.       },
  5167.       resize: function (e, t, i) {
  5168.         this.getRuntime().shimExec.call(this, 'Image', 'resize', e.x, e.y, e.width, e.height, t, i.preserveHeaders, i.resample)
  5169.       }
  5170.     })
  5171.   }), n('moxie/runtime/html4/Runtime', [
  5172.     'moxie/core/utils/Basic',
  5173.     'moxie/core/Exceptions',
  5174.     'moxie/runtime/Runtime',
  5175.     'moxie/core/utils/Env'
  5176.   ], function (e, t, i, n) {
  5177.     function o(t) {
  5178.       var o = this,
  5179.       u = i.capTest,
  5180.       c = i.capTrue;
  5181.       i.call(this, t, a, {
  5182.         access_binary: u(window.FileReader || window.File && File.getAsDataURL),
  5183.         access_image_binary: !1,
  5184.         display_media: u((n.can('create_canvas') || n.can('use_data_uri_over32kb')) && r('moxie/image/Image')),
  5185.         do_cors: !1,
  5186.         drag_and_drop: !1,
  5187.         filter_by_extension: u(function () {
  5188.           return !('Chrome' === n.browser && n.verComp(n.version, 28, '<') || 'IE' === n.browser && n.verComp(n.version, 10, '<') || 'Safari' === n.browser && n.verComp(n.version, 7, '<') || 'Firefox' === n.browser && n.verComp(n.version, 37, '<'))
  5189.         }()),
  5190.         resize_image: function () {
  5191.           return s.Image && o.can('access_binary') && n.can('create_canvas')
  5192.         },
  5193.         report_upload_progress: !1,
  5194.         return_response_headers: !1,
  5195.         return_response_type: function (t) {
  5196.           return 'json' === t && window.JSON ? !0 : !!~e.inArray(t, [
  5197.             'text',
  5198.             'document',
  5199.             ''
  5200.           ])
  5201.         },
  5202.         return_status_code: function (t) {
  5203.           return !e.arrayDiff(t, [
  5204.             200,
  5205.             404
  5206.           ])
  5207.         },
  5208.         select_file: function () {
  5209.           return n.can('use_fileinput')
  5210.         },
  5211.         select_multiple: !1,
  5212.         send_binary_string: !1,
  5213.         send_custom_headers: !1,
  5214.         send_multipart: !0,
  5215.         slice_blob: !1,
  5216.         stream_upload: function () {
  5217.           return o.can('select_file')
  5218.         },
  5219.         summon_file_dialog: function () {
  5220.           return o.can('select_file') && ('Firefox' === n.browser && n.verComp(n.version, 4, '>=') || 'Opera' === n.browser && n.verComp(n.version, 12, '>=') || 'IE' === n.browser && n.verComp(n.version, 10, '>=') || !!~e.inArray(n.browser, [
  5221.             'Chrome',
  5222.             'Safari'
  5223.           ]))
  5224.         },
  5225.         upload_filesize: c,
  5226.         use_http_method: function (t) {
  5227.           return !e.arrayDiff(t, [
  5228.             'GET',
  5229.             'POST'
  5230.           ])
  5231.         }
  5232.       }),
  5233.       e.extend(this, {
  5234.         init: function () {
  5235.           this.trigger('Init')
  5236.         },
  5237.         destroy: function (e) {
  5238.           return function () {
  5239.             e.call(o),
  5240.             e = o = null
  5241.           }
  5242.         }(this.destroy)
  5243.       }),
  5244.       e.extend(this.getShim(), s)
  5245.     }
  5246.     var a = 'html4',
  5247.     s = {
  5248.     };
  5249.     return i.addConstructor(a, o),
  5250.     s
  5251.   }), n('moxie/runtime/html4/file/FileInput', [
  5252.     'moxie/runtime/html4/Runtime',
  5253.     'moxie/file/File',
  5254.     'moxie/core/utils/Basic',
  5255.     'moxie/core/utils/Dom',
  5256.     'moxie/core/utils/Events',
  5257.     'moxie/core/utils/Mime',
  5258.     'moxie/core/utils/Env'
  5259.   ], function (e, t, i, n, r, o, a) {
  5260.     function s() {
  5261.       function e() {
  5262.         var o,
  5263.         c,
  5264.         d,
  5265.         m,
  5266.         h,
  5267.         f,
  5268.         p = this,
  5269.         g = p.getRuntime();
  5270.         f = i.guid('uid_'),
  5271.         o = g.getShimContainer(),
  5272.         s && (d = n.get(s + '_form'), d && i.extend(d.style, {
  5273.           top: '100%'
  5274.         })),
  5275.         m = document.createElement('form'),
  5276.         m.setAttribute('id', f + '_form'),
  5277.         m.setAttribute('method', 'post'),
  5278.         m.setAttribute('enctype', 'multipart/form-data'),
  5279.         m.setAttribute('encoding', 'multipart/form-data'),
  5280.         i.extend(m.style, {
  5281.           overflow: 'hidden',
  5282.           position: 'absolute',
  5283.           top: 0,
  5284.           left: 0,
  5285.           width: '100%',
  5286.           height: '100%'
  5287.         }),
  5288.         h = document.createElement('input'),
  5289.         h.setAttribute('id', f),
  5290.         h.setAttribute('type', 'file'),
  5291.         h.setAttribute('accept', l.join(',')),
  5292.         i.extend(h.style, {
  5293.           fontSize: '999px',
  5294.           opacity: 0
  5295.         }),
  5296.         m.appendChild(h),
  5297.         o.appendChild(m),
  5298.         i.extend(h.style, {
  5299.           position: 'absolute',
  5300.           top: 0,
  5301.           left: 0,
  5302.           width: '100%',
  5303.           height: '100%'
  5304.         }),
  5305.         'IE' === a.browser && a.verComp(a.version, 10, '<') && i.extend(h.style, {
  5306.           filter: 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
  5307.         }),
  5308.         h.onchange = function () {
  5309.           var i;
  5310.           if (this.value) {
  5311.             if (this.files) {
  5312.               if (i = this.files[0], 0 === i.size) return m.parentNode.removeChild(m),
  5313.               void 0
  5314.             } else i = {
  5315.               name: this.value
  5316.             };
  5317.             i = new t(g.uid, i),
  5318.             this.onchange = function () {
  5319.             },
  5320.             e.call(p),
  5321.             p.files = [
  5322.               i
  5323.             ],
  5324.             h.setAttribute('id', i.uid),
  5325.             m.setAttribute('id', i.uid + '_form'),
  5326.             p.trigger('change'),
  5327.             h = m = null
  5328.           }
  5329.         },
  5330.         g.can('summon_file_dialog') && (c = n.get(u.browse_button), r.removeEvent(c, 'click', p.uid), r.addEvent(c, 'click', function (e) {
  5331.           h && !h.disabled && h.click(),
  5332.           e.preventDefault()
  5333.         }, p.uid)),
  5334.         s = f,
  5335.         o = d = c = null
  5336.       }
  5337.       var s,
  5338.       u,
  5339.       c,
  5340.       l = [
  5341.       ];
  5342.       i.extend(this, {
  5343.         init: function (t) {
  5344.           var i,
  5345.           a = this,
  5346.           s = a.getRuntime();
  5347.           u = t,
  5348.           l = t.accept.mimes || o.extList2mimes(t.accept, s.can('filter_by_extension')),
  5349.           i = s.getShimContainer(),
  5350.           function () {
  5351.             var e,
  5352.             o,
  5353.             l;
  5354.             e = n.get(t.browse_button),
  5355.             c = n.getStyle(e, 'z-index') || 'auto',
  5356.             s.can('summon_file_dialog') && ('static' === n.getStyle(e, 'position') && (e.style.position = 'relative'), a.bind('Refresh', function () {
  5357.               o = parseInt(c, 10) || 1,
  5358.               n.get(u.browse_button).style.zIndex = o,
  5359.               this.getRuntime().getShimContainer().style.zIndex = o - 1
  5360.             })),
  5361.             l = s.can('summon_file_dialog') ? e : i,
  5362.             r.addEvent(l, 'mouseover', function () {
  5363.               a.trigger('mouseenter')
  5364.             }, a.uid),
  5365.             r.addEvent(l, 'mouseout', function () {
  5366.               a.trigger('mouseleave')
  5367.             }, a.uid),
  5368.             r.addEvent(l, 'mousedown', function () {
  5369.               a.trigger('mousedown')
  5370.             }, a.uid),
  5371.             r.addEvent(n.get(t.container), 'mouseup', function () {
  5372.               a.trigger('mouseup')
  5373.             }, a.uid),
  5374.             e = null
  5375.           }(),
  5376.           e.call(this),
  5377.           i = null,
  5378.           a.trigger({
  5379.             type: 'ready',
  5380.             async: !0
  5381.           })
  5382.         },
  5383.         setOption: function (e, t) {
  5384.           var i,
  5385.           r = this.getRuntime();
  5386.           'accept' == e && (l = t.mimes || o.extList2mimes(t, r.can('filter_by_extension'))),
  5387.           i = n.get(s),
  5388.           i && i.setAttribute('accept', l.join(','))
  5389.         },
  5390.         disable: function (e) {
  5391.           var t;
  5392.           (t = n.get(s)) && (t.disabled = !!e)
  5393.         },
  5394.         destroy: function () {
  5395.           var e = this.getRuntime(),
  5396.           t = e.getShim(),
  5397.           i = e.getShimContainer(),
  5398.           o = u && n.get(u.container),
  5399.           a = u && n.get(u.browse_button);
  5400.           o && r.removeAllEvents(o, this.uid),
  5401.           a && (r.removeAllEvents(a, this.uid), a.style.zIndex = c),
  5402.           i && (r.removeAllEvents(i, this.uid), i.innerHTML = ''),
  5403.           t.removeInstance(this.uid),
  5404.           s = l = u = i = o = a = t = null
  5405.         }
  5406.       })
  5407.     }
  5408.     return e.FileInput = s
  5409.   }), n('moxie/runtime/html4/file/FileReader', [
  5410.     'moxie/runtime/html4/Runtime',
  5411.     'moxie/runtime/html5/file/FileReader'
  5412.   ], function (e, t) {
  5413.     return e.FileReader = t
  5414.   }), n('moxie/runtime/html4/xhr/XMLHttpRequest', [
  5415.     'moxie/runtime/html4/Runtime',
  5416.     'moxie/core/utils/Basic',
  5417.     'moxie/core/utils/Dom',
  5418.     'moxie/core/utils/Url',
  5419.     'moxie/core/Exceptions',
  5420.     'moxie/core/utils/Events',
  5421.     'moxie/file/Blob',
  5422.     'moxie/xhr/FormData'
  5423.   ], function (e, t, i, n, r, o, a, s) {
  5424.     function u() {
  5425.       function e(e) {
  5426.         var t,
  5427.         n,
  5428.         r,
  5429.         a,
  5430.         s = this,
  5431.         u = !1;
  5432.         if (l) {
  5433.           if (t = l.id.replace(/_iframe$/, ''), n = i.get(t + '_form')) {
  5434.             for (r = n.getElementsByTagName('input'), a = r.length; a--; ) switch (r[a].getAttribute('type')) {
  5435.               case 'hidden':
  5436.                 r[a].parentNode.removeChild(r[a]);
  5437.                 break;
  5438.               case 'file':
  5439.                 u = !0
  5440.             }
  5441.             r = [
  5442.             ],
  5443.             u || n.parentNode.removeChild(n),
  5444.             n = null
  5445.           }
  5446.           setTimeout(function () {
  5447.             o.removeEvent(l, 'load', s.uid),
  5448.             l.parentNode && l.parentNode.removeChild(l);
  5449.             var t = s.getRuntime().getShimContainer();
  5450.             t.children.length || t.parentNode.removeChild(t),
  5451.             t = l = null,
  5452.             e()
  5453.           }, 1)
  5454.         }
  5455.       }
  5456.       var u,
  5457.       c,
  5458.       l;
  5459.       t.extend(this, {
  5460.         send: function (d, m) {
  5461.           function h() {
  5462.             var i = w.getShimContainer() || document.body,
  5463.             r = document.createElement('div');
  5464.             r.innerHTML = '<iframe id="' + f + '_iframe" name="' + f + '_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',
  5465.             l = r.firstChild,
  5466.             i.appendChild(l),
  5467.             o.addEvent(l, 'load', function () {
  5468.               var i;
  5469.               try {
  5470.                 i = l.contentWindow.document || l.contentDocument || window.frames[l.id].document,
  5471.                 /^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title) ? u = i.title.replace(/^(\d+).*$/, '$1')  : (u = 200, c = t.trim(i.body.innerHTML), v.trigger({
  5472.                   type: 'progress',
  5473.                   loaded: c.length,
  5474.                   total: c.length
  5475.                 }), x && v.trigger({
  5476.                   type: 'uploadprogress',
  5477.                   loaded: x.size || 1025,
  5478.                   total: x.size || 1025
  5479.                 }))
  5480.               } catch (r) {
  5481.                 if (!n.hasSameOrigin(d.url)) return e.call(v, function () {
  5482.                   v.trigger('error')
  5483.                 }),
  5484.                 void 0;
  5485.                 u = 404
  5486.               }
  5487.               e.call(v, function () {
  5488.                 v.trigger('load')
  5489.               })
  5490.             }, v.uid)
  5491.           }
  5492.           var f,
  5493.           p,
  5494.           g,
  5495.           x,
  5496.           v = this,
  5497.           w = v.getRuntime();
  5498.           if (u = c = null, m instanceof s && m.hasBlob()) {
  5499.             if (x = m.getBlob(), f = x.uid, g = i.get(f), p = i.get(f + '_form'), !p) throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)
  5500.           } else f = t.guid('uid_'),
  5501.           p = document.createElement('form'),
  5502.           p.setAttribute('id', f + '_form'),
  5503.           p.setAttribute('method', d.method),
  5504.           p.setAttribute('enctype', 'multipart/form-data'),
  5505.           p.setAttribute('encoding', 'multipart/form-data'),
  5506.           w.getShimContainer().appendChild(p);
  5507.           p.setAttribute('target', f + '_iframe'),
  5508.           m instanceof s && m.each(function (e, i) {
  5509.             if (e instanceof a) g && g.setAttribute('name', i);
  5510.              else {
  5511.               var n = document.createElement('input');
  5512.               t.extend(n, {
  5513.                 type: 'hidden',
  5514.                 name: i,
  5515.                 value: e
  5516.               }),
  5517.               g ? p.insertBefore(n, g)  : p.appendChild(n)
  5518.             }
  5519.           }),
  5520.           p.setAttribute('action', d.url),
  5521.           h(),
  5522.           p.submit(),
  5523.           v.trigger('loadstart')
  5524.         },
  5525.         getStatus: function () {
  5526.           return u
  5527.         },
  5528.         getResponse: function (e) {
  5529.           if ('json' === e && 'string' === t.typeOf(c) && window.JSON) try {
  5530.             return JSON.parse(c.replace(/^\s*<pre[^>]*>/, '').replace(/<\/pre>\s*$/, ''))
  5531.           } catch (i) {
  5532.             return null
  5533.           }
  5534.           return c
  5535.         },
  5536.         abort: function () {
  5537.           var t = this;
  5538.           l && l.contentWindow && (l.contentWindow.stop ? l.contentWindow.stop()  : l.contentWindow.document.execCommand ? l.contentWindow.document.execCommand('Stop')  : l.src = 'about:blank'),
  5539.           e.call(this, function () {
  5540.             t.dispatchEvent('abort')
  5541.           })
  5542.         }
  5543.       })
  5544.     }
  5545.     return e.XMLHttpRequest = u
  5546.   }), n('moxie/runtime/html4/image/Image', [
  5547.     'moxie/runtime/html4/Runtime',
  5548.     'moxie/runtime/html5/image/Image'
  5549.   ], function (e, t) {
  5550.     return e.Image = t
  5551.   }), a(['moxie/core/utils/Basic',
  5552.   'moxie/core/utils/Encode',
  5553.   'moxie/core/utils/Env',
  5554.   'moxie/core/Exceptions',
  5555.   'moxie/core/utils/Dom',
  5556.   'moxie/core/EventTarget',
  5557.   'moxie/runtime/Runtime',
  5558.   'moxie/runtime/RuntimeClient',
  5559.   'moxie/file/Blob',
  5560.   'moxie/core/I18n',
  5561.   'moxie/core/utils/Mime',
  5562.   'moxie/file/FileInput',
  5563.   'moxie/file/File',
  5564.   'moxie/file/FileDrop',
  5565.   'moxie/file/FileReader',
  5566.   'moxie/core/utils/Url',
  5567.   'moxie/runtime/RuntimeTarget',
  5568.   'moxie/xhr/FormData',
  5569.   'moxie/xhr/XMLHttpRequest',
  5570.   'moxie/runtime/Transporter',
  5571.   'moxie/image/Image',
  5572.   'moxie/core/utils/Events',
  5573.   'moxie/runtime/html5/image/ResizerCanvas'])
  5574. }(this)
  5575. });/**
  5576.  * Plupload - multi-runtime File Uploader
  5577.  * v2.3.1
  5578.  *
  5579.  * Copyright 2013, Moxiecode Systems AB
  5580.  * Released under GPL License.
  5581.  *
  5582.  * License: http://www.plupload.com/license
  5583.  * Contributing: http://www.plupload.com/contributing
  5584.  *
  5585.  * Date: 2017-02-06
  5586.  */
  5587. !function (e, t) {
  5588. var i = function () {
  5589.   var e = {
  5590.   };
  5591.   return t.apply(e, arguments),
  5592.   e.plupload
  5593. };
  5594. 'function' == typeof define && define.amd ? define('plupload', [
  5595.   './moxie'
  5596. ], i)  : 'object' == typeof module && module.exports ? module.exports = i(require('./moxie'))  : e.plupload = i(e.moxie)
  5597. }(this || window, function (e) {
  5598. !function (e, t, i) {
  5599.   function n(e) {
  5600.     function t(e, t, i) {
  5601.       var r = {
  5602.         chunks: 'slice_blob',
  5603.         jpgresize: 'send_binary_string',
  5604.         pngresize: 'send_binary_string',
  5605.         progress: 'report_upload_progress',
  5606.         multi_selection: 'select_multiple',
  5607.         dragdrop: 'drag_and_drop',
  5608.         drop_element: 'drag_and_drop',
  5609.         headers: 'send_custom_headers',
  5610.         urlstream_upload: 'send_binary_string',
  5611.         canSendBinary: 'send_binary',
  5612.         triggerDialog: 'summon_file_dialog'
  5613.       };
  5614.       r[e] ? n[r[e]] = t : i || (n[e] = t)
  5615.     }
  5616.     var i = e.required_features,
  5617.     n = {
  5618.     };
  5619.     return 'string' == typeof i ? l.each(i.split(/\s*,\s*/), function (e) {
  5620.       t(e, !0)
  5621.     })  : 'object' == typeof i ? l.each(i, function (e, i) {
  5622.       t(i, e)
  5623.     })  : i === !0 && (e.chunk_size && e.chunk_size > 0 && (n.slice_blob = !0), l.isEmptyObj(e.resize) && e.multipart !== !1 || (n.send_binary_string = !0), e.http_method && (n.use_http_method = e.http_method), l.each(e, function (e, i) {
  5624.       t(i, !!e, !0)
  5625.     })),
  5626.     n
  5627.   }
  5628.   var r = window.setTimeout,
  5629.   s = {
  5630.   },
  5631.   a = t.core.utils,
  5632.   o = t.runtime.Runtime,
  5633.   l = {
  5634.     VERSION: '2.3.1',
  5635.     STOPPED: 1,
  5636.     STARTED: 2,
  5637.     QUEUED: 1,
  5638.     UPLOADING: 2,
  5639.     FAILED: 4,
  5640.     DONE: 5,
  5641.     GENERIC_ERROR: - 100,
  5642.     HTTP_ERROR: - 200,
  5643.     IO_ERROR: - 300,
  5644.     SECURITY_ERROR: - 400,
  5645.     INIT_ERROR: - 500,
  5646.     FILE_SIZE_ERROR: - 600,
  5647.     FILE_EXTENSION_ERROR: - 601,
  5648.     FILE_DUPLICATE_ERROR: - 602,
  5649.     IMAGE_FORMAT_ERROR: - 700,
  5650.     MEMORY_ERROR: - 701,
  5651.     IMAGE_DIMENSIONS_ERROR: - 702,
  5652.     mimeTypes: a.Mime.mimes,
  5653.     ua: a.Env,
  5654.     typeOf: a.Basic.typeOf,
  5655.     extend: a.Basic.extend,
  5656.     guid: a.Basic.guid,
  5657.     getAll: function (e) {
  5658.       var t,
  5659.       i = [
  5660.       ];
  5661.       'array' !== l.typeOf(e) && (e = [
  5662.         e
  5663.       ]);
  5664.       for (var n = e.length; n--; ) t = l.get(e[n]),
  5665.       t && i.push(t);
  5666.       return i.length ? i : null
  5667.     },
  5668.     get: a.Dom.get,
  5669.     each: a.Basic.each,
  5670.     getPos: a.Dom.getPos,
  5671.     getSize: a.Dom.getSize,
  5672.     xmlEncode: function (e) {
  5673.       var t = {
  5674.         '<': 'lt',
  5675.         '>': 'gt',
  5676.         '&': 'amp',
  5677.         '"': 'quot',
  5678.         '\'': '#39'
  5679.       },
  5680.       i = /[<>&\"\']/g;
  5681.       return e ? ('' + e).replace(i, function (e) {
  5682.         return t[e] ? '&' + t[e] + ';' : e
  5683.       })  : e
  5684.     },
  5685.     toArray: a.Basic.toArray,
  5686.     inArray: a.Basic.inArray,
  5687.     inSeries: a.Basic.inSeries,
  5688.     addI18n: t.core.I18n.addI18n,
  5689.     translate: t.core.I18n.translate,
  5690.     sprintf: a.Basic.sprintf,
  5691.     isEmptyObj: a.Basic.isEmptyObj,
  5692.     hasClass: a.Dom.hasClass,
  5693.     addClass: a.Dom.addClass,
  5694.     removeClass: a.Dom.removeClass,
  5695.     getStyle: a.Dom.getStyle,
  5696.     addEvent: a.Events.addEvent,
  5697.     removeEvent: a.Events.removeEvent,
  5698.     removeAllEvents: a.Events.removeAllEvents,
  5699.     cleanName: function (e) {
  5700.       var t,
  5701.       i;
  5702.       for (i = [
  5703.         /[\300-\306]/g,
  5704.         'A',
  5705.         /[\340-\346]/g,
  5706.         'a',
  5707.         /\307/g,
  5708.         'C',
  5709.         /\347/g,
  5710.         'c',
  5711.         /[\310-\313]/g,
  5712.         'E',
  5713.         /[\350-\353]/g,
  5714.         'e',
  5715.         /[\314-\317]/g,
  5716.         'I',
  5717.         /[\354-\357]/g,
  5718.         'i',
  5719.         /\321/g,
  5720.         'N',
  5721.         /\361/g,
  5722.         'n',
  5723.         /[\322-\330]/g,
  5724.         'O',
  5725.         /[\362-\370]/g,
  5726.         'o',
  5727.         /[\331-\334]/g,
  5728.         'U',
  5729.         /[\371-\374]/g,
  5730.         'u'
  5731.       ], t = 0; t < i.length; t += 2) e = e.replace(i[t], i[t + 1]);
  5732.       return e = e.replace(/\s+/g, '_'),
  5733.       e = e.replace(/[^a-z0-9_\-\.]+/gi, '')
  5734.     },
  5735.     buildUrl: function (e, t) {
  5736.       var i = '';
  5737.       return l.each(t, function (e, t) {
  5738.         i += (i ? '&' : '') + encodeURIComponent(t) + '=' + encodeURIComponent(e)
  5739.       }),
  5740.       i && (e += (e.indexOf('?') > 0 ? '&' : '?') + i),
  5741.       e
  5742.     },
  5743.     formatSize: function (e) {
  5744.       function t(e, t) {
  5745.         return Math.round(e * Math.pow(10, t)) / Math.pow(10, t)
  5746.       }
  5747.       if (e === i || /\D/.test(e)) return l.translate('N/A');
  5748.       var n = Math.pow(1024, 4);
  5749.       return e > n ? t(e / n, 1) + ' ' + l.translate('tb')  : e > (n /= 1024) ? t(e / n, 1) + ' ' + l.translate('gb')  : e > (n /= 1024) ? t(e / n, 1) + ' ' + l.translate('mb')  : e > 1024 ? Math.round(e / 1024) + ' ' + l.translate('kb')  : e + ' ' + l.translate('b')
  5750.     },
  5751.     parseSize: a.Basic.parseSizeStr,
  5752.     predictRuntime: function (e, t) {
  5753.       var i,
  5754.       n;
  5755.       return i = new l.Uploader(e),
  5756.       n = o.thatCan(i.getOption().required_features, t || e.runtimes),
  5757.       i.destroy(),
  5758.       n
  5759.     },
  5760.     addFileFilter: function (e, t) {
  5761.       s[e] = t
  5762.     }
  5763.   };
  5764.   l.addFileFilter('mime_types', function (e, t, i) {
  5765.     e.length && !e.regexp.test(t.name) ? (this.trigger('Error', {
  5766.       code: l.FILE_EXTENSION_ERROR,
  5767.       message: l.translate('File extension error.'),
  5768.       file: t
  5769.     }), i(!1))  : i(!0)
  5770.   }),
  5771.   l.addFileFilter('max_file_size', function (e, t, i) {
  5772.     var n;
  5773.     e = l.parseSize(e),
  5774.     t.size !== n && e && t.size > e ? (this.trigger('Error', {
  5775.       code: l.FILE_SIZE_ERROR,
  5776.       message: l.translate('File size error.'),
  5777.       file: t
  5778.     }), i(!1))  : i(!0)
  5779.   }),
  5780.   l.addFileFilter('prevent_duplicates', function (e, t, i) {
  5781.     if (e) for (var n = this.files.length; n--; ) if (t.name === this.files[n].name && t.size === this.files[n].size) return this.trigger('Error', {
  5782.       code: l.FILE_DUPLICATE_ERROR,
  5783.       message: l.translate('Duplicate file error.'),
  5784.       file: t
  5785.     }),
  5786.     i(!1),
  5787.     void 0;
  5788.     i(!0)
  5789.   }),
  5790.   l.Uploader = function (e) {
  5791.     function a() {
  5792.       var e,
  5793.       t,
  5794.       i = 0;
  5795.       if (this.state == l.STARTED) {
  5796.         for (t = 0; t < x.length; t++) e || x[t].status != l.QUEUED ? i++ : (e = x[t], this.trigger('BeforeUpload', e) && (e.status = l.UPLOADING, this.trigger('UploadFile', e)));
  5797.         i == x.length && (this.state !== l.STOPPED && (this.state = l.STOPPED, this.trigger('StateChanged')), this.trigger('UploadComplete', x))
  5798.       }
  5799.     }
  5800.     function u(e) {
  5801.       e.percent = e.size > 0 ? Math.ceil(100 * (e.loaded / e.size))  : 100,
  5802.       d()
  5803.     }
  5804.     function d() {
  5805.       var e,
  5806.       t,
  5807.       n,
  5808.       r = 0;
  5809.       for (w.reset(), e = 0; e < x.length; e++) t = x[e],
  5810.       t.size !== i ? (w.size += t.origSize, n = t.loaded * t.origSize / t.size, (!t.completeTimestamp || t.completeTimestamp > I) && (r += n), w.loaded += n)  : w.size = i,
  5811.       t.status == l.DONE ? w.uploaded++ : t.status == l.FAILED ? w.failed++ : w.queued++;
  5812.       w.size === i ? w.percent = x.length > 0 ? Math.ceil(100 * (w.uploaded / x.length))  : 0 : (w.bytesPerSec = Math.ceil(r / (( + new Date - I || 1) / 1000)), w.percent = w.size > 0 ? Math.ceil(100 * (w.loaded / w.size))  : 0)
  5813.     }
  5814.     function c() {
  5815.       var e = U[0] || F[0];
  5816.       return e ? e.getRuntime().uid : !1
  5817.     }
  5818.     function f(e, t) {
  5819.       if (e.ruid) {
  5820.         var i = o.getInfo(e.ruid);
  5821.         if (i) return i.can(t)
  5822.       }
  5823.       return !1
  5824.     }
  5825.     function p() {
  5826.       this.bind('FilesAdded FilesRemoved', function (e) {
  5827.         e.trigger('QueueChanged'),
  5828.         e.refresh()
  5829.       }),
  5830.       this.bind('CancelUpload', y),
  5831.       this.bind('BeforeUpload', _),
  5832.       this.bind('UploadFile', E),
  5833.       this.bind('UploadProgress', v),
  5834.       this.bind('StateChanged', b),
  5835.       this.bind('QueueChanged', d),
  5836.       this.bind('Error', z),
  5837.       this.bind('FileUploaded', R),
  5838.       this.bind('Destroy', O)
  5839.     }
  5840.     function g(e, i) {
  5841.       var n = this,
  5842.       r = 0,
  5843.       s = [
  5844.       ],
  5845.       a = {
  5846.         runtime_order: e.runtimes,
  5847.         required_caps: e.required_features,
  5848.         preferred_caps: P,
  5849.         swf_url: e.flash_swf_url,
  5850.         xap_url: e.silverlight_xap_url
  5851.       };
  5852.       l.each(e.runtimes.split(/\s*,\s*/), function (t) {
  5853.         e[t] && (a[t] = e[t])
  5854.       }),
  5855.       e.browse_button && l.each(e.browse_button, function (i) {
  5856.         s.push(function (s) {
  5857.           var u = new t.file.FileInput(l.extend({
  5858.           }, a, {
  5859.             accept: e.filters.mime_types,
  5860.             name: e.file_data_name,
  5861.             multiple: e.multi_selection,
  5862.             container: e.container,
  5863.             browse_button: i
  5864.           }));
  5865.           u.onready = function () {
  5866.             var e = o.getInfo(this.ruid);
  5867.             l.extend(n.features, {
  5868.               chunks: e.can('slice_blob'),
  5869.               multipart: e.can('send_multipart'),
  5870.               multi_selection: e.can('select_multiple')
  5871.             }),
  5872.             r++,
  5873.             U.push(this),
  5874.             s()
  5875.           },
  5876.           u.onchange = function () {
  5877.             n.addFile(this.files)
  5878.           },
  5879.           u.bind('mouseenter mouseleave mousedown mouseup', function (t) {
  5880.             A || (e.browse_button_hover && ('mouseenter' === t.type ? l.addClass(i, e.browse_button_hover)  : 'mouseleave' === t.type && l.removeClass(i, e.browse_button_hover)), e.browse_button_active && ('mousedown' === t.type ? l.addClass(i, e.browse_button_active)  : 'mouseup' === t.type && l.removeClass(i, e.browse_button_active)))
  5881.           }),
  5882.           u.bind('mousedown', function () {
  5883.             n.trigger('Browse')
  5884.           }),
  5885.           u.bind('error runtimeerror', function () {
  5886.             u = null,
  5887.             s()
  5888.           }),
  5889.           u.init()
  5890.         })
  5891.       }),
  5892.       e.drop_element && l.each(e.drop_element, function (e) {
  5893.         s.push(function (i) {
  5894.           var s = new t.file.FileDrop(l.extend({
  5895.           }, a, {
  5896.             drop_zone: e
  5897.           }));
  5898.           s.onready = function () {
  5899.             var e = o.getInfo(this.ruid);
  5900.             l.extend(n.features, {
  5901.               chunks: e.can('slice_blob'),
  5902.               multipart: e.can('send_multipart'),
  5903.               dragdrop: e.can('drag_and_drop')
  5904.             }),
  5905.             r++,
  5906.             F.push(this),
  5907.             i()
  5908.           },
  5909.           s.ondrop = function () {
  5910.             n.addFile(this.files)
  5911.           },
  5912.           s.bind('error runtimeerror', function () {
  5913.             s = null,
  5914.             i()
  5915.           }),
  5916.           s.init()
  5917.         })
  5918.       }),
  5919.       l.inSeries(s, function () {
  5920.         'function' == typeof i && i(r)
  5921.       })
  5922.     }
  5923.     function h(e, n, r) {
  5924.       var s = new t.image.Image;
  5925.       try {
  5926.         s.onload = function () {
  5927.           return n.width > this.width && n.height > this.height && n.quality === i && n.preserve_headers && !n.crop ? (this.destroy(), r(e))  : (s.downsize(n.width, n.height, n.crop, n.preserve_headers), void 0)
  5928.         },
  5929.         s.onresize = function () {
  5930.           r(this.getAsBlob(e.type, n.quality)),
  5931.           this.destroy()
  5932.         },
  5933.         s.onerror = function () {
  5934.           r(e)
  5935.         },
  5936.         s.load(e)
  5937.       } catch (a) {
  5938.         r(e)
  5939.       }
  5940.     }
  5941.     function m(e, i, r) {
  5942.       function s(e, i, n) {
  5943.         var r = S[e];
  5944.         switch (e) {
  5945.           case 'max_file_size':
  5946.             'max_file_size' === e && (S.max_file_size = S.filters.max_file_size = i);
  5947.             break;
  5948.           case 'chunk_size':
  5949.             (i = l.parseSize(i)) && (S[e] = i, S.send_file_name = !0);
  5950.             break;
  5951.           case 'multipart':
  5952.             S[e] = i,
  5953.             i || (S.send_file_name = !0);
  5954.             break;
  5955.           case 'http_method':
  5956.             S[e] = 'PUT' === i.toUpperCase() ? 'PUT' : 'POST';
  5957.             break;
  5958.           case 'unique_names':
  5959.             S[e] = i,
  5960.             i && (S.send_file_name = !0);
  5961.             break;
  5962.           case 'filters':
  5963.             'array' === l.typeOf(i) && (i = {
  5964.               mime_types: i
  5965.             }),
  5966.             n ? l.extend(S.filters, i)  : S.filters = i,
  5967.             i.mime_types && ('string' === l.typeOf(i.mime_types) && (i.mime_types = t.core.utils.Mime.mimes2extList(i.mime_types)), i.mime_types.regexp = function (e) {
  5968.               var t = [
  5969.               ];
  5970.               return l.each(e, function (e) {
  5971.                 l.each(e.extensions.split(/,/), function (e) {
  5972.                   /^\s*\*\s*$/.test(e) ? t.push('\\.*')  : t.push('\\.' + e.replace(new RegExp('[' + '/^$.*+?|()[]{}\\'.replace(/./g, '\\$&') + ']', 'g'), '\\$&'))
  5973.                 })
  5974.               }),
  5975.               new RegExp('(' + t.join('|') + ')$', 'i')
  5976.             }(i.mime_types), S.filters.mime_types = i.mime_types);
  5977.             break;
  5978.           case 'resize':
  5979.             S.resize = i ? l.extend({
  5980.               preserve_headers: !0,
  5981.               crop: !1
  5982.             }, i)  : !1;
  5983.             break;
  5984.           case 'prevent_duplicates':
  5985.             S.prevent_duplicates = S.filters.prevent_duplicates = !!i;
  5986.             break;
  5987.           case 'container':
  5988.           case 'browse_button':
  5989.           case 'drop_element':
  5990.             i = 'container' === e ? l.get(i)  : l.getAll(i);
  5991.           case 'runtimes':
  5992.           case 'multi_selection':
  5993.           case 'flash_swf_url':
  5994.           case 'silverlight_xap_url':
  5995.             S[e] = i,
  5996.             n || (u = !0);
  5997.             break;
  5998.           default:
  5999.             S[e] = i
  6000.         }
  6001.         n || a.trigger('OptionChanged', e, i, r)
  6002.       }
  6003.       var a = this,
  6004.       u = !1;
  6005.       'object' == typeof e ? l.each(e, function (e, t) {
  6006.         s(t, e, r)
  6007.       })  : s(e, i, r),
  6008.       r ? (S.required_features = n(l.extend({
  6009.       }, S)), P = n(l.extend({
  6010.       }, S, {
  6011.         required_features: !0
  6012.       })))  : u && (a.trigger('Destroy'), g.call(a, S, function (e) {
  6013.         e ? (a.runtime = o.getInfo(c()).type, a.trigger('Init', {
  6014.           runtime: a.runtime
  6015.         }), a.trigger('PostInit'))  : a.trigger('Error', {
  6016.           code: l.INIT_ERROR,
  6017.           message: l.translate('Init error.')
  6018.         })
  6019.       }))
  6020.     }
  6021.     function _(e, t) {
  6022.       if (e.settings.unique_names) {
  6023.         var i = t.name.match(/\.([^.]+)$/),
  6024.         n = 'part';
  6025.         i && (n = i[1]),
  6026.         t.target_name = t.id + '.' + n
  6027.       }
  6028.     }
  6029.     function E(e, i) {
  6030.       function n() {
  6031.         c-- > 0 ? r(s, 1000)  : (i.loaded = g, e.trigger('Error', {
  6032.           code: l.HTTP_ERROR,
  6033.           message: l.translate('HTTP Error.'),
  6034.           file: i,
  6035.           response: T.responseText,
  6036.           status: T.status,
  6037.           responseHeaders: T.getAllResponseHeaders()
  6038.         }))
  6039.       }
  6040.       function s() {
  6041.         var t,
  6042.         n,
  6043.         r = {
  6044.         };
  6045.         i.status === l.UPLOADING && e.state !== l.STOPPED && (e.settings.send_file_name && (r.name = i.target_name || i.name), d && p.chunks && o.size > d ? (n = Math.min(d, o.size - g), t = o.slice(g, g + n))  : (n = o.size, t = o), d && p.chunks && (e.settings.send_chunk_number ? (r.chunk = Math.ceil(g / d), r.chunks = Math.ceil(o.size / d))  : (r.offset = g, r.total = o.size)), e.trigger('BeforeChunkUpload', i, r, t, g) && a(r, t, n))
  6046.       }
  6047.       function a(a, d, f) {
  6048.         var h;
  6049.         T = new t.xhr.XMLHttpRequest,
  6050.         T.upload && (T.upload.onprogress = function (t) {
  6051.           i.loaded = Math.min(i.size, g + t.loaded),
  6052.           e.trigger('UploadProgress', i)
  6053.         }),
  6054.         T.onload = function () {
  6055.           return T.status >= 400 ? (n(), void 0)  : (c = e.settings.max_retries, f < o.size ? (d.destroy(), g += f, i.loaded = Math.min(g, o.size), e.trigger('ChunkUploaded', i, {
  6056.             offset: i.loaded,
  6057.             total: o.size,
  6058.             response: T.responseText,
  6059.             status: T.status,
  6060.             responseHeaders: T.getAllResponseHeaders()
  6061.           }), 'Android Browser' === l.ua.browser && e.trigger('UploadProgress', i))  : i.loaded = i.size, d = h = null, !g || g >= o.size ? (i.size != i.origSize && (o.destroy(), o = null), e.trigger('UploadProgress', i), i.status = l.DONE, i.completeTimestamp = + new Date, e.trigger('FileUploaded', i, {
  6062.             response: T.responseText,
  6063.             status: T.status,
  6064.             responseHeaders: T.getAllResponseHeaders()
  6065.           }))  : r(s, 1), void 0)
  6066.         },
  6067.         T.onerror = function () {
  6068.           n()
  6069.         },
  6070.         T.onloadend = function () {
  6071.           this.destroy(),
  6072.           T = null
  6073.         },
  6074.         e.settings.multipart && p.multipart ? (T.open(e.settings.http_method, u, !0), l.each(e.settings.headers, function (e, t) {
  6075.           T.setRequestHeader(t, e)
  6076.         }), h = new t.xhr.FormData, l.each(l.extend(a, e.settings.multipart_params), function (e, t) {
  6077.           h.append(t, e)
  6078.         }), h.append(e.settings.file_data_name, d), T.send(h, {
  6079.           runtime_order: e.settings.runtimes,
  6080.           required_caps: e.settings.required_features,
  6081.           preferred_caps: P,
  6082.           swf_url: e.settings.flash_swf_url,
  6083.           xap_url: e.settings.silverlight_xap_url
  6084.         }))  : (u = l.buildUrl(e.settings.url, l.extend(a, e.settings.multipart_params)), T.open(e.settings.http_method, u, !0), l.each(e.settings.headers, function (e, t) {
  6085.           T.setRequestHeader(t, e)
  6086.         }), T.hasRequestHeader('Content-Type') || T.setRequestHeader('Content-Type', 'application/octet-stream'), T.send(d, {
  6087.           runtime_order: e.settings.runtimes,
  6088.           required_caps: e.settings.required_features,
  6089.           preferred_caps: P,
  6090.           swf_url: e.settings.flash_swf_url,
  6091.           xap_url: e.settings.silverlight_xap_url
  6092.         }))
  6093.       }
  6094.       var o,
  6095.       u = e.settings.url,
  6096.       d = e.settings.chunk_size,
  6097.       c = e.settings.max_retries,
  6098.       p = e.features,
  6099.       g = 0;
  6100.       i.loaded && (g = i.loaded = d ? d * Math.floor(i.loaded / d)  : 0),
  6101.       o = i.getSource(),
  6102.       !l.isEmptyObj(e.settings.resize) && f(o, 'send_binary_string') && - 1 !== l.inArray(o.type, [
  6103.         'image/jpeg',
  6104.         'image/png'
  6105.       ]) ? h.call(this, o, e.settings.resize, function (e) {
  6106.         o = e,
  6107.         i.size = e.size,
  6108.         s()
  6109.       })  : s()
  6110.     }
  6111.     function v(e, t) {
  6112.       u(t)
  6113.     }
  6114.     function b(e) {
  6115.       if (e.state == l.STARTED) I = + new Date;
  6116.        else if (e.state == l.STOPPED) for (var t = e.files.length - 1; t >= 0; t--) e.files[t].status == l.UPLOADING && (e.files[t].status = l.QUEUED, d())
  6117.     }
  6118.     function y() {
  6119.       T && T.abort()
  6120.     }
  6121.     function R(e) {
  6122.       d(),
  6123.       r(function () {
  6124.         a.call(e)
  6125.       }, 1)
  6126.     }
  6127.     function z(e, t) {
  6128.       t.code === l.INIT_ERROR ? e.destroy()  : t.code === l.HTTP_ERROR && (t.file.status = l.FAILED, t.file.completeTimestamp = + new Date, u(t.file), e.state == l.STARTED && (e.trigger('CancelUpload'), r(function () {
  6129.         a.call(e)
  6130.       }, 1)))
  6131.     }
  6132.     function O(e) {
  6133.       e.stop(),
  6134.       l.each(x, function (e) {
  6135.         e.destroy()
  6136.       }),
  6137.       x = [
  6138.       ],
  6139.       U.length && (l.each(U, function (e) {
  6140.         e.destroy()
  6141.       }), U = [
  6142.       ]),
  6143.       F.length && (l.each(F, function (e) {
  6144.         e.destroy()
  6145.       }), F = [
  6146.       ]),
  6147.       P = {
  6148.       },
  6149.       A = !1,
  6150.       I = T = null,
  6151.       w.reset()
  6152.     }
  6153.     var S,
  6154.     I,
  6155.     w,
  6156.     T,
  6157.     D = l.guid(),
  6158.     x = [
  6159.     ],
  6160.     P = {
  6161.     },
  6162.     U = [
  6163.     ],
  6164.     F = [
  6165.     ],
  6166.     A = !1;
  6167.     S = {
  6168.       chunk_size: 0,
  6169.       file_data_name: 'file',
  6170.       filters: {
  6171.         mime_types: [
  6172.         ],
  6173.         prevent_duplicates: !1,
  6174.         max_file_size: 0
  6175.       },
  6176.       flash_swf_url: 'js/Moxie.swf',
  6177.       http_method: 'POST',
  6178.       max_retries: 0,
  6179.       multipart: !0,
  6180.       multi_selection: !0,
  6181.       resize: !1,
  6182.       runtimes: o.order,
  6183.       send_file_name: !0,
  6184.       send_chunk_number: !0,
  6185.       silverlight_xap_url: 'js/Moxie.xap'
  6186.     },
  6187.     m.call(this, e, null, !0),
  6188.     w = new l.QueueProgress,
  6189.     l.extend(this, {
  6190.       id: D,
  6191.       uid: D,
  6192.       state: l.STOPPED,
  6193.       features: {
  6194.       },
  6195.       runtime: null,
  6196.       files: x,
  6197.       settings: S,
  6198.       total: w,
  6199.       init: function () {
  6200.         var e,
  6201.         t,
  6202.         i = this;
  6203.         return e = i.getOption('preinit'),
  6204.         'function' == typeof e ? e(i)  : l.each(e, function (e, t) {
  6205.           i.bind(t, e)
  6206.         }),
  6207.         p.call(i),
  6208.         l.each(['container',
  6209.         'browse_button',
  6210.         'drop_element'], function (e) {
  6211.           return null === i.getOption(e) ? (t = {
  6212.             code: l.INIT_ERROR,
  6213.             message: l.sprintf(l.translate('%s specified, but cannot be found.'), e)
  6214.           }, !1)  : void 0
  6215.         }),
  6216.         t ? i.trigger('Error', t)  : S.browse_button || S.drop_element ? (g.call(i, S, function (e) {
  6217.           var t = i.getOption('init');
  6218.           'function' == typeof t ? t(i)  : l.each(t, function (e, t) {
  6219.             i.bind(t, e)
  6220.           }),
  6221.           e ? (i.runtime = o.getInfo(c()).type, i.trigger('Init', {
  6222.             runtime: i.runtime
  6223.           }), i.trigger('PostInit'))  : i.trigger('Error', {
  6224.             code: l.INIT_ERROR,
  6225.             message: l.translate('Init error.')
  6226.           })
  6227.         }), void 0)  : i.trigger('Error', {
  6228.           code: l.INIT_ERROR,
  6229.           message: l.translate('You must specify either browse_button or drop_element.')
  6230.         })
  6231.       },
  6232.       setOption: function (e, t) {
  6233.         m.call(this, e, t, !this.runtime)
  6234.       },
  6235.       getOption: function (e) {
  6236.         return e ? S[e] : S
  6237.       },
  6238.       refresh: function () {
  6239.         U.length && l.each(U, function (e) {
  6240.           e.trigger('Refresh')
  6241.         }),
  6242.         this.trigger('Refresh')
  6243.       },
  6244.       start: function () {
  6245.         this.state != l.STARTED && (this.state = l.STARTED, this.trigger('StateChanged'), a.call(this))
  6246.       },
  6247.       stop: function () {
  6248.         this.state != l.STOPPED && (this.state = l.STOPPED, this.trigger('StateChanged'), this.trigger('CancelUpload'))
  6249.       },
  6250.       disableBrowse: function () {
  6251.         A = arguments[0] !== i ? arguments[0] : !0,
  6252.         U.length && l.each(U, function (e) {
  6253.           e.disable(A)
  6254.         }),
  6255.         this.trigger('DisableBrowse', A)
  6256.       },
  6257.       getFile: function (e) {
  6258.         var t;
  6259.         for (t = x.length - 1; t >= 0; t--) if (x[t].id === e) return x[t]
  6260.       },
  6261.       addFile: function (e, i) {
  6262.         function n(e, t) {
  6263.           var i = [
  6264.           ];
  6265.           l.each(u.settings.filters, function (t, n) {
  6266.             s[n] && i.push(function (i) {
  6267.               s[n].call(u, t, e, function (e) {
  6268.                 i(!e)
  6269.               })
  6270.             })
  6271.           }),
  6272.           l.inSeries(i, t)
  6273.         }
  6274.         function a(e) {
  6275.           var s = l.typeOf(e);
  6276.           if (e instanceof t.file.File) {
  6277.             if (!e.ruid && !e.isDetached()) {
  6278.               if (!o) return !1;
  6279.               e.ruid = o,
  6280.               e.connectRuntime(o)
  6281.             }
  6282.             a(new l.File(e))
  6283.           } else e instanceof t.file.Blob ? (a(e.getSource()), e.destroy())  : e instanceof l.File ? (i && (e.name = i), d.push(function (t) {
  6284.             n(e, function (i) {
  6285.               i || (x.push(e), f.push(e), u.trigger('FileFiltered', e)),
  6286.               r(t, 1)
  6287.             })
  6288.           }))  : - 1 !== l.inArray(s, [
  6289.             'file',
  6290.             'blob'
  6291.           ]) ? a(new t.file.File(null, e))  : 'node' === s && 'filelist' === l.typeOf(e.files) ? l.each(e.files, a)  : 'array' === s && (i = null, l.each(e, a))
  6292.         }
  6293.         var o,
  6294.         u = this,
  6295.         d = [
  6296.         ],
  6297.         f = [
  6298.         ];
  6299.         o = c(),
  6300.         a(e),
  6301.         d.length && l.inSeries(d, function () {
  6302.           f.length && u.trigger('FilesAdded', f)
  6303.         })
  6304.       },
  6305.       removeFile: function (e) {
  6306.         for (var t = 'string' == typeof e ? e : e.id, i = x.length - 1; i >= 0; i--) if (x[i].id === t) return this.splice(i, 1) [0]
  6307.       },
  6308.       splice: function (e, t) {
  6309.         var n = x.splice(e === i ? 0 : e, t === i ? x.length : t),
  6310.         r = !1;
  6311.         return this.state == l.STARTED && (l.each(n, function (e) {
  6312.           return e.status === l.UPLOADING ? (r = !0, !1)  : void 0
  6313.         }), r && this.stop()),
  6314.         this.trigger('FilesRemoved', n),
  6315.         l.each(n, function (e) {
  6316.           e.destroy()
  6317.         }),
  6318.         r && this.start(),
  6319.         n
  6320.       },
  6321.       dispatchEvent: function (e) {
  6322.         var t,
  6323.         i;
  6324.         if (e = e.toLowerCase(), t = this.hasEventListener(e)) {
  6325.           t.sort(function (e, t) {
  6326.             return t.priority - e.priority
  6327.           }),
  6328.           i = [
  6329.           ].slice.call(arguments),
  6330.           i.shift(),
  6331.           i.unshift(this);
  6332.           for (var n = 0; n < t.length; n++) if (t[n].fn.apply(t[n].scope, i) === !1) return !1
  6333.         }
  6334.         return !0
  6335.       },
  6336.       bind: function (e, t, i, n) {
  6337.         l.Uploader.prototype.bind.call(this, e, t, n, i)
  6338.       },
  6339.       destroy: function () {
  6340.         this.trigger('Destroy'),
  6341.         S = w = null,
  6342.         this.unbindAll()
  6343.       }
  6344.     })
  6345.   },
  6346.   l.Uploader.prototype = t.core.EventTarget.instance,
  6347.   l.File = function () {
  6348.     function e(e) {
  6349.       l.extend(this, {
  6350.         id: l.guid(),
  6351.         name: e.name || e.fileName,
  6352.         type: e.type || '',
  6353.         size: e.size || e.fileSize,
  6354.         origSize: e.size || e.fileSize,
  6355.         loaded: 0,
  6356.         percent: 0,
  6357.         status: l.QUEUED,
  6358.         lastModifiedDate: e.lastModifiedDate || (new Date).toLocaleString(),
  6359.         completeTimestamp: 0,
  6360.         getNative: function () {
  6361.           var e = this.getSource().getSource();
  6362.           return - 1 !== l.inArray(l.typeOf(e), [
  6363.             'blob',
  6364.             'file'
  6365.           ]) ? e : null
  6366.         },
  6367.         getSource: function () {
  6368.           return t[this.id] ? t[this.id] : null
  6369.         },
  6370.         destroy: function () {
  6371.           var e = this.getSource();
  6372.           e && (e.destroy(), delete t[this.id])
  6373.         }
  6374.       }),
  6375.       t[this.id] = e
  6376.     }
  6377.     var t = {
  6378.     };
  6379.     return e
  6380.   }(),
  6381.   l.QueueProgress = function () {
  6382.     var e = this;
  6383.     e.size = 0,
  6384.     e.loaded = 0,
  6385.     e.uploaded = 0,
  6386.     e.failed = 0,
  6387.     e.queued = 0,
  6388.     e.percent = 0,
  6389.     e.bytesPerSec = 0,
  6390.     e.reset = function () {
  6391.       e.size = e.loaded = e.uploaded = e.failed = e.queued = e.percent = e.bytesPerSec = 0
  6392.     }
  6393.   },
  6394.   e.plupload = l
  6395. }(this, e)
  6396. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement