unpoly-rails 0.51.0 → 0.51.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of unpoly-rails might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f569613e5854dd55d5273264a5f5bcae73afca0e
4
- data.tar.gz: 0e5d5e9745f0a7358149d85c79b3b893fe5216c5
3
+ metadata.gz: 79ca1fe7f885ce9f916a26965461068cf757665f
4
+ data.tar.gz: bef0dec9596348d3a3071298e3894e655cf02644
5
5
  SHA512:
6
- metadata.gz: f658c7dfac8658a6f461c7212037b39f54b63dcf89827de963fda9407d0d6214b257ded8a809e8333189effbb0f4b88590cd77723dbe22fe8a5d88fc4105e74b
7
- data.tar.gz: 3a9f57868926279643620e70e4d873f9bd82b06e3a2f4e096e5240079753719128c680cb085bbeec75ffde38d9b93aad2772a78c6159de01cb293c617d865222
6
+ metadata.gz: 7034510dafd6378cad2c17982365cbf31bd6779b6129e597fdfd1cca6cb2b34a750f873b0bd7301f0baf7532a648eb576dbcd8998bb9d4adc8a06864dbd442af
7
+ data.tar.gz: ebc42fa5ccebdf3947eb6277ff5da3a582f65508536e83295160520b7ffb9960b025c2fc071e661515952d864ce3094c24de88e4f66d533efb488a6e5295e268
data/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ Changes to this project will be documented in this file.
6
6
  This project mostly adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
 
9
+
10
+ 0.51.1
11
+ ------
12
+
13
+ ### Fragment updates
14
+
15
+ - Fix a bug where Unpoly would crash when replacing a fragment with a `<script>` tag with a later sibling element.
16
+
17
+
18
+
9
19
  0.51.0
10
20
  ------
11
21
 
data/dist/unpoly.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  (function() {
7
7
  window.up = {
8
- version: "0.51.0",
8
+ version: "0.51.1",
9
9
  renamedModule: function(oldName, newName) {
10
10
  return typeof Object.defineProperty === "function" ? Object.defineProperty(up, oldName, {
11
11
  get: function() {
@@ -6550,7 +6550,7 @@ is built from these functions. You can use them to extend Unpoly from your
6550
6550
 
6551
6551
  (function() {
6552
6552
  up.dom = (function($) {
6553
- var autofocus, bestMatchingSteps, bestPreflightSelector, config, destroy, emitFragmentInserted, emitFragmentKept, extract, findKeepPlan, first, firstInLayer, firstInPriority, fixScripts, hello, isRealElement, isSingletonElement, layerOf, matchesLayer, parseResponseDoc, processResponse, reload, replace, reset, resolveSelector, setSource, shouldExtractTitle, shouldLogDestruction, source, swapElements, swapSingletonElement, transferKeepableElements, u, updateHistoryAndTitle;
6553
+ var autofocus, bestMatchingSteps, bestPreflightSelector, config, destroy, detectScriptFixes, emitFragmentInserted, emitFragmentKept, extract, findKeepPlan, first, firstInLayer, firstInPriority, fixScripts, hello, isRealElement, isSingletonElement, layerOf, matchesLayer, parseResponseDoc, processResponse, reload, replace, reset, resolveSelector, setSource, shouldExtractTitle, shouldLogDestruction, source, swapElements, swapSingletonElement, transferKeepableElements, u, updateHistoryAndTitle;
6554
6554
  u = up.util;
6555
6555
 
6556
6556
  /**
@@ -6951,7 +6951,7 @@ is built from these functions. You can use them to extend Unpoly from your
6951
6951
  step = extractSteps[i];
6952
6952
  up.log.group('Updating %s', step.selector, function() {
6953
6953
  var swapPromise;
6954
- fixScripts(step.$new.get(0));
6954
+ fixScripts(step.$new);
6955
6955
  swapPromise = swapElements(step.$old, step.$new, step.pseudoClass, step.transition, options);
6956
6956
  swapPromises.push(swapPromise);
6957
6957
  return options = u.merge(options, {
@@ -6976,20 +6976,35 @@ is built from these functions. You can use them to extend Unpoly from your
6976
6976
  cascade = new up.ExtractCascade(selector, options);
6977
6977
  return cascade.bestMatchingSteps();
6978
6978
  };
6979
- fixScripts = function(element) {
6979
+ fixScripts = function($element) {
6980
+ var fix, fixes, i, len, results;
6981
+ fixes = [];
6982
+ detectScriptFixes($element.get(0), fixes);
6983
+ results = [];
6984
+ for (i = 0, len = fixes.length; i < len; i++) {
6985
+ fix = fixes[i];
6986
+ results.push(fix());
6987
+ }
6988
+ return results;
6989
+ };
6990
+ detectScriptFixes = function(element, fixes) {
6980
6991
  var child, clone, i, len, ref, results;
6981
6992
  if (element.tagName === 'NOSCRIPT') {
6982
6993
  clone = document.createElement('noscript');
6983
6994
  clone.textContent = element.innerHTML;
6984
- return element.parentNode.replaceChild(clone, element);
6995
+ return fixes.push(function() {
6996
+ return element.parentNode.replaceChild(clone, element);
6997
+ });
6985
6998
  } else if (element.tagName === 'SCRIPT') {
6986
- return element.parentNode.removeChild(element);
6999
+ return fixes.push(function() {
7000
+ return element.parentNode.removeChild(element);
7001
+ });
6987
7002
  } else {
6988
7003
  ref = element.children;
6989
7004
  results = [];
6990
7005
  for (i = 0, len = ref.length; i < len; i++) {
6991
7006
  child = ref[i];
6992
- results.push(fixScripts(child));
7007
+ results.push(detectScriptFixes(child, fixes));
6993
7008
  }
6994
7009
  return results;
6995
7010
  }
data/dist/unpoly.min.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){window.up={version:"0.51.0",renamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.log.warn("up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$,F,C,D,O,R,N,U,M,L,H,K,q,j,_,V,I,z,W,Q,B,J,X,G,Z,Y,tt,et,nt,rt,ot,it,ut,st,at,lt,ct,pt,ft,ht,dt,mt,vt,gt,yt,bt,wt,kt,St,Tt,Et,At,xt,Pt,$t,Ft,Ct,Dt,Ot,Rt,Nt,Ut,Mt,Lt,Ht,Kt,qt,jt,_t,Vt,It,zt,Wt,Qt,Bt,Jt,Xt,Gt,Zt,Yt,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe;return Et=r.noop,vt=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},ut=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},xt=function(t,e){var n,r,o;return r=Ut(t),n=r.protocol+"//"+r.hostname,ut(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.hash:void 0)===!0&&(n+=r.hash),(null!=e?e.search:void 0)!==!1&&(n+=r.search),n},I=function(t){var e;return e=Ut(location.href),t=Ut(t),e.protocol!==t.protocol||e.host!==t.host},Ut=function(t){var e;return t=ae(t),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),_(e.hostname)&&(e.href=e.href),e)},At=function(t){return t?t.toUpperCase():"GET"},yt=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,c,p,f,h,d,m,v,g;for(v=t.split(/[ >]/),o=null,f=c=0,d=v.length;d>c;f=++c){for(s=v[f],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,h=0,m=u.length;m>h;h++)switch(a=u[h],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===f&&(o=e),n=e}return o},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},Yt=function(t){var e,n,o,i,u,s,a,l,c;if(e=r(t),l=void 0,c=Ht(e.attr("up-id")))l="[up-id='"+c+"']";else if(i=Ht(e.attr("id")))l="#"+i;else if(a=Ht(e.attr("name")))l="[name='"+a+"']";else if(n=Ht(Tt(e)))for(l="",o=0,s=n.length;s>o;o++)u=n[o],l+="."+u;else l=e.prop("tagName").toLowerCase();return l},Tt=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Xt(n,function(t){return ot(t)&&!t.match(/^up-/)})},S=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},d=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;o>n;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},h=Object.assign||d,se=r.trim,P=function(t,e){var n,r,o,i,u;for(u=[],r=n=0,i=t.length;i>n;r=++n)o=t[r],u.push(e(o,r));return u},ht=P,ie=function(t,e){var n,r,o,i;for(i=[],r=n=0,o=t-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)i.push(e(r));return i},tt=function(t){return null===t},lt=function(t){return void 0===t},z=function(t){return!lt(t)},Y=function(t){return lt(t)||tt(t)},G=function(t){return!Y(t)},_=function(t){return Y(t)||nt(t)&&0===Object.keys(t).length||0===t.length},Ht=function(t,e){return null==e&&(e=ot),e(t)?t:void 0},ot=function(t){return!_(t)},X=function(t){return"function"==typeof t},st=function(t){return"string"==typeof t||t instanceof String},et=function(t){return"number"==typeof t||t instanceof Number},rt=function(t){return!("object"!=typeof t||tt(t)||Z(t)||it(t)||J(t)||j(t))},nt=function(t){var e;return e=typeof t,"object"===e&&!tt(t)||"function"===e},Q=function(t){return!(!t||1!==t.nodeType)},Z=function(t){return t instanceof jQuery},it=function(t){return nt(t)&&X(t.then)},j=Array.isArray,J=function(t){return t instanceof FormData},ue=function(t){return Array.prototype.slice.call(t)},w=function(t){return j(t)?t=t.slice():nt(t)&&!X(t)?t=h({},t):up.fail("Cannot copy %o",t),t},ae=function(t){return Z(t)?t.get(0):t},gt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],h.apply(null,[{}].concat(t.call(e)))},Nt=function(t,e){var n,r,o,i;if(o=t?w(t):{},e)for(r in e)n=e[r],i=o[r],G(i)?nt(n)&&nt(i)&&(o[r]=Nt(i,n)):o[r]=n;return o},Rt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],A(e,G)},A=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=n;break}return i},p=function(t,e){var n,r,o,i;for(i=!1,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=!0;break}return i},l=function(t,e){var n,r,o,i;for(i=!0,r=0,o=t.length;o>r;r++)if(n=t[r],!e(n)){i=!1;break}return i},g=function(t){return Xt(t,G)},le=function(t){var e;return e={},Xt(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Xt=function(t,e){var n;return n=[],P(t,function(t){return e(t)?n.push(t):void 0}),n},_t=function(t,e){return Xt(t,function(t){return!e(t)})},q=function(t,e){return Xt(t,function(t){return b(e,t)})},Kt=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;o>t;t++)n=r[t],i.push(e.attr(n));return i}(),A(o,ot)},ne=function(t,e){return setTimeout(e,t)},St=function(t){return setTimeout(t,0)},bt=function(t){return Promise.resolve().then(t)},ft=function(t){return t[t.length-1]},v=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Jt=vt(function(){var t,e,n;return t=r("<div>"),t.attr("up-viewport",""),t.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),e=t.get(0),n=e.offsetWidth-e.clientWidth,t.remove(),n}),x=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=t.css("overflow-y"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},Ft=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},oe=function(t,e,n){var o,i,u;return o=r(t),u=o.css(Object.keys(e)),o.css(e),i=function(){return o.css(u)},n?(n(),i()):Ft(i)},M=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),_(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},L=function(t){return t=ae(t),t.offsetHeight},T=function(t,e,n){},dt=function(t){var e,n;return e=r(t),n=e.css(["margin-top","margin-right","margin-bottom","margin-left"]),{top:parseFloat(n["margin-top"]),right:parseFloat(n["margin-right"]),bottom:parseFloat(n["margin-bottom"]),left:parseFloat(n["margin-left"])}},mt=function(t,e){var n,o,i,u,s,a;return e=Nt(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=dt(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},k=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],n.specified?u.push(e.attr(n.name,n.value)):u.push(void 0);return u},Zt=function(t,e){return t.find(e).addBack(e)},Gt=function(t,e){var n,r;return r=Zt(t,e),n=t.parents(e),r.add(n)},F=function(t){return 27===t.keyCode},b=function(t,e){return t.indexOf(e)>=0},m=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Ct=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;r>n;n++)u=i[n],o.hasOwnProperty(u)&&(e[u]=o[u]);return e},D=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=w(o),n=0,r=i.length;r>n;n++)u=i[n],delete e[u];return e},ct=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},pt=function(t){var e;return e=lt(t.button)||0===t.button,e&&ct(t)},ce=function(){return new Promise(Et)},Pt=function(){return r()},ee=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],Y(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},It=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},wt=function(t){var e,n,o,i,u,s,a;for(u={},a=[],n=[],o=0,i=t.length;i>o;o++)s=t[o],st(s)?a.push(s):n.push(s);return u.parsed=n,a.length&&(e=a.join(", "),u.parsed.push(e)),u.select=function(){return u.find(void 0)},u.find=function(t){var e,n,o,i,s,a;for(n=Pt(),s=u.parsed,o=0,i=s.length;i>o;o++)a=s[o],e=t?t.find(a):r(a),n=n.add(e);return n},u.selectInSubtree=function(t){var e;return e=u.find(t),u.doesMatch(t)&&(e=e.add(t)),e},u.doesMatch=function(t){var e;return e=r(t),p(u.parsed,function(t){return e.is(t)})},u.seekUp=function(t){var e,n,o;for(o=r(t),e=o,n=void 0;e.length;){if(u.doesMatch(e)){n=e;break}e=e.parent()}return n||Pt()},u},C=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],X(n)?n.apply(null,e):n},y=function(t){var e;return e=Ot(t),Object.preventExtensions(e),e},Ot=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,X(n)&&(n=n()),h(e,n)},e.reset(),e},pe=function(t){var e,n;return t=ae(t),e=t.parentNode,n=ue(t.childNodes),P(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},$t=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},B=function(t){var e,n;for(e=r(t);;){if(n=e.css("position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},N=function(t,e){var n,o,i,u;return n=r(t),o=$t(n),i=n.position(),u=o.offset(),n.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},Wt=function(t){var e,n,r,o,i,u,s;if(j(t),J(t))return up.fail("Cannot convert FormData into an array");for(u=Qt(t),e=[],s=u.split("&"),n=0,r=s.length;r>n;n++)i=s[n],ot(i)&&(o=i.split("="),e.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return e},Qt=function(t,e){var n;if(e=Nt(e,{purpose:"url"}),st(t),J(t))return up.fail("Cannot convert FormData into a query string");if(ot(t)){switch(n=r.param(t),e.purpose){case"url":n=n.replace(/\+/g,"%20");break;case"form":n=n.replace(/\%20/g,"+");break;default:up.fail("Unknown purpose %o",e.purpose)}return n}return""},u=function(t){var e,n;return n="input[type=submit], button[type=submit], button:not([type])",e=r(document.activeElement),e.is(n)&&t.has(e)?e:t.find(n).first()},Bt=function(t){var e,n,o,i,s,a;return n=r(t),a=n.find("input[type=file]").length,e=u(n),o=e.attr("name"),i=e.val(),s=a?new FormData(n.get(0)):n.serializeArray(),ot(o)&&f(s,o,i),s},f=function(t,e,n,r){var o;return t||(t=[]),j(t)?t.push({name:e,value:n}):J(t)?t.append(e,n):nt(t)?t[e]=n:st(t)&&(o=Qt([{name:e,value:n}],r),t=[t,o].join("&")),t},R=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],j(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),fe().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},$=function(t){return t.replace(/[&<>"]/g,function(t){return a[t]})},Lt=function(t,e){var n;return n=t[e],delete t[e],n},zt=function(t,e,n){return t[n]=Lt(t,e)},Mt=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},O=function(t){var e;return e=ft(t),rt(e)?t.pop():{}},Dt=function(t){var e;return e=r(t).css("opacity"),G(e)?parseFloat(e):void 0},fe=vt(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),K=function(t){return t},W=function(t){return t=ae(t),!jQuery.contains(document.documentElement,t)},qt=function(e){var n,r;return n=kt(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},s=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=ft(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;return!this.currentTask&&(this.currentTask=this.queue.shift())?(t=this.currentTask(),c(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))):void 0},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=ht(e,qt),this.poke(),this.promise()},e}(),re=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},te=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return ht(e,function(t){return t()})}},jt=function(t){var e,n;return n=void 0,e=new Promise(function(e,r){return n=ne(t,e)}),e.cancel=function(){return clearTimeout(n)},e},H=function(t){var e,n,r,o;return e=mt(t),r=v(),n=e.left+.5*e.width,o=.5*r.width,o>n?"left":"right"},E=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},U=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;r>n;n++)o=t[n],j(o)?e=e.concat(o):e.push(o);return e},at=function(t){return!!t},c=function(t,e){return t.then(e,e)},kt=function(){var t,e;return e=void 0,_t=void 0,t=new Promise(function(t,n){return e=t,_t=n}),t.resolve=e,t.reject=_t,t.promise=function(){return t},t},Vt=function(t){var e,n;try{return t()}catch(n){return e=n,Promise.reject(e)}},V=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Wt,requestDataAsQuery:Qt,appendRequestData:f,requestDataFromForm:Bt,offsetParent:$t,fixedToAbsolute:N,isFixed:B,presentAttr:Kt,parseUrl:Ut,normalizeUrl:xt,normalizeMethod:At,methodAllowsPayload:yt,createElementFromHtml:S,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:Yt,assign:h,assignPolyfill:d,copy:w,merge:gt,options:Nt,option:Rt,fail:R,each:P,map:ht,times:ie,any:p,all:l,detect:A,select:Xt,reject:_t,intersect:q,compact:g,uniq:le,last:ft,isNull:tt,isDefined:z,isUndefined:lt,isGiven:G,isMissing:Y,isPresent:ot,isBlank:_,presence:Ht,isObject:nt,isFunction:X,isString:st,isNumber:et,isElement:Q,isJQuery:Z,isPromise:it,isOptions:rt,isArray:j,isFormData:J,isUnmodifiedKeyEvent:ct,isUnmodifiedMouseEvent:pt,nullJQuery:Pt,unJQuery:ae,setTimer:ne,nextFrame:St,measure:mt,temporaryCss:oe,cssAnimate:T,forceCompositing:M,forceRepaint:L,escapePressed:F,copyAttributes:k,selectInSubtree:Zt,selectInDynasty:Gt,contains:b,toArray:ue,castedAttr:m,clientSize:v,only:Ct,except:D,trim:se,unresolvablePromise:ce,setMissingAttrs:ee,remove:It,memoize:vt,scrollbarWidth:Jt,documentHasVerticalScrollbar:x,config:y,openConfig:Ot,unwrapElement:pe,multiSelector:wt,error:R,pluckData:Mt,pluckKey:Lt,renameKey:zt,extractOptions:O,isDetached:W,noop:Et,opacity:Dt,whenReady:fe,identity:K,escapeHtml:$,DivertibleChain:s,submittedValue:re,sequence:te,promiseTimer:jt,previewable:qt,evalOption:C,horizontalScreenHalf:H,detachWith:E,flatten:U,isTruthy:at,newDeferred:kt,always:c,rejectOnError:Vt,isBodyDescendant:V,isCrossDomain:I,microtask:bt}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store={}}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):this.key.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return this.config.cachable?this.config.cachable(t):!0},r.prototype.clear=function(){return this.store={}},r.prototype.log=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix?(t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)):void 0},r.prototype.keys=function(){return Object.keys(this.store)},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;return o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=null,r=null,t.each(o,function(t){return function(e){var o,i;return o=t.store[e],i=o.timestamp,!r||r>i?(n=e,r=i):void 0}}(this)),n)?delete this.store[n]:void 0},r.prototype.alias=function(e,n){var r;return r=this.get(e,{silent:!0}),t.isDefined(r)?this.set(n,r):void 0},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n;return this.isEnabled()&&this.isCachable(t)?(this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),this.store[n]={timestamp:this.timestamp(),value:e}):void 0},r.prototype.remove=function(t){var e;return this.isCachable(t)?(e=this.normalizeStoreKey(t),delete this.store[e]):void 0},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),e?(n=this.timestamp()-t.timestamp,e>n):!0},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store[this.normalizeStoreKey(t)])?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=up.dom.config.fallbackTransition),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return this.options.provideTarget?this.plans[0].selector:(t=this.oldPlan())?t.selector:this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?t.steps:this.matchingPlanNotFound()},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.parseSteps=e(this.parseSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this),this.origin=n.origin,this.selector=up.dom.resolveSelector(t,n.origin),this.transition=n.transition||n.animation||"none",this.response=n.response,this.oldLayer=n.layer,this.steps=this.parseSteps()}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.parseSteps=function(){var e,n,r;return r=t.isString(this.transition)?this.transition.split(e):[this.transition],e=/\ *,\ */,n=this.selector.split(e),t.map(n,function(e,n){var o,i,u,s;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],s=r[n]||t.last(r),{selector:u,pseudoClass:i,transition:s}})},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;return null===this.scheduledValue||this.currentTimer||this.currentCallback?void 0:(this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this)))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;return t=this.readFieldValue(),this.isNewValue(t)?(this.scheduledValue=t,this.cancelTimer(),this.scheduleTimer()):void 0},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function t(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return t.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},t.prototype.onMousedown=function(t,e){return up.link.shouldProcessEvent(t,e)?(up.bus.consumeAction(t),this.followLink(e)):void 0},t.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},t.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onClick.apply(t,e)}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onMousedown.apply(t,e)}}(this))},t.prototype.followLink=function(t,e){return null==e&&(e={}),up.feedback.start(t,e,function(n){return function(){return n.followNow(t,e)}}(this))},t.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},t.prototype.matchesLink=function(t){return t.is(this.fullSelector())},t}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkElement=e(this.unmarkElement,this),this.markElement=e(this.markElement,this),this.whenElementFinished=e(this.whenElementFinished,this),this.finishOneElement=e(this.finishOneElement,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.className="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.className,this.finishEvent="up:"+t+":finish"}return n.prototype.claim=function(t,e){return this.finish(t).then(function(n){return function(){return n.start(t,e)}}(this))},n.prototype.start=function(t,e){var n;return n=e(t),this.markElement(t,n),n.then(function(e){return function(){return e.unmarkElement(t)}}(this)),n},n.prototype.finish=function(e){var n,r;return n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.finishOneElement=function(t){var e;return e=$(t),e.trigger(this.finishEvent),this.whenElementFinished(e)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markElement=function(t,e){return t.addClass(this.className),t.data(this.dataKey,e)},n.prototype.unmarkElement=function(t){return t.removeClass(this.className),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),!this.data||t.methodAllowsPayload(this.method)||t.isFormData(this.data)?void 0:this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,c,p,f,h;l=new XMLHttpRequest,p=t.copy(e.headers),c=e.data,f=e.method,h=e.url,u=up.proxy.wrapMethod(f,c),f=u[0],c=u[1],t.isFormData(c)?delete p["Content-Type"]:t.isPresent(c)?(c=t.requestDataAsQuery(c,{purpose:"form"}),p["Content-Type"]="application/x-www-form-urlencoded"):c=null,e.target&&(p[up.protocol.config.targetHeader]=e.target),e.failTarget&&(p[up.protocol.config.failTargetHeader]=e.failTarget),e.isCrossDomain()||p["X-Requested-With"]||(p["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(p[up.protocol.config.csrfHeader]=o),l.open(f,h);for(i in p)a=p[i],l.setRequestHeader(i,a);return s=function(){var t;return t=e.buildResponse(l),t.isSuccess()?n(t):r(t)},l.onload=s,l.onerror=s,l.ontimeout=s,e.timeout&&(l.timeout=e.timeout),l.send(c)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){return this.isSafe()||this.isCrossDomain()?void 0:up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;return(n=t.getResponseHeader(e.methodHeader))?l.normalizeMethod(n):void 0},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",
2
- methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canConsole,canCssTransition,canDOMParser,canFormData,canInputEvent,canPromise,canPushState,hash,isIE10OrWorse,isRecentJQuery,isSupported,navigate,polyfilledSessionStorage,popCookie,puts,sessionStorage,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,navigate=function(t,e){var n;return null==e&&(e={}),n=new up.Request(u.merge(e,{url:t})),n.navigate()},submitForm=function(t){return t.submit()},puts=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],console[e].apply(console,t)},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(t){var e,n,r,o,i,s,a,l,c;if(s=200,r="",u.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(t))l="undefined";else if(u.isNumber(t)||u.isFunction(t))l=t.toString();else if(u.isArray(t))l="["+u.map(t,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(t))l="$("+u.map(t,stringifyArg).join(", ")+")",r=")";else if(u.isElement(t)){for(e=$(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],o=0,i=a.length;i>o;o++)n=a[o],(c=e.attr(n))&&(l+=" "+n+'="'+c+'"');l+=">",r=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=r),l},sprintf=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,e].concat(slice.call(t)))},sprintfWithFormattedArgs=function(){var t,e,n,r;return e=arguments[0],r=arguments[1],t=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=t[n],r=e(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE10OrWorse=u.memoize(function(){return!window.atob}),canPushState=function(){return u.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},canCssTransition=function(){return"transition"in document.documentElement.style},canInputEvent=function(){return"oninput"in document.createElement("input")},canPromise=function(){return!!window.Promise},canFormData=function(){return!!window.FormData},canDOMParser=function(){return!!window.DOMParser},canConsole=function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd},isRecentJQuery=function(){var t,e,n,r;return r=$.fn.jquery,n=r.split("."),t=parseInt(n[0]),e=parseInt(n[1]),t>=2||1===t&&e>=9},popCookie=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,u.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(t){return t.preload||u.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},isSupported=function(){return!isIE10OrWorse()&&isRecentJQuery()&&canConsole()&&canDOMParser()&&canFormData()&&canCssTransition()&&canInputEvent()&&canPromise()},sessionStorage=u.memoize(function(){try{return window.sessionStorage}catch(t){return polyfilledSessionStorage()}}),polyfilledSessionStorage=function(){var t;return t={},{getItem:function(e){return t[e]},setItem:function(e,n){return t[e]=n}}},hash=function(t){return t||(t=location.hash),t||(t=""),"#"===t[0]&&(t=t.substr(1)),u.presence(t)},{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,navigate:navigate,submitForm:submitForm,canPushState:canPushState,whenConfirmed:whenConfirmed,isSupported:isSupported,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage,popCookie:popCookie,hash:hash,canPushState:canPushState}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,fixRenamedEvents,forgetUpDescription,haltEvent,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,renamedEvent,renamedEvents,resetBus,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,renamedEvents={},upListenerToJqueryListener=function(t){return function(e){var n;return n=e.$element||$(this),t.apply(n.get(0),[e,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(t,e){var n,r,o;return n=u.copy(t),fixRenamedEvents(n),o=n.pop(),r=void 0,e?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},fixRenamedEvents=function(t){var e;return e=t[0].split(/\s+/),e=u.map(e,function(t){var e;return(e=renamedEvents[t])?(up.log.warn(t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},live=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(t=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(e=$(document)).on.apply(e,t),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],t=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(e=$(document)).off.apply(e,t)},rememberUpDescription=function(t){var e;return e=upDescriptionNumber(t),liveUpDescriptions[e]=t},forgetUpDescription=function(t){var e;return e=upDescriptionNumber(t),delete liveUpDescriptions[e]},upDescriptionNumber=function(t){return u.last(t)._descriptionNumber},emit=function(t,e){var n,r;return null==e&&(e={}),r=$.Event(t,e),(n=e.$element)?delete e.$element:n=$(document),logEmission(t,e),n.trigger(r),r},logEmission=function(t,e){var n,r,o;return e.hasOwnProperty("message")?(n=e.message,delete e.message,n!==!1&&(u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n)?u.isPresent(e)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[t],[e])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[t])):void 0):u.isPresent(e)?up.puts("Emitted event %s (%o)",t,e):up.puts("Emitted event %s",t)},nobodyPrevents=function(){var t,e;return t=1<=arguments.length?slice.call(arguments,0):[],e=emit.apply(null,t),!e.isDefaultPrevented()},whenEmitted=function(){var t;return t=1<=arguments.length?slice.call(arguments,0):[],new Promise(function(e,n){return nobodyPrevents.apply(null,t)?e():n(new Error("Event "+t[0]+" was prevented"))})},onEscape=function(t){return live("keydown","body",function(e){return u.escapePressed(e)?t(e):void 0})},haltEvent=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},consumeAction=function(t){return haltEvent(t),"up:action:consumed"!==t.type?emit("up:action:consumed",{$element:$(t.target),message:!1}):void 0},snapshot=function(){var t,e,n;n=[];for(e in liveUpDescriptions)t=liveUpDescriptions[e],n.push(t.isDefault=!0);return n},resetBus=function(){var t,e,n,r,o,i;e=[];for(o in liveUpDescriptions)t=liveUpDescriptions[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(unbind.apply(null,t));return i},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},renamedEvent=function(t,e){return renamedEvents[t]=e},boot=function(){return up.browser.isSupported()?(emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",resetBus),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,haltEvent:haltEvent,consumeAction:consumeAction,renamedEvent:renamedEvent,boot:boot}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){var t=[].slice;up.log=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return m=up.util,r=up.browser,n="up.log.enabled",o=m.config({prefix:"[UP] ",enabled:"true"===r.sessionStorage().getItem(n),collapse:!1}),h=function(){return o.reset()},c=function(t){return""+o.prefix+t},i=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["debug",c(n)].concat(t.call(e))):void 0},f=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["log",c(n)].concat(t.call(e))):void 0},v=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["warn",c(n)].concat(t.call(e))):void 0},l=function(){var e,n,i,u;if(i=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),!o.enabled||!i)return n();u=o.collapse?"groupCollapsed":"group",r.puts.apply(r,[u,c(i)].concat(t.call(e)));try{return n()}finally{i&&r.puts("groupEnd")}},a=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["error",c(n)].concat(t.call(e))):void 0},p=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=o.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",r.puts("log",t)},up.on("up:framework:boot",p),up.on("up:framework:reset",h),d=function(t){return r.sessionStorage().setItem(n,t.toString()),o.enabled=t},s=function(){return d(!0)},u=function(){return d(!1)},{puts:f,debug:i,error:a,warn:v,group:l,config:o,enable:s,disable:u}}(jQuery),up.puts=up.log.puts}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,c,p;return p=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+p.escapeHtml(t)+"</span>"},c=p.config({$toast:null}),l=function(){return i(),c.reset()},s=function(e){return p.isArray(e)?(e[0]=p.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=p.escapeHtml(e),e},u=function(){return!!c.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),c.$toast=a},i=function(){return u()?(c.$toast.remove(),c.$toast=null):void 0},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S;return S=up.util,n="up-destructible",r="up-destructors",o={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},m=!0,p=[],g=[],c=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),d(p,o,r,n)},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),m&&(r.priority=h(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)},h=function(t){var e,n;for(n in o)if(e=o[n],t.indexOf(n)>=0)return e},s=function(t,e,n){return{selector:t,callback:n,isSystem:m,priority:e.priority||0,batch:e.batch,keep:e.keep}},d=function(t,e,n,r){var o,i,u;if(up.browser.isSupported()){for(i=s(e,n,r),o=0;(u=t[o])&&u.priority>=i.priority;)o+=1;return t.splice(o,0,i)}},u=function(t,e,n){var r,o;return up.puts(t.isSystem?void 0:"Compiling '%s' on %o",t.selector,n),t.keep&&(o=S.isString(t.keep)?t.keep:"",e.attr("up-keep",o)),r=t.callback.apply(n,[e,f(e)]),i(e,r)},y=function(t){return S.isFunction(t)?t:S.isArray(t)&&S.all(t,S.isFunction)?S.sequence.apply(S,t):void 0},i=function(t,e){var o;return(e=y(e))?(t.addClass(n),o=t.data(r)||function(){return w(t)},o=S.sequence(o,e),t.data(r,o)):void 0},w=function(t){return t.removeData(r),t.removeClass(n)},l=function(t,n){var r;return n=S.options(n),r=e(n.skip),up.log.group("Compiling fragment %o",t.get(0),function(){var n,o,i,s,a,l;for(a=[g,p],l=[],o=0,i=a.length;i>o;o++)s=a[o],l.push(function(){var o,i,a;for(a=[],o=0,i=s.length;i>o;o++)c=s[o],n=S.selectInSubtree(t,c.selector),r.length&&(n=n.filter(function(){var t;return t=e(this),S.all(r,function(e){return 0===t.closest(e).length})})),n.length?a.push(up.log.group(c.isSystem?void 0:"Compiling '%s' on %d element(s)",c.selector,n.length,function(){return c.batch?u(c,n,n.get()):n.each(function(){return u(c,e(this),this)})})):a.push(void 0);return a}());return l})},a=function(t){return b(t)()},b=function(t){var o,i;return o=S.selectInSubtree(t,"."+n),i=S.map(o,function(t){return e(t).data(r)}),i=S.compact(i),S.sequence.apply(S,i)},f=function(t){var n,r;return n=e(t),r=n.attr("up-data"),S.isString(r)&&""!==S.trim(r)?JSON.parse(r):{}},k=function(){var t;return t=function(t){return t.isSystem},p=S.select(p,t),g=S.select(g,t)},up.on("up:framework:booted",function(){return m=!1}),up.on("up:framework:reset",k),{compiler:c,macro:v,compile:l,clean:a,prepareClean:b,data:f}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,d=function(){return n.reset(),c=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(c=u,u=void 0),u=t},h=function(t){return i("replaceState",t)},p=function(t,e){return e=v.options(e,{force:!1}),t=s(t),!e.force&&o(t)||!up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t})?void 0:i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return up.browser.canPushState()&&n.enabled?(i=e(),window.history[t](i,"",o),a(r()),!0):!1},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),h(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.macro("a[up-back], [up-href][up-back]",function(t){return v.isPresent(c)?(v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",d),{config:n,push:p,replace:h,url:r,isUrl:o,previousUrl:function(){return c},normalizeUrl:s}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var anchoredRight,config,finishScrolling,firstHashTarget,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealHash,revealOrRestoreScroll,revealSelector,saveScroll,scroll,scrollAbruptlyNow,scrollTopKey,scrollTops,scrollWithAnimateNow,scrollableElementForViewport,scrollingTracker,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=new up.Cache({size:30,key:up.history.normalizeUrl}),scrollingTracker=new up.MotionTracker("scrolling"),reset=function(){return config.reset(),lastScrollTops.clear(),scrollingTracker.finish()},scroll=function(t,e,n){var r;return r=scrollableElementForViewport(t),n=u.options(n),n.duration=u.option(n.duration,config.duration),n.easing=u.option(n.easing,config.easing),finishScrolling(r).then(function(){return up.motion.isEnabled()&&n.duration>0?scrollWithAnimateNow(r,e,n):scrollAbruptlyNow(r,e)})},scrollableElementForViewport=function(t){var e;return e=$(t),e.get(0)===document?$("html, body"):e},scrollWithAnimateNow=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(scrollingTracker.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(scrollingTracker.eventName)}),o},scrollingTracker.claim(t,r)},scrollAbruptlyNow=function(t,e){return t.scrollTop(e),Promise.resolve()},finishScrolling=function(t){var e;return e=scrollableElementForViewport(t),scrollingTracker.finish(e)},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||up.fail("Fixed element %o must have a CSS attribute %s",n.get(0),e),parseFloat(r)+n.height()},e=function(){var t,e,o,i;for(o=$(config.fixedTop.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"top"));return i}(),t=function(){var t,e,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n;return n=$(t),up.puts("Revealing fragment %o",n.get(0)),e=u.options(e),u.rejectOnError(function(){var t,r,o,i,s,a,l,c,p,f,h,d,m;return t=e.viewport?$(e.viewport):viewportOf(n),h=u.option(e.snap,config.snap),m=t.is(document),d=m?u.clientSize().height:t.outerHeight(),c=t.scrollTop(),s=c,l=void 0,a=void 0,m?(a=measureObstruction(),l=0):(a={top:0,bottom:0},l=c),p=function(){return s+a.top},f=function(){return s+d-a.bottom-1},r=u.measure(n,{relative:t,includeMargin:!0}),o=r.top+l,i=o+Math.min(r.height,config.substance)-1,i>f()&&(s+=i-f()),(o<p()||e.top)&&(s=o-a.top),h>s&&r.top<.5*d&&(s=0),s!==c?scroll(t,s,e):Promise.resolve()})},revealHash=function(){var t,e;return(e=up.browser.hash())&&(t=firstHashTarget(e))?reveal(t):Promise.resolve()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t,e){var n,r;return null==e&&(e={}),n=$(t),r=viewportSelector().seekUp(n),0===r.length&&e.strict!==!1&&up.fail("Could not find viewport for %o",n),r},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().selectInSubtree(e)},viewports=function(){return viewportSelector().select()},scrollTopKey=function(t){var e;return e=$(t),e.is(document)?"document":u.selectorForElement(e)},scrollTops=function(){var t,e,n,r,o;for(o={},r=config.viewports,e=0,n=r.length;n>e;e++)t=r[e],$(t).each(function(){var t,e,n;return t=$(this),e=scrollTopKey(t),n=t.scrollTop(),o[e]=n});return o},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),r=e.add(n)):r=viewports(),o=lastScrollTops.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=u.map(r,function(t){var e,n;return e=scrollTopKey(t),n=o[e]||0,scroll(t,n,{duration:0})}),Promise.all(t)})},revealOrRestoreScroll=function(t,e){var n,r,o;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?(r={},u.isString(e.reveal)&&(o=revealSelector(e.reveal),n=up.first(o)||n,r.top=!0),reveal(n,r)):Promise.resolve()},revealSelector=function(t,e){return t=up.dom.resolveSelector(t,e),"#"===t[0]&&(t+=", a[name='"+t+"']"),t},firstHashTarget=function(t){return(t=up.browser.hash(t))?up.first("[id='"+t+"'], a[name='"+t+"']"):void 0},up.on("up:app:booted",revealHash),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,revealHash:revealHash,firstHashTarget:firstHashTarget,scroll:scroll,config:config,viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function($){var autofocus,bestMatchingSteps,bestPreflightSelector,config,destroy,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,first,firstInLayer,firstInPriority,fixScripts,hello,isRealElement,isSingletonElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,source,swapElements,swapSingletonElement,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:"none"}),reset=function(){return config.reset()},setSource=function(t,e){var n;return n=$(t),u.isPresent(e)&&(e=u.normalizeUrl(e)),n.attr("up-source",e)},source=function(t){var e;return e=$(t).closest("[up-source]"),u.presence(e.attr("up-source"))||up.browser.url()},resolveSelector=function(t,e){var n,r;return u.isString(t)?(r=t,u.contains(r,"&")&&(u.isPresent(e)?(n=u.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=u.selectorForElement(t),r},replace=function(t,e,n){var r,o,i,s,a,l,c,p,f,h,d;if(n=u.options(n),n.inspectResponse=s=function(){return up.browser.navigate(e,u.only(n,"method","data"))},!up.browser.canPushState()&&n.history!==!1)return n.preload||s(),u.unresolvablePromise();d=u.merge(n,{humanizedTarget:"target"}),i=u.merge(n,{humanizedTarget:"failure target",provideTarget:void 0}),u.renameKey(i,"failTransition","transition"),u.renameKey(i,"failLayer","layer");try{l=bestPreflightSelector(t,d),a=bestPreflightSelector(n.failTarget,i)}catch(o){return r=o,Promise.reject(r)}return h={url:e,method:n.method,data:n.data,target:l,failTarget:a,cache:n.cache,preload:n.preload,headers:n.headers,timeout:n.timeout},p=function(t){return processResponse(!0,l,t,d)},c=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=processResponse(!1,a,t,i),u.always(e,n))},f=up.request(h),n.preload||(f=f.then(p,c)),f},processResponse=function(t,e,n,r){var o,i,s,a,l;return a=n.request,l=n.url,i=l,o=a.hash,r.reveal===!0&&o&&(r.reveal=o,i+=o),s="GET"===n.method,t?s?(r.history===!1||u.isString(r.history)||(r.history=i),r.source===!1||u.isString(r.source)||(r.source=l)):(u.isString(r.history)||(r.history=!1),u.isString(r.source)||(r.source="keep")):s?(r.history!==!1&&(r.history=i),r.source!==!1&&(r.source=l)):(r.history=!1,r.source="keep"),shouldExtractTitle(r)&&n.title&&(r.title=n.title),extract(e,n.text,r)},shouldExtractTitle=function(t){return!(t.title===!1||u.isString(t.title)||t.history===!1&&t.title!==!0)},extract=function(t,e,n){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=e?e.length:void 0,function(){return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),n.saveScroll!==!1&&up.layout.saveScroll(),u.rejectOnError(function(){var r,o,i,s,a,l,c;for("function"==typeof n.provideTarget&&n.provideTarget(),s=parseResponseDoc(e),r=bestMatchingSteps(t,s,n),shouldExtractTitle(n)&&(a=s.title())&&(n.title=a),updateHistoryAndTitle(n),c=[],o=0,i=r.length;i>o;o++)l=r[o],up.log.group("Updating %s",l.selector,function(){var t;return fixScripts(l.$new.get(0)),t=swapElements(l.$old,l.$new,l.pseudoClass,l.transition,n),c.push(t),n=u.merge(n,{reveal:!1})});return Promise.all(c)})})},bestPreflightSelector=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},bestMatchingSteps=function(t,e,n){var r;return n=u.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},fixScripts=function(t){var e,n,r,o,i,u;if("NOSCRIPT"===t.tagName)return n=document.createElement("noscript"),n.textContent=t.innerHTML,t.parentNode.replaceChild(n,t);if("SCRIPT"===t.tagName)return t.parentNode.removeChild(t);for(i=t.children,u=[],r=0,o=i.length;o>r;r++)e=i[r],u.push(fixScripts(e));return u},parseResponseDoc=function(t){var e;return e=u.createElementFromHtml(t),{title:function(){var t;return null!=(t=e.querySelector("head title"))?t.textContent:void 0},first:function(t){var n;return(n=$.find(t,e)[0])?$(n):void 0}}},updateHistoryAndTitle=function(t){return t=u.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),u.isString(t.title)?document.title=t.title:void 0},swapElements=function(t,e,n,r,o){var i,s,a,l,c;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(t)})),up.motion.finish(t),n?(i=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(i):t.append(i),hello(i.children(),o),l=up.layout.revealOrRestoreScroll(i,o),l=l.then(function(){return up.animate(i,r,o)}),l=l.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(t,e,o))?(emitFragmentKept(a),l=Promise.resolve()):(o.keepPlans=transferKeepableElements(t,e,o),s=up.syntax.prepareClean(t),c=function(){return isSingletonElement(t)?(swapSingletonElement(t,e),r=!1):e.insertBefore(t),o.source!==!1&&setSource(e,o.source),autofocus(e),hello(e,o),up.morph(t,e,r,o)},l=destroy(t,{clean:s,beforeWipe:c,log:!1})),l},isSingletonElement=function(t){return t.is("body")},swapSingletonElement=function(t,e){return t.replaceWith(e)},transferKeepableElements=function(t,e,n){var r,o,i,s,a,l,c,p;if(s=[],n.keep)for(p=t.find("[up-keep]"),i=0,l=p.length;l>i;i++)a=p[i],r=$(a),(c=findKeepPlan(r,e,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),up.util.detachWith(r,o),c.$newElement.replaceWith(r),s.push(c));return s},findKeepPlan=function(t,e,n){var r,o,i,s,a;return n.keep&&(r=t,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?e.find(s):u.selectInSubtree(e,s),o=o.first(),o.length&&o.is("[up-keep]")&&(a={$element:r,$newElement:o,newData:up.syntax.data(o)},i=u.merge(a,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i))))?a:void 0},hello=function(t,e){var n,r,o,i,s,a;for(n=$(t),e=u.options(e,{keepPlans:[]}),o=[],a=e.keepPlans,r=0,i=a.length;i>r;r++)s=a[r],emitFragmentKept(s),o.push(s.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,e),n},emitFragmentInserted=function(t,e){var n;return n=$(t),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:e.origin})},emitFragmentKept=function(t){var e;return e=u.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},autofocus=function(t){var e,n;return n="[autofocus]:last",e=u.selectInSubtree(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},isRealElement=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},first=function(t,e){var n;return e=u.options(e,{layer:"auto"}),n=resolveSelector(t,e.origin),"auto"===e.layer?firstInPriority(n,e.origin):firstInLayer(n,e.layer)},firstInPriority=function(t,e){var n,r,o,i,s,a;for(i=["popup","modal","page"],n=void 0,u.isPresent(e)&&(a=layerOf(e),u.remove(i,a),i.unshift(a)),r=0,s=i.length;s>r&&(o=i[r],!(n=firstInLayer(t,o)));r++);return n},firstInLayer=function(t,e){var n,r,o,i,u,s;for(r=$(t),o=void 0,u=0,s=r.length;s>u;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,e)){o=n;break}return o},layerOf=function(t){var e;return e=$(t),up.popup.contains(e)?"popup":up.modal.contains(e)?"modal":"page"},matchesLayer=function(t,e){return layerOf(t)===e},destroy=function(t,e){var n,r,o,i,s,a;return n=$(t),e=u.options(e,{animation:!1}),shouldLogDestruction(n,e)&&(i=["Destroying fragment %o",n.get(0)],s=["Destroyed fragment %o",n.get(0)]),0===n.length?Promise.resolve():(up.emit("up:fragment:destroy",{$element:n,message:i}),n.addClass("up-destroying"),updateHistoryAndTitle(e),r=function(){var t;return t=up.motion.animateOptions(e),up.motion.animate(n,e.animation,t)},o=e.beforeWipe||Promise.resolve(),a=function(){return e.clean||(e.clean=function(){return up.syntax.clean(n)}),e.clean(),up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:s}),n.remove()},r().then(o).then(a))},shouldLogDestruction=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},reload=function(t,e){var n;return e=u.options(e,{cache:!1}),n=e.url||source(t),replace(t,n,e)},up.on("up:app:boot",function(){var t;return t=$(document.body),setSource(t,up.browser.url()),hello(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello,config:config}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.hello=up.dom.hello,up.renamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$;return x=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=x.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return c(),v=x.copy(u),g=x.copy(s),i.reset()},f=function(){return i.enabled},n=function(t,i,u){var s;return s=e(t),u=r(u),p(s,u).then(function(){return P(s,i,u)?x.isFunction(i)?i(s,u):x.isString(i)?n(s,a(i),u):x.isOptions(i)?o(s,i,u):up.fail("Animation must be a function, animation name or object of CSS properties, but it was %o",i):S(s,i)})},P=function(t,e,n){return f()&&!h(e)&&n.duration>0&&x.all(t,x.isBodyDescendant)},S=function(t,e){return x.isOptions(e)&&t.css(e),Promise.resolve()},o=function(t,e,n){var r;return r=function(){var r,o,i,u,s,a,l,c,p,f;return c=Object.keys(e),l={"transition-property":c.join(", "),"transition-duration":n.duration+"ms","transition-delay":n.delay+"ms","transition-timing-function":n.easing},u=t.css(Object.keys(l)),o=x.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;return e=t.originalEvent.propertyName,x.contains(c,e)?i():void 0},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=x.setTimer(n.duration+p,i),o.then(function(){var e;return t.off(m.finishEvent,s),t.off("transitionend",a),clearTimeout(r),f(),t.css({transition:"none"}),e=!("none"===u["transition-property"]||"all"===u["transition-property"]&&"0"===u["transition-duration"][0]),e?(x.forceRepaint(t),t.css(u)):void 0}),f=x.forceCompositing(t),t.css(l),t.css(e),o.promise()},m.start(t,r)},r=function(){var e,n,r,o,u;return n=1<=arguments.length?t.call(arguments,0):[],u=n.shift()||{},e=x.isJQuery(n[0])?n.shift():x.nullJQuery(),o=x.isObject(n[0])?n.shift():{},r={},r.easing=x.option(u.easing,x.presentAttr(e,"up-easing"),o.easing,i.easing),r.duration=Number(x.option(u.duration,x.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(x.option(u.delay,x.presentAttr(e,"up-delay"),o.delay,i.delay)),r.finishedMotion=u.finishedMotion,r},a=function(t){return v[t]||up.fail("Unknown animation %o",t)},$=function(t,e,n,r){var o,i,u,s,a;return n.copy===!1||t.is(".up-ghost")||e.is(".up-ghost")?r(t,e,n):(s=void 0,
3
- i=void 0,a=void 0,u=void 0,o=up.layout.viewportOf(t),x.temporaryCss(e,{display:"none"},function(){return s=y(t,o),a=o.scrollTop()}),t.hide(),up.layout.revealOrRestoreScroll(e,n).then(function(){var l,c,p,f;return i=y(e,o),u=o.scrollTop(),s.moveTop(u-a),p=x.temporaryCss(e,{opacity:"0"}),f=r(s.$ghost,i.$ghost,n),l=s.$ghost.add(i.$ghost),c=t.add(e),m.forwardFinishEvent(c,l,f),f.then(function(){return p(),s.$bounds.remove(),i.$bounds.remove()})}))},c=function(t){return m.finish(t)},d=function(t,n,o,i){var u,s,a,c,f;return i=x.options(i),i=x.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=P(u,c,i),up.log.group(f?"Morphing %o to %o with transition %o":void 0,a.get(0),s.get(0),o,function(){return p(u,i).then(function(){return f?c?$(a,s,i,c):up.fail("Unknown transition %o",o):T(a,s,i)})})},p=function(t,e){return e.finishedMotion?Promise.resolve():(e.finishedMotion=!0,c(t))},l=function(t){var e;if(h(t))return void 0;if(x.isFunction(t))return t;if(x.isArray(t))return h(t[0])&&h(t[1])?void 0:function(e,r,o){return Promise.all([n(e,t[0],o),n(r,t[1],o)])};if(x.isString(t)){if(t.indexOf("/")>=0)return l(t.split("/"));if(e=g[t])return l(e)}},T=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},y=function(t,n){var r,o,i,u,s,a,l,c,p;for(u=x.measure(t,{relative:!0,inner:!0}),i=t.clone(),i.find("script").remove(),i.css({position:"static"===t.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},i.appendTo(r),r.insertBefore(t),c(t.offset().top-i.offset().top),o=up.layout.fixedChildren(i),a=0,l=o.length;l>a;a++)s=o[a],x.fixedToAbsolute(s,n);return{$ghost:i,$bounds:r,moveTop:c}},w=function(t,e){return g[t]=e},b=function(t,e){return v[t]=e},E=function(){return u=x.copy(v),s=x.copy(g)},h=function(t){return!t||"none"===t||x.isOptions(t)&&x.isBlank(t)},b("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),b("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),A=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},b("move-to-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css(A(0,0)),n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css(A(0,-o)),n(t,A(0,0),e)}),b("move-to-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css(A(0,0)),n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css(A(0,o)),n(t,A(0,0),e)}),b("move-to-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css(A(0,0)),n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css(A(-o,0)),n(t,A(0,0),e)}),b("move-to-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css(A(0,0)),n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css(A(o,0)),n(t,A(0,0),e)}),b("roll-down",function(t,e){var r,o,i;return o=t.height(),i=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),r=n(t,{height:o+"px"},e),r.then(i),r}),w("move-left","move-to-left/move-from-right"),w("move-right","move-to-right/move-from-left"),w("move-up","move-to-top/move-from-bottom"),w("move-down","move-to-bottom/move-from-top"),w("cross-fade","fade-out/fade-in"),up.on("up:framework:booted",E),up.on("up:framework:reset",k),{morph:d,animate:n,animateOptions:r,finish:c,transition:w,animation:b,config:i,isEnabled:f,prependCopy:y,isNone:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$,F,C,D,O,R,N,U;return N=up.util,n=void 0,T=void 0,D=void 0,w=void 0,O=void 0,A=[],c=N.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return c.cacheSize},expiry:function(){return c.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),p=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(T),T=null},s=function(){return clearTimeout(D),D=null},$=function(){return n=null,u(),s(),w=0,c.reset(),i.clear(),O=!1,A=[]},$(),b=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=N.extractOptions(e),N.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||l(),!n&&(o=p(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=g(i),C(i,o),o["catch"](function(t){return P(i)})),r.preload||(y(),N.always(o,v)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},b.apply(null,e).then(r,n)})},h=function(){return 0===w},f=function(){return w>0},y=function(){var t;return w+=1,D?void 0:(t=function(){return f()?(up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0):void 0},D=N.setTimer(c.slowDelay,t))},v=function(){return w-=1,h()&&(s(),O)?(up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1):void 0},g=function(t){return w<c.maxRequests?m(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return m(t)},e=N.previewable(e),A.push(e),e.promise},m=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),N.always(n,F),N.always(n,k),n):(N.microtask(k),Promise.reject(new Error("Event up:proxy:load was prevented")))},x=function(t){var e,n;return n=t.request,n.url!==t.url?(e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)):void 0},F=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},k=function(){var t;return void("function"==typeof(t=A.shift())&&t())},o=i.alias,C=i.set,P=i.remove,l=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),a=function(t){var e,r;return r=parseInt(N.presentAttr(t,"up-delay"))||c.preloadDelay,t.is(n)?void 0:(n=t,u(),e=function(){return S(t),n=null},R(e,r))},R=function(t,e){return T=setTimeout(t,e)},S=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},d=function(t){return N.contains(c.safeMethods,t)},U=function(t,e,n){return N.contains(c.wrapMethods,t)&&(e=N.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.on("mouseover mousedown touchstart","a[up-preload], [up-href][up-preload]",function(t,e){return up.link.shouldProcessEvent(t,e)&&up.link.isSafe(e)?a(e):void 0}),up.on("up:framework:reset",$),{preload:S,ajax:r,request:b,get:p,alias:o,clear:l,remove:P,isIdle:h,isBusy:f,isSafeMethod:d,wrapMethod:U,config:c}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function($){var DEFAULT_FOLLOW_VARIANT,addFollowVariant,allowDefault,defaultFollow,defaultPreload,follow,followMethod,followVariantForLink,followVariants,isFollowable,isSafe,makeFollowable,shouldProcessEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r;return n=$(t),r=followVariantForLink(n),r.followLink(n,e)},defaultFollow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target")),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.confirm=u.option(e.confirm,n.attr("up-confirm")),e=u.merge(e,up.motion.animateOptions(e,n)),up.browser.whenConfirmed(e).then(function(){return up.replace(r,o,e)})},defaultPreload=function(t,e){return e=u.options(e),e.preload=!0,defaultFollow(t,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},allowDefault=function(t){},followVariants=[],addFollowVariant=function(t,e){var n;return n=new up.FollowVariant(t,e),followVariants.push(n),n.registerEvents(),n},isFollowable=function(t){return!!followVariantForLink(t,{"default":!1})},followVariantForLink=function(t,e){var n,r;return e=u.options(e),n=$(t),r=u.detect(followVariants,function(t){return t.matchesLink(n)}),e["default"]!==!1&&(r||(r=DEFAULT_FOLLOW_VARIANT)),r},makeFollowable=function(t){var e;return e=$(t),isFollowable(e)?void 0:e.attr("up-follow","")},shouldProcessEvent=function(t,e){var n,r,o;return n=$(t.target),r=n.closest("a, [up-href]").not(e),o=up.form.fieldSelector().seekUp(n),0===r.length&&0===o.length&&u.isUnmodifiedMouseEvent(t)},isSafe=function(t,e){var n,r;return n=$(t),r=followMethod(n,e),up.proxy.isSafeMethod(r)},DEFAULT_FOLLOW_VARIANT=addFollowVariant("[up-target], [up-follow]",{follow:function(t,e){return defaultFollow(t,e)},preload:function(t,e){return defaultPreload(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?makeFollowable(t):e["up-target"]=n,u.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(t){var e,n,r,o,i,s,a,l,c,p;if(e=t.find("a, [up-href]"),(c=t.attr("up-expand"))&&(e=e.filter(c)),i=e.get(0)){for(p=/^up-/,a={},a["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],s=n.name,s.match(p)&&(a[s]=n.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,isSafe:isSafe,isFollowable:isFollowable,shouldProcessEvent:shouldProcessEvent,followMethod:followMethod,addFollowVariant:addFollowVariant,followVariantForLink:followVariantForLink,allowDefault:allowDefault}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,fieldSelector,findSwitcherForTarget,observe,observeField,reset,resolveValidateTarget,submit,switchTarget,switchTargets,switcherValues,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},fieldSelector=function(){return u.multiSelector(config.fields)},submit=function(t,e){var n,r,o,i;return n=$(t).closest("form"),e=u.options(e),o=u.option(e.target,n.attr("up-target"),"body"),i=u.option(e.url,n.attr("action"),up.browser.url()),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.history=u.option(e.history,u.castedAttr(n,"up-history"),!0),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.method=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),e.headers=u.option(e.headers,{}),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.data=u.requestDataFromForm(n),e=u.merge(e,up.motion.animateOptions(e,n)),e.validate&&(e.headers||(e.headers={}),e.transition=!1,e.failTransition=!1,e.headers[up.protocol.config.validateHeader]=e.validate),up.feedback.start(n),up.browser.canPushState()||e.history===!1?(r=up.replace(o,i,e),u.always(r,function(){return up.feedback.stop(n)}),r):(n.get(0).submit(),u.unresolvablePromise())},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($element,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option(u.presentAttr($element,"up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),$fields=fieldSelector().selectInSubtree($element),destructors=u.map($fields,function(t){return observeField($(t),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},autosubmit=function(t,e){return observe(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return submit(n)})})},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),u.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!1),e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},switcherValues=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(e.target,n.attr("up-switch")),u.isPresent(o)||up.fail("No switch target given for %o",n.get(0)),r=switcherValues(n),$(o).each(function(){return switchTarget($(this),r)})},switchTarget=function(t,e){var n,r,o,i;return n=$(t),e||(e=switcherValues(findSwitcherForTarget(n))),(r=n.attr("up-hide-for"))?(r=r.split(" "),o=0===u.intersect(e,r).length):(i=(i=n.attr("up-show-for"))?i.split(" "):[":present",":checked"],o=u.intersect(e,i).length>0),n.toggle(o),n.addClass("up-switched")},findSwitcherForTarget=function(t){var e,n;return e=$("[up-switch]"),n=u.detect(e,function(e){var n;return n=$(e).attr("up-switch"),t.is(n)}),n?$(n):u.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),submit(e)}),up.on("change","[up-validate]",function(t,e){return validate(e)}),up.compiler("[up-switch]",function(t){return switchTargets(t)}),up.on("change","[up-switch]",function(t,e){return switchTargets(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return switchTarget(t)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.compiler("[up-autosubmit]",function(t){return autosubmit(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets,autosubmit:autosubmit,fieldSelector:fieldSelector}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function($){var align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,isOpen,preloadNow,reset,state,toggleAsap,u,unveilFrame;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$popup)&&t.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var t,e,n;switch(t={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(e=state.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=u.measure(state.$anchor),state.position){case"bottom-right":t.top=e.top+e.height,t.left=e.left+e.width-n.width;break;case"bottom-left":t.top=e.top+e.height,t.left=e.left;break;case"top-right":t.top=e.top-n.height,t.left=e.left+e.width-n.width;break;case"top-left":t.top=e.top-n.height,t.left=e.left;break;default:up.fail("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(t)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t){var e;return e=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),state.$popup=e},unveilFrame=function(){return state.$popup.show()},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(t,e){return chain.asap(closeNow,function(){return attachNow(t,e)})},attachNow=function(t,e){var n,r,o,i,s,a,l;return n=$(t),n.length||up.fail("Cannot attach popup to non-existing element %o",t),e=u.options(e),l=u.option(u.pluckKey(e,"url"),n.attr("up-href"),n.attr("href")),i=u.option(u.pluckKey(e,"html")),l||i||up.fail("up.popup.attach() requires either an { url } or { html } option"),a=u.option(u.pluckKey(e,"target"),n.attr("up-popup"),"body"),s=u.option(e.position,n.attr("up-position"),config.position),e.animation=u.option(e.animation,n.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(n,"up-sticky"),config.sticky),e.history=up.browser.canPushState()?u.option(e.history,u.castedAttr(n,"up-history"),config.history):!1,e.confirm=u.option(e.confirm,n.attr("up-confirm")),e.method=up.link.followMethod(n,e),e.layer="popup",e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.provideTarget=function(){return createHiddenFrame(a)},r=up.motion.animateOptions(e,n,{duration:config.openDuration,easing:config.openEasing}),o=u.merge(e,{animation:!1}),e.preload&&l?up.replace(a,l,e):up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:popup:open",{url:l,message:"Opening popup"}).then(function(){var t;return state.phase="opening",state.$anchor=n,state.position=s,e.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),state.sticky=e.sticky,t=i?up.extract(a,i,o):up.replace(a,l,o),t=t.then(function(){return align(),unveilFrame(),up.animate(state.$popup,e.animation,r)}),t=t.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e;return isOpen()?(t=u.options(t,{animation:config.closeAnimation,history:state.coveredUrl,title:state.coveredTitle}),e=up.motion.animateOptions(t,{duration:config.closeDuration,easing:config.closeEasing}),u.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,t).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},preloadNow=function(t,e){return e=u.options(e),e.preload=!0,attachNow(t,e)},toggleAsap=function(t,e){return t.is(".up-current")?closeAsap():attachAsap(t,e)},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return toggleAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click up:action:consumed",function(t){var e;return e=$(t.target),e.closest(".up-popup, [up-popup]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click",".up-popup [up-close]",function(t,e){return closeAsap(),up.bus.consumeAction(t)}),up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,flavors,followAsap,isOpen,markAsAnimating,openAsap,openNow,preloadNow,reset,shiftElements,state,templateHtml,u,unshiftElements,unveilFrame,visitAsap;return u=up.util,config=u.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$modal)&&t.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var t;return t=flavorDefault("template"),u.evalOption(t,{closeLabel:flavorDefault("closeLabel")})},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t,e){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),u.isPresent(state.position)&&o.attr("up-position",state.position),r=o.find(".up-modal-dialog"),u.isPresent(e.width)&&r.css("width",e.width),u.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),u.isPresent(e.height)&&r.css("height",e.height),state.closable||o.find(".up-modal-close").remove(),n=o.find(".up-modal-content"),u.$createPlaceholder(t,n),o.hide(),o.appendTo(document.body),state.$modal=o},unveilFrame=function(){return state.$modal.show()},shiftElements=function(){var t,e,n,r,o;return u.documentHasVerticalScrollbar()?(t=$("body"),r=u.scrollbarWidth(),e=parseFloat(t.css("padding-right")),n=r+e,o=u.temporaryCss(t,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var t,e,n,o;return t=$(this),e=parseFloat(t.css("right")),n=r+e,o=u.temporaryCss(t,{right:n}),state.unshifters.push(o)})):void 0},unshiftElements=function(){var t,e;for(t=[];e=state.unshifters.pop();)t.push(e());return t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(t,e){return e=u.options(e),e.$link=$(t),openAsap(e)},preloadNow=function(t,e){return e=u.options(e),e.$link=t,e.preload=!0,openNow(e)},visitAsap=function(t,e){return e=u.options(e),e.url=t,openAsap(e)},extractAsap=function(t,e,n){return n=u.options(n),n.html=e,n.history=u.option(n.history,!1),n.target=t,openAsap(n)},openAsap=function(t){return chain.asap(closeNow,function(){return openNow(t)})},openNow=function(t){var e,n,r,o,i;return t=u.options(t),e=u.option(u.pluckKey(t,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(t,"url"),e.attr("up-href"),e.attr("href")),r=u.option(u.pluckKey(t,"html")),o=u.option(u.pluckKey(t,"target"),e.attr("up-modal"),"body"),t.flavor=u.option(t.flavor,e.attr("up-flavor"),config.flavor),t.position=u.option(t.position,e.attr("up-position"),flavorDefault("position",t.flavor)),t.position=u.evalOption(t.position,{$link:e}),t.width=u.option(t.width,e.attr("up-width"),flavorDefault("width",t.flavor)),t.maxWidth=u.option(t.maxWidth,e.attr("up-max-width"),flavorDefault("maxWidth",t.flavor)),t.height=u.option(t.height,e.attr("up-height"),flavorDefault("height")),t.animation=u.option(t.animation,e.attr("up-animation"),flavorDefault("openAnimation",t.flavor)),t.animation=u.evalOption(t.animation,{position:t.position}),t.backdropAnimation=u.option(t.backdropAnimation,e.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",t.flavor)),t.backdropAnimation=u.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=u.option(t.sticky,u.castedAttr(e,"up-sticky"),flavorDefault("sticky",t.flavor)),t.closable=u.option(t.closable,u.castedAttr(e,"up-closable"),flavorDefault("closable",t.flavor)),t.confirm=u.option(t.confirm,e.attr("up-confirm")),t.method=up.link.followMethod(e,t),t.layer="modal",t.failTarget=u.option(t.failTarget,e.attr("up-fail-target")),t.failLayer=u.option(t.failLayer,e.attr("up-fail-layer"),"auto"),n=up.motion.animateOptions(t,e,{duration:flavorDefault("openDuration",t.flavor),easing:flavorDefault("openEasing",t.flavor)}),t.history=u.option(t.history,u.castedAttr(e,"up-history"),flavorDefault("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return createHiddenFrame(o,t)},t.preload?up.replace(o,i,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var e,s;return state.phase="opening",state.flavor=t.flavor,state.sticky=t.sticky,state.closable=t.closable,state.position=t.position,t.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),e=u.merge(t,{animation:!1}),s=r?up.extract(o,r,e):up.replace(o,i,e),s=s.then(function(){return shiftElements(),unveilFrame(),animate(t.animation,t.backdropAnimation,n)}),s=s.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e,n,r,o;return t=u.options(t),isOpen()?(o=u.option(t.animation,flavorDefault("closeAnimation")),o=u.evalOption(o,{position:state.position}),n=u.option(t.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),e=up.motion.animateOptions(t,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(t,"animation","duration","easing","delay"),{history:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var t;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,t=animate(o,n,e),t=t.then(function(){return up.destroy(state.$modal,r)}),t=t.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,state.closable=null,state.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},markAsAnimating=function(t){return null==t&&(t=!0),state.$modal.toggleClass("up-modal-animating",t)},animate=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(markAsAnimating(),r=Promise.all([up.animate(state.$modal.find(".up-modal-viewport"),t,n),up.animate(state.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-modal").length>0},flavor=function(t,e){return null==e&&(e={}),up.log.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),u.assign(flavorOverrides(t),e)},flavorOverrides=function(t){return flavors[t]||(flavors[t]={})},flavorDefault=function(t,e){var n;return null==e&&(e=state.flavor),e&&(n=flavorOverrides(e)[t]),u.isMissing(n)&&(n=config[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return followAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click",".up-modal",function(t){var e;if(state.closable)return e=$(t.target),e.closest(".up-modal-dialog").length||e.closest("[up-modal]").length?void 0:(up.bus.consumeAction(t),closeAsap())}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin)&&!up.popup.contains(e))return autoclose()}),up.bus.onEscape(function(){return state.closable?closeAsap():void 0}),up.on("click",".up-modal [up-close]",function(t,e){return closeAsap(),up.bus.consumeAction(t)}),up.macro("a[up-drawer], [up-href][up-drawer]",function(t){var e;return e=t.attr("up-drawer"),t.attr({"up-modal":e,"up-flavor":"drawer"})}),flavors.drawer={openAnimation:function(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(t){return u.isPresent(t.$link)?u.horizontalScreenHalf(t.$link):"left"}},up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visitAsap,follow:followAsap,extract:extractAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,flavors:flavors,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,i,u,s,a,l,c,p,f;return f=up.util,s=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),p=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,c=function(){var t;return null!=(t=p.$tooltip)&&t.remove(),p.reset(),o.reset(),s.reset()},e=function(){var t,e,n;switch(t={},n=f.measure(p.$tooltip),f.isFixed(p.$anchor)?(e=p.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=f.measure(p.$anchor),p.position){case"top":t.top=e.top-n.height,t.left=e.left+.5*(e.width-n.width);break;case"left":t.top=e.top+.5*(e.height-n.height),t.left=e.left-n.width;break;case"right":t.top=e.top+.5*(e.height-n.height),t.left=e.left+e.width;break;case"bottom":t.top=e.top+e.height,t.left=e.left+.5*(e.width-n.width);break;default:up.fail("Unknown position option '%s'",p.position)}return p.$tooltip.attr("up-position",p.position),p.$tooltip.css(t)},a=function(t){var e;return e=f.$createElementFromSelector(".up-tooltip"),f.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),p.$tooltip=e},n=function(t,e){
4
- return null==e&&(e={}),o.asap(u,function(){return r(t,e)})},r=function(n,r){var o,i,u,l,c,h;return o=t(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),h=f.option(r.text,o.attr("up-tooltip")),c=f.option(r.position,o.attr("up-position"),s.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),s.openAnimation),i=up.motion.animateOptions(r,o,{duration:s.openDuration,easing:s.openEasing}),p.phase="opening",p.$anchor=o,a({text:h,html:l}),p.position=c,e(),up.animate(p.$tooltip,u,i).then(function(){return p.phase="opened"})},i=function(t){return o.asap(function(){return u(t)})},u=function(t){var e;return l()?(t=f.options(t,{animation:s.closeAnimation}),e=up.motion.animateOptions(t,{duration:s.closeDuration,easing:s.closeEasing}),f.assign(t,e),p.phase="closing",up.destroy(p.$tooltip,t).then(function(){return p.phase="closed",p.$tooltip=null,p.$anchor=null})):Promise.resolve()},l=function(){return"opening"===p.phase||"opened"===p.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseenter",function(){return n(t)}),t.on("mouseleave",function(){return i()})}),up.on("click up:action:consumed",function(t){return i()}),up.on("up:framework:reset",c),up.bus.onEscape(function(){return i()}),{config:s,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var t=[].slice;up.feedback=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d;return h=up.util,o=h.config({currentClasses:["up-current"]}),l=function(){return o.reset()},i=function(){var t;return t=o.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},n="up-active",r="a, [up-href]",a=function(t){return h.isPresent(t)?h.normalizeUrl(t,{stripTrailingSlash:!0}):void 0},c=function(t){var e,n,r,o,i,u,s,l,c,p;for(l=[],u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(e=u[n],c=h.presentAttr(t,e))for(p="up-alias"===e?c.split(" "):[c],r=0,i=p.length;i>r;r++)s=p[r],"#"!==s&&(s=a(s),l.push(s));return l},d=function(t){var e,n,r,o;return t=h.map(t,a),t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},s=function(){var t,n;return t=d([up.browser.url(),up.modal.url(),up.modal.coveredUrl(),up.popup.url(),up.popup.coveredUrl()]),n=i(),h.each(e(r),function(r){var o,i;return o=e(r),i=c(o),up.link.isSafe(o)&&t.matchesAny(i)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},u=function(t){var n;return n=e(t),n.is(r)&&(n=h.presence(n.parent(r))||n),n},p=function(){var e,r,o,i,s,a;return o=1<=arguments.length?t.call(arguments,0):[],i=o.shift(),r=o.pop(),s=h.options(o[0]),e=u(i),s.preload||e.addClass(n),r?(a=r(),h.isPromise(a)?h.always(a,function(){return f(e)}):up.warn("Expected block to return a promise, but got %o",a),a):void 0},f=function(t){var e;return e=u(t),e.removeClass(n)},up.on("up:fragment:inserted",function(){return s()}),up.on("up:fragment:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?s():void 0}),up.on("up:framework:reset",l),{config:o,start:p,stop:f}}(jQuery),up.renamedModule("navigation","feedback")}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;return e()&&up.link.isFollowable(t)?(i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)):void 0})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
1
+ (function(){window.up={version:"0.51.1",renamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.log.warn("up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,F,$,C,D,O,R,N,U,M,L,H,K,q,j,_,V,I,z,W,Q,B,J,X,G,Z,Y,tt,et,nt,rt,ot,it,ut,st,at,lt,ct,pt,ft,ht,dt,mt,vt,gt,yt,bt,wt,kt,St,Tt,Et,At,xt,Pt,Ft,$t,Ct,Dt,Ot,Rt,Nt,Ut,Mt,Lt,Ht,Kt,qt,jt,_t,Vt,It,zt,Wt,Qt,Bt,Jt,Xt,Gt,Zt,Yt,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe;return Et=r.noop,vt=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},ut=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},xt=function(t,e){var n,r,o;return r=Ut(t),n=r.protocol+"//"+r.hostname,ut(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.hash:void 0)===!0&&(n+=r.hash),(null!=e?e.search:void 0)!==!1&&(n+=r.search),n},I=function(t){var e;return e=Ut(location.href),t=Ut(t),e.protocol!==t.protocol||e.host!==t.host},Ut=function(t){var e;return t=ae(t),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),_(e.hostname)&&(e.href=e.href),e)},At=function(t){return t?t.toUpperCase():"GET"},yt=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,c,p,f,h,d,m,v,g;for(v=t.split(/[ >]/),o=null,f=c=0,d=v.length;d>c;f=++c){for(s=v[f],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,h=0,m=u.length;m>h;h++)switch(a=u[h],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===f&&(o=e),n=e}return o},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},Yt=function(t){var e,n,o,i,u,s,a,l,c;if(e=r(t),l=void 0,c=Ht(e.attr("up-id")))l="[up-id='"+c+"']";else if(i=Ht(e.attr("id")))l="#"+i;else if(a=Ht(e.attr("name")))l="[name='"+a+"']";else if(n=Ht(Tt(e)))for(l="",o=0,s=n.length;s>o;o++)u=n[o],l+="."+u;else l=e.prop("tagName").toLowerCase();return l},Tt=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Xt(n,function(t){return ot(t)&&!t.match(/^up-/)})},S=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},d=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;o>n;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},h=Object.assign||d,se=r.trim,P=function(t,e){var n,r,o,i,u;for(u=[],r=n=0,i=t.length;i>n;r=++n)o=t[r],u.push(e(o,r));return u},ht=P,ie=function(t,e){var n,r,o,i;for(i=[],r=n=0,o=t-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)i.push(e(r));return i},tt=function(t){return null===t},lt=function(t){return void 0===t},z=function(t){return!lt(t)},Y=function(t){return lt(t)||tt(t)},G=function(t){return!Y(t)},_=function(t){return Y(t)||nt(t)&&0===Object.keys(t).length||0===t.length},Ht=function(t,e){return null==e&&(e=ot),e(t)?t:void 0},ot=function(t){return!_(t)},X=function(t){return"function"==typeof t},st=function(t){return"string"==typeof t||t instanceof String},et=function(t){return"number"==typeof t||t instanceof Number},rt=function(t){return!("object"!=typeof t||tt(t)||Z(t)||it(t)||J(t)||j(t))},nt=function(t){var e;return e=typeof t,"object"===e&&!tt(t)||"function"===e},Q=function(t){return!(!t||1!==t.nodeType)},Z=function(t){return t instanceof jQuery},it=function(t){return nt(t)&&X(t.then)},j=Array.isArray,J=function(t){return t instanceof FormData},ue=function(t){return Array.prototype.slice.call(t)},w=function(t){return j(t)?t=t.slice():nt(t)&&!X(t)?t=h({},t):up.fail("Cannot copy %o",t),t},ae=function(t){return Z(t)?t.get(0):t},gt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],h.apply(null,[{}].concat(t.call(e)))},Nt=function(t,e){var n,r,o,i;if(o=t?w(t):{},e)for(r in e)n=e[r],i=o[r],G(i)?nt(n)&&nt(i)&&(o[r]=Nt(i,n)):o[r]=n;return o},Rt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],A(e,G)},A=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=n;break}return i},p=function(t,e){var n,r,o,i;for(i=!1,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=!0;break}return i},l=function(t,e){var n,r,o,i;for(i=!0,r=0,o=t.length;o>r;r++)if(n=t[r],!e(n)){i=!1;break}return i},g=function(t){return Xt(t,G)},le=function(t){var e;return e={},Xt(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Xt=function(t,e){var n;return n=[],P(t,function(t){return e(t)?n.push(t):void 0}),n},_t=function(t,e){return Xt(t,function(t){return!e(t)})},q=function(t,e){return Xt(t,function(t){return b(e,t)})},Kt=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;o>t;t++)n=r[t],i.push(e.attr(n));return i}(),A(o,ot)},ne=function(t,e){return setTimeout(e,t)},St=function(t){return setTimeout(t,0)},bt=function(t){return Promise.resolve().then(t)},ft=function(t){return t[t.length-1]},v=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Jt=vt(function(){var t,e,n;return t=r("<div>"),t.attr("up-viewport",""),t.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),e=t.get(0),n=e.offsetWidth-e.clientWidth,t.remove(),n}),x=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=t.css("overflow-y"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},$t=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},oe=function(t,e,n){var o,i,u;return o=r(t),u=o.css(Object.keys(e)),o.css(e),i=function(){return o.css(u)},n?(n(),i()):$t(i)},M=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),_(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},L=function(t){return t=ae(t),t.offsetHeight},T=function(t,e,n){},dt=function(t){var e,n;return e=r(t),n=e.css(["margin-top","margin-right","margin-bottom","margin-left"]),{top:parseFloat(n["margin-top"]),right:parseFloat(n["margin-right"]),bottom:parseFloat(n["margin-bottom"]),left:parseFloat(n["margin-left"])}},mt=function(t,e){var n,o,i,u,s,a;return e=Nt(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=dt(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},k=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],n.specified?u.push(e.attr(n.name,n.value)):u.push(void 0);return u},Zt=function(t,e){return t.find(e).addBack(e)},Gt=function(t,e){var n,r;return r=Zt(t,e),n=t.parents(e),r.add(n)},$=function(t){return 27===t.keyCode},b=function(t,e){return t.indexOf(e)>=0},m=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Ct=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;r>n;n++)u=i[n],o.hasOwnProperty(u)&&(e[u]=o[u]);return e},D=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=w(o),n=0,r=i.length;r>n;n++)u=i[n],delete e[u];return e},ct=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},pt=function(t){var e;return e=lt(t.button)||0===t.button,e&&ct(t)},ce=function(){return new Promise(Et)},Pt=function(){return r()},ee=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],Y(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},It=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},wt=function(t){var e,n,o,i,u,s,a;for(u={},a=[],n=[],o=0,i=t.length;i>o;o++)s=t[o],st(s)?a.push(s):n.push(s);return u.parsed=n,a.length&&(e=a.join(", "),u.parsed.push(e)),u.select=function(){return u.find(void 0)},u.find=function(t){var e,n,o,i,s,a;for(n=Pt(),s=u.parsed,o=0,i=s.length;i>o;o++)a=s[o],e=t?t.find(a):r(a),n=n.add(e);return n},u.selectInSubtree=function(t){var e;return e=u.find(t),u.doesMatch(t)&&(e=e.add(t)),e},u.doesMatch=function(t){var e;return e=r(t),p(u.parsed,function(t){return e.is(t)})},u.seekUp=function(t){var e,n,o;for(o=r(t),e=o,n=void 0;e.length;){if(u.doesMatch(e)){n=e;break}e=e.parent()}return n||Pt()},u},C=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],X(n)?n.apply(null,e):n},y=function(t){var e;return e=Ot(t),Object.preventExtensions(e),e},Ot=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,X(n)&&(n=n()),h(e,n)},e.reset(),e},pe=function(t){var e,n;return t=ae(t),e=t.parentNode,n=ue(t.childNodes),P(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},Ft=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},B=function(t){var e,n;for(e=r(t);;){if(n=e.css("position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},N=function(t,e){var n,o,i,u;return n=r(t),o=Ft(n),i=n.position(),u=o.offset(),n.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},Wt=function(t){var e,n,r,o,i,u,s;if(j(t),J(t))return up.fail("Cannot convert FormData into an array");for(u=Qt(t),e=[],s=u.split("&"),n=0,r=s.length;r>n;n++)i=s[n],ot(i)&&(o=i.split("="),e.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return e},Qt=function(t,e){var n;if(e=Nt(e,{purpose:"url"}),st(t),J(t))return up.fail("Cannot convert FormData into a query string");if(ot(t)){switch(n=r.param(t),e.purpose){case"url":n=n.replace(/\+/g,"%20");break;case"form":n=n.replace(/\%20/g,"+");break;default:up.fail("Unknown purpose %o",e.purpose)}return n}return""},u=function(t){var e,n;return n="input[type=submit], button[type=submit], button:not([type])",e=r(document.activeElement),e.is(n)&&t.has(e)?e:t.find(n).first()},Bt=function(t){var e,n,o,i,s,a;return n=r(t),a=n.find("input[type=file]").length,e=u(n),o=e.attr("name"),i=e.val(),s=a?new FormData(n.get(0)):n.serializeArray(),ot(o)&&f(s,o,i),s},f=function(t,e,n,r){var o;return t||(t=[]),j(t)?t.push({name:e,value:n}):J(t)?t.append(e,n):nt(t)?t[e]=n:st(t)&&(o=Qt([{name:e,value:n}],r),t=[t,o].join("&")),t},R=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],j(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),fe().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},F=function(t){return t.replace(/[&<>"]/g,function(t){return a[t]})},Lt=function(t,e){var n;return n=t[e],delete t[e],n},zt=function(t,e,n){return t[n]=Lt(t,e)},Mt=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},O=function(t){var e;return e=ft(t),rt(e)?t.pop():{}},Dt=function(t){var e;return e=r(t).css("opacity"),G(e)?parseFloat(e):void 0},fe=vt(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),K=function(t){return t},W=function(t){return t=ae(t),!jQuery.contains(document.documentElement,t)},qt=function(e){var n,r;return n=kt(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},s=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=ft(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;return!this.currentTask&&(this.currentTask=this.queue.shift())?(t=this.currentTask(),c(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))):void 0},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=ht(e,qt),this.poke(),this.promise()},e}(),re=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},te=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return ht(e,function(t){return t()})}},jt=function(t){var e,n;return n=void 0,e=new Promise(function(e,r){return n=ne(t,e)}),e.cancel=function(){return clearTimeout(n)},e},H=function(t){var e,n,r,o;return e=mt(t),r=v(),n=e.left+.5*e.width,o=.5*r.width,o>n?"left":"right"},E=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},U=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;r>n;n++)o=t[n],j(o)?e=e.concat(o):e.push(o);return e},at=function(t){return!!t},c=function(t,e){return t.then(e,e)},kt=function(){var t,e;return e=void 0,_t=void 0,t=new Promise(function(t,n){return e=t,_t=n}),t.resolve=e,t.reject=_t,t.promise=function(){return t},t},Vt=function(t){var e,n;try{return t()}catch(n){return e=n,Promise.reject(e)}},V=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Wt,requestDataAsQuery:Qt,appendRequestData:f,requestDataFromForm:Bt,offsetParent:Ft,fixedToAbsolute:N,isFixed:B,presentAttr:Kt,parseUrl:Ut,normalizeUrl:xt,normalizeMethod:At,methodAllowsPayload:yt,createElementFromHtml:S,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:Yt,assign:h,assignPolyfill:d,copy:w,merge:gt,options:Nt,option:Rt,fail:R,each:P,map:ht,times:ie,any:p,all:l,detect:A,select:Xt,reject:_t,intersect:q,compact:g,uniq:le,last:ft,isNull:tt,isDefined:z,isUndefined:lt,isGiven:G,isMissing:Y,isPresent:ot,isBlank:_,presence:Ht,isObject:nt,isFunction:X,isString:st,isNumber:et,isElement:Q,isJQuery:Z,isPromise:it,isOptions:rt,isArray:j,isFormData:J,isUnmodifiedKeyEvent:ct,isUnmodifiedMouseEvent:pt,nullJQuery:Pt,unJQuery:ae,setTimer:ne,nextFrame:St,measure:mt,temporaryCss:oe,cssAnimate:T,forceCompositing:M,forceRepaint:L,escapePressed:$,copyAttributes:k,selectInSubtree:Zt,selectInDynasty:Gt,contains:b,toArray:ue,castedAttr:m,clientSize:v,only:Ct,except:D,trim:se,unresolvablePromise:ce,setMissingAttrs:ee,remove:It,memoize:vt,scrollbarWidth:Jt,documentHasVerticalScrollbar:x,config:y,openConfig:Ot,unwrapElement:pe,multiSelector:wt,error:R,pluckData:Mt,pluckKey:Lt,renameKey:zt,extractOptions:O,isDetached:W,noop:Et,opacity:Dt,whenReady:fe,identity:K,escapeHtml:F,DivertibleChain:s,submittedValue:re,sequence:te,promiseTimer:jt,previewable:qt,evalOption:C,horizontalScreenHalf:H,detachWith:E,flatten:U,isTruthy:at,newDeferred:kt,always:c,rejectOnError:Vt,isBodyDescendant:V,isCrossDomain:I,microtask:bt}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store={}}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):this.key.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return this.config.cachable?this.config.cachable(t):!0},r.prototype.clear=function(){return this.store={}},r.prototype.log=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix?(t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)):void 0},r.prototype.keys=function(){return Object.keys(this.store)},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;return o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=null,r=null,t.each(o,function(t){return function(e){var o,i;return o=t.store[e],i=o.timestamp,!r||r>i?(n=e,r=i):void 0}}(this)),n)?delete this.store[n]:void 0},r.prototype.alias=function(e,n){var r;return r=this.get(e,{silent:!0}),t.isDefined(r)?this.set(n,r):void 0},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n;return this.isEnabled()&&this.isCachable(t)?(this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),this.store[n]={timestamp:this.timestamp(),value:e}):void 0},r.prototype.remove=function(t){var e;return this.isCachable(t)?(e=this.normalizeStoreKey(t),delete this.store[e]):void 0},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),e?(n=this.timestamp()-t.timestamp,e>n):!0},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store[this.normalizeStoreKey(t)])?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=up.dom.config.fallbackTransition),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return this.options.provideTarget?this.plans[0].selector:(t=this.oldPlan())?t.selector:this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?t.steps:this.matchingPlanNotFound()},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.parseSteps=e(this.parseSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this),this.origin=n.origin,this.selector=up.dom.resolveSelector(t,n.origin),this.transition=n.transition||n.animation||"none",this.response=n.response,this.oldLayer=n.layer,this.steps=this.parseSteps()}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.parseSteps=function(){var e,n,r;return r=t.isString(this.transition)?this.transition.split(e):[this.transition],e=/\ *,\ */,n=this.selector.split(e),t.map(n,function(e,n){var o,i,u,s;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],s=r[n]||t.last(r),{selector:u,pseudoClass:i,transition:s}})},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;return null===this.scheduledValue||this.currentTimer||this.currentCallback?void 0:(this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this)))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;return t=this.readFieldValue(),this.isNewValue(t)?(this.scheduledValue=t,this.cancelTimer(),this.scheduleTimer()):void 0},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function t(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return t.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},t.prototype.onMousedown=function(t,e){return up.link.shouldProcessEvent(t,e)?(up.bus.consumeAction(t),this.followLink(e)):void 0},t.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},t.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onClick.apply(t,e)}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onMousedown.apply(t,e)}}(this))},t.prototype.followLink=function(t,e){return null==e&&(e={}),up.feedback.start(t,e,function(n){return function(){return n.followNow(t,e)}}(this))},t.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},t.prototype.matchesLink=function(t){return t.is(this.fullSelector())},t}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkElement=e(this.unmarkElement,this),this.markElement=e(this.markElement,this),this.whenElementFinished=e(this.whenElementFinished,this),this.finishOneElement=e(this.finishOneElement,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.className="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.className,this.finishEvent="up:"+t+":finish"}return n.prototype.claim=function(t,e){return this.finish(t).then(function(n){return function(){return n.start(t,e)}}(this))},n.prototype.start=function(t,e){var n;return n=e(t),this.markElement(t,n),n.then(function(e){return function(){return e.unmarkElement(t)}}(this)),n},n.prototype.finish=function(e){var n,r;return n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.finishOneElement=function(t){var e;return e=$(t),e.trigger(this.finishEvent),this.whenElementFinished(e)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markElement=function(t,e){return t.addClass(this.className),t.data(this.dataKey,e)},n.prototype.unmarkElement=function(t){return t.removeClass(this.className),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),!this.data||t.methodAllowsPayload(this.method)||t.isFormData(this.data)?void 0:this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,c,p,f,h;l=new XMLHttpRequest,p=t.copy(e.headers),c=e.data,f=e.method,h=e.url,u=up.proxy.wrapMethod(f,c),f=u[0],c=u[1],t.isFormData(c)?delete p["Content-Type"]:t.isPresent(c)?(c=t.requestDataAsQuery(c,{purpose:"form"}),p["Content-Type"]="application/x-www-form-urlencoded"):c=null,e.target&&(p[up.protocol.config.targetHeader]=e.target),e.failTarget&&(p[up.protocol.config.failTargetHeader]=e.failTarget),e.isCrossDomain()||p["X-Requested-With"]||(p["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(p[up.protocol.config.csrfHeader]=o),l.open(f,h);for(i in p)a=p[i],l.setRequestHeader(i,a);return s=function(){var t;return t=e.buildResponse(l),t.isSuccess()?n(t):r(t)},l.onload=s,l.onerror=s,l.ontimeout=s,e.timeout&&(l.timeout=e.timeout),l.send(c)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){return this.isSafe()||this.isCrossDomain()?void 0:up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;return(n=t.getResponseHeader(e.methodHeader))?l.normalizeMethod(n):void 0},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",
2
+ methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canConsole,canCssTransition,canDOMParser,canFormData,canInputEvent,canPromise,canPushState,hash,isIE10OrWorse,isRecentJQuery,isSupported,navigate,polyfilledSessionStorage,popCookie,puts,sessionStorage,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,navigate=function(t,e){var n;return null==e&&(e={}),n=new up.Request(u.merge(e,{url:t})),n.navigate()},submitForm=function(t){return t.submit()},puts=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],console[e].apply(console,t)},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(t){var e,n,r,o,i,s,a,l,c;if(s=200,r="",u.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(t))l="undefined";else if(u.isNumber(t)||u.isFunction(t))l=t.toString();else if(u.isArray(t))l="["+u.map(t,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(t))l="$("+u.map(t,stringifyArg).join(", ")+")",r=")";else if(u.isElement(t)){for(e=$(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],o=0,i=a.length;i>o;o++)n=a[o],(c=e.attr(n))&&(l+=" "+n+'="'+c+'"');l+=">",r=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=r),l},sprintf=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,e].concat(slice.call(t)))},sprintfWithFormattedArgs=function(){var t,e,n,r;return e=arguments[0],r=arguments[1],t=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=t[n],r=e(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE10OrWorse=u.memoize(function(){return!window.atob}),canPushState=function(){return u.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},canCssTransition=function(){return"transition"in document.documentElement.style},canInputEvent=function(){return"oninput"in document.createElement("input")},canPromise=function(){return!!window.Promise},canFormData=function(){return!!window.FormData},canDOMParser=function(){return!!window.DOMParser},canConsole=function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd},isRecentJQuery=function(){var t,e,n,r;return r=$.fn.jquery,n=r.split("."),t=parseInt(n[0]),e=parseInt(n[1]),t>=2||1===t&&e>=9},popCookie=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,u.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(t){return t.preload||u.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},isSupported=function(){return!isIE10OrWorse()&&isRecentJQuery()&&canConsole()&&canDOMParser()&&canFormData()&&canCssTransition()&&canInputEvent()&&canPromise()},sessionStorage=u.memoize(function(){try{return window.sessionStorage}catch(t){return polyfilledSessionStorage()}}),polyfilledSessionStorage=function(){var t;return t={},{getItem:function(e){return t[e]},setItem:function(e,n){return t[e]=n}}},hash=function(t){return t||(t=location.hash),t||(t=""),"#"===t[0]&&(t=t.substr(1)),u.presence(t)},{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,navigate:navigate,submitForm:submitForm,canPushState:canPushState,whenConfirmed:whenConfirmed,isSupported:isSupported,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage,popCookie:popCookie,hash:hash,canPushState:canPushState}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,fixRenamedEvents,forgetUpDescription,haltEvent,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,renamedEvent,renamedEvents,resetBus,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,renamedEvents={},upListenerToJqueryListener=function(t){return function(e){var n;return n=e.$element||$(this),t.apply(n.get(0),[e,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(t,e){var n,r,o;return n=u.copy(t),fixRenamedEvents(n),o=n.pop(),r=void 0,e?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},fixRenamedEvents=function(t){var e;return e=t[0].split(/\s+/),e=u.map(e,function(t){var e;return(e=renamedEvents[t])?(up.log.warn(t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},live=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(t=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(e=$(document)).on.apply(e,t),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],t=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(e=$(document)).off.apply(e,t)},rememberUpDescription=function(t){var e;return e=upDescriptionNumber(t),liveUpDescriptions[e]=t},forgetUpDescription=function(t){var e;return e=upDescriptionNumber(t),delete liveUpDescriptions[e]},upDescriptionNumber=function(t){return u.last(t)._descriptionNumber},emit=function(t,e){var n,r;return null==e&&(e={}),r=$.Event(t,e),(n=e.$element)?delete e.$element:n=$(document),logEmission(t,e),n.trigger(r),r},logEmission=function(t,e){var n,r,o;return e.hasOwnProperty("message")?(n=e.message,delete e.message,n!==!1&&(u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n)?u.isPresent(e)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[t],[e])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[t])):void 0):u.isPresent(e)?up.puts("Emitted event %s (%o)",t,e):up.puts("Emitted event %s",t)},nobodyPrevents=function(){var t,e;return t=1<=arguments.length?slice.call(arguments,0):[],e=emit.apply(null,t),!e.isDefaultPrevented()},whenEmitted=function(){var t;return t=1<=arguments.length?slice.call(arguments,0):[],new Promise(function(e,n){return nobodyPrevents.apply(null,t)?e():n(new Error("Event "+t[0]+" was prevented"))})},onEscape=function(t){return live("keydown","body",function(e){return u.escapePressed(e)?t(e):void 0})},haltEvent=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},consumeAction=function(t){return haltEvent(t),"up:action:consumed"!==t.type?emit("up:action:consumed",{$element:$(t.target),message:!1}):void 0},snapshot=function(){var t,e,n;n=[];for(e in liveUpDescriptions)t=liveUpDescriptions[e],n.push(t.isDefault=!0);return n},resetBus=function(){var t,e,n,r,o,i;e=[];for(o in liveUpDescriptions)t=liveUpDescriptions[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(unbind.apply(null,t));return i},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},renamedEvent=function(t,e){return renamedEvents[t]=e},boot=function(){return up.browser.isSupported()?(emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",resetBus),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,haltEvent:haltEvent,consumeAction:consumeAction,renamedEvent:renamedEvent,boot:boot}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){var t=[].slice;up.log=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return m=up.util,r=up.browser,n="up.log.enabled",o=m.config({prefix:"[UP] ",enabled:"true"===r.sessionStorage().getItem(n),collapse:!1}),h=function(){return o.reset()},c=function(t){return""+o.prefix+t},i=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["debug",c(n)].concat(t.call(e))):void 0},f=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["log",c(n)].concat(t.call(e))):void 0},v=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["warn",c(n)].concat(t.call(e))):void 0},l=function(){var e,n,i,u;if(i=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),!o.enabled||!i)return n();u=o.collapse?"groupCollapsed":"group",r.puts.apply(r,[u,c(i)].concat(t.call(e)));try{return n()}finally{i&&r.puts("groupEnd")}},a=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["error",c(n)].concat(t.call(e))):void 0},p=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=o.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",r.puts("log",t)},up.on("up:framework:boot",p),up.on("up:framework:reset",h),d=function(t){return r.sessionStorage().setItem(n,t.toString()),o.enabled=t},s=function(){return d(!0)},u=function(){return d(!1)},{puts:f,debug:i,error:a,warn:v,group:l,config:o,enable:s,disable:u}}(jQuery),up.puts=up.log.puts}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,c,p;return p=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+p.escapeHtml(t)+"</span>"},c=p.config({$toast:null}),l=function(){return i(),c.reset()},s=function(e){return p.isArray(e)?(e[0]=p.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=p.escapeHtml(e),e},u=function(){return!!c.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),c.$toast=a},i=function(){return u()?(c.$toast.remove(),c.$toast=null):void 0},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S;return S=up.util,n="up-destructible",r="up-destructors",o={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},m=!0,p=[],g=[],c=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),d(p,o,r,n)},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),m&&(r.priority=h(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)},h=function(t){var e,n;for(n in o)if(e=o[n],t.indexOf(n)>=0)return e},s=function(t,e,n){return{selector:t,callback:n,isSystem:m,priority:e.priority||0,batch:e.batch,keep:e.keep}},d=function(t,e,n,r){var o,i,u;if(up.browser.isSupported()){for(i=s(e,n,r),o=0;(u=t[o])&&u.priority>=i.priority;)o+=1;return t.splice(o,0,i)}},u=function(t,e,n){var r,o;return up.puts(t.isSystem?void 0:"Compiling '%s' on %o",t.selector,n),t.keep&&(o=S.isString(t.keep)?t.keep:"",e.attr("up-keep",o)),r=t.callback.apply(n,[e,f(e)]),i(e,r)},y=function(t){return S.isFunction(t)?t:S.isArray(t)&&S.all(t,S.isFunction)?S.sequence.apply(S,t):void 0},i=function(t,e){var o;return(e=y(e))?(t.addClass(n),o=t.data(r)||function(){return w(t)},o=S.sequence(o,e),t.data(r,o)):void 0},w=function(t){return t.removeData(r),t.removeClass(n)},l=function(t,n){var r;return n=S.options(n),r=e(n.skip),up.log.group("Compiling fragment %o",t.get(0),function(){var n,o,i,s,a,l;for(a=[g,p],l=[],o=0,i=a.length;i>o;o++)s=a[o],l.push(function(){var o,i,a;for(a=[],o=0,i=s.length;i>o;o++)c=s[o],n=S.selectInSubtree(t,c.selector),r.length&&(n=n.filter(function(){var t;return t=e(this),S.all(r,function(e){return 0===t.closest(e).length})})),n.length?a.push(up.log.group(c.isSystem?void 0:"Compiling '%s' on %d element(s)",c.selector,n.length,function(){return c.batch?u(c,n,n.get()):n.each(function(){return u(c,e(this),this)})})):a.push(void 0);return a}());return l})},a=function(t){return b(t)()},b=function(t){var o,i;return o=S.selectInSubtree(t,"."+n),i=S.map(o,function(t){return e(t).data(r)}),i=S.compact(i),S.sequence.apply(S,i)},f=function(t){var n,r;return n=e(t),r=n.attr("up-data"),S.isString(r)&&""!==S.trim(r)?JSON.parse(r):{}},k=function(){var t;return t=function(t){return t.isSystem},p=S.select(p,t),g=S.select(g,t)},up.on("up:framework:booted",function(){return m=!1}),up.on("up:framework:reset",k),{compiler:c,macro:v,compile:l,clean:a,prepareClean:b,data:f}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,d=function(){return n.reset(),c=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(c=u,u=void 0),u=t},h=function(t){return i("replaceState",t)},p=function(t,e){return e=v.options(e,{force:!1}),t=s(t),!e.force&&o(t)||!up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t})?void 0:i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return up.browser.canPushState()&&n.enabled?(i=e(),window.history[t](i,"",o),a(r()),!0):!1},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),h(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.macro("a[up-back], [up-href][up-back]",function(t){return v.isPresent(c)?(v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",d),{config:n,push:p,replace:h,url:r,isUrl:o,previousUrl:function(){return c},normalizeUrl:s}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var anchoredRight,config,finishScrolling,firstHashTarget,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealHash,revealOrRestoreScroll,revealSelector,saveScroll,scroll,scrollAbruptlyNow,scrollTopKey,scrollTops,scrollWithAnimateNow,scrollableElementForViewport,scrollingTracker,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=new up.Cache({size:30,key:up.history.normalizeUrl}),scrollingTracker=new up.MotionTracker("scrolling"),reset=function(){return config.reset(),lastScrollTops.clear(),scrollingTracker.finish()},scroll=function(t,e,n){var r;return r=scrollableElementForViewport(t),n=u.options(n),n.duration=u.option(n.duration,config.duration),n.easing=u.option(n.easing,config.easing),finishScrolling(r).then(function(){return up.motion.isEnabled()&&n.duration>0?scrollWithAnimateNow(r,e,n):scrollAbruptlyNow(r,e)})},scrollableElementForViewport=function(t){var e;return e=$(t),e.get(0)===document?$("html, body"):e},scrollWithAnimateNow=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(scrollingTracker.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(scrollingTracker.eventName)}),o},scrollingTracker.claim(t,r)},scrollAbruptlyNow=function(t,e){return t.scrollTop(e),Promise.resolve()},finishScrolling=function(t){var e;return e=scrollableElementForViewport(t),scrollingTracker.finish(e)},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||up.fail("Fixed element %o must have a CSS attribute %s",n.get(0),e),parseFloat(r)+n.height()},e=function(){var t,e,o,i;for(o=$(config.fixedTop.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"top"));return i}(),t=function(){var t,e,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n;return n=$(t),up.puts("Revealing fragment %o",n.get(0)),e=u.options(e),u.rejectOnError(function(){var t,r,o,i,s,a,l,c,p,f,h,d,m;return t=e.viewport?$(e.viewport):viewportOf(n),h=u.option(e.snap,config.snap),m=t.is(document),d=m?u.clientSize().height:t.outerHeight(),c=t.scrollTop(),s=c,l=void 0,a=void 0,m?(a=measureObstruction(),l=0):(a={top:0,bottom:0},l=c),p=function(){return s+a.top},f=function(){return s+d-a.bottom-1},r=u.measure(n,{relative:t,includeMargin:!0}),o=r.top+l,i=o+Math.min(r.height,config.substance)-1,i>f()&&(s+=i-f()),(o<p()||e.top)&&(s=o-a.top),h>s&&r.top<.5*d&&(s=0),s!==c?scroll(t,s,e):Promise.resolve()})},revealHash=function(){var t,e;return(e=up.browser.hash())&&(t=firstHashTarget(e))?reveal(t):Promise.resolve()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t,e){var n,r;return null==e&&(e={}),n=$(t),r=viewportSelector().seekUp(n),0===r.length&&e.strict!==!1&&up.fail("Could not find viewport for %o",n),r},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().selectInSubtree(e)},viewports=function(){return viewportSelector().select()},scrollTopKey=function(t){var e;return e=$(t),e.is(document)?"document":u.selectorForElement(e)},scrollTops=function(){var t,e,n,r,o;for(o={},r=config.viewports,e=0,n=r.length;n>e;e++)t=r[e],$(t).each(function(){var t,e,n;return t=$(this),e=scrollTopKey(t),n=t.scrollTop(),o[e]=n});return o},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),r=e.add(n)):r=viewports(),o=lastScrollTops.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=u.map(r,function(t){var e,n;return e=scrollTopKey(t),n=o[e]||0,scroll(t,n,{duration:0})}),Promise.all(t)})},revealOrRestoreScroll=function(t,e){var n,r,o;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?(r={},u.isString(e.reveal)&&(o=revealSelector(e.reveal),n=up.first(o)||n,r.top=!0),reveal(n,r)):Promise.resolve()},revealSelector=function(t,e){return t=up.dom.resolveSelector(t,e),"#"===t[0]&&(t+=", a[name='"+t+"']"),t},firstHashTarget=function(t){return(t=up.browser.hash(t))?up.first("[id='"+t+"'], a[name='"+t+"']"):void 0},up.on("up:app:booted",revealHash),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,revealHash:revealHash,firstHashTarget:firstHashTarget,scroll:scroll,config:config,viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function($){var autofocus,bestMatchingSteps,bestPreflightSelector,config,destroy,detectScriptFixes,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,first,firstInLayer,firstInPriority,fixScripts,hello,isRealElement,isSingletonElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,source,swapElements,swapSingletonElement,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:"none"}),reset=function(){return config.reset()},setSource=function(t,e){var n;return n=$(t),u.isPresent(e)&&(e=u.normalizeUrl(e)),n.attr("up-source",e)},source=function(t){var e;return e=$(t).closest("[up-source]"),u.presence(e.attr("up-source"))||up.browser.url()},resolveSelector=function(t,e){var n,r;return u.isString(t)?(r=t,u.contains(r,"&")&&(u.isPresent(e)?(n=u.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=u.selectorForElement(t),r},replace=function(t,e,n){var r,o,i,s,a,l,c,p,f,h,d;if(n=u.options(n),n.inspectResponse=s=function(){return up.browser.navigate(e,u.only(n,"method","data"))},!up.browser.canPushState()&&n.history!==!1)return n.preload||s(),u.unresolvablePromise();d=u.merge(n,{humanizedTarget:"target"}),i=u.merge(n,{humanizedTarget:"failure target",provideTarget:void 0}),u.renameKey(i,"failTransition","transition"),u.renameKey(i,"failLayer","layer");try{l=bestPreflightSelector(t,d),a=bestPreflightSelector(n.failTarget,i)}catch(o){return r=o,Promise.reject(r)}return h={url:e,method:n.method,data:n.data,target:l,failTarget:a,cache:n.cache,preload:n.preload,headers:n.headers,timeout:n.timeout},p=function(t){return processResponse(!0,l,t,d)},c=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=processResponse(!1,a,t,i),u.always(e,n))},f=up.request(h),n.preload||(f=f.then(p,c)),f},processResponse=function(t,e,n,r){var o,i,s,a,l;return a=n.request,l=n.url,i=l,o=a.hash,r.reveal===!0&&o&&(r.reveal=o,i+=o),s="GET"===n.method,t?s?(r.history===!1||u.isString(r.history)||(r.history=i),r.source===!1||u.isString(r.source)||(r.source=l)):(u.isString(r.history)||(r.history=!1),u.isString(r.source)||(r.source="keep")):s?(r.history!==!1&&(r.history=i),r.source!==!1&&(r.source=l)):(r.history=!1,r.source="keep"),shouldExtractTitle(r)&&n.title&&(r.title=n.title),extract(e,n.text,r)},shouldExtractTitle=function(t){return!(t.title===!1||u.isString(t.title)||t.history===!1&&t.title!==!0)},extract=function(t,e,n){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=e?e.length:void 0,function(){return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),n.saveScroll!==!1&&up.layout.saveScroll(),u.rejectOnError(function(){var r,o,i,s,a,l,c;for("function"==typeof n.provideTarget&&n.provideTarget(),s=parseResponseDoc(e),r=bestMatchingSteps(t,s,n),shouldExtractTitle(n)&&(a=s.title())&&(n.title=a),updateHistoryAndTitle(n),c=[],o=0,i=r.length;i>o;o++)l=r[o],up.log.group("Updating %s",l.selector,function(){var t;return fixScripts(l.$new),t=swapElements(l.$old,l.$new,l.pseudoClass,l.transition,n),c.push(t),n=u.merge(n,{reveal:!1})});return Promise.all(c)})})},bestPreflightSelector=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},bestMatchingSteps=function(t,e,n){var r;return n=u.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},fixScripts=function(t){var e,n,r,o,i;for(n=[],detectScriptFixes(t.get(0),n),i=[],r=0,o=n.length;o>r;r++)e=n[r],i.push(e());return i},detectScriptFixes=function(t,e){var n,r,o,i,u,s;if("NOSCRIPT"===t.tagName)return r=document.createElement("noscript"),r.textContent=t.innerHTML,e.push(function(){return t.parentNode.replaceChild(r,t)});if("SCRIPT"===t.tagName)return e.push(function(){return t.parentNode.removeChild(t)});for(u=t.children,s=[],o=0,i=u.length;i>o;o++)n=u[o],s.push(detectScriptFixes(n,e));return s},parseResponseDoc=function(t){var e;return e=u.createElementFromHtml(t),{title:function(){var t;return null!=(t=e.querySelector("head title"))?t.textContent:void 0},first:function(t){var n;return(n=$.find(t,e)[0])?$(n):void 0}}},updateHistoryAndTitle=function(t){return t=u.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),u.isString(t.title)?document.title=t.title:void 0},swapElements=function(t,e,n,r,o){var i,s,a,l,c;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(t)})),up.motion.finish(t),n?(i=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(i):t.append(i),hello(i.children(),o),l=up.layout.revealOrRestoreScroll(i,o),l=l.then(function(){return up.animate(i,r,o)}),l=l.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(t,e,o))?(emitFragmentKept(a),l=Promise.resolve()):(o.keepPlans=transferKeepableElements(t,e,o),s=up.syntax.prepareClean(t),c=function(){return isSingletonElement(t)?(swapSingletonElement(t,e),r=!1):e.insertBefore(t),o.source!==!1&&setSource(e,o.source),autofocus(e),hello(e,o),up.morph(t,e,r,o)},l=destroy(t,{clean:s,beforeWipe:c,log:!1})),l},isSingletonElement=function(t){return t.is("body")},swapSingletonElement=function(t,e){return t.replaceWith(e)},transferKeepableElements=function(t,e,n){var r,o,i,s,a,l,c,p;if(s=[],n.keep)for(p=t.find("[up-keep]"),i=0,l=p.length;l>i;i++)a=p[i],r=$(a),(c=findKeepPlan(r,e,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),up.util.detachWith(r,o),c.$newElement.replaceWith(r),s.push(c));return s},findKeepPlan=function(t,e,n){var r,o,i,s,a;return n.keep&&(r=t,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?e.find(s):u.selectInSubtree(e,s),o=o.first(),o.length&&o.is("[up-keep]")&&(a={$element:r,$newElement:o,newData:up.syntax.data(o)},i=u.merge(a,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i))))?a:void 0},hello=function(t,e){var n,r,o,i,s,a;for(n=$(t),e=u.options(e,{keepPlans:[]}),o=[],a=e.keepPlans,r=0,i=a.length;i>r;r++)s=a[r],emitFragmentKept(s),o.push(s.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,e),n},emitFragmentInserted=function(t,e){var n;return n=$(t),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:e.origin})},emitFragmentKept=function(t){var e;return e=u.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},autofocus=function(t){var e,n;return n="[autofocus]:last",e=u.selectInSubtree(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},isRealElement=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},first=function(t,e){var n;return e=u.options(e,{layer:"auto"}),n=resolveSelector(t,e.origin),"auto"===e.layer?firstInPriority(n,e.origin):firstInLayer(n,e.layer)},firstInPriority=function(t,e){var n,r,o,i,s,a;for(i=["popup","modal","page"],n=void 0,u.isPresent(e)&&(a=layerOf(e),u.remove(i,a),i.unshift(a)),r=0,s=i.length;s>r&&(o=i[r],!(n=firstInLayer(t,o)));r++);return n},firstInLayer=function(t,e){var n,r,o,i,u,s;for(r=$(t),o=void 0,u=0,s=r.length;s>u;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,e)){o=n;break}return o},layerOf=function(t){var e;return e=$(t),up.popup.contains(e)?"popup":up.modal.contains(e)?"modal":"page"},matchesLayer=function(t,e){return layerOf(t)===e},destroy=function(t,e){var n,r,o,i,s,a;return n=$(t),e=u.options(e,{animation:!1}),shouldLogDestruction(n,e)&&(i=["Destroying fragment %o",n.get(0)],s=["Destroyed fragment %o",n.get(0)]),0===n.length?Promise.resolve():(up.emit("up:fragment:destroy",{$element:n,message:i}),n.addClass("up-destroying"),updateHistoryAndTitle(e),r=function(){var t;return t=up.motion.animateOptions(e),up.motion.animate(n,e.animation,t)},o=e.beforeWipe||Promise.resolve(),a=function(){return e.clean||(e.clean=function(){return up.syntax.clean(n)}),e.clean(),up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:s}),n.remove()},r().then(o).then(a))},shouldLogDestruction=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},reload=function(t,e){var n;return e=u.options(e,{cache:!1}),n=e.url||source(t),replace(t,n,e)},up.on("up:app:boot",function(){var t;return t=$(document.body),setSource(t,up.browser.url()),hello(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello,config:config}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.hello=up.dom.hello,up.renamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,F;return x=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=x.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return c(),v=x.copy(u),g=x.copy(s),i.reset()},f=function(){return i.enabled},n=function(t,i,u){var s;return s=e(t),u=r(u),p(s,u).then(function(){return P(s,i,u)?x.isFunction(i)?i(s,u):x.isString(i)?n(s,a(i),u):x.isOptions(i)?o(s,i,u):up.fail("Animation must be a function, animation name or object of CSS properties, but it was %o",i):S(s,i)})},P=function(t,e,n){return f()&&!h(e)&&n.duration>0&&x.all(t,x.isBodyDescendant)},S=function(t,e){return x.isOptions(e)&&t.css(e),Promise.resolve()},o=function(t,e,n){var r;return r=function(){var r,o,i,u,s,a,l,c,p,f;return c=Object.keys(e),l={"transition-property":c.join(", "),"transition-duration":n.duration+"ms","transition-delay":n.delay+"ms","transition-timing-function":n.easing},u=t.css(Object.keys(l)),o=x.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;return e=t.originalEvent.propertyName,x.contains(c,e)?i():void 0},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=x.setTimer(n.duration+p,i),o.then(function(){var e;return t.off(m.finishEvent,s),t.off("transitionend",a),clearTimeout(r),f(),t.css({transition:"none"}),e=!("none"===u["transition-property"]||"all"===u["transition-property"]&&"0"===u["transition-duration"][0]),e?(x.forceRepaint(t),t.css(u)):void 0}),f=x.forceCompositing(t),t.css(l),t.css(e),o.promise()},m.start(t,r)},r=function(){var e,n,r,o,u;return n=1<=arguments.length?t.call(arguments,0):[],u=n.shift()||{},e=x.isJQuery(n[0])?n.shift():x.nullJQuery(),o=x.isObject(n[0])?n.shift():{},r={},r.easing=x.option(u.easing,x.presentAttr(e,"up-easing"),o.easing,i.easing),r.duration=Number(x.option(u.duration,x.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(x.option(u.delay,x.presentAttr(e,"up-delay"),o.delay,i.delay)),
3
+ r.finishedMotion=u.finishedMotion,r},a=function(t){return v[t]||up.fail("Unknown animation %o",t)},F=function(t,e,n,r){var o,i,u,s,a;return n.copy===!1||t.is(".up-ghost")||e.is(".up-ghost")?r(t,e,n):(s=void 0,i=void 0,a=void 0,u=void 0,o=up.layout.viewportOf(t),x.temporaryCss(e,{display:"none"},function(){return s=y(t,o),a=o.scrollTop()}),t.hide(),up.layout.revealOrRestoreScroll(e,n).then(function(){var l,c,p,f;return i=y(e,o),u=o.scrollTop(),s.moveTop(u-a),p=x.temporaryCss(e,{opacity:"0"}),f=r(s.$ghost,i.$ghost,n),l=s.$ghost.add(i.$ghost),c=t.add(e),m.forwardFinishEvent(c,l,f),f.then(function(){return p(),s.$bounds.remove(),i.$bounds.remove()})}))},c=function(t){return m.finish(t)},d=function(t,n,o,i){var u,s,a,c,f;return i=x.options(i),i=x.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=P(u,c,i),up.log.group(f?"Morphing %o to %o with transition %o":void 0,a.get(0),s.get(0),o,function(){return p(u,i).then(function(){return f?c?F(a,s,i,c):up.fail("Unknown transition %o",o):T(a,s,i)})})},p=function(t,e){return e.finishedMotion?Promise.resolve():(e.finishedMotion=!0,c(t))},l=function(t){var e;if(h(t))return void 0;if(x.isFunction(t))return t;if(x.isArray(t))return h(t[0])&&h(t[1])?void 0:function(e,r,o){return Promise.all([n(e,t[0],o),n(r,t[1],o)])};if(x.isString(t)){if(t.indexOf("/")>=0)return l(t.split("/"));if(e=g[t])return l(e)}},T=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},y=function(t,n){var r,o,i,u,s,a,l,c,p;for(u=x.measure(t,{relative:!0,inner:!0}),i=t.clone(),i.find("script").remove(),i.css({position:"static"===t.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},i.appendTo(r),r.insertBefore(t),c(t.offset().top-i.offset().top),o=up.layout.fixedChildren(i),a=0,l=o.length;l>a;a++)s=o[a],x.fixedToAbsolute(s,n);return{$ghost:i,$bounds:r,moveTop:c}},w=function(t,e){return g[t]=e},b=function(t,e){return v[t]=e},E=function(){return u=x.copy(v),s=x.copy(g)},h=function(t){return!t||"none"===t||x.isOptions(t)&&x.isBlank(t)},b("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),b("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),A=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},b("move-to-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css(A(0,0)),n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css(A(0,-o)),n(t,A(0,0),e)}),b("move-to-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css(A(0,0)),n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css(A(0,o)),n(t,A(0,0),e)}),b("move-to-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css(A(0,0)),n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css(A(-o,0)),n(t,A(0,0),e)}),b("move-to-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css(A(0,0)),n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css(A(o,0)),n(t,A(0,0),e)}),b("roll-down",function(t,e){var r,o,i;return o=t.height(),i=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),r=n(t,{height:o+"px"},e),r.then(i),r}),w("move-left","move-to-left/move-from-right"),w("move-right","move-to-right/move-from-left"),w("move-up","move-to-top/move-from-bottom"),w("move-down","move-to-bottom/move-from-top"),w("cross-fade","fade-out/fade-in"),up.on("up:framework:booted",E),up.on("up:framework:reset",k),{morph:d,animate:n,animateOptions:r,finish:c,transition:w,animation:b,config:i,isEnabled:f,prependCopy:y,isNone:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,F,$,C,D,O,R,N,U;return N=up.util,n=void 0,T=void 0,D=void 0,w=void 0,O=void 0,A=[],c=N.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return c.cacheSize},expiry:function(){return c.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),p=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(T),T=null},s=function(){return clearTimeout(D),D=null},F=function(){return n=null,u(),s(),w=0,c.reset(),i.clear(),O=!1,A=[]},F(),b=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=N.extractOptions(e),N.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||l(),!n&&(o=p(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=g(i),C(i,o),o["catch"](function(t){return P(i)})),r.preload||(y(),N.always(o,v)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},b.apply(null,e).then(r,n)})},h=function(){return 0===w},f=function(){return w>0},y=function(){var t;return w+=1,D?void 0:(t=function(){return f()?(up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0):void 0},D=N.setTimer(c.slowDelay,t))},v=function(){return w-=1,h()&&(s(),O)?(up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1):void 0},g=function(t){return w<c.maxRequests?m(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return m(t)},e=N.previewable(e),A.push(e),e.promise},m=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),N.always(n,$),N.always(n,k),n):(N.microtask(k),Promise.reject(new Error("Event up:proxy:load was prevented")))},x=function(t){var e,n;return n=t.request,n.url!==t.url?(e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)):void 0},$=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},k=function(){var t;return void("function"==typeof(t=A.shift())&&t())},o=i.alias,C=i.set,P=i.remove,l=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),a=function(t){var e,r;return r=parseInt(N.presentAttr(t,"up-delay"))||c.preloadDelay,t.is(n)?void 0:(n=t,u(),e=function(){return S(t),n=null},R(e,r))},R=function(t,e){return T=setTimeout(t,e)},S=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},d=function(t){return N.contains(c.safeMethods,t)},U=function(t,e,n){return N.contains(c.wrapMethods,t)&&(e=N.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.on("mouseover mousedown touchstart","a[up-preload], [up-href][up-preload]",function(t,e){return up.link.shouldProcessEvent(t,e)&&up.link.isSafe(e)?a(e):void 0}),up.on("up:framework:reset",F),{preload:S,ajax:r,request:b,get:p,alias:o,clear:l,remove:P,isIdle:h,isBusy:f,isSafeMethod:d,wrapMethod:U,config:c}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function($){var DEFAULT_FOLLOW_VARIANT,addFollowVariant,allowDefault,defaultFollow,defaultPreload,follow,followMethod,followVariantForLink,followVariants,isFollowable,isSafe,makeFollowable,shouldProcessEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r;return n=$(t),r=followVariantForLink(n),r.followLink(n,e)},defaultFollow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target")),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.confirm=u.option(e.confirm,n.attr("up-confirm")),e=u.merge(e,up.motion.animateOptions(e,n)),up.browser.whenConfirmed(e).then(function(){return up.replace(r,o,e)})},defaultPreload=function(t,e){return e=u.options(e),e.preload=!0,defaultFollow(t,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},allowDefault=function(t){},followVariants=[],addFollowVariant=function(t,e){var n;return n=new up.FollowVariant(t,e),followVariants.push(n),n.registerEvents(),n},isFollowable=function(t){return!!followVariantForLink(t,{"default":!1})},followVariantForLink=function(t,e){var n,r;return e=u.options(e),n=$(t),r=u.detect(followVariants,function(t){return t.matchesLink(n)}),e["default"]!==!1&&(r||(r=DEFAULT_FOLLOW_VARIANT)),r},makeFollowable=function(t){var e;return e=$(t),isFollowable(e)?void 0:e.attr("up-follow","")},shouldProcessEvent=function(t,e){var n,r,o;return n=$(t.target),r=n.closest("a, [up-href]").not(e),o=up.form.fieldSelector().seekUp(n),0===r.length&&0===o.length&&u.isUnmodifiedMouseEvent(t)},isSafe=function(t,e){var n,r;return n=$(t),r=followMethod(n,e),up.proxy.isSafeMethod(r)},DEFAULT_FOLLOW_VARIANT=addFollowVariant("[up-target], [up-follow]",{follow:function(t,e){return defaultFollow(t,e)},preload:function(t,e){return defaultPreload(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?makeFollowable(t):e["up-target"]=n,u.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(t){var e,n,r,o,i,s,a,l,c,p;if(e=t.find("a, [up-href]"),(c=t.attr("up-expand"))&&(e=e.filter(c)),i=e.get(0)){for(p=/^up-/,a={},a["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],s=n.name,s.match(p)&&(a[s]=n.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,isSafe:isSafe,isFollowable:isFollowable,shouldProcessEvent:shouldProcessEvent,followMethod:followMethod,addFollowVariant:addFollowVariant,followVariantForLink:followVariantForLink,allowDefault:allowDefault}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,fieldSelector,findSwitcherForTarget,observe,observeField,reset,resolveValidateTarget,submit,switchTarget,switchTargets,switcherValues,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},fieldSelector=function(){return u.multiSelector(config.fields)},submit=function(t,e){var n,r,o,i;return n=$(t).closest("form"),e=u.options(e),o=u.option(e.target,n.attr("up-target"),"body"),i=u.option(e.url,n.attr("action"),up.browser.url()),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.history=u.option(e.history,u.castedAttr(n,"up-history"),!0),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.method=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),e.headers=u.option(e.headers,{}),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.data=u.requestDataFromForm(n),e=u.merge(e,up.motion.animateOptions(e,n)),e.validate&&(e.headers||(e.headers={}),e.transition=!1,e.failTransition=!1,e.headers[up.protocol.config.validateHeader]=e.validate),up.feedback.start(n),up.browser.canPushState()||e.history===!1?(r=up.replace(o,i,e),u.always(r,function(){return up.feedback.stop(n)}),r):(n.get(0).submit(),u.unresolvablePromise())},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($element,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option(u.presentAttr($element,"up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),$fields=fieldSelector().selectInSubtree($element),destructors=u.map($fields,function(t){return observeField($(t),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},autosubmit=function(t,e){return observe(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return submit(n)})})},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),u.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!1),e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},switcherValues=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(e.target,n.attr("up-switch")),u.isPresent(o)||up.fail("No switch target given for %o",n.get(0)),r=switcherValues(n),$(o).each(function(){return switchTarget($(this),r)})},switchTarget=function(t,e){var n,r,o,i;return n=$(t),e||(e=switcherValues(findSwitcherForTarget(n))),(r=n.attr("up-hide-for"))?(r=r.split(" "),o=0===u.intersect(e,r).length):(i=(i=n.attr("up-show-for"))?i.split(" "):[":present",":checked"],o=u.intersect(e,i).length>0),n.toggle(o),n.addClass("up-switched")},findSwitcherForTarget=function(t){var e,n;return e=$("[up-switch]"),n=u.detect(e,function(e){var n;return n=$(e).attr("up-switch"),t.is(n)}),n?$(n):u.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),submit(e)}),up.on("change","[up-validate]",function(t,e){return validate(e)}),up.compiler("[up-switch]",function(t){return switchTargets(t)}),up.on("change","[up-switch]",function(t,e){return switchTargets(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return switchTarget(t)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.compiler("[up-autosubmit]",function(t){return autosubmit(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets,autosubmit:autosubmit,fieldSelector:fieldSelector}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function($){var align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,isOpen,preloadNow,reset,state,toggleAsap,u,unveilFrame;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$popup)&&t.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var t,e,n;switch(t={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(e=state.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=u.measure(state.$anchor),state.position){case"bottom-right":t.top=e.top+e.height,t.left=e.left+e.width-n.width;break;case"bottom-left":t.top=e.top+e.height,t.left=e.left;break;case"top-right":t.top=e.top-n.height,t.left=e.left+e.width-n.width;break;case"top-left":t.top=e.top-n.height,t.left=e.left;break;default:up.fail("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(t)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t){var e;return e=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),state.$popup=e},unveilFrame=function(){return state.$popup.show()},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(t,e){return chain.asap(closeNow,function(){return attachNow(t,e)})},attachNow=function(t,e){var n,r,o,i,s,a,l;return n=$(t),n.length||up.fail("Cannot attach popup to non-existing element %o",t),e=u.options(e),l=u.option(u.pluckKey(e,"url"),n.attr("up-href"),n.attr("href")),i=u.option(u.pluckKey(e,"html")),l||i||up.fail("up.popup.attach() requires either an { url } or { html } option"),a=u.option(u.pluckKey(e,"target"),n.attr("up-popup"),"body"),s=u.option(e.position,n.attr("up-position"),config.position),e.animation=u.option(e.animation,n.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(n,"up-sticky"),config.sticky),e.history=up.browser.canPushState()?u.option(e.history,u.castedAttr(n,"up-history"),config.history):!1,e.confirm=u.option(e.confirm,n.attr("up-confirm")),e.method=up.link.followMethod(n,e),e.layer="popup",e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.provideTarget=function(){return createHiddenFrame(a)},r=up.motion.animateOptions(e,n,{duration:config.openDuration,easing:config.openEasing}),o=u.merge(e,{animation:!1}),e.preload&&l?up.replace(a,l,e):up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:popup:open",{url:l,message:"Opening popup"}).then(function(){var t;return state.phase="opening",state.$anchor=n,state.position=s,e.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),state.sticky=e.sticky,t=i?up.extract(a,i,o):up.replace(a,l,o),t=t.then(function(){return align(),unveilFrame(),up.animate(state.$popup,e.animation,r)}),t=t.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e;return isOpen()?(t=u.options(t,{animation:config.closeAnimation,history:state.coveredUrl,title:state.coveredTitle}),e=up.motion.animateOptions(t,{duration:config.closeDuration,easing:config.closeEasing}),u.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,t).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},preloadNow=function(t,e){return e=u.options(e),e.preload=!0,attachNow(t,e)},toggleAsap=function(t,e){return t.is(".up-current")?closeAsap():attachAsap(t,e)},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return toggleAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click up:action:consumed",function(t){var e;return e=$(t.target),e.closest(".up-popup, [up-popup]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click",".up-popup [up-close]",function(t,e){return closeAsap(),up.bus.consumeAction(t)}),up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,flavors,followAsap,isOpen,markAsAnimating,openAsap,openNow,preloadNow,reset,shiftElements,state,templateHtml,u,unshiftElements,unveilFrame,visitAsap;return u=up.util,config=u.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$modal)&&t.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var t;return t=flavorDefault("template"),u.evalOption(t,{closeLabel:flavorDefault("closeLabel")})},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t,e){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),u.isPresent(state.position)&&o.attr("up-position",state.position),r=o.find(".up-modal-dialog"),u.isPresent(e.width)&&r.css("width",e.width),u.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),u.isPresent(e.height)&&r.css("height",e.height),state.closable||o.find(".up-modal-close").remove(),n=o.find(".up-modal-content"),u.$createPlaceholder(t,n),o.hide(),o.appendTo(document.body),state.$modal=o},unveilFrame=function(){return state.$modal.show()},shiftElements=function(){var t,e,n,r,o;return u.documentHasVerticalScrollbar()?(t=$("body"),r=u.scrollbarWidth(),e=parseFloat(t.css("padding-right")),n=r+e,o=u.temporaryCss(t,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var t,e,n,o;return t=$(this),e=parseFloat(t.css("right")),n=r+e,o=u.temporaryCss(t,{right:n}),state.unshifters.push(o)})):void 0},unshiftElements=function(){var t,e;for(t=[];e=state.unshifters.pop();)t.push(e());return t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(t,e){return e=u.options(e),e.$link=$(t),openAsap(e)},preloadNow=function(t,e){return e=u.options(e),e.$link=t,e.preload=!0,openNow(e)},visitAsap=function(t,e){return e=u.options(e),e.url=t,openAsap(e)},extractAsap=function(t,e,n){return n=u.options(n),n.html=e,n.history=u.option(n.history,!1),n.target=t,openAsap(n)},openAsap=function(t){return chain.asap(closeNow,function(){return openNow(t)})},openNow=function(t){var e,n,r,o,i;return t=u.options(t),e=u.option(u.pluckKey(t,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(t,"url"),e.attr("up-href"),e.attr("href")),r=u.option(u.pluckKey(t,"html")),o=u.option(u.pluckKey(t,"target"),e.attr("up-modal"),"body"),t.flavor=u.option(t.flavor,e.attr("up-flavor"),config.flavor),t.position=u.option(t.position,e.attr("up-position"),flavorDefault("position",t.flavor)),t.position=u.evalOption(t.position,{$link:e}),t.width=u.option(t.width,e.attr("up-width"),flavorDefault("width",t.flavor)),t.maxWidth=u.option(t.maxWidth,e.attr("up-max-width"),flavorDefault("maxWidth",t.flavor)),t.height=u.option(t.height,e.attr("up-height"),flavorDefault("height")),t.animation=u.option(t.animation,e.attr("up-animation"),flavorDefault("openAnimation",t.flavor)),t.animation=u.evalOption(t.animation,{position:t.position}),t.backdropAnimation=u.option(t.backdropAnimation,e.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",t.flavor)),t.backdropAnimation=u.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=u.option(t.sticky,u.castedAttr(e,"up-sticky"),flavorDefault("sticky",t.flavor)),t.closable=u.option(t.closable,u.castedAttr(e,"up-closable"),flavorDefault("closable",t.flavor)),t.confirm=u.option(t.confirm,e.attr("up-confirm")),t.method=up.link.followMethod(e,t),t.layer="modal",t.failTarget=u.option(t.failTarget,e.attr("up-fail-target")),t.failLayer=u.option(t.failLayer,e.attr("up-fail-layer"),"auto"),n=up.motion.animateOptions(t,e,{duration:flavorDefault("openDuration",t.flavor),easing:flavorDefault("openEasing",t.flavor)}),t.history=u.option(t.history,u.castedAttr(e,"up-history"),flavorDefault("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return createHiddenFrame(o,t)},t.preload?up.replace(o,i,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var e,s;return state.phase="opening",state.flavor=t.flavor,state.sticky=t.sticky,state.closable=t.closable,state.position=t.position,t.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),e=u.merge(t,{animation:!1}),s=r?up.extract(o,r,e):up.replace(o,i,e),s=s.then(function(){return shiftElements(),unveilFrame(),animate(t.animation,t.backdropAnimation,n)}),s=s.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e,n,r,o;return t=u.options(t),isOpen()?(o=u.option(t.animation,flavorDefault("closeAnimation")),o=u.evalOption(o,{position:state.position}),n=u.option(t.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),e=up.motion.animateOptions(t,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(t,"animation","duration","easing","delay"),{history:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var t;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,t=animate(o,n,e),t=t.then(function(){return up.destroy(state.$modal,r)}),t=t.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,state.closable=null,state.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},markAsAnimating=function(t){return null==t&&(t=!0),state.$modal.toggleClass("up-modal-animating",t)},animate=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(markAsAnimating(),r=Promise.all([up.animate(state.$modal.find(".up-modal-viewport"),t,n),up.animate(state.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-modal").length>0},flavor=function(t,e){return null==e&&(e={}),up.log.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),u.assign(flavorOverrides(t),e)},flavorOverrides=function(t){return flavors[t]||(flavors[t]={})},flavorDefault=function(t,e){var n;return null==e&&(e=state.flavor),e&&(n=flavorOverrides(e)[t]),u.isMissing(n)&&(n=config[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return followAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click",".up-modal",function(t){var e;if(state.closable)return e=$(t.target),e.closest(".up-modal-dialog").length||e.closest("[up-modal]").length?void 0:(up.bus.consumeAction(t),closeAsap())}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin)&&!up.popup.contains(e))return autoclose()}),up.bus.onEscape(function(){return state.closable?closeAsap():void 0}),up.on("click",".up-modal [up-close]",function(t,e){return closeAsap(),up.bus.consumeAction(t)}),up.macro("a[up-drawer], [up-href][up-drawer]",function(t){var e;return e=t.attr("up-drawer"),t.attr({"up-modal":e,"up-flavor":"drawer"})}),flavors.drawer={openAnimation:function(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(t){return u.isPresent(t.$link)?u.horizontalScreenHalf(t.$link):"left"}},up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visitAsap,follow:followAsap,extract:extractAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,flavors:flavors,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,i,u,s,a,l,c,p,f;return f=up.util,s=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),p=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,c=function(){var t;return null!=(t=p.$tooltip)&&t.remove(),p.reset(),o.reset(),s.reset()},e=function(){var t,e,n;switch(t={},n=f.measure(p.$tooltip),f.isFixed(p.$anchor)?(e=p.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=f.measure(p.$anchor),p.position){case"top":t.top=e.top-n.height,t.left=e.left+.5*(e.width-n.width);break;case"left":t.top=e.top+.5*(e.height-n.height),t.left=e.left-n.width;break;case"right":t.top=e.top+.5*(e.height-n.height),t.left=e.left+e.width;break;case"bottom":t.top=e.top+e.height,t.left=e.left+.5*(e.width-n.width);break;default:up.fail("Unknown position option '%s'",p.position)}return p.$tooltip.attr("up-position",p.position),
4
+ p.$tooltip.css(t)},a=function(t){var e;return e=f.$createElementFromSelector(".up-tooltip"),f.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),p.$tooltip=e},n=function(t,e){return null==e&&(e={}),o.asap(u,function(){return r(t,e)})},r=function(n,r){var o,i,u,l,c,h;return o=t(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),h=f.option(r.text,o.attr("up-tooltip")),c=f.option(r.position,o.attr("up-position"),s.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),s.openAnimation),i=up.motion.animateOptions(r,o,{duration:s.openDuration,easing:s.openEasing}),p.phase="opening",p.$anchor=o,a({text:h,html:l}),p.position=c,e(),up.animate(p.$tooltip,u,i).then(function(){return p.phase="opened"})},i=function(t){return o.asap(function(){return u(t)})},u=function(t){var e;return l()?(t=f.options(t,{animation:s.closeAnimation}),e=up.motion.animateOptions(t,{duration:s.closeDuration,easing:s.closeEasing}),f.assign(t,e),p.phase="closing",up.destroy(p.$tooltip,t).then(function(){return p.phase="closed",p.$tooltip=null,p.$anchor=null})):Promise.resolve()},l=function(){return"opening"===p.phase||"opened"===p.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseenter",function(){return n(t)}),t.on("mouseleave",function(){return i()})}),up.on("click up:action:consumed",function(t){return i()}),up.on("up:framework:reset",c),up.bus.onEscape(function(){return i()}),{config:s,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var t=[].slice;up.feedback=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d;return h=up.util,o=h.config({currentClasses:["up-current"]}),l=function(){return o.reset()},i=function(){var t;return t=o.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},n="up-active",r="a, [up-href]",a=function(t){return h.isPresent(t)?h.normalizeUrl(t,{stripTrailingSlash:!0}):void 0},c=function(t){var e,n,r,o,i,u,s,l,c,p;for(l=[],u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(e=u[n],c=h.presentAttr(t,e))for(p="up-alias"===e?c.split(" "):[c],r=0,i=p.length;i>r;r++)s=p[r],"#"!==s&&(s=a(s),l.push(s));return l},d=function(t){var e,n,r,o;return t=h.map(t,a),t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},s=function(){var t,n;return t=d([up.browser.url(),up.modal.url(),up.modal.coveredUrl(),up.popup.url(),up.popup.coveredUrl()]),n=i(),h.each(e(r),function(r){var o,i;return o=e(r),i=c(o),up.link.isSafe(o)&&t.matchesAny(i)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},u=function(t){var n;return n=e(t),n.is(r)&&(n=h.presence(n.parent(r))||n),n},p=function(){var e,r,o,i,s,a;return o=1<=arguments.length?t.call(arguments,0):[],i=o.shift(),r=o.pop(),s=h.options(o[0]),e=u(i),s.preload||e.addClass(n),r?(a=r(),h.isPromise(a)?h.always(a,function(){return f(e)}):up.warn("Expected block to return a promise, but got %o",a),a):void 0},f=function(t){var e;return e=u(t),e.removeClass(n)},up.on("up:fragment:inserted",function(){return s()}),up.on("up:fragment:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?s():void 0}),up.on("up:framework:reset",l),{config:o,start:p,stop:f}}(jQuery),up.renamedModule("navigation","feedback")}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;return e()&&up.link.isFollowable(t)?(i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)):void 0})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
@@ -379,7 +379,7 @@ up.dom = (($) ->
379
379
  swapPromises = []
380
380
  for step in extractSteps
381
381
  up.log.group 'Updating %s', step.selector, ->
382
- fixScripts(step.$new.get(0))
382
+ fixScripts(step.$new)
383
383
  swapPromise = swapElements(step.$old, step.$new, step.pseudoClass, step.transition, options)
384
384
  swapPromises.push(swapPromise)
385
385
  # When extracting multiple selectors, we only want to reveal the first element.
@@ -401,7 +401,16 @@ up.dom = (($) ->
401
401
  cascade = new up.ExtractCascade(selector, options)
402
402
  cascade.bestMatchingSteps()
403
403
 
404
- fixScripts = (element) ->
404
+ fixScripts = ($element) ->
405
+ # detectScriptFixes() both (1) iterates over element.children and
406
+ # (2) removes elements from that live array. This would cause calls to
407
+ # detectScriptFixes(undefined). Hence we collect all required deletions
408
+ # and replacements and execute them in one sweep when we're done iterating.
409
+ fixes = []
410
+ detectScriptFixes($element.get(0), fixes)
411
+ fix() for fix in fixes
412
+
413
+ detectScriptFixes = (element, fixes) ->
405
414
  # IE11 and Edge cannot find <noscript> tags with jQuery or querySelector() or getElementsByTagName()
406
415
  # when the tag was created by DOMParser. That's why we traverse the DOM manually.
407
416
  # https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12453464/
@@ -415,17 +424,17 @@ up.dom = (($) ->
415
424
  # work with <noscript> tags, such as lazysizes.
416
425
  # http://w3c.github.io/DOM-Parsing/#dom-domparser-parsefromstring
417
426
  clone.textContent = element.innerHTML
418
- element.parentNode.replaceChild(clone, element)
427
+ fixes.push -> element.parentNode.replaceChild(clone, element)
419
428
  else if element.tagName == 'SCRIPT'
420
429
  # We don't support the execution of <script> tags in new fragments.
421
430
  # This is a feature that we had in Unpoly once, but no one used it for years.
422
431
  # It's also tricky to implement since <script> tags created by DOMParser are
423
432
  # marked as non-executable.
424
433
  # http://w3c.github.io/DOM-Parsing/#dom-domparser-parsefromstring
425
- element.parentNode.removeChild(element)
434
+ fixes.push -> element.parentNode.removeChild(element)
426
435
  else
427
436
  for child in element.children
428
- fixScripts(child)
437
+ detectScriptFixes(child, fixes)
429
438
 
430
439
  parseResponseDoc = (html) ->
431
440
  # jQuery cannot construct transient elements that contain <html> or <body> tags
@@ -4,6 +4,6 @@ module Unpoly
4
4
  # The current version of the unpoly-rails gem.
5
5
  # This version number is also used for releases of the Unpoly
6
6
  # frontend code.
7
- VERSION = '0.51.0'
7
+ VERSION = '0.51.1'
8
8
  end
9
9
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unpoly",
3
- "version": "0.51.0",
3
+ "version": "0.51.1",
4
4
  "description": "Unobtrusive JavaScript framework",
5
5
  "main": "dist/unpoly.js",
6
6
  "files": [
@@ -784,6 +784,26 @@ describe 'up.dom', ->
784
784
  expect(window.scriptTagExecuted).not.toHaveBeenCalled()
785
785
  done()
786
786
 
787
+ it 'does not crash when the new fragment contains inline script tag that is followed by another sibling (bugfix)', (done) ->
788
+ @responseText = """
789
+ <div class="middle">
790
+ <div>new-middle-before</div>
791
+ <script type="text/javascript">
792
+ window.scriptTagExecuted()
793
+ </script>
794
+ <div>new-middle-after</div>
795
+ </div>
796
+ """
797
+
798
+ promise = up.replace('.middle', '/path')
799
+ @respond()
800
+
801
+ u.nextFrame ->
802
+ promiseState(promise).then (result) ->
803
+ expect(result.state).toEqual('fulfilled')
804
+ expect(window.scriptTagExecuted).not.toHaveBeenCalled()
805
+ done()
806
+
787
807
  describe 'linked scripts', ->
788
808
 
789
809
  beforeEach ->
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unpoly-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.51.0
4
+ version: 0.51.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails