!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),(e.jsondiffpatch||(e.jsondiffpatch={})).formatters=t()}}(function(){return function t(e,o,n){function r(a,f){if(!o[a]){if(!e[a]){var d="function"==typeof require&&require;if(!f&&d)return d(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var s=o[a]={exports:{}};e[a][0].call(s.exports,function(t){var o=e[a][1][t];return r(o?o:t)},s,s.exports,t,e,o,n)}return o[a].exports}for(var i="function"==typeof require&&require,a=0;a0)){var n=o.shift();n()}},!0),function(t){o.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=o,n.addListener=o,n.once=o,n.off=o,n.removeListener=o,n.removeAllListeners=o,n.emit=o,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],2:[function(t,e,o){var n=t("./base"),r=n.BaseFormatter,i=function(){this.includeMoveDestinations=!1};i.prototype=new r,i.prototype.prepareContext=function(t){r.prototype.prepareContext.call(this,t),t.indent=function(t){this.indentLevel=(this.indentLevel||0)+("undefined"==typeof t?1:t),this.indentPad=new Array(this.indentLevel+1).join("  ")},t.row=function(e,o){t.out('
'),t.out(t.indentPad),t.out('
'),t.out(e),t.out('
'),t.out(o),t.out("
")}},i.prototype.typeFormattterErrorFormatter=function(t,e){t.row("",'
'+e+"
")},i.prototype.formatTextDiffString=function(t,e){var o=this.parseTextDiff(e);t.out('")},i.prototype.rootBegin=function(t,e,o){t.out(''),"node"===e&&(t.row("{"),t.indent()),"array"===o&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")},i.prototype.rootEnd=function(t,e){"node"===e&&(t.indent(-1),t.row("}")),t.out("
")},i.prototype.nodeBegin=function(t,e,o,n,r){t.row("""+e+"": {"),"node"===n&&t.indent(),"array"===r&&t.row('"_t": "a",',"Array delta (member names indicate array indices)")},i.prototype.nodeEnd=function(t,e,o,n,r,i){"node"===n&&t.indent(-1),t.row("}"+(i?"":","))},i.prototype.format_unchanged=function(){},i.prototype.format_movedestination=function(){},i.prototype.format_node=function(t,e,o){this.formatDeltaChildren(t,e,o)};var a=function(t){return'
"'+t+""
"},f={added:function(t,e,o,n){var r="
([newValue])
";return"undefined"==typeof n?"new value"+r:"number"==typeof n?"insert at index "+n+r:"add property "+a(n)+r},modified:function(t,e,o,n){var r="
([previousValue, newValue])
";return"undefined"==typeof n?"modify value"+r:"number"==typeof n?"modify at index "+n+r:"modify property "+a(n)+r},deleted:function(t,e,o,n){var r="
([previousValue, 0, 0])
";return"undefined"==typeof n?"delete value"+r:"number"==typeof n?"remove index "+n+r:"delete property "+a(n)+r},moved:function(t,e,o,n){return'move from index '+n+' to index '+t[1]+""},textdiff:function(t,e,o,n){var r="undefined"==typeof n?"":"number"==typeof n?" at index "+n:" at property "+a(n);return"text diff"+r+', format is a variation of Unidiff'}},d=function(t,e){var o=this.getDeltaType(e),n=f[o],r=n&&n.apply(n,Array.prototype.slice.call(arguments,1)),i=JSON.stringify(e,null,2);"textdiff"===o&&(i=i.split("\\n").join('\\n"+\n "')),t.indent(),t.row(i,r),t.indent(-1)};i.prototype.format_added=d,i.prototype.format_modified=d,i.prototype.format_deleted=d,i.prototype.format_moved=d,i.prototype.format_textdiff=d,o.AnnotatedFormatter=i;var s;o.format=function(t,e){return s||(s=new i),s.format(t,e)}},{"./base":3}],3:[function(t,e,o){var n="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},r="function"==typeof Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];for(var o in t)t.hasOwnProperty(o)&&e.push(o);return e},i=function(t){return"_"===t.substr(0,1)?t.slice(1):t},a=function(t){return"_t"===t?-1:"_"===t.substr(0,1)?parseInt(t.slice(1),10):parseInt(t,10)+.1},f=function(t,e){return a(t)-a(e)},d=function(){};d.prototype.format=function(t,e){var o={};return this.prepareContext(o),this.recurse(o,t,e),this.finalize(o)},d.prototype.prepareContext=function(t){t.buffer=[],t.out=function(){this.buffer.push.apply(this.buffer,arguments)}},d.prototype.typeFormattterNotFound=function(t,e){throw new Error("cannot format delta type: "+e)},d.prototype.typeFormattterErrorFormatter=function(t,e){return e.toString()},d.prototype.finalize=function(t){return n(t.buffer)?t.buffer.join(""):void 0},d.prototype.recurse=function(t,e,o,n,r,i,a){if("undefined"==typeof e&&"undefined"==typeof n)return void 0;var f=this.getDeltaType(e,i),d="node"===f?"a"===e._t?"array":"object":"";"undefined"!=typeof n?this.nodeBegin(t,n,r,f,d,a):this.rootBegin(t,f,d);var s;try{s=this["format_"+f]||this.typeFormattterNotFound(t,f),s.call(this,t,e,o,n,r,i)}catch(p){this.typeFormattterErrorFormatter(t,p,e,o,n,r,i),"undefined"!=typeof console&&console.error&&console.error(p.stack)}"undefined"!=typeof n?this.nodeEnd(t,n,r,f,d,a):this.rootEnd(t,f,d)},d.prototype.formatDeltaChildren=function(t,e,o){var n=this;this.forEachDeltaKey(e,o,function(r,i,a,f){n.recurse(t,e[r],o?o[i]:void 0,r,i,a,f)})},d.prototype.forEachDeltaKey=function(t,e,o){var a,d=r(t),s="a"===t._t,p={};if("undefined"!=typeof e)for(a in e)"undefined"!=typeof t[a]||s&&"undefined"!=typeof t["_"+a]||d.push(a);for(a in t){var u=t[a];n(u)&&3===u[2]&&(p[u[1].toString()]=u[0],this.includeMoveDestinations!==!1&&"undefined"==typeof e&&"undefined"==typeof t[u[1]]&&d.push(u[1].toString()))}s?d.sort(f):d.sort();for(var c=0,l=d.length;l>c;c++){var h=d[c];if(!s||"_t"!==h){var v=s?"number"==typeof h?h:parseInt(i(h),10):h,y=c===l-1;o(h,v,p[v],y)}}},d.prototype.getDeltaType=function(t,e){if("undefined"==typeof t)return"undefined"!=typeof e?"movedestination":"unchanged";if(n(t)){if(1===t.length)return"added";if(2===t.length)return"modified";if(3===t.length&&0===t[2])return"deleted";if(3===t.length&&2===t[2])return"textdiff";if(3===t.length&&3===t[2])return"moved"}else if("object"==typeof t)return"node";return"unknown"},d.prototype.parseTextDiff=function(t){for(var e=[],o=t.split("\n@@ "),n=0,r=o.length;r>n;n++){var i=o[n],a={pieces:[]},f=/^(?:@@ )?[-+]?(\d+),(\d+)/.exec(i).slice(1);a.location={line:f[0],chr:f[1]};for(var d=i.split("\n").slice(1),s=0,p=d.length;p>s;s++){var u=d[s];if(u.length){var c={type:"context"};"+"===u.substr(0,1)?c.type="added":"-"===u.substr(0,1)&&(c.type="deleted"),c.text=u.slice(1),a.pieces.push(c)}}e.push(a)}return e},o.BaseFormatter=d},{}],4:[function(t,e,o){(function(e){o.html=t("./html"),o.annotated=t("./annotated");var n="undefined"!=typeof e&&"string"==typeof e.execPath;n&&(o.console=t("./console"))}).call(this,t("oMfpAn"))},{"./annotated":2,"./html":5,oMfpAn:1}],5:[function(t,e,o){var n=t("./base"),r=n.BaseFormatter,i=function(){};i.prototype=new r,i.prototype.typeFormattterErrorFormatter=function(t,e){t.out('
'+e+"
")},i.prototype.formatValue=function(t,e){t.out("
"+JSON.stringify(e,null,2)+"
")},i.prototype.formatTextDiffString=function(t,e){var o=this.parseTextDiff(e);t.out('")};var a=function(t){t=t||document;var e=function(t){return t.textContent||t.innerText},o=function(t,e,o){for(var n=t.querySelectorAll(e),r=0,i=n.length;i>r;r++)o(n[r])},n=function(t,e){for(var o=0,n=t.children.length;n>o;o++)e(t.children[o],o)};o(t,".jsondiffpatch-arrow",function(t){var o=t.parentNode,r=t.children[0],i=r.children[1];r.style.display="none";var a,f=e(o.querySelector(".jsondiffpatch-moved-destination")),d=o.parentNode;if(n(d,function(t){t.getAttribute("data-key")===f&&(a=t)}),a)try{var s=a.offsetTop-o.offsetTop;r.setAttribute("height",Math.abs(s)+6),t.style.top=-8+(s>0?0:s)+"px";var p=s>0?"M30,0 Q-10,"+Math.round(s/2)+" 26,"+(s-4):"M30,"+-s+" Q-10,"+Math.round(-s/2)+" 26,4";i.setAttribute("d",p),r.style.display=""}catch(u){return}})};i.prototype.rootBegin=function(t,e,o){var n="jsondiffpatch-"+e+(o?" jsondiffpatch-child-node-type-"+o:"");t.out('
')},i.prototype.rootEnd=function(t){t.out("
"+(t.hasArrows?'":""))},i.prototype.nodeBegin=function(t,e,o,n,r){var i="jsondiffpatch-"+n+(r?" jsondiffpatch-child-node-type-"+r:"");t.out('
  • '+o+"
    ")},i.prototype.nodeEnd=function(t){t.out("
  • ")},i.prototype.format_unchanged=function(t,e,o){"undefined"!=typeof o&&(t.out('
    '),this.formatValue(t,o),t.out("
    "))},i.prototype.format_movedestination=function(t,e,o){"undefined"!=typeof o&&(t.out('
    '),this.formatValue(t,o),t.out("
    "))},i.prototype.format_node=function(t,e,o){var n="a"===e._t?"array":"object";t.out('")},i.prototype.format_added=function(t,e){t.out('
    '),this.formatValue(t,e[0]),t.out("
    ")},i.prototype.format_modified=function(t,e){t.out('
    '),this.formatValue(t,e[0]),t.out('
    '),this.formatValue(t,e[1]),t.out("
    ")},i.prototype.format_deleted=function(t,e){t.out('
    '),this.formatValue(t,e[0]),t.out("
    ")},i.prototype.format_moved=function(t,e){t.out('
    '),this.formatValue(t,e[0]),t.out('
    '+e[1]+"
    "),t.out('
    '),t.hasArrows=!0},i.prototype.format_textdiff=function(t,e){t.out('
    '),this.formatTextDiffString(t,e[0]),t.out("
    ")};var f=function(t,e,o){var n=e||document.body,r="jsondiffpatch-unchanged-",i={showing:r+"showing",hiding:r+"hiding",visible:r+"visible",hidden:r+"hidden"},f=n.classList;if(f){if(!o)return f.remove(i.showing),f.remove(i.hiding),f.remove(i.visible),f.remove(i.hidden),void(t===!1&&f.add(i.hidden));t===!1?(f.remove(i.showing),f.add(i.visible),setTimeout(function(){f.add(i.hiding)},10)):(f.remove(i.hiding),f.add(i.showing),f.remove(i.hidden));var d=setInterval(function(){a(n)},100);setTimeout(function(){f.remove(i.showing),f.remove(i.hiding),t===!1?(f.add(i.hidden),f.remove(i.visible)):(f.add(i.visible),f.remove(i.hidden)),setTimeout(function(){f.remove(i.visible),clearInterval(d)},o+400)},o)}},d=function(t,e){return f(!1,t,e)};o.HtmlFormatter=i,o.showUnchanged=f,o.hideUnchanged=d;var s;o.format=function(t,e){return s||(s=new i),s.format(t,e)}},{"./base":3}]},{},[4])(4)});