@cosmicstack/mercury-agent 1.1.7 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -2
- package/dist/index.js +10142 -4331
- package/dist/index.js.map +1 -1
- package/dist/web/static/vendor/geist/Geist-Italic[wght].woff2 +0 -0
- package/dist/web/static/vendor/geist/Geist-Variable.woff2 +0 -0
- package/dist/web/static/vendor/geist/GeistMono-Italic[wght].woff2 +0 -0
- package/dist/web/static/vendor/geist/GeistMono-Variable.woff2 +0 -0
- package/dist/web/static/vendor/graphology.min.js +2 -0
- package/dist/web/static/vendor/icons.svg +108 -0
- package/dist/web/static/vendor/sql-wasm.wasm +0 -0
- package/dist/web/ui/assets/Chat-DCFkzIwn.js +28 -0
- package/dist/web/ui/assets/Chat-DCFkzIwn.js.map +1 -0
- package/dist/web/ui/assets/Dashboard-B81ollv8.js +2 -0
- package/dist/web/ui/assets/Dashboard-B81ollv8.js.map +1 -0
- package/dist/web/ui/assets/Goals-D0cR8yIP.js +12 -0
- package/dist/web/ui/assets/Goals-D0cR8yIP.js.map +1 -0
- package/dist/web/ui/assets/Graph-C3eHp3_J.js +7 -0
- package/dist/web/ui/assets/Graph-C3eHp3_J.js.map +1 -0
- package/dist/web/ui/assets/Kanban-DrkTRyni.js +45 -0
- package/dist/web/ui/assets/Kanban-DrkTRyni.js.map +1 -0
- package/dist/web/ui/assets/Login-GRQ-LjgN.js +2 -0
- package/dist/web/ui/assets/Login-GRQ-LjgN.js.map +1 -0
- package/dist/web/ui/assets/MarkdownRenderer-Dvh1jwyj.js +22 -0
- package/dist/web/ui/assets/MarkdownRenderer-Dvh1jwyj.js.map +1 -0
- package/dist/web/ui/assets/Memory-dAZsKmWz.js +12 -0
- package/dist/web/ui/assets/Memory-dAZsKmWz.js.map +1 -0
- package/dist/web/ui/assets/Permissions-DCiyUUfI.js +17 -0
- package/dist/web/ui/assets/Permissions-DCiyUUfI.js.map +1 -0
- package/dist/web/ui/assets/PersonDetail-iZgApJog.js +2 -0
- package/dist/web/ui/assets/PersonDetail-iZgApJog.js.map +1 -0
- package/dist/web/ui/assets/Persons-Bs_HhYjC.js +2 -0
- package/dist/web/ui/assets/Persons-Bs_HhYjC.js.map +1 -0
- package/dist/web/ui/assets/Providers-CL6wMWni.js +7 -0
- package/dist/web/ui/assets/Providers-CL6wMWni.js.map +1 -0
- package/dist/web/ui/assets/Schedules-BQwE1hP5.js +17 -0
- package/dist/web/ui/assets/Schedules-BQwE1hP5.js.map +1 -0
- package/dist/web/ui/assets/Settings-26SF-okR.js +12 -0
- package/dist/web/ui/assets/Settings-26SF-okR.js.map +1 -0
- package/dist/web/ui/assets/Skills-DANyYK_d.js +7 -0
- package/dist/web/ui/assets/Skills-DANyYK_d.js.map +1 -0
- package/dist/web/ui/assets/Tasks-DbwRozzx.js +7 -0
- package/dist/web/ui/assets/Tasks-DbwRozzx.js.map +1 -0
- package/dist/web/ui/assets/Usage-i_q6Ri4s.js +12 -0
- package/dist/web/ui/assets/Usage-i_q6Ri4s.js.map +1 -0
- package/dist/web/ui/assets/Workspace-ZR5syf-9.js +52 -0
- package/dist/web/ui/assets/Workspace-ZR5syf-9.js.map +1 -0
- package/dist/web/ui/assets/activity-CIP1IzSg.js +7 -0
- package/dist/web/ui/assets/activity-CIP1IzSg.js.map +1 -0
- package/dist/web/ui/assets/alert-dialog-CW-j2nG4.js +7 -0
- package/dist/web/ui/assets/alert-dialog-CW-j2nG4.js.map +1 -0
- package/dist/web/ui/assets/arrow-left-D2YO-iMS.js +7 -0
- package/dist/web/ui/assets/arrow-left-D2YO-iMS.js.map +1 -0
- package/dist/web/ui/assets/avatar-BLsf3GhK.js +7 -0
- package/dist/web/ui/assets/avatar-BLsf3GhK.js.map +1 -0
- package/dist/web/ui/assets/badge-DfDJNUtd.js +2 -0
- package/dist/web/ui/assets/badge-DfDJNUtd.js.map +1 -0
- package/dist/web/ui/assets/button-TaFPR-zy.js +2 -0
- package/dist/web/ui/assets/button-TaFPR-zy.js.map +1 -0
- package/dist/web/ui/assets/card-DAYo4Zl5.js +2 -0
- package/dist/web/ui/assets/card-DAYo4Zl5.js.map +1 -0
- package/dist/web/ui/assets/chevron-down-CQi0yuay.js +12 -0
- package/dist/web/ui/assets/chevron-down-CQi0yuay.js.map +1 -0
- package/dist/web/ui/assets/circle-check-DweDcOkA.js +7 -0
- package/dist/web/ui/assets/circle-check-DweDcOkA.js.map +1 -0
- package/dist/web/ui/assets/circle-x-BmL20etA.js +7 -0
- package/dist/web/ui/assets/circle-x-BmL20etA.js.map +1 -0
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js +2 -0
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js.map +1 -0
- package/dist/web/ui/assets/dialog-DovgkMhT.js +2 -0
- package/dist/web/ui/assets/dialog-DovgkMhT.js.map +1 -0
- package/dist/web/ui/assets/download-_QBatDio.js +7 -0
- package/dist/web/ui/assets/download-_QBatDio.js.map +1 -0
- package/dist/web/ui/assets/eye-Wpgtfmgw.js +7 -0
- package/dist/web/ui/assets/eye-Wpgtfmgw.js.map +1 -0
- package/dist/web/ui/assets/file-text-2EGFNyc1.js +7 -0
- package/dist/web/ui/assets/file-text-2EGFNyc1.js.map +1 -0
- package/dist/web/ui/assets/folder-open-C-OiZn9P.js +7 -0
- package/dist/web/ui/assets/folder-open-C-OiZn9P.js.map +1 -0
- package/dist/web/ui/assets/git-branch-BT9gCKgG.js +7 -0
- package/dist/web/ui/assets/git-branch-BT9gCKgG.js.map +1 -0
- package/dist/web/ui/assets/index-BhxU0YlT.js +163 -0
- package/dist/web/ui/assets/index-BhxU0YlT.js.map +1 -0
- package/dist/web/ui/assets/index-CUT6Fr2C.js +2 -0
- package/dist/web/ui/assets/index-CUT6Fr2C.js.map +1 -0
- package/dist/web/ui/assets/index-DOw1nKre.css +1 -0
- package/dist/web/ui/assets/input-L1uz5xAQ.js +2 -0
- package/dist/web/ui/assets/input-L1uz5xAQ.js.map +1 -0
- package/dist/web/ui/assets/loader-circle-BTFgt3hG.js +7 -0
- package/dist/web/ui/assets/loader-circle-BTFgt3hG.js.map +1 -0
- package/dist/web/ui/assets/pencil-uxK07iYy.js +7 -0
- package/dist/web/ui/assets/pencil-uxK07iYy.js.map +1 -0
- package/dist/web/ui/assets/plus-DcWFYr4m.js +7 -0
- package/dist/web/ui/assets/plus-DcWFYr4m.js.map +1 -0
- package/dist/web/ui/assets/power-DVIqVIMj.js +12 -0
- package/dist/web/ui/assets/power-DVIqVIMj.js.map +1 -0
- package/dist/web/ui/assets/progress-DMwOdxli.js +2 -0
- package/dist/web/ui/assets/progress-DMwOdxli.js.map +1 -0
- package/dist/web/ui/assets/search-D1OOxb1X.js +7 -0
- package/dist/web/ui/assets/search-D1OOxb1X.js.map +1 -0
- package/dist/web/ui/assets/select-Dnx_bUgy.js +2 -0
- package/dist/web/ui/assets/select-Dnx_bUgy.js.map +1 -0
- package/dist/web/ui/assets/send-D4uxqmyH.js +7 -0
- package/dist/web/ui/assets/send-D4uxqmyH.js.map +1 -0
- package/dist/web/ui/assets/sparkles-DLSJA4xU.js +7 -0
- package/dist/web/ui/assets/sparkles-DLSJA4xU.js.map +1 -0
- package/dist/web/ui/assets/switch-CvDDbCUA.js +2 -0
- package/dist/web/ui/assets/switch-CvDDbCUA.js.map +1 -0
- package/dist/web/ui/assets/terminal-DI3J3W_z.js +7 -0
- package/dist/web/ui/assets/terminal-DI3J3W_z.js.map +1 -0
- package/dist/web/ui/assets/textarea-CXLsr8tf.js +2 -0
- package/dist/web/ui/assets/textarea-CXLsr8tf.js.map +1 -0
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js +6 -0
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js.map +1 -0
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js +30 -0
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js.map +1 -0
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js +18 -0
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js.map +1 -0
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js +65 -0
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js.map +1 -0
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js +44 -0
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js.map +1 -0
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js +17 -0
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js.map +1 -0
- package/dist/web/ui/assets/zap-C-0oH5gt.js +7 -0
- package/dist/web/ui/assets/zap-C-0oH5gt.js.map +1 -0
- package/dist/web/ui/favicon.svg +10 -0
- package/dist/web/ui/icons/icon-192.svg +10 -0
- package/dist/web/ui/icons/icon-512-maskable.svg +10 -0
- package/dist/web/ui/icons/icon-512.svg +10 -0
- package/dist/web/ui/index.html +24 -0
- package/dist/web/ui/logo-dark.png +0 -0
- package/dist/web/ui/logo-full-dark.png +0 -0
- package/dist/web/ui/logo-full-light.png +0 -0
- package/dist/web/ui/logo-light.png +0 -0
- package/dist/web/ui/manifest.webmanifest +1 -0
- package/dist/web/ui/registerSW.js +1 -0
- package/dist/web/ui/sw.js +11 -0
- package/dist/web/ui/sw.js.map +1 -0
- package/dist/web/ui/workbox-0bb07689.js +3 -0
- package/dist/web/ui/workbox-0bb07689.js.map +1 -0
- package/package.json +11 -6
- package/src/web/static/vendor/geist/Geist-Italic[wght].woff2 +0 -0
- package/src/web/static/vendor/geist/Geist-Variable.woff2 +0 -0
- package/src/web/static/vendor/geist/GeistMono-Italic[wght].woff2 +0 -0
- package/src/web/static/vendor/geist/GeistMono-Variable.woff2 +0 -0
- package/src/web/static/vendor/graphology.min.js +2 -0
- package/src/web/static/vendor/icons.svg +108 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).graphology=e()}(this,(function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function o(t,e,n){return o=i()?Reflect.construct.bind():function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return o(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),r(a,t)},a(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u=function(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++)if(arguments[e])for(var r in arguments[e])t[r]=arguments[e][r];return t};function d(t,e,n,r){var i=t._nodes.get(e),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function s(e){return"object"===t(e)&&null!==e}function h(t){var e;for(e in t)return!1;return!0}function p(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n})}function f(t,e,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(t,e,r)}function l(t){return!!s(t)&&!(t.attributes&&!Array.isArray(t.attributes))}"function"==typeof Object.assign&&(u=Object.assign);var g,y={exports:{}},w="object"==typeof Reflect?Reflect:null,v=w&&"function"==typeof w.apply?w.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};g=w&&"function"==typeof w.ownKeys?w.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var b=Number.isNaN||function(t){return t!=t};function m(){m.init.call(this)}y.exports=m,y.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}U(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&U(t,"error",e,n)}(t,i,{once:!0})}))},m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var k=10;function _(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function G(t){return void 0===t._maxListeners?m.defaultMaxListeners:t._maxListeners}function x(t,e,n,r){var i,o,a,c;if(_(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=G(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return t}function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=E.bind(r);return i.listener=n,r.wrapFn=i,i}function L(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):D(i,i.length)}function S(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function D(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function U(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o)}))}}function N(t){if("function"!=typeof t)throw new Error("obliterator/iterator: expecting a function!");this.next=t}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return k},set:function(t){if("number"!=typeof t||t<0||b(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");k=t}}),m.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||b(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},m.prototype.getMaxListeners=function(){return G(this)},m.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)v(c,this,e);else{var u=c.length,d=D(c,u);for(n=0;n<u;++n)v(d[n],this,e)}return!0},m.prototype.addListener=function(t,e){return x(this,t,e,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(t,e){return x(this,t,e,!0)},m.prototype.once=function(t,e){return _(e),this.on(t,A(this,t,e)),this},m.prototype.prependOnceListener=function(t,e){return _(e),this.prependListener(t,A(this,t,e)),this},m.prototype.removeListener=function(t,e){var n,r,i,o,a;if(_(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},m.prototype.listeners=function(t){return L(this,t,!0)},m.prototype.rawListeners=function(t){return L(this,t,!1)},m.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):S.call(t,e)},m.prototype.listenerCount=S,m.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]},"undefined"!=typeof Symbol&&(N.prototype[Symbol.iterator]=function(){return this}),N.of=function(){var t=arguments,e=t.length,n=0;return new N((function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}}))},N.empty=function(){return new N((function(){return{done:!0}}))},N.fromSequence=function(t){var e=0,n=t.length;return new N((function(){return e>=n?{done:!0}:{done:!1,value:t[e++]}}))},N.is=function(t){return t instanceof N||"object"==typeof t&&null!==t&&"function"==typeof t.next};var O=N,j={};j.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,j.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var C=O,M=j,z=M.ARRAY_BUFFER_SUPPORT,W=M.SYMBOL_SUPPORT;var P=function(t){var e=function(t){return"string"==typeof t||Array.isArray(t)||z&&ArrayBuffer.isView(t)?C.fromSequence(t):"object"!=typeof t||null===t?null:W&&"function"==typeof t[Symbol.iterator]?t[Symbol.iterator]():"function"==typeof t.next?t:null}(t);if(!e)throw new Error("obliterator: target is not iterable nor a valid iterator.");return e},R=P,K=function(t,e){for(var n,r=arguments.length>1?e:1/0,i=r!==1/0?new Array(r):[],o=0,a=R(t);;){if(o===r)return i;if((n=a.next()).done)return o!==e&&(i.length=o),i;i[o++]=n.value}},T=function(t){function n(e){var n;return(n=t.call(this)||this).name="GraphError",n.message=e,n}return e(n,t),n}(a(Error)),B=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T),F=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T),I=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T);function Y(t,e){this.key=t,this.attributes=e,this.clear()}function q(t,e){this.key=t,this.attributes=e,this.clear()}function J(t,e){this.key=t,this.attributes=e,this.clear()}function V(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r}Y.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}},q.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}},J.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}},V.prototype.attach=function(){var t="out",e="in";this.undirected&&(t=e="undirected");var n=this.source.key,r=this.target.key;this.source[t][r]=this,this.undirected&&n===r||(this.target[e][n]=this)},V.prototype.attachMulti=function(){var t="out",e="in",n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");var i=this.source[t],o=i[r];if(void 0===o)return i[r]=this,void(this.undirected&&n===r||(this.target[e][n]=this));o.previous=this,this.next=o,i[r]=this,this.target[e][n]=this},V.prototype.detach=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t]},V.prototype.detachMulti=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),void 0===this.previous?void 0===this.next?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,void 0!==this.next&&(this.next.previous=this.previous))};function H(t,e,n,r,i,o,a){var c,u,d,s;if(r=""+r,0===n){if(!(c=t._nodes.get(r)))throw new F("Graph.".concat(e,': could not find the "').concat(r,'" node in the graph.'));d=i,s=o}else if(3===n){if(i=""+i,!(u=t._edges.get(i)))throw new F("Graph.".concat(e,': could not find the "').concat(i,'" edge in the graph.'));var h=u.source.key,p=u.target.key;if(r===h)c=u.target;else{if(r!==p)throw new F("Graph.".concat(e,': the "').concat(r,'" node is not attached to the "').concat(i,'" edge (').concat(h,", ").concat(p,")."));c=u.source}d=o,s=a}else{if(!(u=t._edges.get(r)))throw new F("Graph.".concat(e,': could not find the "').concat(r,'" edge in the graph.'));c=1===n?u.source:u.target,d=i,s=o}return[c,d,s]}var Q=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return a.attributes[c]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){return H(this,e,n,t,r)[0].attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return a.attributes.hasOwnProperty(c)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=H(this,e,n,t,r,i,o),c=a[0],u=a[1],d=a[2];return c.attributes[u]=d,this.emit("nodeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:u}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=H(this,e,n,t,r,i,o),c=a[0],u=a[1],d=a[2];if("function"!=typeof d)throw new B("Graph.".concat(e,": updater should be a function."));var s=c.attributes,h=d(s[u]);return s[u]=h,this.emit("nodeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:u}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return delete a.attributes[c],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:c}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if(!s(c))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return a.attributes=c,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if(!s(c))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return u(a.attributes,c),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:c}),this}}},{name:function(t){return"update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if("function"!=typeof c)throw new B("Graph.".concat(e,": provided updater is not a function."));return a.attributes=c(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}}];var X=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes[r]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+t,o=""+arguments[1];if(!(r=d(this,i,o,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(i,'" - "').concat(o,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(r=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return r.attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes.hasOwnProperty(r)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,c=""+r;if(r=arguments[2],i=arguments[3],!(o=d(this,a,c,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return o.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,c=""+r;if(r=arguments[2],i=arguments[3],!(o=d(this,a,c,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof i)throw new B("Graph.".concat(e,": updater should be a function."));return o.attributes[r]=i(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!s(r))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!s(r))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return u(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this}}},{name:function(t){return"update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof r)throw new B("Graph.".concat(e,": provided updater is not a function."));return i.attributes=r(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}}];var Z=O,$=P,tt=function(){var t=arguments,e=null,n=-1;return new Z((function(){for(var r=null;;){if(null===e){if(++n>=t.length)return{done:!0};e=$(t[n])}if(!0!==(r=e.next()).done)break;e=null}return r}))},et=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function nt(t,e,n,r){var i=!1;for(var o in e)if(o!==r){var a=e[o];if(i=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),t&&i)return a.key}}function rt(t,e,n,r){var i,o,a,c=!1;for(var u in e)if(u!==r){i=e[u];do{if(o=i.source,a=i.target,c=n(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),t&&c)return i.key;i=i.next}while(void 0!==i)}}function it(t,e){var n,r=Object.keys(t),i=r.length,o=0;return new O((function(){do{if(n)n=n.next;else{if(o>=i)return{done:!0};var a=r[o++];if(a===e){n=void 0;continue}n=t[a]}}while(!n);return{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function ot(t,e,n,r){var i=e[n];if(i){var o=i.source,a=i.target;return r(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&t?i.key:void 0}}function at(t,e,n,r){var i=e[n];if(i){var o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&o)return i.key;i=i.next}while(void 0!==i)}}function ct(t,e){var n=t[e];return void 0!==n.next?new O((function(){if(!n)return{done:!0};var t={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:t}})):O.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function ut(t,e){if(0===t.size)return[];if("mixed"===e||e===t.type)return"function"==typeof Array.from?Array.from(t._edges.keys()):K(t._edges.keys(),t._edges.size);for(var n,r,i="undirected"===e?t.undirectedSize:t.directedSize,o=new Array(i),a="undirected"===e,c=t._edges.values(),u=0;!0!==(n=c.next()).done;)(r=n.value).undirected===a&&(o[u++]=r.key);return o}function dt(t,e,n,r){if(0!==e.size)for(var i,o,a="mixed"!==n&&n!==e.type,c="undirected"===n,u=!1,d=e._edges.values();!0!==(i=d.next()).done;)if(o=i.value,!a||o.undirected===c){var s=o,h=s.key,p=s.attributes,f=s.source,l=s.target;if(u=r(h,p,f.key,l.key,f.attributes,l.attributes,o.undirected),t&&u)return h}}function st(t,e){if(0===t.size)return O.empty();var n="mixed"!==e&&e!==t.type,r="undirected"===e,i=t._edges.values();return new O((function(){for(var t,e;;){if((t=i.next()).done)return t;if(e=t.value,!n||e.undirected===r)break}return{value:{edge:e.key,attributes:e.attributes,source:e.source.key,target:e.target.key,sourceAttributes:e.source.attributes,targetAttributes:e.target.attributes,undirected:e.undirected},done:!1}}))}function ht(t,e,n,r,i,o){var a,c=e?rt:nt;if("undirected"!==n){if("out"!==r&&(a=c(t,i.in,o),t&&a))return a;if("in"!==r&&(a=c(t,i.out,o,r?void 0:i.key),t&&a))return a}if("directed"!==n&&(a=c(t,i.undirected,o),t&&a))return a}function pt(t,e,n,r){var i=[];return ht(!1,t,e,n,r,(function(t){i.push(t)})),i}function ft(t,e,n){var r=O.empty();return"undirected"!==t&&("out"!==e&&void 0!==n.in&&(r=tt(r,it(n.in))),"in"!==e&&void 0!==n.out&&(r=tt(r,it(n.out,e?void 0:n.key)))),"directed"!==t&&void 0!==n.undirected&&(r=tt(r,it(n.undirected))),r}function lt(t,e,n,r,i,o,a){var c,u=n?at:ot;if("undirected"!==e){if(void 0!==i.in&&"out"!==r&&(c=u(t,i.in,o,a),t&&c))return c;if(void 0!==i.out&&"in"!==r&&(r||i.key!==o)&&(c=u(t,i.out,o,a),t&&c))return c}if("directed"!==e&&void 0!==i.undirected&&(c=u(t,i.undirected,o,a),t&&c))return c}function gt(t,e,n,r,i){var o=[];return lt(!1,t,e,n,r,i,(function(t){o.push(t)})),o}function yt(t,e,n,r){var i=O.empty();return"undirected"!==t&&(void 0!==n.in&&"out"!==e&&r in n.in&&(i=tt(i,ct(n.in,r))),void 0!==n.out&&"in"!==e&&r in n.out&&(e||n.key!==r)&&(i=tt(i,ct(n.out,r)))),"directed"!==t&&void 0!==n.undirected&&r in n.undirected&&(i=tt(i,ct(n.undirected,r))),i}var wt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function vt(){this.A=null,this.B=null}function bt(t,e,n,r,i){for(var o in r){var a=r[o],c=a.source,u=a.target,d=c===n?u:c;if(!e||!e.has(d.key)){var s=i(d.key,d.attributes);if(t&&s)return d.key}}}function mt(t,e,n,r,i){if("mixed"!==e){if("undirected"===e)return bt(t,null,r,r.undirected,i);if("string"==typeof n)return bt(t,null,r,r[n],i)}var o,a=new vt;if("undirected"!==e){if("out"!==n){if(o=bt(t,null,r,r.in,i),t&&o)return o;a.wrap(r.in)}if("in"!==n){if(o=bt(t,a,r,r.out,i),t&&o)return o;a.wrap(r.out)}}if("directed"!==e&&(o=bt(t,a,r,r.undirected,i),t&&o))return o}function kt(t,e,n){var r=Object.keys(n),i=r.length,o=0;return new O((function(){var a=null;do{if(o>=i)return t&&t.wrap(n),{done:!0};var c=n[r[o++]],u=c.source,d=c.target;a=u===e?d:u,t&&t.has(a.key)&&(a=null)}while(null===a);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}))}function _t(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var r=[];return mt(!1,t,e,n,(function(t){r.push(t)})),r}("mixed"===r?this.type:r,i,e)}}function Gt(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return O.empty();t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return kt(null,n,n.undirected);if("string"==typeof e)return kt(null,n,n[e])}var r=O.empty(),i=new vt;return"undirected"!==t&&("out"!==e&&(r=tt(r,kt(i,n,n.in))),"in"!==e&&(r=tt(r,kt(i,n,n.out)))),"directed"!==t&&(r=tt(r,kt(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,e)}}function xt(t,e,n,r,i){for(var o,a,c,u,d,s,h,p=r._nodes.values(),f=r.type;!0!==(o=p.next()).done;){var l=!1;if(a=o.value,"undirected"!==f)for(c in u=a.out){d=u[c];do{if(s=d.target,l=!0,h=i(a.key,s.key,a.attributes,s.attributes,d.key,d.attributes,d.undirected),t&&h)return d;d=d.next}while(d)}if("directed"!==f)for(c in u=a.undirected)if(!(e&&a.key>c)){d=u[c];do{if((s=d.target).key!==c&&(s=d.source),l=!0,h=i(a.key,s.key,a.attributes,s.attributes,d.key,d.attributes,d.undirected),t&&h)return d;d=d.next}while(d)}if(n&&!l&&(h=i(a.key,null,a.attributes,null,null,null,null),t&&h))return null}}function Et(t){if(!s(t))throw new B('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new B("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!s(t.attributes)||null===t.attributes))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function At(t){if(!s(t))throw new B('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new B("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new B("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!s(t.attributes)||null===t.attributes))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&"boolean"!=typeof t.undirected)throw new B("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}vt.prototype.wrap=function(t){null===this.A?this.A=t:null===this.B&&(this.B=t)},vt.prototype.has=function(t){return null!==this.A&&t in this.A||null!==this.B&&t in this.B};var Lt,St=(Lt=255&Math.floor(256*Math.random()),function(){return Lt++}),Dt=new Set(["directed","undirected","mixed"]),Ut=new Set(["domain","_events","_eventsCount","_maxListeners"]),Nt={allowSelfLoops:!0,multi:!1,type:"mixed"};function Ot(t,e,n){var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function jt(t,e,n,r,i,o,a,c){if(!r&&"undirected"===t.type)throw new I("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new I("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!s(c))throw new B("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!t.allowSelfLoops&&o===a)throw new I("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=t._nodes.get(o),d=t._nodes.get(a);if(!u)throw new F("Graph.".concat(e,': source node "').concat(o,'" not found.'));if(!d)throw new F("Graph.".concat(e,': target node "').concat(a,'" not found.'));var h={key:null,undirected:r,source:o,target:a,attributes:c};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new I("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));if(!t.multi&&(r?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new I("Graph.".concat(e,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var p=new V(r,i,u,d,c);t._edges.set(i,p);var f=o===a;return r?(u.undirectedDegree++,d.undirectedDegree++,f&&(u.undirectedLoops++,t._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,f&&(u.directedLoops++,t._directedSelfLoopCount++)),t.multi?p.attachMulti():p.attach(),r?t._undirectedSize++:t._directedSize++,h.key=i,t.emit("edgeAdded",h),i}function Ct(t,e,n,r,i,o,a,c,d){if(!r&&"undirected"===t.type)throw new I("Graph.".concat(e,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new I("Graph.".concat(e,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(c)if(d){if("function"!=typeof c)throw new B("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(c,'"'))}else if(!s(c))throw new B("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(c,'"'));var h;if(o=""+o,a=""+a,d&&(h=c,c=void 0),!t.allowSelfLoops&&o===a)throw new I("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var p,f,l=t._nodes.get(o),g=t._nodes.get(a);if(!n&&(p=t._edges.get(i))){if(!(p.source.key===o&&p.target.key===a||r&&p.source.key===a&&p.target.key===o))throw new I("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(p.source.key,'", "').concat(p.target.key,'").'));f=p}if(f||t.multi||!l||(f=r?l.undirected[a]:l.out[a]),f){var y=[f.key,!1,!1,!1];if(d?!h:!c)return y;if(d){var w=f.attributes;f.attributes=h(w),t.emit("edgeAttributesUpdated",{type:"replace",key:f.key,attributes:f.attributes})}else u(f.attributes,c),t.emit("edgeAttributesUpdated",{type:"merge",key:f.key,attributes:f.attributes,data:c});return y}c=c||{},d&&h&&(c=h(c));var v={key:null,undirected:r,source:o,target:a,attributes:c};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new I("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));var b=!1,m=!1;l||(l=Ot(t,o,{}),b=!0,o===a&&(g=l,m=!0)),g||(g=Ot(t,a,{}),m=!0),p=new V(r,i,l,g,c),t._edges.set(i,p);var k=o===a;return r?(l.undirectedDegree++,g.undirectedDegree++,k&&(l.undirectedLoops++,t._undirectedSelfLoopCount++)):(l.outDegree++,g.inDegree++,k&&(l.directedLoops++,t._directedSelfLoopCount++)),t.multi?p.attachMulti():p.attach(),r?t._undirectedSize++:t._directedSize++,v.key=i,t.emit("edgeAdded",v),[i,!0,b,m]}function Mt(t,e){t._edges.delete(e.key);var n=e.source,r=e.target,i=e.attributes,o=e.undirected,a=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,a&&(n.undirectedLoops--,t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,a&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),o?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:o})}var zt=function(n){function r(t){var e;if(e=n.call(this)||this,"boolean"!=typeof(t=u({},Nt,t)).multi)throw new B("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!Dt.has(t.type))throw new B('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new B("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?Y:"directed"===t.type?q:J;p(c(e),"NodeDataClass",r);var i="geid_"+St()+"_",o=0;return p(c(e),"_attributes",{}),p(c(e),"_nodes",new Map),p(c(e),"_edges",new Map),p(c(e),"_directedSize",0),p(c(e),"_undirectedSize",0),p(c(e),"_directedSelfLoopCount",0),p(c(e),"_undirectedSelfLoopCount",0),p(c(e),"_edgeKeyGenerator",(function(){var t;do{t=i+o++}while(e._edges.has(t));return t})),p(c(e),"_options",t),Ut.forEach((function(t){return p(c(e),t,e[t])})),f(c(e),"order",(function(){return e._nodes.size})),f(c(e),"size",(function(){return e._edges.size})),f(c(e),"directedSize",(function(){return e._directedSize})),f(c(e),"undirectedSize",(function(){return e._undirectedSize})),f(c(e),"selfLoopCount",(function(){return e._directedSelfLoopCount+e._undirectedSelfLoopCount})),f(c(e),"directedSelfLoopCount",(function(){return e._directedSelfLoopCount})),f(c(e),"undirectedSelfLoopCount",(function(){return e._undirectedSelfLoopCount})),f(c(e),"multi",e._options.multi),f(c(e),"type",e._options.type),f(c(e),"allowSelfLoops",e._options.allowSelfLoops),f(c(e),"implementation",(function(){return"graphology"})),e}e(r,n);var i=r.prototype;return i._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return!!r&&!r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return!!i&&i.out.hasOwnProperty(e)}throw new B("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return!!r&&r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return!!i&&i.undirected.hasOwnProperty(e)}throw new B("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length){var n=""+t;return this._edges.has(n)}if(2===arguments.length){t=""+t,e=""+e;var r=this._nodes.get(t);return!!r&&(void 0!==r.out&&r.out.hasOwnProperty(e)||void 0!==r.undirected&&r.undirected.hasOwnProperty(e))}throw new B("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new I("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new F('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new I("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new F('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.undirected&&n.undirected[e]||void 0;return r?r.key:void 0}},i.edge=function(t,e){if(this.multi)throw new I("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(r)return r.key},i.areDirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areDirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&(e in n.in||e in n.out)},i.areOutNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areOutNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.out},i.areInNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areInNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.in},i.areUndirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areUndirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"directed"!==this.type&&e in n.undirected},i.areNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&(e in n.in||e in n.out)||"directed"!==this.type&&e in n.undirected},i.areInboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areInboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.in||"directed"!==this.type&&e in n.undirected},i.areOutboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areOutboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.out||"directed"!==this.type&&e in n.undirected},i.inDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree},i.outDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.outDegree},i.directedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree+e.outDegree},i.undirectedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:e.undirectedDegree},i.inboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree),n},i.outboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.outDegree),n},i.degree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree),n},i.inDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree-e.directedLoops},i.outDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.outDegree-e.directedLoops},i.directedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree+e.outDegree-2*e.directedLoops},i.undirectedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:e.undirectedDegree-2*e.undirectedLoops},i.inboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree,r+=e.directedLoops),n-r},i.outboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.outDegree,r+=e.directedLoops),n-r},i.degreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.degreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree,r+=2*e.directedLoops),n-r},i.source=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return[e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t,e=""+e;var n=this._edges.get(e);if(!n)throw new F('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(t===r)return i;if(t===i)return r;throw new F('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(r,", ").concat(i,")."))},i.hasExtremity=function(t,e){t=""+t,e=""+e;var n=this._edges.get(t);if(!n)throw new F('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return!e.undirected},i.isSelfLoop=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.addNode=function(t,e){var n=function(t,e,n){if(n&&!s(n))throw new B('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(e=""+e,n=n||{},t._nodes.has(e))throw new I('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}(this,t,e);return n.key},i.mergeNode=function(t,e){if(e&&!s(e))throw new B('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));t=""+t,e=e||{};var n=this._nodes.get(t);return n?(e&&(u(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),[t,!1]):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),[t,!0])},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new B('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));t=""+t;var n=this._nodes.get(t);if(n){if(e){var r=n.attributes;n.attributes=e(r),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes})}return[t,!1]}var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]},i.dropNode=function(t){t=""+t;var e,n=this._nodes.get(t);if(!n)throw new F('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));if("undirected"!==this.type){for(var r in n.out){e=n.out[r];do{Mt(this,e),e=e.next}while(e)}for(var i in n.in){e=n.in[i];do{Mt(this,e),e=e.next}while(e)}}if("directed"!==this.type)for(var o in n.undirected){e=n.undirected[o];do{Mt(this,e),e=e.next}while(e)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(e=d(this,n,r,this.type)))throw new F('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(t=""+t,!(e=this._edges.get(t)))throw new F('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));return Mt(this,e),this},i.dropDirectedEdge=function(t,e){if(arguments.length<2)throw new I("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=d(this,t=""+t,e=""+e,"directed");if(!n)throw new F('Graph.dropDirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return Mt(this,n),this},i.dropUndirectedEdge=function(t,e){if(arguments.length<2)throw new I("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=d(this,t,e,"undirected");if(!n)throw new F('Graph.dropUndirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return Mt(this,n),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},i.clearEdges=function(){for(var t,e=this._nodes.values();!0!==(t=e.next()).done;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new B("Graph.updateAttribute: updater should be a function.");var n=this._attributes[t];return this._attributes[t]=e(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!s(t))throw new B("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!s(t))throw new B("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.updateAttributes=function(t){if("function"!=typeof t)throw new B("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new B("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!l(e))throw new B("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=t(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null})},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new B("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!l(e))throw new B("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i,o,a=this._edges.values();!0!==(n=a.next()).done;)i=(r=n.value).source,o=r.target,r.attributes=t(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:e||null})},i.forEachAdjacencyEntry=function(t){if("function"!=typeof t)throw new B("Graph.forEachAdjacencyEntry: expecting a callback.");xt(!1,!1,!1,this,t)},i.forEachAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new B("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");xt(!1,!1,!0,this,t)},i.forEachAssymetricAdjacencyEntry=function(t){if("function"!=typeof t)throw new B("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");xt(!1,!0,!1,this,t)},i.forEachAssymetricAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new B("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");xt(!1,!0,!0,this,t)},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):K(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new B("Graph.forEachNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes)},i.findNode=function(t){if("function"!=typeof t)throw new B("Graph.findNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return n.key},i.mapNodes=function(t){if("function"!=typeof t)throw new B("Graph.mapNode: expecting a callback.");for(var e,n,r=this._nodes.values(),i=new Array(this.order),o=0;!0!==(e=r.next()).done;)n=e.value,i[o++]=t(n.key,n.attributes);return i},i.someNode=function(t){if("function"!=typeof t)throw new B("Graph.someNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return!0;return!1},i.everyNode=function(t){if("function"!=typeof t)throw new B("Graph.everyNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(!t((n=e.value).key,n.attributes))return!1;return!0},i.filterNodes=function(t){if("function"!=typeof t)throw new B("Graph.filterNodes: expecting a callback.");for(var e,n,r=this._nodes.values(),i=[];!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes)&&i.push(n.key);return i},i.reduceNodes=function(t,e){if("function"!=typeof t)throw new B("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new B("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,r,i=e,o=this._nodes.values();!0!==(n=o.next()).done;)i=t(i,(r=n.value).key,r.attributes);return i},i.nodeEntries=function(){var t=this._nodes.values();return new O((function(){var e=t.next();if(e.done)return e;var n=e.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},i.export=function(){var t=this,e=new Array(this._nodes.size),n=0;this._nodes.forEach((function(t,r){e[n++]=function(t,e){var n={key:t};return h(e.attributes)||(n.attributes=u({},e.attributes)),n}(r,t)}));var r=new Array(this._edges.size);return n=0,this._edges.forEach((function(e,i){r[n++]=function(t,e,n){var r={key:e,source:n.source.key,target:n.target.key};return h(n.attributes)||(r.attributes=u({},n.attributes)),"mixed"===t&&n.undirected&&(r.undirected=!0),r}(t.type,i,e)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}},i.import=function(t){var e,n,i,o,a,c=this,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t instanceof r)return t.forEachNode((function(t,e){u?c.mergeNode(t,e):c.addNode(t,e)})),t.forEachEdge((function(t,e,n,r,i,o,a){u?a?c.mergeUndirectedEdgeWithKey(t,n,r,e):c.mergeDirectedEdgeWithKey(t,n,r,e):a?c.addUndirectedEdgeWithKey(t,n,r,e):c.addDirectedEdgeWithKey(t,n,r,e)})),this;if(!s(t))throw new B("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!s(t.attributes))throw new B("Graph.import: invalid attributes. Expecting a plain object.");u?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new B("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;e<n;e++){Et(o=i[e]);var d=o,h=d.key,p=d.attributes;u?this.mergeNode(h,p):this.addNode(h,p)}}if(t.edges){var f=!1;if("undirected"===this.type&&(f=!0),i=t.edges,!Array.isArray(i))throw new B("Graph.import: invalid edges. Expecting an array.");for(e=0,n=i.length;e<n;e++){At(a=i[e]);var l=a,g=l.source,y=l.target,w=l.attributes,v=l.undirected,b=void 0===v?f:v;"key"in a?(u?b?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:b?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,a.key,g,y,w):(u?b?this.mergeUndirectedEdge:this.mergeDirectedEdge:b?this.addUndirectedEdge:this.addDirectedEdge).call(this,g,y,w)}}return this},i.nullCopy=function(t){var e=new r(u({},this._options,t));return e.replaceAttributes(u({},this.getAttributes())),e},i.emptyCopy=function(t){var e=this.nullCopy(t);return this._nodes.forEach((function(t,n){var r=u({},t.attributes);t=new e.NodeDataClass(n,r),e._nodes.set(n,t)})),e},i.copy=function(t){if("string"==typeof(t=t||{}).type&&t.type!==this.type&&"mixed"!==t.type)throw new I('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(t.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof t.multi&&t.multi!==this.multi&&!0!==t.multi)throw new I("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof t.allowSelfLoops&&t.allowSelfLoops!==this.allowSelfLoops&&!0!==t.allowSelfLoops)throw new I("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var e,n,r=this.emptyCopy(t),i=this._edges.values();!0!==(e=i.next()).done;)jt(r,"copy",!1,(n=e.value).undirected,n.key,n.source.key,n.target.key,u({},n.attributes));return r},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var e=this,n={};this._nodes.forEach((function(t,e){n[e]=t.attributes}));var r={},i={};this._edges.forEach((function(t,n){var o,a=t.undirected?"--":"->",c="",u=t.source.key,d=t.target.key;t.undirected&&u>d&&(o=u,u=d,d=o);var s="(".concat(u,")").concat(a,"(").concat(d,")");n.startsWith("geid_")?e.multi&&(void 0===i[s]?i[s]=0:i[s]++,c+="".concat(i[s],". ")):c+="[".concat(n,"]: "),r[c+=s]=t.attributes}));var o={};for(var a in this)this.hasOwnProperty(a)&&!Ut.has(a)&&"function"!=typeof this[a]&&"symbol"!==t(a)&&(o[a]=this[a]);return o.attributes=this._attributes,o.nodes=n,o.edges=r,p(o,"constructor",this.constructor),o},r}(y.exports.EventEmitter);"undefined"!=typeof Symbol&&(zt.prototype[Symbol.for("nodejs.util.inspect.custom")]=zt.prototype.inspect),[{name:function(t){return"".concat(t,"Edge")},generateKey:!0},{name:function(t){return"".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return"".concat(t,"EdgeWithKey")}},{name:function(t){return"".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(t){["add","merge","update"].forEach((function(e){var n=t.name(e),r="add"===e?jt:Ct;t.generateKey?zt.prototype[n]=function(i,o,a){return r(this,n,!0,"undirected"===(t.type||this.type),null,i,o,a,"update"===e)}:zt.prototype[n]=function(i,o,a,c){return r(this,n,!1,"undirected"===(t.type||this.type),i,o,a,c,"update"===e)}}))})),function(t){Q.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Node"),0),r(t,n("Source"),1),r(t,n("Target"),2),r(t,n("Opposite"),3)}))}(zt),function(t){X.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Edge"),"mixed"),r(t,n("DirectedEdge"),"directed"),r(t,n("UndirectedEdge"),"undirected")}))}(zt),function(t){et.forEach((function(e){!function(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return ut(this,r);if(1===arguments.length){t=""+t;var o=this._nodes.get(t);if(void 0===o)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return pt(this.multi,"mixed"===r?this.type:r,i,o)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(n,': could not find the "').concat(e,'" target node in the graph.'));return gt(r,this.multi,i,a,e)}throw new B("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return dt(!1,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!1,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var c=this._nodes.get(t);if(!c)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return lt(!1,r,this.multi,i,c,e,n)}throw new B("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){var t,e=Array.prototype.slice.call(arguments),n=e.pop();if(0===e.length){var i=0;"directed"!==r&&(i+=this.undirectedSize),"undirected"!==r&&(i+=this.directedSize),t=new Array(i);var a=0;e.push((function(e,r,i,o,c,u,d){t[a++]=n(e,r,i,o,c,u,d)}))}else t=[],e.push((function(e,r,i,o,a,c,u){t.push(n(e,r,i,o,a,c,u))}));return this[o].apply(this,e),t};var c="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[c]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=[];return t.push((function(t,r,i,o,a,c,u){e(t,r,i,o,a,c,u)&&n.push(t)})),this[o].apply(this,t),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(){var t,e,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new B("Graph.".concat(u,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new B("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(t=n[0],e=n[1],n=[]):3===n.length?(t=n[1],e=n[2],n=[n[0]]):4===n.length&&(t=n[2],e=n[3],n=[n[0],n[1]]);var r=e;return n.push((function(e,n,i,o,a,c,u){r=t(r,e,n,i,o,a,c,u)})),this[o].apply(this,n),r}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return!1;if(1===arguments.length)return dt(!0,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!0,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var c=this._nodes.get(t);if(!c)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return lt(!0,r,this.multi,i,c,e,n)}throw new B("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var a="some"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,c){return e(t,n,r,i,o,a,c)})),!!this[o].apply(this,t)};var c="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[c]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,c){return!e(t,n,r,i,o,a,c)})),!this[o].apply(this,t)}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return O.empty();if(!arguments.length)return st(this,r);if(1===arguments.length){t=""+t;var n=this._nodes.get(t);if(!n)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ft(r,i,n)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return yt(r,i,a,e)}throw new B("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e)}))}(zt),function(t){wt.forEach((function(e){_t(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));mt(!1,"mixed"===r?this.type:r,i,n,e)}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(t,e){var n=[];return this[o](t,(function(t,r){n.push(e(t,r))})),n};var c="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[c]=function(t,e){var n=[];return this[o](t,(function(t,r){e(t,r)&&n.push(t)})),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(t,e,n){if(arguments.length<3)throw new B("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var r=n;return this[o](t,(function(t,n){r=e(r,t,n)})),r}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n[0].toUpperCase()+n.slice(1,-1),a="find"+o;t.prototype[a]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new F("Graph.".concat(a,': could not find the "').concat(t,'" node in the graph.'));return mt(!0,"mixed"===r?this.type:r,i,n,e)}};var c="some"+o;t.prototype[c]=function(t,e){return!!this[a](t,e)};var u="every"+o;t.prototype[u]=function(t,e){return!this[a](t,(function(t,n){return!e(t,n)}))}}(t,e),Gt(t,e)}))}(zt);var Wt=function(t){function n(e){var n=u({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new B("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new B('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Pt=function(t){function n(e){var n=u({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new B("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new B('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Rt=function(t){function n(e){var n=u({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new B("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}(zt),Kt=function(t){function n(e){var n=u({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new B("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new B('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Tt=function(t){function n(e){var n=u({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new B("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new B('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt);function Bt(t){t.from=function(e,n){var r=u({},e.options,n),i=new t(r);return i.import(e),i}}return Bt(zt),Bt(Wt),Bt(Pt),Bt(Rt),Bt(Kt),Bt(Tt),zt.Graph=zt,zt.DirectedGraph=Wt,zt.UndirectedGraph=Pt,zt.MultiGraph=Rt,zt.MultiDirectedGraph=Kt,zt.MultiUndirectedGraph=Tt,zt.InvalidArgumentsGraphError=B,zt.NotFoundGraphError=F,zt.UsageGraphError=I,zt}));
|
|
2
|
+
//# sourceMappingURL=graphology.umd.min.js.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
2
|
+
<symbol id="activity" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
3
|
+
<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.46 7.36a1 1 0 0 1-1.9 0L9.72 4.18a1 1 0 0 0-1.9 0L5.36 13.54A2 2 0 0 1 3.43 15H2"/>
|
|
4
|
+
</symbol>
|
|
5
|
+
<symbol id="message-circle" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
6
|
+
<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>
|
|
7
|
+
</symbol>
|
|
8
|
+
<symbol id="brain" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
9
|
+
<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.773 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18"/>
|
|
10
|
+
<path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.773 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18"/>
|
|
11
|
+
<path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/>
|
|
12
|
+
<path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/>
|
|
13
|
+
<path d="M6.003 5.125a3 3 0 0 0 .399 1.375"/>
|
|
14
|
+
</symbol>
|
|
15
|
+
<symbol id="users" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
16
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/>
|
|
17
|
+
<circle cx="9" cy="7" r="4"/>
|
|
18
|
+
<path d="M22 21v-2a4 4 0 0 0-3-3.87"/>
|
|
19
|
+
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
|
|
20
|
+
</symbol>
|
|
21
|
+
<symbol id="target" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
22
|
+
<circle cx="12" cy="12" r="10"/>
|
|
23
|
+
<circle cx="12" cy="12" r="6"/>
|
|
24
|
+
<circle cx="12" cy="12" r="2"/>
|
|
25
|
+
</symbol>
|
|
26
|
+
<symbol id="network" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
27
|
+
<rect x="14" y="14" width="4" height="4" rx="1"/>
|
|
28
|
+
<rect x="6" y="14" width="4" height="4" rx="1"/>
|
|
29
|
+
<rect x="10" y="6" width="4" height="4" rx="1"/>
|
|
30
|
+
<path d="M14 10h2v4"/>
|
|
31
|
+
<path d="M10 10H8v4"/>
|
|
32
|
+
<path d="M12 10v4"/>
|
|
33
|
+
</symbol>
|
|
34
|
+
<symbol id="key" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
35
|
+
<path d="m21 2-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.78 7.78 5.5 5.5 0 0 1 7.78-7.78Zm0 0L15.5 7.5m0 0 3 3L22 7l-3-3m-3.5 3.5L19 4"/>
|
|
36
|
+
</symbol>
|
|
37
|
+
<symbol id="puzzle" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
38
|
+
<path d="M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.5 2.5 0 1 0-3.214 3.214c.446.166.854.497.925.968a1 1 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.704.704 2.402 2.402 0 0 1-1.704-.704l-1.568-1.567a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.04.96a2.5 2.5 0 0 1-3.238-3.237c.456-.199.886-.547.96-1.04a1.026 1.026 0 0 0-.291-.877l-1.567-1.569a2.402 2.402 0 0 1 0-3.407l1.61-1.611a1 1 0 0 1 .837-.276c.47.07.802.48.968.925a2.501 2.501 0 1 0 3.214-3.214c-.446-.166-.854-.497-.925-.968a.98.98 0 0 1 .276-.837l1.611-1.611a2.402 2.402 0 0 1 3.407 0l1.568 1.567a1.026 1.026 0 0 0 .877.29c.493-.074.84-.504 1.04-.96a2.5 2.5 0 0 1 3.238 3.237c-.456.199-.886.547-.96 1.04Z"/>
|
|
39
|
+
</symbol>
|
|
40
|
+
<symbol id="shield" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
41
|
+
<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-3 6.892-3 1 0 1.108.999 2.108.999C16.5 3 18 5 19 5a1 1 0 0 1 1 1z"/>
|
|
42
|
+
</symbol>
|
|
43
|
+
<symbol id="clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
44
|
+
<circle cx="12" cy="12" r="10"/>
|
|
45
|
+
<polyline points="12 6 12 12 16 14"/>
|
|
46
|
+
</symbol>
|
|
47
|
+
<symbol id="bar-chart-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
48
|
+
<path d="M3 3v18h18"/>
|
|
49
|
+
<path d="M18 17V9"/>
|
|
50
|
+
<path d="M13 17V5"/>
|
|
51
|
+
<path d="M8 17v-3"/>
|
|
52
|
+
</symbol>
|
|
53
|
+
<symbol id="settings" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
54
|
+
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
|
|
55
|
+
<circle cx="12" cy="12" r="3"/>
|
|
56
|
+
</symbol>
|
|
57
|
+
<symbol id="log-out" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
58
|
+
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/>
|
|
59
|
+
<polyline points="16 17 21 12 16 7"/>
|
|
60
|
+
<line x1="21" y1="12" x2="9" y2="12"/>
|
|
61
|
+
</symbol>
|
|
62
|
+
<symbol id="sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
63
|
+
<circle cx="12" cy="12" r="4"/>
|
|
64
|
+
<path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/>
|
|
65
|
+
</symbol>
|
|
66
|
+
<symbol id="moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
67
|
+
<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>
|
|
68
|
+
</symbol>
|
|
69
|
+
<symbol id="arrow-left" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
70
|
+
<path d="m12 19-7-7 7-7M19 12H5"/>
|
|
71
|
+
</symbol>
|
|
72
|
+
<symbol id="send" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
73
|
+
<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>
|
|
74
|
+
</symbol>
|
|
75
|
+
<symbol id="chevron-down" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
76
|
+
<path d="m6 9 6 6 6-6"/>
|
|
77
|
+
</symbol>
|
|
78
|
+
<symbol id="x" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
79
|
+
<path d="M18 6 6 18M6 6l12 12"/>
|
|
80
|
+
</symbol>
|
|
81
|
+
<symbol id="plus" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
82
|
+
<path d="M5 12h14M12 5v14"/>
|
|
83
|
+
</symbol>
|
|
84
|
+
<symbol id="search" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
85
|
+
<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>
|
|
86
|
+
</symbol>
|
|
87
|
+
<symbol id="trash" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
88
|
+
<path d="M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
|
|
89
|
+
</symbol>
|
|
90
|
+
<symbol id="check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
91
|
+
<path d="M20 6 9 17l-5-5"/>
|
|
92
|
+
</symbol>
|
|
93
|
+
<symbol id="refresh" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
94
|
+
<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/>
|
|
95
|
+
<path d="M21 3v5h-5"/>
|
|
96
|
+
<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/>
|
|
97
|
+
<path d="M8 16H3v5"/>
|
|
98
|
+
</symbol>
|
|
99
|
+
<symbol id="panel-left-close" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
100
|
+
<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>
|
|
101
|
+
</symbol>
|
|
102
|
+
<symbol id="panel-left-open" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
103
|
+
<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="m14 9 3 3-3 3"/>
|
|
104
|
+
</symbol>
|
|
105
|
+
<symbol id="download" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
106
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>
|
|
107
|
+
</symbol>
|
|
108
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{j as e,m as A,A as $}from"./vendor-motion-Dwx3-JO5.js";import{r as d,j as pe,e as fe}from"./vendor-react-C7pctHW3.js";import{e as E,S as V,M as X,c as j,a as k,X as Z,g as J,u as Y,h as ge,i as be}from"./index-BhxU0YlT.js";import{B as C}from"./button-TaFPR-zy.js";import{P as ye}from"./progress-DMwOdxli.js";import{A as je,F as ve,o as we,u as y,M as Q,C as Ne,a as ke,b as Se}from"./MarkdownRenderer-Dvh1jwyj.js";import{A as Ce,a as Te,b as De,c as Me,d as Ae,e as Pe,f as Le,g as Be,T as ze}from"./alert-dialog-CW-j2nG4.js";import{P as $e}from"./plus-DcWFYr4m.js";import{L as M}from"./loader-circle-BTFgt3hG.js";import{h as Ee}from"./vendor-syntax-xZUI6Op9.js";import{B as Ie}from"./badge-DfDJNUtd.js";import{f as Oe,g as Re,h as Fe,i as ee}from"./vendor-radix-3UdfCgs_.js";import{C as Ue,a as R}from"./chevron-down-CQi0yuay.js";import{C as We,a as _e,b as qe}from"./collapsible-BU_K9n8f.js";import{C as He}from"./circle-x-BmL20etA.js";import{C as Ge}from"./circle-check-DweDcOkA.js";import{F as Ke}from"./folder-open-C-OiZn9P.js";import{Z as Ve}from"./zap-C-0oH5gt.js";import{S as Xe}from"./send-D4uxqmyH.js";import"./index-CUT6Fr2C.js";import"./vendor-markdown-DwTbvico.js";/**
|
|
2
|
+
* @license lucide-react v0.511.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ze=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],Je=E("file",Ze);/**
|
|
7
|
+
* @license lucide-react v0.511.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ye=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Qe=E("panel-left-close",Ye);/**
|
|
12
|
+
* @license lucide-react v0.511.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],tt=E("panel-left-open",et);/**
|
|
17
|
+
* @license lucide-react v0.511.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const st=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],at=E("wrench",st);function G({threads:t,activeThreadId:i,onSelect:r,onDelete:c,onNew:a,onExport:l}){const[o,m]=d.useState(null);function p(h){const f=new Date(h),w=new Date().getTime()-f.getTime(),N=Math.floor(w/(1e3*60*60*24));return N===0?f.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):N===1?"Yesterday":N<7?`${N} days ago`:f.toLocaleDateString(void 0,{month:"short",day:"numeric"})}return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Conversations"}),e.jsxs(C,{size:"sm",onClick:a,className:"h-7 gap-1 px-2 text-xs",children:[e.jsx($e,{className:"h-3.5 w-3.5"}),"New Chat"]})]}),e.jsx(V,{className:"flex-1",children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center",children:[e.jsx(X,{className:"h-8 w-8 text-muted-foreground/40"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No conversations yet"})]}):e.jsx("div",{className:"p-2",children:t.map(h=>{const f=h.id===i;return e.jsx(rt,{thread:h,isActive:f,formatDate:p,onSelect:()=>r(h.id),onDelete:()=>m(h.id),onExport:()=>l(h.id)},h.id)})})}),e.jsx(Ce,{open:o!==null,onOpenChange:h=>{h||m(null)},children:e.jsxs(Te,{children:[e.jsxs(De,{children:[e.jsx(Me,{children:"Delete conversation?"}),e.jsx(Ae,{children:"This will permanently remove this conversation and all its messages. This action cannot be undone."})]}),e.jsxs(Pe,{children:[e.jsx(Le,{children:"Cancel"}),e.jsx(Be,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{o&&(c(o),m(null))},children:"Delete"})]})]})})]})}function rt({thread:t,isActive:i,formatDate:r,onSelect:c,onDelete:a,onExport:l}){return e.jsxs("div",{onClick:c,className:j("group flex w-full cursor-pointer items-center rounded-lg pl-2 pr-1 py-2 text-left transition-all duration-150",i?"border-l-2 border-l-primary bg-primary/10 text-foreground":"border-l-2 border-l-transparent hover:bg-muted/60 text-foreground/80"),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-medium leading-snug text-left",children:t.title||"New conversation"}),e.jsx("div",{className:"text-xs text-muted-foreground text-left",children:r(t.createdAt)})]}),e.jsx("button",{onClick:o=>{o.stopPropagation(),a()},className:j("shrink-0 rounded-md p-1 text-red-500 hover:bg-red-500/10 hover:text-red-600 transition-opacity",i?"opacity-100":"opacity-0 group-hover:opacity-100"),title:"Delete",children:e.jsx(ze,{className:"h-3.5 w-3.5"})})]})}const nt={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",go:"go",rs:"rust",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",css:"css",html:"html",sh:"bash",bash:"bash",sql:"sql",toml:"toml",xml:"xml",dockerfile:"docker"};function ot(t){return nt[t.toLowerCase().replace(/^\./,"")]||"text"}function K(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function lt({open:t,onClose:i}){const[r,c]=d.useState(null),[a,l]=d.useState(null),[o,m]=d.useState(!1),[p,h]=d.useState(!1),[f,S]=d.useState(null),w=d.useCallback(async u=>{m(!0),S(null),l(null);try{const g=await k.workspace.tree(u);c(g)}catch(g){S(g instanceof Error?g.message:"Failed to load workspace")}finally{m(!1)}},[]),N=d.useCallback(async u=>{h(!0);try{const g=await k.workspace.file(u);l(g)}catch(g){S(g instanceof Error?g.message:"Failed to load file")}finally{h(!1)}},[]),[D,x]=d.useState(!1);if(t&&!D&&(x(!0),w()),!t&&D&&x(!1),!t)return null;const n=[];if(r){const u=r.currentPath.replace(r.root,"").replace(/^\//,"");if(u){const g=u.split("/");let T="";for(const P of g)T=T?`${T}/${P}`:P,n.push({label:P,path:T})}}function b(){if(!r)return;const g=r.currentPath.replace(r.root,"").replace(/^\//,"").split("/").filter(Boolean);g.length<=1?w():(g.pop(),w(g.join("/")))}return e.jsxs("div",{className:"flex h-full w-full flex-col border-l border-border bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Workspace"}),r&&e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:r.root})]}),e.jsx(C,{variant:"ghost",size:"icon",onClick:i,className:"h-7 w-7 shrink-0",children:e.jsx(Z,{className:"h-4 w-4"})})]}),r&&n.length>0&&e.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2 text-xs",children:[e.jsx("button",{onClick:()=>w(),className:"text-primary hover:underline",children:"root"}),n.map(u=>e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(J,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("button",{onClick:()=>w(u.path),className:"text-primary hover:underline",children:u.label})]},u.path))]}),e.jsx(V,{className:"flex-1",children:o?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(M,{className:"h-5 w-5 animate-spin text-primary"})}):f?e.jsx("div",{className:"px-4 py-8 text-center text-sm text-destructive",children:f}):e.jsxs("div",{className:"flex flex-col",children:[r&&e.jsxs("div",{className:"border-b border-border",children:[n.length>0&&e.jsxs("button",{onClick:b,className:"flex w-full items-center gap-2 px-4 py-2 text-sm text-muted-foreground hover:bg-muted/50 transition-colors",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx("span",{children:".."})]}),r.items.map(u=>e.jsxs("button",{onClick:()=>{if(u.type==="directory"){const g=r.currentPath.replace(r.root,"").replace(/^\//,""),T=g?`${g}/${u.name}`:u.name;w(T)}else{const g=r.currentPath.replace(r.root,"").replace(/^\//,""),T=g?`${g}/${u.name}`:u.name;N(T)}},className:j("flex w-full items-center gap-2 px-4 py-2 text-sm transition-colors hover:bg-muted/50",u.type==="directory"?"text-foreground":"text-foreground/80"),children:[u.type==="directory"?e.jsx(ve,{className:"h-4 w-4 shrink-0 text-primary/70"}):e.jsx(Je,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate",children:u.name}),u.size!==void 0&&u.type==="file"&&e.jsx("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:K(u.size)})]},u.name)),r.items.length===0&&e.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Empty directory"})]}),p&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(M,{className:"h-5 w-5 animate-spin text-primary"})}),a&&!p&&e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[K(a.size),a.truncated&&" (truncated)"]})]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>l(null),className:"h-6 text-xs",children:"Close"})]}),e.jsx("div",{className:"overflow-auto text-xs",children:e.jsx(Ee,{language:ot(a.ext),style:we,customStyle:{margin:0,borderRadius:0,fontSize:"0.75rem",lineHeight:"1.5"},showLineNumbers:!0,wrapLongLines:!0,children:a.content})})]})]})})]})}const it=Oe,ct=Re,te=d.forwardRef(({className:t,align:i="center",sideOffset:r=4,...c},a)=>e.jsx(Fe,{children:e.jsx(ee,{ref:a,align:i,sideOffset:r,className:j("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...c})}));te.displayName=ee.displayName;function dt({currentProvider:t,currentModel:i}){const[r,c]=d.useState(!1),[a,l]=d.useState(null),[o,m]=d.useState(!1),[p,h]=d.useState(null),f=y(x=>x.setProvider),S=y(x=>x.setModel),w=d.useCallback(async()=>{if(!a){m(!0);try{const x=await k.chat.models.list();l(x)}catch{}finally{m(!1)}}},[a]);async function N(x){h(x);try{await k.chat.models.switch(x);const n=await k.chat.models.list();l(n);const b=n.providers.find(u=>u.name===x);b&&(f(b.name),S(b.model)),c(!1)}catch{}finally{h(null)}}const D=i.length>24?i.slice(0,22)+"...":i||t||"Model";return e.jsxs(it,{open:r,onOpenChange:x=>{c(x),x&&w()},children:[e.jsx(ct,{asChild:!0,children:e.jsxs(C,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-xs font-medium text-muted-foreground hover:text-foreground",children:[e.jsx("span",{className:"max-w-[140px] truncate",children:D}),e.jsx(Ue,{className:"h-3 w-3"})]})}),e.jsxs(te,{align:"start",className:"w-72 p-2",children:[e.jsx("p",{className:"px-2 pb-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Providers"}),o?e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(M,{className:"h-4 w-4 animate-spin text-primary"})}):a?e.jsx("div",{className:"flex flex-col gap-0.5",children:a.providers.map(x=>{const n=x.name===t,b=p===x.name;return e.jsxs("button",{disabled:!x.available||b,onClick:()=>{!n&&x.available&&N(x.name)},className:j("flex items-center gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors",x.available?"hover:bg-muted/60":"cursor-not-allowed opacity-40",n&&"bg-primary/10"),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-medium text-foreground",children:x.name}),n&&e.jsx(R,{className:"h-3.5 w-3.5 text-primary"})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:x.model})]}),b?e.jsx(M,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-primary"}):e.jsx(Ie,{variant:x.available?"success":"secondary",className:"shrink-0 text-[10px] px-1.5 py-0",children:x.available?"Ready":"Unavailable"})]},x.name)})}):e.jsx("p",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No providers found"})]})]})}const mt=[{value:"off",label:"Off"},{value:"plan",label:"Plan"},{value:"execute",label:"Exec"}];function ut(){const[t,i]=d.useState(null),[r,c]=d.useState(!1),a=d.useCallback(async()=>{try{const o=await k.code.status();i(o)}catch{}},[]);d.useEffect(()=>{a()},[a]);async function l(o){if(!(!t||r||o===t.state)){c(!0);try{const m=await k.code.set(o);i(p=>p&&{...p,state:m.state,active:m.active})}catch{}finally{c(!1)}}}return t!=null&&t.available?e.jsx("div",{className:"flex items-center rounded-lg border border-border bg-muted/40 p-0.5",children:mt.map(o=>{const m=t.state===o.value;return e.jsx("button",{disabled:r,onClick:()=>l(o.value),className:j("rounded-md px-2.5 py-1 text-xs font-medium transition-all duration-150",m?o.value==="plan"?"bg-amber-500/15 text-amber-600 dark:text-amber-400 shadow-sm":o.value==="execute"?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 shadow-sm":"bg-background text-muted-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:o.label},o.value)})}):null}const xt={running:{icon:M,label:"Running...",color:"text-mercury-500",border:"border-l-mercury-500",iconClass:"animate-spin"},done:{icon:Ge,label:"Complete",color:"text-emerald-500",border:"border-l-emerald-500",iconClass:""},error:{icon:He,label:"Failed",color:"text-red-500",border:"border-l-red-500",iconClass:""}};function se({tool:t,status:i,result:r}){const[c,a]=d.useState(!1),l=xt[i],o=l.icon;return e.jsx(We,{open:c,onOpenChange:a,children:e.jsxs("div",{className:j("my-1.5 overflow-hidden rounded-md border border-border/60 border-l-2 bg-muted/30",l.border),children:[e.jsxs(_e,{className:"flex w-full items-center gap-2 px-3 py-2 text-xs transition-colors hover:bg-muted/50",children:[e.jsx(J,{className:j("h-3 w-3 text-muted-foreground transition-transform",c&&"rotate-90")}),e.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:t}),e.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[e.jsx(o,{className:j("h-3.5 w-3.5",l.color,l.iconClass)}),e.jsx("span",{className:j("text-[0.6875rem]",l.color),children:l.label})]})]}),e.jsx(qe,{children:r&&e.jsx("div",{className:"max-h-40 overflow-auto border-t border-border/40 bg-background/50 px-3 py-2",children:e.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[0.75rem] leading-relaxed text-muted-foreground",children:r})})})]})})}function ht({message:t,isLast:i}){var m;const[r,c]=d.useState(!1),a=t.role==="user",l=Y(p=>p.resolved),o=d.useCallback(()=>{navigator.clipboard.writeText(t.content),c(!0),setTimeout(()=>c(!1),2e3)},[t.content]);return e.jsxs(A.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:j("group flex gap-3",a?"flex-row-reverse":"flex-row"),children:[e.jsx("div",{className:j("flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-xs font-semibold",a?"bg-primary text-primary-foreground":"bg-card"),children:a?"U":e.jsx("img",{src:l==="dark"?"/logo-dark.png":"/logo-light.png",alt:"Mercury",className:"h-full w-full object-contain"})}),e.jsxs("div",{className:j("relative max-w-[80%] space-y-1",a?"items-end":"items-start"),children:[(m=t.steps)==null?void 0:m.map((p,h)=>e.jsx(se,{tool:p.tool,status:p.status,result:p.result},`${t.id}-step-${h}`)),e.jsxs("div",{className:j("relative rounded-2xl px-4 py-2.5",a?"rounded-br-sm bg-mercury-500 text-white":"rounded-bl-sm border border-border/60 bg-card text-card-foreground"),children:[a?e.jsx("p",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:t.content}):e.jsx(Q,{content:t.content}),e.jsx("div",{className:j("absolute -top-3 flex items-center gap-1 rounded-md border border-border bg-popover px-1 py-0.5 opacity-0 shadow-sm transition-opacity group-hover:opacity-100",a?"right-0":"left-0"),children:e.jsx("button",{onClick:o,className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:r?e.jsx(R,{className:"h-3 w-3 text-emerald-500"}):e.jsx(Ne,{className:"h-3 w-3"})})})]}),e.jsx("p",{className:j("px-1 text-[0.6875rem] text-muted-foreground",a?"text-right":"text-left"),children:ge(t.timestamp)})]})]})}function pt({text:t,steps:i}){const r=!t,c=Y(a=>a.resolved);return e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full bg-card",children:e.jsx("img",{src:c==="dark"?"/logo-dark.png":"/logo-light.png",alt:"Mercury",className:"h-full w-full object-contain"})}),e.jsxs("div",{className:"max-w-[80%] space-y-1",children:[i==null?void 0:i.map((a,l)=>e.jsx(se,{tool:a.tool,status:a.status},`stream-step-${l}`)),e.jsx("div",{className:"rounded-2xl rounded-bl-sm border border-border/60 bg-card px-4 py-2.5 text-card-foreground",children:r?e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx("span",{children:"Thinking"}),e.jsx("span",{className:"inline-flex w-5",children:e.jsx("span",{className:"animate-pulse",children:"..."})})]}):e.jsxs("div",{className:"inline",children:[e.jsx(Q,{content:t}),e.jsx("span",{className:"ml-0.5 inline-block h-4 w-[3px] translate-y-[2px] rounded-sm bg-mercury-500 animate-cursor-blink"})]})})]})]})}function ft(){const t=y(o=>o.setThreads),i=y(o=>o.threads),r=y(o=>o.threadVersion),[c,a]=d.useState(!0),l=d.useCallback(async()=>{try{const o=await k.chat.threads.list();t(o.threads)}catch{}finally{a(!1)}},[t]);return d.useEffect(()=>{l()},[l,r]),{threads:i,loading:c,reload:l}}function gt(t){const i=d.useRef(null),[r,c]=d.useState(!0),a=d.useRef(!1),l=d.useCallback(()=>{const m=i.current;m&&(m.scrollTop=m.scrollHeight,a.current=!1,c(!0))},[]);d.useEffect(()=>{a.current||l()},t);const o=d.useCallback(()=>{const m=i.current;if(!m)return;const h=m.scrollHeight-m.scrollTop-m.clientHeight<80;c(h),h?a.current=!1:a.current=!0},[]);return{containerRef:i,atBottom:r,scrollToBottom:l,handleScroll:o}}function bt(){return e.jsx("div",{className:"flex w-full justify-start",children:e.jsxs("div",{className:"flex items-center gap-2 rounded-2xl bg-muted px-4 py-3 text-sm text-muted-foreground",children:[e.jsx(M,{className:"h-4 w-4 animate-spin text-primary"}),"Thinking..."]})})}function yt({data:t}){const[i,r]=d.useState(!1);async function c(a){r(!0);try{await k.chat.permission(t.id,a)}catch{}finally{r(!1)}}return e.jsx("div",{className:"flex w-full justify-start",children:e.jsxs("div",{className:"max-w-[85%] rounded-2xl border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-600 dark:text-amber-400",children:[e.jsx(Ve,{className:"h-4 w-4"}),"Permission Required"]}),t.tool&&e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Tool: ",e.jsx("span",{className:"font-medium text-foreground",children:t.tool})]}),t.description&&e.jsx("p",{className:"mt-1 text-sm text-foreground",children:t.description}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsxs(C,{size:"sm",className:"h-7 gap-1 text-xs",disabled:i,onClick:()=>c("allow"),children:[i?e.jsx(M,{className:"h-3 w-3 animate-spin"}):e.jsx(R,{className:"h-3 w-3"}),"Allow"]}),e.jsxs(C,{size:"sm",variant:"outline",className:"h-7 gap-1 text-xs",disabled:i,onClick:()=>c("deny"),children:[e.jsx(Z,{className:"h-3 w-3"}),"Deny"]})]})]})})}const ae=[{command:"/help",description:"Show all available commands",category:"General"},{command:"/progress",description:"Show current task progress",category:"General"},{command:"/halt",description:"Stop all sub-agents",category:"General"},{command:"/stop",description:"Stop all agents and clear tasks",category:"General"},{command:"/agents",description:"List active sub-agents and status",category:"Agents"},{command:"/agents kill",description:"Kill a specific sub-agent",category:"Agents"},{command:"/bg",description:"Run a shell command in background",category:"Background"},{command:"/bg:",description:"Delegate an LLM task to background",category:"Background"},{command:"/bg list",description:"Show all background tasks",category:"Background"},{command:"/bg current",description:"Move active task to background",category:"Background"},{command:"/bg stop",description:"Stop a background task",category:"Background"},{command:"/bg killall",description:"Stop all background tasks",category:"Background"},{command:"/bg clear",description:"Prune completed background tasks",category:"Background"},{command:"/models",description:"List available models",category:"Models"},{command:"/models use",description:"Switch to a different model",category:"Models"},{command:"/code",description:"Toggle programming mode",category:"Code"},{command:"/code plan",description:"Set plan-only mode",category:"Code"},{command:"/code execute",description:"Set execute mode",category:"Code"},{command:"/code off",description:"Disable programming mode",category:"Code"},{command:"/spotify",description:"Spotify status and controls",category:"Spotify"},{command:"/spotify play",description:"Play or search for music",category:"Spotify"},{command:"/spotify pause",description:"Pause playback",category:"Spotify"},{command:"/spotify next",description:"Skip to next track",category:"Spotify"},{command:"/spotify prev",description:"Previous track",category:"Spotify"},{command:"/spotify queue",description:"Show play queue",category:"Spotify"},{command:"/budget",description:"Show token budget status",category:"Budget"},{command:"/budget override",description:"Override budget for next request",category:"Budget"},{command:"/budget reset",description:"Reset daily usage counter",category:"Budget"},{command:"/budget set",description:"Set new daily budget limit",category:"Budget"},{command:"/memory",description:"Manage second-brain memory",category:"Memory"},{command:"/permissions",description:"Toggle permission mode",category:"General"},{command:"/ws",description:"Workspace file operations",category:"Workspace"},{command:"/exit",description:"Shutdown Mercury",category:"General"}];function jt({filter:t,selectedIndex:i,onSelect:r}){const c=ae.filter(a=>a.command.startsWith(t.toLowerCase()));return c.length===0?null:e.jsx(A.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.15},className:"absolute bottom-full left-0 right-0 mb-2 max-h-64 overflow-y-auto rounded-xl border border-border bg-popover shadow-xl",children:e.jsx("div",{className:"p-1",children:c.map((a,l)=>e.jsxs("button",{onMouseDown:o=>{o.preventDefault(),r(a.command)},className:j("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",l===i?"bg-primary/10 text-primary":"text-foreground hover:bg-muted"),children:[e.jsx("span",{className:"font-mono font-medium text-xs shrink-0",children:a.command}),e.jsx("span",{className:"text-muted-foreground text-xs truncate",children:a.description}),e.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground/60 shrink-0",children:a.category})]},a.command))})})}function vt({onSend:t,disabled:i}){const[r,c]=d.useState(""),[a,l]=d.useState(!1),[o,m]=d.useState(0),p=d.useRef(null),h=a?r.split(`
|
|
22
|
+
`)[0]:"",f=ae.filter(n=>n.command.startsWith(h.toLowerCase()));function S(){const n=r.trim();!n||i||(l(!1),t(n),c(""),p.current&&(p.current.style.height="auto"))}function w(n){var u;const b=["/bg","/bg:","/bg stop","/models use","/agents kill","/spotify play","/budget set"].includes(n);c(b?n+" ":n),l(!1),m(0),(u=p.current)==null||u.focus()}function N(n){if(a&&f.length>0){if(n.key==="ArrowDown"){n.preventDefault(),m(b=>Math.min(b+1,f.length-1));return}if(n.key==="ArrowUp"){n.preventDefault(),m(b=>Math.max(b-1,0));return}if(n.key==="Tab"||n.key==="Enter"&&!n.shiftKey){n.preventDefault(),w(f[o].command);return}if(n.key==="Escape"){n.preventDefault(),l(!1);return}}n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),S())}function D(n){c(n);const b=n.split(`
|
|
23
|
+
`)[0];b.startsWith("/")&&!b.includes(" ")||b.startsWith("/")&&b.split(" ").length<=2?(l(!0),m(0)):l(!1)}function x(){const n=p.current;n&&(n.style.height="auto",n.style.height=Math.min(n.scrollHeight,200)+"px")}return e.jsx("div",{className:"border-t border-border bg-background/80 backdrop-blur-xl px-4 py-3",children:e.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx($,{children:a&&f.length>0&&e.jsx(jt,{filter:h,selectedIndex:o,onSelect:w})}),e.jsx("textarea",{ref:p,value:r,onChange:n=>{D(n.target.value),x()},onKeyDown:N,onBlur:()=>{setTimeout(()=>l(!1),200)},placeholder:"Send a message... (type / for commands)",rows:1,className:j("w-full resize-none rounded-xl border border-border bg-muted/40 px-4 py-3 pr-12 text-sm text-foreground placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40","transition-all duration-150"),style:{maxHeight:200}})]}),e.jsx(C,{size:"icon",disabled:i||!r.trim(),onClick:S,className:"h-10 w-10 shrink-0 rounded-xl",children:e.jsx(Xe,{className:"h-4 w-4"})})]})})}function _t(){const{threadId:t}=pe(),i=fe(),{connected:r}=ke(),{threads:c,loading:a,reload:l}=ft(),o=y(s=>s.messages),m=y(s=>s.streamingText),p=y(s=>s.isStreaming),h=y(s=>s.waiting),f=y(s=>s.activeThreadId),S=y(s=>s.provider),w=y(s=>s.model),N=y(s=>s.totalSteps),D=y(s=>s.completedSteps),x=y(s=>s.currentStepTool),n=y(s=>s.setActiveThread),b=y(s=>s.addMessage),u=y(s=>s.clearMessages),g=y(s=>s.setWaiting),T=y(s=>s.clearStreaming),P=y(s=>s.resetSteps),re=y(s=>s.bumpThreadVersion);d.useEffect(()=>{t&&t!==f&&n(t)},[t]);const[L,B]=d.useState(!0),[I,F]=d.useState(!1),{containerRef:ne,atBottom:oe,scrollToBottom:le,handleScroll:ie}=gt([o,m,h]);d.useEffect(()=>{if(!f){u();return}(async()=>{try{const s=await k.chat.threads.get(f);u(),s.messages&&s.messages.length>0&&s.messages.forEach(v=>b(v))}catch{u()}})()},[f]);async function ce(s){let v=f;v||(v=`web:${Date.now()}_${Math.random().toString(36).slice(2,8)}`,n(v)),b({id:crypto.randomUUID(),role:"user",content:s,timestamp:new Date().toISOString()}),g(!0),k.chat.threads.addMessage(v,"user",s).then(()=>re()).catch(()=>{});try{await k.chat.send(s,v),l()}catch{g(!1),T(),P(),b({id:crypto.randomUUID(),role:"system",content:"Failed to send message. Please try again.",timestamp:new Date().toISOString()})}}async function U(s){try{await k.chat.threads.delete(s),f===s&&(n(null),u()),l()}catch{}}function W(){const s=`web:${Date.now()}_${Math.random().toString(36).slice(2,8)}`;n(s),u(),l(),i(`/chat/${s}`)}function _(s){n(s),i(`/chat/${s}`)}function q(s){const v=c.find(z=>z.id===s);if(!v)return;const xe=v.messages.map(z=>`[${z.role}] ${z.content}`).join(`
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
`),he=new Blob([xe],{type:"text/plain"}),H=URL.createObjectURL(he),O=document.createElement("a");O.href=H,O.download=`${v.title||"conversation"}-${s.slice(0,8)}.txt`,O.click(),URL.revokeObjectURL(H)}const de=p||h,me=N>0,ue=N>0?D/N*100:0;return e.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[e.jsx("div",{className:j("hidden h-full shrink-0 border-r border-border bg-background transition-[width] duration-200 ease-in-out md:block overflow-hidden",L?"w-[240px]":"w-0 border-r-0"),children:e.jsx("div",{className:"h-full w-[240px]",children:e.jsx(G,{threads:c,activeThreadId:f,onSelect:_,onDelete:U,onNew:W,onExport:q})})}),e.jsx($,{children:L&&e.jsxs(e.Fragment,{children:[e.jsx(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/50 backdrop-blur-sm md:hidden",onClick:()=>B(!1)}),e.jsx(A.div,{initial:{x:-260},animate:{x:0},exit:{x:-260},transition:{duration:.2,ease:"easeInOut"},className:"fixed inset-y-0 left-0 z-50 w-[260px] bg-background shadow-xl md:hidden",children:e.jsx(G,{threads:c,activeThreadId:f,onSelect:s=>{_(s),B(!1)},onDelete:U,onNew:()=>{W(),B(!1)},onExport:q})})]})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"flex h-12 items-center gap-2 border-b border-border bg-background/80 backdrop-blur-xl px-3",children:[e.jsx(C,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>B(!L),children:L?e.jsx(Qe,{className:"h-4 w-4"}):e.jsx(tt,{className:"h-4 w-4"})}),e.jsx("span",{className:"hidden text-sm font-bold mercury-gradient-text sm:inline",children:"Mercury"}),e.jsx("div",{className:"mx-1 h-4 w-px bg-border"}),e.jsx(dt,{currentProvider:S,currentModel:w}),e.jsx("div",{className:"flex-1"}),e.jsx(ut,{}),e.jsx("div",{className:j("h-2 w-2 rounded-full",r?"bg-emerald-500":"bg-destructive"),title:r?"Connected":"Disconnected"}),e.jsx(C,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>F(!I),children:e.jsx(Ke,{className:"h-4 w-4"})}),e.jsx(C,{variant:"ghost",size:"icon",className:"h-8 w-8 hidden md:inline-flex",onClick:()=>window.location.href="/settings",children:e.jsx(be,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"relative flex-1 min-h-0",children:[e.jsx("div",{ref:ne,onScroll:ie,className:"h-full overflow-y-auto",children:e.jsx("div",{className:"mx-auto max-w-3xl space-y-4 px-4 py-6",children:a&&o.length===0?e.jsx("div",{className:"flex flex-col items-center justify-center py-24",children:e.jsx(M,{className:"h-6 w-6 animate-spin text-primary"})}):o.length===0&&!p&&!h?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-24 text-center",children:[e.jsx("div",{className:"rounded-2xl bg-primary/10 p-4",children:e.jsx(X,{className:"h-8 w-8 text-primary"})}),e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Start a conversation"}),e.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:"Send a message to begin. Mercury is ready to assist you."})]}):e.jsxs(e.Fragment,{children:[o.map(s=>{if(s.role==="system")try{const v=JSON.parse(s.content);if(v.id&&(v.tool||v.description))return e.jsx(yt,{data:v},s.id)}catch{}return e.jsx(ht,{message:s},s.id)}),p&&m&&e.jsx(pt,{text:m}),h&&!p&&e.jsx(bt,{})]})})}),e.jsx($,{children:!oe&&e.jsx(A.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute bottom-4 right-4",children:e.jsx(C,{variant:"outline",size:"icon",className:"h-9 w-9 rounded-full shadow-lg border-border bg-background/90 backdrop-blur-sm",onClick:le,children:e.jsx(Se,{className:"h-4 w-4"})})})})]}),me&&e.jsx("div",{className:"px-4 py-1.5",children:e.jsxs("div",{className:"mx-auto max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:[e.jsx(M,{className:"h-3 w-3 animate-spin text-primary"}),e.jsxs("span",{children:["Step ",D," of ",N,x&&e.jsxs("span",{className:"ml-1 text-foreground font-medium",children:["— ",x]})]})]}),e.jsx(ye,{value:ue,className:"h-1"})]})}),e.jsx(vt,{onSend:ce,disabled:de})]}),e.jsx($,{mode:"wait",children:I&&e.jsx(A.div,{initial:{width:0,opacity:0},animate:{width:320,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"hidden h-full shrink-0 overflow-hidden md:block",children:e.jsx("div",{className:"h-full w-[320px]",children:e.jsx(lt,{open:I,onClose:()=>F(!1)})})})})]})}export{_t as ChatPage};
|
|
28
|
+
//# sourceMappingURL=Chat-DCFkzIwn.js.map
|