function checklength(){var n={url:$(this).attr("action"),query:$(this).find(".js-searchValue").val()},t=n.url+"#!?q="+n.query;return window.location=t,!1}var Core,cookied,backToTop,checkLastRowColour,buildNavigation,headerLoginDrawer,headerSearchDrawer,starRating,bindFlip,cardEqualHeight,validationErrorElements,observer,baseApp,ngFileUpload,baseModule;(function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof module!="undefined"&&module.exports?module.exports=n(require("jquery")):n(jQuery)})(function(n){var o=-1,r=-1,i=function(n){return parseFloat(n)||0},s=function(t){var f=1,e=n(t),u=null,r=[];return e.each(function(){var t=n(this),e=t.offset().top-i(t.css("margin-top")),o=r.length>0?r[r.length-1]:null;o===null?r.push(t):Math.floor(Math.abs(u-e))<=f?r[r.length-1]=o.add(t):r.push(t);u=e}),r},u=function(t){var i={byRow:!0,property:"height",target:null,remove:!1};return typeof t=="object"?n.extend(i,t):(typeof t=="boolean"?i.byRow=t:t==="remove"&&(i.remove=!0),i)},t=n.fn.matchHeight=function(i){var r=u(i),f;return r.remove?(f=this,this.css(r.property,""),n.each(t._groups,function(n,t){t.elements=t.elements.not(f)}),this):this.length<=1&&!r.target?this:(t._groups.push({elements:this,options:r}),t._apply(this,r),this)},f,e;t.version="master";t._groups=[];t._throttle=80;t._maintainScroll=!1;t._beforeUpdate=null;t._afterUpdate=null;t._rows=s;t._parse=i;t._parseOptions=u;t._apply=function(r,f){var e=u(f),o=n(r),c=[o],l=n(window).scrollTop(),a=n("html").outerHeight(!0),h=o.parents().filter(":hidden");return h.each(function(){var t=n(this);t.data("style-cache",t.attr("style"))}),h.css("display","block"),e.byRow&&!e.target&&(o.each(function(){var i=n(this),t=i.css("display");t!=="inline-block"&&t!=="flex"&&t!=="inline-flex"&&(t="block");i.data("style-cache",i.attr("style"));i.css({display:t,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),c=s(o),o.each(function(){var t=n(this);t.attr("style",t.data("style-cache")||"")})),n.each(c,function(t,r){var u=n(r),f=0;if(e.target)f=e.target.outerHeight(!1);else{if(e.byRow&&u.length<=1){u.css(e.property,"");return}u.each(function(){var t=n(this),u=t.attr("style"),i=t.css("display"),r;i!=="inline-block"&&i!=="flex"&&i!=="inline-flex"&&(i="block");r={display:i};r[e.property]="";t.css(r);t.outerHeight(!1)>f&&(f=t.outerHeight(!1));u?t.attr("style",u):t.css("display","")})}u.each(function(){var t=n(this),r=0;e.target&&t.is(e.target)||(t.css("box-sizing")!=="border-box"&&(r+=i(t.css("border-top-width"))+i(t.css("border-bottom-width")),r+=i(t.css("padding-top"))+i(t.css("padding-bottom"))),t.css(e.property,f-r+"px"))})}),h.each(function(){var t=n(this);t.attr("style",t.data("style-cache")||null)}),t._maintainScroll&&n(window).scrollTop(l/a*n("html").outerHeight(!0)),this};t._applyDataApi=function(){var t={};n("[data-match-height], [data-mh]").each(function(){var i=n(this),r=i.attr("data-mh")||i.attr("data-match-height");t[r]=r in t?t[r].add(i):i});n.each(t,function(){this.matchHeight(!0)})};f=function(i){t._beforeUpdate&&t._beforeUpdate(i,t._groups);n.each(t._groups,function(){t._apply(this.elements,this.options)});t._afterUpdate&&t._afterUpdate(i,t._groups)};t._update=function(i,u){if(u&&u.type==="resize"){var e=n(window).width();if(e===o)return;o=e}i?r===-1&&(r=setTimeout(function(){f(u);r=-1},t._throttle)):f(u)};n(t._applyDataApi);e=n.fn.on?"on":"bind";n(window)[e]("load",function(n){t._update(!1,n)});n(window)[e]("resize orientationchange",function(n){t._update(!0,n)})}),function(){function g(n,t){return n.push.apply(n,t),n}function hu(n,t,i,r){for(var f=n.length,u=i+(r?1:-1);r?u--:++u<f;)if(t(n[u],u,n))return u;return-1}function hi(n){return function(i){return i==null?t:i[n]}}function cu(n){return function(i){return n==null?t:n[i]}}function lu(n,t,i,r,u){return u(n,function(n,u,f){i=r?(r=!1,n):t(i,n,u,f)}),i}function au(n,t){return rt(t,function(t){return n[t]})}function yu(n,t){return function(i){return n(t(i))}}function n(n){return n instanceof p?n:new p(n)}function p(n,t){this.__wrapped__=n;this.__actions__=[];this.__chain__=!!t}function nf(n,i,r){var u=n[i];f.call(n,i)&&pt(u,r)&&(r!==t||i in n)||li(n,i,r)}function li(n,t,i){n[t]=i}function ai(n,i,r){if(typeof n!="function")throw new TypeError(b);return setTimeout(function(){n.apply(t,r)},i)}function tf(n,t){var i=!0;return u(n,function(n,r,u){return i=!!t(n,r,u)}),i}function vi(n,i,r){for(var o=-1,h=n.length,f,u,e,s;++o<h;)f=n[o],u=i(f),u!=null&&(e===t?u===u&&!0:r(u,e))&&(e=u,s=f);return s}function ht(n,t){var i=[];return u(n,function(n,r,u){t(n,r,u)&&i.push(n)}),i}function it(n,t,i,r,u){var e=-1,o=n.length,f;for(i||(i=ne),u||(u=[]);++e<o;)f=n[e],t>0&&i(f)?t>1?it(f,t-1,i,r,u):g(u,f):r||(u[u.length]=f);return u}function pi(n,t){return n&&yi(n,t,s)}function wi(n,t){return ht(t,function(t){return v(n[t])})}function e(n){return te(n)}function rf(n,t){return n>t}function uf(n){return o(n)&&e(n)==ii}function lt(n,t,i,r,u){return n===t?!0:n==null||t==null||!o(n)&&!o(t)?n!==n&&t!==t:ff(n,t,i,r,lt,u)}function ff(n,t,r,u,o,s){var p=i(n),nt=i(t),h=p?ni:e(n),c=nt?ni:e(t),a,g,v,y,l;h=h==gt?d:h;c=c==gt?d:c;var w=h==d,tt=c==d,b=h==c;if(s||(s=[]),a=et(s,function(t){return t[0]==n}),g=et(s,function(n){return n[0]==t}),a&&g)return a[1]==t;if(s.push([n,t]),s.push([t,n]),b&&!w)return l=p?bf(n,t,r,u,o,s):kf(n,t,h,r,u,o,s),s.pop(),l;if(!(r&k)&&(v=w&&f.call(n,"__wrapped__"),y=tt&&f.call(t,"__wrapped__"),v||y)){var it=v?n.value():n,rt=y?t.value():t,l=o(it,rt,r,u,s);return s.pop(),l}return b?(l=df(n,t,r,u,o,s),s.pop(),l):!1}function ef(n){return o(n)&&e(n)==ui}function r(n){return typeof n=="function"?n:n==null?y:(typeof n=="object"?bi:hi)(n)}function of(n,t){return n<t}function rt(n,t){var r=-1,i=a(n)?Array(n.length):[];return u(n,function(n,u,f){i[++r]=t(n,u,f)}),i}function bi(n){var t=l(n);return function(i){var u=t.length,r;if(i==null)return!u;for(i=Object(i);u--;)if(r=t[u],!(r in i&&lt(n[r],i[r],k|kt)))return!1;return!0}}function sf(n,t){return n=Object(n),yt(t,function(t,i){return i in n&&(t[i]=n[i]),t},{})}function w(n,t){return vt(nr(n,t,y),n+"")}function ki(n,t,i){var u=-1,r=n.length,f;for(t<0&&(t=-t>r?0:r+t),i=i>r?r:i,i<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0,f=Array(r);++u<r;)f[u]=n[u+t];return f}function ut(n){return ki(n,0,n.length)}function di(n,t){var i;return u(n,function(n,r,u){return i=t(n,r,u),!i}),!!i}function hf(n,t){var i=n;return yt(t,function(n,t){return t.func.apply(t.thisArg,g([n],t.args))},i)}function cf(n,i){if(n!==i){var o=n!==t,s=n===null,r=n===n,u=!1,h=i!==t,c=i===null,f=i===i,e=!1;if(!c&&!e&&!u&&n>i||u&&h&&f&&!c&&!e||s&&h&&f||!o&&f||!r)return 1;if(!s&&!u&&!e&&n<i||e&&o&&r&&!s&&!u||c&&o&&r||!h&&r||!f)return-1}return 0}function ft(n,i,r,u){var h=!r,o,s,f,e;for(r||(r={}),o=-1,s=i.length;++o<s;)f=i[o],e=u?u(r[f],n[f],f,r,n):t,e===t&&(e=n[f]),h?li(r,f,e):nf(r,f,e);return r}function at(n){return w(function(i,r){var e=-1,u=r.length,f=u>1?r[u-1]:t,o;for(f=n.length>3&&typeof f=="function"?(u--,f):t,i=Object(i);++e<u;)o=r[e],o&&n(i,o,e,f);return i})}function lf(n,t){return function(i,r){if(i==null)return i;if(!a(i))return n(i,r);for(var f=i.length,u=t?f:-1,e=Object(i);t?u--:++u<f;)if(r(e[u],u,e)===!1)break;return i}}function af(n){return function(t,i,r){for(var s=-1,f=Object(t),e=r(t),o=e.length,u;o--;)if(u=e[n?o:++s],i(f[u],u,f)===!1)break;return t}}function vf(n){return function(){var r=arguments,t=st(n.prototype),i=n.apply(t,r);return c(i)?i:t}}function yf(n){return function(i,u,f){var o=Object(i),h,e;return a(i)||(h=r(u,3),i=s(i),u=function(n){return h(o[n],n,o)}),e=n(i,u,f),e>-1?o[h?i[e]:e]:t}}function pf(n,t,i,r){function u(){for(var l=-1,s=arguments.length,t=-1,c=r.length,o=Array(c+s),a=this&&this!==h&&this instanceof u?e:n;++t<c;)o[t]=r[t];while(s--)o[t++]=arguments[++l];return a.apply(f?i:this,o)}if(typeof n!="function")throw new TypeError(b);var f=t&dt,e=vf(n);return u}function wf(n,i,r,u){return n===t||pt(n,nt[r])&&!f.call(u,r)?i:n}function bf(n,i,r,u,f,e){var p=r&k,h=n.length,v=i.length,o,a,y;if(h!=v&&!(p&&v>h))return!1;for(var c=-1,s=!0,l=r&kt?[]:t;++c<h;){if(o=n[c],a=i[c],y!==t){if(y)continue;s=!1;break}if(l){if(!di(i,function(n,t){if(!rr(l,t)&&(o===n||f(o,n,r,u,e)))return l.push(t)})){s=!1;break}}else if(!(o===a||f(o,a,r,u,e))){s=!1;break}}return s}function kf(n,t,i){switch(i){case ti:case ii:case ri:return pt(+n,+t);case iu:return n.name==t.name&&n.message==t.message;case ui:case fi:return n==t+""}return!1}function df(n,i,r,u,e,o){var p=r&k,w=s(n),b=w.length,tt=s(i),it=tt.length,c,h,l,y,d,g,nt,a,v;if(b!=it&&!p)return!1;for(c=b;c--;)if(h=w[c],!(p?h in i:f.call(i,h)))return!1;for(l=!0,y=p;++c<b;){if(h=w[c],d=n[h],g=i[h],!(nt===t?d===g||e(d,g,r,u,o):nt)){l=!1;break}y||(y=h=="constructor")}return l&&!y&&(a=n.constructor,v=i.constructor,a!=v&&"constructor"in n&&"constructor"in i&&!(typeof a=="function"&&a instanceof a&&typeof v=="function"&&v instanceof v)&&(l=!1)),l}function gf(n){return vt(nr(n,t,tr),n+"")}function ne(n){return i(n)||ot(n)}function gi(n){var t=[],i;if(n!=null)for(i in Object(n))t.push(i);return t}function te(n){return bu.call(n)}function nr(n,i,r){return i=tt(i===t?n.length-1:i,0),function(){for(var f=arguments,t=-1,e=tt(f.length-i,0),o=Array(e),u;++t<e;)o[t]=f[i+t];for(t=-1,u=Array(i+1);++t<i;)u[t]=f[t];return u[i]=r(o),n.apply(this,u)}}function ie(n){return ht(n,Boolean)}function re(){var n=arguments.length;if(!n)return[];for(var u=Array(n-1),t=arguments[0],r=n;r--;)u[r-1]=arguments[r];return g(i(t)?ut(t):[t],it(u,1))}function ue(n,t,i){var f=n==null?0:n.length,u;return f?(u=i==null?0:wt(i),u<0&&(u=tt(f+u,0)),hu(n,r(t,3),u)):-1}function tr(n){var t=n==null?0:n.length;return t?it(n,1):[]}function fe(n){var t=n==null?0:n.length;return t?it(n,gr):[]}function ir(n){return n&&n.length?n[0]:t}function rr(n,t,i){var f=n==null?0:n.length,r,e,u;for(i=typeof i=="number"?i<0?tt(f+i,0):i:0,r=(i||0)-1,e=t===t;++r<f;)if(u=n[r],e?u===t:u!==u)return r;return-1}function ee(n){var i=n==null?0:n.length;return i?n[i-1]:t}function oe(n,i,r){var u=n==null?0:n.length;return i=i==null?0:+i,r=r===t?u:+r,u?ki(n,i,r):[]}function ur(t){var i=n(t);return i.__chain__=!0,i}function se(n,t){return t(n),n}function he(n,t){return t(n)}function ce(){return hf(this.__wrapped__,this.__actions__)}function le(n,i,u){return i=u?t:i,tf(n,r(i))}function ae(n,t){return ht(n,r(t))}function fr(n,t){return u(n,r(t))}function ve(n,t){return rt(n,r(t))}function yt(n,t,i){return lu(n,r(t),i,arguments.length<3,u)}function ye(n){return n==null?0:(n=a(n)?n:l(n),n.length)}function pe(n,i,u){return i=u?t:i,di(n,r(i))}function we(n,t){var i=0;return t=r(t),rt(rt(n,function(n,r,u){return{value:n,index:i++,criteria:t(n,r,u)}}).sort(function(n,t){return cf(n.criteria,t.criteria)||n.index-t.index}),hi("value"))}function er(n,i){var r;if(typeof i!="function")throw new TypeError(b);return n=wt(n),function(){return--n>0&&(r=i.apply(this,arguments)),n<=1&&(i=t),r}}function ge(n){if(typeof n!="function")throw new TypeError(b);return function(){var t=arguments;return!n.apply(this,t)}}function no(n){return er(2,n)}function to(n){return c(n)?i(n)?ut(n):ft(n,l(n)):n}function pt(n,t){return n===t||n!==n&&t!==t}function a(n){return n!=null&&eo(n.length)&&!v(n)}function io(n){return n===!0||n===!1||o(n)&&e(n)==ti}function ro(n){return a(n)&&(i(n)||cr(n)||v(n.splice)||ot(n))?!n.length:!l(n).length}function uo(n,t){return lt(n,t)}function fo(n){return typeof n=="number"&&gu(n)}function v(n){if(!c(n))return!1;var t=e(n);return t==ru||t==uu||t==tu||t==fu}function eo(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=nu}function c(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function o(n){return n!=null&&typeof n=="object"}function oo(n){return sr(n)&&n!=+n}function so(n){return n===null}function sr(n){return typeof n=="number"||o(n)&&e(n)==ri}function cr(n){return typeof n=="string"||!i(n)&&o(n)&&e(n)==fi}function ho(n){return n===t}function co(n){return a(n)?n.length?ut(n):[]:wr(n)}function ar(n){return typeof n=="string"?n:n==null?"":n+""}function ao(n,t){var i=st(n);return t==null?i:vr(i,t)}function vo(n,t){return n!=null&&f.call(n,t)}function wo(n,i,r){var u=n==null?t:n[i];return u===t&&(u=r),v(u)?u.call(n):u}function wr(n){return n==null?[]:au(n,s(n))}function bo(n){return n=ar(n),n&&eu.test(n)?n.replace(ei,vu):n}function y(n){return n}function ko(n){return bi(vr({},n))}function bt(n,t,i){var f=s(t),r=wi(t,f),e,o;return i!=null||c(t)&&(r.length||!f.length)||(i=t,t=n,n=this,r=wi(t,s(t))),e=!(c(i)&&"chain"in i)||!!i.chain,o=v(n),u(r,function(i){var r=t[i];n[i]=r;o&&(n.prototype[i]=function(){var i=this.__chain__,t,u;return e||i?(t=n(this.__wrapped__),u=t.__actions__=ut(this.__actions__),u.push({func:r,args:arguments,thisArg:n}),t.__chain__=i,t):r.apply(n,g([this.value()],arguments))})}),n}function go(){return h._===this&&(h._=ku),this}function kr(){}function ns(n){var t=++wu;return ar(n)+t}function ts(n){return n&&n.length?vi(n,y,rf):t}function is(n){return n&&n.length?vi(n,y,of):t}var t,b="Expected a function",k=1,kt=2,dt=1,dr=32,gr=1/0,nu=9007199254740991,gt="[object Arguments]",ni="[object Array]",tu="[object AsyncFunction]",ti="[object Boolean]",ii="[object Date]",iu="[object Error]",ru="[object Function]",uu="[object GeneratorFunction]",ri="[object Number]",d="[object Object]",fu="[object Proxy]",ui="[object RegExp]",fi="[object String]",ei=/[&<>"']/g,eu=RegExp(ei.source),ou=typeof global=="object"&&global&&global.Object===Object&&global,su=typeof self=="object"&&self&&self.Object===Object&&self,h=ou||su||Function("return this")(),oi=typeof exports=="object"&&exports&&!exports.nodeType&&exports,si=oi&&typeof module=="object"&&module&&!module.nodeType&&module,vu=cu({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),pu=Array.prototype,nt=Object.prototype,f=nt.hasOwnProperty,wu=0,bu=nt.toString,ku=h._,ci=Object.create,du=nt.propertyIsEnumerable,gu=h.isFinite,l=yu(Object.keys,Object),tt=Math.max,st=function(){function n(){}return function(i){if(!c(i))return{};if(ci)return ci(i);n.prototype=i;var r=new n;return n.prototype=t,r}}(),u,yi,ct,vt,et,ot,i,or,hr,wt,lr,pr,br;p.prototype=st(n.prototype);p.prototype.constructor=p;u=lf(pi);yi=af();ct=kr;vt=y;et=yf(ue);var be=w(function(n,t,i){return pf(n,dt|dr,t,i)}),ke=w(function(n,t){return ai(n,1,t)}),de=w(function(n,t,i){return ai(n,lr(t)||0,i)});ot=ct(function(){return arguments}())?ct:function(n){return o(n)&&f.call(n,"callee")&&!du.call(n,"callee")};i=Array.isArray;or=uf;hr=ef;wt=Number;lr=Number;var vr=at(function(n,t){ft(t,l(t),n)}),yr=at(function(n,t){ft(t,gi(t),n)}),lo=at(function(n,t,i,r){ft(t,yo(t),n,r)});pr=w(function(n){return n.push(t,wf),lo.apply(t,n)});var s=l,yo=gi,po=gf(function(n,t){return n==null?{}:sf(n,t)});br=r;n.assignIn=yr;n.before=er;n.bind=be;n.chain=ur;n.compact=ie;n.concat=re;n.create=ao;n.defaults=pr;n.defer=ke;n.delay=de;n.filter=ae;n.flatten=tr;n.flattenDeep=fe;n.iteratee=br;n.keys=s;n.map=ve;n.matches=ko;n.mixin=bt;n.negate=ge;n.once=no;n.pick=po;n.slice=oe;n.sortBy=we;n.tap=se;n.thru=he;n.toArray=co;n.values=wr;n.extend=yr;bt(n,n);n.clone=to;n.escape=bo;n.every=le;n.find=et;n.forEach=fr;n.has=vo;n.head=ir;n.identity=y;n.indexOf=rr;n.isArguments=ot;n.isArray=i;n.isBoolean=io;n.isDate=or;n.isEmpty=ro;n.isEqual=uo;n.isFinite=fo;n.isFunction=v;n.isNaN=oo;n.isNull=so;n.isNumber=sr;n.isObject=c;n.isRegExp=hr;n.isString=cr;n.isUndefined=ho;n.last=ee;n.max=ts;n.min=is;n.noConflict=go;n.noop=kr;n.reduce=yt;n.result=wo;n.size=ye;n.some=pe;n.uniqueId=ns;n.each=fr;n.first=ir;bt(n,function(){var t={};return pi(n,function(i,r){f.call(n.prototype,r)||(t[r]=i)}),t}(),{chain:!1});n.VERSION="4.17.4";u(["pop","join","replace","reverse","split","push","shift","sort","splice","unshift"],function(t){var r=(/^(?:replace|split)$/.test(t)?String.prototype:pu)[t],u=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",f=/^(?:pop|join|replace|shift)$/.test(t);n.prototype[t]=function(){var t=arguments,n;return f&&!this.__chain__?(n=this.value(),r.apply(i(n)?n:[],t)):this[u](function(n){return r.apply(i(n)?n:[],t)})}});n.prototype.toJSON=n.prototype.valueOf=n.prototype.value=ce;typeof define=="function"&&typeof define.amd=="object"&&define.amd?(h._=n,define(function(){return n})):si?((si.exports=n)._=n,oi._=n):h._=n}.call(this),function(n,t,i){"use strict";function b(n){return n===" "||n==="\t"||n==="\n"||n==="\f"||n==="\r"}function fi(t,i){var r=new n.Image;return r.onerror=function(){o[t]=!1;f()},r.onload=function(){o[t]=r.width===1;f()},r.src=i,"pending"}function ei(){p=!1;a=n.devicePixelRatio;h={};w={};r.DPR=a||1;u.width=Math.max(n.innerWidth||0,e.clientWidth);u.height=Math.max(n.innerHeight||0,e.clientHeight);u.vw=u.width/100;u.vh=u.height/100;v=[u.height,u.width,a].join("-");u.em=r.getEmValue();u.rem=u.em}function oi(n,t,i,r){var f,o,e,u;return y.algorithm==="saveData"?n>2.7?u=i+1:(o=t-i,f=Math.pow(n-.6,1.5),e=o*f,r&&(e+=.1*f),u=n+e):u=i>1?Math.sqrt(n*t):n,u>i}function si(n){var i,t=r.getSet(n),u=!1;t!=="pending"&&(u=v,t&&(i=r.setRes(t),r.applySetCandidate(i,n)));n[r.ns].evaled=u}function hi(n,t){return n.res-t.res}function ci(n,t,i){var u;return!i&&t&&(i=n[r.ns].sets,i=i&&i[i.length-1]),u=pt(t,i),u&&(t=r.makeUrl(t),n[r.ns].curSrc=t,n[r.ns].curCan=u,u.res||ft(u,u.set.sizes)),u}function pt(n,t){var i,f,u;if(n&&t)for(u=r.parseSet(t),n=r.makeUrl(n),i=0;i<u.length;i++)if(n===r.makeUrl(u[i].url)){f=u[i];break}return f}function li(n,t){for(var i,f,o=n.getElementsByTagName("source"),u=0,e=o.length;u<e;u++)i=o[u],i[r.ns]=!0,f=i.getAttribute("srcset"),f&&t.push({srcset:f,media:i.getAttribute("media"),type:i.getAttribute("type"),sizes:i.getAttribute("sizes")})}function ai(n,t){function h(t){var i,r=t.exec(n.substring(e));if(r)return i=r[0],e+=i.length,i}function s(){for(var n=!1,u,r,e,i={},h,v,s,l,y,a=0;a<f.length;a++)h=f[a],v=h[h.length-1],s=h.substring(0,h.length-1),l=parseInt(s,10),y=parseFloat(s),at.test(s)&&v==="w"?((u||r)&&(n=!0),l===0?n=!0:u=l):ui.test(s)&&v==="x"?((u||r||e)&&(n=!0),y<0?n=!0:r=y):at.test(s)&&v==="h"?((e||r)&&(n=!0),l===0?n=!0:e=l):n=!0;n||(i.url=o,u&&(i.w=u),r&&(i.d=r),e&&(i.h=e),e||r||u||(i.d=1),i.d===1&&(t.has1x=!0),i.set=t,c.push(i))}function a(){for(h(ni),i="",u="in descriptor";;){if(r=n.charAt(e),u==="in descriptor")if(b(r))i&&(f.push(i),i="",u="after descriptor");else{if(r===","){e+=1;i&&f.push(i);s();return}if(r==="(")i=i+r,u="in parens";else{if(r===""){i&&f.push(i);s();return}i=i+r}}else if(u==="in parens")if(r===")")i=i+r,u="in descriptor";else{if(r===""){f.push(i);s();return}i=i+r}else if(u==="after descriptor"&&!b(r)){if(r===""){s();return}u="in descriptor";e-=1}e+=1}}for(var l=n.length,o,f,i,u,r,e=0,c=[];;){if(h(ti),e>=l)return c;o=h(ii);f=[];o.slice(-1)===","?(o=o.replace(ri,""),s()):a()}}function vi(n){function c(n){function f(){r&&(u.push(r),r="")}function h(){u[0]&&(s.push(u),u=[])}for(var i,r="",u=[],s=[],e=0,t=0,o=!1;;){if(i=n.charAt(t),i==="")return f(),h(),s;if(o)if(i==="*"&&n[t+1]==="/"){o=!1;t+=2;f();continue}else{t+=1;continue}else if(b(i))if(n.charAt(t-1)&&b(n.charAt(t-1))||!r){t+=1;continue}else if(e===0){f();t+=1;continue}else i=" ";else if(i==="(")e+=1;else if(i===")")e-=1;else if(i===","){f();h();t+=1;continue}else if(i==="/"&&n.charAt(t+1)==="*"){o=!0;t+=2;continue}r=r+i;t+=1}}function l(n){return s.test(n)&&parseFloat(n)>=0?!0:h.test(n)?!0:n==="0"||n==="-0"||n==="+0"?!0:!1}var s=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,h=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i,i,u,o,t,f,e;for(u=c(n),o=u.length,i=0;i<o;i++){if(t=u[i],f=t[t.length-1],l(f))e=f,t.pop();else continue;if(t.length===0)return e;if(t=t.join(" "),r.matchesMedia(t))return e}return"100vw"}t.createElement("picture");var wt,c,et,v,r={},k=!1,l=function(){},s=t.createElement("img"),d=s.getAttribute,ot=s.setAttribute,st=s.removeAttribute,e=t.documentElement,o={},y={algorithm:""},g="data-pfsrc",ht=g+"set",nt=navigator.userAgent,bt=/rident/.test(nt)||/ecko/.test(nt)&&nt.match(/rv\:(\d+)/)&&RegExp.$1>35,tt="currentSrc",kt=/\s+\+?\d+(e\d+)?w/,dt=/(\([^)]+\))?\s*(.+)/,it=n.picturefillCFG,gt="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",ct="font-size:100%!important;",p=!0,h={},w={},a=n.devicePixelRatio,u={px:1,"in":96},lt=t.createElement("a"),rt=!1,ni=/^[ \t\n\r\u000c]+/,ti=/^[, \t\n\r\u000c]+/,ii=/^[^ \t\n\r\u000c]+/,ri=/[,]+$/,at=/^\d+$/,ui=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,vt=function(n,t,i,r){n.addEventListener?n.addEventListener(t,i,r||!1):n.attachEvent&&n.attachEvent("on"+t,i)},ut=function(n){var t={};return function(i){return i in t||(t[i]=n(i)),t[i]}};var yt=function(){var n=/^([\d\.]+)(em|vw|px)$/,t=function(){for(var n=arguments,t=0,i=n[0];++t in n;)i=i.replace(n[t],n[++t]);return i},i=ut(function(n){return"return "+t((n||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/ig,"")+";"});return function(t,r){var f;if(!(t in h))if(h[t]=!1,r&&(f=t.match(n)))h[t]=f[1]*u[f[2]];else try{h[t]=new Function("e",i(t))(u)}catch(e){}return h[t]}}(),ft=function(n,t){return n.w?(n.cWidth=r.calcListLength(t||"100vw"),n.res=n.w/n.cWidth):n.res=n.d,n},f=function(n){if(k){var f,u,e,i=n||{};if(i.elements&&i.elements.nodeType===1&&(i.elements.nodeName.toUpperCase()==="IMG"?i.elements=[i.elements]:(i.context=i.elements,i.elements=null)),f=i.elements||r.qsa(i.context||t,i.reevaluate||i.reselect?r.sel:r.selShort),e=f.length){for(r.setupRun(i),rt=!0,u=0;u<e;u++)r.fillImg(f[u],i);r.teardownRun(i)}}};for(wt=n.console&&console.warn?function(n){console.warn(n)}:l,(tt in s)||(tt="src"),o["image/jpeg"]=!0,o["image/gif"]=!0,o["image/png"]=!0,o["image/svg+xml"]=t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),r.ns=("pf"+(new Date).getTime()).substr(0,9),r.supSrcset=("srcset"in s),r.supSizes=("sizes"in s),r.supPicture=!!n.HTMLPictureElement,r.supSrcset&&r.supPicture&&!r.supSizes&&function(n){s.srcset="data:,a";n.src="data:,a";r.supSrcset=s.complete===n.complete;r.supPicture=r.supSrcset&&r.supPicture}(t.createElement("img")),r.supSrcset&&!r.supSizes?function(){var i="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",n=t.createElement("img"),u=function(){var t=n.width;t===2&&(r.supSizes=!0);et=r.supSrcset&&!r.supSizes;k=!0;setTimeout(f)};n.onload=u;n.onerror=u;n.setAttribute("sizes","9px");n.srcset=i+" 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 9w";n.src=i}():k=!0,r.selShort="picture>img,img[srcset]",r.sel=r.selShort,r.cfg=y,r.DPR=a||1,r.u=u,r.types=o,r.setSize=l,r.makeUrl=ut(function(n){return lt.href=n,lt.href}),r.qsa=function(n,t){return"querySelector"in n?n.querySelectorAll(t):[]},r.matchesMedia=function(){return r.matchesMedia=n.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?function(n){return!n||matchMedia(n).matches}:r.mMQ,r.matchesMedia.apply(this,arguments)},r.mMQ=function(n){return n?yt(n):!0},r.calcLength=function(n){var t=yt(n,!0)||!1;return t<0&&(t=!1),t},r.supportsType=function(n){return n?o[n]:!0},r.parseSize=ut(function(n){var t=(n||"").match(dt);return{media:t&&t[1],length:t&&t[2]}}),r.parseSet=function(n){return n.cands||(n.cands=ai(n.srcset,n)),n.cands},r.getEmValue=function(){var n;if(!c&&(n=t.body)){var i=t.createElement("div"),r=e.style.cssText,u=n.style.cssText;i.style.cssText=gt;e.style.cssText=ct;n.style.cssText=ct;n.appendChild(i);c=i.offsetWidth;n.removeChild(i);c=parseFloat(c,10);e.style.cssText=r;n.style.cssText=u}return c||16},r.calcListLength=function(n){if(!(n in w)||y.uT){var t=r.calcLength(vi(n));w[n]=t?t:u.width}return w[n]},r.setRes=function(n){var t,i,u;if(n)for(t=r.parseSet(n),i=0,u=t.length;i<u;i++)ft(t[i],n.sizes);return t},r.setRes.res=ft,r.applySetCandidate=function(n,t){if(n.length){var f,e,o,l,i,s,u,a,v,h=t[r.ns],c=r.DPR;if(s=h.curSrc||t[tt],u=h.curCan||ci(t,s,n[0].set),u&&u.set===n[0].set&&(v=bt&&!t.complete&&u.res-.1>c,v||(u.cached=!0,u.res>=c&&(i=u))),!i)for(n.sort(hi),l=n.length,i=n[l-1],e=0;e<l;e++)if(f=n[e],f.res>=c){o=e-1;i=n[o]&&(v||s!==r.makeUrl(f.url))&&oi(n[o].res,f.res,c,n[o].cached)?n[o]:f;break}i&&(a=r.makeUrl(i.url),h.curSrc=a,h.curCan=i,a!==s&&r.setSrc(t,i),r.setSize(t))}},r.setSrc=function(n,t){var i;n.src=t.url;t.set.type==="image/svg+xml"&&(i=n.style.width,n.style.width=n.offsetWidth+1+"px",n.offsetWidth+1&&(n.style.width=i))},r.getSet=function(n){for(var t,u,f=!1,e=n[r.ns].sets,i=0;i<e.length&&!f;i++)if(t=e[i],t.srcset&&r.matchesMedia(t.media)&&(u=r.supportsType(t.type))){u==="pending"&&(t=u);f=t;break}return f},r.parseSets=function(n,t,u){var o,e,s,h,c=t&&t.nodeName.toUpperCase()==="PICTURE",f=n[r.ns];(f.src===i||u.src)&&(f.src=d.call(n,"src"),f.src?ot.call(n,g,f.src):st.call(n,g));(f.srcset===i||u.srcset||!r.supSrcset||n.srcset)&&(o=d.call(n,"srcset"),f.srcset=o,h=!0);f.sets=[];c&&(f.pic=!0,li(t,f.sets));f.srcset?(e={srcset:f.srcset,sizes:d.call(n,"sizes")},f.sets.push(e),s=(et||f.src)&&kt.test(f.srcset||""),s||!f.src||pt(f.src,e)||e.has1x||(e.srcset+=", "+f.src,e.cands.push({url:f.src,d:1,set:e}))):f.src&&f.sets.push({srcset:f.src,sizes:null});f.curCan=null;f.curSrc=i;f.supported=!(c||e&&!r.supSrcset||s&&!r.supSizes);h&&r.supSrcset&&!f.supported&&(o?(ot.call(n,ht,o),n.srcset=""):st.call(n,ht));f.supported&&!f.srcset&&(!f.src&&n.src||n.src!==r.makeUrl(f.src))&&(f.src===null?n.removeAttribute("src"):n.src=f.src);f.parsed=!0},r.fillImg=function(n,t){var i,u=t.reselect||t.reevaluate;(n[r.ns]||(n[r.ns]={}),i=n[r.ns],u||i.evaled!==v)&&((!i.parsed||t.reevaluate)&&r.parseSets(n,n.parentNode,t),i.supported?i.evaled=v:si(n))},r.setupRun=function(){(!rt||p||a!==n.devicePixelRatio)&&ei()},r.supPicture?(f=l,r.fillImg=l):function(){var i,h=n.attachEvent?/d$|^c/:/d$|^c|^i/,f=function(){var n=t.readyState||"";o=setTimeout(f,n==="loading"?200:999);t.body&&(r.fillImgs(),i=i||h.test(n),i&&clearTimeout(o))},o=setTimeout(f,t.body?9:99),c=function(n,t){var i,r,u=function(){var f=new Date-r;f<t?i=setTimeout(u,t-f):(i=null,n())};return function(){r=new Date;i||(i=setTimeout(u,t))}},s=e.clientHeight,l=function(){p=Math.max(n.innerWidth||0,e.clientWidth)!==u.width||e.clientHeight!==s;s=e.clientHeight;p&&r.fillImgs()};vt(n,"resize",c(l,99));vt(t,"readystatechange",f)}(),r.picturefill=f,r.fillImgs=f,r.teardownRun=l,f._=r,n.picturefillCFG={pf:r,push:function(n){var t=n.shift();typeof r[t]=="function"?r[t].apply(r,n):(y[t]=n[0],rt&&r.fillImgs({reselect:!0}))}};it&&it.length;)n.picturefillCFG.push(it.shift());n.picturefill=f;typeof module=="object"&&typeof module.exports=="object"?module.exports=f:typeof define=="function"&&define.amd&&define("picturefill",function(){return f});r.supPicture||(o["image/webp"]=fi("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))}(window,document);Core=function(){"use strict";var n={};return n.bindEvent=function(n,t,i){n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent&&n.attachEvent("on"+t,i)},n.debounce=function(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;i||n.apply(u,f)},o=i&&!r;clearTimeout(r);r=setTimeout(e,t);o&&n.apply(u,f)}},n.getIEVersion=function(){var n=-1,t,i;return navigator.appName=="Microsoft Internet Explorer"&&(t=navigator.userAgent,i=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),i.exec(t)!==null&&(n=parseFloat(RegExp.$1))),n},n.mediaQuery=function(t,i){n.getIEVersion()>9||n.getIEVersion()<=0?(this.media=window.matchMedia(t),this.media.addListener(function(n){i(n)}),i(this.media)):i("Not supported")},n.setStorage=function(n,t,i,r){var u,f;r?(u=new Date,u.setDate(u.getDate()+i),f=i>0?escape(t)+(i==null?"":"; expires="+u.toUTCString()):escape(t),document.cookie=n+"="+f+";path=/"):"localStorage"in window&&window.localStorage!==null?window.localStorage.setItem(n,t):(u=new Date,u.setDate(u.getDate()+i),f=escape(t)+(i==null?"":"; expires="+u.toUTCString()),document.cookie=n+"="+f+";path=/")},n.getStorage=function(n,t){var i,u,f,r;if(t){for(r=document.cookie.split(";"),i=0;i<r.length;i++)if(u=r[i].substr(0,r[i].indexOf("=")),f=r[i].substr(r[i].indexOf("=")+1),u=u.replace(/^\s+|\s+$/g,""),u==n)return unescape(f)}else{if("localStorage"in window&&window.localStorage!==null)return window.localStorage.getItem(n);for(r=document.cookie.split(";"),i=0;i<r.length;i++)if(u=r[i].substr(0,r[i].indexOf("=")),f=r[i].substr(r[i].indexOf("=")+1),u=u.replace(/^\s+|\s+$/g,""),u==n)return unescape(f)}},n.clearStorage=function(t,i){i?n.setStorage(encodeURIComponent(t),"",-1,!0):"localStorage"in window&&window.localStorage!==null?window.localStorage.removeItem(t):n.setStorage(encodeURIComponent(t),"",-1,!0)},n}();cookied=function(){function t(n,t,i){var r=new Date,u;r.setDate(r.getDate()+i);u=escape(t)+(i==null?"":"; expires="+r.toUTCString())+"; path=/";document.cookie=n+"="+u}function i(n){for(var r,u,i=document.cookie.split(";"),t=0;t<i.length;t++)if(r=i[t].substr(0,i[t].indexOf("=")),u=i[t].substr(i[t].indexOf("=")+1),r=r.replace(/^\s+|\s+$/g,""),r==n)return unescape(u)}function r(){var u='<div class="cookiedOuter"><div class="cookied"><p>'+n.Options.message+' <a href="'+n.Options.cookiePolicyLink+'">'+n.Options.cookiePolicyLinkText+'<\/a><\/p>  <a href="#" class="cookiedOK">'+n.Options.cookieButtonText+"<\/a><\/div><\/div>",r=i("cookieOK");if(r==null||r==""){$("body").prepend(u).addClass("cookie-is-active");switch(n.Options.position){case"top":$(".cookied").css("top","0");break;case"bottom":$(".cookied").css("bottom","0");break;case"widget":$(".cookied").addClass("cookiedWidget")}$(".cookied").fadeIn();$(".cookied a.cookiedOK").click(function(){return t("cookieOK",r,365),$(".cookied").fadeOut(),$("body").removeClass("cookie-is-active"),!1})}}var n=this;n.Options=new cookied.opt;this.Init=r};cookied.opt=function(){this.position="top";this.message="This site uses cookies.";this.cookiePolicyLink="";this.cookiePolicyLinkText="Please read our cookie policy.";this.cookieButtonText="Close 2"};backToTop=function(){"use strict";var n={offset:300,scrollTopDuration:700,backToTopSelector:$(".js-backToTop")},t;$(window).scroll(function(){$(this).scrollTop()>n.offset?n.backToTopSelector.addClass("back-to-top-visible"):n.backToTopSelector.removeClass("back-to-top-visible")});n.backToTopSelector.on("click",function(n){t(n)});t=function(t){t.preventDefault();$("body,html").animate({scrollTop:0},n.scrollTopDuration)}}();$(".js-reveal").off().on("click",function(){var n=$(this),t=n.attr("data-revealedContentId"),i;return $("#"+t).length>0&&(n.hasClass("is-active")?(n.parent().children('[data-revealedContentId="'+t+'"]').removeClass("is-active"),$("#"+t).removeClass("is-active")):(i=n.parent().children(".revealedContent.is-active"),i.length>0?(i.removeClass("is-active"),n.parent().children(".js-reveal").removeClass("is-active"),n.parent().children('[data-revealedContentId="'+t+'"]').addClass("is-active"),$("#"+t).addClass("is-active")):(n.parent().children(".js-reveal").removeClass("is-active"),n.parent().children('[data-revealedContentId="'+t+'"]').addClass("is-active"),$("#"+t).addClass("is-active")))),!1});checkLastRowColour=function(){var n={block:$(".page > .block, .page .block-container > .block").last(),blockName:$(".page > .block, .page .block-container > .block").length?$(".page > .block, .page .block-container > .block").last().attr("class").split(" ")[1]:null,footer:$(".footer-container"),blocks:["featuredcontentblock","socialshareblock","rowblockwithsidebar","rowblock"],searchBlocks:["bookquicksearchblock","resourcequicksearchblock","booklistquicksearchblock","calltoactionblock"]};n.blocks.indexOf(n.blockName)>-1?n.block.hasClass("has-alternative-background-colour")?n.footer.addClass("has-alternative-background-colour"):n.block.hasClass("style-primary")?n.footer.addClass("has-style-primary"):n.block.hasClass("style-secondary")?n.footer.addClass("has-style-secondary"):n.block.hasClass("style-tertiary")?n.footer.addClass("has-style-tertiary"):n.block.hasClass("style-quaternary")?n.footer.addClass("has-style-quaternary"):n.block.hasClass("style-quinary")?n.footer.addClass("has-style-quinary"):n.block.hasClass("socialshareblock")&&n.footer.addClass("has-style-default"):n.searchBlocks.indexOf(n.blockName)>-1&&(n.footer.addClass("has-alternative-background-colour"),n.block.addClass("no-lower-shadow"))}();$(".js-searchForm").bind("submit",checklength);$(".js-mobileSearchForm").bind("submit",checklength);$(".js-socialShare").on("click",function(n){n.preventDefault();windowPopup($(this).attr("href"),500,300)});var windowPopup=function(n,t,i){var r=screen.width/2-t/2,u=screen.height/2-i/2;window.open(n,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width="+t+",height="+i+",top="+u+",left="+r)},mainDebounce=Core.debounce(function(){"use strict";var n={byRow:!0,property:"height",target:null,remove:!1};$.fn.matchHeight._maintainScroll=!0;$(".equal-heights .js-podTitle").matchHeight(n);$(".equal-heights .js-equalHeight").matchHeight(n);buildNavigation();headerLoginDrawer();headerSearchDrawer()},250),windowWidth=$(window).width();Core.bindEvent(window,"resize",function(){$(window).width()!==windowWidth&&(windowWidth=$(window).width(),mainDebounce())});mainDebounce();buildNavigation=function(){var n;if($("#navtrigger").is(":visible")){setTimeout(function(){var n=$("#mobilenavigation").outerHeight(),r=$(window).height(),t,i;$("#mobilenavigation").css({height:n,"min-height":r,top:-n,display:"none"});t="@-webkit-keyframes openNav {0%{ top: -"+n+"px; }100%{ top: 0; }}@-moz-keyframes openNav {0%{ top: -"+n+"px; }100%{ top: 0; }}@keyframes openNav {0%{ top: -"+n+"; }100%{ top: 0; }}";i="@-webkit-keyframes closeNav {0%{ top: 0; }100%{ top: -"+n+"px; }}@-moz-keyframes closeNav {0%{ top: 0; }100%{ top: -"+n+"px; }}@keyframes closeNav {0%{ top: 0; }100%{ top: -"+n+"px; }}";$("head").append("<style>"+t+i+"<\/style>")},200);$("#navtrigger").off().on("click",function(){$("#mobilenavigation").removeClass("is-closed").addClass("is-open");$("#mobilenavigation").css("visibility","visible");$("#mobilenavigation").css("display","block");$("#mobilenavigation").css("height","");$(".pagewrap").fadeOut(800);$(".pagewrap").addClass("mobile-navigation-is-active")});$(".mobilenavigation-closeMenu").off().on("click",function(){u();$("#mobilenavigation").removeClass("is-open").addClass("is-closed");$(".pagewrap").fadeIn(800);$(".pagewrap").removeClass("mobile-navigation-is-active")});var i=function(n){return n.siblings().hide(),n.addClass("is-selected"),n.find("> ul").show(),n.find("> ul > li").each(function(n){var t=$(this);setTimeout(function(){t.addClass("animate-in")},150*(n+1))}),setTimeout(function(){var t=n.find(" > .mobilenavigation-link").height();n.find(" > .mobilenavigation-iconLink").height(t)},25),!1},r=function(n){return n.hide().fadeIn(800),n.siblings().fadeIn(800),n.removeClass("is-selected"),n.find("li").removeClass("is-selected animate-in").show(),n.find("ul").hide(),n.find(".mobilenavigation-iconLink").removeAttr("style"),!1},u=function(){var n=$(".mobilenavigation-primary");n.hide().fadeIn(800);n.siblings().fadeIn(800);n.find("ul").hide();n.find("li").removeClass("is-selected animate-in").show();n.find(".mobilenavigation-iconLink").removeAttr("style");$("#mobilenavigation").removeClass("is-in-use")},t=function(n){location.href=n};$("#mobilenavigation a").off().on("click",function(){var n=$(this),u=n.closest("li"),f=n.closest("ul");if(f.hasClass("mobilenavigation-primary"))return u.hasClass("is-selected")&&n.hasClass("mobilenavigation-iconLink")?($("#mobilenavigation").removeClass("is-in-use"),r(u)):n.hasClass("mobilenavigation-iconLink")?(i(u),$("#mobilenavigation").addClass("is-in-use")):t(n.attr("href")),!1;if(n.hasClass("mobilenavigation-link"))t(n.attr("href"));else if(n.hasClass("mobilenavigation-donateCta"))t(n.attr("href"));else return u.hasClass("is-selected")&&n.hasClass("mobilenavigation-iconLink")?r(u):n.hasClass("mobilenavigation-iconLink")&&(i(u),$("#mobilenavigation").addClass("is-in-use")),!1});$(".mobilenavigation-headerTitle").on("click",function(){return u(),!1})}else{$(".pagewrap").show();n={navigationItem:$(".navigation-item"),navigationLink:$(".navigation-item > a")};n.navigationItem.on("mouseenter",function(){var n=$(this),t;if(n.hasClass("has-dropdown")){t=setTimeout(function(){n.addClass("is-open")},70);n.on("mouseleave",function(){clearTimeout(t);n.removeClass("is-open")})}});$(".navigation a").on("focus",function(){var t=$(this);n.navigationItem.removeClass("is-open");t.parent().hasClass("has-dropdown")?t.parent().addClass("is-open"):t.closest(".has-dropdown").addClass("is-open")});n.navigationLink.on("touchstart",function(t){t.preventDefault();var i=$(this);i.parent().hasClass("has-dropdown")?i.parent().hasClass("is-open")?window.location=i.attr("href"):(n.navigationItem.removeClass("is-open"),i.parent().addClass("is-open")):window.location=i.attr("href")})}};headerLoginDrawer=function(){var n={logintrigger:$(".logintrigger"),drawerToggle:$(".logintrigger-drawerToggle"),siteOverlay:$(".siteoverlay"),headerdrawer:$(".headerdrawer")},t;if(n.logintrigger.is(":visible")){n.drawerToggle.off().on("click",function(n){t(n)});n.siteOverlay.off().on("click",function(n){t(n)});t=function(t){t.preventDefault();var i=n.drawerToggle.attr("aria-expanded")==="true";n.drawerToggle.attr("aria-expanded",!i);n.headerdrawer.toggleClass("is-open");n.logintrigger.toggleClass("is-open");n.siteOverlay.hasClass("is-open")?(n.siteOverlay.removeClass("is-open"),n.siteOverlay.addClass("is-closed")):(n.siteOverlay.removeClass("is-closed"),n.siteOverlay.addClass("is-open"));n.drawerToggle.attr("aria-expanded",String(!i))}}};$(".logintrigger-profileToggle").on("click",function(){$(".logintrigger-profileToggle").toggleClass("active");$(".headerdrawer-panel").toggleClass("is-open")});$(".headerdrawer-profile__more").on("click",function(){$(".headerdrawer").toggleClass("is-collapsed");$(".headerdrawer-programmes").toggleClass("is-collapsed");var n=$(".headerdrawer-profile__more").attr("data-alt-text"),t=$(".headerdrawer-profile__more").attr("data-main-text"),i=$(".headerdrawer-profile__more").text();$(".headerdrawer-profile__more").text(n);$(".headerdrawer-profile__more").attr("data-alt-text",t);$(".headerdrawer-profile__more").attr("data-main-text",n)});if(headerSearchDrawer=function(){var n={headerSearch:$(".headersearch"),headerSearchInput:$("#main-header-search"),headerSearchIcon:$(".navigation-searchIcon")};if(n.headerSearch.is(":visible"))n.headerSearchIcon.off().on("click",function(t){var i=n.headerSearchIcon.attr("aria-expanded")==="true";n.headerSearchIcon.attr("aria-expanded",!i);t.target===n.headerSearchIcon[0]&&(t.preventDefault(),n.headerSearch.toggleClass("is-open"));n.headerSearchIcon.attr("aria-expanded",String(!i));n.headerSearchInput.focus()})},starRating=function(){var n={ratingSelector:$(".js-starRating")};n.ratingSelector.each(function(){var n=$(this).find(".starRating-star"),t=$(this).attr("data-rating");$(n[t-1]).addClass("is-active")})}(),$(".bookquicksearch form").submit(function(n){n.preventDefault();var t={url:$(this).attr("action"),type:$(this).find("input[name=type]").val(),query:$(this).find(".bookquicksearch-searchInput > input").val(),cat:$(this).find(".bookquicksearch-select > select").val()},i=t.url+"#!?type="+t.type+"&q="+t.query+"&cat="+t.cat;window.location=i}),$(".booklistquicksearch form").submit(function(n){n.preventDefault();var t={url:$(this).attr("action"),type:$(this).find("input[name=type]").val(),query:$(this).find(".booklistquicksearch-searchInput > input").val(),cat:$(this).find(".booklistquicksearch-select > select").val()},i=t.url+"#!?type="+t.type+"&q="+t.query+"&cat="+t.cat;window.location=i}),$(".resourcequicksearch form").submit(function(n){var t,i;n.preventDefault();t={url:$(this).attr("action"),type:$(this).find("input[name=type]").val(),query:$(this).find(".resourcequicksearch-searchInput > input").val(),age:$(this).find(".resourcequicksearch-select.age > select").val(),resource:$(this).find(".resourcequicksearch-select.resource > select").val(),categories:[]};t.age.length>0&&t.categories.push(t.age);t.resource.length>0&&t.categories.push(t.resource);i=t.url+"#!?type="+t.type+"&q="+t.query+"&cat="+t.categories;window.location=i}),bindFlip=function(n){"use strict";var t=$(n);t.off().on("click touchend",function(){var n=$(this).parent().parent();return n.toggleClass("is-active"),n.hasClass("is-active")?n.find(".toggleFlip").attr("aria-pressed",!0):n.find(".toggleFlip").attr("aria-pressed",!1),!1})},bindFlip(".toggleFlip"),cardEqualHeight=function(){var n=function(){var u=$(".booklisting-bookshelf .book-wrapper"),n,f,t,r;for(i=0;i<u.length;i++)n=u[i],$(n).children().height(""),t=$(n).find(".book-front").outerHeight(),r=$(n).find(".book-back").outerHeight(),f=t>r?t:r,$(n).height(f)},t;n();t={byRow:!0,property:"height",target:null,remove:!1};$(".book").matchHeight(t);$.fn.matchHeight._beforeUpdate=function(){n()}}(),$(".search-filtersButton"))$(".search-filtersButton").on("click",function(){$(".search-accordionToggle").trigger("click")});$(".subnavigation-close").click(function(){$(this).closest(".navigation-item").removeClass("is-open")});$(".subnavigation").keydown(function(n){n.keyCode==27&&$(this).closest(".navigation-item").removeClass("is-open")});$("#age-expand").on("click",function(n){var t=$(n.currentTarget);t.attr("aria-expanded")==="false"?$(this).attr("aria-expanded","true"):$(this).attr("aria-expanded","false")});$("#theme-expand").on("click",function(n){var t=$(n.currentTarget);t.attr("aria-expanded")==="false"?$(this).attr("aria-expanded","true"):$(this).attr("aria-expanded","false")});$("#theme-expand-initial").on("click",function(n){var t=$(n.currentTarget);t.attr("aria-expanded")==="false"?$(this).attr("aria-expanded","true"):$(this).attr("aria-expanded","false")});$("#age-expand-initial").on("click",function(n){var t=$(n.currentTarget);t.attr("aria-expanded")==="false"?$(this).attr("aria-expanded","true"):$(this).attr("aria-expanded","false")});$(".search-tab").click(function(){$("li.search-tab.is-current").find("a").attr("aria-selected","true")});$(".bookdetail-tab").click(function(){$("li.bookdetail-tab.is-current").find("a").attr("aria-selected","true")});$(".bookdetail-tab").click(function(){$("li.bookdetail-tab").find("a").attr("aria-selected","false")});$(document).on("click",".search-accordionTitle a",function(n){var t=$(n.currentTarget);t.attr("aria-expanded")==="false"?$(this).attr("aria-expanded","true"):$(this).attr("aria-expanded","false")});$("form[data-f-type=form] button[data-f-type=submitbutton]").click(function(){var n=$(this).closest("form[data-f-type=form]").find("input[aria-invalid=true]");n.length>0&&n.first().focus()});validationErrorElements=$("span.Form__Element__ValidationError");validationErrorElements.length>0&&(observer=new MutationObserver(function(n){$(n).each(function(){var n=this,t;$(n.target).text(function(){var t=$(n.target.parentElement).find(".Form__Element__Caption").first().text().replace("*","");return $(this).text().replace("This field",t)});t=$(n.target).is(":visible");$(n.target.parentElement).find("input, select, textarea").first().attr("aria-invalid",t)});var t=$("*[aria-invalid=true]");t.length>0&&t.first().focus()}),validationErrorElements.each(function(){observer.observe(this,{attributes:!0,attributeFilter:["style"]})}));baseApp=angular.module("baseApp",["base.module","lodash.module","vcRecaptcha","ngAria"],["$locationProvider",function(n){n.html5Mode({enabled:!1})}]).run(["$rootScope",function(n){n.$on("serviceLayerErrorEvent",function(){console.log(arguments[0].name,Array.prototype.slice.call(arguments,1))})}]),function(){"use strict";angular.module("articleListingBlock.controller",[]).controller("articleListingBlockController",["$scope","endpoints","$window","$timeout","$location","helper","$sce",function(n,t,i,r,u,f){n.parentPageId=0;n.parentMediaFolderId=0;n.categoryFilters=[];n.pageNo=1;n.pageSize=5;n.displayHiddenContent=!1;n.languageBranch=$("html").attr("lang");n.sortOption="MostRecent";n.currentPage=1;n.query="";n.tagsShown=5;n.onLoad=function(t){if(n.parentElement=$("#"+t),n.parentElement.data("parent-id")&&(n.parentPageId=n.parentElement.data("parent-id")),n.parentElement.data("parentmedia-id")&&(n.parentMediaFolderId=n.parentElement.data("parentmedia-id")),n.parentElement.data("ordering")&&(n.sortOption=n.parentElement.data("ordering")),n.parentElement.data("search-page")&&(n.searchPage=n.parentElement.data("search-page")),n.parentElement.data("page-size")&&(n.pageSize=n.parentElement.data("page-size")),n.parentElement.data("page-size")&&(n.pageSize=n.parentElement.data("page-size")),n.parentElement.data("display-hidden-content")&&(n.displayHiddenContent=n.parentElement.data("display-hidden-content")),n.parentElement.data("categories")){var i=n.parentElement.data("categories").toString();i.indexOf(",")>=0?n.categoryFilters=i.split(","):n.categoryFilters.push(i.toString())}n.setSearchObject();n.getResults()};u.search().q&&(n.query=u.search().q);u.search().sortOption&&(n.sortOption=u.search().sortOption);u.search().pageNo&&(n.pageNo=u.search().pageNo);n.$watch(function(){return n.query},function(n){u.search("q",n)});n.$watch(function(){return n.sortOption},function(n){u.search("sortOption",n)});n.$watch(function(){return n.pageNo},function(n){u.search("pageNo",n)});n.getResults=function(){t.articleListingData.post(n.searchQuery).then(function(t){n.results=t.results;n.dataLoaded=!0;n.results&&t.paging&&(n.totalResults=t.paging.totalResults)})};n.setQuery=function(){n.dataLoaded=!1;n.pageNo=1;n.setSearchObject();n.getResults()};n.clearQuery=function(){n.query="";n.dataLoaded=!1;n.setSearchObject();n.getResults()};n.setSearchObject=function(){n.searchQuery={query:n.query,parentPageId:n.parentPageId,parentMediaFolderId:n.parentMediaFolderId,categories:n.categoryFilters,sortOption:n.sortOption,pageNo:n.pageNo,pageSize:n.pageSize,languageBranch:n.languageBranch,displayHiddenContent:n.displayHiddenContent}};n.returnReadableSize=function(n){return f.convertToReadableSize(n,0)};n.updateSortOption=function(){n.dataLoaded=!1;n.searchQuery.sortOption=n.sortOption;n.searchQuery.PageNo=1;n.pageNo=1;n.currentPage=1;n.getResults()};n.slideToResults=function(){r(function(){$("html, body").animate({scrollTop:$(".js-article-listing-container").offset().top-40},500)},250)};n.changePage=function(t){n.dataLoaded=!1;n.searchQuery.PageNo=t;n.getResults();r(function(){$("html, body").animate({scrollTop:n.parentElement.offset().top-0},500)},250)}}])}(),function(){"use strict";angular.module("bookFinderBlock.controller",[]).controller("bookFinderBlockController",["$scope","$timeout","endpoints","$window","$filter","$location",function(n,t,i){n.ageGroupOpen=!0;n.themesOpen=!1;n.themesDisabled=!0;n.themes=[];n.submitButtonDisabled=!0;n.onLoad=function(t){n.parentElement=$("#"+t);n.pageUrl="";n.parentElement.data("page-url")&&(n.pageUrl=n.parentElement.data("page-url"));n.getCategories()};n.getCategories=function(){i.bookFinderCategories.get().then(function(t){n.categories=t.themes})};n.setAgeGroup=function(i){angular.forEach(n.categories,function(n){n.selected=n.id===i.id?!0:!1});n.selectedAgeGroup=i.name;n.themesDisabled=!1;n.ageGroupOpen=!1;n.themesOpen=!0;t(function(){$("html, body").animate({scrollTop:n.parentElement.offset().top-0},500)},250)};n.setTheme=function(t){t.selected==!0?n.themes.push(t.id):t.selected==!1&&(n.themes=_.filter(n.themes,function(n){return n!==t.id}));n.submitButtonDisabled=n.themes.length>0?!1:!0};n.toggleThemes=function(i,r){r===!1&&(n.themesOpen=!i,t(function(){$("html, body").animate({scrollTop:n.parentElement.offset().top-0},500)},250))};n.removeCategory=function(t){var i=t;angular.forEach(n.categories,function(n){angular.forEach(n.childCategories,function(n){n.id==i&&(n.selected=!1)})});n.themes=_.filter(n.themes,function(n){return n!==i});n.submitButtonDisabled=n.themes.length>0?!1:!0};n.toggleAgeGroup=function(i){n.ageGroupOpen=!i;t(function(){$("html, body").animate({scrollTop:n.parentElement.offset().top-0},500)},250)};n.redirectToSearchPage=function(){var t=[],i;angular.forEach(n.categories,function(n){n.selected===!0&&t.push(n.id);angular.forEach(n.childCategories,function(n){n.selected===!0&&t.push(n.id)})});i=n.pageUrl+"#!?cat="+t;window.location=i}}])}(),function(){"use strict";angular.module("booklistShelfListingBlock.controller",[]).controller("booklistShelfListingBlockController",["$scope","$timeout","endpoints","$window","$filter","$location","$sce",function(n,t,i,r,u,f,e){n.sortOption="AtoZ";n.pageNo=1;n.pageSize=16;n.languageBranch=$("html").attr("lang");n.onLoad=function(t){n.parentElement=$("#"+t);n.resultContainer=$("#"+t).find(".booklistshelflisting-header");n.parentElement.data("booklist-id")&&(n.booklistId=n.parentElement.data("booklist-id"));f.search().sortOption&&(n.sortOption=f.search().sortOption);f.search().pageNo&&(n.pageNo=parseInt(f.search().pageNo));f.search().pageSize&&(n.pageSize=parseInt(f.search().pageSize));n.$watch(function(){return n.sortOption},function(n){f.search("sortOption",n)});n.$watch(function(){return n.pageNo},function(n){f.search("pageNo",n)});n.$watch(function(){return n.pageSize},function(n){f.search("pageSize",n)});n.setSearchObject();n.getResults()};n.getResults=function(){i.booklistData.post(n.searchObject).then(function(t){n.results=t.results;n.dataLoaded=!0;n.results&&t.paging&&(n.totalResults=t.paging.totalResults)})};n.setSearchObject=function(){n.searchObject={sortOption:n.sortOption,pageNo:parseInt(n.pageNo),pageSize:parseInt(n.pageSize),languageBranch:n.languageBranch,booklistId:n.booklistId,summaryLength:120}};n.changePage=function(t){n.dataLoaded=!1;n.pageNo=t;n.setSearchObject();n.getResults()};n.renderHtml=function(n){if(n){var t=angular.element("<textarea />").html(n).text();return e.trustAsHtml(t)}};n.updateSortOption=function(){n.dataLoaded=!1;n.pageNo=1;n.setSearchObject();n.getResults()};n.updateNumberOfPages=function(t){n.dataLoaded=!1;n.pageNo=1;n.pageSize=parseInt(t);n.setSearchObject();n.getResults()};n.slideToResults=function(){t(function(){$("html, body").animate({scrollTop:n.resultContainer.offset().top-0},500)},250)}}])}(),function(){"use strict";angular.module("bookReviewBlock.controller",[]).controller("bookReviewBlockController",["$scope","endpoints","$window","$location","_","vcRecaptchaService",function(n,t){n.starRating=null;n.name="";n.location="";n.review="";n.bookId=null;n.submitted=!1;n.reviewSubmitting=!1;n.searchObject={};n.onLoad=function(t){n.parentElement=$("#"+t);n.parentElement.data("book-id")&&(n.bookId=n.parentElement.data("book-id"))};n.setRating=function(t){return n.starRating=t,$(".starRatingInput-star").attr("aria-pressed","false"),$(".starRatingInput-star:nth-last-of-type("+t+")").attr("aria-pressed","true"),!1};n.submit=function(){n.submitted=!0;n.showSuccess=!1;n.showFailed=!1;n.form.$valid?(n.upload(),n.reviewSubmitting=!0):angular.element("input.ng-invalid, textarea.ng-invalid").first().focus()};n.upload=function(){n.searchObject={starRating:n.starRating,name:n.name,location:n.location,review:n.review,bookId:n.bookId,recaptchaResponse:n.recaptchaResponse};t.bookReview.post(n.searchObject).then(function(){n.showSuccess=!0;n.showFailed=!1;n.reviewSubmitting=!1;n.starRating=null;n.name="";n.location="";n.review="";n.bookId=null;n.submitted=!1},function(){n.showSuccess=!1;n.showFailed=!0;n.reviewSubmitting=!1});$("html, body").animate({scrollTop:n.parentElement.offset().top-145},500)};n.hasError=function(t,i){return i?n.submitted&&n.form[t].$error[i]:n.submitted&&n.form[t].$invalid}}])}(),function(){"use strict";angular.module("bookShelfListingBlock.controller",[]).controller("bookShelfListingBlockController",["$scope","$timeout","endpoints","$window","$filter","$location","$sce",function(n,t,i,r,u,f,e){n.query="";n.type="Book";n.categories=[];n.sortOption="Relevance";n.pageNo=1;n.pageSize=8;n.languageBranch=$("html").attr("lang");n.ageGroup=null;n.themesDisabled=!0;n.submitButtonDisabled=!0;n.selectedAgeGroups=[];n.selectedThemes=[];n.searchObject={query:n.query,type:n.type,sortOption:n.sortOption,categories:angular.copy(n.categories),pageNo:parseInt(n.pageNo),pageSize:parseInt(n.pageSize),languageBranch:n.languageBranch,flattenCategories:!1,summaryLength:150};n.onLoad=function(t){n.parentElement=$("#"+t);n.resultContainer=$("#"+t).find(".bookshelflisting-header");n.getFilters()};f.search().sortOption&&(n.sortOption=f.search().sortOption);f.search().pageNo&&(n.pageNo=parseInt(f.search().pageNo));f.search().pageSize&&(n.pageSize=parseInt(f.search().pageSize));n.$watch(function(){return n.sortOption},function(n){f.search("sortOption",n)});n.$watch(function(){return n.pageNo},function(n){f.search("pageNo",n)});n.$watch(function(){return n.pageSize},function(n){f.search("pageSize",n)});n.getResults=function(){i.searchData.post(n.searchObject).then(function(t){n.results=t.results;n.dataLoaded=!0;n.results&&t.paging&&(n.totalResults=t.paging.totalResults)})};n.removeCategory=function(t){var i=t;angular.forEach(n.categories,function(n){angular.forEach(n.childCategories,function(n){n.id==i&&(n.selected=!1)})});n.dataLoaded=!1;n.pageNo=1;n.selectedThemes=_.filter(n.selectedThemes,function(n){return n!==i});n.submitButtonDisabled=n.selectedThemes.length>0?!1:!0;n.updateResults()};n.updateResults=function(){n.selectedCategoriesUrl=[];angular.forEach(n.categories,function(t){t.selected===!0&&n.selectedCategoriesUrl.push(t.id);angular.forEach(t.childCategories,function(t){t.selected===!0&&n.selectedCategoriesUrl.push(t.id)})});n.selectedCategoriesUrl.length>0&&f.search("cat",[n.selectedCategoriesUrl]);n.setSearchObject();n.ageGroupOpen=!1;n.themesOpen=!1;n.getResults()};n.setTheme=function(t){t.selected==!0?n.selectedThemes.push(t.id):t.selected==!1&&(n.selectedThemes=_.filter(n.selectedThemes,function(n){return n!==t.id}));n.submitButtonDisabled=n.selectedThemes.length>0?!1:!0};n.getFilters=function(){i.bookFinderCategories.get().then(function(t){var r,i,e,u,o;if(n.categories=t.themes,f.search().cat)for(r=f.search().cat.split(","),i=0;i<n.categories.length;i++){for(e=0;e<r.length;e++)n.categories[i].id==r[e]&&(n.categories[i].selected=!0,n.ageGroup=parseInt(r[e]),n.themesDisabled=!1);for(u=0;u<n.categories[i].childCategories.length;u++)for(o=0;o<r.length;o++)n.categories[i].childCategories[u].id==r[o]&&(n.categories[i].childCategories[u].selected=!0,n.selectedThemes.push(n.categories[i].childCategories[u].id),n.submitButtonDisabled=!1)}n.updateResults()})};n.setSearchObject=function(){n.searchObject={query:n.query,type:n.type,sortOption:n.sortOption,pageNo:parseInt(n.pageNo),pageSize:parseInt(n.pageSize),languageBranch:n.languageBranch,categories:angular.copy(n.categories),flattenCategories:!1,summaryLength:150}};n.setAgeGroup=function(i){angular.forEach(n.categories,function(n){n.selected=n.id===i.id?!0:!1});n.ageGroup=i.id;n.themesDisabled=!1;n.ageGroupOpen=!1;n.themesOpen=!0;t(function(){$("html, body").animate({scrollTop:n.parentElement.offset().top-0},500)},250)};n.toggleThemes=function(i,r){r===!1&&(n.themesOpen===!1&&n.ageGroupOpen===!1?n.themesOpen=!0:(n.themesOpen=!i,n.ageGroupOpen=!n.ageGroupOpen),t(function(){$("html, body").animate({scrollTop:n.parentElement.offset().top-0},500)},250))};n.toggleAgeGroup=function(i,r){r===!1?(n.themesOpen===!1&&n.ageGroupOpen===!1?n.ageGroupOpen=!0:(n.ageGroupOpen=!i,n.themesOpen=!n.themesOpen),t(function(){$("html, body").animate({scrollTop:n.parentElement.offset().top-0},500)},250)):n.ageGroupOpen=!i};n.changePage=function(t){n.dataLoaded=!1;n.pageNo=t;n.setSearchObject();n.getResults()};n.renderHtml=function(n){if(n){var t=angular.element("<textarea />").html(n).text();return e.trustAsHtml(t)}};n.updateSortOption=function(){n.dataLoaded=!1;n.pageNo=1;n.setSearchObject();n.getResults()};n.updateNumberOfPages=function(t){n.dataLoaded=!1;n.pageNo=1;n.pageSize=parseInt(t);n.setSearchObject();n.getResults()};n.slideToResults=function(){t(function(){$("html, body").animate({scrollTop:n.resultContainer.offset().top-0},500)},250)}}])}(),function(){"use strict";angular.module("imageUploadBlock.controller",[]).controller("imageUploadBlockController",["$scope","$window","Upload",function(n){n.terms=!1;n.imageUploading=!1;n.submitted=!1;n.showSuccess=!1;n.showError=!1;n.submit=function(){n.submitted=!0;n.showSuccess=!1;n.showFailed=!1;n.form.$valid&&n.file&&(n.upload(n.file),n.imageUploading=!0)};n.upload=function(t){var i=new FormData;i.append("file",t);$.ajax({url:"/api/ImageUpload/post?name="+n.name+"&email="+n.email+"&subject="+n.subject+"",processData:!1,contentType:!1,data:i,type:"POST"}).done(function(){n.name="";n.email="";n.subject="";n.terms=!1;n.file=null;n.imageUploading=!1;n.showSuccess=!0;n.showFailed=!1;n.submitted=!1;n.$apply()}).fail(function(){n.imageUploading=!1;n.showSuccess=!1;n.showFailed=!0;n.$apply()})};n.hasError=function(t,i){return i?n.submitted&&n.form[t].$error[i]:n.submitted&&n.form[t].$invalid}}])}(),function(){"use strict";angular.module("quizBlock.controller",[]).controller("quizBlockController",["$scope","endpoints",function(n,t){n.answers={};n.correctCount=0;n.percentage=null;n.isCheckAnswersVisible=!1;n.showCorrectAnswers=!1;n.thresholdMessage=null;n.disableAnswers=!1;n.onLoad=function(t){n.parentElement=$("#"+t);n.parentElement.data("quiz-id")&&(n.bookId=n.parentElement.data("quiz-id"));n.getData(n.bookId)};n.getData=function(i){t.quiz.get(i).then(function(t){n.questions=t.questions;n.scoreThresholds=t.scoreThresholds})};n.showCorrectAnswers=function(){n.showCorrectAnswers=!0;n.isCheckAnswersVisible=!1;$("html, body").animate({scrollTop:n.parentElement.offset().top},500)};n.checkAnswers=function(){var u,t,r,i;for(n.correctCount=0,u=n.questions.length,t=0;t<u;t++)for(r=n.questions[t].answers,n.questions[t].userAnswerCorrect=!1,n.questions[t].userAnswer=n.answers[t],i=0;i<r.length;i++)r[i].selected=!1,n.questions[t].userAnswer===r[i].answerText&&r[i].correct===!0?(n.questions[t].userAnswerCorrect=!0,r[i].selected=!0,n.correctCount++):n.questions[t].userAnswer===r[i].answerText&&r[i].correct===!1&&(r[i].selected=!0);n.disableAnswers=!0};n.submitAnswers=function(){n.checkAnswers();n.isCheckAnswersVisible=!0;n.getScorePercentage();n.showThresholdMessage()};n.getScorePercentage=function(){if(n.correctCount>0){var t=n.correctCount/n.questions.length*100;n.percentage=Math.round(t)}else n.percentage=0};n.showThresholdMessage=function(){if(n.percentage!==null)for(var t=0;t<n.scoreThresholds.length;t++)if(n.percentage<=n.scoreThresholds[t].upperThreshold){n.thresholdMessage=n.scoreThresholds[t].message;break}}}])}(),function(){"use strict";angular.module("searchBlock.controller",[]).controller("searchBlockController",["$scope","endpoints","$timeout","$window","helper","$location","$sce",function(n,t,i,r,u,f,e){n.query="";n.type="All";n.sortOption="MostRecent";n.categories=[];n.pageNo=1;n.pageSize=5;n.languageBranch=$("html").attr("lang");n.firstLoad=!1;n.tagsShown=5;n.searchObject={query:n.query,type:n.type,sortOption:n.sortOption,categories:angular.copy(n.userfilters),pageNo:n.pageNo,pageSize:n.pageSize,languageBranch:n.languageBranch,flattenCategories:!1,summaryLength:360};n.onLoad=function(t){n.parentElement=$("#"+t);n.parentElement.data("search-page")&&(n.searchPage=n.parentElement.data("search-page"));n.resultContainer=$("#"+t).find(".search-resultsHeader");n.setCategoryFilters()};f.search().sortOption&&(n.sortOption=f.search().sortOption);f.search().q&&(n.query=f.search().q);f.search().type&&(n.type=f.search().type);f.search().pageNo&&(n.pageNo=f.search().pageNo);n.$watch(function(){return n.searchObject.query},function(n){f.search("q",n)});n.$watch(function(){return n.type},function(n){f.search("type",n)});n.$watch(function(){return n.sortOption},function(n){f.search("sortOption",n)});n.$watch(function(){return n.pageNo},function(n){f.search("pageNo",n)});n.$watch("searchObject.categories",function(t){n.selectedFilters=[];angular.forEach(t,function(t){angular.forEach(t.childCategories,function(t){t.selected===!0&&n.selectedFilters.push(t.id)})});n.selectedFilters.length>0?(f.search("cat",[n.selectedFilters]),$(".search-filterSelected").show()):$(".search-filterSelected").hide()},!0);n.$watch("userfilters",function(n){var t=0;angular.forEach(n,function(n){n.childCategories_selected=0;angular.forEach(n.childCategories,function(i){t+=i.selected?1:0;n.childCategories_selected+=i.selected?1:0;n.selected=n.childCategories_selected>0?!0:!1})})},!0);n.getResults=function(i){setTimeout(function(){i!==!0&&(n.selectedFilters&&n.selectedFilters.length>0||n.query&&n.query.length>0?(n.sortOption="Relevance",n.searchObject.sortOption="Relevance"):(n.sortOption="MostRecent",n.searchObject.sortOption="MostRecent"));n.selectedFilters&&n.selectedFilters.length>0&&$(".search-filterSelected").show();t.searchData.post(n.searchObject).then(function(t){n.results=t.results;n.dataLoaded=!0;n.results&&t.paging&&(n.totalResults=t.paging.totalResults)})},200)};n.loadCategories=function(){n.enabledCats=[];for(var t=0;t<n.userfilters.length;t++)n.userfilters[t].categorySelectable&&n.enabledCats.push(n.userfilters[t]);n.numberOfUserFilters=n.enabledCats.length;n.remainderOfThree=n.numberOfUserFilters%3;n.thridOfUserFilters=n.numberOfUserFilters/3;n.numberOfUserFiltersTwo=n.thridOfUserFilters*2;n.remainderOfTwo=n.enabledCats.length%2;n.numberOfUserFiltersHalf=n.numberOfUserFilters/2;n.userFiltersSplit=[];n.userFiltersSplit[0]=n.remainderOfThree>0?n.enabledCats.slice(0,n.thridOfUserFilters+1):n.enabledCats.slice(0,n.thridOfUserFilters);n.userFiltersSplit[1]=n.remainderOfThree>0?n.enabledCats.slice(n.thridOfUserFilters+1,n.numberOfUserFiltersTwo+1):n.remainderOfThree>1?n.enabledCats.slice(n.thridOfUserFilters+1,n.numberOfUserFiltersTwo+2):n.enabledCats.slice(n.thridOfUserFilters,n.numberOfUserFiltersTwo);n.userFiltersSplit[2]=n.remainderOfThree>0?n.enabledCats.slice(n.numberOfUserFiltersTwo+1,n.enabledCats.length):n.remainderOfThree>1?n.enabledCats.slice(n.numberOfUserFiltersTwo+2,n.enabledCats.length):n.enabledCats.slice(n.numberOfUserFiltersTwo,n.enabledCats.length);n.userFiltersSplit[3]=n.remainderOfTwo>0?n.enabledCats.slice(0,n.numberOfUserFiltersHalf+1):n.enabledCats.slice(0,n.numberOfUserFiltersHalf);n.userFiltersSplit[4]=n.remainderOfTwo>0?n.enabledCats.slice(n.numberOfUserFiltersHalf+1,n.enabledCats.length):n.enabledCats.slice(n.numberOfUserFiltersHalf,n.enabledCats.length);n.userFiltersSplit[5]=n.enabledCats;n.userFiltersSplit[0].class="wide-third";n.userFiltersSplit[1].class="wide-third";n.userFiltersSplit[2].class="wide-third";n.userFiltersSplit[3].class="tablet-half";n.userFiltersSplit[4].class="tablet-half";n.userFiltersSplit[5].class="mobile-full"};n.setCategoryFilters=function(){t.filtersData.get().then(function(t){var e,i,r,u;if(n.userfilters=t,n.chosenCat=[],f.search().cat)for(e=f.search().cat.split(","),i=0;i<n.userfilters.length;i++)for(r=0;r<n.userfilters[i].childCategories.length;r++)for(u=0;u<e.length;u++)n.userfilters[i].childCategories[r].id==e[u]&&(n.userfilters[i].childCategories[r].selected=!0,n.chosenCat.push({name:n.userfilters[i].childCategories[r].name,id:n.userfilters[i].childCategories[r].id}));n.disableFilters(n.type);n.loadCategories();n.firstLoad=!0;n.selectedFilters.length>0?(f.search("cat",[n.selectedFilters]),$(".search-filterSelected").show()):$(".search-filterSelected").hide();n.setSearchObject(!0);n.getResults()})};n.checkCat=function(){var i,t;if(n.searchObject.categories,n.searchObject.categories)for(n.getCaters=n.searchObject.categories,i=0;i<n.getCaters.length;i++)if(n.getCaters[i].selected)for(n.subCat=n.getCaters[i].childCategories,t=0;t<n.subCat.length;t++)n.subCat[t].selected&&n.chosenCat.push({name:n.subCat[t].name,id:n.subCat[t].id})};n.openThisCat=function(){for(var t=0;t<n.userfilters.length;t++)n.userfilters[t].categoryOpen=n.userfilters[t].name===$(this)[0].category.name?!n.userfilters[t].categoryOpen:!1};n.changeSearchType=function(t){n.dataLoaded=!1;n.type=t;n.pageNo=1;n.disableFilters(n.type);n.loadCategories();f.search("cat",[n.selectedFilters]);n.setSearchObject(!0);n.getResults()};n.returnReadableSize=function(n){return u.convertToReadableSize(n,0)};n.updateSortOption=function(){n.dataLoaded=!1;n.pageNo=1;n.sortDropdownUsed=!0;n.selectedFilters.length>0?(f.search("cat",[n.selectedFilters]),$(".search-filterSelected").show()):$(".search-filterSelected").hide();n.setSearchObject();n.getResults(!0)};n.setQuery=function(){n.dataLoaded=!1;n.pageNo=1;n.selectedFilters.length>0?(f.search("cat",[n.selectedFilters]),$(".search-filterSelected").show()):$(".search-filterSelected").hide();n.setSearchObject();n.getResults()};n.setCategories=function(){n.dataLoaded=!1;n.pageNo=1;n.selectedFilters.length>0?(f.search("cat",[n.selectedFilters]),$(".search-filterSelected").show()):$(".search-filterSelected").hide();n.setSearchObject();n.getResults()};n.clearFilters=function(t){n.dataLoaded=!1;n.pageNo=1;n.dontResetCategories=!1;n.removeSingle=t&&t!==!1?!0:!1;angular.forEach(n.userfilters,function(i){i.selected=!1;angular.forEach(i.childCategories,function(i){n.removeSingle===!0?i.id===t&&(i.selected=!1,n.dontResetCategories=!0):(i.selected=!1,n.dontResetCategories=!1)})});f.search("cat","");n.setSearchObject(n.dontResetCategories);n.getResults()};n.setSearchObject=function(t){n.searchObject={query:n.query,type:n.type,sortOption:n.sortOption,categories:angular.copy(n.userfilters),pageNo:n.pageNo,pageSize:n.pageSize,languageBranch:n.languageBranch,flattenCategories:!1,summaryLength:360};n.firstLoad&&!t&&(n.chosenCat=[],n.checkCat(),$(".search-filterSelected").hide())};n.changePage=function(t){n.dataLoaded=!1;n.pageNo=t;n.setSearchObject();n.getResults(!0)};n.slideToResults=function(){i(function(){$("html, body").animate({scrollTop:n.resultContainer.offset().top-40},500)},250)};n.renderHtml=function(n){if(n){var t=angular.element("<textarea />").html(n).text();return e.trustAsHtml(t)}};n.clearThisFilter=function(){var i,t;for(n.targ=$(this)[0].tags.id,n.chosenCat=[],$("#"+n.targ).next("label").trigger("click"),n.getCaters=n.searchObject.categories,i=0;i<n.getCaters.length;i++)for(n.subCat=n.getCaters[i].childCategories,t=0;t<n.subCat.length;t++)n.subCat[t].selected&&(n.targ===n.subCat[t].id?(n.subCat[t].selected=!1,n.clearFilters(n.subCat[t].id)):n.chosenCat.push({name:n.subCat[t].name,id:n.subCat[t].id}))};n.clearQuery=function(){n.query="";n.dataLoaded=!1;n.selectedFilters.length>0?(f.search("cat",[n.selectedFilters]),$(".search-filterSelected").show()):($(".search-filterSelected").hide(),n.sortOption="MostRecent");n.setSearchObject();n.getResults()};n.disableFilters=function(t){for(var r,u,f=$('*[data-type="'+t+'"]').data("non-applicable-categories").toString(),e=f?f.split(","):[],o=0,i=0;i<n.userfilters.length;i++)for(n.userfilters[i].childCategories_unselectable=0,r=0;r<n.userfilters[i].childCategories.length;r++){for(n.userfilters[i].categorySelectable=!0,n.userfilters[i].childCategories[r].orginalSelectable===undefined?n.userfilters[i].childCategories[r].orginalSelectable=n.userfilters[i].childCategories[r].selectable:n.userfilters[i].childCategories[r].selectable=n.userfilters[i].childCategories[r].orginalSelectable,u=0;u<e.length;u++)e[u]==n.userfilters[i].childCategories[r].id&&(n.userfilters[i].childCategories[r].selected=!1,n.userfilters[i].childCategories[r].selectable=!1);o+=n.userfilters[i].childCategories[r].selectable?0:1;n.userfilters[i].childCategories_unselectable+=n.userfilters[i].childCategories[r].selectable?0:1;n.userfilters[i].childCategories.length==n.userfilters[i].childCategories_unselectable&&(n.userfilters[i].categoryOpen=!1,n.userfilters[i].categorySelectable=!1)}}}])}(),function(){function t(t,i,r){function u(u,c){var l=c.dirPaginate,a=l.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),v=/\|\s*itemsPerPage\s*:\s*(.*\(\s*\w*\)|([^\)]*?(?=\s+as\s+))|[^\)]*)/,y,p,w;if(a[2].match(v)===null)throw"pagination directive: the 'itemsPerPage' filter must be set.";return y=a[2].replace(v,""),p=i(y),o(u),w=c.paginationId||n,r.registerInstance(w),function(u,o,c){var a=i(c.paginationId)(u)||c.paginationId||n,v,y,w;r.registerInstance(a);v=f(l,a);e(o,c,v);s(o);y=t(o);w=h(u,c,a);r.setCurrentPageParser(a,w,u);typeof c.totalItems!="undefined"?(r.setAsyncModeTrue(a),u.$watch(function(){return i(c.totalItems)(u)},function(n){0<=n&&r.setCollectionLength(a,n)})):(r.setAsyncModeFalse(a),u.$watchCollection(function(){return p(u)},function(n){if(n){var t=n instanceof Array?n.length:Object.keys(n).length;r.setCollectionLength(a,t)}}));y(u)}}function f(t,i){var r=!!t.match(/(\|\s*itemsPerPage\s*:[^|]*:[^|]*)/);return i===n||r?t:t.replace(/(\|\s*itemsPerPage\s*:\s*[^|\s]*)/,"$1 : '"+i+"'")}function e(n,t,i){n[0].hasAttribute("dir-paginate-start")||n[0].hasAttribute("data-dir-paginate-start")?(t.$set("ngRepeatStart",i),n.eq(n.length-1).attr("ng-repeat-end",!0)):t.$set("ngRepeat",i)}function o(n){angular.forEach(n,function(n){n.nodeType===1&&angular.element(n).attr("dir-paginate-no-compile",!0)})}function s(n){angular.forEach(n,function(n){n.nodeType===1&&angular.element(n).removeAttr("dir-paginate-no-compile")});n.eq(0).removeAttr("dir-paginate-start").removeAttr("dir-paginate").removeAttr("data-dir-paginate-start").removeAttr("data-dir-paginate");n.eq(n.length-1).removeAttr("dir-paginate-end").removeAttr("data-dir-paginate-end")}function h(n,t,r){var u,f;return t.currentPage?u=i(t.currentPage):(f=(r+"__currentPage").replace(/\W/g,"_"),n[f]=1,u=i(f)),u}return{terminal:!0,multiElement:!0,priority:100,compile:u}}function i(){return{priority:5e3,terminal:!0}}function r(n){n.put("angularUtils.directives.dirPagination.template",'<ul class="pagination" ng-if="1 < pages.length || !autoHide"><li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == 1 }"><a href="" ng-click="setCurrent(1)">&laquo;<\/a><\/li><li ng-if="directionLinks" ng-class="{ disabled : pagination.current == 1 }"><a href="" ng-click="setCurrent(pagination.current - 1)">&lsaquo;<\/a><\/li><li ng-repeat="pageNumber in pages track by tracker(pageNumber, $index)" ng-class="{ active : pagination.current == pageNumber, disabled : pageNumber == \'...\' || ( ! autoHide && pages.length === 1 ) }"><a href="" ng-click="setCurrent(pageNumber)">{{ pageNumber }}<\/a><\/li><li ng-if="directionLinks" ng-class="{ disabled : pagination.current == pagination.last }"><a href="" ng-click="setCurrent(pagination.current + 1)">&rsaquo;<\/a><\/li><li ng-if="boundaryLinks"  ng-class="{ disabled : pagination.current == pagination.last }"><a href="" ng-click="setCurrent(pagination.last)">&raquo;<\/a><\/li><\/ul>')}function u(t,i){function o(i,r,u){function c(n){if(t.isRegistered(o)&&v(n)){var r=i.pagination.current;if(i.pages=f(n,t.getCollectionLength(o),t.getItemsPerPage(o),s),i.pagination.current=n,a(),i.onPageChange)i.onPageChange({newPageNumber:n,oldPageNumber:r})}}function l(){if(t.isRegistered(o)){var n=parseInt(t.getCurrentPage(o))||1;i.pages=f(n,t.getCollectionLength(o),t.getItemsPerPage(o),s);i.pagination.current=n;i.pagination.last=i.pages[i.pages.length-1];i.pagination.last<i.pagination.current?i.setCurrent(i.pagination.last):a()}}function a(){if(t.isRegistered(o)){var n=t.getCurrentPage(o),r=t.getItemsPerPage(o),u=t.getCollectionLength(o);i.range.lower=(n-1)*r+1;i.range.upper=Math.min(n*r,u);i.range.total=u}}function v(n){return e.test(n)&&0<n&&n<=i.pagination.last}var y=u.paginationId||n,o=i.paginationId||u.paginationId||n,h,s;t.isRegistered(o)||t.isRegistered(y)||(h=o!==n?" (id: "+o+") ":" ",window.console&&console.warn("Pagination directive: the pagination controls"+h+"cannot be used without the corresponding pagination directive, which was not found at link time."));i.maxSize||(i.maxSize=9);i.autoHide=i.autoHide===undefined?!0:i.autoHide;i.directionLinks=angular.isDefined(u.directionLinks)?i.$parent.$eval(u.directionLinks):!0;i.boundaryLinks=angular.isDefined(u.boundaryLinks)?i.$parent.$eval(u.boundaryLinks):!1;s=Math.max(i.maxSize,5);i.pages=[];i.pagination={last:1,current:1};i.range={lower:1,upper:1,total:1};i.$watch("maxSize",function(n){n&&(s=Math.max(i.maxSize,5),l())});i.$watch(function(){if(t.isRegistered(o))return(t.getCollectionLength(o)+1)*t.getItemsPerPage(o)},function(n){0<n&&l()});i.$watch(function(){if(t.isRegistered(o))return t.getItemsPerPage(o)},function(n,t){n!=t&&typeof t!="undefined"&&c(i.pagination.current)});i.$watch(function(){if(t.isRegistered(o))return t.getCurrentPage(o)},function(n,t){n!=t&&c(n)});i.setCurrent=function(n){t.isRegistered(o)&&v(n)&&(n=parseInt(n,10),t.setCurrentPage(o,n));$(".search-filterSelected-tag").length>0&&setTimeout(function(){$(".search-filterSelected").show()},100)};i.tracker=function(n,t){return n+"_"+t}}function f(n,t,i,r){var o=[],e=Math.ceil(t/i),h=Math.ceil(r/2),f,c,u;for(f=n<=h?"start":e-h<n?"end":"middle",c=r<e,u=1;u<=e&&u<=r;){var l=s(u,n,r,e),a=u===2&&(f==="middle"||f==="end"),v=u===r-1&&(f==="middle"||f==="start");c&&(a||v)?o.push("..."):o.push(l);u++}return o}function s(n,t,i,r){var u=Math.ceil(i/2);return n===i?r:n===1?n:i<r?r-u<t?r-i+n:u<t?t-u+n:n:n}var e=/^\d+$/,r={restrict:"AE",scope:{maxSize:"=?",onPageChange:"&?",paginationId:"=?",autoHide:"=?"},link:o},u=i.getString();return u!==undefined?r.template=u:r.templateUrl=function(n,t){return t.templateUrl||i.getPath()},r}function f(t){return function(i,r,u){var o,f,s;if(typeof u=="undefined"&&(u=n),!t.isRegistered(u))throw"pagination directive: the itemsPerPage id argument (id: "+u+") does not match a registered pagination-id.";return angular.isObject(i)?(r=parseInt(r)||9999999999,f=t.isAsyncMode(u)?0:(t.getCurrentPage(u)-1)*r,o=f+r,t.setItemsPerPage(u,r),i instanceof Array?i.slice(f,o):(s={},angular.forEach(e(i).slice(f,o),function(n){s[n]=i[n]}),s)):i}}function e(n){var t,i;if(Object.keys)return Object.keys(n);t=[];for(i in n)n.hasOwnProperty(i)&&t.push(i);return t}function o(){var n={},t;this.registerInstance=function(i){typeof n[i]=="undefined"&&(n[i]={asyncMode:!1},t=i)};this.deregisterInstance=function(t){delete n[t]};this.isRegistered=function(t){return typeof n[t]!="undefined"};this.getLastInstanceId=function(){return t};this.setCurrentPageParser=function(t,i,r){n[t].currentPageParser=i;n[t].context=r};this.setCurrentPage=function(t,i){n[t].currentPageParser.assign(n[t].context,i)};this.getCurrentPage=function(t){var i=n[t].currentPageParser;return i?i(n[t].context):1};this.setItemsPerPage=function(t,i){n[t].itemsPerPage=i};this.getItemsPerPage=function(t){return n[t].itemsPerPage};this.setCollectionLength=function(t,i){n[t].collectionLength=i};this.getCollectionLength=function(t){return n[t].collectionLength};this.setAsyncModeTrue=function(t){n[t].asyncMode=!0};this.setAsyncModeFalse=function(t){n[t].asyncMode=!1};this.isAsyncMode=function(t){return n[t].asyncMode}}function s(){var n="angularUtils.directives.dirPagination.template",t;this.setPath=function(t){n=t};this.setString=function(n){t=n};this.$get=function(){return{getPath:function(){return n},getString:function(){return t}}}}var n="__default";angular.module("angularUtils.directives.dirPagination",[]).directive("dirPaginate",["$compile","$parse","paginationService",t]).directive("dirPaginateNoCompile",i).directive("dirPaginationControls",["paginationService","paginationTemplate",u]).filter("itemsPerPage",["paginationService",f]).service("paginationService",o).provider("paginationTemplate",s).run(["$templateCache",r])}(),function(){"use strict";angular.module("rwEnter.directive",[]).directive("rwEnter",[function(){return{restrict:"A",link:function(n,t,i){t.on("keydown keypress",function(t){t.which===13&&(n.$apply(function(){n.$eval(i.rwEnter)}),t.preventDefault())})}}}])}(),function(){"use strict";angular.module("rwLink.directive",[]).directive("rwLink",["$window",function(n){return{link:function(t,i,r){r.rwLink&&(i.attr("href",r.rwLink),i.click(function(){n.location.href=r.rwLink;n.location.reload()}))}}}])}(),function(n){"use strict";n.module("vcRecaptcha",[])}(angular),function(n){"use strict";function t(){throw new Error('You need to set the "key" attribute to your public reCaptcha key. If you don\'t have a key, please get one from https://www.google.com/recaptcha/admin/create');}var i=n.module("vcRecaptcha");i.provider("vcRecaptchaService",function(){var r=this,i={};r.onLoadFunctionName="vcRecaptchaApiLoaded";r.setDefaults=function(t){n.copy(t,i)};r.setSiteKey=function(n){i.key=n};r.setTheme=function(n){i.theme=n};r.setStoken=function(n){i.stoken=n};r.setSize=function(n){i.size=n};r.setType=function(n){i.type=n};r.setLang=function(n){i.lang=n};r.setBadge=function(n){i.badge=n};r.setOnLoadFunctionName=function(n){r.onLoadFunctionName=n};r.$get=["$rootScope","$window","$q","$document","$interval",function(u,f,e,o,s){function k(){return!h?b:e.when(h)}function v(){if(!h)throw new Error("reCaptcha has not been loaded yet.");}function p(){return n.isFunction((f.grecaptcha||{}).render)}var y=e.defer(),b=y.promise,l={},h,a,w,c;return f.vcRecaptchaApiLoadedCallback=f.vcRecaptchaApiLoadedCallback||[],a=function(){h=f.grecaptcha;y.resolve(h)},f.vcRecaptchaApiLoadedCallback.push(a),f[r.onLoadFunctionName]=function(){f.vcRecaptchaApiLoadedCallback.forEach(function(n){n()})},p()?a():f.document.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')?w=s(function(){p()&&(s.cancel(w),a())},25):(c=f.document.createElement("script"),c.async=!0,c.defer=!0,c.src="https://www.google.com/recaptcha/api.js?onload="+r.onLoadFunctionName+"&render=explicit",o.find("body")[0].appendChild(c)),{create:function(n,r){return r.sitekey=r.key||i.key,r.theme=r.theme||i.theme,r.stoken=r.stoken||i.stoken,r.size=r.size||i.size,r.type=r.type||i.type,r.hl=r.lang||i.lang,r.badge=r.badge||i.badge,r.sitekey||t(),k().then(function(t){var i=t.render(n,r);return l[i]=n,i})},reload:function(n){v();h.reset(n);u.$broadcast("reCaptchaReset",n)},execute:function(n){v();h.execute(n)},useLang:function(n,t){var u=l[n],i,r;if(u)if(i=u.querySelector("iframe"),t)i&&i.src&&(r=i.src,/[?&]hl=/.test(r)?r=r.replace(/([?&]hl=)\w+/,"$1"+t):r+=(r.indexOf("?")===-1?"?":"&")+"hl="+t,i.src=r);else return i&&i.src&&/[?&]hl=\w+/.test(i.src)?i.src.replace(/.+[?&]hl=(\w+)([^\w].+)?/,"$1"):null;else throw new Error("reCaptcha Widget ID not exists",n);},getResponse:function(n){return v(),h.getResponse(n)},getInstance:function(n){return l[n]},destroy:function(n){delete l[n]}}}]})}(angular),function(n){"use strict";var t=n.module("vcRecaptcha");t.directive("vcRecaptcha",["$document","$timeout","vcRecaptchaService",function(t,i,r){return{restrict:"A",require:"?^^form",scope:{response:"=?ngModel",key:"=?",stoken:"=?",theme:"=?",size:"=?",type:"=?",lang:"=?",badge:"=?",tabindex:"=?",required:"=?",onCreate:"&",onSuccess:"&",onExpire:"&",onError:"&"},link:function(u,f,e,o){function c(){o&&o.$setValidity("recaptcha",null);v()}function l(){i(function(){u.response="";s();u.onExpire({widgetId:u.widgetId})})}function a(){var n=arguments;i(function(){u.response="";s();u.onError({widgetId:u.widgetId,arguments:n})})}function s(){o&&o.$setValidity("recaptcha",u.required===!1?null:Boolean(u.response))}function v(){r.destroy(u.widgetId);n.element(t[0].querySelectorAll(".pls-container")).parent().remove()}u.widgetId=null;o&&n.isDefined(e.required)&&u.$watch("required",s);var h=u.$watch("key",function(t){var o=function(n){i(function(){u.response=n;s();u.onSuccess({response:n,widgetId:u.widgetId})})};r.create(f[0],{callback:o,key:t,stoken:u.stoken||e.stoken||null,theme:u.theme||e.theme||null,type:u.type||e.type||null,lang:u.lang||e.lang||null,tabindex:u.tabindex||e.tabindex||null,size:u.size||e.size||null,badge:u.badge||e.badge||null,"expired-callback":l,"error-callback":e.onError?a:undefined}).then(function(t){s();u.widgetId=t;u.onCreate({widgetId:t});u.$on("$destroy",c);u.$on("reCaptchaReset",function(i,r){(n.isUndefined(r)||t===r)&&(u.response="",s())})});h()})}}}])}(angular),function(){"use strict";angular.module("rwSetCardHeight.directive",[]).directive("rwSetCardHeight",["$timeout",function(n){return{link:function(t){t.$last&&n(function(){t.setHeight=function(){for(var n,i,r,f,u=document.getElementsByClassName("book-wrapper"),t=0;t<u.length;t++)n=u[t],$(n).children().height(""),i=$(n).find(".book-front").outerHeight(),r=$(n).find(".book-back").outerHeight(),f=i>r?i:r,$(n).height(f)};t.setHeight();$(".book").matchHeight({byRow:!0,property:"height",target:null,remove:!1});$.fn.matchHeight._afterUpdate=function(){t.setHeight()}})}}}])}(),function(){"use strict";angular.module("rwToggleFlip.directive",[]).directive("rwToggleFlip",["$window",function(n){return{restrict:"A",link:function(t,i){n.bindFlip(i)}}}])}();angular.module("categoryFilter.filters",[]).filter("categoryFilter",function(){return function(n){var r=_.filter(n,function(n){return n.selected==!0}).length==0,t=[];return angular.forEach(n,function(n){if(n.selected==!0||r)for(i=0,len=n.childCategories.length;i<len;i++)t.push(n.childCategories[i]);else for(i=0,len=n.childCategories.length;i<len;i++)n.childCategories[i].selected=!1}),t}}),function(){"use strict";angular.module("truncate.filter",[]).filter("cut",function(){return function(n,t,i,r){if(!n)return"";if((i=parseInt(i,10),!i)||n.length<=i)return n;if(n=n.substr(0,i),t){var u=n.lastIndexOf(" ");u!=-1&&(n=n.substr(0,u))}return n+(r||" …")}})}();!window.XMLHttpRequest||window.FileAPI&&FileAPI.shouldLoad||(window.XMLHttpRequest.prototype.setRequestHeader=function(n){return function(t,i){if("__setXHR_"===t){var r=i(this);r instanceof Function&&r(this)}else n.apply(this,arguments)}}(window.XMLHttpRequest.prototype.setRequestHeader));ngFileUpload=angular.module("ngFileUpload",[]);ngFileUpload.version="12.2.13";ngFileUpload.service("UploadBase",["$http","$q","$timeout",function(n,t,i){function f(f){function h(n){o.notify&&o.notify(n);e.progressFunc&&i(function(){e.progressFunc(n)})}function c(n){return null!=f._start&&u?{loaded:n.loaded+f._start,total:f._file&&f._file.size||n.total,type:n.type,config:f,lengthComputable:!0,target:n.target}:n}function s(){n(f).then(function(n){if(u&&f._chunkSize&&!f._finished&&f._file){var t=f._file&&f._file.size||0;h({loaded:Math.min(f._end,t),total:t,config:f,type:"progress"});r.upload(f,!0)}else f._finished&&delete f._finished,o.resolve(n)},function(n){o.reject(n)},function(n){o.notify(n)})}f.method=f.method||"POST";f.headers=f.headers||{};var o=f._deferred=f._deferred||t.defer(),e=o.promise;return f.disableProgress||(f.headers.__setXHR_=function(){return function(n){n&&n.upload&&n.upload.addEventListener&&(f.__XHR=n,f.xhrFn&&f.xhrFn(n),n.upload.addEventListener("progress",function(n){n.config=f;h(c(n))},!1),n.upload.addEventListener("load",function(n){n.lengthComputable&&(n.config=f,h(c(n)))},!1))}}),u?f._chunkSize&&f._end&&!f._finished?(f._start=f._end,f._end+=f._chunkSize,s()):f.resumeSizeUrl?n.get(f.resumeSizeUrl).then(function(n){f._start=f.resumeSizeResponseReader?f.resumeSizeResponseReader(n.data):parseInt((null==n.data.size?n.data:n.data.size).toString());f._chunkSize&&(f._end=f._start+f._chunkSize);s()},function(n){throw n;}):f.resumeSize?f.resumeSize().then(function(n){f._start=n;f._chunkSize&&(f._end=f._start+f._chunkSize);s()},function(n){throw n;}):(f._chunkSize&&(f._start=0,f._end=f._start+f._chunkSize),s()):s(),e.success=function(n){return e.then(function(t){n(t.data,t.status,t.headers,f)}),e},e.error=function(n){return e.then(null,function(t){n(t.data,t.status,t.headers,f)}),e},e.progress=function(n){return e.progressFunc=n,e.then(null,null,function(t){n(t)}),e},e.abort=e.pause=function(){return f.__XHR&&i(function(){f.__XHR.abort()}),e},e.xhr=function(n){return f.xhrFn=function(t){return function(){t&&t.apply(e,arguments);n.apply(e,arguments)}}(f.xhrFn),e},r.promisesCount++,e["finally"]&&e["finally"]instanceof Function&&e["finally"](function(){r.promisesCount--}),e}function e(n){var i={};for(var t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}var r=this,u;r.promisesCount=0;this.isResumeSupported=function(){return window.Blob&&window.Blob.prototype.slice};u=this.isResumeSupported();this.isUploadInProgress=function(){return r.promisesCount>0};this.rename=function(n,t){return n.ngfName=t,n};this.jsonBlob=function(n){null==n||angular.isString(n)||(n=JSON.stringify(n));var t=new window.Blob([n],{type:"application/json"});return t._ngfBlob=!0,t};this.json=function(n){return angular.toJson(n)};this.isFile=function(n){return null!=n&&(n instanceof window.Blob||n.flashId&&n.name&&n.size)};this.upload=function(n,t){function o(t,i){if(t._ngfBlob)return t;if(n._file=n._file||t,null!=n._start&&u){n._end&&n._end>=t.size&&(n._finished=!0,n._end=t.size);var r=t.slice(n._start,n._end||t.size);return r.name=t.name,r.ngfName=t.ngfName,n._chunkSize&&(i.append("_chunkSize",n._chunkSize),i.append("_currentChunkSize",n._end-n._start),i.append("_chunkNumber",Math.floor(n._start/n._chunkSize)),i.append("_totalSize",n._file.size)),r}return t}function i(t,u,f){var s,h,e,c;if(void 0!==u)if(angular.isDate(u)&&(u=u.toISOString()),angular.isString(u))t.append(f,u);else if(r.isFile(u))s=o(u,t),h=f.split(","),h[1]&&(s.ngfName=h[1].replace(/^\s+|\s+$/g,""),f=h[0]),n._fileKey=n._fileKey||f,t.append(f,s,s.ngfName||s.name);else if(angular.isObject(u)){if(u.$$ngfCircularDetection)throw"ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: "+f;u.$$ngfCircularDetection=!0;try{for(e in u)u.hasOwnProperty(e)&&"$$ngfCircularDetection"!==e&&(c=null==n.objectKey?"[i]":n.objectKey,u.length&&parseInt(e)>-1&&(c=null==n.arrayKey?c:n.arrayKey),i(t,u[e],f+c.replace(/[ik]/g,e)))}finally{delete u.$$ngfCircularDetection}}else t.append(f,u)}function s(){n._chunkSize=r.translateScalars(n.resumeChunkSize);n._chunkSize=n._chunkSize?parseInt(n._chunkSize.toString()):null;n.headers=n.headers||{};n.headers["Content-Type"]=void 0;n.transformRequest=n.transformRequest?angular.isArray(n.transformRequest)?n.transformRequest:[n.transformRequest]:[];n.transformRequest.push(function(t){var r,u=new window.FormData,f;t=t||n.fields||{};n.file&&(t.file=n.file);for(r in t)t.hasOwnProperty(r)&&(f=t[r],n.formDataAppender?n.formDataAppender(u,r,f):i(u,f,r));return u})}return t||(n=e(n)),n._isDigested||(n._isDigested=!0,s()),f(n)};this.http=function(t){return t=e(t),t.transformRequest=t.transformRequest||function(t){return window.ArrayBuffer&&t instanceof window.ArrayBuffer||t instanceof window.Blob?t:n.defaults.transformRequest[0].apply(this,arguments)},t._chunkSize=r.translateScalars(t.resumeChunkSize),t._chunkSize=t._chunkSize?parseInt(t._chunkSize.toString()):null,f(t)};this.translateScalars=function(n){if(angular.isString(n)){if(n.search(/kb/i)===n.length-2)return parseFloat(1024*n.substring(0,n.length-2));if(n.search(/mb/i)===n.length-2)return parseFloat(1048576*n.substring(0,n.length-2));if(n.search(/gb/i)===n.length-2)return parseFloat(1073741824*n.substring(0,n.length-2));if(n.search(/b/i)===n.length-1||n.search(/s/i)===n.length-1)return parseFloat(n.substring(0,n.length-1));if(n.search(/m/i)===n.length-1)return parseFloat(60*n.substring(0,n.length-1));if(n.search(/h/i)===n.length-1)return parseFloat(3600*n.substring(0,n.length-1))}return n};this.urlToBlob=function(i){var r=t.defer();return n({url:i,method:"get",responseType:"arraybuffer"}).then(function(n){var f=new Uint8Array(n.data),e=n.headers("content-type")||"image/WebP",t=new window.Blob([f],{type:e}),u=i.match(/.*\/(.+?)(\?.*)?$/);u.length>1&&(t.name=u[1]);r.resolve(t)},function(n){r.reject(n)}),r.promise};this.setDefaults=function(n){this.defaults=n||{}};this.defaults={};this.version=ngFileUpload.version}]);ngFileUpload.service("Upload",["$parse","$timeout","$compile","$q","UploadExif",function(n,t,i,r,u){function o(n,t,i){var u=[f.emptyPromise()];return angular.forEach(n,function(r,e){0===r.type.indexOf("image/jpeg")&&f.attrGetter("ngfFixOrientation",t,i,{$file:r})&&u.push(f.happyPromise(f.applyExifRotation(r),r).then(function(t){n.splice(e,1,t)}))}),r.all(u)}function s(n,t,i,u){var o=f.attrGetter("ngfResize",t,i),s;return!o||!f.isResizeSupported()||!n.length?f.emptyPromise():o instanceof Function?(s=r.defer(),o(n).then(function(r){e(r,n,t,i,u).then(function(n){s.resolve(n)},function(n){s.reject(n)})},function(n){s.reject(n)})):e(o,n,t,i,u)}function e(n,t,i,u,e){function h(r,o){if(0===r.type.indexOf("image")){if(n.pattern&&!f.validatePattern(r,n.pattern))return;n.resizeIf=function(n,t){return f.attrGetter("ngfResizeIf",i,u,{$width:n,$height:t,$file:r})};var h=f.resize(r,n);s.push(h);h.then(function(n){t.splice(o,1,n)},function(n){r.$error="resize";(r.$errorMessages=r.$errorMessages||{}).resize=!0;r.$errorParam=(n?(n.message?n.message:n)+": ":"")+(r&&r.name);e.$ngfValidations.push({name:"resize",valid:!1});f.applyModelValidation(e,t)})}}for(var s=[f.emptyPromise()],o=0;o<t.length;o++)h(t[o],o);return r.all(s)}var f=u;return f.getAttrWithDefaults=function(n,t){if(null!=n[t])return n[t];var i=f.defaults[t];return null==i?i:angular.isString(i)?i:JSON.stringify(i)},f.attrGetter=function(t,i,r,u){var f=this.getAttrWithDefaults(i,t);if(!r)return f;try{return u?n(f)(r,u):n(f)(r)}catch(e){if(t.search(/min|max|pattern/i))return f;throw e;}},f.shouldUpdateOn=function(n,t,i){var r=f.attrGetter("ngfModelOptions",t,i);return r&&r.updateOn?r.updateOn.split(" ").indexOf(n)>-1:!0},f.emptyPromise=function(){var n=r.defer(),i=arguments;return t(function(){n.resolve.apply(n,i)}),n.promise},f.rejectPromise=function(){var n=r.defer(),i=arguments;return t(function(){n.reject.apply(n,i)}),n.promise},f.happyPromise=function(n,i){var u=r.defer();return n.then(function(n){u.resolve(n)},function(n){t(function(){throw n;});u.resolve(i)}),u.promise},f.updateModel=function(i,r,u,e,h,c,l){function tt(o,s,h,l,a){var v,y,p;r.$$ngfPrevValidFiles=o;r.$$ngfPrevInvalidFiles=s;v=o&&o.length?o[0]:null;y=s&&s.length?s[0]:null;i&&(f.applyModelValidation(i,o),i.$setViewValue(a?v:o));e&&n(e)(u,{$files:o,$file:v,$newFiles:h,$duplicateFiles:l,$invalidFiles:s,$invalidFile:y,$event:c});p=f.attrGetter("ngfModelInvalid",r);p&&t(function(){n(p).assign(u,a?y:s)});t(function(){})}function rt(){function t(n,t){return n.name===t.name&&(n.$ngfOrigSize||n.size)===(t.$ngfOrigSize||t.size)&&n.type===t.type}function i(n){for(var i=0;i<p.length;i++)if(t(n,p[i]))return!0;for(i=0;i<d.length;i++)if(t(n,d[i]))return!0;return!1}if(h){a=[];b=[];for(var n=0;n<h.length;n++)i(h[n])?b.push(h[n]):a.push(h[n])}}function ut(n){return angular.isArray(n)?n:[n]}function it(){function n(){t(function(){tt(y?p.concat(v):v,y?d.concat(k):k,h,b,nt)},w&&w.debounce?w.debounce.change||w.debounce:0)}var e=g?a:v;s(e,r,u,i).then(function(){g?f.validate(a,y?p.length:0,i,r,u).then(function(t){v=t.validsFiles;k=t.invalidsFiles;n()}):n()},function(){for(var i,r,t=0;t<e.length;t++)i=e[t],"resize"===i.$error&&(r=v.indexOf(i),r>-1&&(v.splice(r,1),k.push(i)),n())})}var a,p,d,b=[],k=[],v=[],y,nt,g,w;p=r.$$ngfPrevValidFiles||[];d=r.$$ngfPrevInvalidFiles||[];i&&i.$modelValue&&(p=ut(i.$modelValue));y=f.attrGetter("ngfKeep",r,u);a=(h||[]).slice(0);("distinct"===y||f.attrGetter("ngfKeepDistinct",r,u)===!0)&&rt(r,u);nt=!y&&!f.attrGetter("ngfMultiple",r,u)&&!f.attrGetter("multiple",r);(!y||a.length)&&(f.attrGetter("ngfBeforeModelChange",r,u,{$files:h,$file:h&&h.length?h[0]:null,$newFiles:a,$duplicateFiles:b,$event:c}),g=f.attrGetter("ngfValidateAfterResize",r,u),w=f.attrGetter("ngfModelOptions",r,u),f.validate(a,y?p.length:0,i,r,u).then(function(n){l?tt(a,[],h,b,nt):(w&&w.allowInvalid||g?v=a:(v=n.validFiles,k=n.invalidFiles),f.attrGetter("ngfFixOrientation",r,u)&&f.isExifSupported()?o(v,r,u).then(function(){it()}):it())}))},f}]);ngFileUpload.directive("ngfSelect",["$parse","$timeout","$compile","Upload",function(n,t,i,r){function f(n){var t=n.match(/Android[^\d]*(\d+)\.(\d+)/),i;return t&&t.length>2?(i=r.defaults.androidFixMinorVersion||4,parseInt(t[1])<4||parseInt(t[1])===i&&parseInt(t[2])<i):-1===n.indexOf("Chrome")&&/.*Windows.*Safari.*/.test(n)}function e(n,t,i,r,e,o,s,h){function v(){return"input"===t[0].tagName.toLowerCase()&&i.type&&"file"===i.type.toLowerCase()}function p(){return l("ngfChange")||l("ngfSelect")}function y(t){var u,f,e;if(h.shouldUpdateOn("change",i,n)){if(u=t.__files_||t.target&&t.target.files,f=[],!u)return;for(e=0;e<u.length;e++)f.push(u[e]);h.updateModel(r,i,n,p(),f.length?f:null,t)}}function g(n,r){function e(t){n.attr("id","ngf-"+t);r.attr("id","ngf-label-"+t)}for(var u,f=0;f<t[0].attributes.length;f++)u=t[0].attributes[f],"type"!==u.name&&"class"!==u.name&&"style"!==u.name&&("id"===u.name?(e(u.value),a.push(i.$observe("id",e))):n.attr(u.name,u.value||"required"!==u.name&&"multiple"!==u.name?u.value:u.name))}function nt(){if(v())return t;var i=angular.element('<input type="file">'),n=angular.element("<label>upload<\/label>");return n.css("visibility","hidden").css("position","absolute").css("overflow","hidden").css("width","0px").css("height","0px").css("border","none").css("margin","0px").css("padding","0px").attr("tabindex","-1"),g(i,n),u.push({el:t,ref:n}),document.body.appendChild(n.append(i)[0]),i}function tt(i){if(t.attr("disabled"))return!1;if(!l("ngfSelectDisabled",n)){var r=it(i);if(null!=r)return r;w(i);try{v()||document.body.contains(c[0])||(u.push({el:t,ref:c.parent()}),document.body.appendChild(c.parent()[0]),c.bind("change",y))}catch(e){}return f(navigator.userAgent)?setTimeout(function(){c[0].click()},0):c[0].click(),!1}}function it(n){var t=n.changedTouches||n.originalEvent&&n.originalEvent.changedTouches,i,r;if(t)return"touchstart"===n.type?(d=t[0].clientX,k=t[0].clientY,!0):"touchend"===n.type&&(i=t[0].clientX,r=t[0].clientY,Math.abs(i-d)>20||Math.abs(r-k)>20)?(n.stopPropagation(),n.preventDefault(),!1):!0}function w(t){h.shouldUpdateOn("click",i,n)&&c.val()&&(c.val(null),h.updateModel(r,i,n,p(),null,t,!0))}function b(n){if(c&&!c.attr("__ngf_ie10_Fix_")){if(!c[0].parentNode)return void(c=null);n.preventDefault();n.stopPropagation();c.unbind("click");var t=c.clone();return c.replaceWith(t),c=t,c.attr("__ngf_ie10_Fix_","true"),c.bind("change",y),c.bind("click",b),c[0].click(),!1}c.removeAttr("__ngf_ie10_Fix_")}var l=function(n,t){return h.attrGetter(n,i,t)},a;h.registerModelChangeValidator(r,i,n);a=[];l("ngfMultiple")&&a.push(n.$watch(l("ngfMultiple"),function(){c.attr("multiple",l("ngfMultiple",n))}));l("ngfCapture")&&a.push(n.$watch(l("ngfCapture"),function(){c.attr("capture",l("ngfCapture",n))}));l("ngfAccept")&&a.push(n.$watch(l("ngfAccept"),function(){c.attr("accept",l("ngfAccept",n))}));a.push(i.$observe("accept",function(){c.attr("accept",l("accept"))}));var k=0,d=0,c=t;v()||(c=nt());c.bind("change",y);v()?t.bind("click",w):t.bind("click touchstart touchend",tt);-1!==navigator.appVersion.indexOf("MSIE 10")&&c.bind("click",b);r&&r.$formatters.push(function(n){return(null==n||0===n.length)&&c.val()&&c.val(null),n});n.$on("$destroy",function(){v()||c.parent().remove();angular.forEach(a,function(n){n()})});o(function(){for(var t,n=0;n<u.length;n++)t=u[n],document.body.contains(t.el[0])||(u.splice(n,1),t.ref.remove())});window.FileAPI&&window.FileAPI.ngfFixIE&&window.FileAPI.ngfFixIE(t,c,y)}var u=[];return{restrict:"AEC",require:"?ngModel",link:function(u,f,o,s){e(u,f,o,s,n,t,i,r)}}}]),function(){function t(n){return"img"===n.tagName.toLowerCase()?"image":"audio"===n.tagName.toLowerCase()?"audio":"video"===n.tagName.toLowerCase()?"video":/./}function n(n,i,r,u,f,e,o,s){function h(t){var e=n.attrGetter("ngfNoObjectUrl",f,r);n.dataUrl(t,e)["finally"](function(){i(function(){var n=(e?t.$ngfDataUrl:t.$ngfBlobUrl)||t.$ngfDataUrl;s?u.css("background-image","url('"+(n||"")+"')"):u.attr("src",n);n?u.removeClass("ng-hide"):u.addClass("ng-hide")})})}i(function(){var i=r.$watch(f[e],function(i){var c=o,l;return"ngfThumbnail"===e&&(c||(c={width:u[0].naturalWidth||u[0].clientWidth,height:u[0].naturalHeight||u[0].clientHeight}),0===c.width&&window.getComputedStyle)&&(l=getComputedStyle(u[0]),l.width&&l.width.indexOf("px")>-1&&l.height&&l.height.indexOf("px")>-1&&(c={width:parseInt(l.width.slice(0,-2)),height:parseInt(l.height.slice(0,-2))})),angular.isString(i)?(u.removeClass("ng-hide"),s?u.css("background-image","url('"+i+"')"):u.attr("src",i)):void(!i||!i.type||0!==i.type.search(t(u[0]))||s&&0!==i.type.indexOf("image")?u.addClass("ng-hide"):c&&n.isResizeSupported()?(c.resizeIf=function(t,u){return n.attrGetter("ngfResizeIf",f,r,{$width:t,$height:u,$file:i})},n.resize(i,c).then(function(n){h(n)},function(n){throw n;})):h(i))});r.$on("$destroy",function(){i()})})}ngFileUpload.service("UploadDataUrl",["UploadBase","$timeout","$q",function(n,t,i){var r=n;return r.base64DataUrl=function(n){if(angular.isArray(n)){var t=i.defer(),u=0;return angular.forEach(n,function(i){r.dataUrl(i,!0)["finally"](function(){if(u++,u===n.length){var i=[];angular.forEach(n,function(n){i.push(n.$ngfDataUrl)});t.resolve(i,n)}})}),t.promise}return r.dataUrl(n,!0)},r.dataUrl=function(n,u){var e,f;return n?u&&null!=n.$ngfDataUrl||!u&&null!=n.$ngfBlobUrl?r.emptyPromise(u?n.$ngfDataUrl:n.$ngfBlobUrl,n):(e=u?n.$$ngfDataUrlPromise:n.$$ngfBlobUrlPromise,e)?e:(f=i.defer(),t(function(){var i,e,o;if(window.FileReader&&n&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 8")||n.size<2e4)&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 9")||n.size<4e6))if(i=window.URL||window.webkitURL,i&&i.createObjectURL&&!u){try{e=i.createObjectURL(n)}catch(s){return void t(function(){n.$ngfBlobUrl="";f.reject()})}t(function(){var u,o,t;if(n.$ngfBlobUrl=e,e)for(f.resolve(e,n),r.blobUrls=r.blobUrls||[],r.blobUrlsTotalSize=r.blobUrlsTotalSize||0,r.blobUrls.push({url:e,size:n.size}),r.blobUrlsTotalSize+=n.size||0,u=r.defaults.blobUrlsMaxMemory||268435456,o=r.defaults.blobUrlsMaxQueueSize||200;(r.blobUrlsTotalSize>u||r.blobUrls.length>o)&&r.blobUrls.length>1;)t=r.blobUrls.splice(0,1)[0],i.revokeObjectURL(t.url),r.blobUrlsTotalSize-=t.size})}else o=new FileReader,o.onload=function(i){t(function(){n.$ngfDataUrl=i.target.result;f.resolve(i.target.result,n);t(function(){delete n.$ngfDataUrl},1e3)})},o.onerror=function(){t(function(){n.$ngfDataUrl="";f.reject()})},o.readAsDataURL(n);else t(function(){n[u?"$ngfDataUrl":"$ngfBlobUrl"]="";f.reject()})}),e=u?n.$$ngfDataUrlPromise=f.promise:n.$$ngfBlobUrlPromise=f.promise,e["finally"](function(){delete n[u?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"]}),e):r.emptyPromise(n,n)},r}]);ngFileUpload.directive("ngfSrc",["Upload","$timeout",function(t,i){return{restrict:"AE",link:function(r,u,f){n(t,i,r,u,f,"ngfSrc",t.attrGetter("ngfResize",f,r),!1)}}}]);ngFileUpload.directive("ngfBackground",["Upload","$timeout",function(t,i){return{restrict:"AE",link:function(r,u,f){n(t,i,r,u,f,"ngfBackground",t.attrGetter("ngfResize",f,r),!0)}}}]);ngFileUpload.directive("ngfThumbnail",["Upload","$timeout",function(t,i){return{restrict:"AE",link:function(r,u,f){var e=t.attrGetter("ngfSize",f,r);n(t,i,r,u,f,"ngfThumbnail",e,t.attrGetter("ngfAsBackground",f,r))}}}]);ngFileUpload.config(["$compileProvider",function(n){n.imgSrcSanitizationWhitelist&&n.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/);n.aHrefSanitizationWhitelist&&n.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/)}]);ngFileUpload.filter("ngfDataUrl",["UploadDataUrl","$sce",function(n,t){return function(i,r,u){if(angular.isString(i))return t.trustAsResourceUrl(i);var f=i&&((r?i.$ngfDataUrl:i.$ngfBlobUrl)||i.$ngfDataUrl);return i&&!f?(!i.$ngfDataUrlFilterInProgress&&angular.isObject(i)&&(i.$ngfDataUrlFilterInProgress=!0,n.dataUrl(i,r)),""):(i&&delete i.$ngfDataUrlFilterInProgress,(i&&f?u?t.trustAsResourceUrl(f):f:i)||"")}}])}();ngFileUpload.service("UploadValidate",["UploadDataUrl","$q","$timeout",function(n,t,i){function u(n){var t="",f=[],i,r,e;if(n.length>2&&"/"===n[0]&&"/"===n[n.length-1])t=n.substring(1,n.length-1);else if(i=n.split(","),i.length>1)for(r=0;r<i.length;r++)e=u(i[r]),e.regexp?(t+="("+e.regexp+")",r<i.length-1&&(t+="|")):f=f.concat(e.excludes);else 0===n.indexOf("!")?f.push("^((?!"+u(n.substring(1)).regexp+").)*$"):(0===n.indexOf(".")&&(n="*"+n),t="^"+n.replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g"),"\\$&")+"$",t=t.replace(/\\\*/g,".*").replace(/\\\?/g,"."));return{regexp:t,excludes:f}}function f(n,t){null==t||n.$dirty||(n.$setDirty?n.$setDirty():n.$dirty=!0)}var r=n;return r.validatePattern=function(n,t){var i,r,f,e,o;if(!t)return!0;for(i=u(t),r=!0,i.regexp&&i.regexp.length&&(f=new RegExp(i.regexp,"i"),r=null!=n.type&&f.test(n.type)||null!=n.name&&f.test(n.name)),e=i.excludes.length;e--;)o=new RegExp(i.excludes[e],"i"),r=r&&(null==n.type||o.test(n.type))&&(null==n.name||o.test(n.name));return r},r.ratioToFloat=function(n){var t=n.toString(),i=t.search(/[x:]/i);return i>-1?parseFloat(t.substring(0,i))/parseFloat(t.substring(i+1)):parseFloat(t)},r.registerModelChangeValidator=function(n,t,i){n&&n.$formatters.push(function(u){if(n.$dirty){var f=u;u&&!angular.isArray(u)&&(f=[u]);r.validate(f,0,n,t,i).then(function(){r.applyModelValidation(n,f)})}return u})},r.applyModelValidation=function(n,t){f(n,t);angular.forEach(n.$ngfValidations,function(t){n.$setValidity(t.name,t.valid)})},r.getValidationAttr=function(n,t,i,u,f){var s="ngf"+i[0].toUpperCase()+i.substr(1),e=r.attrGetter(s,n,t,{$file:f}),o;return null==e&&(e=r.attrGetter("ngfValidate",n,t,{$file:f}))&&(o=(u||i).split("."),e=e[o[0]],o.length>1&&(e=e&&e[o[1]])),e},r.validate=function(n,i,u,f,e){function c(t,i,o){var c,a,s,v;if(n){for(c=n.length,a=null;c--;)s=n[c],s&&(v=r.getValidationAttr(f,e,t,i,s),null!=v&&(o(s,v,c)||(-1===p.indexOf(t)?(s.$error=t,(s.$errorMessages=s.$errorMessages||{})[t]=!0,s.$errorParam=v,-1===h.indexOf(s)&&h.push(s),l||n.splice(c,1),a=!1):n.splice(c,1))));null!==a&&u.$ngfValidations.push({name:t,valid:a})}}function s(i,o,s,c,v){function y(t,r,u){function f(f){var e,o;f()?-1===p.indexOf(i)?((r.$error=i,(r.$errorMessages=r.$errorMessages||{})[i]=!0,r.$errorParam=u,-1===h.indexOf(r)&&h.push(r),l)||(e=n.indexOf(r),e>-1&&n.splice(e,1)),t.resolve(!1)):(o=n.indexOf(r),o>-1&&n.splice(o,1),t.resolve(!0)):t.resolve(!0)}null!=u?c(r,u).then(function(n){f(function(){return!v(n,u)})},function(){f(function(){return a("ngfValidateForce",{$file:r})})}):t.resolve(!0)}var b=[r.emptyPromise(!0)],w;return n&&(n=void 0===n.length?[n]:n,angular.forEach(n,function(n){var u=t.defer();return b.push(u.promise),!s||null!=n.type&&0===n.type.search(s)?void("dimensions"===i&&null!=r.attrGetter("ngfDimensions",f)?r.imageDimensions(n).then(function(t){y(u,n,a("ngfDimensions",{$file:n,$width:t.width,$height:t.height}))},function(){u.resolve(!1)}):"duration"===i&&null!=r.attrGetter("ngfDuration",f)?r.mediaDuration(n).then(function(t){y(u,n,a("ngfDuration",{$file:n,$duration:t}))},function(){u.resolve(!1)}):y(u,n,r.getValidationAttr(f,e,i,o,n))):void u.resolve(!0)})),w=t.defer(),t.all(b).then(function(n){for(var t=!0,r=0;r<n.length;r++)if(!n[r]){t=!1;break}u.$ngfValidations.push({name:i,valid:t});w.resolve(t)}),w.promise}var h,v,y,o;u=u||{};u.$ngfValidations=u.$ngfValidations||[];angular.forEach(u.$ngfValidations,function(n){n.valid=!0});var a=function(n,t){return r.attrGetter(n,f,e,t)},p=(r.attrGetter("ngfIgnoreInvalid",f,e)||"").split(" "),l=r.attrGetter("ngfRunAllValidations",f,e);return null==n||0===n.length?r.emptyPromise({validFiles:n,invalidFiles:[]}):(n=void 0===n.length?[n]:n.slice(0),h=[],c("pattern",null,r.validatePattern),c("minSize","size.min",function(n,t){return n.size+.1>=r.translateScalars(t)}),c("maxSize","size.max",function(n,t){return n.size-.1<=r.translateScalars(t)}),v=0,c("maxTotalSize",null,function(t,i){return v+=t.size,v>r.translateScalars(i)?(n.splice(0,n.length),!1):!0}),c("validateFn",null,function(n,t){return t===!0||null===t||""===t}),!n.length)?r.emptyPromise({validFiles:[],invalidFiles:h}):(y=t.defer(),o=[],o.push(s("maxHeight","height.max",/image/,this.imageDimensions,function(n,t){return n.height<=t})),o.push(s("minHeight","height.min",/image/,this.imageDimensions,function(n,t){return n.height>=t})),o.push(s("maxWidth","width.max",/image/,this.imageDimensions,function(n,t){return n.width<=t})),o.push(s("minWidth","width.min",/image/,this.imageDimensions,function(n,t){return n.width>=t})),o.push(s("dimensions",null,/image/,function(n,t){return r.emptyPromise(t)},function(n){return n})),o.push(s("ratio",null,/image/,this.imageDimensions,function(n,t){for(var u=t.toString().split(","),f=!1,i=0;i<u.length;i++)Math.abs(n.width/n.height-r.ratioToFloat(u[i]))<.01&&(f=!0);return f})),o.push(s("maxRatio","ratio.max",/image/,this.imageDimensions,function(n,t){return n.width/n.height-r.ratioToFloat(t)<.0001})),o.push(s("minRatio","ratio.min",/image/,this.imageDimensions,function(n,t){return n.width/n.height-r.ratioToFloat(t)>-.0001})),o.push(s("maxDuration","duration.max",/audio|video/,this.mediaDuration,function(n,t){return n<=r.translateScalars(t)})),o.push(s("minDuration","duration.min",/audio|video/,this.mediaDuration,function(n,t){return n>=r.translateScalars(t)})),o.push(s("duration",null,/audio|video/,function(n,t){return r.emptyPromise(t)},function(n){return n})),o.push(s("validateAsyncFn",null,null,function(n,t){return t},function(n){return n===!0||null===n||""===n})),t.all(o).then(function(){var t,r;if(l)for(t=0;t<n.length;t++)r=n[t],r.$error&&n.splice(t--,1);l=!1;c("maxFiles",null,function(n,t,r){return t>i+r});y.resolve({validFiles:n,invalidFiles:h})}),y.promise)},r.imageDimensions=function(n){var f,u;return n.$ngfWidth&&n.$ngfHeight?(f=t.defer(),i(function(){f.resolve({width:n.$ngfWidth,height:n.$ngfHeight})}),f.promise):n.$ngfDimensionPromise?n.$ngfDimensionPromise:(u=t.defer(),i(function(){return 0!==n.type.indexOf("image")?void u.reject("not image"):void r.dataUrl(n).then(function(t){function f(){var t=r[0].naturalWidth||r[0].clientWidth,i=r[0].naturalHeight||r[0].clientHeight;r.remove();n.$ngfWidth=t;n.$ngfHeight=i;u.resolve({width:t,height:i})}function e(){r.remove();u.reject("load error")}function o(){i(function(){r[0].parentNode&&(r[0].clientWidth?f():s++>10?e():o())},1e3)}var r=angular.element("<img>").attr("src",t).css("visibility","hidden").css("position","fixed").css("max-width","none !important").css("max-height","none !important"),s;r.on("load",f);r.on("error",e);s=0;o();angular.element(document.getElementsByTagName("body")[0]).append(r)},function(){u.reject("load error")})}),n.$ngfDimensionPromise=u.promise,n.$ngfDimensionPromise["finally"](function(){delete n.$ngfDimensionPromise}),n.$ngfDimensionPromise)},r.mediaDuration=function(n){var f,u;return n.$ngfDuration?(f=t.defer(),i(function(){f.resolve(n.$ngfDuration)}),f.promise):n.$ngfDurationPromise?n.$ngfDurationPromise:(u=t.defer(),i(function(){return 0!==n.type.indexOf("audio")&&0!==n.type.indexOf("video")?void u.reject("not media"):void r.dataUrl(n).then(function(t){function f(){var t=r[0].duration;n.$ngfDuration=t;r.remove();u.resolve(t)}function e(){r.remove();u.reject("load error")}function o(){i(function(){r[0].parentNode&&(r[0].duration?f():s>10?e():o())},1e3)}var r=angular.element(0===n.type.indexOf("audio")?"<audio>":"<video>").attr("src",t).css("visibility","none").css("position","fixed"),s;r.on("loadedmetadata",f);r.on("error",e);s=0;o();angular.element(document.body).append(r)},function(){u.reject("load error")})}),n.$ngfDurationPromise=u.promise,n.$ngfDurationPromise["finally"](function(){delete n.$ngfDurationPromise}),n.$ngfDurationPromise)},r}]);ngFileUpload.service("UploadResize",["UploadValidate","$q",function(n,t){var i=n,r=function(n,t,i,r,u){var f=u?Math.max(i/n,r/t):Math.min(i/n,r/t);return{width:n*f,height:t*f,marginX:n*f-i,marginY:t*f-r}},u=function(n,u,f,e,o,s,h,c){var a=t.defer(),v=document.createElement("canvas"),l=document.createElement("img");return l.setAttribute("style","visibility:hidden;position:fixed;z-index:-100000"),document.body.appendChild(l),l.onload=function(){var t=l.width,y=l.height,p,w,n,b;if(l.parentNode.removeChild(l),null!=c&&c(t,y)===!1)return void a.reject("resizeIf");try{s&&(p=i.ratioToFloat(s),w=t/y,p>w?(u=t,f=u/p):(f=y,u=f*p));u||(u=t);f||(f=y);n=r(t,y,u,f,h);v.width=Math.min(n.width,u);v.height=Math.min(n.height,f);b=v.getContext("2d");b.drawImage(l,Math.min(0,-n.marginX/2),Math.min(0,-n.marginY/2),n.width,n.height);a.resolve(v.toDataURL(o||"image/WebP",e||.934))}catch(k){a.reject(k)}},l.onerror=function(){l.parentNode.removeChild(l);a.reject()},l.src=n,a.promise};return i.dataUrltoBlob=function(n,t,i){for(var u,f=n.split(","),s=f[0].match(/:(.*?);/)[1],e=atob(f[1]),r=e.length,o=new Uint8Array(r);r--;)o[r]=e.charCodeAt(r);return u=new window.Blob([o],{type:s}),u.name=t,u.$ngfOrigSize=i,u},i.isResizeSupported=function(){var n=document.createElement("canvas");return window.atob&&n.getContext&&n.getContext("2d")&&window.Blob},i.isResizeSupported()&&Object.defineProperty(window.Blob.prototype,"name",{get:function(){return this.$ngfName},set:function(n){this.$ngfName=n},configurable:!0}),i.resize=function(n,r){if(0!==n.type.indexOf("image"))return i.emptyPromise(n);var f=t.defer();return i.dataUrl(n,!0).then(function(t){u(t,r.width,r.height,r.quality,r.type||n.type,r.ratio,r.centerCrop,r.resizeIf).then(function(u){if("image/jpeg"===n.type&&r.restoreExif!==!1)try{u=i.restoreExif(t,u)}catch(e){setTimeout(function(){throw e;},1)}try{var o=i.dataUrltoBlob(u,n.name,n.size);f.resolve(o)}catch(e){f.reject(e)}},function(t){"resizeIf"===t&&f.resolve(n);f.reject(t)})},function(n){f.reject(n)}),f.promise},i}]),function(){function t(t,i,r,u,f,e,o,s,h,c){function v(){return i.attr("disabled")||l("ngfDropDisabled",t)}function w(n,i,r){if(n){var u;try{u=n&&n.getData&&n.getData("text/html")}catch(f){}tt(n.items,n.files,l("ngfAllowDir",t)!==!1,l("multiple")||l("ngfMultiple",t)).then(function(n){n.length?b(n,i):g(r,u).then(function(n){b(n,i)})})}}function b(n,i){s.updateModel(u,r,t,l("ngfChange")||l("ngfDrop"),n,i)}function g(n,i){var u,e,o,f;return!s.shouldUpdateOn(n,r,t)||"string"!=typeof i?s.rejectPromise([]):(u=[],i.replace(/<(img src|img [^>]* src) *=\"([^\"]*)\"/gi,function(n,t,i){u.push(i)}),e=[],o=[],u.length)?(angular.forEach(u,function(n){e.push(s.urlToBlob(n).then(function(n){o.push(n)}))}),f=c.defer(),c.all(e).then(function(){f.resolve(o)},function(n){f.reject(n)}),f.promise):s.emptyPromise()}function nt(n,t,i,r){var u=l("ngfDragOverClass",n,{$event:i}),f="dragover",e,h,o;if(angular.isString(u))f=u;else if(u&&(u.delay&&(d=u.delay),u.accept||u.reject))if(e=i.dataTransfer.items,null!=e&&e.length)for(h=u.pattern||l("ngfPattern",n,{$event:i}),o=e.length;o--;){if(!s.validatePattern(e[o],h)){f=u.reject;break}f=u.accept}else f=u.accept;r(f)}function tt(n,i,u,f){function nt(n,t){var i=c.defer(),u,r;if(null!=n)if(n.isDirectory){u=[s.emptyPromise()];g&&(r={type:"directory"},r.name=r.path=(t||"")+n.name,e.push(r));var h=n.createReader(),f=[],o=function(){h.readEntries(function(r){try{r.length?(f=f.concat(Array.prototype.slice.call(r||[],0)),o()):(angular.forEach(f.slice(0),function(i){e.length<=y&&a>=v&&u.push(nt(i,(t?t:"")+n.name+"/"))}),c.all(u).then(function(){i.resolve()},function(n){i.reject(n)}))}catch(s){i.reject(s)}},function(n){i.reject(n)})};o()}else n.file(function(n){try{n.path=(t?t:"")+n.name;g&&(n=s.rename(n,n.path));e.push(n);v+=n.size;i.resolve()}catch(r){i.reject(r)}},function(n){i.reject(n)});return i.promise}var y=s.getValidationAttr(r,t,"maxFiles"),a,h,b,k,d,p,w;null==y&&(y=Number.MAX_VALUE);a=s.getValidationAttr(r,t,"maxTotalSize");null==a&&(a=Number.MAX_VALUE);var g=l("ngfIncludeDir",t),e=[],v=0,tt=[s.emptyPromise()];if(n&&n.length>0&&"file:"!==o.location.protocol)for(h=0;h<n.length;h++){if(n[h].webkitGetAsEntry&&n[h].webkitGetAsEntry()&&n[h].webkitGetAsEntry().isDirectory){if(b=n[h].webkitGetAsEntry(),b.isDirectory&&!u)continue;null!=b&&tt.push(nt(b))}else k=n[h].getAsFile(),null!=k&&(e.push(k),v+=k.size);if(e.length>y||v>a||!f&&e.length>0)break}else if(null!=i)for(d=0;d<i.length;d++)if(p=i.item(d),(p.type||p.size>0)&&(e.push(p),v+=p.size),e.length>y||v>a||!f&&e.length>0)break;return w=c.defer(),c.all(tt).then(function(){if(f||g||!e.length)w.resolve(e);else{for(var n=0;e[n]&&"directory"===e[n].type;)n++;w.resolve([e[n]])}},function(n){w.reject(n)}),w.promise}var p=n(),l=function(n,t,i){return s.attrGetter(n,r,t,i)};if(l("dropAvailable")&&e(function(){t[l("dropAvailable")]?t[l("dropAvailable")].value=p:t[l("dropAvailable")]=p}),!p)return void(l("ngfHideOnDropNotAvailable",t)===!0&&i.css("display","none"));null==l("ngfSelect")&&s.registerModelChangeValidator(u,r,t);var a,k=null,y=f(l("ngfStopPropagation")),d=1;i[0].addEventListener("dragover",function(n){if(!v()&&s.shouldUpdateOn("drop",r,t)){if(n.preventDefault(),y(t)&&n.stopPropagation(),navigator.userAgent.indexOf("Chrome")>-1){var u=n.dataTransfer.effectAllowed;n.dataTransfer.dropEffect="move"===u||"linkMove"===u?"move":"copy"}e.cancel(k);a||(a="C",nt(t,r,n,function(r){a=r;i.addClass(a);l("ngfDrag",t,{$isDragging:!0,$class:a,$event:n})}))}},!1);i[0].addEventListener("dragenter",function(n){!v()&&s.shouldUpdateOn("drop",r,t)&&(n.preventDefault(),y(t)&&n.stopPropagation())},!1);i[0].addEventListener("dragleave",function(n){!v()&&s.shouldUpdateOn("drop",r,t)&&(n.preventDefault(),y(t)&&n.stopPropagation(),k=e(function(){a&&i.removeClass(a);a=null;l("ngfDrag",t,{$isDragging:!1,$event:n})},d||100))},!1);i[0].addEventListener("drop",function(n){!v()&&s.shouldUpdateOn("drop",r,t)&&(n.preventDefault(),y(t)&&n.stopPropagation(),a&&i.removeClass(a),a=null,w(n.dataTransfer,n,"dropUrl"))},!1);i[0].addEventListener("paste",function(n){navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&l("ngfEnableFirefoxPaste",t)&&n.preventDefault();!v()&&s.shouldUpdateOn("paste",r,t)&&w(n.clipboardData||n.originalEvent.clipboardData,n,"pasteUrl")},!1);navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&l("ngfEnableFirefoxPaste",t)&&(i.attr("contenteditable",!0),i.on("keypress",function(n){n.metaKey||n.ctrlKey||n.preventDefault()}))}function n(){var n=document.createElement("div");return"draggable"in n&&"ondrop"in n&&!/Edge\/12./i.test(navigator.userAgent)}ngFileUpload.directive("ngfDrop",["$parse","$timeout","$window","Upload","$http","$q",function(n,i,r,u,f,e){return{restrict:"AEC",require:"?ngModel",link:function(o,s,h,c){t(o,s,h,c,n,i,r,u,f,e)}}}]);ngFileUpload.directive("ngfNoFileDrop",function(){return function(t,i){n()&&i.css("display","none")}});ngFileUpload.directive("ngfDropAvailable",["$parse","$timeout","Upload",function(t,i,r){return function(u,f,e){if(n()){var o=t(r.attrGetter("ngfDropAvailable",e));i(function(){o(u);o.assign&&o.assign(u,!0)})}}}])}();ngFileUpload.service("UploadExif",["UploadResize","$q",function(n,t){function r(n,t,i,r){switch(t){case 2:return n.transform(-1,0,0,1,i,0);case 3:return n.transform(-1,0,0,-1,i,r);case 4:return n.transform(1,0,0,-1,0,r);case 5:return n.transform(0,1,1,0,0,0);case 6:return n.transform(0,1,-1,0,r,0);case 7:return n.transform(0,-1,-1,0,r,i);case 8:return n.transform(0,-1,1,0,0,i)}}function u(n){for(var i="",r=new Uint8Array(n),u=r.byteLength,t=0;u>t;t++)i+=String.fromCharCode(r[t]);return window.btoa(i)}var i=n;return i.isExifSupported=function(){return window.FileReader&&(new FileReader).readAsArrayBuffer&&i.isResizeSupported()},i.readOrientation=function(n){var i=t.defer(),r=new FileReader,u=n.slice?n.slice(0,65536):n;return r.readAsArrayBuffer(u),r.onerror=function(n){return i.reject(n)},r.onload=function(n){var u={orientation:1},r=new DataView(this.result),h,t,s,f,c,e,o;if(65496!==r.getUint16(0,!1))return i.resolve(u);for(h=r.byteLength,t=2;h>t;)if(s=r.getUint16(t,!1),t+=2,65505===s){if(1165519206!==r.getUint32(t+=2,!1))return i.resolve(u);for(f=18761===r.getUint16(t+=6,!1),t+=r.getUint32(t+4,f),c=r.getUint16(t,f),t+=2,e=0;c>e;e++)if(274===r.getUint16(t+12*e,f))return o=r.getUint16(t+12*e+8,f),o>=2&&8>=o&&(r.setUint16(t+12*e+8,1,f),u.fixedArrayBuffer=n.target.result),u.orientation=o,i.resolve(u)}else{if(65280!=(65280&s))break;t+=r.getUint16(t,!1)}return i.resolve(u)},i.promise},i.applyExifRotation=function(n){if(0!==n.type.indexOf("image/jpeg"))return i.emptyPromise(n);var f=t.defer();return i.readOrientation(n).then(function(t){return t.orientation<2||t.orientation>8?f.resolve(n):void i.dataUrl(n,!0).then(function(e){var s=document.createElement("canvas"),o=document.createElement("img");o.onload=function(){var h,e,c;try{s.width=t.orientation>4?o.height:o.width;s.height=t.orientation>4?o.width:o.height;h=s.getContext("2d");r(h,t.orientation,o.width,o.height);h.drawImage(o,0,0);e=s.toDataURL(n.type||"image/WebP",.934);e=i.restoreExif(u(t.fixedArrayBuffer),e);c=i.dataUrltoBlob(e,n.name);f.resolve(c)}catch(l){return f.reject(l)}};o.onerror=function(){f.reject()};o.src=e},function(n){f.reject(n)})},function(n){f.reject(n)}),f.promise},i.restoreExif=function(n,t){var i={};return i.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i.encode64=function(n){var u,t,o,s,f,h="",i="",r="",e=0;do u=n[e++],t=n[e++],i=n[e++],o=u>>2,s=(3&u)<<4|t>>4,f=(15&t)<<2|i>>6,r=63&i,isNaN(t)?f=r=64:isNaN(i)&&(r=64),h=h+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(f)+this.KEY_STR.charAt(r),u=t=i="",o=s=f=r="";while(e<n.length);return h},i.restore=function(n,t){n.match("data:image/jpeg;base64,")&&(n=n.replace("data:image/jpeg;base64,",""));var i=this.decode64(n),r=this.slice2Segments(i),u=this.exifManipulation(t,r);return"data:image/jpeg;base64,"+this.encode64(u)},i.exifManipulation=function(n,t){var i=this.getExifArray(t),r=this.insertExif(n,i);return new Uint8Array(r)},i.getExifArray=function(n){for(var t,i=0;i<n.length;i++)if(t=n[i],255===t[0]&225===t[1])return t;return[]},i.insertExif=function(n,t){var f=n.replace("data:image/jpeg;base64,",""),r=this.decode64(f),u=r.indexOf(255,3),e=r.slice(0,u),o=r.slice(u),i=e;return i=i.concat(t),i=i.concat(o)},i.slice2Segments=function(n){for(var t=0,i=[];;){if(255===n[t]&218===n[t+1])break;if(255===n[t]&216===n[t+1])t+=2;else{var u=256*n[t+2]+n[t+3],r=t+u+2,f=n.slice(t,r);i.push(f);t=r}if(t>n.length)break}return i},i.decode64=function(n){var e,o,s,r,t,h="",u="",i=0,f=[];/[^A-Za-z0-9\+\/\=]/g.exec(n)&&console.log("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, NaNExpect errors in decoding.");n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");do s=this.KEY_STR.indexOf(n.charAt(i++)),r=this.KEY_STR.indexOf(n.charAt(i++)),t=this.KEY_STR.indexOf(n.charAt(i++)),u=this.KEY_STR.indexOf(n.charAt(i++)),e=s<<2|r>>4,o=(15&r)<<4|t>>2,h=(3&t)<<6|u,f.push(e),64!==t&&f.push(o),64!==u&&f.push(h),e=o=h="",s=r=t=u="";while(i<n.length);return f},i.restore(n,t)},i}]);baseModule=angular.module("base.module",["searchBlock.controller","helper.service","articleListingBlock.controller","bookReviewBlock.controller","bookShelfListingBlock.controller","booklistShelfListingBlock.controller","bookFinderBlock.controller","rwEnter.directive","rwLink.directive","rwSetCardHeight.directive","quizBlock.controller","imageUploadBlock.controller","rwToggleFlip.directive","categoryFilter.filters","truncate.filter","angularUtils.directives.dirPagination","endpoints.service","ngFileUpload"]);angular.module("lodash.module",[]).constant("_",window._),function(){"use strict";angular.module("data.service",[]).service("data",["$rootScope","$http","$q",function(n,t,i){this.get=function(r){var u=i.defer(),f=t.get(r);return f.then(function(n){return u.resolve(n.data)},function(t){return n.$broadcast("serviceLayerErrorEvent",t),u.reject(t)},function(n){return u.update(n)}),u.promise};this.post=function(r,u){var f=i.defer(),e=t.post(r,u);return e.then(function(n){return f.resolve(n.data)},function(t){return n.$broadcast("serviceLayerErrorEvent",t),f.reject(t)},function(n){return f.update(n)}),f.promise}}])}(),function(){"use strict";angular.module("endpoints.service",["data.service"]).service("endpoints",["data",function(n){this.searchData={post:function(t){return n.post("/api/Search/get",t)}};this.booklistData={post:function(t){return n.post("/api/Booklist/get",t)}};this.filtersData={get:function(){return n.get("/api/Categories/getall")}};this.articleListingData={post:function(t){return n.post("/api/ArticleListing/Search",t)}};this.bookReview={post:function(t){return n.post("/api/BookReview/get",t)}};this.bookFinderCategories={get:function(){return n.get("/api/BookFinder/get")}};this.quiz={get:function(t){return n.get("/api/Quiz/get?quizId="+t)}};this.bookFinderSearch={post:function(t){return n.post("/api/BookFinder/Search",t)}}}])}(),function(){"use strict";angular.module("helper.service",[]).service("helper",[function(){this.convertToReadableSize=function(n,t){if(n==0)return"0 Bytes";var i=1e3,u=t+1||3,r=Math.floor(Math.log(n)/Math.log(i));return parseFloat((n/Math.pow(i,r)).toFixed(u))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]};this.convertToReadableDate=function(n){var i=n.split("T"),t=i[0].split("-");return t[2]+" "+monthNames[t[1]-1]+" "+t[0]}}])}()