/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/difflet@1.0.1/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var traverse=require("traverse"),Stream=require("stream").Stream,charm=require("charm"),defaultDeepEqual=require("deep-is"),exports=module.exports=function(e){var t=difflet.bind(null,e);return t.compare=function(t,n){var r=Object.keys(e||{}).reduce((function(t,n){return t[n]=e[n],t}),{}),i=r.stream=new Stream,o="";return i.write=function(e){o+=e},i.end=function(){},i.readable=!0,i.writable=!0,difflet(r,t,n),o},t};function difflet(e,t,n){var r=e.stream||new Stream;e.stream||(r.readable=!0,r.writable=!0,r.write=function(e){this.emit("data",e)},r.end=function(){this.emit("end")}),e||(e={});var i=e.deepEqual||defaultDeepEqual;if(void 0===e.start&&void 0===e.stop){var o=charm(r);e.start=function(e){o.foreground({inserted:"green",updated:"blue",deleted:"red",comment:"cyan"}[e]),o.display("bright")},e.stop=function(e){o.display("reset")}}var a=function(t){e.write?e.write(t,r):r.write(t)},s="first"===e.comma,c=function(t,n){return p.call(this,!0,t,n||e)},d=function(t,n){return p.call(this,!1,t,n||e)},f=0;function u(t){0===f&&e.start(t,r),f++}function l(t){0==--f&&e.stop(t,r)}function p(e,n,r){var o=r.indent,c=function(e){traverse(e).forEach((function(e){d.call(this,e,{indent:o})}))};if(e)var f=traverse.get(t,this.path||[]);var p,h=e&&void 0===f;try{p=o?Array(((this.path||[]).length+1)*o+1).join(" "):""}catch(e){p=""}if(s&&(p=p.slice(o)),Array.isArray(n)){var m=(f||traverse.has(t,this.path))&&!Array.isArray(f);if(m&&u("updated"),r.comment&&!Array.isArray(f)&&(o=0),Array.isArray(f)&&n.length!=f.length&&0==n.length)return a("[\n"),u("deleted"),f.forEach((function(e,t){0!=t&&a(", "),c(e)})),l("deleted"),a(p+"\n]");this.before((function(){h&&u("inserted"),o&&s?0===(this.path||[]).length||Array.isArray(this.parent.node)?a("[ "):a("\n"+p+"[ "):a(o?"[\n"+p:"[")})),this.post((function(e){e.isLast||o&&s||a(",");var t=f&&f[e.key];if(o&&r.comment&&e.node!==t&&("object"!=typeof e.node||"object"!=typeof t)&&(u("comment"),a(" // != "),traverse(t).forEach(c),l("comment")),e.isLast){if(f&&f.length>e.parent.node.length){var n=f.slice(e.key+1);u("deleted"),n.forEach((function(e){a(", "),c(e)})),l("deleted")}}else o&&s?a("\n"+p+", "):o&&a("\n"+p)})),this.after((function(){o&&s?a("\n"+p):o&&a("\n"+p.slice(o)),a("]"),m&&l("updated"),h&&l("inserted")}))}else if(isRegExp(n))this.block(),h?(u("inserted"),a(n.toString()),l("inserted")):e&&f!==n?(u("updated"),a(n.toString()),l("updated")):a(n.toString());else if("object"==typeof n&&n&&"function"==typeof n.inspect)this.block(),h?(u("inserted"),a(n.inspect()),l("inserted")):f&&"function"==typeof f.inspect&&f.inspect()===n.inspect()?a(n.inspect()):(u("updated"),a(n.inspect()),l("updated"));else if("object"==typeof n&&null!==n){var y=!1,v=e&&"object"==typeof f&&f?Object.keys(f).filter((function(e){return!Object.hasOwnProperty.call(n,e)})):[];this.before((function(){h&&u("inserted"),a(o&&s&&!this.isRoot?"\n"+p+"{ ":"{")})),this.pre((function(n,r){e&&(void 0===traverse.get(t,this.path.concat(r))&&(y=!0,u("inserted")));o&&!s&&a("\n"+p),d(r),a(o?" : ":":")})),this.post((function(e){e.isLast||o&&s||a(","),e.isLast&&v.length?(y&&l("inserted"),y=!1):y&&(l("inserted"),y=!1);var t=f&&f[e.key];o&&r.comment&&e.node!==t&&("object"!=typeof e.node||"object"!=typeof t)&&(u("comment"),a(" // != "),traverse(t).forEach((function(e){d.call(this,e,{indent:0})})),l("comment")),e.isLast&&v.length?(y&&l("inserted"),y=!1,o&&s?a("\n"+p+", "):r.comment&&o?a("\n"+p):a(o?",\n"+p:",")):e.isLast||o&&s&&a("\n"+p+", ")})),this.after((function(){h&&l("inserted"),v.length&&(o&&!s&&0===Object.keys(n).length&&a("\n"+p),u("deleted"),v.forEach((function(t,n){o&&r.comment&&(l("deleted"),u("comment"),a("// "),l("comment"),u("deleted")),d(t),a(o?" : ":":"),traverse(f[t]).forEach((function(e){d.call(this,e,{indent:0})}));var i=n===v.length-1;e&&!i&&a(o&&s?"\n"+p+", ":o?",\n"+p:",")})),l("deleted")),a(s&&o?p.slice(o)+" }":o?"\n"+p.slice(o)+"}":"}")}))}else{var g=!1;h?u("inserted"):e&&!i(f,n)&&(g=!0,u("updated")),"string"==typeof n?a('"'+n.toString().replace(/"/g,'\\"')+'"'):isRegExp(n)?a(n.toString()):a("function"==typeof n?n.name?"[Function: "+n.name+"]":"[Function]":void 0===n?"undefined":null===n?"null":n.toString()),h?l("inserted"):g&&l("updated")}}return e.stream?traverse(n).forEach(c):process.nextTick((function(){traverse(n).forEach(c),r.emit("end")})),r}function isRegExp(e){return e instanceof RegExp||e&&"function"==typeof e.test&&"function"==typeof e.exec&&"function"==typeof e.compile&&e.constructor&&"RegExp"===e.constructor.name}exports.compare=function(e,t){return exports({}).compare(e,t)};
//# sourceMappingURL=/sm/d054c531365021dc61f4fe47c7651c362b546f09f8cd2546d0d0ec41765e76ab.map