Mini Kabibi Habibi

Current Path : C:/Program Files (x86)/Common Files/Adobe/CEP/extensions/com.adobe.ccx.fnft-3.5.0/js/
Upload File :
Current File : C:/Program Files (x86)/Common Files/Adobe/CEP/extensions/com.adobe.ccx.fnft-3.5.0/js/fnft-head.js

/*
 * Baobab
 *
 * Homepage: https://github.com/Yomguithereal/baobab
 * Version: 2.3.3
 * Author: Yomguithereal (Guillaume Plique)
 * License: MIT
 */
!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.Baobab=t()}}(function(){var t;return function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return o(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,r,n){(function(){"use strict";function e(t,e){var r,n={};for(r in t)n[r]=t[r];for(r in e)n[r]=e[r];return n}function o(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!(t instanceof Function)&&!(t instanceof RegExp)}function i(t,e,r){var n,o,i,a;for(o in t)e.call(r||null,o,t[o]);if(Object.getOwnPropertySymbols)for(n=Object.getOwnPropertySymbols(t),i=0,a=n.length;a>i;i++)e.call(r||null,n[i],t[n[i]])}function a(t,e){t=t||[];var r,n,o=[];for(n=0,r=t.length;r>n;n++)t[n].fn!==e&&o.push(t[n]);return o}var s={once:"boolean",scope:"object"},u=0,h=function(){this._enabled=!0,this.unbindAll()};h.prototype.unbindAll=function(){return this._handlers={},this._handlersAll=[],this._handlersComplex=[],this},h.prototype.on=function(t,e,r){var n,a,h,l,f,c,p;if(o(t))return i(t,function(t,r){this.on(t,r,e)},this),this;for("function"==typeof t&&(r=e,e=t,t=null),f=[].concat(t),n=0,a=f.length;a>n;n++){if(l=f[n],p={order:u++,fn:e},"string"==typeof l||"symbol"==typeof l)this._handlers[l]||(this._handlers[l]=[]),c=this._handlers[l],p.type=l;else if(l instanceof RegExp)c=this._handlersComplex,p.pattern=l;else{if(null!==l)throw Error("Emitter.on: invalid event.");c=this._handlersAll}for(h in r||{})s[h]&&(p[h]=r[h]);c.push(p)}return this},h.prototype.once=function(){var t=Array.prototype.slice.call(arguments),r=t.length-1;return o(t[r])&&t.length>1?t[r]=e(t[r],{once:!0}):t.push({once:!0}),this.on.apply(this,t)},h.prototype.off=function(t,e){var r,n,s,u;if(1===arguments.length&&"function"==typeof t){e=arguments[0];for(s in this._handlers)this._handlers[s]=a(this._handlers[s],e),0===this._handlers[s].length&&delete this._handlers[s];this._handlersAll=a(this._handlersAll,e),this._handlersComplex=a(this._handlersComplex,e)}else if(1!==arguments.length||"string"!=typeof t&&"symbol"!=typeof t)if(2===arguments.length){var h=[].concat(t);for(r=0,n=h.length;n>r;r++)u=h[r],this._handlers[u]=a(this._handlers[u],e),0===(this._handlers[u]||[]).length&&delete this._handlers[u]}else o(t)&&i(t,this.off,this);else delete this._handlers[t];return this},h.prototype.listeners=function(t){var e,r,n,o=this._handlersAll||[],i=!1;if(!t)throw Error("Emitter.listeners: no event provided.");for(o=o.concat(this._handlers[t]||[]),r=0,n=this._handlersComplex.length;n>r;r++)e=this._handlersComplex[r],~t.search(e.pattern)&&(i=!0,o.push(e));return this._handlersAll.length||i?o.sort(function(t,e){return t.order-e.order}):o.slice(0)},h.prototype.emit=function(t,e){if(!this._enabled)return this;if(o(t))return i(t,this.emit,this),this;var r,n,a,s,u,h,l,f,c=[].concat(t),p=[];for(u=0,l=c.length;l>u;u++){for(a=this.listeners(c[u]),h=0,f=a.length;f>h;h++)s=a[h],r={type:c[u],target:this},arguments.length>1&&(r.data=e),s.fn.call("scope"in s?s.scope:this,r),s.once&&p.push(s);for(h=p.length-1;h>=0;h--)n=p[h].type?this._handlers[p[h].type]:p[h].pattern?this._handlersComplex:this._handlersAll,n.splice(n.indexOf(p[h]),1)}return this},h.prototype.kill=function(){this.unbindAll(),this._handlers=null,this._handlersAll=null,this._handlersComplex=null,this._enabled=!1,this.unbindAll=this.on=this.once=this.off=this.emit=this.listeners=Function.prototype},h.prototype.disable=function(){return this._enabled=!1,this},h.prototype.enable=function(){return this._enabled=!0,this},h.version="3.1.1","undefined"!=typeof n?("undefined"!=typeof r&&r.exports&&(n=r.exports=h),n.Emitter=h):"function"==typeof t&&t.amd?t("emmett",[],function(){return h}):this.Emitter=h}).call(this)},{}],2:[function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){return"λ"+t.map(function(t){return v["default"]["function"](t)||v["default"].object(t)?"#"+B()+"#":t}).join("λ")}r.__esModule=!0;var u=t("emmett"),h=o(u),l=t("./cursor"),f=o(l),c=t("./monkey"),p=t("./watcher"),d=o(p),y=t("./type"),v=o(y),m=t("./update"),g=o(m),b=t("./helpers"),_=n(b),w=_.arrayFrom,k=_.coercePath,P=_.deepFreeze,j=_.getIn,M=_.makeError,C=_.deepClone,O=_.deepMerge,E=_.shallowClone,x=_.shallowMerge,B=_.uniqid,D={autoCommit:!0,asynchronous:!0,immutable:!0,lazyMonkeys:!0,persistent:!0,pure:!0,validate:null,validationBehavior:"rollback"},z=function(t){function e(r,n){var o=this;if(i(this,e),t.call(this),arguments.length<1&&(r={}),!v["default"].object(r)&&!v["default"].array(r))throw M("Baobab: invalid data.",{data:r});this.options=x({},D,n),this.options.persistent||(this.options.immutable=!1,this.options.pure=!1),this._identity="[object Baobab]",this._cursors={},this._future=null,this._transaction=[],this._affectedPathsIndex={},this._monkeys={},this._previousData=null,this._data=r,this.root=new f["default"](this,[],"λ"),delete this.root.release,this.options.immutable&&P(this._data);var a=function(t){o[t]=function(){var e=this.root[t].apply(this.root,arguments);return e instanceof f["default"]?this:e}};["apply","clone","concat","deepClone","deepMerge","exists","get","push","merge","pop","project","serialize","set","shift","splice","unset","unshift"].forEach(a),this._refreshMonkeys();var s=this.validate();if(s)throw Error("Baobab: invalid data.",{error:s})}return a(e,t),e.prototype._refreshMonkeys=function(t,e,r){var n=this,o=function s(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];if(t instanceof c.Monkey)return t.release(),void g["default"](n._monkeys,e,{type:"unset"},{immutable:!1,persistent:!1,pure:!1});if(v["default"].object(t))for(var r in t)s(t[r],e.concat(r))},i=function u(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];if(t instanceof c.MonkeyDefinition||t instanceof c.Monkey){var r=new c.Monkey(n,e,t instanceof c.Monkey?t.definition:t);return void g["default"](n._monkeys,e,{type:"set",value:r},{immutable:!1,persistent:!1,pure:!1})}if(v["default"].object(t))for(var o in t)u(t[o],e.concat(o))};if(arguments.length){var a=j(this._monkeys,e).data;a&&o(a,e),"unset"!==r&&i(t,e)}else i(this._data);return this},e.prototype.validate=function r(t){var e=this.options,r=e.validate,n=e.validationBehavior;if("function"!=typeof r)return null;var o=r.call(this,this._previousData,this._data,t||[[]]);return o instanceof Error?("rollback"===n&&(this._data=this._previousData,this._affectedPathsIndex={},this._transaction=[],this._previousData=this._data),this.emit("invalid",{error:o}),o):null},e.prototype.select=function(t){if(t=t||[],arguments.length>1&&(t=w(arguments)),!v["default"].path(t))throw M("Baobab.select: invalid path.",{path:t});t=[].concat(t);var e=s(t),r=this._cursors[e];return r||(r=new f["default"](this,t,e),this._cursors[e]=r),this.emit("select",{path:t,cursor:r}),r},e.prototype.update=function(t,e){var r=this;if(t=k(t),!v["default"].operationType(e.type))throw M('Baobab.update: unknown operation type "'+e.type+'".',{operation:e});var n=j(this._data,t),o=n.solvedPath,i=n.exists;if(!o)throw M("Baobab.update: could not solve the given path.",{path:o});var a=v["default"].monkeyPath(this._monkeys,o);if(a&&o.length>a.length)throw M("Baobab.update: attempting to update a read-only path.",{path:o});if("unset"!==e.type||i){var u=e;if(/merge/i.test(e.type)){var h=j(this._monkeys,o).data;if(v["default"].object(h)){u=E(u);var l=j(this._data,o).data;/deep/i.test(u.type)?u.value=O({},O({},l,C(h)),u.value):u.value=x({},O({},l,C(h)),u.value)}}this._transaction.length||(this._previousData=this._data);var f=g["default"](this._data,o,u,this.options),c=f.data,p=f.node;if(!("data"in f))return p;var d=o.concat("push"===e.type?p.length-1:[]),y=s(d);return this._data=c,this._affectedPathsIndex[y]=!0,this._transaction.push(x({},e,{path:d})),this._refreshMonkeys(p,o,e.type),this.emit("write",{path:d}),this.options.autoCommit?this.options.asynchronous?(this._future||(this._future=setTimeout(function(){return r.commit()},0)),p):(this.commit(),p):p}},e.prototype.commit=function(){if(!this._transaction.length)return this;this._future&&(this._future=clearTimeout(this._future));var t=Object.keys(this._affectedPathsIndex).map(function(t){return"λ"!==t?t.split("λ").slice(1):[]}),e=this.validate(t);if(e)return this;var r=this._transaction,n=this._previousData;return this._affectedPathsIndex={},this._transaction=[],this._previousData=this._data,this.emit("update",{paths:t,currentData:this._data,transaction:r,previousData:n}),this},e.prototype.getMonkey=function(t){t=k(t);var e=j(this._monkeys,[].concat(t)).data;return e instanceof c.Monkey?e:null},e.prototype.watch=function(t){return new d["default"](this,t)},e.prototype.release=function(){var t=void 0;this.emit("release"),delete this.root,delete this._data,delete this._previousData,delete this._transaction,delete this._affectedPathsIndex,delete this._monkeys;for(t in this._cursors)this._cursors[t].release();delete this._cursors,this.kill()},e.prototype.toJSON=function(){return this.serialize()},e.prototype.toString=function(){return this._identity},e}(h["default"]);r["default"]=z,z.monkey=function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];if(!e.length)throw new Error("Baobab.monkey: missing definition.");return 1===e.length&&"function"!=typeof e[0]?new c.MonkeyDefinition(e[0]):new c.MonkeyDefinition(e)},z.dynamicNode=z.monkey,z.Cursor=f["default"],z.MonkeyDefinition=c.MonkeyDefinition,z.Monkey=c.Monkey,z.type=v["default"],z.helpers=_,z.VERSION="2.3.2",e.exports=r["default"]},{"./cursor":3,"./helpers":4,"./monkey":5,"./type":6,"./update":7,"./watcher":8,emmett:1}],3:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!e)throw p.makeError("Baobab.Cursor."+t+": "+("cannot use "+t+" on an unresolved dynamic path."),{path:e})}function s(t,e){d.prototype[t]=function(r,n){if(arguments.length>2)throw p.makeError("Baobab.Cursor."+t+": too many arguments.");if(1!==arguments.length||y[t]||(n=r,r=[]),r=p.coercePath(r),!c["default"].path(r))throw p.makeError("Baobab.Cursor."+t+": invalid path.",{path:r});if(e&&!e(n))throw p.makeError("Baobab.Cursor."+t+": invalid value.",{path:r,value:n});if(!this.solvedPath)throw p.makeError("Baobab.Cursor."+t+": the dynamic path of the cursor cannot be solved.",{path:this.path});var o=this.solvedPath.concat(r);return this.tree.update(o,{type:t,value:n})}}r.__esModule=!0;var u=t("emmett"),h=n(u),l=t("./monkey"),f=t("./type"),c=n(f),p=t("./helpers"),d=function(t){function e(r,n,i){var a=this;o(this,e),t.call(this),n=n||[],this._identity="[object Cursor]",this._archive=null,this.tree=r,this.path=n,this.hash=i,this.state={killed:!1,recording:!1,undoing:!1},this._dynamicPath=c["default"].dynamicPath(this.path),this._monkeyPath=c["default"].monkeyPath(this.tree._monkeys,this.path),this._dynamicPath?this.solvedPath=p.getIn(this.tree._data,this.path).solvedPath:this.solvedPath=this.path,this._writeHandler=function(t){var e=t.data;!a.state.killed&&p.solveUpdate([e.path],a._getComparedPaths())&&(a.solvedPath=p.getIn(a.tree._data,a.path).solvedPath)};var s=function(t){var e=a,r=Object.defineProperties({},{previousData:{get:function(){return p.getIn(t,e.solvedPath).data},configurable:!0,enumerable:!0},currentData:{get:function(){return e.get()},configurable:!0,enumerable:!0}});return a.state.recording&&!a.state.undoing&&a.archive.add(r.previousData),a.state.undoing=!1,a.emit("update",r)};this._updateHandler=function(t){if(!a.state.killed){var e=t.data,r=e.paths,n=e.previousData,o=s.bind(a,n),i=a._getComparedPaths();return p.solveUpdate(r,i)?o():void 0}};var u=!1;this._lazyBind=function(){return u?void 0:(u=!0,a._dynamicPath&&a.tree.on("write",a._writeHandler),a.tree.on("update",a._updateHandler))},this._dynamicPath?this._lazyBind():(this.on=p.before(this._lazyBind,this.on.bind(this)),this.once=p.before(this._lazyBind,this.once.bind(this)))}return i(e,t),e.prototype._getComparedPaths=function(){var t=this._monkeyPath?p.getIn(this.tree._monkeys,this._monkeyPath).data.relatedPaths():[];return[this.solvedPath].concat(t)},e.prototype.isRoot=function(){return!this.path.length},e.prototype.isLeaf=function(){return c["default"].primitive(this._get().data)},e.prototype.isBranch=function(){return!this.isRoot()&&!this.isLeaf()},e.prototype.root=function(){return this.tree.select()},e.prototype.select=function(t){return arguments.length>1&&(t=p.arrayFrom(arguments)),this.tree.select(this.path.concat(t))},e.prototype.up=function(){return this.isRoot()?null:this.tree.select(this.path.slice(0,-1))},e.prototype.down=function(){if(a("down",this.solvedPath),!(this._get().data instanceof Array))throw Error("Baobab.Cursor.down: cannot go down on a non-list type.");return this.tree.select(this.solvedPath.concat(0))},e.prototype.left=function(){a("left",this.solvedPath);var t=+this.solvedPath[this.solvedPath.length-1];if(isNaN(t))throw Error("Baobab.Cursor.left: cannot go left on a non-list type.");return t?this.tree.select(this.solvedPath.slice(0,-1).concat(t-1)):null},e.prototype.right=function(){a("right",this.solvedPath);var t=+this.solvedPath[this.solvedPath.length-1];if(isNaN(t))throw Error("Baobab.Cursor.right: cannot go right on a non-list type.");return t+1===this.up()._get().data.length?null:this.tree.select(this.solvedPath.slice(0,-1).concat(t+1))},e.prototype.leftmost=function(){a("leftmost",this.solvedPath);var t=+this.solvedPath[this.solvedPath.length-1];if(isNaN(t))throw Error("Baobab.Cursor.leftmost: cannot go left on a non-list type.");return this.tree.select(this.solvedPath.slice(0,-1).concat(0))},e.prototype.rightmost=function(){a("rightmost",this.solvedPath);var t=+this.solvedPath[this.solvedPath.length-1];if(isNaN(t))throw Error("Baobab.Cursor.rightmost: cannot go right on a non-list type.");var e=this.up()._get().data;return this.tree.select(this.solvedPath.slice(0,-1).concat(e.length-1))},e.prototype.map=function(t,e){a("map",this.solvedPath);var r=this._get().data,n=arguments.length;if(!c["default"].array(r))throw Error("baobab.Cursor.map: cannot map a non-list type.");return r.map(function(o,i){return t.call(n>1?e:this,this.select(i),i,r)},this)},e.prototype._get=function(){var t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];if(!c["default"].path(t))throw p.makeError("Baobab.Cursor.getters: invalid path.",{path:t});return this.solvedPath?p.getIn(this.tree._data,this.solvedPath.concat(t)):{data:void 0,solvedPath:null,exists:!1}},e.prototype.exists=function(t){return t=p.coercePath(t),arguments.length>1&&(t=p.arrayFrom(arguments)),this._get(t).exists},e.prototype.get=function(t){t=p.coercePath(t),arguments.length>1&&(t=p.arrayFrom(arguments));var e=this._get(t),r=e.data,n=e.solvedPath;return this.tree.emit("get",{data:r,solvedPath:n,path:this.path.concat(t)}),r},e.prototype.clone=function(){var t=this.get.apply(this,arguments);return p.shallowClone(t)},e.prototype.deepClone=function(){var t=this.get.apply(this,arguments);return p.deepClone(t)},e.prototype.serialize=function(t){if(t=p.coercePath(t),arguments.length>1&&(t=p.arrayFrom(arguments)),!c["default"].path(t))throw p.makeError("Baobab.Cursor.getters: invalid path.",{path:t});if(this.solvedPath){var e=this.solvedPath.concat(t),r=p.deepClone(p.getIn(this.tree._data,e).data),n=p.getIn(this.tree._monkeys,e).data,o=function i(t,e){if(c["default"].object(e)&&c["default"].object(t))for(var r in e)e[r]instanceof l.Monkey?delete t[r]:i(t[r],e[r])};return o(r,n),r}},e.prototype.project=function(t){if(c["default"].object(t)){var e={};for(var r in t)e[r]=this.get(t[r]);return e}if(c["default"].array(t)){for(var e=[],n=0,o=t.length;o>n;n++)e.push(this.get(t[n]));return e}throw p.makeError("Baobab.Cursor.project: wrong projection.",{projection:t})},e.prototype.startRecording=function(t){if(t=t||1/0,1>t)throw p.makeError("Baobab.Cursor.startRecording: invalid max records.",{value:t});return this.state.recording=!0,this.archive?this:(this._lazyBind(),this.archive=new p.Archive(t),this)},e.prototype.stopRecording=function(){return this.state.recording=!1,this},e.prototype.undo=function(){var t=arguments.length<=0||void 0===arguments[0]?1:arguments[0];if(!this.state.recording)throw new Error("Baobab.Cursor.undo: cursor is not recording.");var e=this.archive.back(t);if(!e)throw Error("Baobab.Cursor.undo: cannot find a relevant record.");return this.state.undoing=!0,this.set(e),this},e.prototype.hasHistory=function(){return!(!this.archive||!this.archive.get().length)},e.prototype.getHistory=function(){return this.archive?this.archive.get():[]},e.prototype.clearHistory=function(){return this.archive&&this.archive.clear(),this},e.prototype.release=function(){this._dynamicPath&&this.tree.off("write",this._writeHandler),this.tree.off("update",this._updateHandler),this.hash&&delete this.tree._cursors[this.hash],delete this.tree,delete this.path,delete this.solvedPath,delete this.archive,this.kill(),this.state.killed=!0},e.prototype.toJSON=function(){return this.serialize()},e.prototype.toString=function(){return this._identity},e}(h["default"]);r["default"]=d,"function"==typeof Symbol&&"undefined"!=typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){var t=this._get().data;if(!c["default"].array(t))throw Error("baobab.Cursor.@@iterate: cannot iterate a non-list type.");var e=0,r=this,n=t.length;return{next:function(){return n>e?{value:r.select(e++)}:{done:!0}}}});var y={unset:!0,pop:!0,shift:!0};s("set"),s("unset"),s("apply",c["default"]["function"]),s("push"),s("concat",c["default"].array),s("unshift"),s("pop"),s("shift"),s("splice",c["default"].splicer),s("merge",c["default"].object),s("deepMerge",c["default"].object),e.exports=r["default"]},{"./helpers":4,"./monkey":5,"./type":6,emmett:1}],4:[function(t,e,r){(function(e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){var r=void 0,n=void 0;for(r=0,n=t.length;n>r;r++)if(e(t[r]))return r;return-1}function a(t){var e=new Array(t.length),r=void 0,n=void 0;for(r=0,n=t.length;n>r;r++)e[r]=t[r];return e}function s(t){return a(t)}function u(t,e){return function(){t.apply(null,arguments),e.apply(null,arguments)}}function h(t){var e=t.source,r="";return t.global&&(r+="g"),t.multiline&&(r+="m"),t.ignoreCase&&(r+="i"),t.sticky&&(r+="y"),t.unicode&&(r+="u"),new RegExp(e,r)}function l(t,r){if(!r||"object"!=typeof r||r instanceof Error||r instanceof _.MonkeyDefinition||r instanceof _.Monkey||"ArrayBuffer"in e&&r instanceof ArrayBuffer)return r;if(k["default"].array(r)){if(t){var n=[],o=void 0,i=void 0;for(o=0,i=r.length;i>o;o++)n.push(l(!0,r[o]));return n}return a(r)}if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return h(r);if(k["default"].object(r)){var s={},u=void 0;for(u in r)k["default"].lazyGetter(r,u)?Object.defineProperty(s,u,{get:Object.getOwnPropertyDescriptor(r,u).get,enumerable:!0,configurable:!0}):r.hasOwnProperty(u)&&(s[u]=t?l(!0,r[u]):r[u]);return s}return r}function f(t){return t||0===t||""===t?t:[]}function c(t,e){var r=!0,n=void 0;if(!t)return!1;for(n in e)if(k["default"].object(e[n]))r=r&&c(t[n],e[n]);else if(k["default"].array(e[n]))r=r&&!!~e[n].indexOf(t[n]);else if(t[n]!==e[n])return!1;return r}function p(t,e){if(!("object"!=typeof e||null===e||e instanceof _.Monkey)&&(Object.freeze(e),t))if(Array.isArray(e)){var r=void 0,n=void 0;for(r=0,n=e.length;n>r;r++)p(!0,e[r])}else{var o=void 0,i=void 0;for(i in e)k["default"].lazyGetter(e,i)||(o=e[i],o&&e.hasOwnProperty(i)&&"object"==typeof o&&!Object.isFrozen(o)&&p(!0,o))}}function d(t,e){if(!e)return B;var r=[],n=!0,o=t,a=void 0,s=void 0,u=void 0;for(s=0,u=e.length;u>s;s++){if(!o)return{data:void 0,solvedPath:r.concat(e.slice(s)),exists:!1};if("function"==typeof e[s]){if(!k["default"].array(o))return B;if(a=i(o,e[s]),!~a)return B;r.push(a),o=o[a]}else if("object"==typeof e[s]){if(!k["default"].array(o))return B;if(a=i(o,function(t){return c(t,e[s])}),!~a)return B;r.push(a),o=o[a]}else r.push(e[s]),n="object"==typeof o&&e[s]in o,o=o[e[s]]}return{data:o,solvedPath:r,exists:n}}function y(t,e){var r=new Error(t);for(var n in e)r[n]=e[n];return r}function v(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];var o=r[0],i=void 0,a=void 0,s=void 0,u=void 0;for(a=1,s=r.length;s>a;a++){i=r[a];for(u in i)!t||!k["default"].object(i[u])||i[u]instanceof _.Monkey?o[u]=i[u]:o[u]=v(!0,o[u]||{},i[u])}return o}function m(t,e){var r=[];e=[].concat(e);for(var n=0,o=e.length;o>n;n++){var i=e[n];"."===i?n||(r=t.slice(0)):".."===i?r=(n?r:t).slice(0,-1):r.push(i)}return r}function g(t,e){var r=void 0,n=void 0,o=void 0,i=void 0,a=void 0,s=void 0,u=void 0,h=void 0,l=void 0;for(r=0,i=t.length;i>r;r++){if(u=t[r],!u.length)return!0;for(n=0,a=e.length;a>n;n++){if(h=e[n],!h||!h.length)return!0;for(o=0,s=h.length;s>o&&(l=h[o],l==u[o]);o++)if(o+1===s||o+1===u.length)return!0}}return!1}function b(t,e,r){r=Math.max(0,r),k["default"]["function"](e)&&(e=i(t,e)),k["default"].object(e)&&(e=i(t,function(t){return c(t,e)}));for(var n=arguments.length,o=Array(n>3?n-3:0),a=3;n>a;a++)o[a-3]=arguments[a];return e>=0?t.slice(0,e).concat(o).concat(t.slice(e+r)):t.slice(0,t.length+e).concat(o).concat(t.slice(t.length+e+r))}r.__esModule=!0,r.arrayFrom=s,r.before=u,r.coercePath=f,r.getIn=d,r.makeError=y,r.solveRelativePath=m,r.solveUpdate=g,r.splice=b;var _=t("./monkey"),w=t("./type"),k=n(w),P=Function.prototype,j=function(){function t(e){o(this,t),this.size=e,this.records=[]}return t.prototype.get=function(){return this.records},t.prototype.add=function(t){return this.records.unshift(t),this.records.length>this.size&&(this.records.length=this.size),this},t.prototype.clear=function(){return this.records=[],this},t.prototype.back=function(t){var e=this.records[t-1];return e&&(this.records=this.records.slice(t)),e},t}();r.Archive=j;var M=l.bind(null,!1),C=l.bind(null,!0);r.shallowClone=M,r.deepClone=C;var O="function"==typeof Object.freeze,E=O?p.bind(null,!1):P,x=O?p.bind(null,!0):P;r.freeze=E,r.deepFreeze=x;var B={data:void 0,solvedPath:null,exists:!1},D=v.bind(null,!1),z=v.bind(null,!0);r.shallowMerge=D,r.deepMerge=z;var A=function(){var t=0;return function(){return t++}}();r.uniqid=A}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./monkey":5,"./type":6}],5:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var i=t("./type"),a=n(i),s=t("./update"),u=n(s),h=t("./helpers"),l=function c(t){var e=this;o(this,c);var r=a["default"].monkeyDefinition(t);if(!r)throw h.makeError("Baobab.monkey: invalid definition.",{definition:t});if(this.type=r,"object"===this.type)this.getter=t.get,this.projection=t.cursors||{},this.paths=Object.keys(this.projection).map(function(t){return e.projection[t]}),this.options=t.options||{};else{var n=1,i={};a["default"].object(t[t.length-1])&&(n++,i=t[t.length-1]),this.getter=t[t.length-n],this.projection=t.slice(0,-n),this.paths=this.projection,this.options=i}this.paths=this.paths.map(function(t){return[].concat(t)}),this.hasDynamicPaths=this.paths.some(a["default"].dynamicPath)};r.MonkeyDefinition=l;var f=function(){function t(e,r,n){var i=this;o(this,t),this.tree=e,this.path=r,this.definition=n;var a=n.projection,s=h.solveRelativePath.bind(null,r.slice(0,-1));"object"===n.type?(this.projection=Object.keys(a).reduce(function(t,e){return t[e]=s(a[e]),t},{}),this.depPaths=Object.keys(this.projection).map(function(t){return i.projection[t]})):(this.projection=a.map(s),this.depPaths=this.projection),this.state={killed:!1},this.writeListener=function(t){var e=t.data.path;if(!i.state.killed){var r=h.solveUpdate([e],i.relatedPaths());r&&i.update()}},this.recursiveListener=function(t){var e=t.data,r=e.monkey,n=e.path;if(!i.state.killed&&i!==r){var o=h.solveUpdate([n],i.relatedPaths(!1));o&&i.update()}},this.tree.on("write",this.writeListener),this.tree.on("_monkey",this.recursiveListener),this.update()}return t.prototype.relatedPaths=function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0],r=void 0;r=this.definition.hasDynamicPaths?this.depPaths.map(function(e){return h.getIn(t.tree._data,e).solvedPath}):this.depPaths;var n=e&&this.depPaths.some(function(e){return!!a["default"].monkeyPath(t.tree._monkeys,e)});return n?r.reduce(function(e,r){var n=a["default"].monkeyPath(t.tree._monkeys,r);if(!n)return e.concat([r]);var o=h.getIn(t.tree._monkeys,n).data;return e.concat(o.relatedPaths())},[]):r},t.prototype.update=function(){var t=this.tree.project(this.projection),e=function(t,e,r){var n=null,o=!1;return function(){return o||(n=e.getter.apply(t,"object"===e.type?[r]:r),t.options.immutable&&e.options.immutable!==!1&&h.deepFreeze(n),o=!0),n}}(this.tree,this.definition,t);if(e.isLazyGetter=!0,this.tree.options.lazyMonkeys)this.tree._data=u["default"](this.tree._data,this.path,{type:"monkey",value:e},this.tree.options).data;else{var r=u["default"](this.tree._data,this.path,{type:"set",value:e(),options:{mutableLeaf:!this.definition.options.immutable}},this.tree.options);"data"in r&&(this.tree._data=r.data)}return this.tree.emit("_monkey",{monkey:this,path:this.path}),this},t.prototype.release=function(){this.tree.off("write",this.writeListener),this.tree.off("_monkey",this.monkeyListener),this.state.killed=!0,delete this.projection,delete this.depPaths,delete this.tree},t}();r.Monkey=f},{"./helpers":4,"./type":6,"./update":7}],6:[function(t,e,r){"use strict";function n(t,e){return e.some(function(e){return i[e](t)})}r.__esModule=!0;var o=t("./monkey"),i={};i.array=function(t){return Array.isArray(t)},i.object=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!(t instanceof Date)&&!(t instanceof RegExp)&&!("function"==typeof Map&&t instanceof Map)&&!("function"==typeof Set&&t instanceof Set)},i.string=function(t){return"string"==typeof t},i.number=function(t){return"number"==typeof t},i["function"]=function(t){return"function"==typeof t},i.primitive=function(t){return t!==Object(t)},i.splicer=function(t){return!i.array(t)||t.length<2?!1:n(t[0],["number","function","object"])&&i.number(t[1])};var a=["string","number","function","object"];i.path=function(t){return t||0===t||""===t?[].concat(t).every(function(t){return n(t,a)}):!1},i.dynamicPath=function(t){return t.some(function(t){return i["function"](t)||i.object(t)})},i.monkeyPath=function(t,e){var r=[],n=t,i=void 0,a=void 0;for(i=0,a=e.length;a>i;i++){if(r.push(e[i]),"object"!=typeof n)return null;if(n=n[e[i]],n instanceof o.Monkey)return r}return null},i.lazyGetter=function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return r&&r.get&&r.get.isLazyGetter===!0},i.monkeyDefinition=function(t){if(i.object(t))return i["function"](t.get)&&(!t.cursors||i.object(t.cursors)&&Object.keys(t.cursors).every(function(e){return i.path(t.cursors[e])}))?"object":null;if(i.array(t)){var e=1;return i.object(t[t.length-1])&&e++,i["function"](t[t.length-e])&&t.slice(0,-e).every(function(t){return i.path(t)})?"array":null}return null},i.watcherMapping=function(t){return i.object(t)&&Object.keys(t).every(function(e){return i.path(t[e])})};var s=["set","apply","push","unshift","concat","pop","shift","deepMerge","merge","splice","unset"];i.operationType=function(t){return"string"==typeof t&&!!~s.indexOf(t)},r["default"]=i,e.exports=r["default"]},{"./monkey":5}],7:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,r){return u.makeError('Baobab.update: cannot apply the "'+t+'" on '+("a non "+e+" (path: /"+r.join("/")+")."),{path:r})}function i(t,e,r){var n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],i=r.type,a=r.value,h=r.options,l=void 0===h?{}:h,f={root:t},c=["root"].concat(e),p=[],d=f,y=void 0,v=void 0,m=void 0;for(y=0,v=c.length;v>y;y++){if(m=c[y],y>0&&p.push(m),y===v-1){if("set"===i){if(n.pure&&d[m]===a)return{node:d[m]};s["default"].lazyGetter(d,m)?Object.defineProperty(d,m,{value:a,enumerable:!0,configurable:!0}):n.persistent&&!l.mutableLeaf?d[m]=u.shallowClone(a):d[m]=a}else if("monkey"===i)Object.defineProperty(d,m,{get:a,enumerable:!0,configurable:!0});else if("apply"===i){var g=a(d[m]);if(n.pure&&d[m]===g)return{node:d[m]};s["default"].lazyGetter(d,m)?Object.defineProperty(d,m,{value:g,enumerable:!0,configurable:!0}):n.persistent?d[m]=u.shallowClone(g):d[m]=g}else if("push"===i){if(!s["default"].array(d[m]))throw o("push","array",p);n.persistent?d[m]=d[m].concat([a]):d[m].push(a)}else if("unshift"===i){if(!s["default"].array(d[m]))throw o("unshift","array",p);n.persistent?d[m]=[a].concat(d[m]):d[m].unshift(a)}else if("concat"===i){if(!s["default"].array(d[m]))throw o("concat","array",p);n.persistent?d[m]=d[m].concat(a):d[m].push.apply(d[m],a)}else if("splice"===i){if(!s["default"].array(d[m]))throw o("splice","array",p);n.persistent?d[m]=u.splice.apply(null,[d[m]].concat(a)):d[m].splice.apply(d[m],a)}else if("pop"===i){if(!s["default"].array(d[m]))throw o("pop","array",p);n.persistent?d[m]=u.splice(d[m],-1,1):d[m].pop()}else if("shift"===i){if(!s["default"].array(d[m]))throw o("shift","array",p);n.persistent?d[m]=u.splice(d[m],0,1):d[m].shift()}else if("unset"===i)s["default"].object(d)?delete d[m]:s["default"].array(d)&&d.splice(m,1);else if("merge"===i){if(!s["default"].object(d[m]))throw o("merge","object",p);n.persistent?d[m]=u.shallowMerge({},d[m],a):d[m]=u.shallowMerge(d[m],a)}else if("deepMerge"===i){if(!s["default"].object(d[m]))throw o("deepMerge","object",p);n.persistent?d[m]=u.deepMerge({},d[m],a):d[m]=u.deepMerge(d[m],a)}n.immutable&&!l.mutableLeaf&&u.deepFreeze(d);break}s["default"].primitive(d[m])?d[m]={}:n.persistent&&(d[m]=u.shallowClone(d[m])),n.immutable&&v>0&&u.freeze(d),d=d[m]}return s["default"].lazyGetter(d,m)?{data:f.root}:{data:f.root,node:d[m]}}r.__esModule=!0,r["default"]=i;var a=t("./type"),s=n(a),u=t("./helpers");e.exports=r["default"]},{"./helpers":4,"./type":6}],8:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}r.__esModule=!0;var a=t("emmett"),s=n(a),u=t("./cursor"),h=n(u),l=t("./type"),f=n(l),c=t("./helpers"),p=function(t){
function e(r,n){var i=this;o(this,e),t.call(this),this.tree=r,this.mapping=null,this.state={killed:!1},this.refresh(n),this.handler=function(t){if(!i.state.killed){var e=i.getWatchedPaths();return c.solveUpdate(t.data.paths,e)?i.emit("update"):void 0}},this.tree.on("update",this.handler)}return i(e,t),e.prototype.getWatchedPaths=function(){var t=this,e=Object.keys(this.mapping).map(function(e){var r=t.mapping[e];return r instanceof h["default"]?r.solvedPath:t.mapping[e]});return e.reduce(function(e,r){if(r=[].concat(r),f["default"].dynamicPath(r)&&(r=c.getIn(t.tree._data,r).solvedPath),!r)return e;var n=f["default"].monkeyPath(t.tree._monkeys,r);return n?e.concat(c.getIn(t.tree._monkeys,n).data.relatedPaths()):e.concat([r])},[])},e.prototype.getCursors=function(){var t=this,e={};return Object.keys(this.mapping).forEach(function(r){var n=t.mapping[r];n instanceof h["default"]?e[r]=n:e[r]=t.tree.select(n)}),e},e.prototype.refresh=function(t){if(!f["default"].watcherMapping(t))throw c.makeError("Baobab.watch: invalid mapping.",{mapping:t});this.mapping=t;var e={};for(var r in t)e[r]=t[r]instanceof h["default"]?t[r].path:t[r];this.get=this.tree.project.bind(this.tree,e)},e.prototype.release=function(){this.tree.off("update",this.handler),this.state.killed=!0,this.kill()},e}(s["default"]);r["default"]=p,e.exports=r["default"]},{"./cursor":3,"./helpers":4,"./type":6,emmett:1}]},{},[2])(2)});