bookstack/public/js/common.js

9 lines
268 KiB
JavaScript
Raw Normal View History

2016-02-01 02:03:55 +08:00
!function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){!function(e,t,n){"use strict";function r(e,t,n){if(!e)throw ve("areq","Argument '{0}' is {1}",t||"?",n||"required");return e}function i(e,t){return e||t?e?t?(q(e)&&(e=e.join(" ")),q(t)&&(t=t.join(" ")),e+" "+t):e:t:""}function o(e){var t={};return e&&(e.to||e.from)&&(t.to=e.to,t.from=e.from),t}function a(e,t,n){var r="";return e=q(e)?e:e&&H(e)&&e.length?e.split(/\s+/):[],U(e,function(e,i){e&&e.length>0&&(r+=i>0?" ":"",r+=n?t+e:e+t)}),r}function s(e,t){var n=e.indexOf(t);t>=0&&e.splice(n,1)}function u(e){if(e instanceof V)switch(e.length){case 0:return[];case 1:if(e[0].nodeType===Z)return e;break;default:return V(l(e))}return e.nodeType===Z?V(e):void 0}function l(e){if(!e[0])return e;for(var t=0;t<e.length;t++){var n=e[t];if(n.nodeType==Z)return n}}function c(e,t,n){U(t,function(t){e.addClass(t,n)})}function f(e,t,n){U(t,function(t){e.removeClass(t,n)})}function p(e){return function(t,n){n.addClass&&(c(e,t,n.addClass),n.addClass=null),n.removeClass&&(f(e,t,n.removeClass),n.removeClass=null)}}function d(e){if(e=e||{},!e.$$prepared){var t=e.domOperation||L;e.domOperation=function(){e.$$domOperationFired=!0,t(),t=L},e.$$prepared=!0}return e}function h(e,t){m(e,t),v(e,t)}function m(e,t){t.from&&(e.css(t.from),t.from=null)}function v(e,t){t.to&&(e.css(t.to),t.to=null)}function g(e,t,n){var r=t.options||{},i=n.options||{},o=(r.addClass||"")+" "+(i.addClass||""),a=(r.removeClass||"")+" "+(i.removeClass||""),s=$(e.attr("class"),o,a);i.preparationClasses&&(r.preparationClasses=k(i.preparationClasses,r.preparationClasses),delete i.preparationClasses);var u=r.domOperation!==L?r.domOperation:null;return z(r,i),u&&(r.domOperation=u),s.addClass?r.addClass=s.addClass:r.addClass=null,s.removeClass?r.removeClass=s.removeClass:r.removeClass=null,t.addClass=r.addClass,t.removeClass=r.removeClass,r}function $(e,t,n){function r(e){H(e)&&(e=e.split(" "));var t={};return U(e,function(e){e.length&&(t[e]=!0)}),t}var i=1,o=-1,a={};e=r(e),t=r(t),U(t,function(e,t){a[t]=i}),n=r(n),U(n,function(e,t){a[t]=a[t]===i?null:o});var s={addClass:"",removeClass:""};return U(a,function(t,n){var r,a;t===i?(r="addClass",a=!e[n]):t===o&&(r="removeClass",a=e[n]),a&&(s[r].length&&(s[r]+=" "),s[r]+=n)}),s}function y(e){return e instanceof t.element?e[0]:e}function b(e,t,n){var r="";t&&(r=a(t,K,!0)),n.addClass&&(r=k(r,a(n.addClass,X))),n.removeClass&&(r=k(r,a(n.removeClass,J))),r.length&&(n.preparationClasses=r,e.addClass(r))}function w(e,t){t.preparationClasses&&(e.removeClass(t.preparationClasses),t.preparationClasses=null),t.activeClasses&&(e.removeClass(t.activeClasses),t.activeClasses=null)}function x(e,t){var n=t?"-"+t+"s":"";return E(e,[he,n]),[he,n]}function C(e,t){var n=t?"paused":"",r=P+ce;return E(e,[r,n]),[r,n]}function E(e,t){var n=t[0],r=t[1];e.style[n]=r}function k(e,t){return e?t?e+" "+t:e:t}function S(e){return[de,e+"s"]}function A(e,t){var n=t?pe:he;return[n,e+"s"]}function T(e,t,n){var r=Object.create(null),i=e.getComputedStyle(t)||{};return U(n,function(e,t){var n=i[e];if(n){var o=n.charAt(0);("-"===o||"+"===o||o>=0)&&(n=D(n)),0===n&&(n=null),r[t]=n}}),r}function D(e){var t=0,n=e.split(/\s*,\s*/);return U(n,function(e){"s"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),e=parseFloat(e)||0,t=t?Math.max(e,t):e}),t}function O(e){return 0===e||null!=e}function F(e,t){var n=I,r=e+"s";return t?n+=oe:r+=" linear all",[n,r]}function M(){var e=Object.create(null);return{flush:function(){e=Object.create(null)},count:function(t){var n=e[t];return n?n.total:0},get:function(t){var n=e[t];return n&&n.value},put:function(t,n){e[t]?e[t].total++:e[t]={total:1,value:n}}}}function N(e,t,n){U(n,function(n){e[n]=G
}function s(e){for(var t={},n=0,r=e.length;r>n;n++){var i=e[n];t[i.name]=i.value}return t}function u(e){return e.replace(/&/g,"&amp;").replace(d,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(h,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l(e,n){var r=!1,i=t.bind(e,e.push);return{start:function(e,o){e=t.lowercase(e),!r&&x[e]&&(r=e),r||C[e]!==!0||(i("<"),i(e),t.forEach(o,function(r,o){var a=t.lowercase(o),s="img"===e&&"src"===a||"background"===a;A[a]!==!0||E[a]===!0&&!n(r,s)||(i(" "),i(o),i('="'),i(u(r)),i('"'))}),i(">"))},end:function(e){e=t.lowercase(e),r||C[e]!==!0||m[e]===!0||(i("</"),i(e),i(">")),e==r&&(r=!1)},chars:function(e){r||i(u(e))}}}function c(e){if(e.nodeType===Node.ELEMENT_NODE)for(var t=e.attributes,n=0,r=t.length;r>n;n++){var i=t[n],o=i.name.toLowerCase();("xmlns:ns1"===o||0===o.indexOf("ns1:"))&&(e.removeAttributeNode(i),n--,r--)}var a=e.firstChild;a&&c(a),a=e.nextSibling,a&&c(a)}var f,p=t.$$minErr("$sanitize"),d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,h=/([^\#-~ |!])/g,m=o("area,br,col,hr,img,wbr"),v=o("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),g=o("rp,rt"),$=t.extend({},g,v),y=t.extend({},v,o("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),b=t.extend({},g,o("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),w=o("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),x=o("script,style"),C=t.extend({},m,y,b,$),E=o("background,cite,href,longdesc,src,xlink:href"),k=o("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),S=o("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),A=t.extend({},E,S,k);!function(e){var t;if(!e.document||!e.document.implementation)throw p("noinert","Can't create an inert html document");t=e.document.implementation.createHTMLDocument("inert");var n=t.documentElement||t.getDocumentElement(),r=n.getElementsByTagName("body");if(1===r.length)f=r[0];else{var i=t.createElement("html");f=t.createElement("body"),i.appendChild(f),t.appendChild(i)}}(e),t.module("ngSanitize",[]).provider("$sanitize",r),t.module("ngSanitize").filter("linky",["$sanitize",function(e){var n=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,r=/^mailto:/
r.push(s)}catch(l){n(l)}}),r}])),l[t].push(n)):o(t,s(A)),this},this.component=function(e,t){function n(e){function n(t){return S(t)||Wr(t)?function(n,r){return e.invoke(t,this,{$element:n,$attrs:r})}:t}var i=t.template||t.templateUrl?t.template:"";return{controller:r,controllerAs:$t(t.controller)||t.controllerAs||"$ctrl",template:n(i),templateUrl:n(t.templateUrl),transclude:t.transclude,scope:{},bindToController:t.bindings||{},restrict:"E",require:t.require}}var r=t.controller||function(){};return o(t,function(e,t){"$"===t.charAt(0)&&(n[t]=e)}),n.$inject=["$injector"],this.directive(e,n)},this.aHrefSanitizationWhitelist=function(e){return b(e)?(r.aHrefSanitizationWhitelist(e),this):r.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(e){return b(e)?(r.imgSrcSanitizationWhitelist(e),this):r.imgSrcSanitizationWhitelist()};var k=!0;this.debugInfoEnabled=function(e){return b(e)?(k=e,this):k},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(e,r,i,a,s,u,g,b,A,T){function O(e,t,n){le.innerHTML="<span "+t+">";var r=le.firstChild.attributes,i=r[0];r.removeNamedItem(i.name),i.value=n,e.attributes.setNamedItem(i)}function F(e,t){try{e.addClass(t)}catch(n){}}function M(e,n,r,i,o){e instanceof jr||(e=jr(e));for(var a=/\S+/,s=0,u=e.length;u>s;s++){var l=e[s];l.nodeType===ri&&l.nodeValue.match(a)&&Oe(l,e[s]=t.createElement("span"))}var c=j(e,n,e,r,i,o);M.$$addScopeClass(e);var f=null;return function(t,n,r){pe(t,"scope"),o&&o.needsNewScope&&(t=t.$parent.$new()),r=r||{};var i=r.parentBoundTranscludeFn,a=r.transcludeControllers,s=r.futureParentElement;i&&i.$$boundTransclude&&(i=i.$$boundTransclude),f||(f=I(s));var u;if(u="html"!==f?jr(te(f,jr("<div>").append(e).html())):n?xi.clone.call(e):e,a)for(var l in a)u.data("$"+l+"Controller",a[l].instance);return M.$$addScopeInfo(u,t),n&&n(u,t),c&&c(t,u,u,i),u}}function I(e){var t=e&&e[0];return t&&"foreignobject"!==R(t)&&Vr.call(t).match(/SVG/)?"svg":"html"}function j(e,t,r,i,o,a){function s(e,r,i,o){var a,s,u,l,c,f,p,d,v;if(h){var g=r.length;for(v=new Array(g),c=0;c<m.length;c+=3)p=m[c],v[p]=r[p]}else v=r;for(c=0,f=m.length;f>c;)u=v[m[c++]],a=m[c++],s=m[c++],a?(a.scope?(l=e.$new(),M.$$addScopeInfo(jr(u),l)):l=e,d=a.transcludeOnThisElement?P(e,a.transclude,o):!a.templateOnThisElement&&o?o:!o&&t?P(e,t):null,a(s,l,u,i,d)):s&&s(e,u.childNodes,n,o)}for(var u,l,c,f,p,d,h,m=[],v=0;v<e.length;v++)u=new fe,l=_(e[v],[],u,0===v?i:n,o),c=l.length?H(l,e[v],u,t,r,null,[],[],a):null,c&&c.scope&&M.$$addScopeClass(u.$$element),p=c&&c.terminal||!(f=e[v].childNodes)||!f.length?null:j(f,c?(c.transcludeOnThisElement||!c.templateOnThisElement)&&c.transclude:t),(c||p)&&(m.push(v,c,p),d=!0,h=h||c),a=null;return d?s:null}function P(e,t,n){var r=function(r,i,o,a,s){return r||(r=e.$new(!1,s),r.$$transcluded=!0),t(r,i,{parentBoundTranscludeFn:n,transcludeControllers:o,futureParentElement:a})},i=r.$$slots=ge();for(var o in t.$$slots)t.$$slots[o]?i[o]=P(e,t.$$slots[o],n):i[o]=null;return r}function _(e,t,n,r,i){var o,a,s=e.nodeType,u=n.$attr;switch(s){case ti:G(t,mt(R(e)),"E",r,i);for(var l,c,f,h,m,v,g=e.attributes,$=0,y=g&&g.length;y>$;$++){var b=!1,x=!1;l=g[$],c=l.name,m=Qr(l.value),h=mt(c),(v=ve.test(h))&&(c=c.replace(qi,"").substr(8).replace(/_(.)/g,function(e,t){return t.toUpperCase()}));var E=h.match($e);E&&Q(E[1])&&(b=c,x=c.substr(0,c.length-5)+"end",c=c.substr(0,c.length-6)),f=mt(c.toLowerCase()),u[f]=c,(v||!n.hasOwnProperty(f))&&(n[f]=m,Ge(e,f)&&(n[f]=!0)),re(e,t,m,f,v),G(t,f,"A",r,i,b,x)}if(a=e.className,w(a)&&(a=a.animVal),C(a)&&""!==a)for(;o=d.exec(a);)f=mt(o[2]),G(t,f,"C",r,i)&&(n[f]=Qr(o[3])),a=a.substr(o.index+o[0].length);break;case ri:if(11===Ir)for(;e.parentNode&&e.nextSibling&&e.nextSibling.nodeType===ri;)e.nodeValue=e.nodeValue+e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);ee(t,e.nodeValue);break;case ii:try{o=p.exec(e.nodeValue),o&&(f=mt(o[1]),G(t,f,"M",r,i)&&(n[f]=Qr(o[2])))}catch(k){}}return t.sort(X),t}function L(e,t,n){var r=[],i=0;if(t&&e.hasAttribute&&e.
error:i("error"),debug:function(){var n=i("debug");return function(){e&&n.apply(t,arguments)}}()}}]}function Jt(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throw oo("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return e}function Kt(e){return e+""}function en(e,t){if(e){if(e.constructor===e)throw oo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throw oo("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throw oo("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throw oo("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}return e}function tn(e,t){if(e){if(e.constructor===e)throw oo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===ao||e===so||e===uo)throw oo("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}function nn(e,t){if(e&&(e===0..constructor||e===(!1).constructor||e==="".constructor||e==={}.constructor||e===[].constructor||e===Function.constructor))throw oo("isecaf","Assigning to a constructor is disallowed! Expression: {0}",t)}function rn(e,t){return"undefined"!=typeof e?e:t}function on(e,t){return"undefined"==typeof e?t:"undefined"==typeof t?e:e+t}function an(e,t){var n=e(t);return!n.$stateful}function sn(e,t){var n,r;switch(e.type){case po.Program:n=!0,o(e.body,function(e){sn(e.expression,t),n=n&&e.expression.constant}),e.constant=n;break;case po.Literal:e.constant=!0,e.toWatch=[];break;case po.UnaryExpression:sn(e.argument,t),e.constant=e.argument.constant,e.toWatch=e.argument.toWatch;break;case po.BinaryExpression:sn(e.left,t),sn(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.left.toWatch.concat(e.right.toWatch);break;case po.LogicalExpression:sn(e.left,t),sn(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=e.constant?[]:[e];break;case po.ConditionalExpression:sn(e.test,t),sn(e.alternate,t),sn(e.consequent,t),e.constant=e.test.constant&&e.alternate.constant&&e.consequent.constant,e.toWatch=e.constant?[]:[e];break;case po.Identifier:e.constant=!1,e.toWatch=[e];break;case po.MemberExpression:sn(e.object,t),e.computed&&sn(e.property,t),e.constant=e.object.constant&&(!e.computed||e.property.constant),e.toWatch=[e];break;case po.CallExpression:n=e.filter?an(t,e.callee.name):!1,r=[],o(e.arguments,function(e){sn(e,t),n=n&&e.constant,e.constant||r.push.apply(r,e.toWatch)}),e.constant=n,e.toWatch=e.filter&&an(t,e.callee.name)?r:[e];break;case po.AssignmentExpression:sn(e.left,t),sn(e.right,t),e.constant=e.left.constant&&e.right.constant,e.toWatch=[e];break;case po.ArrayExpression:n=!0,r=[],o(e.elements,function(e){sn(e,t),n=n&&e.constant,e.constant||r.push.apply(r,e.toWatch)}),e.constant=n,e.toWatch=r;break;case po.ObjectExpression:n=!0,r=[],o(e.properties,function(e){sn(e.value,t),n=n&&e.value.constant,e.value.constant||r.push.apply(r,e.value.toWatch)}),e.constant=n,e.toWatch=r;break;case po.ThisExpression:e.constant=!1,e.toWatch=[];break;case po.LocalsExpression:e.constant=!1,e.toWatch=[]}}function un(e){if(1==e.length){var t=e[0].expression,r=t.toWatch;return 1!==r.length?r:r[0]!==t?r:n}}function ln(e){return e.type===po.Identifier||e.type===po.MemberExpression}function cn(e){return 1===e.body.length&&ln(e.body[0].expression)?{type:po.AssignmentExpression,left:e.body[0].expression,right:{type:po.NGValueParameter},operator:"="}:void 0}function fn(e){return 0===e.body.length||1===e.body.length&&(e.body[0].expression.type===po.Literal||e.body[0].expression.type===po.ArrayExpression||e.body[0].expression.type===po.ObjectExpression)}function pn(e){return e.constant}function dn(e,t){this.astBuilder=e,this.$filter=t}function hn(e,t){this.astBuilder=e,this.$filter=t}function mn(e){return"constructor"==e}function vn(e){return
t.val()!==e&&t.val(e)}}function dr(e,t){if(k(e))return e;if(C(e)){Vo.lastIndex=0;var n=Vo.exec(e);if(n){var r=+n[1],i=+n[2],o=0,a=0,s=0,u=0,l=Xn(r),c=7*(i-1);return t&&(o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),u=t.getMilliseconds()),new Date(r,0,l.getDate()+c,o,a,s,u)}}return NaN}function hr(e,t){return function(n,r){var i,a;if(k(n))return n;if(C(n)){if('"'==n.charAt(0)&&'"'==n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),jo.test(n))return new Date(n);if(e.lastIndex=0,i=e.exec(n))return i.shift(),a=r?{yyyy:r.getFullYear(),MM:r.getMonth()+1,dd:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds(),sss:r.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},o(i,function(e,n){n<t.length&&(a[t[n]]=+e)}),new Date(a.yyyy,a.MM-1,a.dd,a.HH,a.mm,a.ss||0,1e3*a.sss||0)}return NaN}}function mr(e,t,r,i){return function(o,a,s,u,l,c,f){function p(e){return e&&!(e.getTime&&e.getTime()!==e.getTime())}function d(e){return b(e)&&!k(e)?r(e)||n:e}vr(o,a,s,u),pr(o,a,s,u,l,c);var h,m=u&&u.$options&&u.$options.timezone;if(u.$$parserName=e,u.$parsers.push(function(e){if(u.$isEmpty(e))return null;if(t.test(e)){var i=r(e,h);return m&&(i=J(i,m)),i}return n}),u.$formatters.push(function(e){if(e&&!k(e))throw ya("datefmt","Expected `{0}` to be a date",e);return p(e)?(h=e,h&&m&&(h=J(h,m,!0)),f("date")(e,i,m)):(h=null,"")}),b(s.min)||s.ngMin){var v;u.$validators.min=function(e){return!p(e)||y(v)||r(e)>=v},s.$observe("min",function(e){v=d(e),u.$validate()})}if(b(s.max)||s.ngMax){var g;u.$validators.max=function(e){return!p(e)||y(g)||r(e)<=g},s.$observe("max",function(e){g=d(e),u.$validate()})}}}function vr(e,t,r,i){var o=t[0],a=i.$$hasNativeValidators=w(o.validity);a&&i.$parsers.push(function(e){var r=t.prop(Tr)||{};return r.badInput||r.typeMismatch?n:e})}function gr(e,t,r,i,o,a){if(vr(e,t,r,i),pr(e,t,r,i,o,a),i.$$parserName="number",i.$parsers.push(function(e){return i.$isEmpty(e)?null:Lo.test(e)?parseFloat(e):n}),i.$formatters.push(function(e){if(!i.$isEmpty(e)){if(!E(e))throw ya("numfmt","Expected `{0}` to be a number",e);e=e.toString()}return e}),b(r.min)||r.ngMin){var s;i.$validators.min=function(e){return i.$isEmpty(e)||y(s)||e>=s},r.$observe("min",function(e){b(e)&&!E(e)&&(e=parseFloat(e,10)),s=E(e)&&!isNaN(e)?e:n,i.$validate()})}if(b(r.max)||r.ngMax){var u;i.$validators.max=function(e){return i.$isEmpty(e)||y(u)||u>=e},r.$observe("max",function(e){b(e)&&!E(e)&&(e=parseFloat(e,10)),u=E(e)&&!isNaN(e)?e:n,i.$validate()})}}function $r(e,t,n,r,i,o){pr(e,t,n,r,i,o),cr(r),r.$$parserName="url",r.$validators.url=function(e,t){var n=e||t;return r.$isEmpty(n)||Po.test(n)}}function yr(e,t,n,r,i,o){pr(e,t,n,r,i,o),cr(r),r.$$parserName="email",r.$validators.email=function(e,t){var n=e||t;return r.$isEmpty(n)||_o.test(n)}}function br(e,t,n,r){y(n.name)&&t.attr("name",u());var i=function(e){t[0].checked&&r.$setViewValue(n.value,e&&e.type)};t.on("click",i),r.$render=function(){var e=n.value;t[0].checked=e==r.$viewValue},n.$observe("value",r.$render)}function wr(e,t,n,r,i){var o;if(b(r)){if(o=e(r),!o.constant)throw ya("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,r);return o(t)}return i}function xr(e,t,n,r,i,o,a,s){var u=wr(s,e,"ngTrueValue",n.ngTrueValue,!0),l=wr(s,e,"ngFalseValue",n.ngFalseValue,!1),c=function(e){r.$setViewValue(t[0].checked,e&&e.type)};t.on("click",c),r.$render=function(){t[0].checked=r.$viewValue},r.$isEmpty=function(e){return e===!1},r.$formatters.push(function(e){return q(e,u)}),r.$parsers.push(function(e){return e?u:l})}function Cr(e,t){return e="ngClass"+e,["$animate",function(n){function r(e,t){var n=[];e:for(var r=0;r<e.length;r++){for(var i=e[r],o=0;o<t.length;o++)if(i==t[o])continue e;n.push(i)}return n}function i(e){var t=[];return Wr(e)?(o(e,function(e){t=t.concat(i(e))}),t):C(e)?e.split(" "):w(e)?(o(e,function(e,n){e&&(t=t.concat(n.split(" ")))}),t):e}return{restrict:"AC",link:function(a,s,u){function l(e){var t=f(e,1);u.$addClass(t)}function c(e){var t=f(e,-1);u.$removeClass(t)}function f(e,t){var n=s.data("$classCounts")||ge(),r=[];return o(e,function(e){(t>0||n[e])&&(n[e
(p.state.expensiveChecks||mn(e.name))&&p.addEnsureSafeObject(t),i(t);break;case po.MemberExpression:u=r&&(r.context=this.nextId())||this.nextId(),t=t||this.nextId(),p.recurse(e.object,u,n,function(){p.if_(p.notNull(u),function(){a&&1!==a&&p.addEnsureSafeAssignContext(u),e.computed?(l=p.nextId(),p.recurse(e.property,l),p.getStringValue(l),p.addEnsureSafeMemberName(l),a&&1!==a&&p.if_(p.not(p.computedMember(u,l)),p.lazyAssign(p.computedMember(u,l),"{}")),f=p.ensureSafeObject(p.computedMember(u,l)),p.assign(t,f),r&&(r.computed=!0,r.name=l)):(Jt(e.property.name),a&&1!==a&&p.if_(p.not(p.nonComputedMember(u,e.property.name)),p.lazyAssign(p.nonComputedMember(u,e.property.name),"{}")),f=p.nonComputedMember(u,e.property.name),(p.state.expensiveChecks||mn(e.property.name))&&(f=p.ensureSafeObject(f)),p.assign(t,f),r&&(r.computed=!1,r.name=e.property.name))},function(){p.assign(t,"undefined")}),i(t)},!!a);break;case po.CallExpression:t=t||this.nextId(),e.filter?(l=p.filter(e.callee.name),c=[],o(e.arguments,function(e){var t=p.nextId();p.recurse(e,t),c.push(t)}),f=l+"("+c.join(",")+")",p.assign(t,f),i(t)):(l=p.nextId(),u={},c=[],p.recurse(e.callee,l,u,function(){p.if_(p.notNull(l),function(){p.addEnsureSafeFunction(l),o(e.arguments,function(e){p.recurse(e,p.nextId(),n,function(e){c.push(p.ensureSafeObject(e))})}),u.name?(p.state.expensiveChecks||p.addEnsureSafeObject(u.context),f=p.member(u.context,u.name,u.computed)+"("+c.join(",")+")"):f=l+"("+c.join(",")+")",f=p.ensureSafeObject(f),p.assign(t,f)},function(){p.assign(t,"undefined")}),i(t)}));break;case po.AssignmentExpression:if(l=this.nextId(),u={},!ln(e.left))throw oo("lval","Trying to assign a value to a non l-value");this.recurse(e.left,n,u,function(){p.if_(p.notNull(u.context),function(){p.recurse(e.right,l),p.addEnsureSafeObject(p.member(u.context,u.name,u.computed)),p.addEnsureSafeAssignContext(u.context),f=p.member(u.context,u.name,u.computed)+e.operator+l,p.assign(t,f),i(t||f)})},1);break;case po.ArrayExpression:c=[],o(e.elements,function(e){p.recurse(e,p.nextId(),n,function(e){c.push(e)})}),f="["+c.join(",")+"]",this.assign(t,f),i(f);break;case po.ObjectExpression:c=[],o(e.properties,function(e){p.recurse(e.value,p.nextId(),n,function(t){c.push(p.escape(e.key.type===po.Identifier?e.key.name:""+e.key.value)+":"+t)})}),f="{"+c.join(",")+"}",this.assign(t,f),i(f);break;case po.ThisExpression:this.assign(t,"s"),i("s");break;case po.LocalsExpression:this.assign(t,"l"),i("l");break;case po.NGValueParameter:this.assign(t,"v"),i("v")}},getHasOwnProperty:function(e,t){var n=e+"."+t,r=this.current().own;return r.hasOwnProperty(n)||(r[n]=this.nextId(!1,e+"&&("+this.escape(t)+" in "+e+")")),r[n]},assign:function(e,t){return e?(this.current().body.push(e,"=",t,";"),e):void 0},filter:function(e){return this.state.filters.hasOwnProperty(e)||(this.state.filters[e]=this.nextId(!0)),this.state.filters[e]},ifDefined:function(e,t){return"ifDefined("+e+","+this.escape(t)+")"},plus:function(e,t){return"plus("+e+","+t+")"},return_:function(e){this.current().body.push("return ",e,";")},if_:function(e,t,n){if(e===!0)t();else{var r=this.current().body;r.push("if(",e,"){"),t(),r.push("}"),n&&(r.push("else{"),n(),r.push("}"))}},not:function(e){return"!("+e+")"},notNull:function(e){return e+"!=null"},nonComputedMember:function(e,t){return e+"."+t},computedMember:function(e,t){return e+"["+t+"]"},member:function(e,t,n){return n?this.computedMember(e,t):this.nonComputedMember(e,t)},addEnsureSafeObject:function(e){this.current().body.push(this.ensureSafeObject(e),";")},addEnsureSafeMemberName:function(e){this.current().body.push(this.ensureSafeMemberName(e),";")},addEnsureSafeFunction:function(e){this.current().body.push(this.ensureSafeFunction(e),";")},addEnsureSafeAssignContext:function(e){this.current().body.push(this.ensureSafeAssignContext(e),";")},ensureSafeObject:function(e){return"ensureSafeObject("+e+",text)"},ensureSafeMemberName:function(e){return"ensureSafeMemberName("+e+",text)"},ensureSafeFunction:function(e){return"ensureSafeFunction("+e+",text)"},getStringValue:function(e){this.assign(e,
a.enter(e,null,jr(I)),I=n,F.clone=e,j[F.id]=F,l(F.scope,p,b,A,w,S,x)});v=j})}}}}],Oa="ng-hide",Fa="ng-hide-animate",Ma=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngShow,function(t){e[t?"removeClass":"addClass"](n,Oa,{tempClasses:Fa})})}}}],Na=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,n,r){t.$watch(r.ngHide,function(t){e[t?"addClass":"removeClass"](n,Oa,{tempClasses:Fa})})}}}],Ia=sr(function(e,t,n){e.$watch(n.ngStyle,function(e,n){n&&e!==n&&o(n,function(e,n){t.css(n,"")}),e&&t.css(e)},!0)}),ja=["$animate",function(e){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(n,r,i,a){var s=i.ngSwitch||i.on,u=[],l=[],c=[],f=[],p=function(e,t){return function(){e.splice(t,1)}};n.$watch(s,function(n){var r,i;for(r=0,i=c.length;i>r;++r)e.cancel(c[r]);for(c.length=0,r=0,i=f.length;i>r;++r){var s=ve(l[r].clone);f[r].$destroy();var d=c[r]=e.leave(s);d.then(p(c,r))}l.length=0,f.length=0,(u=a.cases["!"+n]||a.cases["?"])&&o(u,function(n){n.transclude(function(r,i){f.push(i);var o=n.element;r[r.length++]=t.createComment(" end ngSwitchWhen: ");var a={clone:r};l.push(a),e.enter(r,o.parent(),o)})})})}}}],Pa=sr({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){r.cases["!"+n.ngSwitchWhen]=r.cases["!"+n.ngSwitchWhen]||[],r.cases["!"+n.ngSwitchWhen].push({transclude:i,element:t})}}),_a=sr({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,n,r,i){r.cases["?"]=r.cases["?"]||[],r.cases["?"].push({transclude:i,element:t})}}),La=r("ngTransclude"),Ra=sr({restrict:"EAC",link:function(e,t,n,r,i){function o(e){e.length&&(t.empty(),t.append(e))}if(n.ngTransclude===n.$attr.ngTransclude&&(n.ngTransclude=""),!i)throw La("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",K(t));var a=n.ngTransclude||n.ngTranscludeSlot;i(o,null,a)}}),za=["$templateCache",function(e){return{restrict:"E",terminal:!0,compile:function(t,n){if("text/ng-template"==n.type){var r=n.id,i=t[0].text;e.put(r,i)}}}}],Va={$setViewValue:m,$render:m},Ua=["$element","$scope","$attrs",function(e,r,i){var o=this,a=new et;o.ngModelCtrl=Va,o.unknownOption=jr(t.createElement("option")),o.renderUnknownOption=function(t){var n="? "+Ke(t)+" ?";o.unknownOption.val(n),e.prepend(o.unknownOption),e.val(n)},r.$on("$destroy",function(){o.renderUnknownOption=m}),o.removeUnknownOption=function(){o.unknownOption.parent()&&o.unknownOption.remove()},o.readValue=function(){return o.removeUnknownOption(),e.val()},o.writeValue=function(t){o.hasOption(t)?(o.removeUnknownOption(),e.val(t),""===t&&o.emptyOption.prop("selected",!0)):null==t&&o.emptyOption?(o.removeUnknownOption(),e.val("")):o.renderUnknownOption(t)},o.addOption=function(e,t){he(e,'"option value"'),""===e&&(o.emptyOption=t);var n=a.get(e)||0;a.put(e,n+1),o.ngModelCtrl.$render(),Sr(t)},o.removeOption=function(e){var t=a.get(e);t&&(1===t?(a.remove(e),""===e&&(o.emptyOption=n)):a.put(e,t-1))},o.hasOption=function(e){return!!a.get(e)},o.registerOption=function(e,t,n,r,i){if(r){var a;n.$observe("value",function(e){b(a)&&o.removeOption(a),a=e,o.addOption(e,t)})}else i?e.$watch(i,function(e,r){n.$set("value",e),r!==e&&o.removeOption(r),o.addOption(e,t)}):o.addOption(n.value,t);t.on("$destroy",function(){o.removeOption(n.value),o.ngModelCtrl.$render()})}}],qa=function(){function e(e,t,n,r){var i=r[1];if(i){var a=r[0];if(a.ngModelCtrl=i,t.on("change",function(){e.$apply(function(){i.$setViewValue(a.readValue())})}),n.multiple){a.readValue=function(){var e=[];return o(t.find("option"),function(t){t.selected&&e.push(t.value)}),e},a.writeValue=function(e){var n=new et(e);o(t.find("option"),function(e){e.selected=b(n.get(e.value))})};var s,u=NaN;e.$watch(function(){u!==i.$viewValue||q(s,i.$viewValue)||(s=U(i.$viewValue),i.$render()),u=i.$viewValue}),i.$isEmpty=function(e){return!e||0===e.length}}}}function t(e,t,n,r){var i=r[1];if(i){var o=r[0];i.$render=function(){o.writeValue(i.$vi
u=r.toDataURL("image/png"),t.emit("thumbnail",e,u),null!=n?n():void 0}}(this),null!=n&&(i.onerror=n),i.src=t},t.prototype.processQueue=function(){var e,t,n,r;if(t=this.options.parallelUploads,n=this.getUploadingFiles().length,e=n,!(n>=t)&&(r=this.getQueuedFiles(),r.length>0)){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,t-n));for(;t>e;){if(!r.length)return;this.processFile(r.shift()),e++}}},t.prototype.processFile=function(e){return this.processFiles([e])},t.prototype.processFiles=function(e){var n,r,i;for(r=0,i=e.length;i>r;r++)n=e[r],n.processing=!0,n.status=t.UPLOADING,this.emit("processing",n);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)},t.prototype._getFilesWithXhr=function(e){var t,n;return n=function(){var n,r,i,o;for(i=this.files,o=[],n=0,r=i.length;r>n;n++)t=i[n],t.xhr===e&&o.push(t);return o}.call(this)},t.prototype.cancelUpload=function(e){var n,r,i,o,a,s,u;if(e.status===t.UPLOADING){for(r=this._getFilesWithXhr(e.xhr),i=0,a=r.length;a>i;i++)n=r[i],n.status=t.CANCELED;for(e.xhr.abort(),o=0,s=r.length;s>o;o++)n=r[o],this.emit("canceled",n);this.options.uploadMultiple&&this.emit("canceledmultiple",r)}else((u=e.status)===t.ADDED||u===t.QUEUED)&&(e.status=t.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));return this.options.autoProcessQueue?this.processQueue():void 0},i=function(){var e,t;return t=arguments[0],e=2<=arguments.length?l.call(arguments,1):[],"function"==typeof t?t.apply(this,e):t},t.prototype.uploadFile=function(e){return this.uploadFiles([e])},t.prototype.uploadFiles=function(e){var n,o,a,s,u,l,c,f,p,d,h,m,v,g,$,y,b,w,x,C,E,k,S,A,T,D,O,F,M,N,I,j,P,_;for(x=new XMLHttpRequest,C=0,A=e.length;A>C;C++)n=e[C],n.xhr=x;m=i(this.options.method,e),b=i(this.options.url,e),x.open(m,b,!0),x.withCredentials=!!this.options.withCredentials,$=null,a=function(t){return function(){var r,i,o;for(o=[],r=0,i=e.length;i>r;r++)n=e[r],o.push(t._errorProcessing(e,$||t.options.dictResponseError.replace("{{statusCode}}",x.status),x));return o}}(this),y=function(t){return function(r){var i,o,a,s,u,l,c,f,p;if(null!=r)for(o=100*r.loaded/r.total,a=0,l=e.length;l>a;a++)n=e[a],n.upload={progress:o,total:r.total,bytesSent:r.loaded};else{for(i=!0,o=100,s=0,c=e.length;c>s;s++)n=e[s],(100!==n.upload.progress||n.upload.bytesSent!==n.upload.total)&&(i=!1),n.upload.progress=o,n.upload.bytesSent=n.upload.total;if(i)return}for(p=[],u=0,f=e.length;f>u;u++)n=e[u],p.push(t.emit("uploadprogress",n,o,n.upload.bytesSent));return p}}(this),x.onload=function(n){return function(r){var i;if(e[0].status!==t.CANCELED&&4===x.readyState){if($=x.responseText,x.getResponseHeader("content-type")&&~x.getResponseHeader("content-type").indexOf("application/json"))try{$=JSON.parse($)}catch(o){r=o,$="Invalid JSON response from server."}return y(),200<=(i=x.status)&&300>i?n._finished(e,$,r):a()}}}(this),x.onerror=function(n){return function(){return e[0].status!==t.CANCELED?a():void 0}}(this),g=null!=(M=x.upload)?M:x,g.onprogress=y,l={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&r(l,this.options.headers);for(s in l)u=l[s],u&&x.setRequestHeader(s,u);if(o=new FormData,this.options.params){N=this.options.params;for(h in N)w=N[h],o.append(h,w)}for(E=0,T=e.length;T>E;E++)n=e[E],this.emit("sending",n,x,o);if(this.options.uploadMultiple&&this.emit("sendingmultiple",e,x,o),"FORM"===this.element.tagName)for(I=this.element.querySelectorAll("input, textarea, select, button"),k=0,D=I.length;D>k;k++)if(f=I[k],p=f.getAttribute("name"),d=f.getAttribute("type"),"SELECT"===f.tagName&&f.hasAttribute("multiple"))for(j=f.options,S=0,O=j.length;O>S;S++)v=j[S],v.selected&&o.append(p,v.value);else(!d||"checkbox"!==(P=d.toLowerCase())&&"radio"!==P||f.checked)&&o.append(p,f.value);for(c=F=0,_=e.length-1;_>=0?_>=F:F>=_;c=_>=0?++F:--F)o.append(this._getParamName(c),e[c],e[c].name);return this.submitRequest(x,o,e)},t.prototype.submitRequest=function(e,t,n){return e.send(t)},t.prototype._finished=function(e,n,r){v
},Qe.clearData=function(){return le.apply(this,S(arguments))},Qe.getData=function(){return ce.apply(this,S(arguments))},Qe.focus=Qe.activate=function(){return fe.apply(this,S(arguments))},Qe.blur=Qe.deactivate=function(){return pe.apply(this,S(arguments))},Qe.activeElement=function(){return de.apply(this,S(arguments))};var Ye=0,Ze={},Xe=0,Je={},Ke={};A(J,{autoActivate:!0});var et=function(e){var t=this;t.id=""+Ye++,Ze[t.id]={instance:t,elements:[],handlers:{}},e&&t.clip(e),Qe.on("*",function(e){return t.emit(e)}),Qe.on("destroy",function(){t.destroy()}),Qe.create()},tt=function(e,t){var i,o,a,s={},u=Ze[this.id],l=u&&u.handlers;if(!u)throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");if("string"==typeof e&&e)a=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(i in e)C.call(e,i)&&"string"==typeof i&&i&&"function"==typeof e[i]&&this.on(i,e[i]);if(a&&a.length){for(i=0,o=a.length;o>i;i++)e=a[i].replace(/^on/,""),s[e]=!0,l[e]||(l[e]=[]),l[e].push(t);if(s.ready&&z.ready&&this.emit({type:"ready",client:this}),s.error){for(i=0,o=Y.length;o>i;i++)if(z[Y[i].replace(/^flash-/,"")]){this.emit({type:"error",name:Y[i],client:this});break}r!==n&&Qe.version!==r&&this.emit({type:"error",name:"version-mismatch",jsVersion:Qe.version,swfVersion:r})}}return this},nt=function(e,t){var n,r,i,o,a,s=Ze[this.id],u=s&&s.handlers;if(!u)return this;if(0===arguments.length)o=w(u);else if("string"==typeof e&&e)o=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)C.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&this.off(n,e[n]);if(o&&o.length)for(n=0,r=o.length;r>n;n++)if(e=o[n].toLowerCase().replace(/^on/,""),a=u[e],a&&a.length)if(t)for(i=a.indexOf(t);-1!==i;)a.splice(i,1),i=a.indexOf(t,i);else a.length=0;return this},rt=function(e){var t=null,n=Ze[this.id]&&Ze[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:T(n)),t},it=function(e){if(lt.call(this,e)){"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=A({},e));var t=A({},me(e),{client:this});ct.call(this,t)}return this},ot=function(e){if(!Ze[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=ft(e);for(var t=0;t<e.length;t++)if(C.call(e,t)&&e[t]&&1===e[t].nodeType){e[t].zcClippingId?-1===Je[e[t].zcClippingId].indexOf(this.id)&&Je[e[t].zcClippingId].push(this.id):(e[t].zcClippingId="zcClippingId_"+Xe++,Je[e[t].zcClippingId]=[this.id],J.autoActivate===!0&&pt(e[t]));var n=Ze[this.id]&&Ze[this.id].elements;-1===n.indexOf(e[t])&&n.push(e[t])}return this},at=function(e){var t=Ze[this.id];if(!t)return this;var n,r=t.elements;e="undefined"==typeof e?r.slice(0):ft(e);for(var i=e.length;i--;)if(C.call(e,i)&&e[i]&&1===e[i].nodeType){for(n=0;-1!==(n=r.indexOf(e[i],n));)r.splice(n,1);var o=Je[e[i].zcClippingId];if(o){for(n=0;-1!==(n=o.indexOf(this.id,n));)o.splice(n,1);0===o.length&&(J.autoActivate===!0&&dt(e[i]),delete e[i].zcClippingId)}}return this},st=function(){var e=Ze[this.id];return e&&e.elements?e.elements.slice(0):[]},ut=function(){Ze[this.id]&&(this.unclip(),this.off(),delete Ze[this.id])},lt=function(e){if(!e||!e.type)return!1;if(e.client&&e.client!==this)return!1;var t=Ze[this.id],n=t&&t.elements,r=!!n&&n.length>0,i=!e.target||r&&-1!==n.indexOf(e.target),o=e.relatedTarget&&r&&-1!==n.indexOf(e.relatedTarget),a=e.client&&e.client===this;return t&&(i||o||a)?!0:!1},ct=function(e){var t=Ze[this.id];if("object"==typeof e&&e&&e.type&&t){var n=$e(e),r=t&&t.handlers["*"]||[],i=t&&t.handlers[e.type]||[],o=r.concat(i);if(o&&o.length){var s,u,l,c,f,p=this;for(s=0,u=o.length;u>s;s++)l=o[s],c=p,"string"==typeof l&&"function"==typeof a[l]&&(l=a[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(c=l,l=l.handleEvent),"function"==typeof l&&(f=A({},e),ye(l,c,[f],n))}}},ft=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},pt=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=a.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source