capejs-rails 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7323d4e08d6718e87bb6905c472d8916e1e0e88a
4
- data.tar.gz: e1c05a7c8b2a365b4d8de071100bcffcae76a1d0
3
+ metadata.gz: 83a6a59a27ec619bb8d1dfb10e59171db1f6012e
4
+ data.tar.gz: d811e4affa1f63a08e89894de8b3c36036ef9ef8
5
5
  SHA512:
6
- metadata.gz: 353f711d43b01f17cfdd19c0743268f8ab17f0c238645315add3a284fd59425f1c3a0bae8f40df2b15adc0f966b199e978f36f68a92e51b15f21a3cec3be2e6e
7
- data.tar.gz: a633cdc91edf430c1543fc8818477f2f2d913184c3c9d2cd7506e5d3bd41db8b388b643ccfcae5df5e8c69b9cba317232425c9a5638d5e65fa030d605d409fbf
6
+ metadata.gz: c451ef7b574e8b5352d8a72a5250502bf06c95a766fb3b0bddacb1c850311800c9d6b698db6d0e239ae61210c1c689d7d702a047cab809d2eb7cbbfaed524b2e
7
+ data.tar.gz: 29ba6c4266c11a20a107dec54868f78c9c69f1b34571d7aa2778efb364303e7586bc7a197642af50f7d1721fd72d362d61c34d115f3b2939422b23b43aaad475
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # capejs-rails
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/capejs-rails.svg)](https://badge.fury.io/rb/capejs-rails)
4
+
3
5
  This gem wraps the [Cape.JS](https://github.com/oiax/capejs) for use in Rails 4.2 and above.
4
6
 
5
7
  ## Usage
@@ -8,14 +10,14 @@ Add the following to your Gemfile:
8
10
 
9
11
  ```ruby
10
12
  gem 'capejs-rails'
11
- gem 'sass-rails', github: 'rails/sass-rails', branch: 'master'
12
- gem 'sprockets-rails', github: 'rails/sprockets-rails', branch: 'master'
13
- gem 'sprockets', github: 'rails/sprockets', branch: 'master'
13
+ gem 'sass-rails', '~> 6.0.0.beta1'
14
+ gem 'sprockets', '~> 4.0.0.beta2'
15
+ gem 'sprockets-rails'
14
16
  gem 'babel-transpiler'
15
17
  ```
16
18
 
17
19
  Add the following directive to your `application.js`:
18
20
 
19
21
  ```javascript
20
- //= require capejs
22
+ //= require cape
21
23
  ```
@@ -4561,4 +4561,5 @@ process.chdir = function (dir) {
4561
4561
  process.umask = function() { return 0; };
4562
4562
 
4563
4563
  },{}]},{},[1])(1)
4564
- });
4564
+ });
4565
+ Cape.defaultAgentAdapter = 'rails';
@@ -1,6 +1,6 @@
1
1
  module CapeJS
2
2
  module Rails
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  CAPEJS_VERSION = '1.5.0'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capejs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsutomu Kuroda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -40,7 +40,6 @@ files:
40
40
  - LICENSE
41
41
  - README.md
42
42
  - app/assets/javascripts/cape.js
43
- - app/assets/javascripts/cape.min.js
44
43
  - lib/capejs-rails.rb
45
44
  - lib/capejs/rails.rb
46
45
  - lib/capejs/rails/engine.rb
@@ -1,3 +0,0 @@
1
- !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Cape=t()}}(function(){return function t(e,n,i){function r(o,a){if(!n[o]){if(!e[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var h=n[o]={exports:{}};e[o][0].call(h.exports,function(t){var n=e[o][1][t];return r(n?n:t)},h,h.exports,t,e,n,i)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(t,e,n){"use strict";var i=t("./cape/utilities");i.MarkupBuilder=t("./cape/markup_builder"),i.VirtualForms=t("./cape/virtual_forms"),i.Component=t("./cape/component.js"),i.Partial=t("./cape/partial.js"),i.DataStore=t("./cape/data_store.js"),i.AgentAdapters={},i.AgentAdapters.RailsAdapter=t("./cape/agent_adapters/rails_adapter.js"),i.ResourceAgent=t("./cape/resource_agent.js"),i.CollectionAgent=t("./cape/collection_agent.js"),i.RoutingMapper=t("./cape/routing_mapper.js"),i.Router=t("./cape/router.js"),i.defaultAgentAdapter=void 0,e.exports=i},{"./cape/agent_adapters/rails_adapter.js":2,"./cape/collection_agent.js":3,"./cape/component.js":4,"./cape/data_store.js":5,"./cape/markup_builder":6,"./cape/partial.js":11,"./cape/resource_agent.js":12,"./cape/router.js":13,"./cape/routing_mapper.js":14,"./cape/utilities":15,"./cape/virtual_forms":16}],2:[function(t,e,n){"use strict";function i(t,e,n){for(var i=document.getElementsByTagName("meta"),r=i.length-1;r>=0;r--)if("csrf-token"===i[r].getAttribute("name")){this.headers["X-CSRF-Token"]=i[r].getAttribute("content");break}}e.exports=i},{}],3:[function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=t("inflected"),s=(t("./utilities"),function(t,e){this._=new a(this),this.init(e),this.client=t,this.objects=[],this.data=void 0,this.headers={"Content-Type":"application/json"}});i(s.prototype,{init:function(t){t=t||{},this.resourceName=t.resourceName,this.basePath=t.basePath,this.nestedIn=t.nestedIn,this.shallow=t.shallow||!1,this.adapter=t.adapter,this.autoRefresh=t.autoRefresh,void 0===this.autoRefresh&&(this.autoRefresh=!0),this.dataType=t.dataType,this.paramName=t.paramName},refresh:function(){var t=this;this.index(this.paramsForRefresh(),function(e){t.data=e,t.refreshObjects(e),t.afterRefresh()})},paramsForRefresh:function(){return{}},refreshObjects:function(t){var e=this.paramName||r.tableize(this.resourceName);if(this.objects.length=0,"object"==typeof t&&Array.isArray(t[e]))for(var n=0;n<t[e].length;n++)this.objects.push(t[e][n])},afterRefresh:function(){this.client.refresh()},index:function(t,e,n){this.get("",null,t,e,n)},create:function(t,e,n){this.post("",null,t,e,n)},update:function(t,e,n,i){this.patch("",t,e,n,i)},destroy:function(t,e,n){this["delete"]("",t,{},e,n)},get:function(t,e,n,i,r){var s=e?this.memberPath(e):this.collectionPath();""!==t&&(s=s+"/"+t),this.ajax("GET",s,n,i,r)},head:function(t,e,n,i,r){var s=e?this.memberPath(e):this.collectionPath();""!==t&&(s=s+"/"+t),this.ajax("HEAD",s,n,i,r)},post:function(t,e,n,i,r){var s=e?this.memberPath(e):this.collectionPath();""!==t&&(s=s+"/"+t),this.ajax("POST",s,n,i,r)},patch:function(t,e,n,i,r){var s=e?this.memberPath(e):this.collectionPath();""!==t&&(s=s+"/"+t),this.ajax("PATCH",s,n,i,r)},put:function(t,e,n,i,r){var s=e?this.memberPath(e):this.collectionPath();""!==t&&(s=s+"/"+t),this.ajax("PUT",s,n,i,r)},"delete":function(t,e,n,i,r){var s=e?this.memberPath(e):this.collectionPath();""!==t&&(s=s+"/"+t),this.ajax("DELETE",s,n,i,r)},collectionPath:function(){var t=r.pluralize(r.underscore(this.resourceName));return this._.pathPrefix()+t},memberPath:function(t){var e=r.pluralize(r.underscore(this.resourceName));return this._.pathPrefix(this.shallow)+e+"/"+t},defaultErrorHandler:function(t){console.log(t)}});var o=t("./mixins/agent_common_methods");i(s.prototype,o);var a=function(t){this.main=t,this.components=[]},u=t("./mixins/agent_common_inner_methods");i(a.prototype,u),e.exports=s},{"./mixins/agent_common_inner_methods":7,"./mixins/agent_common_methods":8,"./utilities":15,inflected:22}],4:[function(t,e,n){(function(n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=t("virtual-dom"),s=(t("inflected"),t("./utilities")),o=function(){this.root=void 0,this.virtualForms=new s.VirtualForms(this),this._=new a(this)};i(o.prototype,{mount:function(t){if(void 0===t)throw new Error("The first argument is missing.");if("string"!=typeof t)throw new Error("The first argument must be a string.");if(this._.mounted)throw new Error("This component has been mounted already.");this._.mounted=!0,this.root=document.getElementById(t),this.root.data=this._.getElementData(this.root),this.init?this.init():this.refresh()},unmount:function(){if(!this._.mounted)throw new Error("This component has not been mounted yet.");for(this._.mounted=!1,this.beforeUnmount&&this.beforeUnmount();this.root.firstChild;)this.root.removeChild(this.root.firstChild);this.afterUnmount&&this.afterUnmount()},refresh:function(){var t,e,i,s;t=new n.Cape.MarkupBuilder(this),this.virtualForms.prepare(),this._.tree?(e=t.markup(this.render),i=r.diff(this._.tree,e),this.root=r.patch(this.root,i),this._.tree=e):(this._.tree=t.markup(this.render),s=r.create(this._.tree),this.root.parentNode.replaceChild(s,this.root),this.root=s),this.virtualForms.apply()},val:function(t,e){return 1===arguments.length?this.virtualForms.val(t):this.virtualForms.val(t,e)},setValues:function(t,e){this.virtualForms.setValues(t,e)},formData:function(t){return this.virtualForms.formData(t)},paramsFor:function(t,e){return this.virtualForms.paramsFor(t,e)},jsonFor:function(t,e){return this.virtualForms.jsonFor(t,e)},checkedOn:function(t){return this.virtualForms.checkedOn(t)}});var a=function(t){this.main=t,this.mounted=!1};i(a.prototype,{getElementData:function(t){var e,n={};return[].forEach.call(t.attributes,function(t){/^data-/.test(t.name)&&(e=t.name.substr(5).replace(/-(.)/g,function(t,e){return e.toUpperCase()}),n[e]=t.value)}),n}}),e.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utilities":15,inflected:22,"virtual-dom":36}],5:[function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=(t("./utilities"),function(t){this.options=t||{},this._=new o(this),"function"==typeof this.init&&this.init()});r.create=function(t){return this.instance||(this.instance=new this(t)),this.instance};var s=t("./mixins/propagator_methods");i(r.prototype,s);var o=function(t){this.main=t,this.components=[]};e.exports=r},{"./mixins/propagator_methods":10,"./utilities":15}],6:[function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=t("virtual-dom"),s=t("inflected"),o=t("./utilities"),a=function(t,e){this._=new u(this),this.component=t,e&&(this.formName=e.formName,this.selectBoxName=e.selectBoxName,this.fieldNamePrefix=e.fieldNamePrefix)};i(a.prototype,{markup:function(t){var e,n,i,r=this.component.root;if("function"!=typeof t)throw new Error("The first agument must be a function.");if(0===t.length)throw new Error("Callback requires an argument.");"form"==r.tagName&&(e=r.attributes.name),n=new a(this.component,{formName:e}),t.call(this.component,n),i={};for(var s=r.attributes.length;s--;)i[r.attributes[s].nodeName]=r.attributes[s].value;return this._.h(r.tagName,i,n._.elements)},elem:function(t){var e,n,i,r,s,o;if(e=Array.prototype.slice.call(arguments,1),i=this._.extractContent(e),n=this._.extractOptions(e),r=this._.extractCallback(e)){if(s=new a(this.component,{formName:this.formName,selectBoxName:this.selectBoxName,fieldNamePrefix:this.fieldNamePrefix}),0===r.length)throw new Error("Callback requires an argument.");r.call(this.component,s),o=this._.generateAttributes(n),this._.elements.push(this._.h(t,o,s._.elements))}else i=i||"",o=this._.generateAttributes(n),this._.elements.push(this._.h(t,o,i));return this},text:function(t){return this._.elements.push(t),this},space:function(){return this._.elements.push(" "),this},sp:function(){return this.space(),this},formFor:function(t){var e,n,i,t,r,s;if(e=Array.prototype.slice.call(arguments),n=this._.extractOptions(e)||{},i=this._.extractCallback(e),"function"!=typeof i)throw new Error("One of arguments must be a function.");if(0===i.length)throw new Error("Callback requires an argument.");return r=new a(this.component,{formName:t}),i.call(this.component,r),n=n||{},n.name=t,void 0===n.onsubmit&&void 0===this._.eventCallbacks.onsubmit&&(n.onsubmit=function(t){return!1}),s=this._.generateAttributes(n),this._.elements.push(this._.h("form",s,r._.elements)),this},fieldsFor:function(t){var e,n,i,r,s;if(e=Array.prototype.slice.call(arguments,1),n=this._.extractOptions(e)||{},i=this._.extractCallback(e),"function"!=typeof i)throw new Error("One of arguments must be a function.");if(0===i.length)throw new Error("Callback requires an argument.");return r=void 0!==this.fieldNamePrefix?this.fieldNamePrefix+"/"+t:t,void 0!==n.index&&(r=r+"/"+String(n.index)),s=new a(this.component,{formName:this.formName,fieldNamePrefix:r}),i.call(this.component,s),s._.elements.forEach(function(t){this._.elements.push(t)}.bind(this)),this},labelFor:function(t,e,n){return n=n||{},n.htmlFor=this._.elementIdFor(t),this.elem("label",e,n),this},hiddenField:function(t,e){return e=e||{},e.type="hidden",e.name=t,this._.inputField(e),this},textField:function(t,e){return e=e||{},e.type=e.type||"text",e.name=t,this._.inputField(e),this},passwordField:function(t,e){return e=e||{},e.type="password",e.name=t,this._.inputField(e),this},textareaField:function(t,e){var n,i;return t&&this.fieldNamePrefix&&(t=this.fieldNamePrefix+"/"+t),e=e||{},e.name=t,n=this.formName||"",this.component.virtualForms.update(n,e),i=s.dasherize(t.replace(/\//g,"_")),e.id||(this.formName?e.id=this.formName+"-field-"+i:e.id="field-"+i),this.elem("textarea","",e),this},checkBox:function(t,e){var n;return e=e||{},e.type="checkbox",t&&(e.name=t),e.value||(e.value="1"),n=e.name&&this.fieldNamePrefix?this.fieldNamePrefix+"/"+e.name:e.name,"[]"!==t.slice(-2)&&this._.elements.push(this._.h("input",i({},{name:n,type:"hidden",value:"0"}))),this._.inputField(e),this},radioButton:function(t,e,n){return n=n||{},n.type="radio",n.value=e,t&&(n.name=t),this._.inputField(n),this},selectBox:function(t){var e,n,i,r,s,o;if(e=Array.prototype.slice.call(arguments,1),n=this._.extractOptions(e)||{},i=this._.extractCallback(e),"function"!=typeof i)throw new Error("One of arguments must be a function.");if(0===i.length)throw new Error("Callback requires an argument.");return t&&this.fieldNamePrefix?n.name=this.fieldNamePrefix+"/"+t:n.name=t,n.id=n.id||this._.elementIdFor(t),r=new a(this.component,{formName:this.formName,selectBoxName:t}),i.call(this.component,r),n=n||{},s=this._.generateAttributes(n),o=this.formName||"",this.component.virtualForms.update(o,{name:t,value:n.value}),this._.elements.push(this._.h("select",s,r._.elements)),this},btn:function(){var t,e,n,i;return t=Array.prototype.slice.call(arguments),n=this._.extractContent(t),e=this._.extractOptions(t)||{},i=this._.extractCallback(t),e.type=e.type||"button",this.elem("button",n,e,i),this},attr:function(t,e){return"object"==typeof t?i(this._.attr,t):"string"==typeof t&&(this._.attr[t]=e),this},"class":function(t){return"object"==typeof t?i(this._.classNames,t):"string"==typeof t&&(this._.classNames[t]=!0),this},data:function(t,e){return"object"==typeof t?i(this._.data,t):"string"==typeof t&&(this._.data[t]=e),this},css:function(t,e){return"object"==typeof t?i(this._.style,t):"string"==typeof t&&(this._.style[t]=e),this},on:function(t,e){if("string"!=typeof t)throw new Error("The first agument must be a string.");this._.eventCallbacks["on"+t]=e},fa:function(t,e){e=e||{};var n=e["class"]||e.className;return n=n?n+" fa fa-"+t:"fa fa-"+t,e["class"]=n,this.i("",e),this}});var u=function(t){this.main=t,this.h=r.h,this.elements=[],this.classNames={},this.attr={},this.data={},this.style={},this.eventCallbacks={}};i(u.prototype,{inputField:function(t){var e,n;return t=t||{},void 0===t.id&&(t.id=this.elementIdFor(t.name),"radio"===t.type&&(t.id=t.id+"-"+String(t.value))),null===t.id&&delete t.id,t.name&&this.main.fieldNamePrefix&&(t.name=this.main.fieldNamePrefix+"/"+t.name),n=this.main.formName||"",this.main.component.virtualForms.update(n,t),e=this.generateAttributes(t),this.elements.push(this.h("input",e)),this},elementIdFor:function(t){var e;return e=this.main.fieldNamePrefix?s.dasherize(this.main.fieldNamePrefix.replace(/\//g,"-")+"-"+t):s.dasherize(t),this.main.formName?this.main.formName+"-field-"+e:"field-"+e},extractContent:function(t){return"string"==typeof t[0]?t[0]:void 0},extractOptions:function(t){for(var e=0;e<t.length;e++)if("object"==typeof t[e])return t[e]},extractCallback:function(t){for(var e=0;e<t.length;e++)if("function"==typeof t[e])return t[e]},generateAttributes:function(t){var e,n;t=t||{},t=i({},this.attr,t),this.attr={},"visible"in t&&!t.visible&&(t.style=t.style||{},t.style.display="none"),"class"in t&&(t.className=t["class"],delete t["class"]),"for"in t&&(t.htmlFor=t["for"],delete t["for"]),e=[];for(s in this.classNames)this.classNames.hasOwnProperty(s)&&this.classNames[s]&&e.push(s);if(this.classNames=[],"object"==typeof t.className)for(var r in t.className)t.className[r]&&e.push(r);else"string"==typeof t.className&&t.className.split(" ").forEach(function(t){e.push(t)});e.length?(e=e.filter(function(t,e,n){return n.indexOf(t)===e}),t.className=e.join(" ")):delete t.className,"data"in t&&(t.dataset=t.data,delete t.data),n=t.dataset||{},n=i({},this.data,n),this.data={},t.dataset=n,"object"==typeof t.style?t.style=i({},this.style,t.style):t.style=this.style,this.style={},o.merge(t,this.eventCallbacks),this.eventCallbacks={};for(var s in t)"function"==typeof t[s]&&(t[s]=t[s].bind(this.main.component));return t}});for(var c=["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","body","button","canvas","caption","cite","code","colgroup","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","html","i","iframe","ins","kbd","label","legend","li","main","map","mark","menu","menuitem","meter","nav","noscript","object","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","u","ul","var","video"],h=c.length;h--;){var l=c[h];a.prototype[l]=new Function("arg1","arg2","this.elem('"+l+"', arg1, arg2); return this")}for(var f=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],h=f.length;h--;){var l=f[h];a.prototype[l]=new Function("options","this.elem('"+l+"', options); return this")}for(var p=["checked","disabled"],h=p.length;h--;){var d=p[h];a.prototype[d]=new Function("value","this.attr('"+d+"', value); return this")}for(var m=["blur","focus","change","select","submit","reset","abort","error","load","unload","click","dblclick","keyup","keydown","keypress","mouseout","mouseover","mouseup","mousedown","mousemove"],h=m.length;h--;){var v=m[h];a.prototype["on"+v]=new Function("callback","this.on('"+v+"', callback); return this")}e.exports=a},{"./utilities":15,inflected:22,"virtual-dom":36}],7:[function(t,e,n){"use strict";var i=t("inflected"),r={applyAdapter:function(){var t,e;t=this.main.adapter||Cape.defaultAgentAdapter,"string"==typeof t&&(e=Cape.AgentAdapters[i.camelize(t)+"Adapter"],"function"==typeof e&&e.apply(this.main,arguments))},headers:function(){var t=this.main.headers;if(void 0===this.main.dataType)t.Accept="application/json, text/plain";else if("json"===this.main.dataType)t.Accept="application/json";else{if("text"!==this.main.dataType)throw new Error("Unsupported data type: "+this.main.dataType);t.Accept="text/plain"}return t},pathPrefix:function(t){var e=this.main.basePath||"/";return this.main.nestedIn&&!t&&(e+=this.main.nestedIn),e},responseHandler:function(){if(void 0===this.main.dataType)return function(t){return t.text()};if("json"===this.main.dataType)return function(t){return t.json()};if("text"===this.main.dataType)return function(t){return t.text()};throw new Error("Unsupported data type: "+this.main.dataType)},dataHandler:function(t,e){if(void 0===this.main.dataType)try{this.main.data=JSON.parse(t)}catch(n){this.main.data=t}else this.main.data=t;"function"==typeof e&&e.call(this.main.client,this.main.data)}};e.exports=r},{inflected:22}],8:[function(t,e,n){"use strict";var i=(t("inflected"),t("./check_status")),r={ajax:function(t,e,n,r,s){var o,a,u=this;if(n=n||{},s=s||this.defaultErrorHandler,this._.applyAdapter(),o="GET"===t||"HEAD"===t,a={method:t,headers:this._.headers(),credentials:"same-origin"},o){var c=[];for(var h in n)c.push(encodeURIComponent(h)+"="+encodeURIComponent(n[h]));c.length&&(e=e+"?"+c.join("&"))}else a.body=JSON.stringify(n);return fetch(e,a).then(i).then(this._.responseHandler()).then(function(t){u._.dataHandler(t,r),u.autoRefresh&&!o&&u.refresh()})["catch"](s),!1}};e.exports=r},{"./check_status":9,inflected:22}],9:[function(t,e,n){"use strict";function i(t){if(t.status>=200&&t.status<300)return t;var e=new Error(t.statusText);throw e.response=t,e}e.exports=i},{}],10:[function(t,e,n){"use strict";var i={attach:function(t){for(var e=0,n=this._.components.length;n>e;e++)if(this._.components[e]===t)return;this._.components.push(t)},detach:function(t){for(var e=0,n=this._.components.length;n>e;e++)if(this._.components[e]===t){this._.components.splice(e,1);break}},propagate:function(){for(var t=this._.components.length;t--;)this._.components[t].refresh()}};e.exports=i},{}],11:[function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=(t("./utilities"),function(t){this.parent=t,this.virtualForms=t.virtualForms});i(r.prototype,{refresh:function(){this.parent.refresh()},val:function(t,e){return 1===arguments.length?this.parent.val(t):this.parent.val(t,e)},setValues:function(t,e){this.virtualForms.setValues(t,e)},formData:function(t){return this.virtualForms.formData(t)},paramsFor:function(t,e){return this.virtualForms.paramsFor(t,e)},jsonFor:function(t,e){return this.virtualForms.jsonFor(t,e)},checkedOn:function(t){return this.virtualForms.checkedOn(t)}}),e.exports=r},{"./utilities":15}],12:[function(t,e,n){"use strict";function i(t,e){e=e||{},this._=new u(this),this.resourceName=e.resourceName,this.client=t,this.id=e.id,this.basePath=e.basePath,this.nestedIn=e.nestedIn,this.shallow=e.shallow||!1,this.adapter=e.adapter,this.autoRefresh=e.autoRefresh||!1,this.dataType=e.dataType,this.singular=e.singular||!1,this.formName=e.formName,this.paramName=e.paramName,this.object=void 0,this.data=void 0,this.errors={},this.headers={"Content-Type":"application/json"}}var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},s=t("inflected"),o=(t("./utilities"),t("./mixins/check_status"));r(i.prototype,{init:function(t,e){var n,i=this;n=this.singular?this.singularPath():this.id?this.memberPath():this.newPath(),e=e||this.defaultErrorHandler,this._.applyAdapter(),fetch(n,{headers:this._.headers(),credentials:"same-origin"}).then(o).then(this._.responseHandler()).then(function(e){i._.initialDataHandler(e,t)})["catch"](e)},refresh:function(){var t=this;this.show(function(e){t.data=e,t.afterRefresh()})},afterRefresh:function(){this.client.refresh()},show:function(t,e){this.ajax("GET",this.requestPath(),{},t,e)},create:function(t,e){var n=this.singular?this.singularPath():this.collectionPath(),i=this.client.paramsFor(this.formName||this.resourceName,{as:this.paramName||this.resourceName});return this.ajax("POST",n,i,t,e),!1},update:function(t,e){var n=this.singular?this.singularPath():this.memberPath(),i=this.client.paramsFor(this.formName||this.resourceName,{as:this.paramName||this.resourceName});return this.ajax("PATCH",n,i,t,e),!1},destroy:function(t,e){var n=this.singular?this.singularPath():this.memberPath();return this.ajax("DELETE",n,{},t,e),!1},get:function(t,e,n,i){var r=this.requestPath();""!==t&&(r=r+"/"+t),this.ajax("GET",r,e,n,i)},head:function(t,e,n,i){var r=this.requestPath();""!==t&&(r=r+"/"+t),this.ajax("HEAD",r,e,n,i)},post:function(t,e,n,i){var r=this.requestPath();""!==t&&(r=r+"/"+t),this.ajax("POST",r,e,n,i)},patch:function(t,e,n,i){var r=this.requestPath();""!==t&&(r=r+"/"+t),this.ajax("PATCH",r,e,n,i)},put:function(t,e,n,i){var r=this.requestPath();""!==t&&(r=r+"/"+t),this.ajax("PUT",r,e,n,i)},"delete":function(t,e,n,i){var r=this.requestPath();""!==t&&(r=r+"/"+t),this.ajax("DELETE",r,e,n,i)},requestPath:function(){return this.singular?this.singularPath():void 0===this.id?this.collectionPath():this.memberPath()},collectionPath:function(){var t=s.pluralize(s.underscore(this.resourceName));return this._.pathPrefix()+t},newPath:function(){var t=s.pluralize(s.underscore(this.resourceName));return this._.pathPrefix()+t+"/new"},memberPath:function(){var t=s.pluralize(s.underscore(this.resourceName));return this._.pathPrefix(this.shallow)+t+"/"+this.id},singularPath:function(){var t=s.underscore(this.resourceName);return this._.pathPrefix()+t},defaultErrorHandler:function(t){console.log(t)}});var a=t("./mixins/agent_common_methods");r(i.prototype,a);var u=function(t){this.main=t},c=t("./mixins/agent_common_inner_methods");r(u.prototype,c),r(u.prototype,{initialDataHandler:function(t,e){var n=this.main.formName||this.main.resourceName,i=this.main.paramName||this.main.resourceName;try{this.main.data=JSON.parse(t),this.main.object=this.main.data[i]||{}}catch(r){console.log("Could not parse the response data as JSON."),this.main.data=t}"function"==typeof e?e.call(this.main.client,this.main):this.main.object&&(this.main.client.setValues(n,this.main.object),this.main.client.refresh())}}),e.exports=i},{"./mixins/agent_common_inner_methods":7,"./mixins/agent_common_methods":8,"./mixins/check_status":9,"./utilities":15,inflected:22}],13:[function(t,e,n){(function(n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=t("inflected"),s=(t("./utilities"),function(t){this._=new o(this),this.rootContainer=t||window,this.routes=[],this.params={},this.query={},this.vars={},this.flash={},this.namespace=null,this.resource=null,this.action=null,this.container=null,this.component=null});i(s.prototype,{draw:function(t){var e;if("function"!=typeof t)throw new Error("The last argument must be a function.");if(0===t.length)throw new Error("Callback requires an argument.");e=new n.Cape.RoutingMapper(this),t(e)},mount:function(t){this._.targetElementId=t},start:function(){var t=this;window.addEventListener?window.addEventListener("hashchange",t._.eventListener,!1):window.attachEvent&&window.attachEvent("onhashchange",t._.eventListener),this.currentHash=window.location.href.split("#")[1]||"",this.navigate(this.currentHash)},stop:function(){var t=this;window.removeEventListener?window.removeEventListener("hashchange",t._.eventListener,!1):window.detachEvent&&window.detachEvent("onhashchange",t._.eventListener)},routeFor:function(t){var e,n,i;for(e=0,n=this.routes.length;n>e;e++)if(i=this.routes[e],t.match(i.regexp))return i;throw new Error("No route match. ["+t+"]")},navigateTo:function(t,e,n){var i,r,s,o,a=this;if(void 0!==e&&(t=this._.constructHash(e,t)),this._.currentHash=t,this._.setHash(t),n=n||{},this.flash.notice=n.notice,this.flash.alert=n.alert,this._.beforeNavigationCallbacks.length){for(i=[],r=new Promise(function(e,n){e(t)}),i.push(r),s=0,o=this._.beforeNavigationCallbacks.length;o>s;s++)r=r.then(this._.beforeNavigationCallbacks[s]),i.push(r);Promise.all(i).then(function(t){a._.mountComponent(t.pop())},a._.errorHandler)}else a._.mountComponent(t)},navigate:function(t,e){this.navigateTo(t,{},e)},redirectTo:function(t,e,n){var i=this;"object"==typeof e&&void 0===n&&(e.hasOwnProperty("notice")||e.hasOwnProperty("alert"))&&(n=e,e=void 0),void 0!==e&&(t=this._.constructHash(e,t)),this._.currentHash=t,this._.setHash(t),n=n||{},this.flash.notice=n.notice,this.flash.alert=n.alert,i._.mountComponent(t)},show:function(t,e){var n,i;if(this.query={},void 0!==e)for(n in e)this.query[n]=e[n];i=new t,i.mount(this._.targetElementId),this._.mountedComponentClass=t,this._.mountedComponent=i},attach:function(t){if(void 0===t)throw new Error("Missing listener.");if("function"!=typeof t.refresh)throw new Error('The listener must have the "refresh" function.');for(var e=0,n=this._.notificationListeners.length;n>e;e++)if(this._.notificationListeners[e]===t)return;this._.notificationListeners.push(t)},detach:function(t){for(var e=0,n=this._.notificationListeners.length;n>e;e++)if(this._.notificationListeners[e]===t){this._.notificationListeners.splice(e,1);break}},beforeNavigation:function(t){this._.beforeNavigationCallbacks.push(t)},errorHandler:function(t){this._.errorHandler=t},notify:function(){var t;for(t=this._.notificationListeners.length;t--;)this._.notificationListeners[t].refresh()}});var o=function(t){var e=this;this.main=t,this.eventListener=function(){var t=window.location.href.split("#")[1]||"";t!=e.currentHash&&e.main.navigate(t)},this.beforeNavigationCallbacks=[],this.notificationListeners=[],this.currentHash=null,this.mountedComponent=null,this.targetElementId=null};i(o.prototype,{mountComponent:function(t){var e,n,i;if("string"!=typeof t)throw new Error("The first argument must be a string.");e=this.main.routeFor(t),this.main.namespace=e.namespace,this.main.resource=e.resource,this.main.action=e.action,this.main.container=e.container,this.main.component=e.component,this.setParams(e),this.setQuery(e),n=this.getComponentClassFor(e),n===this.mountedComponentClass?this.main.notify():(this.mountedComponent&&this.mountedComponent.unmount(),this.main.notify(),i=new n,i.mount(this.targetElementId),this.mountedComponentClass=n,this.mountedComponent=i),this.main.flash={}},constructHash:function(t,e){var n,i;n=[];for(i in t)n.push(i+"="+t[i]);return n.length>0?e+"?"+n.join("&"):e},setHash:function(t){window.location.hash=t},setParams:function(t){var e=this.currentHash.match(t.regexp);this.main.params={},t.keys.forEach(function(t,n){this.main.params[t]=e[n+1]}.bind(this))},setQuery:function(t){var e,n;this.main.query={},e=this.currentHash.split("?")[1],void 0!==e&&(n=e.split("&"),n.forEach(function(t){var e=t.split("=");this.main.query[e[0]]=e[1]||""}.bind(this)))},getComponentClassFor:function(t){var e,n,i,s;for(e=[],t.container&&t.container.split(".").forEach(function(t){e.push(r.camelize(t))}),n=this.main.rootContainer,i=0;n&&i<e.length;i++)n=n[e[i]]?n[e[i]]:null;if(s=r.camelize(t.component),n&&n[s])return n[s];throw new Error("Component class "+e.concat([s]).join(".")+" is not defined.")}}),e.exports=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utilities":15,inflected:22}],14:[function(t,e,n){"use strict";function i(t,e){this._=new o(this),this.router=t,e&&(this.namespacePath=e.namespacePath,this.singular=e.singular,this.pathPrefix=e.pathPrefix,this.resourcePath=e.resourcePath,this.classNamePrefix=e.classNamePrefix,this.resourceClassName=e.resourceClassName)}var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},s=t("inflected");t("./utilities");r(i.prototype,{page:function(t,e,n,i){var r,s,o,a={};if(void 0===t)throw new Error("Missing hash pattern.");if(void 0===e){if(!t.match(/^\w+(\/\w+)*$/))throw new Error("Missing class name path.");e=t.replace("/",".")}i=i||{},this.pathPrefix&&(t=this.pathPrefix+"/"+t),a.path=t,a.keys=this._.extractKeys(t),a.regexp=this._.constructRegexp(t,n),r=this.classNamePrefix?this.classNamePrefix+"."+e:e,s=r.split("."),a.component=s.pop(),a.container=s.length?s.join("."):null,a.namespace=this.namespacePath||null,o=[],this.resourcePath&&o.push(this.resourcePath),i.resource&&o.push(i.resource),o.length?a.resource=o.join("/"):a.resource=null,a.action=i.action||null,this.router.routes.push(a)},root:function(t){this.page("",t)},many:function(t){var e,n,i;e=this._.extractOptions(arguments),n=this._.extractCallback(arguments),i=this._.getResourcePath(e.path||t),this._.addPagesForPluralResource(t,i,e),this._.executeCallback(n,t,i,!1)},one:function(t){var e,n,i;e=this._.extractOptions(arguments),n=this._.extractCallback(arguments),i=this._.getResourcePath(e.path||t),this._.addPagesForSingularResource(t,i,e),this._.executeCallback(n,t,i,!0)},collection:function(){var t;if(void 0===this.resourcePath||this.singular)throw new Error("The collection method must be called within a plural resource definition.");t=Array.prototype.slice.call(arguments,0),t.forEach(function(t){this.page(this.resourcePath+"/"+t,this.resourcePath+"."+t,{},{action:t})}.bind(this))},member:function(){var t;if(void 0===this.resourcePath||this.singular)throw new Error("The member method must be called within a plural resource definition.");t=Array.prototype.slice.call(arguments,0),t.forEach(function(t){this.page(this.resourcePath+"/:id/"+t,this.resourcePath+"."+t,{id:"\\d+"},{},{action:t})}.bind(this))},"new":function(){var t;if(void 0===this.resourcePath)throw new Error("The member method must be called within a resource definition.");t=Array.prototype.slice.call(arguments,0),t.forEach(function(t){this.page(this.resourcePath+"/new/"+t,this.resourcePath+"."+t,{},{action:t})}.bind(this))},view:function(){var t;if(void 0===this.resourcePath||!this.singular)throw new Error("The view method must be called within a singular resource definition.");t=Array.prototype.slice.call(arguments,0),t.forEach(function(t){this.page(this.resourcePath+"/"+t,this.resourcePath+"."+t,{},{action:t})}.bind(this))},namespace:function(t){var e,n,r,s,o;if(e=Array.prototype.slice.call(arguments,1),n=e.pop(),r=e.pop()||{},"function"!=typeof n)throw new Error("The last argument must be a function.");if(0===n.length)throw new Error("Callback requires an argument.");o=r.path||t,s=this.namespacePath?this.namespacePath+"/"+o:o,this.pathPrefix&&(o=this.pathPrefix+"/"+o),this.classNamePrefix&&(t=this.classNamePrefix+"."+t),n(new i(this.router,{namespacePath:s,pathPrefix:o,classNamePrefix:t}))}});var o=function(t){this.main=t};r(o.prototype,{extractKeys:function(t){var e,n=[];return t.split("/").forEach(function(t){(e=t.match(/^:(\w+)$/))&&n.push(e[1])}),n},constructRegexp:function(t,e){var n,i=[];return e=e||{},t.split("/").forEach(function(t){(n=t.match(/^:(\w+)$/))?e[n[1]]?i.push("("+e[n[1]]+")"):i.push("([^/]+)"):t.match(/^\w+$/)&&i.push(t)}),new RegExp("^"+i.join("/")+"(?:\\?[\\w-]+(?:=[\\w-]*)?(?:&[\\w-]+(?:=[\\w-]*)?)*)?$")},extractOptions:function(t){return"function"==typeof t[1]?{}:t[1]||{}},extractCallback:function(t){return"function"==typeof t[1]?t[1]:t[2]},filterActions:function(t,e){var n;e=e||{},
2
- "string"==typeof e.only&&(t.length=0,t.push(e.only)),Array.isArray(e.only)&&(t.length=0,e.only.forEach(function(e){t.push(e)})),"string"==typeof e.except&&(n=t.indexOf(e.except),-1!==n&&t.splice(n,1)),Array.isArray(e.except)&&e.except.forEach(function(e){n=t.indexOf(e),-1!==n&&t.splice(n,1)})},getResourcePath:function(t){return this.main.resourcePath&&(t=this.main.singular?this.main.resourcePath+"/"+t:this.main.resourcePath+"/:"+s.singularize(this.main.resourcePath)+"_id/"+t),t},addPagesForPluralResource:function(t,e,n){var i,r=["index","new","show","edit"];this.filterActions(r,n),n.pathNames=n.pathNames||{},-1!=r.indexOf("index")&&this.main.page(e,t+".list",{},{resource:t,action:"index"}),-1!=r.indexOf("new")&&(i=n.pathNames["new"]?n.pathNames["new"]:"new",this.main.page(e+"/"+i,t+".form",{},{resource:t,action:"new"})),-1!=r.indexOf("show")&&this.main.page(e+"/:id",t+".item",{id:"\\d+"},{resource:t,action:"show"}),-1!=r.indexOf("edit")&&(i=n.pathNames.edit?n.pathNames.edit:"edit",this.main.page(e+"/:id/"+i,t+".form",{id:"\\d+"},{resource:t,action:"edit"}))},addPagesForSingularResource:function(t,e,n){var i,r=["new","show","edit"];this.filterActions(r,n),n.pathNames=n.pathNames||{},-1!=r.indexOf("show")&&this.main.page(e,t+".content",{},{resource:t,action:"show"}),-1!=r.indexOf("new")&&(i=n.pathNames["new"]?n.pathNames["new"]:"new",this.main.page(e+"/"+i,t+".form",{},{resource:t,action:"new"})),-1!=r.indexOf("edit")&&(i=n.pathNames.edit?n.pathNames.edit:"edit",this.main.page(e+"/"+i,t+".form",{},{resource:t,action:"edit"}))},executeCallback:function(t,e,n,r){if("function"==typeof t){if(0===t.length)throw new Error("Callback requires an argument.");t(new i(this.main.router,{singular:r,pathPrefix:this.main.pathPrefix,resourcePath:n,classNamePrefix:this.main.classNamePrefix,resourceClassName:e}))}}}),e.exports=i},{"./utilities":15,inflected:22}],15:[function(t,e,n){(function(t){"use strict";var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},i={};i.extend=function(){var t,e;for(t=1;t<arguments.length;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&(arguments[0][e]=arguments[t][e]);return arguments[0]},i.deepExtend=function(){var e,n;for(e=1;e<arguments.length;e++)for(n in arguments[e])arguments[e].hasOwnProperty(n)&&("object"==typeof arguments[0][n]&&"object"==typeof arguments[e][n]?t.Cape.deepExtend(arguments[0][n],arguments[e][n]):arguments[0][n]=arguments[e][n]);return arguments[0]},i.merge=function(){var t,e;for(t=1;t<arguments.length;t++)for(e in arguments[t])!arguments[0].hasOwnProperty(e)&&arguments[t].hasOwnProperty(e)&&(arguments[0][e]=arguments[t][e]);return arguments[0]},i.createComponentClass=function(t){var e=function(){i.Component.apply(this,arguments),"function"==typeof t.constructor&&t.constructor.apply(this,arguments)};return n(e.prototype,i.Component.prototype,t),e},i.createPartialClass=function(t){var e=function(){i.Partial.apply(this,arguments),"function"==typeof t.constructor&&t.constructor.apply(this,arguments)};return n(e.prototype,i.Partial.prototype,t),e},i.createDataStoreClass=function(t){var e=function(){i.DataStore.apply(this,arguments),"function"==typeof t.constructor&&t.constructor.apply(this,arguments)};return n(e.prototype,i.DataStore.prototype,t),e.create=i.DataStore.create,e},i.createCollectionAgentClass=function(t){var e=function(){i.CollectionAgent.apply(this,arguments),"function"==typeof t.constructor&&t.constructor.apply(this,arguments),this._.applyAdapter()};return n(e.prototype,i.CollectionAgent.prototype,t),e},i.createResourceAgentClass=function(t){var e=function(){i.ResourceAgent.apply(this,arguments),"function"==typeof t.constructor&&t.constructor.apply(this,arguments),this._.applyAdapter()};return n(e.prototype,i.ResourceAgent.prototype,t),e},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],16:[function(t,e,n){(function(n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=t("./utilities"),s=function(t){this.component=t,this.items={},this._=new o(this)};i(s.prototype,{prepare:function(){this._.compile(),n.Cape.deepExtend(this._.realForms,this.items),this._.tempForms=n.Cape.deepExtend({},this._.realForms)},apply:function(){var t,e,n,i,r,s,o,a,u,c,h;for(t=this.component.root.getElementsByTagName("form"),e=0,n=t.length;n>e;e++)for(i=t[e],r=i.getAttribute("name")||"",s=this._.tempForms[r]||{},a=i.getElementsByTagName("*"),o=0;o<a.length;o++)if(u=a[o],void 0!==u.value&&void 0!==u.name&&("hidden"!==u.type||!a[o+1]||"checkbox"!==a[o+1].type))if(c=u.getAttribute("name"),"checkbox"===u.type)if("[]"===c.slice(-2)&&Array.isArray(s[c])){for(u.checked=!1,h=0;h<s[c].length;h++)if(u.value===s[c][h]){u.checked=!0;break}}else u.checked=s[c]===!0||"1"===s[c];else"radio"===u.type?u.checked=u.value===s[c]:u.value!==s[c]&&(u.value=s[c]?s[c]:"");this.items={},this._.compiled=!1},update:function(t,e){var n;n=this._.tempForms[t],void 0===n&&(n=this._.tempForms[t]={}),"checkbox"===e.type?void 0===n[e.name]&&(n[e.name]=!!e.checked):"radio"===e.type&&e.checked?void 0===n[e.name]&&(n[e.name]=e.value):e.value&&void 0===n[e.name]&&(n[e.name]=e.value)},val:function(t,e){var n,i,r;if("object"!=typeof t)return 1===arguments.length?this._.getValue(t):this._.setValue(t,e);for(n in t)if(t.hasOwnProperty(n))if(r=t[n],"object"==typeof r)for(i in r)r.hasOwnProperty(i)&&this._.setValue(n+"."+i,r[i]);else this._.setValue(n,r)},setValues:function(t,e){if("string"!=typeof t)throw new Error("The first argument must be a string.");if("object"!=typeof e)throw new Error("The second argument must be an object.");this.items[t]||(this.items[t]={}),this._.setValuesOfNestedFields(t,null,e)},formData:function(t){var e,n,i,r,s,o;this._.compile(),void 0===t&&(t=""),e=this._.realForms[t]||{},n={};for(i in e)r=i.split("/"),s=r.pop(),o=n,r.forEach(function(t){o[t]||(o[t]={}),o=o[t]}),"[]"===s.slice(-2)&&(s=s.slice(0,-2)),o[s]=e[i];return n},paramsFor:function(t,e){var n,i;return e=e||{},n=e.as||t,i={},i[n]=this.formData(t),i},jsonFor:function(t,e){var n,i,r;return e=e||{},n=e.as||t,i=this.formData(t),i=this._.object2array(i),r={},r[n]=i,JSON.stringify(r)},checkedOn:function(t){var e,n,i,r,s,o,a;e=this._.getNames(t),n=e[0],i=e[1],r=this.component.root.getElementsByTagName("form");for(var u=0;u<r.length;u++){s=r[u].getElementsByTagName("input");for(var c=0;c<s.length;c++)s[c].name===i&&"checkbox"===s[c].type&&(o=s[c])}return void 0!==o?(a=this._.getValue(t),"1"===a||a===!0):void 0}});var o=function(t){this.main=t,this.realForms={},this.tempForms={},this.compiled=!1};i(o.prototype,{getValue:function(t){var e,n,i;return e=this.getNames(t),n=e[0],i=e[1],n in this.main.items&&i in this.main.items[n]?this.main.items[n][i]:(this.compiled||this.compile(),n in this.realForms&&i in this.realForms[n]?this.realForms[n][i]:"")},setValue:function(t,e){var n,i,r,s;return n=this.getNames(t),i=n[0],r=n[1],s=this.getValue(t),this.main.items[i]||(this.main.items[i]={}),this.main.items[i][r]=e,s},setValuesOfNestedFields:function(t,e,n){var i,r,s;for(r in n)i=e?e+"/"+r:r,"[]"===r.slice(-2)?Array.isArray(n[r])&&(this.main.items[t][i]=n[r]):Array.isArray(n[r])?(s=this,n[r].forEach(function(e,n){s.setValuesOfNestedFields(t,i+"/"+n,e)})):"object"==typeof n[r]?this.setValuesOfNestedFields(t,i,n[r]):this.main.items[t][i]=n[r]},compile:function(){var t,e,n,i,r,s;for(this.realForms={},t=this.main.component.root.getElementsByTagName("form"),n=0;n<t.length;n++){for(e=t[n].getElementsByTagName("*"),s={},i=0;i<e.length;i++)r=e[i],r.name&&void 0!==r.value&&!r.disabled&&("checkbox"===r.type?"[]"===r.name.slice(-2)?(Array.isArray(s[r.name])||(s[r.name]=[]),r.checked&&s[r.name].push(r.value)):r.checked&&(s[r.name]=r.value):"radio"===r.type?r.checked&&(s[r.name]=r.value):s[r.name]=r.value);t[n].getAttribute("name")?this.realForms[t[n].getAttribute("name")]=s:this.realForms[""]=s}this.compiled=!0},getNames:function(t){return"string"==typeof t&&t.indexOf(".")>=0?t.split(".",2):["",t]},object2array:function(t){var e,n,i=!0,s=[];e=r.deepExtend({},t);for(n in e)0===n.length||n.match(/\D/)?(i=!1,"object"==typeof t[n]&&(t[n]=this.object2array(e[n]))):"object"==typeof t[n]?s.push(this.object2array(e[n])):s.push(t[n]);return i?s:t}}),e.exports=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utilities":15}],17:[function(t,e,n){e.exports=function(t){var e,n=String.prototype.split,i=/()??/.exec("")[1]===t;return e=function(e,r,s){if("[object RegExp]"!==Object.prototype.toString.call(r))return n.call(e,r,s);var o,a,u,c,h=[],l=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),f=0,r=new RegExp(r.source,l+"g");for(e+="",i||(o=new RegExp("^"+r.source+"$(?!\\s)",l)),s=s===t?-1>>>0:s>>>0;(a=r.exec(e))&&(u=a.index+a[0].length,!(u>f&&(h.push(e.slice(f,a.index)),!i&&a.length>1&&a[0].replace(o,function(){for(var e=1;e<arguments.length-2;e++)arguments[e]===t&&(a[e]=t)}),a.length>1&&a.index<e.length&&Array.prototype.push.apply(h,a.slice(1)),c=a[0].length,f=u,h.length>=s)));)r.lastIndex===a.index&&r.lastIndex++;return f===e.length?!c&&r.test("")||h.push(""):h.push(e.slice(f)),h.length>s?h.slice(0,s):h}}()},{}],18:[function(t,e,n){"use strict";function i(t){var e=t[o];return e||(e=t[o]={}),e}var r=t("individual/one-version"),s="7";r("ev-store",s);var o="__EV_STORE_KEY@"+s;e.exports=i},{"individual/one-version":21}],19:[function(t,e,n){(function(n){var i="undefined"!=typeof n?n:"undefined"!=typeof window?window:{},r=t("min-document");if("undefined"!=typeof document)e.exports=document;else{var s=i["__GLOBAL_DOCUMENT_CACHE@4"];s||(s=i["__GLOBAL_DOCUMENT_CACHE@4"]=r),e.exports=s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"min-document":61}],20:[function(t,e,n){(function(t){"use strict";function n(t,e){return t in i?i[t]:(i[t]=e,e)}var i="undefined"!=typeof window?window:"undefined"!=typeof t?t:{};e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(t,e,n){"use strict";function i(t,e,n){var i="__INDIVIDUAL_ONE_VERSION_"+t,s=i+"_ENFORCE_SINGLETON",o=r(s,e);if(o!==e)throw new Error("Can only have one copy of "+t+".\nYou already have version "+o+" installed.\nThis means you cannot install version "+e);return r(i,n)}var r=t("./index.js");e.exports=i},{"./index.js":20}],22:[function(t,e,n){"use strict";e.exports=t("./lib/Inflector")},{"./lib/Inflector":24}],23:[function(t,e,n){(function(n,i){"use strict";function r(){this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[],this.acronyms={},this.acronymRegex=/(?=a)b/}var s=t("./hasProp"),o=t("./remove"),a=t("./icPart");r.getInstance=function(t){var e="undefined"!=typeof n?n:i;return e.__Inflector_Inflections=e.__Inflector_Inflections||{},e.__Inflector_Inflections[t]=e.__Inflector_Inflections[t]||new r,e.__Inflector_Inflections[t]},r.prototype.acronym=function(t){this.acronyms[t.toLowerCase()]=t;var e=[];for(var n in this.acronyms)s(this.acronyms,n)&&e.push(this.acronyms[n]);this.acronymRegex=new RegExp(e.join("|"))},r.prototype.plural=function(t,e){"string"==typeof t&&o(this.uncountables,t),o(this.uncountables,e),this.plurals.unshift([t,e])},r.prototype.singular=function(t,e){"string"==typeof t&&o(this.uncountables,t),o(this.uncountables,e),this.singulars.unshift([t,e])},r.prototype.irregular=function(t,e){o(this.uncountables,t),o(this.uncountables,e);var n=t[0],i=t.substr(1),r=e[0],s=e.substr(1);if(n.toUpperCase()===r.toUpperCase())this.plural(new RegExp("("+n+")"+i+"$","i"),"$1"+s),this.plural(new RegExp("("+r+")"+s+"$","i"),"$1"+s),this.singular(new RegExp("("+n+")"+i+"$","i"),"$1"+i),this.singular(new RegExp("("+r+")"+s+"$","i"),"$1"+i);else{var u=a(i),c=a(s);this.plural(new RegExp(n.toUpperCase()+u+"$"),r.toUpperCase()+s),this.plural(new RegExp(n.toLowerCase()+u+"$"),r.toLowerCase()+s),this.plural(new RegExp(r.toUpperCase()+c+"$"),r.toUpperCase()+s),this.plural(new RegExp(r.toLowerCase()+c+"$"),r.toLowerCase()+s),this.singular(new RegExp(n.toUpperCase()+u+"$"),n.toUpperCase()+i),this.singular(new RegExp(n.toLowerCase()+u+"$"),n.toLowerCase()+i),this.singular(new RegExp(r.toUpperCase()+c+"$"),n.toUpperCase()+i),this.singular(new RegExp(r.toLowerCase()+c+"$"),n.toLowerCase()+i)}},r.prototype.uncountable=function(){var t=Array.prototype.slice.call(arguments,0);this.uncountables=this.uncountables.concat(t)},r.prototype.human=function(t,e){this.humans.unshift([t,e])},r.prototype.clear=function(t){t=t||"all","all"===t?(this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[]):this[t]=[]},e.exports=r}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./hasProp":28,"./icPart":29,"./remove":31,_process:62}],24:[function(t,e,n){"use strict";var i=t("./Inflections"),r=t("./Transliterator"),s=t("./Methods"),o=t("./defaults"),a=t("./isFunc"),u=s;u.inflections=function(t,e){return a(t)&&(e=t,t=null),t=t||"en",e?void e(i.getInstance(t)):i.getInstance(t)},u.transliterations=function(t,e){return a(t)&&(e=t,t=null),t=t||"en",e?void e(r.getInstance(t)):r.getInstance(t)};for(var c in o)u.inflections(c,o[c]);e.exports=u},{"./Inflections":23,"./Methods":25,"./Transliterator":26,"./defaults":27,"./isFunc":30}],25:[function(t,e,n){"use strict";var i={pluralize:function(t,e){return e=e||"en",this._applyInflections(t,this.inflections(e).plurals)},singularize:function(t,e){return e=e||"en",this._applyInflections(t,this.inflections(e).singulars)},camelize:function(t,e){null!==e&&void 0!==e||(e=!0);var n=""+t,i=this;return n=e?n.replace(/^[a-z\d]*/,function(t){return i.inflections().acronyms[t]||i.capitalize(t)}):n.replace(new RegExp("^(?:"+this.inflections().acronymRegex.source+"(?=\\b|[A-Z_])|\\w)"),function(t){return t.toLowerCase()}),n=n.replace(/(?:_|(\/))([a-z\d]*)/gi,function(t,e,n,r,s){return e||(e=""),""+e+(i.inflections().acronyms[n]||i.capitalize(n))})},underscore:function(t){var e=""+t;return e=e.replace(new RegExp("(?:([A-Za-z\\d])|^)("+this.inflections().acronymRegex.source+")(?=\\b|[^a-z])","g"),function(t,e,n){return""+(e||"")+(e?"_":"")+n.toLowerCase()}),e=e.replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2"),e=e.replace(/([a-z\d])([A-Z])/g,"$1_$2"),e=e.replace(/-/g,"_"),e.toLowerCase()},humanize:function(t,e){var n,i,r,s=""+t,o=this.inflections().humans,a=this;e=e||{},null!==e.capitalize&&void 0!==e.capitalize||(e.capitalize=!0);for(var u=0,c=o.length;c>u;u++)if(n=o[u],i=n[0],r=n[1],i.test&&i.test(s)||s.indexOf(i)>-1){s=s.replace(i,r);break}return s=s.replace(/_id$/,""),s=s.replace(/_/g," "),s=s.replace(/([a-z\d]*)/gi,function(t){return a.inflections().acronyms[t]||t.toLowerCase()}),e.capitalize&&(s=s.replace(/^\w/,function(t){return t.toUpperCase()})),s},capitalize:function(t){var e=null===t||void 0===t?"":String(t);return e.charAt(0).toUpperCase()+e.slice(1)},titleize:function(t){return this.humanize(this.underscore(t)).replace(/(^|[\s¿\/]+)([a-z])/g,function(t,e,n,i,r){return t.replace(n,n.toUpperCase())})},tableize:function(t){return this.pluralize(this.underscore(t))},classify:function(t){return this.camelize(this.singularize(t.replace(/.*\./g,"")))},dasherize:function(t){return t.replace(/_/g,"-")},foreignKey:function(t,e){return null!==e&&void 0!==e||(e=!0),this.underscore(t)+(e?"_id":"id")},ordinal:function(t){var e=Math.abs(Number(t)),n=e%100;if(11===n||12===n||13===n)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},ordinalize:function(t){return""+t+this.ordinal(t)},transliterate:function(t,e){e=e||{};var n=e.locale||"en",i=e.replacement||"?";return this.transliterations(n).transliterate(t,i)},parameterize:function(t,e){e=e||{},void 0===e.separator&&(e.separator="-"),null===e.separator&&(e.separator="");var n=this.transliterate(t,e);if(n=n.replace(/[^a-z0-9\-_]+/gi,e.separator),e.separator.length){var i=new RegExp(e.separator);n=n.replace(new RegExp(i.source+"{2,}"),e.separator),n=n.replace(new RegExp("^"+i.source+"|"+i.source+"$","i"),"")}return n.toLowerCase()},_applyInflections:function(t,e){var n,i,r,s=""+t;if(0===s.length)return s;var o=s.toLowerCase().match(/\b\w+$/);if(o&&this.inflections().uncountables.indexOf(o[0])>-1)return s;for(var a=0,u=e.length;u>a;a++)if(n=e[a],i=n[0],r=n[1],s.match(i)){s=s.replace(i,r);break}return s}};e.exports=i},{}],26:[function(t,e,n){(function(t,n){"use strict";function i(){this.approximations={};for(var t in r)this.approximate(t,r[t])}var r={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","×":"x","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"Th","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"'n","Ŋ":"NG","ŋ":"ng","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z"},s="?";i.getInstance=function(e){var r="undefined"!=typeof t?t:n;return r.__Inflector_Transliterator=r.__Inflector_Transliterator||{},r.__Inflector_Transliterator[e]=r.__Inflector_Transliterator[e]||new i,r.__Inflector_Transliterator[e]},i.prototype.approximate=function(t,e){this.approximations[t]=e},i.prototype.transliterate=function(t,e){var n=this;return t.replace(/[^\u0000-\u007f]/g,function(t){return n.approximations[t]||e||s})},e.exports=i}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:62}],27:[function(t,e,n){"use strict";function i(t){t.plural(/$/,"s"),t.plural(/s$/i,"s"),t.plural(/^(ax|test)is$/i,"$1es"),t.plural(/(octop|vir)us$/i,"$1i"),t.plural(/(octop|vir)i$/i,"$1i"),t.plural(/(alias|status)$/i,"$1es"),t.plural(/(bu)s$/i,"$1ses"),t.plural(/(buffal|tomat)o$/i,"$1oes"),t.plural(/([ti])um$/i,"$1a"),t.plural(/([ti])a$/i,"$1a"),t.plural(/sis$/i,"ses"),t.plural(/(?:([^f])fe|([lr])f)$/i,"$1$2ves"),t.plural(/(hive)$/i,"$1s"),t.plural(/([^aeiouy]|qu)y$/i,"$1ies"),t.plural(/(x|ch|ss|sh)$/i,"$1es"),t.plural(/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"),t.plural(/^(m|l)ouse$/i,"$1ice"),t.plural(/^(m|l)ice$/i,"$1ice"),t.plural(/^(ox)$/i,"$1en"),t.plural(/^(oxen)$/i,"$1"),t.plural(/(quiz)$/i,"$1zes"),t.singular(/s$/i,""),t.singular(/(ss)$/i,"$1"),t.singular(/(n)ews$/i,"$1ews"),t.singular(/([ti])a$/i,"$1um"),t.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"),t.singular(/(^analy)(sis|ses)$/i,"$1sis"),t.singular(/([^f])ves$/i,"$1fe"),t.singular(/(hive)s$/i,"$1"),t.singular(/(tive)s$/i,"$1"),t.singular(/([lr])ves$/i,"$1f"),t.singular(/([^aeiouy]|qu)ies$/i,"$1y"),t.singular(/(s)eries$/i,"$1eries"),t.singular(/(m)ovies$/i,"$1ovie"),t.singular(/(x|ch|ss|sh)es$/i,"$1"),t.singular(/^(m|l)ice$/i,"$1ouse"),t.singular(/(bus)(es)?$/i,"$1"),t.singular(/(o)es$/i,"$1"),t.singular(/(shoe)s$/i,"$1"),t.singular(/(cris|test)(is|es)$/i,"$1is"),t.singular(/^(a)x[ie]s$/i,"$1xis"),t.singular(/(octop|vir)(us|i)$/i,"$1us"),t.singular(/(alias|status)(es)?$/i,"$1"),t.singular(/^(ox)en/i,"$1"),t.singular(/(vert|ind)ices$/i,"$1ex"),t.singular(/(matr)ices$/i,"$1ix"),t.singular(/(quiz)zes$/i,"$1"),t.singular(/(database)s$/i,"$1"),t.irregular("person","people"),t.irregular("man","men"),t.irregular("child","children"),t.irregular("sex","sexes"),t.irregular("move","moves"),t.irregular("zombie","zombies"),t.uncountable("equipment","information","rice","money","species","series","fish","sheep","jeans","police")}e.exports={en:i}},{}],28:[function(t,e,n){"use strict";function i(t,e){return r.call(t,e)}var r=Object.prototype.hasOwnProperty;e.exports=i},{}],29:[function(t,e,n){"use strict";function i(t){return t.split("").map(function(t){return"(?:"+[t.toUpperCase(),t.toLowerCase()].join("|")+")"}).join("")}e.exports=i},{}],30:[function(t,e,n){"use strict";function i(t){return"[object Function]"===r.call(t)}var r=Object.prototype.toString;e.exports=i},{}],31:[function(t,e,n){"use strict";function i(t,e){for(var n=t.length-1;n>=0;n--)t[n]===e&&r.call(t,n,1)}var r=Array.prototype.splice;e.exports=i},{}],32:[function(t,e,n){"use strict";e.exports=function(t){return"object"==typeof t&&null!==t}},{}],33:[function(t,e,n){var i=t("./vdom/create-element.js");e.exports=i},{"./vdom/create-element.js":39}],34:[function(t,e,n){var i=t("./vtree/diff.js");e.exports=i},{"./vtree/diff.js":59}],35:[function(t,e,n){var i=t("./virtual-hyperscript/index.js");e.exports=i},{"./virtual-hyperscript/index.js":46}],36:[function(t,e,n){var i=t("./diff.js"),r=t("./patch.js"),s=t("./h.js"),o=t("./create-element.js"),a=t("./vnode/vnode.js"),u=t("./vnode/vtext.js");e.exports={diff:i,patch:r,h:s,create:o,VNode:a,VText:u}},{"./create-element.js":33,"./diff.js":34,"./h.js":35,"./patch.js":37,"./vnode/vnode.js":55,"./vnode/vtext.js":57}],37:[function(t,e,n){var i=t("./vdom/patch.js");e.exports=i},{"./vdom/patch.js":42}],38:[function(t,e,n){function i(t,e,n){for(var i in e){var o=e[i];void 0===o?r(t,i,o,n):u(o)?(r(t,i,o,n),o.hook&&o.hook(t,i,n?n[i]:void 0)):a(o)?s(t,e,n,i,o):t[i]=o}}function r(t,e,n,i){if(i){var r=i[e];if(u(r))r.unhook&&r.unhook(t,e,n);else if("attributes"===e)for(var s in r)t.removeAttribute(s);else if("style"===e)for(var o in r)t.style[o]="";else"string"==typeof r?t[e]="":t[e]=null}}function s(t,e,n,i,r){var s=n?n[i]:void 0;if("attributes"!==i){if(s&&a(s)&&o(s)!==o(r))return void(t[i]=r);a(t[i])||(t[i]={});var u="style"===i?"":void 0;for(var c in r){var h=r[c];t[i][c]=void 0===h?u:h}}else for(var l in r){var f=r[l];void 0===f?t.removeAttribute(l):t.setAttribute(l,f)}}function o(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__?t.__proto__:t.constructor?t.constructor.prototype:void 0}var a=t("is-object"),u=t("../vnode/is-vhook.js");e.exports=i},{"../vnode/is-vhook.js":50,"is-object":32}],39:[function(t,e,n){function i(t,e){var n=e?e.document||r:r,h=e?e.warn:null;if(t=c(t).a,u(t))return t.init();if(a(t))return n.createTextNode(t.text);if(!o(t))return h&&h("Item is not a valid virtual dom node",t),null;var l=null===t.namespace?n.createElement(t.tagName):n.createElementNS(t.namespace,t.tagName),f=t.properties;s(l,f);for(var p=t.children,d=0;d<p.length;d++){var m=i(p[d],e);m&&l.appendChild(m)}return l}var r=t("global/document"),s=t("./apply-properties"),o=t("../vnode/is-vnode.js"),a=t("../vnode/is-vtext.js"),u=t("../vnode/is-widget.js"),c=t("../vnode/handle-thunk.js");e.exports=i},{"../vnode/handle-thunk.js":48,"../vnode/is-vnode.js":51,"../vnode/is-vtext.js":52,"../vnode/is-widget.js":53,"./apply-properties":38,"global/document":19}],40:[function(t,e,n){function i(t,e,n,i){return n&&0!==n.length?(n.sort(o),r(t,e,n,i,0)):{}}function r(t,e,n,i,o){if(i=i||{},t){s(n,o,o)&&(i[o]=t);var u=e.children;if(u)for(var c=t.childNodes,h=0;h<e.children.length;h++){o+=1;var l=u[h]||a,f=o+(l.count||0);s(n,o,f)&&r(c[h],l,n,i,o),o=f}}return i}function s(t,e,n){if(0===t.length)return!1;for(var i,r,s=0,o=t.length-1;o>=s;){if(i=(o+s)/2>>0,r=t[i],s===o)return r>=e&&n>=r;if(e>r)s=i+1;else{if(!(r>n))return!0;o=i-1}}return!1}function o(t,e){return t>e?1:-1}var a={};e.exports=i},{}],41:[function(t,e,n){function i(t,e,n){var i=t.type,c=t.vNode,p=t.patch;switch(i){case d.REMOVE:return r(e,c);case d.INSERT:return s(e,p,n);case d.VTEXT:return o(e,c,p,n);case d.WIDGET:return a(e,c,p,n);case d.VNODE:return u(e,c,p,n);case d.ORDER:return h(e,p),e;case d.PROPS:return f(e,p,c.properties),e;case d.THUNK:return l(e,n.patch(e,p,n));default:return e}}function r(t,e){var n=t.parentNode;return n&&n.removeChild(t),c(t,e),null}function s(t,e,n){var i=n.render(e,n);return t&&t.appendChild(i),t}function o(t,e,n,i){var r;if(3===t.nodeType)t.replaceData(0,t.length,n.text),r=t;else{var s=t.parentNode;r=i.render(n,i),s&&r!==t&&s.replaceChild(r,t)}return r}function a(t,e,n,i){var r,s=m(e,n);r=s?n.update(e,t)||t:i.render(n,i);var o=t.parentNode;return o&&r!==t&&o.replaceChild(r,t),s||c(t,e),r}function u(t,e,n,i){var r=t.parentNode,s=i.render(n,i);return r&&s!==t&&r.replaceChild(s,t),s}function c(t,e){"function"==typeof e.destroy&&p(e)&&e.destroy(t)}function h(t,e){for(var n,i,r,s=t.childNodes,o={},a=0;a<e.removes.length;a++)i=e.removes[a],n=s[i.from],i.key&&(o[i.key]=n),t.removeChild(n);for(var u=s.length,c=0;c<e.inserts.length;c++)r=e.inserts[c],n=o[r.key],t.insertBefore(n,r.to>=u++?null:s[r.to])}function l(t,e){return t&&e&&t!==e&&t.parentNode&&t.parentNode.replaceChild(e,t),e}var f=t("./apply-properties"),p=t("../vnode/is-widget.js"),d=t("../vnode/vpatch.js"),m=t("./update-widget");e.exports=i},{"../vnode/is-widget.js":53,"../vnode/vpatch.js":56,"./apply-properties":38,"./update-widget":43}],42:[function(t,e,n){function i(t,e,n){return n=n||{},n.patch=n.patch&&n.patch!==i?n.patch:r,n.render=n.render||c,n.patch(t,e,n)}function r(t,e,n){var i=o(e);if(0===i.length)return t;var r=h(t,e.a,i),u=t.ownerDocument;n.document||u===a||(n.document=u);for(var c=0;c<i.length;c++){var l=i[c];t=s(t,r[l],e[l],n)}return t}function s(t,e,n,i){if(!e)return t;var r;if(u(n))for(var s=0;s<n.length;s++)r=l(n[s],e,i),e===t&&(t=r);else r=l(n,e,i),e===t&&(t=r);return t}function o(t){var e=[];for(var n in t)"a"!==n&&e.push(Number(n));return e}var a=t("global/document"),u=t("x-is-array"),c=t("./create-element"),h=t("./dom-index"),l=t("./patch-op");e.exports=i},{"./create-element":39,"./dom-index":40,"./patch-op":41,"global/document":19,"x-is-array":60}],43:[function(t,e,n){function i(t,e){return r(t)&&r(e)?"name"in t&&"name"in e?t.id===e.id:t.init===e.init:!1}var r=t("../vnode/is-widget.js");e.exports=i},{"../vnode/is-widget.js":53}],44:[function(t,e,n){"use strict";function i(t){return this instanceof i?void(this.value=t):new i(t)}var r=t("ev-store");e.exports=i,i.prototype.hook=function(t,e){var n=r(t),i=e.substr(3);n[i]=this.value},i.prototype.unhook=function(t,e){var n=r(t),i=e.substr(3);n[i]=void 0}},{"ev-store":18}],45:[function(t,e,n){"use strict";function i(t){return this instanceof i?void(this.value=t):new i(t)}e.exports=i,i.prototype.hook=function(t,e){t[e]!==this.value&&(t[e]=this.value)}},{}],46:[function(t,e,n){"use strict";function i(t,e,n){var i,o,u,c,h=[];return!n&&a(e)&&(n=e,o={}),o=o||e||{},i=y(t,o),o.hasOwnProperty("key")&&(u=o.key,o.key=void 0),o.hasOwnProperty("namespace")&&(c=o.namespace,o.namespace=void 0),"INPUT"!==i||c||!o.hasOwnProperty("value")||void 0===o.value||v(o.value)||(o.value=w(o.value)),s(o),void 0!==n&&null!==n&&r(n,h,i,o),new l(i,o,h,u,c)}function r(t,e,n,i){if("string"==typeof t)e.push(new f(t));else if("number"==typeof t)e.push(new f(String(t)));else if(o(t))e.push(t);else{if(!h(t)){if(null===t||void 0===t)return;throw u({foreignObject:t,parentVnode:{tagName:n,properties:i}})}for(var s=0;s<t.length;s++)r(t[s],e,n,i)}}function s(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(v(n))continue;"ev-"===e.substr(0,3)&&(t[e]=x(n))}}function o(t){return p(t)||d(t)||m(t)||g(t)}function a(t){return"string"==typeof t||h(t)||o(t)}function u(t){var e=new Error;return e.type="virtual-hyperscript.unexpected.virtual-element",e.message="Unexpected virtual child passed to h().\nExpected a VNode / Vthunk / VWidget / string but:\ngot:\n"+c(t.foreignObject)+".\nThe parent vnode is:\n"+c(t.parentVnode),e.foreignObject=t.foreignObject,e.parentVnode=t.parentVnode,e}function c(t){try{return JSON.stringify(t,null," ")}catch(e){return String(t)}}var h=t("x-is-array"),l=t("../vnode/vnode.js"),f=t("../vnode/vtext.js"),p=t("../vnode/is-vnode"),d=t("../vnode/is-vtext"),m=t("../vnode/is-widget"),v=t("../vnode/is-vhook"),g=t("../vnode/is-thunk"),y=t("./parse-tag.js"),w=t("./hooks/soft-set-hook.js"),x=t("./hooks/ev-hook.js");e.exports=i},{"../vnode/is-thunk":49,"../vnode/is-vhook":50,"../vnode/is-vnode":51,"../vnode/is-vtext":52,"../vnode/is-widget":53,"../vnode/vnode.js":55,"../vnode/vtext.js":57,"./hooks/ev-hook.js":44,"./hooks/soft-set-hook.js":45,"./parse-tag.js":47,"x-is-array":60}],47:[function(t,e,n){"use strict";function i(t,e){if(!t)return"DIV";var n=!e.hasOwnProperty("id"),i=r(t,s),a=null;o.test(i[1])&&(a="DIV");var u,c,h,l;for(l=0;l<i.length;l++)c=i[l],c&&(h=c.charAt(0),a?"."===h?(u=u||[],u.push(c.substring(1,c.length))):"#"===h&&n&&(e.id=c.substring(1,c.length)):a=c);return u&&(e.className&&u.push(e.className),e.className=u.join(" ")),e.namespace?a:a.toUpperCase()}var r=t("browser-split"),s=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,o=/^\.|#/;e.exports=i},{"browser-split":17}],48:[function(t,e,n){function i(t,e){var n=t,i=e;return u(e)&&(i=r(e,t)),u(t)&&(n=r(t,null)),{a:n,b:i}}function r(t,e){var n=t.vnode;if(n||(n=t.vnode=t.render(e)),!(s(n)||o(n)||a(n)))throw new Error("thunk did not return a valid node");return n}var s=t("./is-vnode"),o=t("./is-vtext"),a=t("./is-widget"),u=t("./is-thunk");e.exports=i},{"./is-thunk":49,"./is-vnode":51,"./is-vtext":52,"./is-widget":53}],49:[function(t,e,n){function i(t){return t&&"Thunk"===t.type}e.exports=i},{}],50:[function(t,e,n){function i(t){return t&&("function"==typeof t.hook&&!t.hasOwnProperty("hook")||"function"==typeof t.unhook&&!t.hasOwnProperty("unhook"))}e.exports=i},{}],51:[function(t,e,n){function i(t){return t&&"VirtualNode"===t.type&&t.version===r}var r=t("./version");e.exports=i},{"./version":54}],52:[function(t,e,n){function i(t){return t&&"VirtualText"===t.type&&t.version===r}var r=t("./version");e.exports=i},{"./version":54}],53:[function(t,e,n){function i(t){return t&&"Widget"===t.type}e.exports=i},{}],54:[function(t,e,n){e.exports="2"},{}],55:[function(t,e,n){function i(t,e,n,i,r){this.tagName=t,this.properties=e||c,this.children=n||h,this.key=null!=i?String(i):void 0,this.namespace="string"==typeof r?r:null;var l,f=n&&n.length||0,p=0,d=!1,m=!1,v=!1;for(var g in e)if(e.hasOwnProperty(g)){var y=e[g];u(y)&&y.unhook&&(l||(l={}),l[g]=y)}for(var w=0;f>w;w++){var x=n[w];s(x)?(p+=x.count||0,!d&&x.hasWidgets&&(d=!0),!m&&x.hasThunks&&(m=!0),v||!x.hooks&&!x.descendantHooks||(v=!0)):!d&&o(x)?"function"==typeof x.destroy&&(d=!0):!m&&a(x)&&(m=!0)}this.count=f+p,this.hasWidgets=d,this.hasThunks=m,this.hooks=l,this.descendantHooks=v}var r=t("./version"),s=t("./is-vnode"),o=t("./is-widget"),a=t("./is-thunk"),u=t("./is-vhook");e.exports=i;var c={},h=[];i.prototype.version=r,i.prototype.type="VirtualNode"},{"./is-thunk":49,"./is-vhook":50,"./is-vnode":51,"./is-widget":53,"./version":54}],56:[function(t,e,n){function i(t,e,n){this.type=Number(t),this.vNode=e,this.patch=n}var r=t("./version");i.NONE=0,i.VTEXT=1,i.VNODE=2,i.WIDGET=3,i.PROPS=4,i.ORDER=5,i.INSERT=6,i.REMOVE=7,i.THUNK=8,e.exports=i,i.prototype.version=r,i.prototype.type="VirtualPatch"},{"./version":54}],57:[function(t,e,n){function i(t){this.text=String(t)}var r=t("./version");
3
- e.exports=i,i.prototype.version=r,i.prototype.type="VirtualText"},{"./version":54}],58:[function(t,e,n){function i(t,e){var n;for(var a in t){a in e||(n=n||{},n[a]=void 0);var u=t[a],c=e[a];if(u!==c)if(s(u)&&s(c))if(r(c)!==r(u))n=n||{},n[a]=c;else if(o(c))n=n||{},n[a]=c;else{var h=i(u,c);h&&(n=n||{},n[a]=h)}else n=n||{},n[a]=c}for(var l in e)l in t||(n=n||{},n[l]=e[l]);return n}function r(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__?t.__proto__:t.constructor?t.constructor.prototype:void 0}var s=t("is-object"),o=t("../vnode/is-vhook");e.exports=i},{"../vnode/is-vhook":50,"is-object":32}],59:[function(t,e,n){function i(t,e){var n={a:t};return r(t,e,n,0),n}function r(t,e,n,i){if(t!==e){var r=n[i],a=!1;if(b(t)||b(e))u(t,e,n,i);else if(null==e)x(t)||(o(t,n,i),r=n[i]),r=m(r,new g(g.REMOVE,t,e));else if(y(e))if(y(t))if(t.tagName===e.tagName&&t.namespace===e.namespace&&t.key===e.key){var c=N(t.properties,e.properties);c&&(r=m(r,new g(g.PROPS,t,c))),r=s(t,e,n,r,i)}else r=m(r,new g(g.VNODE,t,e)),a=!0;else r=m(r,new g(g.VNODE,t,e)),a=!0;else w(e)?w(t)?t.text!==e.text&&(r=m(r,new g(g.VTEXT,t,e))):(r=m(r,new g(g.VTEXT,t,e)),a=!0):x(e)&&(x(t)||(a=!0),r=m(r,new g(g.WIDGET,t,e)));r&&(n[i]=r),a&&o(t,n,i)}}function s(t,e,n,i,s){for(var o=t.children,a=f(o,e.children),u=a.children,c=o.length,h=u.length,l=c>h?c:h,p=0;l>p;p++){var d=o[p],v=u[p];s+=1,d?r(d,v,n,s):v&&(i=m(i,new g(g.INSERT,null,v))),y(d)&&d.count&&(s+=d.count)}return a.moves&&(i=m(i,new g(g.ORDER,t,a.moves))),i}function o(t,e,n){h(t,e,n),a(t,e,n)}function a(t,e,n){if(x(t))"function"==typeof t.destroy&&(e[n]=m(e[n],new g(g.REMOVE,t,null)));else if(y(t)&&(t.hasWidgets||t.hasThunks))for(var i=t.children,r=i.length,s=0;r>s;s++){var o=i[s];n+=1,a(o,e,n),y(o)&&o.count&&(n+=o.count)}else b(t)&&u(t,null,e,n)}function u(t,e,n,r){var s=_(t,e),o=i(s.a,s.b);c(o)&&(n[r]=new g(g.THUNK,null,o))}function c(t){for(var e in t)if("a"!==e)return!0;return!1}function h(t,e,n){if(y(t)){if(t.hooks&&(e[n]=m(e[n],new g(g.PROPS,t,l(t.hooks)))),t.descendantHooks||t.hasThunks)for(var i=t.children,r=i.length,s=0;r>s;s++){var o=i[s];n+=1,h(o,e,n),y(o)&&o.count&&(n+=o.count)}}else b(t)&&u(t,null,e,n)}function l(t){var e={};for(var n in t)e[n]=void 0;return e}function f(t,e){var n=d(e),i=n.keys,r=n.free;if(r.length===e.length)return{children:e,moves:null};var s=d(t),o=s.keys,a=s.free;if(a.length===t.length)return{children:e,moves:null};for(var u=[],c=0,h=r.length,l=0,f=0;f<t.length;f++){var m,v=t[f];v.key?i.hasOwnProperty(v.key)?(m=i[v.key],u.push(e[m])):(m=f-l++,u.push(null)):h>c?(m=r[c++],u.push(e[m])):(m=f-l++,u.push(null))}for(var g=c>=r.length?e.length:r[c],y=0;y<e.length;y++){var w=e[y];w.key?o.hasOwnProperty(w.key)||u.push(w):y>=g&&u.push(w)}for(var x,b=u.slice(),_=0,N=[],P=[],j=0;j<e.length;){var k=e[j];for(x=b[_];null===x&&b.length;)N.push(p(b,_,null)),x=b[_];x&&x.key===k.key?(_++,j++):k.key?(x&&x.key&&i[x.key]!==j+1?(N.push(p(b,_,x.key)),x=b[_],x&&x.key===k.key?_++:P.push({key:k.key,to:j})):P.push({key:k.key,to:j}),j++):x&&x.key&&N.push(p(b,_,x.key))}for(;_<b.length;)x=b[_],N.push(p(b,_,x&&x.key));return N.length!==l||P.length?{children:u,moves:{removes:N,inserts:P}}:{children:u,moves:null}}function p(t,e,n){return t.splice(e,1),{from:e,key:n}}function d(t){for(var e={},n=[],i=t.length,r=0;i>r;r++){var s=t[r];s.key?e[s.key]=r:n.push(r)}return{keys:e,free:n}}function m(t,e){return t?(v(t)?t.push(e):t=[t,e],t):e}var v=t("x-is-array"),g=t("../vnode/vpatch"),y=t("../vnode/is-vnode"),w=t("../vnode/is-vtext"),x=t("../vnode/is-widget"),b=t("../vnode/is-thunk"),_=t("../vnode/handle-thunk"),N=t("./diff-props");e.exports=i},{"../vnode/handle-thunk":48,"../vnode/is-thunk":49,"../vnode/is-vnode":51,"../vnode/is-vtext":52,"../vnode/is-widget":53,"../vnode/vpatch":56,"./diff-props":58,"x-is-array":60}],60:[function(t,e,n){function i(t){return"[object Array]"===s.call(t)}var r=Array.isArray,s=Object.prototype.toString;e.exports=r||i},{}],61:[function(t,e,n){},{}],62:[function(t,e,n){function i(){h=!1,a.length?c=a.concat(c):l=-1,c.length&&r()}function r(){if(!h){var t=setTimeout(i);h=!0;for(var e=c.length;e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,h=!1,clearTimeout(t)}}function s(t,e){this.fun=t,this.array=e}function o(){}var a,u=e.exports={},c=[],h=!1,l=-1;u.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new s(t,e)),1!==c.length||h||setTimeout(r,0)},s.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=o,u.addListener=o,u.once=o,u.off=o,u.removeListener=o,u.removeAllListeners=o,u.emit=o,u.binding=function(t){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(t){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}]},{},[1])(1)});