You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/static/js/async/6219.9016cdb0.js

2 lines
746 KiB

(self.webpackChunk_coze_studio_app=self.webpackChunk_coze_studio_app||[]).push([["6219"],{18174:function(e,t,n){var r,o;r=0,o=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t,n){if(n||2==arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,a=Object.keys,s=Array.isArray;function l(e,t){return"object"!=typeof t||a(t).forEach(function(n){e[n]=t[n]}),e}"undefined"==typeof Promise||o.Promise||(o.Promise=Promise);var c=Object.getPrototypeOf,d={}.hasOwnProperty;function u(e,t){return d.call(e,t)}function h(e,t){"function"==typeof t&&(t=t(c(e))),("undefined"==typeof Reflect?a:Reflect.ownKeys)(t).forEach(function(n){f(e,n,t[n])})}var p=Object.defineProperty;function f(e,t,n,r){p(e,t,l(n&&u(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function m(e){return{from:function(t){return e.prototype=Object.create(t.prototype),f(e.prototype,"constructor",e),{extend:h.bind(null,e.prototype)}}}}var v=Object.getOwnPropertyDescriptor,g=[].slice;function b(e,t,n){return g.call(e,t,n)}function y(e,t){return t(e)}function _(e){if(!e)throw Error("Assertion Failed")}function w(e){o.setImmediate?setImmediate(e):setTimeout(e,0)}function x(e,t){if("string"==typeof t&&u(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var a=x(e,t[r]);n.push(a)}return n}var s=t.indexOf(".");if(-1!==s){var l=e[t.substr(0,s)];return null==l?void 0:x(l,t.substr(s+1))}}function S(e,t,n){if(e&&void 0!==t&&!("isFrozen"in Object&&Object.isFrozen(e))){if("string"!=typeof t&&"length"in t){_("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)S(e,t[r],n[r])}else{var a,l,c=t.indexOf(".");-1!==c?(a=t.substr(0,c),""===(l=t.substr(c+1))?void 0===n?s(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n:S(c=(c=e[a])&&u(e,a)?c:e[a]={},l,n)):void 0===n?s(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}}function k(e){var t,n={};for(t in e)u(e,t)&&(n[t]=e[t]);return n}var C=[].concat;function j(e){return C.apply([],e)}var E="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(j([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return o[e]}),T=new Set(E.map(function(e){return o[e]})),I=null;function P(e){return I=new WeakMap,e=function e(t){if(!t||"object"!=typeof t)return t;var n=I.get(t);if(n)return n;if(s(t)){n=[],I.set(t,n);for(var r=0,o=t.length;r<o;++r)n.push(e(t[r]))}else if(T.has(t.constructor))n=t;else{var a,l=c(t);for(a in n=l===Object.prototype?{}:Object.create(l),I.set(t,n),t)u(t,a)&&(n[a]=e(t[a]))}return n}(e),I=null,e}var M={}.toString;function R(e){return M.call(e).slice(8,-1)}var D="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",A="symbol"==typeof D?function(e){var t;return null!=e&&(t=e[D])&&t.apply(e)}:function(){return null};function N(e,t){return 0<=(t=e.indexOf(t))&&e.splice(t,1),0<=t}var L={};function z(e){var t,n,r,o;if(1==arguments.length){if(s(e))return e.slice();if(this===L&&"string"==typeof e)return[e];if(o=A(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e||"number"!=typeof(t=e.length))return[e];for(n=Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var O="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},B=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],W=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(B),F={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function H(e,t){this.name=e,this.message=t}function U(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function V(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=U(e,t)}function K(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=U(e,this.failures)}m(H).from(Error).extend({toString:function(){return this.name+": "+this.message}}),m(V).from(H),m(K).from(H);var q=W.reduce(function(e,t){return e[t]=t+"Error",e},{}),Z=W.reduce(function(e,t){var n=t+"Error";function r(e,r){this.name=n,e?"string"==typeof e?(this.message="".concat(e).concat(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=F[t]||n,this.inner=null)}return m(r).from(H),e[t]=r,e},{});Z.Syntax=SyntaxError,Z.Type=TypeError,Z.Range=RangeError;var Y=B.reduce(function(e,t){return e[t+"Error"]=Z[t],e},{}),X=W.reduce(function(e,t){return -1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Z[t]),e},{});function Q(){}function G(e){return e}function J(e,t){return null==e||e===G?t:function(n){return t(e(n))}}function $(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function ee(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?$(r,this.onsuccess):r),o&&(this.onerror=this.onerror?$(o,this.onerror):o),void 0!==a?a:n}}function et(e,t){return e===Q?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?$(n,this.onsuccess):n),r&&(this.onerror=this.onerror?$(r,this.onerror):r)}}function en(e,t){return e===Q?t:function(n){var r=e.apply(this,arguments);l(n,r);var o=this.onsuccess,a=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),o&&(this.onsuccess=this.onsuccess?$(o,this.onsuccess):o),a&&(this.onerror=this.onerror?$(a,this.onerror):a),void 0===r?void 0===n?void 0:n:l(r,n)}}function er(e,t){return e===Q?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function ei(e,t){return e===Q?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,a=Array(o);o--;)a[o]=arguments[o];return n.then(function(){return t.apply(r,a)})}return t.apply(this,arguments)}}X.ModifyError=V,X.DexieError=H,X.BulkError=K;var eo="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ea(e){eo=e}var es={},E="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,c(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,c(t),e]}(),B=E[0],W=E[1],E=E[2],W=W&&W.then,el=B&&B.constructor,ec=!!E,ed=function(e,t){eb.push([e,t]),eh&&(queueMicrotask(eT),eh=!1)},eu=!0,eh=!0,ep=[],ef=[],em=G,ev={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Q,pgp:!1,env:{},finalize:Q},eg=ev,eb=[],ey=0,e_=[];function ew(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=eg;if("function"!=typeof e){if(e!==es)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ek(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var r=t._lib&&eI();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof ew?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,eC(t)),r&&eP()}},ek.bind(null,t))}catch(e){ek(t,e)}}(this,e)}var ex={get:function(){var e=eg,t=eO;function n(n,r){var o=this,a=!e.global&&(e!==eg||t!==eO),s=a&&!eH(),l=new ew(function(t,l){ej(o,new eS(eY(n,e,a,s),eY(r,e,a,s),t,l,e))});return this._consoleTask&&(l._consoleTask=this._consoleTask),l}return n.prototype=es,n},set:function(e){f(this,"then",e&&e.prototype===es?ex:{get:function(){return e},set:ex.set})}};function eS(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o}function ek(e,t){var n;ef.push(t),null===e._state&&(n=e._lib&&eI(),t=em(t),e._state=!1,e._value=t,ep.some(function(t){return t._value===e._value})||ep.push(e),eC(e),n&&eP())}function eC(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)ej(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===ey&&(++ey,ed(function(){0==--ey&&eM()},[]))}function ej(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++ey,ed(eE,[n,e,t])}else e._listeners.push(t)}function eE(e,t,n){try{var r,o=t._value;!t._state&&ef.length&&(ef=[]),r=eo&&t._consoleTask?t._consoleTask.run(function(){return e(o)}):e(o),t._state||-1!==ef.indexOf(o)||function(e){for(var t=ep.length;t;)if(ep[--t]._value===e._value)return ep.splice(t,1)}(t),n.resolve(r)}catch(e){n.reject(e)}finally{0==--ey&&eM(),--n.psd.ref||n.psd.finalize()}}function eT(){eZ(ev,function(){eI()&&eP()})}function eI(){var e=eu;return eh=eu=!1,e}function eP(){var e,t,n;do for(;0<eb.length;)for(e=eb,eb=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<eb.length);eh=eu=!0}function eM(){var e=ep;ep=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=e_.slice(0),n=t.length;n;)t[--n]()}function eR(e){return new ew(es,!1,e)}function eD(e,t){var n=eg;return function(){var r=eI(),o=eg;try{return eK(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{eK(o,!1),r&&eP()}}}h(ew.prototype,{then:ex,_then:function(e,t){ej(this,new eS(null,null,e,t,eg))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[1];return"function"==typeof e?this.then(null,function(n){return(n instanceof e?t:eR)(n)}):this.then(null,function(n){return(n&&n.name===e?t:eR)(n)})},finally:function(e){return this.then(function(t){return ew.resolve(e()).then(function(){return t})},function(t){return ew.resolve(e()).then(function(){return eR(t)})})},timeout:function(e,t){var n=this;return e<1/0?new ew(function(r,o){var a=setTimeout(function(){return o(new Z.Timeout(t))},e);n.then(r,o).finally(clearTimeout.bind(null,a))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&f(ew.prototype,Symbol.toStringTag,"Dexie.Promise"),ev.env=eq(),h(ew,{all:function(){var e=z.apply(null,arguments).map(eU);return new ew(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(o,a){return ew.resolve(o).then(function(n){e[a]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof ew?e:e&&"function"==typeof e.then?new ew(function(t,n){e.then(t,n)}):new ew(es,!0,e)},reject:eR,race:function(){var e=z.apply(null,arguments).map(eU);return new ew(function(t,n){e.map(function(e){return ew.resolve(e).then(t,n)})})},PSD:{get:function(){return eg},set:function(e){return eg=e}},totalEchoes:{get:function(){return eO}},newPSD:eW,usePSD:eZ,scheduler:{get:function(){return ed},set:function(e){ed=e}},rejectionMapper:{get:function(){return em},set:function(e){em=e}},follow:function(e,t){return new ew(function(n,r){return eW(function(t,n){var r=eg;r.unhandleds=[],r.onunhandled=n,r.finalize=$(function(){var e,r=this;e=function(){0===r.unhandleds.length?t():n(r.unhandleds[0])},e_.push(function t(){e(),e_.splice(e_.indexOf(t),1)}),++ey,ed(function(){0==--ey&&eM()},[])},r.finalize),e()},t,n,r)})}}),el&&(el.allSettled&&f(ew,"allSettled",function(){var e=z.apply(null,arguments).map(eU);return new ew(function(t){0===e.length&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,o){return ew.resolve(e).then(function(e){return r[o]={status:"fulfilled",value:e}},function(e){return r[o]={status:"rejected",reason:e}}).then(function(){return--n||t(r)})})})}),el.any&&"undefined"!=typeof AggregateError&&f(ew,"any",function(){var e=z.apply(null,arguments).map(eU);return new ew(function(t,n){0===e.length&&n(AggregateError([]));var r=e.length,o=Array(r);e.forEach(function(e,a){return ew.resolve(e).then(function(e){return t(e)},function(e){o[a]=e,--r||n(AggregateError(o))})})})}),el.withResolvers&&(ew.withResolvers=el.withResolvers));var eA={awaits:0,echoes:0,id:0},eN=0,eL=[],ez=0,eO=0,eB=0;function eW(e,t,n,r){var o=eg,a=Object.create(o);return a.parent=o,a.ref=0,a.global=!1,a.id=++eB,ev.env,a.env=ec?{Promise:ew,PromiseProp:{value:ew,configurable:!0,writable:!0},all:ew.all,race:ew.race,allSettled:ew.allSettled,any:ew.any,resolve:ew.resolve,reject:ew.reject}:{},t&&l(a,t),++o.ref,a.finalize=function(){--this.parent.ref||this.parent.finalize()},r=eZ(a,e,n,r),0===a.ref&&a.finalize(),r}function eF(){return eA.id||(eA.id=++eN),++eA.awaits,eA.echoes+=100,eA.id}function eH(){return!!eA.awaits&&(0==--eA.awaits&&(eA.id=0),eA.echoes=100*eA.awaits,!0)}function eU(e){return eA.echoes&&e&&e.constructor===el?(eF(),e.then(function(e){return eH(),e},function(e){return eH(),eQ(e)})):e}function eV(){var e=eL[eL.length-1];eL.pop(),eK(e,!1)}function eK(e,t){var n,r=eg;(t?!eA.echoes||ez++&&e===eg:!ez||--ez&&e===eg)||queueMicrotask(t?(function(e){++eO,eA.echoes&&0!=--eA.echoes||(eA.echoes=eA.awaits=eA.id=0),eL.push(eg),eK(e,!0)}).bind(null,e):eV),e!==eg&&(eg=e,r===ev&&(ev.env=eq()),ec&&(n=ev.env.Promise,t=e.env,(r.global||e.global)&&(Object.defineProperty(o,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function eq(){var e=o.Promise;return ec?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(o,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function eZ(e,t,n,r,o){var a=eg;try{return eK(e,!0),t(n,r,o)}finally{eK(a,!1)}}function eY(e,t,n,r){return"function"!=typeof e?e:function(){var o=eg;n&&eF(),eK(t,!0);try{return e.apply(this,arguments)}finally{eK(o,!1),r&&queueMicrotask(eH)}}}function eX(e){Promise===el&&0===eA.echoes?0===ez?e():enqueueNativeMicroTask(e):setTimeout(e,0)}-1===(""+W).indexOf("[native code]")&&(eF=eH=Q);var eQ=ew.reject,eG=String.fromCharCode(65535),eJ="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",e$="String expected.",e0=[],e1="__dbnames",e2="readonly",e4="readwrite";function e6(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var e5={type:3,lower:-Infinity,lowerOpen:!1,upper:[[]],upperOpen:!1};function e3(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=P(t))[e],t}}function e8(){throw Z.Type()}function e9(e,t){try{var n=e7(e),r=e7(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,a=0;a<o;++a)if(e[a]!==t[a])return e[a]<t[a]?-1:1;return n===r?0:n<r?-1:1}(te(e),te(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,a=0;a<o;++a){var s=e9(e[a],t[a]);if(0!==s)return s}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function e7(e){var t=typeof e;return"object"!=t?t:ArrayBuffer.isView(e)?"binary":"ArrayBuffer"===(e=R(e))?"binary":e}function te(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var tt=(tn.prototype._trans=function(e,t,n){var r=this._tx||eg.trans,o=this.name,a=eo&&"undefined"!=typeof console&&console.createTask&&console.createTask("Dexie: ".concat("readonly"===e?"read":"write"," ").concat(this.name));function s(e,n,r){if(!r.schema[o])throw new Z.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}var l=eI();try{var c=r&&r.db._novip===this.db._novip?r===eg.trans?r._promise(e,s,n):eW(function(){return r._promise(e,s,n)},{trans:r,transless:eg.transless||eg}):function e(t,n,r,o){if(t.idbdb&&(t._state.openComplete||eg.letThrough||t._vip)){var a=t._createTransaction(n,r,t._dbSchema);try{a.create(),t._state.PR1398_maxLoop=3}catch(a){return a.name===q.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,o)})):eQ(a)}return a._promise(n,function(e,t){return eW(function(){return eg.trans=a,o(e,t,a)})}).then(function(e){if("readwrite"===n)try{a.idbtrans.commit()}catch(e){}return"readonly"===n?e:a._completion.then(function(){return e})})}if(t._state.openComplete)return eQ(new Z.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return eQ(new Z.DatabaseClosed);t.open().catch(Q)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,o)})}(this.db,e,[this.name],s);return a&&(c._consoleTask=a,c=c.catch(function(e){return console.trace(e),eQ(e)})),c}finally{l&&eP()}},tn.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):null==e?eQ(new Z.Type("Invalid argument to Table.get()")):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},tn.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(s(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=a(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return 0<=e.keyPath.indexOf(t)})){for(var n=0;n<t.length;++n)if(-1===t.indexOf(e.keyPath[n]))return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==eG){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map(function(t){return e[t]}))}!n&&eo&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var o=this.schema.idxByName;function l(e,t){return 0===e9(e,t)}var c=t.reduce(function(t,n){var r=t[0],a=t[1],t=o[n],l=e[n];return[r||t,r||!t?e6(a,t&&t.multi?function(e){return s(e=x(e,n))&&e.some(function(e){return 0===e9(l,e)})}:function(e){return 0===e9(l,x(e,n))}):a]},[null,null]),r=c[0],c=c[1];return r?this.where(r.name).equals(e[r.keyPath]).filter(c):n?this.filter(c):this.where(t).equals("")},tn.prototype.filter=function(e){return this.toCollection().and(e)},tn.prototype.count=function(e){return this.toCollection().count(e)},tn.prototype.offset=function(e){return this.toCollection().offset(e)},tn.prototype.limit=function(e){return this.toCollection().limit(e)},tn.prototype.each=function(e){return this.toCollection().each(e)},tn.prototype.toArray=function(e){return this.toCollection().toArray(e)},tn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},tn.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,s(e)?"[".concat(e.join("+"),"]"):e))},tn.prototype.reverse=function(){return this.toCollection().reverse()},tn.prototype.mapToClass=function(t){var n,r=this.db,o=this.name;function a(){return null!==n&&n.apply(this,arguments)||this}(this.schema.mappedClass=t).prototype instanceof e8&&(function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(a,n=t),Object.defineProperty(a.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),a.prototype.table=function(){return o},t=a);for(var s=new Set,l=t.prototype;l;l=c(l))Object.getOwnPropertyNames(l).forEach(function(e){return s.add(e)});function d(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!s.has(n))try{r[n]=e[n]}catch(e){}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=d,this.hook("reading",d),t},tn.prototype.defineClass=function(){return this.mapToClass(function(e){l(this,e)})},tn.prototype.add=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,a=r.keyPath,s=e;return a&&o&&(s=e3(a)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]})}).then(function(e){return e.numFailures?ew.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{S(e,a,t)}catch(e){}return t})},tn.prototype.update=function(e,t){return"object"!=typeof e||s(e)?this.where(":id").equals(e).modify(t):void 0===(e=x(e,this.schema.primKey.keyPath))?eQ(new Z.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t)},tn.prototype.put=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,a=r.keyPath,s=e;return a&&o&&(s=e3(a)(e)),this._trans("readwrite",function(e){return n.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?ew.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{S(e,a,t)}catch(e){}return t})},tn.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?ew.reject(e.failures[0]):void 0})},tn.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:e5})}).then(function(e){return e.numFailures?ew.reject(e.failures[0]):void 0})},tn.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},tn.prototype.bulkAdd=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,s=n.auto,n=n.keyPath;if(n&&o)throw new Z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Z.InvalidArgument("Arguments objects and keys must have the same length");var l=e.length,n=n&&s?e.map(e3(n)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:n,wantResults:a}).then(function(e){var t=e.numFailures,n=e.results,o=e.lastResult,e=e.failures;if(0===t)return a?n:o;throw new K("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(l," operations failed"),e)})})},tn.prototype.bulkPut=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(t){var n=r.schema.primKey,s=n.auto,n=n.keyPath;if(n&&o)throw new Z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Z.InvalidArgument("Arguments objects and keys must have the same length");var l=e.length,n=n&&s?e.map(e3(n)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:n,wantResults:a}).then(function(e){var t=e.numFailures,n=e.results,o=e.lastResult,e=e.failures;if(0===t)return a?n:o;throw new K("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(l," operations failed"),e)})})},tn.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(e){return e.key}),o=e.map(function(e){return e.changes}),a=[];return this._trans("readwrite",function(s){return n.getMany({trans:s,keys:r,cache:"clone"}).then(function(l){var c=[],d=[];e.forEach(function(e,n){var r=e.key,o=e.changes,s=l[n];if(s){for(var u=0,h=Object.keys(o);u<h.length;u++){var p=h[u],f=o[p];if(p===t.schema.primKey.keyPath){if(0!==e9(f,r))throw new Z.Constraint("Cannot update primary key in bulkUpdate()")}else S(s,p,f)}a.push(n),c.push(r),d.push(s)}});var u=c.length;return n.mutate({trans:s,type:"put",keys:c,values:d,updates:{keys:r,changeSpecs:o}}).then(function(e){var n=e.numFailures,r=e.failures;if(0===n)return u;for(var o=0,s=Object.keys(r);o<s.length;o++){var l,c=s[o],d=a[Number(c)];null!=d&&(l=r[c],delete r[c],r[d]=l)}throw new K("".concat(t.name,".bulkUpdate(): ").concat(n," of ").concat(u," operations failed"),r)})})})},tn.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(e){var r=e.numFailures,o=e.lastResult,e=e.failures;if(0===r)return o;throw new K("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),e)})},tn);function tn(){}function tr(e){function t(t,r){if(r){for(var o=arguments.length,a=Array(o-1);--o;)a[o-1]=arguments[o];return n[t].subscribe.apply(null,a),e}if("string"==typeof t)return n[t]}var n={};t.addEventType=l;for(var r=1,o=arguments.length;r<o;++r)l(arguments[r]);return t;function l(e,r,o){if("object"!=typeof e){r=r||er;var c={subscribers:[],fire:o=o||Q,subscribe:function(e){-1===c.subscribers.indexOf(e)&&(c.subscribers.push(e),c.fire=r(c.fire,e))},unsubscribe:function(e){c.subscribers=c.subscribers.filter(function(t){return t!==e}),c.fire=c.subscribers.reduce(r,o)}};return n[e]=t[e]=c}a(e).forEach(function(t){var n=e[t];if(s(n))l(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Z.InvalidArgument("Invalid event config");var r=l(t,G,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach(function(e){w(function(){e.apply(null,t)})})})}})}}function ti(e,t){return m(t).from({prototype:e}),t}function to(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function ta(e,t){e.filter=e6(e.filter,t)}function ts(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return e6(r(),t())}:t,e.justLimit=n&&!r}function tl(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Z.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function tc(e,t,n){var r=tl(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function td(e,t,n,r){var o=e.replayFilter?e6(e.filter,e.replayFilter()):e.filter;if(e.or){var a={},s=function(e,n,r){var s,l;o&&!o(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})||("[object ArrayBuffer]"==(l=""+(s=n.primaryKey))&&(l=""+new Uint8Array(s)),u(a,l)||(a[l]=!0,t(e,n,r)))};return Promise.all([e.or._iterate(s,n),tu(tc(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return tu(tc(e,r,n),e6(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function tu(e,t,n,r){var o=eD(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};t&&!t(e,function(e){return n=e},function(t){e.stop(t),n=Q},function(t){e.fail(t),n=Q})||o(e.value,e,function(e){return n=e}),n()})})}var th=(tp.prototype.execute=function(e){var t=this["@@propmod"];if(void 0!==t.add){var n=t.add;if(s(n))return r(r([],s(e)?e:[],!0),n,!0).sort();if("number"==typeof n)return(Number(e)||0)+n;if("bigint"==typeof n)try{return BigInt(e)+n}catch(e){return BigInt(0)+n}throw TypeError("Invalid term ".concat(n))}if(void 0!==t.remove){var o=t.remove;if(s(o))return s(e)?e.filter(function(e){return!o.includes(e)}).sort():[];if("number"==typeof o)return Number(e)-o;if("bigint"==typeof o)try{return BigInt(e)-o}catch(e){return BigInt(0)-o}throw TypeError("Invalid subtrahend ".concat(o))}return(n=null===(n=t.replacePrefix)||void 0===n?void 0:n[0])&&"string"==typeof e&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},tp);function tp(e){this["@@propmod"]=e}var tf=(tm.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,eQ.bind(null,n.error)):n.table._trans("readonly",e).then(t)},tm.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,eQ.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},tm.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=e6(t.algorithm,e)},tm.prototype._iterate=function(e,t){return td(this._ctx,e,t,this._ctx.table.core)},tm.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&l(n,e),t._ctx=n,t},tm.prototype.raw=function(){return this._ctx.valueMapper=null,this},tm.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return td(t,e,n,t.table.core)})},tm.prototype.count=function(e){var t=this;return this._read(function(e){var n=t._ctx,r=n.table.core;if(to(n,!0))return r.count({trans:e,query:{index:tl(n,r.schema),range:n.range}}).then(function(e){return Math.min(e,n.limit)});var o=0;return td(n,function(){return++o,!1},e,r).then(function(){return o})}).then(e)},tm.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function a(e,t){return t?a(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function l(e,t){return e9(a(e,o),a(t,o))*s}return this.toArray(function(e){return e.sort(l)}).then(t)},tm.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&&to(n,!0)&&0<n.limit){var r=n.valueMapper,o=tl(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then(function(e){return e=e.result,r?e.map(r):e})}var a=[];return td(n,function(e){return a.push(e)},e,n.table.core).then(function(){return a})},e)},tm.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,to(t)?ts(t,function(){var t=e;return function(e,n){return 0===t||(1===t?--t:n(function(){e.advance(t),t=0}),!1)}}):ts(t,function(){var t=e;return function(){return--t<0}})),this},tm.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),ts(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}},!0),this},tm.prototype.until=function(e,t){return ta(this._ctx,function(n,r,o){return!e(n.value)||(r(o),t)}),this},tm.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},tm.prototype.last=function(e){return this.reverse().first(e)},tm.prototype.filter=function(e){var t;return ta(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=e6(t.isMatch,e),this},tm.prototype.and=function(e){return this.filter(e)},tm.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},tm.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},tm.prototype.desc=function(){return this.reverse()},tm.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},tm.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},tm.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},tm.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},tm.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&to(t,!0)&&0<t.limit)return this._read(function(e){var n=tl(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},tm.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},tm.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},tm.prototype.lastKey=function(e){return this.reverse().firstKey(e)},tm.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var t={};return ta(this._ctx,function(e){var n=e.primaryKey.toString(),e=u(t,n);return t[n]=!0,!e}),this},tm.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){l="function"==typeof e?e:(s=(o=a(e)).length,function(t){for(var n=!1,r=0;r<s;++r){var a=o[r],l=e[a],c=x(t,a);l instanceof th?(S(t,a,l.execute(c)),n=!0):c!==l&&(S(t,a,l),n=!0)}return n});var o,s,l,c=n.table.core,d=c.schema.primaryKey,u=d.outbound,h=d.extractKey,p=200,d=t.db._options.modifyChunkSize;function f(e,t){var n=t.failures,t=t.numFailures;v+=e-t;for(var r=0,o=a(n);r<o.length;r++){var s=o[r];m.push(n[s])}}d&&(p="object"==typeof d?d[c.name]||d["*"]||200:d);var m=[],v=0,g=[];return t.clone().primaryKeys().then(function(t){var o=to(n)&&n.limit===1/0&&("function"!=typeof e||e===tv)&&{index:n.index,range:n.range};return(function n(a){var s=Math.min(p,t.length-a);return c.getMany({trans:r,keys:t.slice(a,a+s),cache:"immutable"}).then(function(d){for(var m=[],v=[],g=u?[]:null,b=[],y=0;y<s;++y){var _=d[y],w={value:P(_),primKey:t[a+y]};!1!==l.call(w,w.value,w)&&(null==w.value?b.push(t[a+y]):u||0===e9(h(_),h(w.value))?(v.push(w.value),u&&g.push(t[a+y])):(b.push(t[a+y]),m.push(w.value)))}return Promise.resolve(0<m.length&&c.mutate({trans:r,type:"add",values:m}).then(function(e){for(var t in e.failures)b.splice(parseInt(t),1);f(m.length,e)})).then(function(){return(0<v.length||o&&"object"==typeof e)&&c.mutate({trans:r,type:"put",keys:g,values:v,criteria:o,changeSpec:"function"!=typeof e&&e,isAdditionalChunk:0<a}).then(function(e){return f(v.length,e)})}).then(function(){return(0<b.length||o&&e===tv)&&c.mutate({trans:r,type:"delete",keys:b,criteria:o,isAdditionalChunk:0<a}).then(function(e){return f(b.length,e)})}).then(function(){return t.length>a+s&&n(a+p)})})})(0).then(function(){if(0<m.length)throw new V("Error modifying one or more objects",m,v,g);return t.length})})})},tm.prototype.delete=function(){var e=this._ctx,t=e.range;return to(e)&&(e.isPrimKey||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey;return e.table.core.count({trans:n,query:{index:r,range:t}}).then(function(r){return e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(function(e){var t=e.failures;if(e.lastResult,e.results,e=e.numFailures)throw new V("Could not delete some values",Object.keys(t).map(function(e){return t[e]}),r-e);return r-e})})}):this.modify(tv)},tm);function tm(){}var tv=function(e,t){return t.value=null};function tg(e,t){return e<t?-1:e===t?0:1}function tb(e,t){return t<e?-1:e===t?0:1}function ty(e,t,n){return(e=e instanceof tk?new e.Collection(e):e)._ctx.error=new(n||TypeError)(t),e}function t_(e){return new e.Collection(e,function(){return tS("")}).limit(0)}function tw(e,t,n,r){var o,a,s,l,c,d,u,h=n.length;if(!n.every(function(e){return"string"==typeof e}))return ty(e,e$);function p(e){o="next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},a="next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},s="next"===e?tg:tb;var t=n.map(function(e){return{lower:a(e),upper:o(e)}}).sort(function(e,t){return s(e.lower,t.lower)});l=t.map(function(e){return e.upper}),c=t.map(function(e){return e.lower}),u="next"===(d=e)?"":r}p("next"),(e=new e.Collection(e,function(){return tx(l[0],c[h-1]+r)}))._ondirectionchange=function(e){p(e)};var f=0;return e._addAlgorithm(function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var p=a(o);if(t(p,c,f))return!0;for(var m=null,v=f;v<h;++v){var g=function(e,t,n,r,o,a){for(var s=Math.min(e.length,r.length),l=-1,c=0;c<s;++c){var d=t[c];if(d!==r[c])return 0>o(e[c],n[c])?e.substr(0,c)+n[c]+n.substr(c+1):0>o(e[c],r[c])?e.substr(0,c)+r[c]+n.substr(c+1):0<=l?e.substr(0,l)+t[l]+n.substr(l+1):null;0>o(e[c],d)&&(l=c)}return s<r.length&&"next"===a?e+n.substr(e.length):s<e.length&&"prev"===a?e.substr(0,n.length):l<0?null:e.substr(0,l)+r[l]+n.substr(l+1)}(o,p,l[v],c[v],s,d);null===g&&null===m?f=v+1:(null===m||0<s(m,g))&&(m=g)}return n(null!==m?function(){e.continue(m+u)}:r),!1}),e}function tx(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function tS(e){return{type:1,lower:e,upper:e}}var tk=(Object.defineProperty(tC.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),tC.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?t_(this):new this.Collection(this,function(){return tx(e,t,!n,!r)})}catch(e){return ty(this,eJ)}},tC.prototype.equals=function(e){return null==e?ty(this,eJ):new this.Collection(this,function(){return tS(e)})},tC.prototype.above=function(e){return null==e?ty(this,eJ):new this.Collection(this,function(){return tx(e,void 0,!0)})},tC.prototype.aboveOrEqual=function(e){return null==e?ty(this,eJ):new this.Collection(this,function(){return tx(e,void 0,!1)})},tC.prototype.below=function(e){return null==e?ty(this,eJ):new this.Collection(this,function(){return tx(void 0,e,!1,!0)})},tC.prototype.belowOrEqual=function(e){return null==e?ty(this,eJ):new this.Collection(this,function(){return tx(void 0,e)})},tC.prototype.startsWith=function(e){return"string"!=typeof e?ty(this,e$):this.between(e,e+eG,!0,!0)},tC.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):tw(this,function(e,t){return 0===e.indexOf(t[0])},[e],eG)},tC.prototype.equalsIgnoreCase=function(e){return tw(this,function(e,t){return e===t[0]},[e],"")},tC.prototype.anyOfIgnoreCase=function(){var e=z.apply(L,arguments);return 0===e.length?t_(this):tw(this,function(e,t){return -1!==t.indexOf(e)},e,"")},tC.prototype.startsWithAnyOfIgnoreCase=function(){var e=z.apply(L,arguments);return 0===e.length?t_(this):tw(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,eG)},tC.prototype.anyOf=function(){var e=this,t=z.apply(L,arguments),n=this._cmp;try{t.sort(n)}catch(e){return ty(this,eJ)}if(0===t.length)return t_(this);var r=new this.Collection(this,function(){return tx(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm(function(e,r,a){for(var s=e.key;0<n(s,t[o]);)if(++o===t.length)return r(a),!1;return 0===n(s,t[o])||(r(function(){e.continue(t[o])}),!1)}),r},tC.prototype.notEqual=function(e){return this.inAnyRange([[-Infinity,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},tC.prototype.noneOf=function(){var e=z.apply(L,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return ty(this,eJ)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-Infinity,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},tC.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,o=this._ascending,a=this._descending,s=this._min,l=this._max;if(0===e.length)return t_(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&0>=o(e[0],e[1])}))return ty(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Z.InvalidArgument);var c=!t||!1!==t.includeLowers,d=t&&!0===t.includeUppers,u,h=o;function p(e,t){return h(e[0],t[0])}try{(u=e.reduce(function(e,t){for(var n=0,o=e.length;n<o;++n){var a=e[n];if(0>r(t[0],a[1])&&0<r(t[1],a[0])){a[0]=s(a[0],t[0]),a[1]=l(a[1],t[1]);break}}return n===o&&e.push(t),e},[])).sort(p)}catch(e){return ty(this,eJ)}var f=0,m=d?function(e){return 0<o(e,u[f][1])}:function(e){return 0<=o(e,u[f][1])},v=c?function(e){return 0<a(e,u[f][0])}:function(e){return 0<=a(e,u[f][0])},g=m,e=new this.Collection(this,function(){return tx(u[0][0],u[u.length-1][1],!c,!d)});return e._ondirectionchange=function(e){h="next"===e?(g=m,o):(g=v,a),u.sort(p)},e._addAlgorithm(function(e,t,r){for(var a=e.key;g(a);)if(++f===u.length)return t(r),!1;return!m(a)&&!v(a)||(0===n._cmp(a,u[f][1])||0===n._cmp(a,u[f][0])||t(function(){h===o?e.continue(u[f][0]):e.continue(u[f][1])}),!1)}),e},tC.prototype.startsWithAnyOf=function(){var e=z.apply(L,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?t_(this):this.inAnyRange(e.map(function(e){return[e,e+eG]})):ty(this,"startsWithAnyOf() only works with strings")},tC);function tC(){}function tj(e){return eD(function(t){return tE(t),e(t.target.error),!1})}function tE(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var tT="storagemutated",tI="x-storagemutated-1",tP=tr(null,tT),tM=(tR.prototype._lock=function(){return _(!eg.global),++this._reculock,1!==this._reculock||eg.global||(eg.lockOwnerFor=this),this},tR.prototype._unlock=function(){if(_(!eg.global),0==--this._reculock)for(eg.global||(eg.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{eZ(e[1],e[0])}catch(e){}}return this},tR.prototype._locked=function(){return this._reculock&&eg.lockOwnerFor!==this},tR.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(_(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Z.DatabaseClosed(r);case"MissingAPIError":throw new Z.MissingAPI(r.message,r);default:throw new Z.OpenFailed(r)}if(!this.active)throw new Z.TransactionInactive;return _(null===this._completion._state),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=eD(function(n){tE(n),t._reject(e.error)}),e.onabort=eD(function(n){tE(n),t.active&&t._reject(new Z.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=eD(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&tP.storagemutated.fire(e.mutatedParts)}),this},tR.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return eQ(new Z.ReadOnly("Transaction is readonly"));if(!this.active)return eQ(new Z.TransactionInactive);if(this._locked())return new ew(function(o,a){r._blockedFuncs.push([function(){r._promise(e,t,n).then(o,a)},eg])});if(n)return eW(function(){var e=new ew(function(e,n){r._lock();var o=t(e,n,r);o&&o.then&&o.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var o=new ew(function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)});return o._lib=!0,o},tR.prototype._root=function(){return this.parent?this.parent._root():this},tR.prototype.waitFor=function(e){var t,n=this._root(),r=ew.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-Infinity).onsuccess=e)}());var o=n._waitingFor;return new ew(function(e,t){r.then(function(t){return n._waitingQueue.push(eD(e.bind(null,t)))},function(e){return n._waitingQueue.push(eD(t.bind(null,e)))}).finally(function(){n._waitingFor===o&&(n._waitingFor=null)})})},tR.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Z.Abort))},tR.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(u(t,e))return t[e];var n=this.schema[e];if(!n)throw new Z.NotFound("Table "+e+" not part of transaction");return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n},tR);function tR(){}function tD(e,t,n,r,o,a,s){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:a,src:(n&&!s?"&":"")+(r?"*":"")+(o?"++":"")+tA(t)}}function tA(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function tN(e,t,n){var r;return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce(function(e,t,n){return(n=r(t,n))&&(e[n[0]]=n[1]),e},{}))}}var tL=function(e){try{return e.only([[]]),tL=function(){return[[]]},[[]]}catch(e){return tL=function(){return eG},eG}};function tz(e){return null==e?function(){}:"string"==typeof e?1===e.split(".").length?function(t){return t[e]}:function(t){return x(t,e)}:function(t){return x(t,e)}}function tO(e){return[].slice.call(e)}var tB=0;function tW(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")}function tF(e,n){var r,o,a,l,c,d=n.db,n=(r=e._middlewares,o=d,a=e._deps,l=n,c=a.IDBKeyRange,a.indexedDB,{dbcore:(l=function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,o=e.lowerOpen,e=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!e):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!e)}var o,a,l=(o=n,a=tO(e.objectStoreNames),{schema:{name:e.name,tables:a.map(function(e){return o.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=s(t),o={},n={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:null==t,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:tz(t)},indexes:tO(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,e=e.keyPath,r={name:t,compound:s(e),keyPath:e,unique:n,multiEntry:r,extractKey:tz(e)};return o[tW(e)]=r}),getIndexByKeyPath:function(e){return o[tW(e)]}};return o[":id"]=n.primaryKey,null!=t&&(o[tW(t)]=n.primaryKey),n})},hasGetAll:0<a.length&&"getAll"in o.objectStore(a[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),n=l.schema,c=l.hasGetAll,l=n.tables.map(function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,o=e.type,a=e.keys,s=e.values,l=e.range;return new Promise(function(e,c){e=eD(e);var d=n.objectStore(t),u=null==d.keyPath,h="put"===o||"add"===o;if(!h&&"delete"!==o&&"deleteRange"!==o)throw Error("Invalid operation type: "+o);var p,f=(a||s||{length:1}).length;if(a&&s&&a.length!==s.length)throw Error("Given keys array must have same length as given values array.");if(0===f)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function m(e){++b,tE(e)}var v=[],g=[],b=0;if("deleteRange"===o){if(4===l.type)return e({numFailures:b,failures:g,results:[],lastResult:void 0});3===l.type?v.push(p=d.clear()):v.push(p=d.delete(r(l)))}else{var u=h?u?[s,a]:[s,null]:[a,null],y=u[0],_=u[1];if(h)for(var w=0;w<f;++w)v.push(p=_&&void 0!==_[w]?d[o](y[w],_[w]):d[o](y[w])),p.onerror=m;else for(w=0;w<f;++w)v.push(p=d[o](y[w])),p.onerror=m}function x(t){t=t.target.result,v.forEach(function(e,t){return null!=e.error&&(g[t]=e.error)}),e({numFailures:b,failures:g,results:"delete"===o?a:v.map(function(e){return e.result}),lastResult:t})}p.onerror=function(e){m(e),x(e)},p.onsuccess=x})},getMany:function(e){var n=e.trans,r=e.keys;return new Promise(function(e,o){e=eD(e);for(var a,s=n.objectStore(t),l=r.length,c=Array(l),d=0,u=0,h=function(t){c[(t=t.target)._pos]=t.result,++u===d&&e(c)},p=tj(o),f=0;f<l;++f)null!=r[f]&&((a=s.get(r[f]))._pos=f,a.onsuccess=h,a.onerror=p,++d);0===d&&e(c)})},get:function(e){var n=e.trans,r=e.key;return new Promise(function(e,o){e=eD(e);var a=n.objectStore(t).get(r);a.onsuccess=function(t){return e(t.target.result)},a.onerror=tj(o)})},query:function(e){return new Promise(function(n,o){n=eD(n);var a,s,l,d=e.trans,u=e.values,h=e.limit,p=e.query,f=h===1/0?void 0:h,m=p.index,p=p.range,d=d.objectStore(t),m=m.isPrimaryKey?d:d.index(m.name),p=r(p);if(0===h)return n({result:[]});c?((f=u?m.getAll(p,f):m.getAllKeys(p,f)).onsuccess=function(e){return n({result:e.target.result})},f.onerror=tj(o)):(a=0,s=!u&&"openKeyCursor"in m?m.openKeyCursor(p):m.openCursor(p),l=[],s.onsuccess=function(e){var t=s.result;return t?(l.push(u?t.value:t.primaryKey),++a===h?n({result:l}):void t.continue()):n({result:l})},s.onerror=tj(o))})},openCursor:function(e){var n=e.trans,o=e.values,a=e.query,s=e.reverse,l=e.unique;return new Promise(function(e,c){e=eD(e);var d=a.index,u=a.range,h=n.objectStore(t),h=d.isPrimaryKey?h:h.index(d.name),d=s?l?"prevunique":"prev":l?"nextunique":"next",p=!o&&"openKeyCursor"in h?h.openKeyCursor(r(u),d):h.openCursor(r(u),d);p.onerror=tj(c),p.onsuccess=eD(function(t){var r,o,a,s,l=p.result;l?(l.___id=++tB,l.done=!1,r=l.continue.bind(l),o=(o=l.continuePrimaryKey)&&o.bind(l),a=l.advance.bind(l),s=function(){throw Error("Cursor not stopped")},l.trans=n,l.stop=l.continue=l.continuePrimaryKey=l.advance=function(){throw Error("Cursor not started")},l.fail=eD(c),l.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},l.start=function(e){function t(){if(p.result)try{e()}catch(e){l.fail(e)}else l.done=!0,l.start=function(){throw Error("Cursor behind last entry")},l.stop()}var n=new Promise(function(e,t){e=eD(e),p.onerror=tj(t),l.fail=t,l.stop=function(t){l.stop=l.continue=l.continuePrimaryKey=l.advance=s,e(t)}});return p.onsuccess=eD(function(e){p.onsuccess=t,t()}),l.continue=r,l.continuePrimaryKey=o,l.advance=a,t(),n},e(l)):e(null)},c)})},count:function(e){var n=e.query,o=e.trans,a=n.index,s=n.range;return new Promise(function(e,n){var l=o.objectStore(t),c=a.isPrimaryKey?l:l.index(a.name),l=r(s),c=l?c.count(l):c.count();c.onsuccess=eD(function(t){return e(t.target.result)}),c.onerror=tj(n)})}}}),d={};return l.forEach(function(e){return d[e.name]=e}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!d[e])throw Error("Table '".concat(e,"' not found"));return d[e]},MIN_KEY:-Infinity,MAX_KEY:tL(t),schema:n}}(o,c,l),r.dbcore.reduce(function(e,n){return n=n.create,t(t({},e),n(e))},l))});e.core=n.dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function tH(e,t,n,r){n.forEach(function(n){var o=r[n];t.forEach(function(t){var r=function e(t,n){return v(t,n)||(t=c(t))&&e(t,n)}(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?f(t,n,{get:function(){return this.table(n)},set:function(e){p(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))})})}function tU(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function tV(e,t){return e._cfg.version-t._cfg.version}function tK(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],a=t[n];if(o){var s={name:n,def:a,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(a.primKey.keyPath||"")||o.primKey.auto!==a.primKey.auto)s.recreate=!0,r.change.push(s);else{var l=o.idxByName,c=a.idxByName,d=void 0;for(d in l)c[d]||s.del.push(d);for(d in c){var u=l[d],h=c[d];u?u.src!==h.src&&s.change.push(h):s.add.push(h)}(0<s.del.length||0<s.add.length||0<s.change.length)&&r.change.push(s)}}else r.add.push([n,a])}return r}function tq(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return tY(o,e)}),o}function tZ(e,t){a(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(eo&&console.debug("Dexie: Creating missing table",n),tq(t,n,e[n].primKey,e[n].indexes))})}function tY(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function tX(e,t,n){var r={};return b(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),o=tD(tA(c=t.keyPath),c||"",!0,!1,!!t.autoIncrement,c&&"string"!=typeof c,!0),a=[],s=0;s<t.indexNames.length;++s){var l=t.index(t.indexNames[s]),c=l.keyPath,l=tD(l.name,c,!!l.unique,!!l.multiEntry,!1,c&&"string"!=typeof c,!1);a.push(l)}r[e]=tN(e,o,a)}),r}function tQ(e,t,n){for(var r=n.db.objectStoreNames,a=0;a<r.length;++a){var s=r[a],l=n.objectStore(s);e._hasGetAll="getAll"in l;for(var c=0;c<l.indexNames.length;++c){var d=l.indexNames[c],u=l.index(d).keyPath,h="string"==typeof u?u:"["+b(u).join("+")+"]";!t[s]||(u=t[s].idxByName[h])&&(u.name=d,delete t[s].idxByName[h],t[s].idxByName[d]=u)}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&o.WorkerGlobalScope&&o instanceof o.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function tG(e){return e.split(",").map(function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return tD(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),s(r),0===t)})}var tJ=(t$.prototype._parseStoresSpec=function(e,t){a(e).forEach(function(n){if(null!==e[n]){var r=tG(e[n]),o=r.shift();if(o.unique=!0,o.multi)throw new Z.Schema("Primary key cannot be multi-valued");r.forEach(function(e){if(e.auto)throw new Z.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Z.Schema("Index must have a name and cannot be an empty string")}),t[n]=tN(n,o,r)}})},t$.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,e):e;var e=t._versions,n={},r={};return e.forEach(function(e){l(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)}),t._dbSchema=r,tU(t,[t._allTables,t,t.Transaction.prototype]),tH(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],a(r),r),t._storeNames=a(r),this},t$.prototype.upgrade=function(e){return this._cfg.contentUpgrade=ei(this._cfg.contentUpgrade||Q,e),this},t$);function t$(){}function t0(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new nj(e1,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function t1(e){return e&&"function"==typeof e.databases}function t2(e){return eW(function(){return eg.letThrough=!0,e()})}function t4(e){return!("from"in e)}var t6=function(e,t){if(!this){var n=new t6;return e&&"d"in e&&l(n,e),n}l(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function t5(e,t,n){var r=e9(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(t4(e))return l(e,{from:t,to:n,d:1});var o=e.l,r=e.r;if(0>e9(n,e.from))return o?t5(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},t7(e);if(0<e9(t,e.to))return r?t5(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},t7(e);0>e9(t,e.from)&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0<e9(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,o&&!e.l&&t3(e,o),r&&n&&t3(e,r)}}function t3(e,t){t4(t)||function e(t,n){var r=n.from,o=n.to,a=n.l,n=n.r;t5(t,r,o),a&&e(t,a),n&&e(t,n)}(e,t)}function t8(e,t){var n=t9(t),r=n.next();if(r.done)return!1;for(var o=r.value,a=t9(e),s=a.next(o.from),l=s.value;!r.done&&!s.done;){if(0>=e9(l.from,o.to)&&0<=e9(l.to,o.from))return!0;0>e9(o.from,l.from)?o=(r=n.next(l.from)).value:l=(s=a.next(o.from)).value}return!1}function t9(e){var t=t4(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>e9(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=e9(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function t7(e){var n,r,o=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),a=1<o?"r":o<-1?"l":"";a&&(n="r"==a?"l":"r",r=t({},e),o=e[a],e.from=o.from,e.to=o.to,e[a]=o[a],r[a]=o[n],(e[n]=r).d=ne(r)),e.d=ne(e)}function ne(e){var t=e.r,e=e.l;return(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function nt(e,t){return a(t).forEach(function(n){e[n]?t3(e[n],t[n]):e[n]=function e(t){var n,r,o={};for(n in t)u(t,n)&&(r=t[n],o[n]=!r||"object"!=typeof r||T.has(r.constructor)?r:e(r));return o}(t[n])}),e}function nn(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&t8(t[n],e[n])})}h(t6.prototype,((W={add:function(e){return t3(this,e),this},addKey:function(e){return t5(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return t5(t,e,e)}),this},hasKey:function(e){var t=t9(this).next(e).value;return t&&0>=e9(t.from,e)&&0<=e9(t.to,e)}})[D]=function(){return t9(this)},W));var nr={},ni={},no=!1;function na(e){nt(ni,e),no||(no=!0,setTimeout(function(){no=!1,ns(ni,(ni={},!1))},0))}function ns(e,t){void 0===t&&(t=!1);var n=new Set;if(e.all)for(var r=0,o=Object.values(nr);r<o.length;r++)nl(s=o[r],e,n,t);else for(var a in e){var s,l=/^idb\:\/\/(.*)\/(.*)\//.exec(a);l&&(a=l[1],l=l[2],(s=nr["idb://".concat(a,"/").concat(l)])&&nl(s,e,n,t))}n.forEach(function(e){return e()})}function nl(e,t,n,r){for(var o=[],a=0,s=Object.entries(e.queries.query);a<s.length;a++){for(var l=s[a],c=l[0],d=[],u=0,h=l[1];u<h.length;u++){var p=h[u];nn(t,p.obsSet)?p.subscribers.forEach(function(e){return n.add(e)}):r&&d.push(p)}r&&o.push([c,d])}if(r)for(var f=0;f<o.length;f++){var m=o[f],c=m[0],d=m[1];e.queries.query[c]=d}}function nc(e){function t(t){return e.next(t)}var n=o(t),r=o(function(t){return e.throw(t)});function o(e){return function(t){var o=e(t),t=o.value;return o.done?t:t&&"function"==typeof t.then?t.then(n,r):s(t)?Promise.all(t).then(n,r):n(t)}}return o(t)()}function nd(e,t,n){for(var r=s(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r}var nu={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),o=r.schema,a={},s=[];function l(e,n,r){var o=tW(e),c=a[o]=a[o]||[],d=null==e?0:"string"==typeof e?1:e.length,u=0<n,u=t(t({},r),{name:u?"".concat(o,"(virtual-from:").concat(r.name,")"):r.name,lowLevelIndex:r,isVirtual:u,keyTail:n,keyLength:d,extractKey:tz(e),unique:!u&&r.unique});return c.push(u),u.isPrimaryKey||s.push(u),1<d&&l(2===d?e[0]:e.slice(0,d-1),n+1,r),c.sort(function(e,t){return e.keyTail-t.keyTail}),u}n=l(o.primaryKey.keyPath,0,o.primaryKey),a[":id"]=[n];for(var c=0,d=o.indexes;c<d.length;c++){var u=d[c];l(u.keyPath,0,u)}function h(n){var r,o=n.query.index;return o.isVirtual?t(t({},n),{query:{index:o.lowLevelIndex,range:(r=n.query.range,o=o.keyTail,{type:1===r.type?2:r.type,lower:nd(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,o),lowerOpen:!0,upper:nd(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,o),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},o),{primaryKey:n,indexes:s,getIndexByKeyPath:function(e){return(e=a[tW(e)])&&e[0]}}),count:function(e){return r.count(h(e))},query:function(e){return r.query(h(e))},openCursor:function(t){var n=t.query.index,o=n.keyTail,a=n.isVirtual,s=n.keyLength;return a?r.openCursor(h(t)).then(function(n){return n&&function(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(nd(r,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?n.continue(n.key.slice(0,s).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(nd(t,e.MAX_KEY,o),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===s?e[0]:e.slice(0,s)}},value:{get:function(){return n.value}}})}(n)}):r.openCursor(t)}})}})}};function nh(e,t,n,r){return n=n||{},r=r||"",a(e).forEach(function(o){var a,s,l;u(t,o)?(a=e[o],s=t[o],"object"==typeof a&&"object"==typeof s&&a&&s?(l=R(a))!==R(s)?n[r+o]=t[o]:"Object"===l?nh(a,s,n,r+o+"."):a!==s&&(n[r+o]=t[o]):a!==s&&(n[r+o]=t[o])):n[r+o]=void 0}),a(t).forEach(function(o){u(e,o)||(n[r+o]=t[o])}),n}function np(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}var nf={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return t(t({},e),{table:function(n){var o=e.table(n),a=o.schema.primaryKey;return t(t({},o),{mutate:function(e){var s=eg.trans,l=s.table(n).hook,c=l.deleting,d=l.creating,h=l.updating;switch(e.type){case"add":if(d.fire===Q)break;return s._promise("readwrite",function(){return p(e)},!0);case"put":if(d.fire===Q&&h.fire===Q)break;return s._promise("readwrite",function(){return p(e)},!0);case"delete":if(c.fire===Q)break;return s._promise("readwrite",function(){return p(e)},!0);case"deleteRange":if(c.fire===Q)break;return s._promise("readwrite",function(){return function e(n,r,s){return o.query({trans:n,values:!1,query:{index:a,range:r},limit:s}).then(function(o){var a=o.result;return p({type:"delete",keys:a,trans:n}).then(function(o){return 0<o.numFailures?Promise.reject(o.failures[0]):a.length<s?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:a[a.length-1],lowerOpen:!0}),s)})})}(e.trans,e.range,1e4)},!0)}return o.mutate(e);function p(e){var n,s=eg.trans,l=e.keys||np(a,e);if(!l)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?t(t({},e),{keys:l}):t({},e)).type&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),("add"===(n=e).type?Promise.resolve([]):o.getMany({trans:n.trans,keys:l,cache:"immutable"})).then(function(t){var n=l.map(function(n,r){var o,l,p,f=t[r],m={onerror:null,onsuccess:null};return"delete"===e.type?c.fire.call(m,n,f,s):"add"===e.type||void 0===f?(o=d.fire.call(m,n,e.values[r],s),null==n&&null!=o&&(e.keys[r]=n=o,a.outbound||S(e.values[r],a.keyPath,n))):(o=nh(f,e.values[r]),(l=h.fire.call(m,o,n,f,s))&&(p=e.values[r],Object.keys(l).forEach(function(e){u(p,e)?p[e]=l[e]:S(p,e,l[e])}))),m});return o.mutate(e).then(function(r){for(var o=r.failures,a=r.results,s=r.numFailures,r=r.lastResult,c=0;c<l.length;++c){var d=(a||l)[c],u=n[c];null==d?u.onerror&&u.onerror(o[c]):u.onsuccess&&u.onsuccess("put"===e.type&&t[c]?e.values[c]:d)}return{failures:o,results:a,numFailures:s,lastResult:r}}).catch(function(e){return n.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})})}}})}})}};function nm(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],o=0,a=0;o<t.keys.length&&a<e.length;++o)0===e9(t.keys[o],e[a])&&(r.push(n?P(t.values[o]):t.values[o]),++a);return r.length===e.length?r:null}catch(e){return null}}var nv={stack:"dbcore",level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=nm(e.keys,e.trans._cache,"clone"===e.cache);return t?ew.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?P(t):t},t})},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),r.mutate(e)}})}}}};function ng(e,t){return"readonly"===e.trans.mode&&!!e.subscr&&!e.trans.explicit&&"disabled"!==e.trans.db._options.cache&&!t.schema.primaryKey.outbound}function nb(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ny={stack:"dbcore",level:0,name:"Observability",create:function(e){var n=e.schema.name,r=new t6(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(eg.subscr&&"readonly"!==n)throw new Z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(eg.querier));return e.transaction(t,n,r)},table:function(o){var l=e.table(o),c=l.schema,d=c.primaryKey,u=c.indexes,h=d.extractKey,p=d.outbound,f=d.autoIncrement&&u.filter(function(e){return e.compound&&e.keyPath.includes(d.keyPath)}),m=t(t({},l),{mutate:function(t){function a(e){return m[e="idb://".concat(n,"/").concat(o,"/").concat(e)]||(m[e]=new t6)}var u,h,p=t.trans,m=t.mutatedParts||(t.mutatedParts={}),v=a(""),g=a(":dels"),b=t.type,y="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[np(d,t).filter(function(e){return e}),t.values]:[],_=y[0],w=y[1],y=t.trans._cache;return s(_)?(v.addKeys(_),(y="delete"===b||_.length===w.length?nm(_,y):null)||g.addKeys(_),(y||w)&&(u=y,h=w,c.indexes.forEach(function(e){var t=a(e.name||"");function n(t){return null!=t?e.extractKey(t):null}function r(n){return e.multiEntry&&s(n)?n.forEach(function(e){return t.addKey(e)}):t.addKey(n)}(u||h).forEach(function(e,t){var o=u&&n(u[t]),t=h&&n(h[t]);0!==e9(o,t)&&(null!=o&&r(o),null!=t&&r(t))})}))):_?(w={from:null!==(w=_.lower)&&void 0!==w?w:e.MIN_KEY,to:null!==(w=_.upper)&&void 0!==w?w:e.MAX_KEY},g.add(w),v.add(w)):(v.add(r),g.add(r),c.indexes.forEach(function(e){return a(e.name).add(r)})),l.mutate(t).then(function(e){return!_||"add"!==t.type&&"put"!==t.type||(v.addKeys(e.results),f&&f.forEach(function(n){for(var r=t.values.map(function(e){return n.extractKey(e)}),o=n.keyPath.findIndex(function(e){return e===d.keyPath}),s=0,l=e.results.length;s<l;++s)r[s][o]=e.results[s];a(n.name).addKeys(r)})),p.mutatedParts=nt(p.mutatedParts||{},m),e})}}),u=function(t){var n=t.query,t=n.index,n=n.range;return[t,new t6(null!==(t=n.lower)&&void 0!==t?t:e.MIN_KEY,null!==(n=n.upper)&&void 0!==n?n:e.MAX_KEY)]},v={get:function(e){return[d,new t6(e.key)]},getMany:function(e){return[d,(new t6).addKeys(e.keys)]},count:u,query:u,openCursor:u};return a(v).forEach(function(e){m[e]=function(a){var s=eg.subscr,c=!!s,d=ng(eg,l)&&nb(e,a)?a.obsSet={}:s;if(c){var u=function(e){return d[e="idb://".concat(n,"/").concat(o,"/").concat(e)]||(d[e]=new t6)},f=u(""),m=u(":dels"),s=v[e](a),c=s[0],s=s[1];if(("query"===e&&c.isPrimaryKey&&!a.values?m:u(c.name||"")).add(s),!c.isPrimaryKey){if("count"!==e){var g="query"===e&&p&&a.values&&l.query(t(t({},a),{values:!1}));return l[e].apply(this,arguments).then(function(t){if("query"===e){if(p&&a.values)return g.then(function(e){return e=e.result,f.addKeys(e),t});var n=a.values?t.result.map(h):t.result;(a.values?f:m).addKeys(n)}else if("openCursor"===e){var r=a.values;return t&&Object.create(t,{key:{get:function(){return m.addKey(t.primaryKey),t.key}},primaryKey:{get:function(){var e=t.primaryKey;return m.addKey(e),e}},value:{get:function(){return r&&f.addKey(t.primaryKey),t.value}}})}return t})}m.add(r)}}return l[e].apply(this,arguments)}}),m}})}};function n_(e,n,r){if(0===r.numFailures)return n;if("deleteRange"===n.type)return null;var o=n.keys?n.keys.length:"values"in n&&n.values?n.values.length:1;return r.numFailures===o?null:(s((n=t({},n)).keys)&&(n.keys=n.keys.filter(function(e,t){return!(t in r.failures)})),"values"in n&&s(n.values)&&(n.values=n.values.filter(function(e,t){return!(t in r.failures)})),n)}function nw(e,t){var n;return(void 0===(n=t).lower||(n.lowerOpen?0<e9(e,n.lower):0<=e9(e,n.lower)))&&(void 0===t.upper||(t.upperOpen?0>e9(e,t.upper):0>=e9(e,t.upper)))}function nx(e,t,n,r,o,a){if(!n||0===n.length)return e;var l=t.query.index,c=l.multiEntry,d=t.query.range,u=r.schema.primaryKey.extractKey,h=l.extractKey,p=(l.lowLevelIndex||l).extractKey,n=n.reduce(function(e,n){var r=e,o=[];if("add"===n.type||"put"===n.type)for(var a=new t6,l=n.values.length-1;0<=l;--l){var p,f=n.values[l],m=u(f);a.hasKey(m)||(p=h(f),(c&&s(p)?p.some(function(e){return nw(e,d)}):nw(p,d))&&(a.addKey(m),o.push(f)))}switch(n.type){case"add":var v=(new t6).addKeys(t.values?e.map(function(e){return u(e)}):e),r=e.concat(t.values?o.filter(function(e){return e=u(e),!v.hasKey(e)&&(v.addKey(e),!0)}):o.map(function(e){return u(e)}).filter(function(e){return!v.hasKey(e)&&(v.addKey(e),!0)}));break;case"put":var g=(new t6).addKeys(n.values.map(function(e){return u(e)}));r=e.filter(function(e){return!g.hasKey(t.values?u(e):e)}).concat(t.values?o:o.map(function(e){return u(e)}));break;case"delete":var b=(new t6).addKeys(n.keys);r=e.filter(function(e){return!b.hasKey(t.values?u(e):e)});break;case"deleteRange":var y=n.range;r=e.filter(function(e){return!nw(u(e),y)})}return r},e);return n===e?e:(n.sort(function(e,t){return e9(p(e),p(t))||e9(u(e),u(t))}),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length<t.limit&&(o.dirty=!0)),a?Object.freeze(n):n)}function nS(e,t){return 0===e9(e.lower,t.lower)&&0===e9(e.upper,t.upper)&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}var nk={stack:"dbcore",level:0,name:"Cache",create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,o){var a,s,l=e.transaction(t,r,o);return"readwrite"===r&&(s=(a=new AbortController).signal,o=function(o){return function(){if(a.abort(),"readwrite"===r){for(var s=new Set,c=0;c<t.length;c++){var d=t[c],u=nr["idb://".concat(n,"/").concat(d)];if(u){var h=e.table(d),p=u.optimisticOps.filter(function(e){return e.trans===l});if(l._explicit&&o&&l.mutatedParts)for(var f=0,m=Object.values(u.queries.query);f<m.length;f++)for(var v=0,g=(_=m[f]).slice();v<g.length;v++)nn((w=g[v]).obsSet,l.mutatedParts)&&(N(_,w),w.subscribers.forEach(function(e){return s.add(e)}));else if(0<p.length){u.optimisticOps=u.optimisticOps.filter(function(e){return e.trans!==l});for(var b=0,y=Object.values(u.queries.query);b<y.length;b++)for(var _,w,x,S=0,k=(_=y[b]).slice();S<k.length;S++)null!=(w=k[S]).res&&l.mutatedParts&&(o&&!w.dirty?(x=Object.isFrozen(w.res),x=nx(w.res,w.req,p,h,w,x),w.dirty?(N(_,w),w.subscribers.forEach(function(e){return s.add(e)})):x!==w.res&&(w.res=x,w.promise=ew.resolve({result:x}))):(w.dirty&&N(_,w),w.subscribers.forEach(function(e){return s.add(e)})))}}}s.forEach(function(e){return e()})}}},l.addEventListener("abort",o(!1),{signal:s}),l.addEventListener("error",o(!1),{signal:s}),l.addEventListener("complete",o(!0),{signal:s})),l},table:function(r){var o=e.table(r),a=o.schema.primaryKey;return t(t({},o),{mutate:function(e){var s=eg.trans;if(a.outbound||"disabled"===s.db._options.cache||s.explicit||"readwrite"!==s.idbtrans.mode)return o.mutate(e);var l=nr["idb://".concat(n,"/").concat(r)];return l?(s=o.mutate(e),("add"===e.type||"put"===e.type)&&(50<=e.values.length||np(a,e).some(function(e){return null==e}))?s.then(function(n){var r=n_(0,t(t({},e),{values:e.values.map(function(e,r){var o;return n.failures[r]?e:(S(e=null!==(o=a.keyPath)&&void 0!==o&&o.includes(".")?P(e):t({},e),a.keyPath,n.results[r]),e)})}),n);l.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&na(e.mutatedParts)})}):(l.optimisticOps.push(e),e.mutatedParts&&na(e.mutatedParts),s.then(function(t){0<t.numFailures&&(N(l.optimisticOps,e),(t=n_(0,e,t))&&l.optimisticOps.push(t),e.mutatedParts&&na(e.mutatedParts))}),s.catch(function(){N(l.optimisticOps,e),e.mutatedParts&&na(e.mutatedParts)})),s):o.mutate(e)},query:function(e){if(!ng(eg,o)||!nb("query",e))return o.query(e);var t,a,s,l,c="immutable"===(null===(p=eg.trans)||void 0===p?void 0:p.db._options.cache),d=eg,u=d.requery,h=d.signal,p=function(e,t,n,r){var o=nr["idb://".concat(e,"/").concat(t)];if(!o)return[];if(!(t=o.queries[n]))return[null,!1,o,null];var a=t[(r.query?r.query.index.name:null)||""];if(!a)return[null,!1,o,null];switch(n){case"query":var s=a.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&nS(e.req.query.range,r.query.range)});return s?[s,!0,o,a]:[a.find(function(e){var t,n;return("limit"in e.req?e.req.limit:1/0)>=r.limit&&(!r.values||e.req.values)&&(t=e.req.query.range,n=r.query.range,0>=function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=e9(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return -1}return t}(t.lower,n.lower,t.lowerOpen,n.lowerOpen)&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return -1;if(0===(t=e9(e,t))){if(n&&r)return 0;if(n)return -1;if(r)return 1}return t}(t.upper,n.upper,t.upperOpen,n.upperOpen))}),!1,o,a];case"count":return[s=a.find(function(e){return nS(e.req.query.range,r.query.range)}),!!s,o,a]}}(n,r,"query",e),f=p[0],d=p[1],m=p[2],v=p[3];return f&&d?f.obsSet=e.obsSet:(d=o.query(e).then(function(e){var t=e.result;if(f&&(f.res=t),c){for(var n=0,r=t.length;n<r;++n)Object.freeze(t[n]);Object.freeze(t)}else e.result=P(t);return e}).catch(function(e){return v&&f&&N(v,f),Promise.reject(e)}),f={obsSet:e.obsSet,promise:d,subscribers:new Set,type:"query",req:e,dirty:!1},v?v.push(f):(v=[f],(m=m||(nr["idb://".concat(n,"/").concat(r)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[e.query.index.name||""]=v)),t=f,a=v,s=u,l=h,t.subscribers.add(s),l.addEventListener("abort",function(){t.subscribers.delete(s),0===t.subscribers.size&&setTimeout(function(){0===t.subscribers.size&&N(a,t)},3e3)}),f.promise.then(function(t){return{result:nx(t.result,e,null==m?void 0:m.optimisticOps,o,f,c)}})}})}})}};function nC(e,t){return new Proxy(e,{get:function(e,n,r){return"db"===n?t:Reflect.get(e,n,r)}})}var nj=(nE.prototype.version=function(e){if(isNaN(e)||e<.1)throw new Z.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Z.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(tV),n.stores({}),this._state.autoSchema=!1,n)},nE.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||eg.letThrough||this._vip)?e():new ew(function(e,n){if(t._state.openComplete)return n(new Z.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new Z.DatabaseClosed);t.open().catch(Q)}t._state.dbReadyPromise.then(e,n)}).then(e)},nE.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;return o&&this.unuse({stack:t,name:o}),(e=this._middlewares[t]||(this._middlewares[t]=[])).push({stack:t,create:n,level:null==r?10:r,name:o}),e.sort(function(e,t){return e.level-t.level}),this},nE.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:!!n&&e.name!==n})),this},nE.prototype.open=function(){var e=this;return eZ(ev,function(){return function(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?eQ(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,o=Math.round(10*e.verno),s=!1;function l(){if(t.openCanceller!==r)throw new Z.DatabaseClosed("db.open() was cancelled")}var c,d=t.dbReadyResolve,u=null,h=!1;return ew.race([r,("undefined"==typeof navigator?ew.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){function t(){return indexedDB.databases().finally(e)}c=setInterval(t,100),t()}).finally(function(){return clearInterval(c)}):Promise.resolve()).then(function r(){return new ew(function(c,d){if(l(),!n)throw new Z.MissingAPI;var p=e.name,f=t.autoSchema||!o?n.open(p):n.open(p,o);if(!f)throw new Z.MissingAPI;f.onerror=tj(d),f.onblocked=eD(e._fireOnBlocked),f.onupgradeneeded=eD(function(r){var o,l,c,m,v,g,b,y,_;u=f.transaction,t.autoSchema&&!e._options.allowEmptyDB?(f.onerror=tE,u.abort(),f.result.close(),(o=n.deleteDatabase(p)).onsuccess=o.onerror=eD(function(){d(new Z.NoSuchDatabase("Database ".concat(p," doesnt exist")))})):(u.onerror=tj(d),h=(r=r.oldVersion>0x4000000000000000?0:r.oldVersion)<1,e.idbdb=f.result,s&&function(e,t){tZ(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=tX(0,e.idbdb,t);tQ(e,e._dbSchema,t);for(var r=0,o=tK(n,e._dbSchema).change;r<o.length;r++){var a=function(e){if(e.change.length||e.recreate)return console.warn("Unable to patch indexes of table ".concat(e.name," because it has changes on the type of index or primary key.")),{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(t){eo&&console.debug("Dexie upgrade patch: Creating missing index ".concat(e.name,".").concat(t.src)),tY(n,t)})}(o[r]);if("object"==typeof a)return a.value}}(e,u),l=e,c=r/10,m=u,v=d,g=l._dbSchema,m.objectStoreNames.contains("$meta")&&!g.$meta&&(g.$meta=tN("$meta",tG("")[0],[]),l._storeNames.push("$meta")),(b=l._createTransaction("readwrite",l._storeNames,g)).create(m),b._completion.catch(v),y=b._reject.bind(b),_=eg.transless||eg,eW(function(){return eg.trans=b,eg.transless=_,0!==c?(tF(l,m),(b.storeNames.includes("$meta")?b.table("$meta").get("version").then(function(e){return null!=e?e:c}):ew.resolve(c)).then(function(e){var t,n,r;return t=e,n=[],e=l._versions,r=l._dbSchema=tX(0,l.idbdb,m),0!==(e=e.filter(function(e){return e._cfg.version>=t})).length?(e.forEach(function(e){n.push(function(){var n=r,o=e._cfg.dbschema;tQ(l,n,m),tQ(l,o,m),r=l._dbSchema=o;var s=tK(n,o);s.add.forEach(function(e){tq(m,e[0],e[1].primKey,e[1].indexes)}),s.change.forEach(function(e){if(e.recreate)throw new Z.Upgrade("Not yet support for changing primary key");var t=m.objectStore(e.name);e.add.forEach(function(e){return tY(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),tY(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var c=e._cfg.contentUpgrade;if(c&&e._cfg.version>t){tF(l,m),b._memoizedTables={};var d=k(o);s.del.forEach(function(e){d[e]=n[e]}),tU(l,[l.Transaction.prototype]),tH(l,[l.Transaction.prototype],a(d),d),b.schema=d;var u,h=O(c);return h&&eF(),s=ew.follow(function(){var e;(u=c(b))&&h&&(e=eH.bind(null,null),u.then(e,e))}),u&&"function"==typeof u.then?ew.resolve(u):s.then(function(){return u})}}),n.push(function(t){var n=e._cfg.dbschema;[].slice.call(t.db.objectStoreNames).forEach(function(e){return null==n[e]&&t.db.deleteObjectStore(e)}),tU(l,[l.Transaction.prototype]),tH(l,[l.Transaction.prototype],l._storeNames,l._dbSchema),b.schema=l._dbSchema}),n.push(function(t){l.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(l.idbdb.version/10)===e._cfg.version?(l.idbdb.deleteObjectStore("$meta"),delete l._dbSchema.$meta,l._storeNames=l._storeNames.filter(function(e){return"$meta"!==e})):t.objectStore("$meta").put(e._cfg.version,"version"))})}),(function e(){return n.length?ew.resolve(n.shift()(b.idbtrans)).then(e):ew.resolve()})().then(function(){tZ(r,m)})):ew.resolve()}).catch(y)):(a(g).forEach(function(e){tq(m,e,g[e].primKey,g[e].indexes)}),tF(l,m),void ew.follow(function(){return l.on.populate.fire(b)}).catch(y))}))},d),f.onsuccess=eD(function(){u=null;var n,l,d,m=e.idbdb=f.result,v=b(m.objectStoreNames);if(0<v.length)try{var g=m.transaction(1===v.length?v[0]:v,"readonly");if(t.autoSchema)n=m,l=g,e.verno=n.version/10,l=e._dbSchema=tX(0,n,l),e._storeNames=b(n.objectStoreNames,0),tH(e,[e._allTables],a(l),l);else if(tQ(e,e._dbSchema,g),((d=tK(tX(0,(d=e).idbdb,g),d._dbSchema)).add.length||d.change.some(function(e){return e.add.length||e.change.length}))&&!s)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),m.close(),o=m.version+1,s=!0,c(r());tF(e,g)}catch(e){}e0.push(e),m.onversionchange=eD(function(n){t.vcFired=!0,e.on("versionchange").fire(n)}),m.onclose=eD(function(t){e.on("close").fire(t)}),h&&(d=e._deps,g=p,m=d.indexedDB,d=d.IDBKeyRange,t1(m)||g===e1||t0(m,d).put({name:g}).catch(Q)),c()},d)}).catch(function(e){switch(null==e?void 0:e.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),r();break;case"VersionError":if(0<o)return o=0,r()}return ew.reject(e)})})]).then(function(){return l(),t.onReadyBeingFired=[],ew.resolve(t2(function(){return e.on.ready.fire(e.vip)})).then(function n(){if(0<t.onReadyBeingFired.length){var r=t.onReadyBeingFired.reduce(ei,Q);return t.onReadyBeingFired=[],ew.resolve(t2(function(){return r(e.vip)})).then(n)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{u&&u.abort()}catch(e){}return r===t.openCanceller&&e._close(),eQ(n)}).finally(function(){t.openComplete=!0,d()}).then(function(){var t;return h&&(t={},e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t["idb://".concat(e.name,"/").concat(n.name,"/").concat(r.name)]=new t6(-Infinity,[[[]]]))}),t["idb://".concat(e.name,"/").concat(n.name,"/")]=t["idb://".concat(e.name,"/").concat(n.name,"/:dels")]=new t6(-Infinity,[[[]]])}),tP(tT).fire(t),ns(t,!0)),e})}(e)})},nE.prototype._close=function(){var e=this._state,t=e0.indexOf(this);if(0<=t&&e0.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new ew(function(t){e.dbReadyResolve=t}),e.openCanceller=new ew(function(t,n){e.cancelOpen=n}))},nE.prototype.close=function(e){var t=(void 0===e?{disableAutoOpen:!0}:e).disableAutoOpen,e=this._state;t?(e.isBeingOpened&&e.cancelOpen(new Z.DatabaseClosed),this._close(),e.autoOpen=!1,e.dbOpenError=new Z.DatabaseClosed):(this._close(),e.autoOpen=this._options.autoOpen||e.isBeingOpened,e.openComplete=!1,e.dbOpenError=null)},nE.prototype.delete=function(e){var t=this;void 0===e&&(e={disableAutoOpen:!0});var n=0<arguments.length&&"object"!=typeof arguments[0],r=this._state;return new ew(function(o,a){function s(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=eD(function(){var e,n,r;e=t._deps,n=t.name,r=e.indexedDB,e=e.IDBKeyRange,t1(r)||n===e1||t0(r,e).delete(n).catch(Q),o()}),n.onerror=tj(a),n.onblocked=t._fireOnBlocked}if(n)throw new Z.InvalidArgument("Invalid closeOptions argument to db.delete()");r.isBeingOpened?r.dbReadyPromise.then(s):s()})},nE.prototype.backendDB=function(){return this.idbdb},nE.prototype.isOpen=function(){return null!==this.idbdb},nE.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},nE.prototype.hasFailed=function(){return null!==this._state.dbOpenError},nE.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(nE.prototype,"tables",{get:function(){var e=this;return a(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),nE.prototype.transaction=function(){var e=(function(e,t,n){var r=arguments.length;if(r<2)throw new Z.InvalidArgument("Too few arguments");for(var o=Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,j(o),n]}).apply(this,arguments);return this._transaction.apply(this,e)},nE.prototype._transaction=function(e,t,n){var r=this,o=eg.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var a,s,l=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(s=t.map(function(e){if(e=e instanceof r.Table?e.name:e,"string"!=typeof e)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e}),"r"==e||e===e2)a=e2;else{if("rw"!=e&&e!=e4)throw new Z.InvalidArgument("Invalid transaction mode: "+e);a=e4}if(o){if(o.mode===e2&&a===e4){if(!l)throw new Z.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&s.forEach(function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!l)throw new Z.SubTransaction("Table "+e+" not included in parent transaction.");o=null}}),l&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,function(t,n){n(e)}):eQ(e)}var c=(function e(t,n,r,o,a){return ew.resolve().then(function(){var s=eg.transless||eg,l=t._createTransaction(n,r,t._dbSchema,o);if(l.explicit=!0,s={trans:l,transless:s},o)l.idbtrans=o.idbtrans;else try{l.create(),l.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(o){return o.name===q.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,null,a)})):eQ(o)}var c,d=O(a);return d&&eF(),s=ew.follow(function(){var e;(c=a.call(l,l))&&(d?(e=eH.bind(null,null),c.then(e,e)):"function"==typeof c.next&&"function"==typeof c.throw&&(c=nc(c)))},s),(c&&"function"==typeof c.then?ew.resolve(c).then(function(e){return l.active?e:eQ(new Z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):s.then(function(){return c})).then(function(e){return o&&l._resolve(),l._completion.then(function(){return e})}).catch(function(e){return l._reject(e),eQ(e)})})}).bind(null,this,a,s,o,n);return o?o._promise(a,c,"lock"):eg.trans?eZ(eg.transless,function(){return r._whenReady(c)}):this._whenReady(c)},nE.prototype.table=function(e){if(!u(this._allTables,e))throw new Z.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},nE);function nE(e,n){var r=this;this._middlewares={},this.verno=0;var o=nE.dependencies;this._options=n=t({addons:nE.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange,cache:"cloned"},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},o=n.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var a,s,l,c,d,u={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Q,dbReadyPromise:null,cancelOpen:Q,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen};u.dbReadyPromise=new ew(function(e){u.dbReadyResolve=e}),u.openCanceller=new ew(function(e,t){u.cancelOpen=t}),this._state=u,this.name=e,this.on=tr(this,"populate","blocked","versionchange","close",{ready:[ei,Q]}),this.on.ready.subscribe=y(this.on.ready.subscribe,function(e){return function(t,n){nE.vip(function(){var o=r._state;o.openComplete?(o.dbOpenError||ew.resolve().then(t),n&&e(t)):o.onReadyBeingFired?(o.onReadyBeingFired.push(t),n&&e(t)):(e(t),n||e(function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))})}}),this.Collection=(a=this,ti(tf.prototype,function(e,t){this.db=a;var n=e5,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._ctx,t=o.table,e=t.hook.reading.fire;this._ctx={table:t,index:o.index,isPrimKey:!o.index||t.schema.primKey.keyPath&&o.index===t.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:e!==G?e:null}})),this.Table=(s=this,ti(tt.prototype,function(e,t,n){this.db=s,this._tx=n,this.name=e,this.schema=t,this.hook=s._allTables[e]?s._allTables[e].hook:tr(null,{creating:[ee,Q],reading:[J,G],updating:[en,Q],deleting:[et,Q]})})),this.Transaction=(l=this,ti(tM.prototype,function(e,t,n,r,o){var a=this;this.db=l,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=tr(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ew(function(e,t){a._resolve=e,a._reject=t}),this._completion.then(function(){a.active=!1,a.on.complete.fire()},function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),eQ(e)})})),this.Version=(c=this,ti(tJ.prototype,function(e){this.db=c,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(d=this,ti(tk.prototype,function(e,t,n){if(this.db=d,this._ctx={table:e,index:":id"===t?null:t,or:n},this._cmp=this._ascending=e9,this._descending=function(e,t){return e9(t,e)},this._max=function(e,t){return 0<e9(e,t)?e:t},this._min=function(e,t){return 0>e9(e,t)?e:t},this._IDBKeyRange=d._deps.IDBKeyRange,!this._IDBKeyRange)throw new Z.MissingAPI})),this.on("versionchange",function(e){0<e.newVersion?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close({disableAutoOpen:!1})}),this.on("blocked",function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))}),this._maxKey=tL(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),e0.filter(function(e){return e.name===r.name&&e!==r&&!e._state.vcFired}).map(function(t){return t.on("versionchange").fire(e)})},this.use(nv),this.use(nk),this.use(ny),this.use(nu),this.use(nf);var h=new Proxy(this,{get:function(e,t,n){if("_vip"===t)return!0;if("table"===t)return function(e){return nC(r.table(e),h)};var o=Reflect.get(e,t,n);return o instanceof tt?nC(o,h):"tables"===t?o.map(function(e){return nC(e,h)}):"_createTransaction"===t?function(){return nC(o.apply(this,arguments),h)}:o}});this.vip=h,o.forEach(function(e){return e(r)})}var nT,W="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",nI=(nP.prototype.subscribe=function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})},nP.prototype[W]=function(){return this},nP);function nP(e){this._subscribe=e}try{nT={indexedDB:o.indexedDB||o.mozIndexedDB||o.webkitIndexedDB||o.msIndexedDB,IDBKeyRange:o.IDBKeyRange||o.webkitIDBKeyRange}}catch(e){nT={indexedDB:null,IDBKeyRange:null}}function nM(e){var t,n=!1,r=new nI(function(r){var o=O(e),a,s=!1,l={},c={},d={get closed(){return s},unsubscribe:function(){s||(s=!0,a&&a.abort(),h&&tP.storagemutated.unsubscribe(f))}};r.start&&r.start(d);var h=!1,p=function(){return eX(m)},f=function(e){nt(l,e),nn(c,l)&&p()},m=function(){var d,m;!s&&nT.indexedDB&&(l={},d={},a&&a.abort(),Promise.resolve(function(t){var n=eI();try{o&&eF();var r=eW(e,t);return r=o?r.finally(eH):r}finally{n&&eP()}}(m={subscr:d,signal:(a=new AbortController).signal,requery:p,querier:e,trans:null})).then(function(e){n=!0,t=e,s||m.signal.aborted||(l={},function(e){for(var t in e)if(u(e,t))return;return 1}(c=d)||h||(tP(tT,f),h=!0),eX(function(){return!s&&r.next&&r.next(e)}))},function(e){n=!1,["DatabaseClosedError","AbortError"].includes(null==e?void 0:e.name)||s||eX(function(){s||r.error&&r.error(e)})}))};return setTimeout(p,0),d});return r.hasValue=function(){return n},r.getValue=function(){return t},r}function nR(e){var t=nA;try{nA=!0,tP.storagemutated.fire(e),ns(e,!0)}finally{nA=t}}h(nj,t(t({},X),{delete:function(e){return new nj(e,{addons:[]}).delete()},exists:function(e){return new nj(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){var t,n;try{return n=(t=nj.dependencies).indexedDB,t=t.IDBKeyRange,(t1(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==e1})}):t0(n,t).toCollection().primaryKeys()).then(e)}catch(e){return eQ(new Z.MissingAPI)}},defineClass:function(){return function(e){l(this,e)}},ignoreTransaction:function(e){return eg.trans?eZ(eg.transless,e):e()},vip:t2,async:function(e){return function(){try{var t=nc(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ew.resolve(t)}catch(e){return eQ(e)}}},spawn:function(e,t,n){try{var r=nc(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ew.resolve(r)}catch(e){return eQ(e)}},currentTransaction:{get:function(){return eg.trans||null}},waitFor:function(e,t){return t=ew.resolve("function"==typeof e?nj.ignoreTransaction(e):e).timeout(t||6e4),eg.trans?eg.trans.waitFor(t):t},Promise:ew,debug:{get:function(){return eo},set:function(e){eo=e}},derive:m,extend:l,props:h,override:y,Events:tr,on:tP,liveQuery:nM,extendObservabilitySet:nt,getByKeyPath:x,setByKeyPath:S,delByKeyPath:function(e,t){"string"==typeof t?S(e,t,void 0):"length"in t&&[].map.call(t,function(t){S(e,t,void 0)})},shallowClone:k,deepClone:P,getObjectDiff:nh,cmp:e9,asap:w,minKey:-Infinity,addons:[],connections:e0,errnames:q,dependencies:nT,cache:nr,semVer:"4.0.11",version:"4.0.11".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),nj.maxKey=tL(nj.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(tP(tT,function(e){nA||(e=new CustomEvent(tI,{detail:e}),nA=!0,dispatchEvent(e),nA=!1)}),addEventListener(tI,function(e){e=e.detail,nA||nR(e)}));var nD,nA=!1,nN=function(){};return"undefined"!=typeof BroadcastChannel&&((nN=function(){(nD=new BroadcastChannel(tI)).onmessage=function(e){return e.data&&nR(e.data)}})(),"function"==typeof nD.unref&&nD.unref(),tP(tT,function(e){nA||nD.postMessage(e)})),"undefined"!=typeof addEventListener&&(addEventListener("pagehide",function(e){if(!nj.disableBfCache&&e.persisted){eo&&console.debug("Dexie: handling persisted pagehide"),null!=nD&&nD.close();for(var t=0;t<e0.length;t++)e0[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!nj.disableBfCache&&e.persisted&&(eo&&console.debug("Dexie: handling persisted pageshow"),nN(),nR({all:new t6(-Infinity,[[]])}))})),ew.rejectionMapper=function(e,t){return!e||e instanceof H||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Y[e.name]?e:(t=new Y[e.name](t||e.message,e),"stack"in e&&f(t,"stack",{get:function(){return this.inner.stack}}),t)},t(nj,Object.freeze({__proto__:null,Dexie:nj,liveQuery:nM,Entity:e8,cmp:e9,PropModification:th,replacePrefix:function(e,t){return new th({replacePrefix:[e,t]})},add:function(e){return new th({add:e})},remove:function(e){return new th({remove:e})},default:nj,RangeSet:t6,mergeRanges:t3,rangesOverlap:t8}),{default:nj}),nj},e.exports=o()},578419:function(e,t,n){var r=n(323086);function o(e,t){var n,o,a,s=null;if(!e||"string"!=typeof e)return s;for(var l=r(e),c="function"==typeof t,d=0,u=l.length;d<u;d++)o=(n=l[d]).property,a=n.value,c?t(o,a,n):a&&(s||(s={}),s[o]=a);return s}e.exports=o,e.exports.default=o},610382:function(e,t,n){"use strict";n.d(t,{Hv:()=>B,rm:()=>r.rm,qz:()=>W.q});var r=n("910376");n("786406");var o=n("825955"),a=n("808549"),s=n("120454"),l=n("151064"),c=n("455069"),d=n("626389"),u=n.n(d),h=n("252237"),p=n.n(h),f=n("287487"),m=n("336205"),v=n("707107"),g=n("214942"),b=n("775699"),y=n("966219"),_=n("458949"),w=n("178385"),x=n("382534"),S=n("407821"),k=n.n(S),C=n("472772"),j=n.n(C),E=n("395245"),T=n.n(E),I=n("297998"),P=n.n(I),M=n("646576"),R=n.n(M),D=n("606121"),A=n.n(D),N=n("376756"),L={};L.styleTagTransform=A(),L.setAttributes=P(),L.insert=T().bind(null,"head"),L.domAPI=j(),L.insertStyleElement=R(),k()(N.Z,L);var z=N.Z&&N.Z.locals?N.Z.locals:void 0,O=[{label:"cURL",value:_.gR.Curl},{label:"Wget",value:_.gR.Wget},{label:"Node.js",value:_.gR.NodeJS},{label:"Python",value:_.gR.Python},{label:"Golang",value:_.gR.Golang}],B=e=>{var{onCancel:t,visible:n,pluginAPIInfo:r}=e,[d,h]=(0,c.useState)(_.gR.Curl),[S,k]=(0,c.useState)(""),{id:C,space_type:j}=(0,g.rY)(e=>e.space),E=j===w.Sn.Personal,T=f.Z.useUserInfo();return(0,c.useEffect)(()=>{h(_.gR.Curl),k("")},[n]),(0,c.useEffect)(()=>{if(r){var e;(e=(0,o._)(function*(){k("");var e=yield x.Js.PluginAPI2Code({plugin_id:r.plugin_id||"",api_id:r.api_id||"",space_id:C||"",dev_id:(null==T?void 0:T.user_id_str)||"",program_lang:d});k((null==e?void 0:e.program_code)||"")}),function(){return e.apply(this,arguments)})()}},[d,r]),(0,l.jsx)(b.M5,{type:"base-composition",title:m.o.t("code_snippet"),visible:n,onCancel:t,footer:(0,l.jsx)(b.T,{children:(0,l.jsx)(b.y3,{theme:"solid",type:"primary",onClick:()=>{var e=u()(S),t={environment:"cn-boe",workspace_id:C||"",workspace_type:E?"personal_workspace":"team_workspace",tool_id:(null==r?void 0:r.api_id)||"",code_type:function(e){switch(e){case _.gR.Curl:return"curl";case _.gR.Wget:return"wget";case _.gR.NodeJS:return"javascript";case _.gR.Python:return"python";case _.gR.Golang:return"golang";default:return""}}(d)||"",status:1};e?(b.O$.success({content:m.o.t("copy_success")}),(0,v.Gg)(v.Kg.code_snippet_front,(0,s._)((0,a._)({},t),{status:0}))):(b.O$.warning({content:m.o.t("copy_failed")}),(0,v.Gg)(v.Kg.code_snippet_front,(0,s._)((0,a._)({},t),{status:1,error_message:"copy_failed"})))},children:m.o.t("copy")})}),maskClosable:!1,children:(0,l.jsxs)("div",{className:"h-[100%] flex flex-col min-h-0",children:[(0,l.jsx)("div",{children:(0,l.jsx)(b.FX,{type:"card",options:O,defaultValue:d,className:"mb-[16px]",value:d,onChange:e=>h(e.target.value)})}),(0,l.jsx)("div",{className:p()(z["editor-container"],"flex-1 min-h-0"),children:(0,l.jsx)(y.Editor,{className:z.editor,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1},language:function(e){switch(e){case _.gR.Curl:case _.gR.Wget:case _.gR.NodeJS:return"javascript";case _.gR.Python:return"python";case _.gR.Golang:return"go";default:return"javascript"}}(d),theme:"tomorrow",width:"100%",value:S})})]})})};n("3779"),n("512421");var W=n("317612")},988179:function(e,t,n){"use strict";n.d(t,{iN:()=>y,zb:()=>B,A7:()=>Y,Pj:()=>X,B5:()=>Z});var r=n("808549"),o=n("151064"),a=n("455069"),s=n("354428"),l=n("336205"),c=n("659596"),d=n("775699"),u=n("486613"),h=n("479886"),p=n.n(h),f=n("287487"),m=n("388993"),v=n("707107"),g=n("214942"),b=n("178385");function y(e,t){var{botId:n}=m.G.getState(),o=f.Z.getUserInfo(),{space:{id:a,space_type:s}}=g.rY.getState(),l=s===b.Sn.Personal,c=Date.now();(0,v.Gg)(e,(0,r._)({user_id:null==o?void 0:o.user_id_str,timestamp:c,bot_id:n,workspace_id:a,workspace_type:l?"personal_workspace":"team_workspace"},t))}var _=e=>{try{if(!e)return e;var t=e.match(/timestamp:"(\d{10,13})"/);if(t){var n=null==t?void 0:t[1],r="YYYY-MM-DD HH:mm:ss",o="".concat(n).length;if(10===o)return'"'.concat(p().unix(Number(n)).format(r),'"');if(13===o)return'"'.concat(p()(Number(n)).format(r),'"')}return e}catch(t){return e}},w=n("157728"),x=()=>{var e=(0,w.useParams)(),t=e.space_id||"",n=e.bot_id||"";return{sendViewDiffEvent:()=>{(0,v.Gg)(v.Kg.bot_diff_viewdetail,{workspace_id:t,bot_id:n})},sendManualMergeEvent:e=>{(0,v.Gg)(v.Kg.bot_merge_manual,{workspace_id:t,bot_id:n,submit_or_not:e})}}},S=n("407821"),k=n.n(S),C=n("472772"),j=n.n(C),E=n("395245"),T=n.n(E),I=n("297998"),P=n.n(I),M=n("646576"),R=n.n(M),D=n("606121"),A=n.n(D),N=n("367689"),L={};L.styleTagTransform=A(),L.setAttributes=P(),L.insert=T().bind(null,"head"),L.domAPI=j(),L.insertStyleElement=R(),k()(N.Z,L);var z=N.Z&&N.Z.locals?N.Z.locals:void 0,O=e=>{try{return JSON.parse(e)}catch(e){return""}},B=e=>{var t,{left:n,right:a,node:s}=e;if((null==s?void 0:null===(t=s.diff_res)||void 0===t?void 0:t.diff_style)===u.jY.TextDetail)return(0,o.jsx)(W,(0,r._)({},e));var l=_(n),c=_(a),h=null==l?void 0:l.includes("template_NewLine"),p=e=>(0,o.jsx)(d.ZT.Text,{className:z["multiline-text"],type:"secondary",size:"small",children:e.replaceAll("template_NewLine","\n")});return h?(0,o.jsxs)(d.ZT.Text,{className:z["multiline-container"],type:"secondary",size:"small",children:[p(null!=l?l:""),(0,o.jsx)(d.ZT.Text,{className:"mx-2",type:"secondary",size:"small",children:"->"}),p(null!=c?c:"")]}):(0,o.jsx)(d.ZT.Text,{type:"secondary",size:"small",ellipsis:{showTooltip:{opts:{content:"".concat(l," -> ").concat(c),style:{wordBreak:"break-word"}}}},children:"".concat(l," -> ").concat(c)})},W=e=>{var t,n,r,u,{node:h,type:p="diff"}=e,f="diff"===p,[m,v]=(0,a.useState)(!1),{sendViewDiffEvent:g}=x(),b=O(null===(t=O(null==h?void 0:null===(n=h.diff_res)||void 0===n?void 0:n.origin_left))||void 0===t?void 0:t.OriginStr),y=O(null===(r=O(null==h?void 0:null===(u=h.diff_res)||void 0===u?void 0:u.origin_right))||void 0===r?void 0:r.OriginStr);return(0,o.jsxs)("div",{children:[(0,o.jsx)(d.ZT.Text,{link:!0,onClick:()=>{v(!0),g()},className:"text-xs",children:l.o.t("coze_bot_diff_btn_view_diff")}),(0,o.jsx)(c.u_,{visible:m,title:(0,o.jsx)("div",{className:"flex gap-1 items-center",children:l.o.t("coze_bot_diff_diffdetail_pagetitle")}),footer:null,width:1e3,onCancel:()=>{v(!1)},children:(0,o.jsxs)("div",{className:z["editor-container"],children:[(0,o.jsxs)("div",{className:z["editor-header"],children:[(0,o.jsx)("div",{className:z["editor-title"],children:l.o.t(f?"coze_bot_diff_diffdetail_latestversion":"coze_bot_diff_diffdetail_onlineversion")}),(0,o.jsx)(d.iz,{className:z["editor-divider"],layout:"vertical"}),(0,o.jsx)("div",{className:z["editor-title"],children:l.o.t(f?"coze_bot_diff_diffdetail_mydraft":"coze_bot_diff_diffdetail_tobereleasedversion")})]}),(0,o.jsx)("div",{className:"h-[600px]",children:(0,o.jsx)(s.DiffEditor,{theme:"light",className:z.editor,original:b,modified:y,language:"text",options:{minimap:{enabled:!1},wordWrap:"on",diffWordWrap:"on",lineNumbers:"on",readOnly:!0,scrollBeyondLastLine:!1,renderOverviewRuler:!1,enableSplitViewResizing:!1,unicodeHighlight:{ambiguousCharacters:!1},suggestLineHeight:32,lineHeight:20,fontSize:12},loading:(0,o.jsx)("div",{className:"h-[100%] w-[100%] flex items-center justify-center",children:(0,o.jsx)(d.yC,{})})})})]})})]})},F=n("252237"),H=n.n(F),U=n("675940"),V={};V.styleTagTransform=A(),V.setAttributes=P(),V.insert=T().bind(null,"head"),V.domAPI=j(),V.insertStyleElement=R(),k()(U.Z,V);var K=U.Z&&U.Z.locals?U.Z.locals:void 0,q=e=>{var{dataSource:t}=e,[n,r]=(0,a.useState)(!1),s=()=>{r(!1)};return{node:(0,o.jsx)(d.M5,{type:"info",title:l.o.t("publish_terms_title"),visible:n,centered:!0,footer:(0,o.jsx)(d.y3,{onClick:s,theme:"solid",children:l.o.t("got_it")}),onCancel:s,children:(0,o.jsx)(d.aV,{dataSource:t,renderItem:e=>(0,o.jsx)(d.aV.Item,{className:K.list,align:"center",header:(0,o.jsxs)("div",{className:"flex items-center w-full",children:[(0,o.jsx)(d.Ee,{className:"border-1",src:e.icon,width:24,height:24,preview:!1,style:{flexShrink:0}}),(0,o.jsx)(d.ZT.Text,{className:"ml-2 font-semibold ",style:{minWidth:90},ellipsis:{showTooltip:{opts:{content:e.name}}},children:e.name})]}),main:(0,o.jsxs)(d.T,{spacing:0,className:"justify-end",children:[e.privacy_policy?(0,o.jsx)(d.y3,{theme:"borderless",className:"!px-2",children:(0,o.jsx)(d.ZT.Text,{link:{href:e.privacy_policy,target:"_blank"},children:l.o.t("about_privacy_policy")})}):null,e.user_agreement?(0,o.jsx)(d.y3,{theme:"borderless",className:"!px-2",children:(0,o.jsx)(d.ZT.Text,{link:{href:e.user_agreement,target:"_blank"},children:l.o.t("terms_of_service")})}):null]})})})}),close:s,open:()=>{r(!0)}}},Z=e=>{var{termServiceData:t,scene:n="bot",className:r}=e,{node:a,open:s}=q({dataSource:t});return(0,o.jsxs)(o.Fragment,{children:[a,(0,o.jsx)(c.ZT.Text,{className:H()("py-[12px] coz-fg-primary leading-[16px]",r),children:l.o.t("bot"===n?"bot_publish_select_desc_compliance_new":"project_publish_select_desc_compliance_new",{publish_terms_title:(0,o.jsx)(c.ZT.Text,{link:!0,onClick:s,className:"!coz-fg-hglt !font-normal",children:l.o.t("publish_terms_title")})})})]})},Y=20,X=8},601477:function(e,t,n){"use strict";n.d(t,{S:function(){return f}});var r=n(808549),o=n(120454),a=n(151064),s=n(336205),l=n(659596),c=n(707107),d=n(775699),u=n(178385),h=n(49695),p=n(150500),f=e=>{var{status:t,id:n,agentType:f="bot",channelName:m,revokeSuccess:v,origin:g,authInfo:b,isMouseIn:y=!0,isV2:_=!1,v2ButtonProps:w={color:"highlight",size:"small"},onBeforeAuthRedirect:x}=e,S=[u._6.Configured,u._6.Configuring].includes(t),k=()=>{if(!(0,p.Tn)(b)){(0,p.ci)();return}("publish"===g&&t===u._6.NotConfigured||"setting"===g&&t===u.tD.Unauthorized)&&((0,c.Gg)("publish"===g?c.Kg.publish_oauth_button_click:c.Kg.settings_oauth_button_click,{action:"授权",channel_name:m}),null==x||x({id:n,authInfo:b,origin:g}),(0,p.OF)({id:n,authInfo:b,origin:g})),("publish"===g&&S||"setting"===g&&t===u.tD.Authorized)&&((0,c.Gg)("publish"===g?c.Kg.publish_oauth_button_click:c.Kg.settings_oauth_button_click,{action:"解除授权",channel_name:m}),E())},{revokeLoading:C,runRevoke:j}=(0,p.To)({id:n,onRevokeSuccess:v,onRevokeFinally:()=>T()}),{open:E,close:T,modal:I,visible:P}=(0,d.q0)({confirmLoading:C,type:"info",title:s.o.t("user_revoke_authorization_title"),onOk:j,okText:s.o.t("Confirm"),cancelText:s.o.t("Cancel"),icon:(0,a.jsx)(h.Z,{style:{color:"var(--semi-color-danger)"},size:"extra-large"}),onCancel:()=>{T()},okButtonProps:{type:"danger"}}),M=s.o.t(S?"bot_publish_columns_action_revoke_authorize":"bot_publish_columns_action_authorize"),R=_?(0,a.jsx)(l.zx,(0,o._)((0,r._)({onClick:k},w),{children:M})):(0,a.jsx)(d.y3,{onClick:k,theme:"borderless",children:M});return t===u._6.Configured?(0,a.jsxs)(a.Fragment,{children:[y||P?R:null,I("project"===f?(0,a.jsx)(d.ZT.Text,{type:"secondary",children:s.o.t("project_release_cancel1_desc")}):null)]}):R}},493278:function(e,t,n){"use strict";n.d(t,{T:function(){return p}});var r=n(151064),o=n(336205),a=n(775699),s=n(486613),l=n(988179),c=n(561641),d=n(269087),u=n(841622),h={[s.sv.Add]:"devops_publish_multibranch_changeset_add",[s.sv.Delete]:"devops_publish_multibranch_changeset_delete",[s.sv.Modify]:"devops_publish_multibranch_changeset_modify",[s.sv.Remove]:"devops_publish_multibranch_changeset_remove"},p=e=>{var{diffData:t,hasError:n}=e;return(0,r.jsx)("div",{className:u.Z.container,children:(null==t?void 0:t.length)>0?t.map(e=>{var t;return(0,r.jsxs)("div",{className:u.Z["info-block"],children:[(0,r.jsx)("div",{className:u.Z["info-title"],children:e.display_name}),(null==e?void 0:null===(t=e.sub_nodes)||void 0===t?void 0:t.length)?(0,r.jsx)(f,{blockDiffData:e.sub_nodes}):null]},e.display_name)}):(0,r.jsxs)("div",{className:u.Z["empty-container"],children:[(0,r.jsx)("img",{src:d.Z}),(0,r.jsx)(a.ZT.Text,{className:u.Z["empty-info"],children:o.o.t(n?"devops_publish_multibranch_NetworkError":"devops_publish_multibranch_nodiff")})]})})},f=e=>{var{blockDiffData:t}=e,n=[{title:o.o.t("devops_publish_multibranch_property"),width:280,render:e=>(0,r.jsxs)(a.ZT.Text,{ellipsis:{showTooltip:{opts:{content:e.display_name,className:u.Z["property-tooltip"]}}},className:u.Z["cell-span"],children:[e.level>0?(0,r.jsx)(a.ZT.Text,{style:{marginLeft:l.Pj+l.A7*(e.level-1),marginRight:8},children:"-"}):null,e.display_name]})},{title:o.o.t("devops_publish_multibranch_changetype"),render:e=>{var t;return e.diff_res&&(null===(t=e.diff_res)||void 0===t?void 0:t.action)!==s.sv.Unknown?(0,r.jsx)(a.fS,{className:u.Z["tag-".concat(e.diff_res.action)],children:o.o.t(h[e.diff_res.action])}):""},width:120},{title:o.o.t("devops_publish_multibranch_changes"),render:e=>{var t,n,o;return(null==e?void 0:null===(t=e.diff_res)||void 0===t?void 0:t.action)===s.sv.Modify?(0,r.jsx)(l.zb,{node:e,left:(null==e?void 0:null===(n=e.diff_res)||void 0===n?void 0:n.display_left)||"",right:(null==e?void 0:null===(o=e.diff_res)||void 0===o?void 0:o.display_right)||""}):""},ellipsis:!0}];return t?(0,r.jsx)(a.iA,{dataSource:(0,c.pX)(t),columns:n,pagination:!1,onRow:()=>({className:u.Z["table-row"]}),className:u.Z["diff-table"]}):null}},714393:function(e,t,n){"use strict";n.d(t,{LH:function(){return p}});var r=n(151064),o=n(336205),a=n(775699),s=n(486613),l=n(988179),c=n(561641),d=n(269087),u=n(841622),h={[s.sv.Add]:"devops_publish_multibranch_changeset_add",[s.sv.Delete]:"devops_publish_multibranch_changeset_delete",[s.sv.Modify]:"devops_publish_multibranch_changeset_modify",[s.sv.Remove]:"devops_publish_multibranch_changeset_remove"},p=e=>{var{diffData:t,hasError:n,type:s="diff"}=e;return(0,r.jsxs)("div",{className:u.Z.container,children:[(null==t?void 0:t.length)>0?t.map(e=>{var t,n;return(0,r.jsxs)("div",{className:u.Z["info-block"],children:[(0,r.jsx)("div",{className:u.Z["info-title"],children:e.display_name}),(null==e?void 0:null===(t=e.sub_nodes)||void 0===t?void 0:t.length)?null==e?void 0:null===(n=e.sub_nodes)||void 0===n?void 0:n.map((e,t)=>(0,r.jsx)(f,{node:e,type:s},t)):null]},e.display_name)}):(0,r.jsxs)("div",{className:u.Z["empty-container"],children:[(0,r.jsx)("img",{src:d.Z}),(0,r.jsx)(a.ZT.Text,{className:u.Z["empty-info"],children:o.o.t(n?"devops_publish_multibranch_NetworkError":"devops_publish_multibranch_nodiff")})]}),(0,r.jsx)("div",{className:"h-[32px]"}),(0,r.jsx)("div",{className:u.Z.mask})]})},f=e=>{var t,{node:n,type:o="diff"}=e,{display_name:a}=n;return(0,r.jsxs)("div",{children:[a?(0,r.jsx)("div",{className:u.Z["info-subtitle"],children:a}):(0,r.jsx)(r.Fragment,{}),(null==n?void 0:null===(t=n.sub_nodes)||void 0===t?void 0:t.length)?(0,r.jsx)(m,{blockDiffData:null==n?void 0:n.sub_nodes,type:o}):null]})},m=e=>{var{blockDiffData:t,type:n="diff"}=e;if(!t)return null;var d=e=>(0,r.jsxs)(a.ZT.Text,{ellipsis:{showTooltip:{opts:{content:e.display_name,className:u.Z["property-tooltip"]}}},className:u.Z["property-title"],children:[e.level>0?(0,r.jsx)(a.ZT.Text,{style:{marginLeft:l.Pj+l.A7*(e.level-1),marginRight:8},children:"-"}):null,e.display_name]}),p=e=>{var t;return e.diff_res&&(null===(t=e.diff_res)||void 0===t?void 0:t.action)!==s.sv.Unknown?(0,r.jsx)(a.fS,{className:u.Z["tag-".concat(e.diff_res.action)],children:o.o.t(h[e.diff_res.action])}):""},f=e=>{var t,o,a;return(null==e?void 0:null===(t=e.diff_res)||void 0===t?void 0:t.action)===s.sv.Modify?(0,r.jsx)(l.zb,{left:(null==e?void 0:null===(o=e.diff_res)||void 0===o?void 0:o.display_left)||"",right:(null==e?void 0:null===(a=e.diff_res)||void 0===a?void 0:a.display_right)||"",node:e,type:n}):""};return(0,r.jsx)(a.aV,{dataSource:(0,c.pX)(t),bordered:!0,className:u.Z.list,renderItem:e=>(0,r.jsx)(a.aV.Item,{children:(0,r.jsxs)("div",{className:u.Z["list-item"],children:[d(e),(0,r.jsxs)("div",{children:[" ",p(e)]}),f(e)]})})})}},243238:function(e,t,n){"use strict";n.d(t,{S:()=>el,O:()=>e_});var r,o=n("151064"),a=n("336205"),s=n("659596"),l=n("775699"),c=n("178385"),d=n("157728"),u=n("825955"),h=n("808549"),p=n("120454"),f=n("455069"),m=n("735114"),v=n("499283");var g=((r={})[r.NotQuery=0]="NotQuery",r[r.GetBindConnectorConfig=1]="GetBindConnectorConfig",r[r.SaveBindConnectorConfig=2]="SaveBindConnectorConfig",r[r.BindConnector=3]="BindConnector",r[r.UnBindConnector=4]="UnBindConnector",r),b=n("382534"),y=n("39663"),_=n("978028"),w=n("475759"),x=e=>{var t,n,r,o,a,s,{botId:l,origin:c="bot",schemaPages:h,onNextStepSuccess:p,onNextStepError:v}=e,[y,_]=(0,f.useState)(0),{space_id:w=""}=(0,d.useParams)(),x="bot"===c?0:1,S=null!==(s=null==h?void 0:null===(a=h[y])||void 0===a?void 0:a.api_action)&&void 0!==s?s:g.BindConnector;var k={[g.NotQuery]:(0,u._)(function*(){return yield Promise.resolve()}),[g.GetBindConnectorConfig]:(t=(0,u._)(function*(e){var t,n;return yield b.nA.GetBindConnectorConfig({connector_id:null!==(t=null==e?void 0:e.connectorId)&&void 0!==t?t:"",detail:null!==(n=null==e?void 0:e.assignFormValue)&&void 0!==n?n:{},agent_type:x,bot_id:l,space_id:w})}),function(e){return t.apply(this,arguments)}),[g.SaveBindConnectorConfig]:(n=(0,u._)(function*(e){var t,n;return yield b.nA.SaveBindConnectorConfig({connector_id:null!==(t=null==e?void 0:e.connectorId)&&void 0!==t?t:"",detail:null!==(n=null==e?void 0:e.assignFormValue)&&void 0!==n?n:{},agent_type:x,bot_id:l,space_id:w})}),function(e){return n.apply(this,arguments)}),[g.BindConnector]:(r=(0,u._)(function*(e){var t,n;return yield b.nA.BindConnector({connector_id:null!==(t=null==e?void 0:e.connectorId)&&void 0!==t?t:"",connector_info:null!==(n=null==e?void 0:e.assignFormValue)&&void 0!==n?n:{},agent_type:x,bot_id:l,space_id:w},{__disableErrorToast:!0})}),function(e){return r.apply(this,arguments)})};var{run:C,loading:j}=(0,m.Z)((o=(0,u._)(function*(e){return yield k[S](e)}),function(e){return o.apply(this,arguments)}),{manual:!0,ready:Object.keys(k).includes(String(S)),onSuccess:e=>{null==p||p({data:e,action:S})},onError:e=>{v(e)}});return{run:C,loading:j,step:y,setStep:_}},S=n("484782"),k=n("407821"),C=n.n(k),j=n("472772"),E=n.n(j),T=n("395245"),I=n.n(T),P=n("297998"),M=n.n(P),R=n("646576"),D=n.n(R),A=n("606121"),N=n.n(A),L=n("642801"),z={};z.styleTagTransform=N(),z.setAttributes=M(),z.insert=I().bind(null,"head"),z.domAPI=E(),z.insertStyleElement=D(),C()(L.Z,z);var O=L.Z&&L.Z.locals?L.Z.locals:void 0,B=e=>{var t,{copyLinkAreaInfo:n={},agentType:r="bot",botId:a="",initValue:s={}}=e,c=e=>{var t=null!=e?e:"";return t&&(t=(t="project"===r?t.replace(/{project_id}/g,a):t.replace(/{bot_id}/g,a)).replace(/{hostname}/g,window.location.hostname).replace(/{corp_id}/g,s.corp_id)),t};return(0,o.jsxs)("div",{className:O["link-area"],children:[(null==n?void 0:n.title_text)?(0,o.jsxs)(l.T,{spacing:12,align:"start",children:[(0,o.jsx)("span",{className:O["step-order"],children:n.step_order||1}),(0,o.jsx)("div",{className:O["step-content"],children:(0,o.jsx)("div",{className:O["step-title"],children:n.title_text})})]}):null,(null==n?void 0:n.description)?(0,o.jsx)(S.D,{skipHtml:!0,className:O.markdown,children:n.description}):null,(null==n?void 0:null===(t=n.link_list)||void 0===t?void 0:t.length)?(0,o.jsx)("div",{className:O["link-list"],children:null==n?void 0:n.link_list.map(e=>(0,o.jsxs)("div",{style:{marginBottom:32},children:[(0,o.jsx)(l.ZT.Title,{className:O.title,children:e.title}),(0,o.jsx)(l.ZT.Text,{className:O.link,copyable:!0,children:c(e.link)})]},e.link))}):null]})},W=n("783915"),F={};F.styleTagTransform=N(),F.setAttributes=M(),F.insert=I().bind(null,"head"),F.domAPI=E(),F.insertStyleElement=D(),C()(W.Z,F);var H=W.Z&&W.Z.locals?W.Z.locals:void 0,U=e=>{var{connectorConfigInfo:t={}}=e;return(0,o.jsxs)("div",{className:H.guide,children:[(null==t?void 0:t.start_text)?(0,o.jsx)(S.D,{skipHtml:!0,linkTarget:"_blank",className:H.markdown,children:null==t?void 0:t.start_text}):null,(null==t?void 0:t.guide_link_url)&&(null==t?void 0:t.guide_link_text)?(0,o.jsx)("div",{children:(0,o.jsx)(l.ZT.Text,{link:{href:null==t?void 0:t.guide_link_url},className:H["config-link"],children:null==t?void 0:t.guide_link_text})}):null]})},V=n("61279"),K=n("297158"),q=n("873183"),Z=n("298203"),Y=n("293758"),X={};X.styleTagTransform=N(),X.setAttributes=M(),X.insert=I().bind(null,"head"),X.domAPI=E(),X.insertStyleElement=D(),C()(Y.Z,X);var Q=Y.Z&&Y.Z.locals?Y.Z.locals:void 0,G=e=>{var{formItemSchema:t,isReadOnly:n,initValue:r}=e,c=null==r?void 0:r[t.name];if(n){;return(0,o.jsxs)("div",{className:Q["disable-field"],children:[(0,o.jsx)("div",{className:Q.title,children:t.title}),"array"===t.type?(0,o.jsx)(s.QS,{tagList:(u=c,p=t.enums,(f=(0,Z.f5)(u))?f.map(e=>{var t,n;return{children:null!==(n=null==p?void 0:null===(t=p.find(t=>t.value===e))||void 0===t?void 0:t.label)&&void 0!==n?n:e}}):[])}):(0,o.jsx)(l.ZT.Text,{style:{width:"100%"},ellipsis:{showTooltip:{opts:{content:c,style:{wordBreak:"break-word"}}}},children:c})]})}function d(e){var t,n,r=(null!==(t=e.rules)&&void 0!==t?t:[]).map(t=>{var n=t.message?a.o.t(t.message,{field:e.name}):void 0;return(0,h._)({},t,n&&{message:n})});return r.push({required:e.required,message:a.o.t("bot_publish_field_placeholder",{field:null!==(n=e.title)&&void 0!==n?n:""})}),r}if(!t.name)return null;switch(t.component){case"Input":if("array"===t.type){var u,p,f,m,v=[];try{v=JSON.parse(c)}catch(e){K.kg.error({error:e}),v=[]}return!v.length&&v.push(""),(0,o.jsx)(s.OF,{field:t.name,initValue:v,children:e=>{var{arrayFields:n,add:r}=e;return(0,o.jsxs)(o.Fragment,{children:[n.map((e,r)=>{var s,{key:c,field:u,remove:h}=e;return(0,o.jsx)(l.K9,{placeholder:a.o.t("bot_publish_field_placeholder",{field:null!==(s=t.title)&&void 0!==s?s:""}),field:u,label:t.title,noLabel:r>0,required:t.required,rules:d(t),fieldClassName:Q.input,suffix:n.length<=1?null:(0,o.jsx)(q.dVD,{onClick:h})},c)}),(0,o.jsx)(s.zx,{className:Q["link-button"],color:"highlight",size:"small",icon:(0,o.jsx)(q.PwN,{}),onClick:r,children:a.o.t("binding_add_card")})]})}})}return(0,o.jsx)(l.K9,{placeholder:a.o.t("bot_publish_field_placeholder",{field:null!==(m=t.title)&&void 0!==m?m:""}),field:t.name,label:t.title,required:t.required,showClear:!0,rules:d(t),initValue:c},t.name);case"Select":var g="array"===t.type,b=g?(0,Z.f5)(c):c;return(0,o.jsx)(l.l0.Select,{placeholder:"Enter ".concat(t.title),field:t.name,label:t.title,optionList:t.enums,multiple:g,rules:d(t),initValue:b},t.name);default:return null}},J=n("205136"),$={};$.styleTagTransform=N(),$.setAttributes=M(),$.insert=I().bind(null,"head"),$.domAPI=E(),$.insertStyleElement=D(),C()(J.Z,$);var ee=J.Z&&J.Z.locals?J.Z.locals:void 0,et=(0,f.forwardRef)((e,t)=>{var n,r,a,s,{schemaAreaInfo:c,initValue:d,getFormDisable:h,isReadOnly:p,setErrorMessage:m}=e,v=(0,f.useRef)(),g=(0,V.Z)();(0,f.useImperativeHandle)(t,()=>({submit:(0,u._)(function*(){var e,t=yield null===(e=v.current)||void 0===e?void 0:e.validate();return Object.fromEntries(Object.entries(null!=t?t:{}).map(e=>{var[t,n]=e;return[t,Array.isArray(n)?JSON.stringify(n):n]}))}),reset:()=>{var e;return null===(e=v.current)||void 0===e?void 0:e.reset()}})),(0,f.useEffect)(()=>{g()},[c]);var b=(null==c?void 0:null===(n=c.schema_list)||void 0===n?void 0:n.filter(e=>e.required).some(e=>{var t,n=null===(t=v.current)||void 0===t?void 0:t.getValue(e.name);return Array.isArray(n)?!n.length||1===n.length&&!n[0]:!n}))||!(null==c?void 0:null===(r=c.schema_list)||void 0===r?void 0:r.length);return(0,f.useEffect)(()=>{h(b)},[b]),(0,o.jsxs)("div",{children:[(null==c?void 0:c.title_text)?(0,o.jsxs)(l.T,{spacing:12,align:"start",children:[(0,o.jsx)("span",{className:ee["step-order"],children:c.step_order||2}),(0,o.jsx)("div",{className:ee["step-content"],children:(0,o.jsx)("div",{className:ee["step-title"],children:c.title_text})})]}):null,(null==c?void 0:c.description)?(0,o.jsx)(S.D,{skipHtml:!0,className:ee.markdown,children:null==c?void 0:c.description}):null,(null==c?void 0:null===(a=c.schema_list)||void 0===a?void 0:a.length)?(0,o.jsx)(l.l0,{initValues:d,className:ee["config-form"],onValueChange:()=>{g(),m(void 0)},getFormApi:e=>v.current=e,autoScrollToError:!0,allowEmpty:!0,children:null==c?void 0:null===(s=c.schema_list)||void 0===s?void 0:s.map(e=>(0,o.jsx)(G,{initValue:d,formItemSchema:e,isReadOnly:p},e.name))}):null]})}),en=n("434414"),er={};er.styleTagTransform=N(),er.setAttributes=M(),er.insert=I().bind(null,"head"),er.domAPI=E(),er.insertStyleElement=D(),C()(en.Z,er);var ei=en.Z&&en.Z.locals?en.Z.locals:void 0,eo=e=>{var t,n,{errorMessage:r}=e,s=null!==(n=null==r?void 0:r.raw)&&void 0!==n?n:{};return(0,o.jsx)(l.l0.ErrorMessage,{error:(t=s,["bind_bot_id","bind_bot_name","bind_space_id"].every(e=>e in t))?(0,o.jsx)("div",{className:ei["error-link"],children:a.o.t("bot_publish_bind_error",{bot_name:(0,o.jsx)(l.ZT.Text,{className:ei["error-link-underline"],link:{href:"/space/".concat(s.bind_space_id,"/").concat(1===s.bind_agent_type?"project-ide":"bot","/").concat(s.bind_bot_id)},ellipsis:{showTooltip:{opts:{content:s.bind_bot_name}}},children:s.bind_bot_name}),key_name:"token"})}):null==r?void 0:r.msg,className:ei["error-container"]})},ea=e=>{var t,n,r,s,d,S,k,{botId:C,origin:j="bot",onSuccess:E,onUnbind:T}=e,I=(0,f.useRef)(null),[P,M]=(0,f.useState)(),{initValue:R}=null!=P?P:{},[D,A]=(0,f.useState)(),[N,L]=(0,f.useState)(!1),[z,O]=(0,f.useState)(),W=(0,f.useRef)(""),F=()=>{var e;A(void 0),ee(0),O(void 0),null===(e=I.current)||void 0===e||e.reset(),el()},H=()=>{F(),T?T():E((0,p._)((0,h._)({},R),{bind_info:{},bind_id:""})),l.O$.success(a.o.t("bot_publish_disconnect_success"))},[V,K]=(0,f.useState)(),q=(0,f.useRef)(),{loading:Z}=(0,m.Z)((0,u._)(function*(){var e;return yield b.nA.QuerySchemaList({connector_id:null!==(e=null==R?void 0:R.id)&&void 0!==e?e:"",scene:j})}),{ready:!!(null==R?void 0:R.id),refreshDeps:[null==R?void 0:R.id],onBefore:()=>{(null==R?void 0:R.id)!==q.current&&(q.current=null==R?void 0:R.id,K({}))},onSuccess:e=>{var t;!(null===(t=e.schema_area_pages)||void 0===t?void 0:t.length)&&(e.schema_area_pages=[{schema_area:e.schema_area,copy_link_area:e.copy_link_area}]),K(e)},onError:()=>{K({})}}),{schema_area_pages:Y=[]}=null!=V?V:{},X=e=>{if((null==R?void 0:R.bind_type)===c.P0.KvAuthBind&&((null==e?void 0:e.client_id)||(null==e?void 0:e.auth_params)))(0,y.HL)({navigatePath:"".concat(location.pathname).concat(location.search),type:"oauth",extra:{origin:"publish",encrypt_state:null==e?void 0:e.encrypt_state}},(null==R?void 0:R.id)||"",(0,h._)((0,p._)((0,h._)({},null==R?void 0:R.auth_login_info),{client_id:null==e?void 0:e.client_id}),e.auth_params));else{var t;W.current=null!==(t=null==e?void 0:e.bind_id)&&void 0!==t?t:""}},Q=()=>{$===(null==Y?void 0:Y.length)-1?(R&&E((0,p._)((0,h._)({},R),{bind_info:(0,h._)({},z),bind_id:W.current})),F()):ee($+1)},{loading:G,run:J,step:$,setStep:ee}=x({botId:C,origin:j,schemaPages:Y,onNextStepSuccess:e=>{if(e.action===g.BindConnector&&X(e.data),e.action===g.GetBindConnectorConfig){var t;O((0,h._)({},z,null===(t=e.data.config)||void 0===t?void 0:t.detail))}Q()},onNextStepError:e=>{(0,v.k0)(e)&&A(e)}}),{node:en,open:er}=(0,w.O)({botId:C,origin:j,platformInfo:R,onUnbind:()=>{H()}});var ei=(t=(0,u._)(function*(){var e,t,n=yield null===(e=I.current)||void 0===e?void 0:e.submit();O((0,h._)({},z,n)),J({connectorId:null!==(t=null==R?void 0:R.id)&&void 0!==t?t:"",assignFormValue:(0,h._)({},z,n)})}),function(){return t.apply(this,arguments)});var{modal:ea,open:es,close:el}=(0,l.q0)({type:"action-small",footer:(null==R?void 0:R.bind_id)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.y3,{theme:"light",type:"tertiary",onClick:()=>{el(),ee(0)},children:a.o.t("Cancel")}),(0,o.jsx)(l.y3,{theme:"solid",type:"danger",onClick:er,children:a.o.t("bot_publish_disconnect",{platform:null!==(s=null==R?void 0:R.name)&&void 0!==s?s:""})})]}):(0,o.jsxs)(o.Fragment,{children:[(null==Y?void 0:Y.length)&&0!==$&&(null===(n=Y[$])||void 0===n?void 0:n.api_action)!==g.NotQuery?(0,o.jsx)(l.y3,{theme:"solid",onClick:()=>{A(void 0),ee($-1)},children:a.o.t("Previous_1")}):null,(0,o.jsx)(l.y3,{theme:"solid",onClick:ei,disabled:N,loading:G,children:$===(null!==(d=null==Y?void 0:Y.length)&&void 0!==d?d:0)-1?(null===(r=Y[$])||void 0===r?void 0:r.api_action)!==g.NotQuery?a.o.t("Save"):a.o.t("Complete"):a.o.t("Next_1")})]}),onCancel:F,title:null==V?void 0:V.title_text}),ec=(e,t)=>(0,o.jsxs)(o.Fragment,{children:[e?(0,o.jsx)(B,{copyLinkAreaInfo:e,agentType:j,botId:C,initValue:(0,h._)({},null==R?void 0:R.bind_info,z)}):null,t?(0,o.jsx)(et,{schemaAreaInfo:t,initValue:(0,h._)({},null==R?void 0:R.bind_info,z),ref:I,getFormDisable:e=>L(e),isReadOnly:!!(null==R?void 0:R.bind_id),setErrorMessage:A}):null,D?(0,o.jsx)(eo,{errorMessage:D}):null]});return{node:ea((0,o.jsxs)(l.yC,{wrapperClassName:_.Z["config-area"],spinning:Z,children:[(0,o.jsx)(U,{connectorConfigInfo:V}),(null==Y?void 0:Y.length)&&!(null==R?void 0:R.bind_id)?(0,o.jsx)("div",{children:ec(null===(S=Y[$])||void 0===S?void 0:S.copy_link_area,null===(k=Y[$])||void 0===k?void 0:k.schema_area)}):null,(null==R?void 0:R.bind_id)&&(null==Y?void 0:Y.length)?(0,o.jsx)(o.Fragment,{children:null==Y?void 0:Y.map((e,t)=>(0,o.jsx)("div",{children:ec(e.copy_link_area,e.schema_area)},t))}):null,en]})),open:e=>{M(e),es()},close:el}},es=n("561641"),el=e=>{var{setDataSource:t,setSelectedPlatforms:n,record:r,bindSuccessCallback:u,unbindCallback:h,origin:p="bot",originId:f}=e,{bot_id:m="",project_id:v=""}=(0,d.useParams)(),{node:g,open:b}=ea({botId:null!=f?f:"bot"===p?m:v,origin:p,onSuccess:e=>{if(u){u(e);return}null==t||t(t=>{var n,r=t.find(t=>t.id===(null==e?void 0:e.id));if(r){if(r.id===es.zW&&!(null==e?void 0:e.bind_id))return t.filter(e=>e.id!==es.zW);r.bind_id=null==e?void 0:e.bind_id,r.bind_info=null!==(n=null==e?void 0:e.bind_info)&&void 0!==n?n:{},r.config_status=(null==e?void 0:e.bind_id)?c._6.Configured:c._6.NotConfigured}return[...t]}),!(null==e?void 0:e.bind_id)&&(null==n||n(t=>t.filter(t=>t!==(null==e?void 0:e.id))))},onUnbind:h}),y=()=>b({initValue:r}),_=a.o.t("bot_publish_action_configure");return(0,o.jsxs)(o.Fragment,{children:["project"===p?(0,o.jsx)(s.zx,{onClick:y,size:"small",color:"primary",children:_}):(0,o.jsx)(l.y3,{onClick:y,theme:"borderless",children:_}),g]})},ec=n("707107"),ed=n("44172"),eu=n("988179"),eh=n("391962"),ep=n("458620"),ef=n("189284"),em=n("486613"),ev=n("714393"),eg=n("493278"),eb=(0,ep.z)({eventName:ep.b.getBotDiffError}),ey=()=>{var e,t,[n,r]=(0,f.useState)(),s=(0,d.useParams)(),[c]=(0,ef.V)(),h=!!(null==c?void 0:c["bot.devops.merge_prompt_diff"]);var{data:p,loading:v,run:g,mutate:y,error:w}=(0,m.Z)((e=(0,u._)(function*(e){var{bot_id:t="",space_id:n="",commit_version:r}=s;return(yield b.bV.BotDiff({space_id:n,bot_id:t,left:{branch:em.I0.Publish,connector_id:e.id},template_key:h?"diff_template_when_publish_v2":"",right:{branch:em.I0.Base,version_id:r}})).data}),function(t){return e.apply(this,arguments)}),{manual:!0,onBefore:()=>{eb.start()},onSuccess:e=>{eb.success()},onError:e=>{eb.error({reason:"get publish diff error",error:e})}}),x=()=>{y({origin_bot_dl:"",diff_display_node:[]}),C()},{modal:S,open:k,close:C}=(0,l.q0)({type:"info",okText:a.o.t("devops_publish_multibranch_done"),okType:"tertiary",okButtonProps:{className:"semi-button-light"},hasCancel:!1,className:_.Z["diff-modal"],onCancel:x,onOk:x,title:a.o.t("devops_publish_multibranch_diffwithin",{connectorName:null!==(t=null==n?void 0:n.name)&&void 0!==t?t:""})});return{node:S((0,o.jsx)("div",{className:_.Z["diff-modal-container"],children:v?(0,o.jsx)(l.yC,{}):h?(0,o.jsx)(ev.LH,{diffData:(null==p?void 0:p.diff_display_node)||[],hasError:void 0!==w,type:"publish"}):(0,o.jsx)(eg.T,{diffData:(null==p?void 0:p.diff_display_node)||[],hasError:void 0!==w})})),open:e=>{r(e),g(e),k()},close:C}},e_=e=>{var{record:t,isMouseIn:n}=e,{open:r,node:s}=ey(),c=(0,eh.R)(e=>e.isCollaboration),d=e=>{(0,eu.iN)(ec.Kg.bot_publish_difference,{platform_type:e.name}),r(e)};return(0,o.jsxs)(o.Fragment,{children:[n&&c?(0,o.jsx)(l.u,{content:a.o.t("devops_publish_multibranch_viewdiff"),children:(0,o.jsx)(l._3,{onClick:()=>{d(t)},icon:(0,o.jsx)(ed.k8G,{color:"#4D53E8"})})}):null,s]})}},150500:function(e,t,n){"use strict";n.d(t,{OF:function(){return g},Tn:function(){return b},To:function(){return v},ci:function(){return y}});var r,o=n(825955),a=n(808549),s=n(788637),l=n(735114),c=n(947578),d=n(297158),u=n(336205),h=n(727914),p=n(382534),f=n(39663),m=n(659596),v=e=>{var{id:t,onRevokeSuccess:n,onRevokeFinally:r}=e,{loading:a,runAsync:s}=(0,l.Z)((0,o._)(function*(){return yield p.nA.CancelUserAuth({connector_id:t})}),{manual:!0,onSuccess:()=>{null==n||n(t)},onFinally:()=>{null==r||r()}});return{revokeLoading:a,runRevoke:s}};var g=(r=(0,o._)(function*(e){var t,n,{id:r,authInfo:o,origin:s}=e,l=yield p.nA.GetConnectorAuthState({connector_id:r}),c=null!==(n=null==l?void 0:null===(t=l.data)||void 0===t?void 0:t.state)&&void 0!==n?n:{};(0,f.HL)({navigatePath:location.pathname,type:"oauth",extra:(0,a._)({origin:s},c)},r,o)}),function(e){return r.apply(this,arguments)}),b=e=>!(0,s.Z)(e)&&!!(null==e?void 0:e.authorize_url),y=()=>{d.kg.error({message:"connection_missing_oauth_info",error:new h.sH("normal_error","Connection missing oauth information")}),m.FN.error({content:(0,c.u)(u.o.t("error"))})}},561641:function(e,t,n){"use strict";n.d(t,{EK:function(){return d},dj:function(){return h},pX:function(){return s},vh:function(){return u},zW:function(){return c},zs:function(){return l}});var r=n(808549),o=n(120454);n(336205),n(775699);var a=n(178385);n(298203),n(150500);var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return null==e||e.forEach(e=>{e.level=t,n.push(e),e.sub_nodes&&n.push(...s(e.sub_nodes,t+1))}),n},l=()=>{var e=document.body.style,t=document.getElementsByTagName("html")[0].style;e.minHeight="600px",t.minHeight="600px",e.minWidth="1680px",t.minWidth="1680px"},c="10000114",d="10000122",u=(e,t)=>(null==t?void 0:t.length)?t.map(t=>{var n,s,l,c,d,u,h,p=null!==(l=null==e?void 0:e[t.id])&&void 0!==l?l:{};return(0,o._)((0,r._)({},t),{publish_status:null!==(c=p.publish_result_status)&&void 0!==c?c:a.an.Failed,fail_text:null!==(d=p.msg)&&void 0!==d?d:"",share_link:null!==(u=null===(n=p.connector)||void 0===n?void 0:n.share_link)&&void 0!==u?u:"",bind_info:null!==(h=null===(s=p.connector)||void 0===s?void 0:s.bind_info)&&void 0!==h?h:t.bind_info})}):[],h=e=>{try{return JSON.parse(e)}catch(e){return""}}},486613:function(e,t,n){"use strict";n.d(t,{I0:function(){return d},Ll:function(){return m},Xb:function(){return p},_g:function(){return f},jY:function(){return h},sv:function(){return u}});var r,o,a,s,l,c,d=((r={})[r.Undefined=0]="Undefined",r[r.PersonalDraft=1]="PersonalDraft",r[r.Base=2]="Base",r[r.Publish=3]="Publish",r);var u=((o={})[o.Unknown=0]="Unknown",o[o.Add=1]="Add",o[o.Delete=2]="Delete",o[o.Modify=3]="Modify",o[o.Remove=4]="Remove",o[o.Remain=5]="Remain",o);var h=((a={})[a.Default=0]="Default",a[a.TextDetail=1]="TextDetail",a);var p=((s={})[s.Online=1]="Online",s[s.Submit=2]="Submit",s[s.Draft=3]="Draft",s);var f=((l={})[l.Bot=1]="Bot",l[l.Workflow=2]="Workflow",l);var m=((c={})[c.AgentFlow=1]="AgentFlow",c[c.Agent=2]="Agent",c[c.Workflow=3]="Workflow",c)},407694:function(e,t,n){"use strict";n.d(t,{Cg:()=>u,X9:()=>d,zu:()=>h});var r=n("151064"),o=n("455069"),a=n("716894"),s=n("992499"),l=e=>(0,a.F)(t=>({spaceId:e.spaceId,projectId:e.projectId,version:e.version,patch:e=>t(()=>e)}),s.X),c=(0,o.createContext)(null),d=e=>{var{spaceId:t,projectId:n,version:a,children:s}=e,d=(0,o.useMemo)(()=>l({spaceId:t,projectId:n,version:a}),[t,n,a]);return(0,r.jsx)(c.Provider,{value:d,children:s})},u=()=>(0,o.useContext)(c),h=e=>{var t=u();if(!t)throw Error("cant not found IDEGlobalContext");return t(e)}},66860:function(e,t,n){"use strict";let r;n.d(t,{dg:()=>ex,nU:()=>ec,S4:()=>eI,OC:()=>ef,Vx:()=>T,lW:()=>y,LC:()=>b,ai:()=>v.ai,Un:()=>x,j2:()=>eT,rA:()=>eE,X5:()=>ej});var o,a,s=n("808549"),l=n("473980"),c=n("151064"),d=n("455069"),u=n("149528"),h=n("825955"),p=n("120454"),f=n("479910"),m=n("598208"),v=n("909776"),g=n("382534");var b=((o={}).Workflow="workflow",o.Plugin="plugin",o.Knowledge="knowledge",o.Database="database",o.Variable="variables",o);var y=((a={}).CreateResource="resource-folder-create-resource",a.CreateFolder="resource-folder-create-folder",a.Rename="resource-folder-rename",a.Delete="resource-folder-delete",a.DuplicateResource="resource-folder-duplicate-resource",a.ImportLibraryResource="resource-folder-import-library-resource",a.MoveToLibrary="resource-folder-move-to-library",a.CopyToLibrary="resource-folder-copy-to-library",a.EnableKnowledge="resource-folder-enable-knowledge",a.DisableKnowledge="resource-folder-disable-knowledge",a.SwitchToChatflow="resource-folder-switch-to-chatflow",a.SwitchToWorkflow="resource-folder-switch-to-workflow",a.UpdateDesc="resource-folder-update-desc",a),_=e=>{if(!!e)switch(e){case v.b0.Imageflow:case v.b0.Workflow:return b.Workflow;case v.b0.Knowledge:return b.Knowledge;case v.b0.Plugin:return b.Plugin;case v.b0.Variable:return b.Variable;case v.b0.Database:return b.Database;default:return b.Workflow}},w={resourceTree:[],canClosePopover:!0,groupExpandMap:{[v.ai.Workflow]:!0,[v.ai.Plugin]:!0,[v.ai.Data]:!0}},x=(0,m.Ue)()((0,f.mW)((e,t)=>{var n,r;return(0,p._)((0,s._)({},w),{updateGroupExpand:(n,r)=>{e({groupExpandMap:(0,p._)((0,s._)({},t().groupExpandMap),{[n]:r})})},setSelectedResource:t=>{e({selectedResource:t})},fetchResource:(n=(0,h._)(function*(t,n,r,o){e({isFetching:!0,spaceId:t,projectId:n,version:r});var a,l=null===(a=(yield g.Js.ProjectResourceList({project_id:null!=n?n:"",space_id:t,project_version:r})).resource_groups)||void 0===a?void 0:a.map(e=>{var t;return{groupType:e.group_type,resourceList:(null===(t=e.resource_list)||void 0===t?void 0:t.map(e=>{var t,n;return(0,s._)({id:String(null!==(t=e.res_id)&&void 0!==t?t:""),type:_(e.res_type),name:null!==(n=e.name)&&void 0!==n?n:""},e)}))||[]}});null==o||o(l),e({resourceTree:l,isFetching:!1,initLoaded:!0})}),function(e,t,r,o){return n.apply(this,arguments)}),refetch:(r=(0,h._)(function*(e){var{spaceId:n,projectId:r,version:o}=t();if(!!n&&!!r)return yield new Promise(e=>setTimeout(()=>e(),700)),t().fetchResource(n,r,o,e)}),function(e){return r.apply(this,arguments)}),setCanClosePopover:t=>{e({canClosePopover:t})}})},{name:"projectIDE.primarySidebar",enabled:!1})),S=n("336205"),k=n("873183"),C=n("659596"),j=(0,c.jsx)("i",{style:{fontSize:14},className:"codicon codicon-folder"}),E=(0,c.jsx)("i",{style:{fontSize:14},className:"codicon codicon-folder-opened"}),T="variables",I={[b.Workflow]:(0,c.jsx)(k.eTH,{}),[b.Plugin]:(0,c.jsx)(k.QWX,{}),[b.Knowledge]:(0,c.jsx)(k.da8,{}),[b.Variable]:(0,c.jsx)(k.pFl,{})},P={[v.ai.Workflow]:S.o.t("library_resource_type_workflow"),[v.ai.Plugin]:S.o.t("library_resource_type_plugin"),[v.ai.Data]:S.o.t("dataide001")},M={[u.H0.Folder]:S.o.t("project_resource_sidebar_create_new_folder"),[v.ai.Workflow]:S.o.t("project_resource_sidebar_create_new_resource",{resource:S.o.t("library_resource_type_workflow")}),[v.ai.Plugin]:S.o.t("project_resource_sidebar_create_new_resource",{resource:S.o.t("library_resource_type_plugin")}),[v.ai.Data]:S.o.t("project_resource_sidebar_create_new_resource",{resource:S.o.t("project_resource_sidebar_data_section")})},R={[v.ai.Workflow]:(0,c.jsx)(k.eTH,{}),[v.ai.Plugin]:(0,c.jsx)(k.QWX,{}),[v.ai.Data]:(0,c.jsx)(k.da8,{})},D={[v.Lk.Rename]:y.Rename,[v.Lk.Copy]:y.DuplicateResource,[v.Lk.Delete]:y.Delete,[v.Lk.CopyToLibrary]:y.CopyToLibrary,[v.Lk.MoveToLibrary]:y.MoveToLibrary,[v.Lk.Enable]:y.EnableKnowledge,[v.Lk.Disable]:y.DisableKnowledge,[v.Lk.SwitchToChatflow]:y.SwitchToChatflow,[v.Lk.SwitchToFuncflow]:y.SwitchToWorkflow,[v.Lk.UpdateDesc]:y.UpdateDesc},A=n("407821"),N=n.n(A),L=n("472772"),z=n.n(L),O=n("395245"),B=n.n(O),W=n("297998"),F=n.n(W),H=n("646576"),U=n.n(H),V=n("606121"),K=n.n(V),q=n("802086"),Z={};Z.styleTagTransform=K(),Z.setAttributes=F(),Z.insert=B().bind(null,"head"),Z.domAPI=z(),Z.insertStyleElement=U(),N()(q.Z,Z);var Y=q.Z&&q.Z.locals?q.Z.locals:void 0,X={[v.ai.Workflow]:"workflow",[v.ai.Plugin]:"plugin",[v.ai.Data]:"data"},Q=e=>{var{groupType:t,onActionVisibleChange:n,onCreateResource:r,onImportResource:o,createResourceConfig:a}=e,s=(0,u.RX)(u.L),l=(0,d.useMemo)(()=>{var e=s.getShortcutByCommandId(y.CreateResource);return(null==e?void 0:e.map(e=>e.join(" ")).join(" / "))||""},[s]),h=Array.isArray(a)?a.map(e=>{var{icon:n,label:o,tooltip:a,subType:s}=e,l=(0,c.jsx)(C.v2.Item,{"data-testid":"project-ide.resource-group.actions.menu-item.".concat(s),onClick:(e,n)=>{n.stopPropagation(),null==r||r(t,s)},icon:n,children:o});return a?(0,c.jsx)(C.u,{trigger:"hover",position:"rightTop",showArrow:!1,content:a,style:{width:208,padding:4,borderRadius:"var(--coze-8)"},children:l},s):l}):(0,c.jsx)(C.v2.Item,{suffix:(0,c.jsx)("span",{className:Y.shortcut,children:l}),onClick:(e,n)=>{n.stopPropagation(),null==r||r(t)},icon:R[t],children:M[t]}),p=(0,d.useMemo)(()=>198,[]);return(0,c.jsx)(C.v2,{trigger:"hover",position:"bottomLeft",onVisibleChange:e=>null==n?void 0:n(e),render:(0,c.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,c.jsxs)(C.v2.SubMenu,{className:"w-[198px]",mode:"menu",style:{width:p},children:[null,h,(0,c.jsx)(C.v2.Item,{onClick:(e,n)=>{n.stopPropagation(),null==o||o(t)},icon:(0,c.jsx)(k.Zgk,{}),children:S.o.t("project_resource_sidebar_import_from_library")})]})}),children:(0,c.jsx)(C.hU,{"data-testid":"project-".concat(X[t],"-add-resource"),color:"secondary",size:"small",icon:(0,c.jsx)(k.PwN,{className:"coz-fg-primary"}),onClick:e=>e.stopPropagation()})})},G=n("252237"),J=n.n(G),$=e=>{var{expand:t}=e;return(0,c.jsx)(k.wMM,{className:"text-[10px] coz-fg-secondary transition-transform",style:t?{transform:"rotate(90deg)"}:void 0})},ee=n("864539"),et={};et.styleTagTransform=K(),et.setAttributes=F(),et.insert=B().bind(null,"head"),et.domAPI=z(),et.insertStyleElement=U(),N()(ee.Z,et);var en=ee.Z&&ee.Z.locals?ee.Z.locals:void 0,er=e=>{var{title:t,actions:n,content:r,expand:o,onExpandChange:a,className:s}=e;return(0,c.jsxs)("div",{className:J()(s,en["resource-group"]),children:[(0,c.jsxs)("div",{className:en["resource-group-header"],onClick:()=>null==a?void 0:a(!o),children:[(0,c.jsxs)("div",{className:en["header-left"],children:[(0,c.jsx)($,{expand:o}),(0,c.jsx)("span",{className:en["header-title"],children:t})]}),n?(0,c.jsx)("div",{className:en["action-group"],children:n}):null]}),(0,c.jsx)("div",{className:en["resource-group-content"],style:o?void 0:{display:"none"},children:r})]})},ei=n("130001"),eo=n("771531"),ea=n("435946"),es=n("450562"),el=e=>{var{label:t}=e;return t?t.length>es.hhB?S.o.t("project_resource_sidebar_warning_length_exceeds"):es.Pz_.test(t)?"":S.o.t("workflow_list_create_modal_name_rule_reg"):S.o.t("project_resource_sidebar_warning_empty_key")},ec=e=>{var{label:t,parentPath:n,id:r,resourceTree:o}=e,a=[],s=e=>{if(a.push(e.id),a.join("/")===n.join("/")){var o;return null===(o=e.children)||void 0===o?void 0:o.some(e=>!(r===e.id&&"-1"!==r)&&e.name===t)}for(var l of e.children||[])if(s(l))return!0;a.pop()};return s(o)?S.o.t("project_resource_sidebar_warning_label_exists",{label:t}):""},ed=(e,t)=>{var n;if(e.type===u.H0.Folder)n=t?E:j;else n=I[e.type]||"";return n},eu=(e,t)=>{var n,r;return(null===(r=e.actions)||void 0===r?void 0:null===(n=r.find(e=>e.key===t))||void 0===n?void 0:n.enable)||!1},eh=(e,t)=>{var n="";switch(null==t?void 0:t.type){case b.Workflow:n="library_resource_type_workflow";break;case b.Plugin:n="library_resource_type_plugin";break;case b.Knowledge:n="library_resource_type_knowledge";break;case b.Database:n="db_table_entry"}switch(e){case y.Rename:return S.o.t("workflow_detail_node_rename");case y.DuplicateResource:return S.o.t("workflow_add_list_copy");case y.Delete:return(null==t?void 0:t.type)===u.H0.Folder?S.o.t("filebox_0042"):S.o.t("project_resource_sidebar_delete");case y.CopyToLibrary:return S.o.t("project_resource_sidebar_copy_to_library");case y.MoveToLibrary:return S.o.t("project_resource_sidebar_move_to_library");case y.EnableKnowledge:return S.o.t("project_resource_sidebar_enable_resource",{resource:S.o.t(n)});case y.DisableKnowledge:return S.o.t("project_resource_sidebar_disable_resource",{resource:S.o.t(n)});case y.ImportLibraryResource:return S.o.t("project_resource_sidebar_import_from_library",{},"");case y.UpdateDesc:return S.o.t("project_241115",{},"修改描述");case y.SwitchToChatflow:return S.o.t("wf_chatflow_121",{flowMode:S.o.t("wf_chatflow_76")});case y.SwitchToWorkflow:return S.o.t("wf_chatflow_121",{flowMode:S.o.t("Workflow")});default:return""}},ep=e=>![y.CreateResource,y.CreateFolder,y.Rename,y.Delete,y.DuplicateResource].includes(e);class ef{isResourceActionEnabled(e){var t;return Object.values((null===(t=this.resourceFolderDispatch)||void 0===t?void 0:t.tempSelectedMap)||{}).every(t=>eu(t,e))}renameResource(e){if(e){this.onRenameResourceEmitter.fire({id:e});return}if(this.isResourceActionEnabled(v.Lk.Rename)){var t,n;null===(n=this.resourceFolderDispatch)||void 0===n||null===(t=n.onEnter)||void 0===t||t.call(n)}}deleteResource(){if(this.isResourceActionEnabled(v.Lk.Delete)){var e,t;null===(t=this.resourceFolderDispatch)||void 0===t||null===(e=t.onDelete)||void 0===e||e.call(t)}}duplicateResource(){this.isResourceActionEnabled(v.Lk.Copy)&&this.onDuplicateEmitter.fire({id:this.resourceFolderDispatch.id,tempSelectedMap:this.resourceFolderDispatch.tempSelectedMap})}get resourceFolderDispatch(){return this.contextKey.getContext(u.sJ)}createResource(){this.onCreateResourceEmitter.fire({id:this.resourceFolderDispatch.id})}constructor(){this.onDuplicateEmitter=new u.Q5,this.onCreateResourceEmitter=new u.Q5,this.onDuplicateEvent=this.onDuplicateEmitter.event,this.onCreateResourceEvent=this.onCreateResourceEmitter.event,this.onRenameResourceEmitter=new u.Q5,this.onRenameResource=this.onRenameResourceEmitter.event}}(0,ei.gn)([(0,eo.f)(u.aY),(0,ei.w6)("design:type",void 0===u.aY?Object:u.aY)],ef.prototype,"contextKey",void 0),ef=(0,ei.gn)([(0,ea.b)()],ef);var em=e=>{var{onDelete:t}=e,n=(0,u.XO)(),[r,o]=(0,d.useState)([]),[a,s]=(0,d.useState)(!1),l=()=>s(!0),p=()=>{o([]),s(!1)},f=(0,d.useMemo)(()=>{if(!r.length)return(0,c.jsx)(c.Fragment,{});var e="";return e=r.length>1?S.o.t("project_resource_sidebar_confirm_batch_delete",{count:r.length}):S.o.t("project_resource_sidebar_confirm_delete",{resourceName:r[0].name}),(0,c.jsxs)("div",{className:"break-all",children:[(0,c.jsx)("span",{className:"coz-fg-secondary",children:e}),r.length>1?(0,c.jsx)("div",{className:Y["file-list-wrapper"],children:(0,c.jsx)("div",{className:Y["file-list"],children:r.map(e=>(0,c.jsxs)("span",{className:Y["file-item"],children:[(0,c.jsx)("span",{className:J()(Y["file-icon"]),children:ed(e)}),(0,c.jsx)("span",{className:Y["file-name"],children:e.name})]}))})}):null]})},[r]),m=(0,c.jsx)(C.u_,{type:"dialog",okButtonColor:"red",title:(0,c.jsx)("span",{className:"text-[16px] font-medium coz-fg-plus",children:S.o.t("project_resource_sidebar_delete")}),visible:a,okText:S.o.t("Delete"),cancelText:S.o.t("Cancel"),autoLoading:!0,onOk:(0,h._)(function*(){yield null==t?void 0:t(r),r.map(e=>e.type?(0,u.Ym)(e.type,e.id):null).filter(e=>!!e).forEach(e=>n.view.closeWidgetByUri(e)),p()}),onCancel:()=>p(),children:f});return{node:m,handleDeleteResource:e=>{console.log("[ResourceFolder]on delete resource>>>",e);var t=e.filter(e=>e.id!==T);if(!!t.length)o(t),l()}}},ev=n("189284"),eg=e=>{var{type:t}=e,n=(0,d.useMemo)(()=>{switch(t){case v.ai.Workflow:return S.o.t("project_resource_sidebar_resource_not_added",{resource:S.o.t("library_resource_type_workflow")});case v.ai.Plugin:return S.o.t("project_resource_sidebar_resource_not_added",{resource:S.o.t("library_resource_type_plugin")});case v.ai.Data:return S.o.t("project_resource_sidebar_resource_not_added",{resource:S.o.t("project_resource_sidebar_data_section")});default:return""}},[t]);return(0,c.jsxs)("div",{className:Y.empty,children:[(0,c.jsxs)("div",{className:Y["empty-card"],children:[(0,c.jsx)("div",{className:Y["empty-icon"]}),(0,c.jsxs)("div",{className:Y["empty-skeleton"],children:[(0,c.jsx)("span",{}),(0,c.jsx)("span",{})]})]}),(0,c.jsx)("div",{className:Y["empty-title"],children:n})]})},eb=e=>{var{groupType:t,iconRender:n,onAction:r,onCreateSubTypeResource:o,createResourceConfig:a,validateConfig:l,hideMoreBtn:h}=e,p=(0,d.useCallback)(e=>{var{resource:t,isSelected:n}=e;return(0,c.jsx)("span",{className:J()("text-[14px]",n?"font-medium":""),children:t.name})},[]),[f]=(0,ev.V)(),m=(0,d.useCallback)(e=>{if(!e.length||h)return[];if(1===e.length){var n,s,l,c,d=e[0];if(d.id===T)return[];if(d.id===u.dz){var p=a?a.map(e=>{var{label:n,subType:r}=e;return{id:"".concat(y.CreateResource,"-").concat(r),execute:()=>null==o?void 0:o(t,r),label:n}}):[{id:y.CreateResource,label:M[t]}];return[null,...p,{id:y.ImportLibraryResource,label:eh(y.ImportLibraryResource),execute:()=>null==r?void 0:r(y.ImportLibraryResource)}].filter(Boolean)}var f=e=>{var{key:t,enable:n,hint:o}=e,a=D[t];return a?{id:a,disabled:!n,tooltip:S.o.t(o||"",{},o),label:eh(a,d),execute:ep(a)?()=>null==r?void 0:r(a,d):void 0}:null},m=null===(n=d.actions)||void 0===n?void 0:n.filter(e=>e.key!==v.Lk.Delete),g=null===(s=d.actions)||void 0===s?void 0:s.filter(e=>e.key===v.Lk.Delete),b=(null==m?void 0:null===(l=m.map(f))||void 0===l?void 0:l.filter(e=>!!e))||[],_=(null==g?void 0:null===(c=g.map(f))||void 0===c?void 0:c.filter(e=>!!e))||[];return(null==b?void 0:b.length)&&(null==_?void 0:_.length)?[...b,{type:"separator"},..._]:[...b,..._]}return e.every(e=>eu(e,v.Lk.Delete))?[{id:y.Delete,label:eh(y.Delete)}]:[]},[a,t,r,o,f,h]),g=x(e=>e.setCanClosePopover);return{textRender:p,iconRender:(0,d.useCallback)(e=>{var{resource:t,isExpand:r}=e,o=(null==n?void 0:n(e))||ed(t,r);return(0,c.jsx)("span",{className:"inline-flex coz-fg-secondary text-[14px]",children:o})},[n]),useOptimismUI:{loadingRender:()=>(0,c.jsx)(C.gb,{className:"relative mr-1 top-0.5",loading:!0,size:"mini"})},contextMenuHandler:m,validateConfig:(0,d.useMemo)(()=>(0,s._)({customValidator:e=>el(e)||ec(e),errorMsgRender:e=>(0,c.jsx)(C.u,{theme:"dark",position:"right",content:e,children:(0,c.jsx)(k.wR2,{className:"coz-fg-hglt-red absolute right-1 text-[13px]"})})},l),[l]),config:(0,d.useMemo)(()=>({itemHeight:28,maxDeep:6,tabSize:14,input:{placeholder:S.o.t("project_resource_sidebar_please_enter"),style:{borderRadius:"var(--coze-4)"}},resourceUriHandler:e=>e.type?(0,u.Ym)(e.type,e.id):null}),[]),renderMoreSuffix:(0,d.useMemo)(()=>!h&&{style:{borderRadius:"var(--coze-4)"},render:e=>{var{baseBtn:t,resource:n}=e;return n.type===b.Variable||0===(n.actions||[]).length?(0,c.jsx)(c.Fragment,{}):t}},[h]),empty:(0,c.jsx)(eg,{type:t}),powerBlackMap:{dragAndDrop:!1,folder:!0},onContextMenuVisibleChange:e=>g(!e)}},ey=n("157728"),e_=n("664319"),ew=()=>{var{selectedResource:e,setSelectedResource:t}=x((0,e_.N)(e=>({selectedResource:e.selectedResource,setSelectedResource:e.setSelectedResource}))),n=(0,ey.useLocation)(),r=(0,u.d0)();return(0,d.useEffect)(()=>{if(n){var{resourceType:e,resourceId:r}=(0,u.hU)(n.pathname);e===b.Variable?t(e):t(r)}},[n]),{selectedResource:e,handleOpenResource:(e,t)=>{if(t.type!==u.H0.Folder){if(t.type===b.Variable){r("/".concat(t.type));return}r("/".concat(t.type,"/").concat(e))}}}};var ex=(r=e=>{var{groupType:t,resourceTree:n,onDelete:r,onAction:o,onCreate:a,onCustomCreate:h,canCreate:p,iconRender:f,initLoaded:m,createResourceConfig:v,defaultResourceType:g,validateConfig:b,hideMoreBtn:_}=e,w=(0,l._)(e,["groupType","resourceTree","onDelete","onAction","onCreate","onCustomCreate","canCreate","iconRender","initLoaded","createResourceConfig","defaultResourceType","validateConfig","hideMoreBtn"]),S=(0,d.useMemo)(()=>(0,u.Ir)(n),[n]),k=(0,d.useRef)(),C=x(e=>e.groupExpandMap),j=x(e=>e.updateGroupExpand),E=e=>{var n;null===(n=k.current)||void 0===n||n.focus(),null==j||j(t,e)},T=(0,u.RX)(ef);(0,d.useEffect)(()=>{var e=T.onDuplicateEvent(e=>{if(e.id!==w.id)return;var t=Object.values(e.tempSelectedMap||{}).filter(e=>e.type!==u.H0.Folder);if(!!(null==t?void 0:t.length))1===t.length&&(null==o||o(y.DuplicateResource,t[0]))}),n=T.onCreateResourceEvent(e=>{if(!!p&&e.id===w.id&&!v)M(t)});return()=>{e.dispose(),n.dispose()}},[g,t,h,o,T,p,v]),(0,d.useEffect)(()=>{var e=T.onRenameResource(e=>{var t;null===(t=k.current)||void 0===t||t.renameResource(e.id)});return()=>{e.dispose()}},[T]);var I=(0,d.useRef)(),M=(e,t)=>{var n,r;if(!!p)E(!0),e===u.H0.Folder?null===(n=k.current)||void 0===n||n.createFolder():h?h(e,t):g?(I.current=t,null===(r=k.current)||void 0===r||r.createResource(g)):console.error("[ResourceFolderCoze]must specify defaultResourceType when use props onCreate creating resource")},{handleDeleteResource:R,node:D}=em({onDelete:r}),A=eb({groupType:t,iconRender:f,onAction:o,createResourceConfig:v,validateConfig:b,onCreateSubTypeResource:M,hideMoreBtn:_}),{selectedResource:N,handleOpenResource:L}=ew();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(er,{className:Y["resource-folder-coze"],title:P[t],content:m?(0,c.jsx)(u.El,(0,s._)({ref:k,resourceTree:n,resourceMap:S,onDelete:R,onCreate:e=>null==a?void 0:a(e,I.current),selected:N,onSelected:L,defaultResourceType:g},A,w)):null,expand:C[t],onExpandChange:E,actions:p?(0,c.jsx)(Q,{createResourceConfig:v,groupType:t,onCreateResource:M,onImportResource:e=>{if(!!p)E(!0),null==o||o(y.ImportLibraryResource)},onActionVisibleChange:e=>{if(e){var t,n;null===(t=k.current)||void 0===t||t.focus(),null===(n=k.current)||void 0===n||n.closeContextMenu()}}}):null}),D]})},e=>{var t,{onChangeName:n}=e,o=(0,l._)(e,["onChangeName"]),{view:a}=(0,u.XO)();var d=(t=(0,h._)(function*(e){var t,r;if(yield null==n?void 0:n(e),(null===(t=e.resource)||void 0===t?void 0:t.type)&&(null===(r=e.resource)||void 0===r?void 0:r.id)&&e.resource.type!==u.H0.Folder){var o,s=(0,u.Ym)(e.resource.type,e.resource.id),l=a.getWidgetContextFromURI(s);null==l||null===(o=l.widget)||void 0===o||o.setTitle(e.name)}}),function(e){return t.apply(this,arguments)});return(0,c.jsx)(r,(0,p._)((0,s._)({},o),{onChangeName:d}))}),eS=n("259674"),ek="resourceFolder";class eC{init(){this.contextKey.setContext(u.sJ,void 0)}registerShortcuts(e){e.registerHandlers({commandId:y.Rename,keybinding:"enter",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.Delete,keybinding:"meta backspace",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.CreateFolder,keybinding:"alt shift n",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.CreateResource,keybinding:"alt n",preventDefault:!1,source:ek,when:u.sJ}),e.registerHandlers({commandId:y.DuplicateResource,keybinding:"alt d",preventDefault:!1,source:ek,when:u.sJ})}registerCommands(e){e.registerCommand({id:y.Rename,label:S.o.t("project_resource_sidebar_rename")},{execute:()=>this.shortcutService.renameResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.Delete},{execute:()=>this.shortcutService.deleteResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.CreateFolder,label:S.o.t("project_resource_sidebar_create_new_folder")},{execute:()=>{var e,t=this.contextKey.getContext(u.sJ);null==t||null===(e=t.onCreateFolder)||void 0===e||e.call(t)},isEnabled:e=>!1,isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.CreateResource,label:"Create Resource",shortLabel:"Create Resource"},{execute:()=>this.shortcutService.createResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)}),e.registerCommand({id:y.DuplicateResource,label:S.o.t("project_resource_sidebar_copy")},{execute:()=>this.shortcutService.duplicateResource(),isEnabled:e=>!(null==e?void 0:e.disabled),isVisible:e=>!(null==e?void 0:e.isHidden)})}}(0,ei.gn)([(0,eo.f)(ef),(0,ei.w6)("design:type",void 0===ef?Object:ef)],eC.prototype,"shortcutService",void 0),(0,ei.gn)([(0,eo.f)(u.aY),(0,ei.w6)("design:type",void 0===u.aY?Object:u.aY)],eC.prototype,"contextKey",void 0),(0,ei.gn)([(0,eS.z)(),(0,ei.w6)("design:type",Function),(0,ei.w6)("design:paramtypes",[]),(0,ei.w6)("design:returntype",void 0)],eC.prototype,"init",null),eC=(0,ei.gn)([(0,ea.b)()],eC);var ej=(0,u.M1)({onBind(e){var{bind:t}=e;t(ef).toSelf().inSingletonScope(),(0,u.KV)(t,eC,[u.pY,u.vY])}}),eE=()=>{var e=x(e=>e.resourceTree),t=x(e=>e.isFetching),n=x(e=>e.initLoaded),r=(0,d.useMemo)(()=>{var t;return(null===(t=e.find(e=>e.groupType===v.ai.Workflow))||void 0===t?void 0:t.resourceList)||[]},[e]),o=(0,d.useMemo)(()=>{var t;return(null===(t=e.find(e=>e.groupType===v.ai.Plugin))||void 0===t?void 0:t.resourceList)||[]},[e]);return{workflowResource:r,pluginResource:o,dataResource:(0,d.useMemo)(()=>{var t;return(null===(t=e.find(e=>e.groupType===v.ai.Data))||void 0===t?void 0:t.resourceList)||[]},[e]),initLoaded:n,isFetching:t}},eT=()=>{var e=(0,u.d0)();return t=>{var{resourceId:n,resourceType:r}=t;return e("/".concat(r,"/").concat(n))}},eI=()=>{var e,t=(0,u.RX)(u.Z7),n=x(e=>e.refetch),r=(0,u.XO)(),o=eT(),a=(0,u.aQ)(),s=e=>{var{scene:t,taskInfo:n}=e;if(!!(null==n?void 0:n.res_type)&&!!(null==n?void 0:n.res_id)&&!!t){var r=t&&[v.K2.CopyProjectResource,v.K2.CopyResourceFromLibrary].includes(t),s=_(n.res_type),l=n.res_id;r?o({resourceType:_(n.res_type),resourceId:n.res_id}):s===b.Workflow?window.open("/work_flow?space_id=".concat(a,"&workflow_id=").concat(l)):window.open("/space/".concat(a,"/").concat(s,"/").concat(l,"?from=project"),"_blank")}},l=e=>{var{scene:t,taskInfo:n,hideViewBtn:r}=e,o="";switch(t){case v.K2.CopyProjectResource:o=S.o.t("project_toast_copy_successful");break;case v.K2.CopyResourceToLibrary:o=S.o.t("resource_toast_copy_to_library_success");break;case v.K2.MoveResourceToLibrary:o=S.o.t("resource_toast_move_to_library_success");break;case v.K2.CopyResourceFromLibrary:o=S.o.t("project_toast_successfully_imported_from_library")}C.FN.success({content:(0,c.jsxs)(C.T,{spacing:6,children:[(0,c.jsx)(C.ZT.Text,{children:o}),r?null:(0,c.jsx)(C.zx,{color:"primary",size:"small",onClick:()=>s({scene:t,taskInfo:n}),children:S.o.t("resource_toast_view_resource")})]})})};return e=(0,h._)(function*(e){var o=new u.K4;try{var a=yield new Promise((r,a)=>{t.startPolling(e),o.pushAll([t.onSuccess(e=>{o.dispose(),n(),r(e)}),t.onError(e=>{o.dispose(),a(e)}),t.onCancel(()=>{o.dispose(),a(Error("cancelled"))})])}),c=e.scene===v.K2.CopyResourceFromLibrary;if(l({scene:e.scene,taskInfo:a,hideViewBtn:c}),c&&s({scene:e.scene,taskInfo:a}),e.scene===v.K2.MoveResourceToLibrary){var d,h,p=(0,u.Ym)(null!==(d=_(e.res_type))&&void 0!==d?d:"",null!==(h=e.res_id)&&void 0!==h?h:"");r.view.closeWidgetByUri(p)}return a}catch(e){console.error("error dispatch resource",e)}}),function(t){return e.apply(this,arguments)}}},562392:function(e,t,n){"use strict";n.d(t,{GR:()=>r.GR,qn:()=>R,Q4:()=>y,cS:()=>r.cS});var r=n("189400"),o=n("151064"),a=n("455069"),s=n("149528"),l=n("336205"),c=n("567282"),d=n("659596"),u=n.p+"static/image/workflow-light.aae45d5d.jpg",h=n.p+"static/image/workflow-dark.74638706.jpg",p=n.p+"static/image/chatflow-light.83371423.jpg",f={workflow:{dark:h,light:u},chatflow:{dark:n.p+"static/image/chatflow-dark.6996d32b.jpg",light:p}},m=e=>{var{flowMode:t}=e,{theme:n}=(0,d.Fg)(),r=(0,a.useMemo)(()=>{if(t===c.wz.ChatFlow)return f.chatflow[n]||f.chatflow.light;return f.workflow[n]||f.workflow.light},[n,t]);return(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,o.jsx)(d.Ee,{src:r,crossOrigin:"anonymous",imgStyle:{width:200,minHeight:120,borderRadius:"7.5px",border:"1px solid var(--coz-stroke-primary)"},preview:!1}),(0,o.jsxs)("div",{className:"px-2 pt-1 pb-2",children:[(0,o.jsx)("p",{className:"text-14 font-medium coz-fg-primary leading-5",children:t===c.wz.Workflow?"Workflow":"Chatflow"}),(0,o.jsx)("span",{className:"text-[12px] coz-fg-primary leading-4",children:t===c.wz.Workflow?l.o.t("wf_chatflow_02"):l.o.t("wf_chatflow_01")})]})]})},v=n("873183"),g={[c.wz.Workflow]:(0,o.jsx)(v.eTH,{}),[c.wz.ChatFlow]:(0,o.jsx)(v.TLD,{})},b=e=>{var{context:t}=e,{widget:n}=t,[r,o]=(0,a.useState)(n.getIconType()||String(c.wz.Workflow)),s=(0,a.useMemo)(()=>g[r],[r]);return(0,a.useEffect)(()=>{var e=n.onIconTypeChanged(e=>o(e));return()=>{var t;return null==e?void 0:null===(t=e.dispose)||void 0===t?void 0:t.call(e)}},[]),s},y={match:/\/workflow\/.*/,area:s.px.MAIN_PANEL,renderContent(){var e=(0,s.jL)(()=>n.e("7241").then(n.bind(n,815935)));return(0,o.jsx)(e,{})},renderIcon:e=>(0,o.jsx)(b,{context:e}),onFocus(e){e.widget.onFocusEmitter.fire()}};s.px.MAIN_PANEL,()=>(0,o.jsx)(v.OlX,{});var _=n("825955"),w=n("614904"),x=n("66860"),S=n("909776"),k=n("382534"),C=n("529223"),j=e=>{var t,{projectId:n}=e,r=(0,x.S4)();return t=(0,_._)(function*(e){var{scene:t,resource:o}=e;try{console.log("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t,">>>"),o),yield r({scene:t,res_id:null==o?void 0:o.id,res_type:C.ResType.Workflow,project_id:n,res_name:(null==o?void 0:o.name)||""})}catch(e){console.error("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t," error>>>"),e)}}),function(e){return t.apply(this,arguments)}},E=n("458620"),T=n("727914"),I=function(){var{currentResourceRef:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{workflowResource:t}=(0,x.rA)();return[{validator:(n,r)=>!((null==e?void 0:e.current)?t.filter(t=>{var n;return t.res_id!==(null==e?void 0:null===(n=e.current)||void 0===n?void 0:n.res_id)}):t).map(e=>e.name).includes(r)||new T.sH(E.b.formValidation,l.o.t("project_resource_sidebar_warning_label_exists",{label:r}))}]},P=e=>{var t,n,{projectId:r}=e,o=(0,x.Un)(e=>e.refetch),a=(0,x.j2)(),s=(0,x.S4)();var l=(t=(0,_._)(function*(e){try{p(),console.log("[ResourceFolder]import library workflow>>>",e),yield s({scene:C.ResourceCopyScene.CopyResourceFromLibrary,res_id:e.workflow_id,res_type:C.ResType.Workflow,project_id:r,res_name:e.name})}catch(e){console.error("[ResourceFolder]import library workflow error>>>",e)}}),function(e){return t.apply(this,arguments)}),d=I();var{node:u,open:h,close:p}=(0,w.Zv)({from:w.wL.ProjectImportLibrary,flowMode:c.wz.Workflow,hiddenExplore:!0,hiddenCreate:!0,hiddenWorkflowCategories:[w.BD.Example,w.BD.Project],projectId:r,onImport:l,nameValidators:d,onCreateSuccess:(n=(0,_._)(function*(e){var{workflowId:t}=e;p(),yield o(),a({resourceType:x.LC.Workflow,resourceId:t})}),function(e){return n.apply(this,arguments)})});return{modal:u,importLibrary:h}},M=()=>{var e,t=(0,x.Un)(e=>e.refetch),n=(0,s.d0)(),{view:r}=(0,s.XO)();return e=(0,_._)(function*(e,o,a){yield k.OH.UpdateWorkflowMeta({workflow_id:o,space_id:a,flow_mode:e}),d.FN.success(l.o.t("wf_chatflow_123",{Chatflow:l.o.t(e===c.wz.ChatFlow?"wf_chatflow_76":"Workflow")})),yield t();var u=(0,s.Ym)("workflow",o),h=r.getWidgetContextFromURI(u),p=!!(null==h?void 0:h.widget);n("/workflow/".concat(o).concat(p?"?refresh=true":""))}),function(t,n,r){return e.apply(this,arguments)}},R=()=>{var e,t,n,r,u=(0,x.Un)(e=>e.refetch),h=(0,s.aQ)(),p=(0,s.vp)(),f=(0,x.j2)(),v=(0,a.useRef)(),b=I({currentResourceRef:v});var{createWorkflowModal:y,workflowModal:C,openCreateModal:E,handleEditWorkflow:T}=(0,w.ub)({from:w.wL.ProjectAddWorkflowResource,spaceId:h,projectId:p,hiddenTemplateEntry:!0,nameValidators:b,refreshPage:()=>{v.current=void 0,null==u||u()},onCreateSuccess:(e=(0,_._)(function*(e){var{workflowId:t}=e;yield null==u?void 0:u(),f({resourceType:x.LC.Workflow,resourceId:t})}),function(t){return e.apply(this,arguments)})});var R=(0,a.useCallback)((t=(0,_._)(function*(e){try{console.log("[ResourceFolder]on change name>>>",e);var t=yield k.OH.UpdateWorkflowMeta({space_id:h,workflow_id:e.id,name:e.name});console.log("[ResourceFolder]rename workflow response>>>",t)}catch(e){console.log("[ResourceFolder]rename workflow error>>>",e)}finally{u()}}),function(e){return t.apply(this,arguments)}),[u,h]);var D=(0,a.useCallback)((n=(0,_._)(function*(e){if(!(null==e?void 0:e.res_id))return;v.current=e;var t,n=yield k.OH.GetWorkflowDetail({space_id:h,workflow_ids:[null==e?void 0:e.res_id]}),r=null==n?void 0:null===(t=n.data)||void 0===t?void 0:t[0];if(!!r)T({space_id:r.space_id,workflow_id:r.workflow_id,url:r.icon,icon_uri:r.icon_uri,name:r.name,desc:r.desc})}),function(e){return n.apply(this,arguments)}),[h,T]);var A=(0,a.useCallback)((r=(0,_._)(function*(e){try{console.log("[ResourceFolder]on delete>>>",e),console.log("delete start>>>",Date.now());var t=yield k.OH.BatchDeleteWorkflow({space_id:h,workflow_id_list:e.filter(e=>e.type===x.LC.Workflow).map(e=>e.id)});console.log("delete end>>>",Date.now()),d.FN.success(l.o.t("Delete_success")),u().then(()=>console.log("refetch end>>>",Date.now())),console.log("[ResourceFolder]delete workflow response>>>",t)}catch(e){console.log("[ResourceFolder]delete workflow error>>>",e),d.FN.error(l.o.t("Delete_failed"))}}),function(e){return r.apply(this,arguments)}),[u,h]),{modal:N,importLibrary:L}=P({projectId:p}),z=M(),O=j({projectId:p}),B=(0,a.useMemo)(()=>[{icon:g[c.wz.Workflow],label:l.o.t("project_resource_sidebar_create_new_resource",{resource:l.o.t("library_resource_type_workflow")}),subType:c.wz.Workflow,tooltip:(0,o.jsx)(m,{flowMode:c.wz.Workflow})},null].filter(Boolean),[]);return{onChangeName:R,onAction:(e,t)=>{var n,r;switch(e){case x.lW.ImportLibraryResource:return L();case x.lW.DuplicateResource:return O({scene:S.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return O({scene:S.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return O({scene:S.K2.CopyResourceToLibrary,resource:t});case x.lW.UpdateDesc:return D(t);case x.lW.SwitchToChatflow:return z(c.wz.ChatFlow,null!==(n=null==t?void 0:t.res_id)&&void 0!==n?n:"",h);case x.lW.SwitchToWorkflow:return z(c.wz.Workflow,null!==(r=null==t?void 0:t.res_id)&&void 0!==r?r:"",h);default:console.warn("[WorkflowResource]unsupported action>>>",e)}},onDelete:A,onCustomCreate:(e,t)=>{console.log("[ResourceFolder]on custom create>>>",e,t),E(t)},createResourceConfig:B,iconRender:(0,a.useMemo)(()=>e=>{var{resource:t}=e;return(0,o.jsx)(o.Fragment,{children:g[t.res_sub_type||c.wz.Workflow]})},[]),modals:[N,y,C]}}},149528:function(e,t,n){"use strict";n.d(t,{M1:()=>e0,aQ:()=>oz,l0:()=>iY,AE:()=>oW,K4:()=>eX.K4,T_:()=>av,Ho:()=>eX.Ho,px:()=>r6,tN:()=>oF,cw:()=>iQ,dQ:()=>eG,Cg:()=>oD.Cg,d0:()=>ar,Qy:()=>al,vp:()=>an,El:()=>sX,Ew:()=>iq,X9:()=>oD.X9,aY:()=>e5,Xe:()=>aV,w8:()=>af,ov:()=>tD,un:()=>tp,XO:()=>oG,Lj:()=>ao,Ir:()=>a9,dz:()=>aX,fZ:()=>o7,sq:()=>oK,q9:()=>ab,L:()=>t3,B6:()=>oZ,KV:()=>eX.KV,Z7:()=>am,fH:()=>r9,KO:()=>oV,JT:()=>eX.JT,IC:()=>oA,jo:()=>oR,RX:()=>nF,ZQ:()=>aa,Fl:()=>o9,Q5:()=>eX.Q5,L8:()=>o5,mY:()=>eX.mY,k7:()=>oQ,BX:()=>oJ,eo:()=>iA,pY:()=>eX.pY,sJ:()=>aJ,hU:()=>o4,qj:()=>o6,CW:()=>aS,OG:()=>oO,Ym:()=>o3,yg:()=>ax,PF:()=>at,W9:()=>o8,XU:()=>ac,xO:()=>iu,yJ:()=>oY,vY:()=>t5,s1:()=>or,H0:()=>aq,VM:()=>o$,jL:()=>o2,zu:()=>oD.zu,tF:()=>aw});var r,o,a,s,l,c,d,u,h,p,f,m,v,g,b,y,_,w,x,S,k,C,j,E,T,I,P,M,R,D,A,N,L,z,O,B,W,F,H,U,V,K,q,Z,Y,X,Q,G,J,$,ee,et,en,er,ei,eo,ea,es,el,ec,ed,eu,eh,ep,ef,em,ev,eg,eb,ey,e_,ew,ex,eS,ek,eC,ej,eE,eT,eI,eP,eM,eR,eD,eA,eN,eL,ez,eO,eB,eW,eF,eH,eU,eV,eK,eq,eZ,eY={};n.r(eY),n.d(eY,{baseBg0:()=>nm,baseBg1:()=>nv,baseBg2:()=>ng,baseBorder:()=>nw,baseFill0:()=>nk,baseFill1:()=>nC,baseFill2:()=>nj,basePrimary:()=>nE,basePrimaryHover:()=>nT,baseText0:()=>nb,baseText1:()=>ny,baseText2:()=>n_,baseWhite:()=>nf,menuBorder:()=>nx,menuBoxShadow:()=>nS});var eX=n("816697"),eQ=n("702570"),eG=Symbol("LifecycleContribution"),eJ=Symbol("PluginContext");Symbol("Plugin");var e$=0;function e0(e){var{contributionKeys:t}=e;e$+=1;var n="IDE_".concat(e$);return r=>{var o=[],a=!1;return{pluginId:n,initPlugin:()=>{if(!a){if(a=!0,e.containerModules&&o.push(...e.containerModules),e.onBind&&o.push(new eQ.n((t,n,o,a)=>{e.onBind({bind:t,unbind:n,isBound:o,rebind:a},r)})),e.onInit||e.onLoading||e.onLayoutInit||e.onStart||e.onWillDispose||e.onDispose){var t,n;o.push((t=e,n=r,new eQ.n(e=>{e(eG).toDynamicValue(e=>{var r=e.container.get(eJ);return{onInit:()=>{var e;return null===(e=t.onInit)||void 0===e?void 0:e.call(t,r,n)},onLoading:()=>{var e;return null===(e=t.onLoading)||void 0===e?void 0:e.call(t,r,n)},onLayoutInit:()=>{var e;return null===(e=t.onLayoutInit)||void 0===e?void 0:e.call(t,r,n)},onStart:()=>{var e;return null===(e=t.onStart)||void 0===e?void 0:e.call(t,r,n)},onWillDispose:()=>{var e;return null===(e=t.onWillDispose)||void 0===e?void 0:e.call(t,r,n)},onDispose:()=>{var e;return null===(e=t.onDispose)||void 0===e?void 0:e.call(t,r,n)}}})})))}}},options:r,contributionKeys:t,containerModules:o}}}var e1=e=>e0(e)(void 0),e2=n("130001"),e4=n("435946"),e6=Symbol("ContextMatcher");class e5{setContext(e,t){this._contextKeys.set(e,t)}getContext(e){return this._contextKeys.get(e)}match(e){var t=Array.from(this._contextKeys.keys());return Function(...t,"return ".concat(e,";"))(...t.map(e=>this._contextKeys.get(e)))}constructor(){this._contextKeys=new Map,this._contextKeys.set("editorFocus",!0)}}e5=(0,e2.gn)([(0,e4.b)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[])],e5);var e3=n("825955"),e8=n("771531"),e9=n("734371");function e7(e){return e.priority>0}function te(e,t){return t.priority-e.priority}function tt(e,t){return tn.apply(this,arguments)}function tn(){return(tn=(0,e3._)(function*(e,t){if(e instanceof Array)return Promise.all(e.map(e=>tt(e,t)));var n=yield e;return{priority:yield t(n),value:n}})).apply(this,arguments)}function tr(e,t){var n,r;return(n=e,r=t,n.map(e=>({value:e,priority:r(e)}))).filter(e7).sort(te)}function ti(e,t){return to.apply(this,arguments)}function to(){return(to=(0,e3._)(function*(e,t){return(yield tt(e,t)).filter(e7).sort(te)})).apply(this,arguments)}var ta=Symbol("OpenHandler"),ts=Symbol("OpenerService");class tl{open(e,t){var n=this;return(0,e3._)(function*(){var r=yield n.getOpener(e,t),o=yield r.open(e,t);return n.onURIOpenEmitter.fire({uri:e,options:t}),o})()}addHandler(e){return this.customEditorOpenHandlers.push(e),this.onDidChangeOpenersEmitter.fire(),eX.JT.create(()=>{this.customEditorOpenHandlers.splice(this.customEditorOpenHandlers.indexOf(e),1),this.onDidChangeOpenersEmitter.fire()})}prioritize(e,t){var n=this;return(0,e3._)(function*(){var r;return(yield ti(n.getHandlers(),(r=(0,e3._)(function*(n){try{return yield n.canHandle(e,t)}catch(e){return 0}}),function(e){return r.apply(this,arguments)}))).map(e=>e.value)})()}getOpener(e,t){var n=this;return(0,e3._)(function*(){var r=yield n.prioritize(e,t);return r.length>=1?r[0]:Promise.reject(Error("There is no opener for ".concat(e,".")))})()}getOpeners(e,t){var n=this;return(0,e3._)(function*(){return e?n.prioritize(e,t):n.getHandlers()})()}getHandlers(){return[...this.handlersProvider.getContributions(),...this.customEditorOpenHandlers]}constructor(e){this.handlersProvider=e,this.customEditorOpenHandlers=[],this.onDidChangeOpenersEmitter=new eX.Q5,this.onURIOpenEmitter=new eX.Q5,this.onDidChangeOpeners=this.onDidChangeOpenersEmitter.event,this.onURIOpen=this.onURIOpenEmitter.event}}tl=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(eX.Qc)),(0,e2.fM)(0,(0,e9.t)(ta)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===eX.Qc?Object:eX.Qc])],tl);var tc=Symbol("ContainerFactory"),td=n("259674"),tu=Symbol("StorageService");class th{setData(e,t){this.storage[this.prefix(e)]=JSON.stringify(t)}getData(e,t){var n=this.storage[this.prefix(e)];return void 0===n?t:JSON.parse(n)}prefix(e){return"".concat(this._prefix).concat(e)}setPrefix(e){this._prefix=e}init(){"undefined"!=typeof window&&window.localStorage?this.storage=window.localStorage:this.storage={}}constructor(){this._prefix="flowide:"}}(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],th.prototype,"init",null),th=(0,e2.gn)([(0,e4.b)()],th);class tp{get onUnload(){return this.onUnloadEmitter.event}get onBeforeUnload(){return this.onBeforeUnloadEmitter.event}onStart(){this.registerUnloadListeners()}registerUnloadListeners(){window.addEventListener("unload",()=>this.onUnloadEmitter.fire()),window.addEventListener("beforeunload",e=>this.onBeforeUnloadEmitter.fire(e))}constructor(){this.onUnloadEmitter=new eX.Q5,this.onBeforeUnloadEmitter=new eX.Q5}}tp=(0,e2.gn)([(0,e4.b)()],tp);class tf{get dir(){return void 0===this._dir&&(this._dir=this.computeDir()),this._dir}get hasDir(){return!this.isRoot&&-1!==this.raw.lastIndexOf(tf.separator)}static isDrive(e){return e.endsWith(":")}static normalizeDrive(e){if(e.length>=3&&47===e.charCodeAt(0)&&58===e.charCodeAt(2)){var t=e.charCodeAt(1);t>=65&&t<=90&&(e="/".concat(String.fromCharCode(t+32),":").concat(e.substr(3)))}else if(e.length>=2&&58===e.charCodeAt(1)){var n=e.charCodeAt(0);n>=65&&n<=90&&(e="".concat(String.fromCharCode(n+32),":").concat(e.substr(2)))}return e}join(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(e=>!!e).join(tf.separator);return r?this.raw.endsWith(tf.separator)?new tf(this.raw+r):new tf(this.raw+tf.separator+r):this}toString(){return this.raw}relative(e){if(this.raw===e.raw)return new tf("");if(!this.raw||!e.raw)return;var t=this.base?this.raw+tf.separator:this.raw;if(!!e.raw.startsWith(t))return new tf(e.raw.substr(t.length))}isEqualOrParent(e){return!!this.relative(e)}relativity(e){var t=this.relative(e);if(t){var n=t.toString();return""===n?0:n.split(tf.separator).length}return -1}normalize(){var e=this.raw.endsWith("/"),t=this.toString().split("/"),n=[];if(t.forEach((e,t)=>{if(!!e&&"."!==e)".."===e?n.length&&".."!==n[n.length-1]?n.pop():!this.isAbsolute&&n.push(".."):n.push(e)}),0===n.length)return this.isRoot?new tf("/"):new tf(".");return new tf((this.isAbsolute?"/":"")+n.join("/")+(e?"/":""))}computeRoot(){if(this.isRoot)return this;if(!!this.isAbsolute){var e=this.raw.indexOf(tf.separator,tf.separator.length);return -1===e?new tf(tf.separator):new tf(this.raw.substr(0,e)).root}}computeDir(){if(!this.hasDir)return this;var e=this.raw.lastIndexOf(tf.separator);if(this.isAbsolute){var t=this.raw.indexOf(tf.separator);if(t===e)return new tf(this.raw.substr(0,t+1))}return new tf(this.raw.substr(0,e))}constructor(e){this.raw=tf.normalizeDrive(e);var t=e.indexOf(tf.separator),n=e.lastIndexOf(tf.separator);this.isAbsolute=0===t,this.base=-1===n?e:e.substr(n+1),this.isRoot=this.isAbsolute&&t===n&&(!this.base||tf.isDrive(this.base)),this.root=this.computeRoot();var r=this.base.lastIndexOf(".");this.name=-1===r?this.base:this.base.substr(0,r),this.ext=-1===r?"":this.base.substr(r)}}tf.separator="/";var tm=n("808549"),tv=n("120454");var tg=(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});"object"==typeof process?ei="win32"===process.platform:"object"==typeof navigator&&(ei=navigator.userAgent.indexOf("Windows")>=0);var tb=/^\w[\w\d+.-]*$/,ty=/^\//,t_=/^\/\//,tw="/",tx=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,tS=function(){function e(e,t,n,r,o,a){if(void 0===a&&(a=!1),"object"==typeof e)this.scheme=e.scheme||"",this.authority=e.authority||"",this.path=e.path||"",this.query=e.query||"",this.fragment=e.fragment||"";else{var s,l;this.scheme=(s=e,l=a,s||l?s:"file"),this.authority=t||"",this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==tw&&(t=tw+t):t=tw}return t}(this.scheme,n||""),this.query=r||"",this.fragment=o||"",!function(e,t){if(!e.scheme&&t)throw Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!tb.test(e.scheme))throw Error("[UriError]: Scheme contains illegal characters.");if(e.path){if(e.authority){if(!ty.test(e.path))throw Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(t_.test(e.path))throw Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}(this,a)}}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString},Object.defineProperty(e.prototype,"fsPath",{get:function(){return tI(this,!1)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,o=e.query,a=e.fragment;return(void 0===t?t=this.scheme:null===t&&(t=""),void 0===n?n=this.authority:null===n&&(n=""),void 0===r?r=this.path:null===r&&(r=""),void 0===o?o=this.query:null===o&&(o=""),void 0===a?a=this.fragment:null===a&&(a=""),t===this.scheme&&n===this.authority&&r===this.path&&o===this.query&&a===this.fragment)?this:new tC(t,n,r,o,a)},e.parse=function(e,t){void 0===t&&(t=!1);var n=tx.exec(e);return n?new tC(n[2]||"",tR(n[4]||""),tR(n[5]||""),tR(n[7]||""),tR(n[9]||""),t):new tC("","","","","")},e.file=function(e){var t="";if(ei&&(e=e.replace(/\\/g,tw)),e[0]===tw&&e[1]===tw){var n=e.indexOf(tw,2);-1===n?(t=e.substring(2),e=tw):(t=e.substring(2,n),e=e.substring(n)||tw)}return new tC("file",t,e,"","")},e.from=function(e){return new tC(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),tP(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(!t)return t;if(t instanceof e)return t;var n=new tC(t);return n._formatted=t.external,n._fsPath=t._sep===tk?t.fsPath:null,n},e}(),tk=ei?1:void 0,tC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return tg(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return!this._fsPath&&(this._fsPath=tI(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return(void 0===e&&(e=!1),e)?tP(this,!0):(!this._formatted&&(this._formatted=tP(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=tk),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(tS),tj=((er={})[58]="%3A",er[47]="%2F",er[63]="%3F",er[35]="%23",er[91]="%5B",er[93]="%5D",er[64]="%40",er[33]="%21",er[36]="%24",er[38]="%26",er[39]="%27",er[40]="%28",er[41]="%29",er[42]="%2A",er[43]="%2B",er[44]="%2C",er[59]="%3B",er[61]="%3D",er[32]="%20",er);function tE(e,t){for(var n=void 0,r=-1,o=0;o<e.length;o++){var a=e.charCodeAt(o);if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||45===a||46===a||95===a||126===a||t&&47===a)-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));var s=tj[a];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,o)),r=-1),n+=s):-1===r&&(r=o)}}return -1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function tT(e){for(var t=void 0,n=0;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=tj[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function tI(e,t){var n;return n=e.authority&&e.path.length>1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&90>=e.path.charCodeAt(1)||e.path.charCodeAt(1)>=97&&122>=e.path.charCodeAt(1))&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,ei&&(n=n.replace(/\//g,"\\")),n}function tP(e,t){var n=t?tT:tE,r="",o=e.scheme,a=e.authority,s=e.path,l=e.query,c=e.fragment;if(o&&(r+=o,r+=":"),(a||"file"===o)&&(r+=tw,r+=tw),a){var d=a.indexOf("@");if(-1!==d){var u=a.substr(0,d);a=a.substr(d+1),-1===(d=u.indexOf(":"))?r+=n(u,!1):(r+=n(u.substr(0,d),!1),r+=":",r+=n(u.substr(d+1),!1)),r+="@"}-1===(d=(a=a.toLowerCase()).indexOf(":"))?r+=n(a,!1):(r+=n(a.substr(0,d),!1),r+=a.substr(d))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){var h=s.charCodeAt(1);h>=65&&h<=90&&(s="/"+String.fromCharCode(h+32)+":"+s.substr(3))}else if(s.length>=2&&58===s.charCodeAt(1)){var h=s.charCodeAt(0);h>=65&&h<=90&&(s=String.fromCharCode(h+32)+":"+s.substr(2))}r+=n(s,!0)}return l&&(r+="?",r+=n(l,!1)),c&&(r+="#",r+=t?c:tE(c,!1)),r}var tM=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function tR(e){return e.match(tM)?e.replace(tM,function(e){return function e(t){try{return decodeURIComponent(t)}catch(n){if(t.length>3)return t.substr(0,3)+e(t.substr(3));return t}}(e)}):e}class tD{get path(){return void 0===this._path&&(this._path=new tf(this.codeUri.path)),this._path}get displayName(){var{base:e}=this.path;return e?e:this.path.isRoot?this.path.toString():""}get allLocations(){for(var e=[],t=this;!t.path.isRoot&&t.path.hasDir;)e.push(t),t=t.parent;return e.push(t),e}get parent(){return this.path.isRoot?this:this.withPath(this.path.dir)}get scheme(){return this.codeUri.scheme}get authority(){return this.codeUri.authority}get query(){return this.codeUri.query}get fragment(){return this.codeUri.fragment}get queryObject(){return tD.queryStringToObject(this.query)}static getDistinctParents(e){var t=[];return e.forEach((n,r)=>{!e.some((e,t)=>t!==r&&e.isEqualOrParent(n))&&t.push(n)}),t}relative(e){if(this.authority===e.authority&&this.scheme===e.scheme)return this.path.relative(e.path)}resolve(e){return this.withPath(this.path.join(e.toString()))}withScheme(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:e}));return new tD(t)}withAuthority(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,authority:e}));return new tD(t)}withoutAuthority(){return this.withAuthority("")}withPath(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,path:e.toString()}));return new tD(t)}withoutPath(){return this.withPath("")}withQuery(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,query:e}));return new tD(t)}addQueryObject(e){return e=(0,tm._)({},this.queryObject,e),this.withQuery(tD.objectToQueryString(e))}removeQueryObject(e){var t=(0,tm._)({},this.queryObject);return e in t&&delete t[e],this.withQuery(tD.objectToQueryString(t))}withoutQuery(){return this.withQuery("")}withFragment(e){var t=tS.from((0,tv._)((0,tm._)({},this.codeUri.toJSON()),{scheme:this.codeUri.scheme,fragment:e}));return new tD(t)}withoutFragment(){return this.withFragment("")}normalizePath(){return this.withPath(this.path.normalize())}toString(){return"".concat(this.scheme,"://").concat(this.authority).concat(this.path.toString()).concat(this.query?"?".concat(this.query):"").concat(this.fragment?"#".concat(this.fragment):"")}isEqualOrParent(e){return e="string"==typeof e?new tD(e):e,this.authority===e.authority&&this.scheme===e.scheme&&this.path.isEqualOrParent(e.path)}match(e){var t="/".concat(e.authority).concat(e.path.toString()),n=[],r="/".concat(this.authority).concat(this.path.toString()),o=r.replace(/\/*\*?$/,"").replace(/[\\. *+ ^ ${} | () [\]]/g,"\\ $&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,optional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));r.endsWith("*")?(n.push({paramName:"*"}),o+="/*"===r?"(.*)$":"(?:\\/(.+)|\\/*)$"):o+="\\/*$";var a=new RegExp(o);return!!t.match(a)}constructor(e=""){e instanceof tS?this.codeUri=e:this.codeUri=tS.parse(e)}}!function(e){e.MAX_PRIORITY=500,e.DEFAULT_PRIORITY=0;function t(){return(t=(0,e3._)(function*(t,n){var r,o;return null===(o=(yield ti(n,(r=(0,e3._)(function*(n){var r=n.canHandle(t);return"boolean"==typeof r?r?e.MAX_PRIORITY:e.DEFAULT_PRIORITY:r}),function(e){return r.apply(this,arguments)})))[0])||void 0===o?void 0:o.value})).apply(this,arguments)}e.findAsync=function(e,n){return t.apply(this,arguments)};e.findSync=function(t,n){var r;return null===(r=tr(n,n=>{var r=n.canHandle(t);return"boolean"==typeof r?r?e.MAX_PRIORITY:e.DEFAULT_PRIORITY:r})[0])||void 0===r?void 0:r.value}}(eo||(eo={})),!function(e){e.objectToQueryString=function(e){return e?Object.keys(e).map(t=>"".concat(t,"=").concat(e[t]||"")).join("&"):""};function t(t,n){var r=new e(t);return new e(n).path.isEqualOrParent(r.path)}function n(t,n){var r=new e(t);return new e(n).toString()===r.toString()}e.queryStringToObject=function(e){return e.split("&").reduce((e,t)=>{var[n,r]=t.split("=");return e[n]=r,e},{})},e.isSubPath=t,e.isURIStringEqual=n;e.isSubOrEqual=function(e,r){return t(e,r)||n(e,r)}}(tD||(tD={}));class tA{init(){var e;for(var t of this.contributionProvider.getContributions())null===(e=t.onInit)||void 0===e||e.call(t);this.onDidInitEmitter.fire()}start(){var e=this;return(0,e3._)(function*(){var t,n,r,o=e.contributionProvider.getContributions();for(var a of o)yield null===(t=a.onLoading)||void 0===t?void 0:t.call(a);for(var s of(e.onDidLoadingEmitter.fire(),o))yield null===(n=s.onLayoutInit)||void 0===n?void 0:n.call(s);for(var l of(e.onDidLayoutInitEmitter.fire(),o))yield null===(r=l.onStart)||void 0===r?void 0:r.call(l);e.onDidStartEmitter.fire()})()}dispose(){var e=this;return(0,e3._)(function*(){var t,n=e.contributionProvider.getContributions();for(var r of n)if(r.onWillDispose&&r.onWillDispose())return;for(var o of n)null===(t=o.onDispose)||void 0===t||t.call(o)})()}constructor(){this.onDidInitEmitter=new eX.Q5,this.onDidInit=this.onDidInitEmitter.event,this.onDidLoadingEmitter=new eX.Q5,this.onDidLoading=this.onDidLoadingEmitter.event,this.onDidLayoutInitEmitter=new eX.Q5,this.onDidLayout=this.onDidLayoutInitEmitter.event,this.onDidStartEmitter=new eX.Q5,this.onDidStart=this.onDidStartEmitter.event}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(eG),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],tA.prototype,"contributionProvider",void 0),tA=(0,e2.gn)([(0,e4.b)()],tA);var tN=new eQ.n(e=>{e(tA).toSelf().inSingletonScope(),(0,eX.yb)(e,ta),e(tl).toSelf().inSingletonScope(),e(tp).toSelf().inSingletonScope(),e(ts).toService(tl),e(e5).toSelf().inSingletonScope(),e(e6).toService(e5),e(eJ).toDynamicValue(e=>({get:t=>e.container.get(t),getAll:t=>e.container.getAll(t),container:e.container})).inSingletonScope(),e(tc).toDynamicValue(e=>e.container).inSingletonScope(),(0,eX.yb)(e,eG),e(tu).to(th).inSingletonScope()});class tL extends Error{static is(e,t){return e instanceof tL&&e.code===t}constructor(e,t,n){super(e),this.message=e,this.code=t,this.uri=n}}tL.NotFound=-4e4,tL.OutOfSync=-40001;var tz=Symbol("ResourceHandler");class tO{get(e){var t=e.withoutQuery().toString(),n=this.resourceCacheMap.get(t);if(n)return n;var r=eo.findSync(e,this.contributionProvider.getContributions());if(!r)throw Error("Unknown Resource handler: ".concat(e.toString()));var o=r.resolve(e);return o.onDispose(()=>{this.resourceCacheMap.delete(t),this.onResourceDisposeEmitter.fire(o)}),this.resourceCacheMap.set(t,o),this.onResourceCreateEmitter.fire(o),o}getResourceListFromCache(){return Array.from(this.resourceCacheMap.values())}clearCache(){for(var e of this.resourceCacheMap.values())e.dispose()}constructor(){this.resourceCacheMap=new Map,this.onResourceCreateEmitter=new eX.Q5,this.onResourceDisposeEmitter=new eX.Q5,this.onResourceCreate=this.onResourceCreateEmitter.event,this.onResourceDispose=this.onResourceDisposeEmitter.event}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(tz),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],tO.prototype,"contributionProvider",void 0),tO=(0,e2.gn)([(0,e4.b)()],tO);class tB{get(e){return this.resourceManager.get(e.withoutQuery())}get onResourceCreate(){return this.resourceManager.onResourceCreate}get onResourceDispose(){return this.resourceManager.onResourceDispose}getResourceListFromCache(){return this.resourceManager.getResourceListFromCache()}clearCache(){this.resourceManager.clearCache()}}(0,e2.gn)([(0,e8.f)(tO),(0,e2.w6)("design:type",void 0===tO?Object:tO)],tB.prototype,"resourceManager",void 0),tB=(0,e2.gn)([(0,e4.b)()],tB);var tW=e0({onBind:(e,t)=>{var{bind:n}=e;n(tO).toSelf().inSingletonScope(),n(tB).toSelf().inSingletonScope(),(0,eX.yb)(n,tz),t.handlers&&t.handlers.forEach(e=>{"function"==typeof e?(n(e).toSelf().inSingletonScope(),n(tz).toService(e)):n(tz).toConstantValue(e)})},onInit:e=>{}}),tF=n("195852"),tH=Symbol("AutoSaveResourceOptions");class tU{cancelSave(){return this.saveCancellationTokenSource.cancel(),this.saveCancellationTokenSource=new eX.AU,this.saveCancellationTokenSource.token}setDirty(e){if(e!==this._dirty)this._dirty=e,this.onDirtyChangeEmitter.fire(void 0)}markAsDirty(){this.setDirty(!0),this.doAutoSave()}cancelSync(){return this.syncCancellationTokenSource.cancel(),this.syncCancellationTokenSource=new eX.AU,this.syncCancellationTokenSource.token}sync(){var e=this;return(0,e3._)(function*(){var t=e.cancelSync();return e.run(()=>e.doSync(t))})()}doSync(e){var t=this;return(0,e3._)(function*(){if(!e.isCancellationRequested)yield t.readContent(!1)})()}doAutoSave(){if("on"===this.autoSave){var e=this.cancelSave();this.toDisposeOnAutoSave.dispose();var t=window.setTimeout(()=>{this.save(e)},this.autoSaveDelay);this.toDisposeOnAutoSave.push(eX.JT.create(()=>window.clearTimeout(t)))}}run(e){var t=this;return(0,e3._)(function*(){if(!t.toDispose.disposed)return t.pendingOperation=t.pendingOperation.then((0,e3._)(function*(){try{yield e()}catch(e){console.error(e)}}))})()}save(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.cancelSave();return this.run(()=>this._doSave(e))}_doSave(e){var t=this;return(0,e3._)(function*(){if(!e.isCancellationRequested&&!!t._valid&&!t._isSaving){t._isSaving=!0;try{var n=[...t.contentChanges];if(0===n.length)return Promise.resolve(void 0);var{version:r}=t.info,o=n[n.length-1];if(o===t.lastContent){t.contentChanges.length=0,t.setValid(!0),t.setDirty(!1);return}var a=yield t.doSave(o,r);t.lastContent=o,t.updateInfo(a),o===t.contentChanges[t.contentChanges.length-1]?(t.contentChanges.length=0,t.setValid(!0),t.setDirty(!1),t.onContentChangeEmitter.fire(o)):t.doAutoSave()}catch(e){if(tL.is(e,tL.OutOfSync)){t.sync();return}t.onErrorEmitter.fire(e)}finally{t._isSaving=!1}}})()}setValid(e){if(e!==this._valid)this._valid=e,this.onValidChangeEmitter.fire()}dispose(){this.toDispose.dispose()}get dirty(){return this._dirty}get valid(){return this._valid}get uri(){return this.options.uri}readContent(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=this;return(0,e3._)(function*(){try{if(void 0!==t.lastContent&&e)return Promise.resolve(t.lastContent);if(t._readContentPromise&&e)return t._readContentPromise.promise;var n=new eX.cO;t._readContentPromise=n;var r=yield t.doRead();return t.lastContent=r.content,t.setValid(!0),t.updateInfo(r.info),t.onContentChangeEmitter.fire(r.content),n.resolve(r.content),t._readContentPromise=void 0,r.content}catch(e){throw t.setValid(!1),t.onErrorEmitter.fire(e),t._readContentPromise=void 0,e}})()}getInfo(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=this;return(0,e3._)(function*(){if(e&&-1!==t.info.version)return t.info;var n=yield t.doGetInfo();return t.updateInfo(n),n})()}updateInfo(e){this.info=e,this.onInfoChangeEmitter.fire(e)}saveContent(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e,o=null!==(t=this.contentChanges[this.contentChanges.length-1])&&void 0!==t?t:this.lastContent;n&&o&&"object"==typeof o&&"object"==typeof e&&(r=(0,tm._)({},o,e)),this.contentChanges.push(r),this.onPreSaveContentEmitter.fire(r),this.markAsDirty()}getPreSaveContent(){var e;return null!==(e=this.contentChanges[this.contentChanges.length-1])&&void 0!==e?e:this.lastContent}constructor(e){var t,n,r,o,a,s;this.options=e,this.autoSave="on",this.autoSaveDelay=2e3,this.info={version:-1,lastModification:-1,displayName:""},this._dirty=!1,this.onPreSaveContentEmitter=new eX.Q5,this.toDispose=new eX.K4,this.onDirtyChangeEmitter=new eX.Q5,this.onValidChangeEmitter=new eX.Q5,this.onContentChangeEmitter=new eX.Q5,this.onInfoChangeEmitter=new eX.Q5,this.onDisplayNameChangeEmitter=(t=this.onInfoChangeEmitter,n=e=>e.displayName,a=(o=new eX.Q5).dispose.bind(o),s=t.event(e=>{var t=n(e);!(0,tF.isEqual)(r,t)&&(r=t,o.fire(t))}),o.dispose=()=>{a(),s.dispose()},o),this.onErrorEmitter=new eX.Q5,this.contentChanges=[],this.toDisposeOnAutoSave=new eX.K4,this.onDirtyChange=this.onDirtyChangeEmitter.event,this.onPreSaveContent=this.onPreSaveContentEmitter.event,this.onValidChange=this.onValidChangeEmitter.event,this.onInfoChange=this.onInfoChangeEmitter.event,this.onContentChange=this.onContentChangeEmitter.event,this.onDisplayNameChange=this.onDisplayNameChangeEmitter.event,this.onError=this.onErrorEmitter.event,this._valid=!1,this.saveCancellationTokenSource=new eX.AU,this.syncCancellationTokenSource=new eX.AU,this.pendingOperation=Promise.resolve(),this._isSaving=!1,this.onDispose=this.toDispose.onDispose,this.options=e,this.toDispose.push(this.toDisposeOnAutoSave),this.toDispose.push(this.onDirtyChangeEmitter),this.toDispose.push(this.onInfoChangeEmitter),this.toDispose.push(this.onValidChangeEmitter),this.toDispose.push(this.onPreSaveContentEmitter),this.toDispose.push(this.onContentChangeEmitter),this.toDispose.push(this.onDisplayNameChangeEmitter),this.toDispose.push(this.onErrorEmitter),this.toDispose.push(eX.JT.create(()=>this.cancelSave())),this.toDispose.push(eX.JT.create(()=>this.cancelSync()))}}tU=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(tH)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===tH?Object:tH])],tU);var tV=e0({onInit:(e,t)=>{var n=e.get(eX.Ho);n.init(),(t.commands||[]).forEach(e=>{n.registerCommand((0,eX.ei)(e,["id","label","icon","category"]),e.execute?(0,eX.ei)(e,["execute","isEnabled","isVisible","isToggled"]):void 0)})},containerModules:[eX.bc]}),tK=n("151064"),tq=n("455069"),tZ=n("523158"),tY=n("686346"),tX=/(mac|iphone|ipod|ipad)/i.test("undefined"!=typeof navigator?null===(ea=navigator)||void 0===ea?void 0:ea.platform:""),tQ={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:tX?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,"=":187,comma:188,dash:189,"-":189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},tG={ctrl:e=>!tX&&e.ctrlKey,control:e=>tX&&e.ctrlKey,shift:e=>e.shiftKey,alt:e=>e.altKey,meta:e=>"keyup"===e.type?tQ.meta.includes(e.keyCode):e.metaKey};function tJ(e,t){var n,r,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e.key||!t)return!1;var a=t.split(/\s+/),s=0;for(var l of a){var c=tG[l],d=tQ[l.toLowerCase()];(c&&c(e)||d&&d===e.keyCode)&&s++}if(o){;return s===a.length&&(n=e,r=Object.keys(tG).reduce((e,t)=>tG[t](n)?e+1:e,0),([16,17,18,91,92].includes(n.keyCode)?r:r+1)===a.length)}return s===a.length}var t$={RIGHTARROW:"→",LEFTARROW:"←",UPARROW:"↑",DOWNARROW:"↓",BACKSPACE:"Backspace",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab",SPACE:"Space",SHIFT:"⇧",PERIOD:".",SLASH:"/",BACKSLASH:"\\",EQUALS:"=",MINUS:"-",BRACKETLEFT:"[",BRACKETRIGHT:"]",QUOTE:"'",SEMICOLON:";",BACKQUOTE:"`",OPENBRACKET:"[",CLOSEBRACKET:"]",COMMA:","},t0=tX?(0,tv._)((0,tm._)({},t$),{META:"⌘",OPTION:"⌥",ALT:"⌥",CONTROL:"^"}):(0,tv._)((0,tm._)({},t$),{META:"Alt",CAPSLOCK:"⇪",CTRL:"Ctrl",ALT:"Alt"}),t1=e=>e.split(/\s+/).map(e=>{var t=e.toLocaleUpperCase();return t0[t]||t}),t2=e=>!!e.closest("div[contentEditable=true]")||"true"===e.contentEditable||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||!1;function t4(){var{shortcuts:e=[],label:t=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,tK.jsxs)("div",{className:"container",style:{display:"inline-flex",marginLeft:4,gap:4,cursor:"default",alignItems:"center",justifyContent:"center"},children:[(0,tK.jsx)("div",{children:t}),e.map((e,t)=>(0,tK.jsxs)(tK.Fragment,{children:[t>0&&(0,tK.jsx)("div",{children:"/"}),e.map(e=>(0,tK.jsx)("div",{className:"tag",style:{display:"inline-block",backgroundColor:"#6B6B75",padding:"0 8px",height:20,lineHeight:"20px",borderRadius:4},children:e},e))]}))]})}/(Macintosh|MacIntel|MacPPC|Mac68K|iPad)/.test(navigator.userAgent),(o=es||(es={})).isKeyEventMatch=tJ,o.getKeybindingLabel=t1,Symbol("KeybindingContribution");class t6{onInit(){}registerKeybinding(e){this.keybindings.push(e)}getMatchKeybinding(e){return this.keybindings.filter(t=>this.checkKeybindingMatchKeyEvent(e,t)&&this.checkKeybindingMatchContext(t))}checkKeybindingMatchKeyEvent(e,t){return es.isKeyEventMatch(e,t.keybinding)}checkKeybindingMatchContext(e){return!e.when||this.contextMatcher.match(e.when)}getKeybindingLabel(e){return es.getKeybindingLabel(e)}constructor(){this.keybindings=[]}}(0,e2.gn)([(0,e8.f)(e6),(0,e2.w6)("design:type",void 0===e6?Object:e6)],t6.prototype,"contextMatcher",void 0),t6=(0,e2.gn)([(0,e4.b)()],t6);var t5=Symbol("ShortcutsContribution");class t3{get enable(){return this._enable}set enable(e){this._enable=e}get shortcutsHandlers(){return Array.from(this.shortcutsHandlerMap.values())}init(){for(var e of this.contributions)e.registerShortcuts(this)}onInit(){document.addEventListener("keydown",this.listener)}onDispose(){document.removeEventListener("keydown",this.listener)}generateShortcutId(e){return[e.commandId,e.source,e.when].filter(Boolean).join()}registerHandlers(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(e=>{var t=Array.isArray(e.keybinding)?e.keybinding:[e.keybinding],n=this.generateShortcutId(e);!this.shortcutsHandlerMap.has(n)&&this.shortcutsHandlerMap.set(n,(0,tv._)((0,tm._)({},e),{keybinding:[]}));var r=this.shortcutsHandlerMap.get(n),o=Array.isArray(r.keybinding)?r.keybinding:[r.keybinding],a=t.filter(e=>!o.includes(e));a.forEach(t=>{this.keybindingRegistry.registerKeybinding({keybinding:t,when:e.when,command:e.commandId,preventDefault:e.preventDefault})}),r.keybinding=[...new Set([...a,...o])],e.execute&&(this.commandRegistry.getCommand(e.commandId)?this.commandRegistry.updateCommand(e.commandId,{label:e.commandLabel}):this.commandRegistry.registerCommand({id:e.commandId,label:e.commandLabel},e))})}getShortcutHandlerByCommandId(e){return this.shortcutsHandlers.find(t=>t.commandId===e)}getLabelWithShortcutUI(e){var t=this.commandRegistry.getCommand(e),n=this.getShortcutHandlerByCommandId(e);if(t&&t.label){var r=t.shortLabel||t.label,o=this.getShortcutByCommandId(e);return n?(0,tK.jsx)(t4,{shortcuts:o,label:r}):r}return""}getLabelWithShortcutByCommandId(e){var{useShortLabel:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.commandRegistry.getCommand(e),r=this.getShortcutHandlerByCommandId(e);if(n&&n.label){var o=t&&n.shortLabel||n.label;if(r){var a=this.getShortcutByCommandId(e);return"".concat(o,"(").concat(a.map(e=>e.join("")).join("/"),")")}return o}return""}getShortcutByCommandId(e){var t=this.getShortcutHandlerByCommandId(e);return t?(Array.isArray(t.keybinding)?t.keybinding:[t.keybinding]).map(e=>this.getKeyDisplayLabel(e)):[]}getKeyDisplayLabel(e){return this.keybindingRegistry.getKeybindingLabel(e)}getShortcutsBySource(e){return this.shortcutsHandlers.filter(t=>t.source===e)}getKeybindingMatchKeyEvent(e,t){return e.filter(e=>this.keybindingRegistry.checkKeybindingMatchKeyEvent(t,e))}executeKeybinding(e,t){this.commandRegistry.executeCommand(e.command,e.args),e.preventDefault&&t.preventDefault()}constructor(){this.contributions=[],this.shortcutsHandlerMap=new Map,this._enable=!0,this.listener=e=>{if(!!this._enable){var t=this.keybindingRegistry.getMatchKeybinding(e);eX.kg.log("ShortcutsRegistry - listener",e,t),t.forEach(t=>{if(!t2(e.target)||!!t.when)this.executeKeybinding(t,e)})}}}}(0,e2.gn)([(0,e8.f)(t6),(0,e2.w6)("design:type",void 0===t6?Object:t6)],t3.prototype,"keybindingRegistry",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],t3.prototype,"commandRegistry",void 0),(0,e2.gn)([(0,tZ.n)(t5),(0,tY.j)(),(0,e2.w6)("design:type",Array)],t3.prototype,"contributions",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],t3.prototype,"init",null),t3=(0,e2.gn)([(0,e4.b)()],t3);var t8=e0({onInit:(e,t)=>{e.get(t3).registerHandlers(...t.shortcuts||[])},containerModules:[new eQ.n(e=>{(0,eX.yb)(e,t5),e(t6).toSelf().inSingletonScope(),e(eG).toService(t6),e(t3).toSelf().inSingletonScope(),e(eG).toService(t3)})]}),t9=Symbol("PreferenceContribution");class t7{init(e){Object.assign(this.preferences,e),this.preferencesChange.fire()}setSchema(e){var{properties:t}=e;if(!!t&&!!(0,eX.Kn)(t))Object.entries(t).forEach(e=>{var[t,n]=e;if(this.schema.properties[t]){console.error("Preference name collision detected in the schema for property: ",t);return}this.schema.properties[t]=n})}getPreferenceData(e){return this.preferences[e]}constructor(){this.preferences={},this.schema={properties:{}},this.preferencesChange=new eX.Q5,this.onDidPreferencesChange=this.preferencesChange.event}}t7=(0,e2.gn)([(0,e4.b)()],t7);class ne{onInit(){this.preferenceContributions.getContributions().forEach(e=>{this.preferencesManager.setSchema(e.configuration)})}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(t9),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],ne.prototype,"preferenceContributions",void 0),(0,e2.gn)([(0,e8.f)(t7),(0,e2.w6)("design:type",void 0===t7?Object:t7)],ne.prototype,"preferencesManager",void 0),ne=(0,e2.gn)([(0,e4.b)()],ne);var nt=e0({onBind(e){var{bind:t}=e;t(t7).toSelf().inSingletonScope(),(0,eX.KV)(t,ne,[eG]),(0,eX.yb)(t,t9)},onInit(e,t){e.container.get(t7).init(null==t?void 0:t.defaultData)}}),nn="popstate",nr=e=>{var t=e.path.toString(),{query:n}=e;return n&&(t+="?".concat(n)),e.fragment&&(t+="#hash"),t};class ni{get state(){return this.history.state}get idx(){var e;return(null===(e=this.state)||void 0===e?void 0:e.fIdx)||null}init(){null===this.idx&&this.history.replaceState((0,tv._)((0,tm._)({},this.state),{fIdx:-1,uri:""}),""),this.window.addEventListener(nn,this.listener),this.disposable.push(eX.JT.create(()=>this.window.removeEventListener(nn,this.listener)))}push(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.idx+1,n={uri:e.toString(),fIdx:t},r=nr(e);try{this.history.pushState(n,"",r)}catch(e){this.window.location.assign(r)}}replace(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.idx,n={uri:toString(),fIdx:t},r=nr(e);this.history.replaceState(n,"",r)}go(e){return this.history.go(e)}dispose(){this.disposable.dispose()}constructor(){this.window=document.defaultView||window,this.history=this.window.history,this.onChangeEmitter=new eX.Q5,this.onChange=this.onChangeEmitter.event,this.disposable=new eX.K4(this.onChangeEmitter),this.listener=e=>{this.onChangeEmitter.fire(e.state||{})}}}class no{get location(){return this.stack[this.idx]}init(){this.history.init(),this.disposable.push(this.history.onChange(this.listener))}dispose(){this.disposable.dispose()}pushOrReplace(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.stack.length>this.idx+1&&(this.stack=this.stack.slice(0,this.idx+1)),t?this.replace(e):this.push(e)}push(e){if(eX.kg.log("navigation history push"),this.similar(e,this.location)){eX.kg.log("location is similar");return}this.stack.push(e),this.idx=this.stack.length-1,this.history.push(e.uri,this.idx),this.onChangeEmitter.fire(e)}replace(e){eX.kg.log("navigation history replace"),this.stack.splice(this.idx+1,0,e),this.idx=this.stack.length-1,this.history.replace(e.uri,this.idx),this.onChangeEmitter.fire(e)}go(e){var t=this.idx+e,n=this.stack[t];if(!(t>=this.stack.length)&&!(t<0)&&!!n)return this.idx=t,window.history.go(e),this.onChangeEmitter.fire(n),this.stack[this.idx]}back(){return this.go(-1)}canGoBack(){return this.idx>=1}forward(){return this.go(1)}canGoForward(){return this.idx>=0&&this.idx!==this.stack.length-1}similar(e,t){return void 0===e||void 0===t?e===t:e.uri.toString()===t.uri.toString()}constructor(){this.stack=[],this.idx=-1,this.history=new ni,this.onChangeEmitter=new eX.Q5,this.onPopstateEmitter=new eX.Q5,this.onDidHistoryChange=this.onChangeEmitter.event,this.onPopstate=this.onPopstateEmitter.event,this.disposable=new eX.K4(this.history,this.onChangeEmitter,this.onPopstateEmitter),this.listener=e=>{if(!e||!(0,eX.hj)(e.fIdx)||!e.uri)return;var{fIdx:t}=e;if(!(t>=this.stack.length)&&!(t<0))this.idx=t,this.onChangeEmitter.fire(this.location),this.onPopstateEmitter.fire(this.location)}}}no=(0,e2.gn)([(0,e4.b)()],no);class na{init(){this.history.init(),this.disposable.pushAll([this.history,this.history.onPopstate(e=>{this.openerService.open(e.uri)})])}goto(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this;return(0,e3._)(function*(){var o;o="string"==typeof e?new tD("".concat(r.scheme,"://").concat(e)):e,r.history.pushOrReplace({uri:o},t),yield r.openerService.open(o,n)})()}back(){var e=this;return(0,e3._)(function*(){var t=e.history.back();t&&(yield e.openerService.open(t.uri))})()}forward(){var e=this;return(0,e3._)(function*(){var t=e.history.forward();t&&(yield e.openerService.open(t.uri))})()}canGoBack(){return this.history.canGoBack()}canGoForward(){return this.history.canGoForward()}get uri(){var e;return null===(e=this.history.location)||void 0===e?void 0:e.uri}get onDidHistoryChange(){return this.history.onDidHistoryChange}setScheme(e){this.scheme=e}dispose(){this.disposable.dispose()}constructor(){this.disposable=new eX.K4,this.scheme="flowide"}}(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],na.prototype,"openerService",void 0),(0,e2.gn)([(0,e8.f)(no),(0,e2.w6)("design:type",void 0===no?Object:no)],na.prototype,"history",void 0),na=(0,e2.gn)([(0,e4.b)()],na);class ns{onLayoutInit(){}onStart(){this.navigationService.init()}onDispose(){this.navigationService.dispose(),this._toDispose.dispose()}registerCommands(e){e.registerCommand({id:"navigation.forward",label:"Forward"},{execute:()=>{this.navigationService.forward()},isEnabled:()=>this.navigationService.canGoForward()}),e.registerCommand({id:"navigation.back",label:"Backward"},{execute:()=>{this.navigationService.back()},isEnabled:()=>this.navigationService.canGoBack()})}registerShortcuts(e){e.registerHandlers({keybinding:"control shift -",commandId:"navigation.forward",preventDefault:!0},{keybinding:"control -",commandId:"navigation.back",preventDefault:!0})}registerMouseNavigationListener(){this._toDispose.push((0,eX.Oo)(document.body,"mousedown",e=>{switch(e.button){case 3:this.navigationService.back();break;case 4:this.navigationService.forward()}}))}constructor(){this._toDispose=new eX.K4}}(0,e2.gn)([(0,e8.f)(na),(0,e2.w6)("design:type",void 0===na?Object:na)],ns.prototype,"navigationService",void 0),ns=(0,e2.gn)([(0,e4.b)()],ns);var nl=e0({onBind:e=>{var{bind:t}=e;t(no).toSelf().inSingletonScope(),t(na).toSelf().inSingletonScope(),(0,eX.KV)(t,ns,[eG,eX.pY,t5])},onInit(e,t){t.uriScheme&&e.container.get(na).setScheme(t.uriScheme)}}),nc={id:"flowide",type:"dark",label:"flow ide default theme"},nd={id:"flowide",type:"light",label:"flow ide default theme"};class nu{init(){this.changeWithPreferences(),this.preferencesManager.onDidPreferencesChange(()=>{this.changeWithPreferences()})}changeWithPreferences(){var e=this.preferencesManager.getPreferenceData("theme")||nc.type;this.themeChange.fire({next:(0,tv._)((0,tm._)({},nc),{type:e}),prev:this.current})}register(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.forEach(e=>this.themes.set(e.id,e)),eX.JT.create(()=>{t.forEach(e=>{e&&e===this.current&&this.setCurrent(nc.id),this.themes.delete(e.id)})})}setCurrent(e){var t=this.themes.get(e),n=this.current;t&&t!==n&&(this.current=t,this.themeChange.fire({next:t,prev:n}))}getCurrent(){return this.current}dispose(){this.themeChange.dispose()}constructor(){this.themes=new Map([[nc.type,nc],[nd.type,nd]]),this.current=nc,this.themeChange=new eX.Q5,this.onDidThemeChange=this.themeChange.event}}(0,e2.gn)([(0,e8.f)(t7),(0,e2.w6)("design:type",void 0===t7?Object:t7)],nu.prototype,"preferencesManager",void 0),nu=(0,e2.gn)([(0,e4.b)()],nu);var nh=Symbol("ColorContribution");class np{init(){this.colorContributions.getContributions().forEach(e=>{e.registerColors(this)})}register(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map(e=>{var{id:t}=e;return this.colors[t]=e,this.schema.properties[t]={type:"string",description:e.description},eX.JT.create(()=>this.deregisterColor(t))})}deregisterColor(e){delete this.colors[e],delete this.schema.properties[e]}getColors(){return Object.keys(this.colors).map(e=>this.colors[e])}getColor(e){return this.colors[e]}getThemeColor(e,t){var n=null===(r=this.getColor(e).defaults)||void 0===r?void 0:r[t];if(n&&"string"==typeof n&&!n.startsWith("#")&&!(null==n?void 0:n.startsWith("rgb"))){var r,o,a=this.colors[n];n=null==a?void 0:null===(o=a.defaults)||void 0===o?void 0:o[t]}return n}toCssColor(e,t){var n="--".concat(e.replace(/\./g,"-")),r=this.getThemeColor(e,t);return"".concat(n,": ").concat(r,";")}toCss(e){return"body {\n".concat(this.getColors().map(t=>this.toCssColor(t.id,e)).join("\n"),"\n}")}constructor(){this.colors={},this.schema={type:"object",properties:{}}}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(nh),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],np.prototype,"colorContributions",void 0),np=(0,e2.gn)([(0,e4.b)()],np);var nf={id:"flowide.color.base.white",defaults:{dark:"rgba(255, 255, 255)",light:"rgba(255, 255, 255)"}},nm={id:"flowide.color.base.bg.0",defaults:{dark:"rgba(22, 22, 26, 1)",light:"rgba(255, 255, 255)"}},nv={id:"flowide.color.base.bg.1",defaults:{dark:"rgba(35, 36, 41, 1)",light:"rgba(255, 255, 255)"}},ng={id:"flowide.color.base.bg.2",defaults:{dark:"rgba(53, 54, 60, 1)",light:"rgba(255, 255, 255)"}},nb={id:"flowide.color.base.text.0",defaults:{dark:"rgba(249,249,249)",light:"rgba(28,31,35)"}},ny={id:"flowide.color.base.text.1",defaults:{dark:"rgba(249,249,249, 0.8)",light:"rgba(28,31,35, 0.8)"}},n_={id:"flowide.color.base.text.2",defaults:{dark:"rgba(249,249,249, 0.6)",light:"rgba(28,31,35, 0.62)"}},nw={id:"flowide.color.base.border",defaults:{dark:"rgba(255, 255, 255, 0.08)",light:"rgba(28,31,35, 0.08)"}},nx={id:"flowide.color.menu.border",defaults:{dark:"#454545",light:"unset"}},nS={id:"flowide.color.menu.box.shadow",defaults:{dark:"rgba(0, 0, 0, 0.36)",light:"rgba(0, 0, 0, 0.16)"}},nk={id:"flowide.color.base.fill.0",defaults:{dark:"rgba(255,255,255, 0.12)",light:"rgba(46,50,56, 0.05)"}},nC={id:"flowide.color.base.fill.1",defaults:{dark:"rgba(255,255,255, 0.16)",light:"rgba(46,50,56, 0.09)"}},nj={id:"flowide.color.base.fill.2",defaults:{dark:"rgba(255,255,255, 0.2)",light:"rgba(46,50,56, 0.05)"}},nE={id:"flowide.color.base.primary",defaults:{dark:"rgb(84,169,255)",light:"rgb(0,100,250)"}},nT={id:"flowide.color.base.primary.hover",defaults:{dark:"rgb(127,193,255)",light:"rgb(0,98,214)"}},nI=[{id:"flowide.color.view.topBar.bg",defaults:{light:nm.id,dark:nm.id}}],nP=[...Object.values(eY),...nI],nM=Symbol("StylingContribution");class nR{apply(e){var t=[],n={type:e.type,label:e.label,getColor:t=>this.colorService.getThemeColor(t,e.type)},r={prefix:nR.PREFIX,add:e=>t.push(e)},o=eX.r4.createStyleElement("flowide-styles");this.stylingContributions.getContributions().forEach(e=>{e.registerStyle(r,n)});var a=t.join("\n");return o.innerHTML=a,this.clear(),this.cssElement=o,eX.JT.create(()=>{this.clear()})}register(e,t){var n=this.css.get(e)||eX.r4.createStyleElement(e);return n.innerHTML=t,this.css.set(e,n),eX.JT.create(()=>{document.head.removeChild(n),this.css.delete(e)})}clear(){this.cssElement&&(document.head.removeChild(this.cssElement),this.cssElement=void 0)}dispose(){this.clear()}constructor(){this.css=new Map}}nR.PREFIX="flowide",(0,e2.gn)([(0,e8.f)(nu),(0,e2.w6)("design:type",void 0===nu?Object:nu)],nR.prototype,"themeService",void 0),(0,e2.gn)([(0,e8.f)(np),(0,e2.w6)("design:type",void 0===np?Object:np)],nR.prototype,"colorService",void 0),(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(nM),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],nR.prototype,"stylingContributions",void 0),nR=(0,e2.gn)([(0,e4.b)()],nR);class nD{registerColors(e){e.register(...nP)}registerStyle(e,t){var{add:n}=e,{type:r}=t;n(this.colorService.toCss(r))}onLoading(){var e=this;return(0,e3._)(function*(){e.colorService.init(),e.themeService.onDidThemeChange(t=>{e.stylingService.apply(t.next),e.ready.resolve()}),e.themeService.init(),yield e.ready.promise,eX.kg.log("theme loaded")})()}onDispose(){this.themeService.dispose(),this.stylingService.dispose()}constructor(){this.ready=new eX.BH}}(0,e2.gn)([(0,e8.f)(np),(0,e2.w6)("design:type",void 0===np?Object:np)],nD.prototype,"colorService",void 0),(0,e2.gn)([(0,e8.f)(nu),(0,e2.w6)("design:type",void 0===nu?Object:nu)],nD.prototype,"themeService",void 0),(0,e2.gn)([(0,e8.f)(nR),(0,e2.w6)("design:type",void 0===nR?Object:nR)],nD.prototype,"stylingService",void 0),nD=(0,e2.gn)([(0,e4.b)()],nD);var nA=e0({onBind(e){var{bind:t}=e;t(nu).toSelf().inSingletonScope(),t(nR).toSelf().inSingletonScope(),t(np).toSelf().inSingletonScope(),(0,eX.yb)(t,nM),(0,eX.yb)(t,nh),(0,eX.KV)(t,nD,[eG,nM,nh])}}),nN=Symbol("LabelHandler"),nL=Symbol("LabelService");class nz{onInit(){for(var e of this.contributionProvider.getContributions())e.onChange&&e.onChange(e=>{this.onChangeEmitter.fire({affects:t=>this.affects(t,e)})})}getIcon(e){for(var t of this.findContribution(e)){var n=t.getIcon&&t.getIcon(e);if(void 0!==n)return n}return""}renderer(e,t){var n=this.findContribution(e).find(e=>e.renderer);return n&&n.renderer?n.renderer(e,t):null}getName(e){for(var t of this.findContribution(e)){var n=t.getName&&t.getName(e);if(void 0!==n)return n}return""}getDescription(e){for(var t of this.findContribution(e)){var n=t.getDescription&&t.getDescription(e);if(void 0!==n)return n}return""}affects(e,t){if(t.affects(e))return!0;for(var n of this.findContribution(e))if(n.affects&&n.affects(e,t))return!0;return!1}findContribution(e){return tr(this.contributionProvider.getContributions(),t=>t.canHandle(e)).map(e=>e.value)}get onChange(){return this.onChangeEmitter.event}constructor(){this.onChangeEmitter=new eX.Q5}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(nN),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],nz.prototype,"contributionProvider",void 0),nz=(0,e2.gn)([(0,e4.b)()],nz);var nO=e0({onBind:(e,t)=>{var{bind:n}=e;(0,eX.KV)(n,nz,[eG]),n(nL).toService(nz),(0,eX.yb)(n,nN),t.handlers&&t.handlers.forEach(e=>{"function"==typeof e?(n(e).toSelf().inSingletonScope(),n(nN).toService(e)):n(nN).toConstantValue(e)})}}),nB=tq.createContext({});function nW(){return tq.useContext(nB)}function nF(e){return nW().get(e)}var nH=Symbol("IDERendererProvider"),nU=e=>{var{className:t}=e,n=nW().get(nH);return(0,tK.jsx)(n,{className:t})},nV=n("630243"),nK=(0,tq.forwardRef)((e,t)=>{var{containerModules:n,customPluginContext:r,container:o,plugins:a}=e,s=(0,tq.useMemo)(()=>{var e,t,s,l=o||new nV.W;if(l.load(tN),n&&n.forEach(e=>l.load(e)),r&&l.rebind(eJ).toConstantValue(r(l)),a){;e=a(l.get(eJ)),t=l,s=new Set,e.reduce((e,t)=>{if(!s.has(t.pluginId)&&(t.initPlugin(),s.add(t.pluginId)),t.containerModules&&t.containerModules.length>0)for(var n of t.containerModules)!e.includes(n)&&e.push(n);return e},[]).forEach(e=>t.load(e)),e.forEach(e=>{if(e.contributionKeys)for(var n of e.contributionKeys)t.bind(n).toConstantValue(e.options)})}return l.get(tA).init(),l},[]);return(0,tq.useEffect)(()=>{var e=s.get(tA);return e.start(),()=>{e.dispose()}},[s]),(0,tq.useImperativeHandle)(t,()=>({getContainer:()=>s})),(0,tK.jsx)(nB.Provider,{value:s,children:e.children})}),nq=()=>{var e=nF(nu),[t,n]=(0,tq.useState)(e.getCurrent());return(0,tq.useEffect)(()=>{var t=e.onDidThemeChange(e=>{var{next:t}=e;n(t)});return()=>t.dispose()},[]),{theme:t}},nZ=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=nF(nR),o=nF(np),{theme:a}=nq();(0,tq.useEffect)(()=>{var n=t({prefix:"flowide"},{type:a.type,label:a.label,getColor:e=>o.getThemeColor(e,a.type)}),s=r.register(e,n);return()=>s.dispose()},[e,a,...n])},nY=Symbol("EventService"),nX=Symbol("EventContribution");class nQ{onDispose(){this.toDispose.dispose()}onInit(){for(var e of this.contributions)e.registerEvent(this)}listenGlobalEvent(e,t,n){return this._listenEvent(e,t,n)}_listenEvent(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.globalEvents,o=r[e];if(!o){var a={handleEvent:e=>{for(var t=o.handlers,n=0,r=t.length;n<r;n++)if(t[n].handle(e))return}};window.addEventListener(e,a,!1),o=r[e]={handlers:[],dispose:()=>{window.removeEventListener(e,a),delete r[e]}}}var{handlers:s}=o,l={handle:t,priority:n};s.unshift(l),s.sort((e,t)=>t.priority-e.priority);var c=eX.JT.create(()=>{var e=o.handlers.indexOf(l);-1!==e&&o.handlers.splice(e,1),0===o.handlers.length&&o.dispose()});return this.toDispose.push(c),c}constructor(){this.toDispose=new eX.K4,this.globalEvents={}}}(0,e2.gn)([(0,tZ.n)(nX),(0,tY.j)(),(0,e2.w6)("design:type",Array)],nQ.prototype,"contributions",void 0),nQ=(0,e2.gn)([(0,e4.b)()],nQ);var nG=e0({containerModules:[new eQ.n(e=>{(0,eX.yb)(e,nX),e(nY).toService(nQ),(0,eX.KV)(e,nQ,[eG])})]});function nJ(e){return getComputedStyle(e)}function n$(e,t){for(var n in t){var r=t[n];"number"==typeof r&&(r="".concat(r,"px")),e.style[n]=r}return e}function n0(e){var t=document.createElement("div");return t.className=e,t}var n1="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function n2(e,t){if(!n1)throw Error("No element matching method supported");return n1.call(e,t)}function n4(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function n6(e,t){return Array.prototype.filter.call(e.children,e=>n2(e,t))}function n5(e){return parseInt(e,10)||0}var n3={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},n8={main:"ide-ps",rtl:"ide-ps__rtl",element:{thumb:e=>"ide-ps__thumb-".concat(e),rail:e=>"ide-ps__rail-".concat(e),consuming:"ide-ps__child--consume"},state:{focus:"ide-ps--focus",clicking:"ide-ps--clicking",active:e=>"ide-ps--active-".concat(e),scrolling:e=>"ide-ps--scrolling-".concat(e)}},n9={x:null,y:null};function n7(e,t){var n=e.element.classList,r=n8.state.scrolling(t);n.contains(r)?clearTimeout(n9[t]):n.add(r)}function re(e,t){n9[t]=setTimeout(()=>e.isAlive&&e.element.classList.remove(n8.state.scrolling(t)),e.settings.scrollingThreshold)}function rt(e,t){var{element:n}=e,r=Math.floor(n.scrollTop),o=n.getBoundingClientRect();e.containerWidth=Math.round(o.width),e.containerHeight=Math.round(o.height),e.contentWidth=n.scrollWidth,e.contentHeight=n.scrollHeight,!n.contains(e.scrollbarXRail)&&(!t||"x"===t)&&(n6(n,n8.element.rail("x")).forEach(e=>n4(e)),n.appendChild(e.scrollbarXRail)),!n.contains(e.scrollbarYRail)&&(!t||"y"===t)&&(n6(n,n8.element.rail("y")).forEach(e=>n4(e)),n.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=rn(e,n5(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=n5((e.negativeScrollAdjustment+n.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=rn(e,n5(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTop=n5(r*(e.railYHeight-e.scrollbarYHeight)/(e.contentHeight-e.containerHeight))):e.scrollbarYActive=!1,e.scrollbarXLeft>=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),function(e,t){var n={width:t.railXWidth},r=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-r:n.top=t.scrollbarXTop+r,n$(t.scrollbarXRail,n);var o={top:r,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?o.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:o.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?o.left=t.negativeScrollAdjustment+e.scrollLeft+2*t.containerWidth-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:o.left=t.scrollbarYLeft+e.scrollLeft,n$(t.scrollbarYRail,o),n$(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),n$(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}(n,e),e.scrollbarXActive?n.classList.add(n8.state.active("x")):(n.classList.remove(n8.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,n.scrollLeft=!0===e.isRtl?e.contentWidth:0),e.scrollbarYActive?n.classList.add(n8.state.active("y")):(n.classList.remove(n8.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,n.scrollTop=0)}function rn(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function rr(e){if("function"==typeof window.CustomEvent)return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ri(e,t,n){var r,o=!(arguments.length>3)||void 0===arguments[3]||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if("top"===t)r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if("left"===t)r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw Error("A proper axis should be provided");(function(e,t,n){var r,o,[a,s,l,c,d,u]=n,h=!(arguments.length>3)||void 0===arguments[3]||arguments[3],p=arguments.length>4&&void 0!==arguments[4]&&arguments[4],{element:f}=e;if(e.reach[c]=null,f[l]<1&&(e.reach[c]="start"),f[l]>e[a]-e[s]-1&&(e.reach[c]="end"),t&&(f.dispatchEvent(rr("ide-ps-scroll-".concat(c))),t<0?f.dispatchEvent(rr("ide-ps-scroll-".concat(d))):t>0&&f.dispatchEvent(rr("ide-ps-scroll-".concat(u))),h)){;n7(r=e,o=c),re(r,o)}e.reach[c]&&(t||p)&&f.dispatchEvent(rr("ide-ps-".concat(c,"-reach-").concat(e.reach[c])))})(e,n,r,o,a)}class ro{bind(e,t){void 0===this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)}unbind(e,t){this.handlers[e]=this.handlers[e].filter(n=>!!t&&n!==t||(this.element.removeEventListener(e,n,!1),!1))}unbindAll(){for(var e in this.handlers)this.unbind(e)}get isEmpty(){return Object.keys(this.handlers).every(e=>0===this.handlers[e].length)}constructor(e){this.element=e,this.handlers={}}}class ra{eventElement(e){var t=this.eventElements.filter(t=>t.element===e)[0];return!t&&(t=new ro(e),this.eventElements.push(t)),t}bind(e,t,n){this.eventElement(e).bind(t,n)}unbind(e,t,n){var r=this.eventElement(e);r.unbind(t,n),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)}unbindAll(){this.eventElements.forEach(e=>e.unbindAll()),this.eventElements=[]}once(e,t,n){var r=this.eventElement(e),o=e=>{r.unbind(t,o),n(e)};r.bind(t,o)}constructor(){this.eventElements=[]}}function rs(e,t){var[n,r,o,a,s,l,c,d,u]=t,{element:h}=e,p=null,f=null,m=null;function v(t){t.touches&&t.touches[0]&&(t[o]=t.touches[0].pageY),h[c]=p+m*(t[o]-f),n7(e,d),rt(e),t.stopPropagation(),t.type.startsWith("touch")&&t.changedTouches.length>1&&t.preventDefault()}function g(){re(e,d),e[u].classList.remove(n8.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",v)}function b(t,s){p=h[c],s&&t.touches&&(t[o]=t.touches[0].pageY),f=t[o],m=(e[r]-e[n])/(e[a]-e[l]),s?e.event.bind(e.ownerDocument,"touchmove",v):(e.event.bind(e.ownerDocument,"mousemove",v),e.event.once(e.ownerDocument,"mouseup",g),t.preventDefault()),e[u].classList.add(n8.state.clicking),t.stopPropagation()}e.event.bind(e[s],"mousedown",e=>{b(e)}),e.event.bind(e[s],"touchstart",e=>{b(e,!0)})}var rl=()=>({handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}),rc={"click-rail":e=>{var{element:t}=e;e.event.bind(e.scrollbarYRail,"mousedown",e=>{var t=e.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top>e.scrollbarYTop?1:-1;e.element.scrollTop+=t*e.containerHeight,rt(i),e.stopPropagation()}),e.event.bind(e.scrollbarY,"mousedown",e=>e.stopPropagation()),e.event.bind(e.scrollbarX,"mousedown",e=>e.stopPropagation()),e.event.bind(e.scrollbarXRail,"mousedown",e=>{var t=e.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=t*e.containerWidth,rt(i),e.stopPropagation()})},"drag-thumb":function(e){rs(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),rs(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(e){var{element:t}=e;e.event.bind(e.ownerDocument,"keydown",n=>{if(n.isDefaultPrevented&&n.isDefaultPrevented()||n.defaultPrevented||!n2(t,":hover")&&!(n2(e.scrollbarX,":focus")||n2(e.scrollbarY,":focus")))return;var r,o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){;if("IFRAME"===o.tagName)o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(n2(r=o,"input,[contenteditable]")||n2(r,"select,[contenteditable]")||n2(r,"textarea,[contenteditable]")||n2(r,"button,[contenteditable]"))return}var a=0,s=0;switch(n.which){case 37:a=n.metaKey?-e.contentWidth:n.altKey?-e.containerWidth:-30;break;case 38:s=n.metaKey?e.contentHeight:n.altKey?e.containerHeight:30;break;case 39:a=n.metaKey?e.contentWidth:n.altKey?e.containerWidth:30;break;case 40:s=n.metaKey?-e.contentHeight:n.altKey?-e.containerHeight:-30;break;case 32:s=n.shiftKey?e.containerHeight:-e.containerHeight;break;case 33:s=e.containerHeight;break;case 34:s=-e.containerHeight;break;case 36:s=e.contentHeight;break;case 35:s=-e.contentHeight;break;default:return}if((!e.settings.suppressScrollX||0===a)&&(!e.settings.suppressScrollY||0===s))t.scrollTop-=s,t.scrollLeft+=a,rt(e),function(n,r){var o=Math.floor(t.scrollTop);if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&r<0)return!e.settings.wheelPropagation}var{scrollLeft:a}=t;if(0===r){if(!e.scrollbarXActive)return!1;if(0===a&&n<0||a>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}(a,s)&&n.preventDefault()})},wheel:function(e){var{element:t}=e;function n(n){var r,o,a,s,l,c,d,u,[h,p]=function(e){var{deltaX:t}=e,n=-1*e.deltaY;return((void 0===t||void 0===n)&&(t=-1*e.wheelDeltaX/6,n=e.wheelDeltaY/6),e.deltaMode&&1===e.deltaMode&&(t*=10,n*=10),t!=t&&n!=n&&(t=0,n=e.wheelDelta),e.shiftKey)?[-n,-t]:(Math.abs(n)>Math.abs(t)&&(t=0),Math.abs(t)>Math.abs(n)&&(n=0),[t,n])}(n);if(!function(e,n,r){if(!n3.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(e))return!1;for(var o=e;o&&o!==t;){if(o.classList.contains(n8.element.consuming))return!0;var a=nJ(o);if(r&&a.overflowY.match(/(scroll|auto)/)){var s=o.scrollHeight-o.clientHeight;if(s>0&&(o.scrollTop>0&&r<0||o.scrollTop<s&&r>0))return!0}if(n&&a.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&n<0||o.scrollLeft<l&&n>0))return!0}o=o.parentNode}return!1}(n.target,h,p)){var f=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(p?t.scrollTop-=p*e.settings.wheelSpeed:t.scrollTop+=h*e.settings.wheelSpeed,f=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(h?t.scrollLeft+=h*e.settings.wheelSpeed:t.scrollLeft-=p*e.settings.wheelSpeed,f=!0):(t.scrollTop-=p*e.settings.wheelSpeed,t.scrollLeft+=h*e.settings.wheelSpeed),rt(e),(f=f||(r=h,o=p,s=Math.floor(t.scrollTop),l=0===t.scrollTop,c=s+t.offsetHeight===t.scrollHeight,d=0===t.scrollLeft,u=t.scrollLeft+t.offsetWidth===t.scrollWidth,!(a=Math.abs(o)>Math.abs(r)?l||c:d||u)||!e.settings.wheelPropagation))&&!n.ctrlKey&&(n.stopPropagation(),n.preventDefault())}}void 0!==window.onwheel?e.event.bind(t,"wheel",n):void 0!==window.onmousewheel&&e.event.bind(t,"mousewheel",n)},touch:function(e){if(!!n3.supportsTouch||!!n3.supportsIePointer){var{element:t}=e;var n={},r=0,o={},a=null;n3.supportsTouch?(e.event.bind(t,"touchstart",d),e.event.bind(t,"touchmove",u),e.event.bind(t,"touchend",h)):n3.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",d),e.event.bind(t,"pointermove",u),e.event.bind(t,"pointerup",h)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",d),e.event.bind(t,"MSPointerMove",u),e.event.bind(t,"MSPointerUp",h)))}function s(n,r){t.scrollTop-=r,t.scrollLeft-=n,rt(e)}function l(e){return e.targetTouches?e.targetTouches[0]:e}function c(e){return(!e.pointerType||"pen"!==e.pointerType||0!==e.buttons)&&(!!e.targetTouches&&1===e.targetTouches.length||!!e.pointerType&&"mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE||!1)}function d(e){if(!!c(e)){var t=l(e);n.pageX=t.pageX,n.pageY=t.pageY,r=new Date().getTime(),null!==a&&clearInterval(a)}}function u(a){if(c(a)){var d=l(a),u={pageX:d.pageX,pageY:d.pageY},h=u.pageX-n.pageX,p=u.pageY-n.pageY;if(!function(e,n,r){if(!t.contains(e))return!1;for(var o=e;o&&o!==t;){if(o.classList.contains(n8.element.consuming))return!0;var a=nJ(o);if(r&&a.overflowY.match(/(scroll|auto)/)){var s=o.scrollHeight-o.clientHeight;if(s>0&&(o.scrollTop>0&&r<0||o.scrollTop<s&&r>0))return!0}if(n&&a.overflowX.match(/(scroll|auto)/)){var l=o.scrollWidth-o.clientWidth;if(l>0&&(o.scrollLeft>0&&n<0||o.scrollLeft<l&&n>0))return!0}o=o.parentNode}return!1}(a.target,h,p)){s(h,p),n=u;var f=new Date().getTime(),m=f-r;m>0&&(o.x=h/m,o.y=p/m,r=f),function(n,r){var o=Math.floor(t.scrollTop),{scrollLeft:a}=t,s=Math.abs(n),l=Math.abs(r);if(l>s){if(r<0&&o===e.contentHeight-e.containerHeight||r>0&&0===o)return 0===window.scrollY&&r>0&&n3.isChrome}else s>l&&(n<0&&a===e.contentWidth-e.containerWidth||n>0);return!0}(h,p)&&a.preventDefault()}}}function h(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized||!o.x&&!o.y||.01>Math.abs(o.x)&&.01>Math.abs(o.y)||!e.element){clearInterval(a);return}s(30*o.x,30*o.y),o.x*=.8,o.y*=.8},10))}}};class rd{update(){if(!!this.isAlive)this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,n$(this.scrollbarXRail,{display:"block"}),n$(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=n5(nJ(this.scrollbarXRail).marginLeft)+n5(nJ(this.scrollbarXRail).marginRight),this.railYMarginHeight=n5(nJ(this.scrollbarYRail).marginTop)+n5(nJ(this.scrollbarYRail).marginBottom),n$(this.scrollbarXRail,{display:"none"}),n$(this.scrollbarYRail,{display:"none"}),rt(this),ri(this,"top",0,!1,!0),ri(this,"left",0,!1,!0),n$(this.scrollbarXRail,{display:""}),n$(this.scrollbarYRail,{display:""})}onScroll(e){if(!!this.isAlive)rt(this),ri(this,"top",this.element.scrollTop-this.lastScrollTop),ri(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft}destroy(){if(!!this.isAlive)this.event.unbindAll(),n4(this.scrollbarX),n4(this.scrollbarY),n4(this.scrollbarXRail),n4(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1}removePsClasses(){this.element.className=this.element.className.split(" ").filter(e=>!e.match(/^ps([-_].+|)$/)).join(" ")}constructor(e,t={}){if("string"==typeof e&&(e=document.querySelector(e)),!e||!e.nodeName)throw Error("no element is specified to initialize PerfectScrollbar");for(var n in this.element=e,e.classList.add(n8.main),this.settings=rl(),t)this.settings[n]=t[n];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var r,o,a,s=()=>e.classList.add(n8.state.focus),l=()=>e.classList.remove(n8.state.focus);this.isRtl="rtl"===nJ(e).direction,!0===this.isRtl&&e.classList.add(n8.rtl),this.isNegativeScroll=(r=e.scrollLeft,o=null,e.scrollLeft=-1,o=e.scrollLeft<0,e.scrollLeft=r,o),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new ra,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=n0(n8.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=n0(n8.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",l),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var c=nJ(this.scrollbarXRail);this.scrollbarXBottom=parseInt(c.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n5(c.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n5(c.borderLeftWidth)+n5(c.borderRightWidth),n$(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n5(c.marginLeft)+n5(c.marginRight),n$(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=n0(n8.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=n0(n8.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",l),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var d=nJ(this.scrollbarYRail);this.scrollbarYRight=parseInt(d.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n5(d.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?n5((a=nJ(this.scrollbarY)).width)+n5(a.paddingLeft)+n5(a.paddingRight)+n5(a.borderLeftWidth)+n5(a.borderRightWidth):null,this.railBorderYWidth=n5(d.borderTopWidth)+n5(d.borderBottomWidth),n$(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n5(d.marginTop)+n5(d.marginBottom),n$(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(e=>rc[e](this)),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",e=>this.onScroll(e)),rt(this)}}var ru=n("784221"),rh=n("252497"),rp=n("30316");function rf(){return function(e,t,n){var r=new rh.S(ru.Mx,!0);(0,rp.D0)(e,t,n,r)}}class rm{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}(a=el||(el={})).calc=function(e,t){var n=e.length;if(0===n)return t;for(var r=0,o=0,a=0,s=0,l=0,c=0;c<n;++c){var d=e[c],u=d.minSize,h=d.maxSize,p=d.sizeHint;d.done=!1,d.size=Math.max(u,Math.min(p,h)),a+=d.size,r+=u,o+=h,d.stretch>0&&(s+=d.stretch,l++)}if(t===a)return 0;if(t<=r){for(var f=0;f<n;++f){var m=e[f];m.size=m.minSize}return t-r}if(t>=o){for(var v=0;v<n;++v){var g=e[v];g.size=g.maxSize}return t-o}var b=n;if(t<a){for(var y=a-t;l>0&&y>.01;){for(var _=y,w=s,x=0;x<n;++x){var S=e[x];if(!S.done&&0!==S.stretch){var k=S.stretch*_/w;S.size-k<=S.minSize?(y-=S.size-S.minSize,s-=S.stretch,S.size=S.minSize,S.done=!0,b--,l--):(y-=k,S.size-=k)}}}for(;b>0&&y>.01;){for(var C=y/b,j=0;j<n;++j){var E=e[j];if(!E.done)E.size-C<=E.minSize?(y-=E.size-E.minSize,E.size=E.minSize,E.done=!0,b--):(y-=C,E.size-=C)}}}else{for(var T=t-a;l>0&&T>.01;){for(var I=T,P=s,M=0;M<n;++M){var R=e[M];if(!R.done&&0!==R.stretch){var D=R.stretch*I/P;R.size+D>=R.maxSize?(T-=R.maxSize-R.size,s-=R.stretch,R.size=R.maxSize,R.done=!0,b--,l--):(T-=D,R.size+=D)}}}for(;b>0&&T>.01;){for(var A=T/b,N=0;N<n;++N){var L=e[N];if(!L.done)L.size+A>=L.maxSize?(T-=L.maxSize-L.size,L.size=L.maxSize,L.done=!0,b--):(T-=A,L.size+=A)}}}return 0},a.adjust=function(e,t,n){if(0!==e.length&&0!==n)n>0?function(e,t,n){for(var r=0,o=0;o<=t;++o){var a=e[o];r+=a.maxSize-a.size}for(var s=0,l=t+1,c=e.length;l<c;++l){var d=e[l];s+=d.size-d.minSize}for(var u=n=Math.min(n,r,s),h=t;h>=0&&u>0;--h){var p=e[h],f=p.maxSize-p.size;f>=u?(p.sizeHint=p.size+u,u=0):(p.sizeHint=p.size+f,u-=f)}for(var m=n,v=t+1,g=e.length;v<g&&m>0;++v){var b=e[v],y=b.size-b.minSize;y>=m?(b.sizeHint=b.size-m,m=0):(b.sizeHint=b.size-y,m-=y)}}(e,t,n):function(e,t,n){for(var r=0,o=t+1,a=e.length;o<a;++o){var s=e[o];r+=s.maxSize-s.size}for(var l=0,c=0;c<=t;++c){var d=e[c];l+=d.size-d.minSize}for(var u=n=Math.min(n,r,l),h=t+1,p=e.length;h<p&&u>0;++h){var f=e[h],m=f.maxSize-f.size;m>=u?(f.sizeHint=f.size+u,u=0):(f.sizeHint=f.size+m,u-=m)}for(var v=n,g=t;g>=0&&v>0;--g){var b=e[g],y=b.size-b.minSize;y>=v?(b.sizeHint=b.size-v,v=0):(b.sizeHint=b.size-y,v-=y)}}(e,t,-n)};class rv{get(e){var t,n=ec.ensureMap(e);return t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e)}set(e,t){var n,r=ec.ensureMap(e);n=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(e);var o=this._coerceValue(e,t);this._maybeNotify(e,n,r[this._pid]=o)}coerce(e){var t,n=ec.ensureMap(e);t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);var r=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=r)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){var n=this._coerce;return n?n(e,t):t}_compareValue(e,t){var n=this._compare;return n?n(e,t):e===t}_maybeNotify(e,t,n){var r=this._changed;r&&!this._compareValue(t,n)&&r(e,t,n)}constructor(e){this._pid=ec.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}}(rv||(rv={})).clearData=function(e){ec.ownerData.delete(e)},(s=ec||(ec={})).ownerData=new WeakMap,s.nextPID=(l=0,()=>{var e=Math.random(),t="".concat(e).slice(2);return"pid-".concat(t,"-").concat(l++)}),s.ensureMap=function(e){var t=s.ownerData.get(e);return t?t:(t=Object.create(null),s.ownerData.set(e,t),t)};class rg{get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){for(var e=this._first;e;)yield e.value,e=e.next}*retro(){for(var e=this._last;e;)yield e.value,e=e.prev}*nodes(){for(var e=this._first;e;)yield e,e=e.next}*retroNodes(){for(var e=this._last;e;)yield e,e=e.prev}assign(e){for(var t of(this.clear(),e))this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){var t=new ed.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){var t=new ed.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t):this._first=t,this._last=t,this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof ed.LinkedListNode)||t.list!==this)throw Error("Reference node is not owned by the list.");var n=new ed.LinkedListNode(this,e),r=t.prev;return n.next=t,n.prev=r,t.prev=n,r.next=n,this._size++,n}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof ed.LinkedListNode)||t.list!==this)throw Error("Reference node is not owned by the list.");var n=new ed.LinkedListNode(this,e),r=t.next;return n.next=r,n.prev=t,t.next=n,r.prev=n,this._size++,n}removeFirst(){var e=this._first;if(!!e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){var e=this._last;if(!!e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof ed.LinkedListNode)||e.list!==this)throw Error("Node is not owned by the list.");e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--}clear(){for(var e=this._first;e;){var{next:t}=e;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}constructor(){this._first=null,this._last=null,this._size=0}}function*rb(){}function ry(e,t){var n=0;for(var r of e)if(t(r,n++))return r}(c=rg||(rg={})).from=function(e){var t=new c;return t.assign(e),t},(ed||(ed={})).LinkedListNode=class e{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}},!function(e){function t(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=e.length;if(0===a)return -1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),n=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))<r?o+1+(a-r):o-r+1;for(var s=0;s<n;++s){var l=(r+s)%a;if(e[l]===t)return l}return -1}function n(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.length;if(0===a)return -1;n=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(o=o<0?Math.max(0,o+a):Math.min(o,a-1))?r+1+(a-o):r-o+1;for(var s=0;s<n;++s){var l=(r-s+a)%a;if(e[l]===t)return l}return -1}function r(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=e.length;if(0===a)return -1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),n=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))<r?o+1+(a-r):o-r+1;for(var s=0;s<n;++s){var l=(r+s)%a;if(t(e[l],l))return l}return -1}function o(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=e.length;if(0===a)return -1;n=(r=r<0?Math.max(0,r+a):Math.min(r,a-1))<(o=o<0?Math.max(0,o+a):Math.min(o,a-1))?r+1+(a-o):r-o+1;for(var s=0;s<n;++s){var l=(r-s+a)%a;if(t(e[l],l))return l}return -1}e.firstIndexOf=t,e.lastIndexOf=n,e.findFirstIndex=r,e.findLastIndex=o;e.findFirstValue=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=r(e,t,n,o);return -1!==a?e[a]:void 0};e.findLastValue=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=o(e,t,n,r);return -1!==a?e[a]:void 0};e.lowerBound=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.length;if(0===a)return 0;for(var s=r=r<0?Math.max(0,r+a):Math.min(r,a-1),l=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))-r+1;l>0;){var c=l>>1,d=s+c;0>n(e[d],t)?(s=d+1,l-=c+1):l=c}return s};e.upperBound=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.length;if(0===a)return 0;for(var s=r=r<0?Math.max(0,r+a):Math.min(r,a-1),l=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))-r+1;l>0;){var c=l>>1,d=s+c;n(e[d],t)>0?l=c:(s=d+1,l-=c+1)}return s};e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(var r=0,o=e.length;r<o;++r)if(n?!n(e[r],t[r]):e[r]!==t[r])return!1;return!0};e.slice=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{start:r,stop:o,step:a}=n;if(void 0===a&&(a=1),0===a)throw Error("Slice `step` cannot be zero.");var s=e.length;void 0===r?r=a<0?s-1:0:r<0?r=Math.max(r+s,a<0?-1:0):r>=s&&(r=a<0?s-1:s),void 0===o?o=a<0?-1:s:o<0?o=Math.max(o+s,a<0?-1:0):o>=s&&(o=a<0?s-1:s),t=a<0&&o>=r||a>0&&r>=o?0:a<0?Math.floor((o-r+1)/a+1):Math.floor((o-r-1)/a+1);for(var l=[],c=0;c<t;++c)l[c]=e[r+c*a];return l};function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=e.length;if(!(r<=1))for(t=t<0?Math.max(0,t+r):Math.min(t,r-1),n=n<0?Math.max(0,n+r):Math.min(n,r-1);t<n;){var o=e[t],a=e[n];e[t++]=a,e[n--]=o}}e.move=function(e,t,n){var r=e.length;if(!(r<=1)&&(t=t<0?Math.max(0,t+r):Math.min(t,r-1))!==(n=n<0?Math.max(0,n+r):Math.min(n,r-1))){for(var o=e[t],a=t<n?1:-1,s=t;s!==n;s+=a)e[s]=e[s+a];e[n]=o}},e.reverse=a;e.rotate=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=e.length;if(o<=1||(n=n<0?Math.max(0,n+o):Math.min(n,o-1))>=(r=r<0?Math.max(0,r+o):Math.min(r,o-1)))return;var s=r-n+1;if(t>0?t%=s:t<0&&(t=(t%s+s)%s),0!==t){var l=n+t;a(e,n,l-1),a(e,l,r),a(e,n,r)}};e.fill=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=e.length;if(0!==a){r=r<0?Math.max(0,r+a):Math.min(r,a-1),n=(o=o<0?Math.max(0,o+a):Math.min(o,a-1))<r?o+1+(a-r):o-r+1;for(var s=0;s<n;++s)e[(r+s)%a]=t}};function s(e,t){var n=e.length;if(t<0&&(t+=n),!(t<0)&&!(t>=n)){for(var r=e[t],o=t+1;o<n;++o)e[o-1]=e[o];return e.length=n-1,r}}e.insert=function(e,t,n){var r=e.length;t=t<0?Math.max(0,t+r):Math.min(t,r);for(var o=r;o>t;--o)e[o]=e[o-1];e[t]=n},e.removeAt=s;e.removeFirstOf=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=t(e,n,r,o);return -1!==a&&s(e,a),a};e.removeLastOf=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=n(e,t,r,o);return -1!==a&&s(e,a),a};e.removeAllOf=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);for(var a=0,s=0;s<o;++s)n<=r&&s>=n&&s<=r&&e[s]===t?a++:r<n&&(s<=r||s>=n)&&e[s]===t?a++:a>0&&(e[s-a]=e[s]);return a>0&&(e.length=o-a),a};e.removeFirstWhere=function(e,t){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,l=r(e,t,o,a);return -1!==l&&(n=s(e,l)),{index:l,value:n}};e.removeLastWhere=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=o(e,t,r,a);return -1!==l&&(n=s(e,l)),{index:l,value:n}};e.removeAllWhere=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);for(var a=0,s=0;s<o;++s)n<=r&&s>=n&&s<=r&&t(e[s],s)?a++:r<n&&(s<=r||s>=n)&&t(e[s],s)?a++:a>0&&(e[s-a]=e[s]);return a>0&&(e.length=o-a),a}}(eu||(eu={}));(eh||(eh={})).rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||e<t&&n<0?0:Math.ceil((t-e)/n)};!function(e){function t(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Array(t.length),o=0,a=n,s=t.length;o<s;++o,++a){if(-1===(a=e.indexOf(t[o],a)))return null;r[o]=a}return r}e.findIndices=t;e.matchSumOfSquares=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t(e,n,r);if(!o)return null;for(var a=0,s=0,l=o.length;s<l;++s){var c=o[s]-r;a+=c*c}return{score:a,indices:o}};e.matchSumOfDeltas=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t(e,n,r);if(!o)return null;for(var a=0,s=r-1,l=0,c=o.length;l<c;++l){var d=o[l];a+=d-s-1,s=d}return{score:a,indices:o}};e.highlight=function(e,t,n){for(var r=[],o=0,a=0,s=t.length;o<s;){for(var l=t[o],c=t[o];++o<s&&t[o]===c+1;)c++;a<l&&r.push(e.slice(a,l)),l<c+1&&r.push(n(e.slice(l,c+1))),a=c+1}return a<e.length&&r.push(e.slice(a)),r};e.cmp=function(e,t){return e<t?-1:e>t?1:0}}(ep||(ep={}));class r_{get isConflatable(){return!1}conflate(e){return!1}constructor(e){this.type=e}}class rw extends r_{get isConflatable(){return!0}conflate(e){return!0}}function rx(e,t){this.v=e,this.k=t}!function(e){let t;var n=null;var r=(t=Promise.resolve(),e=>{var n=!1;return t.then(()=>!n&&e()),()=>{n=!0}});function o(e,t){var n=s.get(e);if(!n||0===n.length){u(e,t);return}(function(e,t){var n=0;for(var r of e)if(!1===t(r,n++))return!1;return!0})(function*(e){if("function"==typeof e.retro)yield*e.retro();else for(var t=e.length-1;t>-1;t--)yield e[t]}(n),n=>!n||function(e,t,n){var r=!0;try{r="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){c(e)}return r}(n,e,t))&&u(e,t)}e.sendMessage=o;e.postMessage=function(e,t){if(!t.isConflatable){h(e,t);return}!function(e,t){var n=0;for(var r of e)if(t(r,n++))return!0;return!1}(a,n=>n.handler===e&&!!n.msg&&n.msg.type===t.type&&!!n.msg.isConflatable&&n.msg.conflate(t))&&h(e,t)};e.installMessageHook=function(e,t){var n=s.get(e);if(!n||-1===n.indexOf(t))n?n.push(t):s.set(e,[t])};e.removeMessageHook=function(e,t){var n=s.get(e);if(!n)return;var r=n.indexOf(t);if(-1!==r)n[r]=null,f(n)};e.clearData=function(e){var t=s.get(e);for(var n of(t&&t.length>0&&(eu.fill(t,null),f(t)),a))n.handler===e&&(n.handler=null,n.msg=null)};e.flush=function(){if(!d&&null!==n)n(),n=null,d=!0,p(),d=!1};e.getExceptionHandler=function(){return c};e.setExceptionHandler=function(e){var t=c;return c=e,t};var a=new rg,s=new WeakMap,l=new Set,c=e=>{console.error(e)},d=!1;function u(e,t){try{e.processMessage(t)}catch(e){c(e)}}function h(e,t){if(a.addLast({handler:e,msg:t}),null===n)n=r(p)}function p(){if(n=null,!a.isEmpty){var e={handler:null,msg:null};for(a.addLast(e);;){var t=a.removeFirst();if(t===e)return;t.handler&&t.msg&&o(t.handler,t.msg)}}}function f(e){0===l.size&&r(m),l.add(e)}function m(){l.forEach(v),l.clear()}function v(e){eu.removeAllWhere(e,g)}function g(e){return null===e}}(ef||(ef={})),(em||(em={})).copyText=function(e){var{body:t}=document,n=r=>{r.preventDefault(),r.stopPropagation(),r.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")},(d=ev||(ev={})).boxSizing=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,r=parseFloat(t.borderLeftWidth)||0,o=parseFloat(t.borderRightWidth)||0,a=parseFloat(t.borderBottomWidth)||0,s=parseFloat(t.paddingTop)||0,l=parseFloat(t.paddingLeft)||0,c=parseFloat(t.paddingRight)||0,d=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:r,borderRight:o,borderBottom:a,paddingTop:s,paddingLeft:l,paddingRight:c,paddingBottom:d,horizontalSum:r+l+c+o,verticalSum:n+s+d+a}},d.sizeLimits=function(e){var t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,r=parseFloat(t.minHeight)||0,o=parseFloat(t.maxWidth)||1/0,a=parseFloat(t.maxHeight)||1/0;return o=Math.max(n,o),a=Math.max(r,a),{minWidth:n,minHeight:r,maxWidth:o,maxHeight:a}},d.hitTest=function(e,t,n){var r=e.getBoundingClientRect();return t>=r.left&&t<r.right&&n>=r.top&&n<r.bottom},d.scrollIntoViewIfNeeded=function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(!(r.top<=n.top)||!(r.bottom>=n.bottom)){if(r.top<n.top&&r.height<=n.height||r.bottom>n.bottom&&r.height>=n.height){e.scrollTop-=n.top-r.top;return}if(r.top<n.top&&r.height>n.height||r.bottom>n.bottom&&r.height<n.height){e.scrollTop-=n.bottom-r.bottom;return}}},(u=eg||(eg={})).IS_MAC=!!navigator.platform.match(/Mac/i),u.IS_WIN=!!navigator.platform.match(/Win/i),u.IS_IE=/Trident/.test(navigator.userAgent),u.IS_EDGE=/Edge/.test(navigator.userAgent),u.accelKey=function(e){return u.IS_MAC?e.metaKey:e.ctrlKey},(h=ey||(ey={})).calculateSpecificity=function(e){if(e in eb.specificityCache)return eb.specificityCache[e];var t=eb.calculateSingle(e);return eb.specificityCache[e]=t},h.isValid=function(e){if(e in eb.validityCache)return eb.validityCache[e];var t=!0;try{eb.testElem.querySelector(e)}catch(e){t=!1}return eb.validityCache[e]=t},h.matches=function(e,t){return eb.protoMatchFunc.call(e,t)},(p=eb||(eb={})).specificityCache=Object.create(null),p.validityCache=Object.create(null),p.testElem=document.createElement("div"),p.protoMatchFunc=(f=Element.prototype).matches||f.matchesSelector||f.mozMatchesSelector||f.msMatchesSelector||f.oMatchesSelector||f.webkitMatchesSelector||function(e){var t=this.ownerDocument?this.ownerDocument.querySelectorAll(e):[];return -1!==Array.prototype.indexOf.call(t,this)},p.calculateSingle=function(e){e=e.split(",",1)[0];var t=0,n=0,r=0;function o(t){var n=e.match(t);return null!==n&&(e=e.slice(n[0].length),!0)}for(e=e.replace(x," $1 ");e.length>0;){if(o(m)){t++;continue}if(o(v)||o(g)){n++;continue}if(o(y)){r++;continue}if(o(_)){n++;continue}if(o(b)){r++;continue}if(!o(w))return 0}return(t=Math.min(t,255))<<16|(n=Math.min(n,255))<<8|(r=Math.min(r,255))},m=/^#[^\s\+>~#\.\[:]+/,v=/^\.[^\s\+>~#\.\[:]+/,g=/^\[[^\]]+\]/,b=/^[^\s\+>~#\.\[:]+/,y=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,_=/^:[^\s\+>~#\.\[:]+/,w=/^[\s\+>~\*]+/,x=/:not\(([^\)]+)\)/g;function rS(e){var t,n;function r(t,n){try{var a=e[t](n),s=a.value,l=s instanceof rx;Promise.resolve(l?s.v:s).then(function(n){if(l){var c="return"===t?"return":"next";if(!s.k||n.done)return r(c,n);n=e[c](n).value}o(a.done?"return":"normal",n)},function(e){r("throw",e)})}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(a,s){var l={key:e,arg:o,resolve:a,reject:s,next:null};n?n=n.next=l:(t=n=l,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}rS.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},rS.prototype.next=function(e){return this._invoke("next",e)},rS.prototype.throw=function(e){return this._invoke("throw",e)},rS.prototype.return=function(e){return this._invoke("return",e)};!function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function n(e){return Array.isArray(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=n;function r(e,o){if(e===o)return!0;if(t(e)||t(o))return!1;var a=n(e),s=n(o);return a===s&&(a&&s?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;++n)if(!r(e[n],t[n]))return!1;return!0}(e,o):function(e,t){if(e===t)return!0;for(var n in e)if(void 0!==e[n]&&!(n in t))return!1;for(var o in t)if(void 0!==t[o]&&!(o in e))return!1;for(var a in e){var s=e[a],l=t[a];if(void 0!==s||void 0!==l){if(void 0===s||void 0===l||!r(s,l))return!1}}return!0}(e,o))}function o(e){return t(e)?e:n(e)?function(e){for(var t=Array(e.length),n=0,r=e.length;n<r;++n)t[n]=o(e[n]);return t}(e):function(e){var t={};for(var n in e){var r=e[n];if(void 0!==r)t[n]=o(r)}return t}(e)}e.isObject=function(e){return!t(e)&&!n(e)},e.deepEqual=r,e.deepCopy=o}(e_||(e_={}));class rk{types(){return this._types.slice()}hasData(e){return -1!==this._types.indexOf(e)}getData(e){var t=this._types.indexOf(e);return -1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){var t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}constructor(){this._types=[],this._values=[]}}class rC{resolve(e){(0,this._resolve)(e)}reject(e){(0,this._reject)(e)}constructor(){this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}}function rj(e){for(var t=0,n=0,r=e.length;n<r;++n)n%4==0&&(t=0xffffffff*Math.random()>>>0),e[n]=255&t,t>>>=8}(ew||(ew={})).getRandomValues=(S="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null)&&"function"==typeof S.getRandomValues?function(e){return S.getRandomValues(e)}:rj;(ex||(ex={})).uuid4=function(e){for(var t=new Uint8Array(16),n=Array(256),r=0;r<16;++r)n[r]="0".concat(r.toString(16));for(var o=16;o<256;++o)n[o]=o.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],"".concat(n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]],"-").concat(n[t[4]]).concat(n[t[5]],"-").concat(n[t[6]]).concat(n[t[7]],"-").concat(n[t[8]]).concat(n[t[9]],"-").concat(n[t[10]]).concat(n[t[11]]).concat(n[t[12]]).concat(n[t[13]]).concat(n[t[14]]).concat(n[t[15]])}}(ew.getRandomValues);class rE{connect(e,t){return eS.connect(this,e,t)}disconnect(e,t){return eS.disconnect(this,e,t)}emit(e){eS.emit(this,e)}constructor(e){this.sender=e}}(k=rE||(rE={})).disconnectBetween=function(e,t){eS.disconnectBetween(e,t)},k.disconnectSender=function(e){eS.disconnectSender(e)},k.disconnectReceiver=function(e){eS.disconnectReceiver(e)},k.disconnectAll=function(e){eS.disconnectAll(e)},k.clearData=function(e){eS.disconnectAll(e)},k.getExceptionHandler=function(){return eS.exceptionHandler},k.setExceptionHandler=function(e){var t=eS.exceptionHandler;return eS.exceptionHandler=e,t},Symbol.asyncIterator,!function(e){e.exceptionHandler=e=>{console.error(e)};e.connect=function(e,t,n){n=n||void 0;var a=r.get(e.sender);if(!a&&(a=[],r.set(e.sender,a)),l(a,e,t,n))return!1;var s=n||t,c=o.get(s);!c&&(c=[],o.set(s,c));var d={signal:e,slot:t,thisArg:n};return a.push(d),c.push(d),!0};e.disconnect=function(e,t,n){n=n||void 0;var a=r.get(e.sender);if(!a||0===a.length)return!1;var s=l(a,e,t,n);if(!s)return!1;var d=n||t,u=o.get(d);return s.signal=null,c(a),c(u),!0};function t(e){var t=r.get(e);if(!!t&&0!==t.length){for(var n of t){if(!!n.signal){var a=n.thisArg||n.slot;n.signal=null,c(o.get(a))}}c(t)}}function n(e){var t=o.get(e);if(!!t&&0!==t.length){for(var n of t){if(!!n.signal){var{sender:a}=n.signal;n.signal=null,c(r.get(a))}}c(t)}}e.disconnectBetween=function(e,t){var n=r.get(e);if(!n||0===n.length)return;var a=o.get(t);if(!!a&&0!==a.length){for(var s of a){if(!!s.signal)s.signal.sender===e&&(s.signal=null)}c(n),c(a)}},e.disconnectSender=t,e.disconnectReceiver=n;e.disconnectAll=function(e){t(e),n(e)};e.emit=function(t,n){var o=r.get(t.sender);if(!!o&&0!==o.length)for(var a=0,s=o.length;a<s;++a){var l=o[a];l.signal===t&&function(t,n){var{signal:r,slot:o,thisArg:a}=t;try{o.call(a,r.sender,n)}catch(t){e.exceptionHandler(t)}}(l,n)}};var r=new WeakMap,o=new WeakMap,a=new Set,s="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function l(e,t,n,r){return ry(e,e=>e.signal===t&&e.slot===n&&e.thisArg===r)}function c(e){0===a.size&&s(d),a.add(e)}function d(){a.forEach(u),a.clear()}function u(e){eu.removeAllWhere(e,h)}function h(e){return null===e.signal}}(eS||(eS={}));class rT{get changed(){return this._changed}get label(){return this._label}set label(e){if(this._label!==e)this._label=e,this._changed.emit(void 0)}get mnemonic(){return this._mnemonic}set mnemonic(e){if(this._mnemonic!==e)this._mnemonic=e,this._changed.emit(void 0)}get icon(){return this._icon}set icon(e){if(this._icon!==e)this._icon=e,this._changed.emit(void 0)}get iconClass(){return this._iconClass}set iconClass(e){if(this._iconClass!==e)this._iconClass=e,this._changed.emit(void 0)}get iconLabel(){return this._iconLabel}set iconLabel(e){if(this._iconLabel!==e)this._iconLabel=e,this._changed.emit(void 0)}get caption(){return this._caption}set caption(e){if(this._caption!==e)this._caption=e,this._changed.emit(void 0)}get className(){return this._className}set className(e){if(this._className!==e)this._className=e,this._changed.emit(void 0)}get closable(){return this._closable}set closable(e){if(this._closable!==e)this._closable=e,this._changed.emit(void 0)}get dataset(){return this._dataset}set dataset(e){if(this._dataset!==e)this._dataset=e,this._changed.emit(void 0)}get isDisposed(){return this._isDisposed}dispose(){if(!this.isDisposed)this._isDisposed=!0,rE.clearData(this)}constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new rE(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}}class rI{dispose(){if(!this.isDisposed)this.setFlag(rI.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&rI.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),rE.clearData(this),ef.clearData(this),rv.clearData(this)}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(rI.Flag.IsDisposed)}get isAttached(){return this.testFlag(rI.Flag.IsAttached)}get isHidden(){return this.testFlag(rI.Flag.IsHidden)}get isVisible(){return this.testFlag(rI.Flag.IsVisible)}get title(){return ek.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e)this.isHidden&&this._toggleHidden(!1),e==rI.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0)}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var t=new rI.ChildMessage("child-removed",this);ef.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){var n=new rI.ChildMessage("child-added",this);ef.sendMessage(this._parent,n)}!this.isDisposed&&ef.sendMessage(this,rI.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(rI.Flag.DisallowLayout))throw Error("Cannot set widget layout.");if(this._layout)throw Error("Cannot change widget layout.");if(e.parent)throw Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(var t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){ef.postMessage(this,rI.Msg.UpdateRequest)}fit(){ef.postMessage(this,rI.Msg.FitRequest)}activate(){ef.postMessage(this,rI.Msg.ActivateRequest)}close(){ef.sendMessage(this,rI.Msg.CloseRequest)}show(){if(!!this.testFlag(rI.Flag.IsHidden)){if(this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.BeforeShow),this.clearFlag(rI.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.AfterShow),this.parent){var e=new rI.ChildMessage("child-shown",this);ef.sendMessage(this.parent,e)}}}hide(){if(!this.testFlag(rI.Flag.IsHidden)){if(this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.BeforeHide),this.setFlag(rI.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&ef.sendMessage(this,rI.Msg.AfterHide),this.parent){var e=new rI.ChildMessage("child-hidden",this);ef.sendMessage(this.parent,e)}}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!=0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(rI.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(rI.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(rI.Flag.IsVisible),this.setFlag(rI.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(rI.Flag.IsVisible),this.clearFlag(rI.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&rI.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case rI.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case rI.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case rI.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case rI.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case rI.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case rI.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new rE(this),this._hiddenMode=rI.HiddenMode.Display,this.node=ek.createNode(e),this.addClass("lm-Widget")}}(j=(C=rI||(rI={})).HiddenMode||(C.HiddenMode={}))[j.Display=0]="Display",j[j.Scale=1]="Scale",j[j.ContentVisibility=2]="ContentVisibility",(E=C.Flag||(C.Flag={}))[E.IsDisposed=1]="IsDisposed",E[E.IsAttached=2]="IsAttached",E[E.IsHidden=4]="IsHidden",E[E.IsVisible=8]="IsVisible",E[E.DisallowLayout=16]="DisallowLayout",(T=C.Msg||(C.Msg={})).BeforeShow=new r_("before-show"),T.AfterShow=new r_("after-show"),T.BeforeHide=new r_("before-hide"),T.AfterHide=new r_("after-hide"),T.BeforeAttach=new r_("before-attach"),T.AfterAttach=new r_("after-attach"),T.BeforeDetach=new r_("before-detach"),T.AfterDetach=new r_("after-detach"),T.ParentChanged=new r_("parent-changed"),T.UpdateRequest=new rw("update-request"),T.FitRequest=new rw("fit-request"),T.ActivateRequest=new rw("activate-request"),T.CloseRequest=new rw("close-request"),C.ChildMessage=class e extends r_{constructor(e,t){super(e),this.child=t}},C.ResizeMessage=class e extends r_{constructor(e,t){super("resize"),this.width=e,this.height=t}},(C.ResizeMessage||(C.ResizeMessage={})).UnknownSize=new C.ResizeMessage(-1,-1),C.attach=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e.parent)throw Error("Cannot attach a child widget.");if(e.isAttached||e.node.isConnected)throw Error("Widget is already attached.");if(!t.isConnected)throw Error("Host is not attached.");ef.sendMessage(e,C.Msg.BeforeAttach),t.insertBefore(e.node,n),ef.sendMessage(e,C.Msg.AfterAttach)},C.detach=function(e){if(e.parent)throw Error("Cannot detach a child widget.");if(!e.isAttached||!e.node.isConnected)throw Error("Widget is not attached.");ef.sendMessage(e,C.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),ef.sendMessage(e,C.Msg.AfterDetach)},(I=ek||(ek={})).titleProperty=new rv({name:"title",create:e=>new rT({owner:e})}),I.createNode=function(e){return e.node||document.createElement(e.tag||"div")},(eC||(eC={})).clampDimension=function(e){return Math.max(0,Math.floor(e))};var rP=eC;class rM{dispose(){this._parent=null,this._disposed=!0,rE.clearData(this),rv.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw Error("Cannot change parent widget.");if(e.layout!==this)throw Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e){if(this._fitPolicy=e,this._parent){var{style:t}=this._parent.node;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(var e of this)e.parent=this.parent}onResize(e){for(var t of this)ef.sendMessage(t,rI.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(var t of this)ef.sendMessage(t,rI.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(var t of this)ef.sendMessage(t,e)}onAfterAttach(e){for(var t of this)ef.sendMessage(t,e)}onBeforeDetach(e){for(var t of this)ef.sendMessage(t,e)}onAfterDetach(e){for(var t of this)ef.sendMessage(t,e)}onBeforeShow(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onAfterShow(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onBeforeHide(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onAfterHide(e){for(var t of this)!t.isHidden&&ef.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}}(P=rM||(rM={})).getHorizontalAlignment=function(e){return ej.horizontalAlignmentProperty.get(e)},P.setHorizontalAlignment=function(e,t){ej.horizontalAlignmentProperty.set(e,t)},P.getVerticalAlignment=function(e){return ej.verticalAlignmentProperty.get(e)},P.setVerticalAlignment=function(e,t){ej.verticalAlignmentProperty.set(e,t)};class rR{dispose(){if(!this._disposed){this._disposed=!0;var{style:e}=this.widget.node;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){var e=ev.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,n,r){var o=Math.max(this._minWidth,Math.min(n,this._maxWidth)),a=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(o<n)switch(rM.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(n-o)/2;break;case"right":e+=n-o;break;default:throw"unreachable"}if(a<r)switch(rM.getVerticalAlignment(this.widget)){case"top":break;case"center":t+=(r-a)/2;break;case"bottom":t+=r-a;break;default:throw"unreachable"}var s=!1,{style:l}=this.widget.node;if(this._top!==t&&(this._top=t,l.top="".concat(t,"px")),this._left!==e&&(this._left=e,l.left="".concat(e,"px")),this._width!==o&&(s=!0,this._width=o,l.width="".concat(o,"px")),this._height!==a&&(s=!0,this._height=a,l.height="".concat(a,"px")),s){var c=new rI.ResizeMessage(o,a);ef.sendMessage(this.widget,c)}}constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}}!function(e){function t(e){e.parent&&e.parent.layout&&e.parent.update()}e.horizontalAlignmentProperty=new rv({name:"horizontalAlignment",create:()=>"center",changed:t}),e.verticalAlignmentProperty=new rv({name:"verticalAlignment",create:()=>"top",changed:t})}(ej||(ej={}));class rD extends rM{dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;var n=this._widgets.indexOf(t),r=Math.max(0,Math.min(e,this._widgets.length));if(-1===n){eu.insert(this._widgets,r,t),this.parent&&this.attachWidget(r,t);return}if(r===this._widgets.length&&r--,n!==r)eu.move(this._widgets,n,r),this.parent&&this.moveWidget(n,r,t)}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){var t=eu.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();var e=0;for(var t of this)this.attachWidget(e++,t)}attachWidget(e,t){var n=this.parent.node.children[e];this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,n),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach)}moveWidget(e,t,n){this.parent.isAttached&&ef.sendMessage(n,rI.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&ef.sendMessage(n,rI.Msg.AfterDetach);var r=this.parent.node.children[t];this.parent.isAttached&&ef.sendMessage(n,rI.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,r),this.parent.isAttached&&ef.sendMessage(n,rI.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach)}constructor(...e){super(...e),this._widgets=[]}}class rA extends rD{dispose(){for(var e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){if(this._direction===e)return;if(this._direction=e,!!this.parent)this.parent.dataset.direction=e,this.parent.fit()}get alignment(){return this._alignment}set alignment(e){if(this._alignment===e)return;if(this._alignment=e,!!this.parent)this.parent.dataset.alignment=e,this.parent.update()}get spacing(){return this._spacing}set spacing(e){if(e=rP.clampDimension(e),this._spacing===e)return;if(this._spacing=e,!!this.parent)this.parent.fit()}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){eu.insert(this._items,e,new rR(t)),eu.insert(this._sizers,e,new rm),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){eu.move(this._items,e,t),eu.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){var n=eu.removeAt(this._items,e);eu.removeAt(this._sizers,e),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(var e=0,t=0,n=this._items.length;t<n;++t)e+=+!this._items[t].isHidden;this._fixed=this._spacing*Math.max(0,e-1);for(var r=eE.isHorizontal(this._direction),o=r?this._fixed:0,a=r?0:this._fixed,s=0,l=this._items.length;s<l;++s){var c=this._items[s],d=this._sizers[s];if(c.isHidden){d.minSize=0,d.maxSize=0;continue}c.fit(),d.sizeHint=rA.getSizeBasis(c.widget),d.stretch=rA.getStretch(c.widget),r?(d.minSize=c.minWidth,d.maxSize=c.maxWidth,o+=c.minWidth,a=Math.max(a,c.minHeight)):(d.minSize=c.minHeight,d.maxSize=c.maxHeight,a+=c.minHeight,o=Math.max(o,c.minWidth))}var u=this._box=ev.boxSizing(this.parent.node);o+=u.horizontalSum,a+=u.verticalSum;var{style:h}=this.parent.node;h.minWidth="".concat(o,"px"),h.minHeight="".concat(a,"px"),this._dirty=!0,this.parent.parent&&ef.sendMessage(this.parent.parent,rI.Msg.FitRequest),this._dirty&&ef.sendMessage(this.parent,rI.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;for(var n,r=0,o=0,a=this._items.length;o<a;++o)r+=+!this._items[o].isHidden;if(0!==r){e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),!this._box&&(this._box=ev.boxSizing(this.parent.node));var s=this._box.paddingTop,l=this._box.paddingLeft,c=e-this._box.horizontalSum,d=t-this._box.verticalSum;switch(this._direction){case"left-to-right":n=el.calc(this._sizers,Math.max(0,c-this._fixed));break;case"top-to-bottom":n=el.calc(this._sizers,Math.max(0,d-this._fixed));break;case"right-to-left":n=el.calc(this._sizers,Math.max(0,c-this._fixed)),l+=c;break;case"bottom-to-top":n=el.calc(this._sizers,Math.max(0,d-this._fixed)),s+=d;break;default:throw"unreachable"}var u=0,h=0;if(n>0)switch(this._alignment){case"start":break;case"center":u=0,h=n/2;break;case"end":u=0,h=n;break;case"justify":u=n/r,h=0;break;default:throw"unreachable"}for(var p=0,f=this._items.length;p<f;++p){var m=this._items[p];if(!m.isHidden){var{size:v}=this._sizers[p];switch(this._direction){case"left-to-right":m.update(l+h,s,v+u,d),l+=v+u+this._spacing;break;case"top-to-bottom":m.update(l,s+h,c,v+u),s+=v+u+this._spacing;break;case"right-to-left":m.update(l-h-v-u,s,v+u,d),l-=v+u+this._spacing;break;case"bottom-to-top":m.update(l,s-h-v-u,c,v+u),s-=v+u+this._spacing;break;default:throw"unreachable"}}}}}constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==e.direction&&(this._direction=e.direction),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=rP.clampDimension(e.spacing))}}(M=rA||(rA={})).getStretch=function(e){return eE.stretchProperty.get(e)},M.setStretch=function(e,t){eE.stretchProperty.set(e,t)},M.getSizeBasis=function(e){return eE.sizeBasisProperty.get(e)},M.setSizeBasis=function(e,t){eE.sizeBasisProperty.set(e,t)},!function(e){e.stretchProperty=new rv({name:"stretch",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.sizeBasisProperty=new rv({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t});e.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e};function t(e){e.parent&&e.parent.layout instanceof rA&&e.parent.fit()}e.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(eE||(eE={}));class rN extends rI{get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=eT.createLayout(e)}}(eT||(eT={})).createLayout=function(e){return e.layout||new rD};class rL extends rN{get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}constructor(e={}){super({layout:eI.createLayout(e)}),this.addClass("lm-BoxPanel")}}(R=rL||(rL={})).getStretch=function(e){return rA.getStretch(e)},R.setStretch=function(e,t){rA.setStretch(e,t)},R.getSizeBasis=function(e){return rA.getSizeBasis(e)},R.setSizeBasis=function(e,t){rA.setSizeBasis(e,t)},(eI||(eI={})).createLayout=function(e){return e.layout||new rA(e)};class rz{constructor(e){this.type="text",this.content=e}}class rO{constructor(e,t,n,r){this.type="element",this.tag=e,this.attrs=t,this.children=n,this.renderer=r}}class rB extends rO{constructor(e,t,n){super(e,t,[],n||void 0)}}function rW(e){for(var t,n={},r=[],o=1,a=arguments.length;o<a;++o){var s=arguments[o];"string"==typeof s?r.push(new rz(s)):s instanceof rz?r.push(s):s instanceof rO?r.push(s):s instanceof Array?function(e,t){for(var n of t)"string"==typeof n?e.push(new rz(n)):n instanceof rz?e.push(n):n instanceof rO&&e.push(n)}(r,s):(1===o||2===o)&&s&&"object"==typeof s&&("render"in s?t=s:n=s)}return new rO(e,n,r,t)}function rF(e){var t={},n=null;if(2==arguments.length){var r=arguments[1];"render"in r?n=r:t=r}else if(3==arguments.length)t=arguments[1],n=arguments[2];else if(arguments.length>3)throw Error("hpass() should be called with 1, 2, or 3 arguments");return new rB(e,t,n)}(D=rW||(rW={})).a=D.bind(void 0,"a"),D.abbr=D.bind(void 0,"abbr"),D.address=D.bind(void 0,"address"),D.area=D.bind(void 0,"area"),D.article=D.bind(void 0,"article"),D.aside=D.bind(void 0,"aside"),D.audio=D.bind(void 0,"audio"),D.b=D.bind(void 0,"b"),D.bdi=D.bind(void 0,"bdi"),D.bdo=D.bind(void 0,"bdo"),D.blockquote=D.bind(void 0,"blockquote"),D.br=D.bind(void 0,"br"),D.button=D.bind(void 0,"button"),D.canvas=D.bind(void 0,"canvas"),D.caption=D.bind(void 0,"caption"),D.cite=D.bind(void 0,"cite"),D.code=D.bind(void 0,"code"),D.col=D.bind(void 0,"col"),D.colgroup=D.bind(void 0,"colgroup"),D.data=D.bind(void 0,"data"),D.datalist=D.bind(void 0,"datalist"),D.dd=D.bind(void 0,"dd"),D.del=D.bind(void 0,"del"),D.dfn=D.bind(void 0,"dfn"),D.div=D.bind(void 0,"div"),D.dl=D.bind(void 0,"dl"),D.dt=D.bind(void 0,"dt"),D.em=D.bind(void 0,"em"),D.embed=D.bind(void 0,"embed"),D.fieldset=D.bind(void 0,"fieldset"),D.figcaption=D.bind(void 0,"figcaption"),D.figure=D.bind(void 0,"figure"),D.footer=D.bind(void 0,"footer"),D.form=D.bind(void 0,"form"),D.h1=D.bind(void 0,"h1"),D.h2=D.bind(void 0,"h2"),D.h3=D.bind(void 0,"h3"),D.h4=D.bind(void 0,"h4"),D.h5=D.bind(void 0,"h5"),D.h6=D.bind(void 0,"h6"),D.header=D.bind(void 0,"header"),D.hr=D.bind(void 0,"hr"),D.i=D.bind(void 0,"i"),D.iframe=D.bind(void 0,"iframe"),D.img=D.bind(void 0,"img"),D.input=D.bind(void 0,"input"),D.ins=D.bind(void 0,"ins"),D.kbd=D.bind(void 0,"kbd"),D.label=D.bind(void 0,"label"),D.legend=D.bind(void 0,"legend"),D.li=D.bind(void 0,"li"),D.main=D.bind(void 0,"main"),D.map=D.bind(void 0,"map"),D.mark=D.bind(void 0,"mark"),D.meter=D.bind(void 0,"meter"),D.nav=D.bind(void 0,"nav"),D.noscript=D.bind(void 0,"noscript"),D.object=D.bind(void 0,"object"),D.ol=D.bind(void 0,"ol"),D.optgroup=D.bind(void 0,"optgroup"),D.option=D.bind(void 0,"option"),D.output=D.bind(void 0,"output"),D.p=D.bind(void 0,"p"),D.param=D.bind(void 0,"param"),D.pre=D.bind(void 0,"pre"),D.progress=D.bind(void 0,"progress"),D.q=D.bind(void 0,"q"),D.rp=D.bind(void 0,"rp"),D.rt=D.bind(void 0,"rt"),D.ruby=D.bind(void 0,"ruby"),D.s=D.bind(void 0,"s"),D.samp=D.bind(void 0,"samp"),D.section=D.bind(void 0,"section"),D.select=D.bind(void 0,"select"),D.small=D.bind(void 0,"small"),D.source=D.bind(void 0,"source"),D.span=D.bind(void 0,"span"),D.strong=D.bind(void 0,"strong"),D.sub=D.bind(void 0,"sub"),D.summary=D.bind(void 0,"summary"),D.sup=D.bind(void 0,"sup"),D.table=D.bind(void 0,"table"),D.tbody=D.bind(void 0,"tbody"),D.td=D.bind(void 0,"td"),D.textarea=D.bind(void 0,"textarea"),D.tfoot=D.bind(void 0,"tfoot"),D.th=D.bind(void 0,"th"),D.thead=D.bind(void 0,"thead"),D.time=D.bind(void 0,"time"),D.title=D.bind(void 0,"title"),D.tr=D.bind(void 0,"tr"),D.track=D.bind(void 0,"track"),D.u=D.bind(void 0,"u"),D.ul=D.bind(void 0,"ul"),D.var_=D.bind(void 0,"var"),D.video=D.bind(void 0,"video"),D.wbr=D.bind(void 0,"wbr"),(A=eM||(eM={})).realize=function(e){return eP.createDOMNode(e)},A.render=function(e,t){var n=eP.hostMap.get(t)||[],r=eP.asContentArray(e);eP.hostMap.set(t,r),eP.updateContent(t,n,r)},!function(e){e.hostMap=new WeakMap;function t(e){var r=arguments[1]||null,o=arguments[2]||null;if(r)r.insertBefore(t(e),o);else{if("text"===e.type)return document.createTextNode(e.content);if(function(e,t){for(var r in t){if(!(r in n))"on"===r.substr(0,2)?e[r]=t[r]:e.setAttribute(r,t[r])}void 0!==t.className&&e.setAttribute("class",t.className),void 0!==t.htmlFor&&e.setAttribute("for",t.htmlFor),t.dataset&&function(e,t){for(var n in t)e.setAttribute("data-".concat(n),t[n])}(e,t.dataset),t.style&&function(e,t){var n,r=e.style;for(n in t)r[n]=t[n]}(e,t.style)}(r=document.createElement(e.tag),e.attrs),e.renderer)return e.renderer.render(r,{attrs:e.attrs,children:e.children}),r;for(var a=0,s=e.children.length;a<s;++a)t(e.children[a],r)}return r}e.asContentArray=function(e){return e?e instanceof Array?e:[e]:[]},e.createDOMNode=t;e.updateContent=function e(r,o,a){if(o!==a){for(var s=function(e,t){var n=e.firstChild,r=Object.create(null);for(var o of t)"element"===o.type&&o.attrs.key&&(r[o.attrs.key]={vNode:o,element:n}),n=n.nextSibling;return r}(r,o),l=o.slice(),c=r.firstChild,d=a.length,u=0;u<d;++u){if(u>=l.length){t(a[u],r);continue}var h=l[u],p=a[u];if(h===p){c=c.nextSibling;continue}if("text"===h.type&&"text"===p.type){c.textContent!==p.content&&(c.textContent=p.content),c=c.nextSibling;continue}if("text"===h.type||"text"===p.type||!h.renderer!=!p.renderer){eu.insert(l,u,p),t(p,r,c);continue}var f=p.attrs.key;if(f&&f in s){var m=s[f];m.vNode!==h&&(eu.move(l,l.indexOf(m.vNode,u+1),u),r.insertBefore(m.element,c),h=m.vNode,c=m.element)}if(h===p){c=c.nextSibling;continue}var v=h.attrs.key;if(v&&v!==f||h.tag!==p.tag){eu.insert(l,u,p),t(p,r,c);continue}(function(e,t,r){var o;if(t!==r){for(o in t){if(!(o in n)&&!(o in r))"on"===o.substr(0,2)?e[o]=null:e.removeAttribute(o)}for(o in r){if(!(o in n)&&t[o]!==r[o])"on"===o.substr(0,2)?e[o]=r[o]:e.setAttribute(o,r[o])}t.className!==r.className&&(void 0!==r.className?e.setAttribute("class",r.className):e.removeAttribute("class")),t.htmlFor!==r.htmlFor&&(void 0!==r.htmlFor?e.setAttribute("for",r.htmlFor):e.removeAttribute("for")),t.dataset!==r.dataset&&function(e,t,n){for(var r in t)!(r in n)&&e.removeAttribute("data-".concat(r));for(var o in n)t[o]!==n[o]&&e.setAttribute("data-".concat(o),n[o])}(e,t.dataset||{},r.dataset||{}),t.style!==r.style&&function(e,t,n){var r,o=e.style;for(r in t)!(r in n)&&(o[r]="");for(r in n)t[r]!==n[r]&&(o[r]=n[r])}(e,t.style||{},r.style||{})}})(c,h.attrs,p.attrs),p.renderer?p.renderer.render(c,{attrs:p.attrs,children:p.children}):e(c,h.children,p.children),c=c.nextSibling}(function e(t,n,r,o){for(var a=n.length-1;a>=r;--a){var s=n[a],l=o?t.lastChild:t.childNodes[a];"text"===s.type||(s.renderer&&s.renderer.unrender?s.renderer.unrender(l,{attrs:s.attrs,children:s.children}):e(l,s.children,0,!1)),o&&t.removeChild(l)}})(r,l,d,!0)}};var n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0}}(eP||(eP={}));class rH{get isDisposed(){return!this._fn}dispose(){if(!!this._fn){var e=this._fn;this._fn=null,e()}}constructor(e){this._fn=e}}class rU{get isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed)this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear()}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}constructor(){this._isDisposed=!1,this._items=new Set}}(N=rU||(rU={})).from=function(e){var t=new N;for(var n of e)t.add(n);return t};class rV extends rU{get disposed(){return this._disposed}dispose(){if(!this.isDisposed)super.dispose(),this._disposed.emit(void 0),rE.clearData(this)}constructor(...e){super(...e),this._disposed=new rE(this)}}(L=rV||(rV={})).from=function(e){var t=new L;for(var n of e)t.add(n);return t};class rK{dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});eR.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(e=>{this._resolve=e});var n=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(n),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){if(!!this.dragImage){var{style:n}=this.dragImage;n.transform="translate(".concat(e,"px, ").concat(t,"px)")}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0===e.button){if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if("none"===this._dropAction){eR.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}var t=eR.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){var t=eR.findScrollTarget(e);if(!!this._scrollTarget||!!t)!this._scrollTarget&&setTimeout(this._onScrollFrame,500),this._scrollTarget=t}_updateCurrentTarget(e){var t=this._currentTarget,n=this._currentTarget,r=this._currentElement,o=eR.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==r&&o!==n&&eR.dispatchDragExit(this,n,o,e),o!==r&&o!==n&&(n=eR.dispatchDragEnter(this,o,n,e)),n!==t&&(this._currentTarget=n,eR.dispatchDragLeave(this,t,n,e));var a=eR.dispatchDragOver(this,n,e);this._setDropAction(a)}_attachDragImage(e,t){if(!!this.dragImage){this.dragImage.classList.add("lm-mod-drag-image");var{style:n}=this.dragImage;n.pointerEvents="none",n.position="fixed",n.transform="translate(".concat(e,"px, ").concat(t,"px)"),(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}}_detachDragImage(){if(!this.dragImage)return;var e=this.dragImage.parentNode;if(!!e)e.removeChild(this.dragImage)}_setDropAction(e){if(e=eR.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=rK.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=rK.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=rK.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=rK.overrideCursor("move",this.document)}}_finalize(e){var t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}constructor(e){this._onScrollFrame=()=>{if(!!this._scrollTarget){var{element:e,edge:t,distance:n}=this._scrollTarget,r=Math.max(1,Math.round(Math.pow((eR.SCROLL_EDGE_SIZE-n)/eR.SCROLL_EDGE_SIZE,2)*eR.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=r;break;case"left":e.scrollLeft-=r;break;case"right":e.scrollLeft+=r;break;case"bottom":e.scrollTop+=r}requestAnimationFrame(this._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null,eR.backdropTransform=e.backdropTransform}}!function(e){class t extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});var{drag:n}=t;this.dropAction="none",this.mimeData=n.mimeData,this.proposedAction=n.proposedAction,this.supportedActions=n.supportedActions,this.source=n.source}}e.Event=t;e.overrideCursor=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return eR.overrideCursor(e,t)}}(rK||(rK={})),!function(e){e.SCROLL_EDGE_SIZE=20;function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(t){if(r&&t==r.event)return r.element;e.cursorBackdrop.style.zIndex="-1000";var a=n.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",r={event:t,element:a},a}var{transform:s}=e.cursorBackdrop.style;if(o&&s===o.transform)return o.element;var l=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";var c=n.elementFromPoint(l.left+l.width/2,l.top+l.height/2);return e.cursorBackdrop.style.zIndex="",o={transform:s,element:c},c}e.validateAction=function(e,t){return a[e]&s[t]?e:"none"},e.findElementBehindBackdrop=t;var n,r=null,o=null;e.findScrollTarget=function(n){for(var r=n.clientX,o=n.clientY,a=t(n);a;a=a.parentElement){if(!a.hasAttribute("data-lm-dragscroll"))continue;var s=0,l=0;a===document.body&&(s=window.pageXOffset,l=window.pageYOffset);var c=a.getBoundingClientRect(),d=c.top+l,u=c.left+s,h=u+c.width,p=d+c.height;if(r<u||r>=h||o<d||o>=p)continue;var f=r-u+1,m=o-d+1,v=h-r,g=p-o,b=Math.min(f,m,v,g);if(b>e.SCROLL_EDGE_SIZE)continue;var y=void 0;switch(b){case g:y="bottom";break;case m:y="top";break;case v:y="right";break;case f:y="left";break;default:throw"unreachable"}var _=a.scrollWidth-a.clientWidth,w=a.scrollHeight-a.clientHeight,x=void 0;switch(y){case"top":x=w>0&&a.scrollTop>0;break;case"left":x=_>0&&a.scrollLeft>0;break;case"right":x=_>0&&a.scrollLeft<_;break;case"bottom":x=w>0&&a.scrollTop<w;break;default:throw"unreachable"}if(!!x)return{element:a,edge:y,distance:b}}return null};e.dispatchDragEnter=function(e,t,n,r){if(!t)return null;var o=new rK.Event(r,{drag:e,related:n,type:"lm-dragenter"});if(!t.dispatchEvent(o))return t;var a=e.document instanceof Document?e.document.body:e.document.firstElementChild;return t===a?n:(o=new rK.Event(r,{drag:e,related:n,type:"lm-dragenter"}),a.dispatchEvent(o),a)};e.dispatchDragExit=function(e,t,n,r){if(!!t){var o=new rK.Event(r,{drag:e,related:n,type:"lm-dragexit"});t.dispatchEvent(o)}};e.dispatchDragLeave=function(e,t,n,r){if(!!t){var o=new rK.Event(r,{drag:e,related:n,type:"lm-dragleave"});t.dispatchEvent(o)}};e.dispatchDragOver=function(e,t,n){if(!t)return"none";var r=new rK.Event(n,{drag:e,related:null,type:"lm-dragover"});return t.dispatchEvent(r)?"none":r.dropAction};e.dispatchDrop=function(e,t,n){if(!t)return"none";var r=new rK.Event(n,{drag:e,related:null,type:"lm-drop"});return t.dispatchEvent(r)?"none":r.dropAction};var a={none:0,copy:1,link:2,move:4},s={none:a.none,copy:a.copy,link:a.link,move:a.move,"copy-link":a.copy|a.link,"copy-move":a.copy|a.move,"link-move":a.link|a.move,all:a.copy|a.link|a.move};function l(t){if(!!e.cursorBackdrop){var n,r,o,a,s=(null===(r=e.backdropTransform)||void 0===r?void 0:null===(n=r.clientX)||void 0===n?void 0:n.call(r,t.clientX))||t.clientX,l=(null===(a=e.backdropTransform)||void 0===a?void 0:null===(o=a.clientY)||void 0===o?void 0:o.call(a,t.clientY))||t.clientY;e.cursorBackdrop.style.transform="translate(".concat(s,"px, ").concat(l,"px)")}}function c(n){if(!e.cursorBackdrop)return;var r=t();if(!r)return;var o=r.closest("[data-lm-dragscroll]");if(!!o)o.scrollTop+=e.cursorBackdrop.scrollTop-u,o.scrollLeft+=e.cursorBackdrop.scrollLeft-u,d()}function d(){e.cursorBackdrop.scrollTop=u,e.cursorBackdrop.scrollLeft=u}e.overrideCursor=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=++h,o=n instanceof Document?n.body:n.firstElementChild;return!e.cursorBackdrop.isConnected&&(e.cursorBackdrop.style.transform="scale(0)",o.appendChild(e.cursorBackdrop),d(),document.addEventListener("pointermove",l,{capture:!0,passive:!0}),e.cursorBackdrop.addEventListener("scroll",c,{capture:!0,passive:!0})),e.cursorBackdrop.style.cursor=t,new rH(()=>{r===h&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",l,!0),e.cursorBackdrop.removeEventListener("scroll",c,!0),o.removeChild(e.cursorBackdrop))})};var u=500,h=0;e.cursorBackdrop=((n=document.createElement("div")).classList.add("lm-cursor-backdrop"),n)}(eR||(eR={}));var rq=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End"];class rZ extends rI{dispose(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,super.dispose()}get currentChanged(){return this._currentChanged}get tabMoved(){return this._tabMoved}get tabActivateRequested(){return this._tabActivateRequested}get addRequested(){return this._addRequested}get tabCloseRequested(){return this._tabCloseRequested}get tabDetachRequested(){return this._tabDetachRequested}get document(){return this._document}get titlesEditable(){return this._titlesEditable}set titlesEditable(e){this._titlesEditable=e}get currentTitle(){return this._titles[this._currentIndex]||null}set currentTitle(e){this.currentIndex=e?this._titles.indexOf(e):-1}get currentIndex(){return this._currentIndex}set currentIndex(e){if((e<0||e>=this._titles.length)&&(e=-1),this._currentIndex!==e){var t=this._currentIndex,n=this._titles[t]||null,r=e,o=this._titles[r]||null;this._currentIndex=r,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:r,currentTitle:o})}}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){if(this._orientation!==e)this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e)}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){if(this._addButtonEnabled!==e)this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden")}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();var n=eD.asTitle(t),r=this._titles.indexOf(n),o=Math.max(0,Math.min(e,this._titles.length));return -1===r?(eu.insert(this._titles,o,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,n),n):(o===this._titles.length&&o--,r===o)?n:(eu.move(this._titles,r,o),this.update(),this._adjustCurrentForMove(r,o),n)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();var t=eu.removeAt(this._titles,e);if(!!t)t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t)}clearTabs(){if(0===this._titles.length)return;for(var e of(this._releaseMouse(),this._titles))e.changed.disconnect(this._onTitleChanged,this);var t=this.currentIndex,n=this.currentTitle;if(this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==t)this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){for(var t,n=this._titles,{renderer:r}=this,{currentTitle:o}=this,a=Array(n.length),s=null!==(t=this._getCurrentTabindex())&&void 0!==t?t:this._currentIndex>-1?this._currentIndex:0,l=0,c=n.length;l<c;++l){var d=n[l],u=d===o,h=u?c:c-l-1,p=s===l?0:-1;a[l]=r.renderTab({title:d,current:u,zIndex:h,tabIndex:p})}eM.render(a,this.contentNode)}_getCurrentTabindex(){var e=null,t=this.contentNode.querySelector('li[tabindex="0"]');return t?e=[...this.contentNode.children].indexOf(t):this._addButtonEnabled&&"0"===this.addButtonNode.getAttribute("tabindex")&&(e=-1),e}_evtDblClick(e){if(!this.titlesEditable)return;var t=this.contentNode.children,n=eu.findFirstIndex(t,t=>ev.hitTest(t,e.clientX,e.clientY));if(-1!==n){var r=this.titles[n],o=t[n].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){var a=r.label||"",s=o.innerHTML;o.innerHTML="";var l=document.createElement("input");l.classList.add("lm-TabBar-tabInput"),l.value=a,o.appendChild(l);var c=()=>{l.removeEventListener("blur",c),o.innerHTML=s,this.node.addEventListener("keydown",this)};l.addEventListener("dblclick",e=>e.stopPropagation()),l.addEventListener("blur",c),l.addEventListener("keydown",e=>{"Enter"===e.key?(""!==l.value&&(r.label=r.caption=l.value),c()):"Escape"===e.key&&c()}),this.node.removeEventListener("keydown",this),l.select(),l.focus(),o.children.length>0&&o.children[0].focus()}}}_evtKeyDownCapturing(e){if(e.eventPhase===Event.CAPTURING_PHASE)e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse()}_evtKeyDown(e){if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE){if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){var t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{var n=eu.findFirstIndex(this.contentNode.children,e=>e.contains(t));n>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=n)}}else if(rq.includes(e.key)){var r,o,a,s,l=[...this.contentNode.children];if(this.addButtonEnabled&&l.push(this.addButtonNode),l.length<=1)return;e.preventDefault(),e.stopPropagation();var c=l.indexOf(document.activeElement);-1===c&&(c=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?r=null!==(o=l[c+1])&&void 0!==o?o:l[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?r=null!==(a=l[c-1])&&void 0!==a?a:l[l.length-1]:"Home"===e.key?r=l[0]:"End"===e.key&&(r=l[l.length-1]),r&&(null===(s=l[c])||void 0===s||s.setAttribute("tabindex","-1"),null==r||r.setAttribute("tabindex","0"),r.focus())}}}_evtPointerDown(e){if(0!==e.button&&1!==e.button||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;var t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),n=this.contentNode.children,r=eu.findFirstIndex(n,t=>ev.hitTest(t,e.clientX,e.clientY));if(-1===r&&!t)return;if(this._dragData={tab:n[r],index:r,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===e.button||t)return;var o=n[r].querySelector(this.renderer.closeIconSelector);if(o&&o.contains(e.target))return;if(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===r?this.currentIndex=-1:this.currentIndex=r,-1!==this.currentIndex)this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle})}_evtPointerMove(e){var t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();var n=this.contentNode.children;if(!!t.dragActive||!!eD.dragExceeded(t,e)){if(!t.dragActive){var r=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=r.width,t.tabPressPos=t.pressX-r.left):(t.tabPos=t.tab.offsetTop,t.tabSize=r.height,t.tabPressPos=t.pressY-r.top),t.tabPressOffset={x:t.pressX-r.left,y:t.pressY-r.top},t.tabLayout=eD.snapTabLayout(n,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=rK.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&eD.detachExceeded(t,e)){t.detachRequested=!0;var{index:o}=t,{clientX:a}=e,{clientY:s}=e,l=n[o],c=this._titles[o];if(this._tabDetachRequested.emit({index:o,title:c,tab:l,clientX:a,clientY:s,offset:t.tabPressOffset}),t.dragAborted)return}eD.layoutTabs(n,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;var t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target)){this._addRequested.emit(void 0);return}var n=this.contentNode.children,r=eu.findFirstIndex(n,t=>ev.hitTest(t,e.clientX,e.clientY));if(r!==t.index)return;var o=this._titles[r];if(!o.closable)return;if(1===e.button){this._tabCloseRequested.emit({index:r,title:o});return}var a=n[r].querySelector(this.renderer.closeIconSelector);a&&a.contains(e.target)&&this._tabCloseRequested.emit({index:r,title:o});return}if(0===e.button)eD.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging"),setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,eD.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");var e=t.index,n=t.targetIndex;if(-1!==n&&e!==n)eu.move(this._titles,e,n),this._adjustCurrentForMove(e,n),this._tabMoved.emit({fromIndex:e,toIndex:n,title:this._titles[n]}),ef.sendMessage(this,rI.Msg.UpdateRequest)},eD.parseTransitionDuration(t.tab))}_releaseMouse(){var e=this._dragData;if(!e)return;if(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,!!e.dragActive)eD.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")}_adjustCurrentForInsert(e,t){var n=this.currentTitle,r=this._currentIndex,o=this.insertBehavior;if("select-tab"===o||"select-tab-if-needed"===o&&-1===r){this._currentIndex=e,this._previousTitle=n,this._currentChanged.emit({previousIndex:r,previousTitle:n,currentIndex:e,currentTitle:t});return}r>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex<e&&this._currentIndex>=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){var n=this._currentIndex,r=this.removeBehavior;if(n!==e){n>e&&this._currentIndex--;return}if(0===this._titles.length){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if("select-tab-after"===r){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-tab-before"===r){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-previous-tab"===r){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}constructor(e={}){super({node:eD.createNode()}),this._currentIndex=-1,this._titles=[],this._titlesEditable=!1,this._previousTitle=null,this._dragData=null,this._addButtonEnabled=!1,this._tabMoved=new rE(this),this._currentChanged=new rE(this),this._addRequested=new rE(this),this._tabCloseRequested=new rE(this),this._tabDetachRequested=new rE(this),this._tabActivateRequested=new rE(this),this.addClass("lm-TabBar"),this.contentNode.setAttribute("role","tablist"),this.setFlag(rI.Flag.DisallowLayout),this._document=e.document||document,this.tabsMovable=e.tabsMovable||!1,this.titlesEditable=e.titlesEditable||!1,this.allowDeselect=e.allowDeselect||!1,this.addButtonEnabled=e.addButtonEnabled||!1,this.insertBehavior=e.insertBehavior||"select-tab-if-needed",this.name=e.name||"",this.orientation=e.orientation||"horizontal",this.removeBehavior=e.removeBehavior||"select-tab-after",this.renderer=e.renderer||rZ.defaultRenderer}}!function(e){class t{renderTab(e){var t=e.title.caption,n=this.createTabKey(e),r=this.createTabStyle(e),o=this.createTabClass(e),a=this.createTabDataset(e),s=this.createTabARIA(e);return e.title.closable?rW.li((0,tm._)({id:n,key:n,className:o,title:t,style:r,dataset:a},s),this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):rW.li((0,tm._)({id:n,key:n,className:o,title:t,style:r,dataset:a},s),this.renderIcon(e),this.renderLabel(e))}renderIcon(e){var{title:t}=e,n=this.createIconClass(e);return rW.div({className:n},t.icon,t.iconLabel)}renderLabel(e){return rW.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return rW.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){var t=this._tabKeys.get(e.title);return void 0===t&&(t="tab-key-".concat(this._uuid,"-").concat(this._tabID++),this._tabKeys.set(e.title,t)),t}createTabStyle(e){return{zIndex:"".concat(e.zIndex)}}createTabClass(e){var t="lm-TabBar-tab";return e.title.className&&(t+=" ".concat(e.title.className)),e.title.closable&&(t+=" lm-mod-closable"),e.current&&(t+=" lm-mod-current"),t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:"".concat(null!==(t=e.tabIndex)&&void 0!==t?t:"-1")}}createIconClass(e){var t="lm-TabBar-tabIcon",n=e.title.iconClass;return n?"".concat(t," ").concat(n):t}constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++t._nInstance}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t,e.addButtonSelector=".lm-TabBar-addButton"}(rZ||(rZ={})),(z=eD||(eD={})).DRAG_THRESHOLD=5,z.DETACH_THRESHOLD=20,z.createNode=function(){var e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",e.appendChild(t);var n=document.createElement("div");return n.className="lm-TabBar-addButton lm-mod-hidden",n.setAttribute("tabindex","-1"),n.setAttribute("role","button"),e.appendChild(n),e},z.asTitle=function(e){return e instanceof rT?e:new rT(e)},z.parseTransitionDuration=function(e){return 1e3*(parseFloat(window.getComputedStyle(e).transitionDuration)||0)},z.snapTabLayout=function(e,t){for(var n=Array(e.length),r=0,o=e.length;r<o;++r){var a=e[r],s=window.getComputedStyle(a);"horizontal"===t?n[r]={pos:a.offsetLeft,size:a.offsetWidth,margin:parseFloat(s.marginLeft)||0}:n[r]={pos:a.offsetTop,size:a.offsetHeight,margin:parseFloat(s.marginTop)||0}}return n},z.dragExceeded=function(e,t){var n=Math.abs(t.clientX-e.pressX),r=Math.abs(t.clientY-e.pressY);return n>=z.DRAG_THRESHOLD||r>=z.DRAG_THRESHOLD},z.detachExceeded=function(e,t){var n=e.contentRect;return t.clientX<n.left-z.DETACH_THRESHOLD||t.clientX>=n.right+z.DETACH_THRESHOLD||t.clientY<n.top-z.DETACH_THRESHOLD||t.clientY>=n.bottom+z.DETACH_THRESHOLD},z.layoutTabs=function(e,t,n,r){"horizontal"===r?(o=t.pressX,a=n.clientX-t.contentRect.left,s=n.clientX,l=t.contentRect.width):(o=t.pressY,a=n.clientY-t.contentRect.top,s=n.clientY,l=t.contentRect.height);for(var o,a,s,l,c=t.index,d=a-t.tabPressPos,u=d+t.tabSize,h=0,p=e.length;h<p;++h){var f=void 0,m=t.tabLayout[h],v=m.pos+(m.size>>1);if(h<t.index&&d<v)f="".concat(t.tabSize+t.tabLayout[h+1].margin,"px"),c=Math.min(c,h);else if(h>t.index&&u>v)f="".concat(-t.tabSize-m.margin,"px"),c=Math.max(c,h);else if(h===t.index){var g=s-o,b=l-(t.tabPos+t.tabSize);f="".concat(Math.max(-t.tabPos,Math.min(g,b)),"px")}else f="";"horizontal"===r?e[h].style.left=f:e[h].style.top=f}t.targetIndex=c},z.finalizeTabPosition=function(e,t){if(n="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)r=0;else if(e.targetIndex>e.index){var n,r,o=e.tabLayout[e.targetIndex];r=o.pos+o.size-e.tabSize-e.tabPos}else r=e.tabLayout[e.targetIndex].pos-e.tabPos;var a=n-(e.tabPos+e.tabSize),s=Math.max(-e.tabPos,Math.min(r,a));"horizontal"===t?e.tab.style.left="".concat(s,"px"):e.tab.style.top="".concat(s,"px")},z.resetTabPositions=function(e,t){for(var n of e)"horizontal"===t?n.style.left="":n.style.top=""};class rY extends rM{dispose(){var e=this[Symbol.iterator]();for(var t of(this._items.forEach(e=>{e.dispose()}),this._box=null,this._root=null,this._items.clear(),e))t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){for(var t of(this._hiddenMode=e,this.tabBars()))if(t.titles.length>1)for(var n of t.titles)n.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){if(e=rP.clampDimension(e),this._spacing===e)return;if(this._spacing=e,!!this.parent)this.parent.fit()}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():rb()}widgets(){return this._root?this._root.iterUserWidgets():rb()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():rb()}tabBars(){return this._root?this._root.iterTabBars():rb()}handles(){return this._root?this._root.iterHandles():rb()}moveHandle(e,t,n){var r,o=e.classList.contains("lm-mod-hidden");if(!this._root||o)return;var a=this._root.findSplitNode(e);if(!!a&&0!=(r="horizontal"===a.node.orientation?t-e.offsetLeft:n-e.offsetTop))a.node.holdSizes(),el.adjust(a.node.sizers,a.index,r),this.parent&&this.parent.update()}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){var t,n=new Set;t=e.main?eA.normalizeAreaConfig(e.main,n):null;var r=this.widgets(),o=this.tabBars(),a=this.handles();for(var s of(this._root=null,r))!n.has(s)&&(s.parent=null);for(var l of o)l.dispose();for(var c of a)c.parentNode&&c.parentNode.removeChild(c);for(var d of n)d.parent=this.parent;if(t?this._root=eA.realizeAreaConfig(t,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,!!this.parent)n.forEach(e=>{this.attachWidget(e)}),this.parent.fit()}addWidget(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.ref||null,r=t.mode||"tab-after",o=null;if(this._root&&n&&(o=this._root.findTabNode(n)),n&&!o)throw Error("Reference widget is not in the layout.");switch(e.parent=this.parent,r){case"tab-after":this._insertTab(e,n,o,!0);break;case"tab-before":this._insertTab(e,n,o,!1);break;case"split-top":this._insertSplit(e,n,o,"vertical",!1);break;case"split-left":this._insertSplit(e,n,o,"horizontal",!1);break;case"split-right":this._insertSplit(e,n,o,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,n,o,"vertical",!0);break;case"merge-top":this._insertSplit(e,n,o,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,n,o,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,n,o,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,n,o,"vertical",!0,!0)}if(!!this.parent)this.attachWidget(e),this.parent.fit()}removeWidget(e){if(this._removeWidget(e),!!this.parent)this.detachWidget(e),this.parent.fit()}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;!this._box&&(this._box=ev.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),r=e-n.left-this._box.borderLeft,o=t-n.top-this._box.borderTop,a=this._root.hitTestTabNodes(r,o);if(!a)return null;var{tabBar:s,top:l,left:c,width:d,height:u}=a,h=this._box.borderLeft+this._box.borderRight,p=this._box.borderTop+this._box.borderBottom,f=n.width-h-(c+d),m=n.height-p-(l+u);return{tabBar:s,x:r,y:o,top:l,left:c,right:f,bottom:m,width:d,height:u}}init(){for(var e of(super.init(),this))this.attachWidget(e);for(var t of this.handles())this.parent.node.appendChild(t);this.parent.fit()}attachWidget(e){if(this.parent.node!==e.node.parentNode)this._items.set(e,new rR(e)),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterAttach)}detachWidget(e){if(this.parent.node===e.node.parentNode){this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterDetach);var t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;var t=this._root.findTabNode(e);if(!!t){if(eA.removeAria(e),t.tabBar.titles.length>1){t.tabBar.removeTab(e.title),this._hiddenMode===rI.HiddenMode.Scale&&1==t.tabBar.titles.length&&(t.tabBar.titles[0].owner.hiddenMode=rI.HiddenMode.Display);return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();var n=t.parent;t.parent=null;var r=eu.removeFirstOf(n.children,t),o=eu.removeAt(n.handles,r);if(eu.removeAt(n.sizers,r),o.parentNode&&o.parentNode.removeChild(o),n.children.length>1){n.syncHandles();return}var a=n.parent;n.parent=null;var s=n.children[0],l=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,l.parentNode&&l.parentNode.removeChild(l),this._root===n){s.parent=null,this._root=s;return}var c=a.children.indexOf(n);if(s instanceof eA.TabLayoutNode){s.parent=a,a.children[c]=s;return}var d=eu.removeAt(a.handles,c);eu.removeAt(a.children,c),eu.removeAt(a.sizers,c),d.parentNode&&d.parentNode.removeChild(d);for(var u=0,h=s.children.length;u<h;++u){var p=s.children[u],f=s.handles[u],m=s.sizers[u];eu.insert(a.children,c+u,p),eu.insert(a.handles,c+u,f),eu.insert(a.sizers,c+u,m),p.parent=a}s.children.length=0,s.handles.length=0,s.sizers.length=0,s.parent=null,a.syncHandles()}}_createTabNode(e){var t=new eA.TabLayoutNode(this._createTabBar());return t.tabBar.addTab(e.title),eA.addAria(e,t.tabBar),t}_insertTab(e,t,n,r){if(e!==t){if(!this._root){var o,a=new eA.TabLayoutNode(this._createTabBar());a.tabBar.addTab(e.title),this._root=a,eA.addAria(e,a.tabBar);return}!n&&(n=this._root.findFirstTabNode()),-1===n.tabBar.titles.indexOf(e.title)&&(this._removeWidget(e),e.hide()),o=t?n.tabBar.titles.indexOf(t.title):n.tabBar.currentIndex,this._hiddenMode===rI.HiddenMode.Scale?0===n.tabBar.titles.length?e.hiddenMode=rI.HiddenMode.Display:1==n.tabBar.titles.length?n.tabBar.titles[0].owner.hiddenMode=rI.HiddenMode.Scale:e.hiddenMode=rI.HiddenMode.Scale:e.hiddenMode=this._hiddenMode,n.tabBar.insertTab(o+(r?1:0),e.title),eA.addAria(e,n.tabBar)}}_insertSplit(e,t,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e!==t||!n||1!==n.tabBar.titles.length){if(this._removeWidget(e),!this._root){this._root=this._createTabNode(e);return}if(!n||!n.parent){var s=this._splitRoot(r),l=o?s.children.length:0;s.normalizeSizes();var c=eA.createSizer(n?1:eA.GOLDEN_RATIO),d=this._createTabNode(e);eu.insert(s.children,l,d),eu.insert(s.sizers,l,c),eu.insert(s.handles,l,this._createHandle()),d.parent=s,s.normalizeSizes(),s.syncHandles();return}var u=n.parent;if(u.orientation===r){var h=u.children.indexOf(n);if(a){var p=u.children[h+(o?1:-1)];if(p instanceof eA.TabLayoutNode){this._insertTab(e,null,p,!0),++p.tabBar.currentIndex;return}}u.normalizeSizes();var f=u.sizers[h].sizeHint/=2,m=h+(o?1:0),v=this._createTabNode(e);eu.insert(u.children,m,v),eu.insert(u.sizers,m,eA.createSizer(f)),eu.insert(u.handles,m,this._createHandle()),v.parent=u,u.syncHandles();return}var g=eu.removeFirstOf(u.children,n),b=new eA.SplitLayoutNode(r);b.normalized=!0,b.children.push(n),b.sizers.push(eA.createSizer(.5)),b.handles.push(this._createHandle()),n.parent=b;var y=o?1:0,_=this._createTabNode(e);eu.insert(b.children,y,_),eu.insert(b.sizers,y,eA.createSizer(.5)),eu.insert(b.handles,y,this._createHandle()),_.parent=b,b.syncHandles(),eu.insert(u.children,g,b),b.parent=u}}_splitRoot(e){var t=this._root;if(t instanceof eA.SplitLayoutNode&&t.orientation===e)return t;var n=this._root=new eA.SplitLayoutNode(e);return t&&(n.children.push(t),n.sizers.push(eA.createSizer(0)),n.handles.push(this._createHandle()),t.parent=n),n}_fit(){var e=0,t=0;if(this._root){var n=this._root.fit(this._spacing,this._items);e=n.minWidth,t=n.minHeight}var r=this._box=ev.boxSizing(this.parent.node);e+=r.horizontalSum,t+=r.verticalSum;var{style:o}=this.parent.node;o.minWidth="".concat(e,"px"),o.minHeight="".concat(t,"px"),this._dirty=!0,this.parent.parent&&ef.sendMessage(this.parent.parent,rI.Msg.FitRequest),this._dirty&&ef.sendMessage(this.parent,rI.Msg.UpdateRequest)}_update(e,t){if(this._dirty=!1,!!this._root){e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),!this._box&&(this._box=ev.boxSizing(this.parent.node));var n=this._box.paddingTop,r=this._box.paddingLeft,o=e-this._box.horizontalSum,a=t-this._box.verticalSum;this._root.update(n,r,o,a,this._spacing,this._items)}}_createTabBar(){var e=this.renderer.createTabBar(this._document);return e.orientation="horizontal",this.parent&&this.attachWidget(e),e}_createHandle(){var e=this.renderer.createHandle(),{style:t}=e;return t.position="absolute",t.contain="strict",t.top="0",t.left="0",t.width="0",t.height="0",this.parent&&this.parent.node.appendChild(e),e}constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=rP.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:rI.HiddenMode.Display}}!function(e){function t(e){var t=new rm;return t.sizeHint=e,t.size=e,t}function n(e,t){var r;return r="tab-area"===e.type?function(e,t){if(0===e.widgets.length)return null;var n=[];for(var r of e.widgets)!t.has(r)&&(t.add(r),n.push(r));if(0===n.length)return null;var o=e.currentIndex;return -1!==o&&(o<0||o>=n.length)&&(o=0),{type:"tab-area",widgets:n,currentIndex:o}}(e,t):function(e,t){for(var{orientation:r}=e,o=[],a=[],s=0,l=e.children.length;s<l;++s){var c=n(e.children[s],t);if(!!c)"tab-area"===c.type||c.orientation!==r?(o.push(c),a.push(Math.abs(e.sizes[s]||0))):(o.push(...c.children),a.push(...c.sizes))}return 0===o.length?null:1===o.length?o[0]:{type:"split-area",orientation:r,children:o,sizes:a}}(e,t)}function r(n,s,l){var c;return c="tab-area"===n.type?function(t,n,r){var a=n.createTabBar(r);for(var s of t.widgets)s.hide(),a.addTab(s.title),e.addAria(s,a);return a.currentIndex=t.currentIndex,new o(a)}(n,s,l):function(e,n,o){var s=new a(e.orientation);return e.children.forEach((a,l)=>{var c=r(a,n,o),d=t(e.sizes[l]),u=n.createHandle();s.children.push(c),s.handles.push(u),s.sizers.push(d),c.parent=s}),s.syncHandles(),s.normalizeSizes(),s}(n,s,l)}e.GOLDEN_RATIO=.618,e.createSizer=t,e.normalizeAreaConfig=n,e.realizeAreaConfig=r;class o{get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(var e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){var e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return -1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e<this._left||e>=this._left+this._width||t<this._top||t>=this._top+this._height?null:this}createConfig(){var e=this.tabBar.titles.map(e=>e.owner),{currentIndex:t}=this.tabBar;return{type:"tab-area",widgets:e,currentIndex:t}}holdAllSizes(){}fit(e,t){var n=0,r=0,o=t.get(this.tabBar),a=this.tabBar.currentTitle,s=a?t.get(a.owner):void 0,[l,c]=this.sizers;return o&&o.fit(),s&&s.fit(),o&&!o.isHidden?(n=Math.max(n,o.minWidth),r+=o.minHeight,l.minSize=o.minHeight,l.maxSize=o.maxHeight):(l.minSize=0,l.maxSize=0),s&&!s.isHidden?(n=Math.max(n,s.minWidth),r+=s.minHeight,c.minSize=s.minHeight):c.minSize=0,c.maxSize=1/0,{minWidth:n,minHeight:r,maxWidth:1/0,maxHeight:1/0}}update(e,t,n,r,o,a){this._top=t,this._left=e,this._width=n,this._height=r;var s=a.get(this.tabBar),l=this.tabBar.currentTitle,c=l?a.get(l.owner):void 0;if(el.calc(this.sizers,r),s&&!s.isHidden){var{size:d}=this.sizers[0];s.update(e,t,n,d),t+=d}if(c&&!c.isHidden){var{size:u}=this.sizers[1];c.update(e,t,n,u)}}constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var t=new rm,n=new rm;t.stretch=0,n.stretch=1,this.tabBar=e,this.sizers=[t,n]}}e.TabLayoutNode=o;class a{*iterAllWidgets(){for(var e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(var e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(var e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(var e of this.children)yield*e.iterTabBars()}*iterHandles(){for(var e of(yield*this.handles,this.children))yield*e.iterHandles()}findTabNode(e){for(var t=0,n=this.children.length;t<n;++t){var r=this.children[t].findTabNode(e);if(r)return r}return null}findSplitNode(e){var t=this.handles.indexOf(e);if(-1!==t)return{index:t,node:this};for(var n=0,r=this.children.length;n<r;++n){var o=this.children[n].findSplitNode(e);if(o)return o}return null}findFirstTabNode(){return 0===this.children.length?null:this.children[0].findFirstTabNode()}hitTestTabNodes(e,t){for(var n=0,r=this.children.length;n<r;++n){var o=this.children[n].hitTestTabNodes(e,t);if(o)return o}return null}createConfig(){var{orientation:e}=this,t=this.createNormalizedSizes();return{type:"split-area",orientation:e,children:this.children.map(e=>e.createConfig()),sizes:t}}syncHandles(){this.handles.forEach((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")})}holdSizes(){for(var e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(var e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){var e=this.sizers.length;if(0!==e){this.holdSizes();var t=this.sizers.reduce((e,t)=>e+t.sizeHint,0);if(0===t)for(var n of this.sizers)n.size=n.sizeHint=1/e;else for(var r of this.sizers)r.size=r.sizeHint/=t;this.normalized=!0}}createNormalizedSizes(){var e=this.sizers.length;if(0===e)return[];var t=this.sizers.map(e=>e.size),n=t.reduce((e,t)=>e+t,0);if(0===n)for(var r=t.length-1;r>-1;r--)t[r]=1/e;else for(var o=t.length-1;o>-1;o--)t[o]/=n;return t}fit(e,t){for(var n="horizontal"===this.orientation,r=Math.max(0,this.children.length-1)*e,o=n?r:0,a=n?0:r,s=0,l=this.children.length;s<l;++s){var c=this.children[s].fit(e,t);n?(a=Math.max(a,c.minHeight),o+=c.minWidth,this.sizers[s].minSize=c.minWidth):(o=Math.max(o,c.minWidth),a+=c.minHeight,this.sizers[s].minSize=c.minHeight)}return{minWidth:o,minHeight:a,maxWidth:1/0,maxHeight:1/0}}update(e,t,n,r,o,a){var s="horizontal"===this.orientation,l=Math.max(0,(s?n:r)-Math.max(0,this.children.length-1)*o);if(this.normalized){for(var c of this.sizers)c.sizeHint*=l;this.normalized=!1}el.calc(this.sizers,l);for(var d=0,u=this.children.length;d<u;++d){var h=this.children[d],{size:p}=this.sizers[d],f=this.handles[d].style;s?(h.update(e,t,p,r,o,a),e+=p,f.top="".concat(t,"px"),f.left="".concat(e,"px"),f.width="".concat(o,"px"),f.height="".concat(r,"px"),e+=o):(h.update(e,t,n,p,o,a),t+=p,f.top="".concat(t,"px"),f.left="".concat(e,"px"),f.width="".concat(n,"px"),f.height="".concat(o,"px"),t+=o)}}constructor(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}}e.SplitLayoutNode=a;e.addAria=function(e,t){e.node.setAttribute("role","tabpanel");var{renderer:n}=t;if(n instanceof rZ.Renderer){var r=n.createTabKey({title:e.title,current:!1,zIndex:0});e.node.setAttribute("aria-labelledby",r)}};e.removeAria=function(e){e.node.removeAttribute("role"),e.node.removeAttribute("aria-labelledby")}}(eA||(eA={}));class rX extends rI{dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode!==e){this._mode=e,this.dataset.mode=e;var t=this.layout;switch(e){case"multiple-document":for(var n of t.tabBars())n.show();break;case"single-document":t.restoreLayout(eN.createSingleDocumentConfig(this));break;default:throw"unreachable"}ef.postMessage(this,eN.LayoutModified)}}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){for(var t of(this._tabsMovable=e,this.tabBars()))t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){for(var t of(this._addButtonEnabled=e,this.tabBars()))t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){var t=ry(this.tabBars(),t=>-1!==t.titles.indexOf(e.title));if(!t)throw Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(eg.IS_EDGE||eg.IS_IE)&&ef.flush(),ef.postMessage(this,eN.LayoutModified)}addWidget(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),ef.postMessage(this,eN.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){if(!eN.isGeneratedTabBarProperty.get(e.child))e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){if(!eN.isGeneratedTabBarProperty.get(e.child))e.child.removeClass("lm-DockPanel-widget"),ef.postMessage(this,eN.LayoutModified)}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){if(e.preventDefault(),!this._tabsConstrained||e.source===this)e.stopPropagation(),this.overlay.hide(1)}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){var t=this;return(0,e3._)(function*(){if(e.preventDefault(),t.overlay.hide(0),"none"===e.proposedAction){e.dropAction="none";return}var n,{clientX:r,clientY:o}=e,{zone:a,target:s}=eN.findDropTarget(t,r,o,t._edges,t._splitOptions);if(t._tabsConstrained&&e.source!==t||"invalid"===a){e.dropAction="none";return}var{mimeData:l}=e,c=l.getData("application/vnd.lumino.widget-factory");if("function"!=typeof c){e.dropAction="none";return}(yield c()).forEach((r,o)=>{0===o?(t.bindWidget(e,r,a,s),n=r):t.bindWidget(e,r,"widget-all",s,n)})})()}bindWidget(e,t,n,r,o){if(!(t instanceof rI)||t.contains(this)){e.dropAction="none";return}var a=r?eN.getDropRef(r.tabBar):null;switch(o&&(a=o),n){case"root-all":this.addWidget(t);break;case"root-top":this.addWidget(t,{mode:"split-top"});break;case"root-left":this.addWidget(t,{mode:"split-left"});break;case"root-right":this.addWidget(t,{mode:"split-right"});break;case"root-bottom":this.addWidget(t,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(t,{mode:"tab-after",ref:a});break;case"widget-top":this.addWidget(t,{mode:"split-top",ref:a});break;case"widget-left":this.addWidget(t,{mode:"split-left",ref:a});break;case"widget-right":this.addWidget(t,{mode:"split-right",ref:a});break;case"widget-bottom":this.addWidget(t,{mode:"split-bottom",ref:a});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),ef.postMessage(this,eN.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;var t=this.layout,n=e.target,r=ry(t.handles(),e=>e.contains(n));if(!!r){e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var o=r.getBoundingClientRect(),a=e.clientX-o.left,s=e.clientY-o.top,l=window.getComputedStyle(r),c=rK.overrideCursor(l.cursor,this._document);this._pressData={handle:r,deltaX:a,deltaY:s,override:c}}}_evtPointerMove(e){if(!!this._pressData){e.preventDefault(),e.stopPropagation();var t=this.node.getBoundingClientRect(),n=e.clientX-t.left-this._pressData.deltaX,r=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,r)}}_evtPointerUp(e){if(0===e.button)e.preventDefault(),e.stopPropagation(),this._releaseMouse(),ef.postMessage(this,eN.LayoutModified)}_releaseMouse(){if(!!this._pressData)this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0)}_showOverlay(e,t){var n,r,o,a,{zone:s,target:l}=eN.findDropTarget(this,e,t,this._edges,this._splitOptions);if("invalid"===s)return this.overlay.hide(100),s;var c=ev.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(s){case"root-all":n=c.paddingTop,r=c.paddingLeft,o=c.paddingRight,a=c.paddingBottom;break;case"root-top":n=c.paddingTop,r=c.paddingLeft,o=c.paddingRight,a=d.height*eN.GOLDEN_RATIO;break;case"root-left":n=c.paddingTop,r=c.paddingLeft,o=d.width*eN.GOLDEN_RATIO,a=c.paddingBottom;break;case"root-right":n=c.paddingTop,r=d.width*eN.GOLDEN_RATIO,o=c.paddingRight,a=c.paddingBottom;break;case"root-bottom":n=d.height*eN.GOLDEN_RATIO,r=c.paddingLeft,o=c.paddingRight,a=c.paddingBottom;break;case"widget-all":n=l.top,r=l.left,o=l.right,a=l.bottom;break;case"widget-top":n=l.top,r=l.left,o=l.right,a=l.bottom+l.height/2;break;case"widget-left":n=l.top,r=l.left,o=l.right+l.width/2,a=l.bottom;break;case"widget-right":n=l.top,r=l.left+l.width/2,o=l.right,a=l.bottom;break;case"widget-bottom":n=l.top+l.height/2,r=l.left,o=l.right,a=l.bottom;break;case"widget-tab":var u=l.tabBar.node.getBoundingClientRect().height;n=l.top,r=l.left,o=l.right,a=l.bottom+l.height-u;break;default:throw"unreachable"}return this.overlay.show({top:n,left:r,right:o,bottom:a}),s}_createTabBar(){var e=this._renderer.createTabBar(this._document);return eN.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){ef.postMessage(this,eN.LayoutModified)}_onCurrentChanged(e,t){var{previousTitle:n,currentTitle:r}=t;n&&n.owner.hide(),r&&r.owner.show(),(eg.IS_EDGE||eg.IS_IE)&&ef.flush(),ef.postMessage(this,eN.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(!this._drag){e.releaseMouse();var{title:n,tab:r,clientX:o,clientY:a,offset:s}=t,l=new rk;l.setData("application/vnd.lumino.widget-factory",()=>[n.owner]);var c=r.cloneNode(!0);s&&(c.style.top="-".concat(s.y,"px"),c.style.left="-".concat(s.x,"px")),this._drag=new rK({document:this._document,mimeData:l,dragImage:c,proposedAction:"move",supportedActions:"move",source:this}),r.classList.add("lm-mod-hidden");this._drag.start(o,a).then(()=>{this._drag=null,r.classList.remove("lm-mod-hidden")})}}constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new rE(this),this._addRequested=new rE(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._splitOptions=e.splitOptions,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||rX.defaultRenderer,this._edges=e.edges||eN.DEFAULT_EDGES,void 0!==e.tabsMovable&&(this._tabsMovable=e.tabsMovable),void 0!==e.tabsConstrained&&(this._tabsConstrained=e.tabsConstrained),void 0!==e.addButtonEnabled&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;this.layout=new rY({document:this._document,renderer:{createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()},spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new rX.Overlay,this.node.appendChild(this.overlay.node)}}!function(e){e.Overlay=class e{show(e){var{style:t}=this.node;if(t.top="".concat(e.top,"px"),t.left="".concat(e.left,"px"),t.right="".concat(e.right,"px"),t.bottom="".concat(e.bottom,"px"),clearTimeout(this._timer),this._timer=-1,!!this._hidden)this._hidden=!1,this.node.classList.remove("lm-mod-hidden")}hide(e){if(this._hidden)return;if(e<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}if(-1===this._timer)this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},e)}constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}};class t{createTabBar(e){var t=new rZ({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){var e=document.createElement("div");return e.className="lm-DockPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t}(rX||(rX={})),(O=eN||(eN={})).GOLDEN_RATIO=.618,O.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},O.LayoutModified=new rw("layout-modified"),O.isGeneratedTabBarProperty=new rv({name:"isGeneratedTabBar",create:()=>!1}),O.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};var t=Array.from(e.widgets()),n=e.selectedWidgets().next().value,r=n?t.indexOf(n):-1;return{main:{type:"tab-area",widgets:t,currentIndex:r}}},O.findDropTarget=function(e,t,n,r,o){if(!ev.hitTest(e.node,t,n))return{zone:"invalid",target:null};var a=e.layout;if(a.isEmpty)return{zone:"root-all",target:null};var s=a.hitTestTabAreas(t,n);if(null==o?void 0:o.maxSplitCount){var l=function e(t){return(null==t?void 0:t.type)==="tab-area"?1:(null==t?void 0:t.type)==="split-area"?t.children.reduce((t,n)=>t+e(n),0):0}(a.saveLayout().main);if(!s)return{zone:"invalid",target:null};if(l>=o.maxSplitCount)return{zone:"widget-all",target:s};if((null==o?void 0:o.splitOrientation)==="horizontal")return s&&s.x<s.width/4?{zone:"widget-left",target:s}:s&&s.x>s.width/4*3?{zone:"widget-right",target:s}:{zone:"widget-all",target:s};if((null==o?void 0:o.splitOrientation)==="vertical")return s&&s.y<s.height/4?{zone:"widget-top",target:s}:s&&s.y>s.height/4*3?{zone:"widget-bottom",target:s}:{zone:"widget-all",target:s}}if("multiple-document"===e.mode){var c=e.node.getBoundingClientRect(),d=t-c.left+1,u=n-c.top+1,h=c.right-t,p=c.bottom-n;switch(Math.min(u,h,p,d)){case u:if(u<r.top)return{zone:"root-top",target:null};break;case h:if(h<r.right)return{zone:"root-right",target:null};break;case p:if(p<r.bottom)return{zone:"root-bottom",target:null};break;case d:if(d<r.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}if(!s)return{zone:"invalid",target:null};if("single-document"===e.mode)return{zone:"widget-all",target:s};var f=s.x-s.left+1,m=s.y-s.top+1,v=s.left+s.width-s.x,g=s.top+s.height-s.y;if(m<s.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:s};var b=Math.round(s.width/3),y=Math.round(s.height/3);return f>b&&v>b&&m>y&&g>y?{zone:"widget-all",target:s}:{zone:function(e,t,n,r){var o;switch(Math.min(e,t,n,r)){case e:o="widget-left";break;case t:o="widget-top";break;case n:o="widget-right";break;case r:o="widget-bottom";break;default:throw"unreachable"}return o}(f/=b,m/=y,v/=b,g/=y),target:s}},O.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner};class rQ extends rM{dispose(){for(var e of this._items){var{widget:t}=e;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){if(e!==this.rowCount)eL.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit()}get columnCount(){return this._columnSizers.length}set columnCount(e){if(e!==this.columnCount)eL.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit()}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){if(e=eL.clampValue(e),this._rowSpacing!==e)this._rowSpacing=e,this.parent&&this.parent.fit()}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){if(e=eL.clampValue(e),this._columnSpacing!==e)this._columnSpacing=e,this.parent&&this.parent.fit()}rowStretch(e){var t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){var n=this._rowSizers[e];if(!n)return;if(t=eL.clampValue(t),n.stretch!==t)n.stretch=t,this.parent&&this.parent.update()}columnStretch(e){var t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){var n=this._columnSizers[e];if(!n)return;if(t=eL.clampValue(t),n.stretch!==t)n.stretch=t,this.parent&&this.parent.update()}*[Symbol.iterator](){for(var e of this._items)yield e.widget}addWidget(e){if(-1===eu.findFirstIndex(this._items,t=>t.widget===e))this._items.push(new rR(e)),this.parent&&this.attachWidget(e)}removeWidget(e){var t=eu.findFirstIndex(this._items,t=>t.widget===e);if(-1!==t){var n=eu.removeAt(this._items,t);this.parent&&this.detachWidget(e),n.dispose()}}init(){for(var e of(super.init(),this))this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&ef.sendMessage(e,rI.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ef.sendMessage(e,rI.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(var e=0,t=this.rowCount;e<t;++e)this._rowSizers[e].minSize=0;for(var n=0,r=this.columnCount;n<r;++n)this._columnSizers[n].minSize=0;for(var o=this._items.filter(e=>!e.isHidden),a=0,s=o.length;a<s;++a)o[a].fit();var l=this.rowCount-1,c=this.columnCount-1;o.sort(eL.rowSpanCmp);for(var d=0,u=o.length;d<u;++d){var h=o[d],p=rQ.getCellConfig(h.widget),f=Math.min(p.row,l),m=Math.min(p.row+p.rowSpan-1,l);eL.distributeMin(this._rowSizers,f,m,h.minHeight)}o.sort(eL.columnSpanCmp);for(var v=0,g=o.length;v<g;++v){var b=o[v],y=rQ.getCellConfig(b.widget),_=Math.min(y.column,c),w=Math.min(y.column+y.columnSpan-1,c);eL.distributeMin(this._columnSizers,_,w,b.minWidth)}if("set-no-constraint"===this.fitPolicy){ef.sendMessage(this.parent,rI.Msg.UpdateRequest);return}for(var x=l*this._rowSpacing,S=c*this._columnSpacing,k=0,C=this.rowCount;k<C;++k)x+=this._rowSizers[k].minSize;for(var j=0,E=this.columnCount;j<E;++j)S+=this._columnSizers[j].minSize;var T=this._box=ev.boxSizing(this.parent.node);S+=T.horizontalSum,x+=T.verticalSum;var{style:I}=this.parent.node;I.minWidth="".concat(S,"px"),I.minHeight="".concat(x,"px"),this._dirty=!0,this.parent.parent&&ef.sendMessage(this.parent.parent,rI.Msg.FitRequest),this._dirty&&ef.sendMessage(this.parent,rI.Msg.UpdateRequest)}_update(e,t){this._dirty=!1,e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),!this._box&&(this._box=ev.boxSizing(this.parent.node));var n=this._box.paddingTop,r=this._box.paddingLeft,o=e-this._box.horizontalSum,a=t-this._box.verticalSum,s=this.rowCount-1,l=this.columnCount-1,c=s*this._rowSpacing,d=l*this._columnSpacing;el.calc(this._rowSizers,Math.max(0,a-c)),el.calc(this._columnSizers,Math.max(0,o-d));for(var u=0,h=n,p=this.rowCount;u<p;++u)this._rowStarts[u]=h,h+=this._rowSizers[u].size+this._rowSpacing;for(var f=0,m=r,v=this.columnCount;f<v;++f)this._columnStarts[f]=m,m+=this._columnSizers[f].size+this._columnSpacing;for(var g=0,b=this._items.length;g<b;++g){var y=this._items[g];if(!y.isHidden){var _=rQ.getCellConfig(y.widget),w=Math.min(_.row,s),x=Math.min(_.column,l),S=Math.min(_.row+_.rowSpan-1,s),k=Math.min(_.column+_.columnSpan-1,l),C=this._columnStarts[x],j=this._rowStarts[w],E=this._columnStarts[k]+this._columnSizers[k].size-C,T=this._rowStarts[S]+this._rowSizers[S].size-j;y.update(C,j,E,T)}}}constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new rm],this._columnSizers=[new rm],this._box=null,void 0!==e.rowCount&&eL.reallocSizers(this._rowSizers,e.rowCount),void 0!==e.columnCount&&eL.reallocSizers(this._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(this._rowSpacing=eL.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(this._columnSpacing=eL.clampValue(e.columnSpacing))}}(B=rQ||(rQ={})).getCellConfig=function(e){return eL.cellConfigProperty.get(e)},B.setCellConfig=function(e,t){eL.cellConfigProperty.set(e,eL.normalizeConfig(t))},(W=eL||(eL={})).cellConfigProperty=new rv({name:"cellConfig",create:()=>({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(e){e.parent&&e.parent.layout instanceof rQ&&e.parent.fit()}}),W.normalizeConfig=function(e){var t=Math.max(0,Math.floor(e.row||0)),n=Math.max(0,Math.floor(e.column||0)),r=Math.max(1,Math.floor(e.rowSpan||0));return{row:t,column:n,rowSpan:r,columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},W.clampValue=function(e){return Math.max(0,Math.floor(e))},W.rowSpanCmp=function(e,t){var n=W.cellConfigProperty.get(e.widget),r=W.cellConfigProperty.get(t.widget);return n.rowSpan-r.rowSpan},W.columnSpanCmp=function(e,t){var n=W.cellConfigProperty.get(e.widget),r=W.cellConfigProperty.get(t.widget);return n.columnSpan-r.columnSpan},W.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.length<t;)e.push(new rm);e.length>t&&(e.length=t)},W.distributeMin=function(e,t,n,r){if(n<t)return;if(t===n){var o=e[t];o.minSize=Math.max(o.minSize,r);return}for(var a=0,s=t;s<=n;++s)a+=e[s].minSize;if(!(a>=r))for(var l=(r-a)/(n-t+1),c=t;c<=n;++c)e[c].minSize+=l},(F=ez||(ez={})).createNode=function(){var e=document.createElement("div"),t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),o=document.createElement("div");return t.className="lm-ScrollBar-button",n.className="lm-ScrollBar-button",t.dataset.action="decrement",n.dataset.action="increment",r.className="lm-ScrollBar-track",o.className="lm-ScrollBar-thumb",r.appendChild(o),e.appendChild(t),e.appendChild(r),e.appendChild(n),e},F.findPart=function(e,t){return e.thumbNode.contains(t)?"thumb":e.trackNode.contains(t)?"track":e.decrementNode.contains(t)?"decrement":e.incrementNode.contains(t)?"increment":null},Symbol.iterator;class rG extends rD{dispose(){for(var e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){if(this._orientation===e)return;if(this._orientation=e,!!this.parent)this.parent.dataset.orientation=e,this.parent.fit()}get alignment(){return this._alignment}set alignment(e){if(this._alignment===e)return;if(this._alignment=e,!!this.parent)this.parent.dataset.alignment=e,this.parent.update()}get spacing(){return this._spacing}set spacing(e){if(e=eC.clampDimension(e),this._spacing===e)return;if(this._spacing=e,!!this.parent)this.parent.fit()}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return eO.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e){for(var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this._sizers.length,r=e.slice(0,n);r.length<n;)r.push(0);for(var o=eO.normalize(r),a=0;a<n;++a){var s=this._sizers[a];s.sizeHint=o[a],s.size=o[a]}this._hasNormedSizes=!0,t&&this.parent&&this.parent.update()}moveHandle(e,t){var n,r=this._handles[e];if(!(!r||r.classList.contains("lm-mod-hidden"))&&0!=(n="horizontal"===this._orientation?t-r.offsetLeft:t-r.offsetTop)){for(var o of this._sizers)o.size>0&&(o.sizeHint=o.size);el.adjust(this._sizers,e,n),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){var n=new rR(t),r=eO.createHandle(this.renderer),o=eO.averageSize(this._sizers),a=eO.createSizer(o);eu.insert(this._items,e,n),eu.insert(this._sizers,e,a),eu.insert(this._handles,e,r),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(r),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){eu.move(this._items,e,t),eu.move(this._sizers,e,t),eu.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){var n=eu.removeAt(this._items,e),r=eu.removeAt(this._handles,e);eu.removeAt(this._sizers,e),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(r),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,n,r,o,a,s){var l=this._items[e];if(!l.isHidden){var c=this._handles[e].style;t?(n+=this.widgetOffset,l.update(n,r,s,o),n+=s,c.top="".concat(r,"px"),c.left="".concat(n,"px"),c.width="".concat(this._spacing,"px"),c.height="".concat(o,"px")):(r+=this.widgetOffset,l.update(n,r,a,s),r+=s,c.top="".concat(r,"px"),c.left="".concat(n,"px"),c.width="".concat(a,"px"),c.height="".concat(this._spacing,"px"))}}_fit(){for(var e=0,t=-1,n=0,r=this._items.length;n<r;++n)this._items[n].isHidden?this._handles[n].classList.add("lm-mod-hidden"):(this._handles[n].classList.remove("lm-mod-hidden"),t=n,e++);-1!==t&&this._handles[t].classList.add("lm-mod-hidden"),this._fixed=this._spacing*Math.max(0,e-1)+this.widgetOffset*this._items.length;for(var o="horizontal"===this._orientation,a=o?this._fixed:0,s=o?0:this._fixed,l=0,c=this._items.length;l<c;++l){var d=this._items[l],u=this._sizers[l];if(u.size>0&&(u.sizeHint=u.size),d.isHidden){u.minSize=0,u.maxSize=0;continue}d.fit(),u.stretch=rG.getStretch(d.widget),o?(u.minSize=d.minWidth,u.maxSize=d.maxWidth,a+=d.minWidth,s=Math.max(s,d.minHeight)):(u.minSize=d.minHeight,u.maxSize=d.maxHeight,s+=d.minHeight,a=Math.max(a,d.minWidth))}var h=this._box=ev.boxSizing(this.parent.node);a+=h.horizontalSum,s+=h.verticalSum;var{style:p}=this.parent.node;p.minWidth="".concat(a,"px"),p.minHeight="".concat(s,"px"),this._dirty=!0,this.parent.parent&&ef.sendMessage(this.parent.parent,rI.Msg.FitRequest),this._dirty&&ef.sendMessage(this.parent,rI.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;for(var n=0,r=0,o=this._items.length;r<o;++r)n+=+!this._items[r].isHidden;if(0!==n||0!==this.widgetOffset){e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),!this._box&&(this._box=ev.boxSizing(this.parent.node));var a=this._box.paddingTop,s=this._box.paddingLeft,l=e-this._box.horizontalSum,c=t-this._box.verticalSum,d=0,u=0,h="horizontal"===this._orientation;if(n>0){if(f=h?Math.max(0,l-this._fixed):Math.max(0,c-this._fixed),this._hasNormedSizes){for(var p of this._sizers)p.sizeHint*=f;this._hasNormedSizes=!1}var f,m=el.calc(this._sizers,f);if(m>0)switch(this._alignment){case"start":break;case"center":d=0,u=m/2;break;case"end":d=0,u=m;break;case"justify":d=m/n,u=0;break;default:throw"unreachable"}}for(var v=0,g=this._items.length;v<g;++v){var b=this._items[v].isHidden?0:this._sizers[v].size+d;this.updateItemPosition(v,h,h?s+u:s,h?a:a+u,c,l,b);var y=this.widgetOffset+(this._handles[v].classList.contains("lm-mod-hidden")?0:this._spacing);h?s+=b+y:a+=b+y}}}constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,void 0!==e.orientation&&(this._orientation=e.orientation),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=eC.clampDimension(e.spacing))}}(H=rG||(rG={})).getStretch=function(e){return eO.stretchProperty.get(e)},H.setStretch=function(e,t){eO.stretchProperty.set(e,t)},(U=eO||(eO={})).stretchProperty=new rv({name:"stretch",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:function(e){e.parent&&e.parent.layout instanceof rG&&e.parent.fit()}}),U.createSizer=function(e){var t=new rm;return t.sizeHint=Math.floor(e),t},U.createHandle=function(e){var t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t},U.averageSize=function(e){return e.reduce((e,t)=>e+t.size,0)/e.length||0},U.normalize=function(e){var t=e.length;if(0===t)return[];var n=e.reduce((e,t)=>e+Math.abs(t),0);return 0===n?e.map(e=>1/t):e.map(e=>e/n)};class rJ extends rN{dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;var t,n=this.layout,r=eu.findFirstIndex(n.handles,t=>t.contains(e.target));if(-1!==r){e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var o=n.handles[r],a=o.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-a.left:e.clientY-a.top;var s=window.getComputedStyle(o),l=rK.overrideCursor(s.cursor);this._pressData={index:r,delta:t,override:l}}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();var t,n=this.layout,r=this.node.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-r.left-this._pressData.delta:e.clientY-r.top-this._pressData.delta,n.moveHandle(this._pressData.index,t)}_evtPointerUp(e){if(0===e.button)e.preventDefault(),e.stopPropagation(),this._releaseMouse()}_releaseMouse(){if(!!this._pressData)this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0)}constructor(e={}){super({layout:eB.createLayout(e)}),this._handleMoved=new rE(this),this._pressData=null,this.addClass("lm-SplitPanel")}}!function(e){class t{createHandle(){var e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t;e.getStretch=function(e){return rG.getStretch(e)};e.setStretch=function(e,t){rG.setStretch(e,t)}}(rJ||(rJ={})),(eB||(eB={})).createLayout=function(e){return e.layout||new rG({renderer:e.renderer||rJ.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})};class r$ extends rD{get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e)this._hiddenMode=e,this.widgets.length>1&&this.widgets.forEach(e=>{e.hiddenMode=this._hiddenMode})}dispose(){for(var e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===rI.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=rI.HiddenMode.Scale),t.hiddenMode=rI.HiddenMode.Scale):t.hiddenMode=rI.HiddenMode.Display,eu.insert(this._items,e,new rR(t)),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){eu.move(this._items,e,t),this.parent.update()}detachWidget(e,t){var n=eu.removeAt(this._items,e);this.parent.isAttached&&ef.sendMessage(t,rI.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ef.sendMessage(t,rI.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===rI.HiddenMode.Scale&&(t.hiddenMode=rI.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=rI.HiddenMode.Display)),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(var e=0,t=0,n=0,r=this._items.length;n<r;++n){var o=this._items[n];if(!o.isHidden)o.fit(),e=Math.max(e,o.minWidth),t=Math.max(t,o.minHeight)}var a=this._box=ev.boxSizing(this.parent.node);e+=a.horizontalSum,t+=a.verticalSum;var{style:s}=this.parent.node;s.minWidth="".concat(e,"px"),s.minHeight="".concat(t,"px"),this._dirty=!0,this.parent.parent&&ef.sendMessage(this.parent.parent,rI.Msg.FitRequest),this._dirty&&ef.sendMessage(this.parent,rI.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;for(var n=0,r=0,o=this._items.length;r<o;++r)n+=+!this._items[r].isHidden;if(0!==n){e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),!this._box&&(this._box=ev.boxSizing(this.parent.node));for(var a=this._box.paddingTop,s=this._box.paddingLeft,l=e-this._box.horizontalSum,c=t-this._box.verticalSum,d=0,u=this._items.length;d<u;++d){var h=this._items[d];if(!h.isHidden)h.widget.node.style.zIndex="".concat(d),h.update(s,a,l,c)}}}constructor(e={}){super(e),this._dirty=!1,this._items=[],this._box=null,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:rI.HiddenMode.Display}}(eW||(eW={})).createLayout=function(e){return e.layout||new r$},(V=eF||(eF={})).orientationFromPlacement=function(e){return K[e]},V.directionFromPlacement=function(e){return q[e]},K={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},q={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"},(0,rp.GW)((0,e4.b)(),rI),(0,rp.GW)(rf(),rI,0);class r0 extends rI{onBeforeDetach(e){this.toBeforeDetach.dispose(),super.onBeforeDetach(e)}createScrollbar(){var e=this;return(0,e3._)(function*(){var t=yield e.getScrollContainer();t.style.overflow="hidden",e.scrollBar=new rd(t,e.scrollOptions),e.disableScrollBarFocus(t),e.toBeforeDetach.push(eX.JT.create(()=>{e.scrollBar&&(e.scrollBar.destroy(),e.scrollBar=void 0),t.style.overflow="initial"}))})()}onAfterAttach(e){super.onAfterAttach(e),this.scrollOptions&&this.createScrollbar()}getScrollContainer(){return this.node}disableScrollBarFocus(e){for(var t of[e.getElementsByClassName("ide-ps__thumb-x"),e.getElementsByClassName("ide-ps__thumb-y")])for(var n=0;n<t.length;n++){var r=t.item(n);r&&r.removeAttribute("tabIndex")}}onUpdateRequest(e){super.onUpdateRequest(e),this.onUpdateEmitter.fire(e),this.scrollBar&&this.scrollBar.update()}setFlag(e){super.setFlag(e),e===rI.Flag.IsVisible&&this.onDidChangeVisibilityEmitter.fire(this.isVisible)}clearFlag(e){super.clearFlag(e),e===rI.Flag.IsVisible&&this.onDidChangeVisibilityEmitter.fire(this.isVisible)}onActivateRequest(e){this.onActivateEmitter.fire(e),super.onActivateRequest(e)}dispose(){if(!this.isDisposed)super.dispose(),this.toDispose.dispose()}onCloseRequest(e){super.onCloseRequest(e),this.dispose()}constructor(e){super(e),this.onDidChangeVisibilityEmitter=new eX.Q5,this.onDidChangeVisibility=this.onDidChangeVisibilityEmitter.event,this.onUpdateEmitter=new eX.Q5,this.onUpdate=this.onUpdateEmitter.event,this.onActivateEmitter=new eX.Q5,this.onActivate=this.onActivateEmitter.event,this.toDispose=new eX.K4(this.onDidChangeVisibilityEmitter,this.onUpdateEmitter,this.onActivateEmitter),this.toBeforeDetach=new eX.K4,this.onDispose=this.toDispose.onDispose}}r0=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,rf()),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===rI||void 0===rI.IOptions?Object:rI.IOptions])],r0);var r1=tq.createContext(void 0);class r2 extends r0{getResourceURI(){var e;return null===(e=this.uri)||void 0===e?void 0:e.withoutQuery()}onResize(e){super.onResize(e),this.onWidgetResizeEmitter.fire(e)}init(e,t){this.uri=e}constructor(e){super(e),this.onWidgetResizeEmitter=new eX.Q5,this.onWidgetResize=this.onWidgetResizeEmitter.event,this.scrollOptions={suppressScrollX:!0,minScrollbarLength:35}}}r2=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,rf()),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",["undefined"==typeof Widget||void 0===Widget.IOptions?Object:Widget.IOptions])],r2);var r4=((Z={}).LEADING="leading",Z.TRAILING="trailing",Z);var r6=((Y={}).TOP_BAR="topBar",Y.ACTIVITY_BAR="activityBar",Y.PRIMARY_SIDEBAR="primarySidebar",Y.MAIN_PANEL="mainPanel",Y.SECONDARY_SIDEBAR="secondarySidebar",Y.BOTTOM_PANEL="bottomPanel",Y.STATUS_BAR="statusBar",Y.RIGHT_BAR="rightBar",Y),r5=Symbol("WidgetFactory"),r3=Symbol("CustomRenderWidgetFactory");class r8 extends r2{render(){return null}}class r9{init(e){for(var t of(this.widgetFactories=e||[],this.factoryProvider.getContributions()))this.widgetFactories.push(t)}getFactoryFromURI(e){for(var t of this.widgetFactories)if(t.match&&t.match.test(e.toString())||t.canHandle&&t.canHandle(e))return t}getWidget(e){for(var[t,n]of this.widgets.entries())if(e===t)return n}getWidgetFromURI(e,t){var n=this.uriToWidgetID(e,t);return this.getWidget(n)}uriToWidgetID(e,t){var n;return(null==(t=t||this.getFactoryFromURI(e))?void 0:null===(n=t.getId)||void 0===n?void 0:n.call(t,e))||e.withoutQuery().toString()}getAllWidgets(){var e=[];for(var[t,n]of this.widgets.entries())e.push(n);return e}setWidget(e,t){this.widgets.set(e,t),t.disposed.connect(()=>this.widgets.delete(e))}doGetWidget(e){var t,n=null!==(t=this.widgets.get(e))&&void 0!==t?t:this.pendingWidgetPromises.get(e);if(n)return n}createSubWidget(e,t){var n=this;return(0,e3._)(function*(){var r=n.uriToWidgetID(e),o=n.getWidget(r);if(o)return o;var a=n.containerFactory.createChild();a.bind(t).toSelf().inSingletonScope();var s=a.get(t);return s.id=r,s.init(e,a),n.setWidget(r,s),s})()}getOrCreateWidgetFromURI(e,t){var n=this;return(0,e3._)(function*(){if(!(t=t||n.getFactoryFromURI(e)))throw Error("No widget factory '".concat(e.toString(),"' has been registered."));var r=n.uriToWidgetID(e,t),o=n.doGetWidget(r);if(o)return o;try{var a,s,l=null===(a=t.createWidget)||void 0===a?void 0:a.call(t,e);if(!l&&t.widget&&((s=n.containerFactory.createChild()).bind(t.widget).toSelf().inSingletonScope(),l=s.get(t.widget)),!l&&t.render&&(s=n.containerFactory.createChild(),l=n.customRenderWidgetFactory(s)),!l)throw Error("No widget createWidget");n.pendingWidgetPromises.set(r,l);var c=yield l;return t.render&&(c.render=t.render),c.id=r,c.init(e,s),n.setWidget(r,c),c}finally{n.pendingWidgetPromises.delete(r)}})()}constructor(){this.widgets=new Map,this.widgetFactories=[],this.pendingWidgetPromises=new Map}}(0,e2.gn)([(0,e8.f)(r3),(0,e2.w6)("design:type",void 0===r3?Object:r3)],r9.prototype,"customRenderWidgetFactory",void 0),(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(r5),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],r9.prototype,"factoryProvider",void 0),(0,e2.gn)([(0,e8.f)(tc),(0,e2.w6)("design:type",void 0===tc?Object:tc)],r9.prototype,"containerFactory",void 0),r9=(0,e2.gn)([(0,e4.b)()],r9);var r7=Symbol("ViewOptions"),ie="flowide-main-panel",it="flowide-bottom-panel",ir={[r6.TOP_BAR]:new tD("flowide:///panel/flowide-top-bar"),[r6.ACTIVITY_BAR]:new tD("flowide:///panel/flowide-activity-bar"),[r6.PRIMARY_SIDEBAR]:new tD("flowide:///panel/flowide-primary-sidebar"),[r6.MAIN_PANEL]:new tD("flowide:///panel/".concat(ie)),[r6.SECONDARY_SIDEBAR]:new tD("flowide:///panel/flowide-secondary-sidebar"),[r6.BOTTOM_PANEL]:new tD("flowide:///panel/".concat(it)),[r6.STATUS_BAR]:new tD("flowide:///panel/flowide-status-bar"),[r6.RIGHT_BAR]:new tD("flowide:///panel/flowide-right-bar")},ii=[r6.TOP_BAR,r6.ACTIVITY_BAR,r6.PRIMARY_SIDEBAR,r6.MAIN_PANEL,r6.SECONDARY_SIDEBAR,r6.BOTTOM_PANEL,r6.STATUS_BAR,r6.RIGHT_BAR],io="flow-split-widget-panel",ia="custom-tabBar-container",is="flow-tabBar-action-container",il="flow-tabBar-scroll-container",ic="flow-toolbar-container",id="flow-toolbar-item",iu="disable-handle-event",ih=new tD("flowide:///hover/tooltip-label"),ip="single-document";new tD("flowide://panel/debug-bar-content");var im="debug-bar-pos";class iv extends r2{init(){var e,t;(null===(t=this.options)||void 0===t?void 0:null===(e=t.defaultLayoutData)||void 0===e?void 0:e.debugBar)&&(this.eventService.listenGlobalEvent("mousedown",this._evtPointerDown.bind(this)),this.eventService.listenGlobalEvent("mousemove",this._evtPointerMove.bind(this)),this.eventService.listenGlobalEvent("mouseup",this._evtPointerUp.bind(this)),this.node.classList.remove("lm-Widget"),this.node.classList.add("global-Widget"))}initContent(e){this.content=null==e?void 0:e.render();var t,n,r,o=(null==e?void 0:e.memoPosition)?JSON.parse(null===(t=this.storageService)||void 0===t?void 0:t.getData(im,"{}")):{};this.ref.current&&(this.ref.current.style.left=(null==o?void 0:o.left)||(null==e?void 0:null===(n=e.defaultPosition)||void 0===n?void 0:n.left),this.ref.current.style.top=(null==o?void 0:o.top)||(null==e?void 0:null===(r=e.defaultPosition)||void 0===r?void 0:r.top))}_evtPointerDown(e){if(0!==e.button&&1!==e.button)return;var t,n,r=null===(t=this.ref.current)||void 0===t?void 0:t.querySelector(".".concat("flow-debug-bar-draggable"));if((!e.target||!!(null==r?void 0:r.contains(e.target))||r===e.target)&&!this._dragPos){e.stopPropagation(),this._dragPos={x:e.clientX,y:e.clientY};var o=null===(n=this.ref.current)||void 0===n?void 0:n.getBoundingClientRect();this.initialPos={x:(null==o?void 0:o.left)||0,y:(null==o?void 0:o.top)||0,width:(null==o?void 0:o.width)||0,height:(null==o?void 0:o.height)||0}}}_evtPointerMove(e){if(!!this._dragPos&&!!this.initialPos){if(e.preventDefault(),e.stopPropagation(),this.initialPos&&this._dragPos&&this.ref.current){var t=0,n=0,r=document.documentElement.clientWidth,o=document.documentElement.clientHeight,a=this.initialPos.x+e.clientX-this._dragPos.x,s=this.initialPos.y+e.clientY-this._dragPos.y;t=a<0?0:a>r-this.initialPos.width?r-this.initialPos.width:a,n=s<0?0:s>o-this.initialPos.height?o-this.initialPos.height:s,this.ref.current.style.left="".concat(t,"px"),this.ref.current.style.top="".concat(n,"px")}}}_evtPointerUp(e){e.stopPropagation();var t,n,r={left:null===(t=this.ref.current)||void 0===t?void 0:t.style.left,top:null===(n=this.ref.current)||void 0===n?void 0:n.style.top};this.storageService.setData(im,JSON.stringify(r)),this._dragPos=null,this.initialPos=null}render(){return(0,tK.jsx)("div",{className:"debug-bar-widget-container",ref:this.ref,style:this.isHidden?{display:"none"}:{},children:this.content})}constructor(...e){super(...e),this.content=null,this.ref=tq.createRef(),this._dragPos=null,this.initialPos=null}}function ig(e,t){return!!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf(e)>=0)||"undefined"!=typeof process&&process.platform===t}(0,e2.gn)([(0,e8.f)(nY),(0,e2.w6)("design:type",void 0===nY?Object:nY)],iv.prototype,"eventService",void 0),(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iv.prototype,"options",void 0),(0,e2.gn)([(0,e8.f)(tu),(0,e2.w6)("design:type",void 0===tu?Object:tu)],iv.prototype,"storageService",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],iv.prototype,"init",null),iv=(0,e2.gn)([(0,e4.b)()],iv),ig("Windows","win32"),ig("Mac","darwin");function ib(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"codicon codicon-".concat(e).concat(t?" ".concat("action-label"):"")}var iy=n("9430"),i_=n("921463"),iw=n("801815"),ix=(e,t,n)=>{var r,o;return{key:(null===(o=e.getResourceURI())||void 0===o?void 0:null===(r=o.toString)||void 0===r?void 0:r.call(o))||(0,iw.x0)(),comp:tq.memo(function(){var r=(0,eX.JA)();(0,tq.useEffect)(()=>{var t=e.onUpdate(()=>r());return()=>t.dispose()},[]);var o=(0,tK.jsx)(iy.SV,{fallbackRender:t=>(0,tK.jsx)(n,(0,tv._)((0,tm._)({},t),{widget:e})),children:(0,tK.jsx)(r1.Provider,{value:e,children:(0,tK.jsx)(t,{})})});return i_.createPortal(o,e.node)})}},iS=(e,t)=>e.withoutQuery().toString()===t.withoutQuery().toString(),ik=(e,t,n)=>{for(var r=new rA(n),o=0;o<e.length;o++)void 0!==t&&o<t.length&&rL.setStretch(e[o],t[o]),r.addWidget(e[o]);return r},iC=(e,t,n)=>{var r={renderer:rJ.defaultRenderer};n&&(r=(0,tm._)({},r,n));for(var o=new rG(r),a=0;a<e.length;a++)void 0!==t&&a<t.length&&rJ.setStretch(e[a],t[a]),o.addWidget(e[a]);return o},ij=n("473980"),iE=e=>{var{item:t}=e,n=nF(nL),r=(0,tq.useMemo)(()=>n.renderer(t.uri),[t.uri]);return r?(0,tK.jsx)("div",{className:"flowide-status-bar-item",children:r}):null},iT=e=>{var{items:t}=e;return nZ("flowide-status-bar-widget",(e,t)=>{var{getColor:n}=t;return"\n .flowide-status-bar-widget-container {\n display: flex;\n height: 100%;\n justify-content: space-between;\n padding: 0 8px;\n }\n .flowide-status-bar-side {\n display: flex;\n }\n .flowide-status-bar-item {\n height: 100%;\n cursor: pointer;\n padding: 0 4px;\n margin: 0 2px;\n font-size: 12px;\n color: ".concat(n("flowide.color.base.text.0"),";\n display: flex;\n align-items: center;\n }\n .flowide-status-bar-item:hover {\n background: ").concat(n("flowide.color.base.fill.0"),"\n }\n ")}),(0,tK.jsxs)("div",{className:"flowide-status-bar-widget-container",children:[(0,tK.jsx)("div",{className:"flowide-status-bar-side",children:t.filter(e=>"left"===e.position).map(e=>(0,tK.jsx)(iE,{item:e},e.uri.toString()))}),(0,tK.jsx)("div",{className:"flowide-status-bar-side",children:t.filter(e=>"right"===e.position).map(e=>(0,tK.jsx)(iE,{item:e},e.uri.toString()))})]})},iI=new tD("flowide://panel/status-bar-content");class iP extends r2{initView(e){var t=this;return(0,e3._)(function*(){t.list=e,t.id="flowide-status-bar-container",t.scrollbar=new rd(t.node),t.update()})()}render(){return(0,tK.jsx)(iT,{items:this.list})}constructor(...e){super(...e),this.list=[]}}iP=(0,e2.gn)([(0,e4.b)()],iP);var iM=n("171505"),iR=n("131325");(eH||(eH={})).invertIfNecessary=function(e,t,n,r,o,a){if("left"===e){if(a){if(t.left-t.width<0)return"right"}else if(t.left-n.width<0)return"right"}else if("right"===e){if(a){if(t.right+t.width>r)return"left"}else if(t.right+n.width>r)return"left"}else if("top"===e){if(a){if(t.top-t.height<0)return"bottom"}else if(t.top-n.height<0)return"bottom"}else if("bottom"===e){if(a){if(t.bottom+t.height>o)return"top"}else if(t.bottom+n.height>o)return"top"}return e};class iD{get hoverHost(){return!this._hoverHost&&(this._hoverHost=document.createElement("div"),this._hoverHost.classList.add(iD.hostClassName),this._hoverHost.style.position="absolute"),this._hoverHost}enableCustomHoverHost(){!this._hoverHost&&(this.enableCustomHost=!0,this._hoverHost=document.createElement("div"),this.reactRoot=(0,iR.createRoot)(this._hoverHost),this._hoverHost.style.position="absolute")}requestHover(e){e.target!==this.hoverTarget&&(this.cancelHover(),this.pendingTimeout=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=setTimeout(...t);return{dispose:()=>clearTimeout(r)}}(()=>this.renderHover(e),this.getHoverDelay()))}renderHover(e){var t=this;return(0,e3._)(function*(){var n,r=t.hoverHost,{target:o,content:a,position:s,cssClasses:l,offset:c}=e;if(l&&r.classList.add(...l),t.hoverTarget=o,!t.reactRoot&&a instanceof HTMLElement?(r.appendChild(a),n=a):!t.reactRoot&&"string"==typeof a&&(r.textContent=a),r.style.top="0px",r.style.left="0px",document.body.append(r),e.visualPreview){var d=n?n.offsetWidth:t.hoverHost.offsetWidth,u=e.visualPreview(d);u&&r.appendChild(u)}yield function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new Promise(t=>{!function n(){e<=0?t():(e--,requestAnimationFrame(n))}()})}();var h=t.setHostPosition(o,r,s,c);if(t.reactRoot){var p=t.labelService.renderer(ih,{content:a,position:h,key:new Date().getTime()});t.reactRoot.render(p)}t.disposeOnHide.push({dispose:()=>{t.lastHidHover=Date.now(),r.classList.remove(h),l&&r.classList.remove(...l)}}),t.listenForMouseOut()})()}listenForMouseOut(){var e=e=>{var t;if(!!this.hoverTarget)e.target instanceof Node&&!this.hoverHost.contains(e.target)&&!(null===(t=this.hoverTarget)||void 0===t?void 0:t.contains(e.target))&&this.cancelHover()};document.addEventListener("mousemove",e),this.disposeOnHide.push({dispose:()=>document.removeEventListener("mousemove",e)})}getHoverDelay(){return Date.now()-this.lastHidHover<200?0:200}setHostPosition(e,t,n,r){var o=t.getBoundingClientRect(),a=e.getBoundingClientRect(),s=document.documentElement.scrollHeight,l=document.body.getBoundingClientRect().width,c=r||0;if("top"===(n=eH.invertIfNecessary(n,a,o,l,s,this.enableCustomHost))||"bottom"===n){var d=a.left+a.width/2-o.width/2,u=Math.min(l-o.width,d),h="top"===n?a.top-o.height+c:a.bottom-c,p=Math.max(0,u);t.style.top="".concat(h,"px"),t.style.left="".concat(p,"px")}else{var f=a.top+a.height/2-o.height/2,m=Math.min(s-o.height,f),v="left"===n?a.left-o.width-c:a.right+c,g=Math.max(0,m);t.style.left="".concat(v,"px"),t.style.top="".concat(g,"px")}return t.classList.add(n),n}unRender(){this.hoverHost.remove(),this.hoverHost.replaceChildren()}cancelHover(){var e;if(this.reactRoot){var t=this.labelService.renderer(ih,{visible:!1,key:new Date().getTime()});this.reactRoot.render(t)}else this.unRender();null===(e=this.pendingTimeout)||void 0===e||e.dispose(),this.disposeOnHide.dispose(),this.hoverTarget=void 0}constructor(){this.reactRoot=null,this.lastHidHover=Date.now(),this.enableCustomHost=!1,this.disposeOnHide=new eX.K4}}function iA(){var e=(0,tq.useContext)(r1);if(null==e?void 0:e.wrapperWidget)return null==e?void 0:e.wrapperWidget;if(!e)throw Error("[useCurrentWidget] Undefined react widget from ide context");return e}function iN(e){var t=nF(iq),n=(0,eX.JA)();return(0,tq.useEffect)(()=>{var e=t.onCurrentWidgetChange(()=>{n()});return()=>e.dispose()},[t]),t.getCurrentWidget(e)}iD.hostClassName="flow-hover",iD.styleSheetId="flow-hover-style",(0,e2.gn)([(0,e8.f)(nL),(0,e2.w6)("design:type",void 0===nL?Object:nL)],iD.prototype,"labelService",void 0),iD=(0,e2.gn)([(0,e4.b)()],iD),tq.createContext(void 0);var iL=()=>{nZ("flowide-activity-bar-widget",(e,t)=>{var{getColor:n}=t;return"\n .activity-bar-widget-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: space-between;\n\n .top-container, .bottom-container {\n display: flex;\n flex-direction: column;\n }\n\n .item-container {\n cursor: pointer;\n position: relative;\n color: ".concat(n("flowide.color.base.text.2"),";\n }\n .item-container.active {\n color: ").concat(n("flowide.color.base.text.0"),";\n }\n .item-container.selected {\n color: ").concat(n("flowide.color.base.text.0"),';\n }\n .item-container.selected::before {\n content: "";\n position: absolute;\n width: 2px;\n height: 100%;\n background: ').concat(n("flowide.color.base.primary"),";\n }\n .item-container:hover {\n color: ").concat(n("flowide.color.base.text.0"),";\n }\n\n .item-container > i {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 18px;\n text-align: center;\n color: inherit;\n\n width: 36px;\n height: 36px;\n mask-repeat: no-repeat;\n -webkit-mask-repeat: no-repeat;\n mask-size: 24px;\n -webkit-mask-size: 24px;\n mask-position: 50% 50%;\n -webkit-mask-position: 50% 50%;\n }\n }")})},iz=e=>{var t,n,{list:r,currentUri:o,setCurrentUri:a}=e,s=nF(nL),l=nF(iD),c=nF(ts),d=null===(n=iN(r6.MAIN_PANEL))||void 0===n?void 0:n.uri,u=e=>{var t=s.getIcon(e.uri);return"string"!=typeof t?t:(0,tK.jsx)("i",{className:ib(t)})};var h=(t=(0,e3._)(function*(e,t){(null==t?void 0:t.onClick)?t.onClick(e):"top"===t.position?a(t.uri):c.open(t.uri),l.cancelHover()}),function(e,n){return t.apply(this,arguments)}),p=(0,tq.useCallback)((e,t)=>{if(!!t)l.requestHover({content:t,target:e.currentTarget,position:"right"})},[]),f=e=>{var t=s.getName(e.uri),n=o&&e.uri.isEqualOrParent(o),r=d&&e.uri.isEqualOrParent(d);return(0,tK.jsx)("div",{className:(0,iM.clsx)("item-container",n&&"selected",r&&"active"),onClick:t=>h(t,e),onMouseEnter:t=>!n&&p(t,e.tooltip),children:u(e)},t)};return iL(),(0,tK.jsxs)("div",{className:"activity-bar-widget-container",children:[(0,tK.jsx)("div",{className:"top-container",children:r.filter(e=>"top"===e.position).map(e=>f(e))}),(0,tK.jsx)("div",{className:"bottom-container",children:r.filter(e=>"bottom"===e.position).map(e=>f(e))})]})},iO=new tD("flowide://panel/activity-bar-content");class iB extends r2{initView(e,t){var n=this;return(0,e3._)(function*(){n.list=e,n.id="flowide-activity-bar-container",t&&n.setCurrentUri(t)})()}setCurrentUri(e){this.currentUri===e?this.currentUri=void 0:this.currentUri=e,this.openerService.open(e),this.update()}storeState(){throw Error("Method not implemented.")}restoreState(e){throw Error("Method not implemented.")}render(){return(0,tK.jsx)(iz,{list:this.list,currentUri:this.currentUri,setCurrentUri:e=>this.setCurrentUri(e)})}constructor(...e){super(...e),this.list=[]}}(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],iB.prototype,"openerService",void 0),iB=(0,e2.gn)([(0,e4.b)()],iB);var iW=Symbol("SidePanelHandlerFactory");class iF{create(e){this.side=e,this.container=this.createContainer()}createContainer(){var e,t=new rA({direction:"top-to-bottom",spacing:0}),n=new rL({layout:t});this.contentPanel=n;var{side:r}=this;switch(r){case"left":e="left-to-right";break;case"right":e="right-to-left";break;default:throw Error("Illegal argument: ".concat(r))}var o=new rA({direction:e,spacing:0}),a=new rN({layout:new rD});return a.addClass("flow-app-sidebar-container"),this.contentPanel.layout=t,rL.setStretch(a,0),rL.setStretch(n,1),o.addWidget(a),o.addWidget(n),new rL({layout:o})}expand(e){this.container.show()}}iF=(0,e2.gn)([(0,e4.b)()],iF);var iH=Symbol("DockPanelRendererFactory"),iU="flow-tabBar-active";class iV extends rX{get onDidChangeCurrent(){return this.onDidChangeCurrentEmitter.event}get currentTitle(){return this._currentTitle}markActiveTabBar(e){var t=Array.from(this.tabBars());t.forEach(e=>e.removeClass(iU));var n=e&&this.findTabBar(e);n?n.addClass(iU):t.length>0&&t[0].addClass(iU)}get currentTabBar(){return this._currentTitle&&this.findTabBar(this._currentTitle)}addWidget(e,t){if("single-document"!==this.mode||e.parent!==this)(null==t?void 0:t.addClickListener)&&this.addWidgetActiveListener(e),super.addWidget(e,t),this.markActiveTabBar(e.title)}setCurrent(e){if(this.toDisposeOnMarkAsCurrent.dispose(),null==e||e.owner.node.focus(),this._currentTitle!==e&&this.onDidChangeCurrentEmitter.fire(e),this._currentTitle=e,this.markActiveTabBar(e),e){var t=()=>this.setCurrent(void 0);e.owner.disposed.connect(t),this.toDisposeOnMarkAsCurrent.push(eX.JT.create(()=>e.owner.disposed.disconnect(t)))}}addWidgetActiveListener(e){var t=()=>{this._currentTitle!==e.title&&(e.activate(),this.setCurrent(e.title))};e.node.tabIndex=-1,this.toDisposeWidgetRemove[e.id]=eX.JT.create(()=>{e.node.removeEventListener("focus",t,!0)}),e.node.addEventListener("focus",t,!0)}initWidgets(){for(var e of this.widgets())this.addWidgetActiveListener(e)}findTabBar(e){return ry(this.tabBars(),t=>eu.firstIndexOf(t.titles,e)>-1)}handleEvent(e){var t,n,r,o,a=null===(t=e.source)||void 0===t?void 0:t.id;if((!!(null===(r=e.target)||void 0===r?void 0:null===(n=r.closest)||void 0===n?void 0:n.call(r,"#".concat(a)))||"lm-dragenter"!==e.type)&&(null===(o=this._options)||void 0===o?!void 0:!o.disabledSplitScreen))super.handleEvent(e)}activateWidget(e){super.activateWidget(e),this.markActiveTabBar(e.title)}onChildRemoved(e){super.onChildRemoved(e);var t,n=this.toDisposeWidgetRemove[null==e?void 0:null===(t=e.child)||void 0===t?void 0:t.id];n&&n.dispose()}constructor(e){super(e),this.onDidChangeCurrentEmitter=new eX.Q5,this.toDisposeOnMarkAsCurrent=new eX.K4,this.toDisposeWidgetRemove={},this._options=e,this._onCurrentChanged=(e,t)=>{this.setCurrent(t.currentTitle||void 0),super._onCurrentChanged(e,t)},this._onTabActivateRequested=(e,t)=>{this.setCurrent(t.title),super._onTabActivateRequested(e,t)}}}(iV||(iV={})).Factory=Symbol("FlowDockPanel#Factory");var iK=Symbol("ApplicationShellOptions");class iq extends rI{init(e){var t=this;return(0,e3._)(function*(){var n,r,o,a,{createLayout:s,splitScreenConfig:l,disableFullScreen:c}=e;t.disableFullScreen=c,t.mainPanel=t.createMainPanel((0,tm._)({splitOptions:null==l?void 0:null===(n=l.main)||void 0===n?void 0:n.splitOptions},null==l?void 0:null===(r=l.main)||void 0===r?void 0:r.dockPanelOptions)),t.bottomPanel=t.createBottomPanel((0,tm._)({splitOptions:null==l?void 0:null===(o=l.bottom)||void 0===o?void 0:o.splitOptions},null==l?void 0:null===(a=l.bottom)||void 0===a?void 0:a.dockPanelOptions)),t.bottomPanel.hide(),t.topPanel=t.createPanel(r6.TOP_BAR),t.rightToolbar=t.createPanel(r6.RIGHT_BAR),t.rightToolbar.hide(),t.statusBar=t.createPanel(r6.STATUS_BAR),t.activityBar=t.createPanel(r6.ACTIVITY_BAR),t.secondarySidebar=t.createPanel(r6.SECONDARY_SIDEBAR),t.leftPanelHandler=t.sidePanelHandlerFactory(),t.leftPanelHandler.create("left"),t.leftPanelHandler.expand(),t.primarySidebar=t.leftPanelHandler.contentPanel;var d=ir[r6.PRIMARY_SIDEBAR];t.primarySidebar.id=d.displayName,t.widgetManager.setWidget(d.toString(),t.primarySidebar),t.secondarySidebar.hide(),t.layout=(null==s?void 0:s(t))||t.createLayout(),t.activityBarWidget=yield t.widgetManager.getOrCreateWidgetFromURI(iO);try{t.statusBarWidget=yield t.widgetManager.getOrCreateWidgetFromURI(iI)}catch(e){}})()}addWidget(e,t){var n=this;return(0,e3._)(function*(){if(!e.id){console.error("Widgets added to the application shell must have a unique id property.");return}var{area:r,mode:o}=t||{};switch(r){case r6.MAIN_PANEL:n.mainPanel.mode=o||"multiple-document",n.mainPanel.addWidget(e,(0,tm._)({addClickListener:!0},null==t?void 0:t.addOptions));break;case r6.TOP_BAR:n.topPanel.addWidget(e);break;case r6.BOTTOM_PANEL:n.bottomPanel.addWidget(e);break;case r6.STATUS_BAR:n.statusBar.addWidget(e);break;case r6.ACTIVITY_BAR:n.activityBar.addWidget(e);break;case r6.PRIMARY_SIDEBAR:n.primarySidebar.addWidget(e);break;case r6.SECONDARY_SIDEBAR:n.secondarySidebar.addWidget(e);break;default:throw Error("Unexpected area: ".concat(null==t?void 0:t.area))}r!==r6.STATUS_BAR&&r!==r6.TOP_BAR&&n.track(e)})()}getWidgetArea(e){var{parent:t}=e;switch(t){case this.mainPanel:return r6.MAIN_PANEL;case this.topPanel:return r6.TOP_BAR;case this.bottomPanel:return r6.BOTTOM_PANEL;case this.statusBar:return r6.STATUS_BAR;case this.activityBar:return r6.ACTIVITY_BAR;case this.primarySidebar:return r6.PRIMARY_SIDEBAR;case this.secondarySidebar:return r6.SECONDARY_SIDEBAR}throw Error("Unknown widget area: ".concat(e.id))}getPanelFromArea(e){switch(e){case r6.TOP_BAR:return this.topPanel;case r6.ACTIVITY_BAR:return this.activityBar;case r6.BOTTOM_PANEL:return this.bottomPanel;case r6.PRIMARY_SIDEBAR:return this.primarySidebar;case r6.SECONDARY_SIDEBAR:return this.secondarySidebar;case r6.STATUS_BAR:return this.statusBar;case r6.RIGHT_BAR:return this.rightToolbar;default:return this.mainPanel}}setCurrentWidget(e){this._currentWidget=e,this._currentWidgetParent=null==e?void 0:e.parent}getCurrentWidget(e){var t;switch(e){case r6.MAIN_PANEL:t=this.mainPanel.currentTitle;break;case r6.BOTTOM_PANEL:t=this.bottomPanel.currentTitle;break;default:throw Error("Illegal argument: ".concat(e))}return t?t.owner:void 0}get currentWidget(){return this._currentWidget}createLayout(){var e=iC([this.mainPanel,this.bottomPanel],[1,0],{orientation:"vertical",spacing:0});this.bottomSplitLayout=e;var t=new rJ({layout:e}),n=iC([this.primarySidebar,t,this.secondarySidebar],[0,1,0],{orientation:"horizontal",spacing:0});this.leftRightSplitLayout=n;var r=new rJ({layout:n}),o=ik([this.activityBar,r,this.rightToolbar],[0,1,0],{direction:"left-to-right",spacing:0}),a=new rL({layout:o});return ik([this.topPanel,a,this.statusBar],[0,1,0],{direction:"top-to-bottom",spacing:0})}createPanel(e){var t=new rN,n=ir[e];return t.id=n.displayName,this.widgetManager.setWidget(n.toString(),t),t}createBottomPanel(e){var t=this.dockPanelRendererFactory();t.tabBarClasses.push("flow-app-bottom");var n=this.dockPanelFactory((0,tm._)({mode:"multiple-document",renderer:t,spacing:0},e)),r=ir[r6.BOTTOM_PANEL];return n.id=r.displayName,n.node.addEventListener("p-dragenter",e=>{e.preventDefault(),e.stopPropagation()}),this.widgetManager.setWidget(r.toString(),n),n}createMainPanel(e){var t=this.dockPanelRendererFactory(),n=this.dockPanelFactory((0,tm._)({mode:"multiple-document",renderer:t,spacing:0},e)),r=ir[r6.MAIN_PANEL];return n.id=r.displayName,this.widgetManager.setWidget(r.toString(),n),n}tabbarIntoView(e){var t,n=function(n){var r;null==n||null===(r=n.titles)||void 0===r||r.forEach(r=>{var o,a;if((null==r?void 0:null===(o=r.owner)||void 0===o?void 0:o.id)&&r.owner.id===(null===(a=t.currentWidget)||void 0===a?void 0:a.id)){var s,l,c="#shell-tab-".concat(null===(l=t.currentWidget)||void 0===l?void 0:null===(s=l.uri)||void 0===s?void 0:s.displayName),d=n.node.querySelector(c);setTimeout(()=>{null==d||d.scrollIntoView({behavior:e?"smooth":"auto"})},0)}})},{mainPanel:r}=this;for(var o of r.tabBars())t=this,n(o)}track(e){e instanceof r2&&(e.onActivate(()=>{this._currentWidget=e,e.parent&&(this._currentWidgetParent=e.parent),this.onCurrentWidgetChangeEmitter.fire(e),this.tabbarIntoView()}),e.onDispose(()=>{var t=e.getResourceURI();if(t){var n=this.closeWidgetUriStack.findIndex(e=>iS(e,t));-1!==n&&this.closeWidgetUriStack.splice(n,1),this.closeWidgetUriStack.push(t)}if(this._currentWidget===e){var r,o,a,s,l,c,d,u,h=null===(u=this._currentWidgetParent)||void 0===u?void 0:null===(d=u.selectedWidgets)||void 0===d?void 0:null===(c=d.call(u))||void 0===c?void 0:null===(l=c.next)||void 0===l?void 0:null===(s=l.call(c))||void 0===s?void 0:s.value;this._currentWidget=h,this.onCurrentWidgetChangeEmitter.fire(h),this.tabbarIntoView()}!(null===(a=this.bottomPanel.selectedWidgets())||void 0===a?void 0:null===(o=a.next)||void 0===o?void 0:null===(r=o.call(a))||void 0===r?void 0:r.value)&&this.bottomPanel.hide()}))}getLayoutData(){var e=[];return this.primarySidebar.widgets.forEach(t=>{e.push(t)}),{version:.2,mainPanel:(0,tv._)((0,tm._)({},this.mainPanel.saveLayout()),{mode:this.mainPanel.mode}),bottomPanel:(0,tv._)((0,tm._)({},this.bottomPanel.saveLayout()),{expanded:this.bottomPanel.isHidden}),primarySidebar:{widgets:e},split:{main:this.bottomSplitLayout.relativeSizes(),leftRight:this.leftRightSplitLayout.relativeSizes()}}}setLayoutData(e){var{version:t}=e;if(!(t&&Number(t)>.2)){var{mainPanel:n,bottomPanel:r,split:o}=e;if(n&&(this.mainPanel.restoreLayout(n),n.mode===ip&&(this.mainPanel.mode=ip),this.mainPanel.initWidgets()),r){var{expanded:a}=r,s=(0,ij._)(r,["expanded"]);this.bottomPanel.restoreLayout(s),!a&&this.bottomPanel.show()}(null==o?void 0:o.main)&&(this.bottomSplitLayout.setRelativeSizes(o.main),window.temp=this.bottomSplitLayout),(null==o?void 0:o.leftRight)&&this.leftRightSplitLayout.setRelativeSizes(o.leftRight)}}constructor(e,t,n={}){super(n),this.dockPanelRendererFactory=e,this.sidePanelHandlerFactory=t,this.closeWidgetUriStack=[],this.onCurrentWidgetChangeEmitter=new eX.Q5,this.onCurrentWidgetChange=this.onCurrentWidgetChangeEmitter.event}}(0,e2.gn)([(0,e8.f)(iV.Factory),(0,e2.w6)("design:type",void 0===iV||void 0===iV.Factory?Object:iV.Factory)],iq.prototype,"dockPanelFactory",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],iq.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(no),(0,e2.w6)("design:type",void 0===no?Object:no)],iq.prototype,"navigationHistory",void 0),iq=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(iH)),(0,e2.fM)(1,(0,e8.f)(iW)),(0,e2.fM)(2,(0,e8.f)(iK)),(0,e2.fM)(2,(0,tY.j)()),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[Function,Function,"undefined"==typeof RecursivePartial?Object:RecursivePartial])],iq);class iZ{show(){this.debugBarWidget.show(),this.debugBarWidget.update()}hide(){this.debugBarWidget.hide(),this.debugBarWidget.update()}createPortal(){var e=this.debugBarWidget.render.bind(this.debugBarWidget),t=ix(this.debugBarWidget,e,this.viewOptions.widgetFallbackRender);return this.shell.node.insertBefore(this.debugBarWidget.node,null),this.hide(),t}}(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iZ.prototype,"viewOptions",void 0),(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],iZ.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iv),(0,e2.w6)("design:type",void 0===iv?Object:iv)],iZ.prototype,"debugBarWidget",void 0),iZ=(0,e2.gn)([(0,e4.b)()],iZ);class iY{addReactPortal(e){if(this.widgets.has(e))return e;var t=e.render.bind(e);this.widgets.add(e);var n=ix(e,t,this.viewOptions.widgetFallbackRender);return e.onDispose(()=>{var t=this.reactPortals.indexOf(n);this.widgets.delete(e),this.reactPortals.splice(t,1),this.fireViewChange()}),this.reactPortals.push(n),this.fireViewChange(),e}toReactComponent(e){if(this.reactComp)return this.reactComp;!this.globalReactPortals.length&&(null===(n=this.viewOptions)||void 0===n?void 0:null===(t=n.defaultLayoutData)||void 0===t?void 0:t.debugBar)&&this.globalReactPortals.push(this.debugService.createPortal());var t,n,r=t=>{var{className:n=""}=t,r=this.reactPortals,o=(0,eX.JA)(),a=(0,tq.useRef)(null);return(0,tq.useEffect)(()=>{var t=this.onViewChange(o);return rI.attach(e,a.current||document.body),this.eventService.listenGlobalEvent("resize",()=>{e.update()}),()=>{t.dispose()}},[]),(0,tK.jsxs)("div",{className:"".concat("flowide-container"," ").concat(n),ref:a,children:[this.globalReactPortals.map(e=>{var t=e.comp;return(0,tK.jsx)(t,{},e.key)}),r.map(e=>{var t=e.comp;return(0,tK.jsx)(t,{},e.key)})]})};return this.reactComp=r,r}constructor(){this.onViewChangeEmitter=new eX.Q5,this.onViewChange=this.onViewChangeEmitter.event,this.widgets=new Set,this.reactPortals=[],this.globalReactPortals=[],this.fireViewChange=(0,tF.debounce)(()=>{this.onViewChangeEmitter.fire()},0)}}(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iY.prototype,"viewOptions",void 0),(0,e2.gn)([(0,e8.f)(nY),(0,e2.w6)("design:type",void 0===nY?Object:nY)],iY.prototype,"eventService",void 0),(0,e2.gn)([(0,e8.f)(iZ),(0,e2.w6)("design:type",void 0===iZ?Object:iZ)],iY.prototype,"debugService",void 0),iY=(0,e2.gn)([(0,e4.b)()],iY);var iX=Symbol("CustomPreferenceContribution");(eU||(eU={})).is=function(e){return(0,eX.Kn)(e)&&(0,tF.isFunction)(e.storeState)&&(0,tF.isFunction)(e.restoreState)};class iQ{init(e){this.windowService.onStart(),this.viewOptions=e;var{getStorageKey:t}=e||{};for(var n of(t&&(this.storageKey=t()),this.disabled=this.storageService.getData("layout/disabled/v2",!!e.restoreDisabled),!this.disabled&&(this.unloadEvent=this.windowService.onUnload(()=>{eX.kg.log("LayoutRestorer: unload"),this.storeLayout()})),(e.customPreferenceConfigs||[]).forEach(e=>{this.customPreferenceConfig.push(e)}),this.contributions))n.registerCustomPreferences(this);this.customPreferenceConfig.forEach(e=>{this.customPreferenceValue[e.key]=this.storageService.getData(e.key,e.default)}),this.initd.fire()}setCustomPreferenceValue(e,t){this.customPreferenceValue[e]=t,this.storageService.setData(e,t),this.onCustomPreferenceChangeEmitter.fire({key:e,value:t})}getCustomPreferenceValue(e){return this.customPreferenceValue[e]}registerCustomPreferenceConfig(e){this.customPreferenceConfig.push(e)}ban(e){if(e!==this.disabled){if(e){var t;null===(t=this.unloadEvent)||void 0===t||t.dispose()}else this.unloadEvent=this.windowService.onUnload(()=>{eX.kg.log("LayoutRestorer: unload"),this.storeLayout()});this.disabled=e,this.storageService.setData("layout/disabled/v2",e)}}isWidgetProperty(e){return"widget"===e}isWidgetsProperty(e){return"widgets"===e}deflate(e){if(void 0!==e)return JSON.stringify(e,(e,t)=>{if(this.isWidgetProperty(e))return this.convertToDescription(t);if(this.isWidgetsProperty(e)){var n=[];for(var r of t){var o=this.convertToDescription(r);o&&n.push(o)}return n}if("currentUri"===e&&t)return t.toString();return t})}inflate(e){var t=this;return(0,e3._)(function*(){if(void 0===e)return{};var n=new eV.ParseContext,r=t.parse(e,n);return yield n.inflate(),r})()}parse(e,t){return JSON.parse(e,(e,n)=>{if(this.isWidgetsProperty(e)){for(var r,o=function(e){var n=r;t.push((0,e3._)(function*(){a[e]=yield n.convertToWidget(s[e])}))},a=t.filteredArray(),s=n,l=0;l<s.length;l++)r=this,o(l);return a}if((0,eX.Kn)(n)&&!Array.isArray(n)){var c,d=function(e){if(c.isWidgetProperty(e)){var r=c;t.push((0,e3._)(function*(){u[e]=yield r.convertToWidget(n[e])}))}else u[e]=n[e]},u={};for(var h in n)c=this,d(h);return u}if("currentUri"===e&&n)return new tD(n);return n})}convertToWidget(e){var t=this;return(0,e3._)(function*(){if(!e.uriStr)return;var n,r=new tD(e.uriStr),o=t.widgetManager.getFactoryFromURI(r),a=yield t.widgetManager.getOrCreateWidgetFromURI(r,o);if(t.viewRenderer.addReactPortal(a),t.applicationShell.track(a),eU.is(a)&&void 0!==e.innerWidgetState){if("string"==typeof e.innerWidgetState){var s=new eV.ParseContext;n=t.parse(e.innerWidgetState,s),yield s.inflate()}else n=e.innerWidgetState;a.restoreState(n)}if(!a.isDisposed)return a})()}convertToDescription(e){var t;if(!!e.uri)return{uriStr:(null==e?void 0:null===(t=e.uri)||void 0===t?void 0:t.toString())||"",innerWidgetState:eU.is(e)?this.deflate(e.storeState()):void 0}}storeLayout(){if(!this.disabled){var e=this.applicationShell.getLayoutData(),t=this.deflate((0,tv._)((0,tm._)({},e),{innerState:this.innerState}));eX.kg.log("layout restorer data: ",t),this.storageService.setData(iQ.storageKey+this.storageKey,t)}}restoreLayout(){var e=this;return(0,e3._)(function*(){if(!e.disabled){var t=e.storageService.getData(iQ.storageKey+e.storageKey),n=yield e.inflate(t),{innerState:r}=n,o=(0,ij._)(n,["innerState"]);eX.kg.log("layout restorer layout data:",o),eX.kg.log("layout restorer inner data:",r),void 0!==r&&(0,eX.Kn)(r)&&(e.innerState=r),e.applicationShell.setLayoutData(o)}})()}storeWidget(e){if(eU.is(e)&&e.uri){var t=e.storeState();this.innerState[e.uri.toString()]=t}}restoreWidget(e){if(eU.is(e)&&e.uri){var t=e.uri.toString(),n=this.innerState[t];void 0!==n&&e.restoreState(n)}}constructor(){this.innerState={},this.initd=new eX.Q5,this.onDidInit=this.initd.event,this.storageKey="",this.disabled=!1,this.customPreferenceConfig=[],this.customPreferenceValue={},this.onCustomPreferenceChangeEmitter=new eX.Q5,this.onCustomPreferenceChange=this.onCustomPreferenceChangeEmitter.event,this.contributions=[]}}iQ.storageKey="layout",(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],iQ.prototype,"applicationShell",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],iQ.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(tu),(0,e2.w6)("design:type",void 0===tu?Object:tu)],iQ.prototype,"storageService",void 0),(0,e2.gn)([(0,e8.f)(tp),(0,e2.w6)("design:type",void 0===tp?Object:tp)],iQ.prototype,"windowService",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],iQ.prototype,"widgetManager",void 0),(0,e2.gn)([(0,tZ.n)(iX),(0,tY.j)(),(0,e2.w6)("design:type",Array)],iQ.prototype,"contributions",void 0),iQ=(0,e2.gn)([(0,e4.b)()],iQ),(eV||(eV={})).ParseContext=class e{push(e){this.toInflate.push(e)}filteredArray(){var e=[];return this.toFilter.push(e),e}inflate(){var e=this;return(0,e3._)(function*(){for(var t=[];e.toInflate.length;)t.push(e.toInflate.pop()());yield Promise.all(t),e.toFilter.length&&e.toFilter.forEach(e=>{for(var t=0;t<(null==e?void 0:e.length);t++)void 0===e[t]&&e.splice(t--,1)})})()}constructor(){this.toInflate=[],this.toFilter=[]}};var iG=Symbol("ViewContribution");class iJ{init(e){var t=this;return(0,e3._)(function*(){t.mergeOptions(e);var n,r,o,a,s,{widgetFactories:l}=e;t.widgetManager.init(l),t.layoutRestorer.init(e),yield t.shell.init({createLayout:e.customLayout,splitScreenConfig:null===(n=e.presetConfig)||void 0===n?void 0:n.splitScreenConfig,disableFullScreen:null===(r=e.presetConfig)||void 0===r?void 0:r.disableFullScreen}),(null===(a=t.options)||void 0===a?void 0:null===(o=a.defaultLayoutData)||void 0===o?void 0:o.debugBar)&&t.debugWidget.initContent(null===(s=e.defaultLayoutData)||void 0===s?void 0:s.debugBar)})()}attach(e){var t=this;return(0,e3._)(function*(){yield t.layoutRestorer.restoreLayout(),null===(r=e.defaultLayoutData)||void 0===r||null===(n=r.defaultWidgets)||void 0===n||n.forEach(e=>{t.openerService.open(e)});var n,r,o,a,s,l=t.shell.activityBarWidget;t.viewRenderer.addReactPortal(l),null==l||null===(a=l.initView)||void 0===a||a.call(l,(null===(o=e.defaultLayoutData)||void 0===o?void 0:o.activityBarItems)||[]),t.shell.addWidget(l,{area:r6.ACTIVITY_BAR});var c=t.shell.statusBarWidget;c&&(t.viewRenderer.addReactPortal(c),c.initView((null===(s=e.defaultLayoutData)||void 0===s?void 0:s.statusBarItems)||[]),t.shell.addWidget(c,{area:r6.STATUS_BAR}))})()}mergeOptions(e){this.viewContributions.getContributions().forEach(t=>{t.registerView({register:t=>{(0,tF.mergeWith)(e,t,(e,t,n)=>{if(["widgetFactories","activityBarItems","statusBarItems","defaultWidgets"].includes(n))return[...e||[],...t]})}})})}}(0,e2.gn)([(0,e8.f)(eX.Qc),(0,e9.t)(iG),(0,e2.w6)("design:type",void 0===eX.Qc?Object:eX.Qc)],iJ.prototype,"viewContributions",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],iJ.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(r7),(0,e2.w6)("design:type",void 0===r7?Object:r7)],iJ.prototype,"options",void 0),(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],iJ.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],iJ.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(iQ),(0,e2.w6)("design:type",void 0===iQ?Object:iQ)],iJ.prototype,"layoutRestorer",void 0),(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],iJ.prototype,"openerService",void 0),(0,e2.gn)([(0,e8.f)(iv),(0,e2.w6)("design:type",void 0===iv?Object:iv)],iJ.prototype,"debugWidget",void 0),iJ=(0,e2.gn)([(0,e4.b)()],iJ);class i${canHandle(){return 1}hidePanelArea(e){var t=this;return(0,e3._)(function*(){var n,r,o=yield t.widgetManager.getWidget(ir[e].toString());null==o||null===(r=o.widgets)||void 0===r||null===(n=r.forEach)||void 0===n||n.call(r,e=>e.hide())})()}bindWidget(e){var t=this;return(0,e3._)(function*(){var n=t.widgetManager.getFactoryFromURI(e),r=yield t.widgetManager.getOrCreateWidgetFromURI(e,n),o=n.area||r6.MAIN_PANEL;return t.viewRenderer.addReactPortal(r),{widget:r,area:o}})()}open(e,t){var n=this;return(0,e3._)(function*(){var r,o,a,s,l,c,d,{widget:u,area:h}=yield n.bindWidget(e);if([r6.MAIN_PANEL,r6.BOTTOM_PANEL].includes(h)){!u.isAttached&&(n.shell.addWidget(u,(0,tv._)((0,tm._)({},t),{area:h})),n.layoutRestorer.restoreWidget(u),u.onDispose(()=>n.layoutRestorer.storeWidget(u))),null===(r=u.parent)||void 0===r||r.show(),h===r6.BOTTOM_PANEL&&n.shell.bottomSplitLayout.absoluteSizes()[1]<26&&n.shell.bottomSplitLayout.setRelativeSizes([.7,.3]),u.uri=e,null===(o=u.parent)||void 0===o||o.activateWidget(u),null===(a=u.onOpenRequest)||void 0===a||a.call(u,e,t);return}if(u.isAttached){if((null===(l=u.parent)||void 0===l?void 0:l.isHidden)&&u.parent.show(),!u.isHidden&&(h===r6.PRIMARY_SIDEBAR||h===r6.SECONDARY_SIDEBAR)){null===(d=u.parent)||void 0===d||d.hide(),yield n.hidePanelArea(h);return}yield n.hidePanelArea(h),u.uri=e,null===(c=u.onOpenRequest)||void 0===c||c.call(u,e,t),u.show()}else yield n.hidePanelArea(h),n.shell.addWidget(u,{area:h}),null===(s=u.parent)||void 0===s||s.show()})()}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],i$.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],i$.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],i$.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(iQ),(0,e2.w6)("design:type",void 0===iQ?Object:iQ)],i$.prototype,"layoutRestorer",void 0),i$=(0,e2.gn)([(0,e4.b)()],i$);var i0=Symbol("TabBarToolbarFactory");class i1 extends r2{initAlign(e){e&&(this.align=e)}updateURI(e){this.currentURI=e,this.update()}render(){var e=this.currentURI,t=(0,tq.useMemo)(()=>{if(!!e){var t=this.widgetManager.getFactoryFromURI(e),n=this.widgetManager.getWidgetFromURI(e,t);return((null==t?void 0:t.toolbarItems)||[]).filter(e=>this.align?e.align===this.align:!e.align||e.align===r4.TRAILING).map((e,t)=>{if(e.render)r=e.render(n);else if(e.commandId){var r,o,a,s=this.commandRegistry.getCommand(e.commandId);o=this.shortcutsService.getLabelWithShortcutUI(e.commandId),(null==s?void 0:s.icon)&&(r=(0,tK.jsx)("div",{className:iu,children:(0,eX.mf)(s.icon)?s.icon(n):null==s?void 0:s.icon}),a=()=>this.commandRegistry.executeCommand(e.commandId,n))}return r?(0,tK.jsx)("div",{className:id,onMouseEnter:e=>{o&&this.hoverService.requestHover({content:o,target:e.currentTarget,position:"bottom"})},onClick:a,children:r},e.commandId||t):null})}},[e]);return(0,tK.jsx)("div",{className:ic,children:t})}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],i1.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],i1.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],i1.prototype,"hoverService",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],i1.prototype,"commandRegistry",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],i1.prototype,"widgetManager",void 0),i1=(0,e2.gn)([(0,e4.b)()],i1);var i2=Symbol("MenuFactory");class i4 extends rI{dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){for(var e=this;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){for(var e=this;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("flow-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){if((e<0||e>=this._items.length)&&(e=-1),-1!==e&&!eK.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e)this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update()}get items(){return this._items}activateNextItem(){var e=this._items.length,t=this._activeIndex,n=t<e-1?t+1:0;this.activeIndex=eu.findFirstIndex(this._items,eK.canActivate,n,0===n?e-1:n-1)}activatePreviousItem(){var e=this._items.length,t=this._activeIndex,n=t<=0?e-1:t-1;this.activeIndex=eu.findLastIndex(this._items,eK.canActivate,n,n===e-1?0:n+1)}triggerActiveItem(){if(!this.isAttached)return;var e=this.activeItem;if(!!e){if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"===e.type){this._openChildMenu(!0);return}this.rootMenu.close();var{command:t,args:n}=e;this.commands.isEnabled(t,n)?this.commands.executeCommand(t,n):eX.kg.log("Menu [error] Command '".concat(t,"' is disabled."))}}addItem(e){return this.insertItem(this._items.length,e)}insertItem(e,t){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(e,this._items.length)),r=eK.createItem(this,t);return eu.insert(this._items,n,r),this.update(),r}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){if(this.isAttached&&this.close(),this.activeIndex=-1,!!eu.removeAt(this._items,e))this.update()}clearItems(){if(this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length)this._items.length=0,this.update()}open(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.isAttached){var r=n.forceX||!1,o=n.forceY||!1;eK.openRootMenu(this,e,t,r,o),this.activate()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mouseup":this._evtMouseUp(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseenter":this._evtMouseEnter(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"mousedown":this._evtMouseDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)}onActivateRequest(e){this.isAttached&&this.node.focus()}onUpdateRequest(e){for(var t,n=function(e,n){var c,d=r[e],u=s[e],h="string"==typeof d.tooltip?d.tooltip:null===(c=d.tooltip)||void 0===c?void 0:c.call(d,{disabled:!d.isEnabled});l[e]=o.renderItem({item:d,active:e===a,collapsed:u,onfocus:()=>{t.activeIndex=e},onmouseenter:e=>{t.hoverService.requestHover({content:h,target:e.currentTarget,position:"right",offset:4})}},t.commands,t.shortcutsService)},r=this._items,{renderer:o}=this,a=this._activeIndex,s=eK.computeCollapsed(r),l=Array(r.length),c=0,d=r.length;c<d;++c)t=this,n(c,d);eM.render(l,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());var n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();var t=e.keyCode;if(13===t){this.triggerActiveItem();return}if(27===t){this.close();return}if(37===t){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(38===t){this.activatePreviousItem();return}if(39===t){var n=this.activeItem;n&&"submenu"===n.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(40===t){this.activateNextItem();return}}_evtMouseUp(e){if(0===e.button)e.preventDefault(),e.stopPropagation(),this.triggerActiveItem()}_evtMouseMove(e){var t=eu.findFirstIndex(this.contentNode.children,t=>ev.hitTest(t,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,(t=this.activeIndex)===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;if(!!n&&"submenu"===n.type&&!!n.submenu)this._startOpenTimer()}_evtMouseEnter(e){for(var t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var{clientX:t,clientY:n}=e;if(ev.hitTest(this._childMenu.node,t,n)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){if(!this._parentMenu)eK.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close()}_openChildMenu(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.activeItem;if(!t||"submenu"!==t.type||!t.submenu){this._closeChildMenu();return}var{submenu:n}=t;if(n!==this._childMenu){i4.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,ef.sendMessage(this,rI.Msg.UpdateRequest);var r=this.contentNode.children[this._activeIndex];eK.openSubmenu(n,r),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},eK.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},eK.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){eK.saveWindowData()}constructor(){super({node:eK.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new rE(this),this._menuRequested=new rE(this),this.addClass("flow-Menu"),this.setFlag(rI.Flag.DisallowLayout),this.renderer=i4.defaultRenderer}}(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],i4.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],i4.prototype,"commands",void 0),(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],i4.prototype,"hoverService",void 0),!function(e){class t{renderItem(e,t,n){var r,o=this.createItemClass(e),a=this.createItemARIA(e),s=e.item.submenu,l=[this.renderLabel(e,t),this.renderShortcut(e,n)];s&&l.push(this.renderSubmenu(e));var c=null==e?void 0:null===(r=e.item)||void 0===r?void 0:r.tooltip;return rW.div((0,tm._)({className:o,tabindex:"0",onfocus:e.onfocus},a,c?{onmouseenter:e.onmouseenter}:{}),...l)}renderLabel(e,t){var n=this.formatLabel(e,t);return rW.div({className:"flow-Menu-itemLabel"},n)}renderShortcut(e,t){var n="",{command:r,customShortcut:o}=e.item,a=t.getShortcutByCommandId(r);return a&&(n=a.map(e=>e.join(" ")).join(" / ")),o&&(n=o),rW.div({className:"flow-Menu-itemShortcut"},n)}renderSubmenu(e){var t=e.item.submenu;return rW.div({className:t?"flow-Menu-itemSubmenuIcon":""})}createItemClass(e){var t="flow-Menu-item";!e.item.isEnabled&&(t+=" flow-mod-disabled"),e.item.isToggled&&(t+=" flow-mod-toggled"),!e.item.isVisible&&(t+=" flow-mod-hidden"),e.active&&(t+=" flow-mod-active"),e.collapsed&&(t+=" flow-mod-collapsed");var n=e.item.className;return n&&(t+=" ".concat(n)),t}createItemARIA(e){var t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",!e.item.isEnabled&&(t["aria-disabled"]="true");break;default:!e.item.isEnabled&&(t["aria-disabled"]="true"),t.role="menuitem"}return t}formatLabel(e,t){var n,{command:r}=e.item,o=null===(n=t.getCommand(r))||void 0===n?void 0:n.label;return[rW.span({className:"flow-Menu-itemMnemonic"},o||"")]}}e.Renderer=t,e.defaultRenderer=new t}((i4=(0,e2.gn)([(0,e4.b)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[])],i4))||(i4={})),!function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;var t=null,n=0;function r(){return n>0?(n--,t):a()}e.saveWindowData=function(){t=a(),n++};function o(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}e.createNode=function(){var e=document.createElement("div"),t=document.createElement("ul");return t.className="flow-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},e.canActivate=o;e.createItem=function(e,t){return new s(e.commands,t)};e.hitTestMenus=function(e,t,n){for(var r=e;r;r=r.childMenu)if(ev.hitTest(r.node,t,n))return!0;return!1};function a(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}e.computeCollapsed=function(e){var t=Array(e.length);eu.fill(t,!1);for(var n=0,r=e.length;n<r;++n){var o=e[n];if(!!o.isVisible){if("separator"!==o.type)break;t[n]=!0}}for(var a=r-1;a>=0;--a){var s=e[a];if(!!s.isVisible){if("separator"!==s.type)break;t[a]=!0}}for(var l=!1;++n<a;){var c=e[n];if(!!c.isVisible)"separator"!==c.type?l=!1:l?t[n]=!0:l=!0}return t};e.openRootMenu=function(e,t,n,o,a){var s=r(),l=s.pageXOffset,c=s.pageYOffset,d=s.clientWidth,u=s.clientHeight;ef.sendMessage(e,rI.Msg.UpdateRequest);var h=u-(a?n:0),{node:p}=e,{style:f}=p;f.opacity="0",f.maxHeight="".concat(h,"px"),rI.attach(e,document.body);var{width:m,height:v}=p.getBoundingClientRect();!o&&t+m>l+d&&(t=l+d-m),!a&&n+v>c+u&&(n>c+u?n=c+u-v:n-=v),f.transform="translate(".concat(Math.max(0,t),"px, ").concat(Math.max(0,n),"px"),f.opacity="1"};e.openSubmenu=function(t,n){var o=r(),a=o.pageXOffset,s=o.pageYOffset,l=o.clientWidth,c=o.clientHeight;ef.sendMessage(t,rI.Msg.UpdateRequest);var{node:d}=t,{style:u}=d;u.opacity="0",u.maxHeight="".concat(c,"px"),rI.attach(t,document.body);var{width:h,height:p}=d.getBoundingClientRect(),f=ev.boxSizing(t.node),m=n.getBoundingClientRect(),v=m.right-e.SUBMENU_OVERLAP;v+h>a+l&&(v=m.left+e.SUBMENU_OVERLAP-h);var g=m.top-f.borderTop-f.paddingTop;g+p>s+c&&(g=m.bottom+f.borderBottom+f.paddingBottom-p),u.transform="translate(".concat(Math.max(0,v),"px, ").concat(Math.max(0,g),"px"),u.opacity="1"};e.findMnemonic=function(e,t,n){for(var r=-1,a=-1,s=!1,l=t.toUpperCase(),c=0,d=e.length;c<d;++c){var u=(c+n)%d,h=e[u];if(!o(h))continue;var{label:p}=h;if(0!==p.length){var f=h.mnemonic;if(f>=0&&f<p.length){p[f].toUpperCase()===l&&(-1===r?r=u:s=!0);continue}-1===a&&p[0].toUpperCase()===l&&(a=u)}}return{index:r,multiple:s,auto:a}};class s{get label(){if("command"===this.type){var e;return(null===(e=this._commands.getCommand(this.command))||void 0===e?void 0:e.label)||""}return"submenu"===this.type&&this.submenu?this.submenu.title.label:""}get iconLabel(){if("command"===this.type){var e;return(null===(e=this._commands.getCommand(this.command))||void 0===e?void 0:e.icon)||""}return"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""}get className(){return"command"===this.type?this.command:"submenu"===this.type&&this.submenu?this.submenu.title.className:""}get isEnabled(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get isToggled(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)}get isVisible(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get keyBinding(){return this.type,null}constructor(e,t){this._commands=e,this.type=t.type||"command",this.command=t.command||"",this.args=t.args||Object.freeze({}),this.submenu=t.submenu||null,this.tooltip=t.tooltip,this.customShortcut=t.customShortcut}}}(eK||(eK={}));class i6{init(){this.menu=this.menuFactory()}deleteItem(e){if("string"==typeof e){var t=this._items.find(t=>t.command===e);eu.removeFirstOf(this._items,t)}else this._items.forEach(t=>{e(t.command)&&eu.removeFirstOf(this._items,t)})}addItem(e){var t=eq.createItem(e,this._idTick++);return this._items.push(t),eX.JT.create(()=>{eu.removeFirstOf(this._items,t)})}close(){this.menu.close()}open(e,t){if(i4.saveWindowData(),this.menu.clearItems(),0===this._items.length)return!1;var n=eq.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);if(!n||0===n.length)return!1;for(var r of n){if(t&&(r.args=t),!r.filter||!!r.filter(t))this.menu.addItem(r)}return this.menu.open(e.clientX,e.clientY),!0}constructor(){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0}}(0,e2.gn)([(0,e8.f)(i2),(0,e2.w6)("design:type",void 0===i2?Object:i2)],i6.prototype,"menuFactory",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],i6.prototype,"init",null),i6=(0,e2.gn)([(0,e4.b)()],i6),!function(e){e.createItem=function(e,t){var n=function(e){if(-1!==e.indexOf(","))throw Error("Selector cannot contain commas: ".concat(e));if(!ey.isValid(e))throw Error("Invalid selector: ".concat(e));return e}(e.selector),r=void 0!==e.rank?e.rank:1/0;return(0,tv._)((0,tm._)({},e),{selector:n,rank:r,id:t})};e.matchItems=function(e,r,o,a){var s=r.target;if(!s)return null;var l=r.currentTarget;if(!l)return null;for(var c=[],d=e.slice();null!==s;){for(var u=[],h=0,p=d.length;h<p;++h){var f=d[h];if(!!f&&!!ey.matches(s,f.selector))u.push(f),d[h]=null}if(0!==u.length&&(o&&u.sort(a?n:t),c.push(...u)),s===l)break;s=s.parentElement}return!o&&c.sort(a?n:t),c};function t(e,t){var n=e.rank,r=t.rank;return n!==r?n<r?-1:1:e.id-t.id}function n(e,n){var r=ey.calculateSpecificity(e.selector),o=ey.calculateSpecificity(n.selector);return r!==o?o-r:t(e,n)}}(eq||(eq={}));var i5=Symbol("MenuService");class i3{onInit(){}clearMenuItems(e){e.forEach(e=>{this.contextMenu.deleteItem(e)})}clearMenuItem(e){}addMenuItem(e){this.contextMenu.addItem(e)}createSubMenu(){return this.menuFactory()}addSubMenuItem(e,t){e.addItem(t)}open(e,t){return this.contextMenu.open(e,t)}close(){this.contextMenu.close()}}(0,e2.gn)([(0,e8.f)(i6),(0,e2.w6)("design:type",void 0===i6?Object:i6)],i3.prototype,"contextMenu",void 0),(0,e2.gn)([(0,e8.f)(i2),(0,e2.w6)("design:type",void 0===i2?Object:i2)],i3.prototype,"menuFactory",void 0),i3=(0,e2.gn)([(0,e4.b)()],i3);var i8=e0({containerModules:[new eQ.n(e=>{e(i5).toService(i3),(0,eX.KV)(e,i3,[eG]),e(i2).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(i4).toSelf().inSingletonScope(),t.get(i4)}),e(i6).toSelf().inSingletonScope()})]}),i9=Symbol("TabBarRendererFactory");(0,rp.GW)((0,e4.b)(),rZ.Renderer);class i7 extends rZ.Renderer{dispose(){this.toDispose.dispose()}set tabBar(e){if(this._tabBar!==e)this._tabBar=e}get tabBar(){return this._tabBar}renderTab(e,t,n){var r=e.title,o=this.shortcutsService.getLabelWithShortcutUI(eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET),a=this.tabBar&&"horizontal"===this.tabBar.orientation&&"string"==typeof r.label?{onmouseenter:e=>this.handleMouseEnterEvent(e,r)}:{title:r.caption};return rW.li((0,tv._)((0,tm._)({},a),{key:this.createTabKey(e),className:this.createTabClass(e),id:this.createTabId(r,n),style:this.createTabStyle(e),dataset:this.createTabDataset(e),ondblclick:e=>this.handleDblClickEvent(e,r),onauxclick:e=>{e.preventDefault()},onclick:e=>this.handleClickEvent(e,r),oncontextmenu:e=>{this.menuService.open(e,r.owner),e.stopPropagation(),e.preventDefault()}}),rW.div({className:"flow-tab-icon-label"},this.renderIcon(e),this.renderLabel(e)),rW.div({className:r.saving?"lm-TabBar-tabCloseIcon saving action-label ".concat(iu):"lm-TabBar-tabCloseIcon action-label ".concat(iu),onmouseenter:e=>{e.stopPropagation(),o&&this.hoverService.requestHover({content:o,position:"bottom",target:e.target})},onclick:e=>this.handleCloseClickEvent(e,r),ondblclick:e=>e.stopPropagation()}))}createTabClass(e){var t,n=super.createTabClass(e);return!(null===(t=e.visible)||void 0===t||t)&&(n+=" p-mod-invisible"),n}handleClickEvent(e,t){this.menuService.close()}createTabId(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"shell-tab-".concat(null===(n=e.owner)||void 0===n?void 0:null===(t=n.uri)||void 0===t?void 0:t.displayName).concat(r?"-hidden":"")}createTabStyle(e){return function(e){var t,n,r="".concat(e.zIndex),{labelSize:o}=e,{iconSize:a}=e;if(o||a){var s=o?o.height:0,l=a?a.height:0,c=e.paddingTop||0;s>0&&l>0&&(c*=1.5);var d=e.paddingBottom||0;t="".concat(s+l+c+d,"px")}return{zIndex:r,height:t,minWidth:n=e.tabWidth?"".concat(e.tabWidth,"px"):"",maxWidth:n}}(e)}renderLabel(e){var t,n,r,{labelSize:o}=e,{iconSize:a}=e;if(o&&(t="".concat(o.width,"px"),n="".concat(o.height,"px")),e.paddingTop||a){var s=a?a.height:0,l=e.paddingTop||0;s>0&&(l*=1.5),r="".concat(l+s,"px")}var c={width:t,height:n,top:r};return"string"==typeof e.title.label?rW.div({className:"flow-TabBar-tabLabel-text",style:c},e.title.label):rF("div",{className:"flow-TabBar-tabLabel",style:c},{render:t=>{var n=this.labelNodeRoot.get(t);if(n)n.render(e.title.label);else{var r=(0,iR.createRoot)(t);r.render(e.title.label),this.labelNodeRoot.set(t,r)}},unrender:e=>{var t=this.labelNodeRoot.get(e);t&&(t.unmount(),this.labelNodeRoot.delete(e))}})}renderIcon(e){if(!e.title.iconLabel)return rW.div();e.paddingTop&&(t="".concat(e.paddingTop||0,"px"));var t,n={top:t},r=this.createIconClass(e);return"string"==typeof e.title.iconLabel?rW.i({className:ib(e.title.iconLabel)}):rF("div",{className:r,style:n},{render:t=>{var n=this.iconNodeRoot.get(t);if(n)n.render(e.title.iconLabel);else{var r=(0,iR.createRoot)(t);this.iconNodeRoot.set(t,r),r.render(e.title.iconLabel)}},unrender:e=>{var t=this.labelNodeRoot.get(e);t&&(t.unmount(),this.labelNodeRoot.delete(e))}})}constructor(){super(),this.toDispose=new eX.K4,this.iconNodeRoot=new WeakMap,this.labelNodeRoot=new WeakMap,this.handleMouseEnterEvent=(e,t)=>{if(this.tabBar&&this.hoverService&&e.currentTarget instanceof HTMLElement&&t){var n=t.label||t.caption;"horizontal"===this.tabBar.orientation?n&&this.hoverService.requestHover({content:n,target:e.currentTarget,position:"bottom"}):n&&this.hoverService.requestHover({content:n,target:e.currentTarget,position:"right"})}},this.handleCloseClickEvent=(e,t)=>{e.stopPropagation(),e.preventDefault(),this.tabBar&&e.currentTarget instanceof HTMLElement&&((null==t?void 0:t.saving)?this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,[t]):null==t||t.owner.close())},this.handleDblClickEvent=(e,t)=>{if(!this.shell.disableFullScreen){var n,r,o=(null==t?void 0:null===(r=t.owner)||void 0===r?void 0:null===(n=r.parent)||void 0===n?void 0:n.id)===ie;this.tabBar&&e.currentTarget instanceof HTMLElement&&o&&this.commandService.executeCommand(eX.mY.Default.VIEW_FULL_SCREEN)}}}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],i7.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],i7.prototype,"hoverService",void 0),(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],i7.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(eX.VD),(0,e2.w6)("design:type",void 0===eX.VD?Object:eX.VD)],i7.prototype,"commandService",void 0),(0,e2.gn)([(0,e8.f)(i5),(0,e2.w6)("design:type",void 0===i5?Object:i5)],i7.prototype,"menuService",void 0),i7=(0,e2.gn)([(0,e4.b)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[])],i7);var oe=Symbol("TabBarRendererFactory");class ot extends rZ{getHandleEvent(e){return!!(!e||e.classList.contains(il))||!(e.classList.contains("flow-toolbar-item")||e.classList.contains("flow-toolbar-container")||e.classList.contains(iu))&&this.getHandleEvent(e.parentElement)}handleEvent(e){(this.getHandleEvent(e.target)||"pointerup"===e.type)&&super.handleEvent(e)}rewrireDOM(){var{contentNode:e}=this;if(!e)throw Error("'this.node' does not have the content as a direct child with class name 'p-TabBar-content'.");this.node.removeChild(e);var t=document.createElement("div");t.classList.add(ia),this.preActionContainer=document.createElement("div"),this.preActionContainer.classList.add("pre-flow-tabBar-action-container"),t.appendChild(this.preActionContainer),this.scrollContainer=document.createElement("div"),this.scrollContainer.classList.add(il),t.appendChild(this.scrollContainer),this.scrollContainer.appendChild(e),this.actionContainer=document.createElement("div"),this.actionContainer.classList.add(is),t.appendChild(this.actionContainer),this.node.appendChild(t)}onResize(e){var t;super.onResize(e),null===(t=this.scrollBar)||void 0===t||t.update()}onAfterAttach(e){!this.scrollBar&&(this.scrollBar=this.scrollBarFactory()),this.toolbar&&(this.toolbar.isAttached&&rI.detach(this.toolbar),rI.attach(this.toolbar,this.actionContainer),this.viewRenderer.addReactPortal(this.toolbar)),this.preActionContainer&&(this.preToolbar.isAttached&&rI.detach(this.preToolbar),rI.attach(this.preToolbar,this.preActionContainer),this.viewRenderer.addReactPortal(this.preToolbar)),super.onAfterAttach(e)}onBeforeDetach(e){this.toolbar&&this.toolbar.isAttached&&rI.detach(this.toolbar),this.preToolbar&&this.preToolbar.isAttached&&rI.detach(this.preToolbar),super.onBeforeDetach(e)}onUpdateRequest(e){var t;super.onUpdateRequest(e),null===(t=this.scrollBar)||void 0===t||t.update()}constructor(e,t,n=t()){super({renderer:n}),this.tabBarToolbarFactory=e,this.rewrireDOM(),this.preToolbar=this.tabBarToolbarFactory(r4.LEADING),this.toolbar=this.tabBarToolbarFactory(),this.preToolbar.tabBar=this,this.toolbar.tabBar=this,n.tabBar=this,this.currentChanged.connect(()=>{var e,t=(null===(e=this.currentTitle)||void 0===e?void 0:e.owner).getResourceURI();t&&(this.preToolbar.updateURI(t),this.toolbar.updateURI(t))}),this.scrollBarFactory=()=>new rd(this.scrollContainer,{useBothWheelAxes:!0,suppressScrollY:!0})}}(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],ot.prototype,"viewRenderer",void 0),ot=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(i0)),(0,e2.fM)(1,(0,e8.f)(i9)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===i0?Object:i0,void 0===i9?Object:i9,void 0])],ot);class on{createTabBar(){return this.tabBarFactory()}createHandle(){return rX.defaultRenderer.createHandle()}constructor(e){this.tabBarFactory=e,this.tabBarClasses=[]}}(0,e2.gn)([(0,e8.f)(iV.Factory),(0,e2.w6)("design:type",void 0===iV||void 0===iV.Factory?Object:iV.Factory)],on.prototype,"dockPanelFactory",void 0),(0,e2.gn)([(0,e8.f)(ot),(0,e2.w6)("design:type",void 0===ot?Object:ot)],on.prototype,"customTabBar",void 0),on=(0,e2.gn)([(0,e4.b)(),(0,e2.fM)(0,(0,e8.f)(oe)),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[void 0===oe?Object:oe])],on);class or{toggleBottomLayout(){this.shell.bottomSplitLayout.setRelativeSizes([.7,.3])}hideBottomLayout(){this.shell.bottomSplitLayout.setRelativeSizes([1,0])}getOpenTitles(){var e=[];for(var t of this.shell.mainPanel.layout.tabBars())e=e.concat(t.titles);return e}getAllTabsFromArea(e){var t=e===r6.MAIN_PANEL?this.shell.mainPanel.widgets():this.shell.bottomPanel.widgets(),n=[];for(var r of t)n.push(r);return n}closeOtherTabs(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];try{var t,n=function(t){[...t.titles].map(n=>{var r;n.label!==(null===(r=t.currentTitle)||void 0===r?void 0:r.label)&&(t.removeTab(n),e&&n.owner.dispose())})},r=null===(t=this.shell.currentWidget)||void 0===t?void 0:t.parent;if(!r)return;for(var o of r.tabBars())n(o)}catch(e){console.error(e)}}openNextTab(){for(var e of this.shell.mainPanel.layout.tabBars()){var t=e.titles.findIndex(e=>e.owner===this.shell.currentWidget);if(-1!==t){var n,r=null===(n=e.titles[(t+1)%e.titles.length].owner)||void 0===n?void 0:n.getResourceURI();r&&this.openHandler.open(r)}}}openLastTab(){for(var e of this.shell.mainPanel.layout.tabBars()){var t=e.titles.findIndex(e=>e.owner===this.shell.currentWidget);if(-1!==t){var n,r=null===(n=e.titles[(t-1+e.titles.length)%e.titles.length].owner)||void 0===n?void 0:n.getResourceURI();r&&this.openHandler.open(r)}}}enableFullScreenMode(){if(!this.isFullScreenMode)ii.forEach(e=>{if(e!==r6.MAIN_PANEL){var t=this.shell.getPanelFromArea(e);this.prevPanelMap.set(e,t.isHidden),t.hide()}}),this.isFullScreenMode=!0,this.onFullScreenModeChangeEmitter.fire(!0)}disableFullScreenMode(){if(!!this.isFullScreenMode)ii.forEach(e=>{if(e!==r6.MAIN_PANEL){var t=this.shell.getPanelFromArea(e),n=!!this.prevPanelMap.get(e);t.setHidden(n)}}),this.isFullScreenMode=!1,this.onFullScreenModeChangeEmitter.fire(!1)}switchFullScreenMode(){this.isFullScreenMode?this.disableFullScreenMode():this.enableFullScreenMode()}setActivityBarUri(e){this.shell.activityBarWidget.setCurrentUri(e)}get activityBarUri(){return this.shell.activityBarWidget.currentUri}constructor(){this.isFullScreenMode=!1,this.onFullScreenModeChangeEmitter=new eX.Q5,this.onFullScreenModeChange=this.onFullScreenModeChangeEmitter.event,this.prevPanelMap=new Map}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],or.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(i$),(0,e2.w6)("design:type",void 0===i$?Object:i$)],or.prototype,"openHandler",void 0),or=(0,e2.gn)([(0,e4.b)()],or);class oi{startDrag(e){var t,{uris:n,position:r,dragImage:o,callback:a,backdropTransform:s}=e,{clientX:l,clientY:c}=r,d=new rk,u=this;var h=(t=(0,e3._)(function*(){var e,t=[];return yield Promise.all(n.map((e=(0,e3._)(function*(e){var n=u.widgetManager.getFactoryFromURI(e),r=yield u.widgetManager.getOrCreateWidgetFromURI(e,n);u.viewRenderer.addReactPortal(r),t.push(r)}),function(t){return e.apply(this,arguments)}))),t}),function(){return t.apply(this,arguments)});d.setData("application/vnd.lumino.widget-factory",h),new rK({document,mimeData:d,dragImage:o,proposedAction:"move",supportedActions:"move",source:this.shell.mainPanel,backdropTransform:s}).start(l,c).then(a)}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],oi.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],oi.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],oi.prototype,"viewRenderer",void 0),oi=(0,e2.gn)([(0,e4.b)()],oi);var oo="expand",oa="close";class os extends r2{get defaultStretch(){return this._defaultStretch}set defaultStretch(e){this._defaultStretch=e}get orientation(){return this._orientation}set orientation(e){this._orientation=e}storeState(){var e;if(!!(null===(e=this.splitPanels)||void 0===e?void 0:e.length))return{sizes:this.getRelativeSizes(),panelClose:this.panels.map(e=>e.node.classList.contains(oa))}}restoreState(e){var t;if(!!(null===(t=this.splitPanels)||void 0===t?void 0:t.length))this.storeData=e,this.addClassNames()}onFitRequest(e){var t;if(super.onFitRequest(e),!!(null===(t=this.panels)||void 0===t?void 0:t.length)&&"horizontal"===this.orientation)this.panels.forEach(e=>{var t,n,r,o,a,s,l,c,d=null==e?void 0:e.node;d&&((null==d?void 0:null===(n=d.classList)||void 0===n?void 0:null===(t=n.contains)||void 0===t?void 0:t.call(n,"close"))?null===(a=d.previousSibling)||void 0===a||null===(o=a.classList)||void 0===o||null===(r=o.add)||void 0===r||r.call(o,"lm-mod-hidden"):null===(c=d.previousSibling)||void 0===c||null===(l=c.classList)||void 0===l||null===(s=l.remove)||void 0===s||s.call(l,"lm-mod-hidden"))})}init(e){var t;if(super.init(e),!!(null===(t=this.splitPanels)||void 0===t?void 0:t.length))!this.layout&&this.createContainer()}createPanel(e){var t=new rN;return t.id=e.displayName,t}addClassNames(){var e;if(!!(null===(e=this.storeData)||void 0===e?void 0:e.panelClose))this.panels.forEach((e,t)=>{var n,r;(null===(r=this.storeData)||void 0===r?void 0:null===(n=r.panelClose)||void 0===n?void 0:n[t])?this.closePanel(t):this.expandPanel(t)})}getWidget(e){var t=this.widgetManager.uriToWidgetID(e);return this.widgetManager.getWidget(t)}getWidgetExpand(e){if(!e)return!1;var t,n=this.widgetManager.uriToWidgetID(e),r=this.widgetManager.getWidget(n);return!!(null==r?void 0:null===(t=r.parent)||void 0===t?void 0:t.node.classList.contains("expand"))}createPanels(e){var t=this;return(0,e3._)(function*(){var n;return t.splitPanels.sort((e,t)=>(e.order||0)-(t.order||0)),Promise.all(t.splitPanels.map((n=(0,e3._)(function*(n,r){var o,{widgetUri:a,widget:s}=n,l=t.createPanel(a);if((null==e?void 0:e[r])===0?l.node.classList.add(oa):l.node.classList.add(oo),o=t.getWidget(a))return o;(o=yield t.widgetManager.createSubWidget(a,s)).wrapperWidget=t,t.viewRenderer.addReactPortal(o);s&&l.addWidget(o),t.panels.push(l)}),function(e,t){return n.apply(this,arguments)})))})()}toggleSubWidget(e){if(!!e&&!!this.layout){var t=this.contentPanel.relativeSizes(),n=this.panels.findIndex(t=>t.id===e.displayName);this.panels.forEach((e,r)=>{var o=e.node.classList.contains(oo);r===n&&o?(t[r]=0,e.node.classList.remove(oo),e.node.classList.add(oa),this.contentPanel.fit(),this.setRelativeSizes(t)):r===n&&!o&&(t[r]=1,e.node.classList.remove(oa),e.node.classList.add(oo),this.contentPanel.fit(),this.setRelativeSizes(t))})}}getRelativeSizes(){return this.contentPanel.relativeSizes()}closePanel(e){var t=this.panels[e];if(!(!t||t.node.classList.contains(oa)))t.node.classList.remove(oo),t.node.classList.add(oa)}expandPanel(e){var t=this.panels[e];if(!(!t||t.node.classList.contains(oo)))t.node.classList.remove(oa),t.node.classList.add(oo)}syncPanelRelativeSizes(e){this.contentPanel.setRelativeSizes(e),(null==e?void 0:e.length)&&(e.forEach((e,t)=>{0===e?this.closePanel(t):this.expandPanel(t)}),this.contentPanel.fit())}setRelativeSizes(e){this.contentPanel.setRelativeSizes(e)}getDefaultStretch(){if(this.defaultStretch)return this.defaultStretch;var e=this.panels.length;return Array(e).fill(1/e)}createContainer(){var e=this;return(0,e3._)(function*(){var t,n=e.getDefaultStretch();yield e.createPanels(n);var r=iC(e.panels,n,{orientation:e.orientation,spacing:0}),o=new rJ({layout:r});o.addClass(io),e.contentPanel=o,e.setRelativeSizes((null===(t=e.storeData)||void 0===t?void 0:t.sizes)||n),e.layout=ik([e.contentPanel],[1],{direction:e.direction,spacing:0})})()}render(){return null}constructor(...e){super(...e),this.panels=[],this.splitPanels=[],this.direction="left-to-right"}}(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],os.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],os.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(iQ),(0,e2.w6)("design:type",void 0===iQ?Object:iQ)],os.prototype,"layoutRestorer",void 0),os=(0,e2.gn)([(0,e4.b)()],os);var ol=e=>{e(r5).toDynamicValue(e=>{var{container:t}=e;return{area:r6.ACTIVITY_BAR,canHandle:e=>e.isEqualOrParent(iO),createWidget:()=>{var e=t.createChild();return e.bind(iB).toSelf().inSingletonScope(),e.get(iB)}}}),e(r5).toDynamicValue(e=>{var{container:t}=e;return{area:r6.STATUS_BAR,canHandle:e=>e.isEqualOrParent(iI),createWidget:()=>{var e=t.createChild();return e.bind(iP).toSelf().inSingletonScope(),e.get(iP)}}})},oc=e=>"\n #".concat(ir[r6.TOP_BAR].displayName," {\n min-height: 40px;\n background: ").concat(e("flowide.color.base.bg.2"),";\n color: ").concat(e("flowide.color.base.text.0"),";\n border-bottom: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.ACTIVITY_BAR].displayName," {\n min-width: 36px;\n color: ").concat(e("flowide.color.base.text.0"),";\n background: ").concat(e("flowide.color.base.bg.2"),";\n border-right: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.PRIMARY_SIDEBAR].displayName," {\n min-width: 110px !important;\n color: ").concat(e("flowide.color.base.text.0"),";\n background: ").concat(e("flowide.color.base.bg.1"),";\n border-right: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.MAIN_PANEL].displayName," {\n color: ").concat(e("flowide.color.base.text.0"),";\n background: ").concat(e("flowide.color.base.bg.0"),";\n }\n #").concat(ir[r6.SECONDARY_SIDEBAR].displayName," {\n min-width: 110px;\n }\n #").concat(ir[r6.STATUS_BAR].displayName," {\n min-height: 22px;\n background: ").concat(e("flowide.color.base.bg.2"),";\n border-top: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n #").concat(ir[r6.BOTTOM_PANEL].displayName," {\n background: ").concat(e("flowide.color.base.bg.0"),";\n color: ").concat(e("flowide.color.base.text.0"),";\n border-top: 1px solid ").concat(e("flowide.color.base.border"),";\n }\n\n .").concat(io," .lm-SplitPanel-child.expand {\n min-height: 75px;\n }\n\n .").concat(io," .lm-SplitPanel-child.close {\n min-height: 22px;\n max-height: 22px;\n }\n\n .").concat(io,'[data-orientation="vertical"] .lm-SplitPanel-handle {\n background: ').concat(e("flowide.color.base.border"),";\n min-height: 1px;\n z-index: 3;\n }\n .").concat(io,'[data-orientation="vertical"] .lm-SplitPanel-handle:hover {\n background: ').concat(e("flowide.color.base.primary.hover"),";\n min-height: 4px;\n }\n .").concat(io,'[data-orientation="vertical"] .lm-SplitPanel-handle:active {\n background: ').concat(e("flowide.color.base.primary"),";\n min-height: 4px;\n }\n\n .").concat(io,'[data-orientation="horizontal"] .lm-SplitPanel-handle {\n background: ').concat(e("flowide.color.base.border"),";\n min-width: 1px;\n }\n .").concat(io,'[data-orientation="horizontal"] .lm-SplitPanel-handle:hover {\n background: ').concat(e("flowide.color.base.primary.hover"),";\n min-width: 4px;\n }\n .").concat(io,'[data-orientation="horizontal"] .lm-SplitPanel-handle:active {\n background: ').concat(e("flowide.color.base.primary"),";\n min-width: 4px;\n }\n "),od=e=>"\n .flow-Menu {\n z-index: 10000;\n position: absolute;\n top: 0;\n left: 0;\n padding: 4px;\n white-space: nowrap;\n overflow-x: hidden;\n overflow-y: auto;\n outline: none;\n font: 12px Helvetica,Arial,sans-serif;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background: ".concat(e("flowide.color.base.bg.0"),";\n color: ").concat(e("flowide.color.base.text.0"),";\n border: 1px solid ").concat(e("flowide.color.menu.border"),";\n box-shadow: 0 1px 6px ").concat(e("flowide.color.menu.box.shadow"),";\n border-radius: 6px;\n }\n\n .flow-Menu-content {\n margin: 0;\n padding: 0;\n display: flex;\n outline: none;\n flex-direction: column;\n list-style-type: none;\n }\n\n .flow-Menu-item {\n display: flex;\n justify-content: space-between;\n padding: 0 4px;\n border-radius: 4px;\n align-items: center;\n outline: none;\n cursor: pointer;\n }\n\n .flow-Menu-item.flow-mod-active {\n background: ").concat(e("flowide.color.base.fill.0"),";\n }\n\n .flow-Menu-item.flow-mod-disabled {\n opacity: 0.35;\n }\n\n .flow-Menu-item.flow-mod-hidden,\n .flow-Menu-item.flow-mod-collapsed {\n display: none !important;\n }\n\n .flow-Menu-itemIcon,\n .flow-Menu-itemSubmenuIcon {\n text-align: center;\n }\n\n .flow-Menu-itemLabel {\n text-align: left;\n padding: 4px 35px 4px 2px;\n }\n\n .flow-Menu-itemShortcut {\n text-align: right;\n }\n .flow-Menu-itemIcon::before,\n .flow-Menu-itemSubmenuIcon::before {\n font-family: codicon;\n }\n\n .flow-Menu-item > .flow-Menu-itemSubmenuIcon::before {\n content: '\\eab6';\n line-height: 20px;\n }\n");class ou{get commandService(){return this.commandFactory()}registerStyle(e,t){var{add:n}=e,{getColor:r}=t;n("\n ".concat(od(r),"\n .flow-hover {\n color: ").concat(r("flowide.color.base.text.0"),";\n background: ").concat(r("flowide.color.base.bg.0"),";\n\n border: 2px solid ").concat(r("flowide.color.base.border"),";\n border-radius: 6px;\n padding: 4px;\n }\n .flowide-container {\n height: 100%;\n }\n .flowide-container .debug-bar-widget-container {\n position: fixed;\n width: fit-content;\n height: fit-content;\n }\n .flowide-container .lm-Widget {\n width: 100%;\n height: 100%;\n }\n .flowide-container .flow-tab-icon-label {\n display: flex;\n align-items: center;\n width: 100%;\n overflow: hidden;\n }\n .flowide-container .flow-tab-icon-label .flow-TabBar-tabLabel-text {\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: keep-all;\n white-space: nowrap;\n }\n .flowide-container .lm-TabBar-tabCloseIcon:hover {\n cursor: pointer;\n }\n .flowide-container .lm-TabBar-content {\n width: fit-content;\n border: 0;\n }\n .flowide-container .lm-DockPanel-handle {\n background: ").concat(r("flowide.color.base.border"),";\n }\n .flowide-container .lm-TabBar {\n color: ").concat(r("flowide.color.base.text.2"),";\n background: ").concat(r("flowide.color.base.fill.0"),";\n display: flex;\n height: 24px;\n }\n .flowide-container .lm-TabBar-tab {\n background: transparent;\n border: 0;\n min-width: 125px;\n max-height: 24px;\n line-height: 24px;\n }\n .flowide-container .lm-TabBar-tab:hover {\n color: ").concat(r("flowide.color.base.text.0"),";\n background: ").concat(r("flowide.color.base.fill.0"),';\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="vertical"] {\n min-height: 1px;\n z-index: 3;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="vertical"]:hover {\n background: ').concat(r("flowide.color.base.primary.hover"),';\n min-height: 4px;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="vertical"]:active {\n background: ').concat(r("flowide.color.base.primary"),';\n min-height: 4px;\n }\n\n .flowide-container .lm-DockPanel-handle[data-orientation="horizontal"] {\n min-width: 1px;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="horizontal"]:hover {\n background: ').concat(r("flowide.color.base.primary.hover"),';\n min-width: 4px;\n }\n .flowide-container .lm-DockPanel-handle[data-orientation="horizontal"]:active {\n background: ').concat(r("flowide.color.base.primary"),";\n min-width: 4px;\n }\n .flowide-container .lm-TabBar-tab.lm-mod-current {\n background: ").concat(r("flowide.color.base.bg.0"),";\n color: ").concat(r("flowide.color.base.text.0"),";\n transform: unset;\n position: relative;\n }\n .flowide-container #").concat(ie,' .lm-TabBar-tab.lm-mod-current::before {\n position: absolute;\n top: 0;\n left: 0;\n content: "";\n width: 100%;\n height: 2px;\n background: ').concat(r("flowide.color.base.primary"),";\n }\n .flowide-container #").concat(it,' .lm-TabBar-tab.lm-mod-current::before {\n position: absolute;\n bottom: 0;\n left: 0;\n content: "";\n width: 100%;\n height: 2px;\n background: ').concat(r("flowide.color.base.primary"),';\n }\n .flowide-container .lm-TabBar-tabCloseIcon.saving:before {\n content: "\\f111";\n }\n .flowide-container .lm-TabBar-tabCloseIcon.saving:hover:before {\n content: "\\f00d";\n }\n .flowide-container .').concat(ia," {\n display: flex;\n width: 100%;\n height: 100%;\n justify-content: space-between;\n }\n .flowide-container .").concat(il," {\n flex-grow: 1;\n position: relative;\n overflow: hidden;\n }\n .flowide-container .").concat(il," .ide-ps__rail-x {\n z-index: 999999;\n user-select: none;\n pointer-events: none;\n }\n .flowide-container .").concat(il," .ide-ps__thumb-x {\n height: 2px;\n }\n .flowide-container .").concat(is," {\n flex-shrink: 0;\n height: 100%;\n }\n .flowide-container .").concat(is," .").concat(ic," {\n display: flex;\n height: 100%;\n }\n .flowide-container .").concat(is," .").concat(id," {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 4px;\n }\n ").concat(oc(r),"\n }"))}registerCommands(e){e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,label:"Close All Tab"},{execute:()=>{var e,t=(null===(e=this.shell.currentWidget)||void 0===e?void 0:e.parent).tabBars(),n=[];for(var r of t)n=n.concat(r.titles);this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,n)}}),e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,label:"Close Current Tab",shortLabel:"Close"},{execute:e=>{var t=e||this.shell.currentWidget;t&&this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,[t.title])}}),e.registerCommand({id:eX.mY.Default.VIEW_REOPEN_LAST_WIDGET,label:"Reopen Last Tab"},{execute:()=>{var e=this.shell.closeWidgetUriStack.pop();e&&this.openHandler.open(e)}}),e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,label:"Close Other Tab"},{execute:e=>{try{var t=e||this.shell.currentWidget,n=null==t?void 0:t.parent;if(!n)return;var r=[];for(var o of n.tabBars())[...o.titles].map(e=>{e.owner!==t&&r.push(e)});this.commandService.executeCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,r)}catch(e){console.error(e)}}}),e.registerCommand({id:eX.mY.Default.VIEW_CLOSE_BOTTOM_PANEL,label:"Close/Open Bottom Pannel"},{execute:()=>{var e;!(null===(e=this.shell.bottomPanel)||void 0===e?void 0:e.currentTitle)&&this.commandService.executeCommand(eX.mY.Default.VIEW_PROBLEMS),this.shell.bottomPanel.setHidden(!this.shell.bottomPanel.isHidden)}}),e.registerCommand({id:eX.mY.Default.VIEW_OPEN_NEXT_TAB,label:"Open Next Tab"},{execute:()=>{this.viewService.openNextTab()}}),e.registerCommand({id:eX.mY.Default.VIEW_OEPN_LAST_TAB,label:"Open Last Tab"},{execute:()=>{this.viewService.openLastTab()}}),e.registerCommand({id:eX.mY.Default.VIEW_FULL_SCREEN,label:"Full Screen"},{execute:this.shell.disableFullScreen?()=>null:()=>{this.viewService.switchFullScreenMode()}})}registerShortcuts(e){e.registerHandlers({keybinding:"alt shift w",commandId:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET}),e.registerHandlers({keybinding:"alt shift rightarrow",commandId:eX.mY.Default.VIEW_OPEN_NEXT_TAB,preventDefault:!0}),e.registerHandlers({keybinding:"alt shift leftarrow",commandId:eX.mY.Default.VIEW_OEPN_LAST_TAB,preventDefault:!0}),e.registerHandlers({keybinding:"alt w",commandId:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET}),e.registerHandlers({keybinding:"alt shift t",commandId:eX.mY.Default.VIEW_REOPEN_LAST_WIDGET}),e.registerHandlers({keybinding:"meta alt t",commandId:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET}),e.registerHandlers({keybinding:"meta j",commandId:eX.mY.Default.VIEW_CLOSE_BOTTOM_PANEL}),e.registerHandlers({keybinding:"alt f",commandId:eX.mY.Default.VIEW_FULL_SCREEN})}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],ou.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(or),(0,e2.w6)("design:type",void 0===or?Object:or)],ou.prototype,"viewService",void 0),(0,e2.gn)([(0,e8.f)(na),(0,e2.w6)("design:type",void 0===na?Object:na)],ou.prototype,"navigationService",void 0),(0,e2.gn)([(0,e8.f)(eX.BB),(0,e2.w6)("design:type",Function)],ou.prototype,"commandFactory",void 0),(0,e2.gn)([(0,e8.f)(i$),(0,e2.w6)("design:type",void 0===i$?Object:i$)],ou.prototype,"openHandler",void 0),ou=(0,e2.gn)([(0,e4.b)()],ou);var oh=()=>(0,tK.jsx)("div",{children:"Something went wrong."});var op=e0({onBind:(e,t)=>{var{bind:n}=e;n(iJ).toSelf().inSingletonScope(),n(r9).toSelf().inSingletonScope(),n(iY).toSelf().inSingletonScope(),n(r7).toConstantValue((0,tm._)({widgetFallbackRender:oh},t)),n(iq).toSelf().inSingletonScope(),n(iQ).toSelf().inSingletonScope(),(0,eX.yb)(n,r5),(0,eX.yb)(n,iG),(0,eX.yb)(n,iX),(0,eX.KV)(n,i$,[ta]),n(iD).toSelf().inSingletonScope(),n(oi).toSelf().inSingletonScope(),n(or).toSelf().inSingletonScope(),n(iZ).toSelf().inSingletonScope(),n(iv).toSelf().inSingletonScope(),n(iW).toAutoFactory(iF),n(iF).toSelf(),n(r3).toFactory(e=>e=>(e.bind(r8).toSelf().inSingletonScope(),e.get(r8))),n(iH).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(on).toSelf().inSingletonScope(),t.bind(ot).toSelf().inSingletonScope(),t.bind(oe).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(ot).toSelf().inSingletonScope(),t.get(ot)}),t.bind(i0).toFactory(e=>t=>{var n=e.container.createChild();n.bind(i1).toSelf().inSingletonScope();var r=n.get(i1);return r.initAlign(t),r}),t.bind(i9).toFactory(e=>()=>{var t=e.container.createChild();return t.bind(i7).toSelf().inSingletonScope(),t.get(i7)}),t.get(on)}),n(nH).toDynamicValue(e=>{var t=e.container.get(iq);return e.container.get(iY).toReactComponent(t)}).inSingletonScope(),(0,eX.KV)(n,ou,[eX.pY,nM,t5]),n(iV.Factory).toFactory(()=>e=>new iV(e)),ol(n)},onInit:(X=(0,e3._)(function*(e,t){var n=e.get(iJ);yield n.init(t)}),function(e,t){return X.apply(this,arguments)}),onLayoutInit:(Q=(0,e3._)(function*(e,t){if(!(null===(n=t.presetConfig)||void 0===n?void 0:n.disableContextMenu)){var n,r=e.container.get(i5);r.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,selector:".lm-TabBar-tab"}),r.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,selector:".lm-TabBar-tab"}),r.addMenuItem({command:eX.mY.Default.VIEW_FULL_SCREEN,selector:".lm-TabBar-tab",filter:e=>{var t;return(null==e?void 0:null===(t=e.parent)||void 0===t?void 0:t.id)===ie}}),r.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,selector:".lm-TabBar-tab"})}var o=e.get(iJ);yield o.attach(t);var a=e.container.get(nY),s=e.container.get(i5);a.listenGlobalEvent("contextmenu",e=>{if(!t2(e.target)){var n,r=s.open(e);(!(null===(n=t.presetConfig)||void 0===n?void 0:n.disableContextMenu)||r)&&(e.stopPropagation(),e.preventDefault())}})}),function(e,t){return Q.apply(this,arguments)}),onDispose:e=>{e.get(iQ).storeLayout()}}),of=n("407821"),om=n.n(of),ov=n("472772"),og=n.n(ov),ob=n("395245"),oy=n.n(ob),o_=n("297998"),ow=n.n(o_),ox=n("646576"),oS=n.n(ox),ok=n("606121"),oC=n.n(ok),oj=n("950367"),oE={};oE.styleTagTransform=oC(),oE.setAttributes=ow(),oE.insert=oy().bind(null,"head"),oE.domAPI=og(),oE.insertStyleElement=oS(),om()(oj.Z,oE),oj.Z&&oj.Z.locals&&oj.Z.locals;var oT=n("268063"),oI={};oI.styleTagTransform=oC(),oI.setAttributes=ow(),oI.insert=oy().bind(null,"head"),oI.domAPI=og(),oI.insertStyleElement=oS(),om()(oT.Z,oI),oT.Z&&oT.Z.locals&&oT.Z.locals;class oP{onInit(){}registerCommands(e){}}(0,e2.gn)([(0,e8.f)(na),(0,e2.w6)("design:type",void 0===na?Object:na)],oP.prototype,"navigationService",void 0),(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],oP.prototype,"openerService",void 0),oP=(0,e2.gn)([(0,e4.b)()],oP);(eZ||(eZ={})).create=function(e){return{container:e,get resourceService(){return e.get(tB)},get historyService(){return e.get(eX.qp)},get commandService(){return e.get(eX.VD)},get:t=>e.get(t),getAll:t=>e.getAll(t)}};var oM=(0,tq.forwardRef)((e,t)=>{var{options:n,container:r,containerModules:o,children:a,className:s}=e,l=(0,tq.useMemo)(()=>{var e;return{containerModules:o,container:r,plugins:(e=n,t=>{var n=e(t),r=[];return r.push(tW(n.resource||{}),op(n.view||{widgetFactories:[],defaultLayoutData:{activityBarItems:[],defaultWidgets:[]}}),nl(n.navigation||{}),tV(n.command||{}),(0,eX.JE)(n.history||{}),e1(n),nO(n.label||{}),t8(n.shortcut||{}),nt(n.preferences||{}),nA({}),i8(),nG()),r.push(e1({onBind(e){var{bind:t}=e;(0,eX.KV)(t,oP,[eX.pY,eG]),n.openHandlers&&n.openHandlers.forEach(e=>{"function"==typeof e?(t(e).toSelf().inSingletonScope(),t(ta).toService(e)):t(ta).toConstantValue(e)})}})),n.plugins&&r.push(...n.plugins),r}),customPluginContext:e=>eZ.create(e)}},[]);return(0,tK.jsx)(nK,(0,tv._)((0,tm._)({},l),{ref:t,children:(0,tK.jsxs)(tK.Fragment,{children:[(0,tK.jsx)(nU,{className:s}),a]})}))}),oR=()=>({version:"",patch:()=>null}),oD=n("407694"),oA=Symbol("OptionsService");class oN{send(e){}init(){}onDispose(){}constructor(){this.onMessageSendEmitter=new eX.Q5,this.onMessageSend=this.onMessageSendEmitter.event}}(0,e2.gn)([(0,e8.f)(oA),(0,e2.w6)("design:type",void 0===oA?Object:oA)],oN.prototype,"options",void 0),oN=(0,e2.gn)([(0,e4.b)()],oN);var oL=Symbol("WidgetContext"),oz=()=>(0,oD.Cg)()(e=>e.spaceId),oO="coze-project",oB=new tD("".concat(oO,":///top-bar")),oW=new tD("".concat(oO,":///default")),oF=new tD("".concat(oO,":///side-bar")),oH=new tD("".concat(oO,":///secondary-sidebar")),oU=new tD("".concat(oO,":///side-bar/resource")),oV=new tD("".concat(oO,":///side-bar/config")),oK=new tD("".concat(oO,":///ui-builder")),oq=new tD("".concat(oO,":///ui-builder/content")),oZ=new tD("".concat(oO,":///session"));var oY=((G={}).RELOAD="reload",G);class oX{switchPanel(e){var t,n,r=this.widgetManager.getWidgetFromURI(oK);e&&oK.match(e)?((null===(t=this.shell.mainPanel.parent)||void 0===t?void 0:t.parent).hide(),null==r||r.show()):(null==r||r.hide(),(null===(n=this.shell.mainPanel.parent)||void 0===n?void 0:n.parent).show())}uiBuilderReopen(){var e=this;return(0,e3._)(function*(){(yield e.widgetManager.getOrCreateWidgetFromURI(oq)).dispose(),e.openPanel("ui-builder")})()}secondarySidebarReOpen(){if(!!this.secondarySidebar.getVisible()){var e=this.widgetManager.getWidgetFromURI(oH);null==e||e.dispose(),this.openerService.open(oH)}}open(e){var t=this;return(0,e3._)(function*(){t.switchPanel(e),yield t.openerService.open(e)})()}openPanel(e){var t=this;return(0,e3._)(function*(){if("ui-builder"===e){t.switchPanel(oK);var n=t.widgetManager.getFactoryFromURI(oq),r=yield t.widgetManager.getOrCreateWidgetFromURI(oq,n);if(t.viewRenderer.addReactPortal(r),!(null==r?void 0:r.isAttached)&&r){var o,a=t.widgetManager.getWidgetFromURI(oK);null==a||null===(o=a.addWidget)||void 0===o||o.call(a,r)}}else t.switchPanel()})()}openDefault(){var e=this;return(0,e3._)(function*(){yield e.openerService.open(oW,{mode:"single-document"})})()}closeWidgetByUri(e){var t=this.widgetManager.getWidgetFromURI(e);t&&t.close()}getWidgetContextFromURI(e){var t=this.widgetManager.getWidgetFromURI(e);if(t)return t.context}splitScreen(e,t){var n,r,o,a=null===(o=this.shell.mainPanel)||void 0===o?void 0:null===(r=o.layout)||void 0===r?void 0:null===(n=r.saveLayout())||void 0===n?void 0:n.main;if((null==a?void 0:a.type)==="tab-area")this.shell.mainPanel.addWidget(t,{mode:"left"===e?"split-left":"split-right"}),this.shell.mainPanel.activateWidget(t);else if((null==a?void 0:a.type)==="split-area"){var{widgets:s}=null==a?void 0:a.children["left"===e?0:1],l=s.find(e=>e.isVisible);this.shell.mainPanel.addWidget(t,{mode:"tab-after",ref:l}),this.shell.mainPanel.activateWidget(t)}}switchFullScreenMode(){this.isFullScreenMode?this.disableFullScreenMode():this.enableFullScreenMode()}enableFullScreenMode(){if(!this.isFullScreenMode)this.primarySidebar.changeVisible(!1),this.shell.getPanelFromArea(r6.TOP_BAR).hide(),this.isFullScreenMode=!0,this.onFullScreenModeChangeEmitter.fire(!0)}disableFullScreenMode(){if(!!this.isFullScreenMode)this.primarySidebar.changeVisible(!0),this.shell.getPanelFromArea(r6.TOP_BAR).show(),this.isFullScreenMode=!1,this.onFullScreenModeChangeEmitter.fire(!1)}constructor(){this.isFullScreenMode=!1,this.onSidebarVisibleChangeEmitter=new eX.Q5,this.onSidebarVisibleChange=this.onSidebarVisibleChangeEmitter.event,this.onSecondarySidebarVisibleChangeEmitter=new eX.Q5,this.onSecondarySidebarChange=this.onSecondarySidebarVisibleChangeEmitter.event,this.onFullScreenModeChangeEmitter=new eX.Q5,this.onFullScreenModeChange=this.onFullScreenModeChangeEmitter.event,this.primarySidebar={onSidebarVisibleChange:this.onSidebarVisibleChange,getVisible:()=>this.shell.primarySidebar.isVisible,changeVisible:e=>{e?(this.shell.primarySidebar.show(),this.onSidebarVisibleChangeEmitter.fire(!0)):(this.shell.primarySidebar.hide(),this.onSidebarVisibleChangeEmitter.fire(!1))}},this.secondarySidebar={getVisible:()=>this.shell.secondarySidebar.isVisible,changeVisible:e=>{e?(!this.widgetManager.getWidgetFromURI(oH)&&this.openerService.open(oH),this.shell.secondarySidebar.show(),this.onSecondarySidebarVisibleChangeEmitter.fire(!0)):(this.shell.secondarySidebar.hide(),this.onSecondarySidebarVisibleChangeEmitter.fire(!1))}}}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],oX.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],oX.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(ts),(0,e2.w6)("design:type",void 0===ts?Object:ts)],oX.prototype,"openerService",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],oX.prototype,"viewRenderer",void 0),oX=(0,e2.gn)([(0,e4.b)()],oX);class oQ{registerMenus(e,t){var n=()=>{var e,n=this.contextKeyService.getContext("widgetFocus");return!!(null==t?void 0:null===(e=t.test)||void 0===e?void 0:e.call(t,n.toString()))};e.forEach(e=>{if(e.submenu){var t=this.menu.createSubMenu();this.menu.addMenuItem({command:e.commandId,selector:e.selector,submenu:t,filter:n}),e.submenu.forEach(e=>{t.addItem({command:e.commandId,filter:n})})}else this.menu.addMenuItem({command:e.commandId,selector:e.selector,filter:n})})}constructor(){var e=this;this.contextmenu={registerContextMenu:(e,t)=>{this.registerMenus(e,t)},open:e=>this.menu.open(e)},this.command={execute:function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.commandService.executeCommand(t,...r)}}}}(0,e2.gn)([(0,e8.f)(eX.VD),(0,e2.w6)("design:type",void 0===eX.VD?Object:eX.VD)],oQ.prototype,"commandService",void 0),(0,e2.gn)([(0,e8.f)(e5),(0,e2.w6)("design:type",void 0===e5?Object:e5)],oQ.prototype,"contextKeyService",void 0),(0,e2.gn)([(0,e8.f)(i5),(0,e2.w6)("design:type",void 0===i5?Object:i5)],oQ.prototype,"menu",void 0),(0,e2.gn)([(0,e8.f)(oX),(0,e2.w6)("design:type",void 0===oX?Object:oX)],oQ.prototype,"view",void 0),oQ=(0,e2.gn)([(0,e4.b)()],oQ);var oG=()=>nF(oQ);function oJ(){var e=iA();if(!e.context)throw Error("[useWidgetContext] Undefined widgetContext from ide context");return e.context}var o$=()=>{var e=iN(r6.MAIN_PANEL);return null==e?void 0:e.context},o0=n("157728"),o1=(e,t)=>{var n=iC([e.mainPanel],[1],{orientation:"vertical",spacing:0});e.bottomSplitLayout=n;var r=new rJ({layout:n}),o=ik([e.primarySidebar,r],[0,1],{direction:"left-to-right",spacing:6}),a=ik([new rL({layout:o}),t,e.secondarySidebar],[1,0,0],{direction:"left-to-right"}),s=new rL({layout:a});return ik([e.topPanel,s],[0,1],{direction:"top-to-bottom",spacing:0})},o2=(e,t)=>{var n=(0,tq.lazy)(e);return()=>(0,tK.jsx)(tq.Suspense,{fallback:t,children:(0,tK.jsx)(n,{})})},o4=e=>{var t,n,r=e.match(/space\/\d+\/project-ide\/\d+\/([^\/]+)(?:\/([^\/]+))?/);return r&&(t=r[1],n=r[2]),{resourceType:t,resourceId:n}},o6=e=>{var t=e.match(/space\/[^/]+\/project-ide\/[^/]+\/(.*)/);return t?t[1]:null},o5=e=>e.path.toString(),o3=(e,t,n)=>new tD("".concat(oO,":///").concat(e,"/").concat(t).concat(n?"?".concat(n):"")),o8=e=>new tD("".concat(oO,":///").concat(e)),o9=e=>"".concat(e.path.toString()).concat(e.query?"".concat(e.query):"").concat(e.fragment?"#".concat(e.fragment):""),o7=(e,t)=>!!e&&!!t&&e.toString()===t.toString(),ae=["commit_version"];function at(e){if(!e)return e;var t=new URLSearchParams(window.location.search),n=new URLSearchParams;for(var r of ae){var o=t.get(r);o&&!e.includes("".concat(r,"="))&&n.append(r,o)}var a=e.includes("?")?"&":"?",s=n.toString();return s?"".concat(e).concat(a).concat(s):e}var an=()=>(0,oD.Cg)()(e=>e.projectId),ar=()=>{var{view:e}=oG(),t=oz(),n=an(),r=(0,o0.useNavigate)();return(0,tq.useCallback)((o,a)=>{var s="/space/".concat(t,"/project-ide/").concat(n).concat(o),l=new tD("".concat(oO,"://").concat(o)),c=l.displayName===oK.displayName;o&&"/"!==o&&!c?e.open(l):e.openPanel(c?"ui-builder":"dev"),r(at(s),a)},[t,n,e,r])},ai=(e,t)=>{var n,r,o,a=-1,s=null===(o=e.mainPanel)||void 0===o?void 0:null===(r=o.layout)||void 0===r?void 0:null===(n=r.saveLayout)||void 0===n?void 0:n.call(r).main,l=(null==s?void 0:s.children)||[s];return(l.forEach((e,n)=>{t&&((null==e?void 0:e.widgets)||[]).some(e=>{var n,r;return(null===(r=e.uri)||void 0===r?void 0:null===(n=r.toString)||void 0===n?void 0:n.call(r))===t.toString()})&&(a=n)}),(null==l?void 0:l.length)===1)?void 0:1===a?"right":"left"},ao=(e,t)=>{var n,r=nF(iq),[o,a]=(0,tq.useState)(ai(r,e));return(0,tq.useEffect)(()=>{a(ai(r,e));var n=()=>{(null==t?void 0:t.titles.some(t=>{var n;return o7(null===(n=t.owner)||void 0===n?void 0:n.uri,e)}))&&a(ai(r,e))};return r.mainPanel.layoutModified.connect(n),()=>{r.mainPanel.layoutModified.disconnect(n)}},[null==e?void 0:null===(n=e.toString)||void 0===n?void 0:n.call(e)]),o},aa=()=>{var{widget:e}=oJ(),[t,n]=(0,tq.useState)(e.getTitle());return(0,tq.useEffect)(()=>{var t=e.onTitleChanged(e=>{n(e)});return()=>{var e;null==t||null===(e=t.dispose)||void 0===e||e.call(t)}},[]),t},as=e=>{var t=iA();(0,tq.useLayoutEffect)(()=>{var n=t.onActivate(()=>{e(t)});return()=>n.dispose()},[t,e])},al=()=>{var e,t,n=iA(),[r,o]=(0,tq.useState)((null===(e=n.uri)||void 0===e?void 0:e.queryObject)||{}),a=(0,tq.useRef)(null===(t=n.uri)||void 0===t?void 0:t.query);return as((0,tq.useCallback)(e=>{var t,n,r=null===(t=e.uri)||void 0===t?void 0:t.query;a.current!==r&&(a.current=r,o((null===(n=e.uri)||void 0===n?void 0:n.queryObject)||{}))},[a,o])),r},ac=e=>{var t,n=nF(eX.Ho);return{keybinding:nF(t3).getShortcutByCommandId(e).map(e=>e.join(" ")).join("/"),label:null===(t=n.getCommand(e))||void 0===t?void 0:t.label}},ad=n("336205"),au=n("298203"),ah=n("909776"),ap=n("382534");var af=((J={}).RESOURCE="resource",J.CLOSE_CONFIRM="close-confirm",J);class am{startPolling(e){var t=this;return(0,e3._)(function*(){t._stopPolling=!1;var n=e.res_name;try{t.onModalVisibleChangeEmitter.fire({type:"resource",scene:e.scene,resourceName:n});var{task_id:r,failed_reasons:o}=yield ap.Js.ResourceCopyDispatch(e);if(t._taskId=r,null==o?void 0:o.length){var a="";a=o.some(e=>e.res_type===ah.b0.Workflow)?ad.o.t("resource_copy_move_notify"):o.reduce((e,t)=>{var n="".concat(t.res_name||"").concat(t.reason||"");return e?"".concat(e,"\n").concat(n):n},""),t.onErrorEmitter.fire(a);return}r?t.doPolling(r):t.onErrorEmitter.fire("no_task_id")}catch(e){t.onErrorEmitter.fire(!0)}})()}retry(){var e=this;return(0,e3._)(function*(){e._stopPolling=!1,e._taskId&&(yield ap.Js.ResourceCopyRetry({task_id:e._taskId}),e.onErrorEmitter.fire(!1),e.doPolling(e._taskId))})()}doPolling(e){var t=this;return(0,e3._)(function*(){if(t._taskId=e,!t._stopPolling)try{var n=yield t.polling(),{status:r}=n||{};yield(0,au._v)(1e3),t._taskId&&!t._stopPolling&&t.onModalVisibleChangeEmitter.fire({type:"resource",scene:null==n?void 0:n.scene,resourceName:null==n?void 0:n.res_name}),r===ah.hY.Processing?t.doPolling(e):r===ah.hY.Successed?(t._stopPolling=!0,t.onModalVisibleChangeEmitter.fire({type:"resource",visible:!1}),t.onSuccessEmitter.fire(n)):t.onErrorEmitter.fire(!0)}catch(e){t._stopPolling=!0,t.onErrorEmitter.fire(!0)}})()}polling(){var e=this;return(0,e3._)(function*(){try{var{task_detail:t}=yield ap.Js.ResourceCopyDetail({task_id:e._taskId});return t}catch(t){return e._stopPolling=!0,e.onErrorEmitter.fire(!0),{status:ah.hY.Failed}}})()}onCloseResourceModal(){var e=this;return(0,e3._)(function*(){e._stopPolling=!0,e.onModalVisibleChangeEmitter.fire({type:"resource",visible:!1}),e.onCancelEmitter.fire(),e._taskId&&(yield ap.Js.ResourceCopyCancel({task_id:e._taskId}),e._taskId=void 0)})()}constructor(){this.onModalVisibleChangeEmitter=new eX.Q5,this.onModalVisibleChange=this.onModalVisibleChangeEmitter.event,this.onCancelEmitter=new eX.Q5,this.onCancel=this.onCancelEmitter.event,this.pollingDelay=1e3,this.onErrorEmitter=new eX.Q5,this.onError=this.onErrorEmitter.event,this.onSuccessEmitter=new eX.Q5,this.onSuccess=this.onSuccessEmitter.event,this._stopPolling=!1}}(0,e2.gn)([(0,e8.f)(oA),(0,e2.w6)("design:type",void 0===oA?Object:oA)],am.prototype,"options",void 0),am=(0,e2.gn)([(0,e4.b)()],am);class av{toErrorPage(){this.onErrorEmitter.fire()}constructor(){this.onErrorEmitter=new eX.Q5,this.onError=this.onErrorEmitter.event}}av=(0,e2.gn)([(0,e4.b)()],av);class ag{toKey(e){return this.widgetManager.uriToWidgetID(e)}get(e){var t=this.toKey(e);if(this.events.has(t))return this.events.get(t);var n=[];return this.events.set(t,n),n}delete(e){var t=this.toKey(e);return this.events.delete(t)}send(e,t){this.get(e).push(t),this.onSendEmitter.fire((0,tm._)({uri:e},t))}on(e){var t=this.get(e);return this.delete(e),t}compare(e,t){return this.toKey(e)===this.toKey(t)}constructor(){this.events=new Map,this.onSendEmitter=new eX.Q5,this.onSend=this.onSendEmitter.event}}(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],ag.prototype,"widgetManager",void 0),ag=(0,e2.gn)([(0,e4.b)()],ag);var ab=e=>{var t=nF(oN);return(0,tq.useEffect)(()=>{var n=t.onMessageSend(e);return()=>{n.dispose()}},[]),{send:(0,tq.useCallback)(e=>{t.send(e)},[t])}},ay=n("537845"),a_=()=>nF(ag),aw=()=>{var e=a_(),t=ar(),n=(0,tq.useCallback)((t,n)=>{var r="string"==typeof t?new tD("".concat(oO,"://").concat(t)):t;e.send(r,n)},[e]);return{send:n,sendOpen:(0,tq.useCallback)((n,r)=>{var o="string"==typeof n?new tD("".concat(oO,"://").concat(n)):n;e.send(o,r),t(o9(o))},[e,t])}},ax=(e,t)=>{var n=a_(),r=(0,tq.useRef)(e),o=(0,ay.Z)(()=>{n.on(e).forEach(t)});(0,tq.useEffect)(()=>{o();var e=n.onSend(e=>{n.compare(e.uri,r.current)&&o()});return()=>e.dispose()},[n,o,r])},aS=e=>{var t=nF(r9),n=new tD("".concat(oO,"://").concat(e));return t.getWidgetFromURI(n)};class ak extends r2{refresh(){this.onRefreshEmitter.fire()}render(){return null}constructor(e){super(e),this.onRefreshEmitter=new eX.Q5,this.onRefresh=this.onRefreshEmitter.event,this.scrollOptions={minScrollbarLength:35}}}class aC{init(e,t){this.registry=e,this._widgetTitleRender=t,this.setTitle(this._title)}update(){this.widget.title.iconLabel=this._widgetTitleRender({commandRegistry:this.commandRegistry,registry:this.registry,uiState:this._uiState,title:this._title,widget:this.widget}),this.widget.title.saving="saving"===this._uiState}setTitle(e,t){this._title!==e&&this.onTitleChangedEmitter.fire(e),this._title=e,t&&(this._uiState=t),this.update()}getTitle(){return this._title}getUIState(){return this._uiState}setUIState(e){this._uiState!==e&&(this._uiState=e,this.update())}getIconType(){return this._iconType}setIconType(e){this._iconType!==e&&this.onIconTypeChangeEmitter.fire(e),this._iconType=e,this.update()}close(){this.widget.close()}constructor(){this._uiState="loading",this.onFocusEmitter=new eX.Q5,this.onFocus=this.onFocusEmitter.event,this.onTitleChangedEmitter=new eX.Q5,this.onTitleChanged=this.onTitleChangedEmitter.event,this.onIconTypeChangeEmitter=new eX.Q5,this.onIconTypeChanged=this.onIconTypeChangeEmitter.event}}(0,e2.gn)([(0,e8.f)(ak),(0,e2.w6)("design:type",ak)],aC.prototype,"widget",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],aC.prototype,"commandRegistry",void 0),aC=(0,e2.gn)([(0,e4.b)()],aC),Symbol("RegistryHandler");var aj=Symbol("ProjectIDEClientProps"),aE=n("659596");class aT{init(){this.hoverService.enableCustomHoverHost()}canHandle(e){return 500}renderer(e,t){return(null==t?void 0:t.content)?(0,tK.jsx)(aE.u,{content:t.content,position:t.position,style:{opacity:1},trigger:"custom",getPopupContainer:()=>document.body,visible:!0,children:(0,tK.jsx)("div",{style:{width:0}})},t.content):null}onDispose(){}constructor(){this.visible=!1}}(0,e2.gn)([(0,e8.f)(iD),(0,e2.w6)("design:type",void 0===iD?Object:iD)],aT.prototype,"hoverService",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],aT.prototype,"init",null),aT=(0,e2.gn)([(0,e4.b)()],aT);class aI extends ak{render(){var e=this.props.view.primarySideBar;return e?(0,tK.jsx)(e,{}):null}}(0,e2.gn)([(0,e8.f)(aj),(0,e2.w6)("design:type",void 0===aj?Object:aj)],aI.prototype,"props",void 0),aI=(0,e2.gn)([(0,e4.b)()],aI);class aP extends ak{render(){var e=this.props.view.configuration;return e?(0,tK.jsx)(e,{}):null}}(0,e2.gn)([(0,e8.f)(aj),(0,e2.w6)("design:type",void 0===aj?Object:aj)],aP.prototype,"props",void 0),aP=(0,e2.gn)([(0,e4.b)()],aP);class aM extends os{render(){return null}init(e){this.orientation="vertical",this.defaultStretch=[.7,.3],this.splitPanels=[{widgetUri:oU,widget:aI,order:1},{widgetUri:oV,widget:aP,order:2}],super.init(e)}}aM=(0,e2.gn)([(0,e4.b)()],aM);var aR=n("345420"),aD=(e,t)=>{var[n,r]=(0,tq.useState)(t.isVisible),[o,a]=(0,tq.useState)(0),s=(0,tq.useRef)(t.isVisible),[l,c]=(0,tq.useState)(!e.load),d=(0,tq.useMemo)(()=>(0,aR.Z)(e.renderContent)?e.renderContent(t.context,t):null,[e,t,o]),u=(0,tq.useCallback)((0,e3._)(function*(){if(!!e.load&&!!(0,aR.Z)(e.load))yield e.load(t.context),c(!0)}),[e,t,c]),h=(0,tq.useCallback)(e=>{var{isVisible:t}=e;return t&&!s.current&&(r(!0),s.current=!0),e.onDidChangeVisibility(e=>{e&&!s.current&&(r(!0),s.current=!0)})},[r,s]);return(0,tq.useLayoutEffect)(()=>{var e=h(t),n=t.onRefresh(()=>{a(e=>e+1)});return()=>{e.dispose(),n.dispose()}},[t,h]),(0,tq.useEffect)(()=>{u()},[u]),{loaded:l,mounted:n,content:d}};class aA{init(){this.disposable.push(this.shell.mainPanel.onDidChangeCurrent(e=>{e&&this.onFocusEmitter.fire(e)}))}dispose(){this.disposable.dispose()}constructor(){this.onFocusEmitter=new eX.Q5,this.onFocus=this.onFocusEmitter.event,this.disposable=new eX.K4(this.onFocusEmitter)}}(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],aA.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(nY),(0,e2.w6)("design:type",void 0===nY?Object:nY)],aA.prototype,"eventService",void 0),(0,e2.gn)([(0,e8.f)(i5),(0,e2.w6)("design:type",void 0===i5?Object:i5)],aA.prototype,"menuService",void 0),(0,e2.gn)([(0,td.z)(),(0,e2.w6)("design:type",Function),(0,e2.w6)("design:paramtypes",[]),(0,e2.w6)("design:returntype",void 0)],aA.prototype,"init",null),aA=(0,e2.gn)([(0,e4.b)()],aA);var aN=(e,t,n)=>{var r=nF(aA),o=nF(e5),a=(0,tq.useCallback)(()=>{var r;null==e||null===(r=e.onFocus)||void 0===r||r.call(e,t),o.setContext("widgetFocus",null==n?void 0:n.uri),o.setContext("widgetContext",t)},[t]),s=nF(iq);(0,tq.useEffect)(()=>{var o,l,c,d,u=null===(l=s.mainPanel.currentTitle)||void 0===l?void 0:null===(o=l.owner)||void 0===o?void 0:o.uri;u&&(null==n?void 0:null===(c=n.uri)||void 0===c?void 0:c.match(u))&&a();var h=r.onFocus(e=>{var t,r;(null===(t=e.owner.uri)||void 0===t?void 0:t.toString())===(null==n?void 0:null===(r=n.uri)||void 0===r?void 0:r.toString())&&a()}),p=null==n?void 0:null===(d=n.onDispose)||void 0===d?void 0:d.call(n,()=>{var n;null==e||null===(n=e.onDispose)||void 0===n||n.call(e,t)});return()=>{var e,t;null==h||null===(e=h.dispose)||void 0===e||e.call(h),null==p||null===(t=p.dispose)||void 0===t||t.call(p)}},[])},aL=e=>()=>{var t=iA(),{context:n}=t;aN(e,n,t);var{loaded:r,mounted:o,content:a}=aD(e,t);return r&&o?a:(0,tK.jsx)(aE.yC,{})};class az{onInit(){this.wsService.init(),this.props.view.widgetRegistries.forEach(e=>{if(e.registerCommands&&e.registerCommands().forEach(t=>{!this.commandRegistry.getCommand(t.id)&&this.commandRegistry.registerCommand({id:t.id,label:t.label},{execute:e=>{var n=this.contextKeyService.getContext("widgetContext");t.execute(n,e)},isEnabled:n=>{var r,o=this.contextKeyService.getContext("widgetFocus"),a=this.contextKeyService.getContext("widgetContext");return((null==o?!void 0:null===(r=o.toString)||void 0===r?!void 0:!r.call(o))||!!e.match.test(o.toString())||"widgetFocus"!==t.when)&&t.isEnable(a,n)}})}),e.registerShortcuts&&e.registerShortcuts().forEach(e=>{this.shortcutsService.registerHandlers({commandId:e.commandId,keybinding:e.keybinding,preventDefault:e.preventDefault})}),e.registerContextMenu){var t=e.registerContextMenu();this.services.contextmenu.registerContextMenu(t,e.match)}}),this.commandRegistry.unregisterCommand(eX.mY.Default.VIEW_FULL_SCREEN),this.commandRegistry.registerCommand({id:eX.mY.Default.VIEW_FULL_SCREEN,label:ad.o.t("project_ide_maximize")},{execute:()=>{this.viewService.switchFullScreenMode()}}),this.commandRegistry.registerCommand({id:oY.RELOAD,label:ad.o.t("refresh_project_tags")},{execute:e=>{if(e)e.refresh();else{var t,{currentWidget:n}=this.shell;null==n||null===(t=n.refresh)||void 0===t||t.call(n)}}}),this.shortcutsService.registerHandlers({commandId:oY.RELOAD,keybinding:"alt r",preventDefault:!1})}createLayout(e){var t=new rL;return t.id=oK.displayName,this.widgetManager.setWidget(oK.toString(),t),o1(e,t)}createWidget(e,t){var n,r=this.widgetManager.containerFactory.createChild();r.bind(ak).toSelf().inSingletonScope();var o=r.get(ak),a=null===(n=e.createStore)||void 0===n?void 0:n.call(e,t);r.bind(aC).toSelf().inSingletonScope();var s=r.get(aC);s.init(e,this.props.view.widgetTitleRender);var l={uri:t,store:a,widget:s,services:this.services};return o.context=l,o.container=r,r.bind(oL).toConstantValue(l),o.render=aL(e),o}registerView(e){var t=this.props.view.widgetRegistries.map(e=>({area:e.area||r6.MAIN_PANEL,match:e.match,createWidget:this.createWidget.bind(this,e),toolbarItems:this.props.view.preToolbar?[{render:this.props.view.preToolbar,align:r4.LEADING},{render:this.props.view.toolbar,align:r4.TRAILING}]:[]}));e.register({presetConfig:{disableContextMenu:!0,splitScreenConfig:{main:{splitOptions:{maxSplitCount:2,splitOrientation:"horizontal"},dockPanelOptions:{spacing:6}}},disableFullScreen:!0},widgetFactories:[{area:r6.MAIN_PANEL,canHandle:oq.match.bind(oq),render:this.props.view.uiBuilder},{area:r6.TOP_BAR,canHandle:oB.match.bind(oB),render:this.props.view.topBar},{area:r6.MAIN_PANEL,canHandle:oW.match.bind(oW),render:this.props.view.widgetDefaultRender},{area:r6.PRIMARY_SIDEBAR,canHandle:oF.match.bind(oF),widget:aM},{area:r6.SECONDARY_SIDEBAR,canHandle:oH.match.bind(oH),render:this.props.view.secondarySidebar},...t],defaultLayoutData:{defaultWidgets:[oB]},customLayout:this.createLayout.bind(this)})}onDispose(){this.wsService.onDispose()}}(0,e2.gn)([(0,e8.f)(aj),(0,e2.w6)("design:type",void 0===aj?Object:aj)],az.prototype,"props",void 0),(0,e2.gn)([(0,e8.f)(r9),(0,e2.w6)("design:type",void 0===r9?Object:r9)],az.prototype,"widgetManager",void 0),(0,e2.gn)([(0,e8.f)(e5),(0,e2.w6)("design:type",void 0===e5?Object:e5)],az.prototype,"contextKeyService",void 0),(0,e2.gn)([(0,e8.f)(oQ),(0,e2.w6)("design:type",void 0===oQ?Object:oQ)],az.prototype,"services",void 0),(0,e2.gn)([(0,e8.f)(eX.Ho),(0,e2.w6)("design:type",void 0===eX.Ho?Object:eX.Ho)],az.prototype,"commandRegistry",void 0),(0,e2.gn)([(0,e8.f)(t3),(0,e2.w6)("design:type",void 0===t3?Object:t3)],az.prototype,"shortcutsService",void 0),(0,e2.gn)([(0,e8.f)(iq),(0,e2.w6)("design:type",void 0===iq?Object:iq)],az.prototype,"shell",void 0),(0,e2.gn)([(0,e8.f)(oX),(0,e2.w6)("design:type",void 0===oX?Object:oX)],az.prototype,"viewService",void 0),(0,e2.gn)([(0,e8.f)(iY),(0,e2.w6)("design:type",void 0===iY?Object:iY)],az.prototype,"viewRenderer",void 0),(0,e2.gn)([(0,e8.f)(oN),(0,e2.w6)("design:type",void 0===oN?Object:oN)],az.prototype,"wsService",void 0),az=(0,e2.gn)([(0,e4.b)()],az);var aO=e0({onBind:(e,t)=>{var{bind:n}=e;n(aj).toConstantValue(t),n(aA).toSelf().inSingletonScope(),n(oX).toSelf().inSingletonScope(),n(am).toSelf().inSingletonScope(),n(ag).toSelf().inSingletonScope(),n(av).toSelf().inSingletonScope(),n(oN).toSelf().inSingletonScope(),n(oQ).toSelf().inSingletonScope(),(0,eX.KV)(n,az,[iG,eG]),(0,eX.KV)(n,aT,[nN])},onStart:e=>{e.container.get(tp).onStart()},onDispose:e=>{e.container.get(aA).dispose()}}),aB={SPLIT_LEFT:{id:"view.custom.split-left",label:ad.o.t("project_ide_tabs_open_on_left")},SPLIT_RIGHT:{id:"view.custom.split-right",label:ad.o.t("project_ide_tabs_open_on_right")},REFRESH:{id:"view.custom.refresh-widget",label:ad.o.t("refresh_project_tags")}};function aW(e){var t=0;return Array.from(e.children()).forEach(e=>{e instanceof rZ&&(t+=e.titles.length)}),t}var aF=e0({onInit(e){var t=e.container.get(i5),n=e.container.get(eX.Ho),r=e.container.get(oX),o=e.container.get(iq),a=e.container.get(t3);n.updateCommand(eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,{label:ad.o.t("project_ide_tabs_close")}),n.updateCommand(eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,{label:ad.o.t("project_ide_tabs_close_other_tabs")}),n.updateCommand(eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,{label:ad.o.t("project_ide_tabs_close_all")}),n.registerCommand(aB.REFRESH,{execute:e=>{e.refresh()}}),a.registerHandlers({keybinding:"alt r",commandId:aB.REFRESH.id}),n.registerCommand(aB.SPLIT_LEFT,{execute:e=>{r.splitScreen("left",e)},isEnabled:()=>aW(o.mainPanel)>1}),n.registerCommand(aB.SPLIT_RIGHT,{execute:e=>{r.splitScreen("right",e)},isEnabled:()=>aW(o.mainPanel)>1}),t.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,selector:".lm-TabBar-tab"}),t.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_OTHER_WIDGET,selector:".lm-TabBar-tab"}),t.addMenuItem({command:eX.mY.Default.VIEW_CLOSE_ALL_WIDGET,selector:".lm-TabBar-tab"}),t.addMenuItem({command:aB.REFRESH.id,selector:".lm-TabBar-tab"}),t.addMenuItem({type:"separator",selector:".lm-TabBar-tab"}),t.addMenuItem({command:aB.SPLIT_LEFT.id,selector:".lm-TabBar-tab"}),t.addMenuItem({command:aB.SPLIT_RIGHT.id,selector:".lm-TabBar-tab"})}});class aH{registerCommands(e){e.registerCommand(eX.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,{execute:e=>{e.some(e=>null==e?void 0:e.saving)?this.modalService.onModalVisibleChangeEmitter.fire({type:af.CLOSE_CONFIRM,options:e}):e.forEach(e=>{var t,n;return null==e?void 0:null===(n=e.owner)||void 0===n?void 0:null===(t=n.close)||void 0===t?void 0:t.call(n)})}})}}(0,e2.gn)([(0,e8.f)(am),(0,e2.w6)("design:type",void 0===am?Object:am)],aH.prototype,"modalService",void 0),aH=(0,e2.gn)([(0,e4.b)()],aH);var aU=e0({onBind:e=>{var{bind:t}=e;(0,eX.KV)(t,aH,[eX.pY])}}),aV=e=>{var{presetOptions:t,plugins:n,children:r}=e,o=(0,tq.useCallback)(()=>({preferences:{defaultData:{theme:"light"}},view:{restoreDisabled:!0,widgetFactories:[],defaultLayoutData:{},widgetFallbackRender:t.view.widgetFallbackRender},plugins:[aO(t),aU(),aF(),...n||[]]}),[t,n]);return(0,tK.jsx)(oM,{options:o,className:"e2e-flow-container",children:r})},aK=n("392300");var aq=(($={}).Folder="folder",$);var aZ=((ee={}).CreateFolder="resource-folder-create-folder",ee.CreateResource="resource-folder-create-resource",ee.EditName="resource-folder-edit-name",ee.Delete="resource-folder-delete",ee),aY={"resource-folder-create-folder":{id:"resource-folder-create-folder",label:"Create Folder",executeName:"onCreateFolder"},"resource-folder-create-resource":{id:"resource-folder-create-resource",label:"Create Resource",executeName:"onCreateResource"},"resource-folder-edit-name":{id:"resource-folder-edit-name",label:"Edit Name",executeName:"onEnter"},"resource-folder-delete":{id:"resource-folder-delete",label:"Delete",executeName:"onDelete"}},aX="$-ROOT-$",aQ="resource-list-right-click-wrapper",aG={id:aX,type:aq.Folder,name:"root"},aJ="resourceFolderContextKey",a$="more-tools-class-name";var a0=((et=a0||{}).Normal="normal",et.Disabled="disabled",et),a1={textErrorColor:"rgba(var(--blockwise-error-color))",textWarningColor:"rgba(var(--blockwise-warning-color))",textSelectedColor:"rgba(6, 7, 9, 0.96)",textNormalColor:"rgba(6, 7, 9, 0.5)"},a2=(e,t)=>"".concat("resource-folder-command-prefix","_").concat(e,"_").concat(t),a4=(e,t)=>{var n=0,r=e;if(String(r.id)===String(t[n])){for(n+=1;n<t.length&&r;)r=(r.children||[]).find(e=>String(e.id)===String(t[n])),n+=1;return r}},a6=(e,t)=>{var n=null,r=null,o=(e,a)=>{if(!r){if(String(e.id)===String(t)){r={resource:e,parent:n,path:a};return}if(e.children){var s=n;n=e,e.children.forEach(e=>{o(e,[...a,e.id])}),n=s}return null}};return o(e,[e.id]),r},a5=e=>{var{resourceTree:t,from:n,to:r,options:o}=e,{collapsedMap:a}=o||{},s=[],l=!1,c=(e,t)=>{var o=String(e.id)===String(n)||String(e.id)===String(r);!l&&o?(l=!0,s.push(e.id)):l&&(s.push(e.id),o&&(l=!1)),e.children&&!(null==a?void 0:a[e.id])&&e.children.forEach(e=>{c(e,[...t,e.id])})};return c(t,[t.id]),s},a3=e=>{var t=(e,t)=>{var n,r,o,a,s=(null===(r=e.name)||void 0===r?void 0:null===(n=r.toLowerCase)||void 0===n?void 0:n.call(r))||"",l=(null===(a=t.name)||void 0===a?void 0:null===(o=a.toLowerCase)||void 0===o?void 0:o.call(a))||"";return s<l?-1:s>l?1:0},n=e.filter(e=>e.type===aq.Folder).sort((e,n)=>t(e,n)),r=e.filter(e=>e.type!==aq.Folder).sort((e,n)=>t(e,n));return n.concat(r)},a8=e=>{var{selectedId:t,resourceTree:n,collapsedMap:r,itemHeight:o}=e,a=-1,s=!1,l=e=>{if(!!e&&!s){if(a+=1,t===e.id){s=!0;return}e.children&&!r[e.id]&&e.children.forEach(e=>{l(e)})}};return l(n),(a-1)*o},a9=e=>{if(!e)return{};var t=(0,tv._)((0,tm._)({},aG),{children:e instanceof Array?e:[e]}),n={},r=(e,t)=>{if(!e)return{maxDeep:t.length-1};var o=t.length+("folder"===e.type?1:0),a="draft"===e.edit_status;return e.children&&e.children.forEach(e=>{var{maxDeep:n,editDraft:s}=r(e,[...t,e.id]);o=Math.max(o,n),a=!!(a||s)}),n[String(e.id)]=(0,tv._)((0,tm._)({},e),{path:t,maxDeep:o-t.length}),{maxDeep:o,editDraft:a}};return r(t,[t.id]),n},a7=(e,t,n)=>{var r=[],o=e=>(r.push(t[e.id]),e.children&&!n[e.id]&&e.children.forEach(e=>{o(e)}),null);return o(e),r},se=e=>{for(var{resourceList:t,parentId:n,type:r}=e,o=0,a=!1,s=[];o<t.length;){var l,c,d=t[o];if(a&&((null===(l=d.path)||void 0===l?void 0:l.length)||0)<=s.length||a&&d.type!==aq.Folder&&((null===(c=d.path)||void 0===c?void 0:c.length)||0)-1===s.length)break;if(d.id===n&&(a=!0,s=d.path||[],r===aq.Folder))return o+1;o+=1}return o};function st(e){var{label:t,nameTitle:n}=e;return t?t.length>64?"Length exceeds":/^[A-Za-z]/.test(t)?/^[A-Za-z][0-9a-zA-Z_]*$/.test(t)?"":"only ASCII letters, digits, and _":"Must start with letter":"Empty Key"}var sn=n("825251"),sr=n("70131"),si="name_input_wrapper",so=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!e||!!(n>10)||(null===(t=e.dataset)||void 0===t?void 0:t[si])===void 0&&so(e.parentElement,n+1)},sa=e=>{var t,n,r,o,{resource:a,initValue:s,handleSave:l,handleChangeName:c,errorMsg:d,errorMsgRef:u,validateConfig:h,config:p}=e,[f,m]=(0,tq.useState)(s),v=(0,tq.useRef)(null),g=()=>{l((null==u?void 0:u.current)?s:void 0)},b=(0,tq.useRef)(!1);return(0,tq.useEffect)(()=>{setTimeout(()=>{b.current=!0},0);var e=e=>{so(e.target)&&g()};return window.addEventListener("mousedown",e,!0),()=>{window.removeEventListener("mousedown",e,!0)}},[]),(0,tK.jsxs)("div",{["data-".concat(si)]:!0,className:"base-item-name-input ".concat("mouseup-ignore-class-name"," ").concat(d?"base-item-name-input-error":""),style:{width:"100%"},children:[(0,tK.jsx)(aE.II,{className:(null==p?void 0:null===(t=p.input)||void 0===t?void 0:t.className)||"",style:(0,tm._)({padding:0},null==p?void 0:null===(n=p.input)||void 0===n?void 0:n.style),ref:v,placeholder:null==p?void 0:null===(r=p.input)||void 0===r?void 0:r.placeholder,onMouseDown:e=>{e.stopPropagation()},onKeyDown:e=>{e.stopPropagation(),"Escape"===e.code&&l("")},onEnterPress:e=>{if(!!b.current)e.stopPropagation(),e.preventDefault(),g()},onChange:e=>{m(e),c(e)},value:f,autoFocus:!0}),d?(null==h?void 0:h.errorMsgRender)?null==h?void 0:null===(o=h.errorMsgRender)||void 0===o?void 0:o.call(h,d,a):(0,tK.jsx)("div",{style:(null==h?void 0:h.errorMsgStyle)||{},className:"base-item-name-input-error-msg-absolute ".concat(null==h?void 0:h.errorMsgClassName),children:d}):null]})},ss=n("873183"),sl=e=>{var{resource:t,contextMenuCallback:n,resourceTreeWrapperRef:r,renderMoreSuffix:o}=e,a=e=>{e.currentTarget=r.current,n(e,[t])},s=(0,tK.jsx)(aE.zx,(0,tv._)((0,tm._)({"data-testid":"agent-ide.resource-item.".concat(t.type,".").concat(t.name,".more-tools")},"object"==typeof o&&(null==o?void 0:o.extraProps)?null==o?void 0:o.extraProps:{}),{className:"base-item-more-hover-display-class ".concat(a$," base-item-more-btn ").concat("object"==typeof o&&o.className?o.className:""),style:"object"==typeof o&&o.style?o.style:{},icon:(0,tK.jsx)(ss.NsR,{}),theme:"borderless",size:"small",onMouseUp:a}));if("object"==typeof o&&o.render)return o.render({onActive:a,baseBtn:s,resource:t});if("object"==typeof o&&o.tooltip)return"string"==typeof o.tooltip?(0,tK.jsx)(aE.u,{content:o.tooltip,children:s}):(0,tK.jsx)(aE.u,(0,tv._)((0,tm._)({},o.tooltip),{children:s}));return s},{Text:sc}=aE.ZT,sd=(0,tq.memo)(e=>{var{name:t,resource:n,searchConfig:r,isSelected:o,tooltipSpace:a,textRender:s}=e,l=(()=>{var e,t;if((null===(e=n.problem)||void 0===e?void 0:e.status)==="error")return a1.textErrorColor;if((null===(t=n.problem)||void 0===t?void 0:t.status)==="warning")return a1.textWarningColor;if(o)return a1.textSelectedColor;return a1.textNormalColor})();return(0,tK.jsx)("span",{style:{flex:1,display:"flex",height:"100%",alignItems:"center",justifyContent:"space-between",overflow:"hidden",fontSize:12},children:(0,tK.jsx)(sc,{style:{flex:1},ellipsis:{showTooltip:{opts:{content:"".concat(t),style:{wordBreak:"break-all"},position:"right",spacing:8+(a||0)}}},children:s?s({resource:n,isSelected:o}):(0,tK.jsx)("span",{style:{color:l},children:(0,tK.jsx)(aE.y$,{sourceString:t,searchWords:[(null==r?void 0:r.searchKey)||""],highlightStyle:(0,tv._)((0,tm._)({},null==r?void 0:r.highlightStyle),{backgroundColor:"transparent",color:"var(--semi-color-primary)"})})})})})},(e,t)=>{var n,r;return e.name===t.name&&(null===(n=e.searchConfig)||void 0===n?void 0:n.searchKey)===(null===(r=t.searchConfig)||void 0===r?void 0:r.searchKey)&&e.resource===t.resource&&e.isSelected===t.isSelected&&!0}),su=e=>{var{resource:t,path:n,icon:r,isSelected:o,isTempSelected:a,isInEdit:s,searchConfig:l,suffixRender:c,config:d,renderMoreSuffix:u,textRender:h,isDragging:p,useOptimismUI:f,isOptimismSaving:m,contextMenuCallback:v,resourceTreeWrapperRef:g}=e,b=(0,ij._)(e,["resource","path","icon","isSelected","isTempSelected","isInEdit","searchConfig","suffixRender","config","renderMoreSuffix","textRender","isDragging","useOptimismUI","isOptimismSaving","contextMenuCallback","resourceTreeWrapperRef"]),{name:y,status:_}=t,w=(0,tq.useMemo)(()=>m&&"object"==typeof f&&f.loadingRender?f.loadingRender():null,[m]),x=(0,tq.useMemo)(()=>{var e;return!s&&(null==c?void 0:null===(e=c.render)||void 0===e?void 0:e.call(c,{resource:t,isSelected:o,isTempSelected:a}))},[o,s,t,a]),S=(0,tq.useMemo)(()=>!s&&u?(0,tK.jsx)(sl,{resource:t,contextMenuCallback:v,resourceTreeWrapperRef:g,renderMoreSuffix:u}):null,[s,t,u]);return(0,tK.jsxs)("div",{"data-testid":"agent-ide.resource-item.".concat(t.type,".").concat(t.name),className:"base-item",style:(0,tm._)({justifyContent:"space-between",height:(null==d?void 0:d.itemHeight)||24,borderRadius:4,paddingLeft:(n.length-1)*((null==d?void 0:d.tabSize)||8)-4},_===a0.Disabled?{fontStyle:"italic",filter:"opacity(0.5)",cursor:"not-allowed",textDecoration:"line-through"}:{}),children:[(0,tK.jsxs)("div",{style:{display:"flex",overflow:s?"visible":"hidden",width:"100%"},children:[r?(0,tK.jsx)("span",{className:"base-item-icon",style:{color:"rgba(6, 7, 9, 0.96)"},children:r}):null,s?(0,tK.jsx)(sa,{resource:t,initValue:y,handleSave:b.handleSave,handleChangeName:b.handleChangeName,errorMsg:b.errorMsg,errorMsgRef:b.errorMsgRef,validateConfig:b.validateConfig,config:d}):(0,tK.jsx)(sd,{isSelected:o,resource:t,name:y,searchConfig:l,tooltipSpace:((null==c?void 0:c.width)||0)+(u?26:0),textRender:h})]}),w,x,S]},t.id)},sh=e=>{var{resource:t,path:n,style:r}=e,o=(0,ij._)(e,["resource","path","style"]),{id:a}=t,{iconRender:s,isSelected:l,isTempSelected:c,isExpand:d,draggingError:u,isDragging:h}=o,p=1===n.length;return(0,tK.jsx)(tK.Fragment,{children:(0,tK.jsx)("div",{style:(0,tv._)((0,tm._)({},r||{}),{cursor:u?"not-allowed":h?"grabbing":"default"}),children:!p&&(0,tK.jsx)(su,(0,tm._)({resource:t,path:n,icon:s?s({resource:t,isSelected:l,isTempSelected:c,isExpand:d}):void 0},o))},"folder-".concat(a))})},sp=e=>{var{resource:t,path:n}=e,r=(0,ij._)(e,["resource","path"]),{isDragging:o,draggingError:a,isSelected:s,isTempSelected:l,iconRender:c}=r;return(0,tK.jsx)("div",{style:{cursor:a?"not-allowed":o?"grabbing":"pointer"},children:(0,tK.jsx)(su,(0,tm._)({resource:t,path:n,icon:(null==t?void 0:t.type)?null==c?void 0:c({resource:t,isSelected:s,isTempSelected:l}):void 0},r))},"file-".concat(t.id))},sf=e=>{var t=(0,sn._)({},(0,sr._)(e)),{resource:n,path:r}=t,o=n.type===aq.Folder?sh:sp;return o?(0,tK.jsx)(o,(0,tv._)((0,tm._)({},t),{path:[...r,n.id]}),"base-render-".concat(n.id)):(0,tK.jsx)(tK.Fragment,{})},sm=(e,t)=>{var[n,r]=(0,tq.useState)(e),o=(0,tq.useRef)(e);return[o,e=>{o.current=e,r(e),null==t||t(e)},n]},sv=e=>{var{selected:t,resourceMap:n,collapsedMapRef:r,setCollapsed:o,tempSelectedMapRef:a,setTempSelectedMap:s,scrollInView:l,updateContext:c}=e,d=(0,tq.useRef)(t||"");return(0,tq.useEffect)(()=>{var e,u;if(!t){s({});return}d.current=t,c({currentSelectedId:t}),((null===(e=n.current[t])||void 0===e?void 0:e.path)||[]).forEach(e=>{delete r.current[e]}),o((0,tm._)({},r.current)),a.current={},(null===(u=n.current)||void 0===u?void 0:u[t])&&(a.current={[t]:n.current[t]}),s(a.current),setTimeout(()=>{l(t)},16)},[t]),d},sg=e=>e.map(e=>"type"in e?e:aY[e.id]?(0,tv._)((0,tm._)({},aY[e.id],e),{id:e.id}):(0,tv._)((0,tm._)({},e),{id:e.id})),sb=new Set,sy="resource-folder-separator-key",s_=e=>{var{tempSelectedMapRef:t,contextMenuHandler:n,registerCommand:r,id:o,contextMenuDisabled:a,onContextMenuVisibleChange:s}=e,l=nF(i5),c=(0,tq.useRef)(0),d=(0,tq.useRef)(0),u=(0,tq.useRef)(!1),h=e=>{u.current!==e&&(u.current=e,null==s||s(u.current))},p=()=>{l.clearMenuItems([...sb.keys(),...Object.keys(aY),...Array(c.current).fill(null).map(e=>e=>e===sy)].filter(Boolean)),c.current=0,d.current=0},f=()=>{var e,t,n;p(),null==l||null===(n=l.contextMenu)||void 0===n||null===(t=n.menu)||void 0===t||null===(e=t.close)||void 0===e||e.call(t),null==h||h(!1)};return(0,tq.useEffect)(()=>{var e,t,n,r;return null==l||null===(r=l.contextMenu)||void 0===r||null===(n=r.menu)||void 0===n||null===(t=n.aboutToClose)||void 0===t||null===(e=t.connect)||void 0===e||e.call(t,()=>{u.current&&(null==h||h(!1))}),()=>{f()}},[]),{contextMenuCallback:(e,s)=>{var u=sg(n?n(s||Object.values(t.current)):[]);return r(u),p(),u.forEach(e=>{if("type"in e){c.current=c.current+1,d.current=d.current+1,l.addMenuItem({command:sy,type:"separator",selector:".".concat(a2(aQ,o))});return}if(!!e.id)!sb.has(e.id)&&sb.add(e.id),!a&&(d.current=d.current+1,l.addMenuItem({command:e.id,selector:".".concat(a2(aQ,o)),args:e,tooltip:e.tooltip}))}),!a&&d.current>0&&(l.open(e),setTimeout(()=>{null==h||h(!0)},0)),()=>{f()}},closeContextMenu:f}},sw=e=>{var{isFocus:t,id:n,updateContext:r,clearContext:o,selectedIdRef:a,tempSelectedMapRef:s}=e,l=(0,tq.useRef)({}),c=nF(eX.Ho),d=(0,tq.useRef)({onEnter:()=>{var e,t;null===(e=(t=l.current)[aZ.EditName])||void 0===e||e.call(t)},onDelete:()=>{var e,t;null===(e=(t=l.current)[aZ.Delete])||void 0===e||e.call(t)},onCreateFolder:()=>{var e,t;null===(e=(t=l.current)[aZ.CreateFolder])||void 0===e||e.call(t)},onCreateResource:()=>{var e,t;null===(e=(t=l.current)[aZ.CreateResource])||void 0===e||e.call(t)}});return(0,tq.useEffect)(()=>{t?r((0,tv._)((0,tm._)({},d.current),{currentSelectedId:a.current,tempSelectedMap:s.current,id:n})):o()},[t]),{registerEvent:(e,t)=>{l.current[e]=t},registerCommand:e=>{e.forEach(e=>{if(!("type"in e))aY[e.id]?(e.label||e.shortLabel)&&c.updateCommand(e.id,(0,tm._)({},e.label?{label:e.label}:{},e.shortLabel?{shortLabel:e.shortLabel}:{})):e.execute&&(c.getCommand(e.id)&&c.unregisterCommand(e.id),c.registerCommand({id:e.id,label:e.label,shortLabel:e.label},{execute:()=>{var t;null===(t=e.execute)||void 0===t||t.call(e)},isEnabled:e=>!e.disabled,isVisible:e=>!e.isHidden}))})}}},sx=e=>{var{enable:t,onChange:n=aK.Z,onDrag:r=aK.Z,onChangeName:o=aK.Z,onCreate:a=aK.Z,onDelete:s=aK.Z,onRevertDelete:l=aK.Z,changeResourceTree:c,scrollInView:d,resourceTreeRef:u,resourceMap:h}=e,[p,f]=(0,tq.useState)({}),m=e=>{var t=e instanceof Array?e:[e];f((0,tm._)({},p,t.reduce((e,t)=>(0,tm._)({[t]:!0},e),{})))},v={optimismSavingMap:p,clearOptimismSavingMap:()=>{f({})}};return t?(0,tm._)({handleDrag:e=>{var t,o,{toId:a,resourceList:s}=e;if(!!a&&!!s){s.forEach(e=>{var t=a4(u.current,e.path.slice(0,e.path.length-1));(null==t?void 0:t.children)&&(t.children=t.children.filter(t=>t.id!==e.id))});var l=null===(t=a6(u.current,a))||void 0===t?void 0:t.resource;l&&(l.children=a3([...l.children||[],...s])),m(s.map(e=>e.id)),c(u.current),null==r||r(e),null==n||n((null===(o=u.current)||void 0===o?void 0:o.children)||[])}},handleChangeName:e=>{var t,r=a4(u.current,e.path||[]);if(!!r)r.name=e.name,m(r.id),c(u.current),null==o||o(e),null==n||n((null===(t=u.current)||void 0===t?void 0:t.children)||[])},handleCreate:e=>{var t,{path:r,type:o,name:s}=e,l=a4(u.current,r);if(!!l){var p="".concat("resource-folder-optimism-id-").concat(Number(new Date)),f={id:p,type:o,name:s};m(p),l.children=a3([...l.children||[],f]),c(u.current),a(e),h.current[p]=f,null==d||d(p),null==n||n((null===(t=u.current)||void 0===t?void 0:t.children)||[])}},handleDelete:e=>{s(e)},handleRevertDelete:e=>{var t;e.forEach(e=>{var t=a4(u.current,e.path||[]);t&&(t.status="normal")}),c(u.current),null==l||l(e),null==n||n((null===(t=u.current)||void 0===t?void 0:t.children)||[])}},v):(0,tm._)({handleDrag:r,handleChangeName:o,handleCreate:a,handleDelete:s,handleRevertDelete:l},v)},sS="resource_folder_key",sk="resource_folder_drag_and_drop_stop_tag",sC="resource_folder_drag_and_drop_id",sj="click_tool_bar",sE="click_outside",sT="click_context_menu",sI=(e,t)=>e.x>t.x&&e.x<t.x+t.width&&e.y>t.y&&e.y<t.y+t.height,sP=e=>{var{e:t,wrapperElm:n,uniqId:r}=e,{pageX:o,pageY:a}=t,{x:s,y:l,width:c,height:d}=n.getBoundingClientRect();return sI({x:o,y:a},{x:s,y:l,width:c,height:d})&&!sI({x:o,y:a},{x:s+8,y:l+8,width:c-16,height:d-16})?aG:sM(t.target,r)},sM=(e,t,n)=>{var r,o,a,s,l,c={};if(n&&(null==e?void 0:null===(o=e.classList)||void 0===o?void 0:null===(r=o.contains)||void 0===r?void 0:r.call(o,n))&&(c.customTag=n),!e)return sE;if((null===(a=e.dataset)||void 0===a?void 0:a[sC])!==void 0&&(null===(s=e.dataset)||void 0===s?void 0:s[sS])===t)return(0,tm._)({id:e.dataset[sC]},c);if((null===(l=e.dataset)||void 0===l?void 0:l[sk])&&e.dataset[sS]===t)return(0,tm._)({id:aX},c);if(e.classList.contains("resource_folder_tool_bar_class_name"))return sj;var d=sM(e.parentElement,t,n);return"object"==typeof d&&null!==d?(0,tm._)({},d,c):d},sR=e=>{var t;if(!e)return"";if("folder"===e.type)return String(e.id);return String(null===(t=e.path)||void 0===t?void 0:t[e.path.length-2])},sD=(e,t)=>!!(Math.abs(t.x-e.x)>10||Math.abs(t.y-e.y)>10)||!1,sA=(e,t,n)=>{var{name:r,path:o,id:a}=t,s=e.filter(e=>{var t=e.path||[];return t[t.length-2]===a});if(s.length)return"Can't move ".concat(s.map(e=>e.name).join(", ")," into ").concat(r);var l=e.filter(e=>(o||[]).includes(String(e.id)));if(l.length)return"Can't move ".concat(l.map(e=>e.name).join(", ")," into ").concat(r);var c=e.reduce((e,t)=>Math.max(e,((null==t?void 0:t.maxDeep)||0)+1),0);return(t.path||[]).length-1+c>((null==n?void 0:n.maxDeep)||5)?"Can't move into ".concat(r,". MaxDeep is ").concat((null==n?void 0:n.maxDeep)||5):""};var sN=((en=sN||{}).MouseDown="mouseDown",en.MouseDownInDiv="mouseDownInDiv",en.MouseUpInDiv="mouseUpInDiv",en.MouseUp="mouseUp",en.MouseMove="mouseMove",en.KeyDown="keyDown",en),sL=()=>{var e=(0,tq.useRef)([]),t=(0,tq.useRef)([]),n=(0,tq.useRef)([]),r=(0,tq.useRef)([]),o=(0,tq.useRef)([]),a=(0,tq.useRef)([]),s=t=>{e.current.forEach(e=>{e(t)})},l=e=>{t.current.forEach(t=>{t(e)})},c=e=>{n.current.forEach(t=>{t(e)})},d=e=>{r.current.forEach(t=>{t(e)})},u=e=>{a.current.forEach(t=>{t(e)})},h=e=>{o.current.forEach(t=>{t(e)})};return(0,tq.useEffect)(()=>(window.addEventListener("mousedown",s),window.addEventListener("mouseup",d),window.addEventListener("keydown",u),window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousedown",s),window.removeEventListener("mouseup",d),window.removeEventListener("keydown",u),window.removeEventListener("mousemove",h)}),[]),{addEventListener:(s,l)=>{"keyDown"===s?a.current.push(l):"mouseDownInDiv"===s?t.current.push(l):"mouseUpInDiv"===s?n.current.push(l):"mouseDown"===s?e.current.push(l):"mouseUp"===s?r.current.push(l):"mouseMove"===s&&o.current.push(l)},customEventBox:e=>{var{children:t}=e;return(0,tK.jsx)("div",{className:"resource-list-custom-event-wrapper",onMouseDownCapture:l,onMouseUp:c,children:t})},onMouseDownInDiv:l,onMouseUpInDiv:c}},sz=e=>{var t,n,r,{iconRender:o,selectedMap:a,addEventListener:s,config:l}=e,[c,d]=(0,tq.useState)(!1),u=(0,tq.useRef)(!1),[h,p]=(0,tq.useState)(null),f=e=>{u.current&&p({x:e.clientX,y:e.clientY})};(0,tq.useEffect)(()=>{s(sN.MouseMove,f)},[]);var m=!h||(null==l?void 0:null===(t=l.dragUi)||void 0===t?void 0:t.disable)?(0,tK.jsx)(tK.Fragment,{}):(0,tK.jsx)("div",{style:(0,tm._)({position:"absolute",zIndex:99999,top:5,left:5,display:c&&(null==h?void 0:h.x)?"block":"none",transform:"translate(".concat((null==h?void 0:h.x)||0,"px, ").concat((null==h?void 0:h.y)||0,"px)"),userSelect:"none",pointerEvents:"none",backgroundColor:"rgba(6, 7, 9, 0.08)",borderRadius:6,padding:"2px 4px",minWidth:20,minHeight:20},(null==l?void 0:null===(n=l.dragUi)||void 0===n?void 0:n.wrapperStyle)||{}),className:(null==l?void 0:null===(r=l.dragUi)||void 0===r?void 0:r.wrapperClassName)||"",children:Object.values(a).length>1?(0,tK.jsx)(tK.Fragment,{children:Object.values(a).length}):Object.values(a).map(e=>(0,tK.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(null==e?void 0:e.type)?(0,tK.jsx)("span",{style:{marginRight:4},children:null==o?void 0:o({resource:e})}):(0,tK.jsx)(tK.Fragment,{}),(0,tK.jsx)("span",{children:e.name})]},e.name))});return{handleDrag:e=>{u.current=e,d(e),p(null),e?document.body.style.cursor="grabbing":document.body.style.cursor=""},isDragging:c,isDraggingRef:u,dragPreview:m}},sO=e=>{var{draggable:t,uniqId:n,updateId:r,setTempSelectedMap:o,collapsedMapRef:a,setCollapsedMap:s,resourceTreeRef:l,onDrag:c,disabled:d,resourceMap:u,addEventListener:h,selectedIdRef:p,onSelected:f,tempSelectedMapRef:m,resourceTreeWrapperRef:v,iconRender:g,config:b}=e,y=(0,tq.useRef)(null),[_,w]=(0,tq.useState)(!1),x=(0,tq.useRef)(!1),S=nF(oi),[k,C]=(0,tq.useState)(""),j=(0,tq.useRef)(null),{isDragging:E,isDraggingRef:T,handleDrag:I,dragPreview:P}=sz({iconRender:g,selectedMap:m.current,addEventListener:h,config:b}),M=e=>{if(!(null==b?void 0:b.resourceUriHandler))return;var t,n=Object.values(m.current).filter(e=>e.type!==aq.Folder).map(e=>{var t;return null===(t=b.resourceUriHandler)||void 0===t?void 0:t.call(b,e)}).filter(Boolean);if(!!n.length)null==S||null===(t=S.startDrag)||void 0===t||t.call(S,{uris:n,position:{clientX:e.clientX,clientY:e.clientY},callback:e=>{},backdropTransform:{clientX:e=>{var t;return Math.max(e,((null===(t=v.current)||void 0===t?void 0:t.clientWidth)||0)+100)}}})},R=e=>{t&&(M(e),C(""),I(!0))},D=()=>{C(""),I(!1)},A=e=>{var t=Object.values(e);1===t.length?j.current=t[0]:0===t.length&&(j.current=null),m.current=e,o(e)},[N,L]=(0,tq.useState)(null),z=(0,tq.useRef)(null),[O,B]=(0,tq.useState)({});(0,tq.useEffect)(()=>{if(null==N?void 0:N.id){var e=sR(N);e!==z.current&&(B((u.current[e]?a7(u.current[e],u.current,a.current):[]).reduce((e,t,n)=>(0,tv._)((0,tm._)({},e),{[t.id]:(0,tm._)({},t)}),{})),z.current=e)}else z.current=null,B({})},[null==N?void 0:N.id]);var W=()=>{r(),w(!0),x.current=!0},F=()=>{A({}),w(!1),x.current=!1},H=()=>{var e=Object.values(m.current).filter(e=>e.id!==aX);return e=e.filter(e=>{var{type:t,path:n}=u.current[e.id];if(t!==aq.Folder){var r=n||[];return!(r||[]).slice(0,r.length-1).some(e=>e!==aX&&m.current[e])}return!0})},U=e=>{if(null==d?void 0:d.current)return;var t=sM(e.target,n);if(!!t){if(W(),"object"==typeof t&&0===e.button&&(y.current={x:e.clientX,y:e.clientY}),"object"==typeof t&&!e.shiftKey&&!e.metaKey){var r,o,a=null;(null==(a=t.id===aX?aG:(null==u?void 0:null===(o=u.current)||void 0===o?void 0:o[String(null==t?void 0:t.id)])||{})?void 0:a.id)&&!(null===(r=m.current)||void 0===r?void 0:r[a.id])&&A({[a.id]:a})}}},V=e=>{if((null==d?!void 0:!d.current)&&!!x.current){var t=sM(e.target,n);if(D(),!t||t===sE){F();return}if(t===sT)return}},K=e=>{if((null==d?!void 0:!d.current)&&!T.current){var t=sM(e.target,n,a$);if("object"==typeof t&&null!==t){var r=null;if(r=t.id===aX?aG:(null==u?void 0:null===(c=u.current)||void 0===c?void 0:c[String(null==t?void 0:t.id)])||{},t.customTag===a$){A({[r.id]:r});return}if(e.ctrlKey||2===e.button&&(null==r?void 0:r.id)&&(null===(o=m.current)||void 0===o?void 0:o[r.id]))return;if(e.shiftKey){var o,c,h,v=(null===(h=j.current)||void 0===h?void 0:h.id)||(null==p?void 0:p.current);if(!v||!(null==r?void 0:r.id)||v===(null==r?void 0:r.id))return;var g=a5({resourceTree:l.current,from:v,to:r.id,options:{collapsedMap:a.current}});(g=(g||[]).reduce((e,t)=>{var n="object"==typeof t?String(t.id):String(t);return(0,tv._)((0,tm._)({},e),{[n]:null==u?void 0:u.current[n]})},{}))[aX]&&delete g[aX],A(g)}else if(e.metaKey){var b=(0,tm._)({},m.current);(null==r?void 0:r.id)&&(b[r.id]?delete b[r.id]:b=(0,tv._)((0,tm._)({},b),{[r.id]:r})),b[aX]&&delete b[aX],A(b)}else(null==r?void 0:r.type)&&"folder"!==r.type&&(null==f||f(r.id,r)),(null==r?void 0:r.id)&&A({[r.id]:r})}(!T.current||!Object.keys(m.current).length)&&"object"==typeof t&&null!==t&&t.id!==aX&&0===e.button&&!e.shiftKey&&!e.metaKey&&s(t.id,!a.current[t.id])}},q=e=>{if(null==d?!void 0:!d.current){if(T.current&&Object.keys(m.current).length&&v.current){var t=sP({e,wrapperElm:v.current,uniqId:n});if(t===sT||!t)return;if("object"==typeof t){var r=H(),o=sR(u.current[t.id]),a=sA(r,u.current[o],b);a?null==c||c({errorMsg:a}):(null==c||c({resourceList:r,toId:o}),s(o,!1))}D()}y.current=null,L(null)}};return(0,tq.useEffect)(()=>{h(sN.MouseDown,V),h(sN.MouseDownInDiv,U),h(sN.MouseUpInDiv,K),h(sN.MouseUp,q)},[]),{context:{isDragging:E,draggingError:k,isFocus:_,dataHandler:e=>({["data-".concat(sC)]:e.id,["data-".concat(sS)]:n}),tempSelectedMapRef:m,currentHoverItem:N,highlightItemMap:O},isFocusRef:x,onMouseMove:e=>{if((null==d?void 0:d.current)||!y.current)return;var t=Object.values(m.current);if(0===t.length||1===t.length&&t[0].id===aX||!(T.current||sD(y.current,{x:e.clientX,y:e.clientY})))return;if(!T.current){R(e);return}if(!v.current)return;var r=sP({e,wrapperElm:v.current,uniqId:n});if(r!==sT){if(!r||r===sE||r===sj){L(null);return}if("object"==typeof r&&(null==r?void 0:r.id)!==(null==N?void 0:N.id)){if((null==r?void 0:r.id)===aX)L(aG);else{L(u.current[String(null==r?void 0:r.id)]);var o=sR(u.current[r.id]);C(sA(H(),u.current[o],b))}}}},dragPreview:P,handleFocus:W,handleBlur:F}},sB=e=>{var{resourceTreeRef:t,collapsedMapRef:n,resourceMap:r,config:o}=e,a=(0,tq.useRef)(null),s=(0,tq.useRef)(!0);return{scrollInView:e=>{if(!a.current||!s.current||!e||!t.current||!(null==r?void 0:null===(l=r.current)||void 0===l?void 0:l[e]))return;var l,c=a8({selectedId:e,resourceTree:t.current,collapsedMap:n.current,itemHeight:(null==o?void 0:o.itemHeight)||24});if(!(c>a.current.scrollTop)||!(c<a.current.offsetHeight+a.current.scrollTop))a.current.scrollTo({top:c,behavior:"smooth"})},scrollWrapper:a,tempDisableScroll:e=>{s.current=!1,setTimeout(()=>{s.current=!0},e||300)}}};class sW{registerPromiseFn(e){return this.mainFunction=e,this}registerCallbackFb(e){return this.callbacks.push(e),this}excute(e){var t=this;return(0,e3._)(function*(){if(!!t.mainFunction){t.lastVersion+=1;var n=t.lastVersion,r=yield t.mainFunction(e);t.lastVersion===n&&t.callbacks.forEach(e=>e(r))}})()}dispose(){this.callbacks=[]}constructor(){this.callbacks=[],this.lastVersion=0}}var sF=e=>{var{validator:t,callback:n}=e,r=(0,tq.useRef)(new sW);return(0,tq.useEffect)(()=>(r.current.registerPromiseFn(t).registerCallbackFb(n),()=>{var e,t;null===(t=r.current)||void 0===t||null===(e=t.dispose)||void 0===e||e.call(t)}),[]),{validateAndUpdate:e=>{var t;null===(t=r.current)||void 0===t||t.excute(e)}}},sH=e=>{var t,{folderEnable:n,defaultResourceType:r,tempSelectedMapRef:o,registerEvent:a,setCollapsedMap:s,onChangeName:l,onCreate:c,resourceMap:d,selectedIdRef:u,resourceTreeRef:h,onDelete:p,validateConfig:f,config:m,resourceList:v}=e,[g,b]=(0,tq.useState)(""),y=(0,tq.useRef)(""),[_,w]=(0,tq.useState)(!1),x=(0,tq.useRef)(!1),S=e=>{x.current=e,w(e)},[k,C]=(0,tq.useState)(null),j=(0,tq.useRef)(null),[E,T]=(0,tq.useState)(null),I=(0,tq.useRef)(null),P=(0,tq.useRef)(null),M=(0,tq.useRef)(null),R=()=>{C(null),j.current=null,T(null),I.current=null,S(!1),b(""),y.current="",P.current=null,M.current=null},D=e=>{var t=d.current[e];t&&t.status!==a0.Disabled&&(C(t),j.current=t,S(!0),P.current=t.name,M.current=t.name)},A=()=>{var e=o.current;1===Object.keys(e).filter(e=>e!==aX).length&&D(Object.values(e)[0].id)},{validateAndUpdate:N}=sF({validator:(null==f?void 0:f.customValidator)||st,callback:e=>{if(e){b(e),y.current=e;return}b(""),y.current=""}});var L=(t=(0,e3._)(function*(e){var t=e||r;if(!!t&&(!!n||t!==aq.Folder)){var a=Object.values(o.current||{})[0];if(!a&&(a=d.current[u.current]),!a&&(a=d.current[aX]),"folder"!==a.type&&(null==a?void 0:a.path)&&(a=d.current[a.path[a.path.length-2]]),((null==a?void 0:null===(l=a.path)||void 0===l?void 0:l.length)||0)+(t===aq.Folder?1:0)>((null==m?void 0:m.maxDeep)||5)){aE.FN.warning("Can't create ".concat(t,". MaxDeep is 5"));return}if(a){var l,c,h,p=a.id;"folder"!==a.type&&(p=(null===(h=a.path)||void 0===h?void 0:h[(null===(c=a.path)||void 0===c?void 0:c.length)-2])||""),P.current="",M.current="",s(p,!1),yield new Promise(e=>{setTimeout(()=>{e(null)},0)}),j.current={id:"-1",name:"",type:t},C(j.current),I.current={parentId:p,type:t};var f=se({resourceList:v.current,parentId:p,type:t});T({parentId:p,type:t,index:f}),S(!0)}}}),function(e){return t.apply(this,arguments)});return(0,tq.useEffect)(()=>{a(aZ.EditName,()=>{!j.current&&A()}),a(aZ.Delete,()=>{var e=Object.values(o.current).filter(e=>e.id!==aX);e.length>0&&(null==p||p(e))}),a(aZ.CreateFolder,()=>{L(aq.Folder)}),a(aZ.CreateResource,e=>{L(e)})},[]),{context:{isInEditMode:_,editResourceId:null==k?void 0:k.id,createResourceInfo:E,handleChangeName:e=>{if(M.current=e,null==I?void 0:I.current){var t,n;N({type:"create",label:e||"",parentPath:(null===(t=d.current[null==I?void 0:null===(n=I.current)||void 0===n?void 0:n.parentId])||void 0===t?void 0:t.path)||[],resourceTree:h.current,id:"-1"})}else if(null==j?void 0:j.current){var r,o=(null==j?void 0:null===(r=j.current)||void 0===r?void 0:r.path)||[];N({type:"edit",label:e||"",parentPath:o.slice(0,(null==o?void 0:o.length)-1)||[],resourceTree:h.current,id:j.current.id})}},errorMsg:g,errorMsgRef:y,handleSave:e=>{var t,n,r,o,a,s,u=void 0===e?M.current||"":e;j.current&&("-1"===j.current.id?""!==u&&(null===(t=I.current)||void 0===t?void 0:t.parentId)&&(null==c||c({parentId:null===(n=I.current)||void 0===n?void 0:n.parentId,name:u,type:null===(r=I.current)||void 0===r?void 0:r.type,path:(null===(s=d.current)||void 0===s?void 0:null===(o=s[null===(a=I.current)||void 0===a?void 0:a.parentId])||void 0===o?void 0:o.path)||[]})):""!==u&&u!==P.current&&j.current.id&&(null==l||l({id:j.current.id,name:u,type:j.current.type,path:d.current[j.current.id].path,resource:d.current[j.current.id]}))),R()}},onCreateResource:L,isInEditModeRef:x,handleRenderList:(e,t)=>{if(!t)return e;var{index:n}=t;return[...e.slice(0,n),"-1",...e.slice(n,e.length)]},handleRename:D}},sU=e=>{var t=(0,tq.useRef)({id:e}),n=nF(e5),r=e=>{n.setContext(aJ,e)},o=()=>n.getContext(aJ);return{updateContext:n=>{var a;(null===(a=o())||void 0===a?void 0:a.id)===e&&(t.current=(0,tm._)({},t.current,n),r(t.current))},clearContext:()=>{var r;(null===(r=o())||void 0===r?void 0:r.id)===e&&n.setContext(aJ,void 0),t.current={id:e}},updateId:()=>{r(t.current)}}},sV=e=>{var{_collapsedMap:t,_setCollapsedMap:n,resourceMap:r}=e,[o,a,s]=sm(t||{});(0,tq.useEffect)(()=>{t&&a(t)},[t]);var l=e=>{null==n||n(e),!t&&a(e)};return{handleCollapse:(e,t)=>{var n,a;(null===(a=r.current)||void 0===a?void 0:null===(n=a[e])||void 0===n?void 0:n.type)==="folder"&&l((0,tv._)((0,tm._)({},o.current),{[e]:t}))},collapsedMapRef:o,setCollapsed:l,collapsedState:s}},sK=n("307321"),sq={};sq.styleTagTransform=oC(),sq.setAttributes=ow(),sq.insert=oy().bind(null,"head"),sq.domAPI=og(),sq.insertStyleElement=oS(),om()(sK.Z,sq);var sZ=sK.Z&&sK.Z.locals?sK.Z.locals:void 0,sY=0,sX=(0,tq.forwardRef)((e,t)=>{var n,r,o,{id:a,resourceTree:s,resourceMap:l,selected:c,disabled:d,searchConfig:u,defaultResourceType:h,useOptimismUI:p=!1,style:f,collapsedMap:m,setCollapsedMap:v,validateConfig:g,onChange:b=aK.Z,onSelected:y=aK.Z,onDrag:_=aK.Z,onChangeName:w=aK.Z,onCreate:x=aK.Z,onDelete:S=aK.Z,iconRender:k,suffixRender:C,textRender:j,renderMoreSuffix:E=!1,contextMenuHandler:T,onContextMenuVisibleChange:I,contextMenuDisabled:P,config:M,powerBlackMap:R,empty:D}=e,A=(0,tq.useRef)(a||"".concat(sY++)),N=(0,tq.useRef)(null),{updateContext:L,clearContext:z,updateId:O}=sU(A.current),[B,W]=sm({},e=>{null==L||L({tempSelectedMap:e})}),F=(0,tq.useRef)(l||{}),H=e=>{F.current=e,B.current=Object.keys(B.current).reduce((e,t)=>F.current[t]?(0,tv._)((0,tm._)({},e),{[t]:F.current[t]}):e,{}),W(B.current)};(0,tq.useEffect)(()=>{H(l)},[l]);var{collapsedMapRef:U,handleCollapse:V,setCollapsed:K,collapsedState:q}=sV({_collapsedMap:m,_setCollapsedMap:v,resourceMap:F}),[Z,Y]=sm((0,tv._)((0,tm._)({},aG),{children:s instanceof Array?s:[s]}),e=>{Q(a7(e,F.current,U.current))}),[X,Q]=sm(a7(Z.current,F.current,U.current));(0,tq.useEffect)(()=>{Q(a7(Z.current,F.current,U.current))},[q]);var G=(0,tq.useRef)(!!d);(0,tq.useEffect)(()=>{G.current=!!d},[d]);var{scrollInView:J,scrollWrapper:$,tempDisableScroll:ee}=sB({resourceTreeRef:Z,collapsedMapRef:U,resourceMap:F,config:M}),{handleDrag:et,handleChangeName:en,handleCreate:er,handleDelete:ei,optimismSavingMap:eo,clearOptimismSavingMap:ea}=sx({enable:!!p,onDrag:_,onChangeName:w,onCreate:x,onDelete:S,changeResourceTree:e=>{Z.current=e,H(a9((null==e?void 0:e.children)||[])),Y(Z.current)},scrollInView:J,resourceTreeRef:Z,resourceMap:F,onChange:b});(0,tq.useEffect)(()=>{Z.current=(0,tv._)((0,tm._)({},aG),{children:s instanceof Array?s:[s]}),Y(Z.current),ea()},[s]);var es=sv({selected:c,resourceMap:F,collapsedMapRef:U,setCollapsed:K,tempSelectedMapRef:B,setTempSelectedMap:W,scrollInView:J,updateContext:L}),{addEventListener:el,onMouseDownInDiv:ec,onMouseUpInDiv:ed}=sL(),{onMouseMove:eu,context:eh,context:{isFocus:ep},isFocusRef:ef,dragPreview:em,handleFocus:ev,handleBlur:eg}=sO({draggable:!(null==R?void 0:R.dragAndDrop),uniqId:A.current,updateId:O,iconRender:k,resourceTreeWrapperRef:N,collapsedMapRef:U,tempSelectedMapRef:B,setTempSelectedMap:W,setCollapsedMap:V,resourceTreeRef:Z,selectedIdRef:es,onSelected:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];y(...t),ee()},onDrag:et,addEventListener:el,disabled:G,resourceMap:F,config:M}),{registerEvent:eb,registerCommand:ey}=sw({isFocus:ep,updateContext:L,clearContext:z,id:A.current,selectedIdRef:es,tempSelectedMapRef:B}),{context:e_,onCreateResource:ew,isInEditModeRef:ex,handleRenderList:eS,handleRename:ek}=sH({folderEnable:!(null==R?void 0:R.folder),defaultResourceType:h,registerEvent:eb,setCollapsedMap:V,resourceTreeRef:Z,tempSelectedMapRef:B,selectedIdRef:es,isFocusRef:ef,resourceMap:F,onChangeName:en,onCreate:er,disabled:G,onDelete:ei,validateConfig:g,config:M,resourceList:X}),{contextMenuCallback:eC,closeContextMenu:ej}=s_({tempSelectedMapRef:B,contextMenuHandler:T,registerCommand:ey,id:A.current,contextMenuDisabled:P,onContextMenuVisibleChange:I});(0,tq.useImperativeHandle)(t,()=>({focus:()=>{ev()},blur:()=>{eg()},createResource:e=>{if(!ex.current&&!!e)null==ew||ew(e)},renameResource:e=>{ek(e)},createFolder:()=>{if(!ex.current)null==ew||ew(aq.Folder)},expandAll:()=>{U.current={},K(U.current)},collapseAll:()=>{U.current=Object.keys(F.current).reduce((e,t)=>{var n,r;return t!==aX&&(null===(r=F.current)||void 0===r?void 0:null===(n=r[t])||void 0===n?void 0:n.type)==="folder"?(0,tv._)((0,tm._)({},e),{[t]:!0}):e},{}),K(U.current)},closeContextMenu:ej}));var eE={searchConfig:u,suffixRender:C,config:M,renderMoreSuffix:!P&&E,textRender:j,contextMenuCallback:eC,resourceTreeWrapperRef:N,iconRender:k,isDragging:eh.isDragging,draggingError:eh.draggingError,currentHoverItem:eh.currentHoverItem,validateConfig:g,errorMsg:e_.errorMsg,errorMsgRef:e_.errorMsgRef,editResourceId:e_.editResourceId,handleChangeName:e_.handleChangeName,handleSave:e_.handleSave,useOptimismUI:p},eT=(null==e_?void 0:e_.createResourceInfo)?(0,tK.jsx)("div",{children:(0,tK.jsx)(sf,(0,tm._)({resource:{id:"-1",name:"",type:null==e_?void 0:e_.createResourceInfo.type},path:[...(null===(o=F.current)||void 0===o?void 0:null===(r=o[null==e_?void 0:e_.createResourceInfo.parentId])||void 0===r?void 0:r.path)||[],"-1"],isInEdit:"-1"===e_.editResourceId},eE))},"-1"):null,eI=eS(X.current,null==e_?void 0:e_.createResourceInfo);return(0,tK.jsxs)(tK.Fragment,{children:[(0,tK.jsx)("div",{className:"resource-list-wrapper ".concat(sZ["resource-list-wrapper"]),ref:N,style:f||{},children:(0,tK.jsxs)("div",{["data-".concat(sk)]:!0,["data-".concat(sS)]:A.current,ref:$,className:"".concat(a2(aQ,A.current)," resource-list-drag-and-drop-wrapper resource-list-custom-event-wrapper resource-list-scroll-container"),onMouseDown:ec,onMouseUp:ed,onMouseMove:eu,onContextMenu:e=>{e.preventDefault()},onContextMenuCapture:eC,children:[eI.map((e,t)=>{if("-1"===e)return eT;if(e.id===aX)return null;if(!e)return(0,tK.jsx)(tK.Fragment,{});var n,r,o,a,s,l,d=String(e.id)===String(e_.editResourceId),u=String(c)===String(e.id),h=!!B.current[e.id],f=(null===(n=X.current[t-1])||void 0===n?void 0:n.id)!==aX&&!!B.current[null===(r=X.current[t-1])||void 0===r?void 0:r.id],m=!!B.current[null===(o=X.current[t+1])||void 0===o?void 0:o.id],v=!U.current[e.id],g=!(null==R?void 0:R.folder)&&!!eh.highlightItemMap[e.id],b=(null===(a=X.current[t-1])||void 0===a?void 0:a.id)!==aX&&!!eh.highlightItemMap[null===(s=X.current[t-1])||void 0===s?void 0:s.id],y=!!eh.highlightItemMap[null===(l=X.current[t+1])||void 0===l?void 0:l.id],_=[...g?[e.id!==aX?"dragging-hover-class":"",b||y?"":"base-radius-class-single",b?"":"base-radius-class-first",y?"":"base-radius-class-last"]:[],u?"item-is-selected":"",...h&&!g?["item-is-temp-selected",f||m?"":"base-radius-class-single",f?"":"base-radius-class-first",m?"":"base-radius-class-last"]:[],d?"item-is-in-edit":"",eh.isDragging||u?"":"base-item-hover-class"].join(" ");return(0,tK.jsx)("div",(0,tv._)((0,tm._)({className:"item-wrapper ".concat(_)},eh.dataHandler(e)),{children:(0,tK.jsx)(sf,(0,tm._)({resource:e,path:e.path||[],isSelected:u,isTempSelected:h,isInEdit:d,isExpand:v,isOptimismSaving:p&&eo[e.id]},eE))}),e.id)}),(0===(n=eI||[]).length||1===n.length&&"-1"!==n[0]&&n[0].id===aX)&&D?D:null,(0,tK.jsx)("div",{style:{padding:12}})]})},A.current),i_.createPortal(em,document.body)]})})},678473:function(e,t,n){"use strict";n.r(t),n.d(t,{ProjectIDE:()=>ns,IDELayout:()=>eh});var r,o,a,s,l=n("151064");n("327212");var c=n("157728"),d=n("455069");n("407694");var u=()=>null,h=()=>null,p=()=>(0,l.jsx)("div",{}),f=e=>null,m=n("149528"),v=n("562392"),g=n("873183"),b={match:/\/plugin\/.*/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("1794").then(n.bind(n,517362)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.QWX,{})},y={match:/\/knowledge\/.*/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("1546").then(n.bind(n,620410)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.Guk,{})},_={match:/\/variables\/?$/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("6809").then(n.bind(n,430474)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.pFl,{})},w={match:/\/database\/.*/,area:m.px.MAIN_PANEL,renderContent(){var e=(0,m.jL)(()=>n.e("3838").then(n.bind(n,119131)));return(0,l.jsx)(e,{})},renderIcon:()=>(0,l.jsx)(g.Dzy,{})},x=n("66860"),S=n("942185"),k=n("130001"),C=n("771531"),j=n("435946");class E{listen(){this.disposable.push(this.viewService.shell.onCurrentWidgetChange(e=>{this.toggleDefaultWidget(e),this.syncURL(e)}))}toggleDefaultWidget(e){if(null==e?void 0:e.uri){if("default"!==(null==e?void 0:e.uri).displayName){var t,n=this.widgetManager.getWidgetFromURI(m.AE);null==n||null===(t=n.dispose)||void 0===t||t.call(n)}}else this.viewService.disableFullScreenMode(),this.projectIDEServices.view.openDefault()}syncURL(e){if(e){var t=null==e?void 0:e.uri;if(!(0,m.fZ)(t,m.AE)){if(t){var n=(0,m.L8)(t);if(n){var r="/space/".concat(this.optionsService.spaceId,"/project-ide/").concat(this.optionsService.projectId).concat(n);t.query&&(r+="?".concat(t.query)),this.navigate(r)}}}}else this.navigate("/space/".concat(this.optionsService.spaceId,"/project-ide/").concat(this.optionsService.projectId))}diffPath(e){var{pathname:t,search:n}=window.location;return t+n!==e}navigate(e){if(!!this.diffPath(e))this.optionsService.navigate((0,m.PF)(e))}dispose(){this.disposable.dispose()}constructor(){this.disposable=new m.K4}}(0,k.gn)([(0,C.f)(m.s1),(0,k.w6)("design:type",void 0===m.s1?Object:m.s1)],E.prototype,"viewService",void 0),(0,k.gn)([(0,C.f)(m.fH),(0,k.w6)("design:type",void 0===m.fH?Object:m.fH)],E.prototype,"widgetManager",void 0),(0,k.gn)([(0,C.f)(m.k7),(0,k.w6)("design:type",void 0===m.k7?Object:m.k7)],E.prototype,"projectIDEServices",void 0),(0,k.gn)([(0,C.f)(m.IC),(0,k.w6)("design:type",void 0===m.IC?Object:m.IC)],E.prototype,"optionsService",void 0),E=(0,k.gn)([(0,j.b)()],E);var T=n("825955"),I=n("287487"),P=n("28260"),M=n("286518"),R=n("382534");class D{init(){this.updateProjectInfo().catch(()=>{this.errorService.toErrorPage()});this.initTaskList(),this.reportUserBehavior()}initTaskList(){var e=this;return(0,T._)(function*(){var t,{task_list:n}=(yield R.sD.DraftProjectInnerTaskList({project_id:e.optionsService.projectId})).data||{},r=null==n?void 0:null===(t=n[0])||void 0===t?void 0:t.task_id;if(r){var{task_detail:o}=yield R.Js.ResourceCopyDetail({task_id:r});e.modalService.onModalVisibleChangeEmitter.fire({type:m.w8.RESOURCE,scene:null==o?void 0:o.scene,resourceName:null==o?void 0:o.res_name}),e.modalService.doPolling(r)}})()}reportUserBehavior(){R.pr.ReportUserBehavior({space_id:this.optionsService.spaceId,behavior_type:M.YQ.Visit,resource_id:this.optionsService.projectId,resource_type:M.$L.Project})}wakeUpPlugin(){var e;R.Js.WakeupIdePlugin({space_id:this.optionsService.spaceId,project_id:this.optionsService.projectId,dev_id:null===(e=I.Z.getUserInfo())||void 0===e?void 0:e.user_id_str})}updateProjectInfo(){var e=this;return(0,T._)(function*(){var t,n,r,o,a,s,l,c,d,u,h,p,f,m=yield R.sD.GetDraftIntelligenceInfo({intelligence_id:e.optionsService.projectId,intelligence_type:P.jH.Project,version:e.optionsService.version||void 0});e.projectInfo={projectInfo:null===(t=m.data)||void 0===t?void 0:t.basic_info,publishInfo:null===(n=m.data)||void 0===n?void 0:n.publish_info,ownerInfo:null===(r=m.data)||void 0===r?void 0:r.owner_info},e.initialValue={space_id:null===(o=e.optionsService)||void 0===o?void 0:o.spaceId,project_id:null===(a=e.optionsService)||void 0===a?void 0:a.projectId,name:null===(l=e.projectInfo)||void 0===l?void 0:null===(s=l.projectInfo)||void 0===s?void 0:s.name,description:null===(d=e.projectInfo)||void 0===d?void 0:null===(c=d.projectInfo)||void 0===c?void 0:c.description,icon_uri:[{uid:(null===(h=e.projectInfo)||void 0===h?void 0:null===(u=h.projectInfo)||void 0===u?void 0:u.icon_uri)||"",url:(null===(f=e.projectInfo)||void 0===f?void 0:null===(p=f.projectInfo)||void 0===p?void 0:p.icon_url)||""}]},e.onProjectInfoUpdatedEmitter.fire()})()}constructor(){this.onProjectInfoUpdatedEmitter=new m.Q5,this.onProjectInfoUpdated=this.onProjectInfoUpdatedEmitter.event}}(0,k.gn)([(0,C.f)(m.IC),(0,k.w6)("design:type",void 0===m.IC?Object:m.IC)],D.prototype,"optionsService",void 0),(0,k.gn)([(0,C.f)(m.Z7),(0,k.w6)("design:type",void 0===m.Z7?Object:m.Z7)],D.prototype,"modalService",void 0),(0,k.gn)([(0,C.f)(m.T_),(0,k.w6)("design:type",void 0===m.T_?Object:m.T_)],D.prototype,"errorService",void 0),D=(0,k.gn)([(0,j.b)()],D);class A{open(){var{resourceType:e}=(0,m.hU)(window.location.pathname);if(e===m.sq.displayName)this.openDesign(),this.tryOpenDefault();else{var t,n,r,o=(0,m.qj)(window.location.pathname);!o||o.startsWith(m.AE.displayName)?(this.tryOpenDefault(),(null===(t=this.applicationShell.mainPanel.currentTitle)||void 0===t?void 0:t.owner)&&this.applicationShell.setCurrentWidget(null===(r=this.applicationShell.mainPanel)||void 0===r?void 0:null===(n=r.currentTitle)||void 0===n?void 0:n.owner)):this.projectIDEServices.view.open((0,m.W9)(o))}}listen(){var e="popstate";window.addEventListener(e,this.syncPopstate),this.disposable.push(m.JT.create(()=>window.removeEventListener(e,this.syncPopstate)))}openDevelop(e,t,n){this.projectIDEServices.view.open((0,m.Ym)(e,t,n))}openDesign(){this.projectIDEServices.view.openPanel("ui-builder")}tryOpenDefault(){var e,t,n,r,o;(null===(o=this.viewService.shell.mainPanel)||void 0===o?void 0:null===(r=o.tabBars)||void 0===r?void 0:null===(n=r.call(o))||void 0===n?void 0:null===(t=n.next)||void 0===t?void 0:null===(e=t.call(n))||void 0===e?void 0:e.done)&&this.projectIDEServices.view.openDefault()}dispose(){this.disposable.dispose()}constructor(){this.disposable=new m.K4,this.syncPopstate=()=>{this.open()}}}(0,k.gn)([(0,C.f)(m.k7),(0,k.w6)("design:type",void 0===m.k7?Object:m.k7)],A.prototype,"projectIDEServices",void 0),(0,k.gn)([(0,C.f)(m.s1),(0,k.w6)("design:type",void 0===m.s1?Object:m.s1)],A.prototype,"viewService",void 0),(0,k.gn)([(0,C.f)(m.Ew),(0,k.w6)("design:type",void 0===m.Ew?Object:m.Ew)],A.prototype,"applicationShell",void 0),A=(0,k.gn)([(0,j.b)()],A);var N=n("710705"),L=n("808549"),z=n("18174");let O=Symbol.for("Dexie"),B=globalThis[O]||(globalThis[O]=z);if(z.semVer!==B.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${z.semVer} and ${B.semVer}`);let{liveQuery:W,mergeRanges:F,rangesOverlap:H,RangeSet:U,cmp:V,Entity:K,PropModification:q,replacePrefix:Z,add:Y,remove:X}=B;var Q=e=>e.timestamp<Date.now()-2592e6||3!==e.version,G=()=>(!s&&(s=new B("CozProjectIDELayoutData")).version(1).stores({layout:"++id, spaceId, projectId, timestamp, data"}),s);var J=(r=(0,T._)(function*(e,t,n){var r=G(),o=yield r.layout.where({spaceId:e,projectId:t}).first();o?yield r.layout.update(o.id,(0,L._)({},n)):yield r.layout.add((0,L._)({spaceId:e,projectId:t},n))}),function(e,t,n){return r.apply(this,arguments)});var $=(o=(0,T._)(function*(e,t){var n=G(),r=yield n.layout.where({spaceId:e,projectId:t}).first();if(!!r){if(Q(r)){yield n.layout.where({id:r.id}).delete();return}return r}}),function(e,t){return o.apply(this,arguments)}),ee="coz-project-ide-layout-data",et=(e,t,n)=>{var r="".concat(ee,"-").concat(e,"-").concat(t);window.localStorage.setItem(r,JSON.stringify(n))},en=(e,t)=>{var n="".concat(ee,"-").concat(e,"-").concat(t),r=window.localStorage.getItem(n);if(!!r)try{var o=JSON.parse(r);if(Q(o)){window.localStorage.removeItem(n);return}return o}catch(e){console.error(e);return}},er=(e,t)=>{var n="".concat(ee,"-").concat(e,"-").concat(t);window.localStorage.removeItem(n)},ei=(e,t,n)=>{try{var r={data:JSON.stringify(n),timestamp:Number(Date.now()),version:3};et(e,t,r),J(e,t,r)}catch(e){console.error(e)}};var eo=(a=(0,T._)(function*(e,t){var n,r=yield $(e,t),o=en(e,t);if(o?!r||r.timestamp<o.timestamp?(yield J(e,t,o),er(e,t),n=o.data):(er(e,t),n=r.data):n=null==r?void 0:r.data,!!n)try{return JSON.parse(n)}catch(e){console.error(e);return}}),function(e,t){return a.apply(this,arguments)}),ea=e=>!!e.context;class es{get openFirstWorkflow(){return this._openFirstWorkflow}set openFirstWorkflow(e){this._openFirstWorkflow=e}init(){}storeLayout(){ei(this.optionsService.spaceId,this.optionsService.projectId,this.getLayoutData())}restoreLayout(){var e=this;return(0,T._)(function*(){if(yield e.addSidebarWidget(),e.enabled){var t=yield eo(e.optionsService.spaceId,e.optionsService.projectId);yield e.setLayoutData(t||{})}})()}storeWidget(){}restoreWidget(){}getLayoutData(){var e={},{primarySidebar:t,mainPanel:n}=this.applicationShell;e.primarySidebar={isHidden:!!(null==t?void 0:t.isHidden)};var r=n.saveLayout();return e.mainPanel=this.widgetsStringifyBFS(r),e}setLayoutData(e){var t=this;return(0,T._)(function*(){var{primarySidebar:n,mainPanel:r}=e||{};if(n&&n.isHidden?t.applicationShell.primarySidebar.hide():t.applicationShell.primarySidebar.show(),r){var o,a,s=yield t.widgetsParseBFS(r),{main:l}=s||{};!(null==l?void 0:null===(o=l.widgets)||void 0===o?void 0:o.length)&&!(null==l?void 0:null===(a=l.children)||void 0===a?void 0:a.length)&&(t._openFirstWorkflow=!0),t.applicationShell.mainPanel.restoreLayout(s),t.applicationShell.mainPanel.initWidgets()}})()}addSidebarWidget(){var e=this;return(0,T._)(function*(){var t=yield e.widgetParse({uri:m.tN.toString()});e.applicationShell.primarySidebar.addWidget(t)})()}listen(){var e=()=>{this.storeLayout(),window.removeEventListener("unload",e)};window.addEventListener("unload",e)}widgetStringify(e){if(!!(null==e?void 0:e.uri)){var t={uri:e.uri.toString()};if(ea(e)){var n=e.context.widget,r=n.getTitle();r&&(t.title=r);var o=n.getIconType();o&&(t.iconType=o)}return t}}widgetsStringify(e){return e.map(e=>this.widgetStringify(e)).filter(e=>(null==e?void 0:e.uri)&&e.uri!==m.AE.toString())}widgetsStringifyBFS(e){var t=e=>(0,N.Z)(e)?Object.keys(e).reduce((n,r)=>("widgets"===r&&Array.isArray(e[r])?n[r]=this.widgetsStringify(e[r]):n[r]=t(e[r]),n),{}):Array.isArray(e)?e.map(t):e;return t(e)}widgetParse(e){var t=this;return(0,T._)(function*(){var n=new m.ov(e.uri),r=t.widgetManager.getFactoryFromURI(n),o=yield t.widgetManager.getOrCreateWidgetFromURI(n,r);if(ea(o)){var a=o.context.widget;e.title&&a.setTitle(e.title,"normal"),e.iconType&&a.setIconType(e.iconType)}return t.viewRenderer.addReactPortal(o),t.applicationShell.track(o),o})()}widgetsParseBFS(e){var t=this;return(0,T._)(function*(){var n,r=(n=(0,T._)(function*(e){if((0,N.Z)(e)){var n;return yield Object.keys(e).reduce((n=(0,T._)(function*(n,o){var a=yield n;return"widgets"===o&&Array.isArray(e[o])?a[o]=yield Promise.all(e[o].map(e=>t.widgetParse(e))):a[o]=yield r(e[o]),a}),function(e,t){return n.apply(this,arguments)}),Promise.resolve({}))}return Array.isArray(e)?yield Promise.all(e.map(r)):e}),function(e){return n.apply(this,arguments)});return yield r(e)})()}constructor(){this._openFirstWorkflow=!1,this.enabled=!0}}(0,k.gn)([(0,C.f)(m.Ew),(0,k.w6)("design:type",void 0===m.Ew?Object:m.Ew)],es.prototype,"applicationShell",void 0),(0,k.gn)([(0,C.f)(m.fH),(0,k.w6)("design:type",void 0===m.fH?Object:m.fH)],es.prototype,"widgetManager",void 0),(0,k.gn)([(0,C.f)(m.l0),(0,k.w6)("design:type",void 0===m.l0?Object:m.l0)],es.prototype,"viewRenderer",void 0),(0,k.gn)([(0,C.f)(m.IC),(0,k.w6)("design:type",void 0===m.IC?Object:m.IC)],es.prototype,"optionsService",void 0),es=(0,k.gn)([(0,j.b)()],es);class el{onStart(){this.projectInfoService.init(),this.openURIResourceService.open(),this.openURIResourceService.listen(),this.widgetEventService.listen(),this.layoutRestorer.listen(),this.onStartedEmitter.fire()}onDispose(){this.widgetEventService.dispose(),this.openURIResourceService.dispose(),this.onStartedEmitter.dispose()}constructor(){this.onStartedEmitter=new m.Q5,this.onStarted=this.onStartedEmitter.event}}(0,k.gn)([(0,C.f)(A),(0,k.w6)("design:type",void 0===A?Object:A)],el.prototype,"openURIResourceService",void 0),(0,k.gn)([(0,C.f)(E),(0,k.w6)("design:type",void 0===E?Object:E)],el.prototype,"widgetEventService",void 0),(0,k.gn)([(0,C.f)(m.cw),(0,k.w6)("design:type",void 0===m.cw?Object:m.cw)],el.prototype,"layoutRestorer",void 0),(0,k.gn)([(0,C.f)(D),(0,k.w6)("design:type",void 0===D?Object:D)],el.prototype,"projectInfoService",void 0),el=(0,k.gn)([(0,j.b)()],el);var ec=(0,m.M1)({onBind(e,t){var{bind:n,rebind:r}=e;n(m.IC).toConstantValue(t),n(D).toSelf().inSingletonScope(),n(A).toSelf().inSingletonScope(),n(E).toSelf().inSingletonScope(),r(m.cw).to(es).inSingletonScope(),(0,m.KV)(n,el,[m.dQ])}}),ed=n("244470"),eu=e=>{var{spaceId:t,projectId:n,version:r}=e;return(0,S.Gy)(n),(0,ed.Z)(t,n)?(0,l.jsx)(ns,{spaceId:t,projectId:n,version:r}):null},eh=()=>{var{space_id:e,project_id:t}=(0,c.useParams)(),n=new URLSearchParams(window.location.search).get("commit_version");return(0,l.jsx)(eu,{spaceId:e||"",projectId:t||"",version:n||""},t)},ep=n("659596"),ef=n("336205"),em=n("442178"),ev=()=>{var e,t,n,r=(0,m.RX)(D),[o,a]=(0,d.useState)(!0),[s,l]=(0,d.useState)(null===(e=r.projectInfo)||void 0===e?void 0:e.projectInfo),[c,u]=(0,d.useState)(null==r?void 0:null===(t=r.projectInfo)||void 0===t?void 0:t.publishInfo),[h,p]=(0,d.useState)(null==r?void 0:null===(n=r.projectInfo)||void 0===n?void 0:n.ownerInfo),[f,v]=(0,d.useState)(r.initialValue),{patch:g}=(0,m.zu)(e=>({patch:e.patch}));return(0,d.useEffect)(()=>{r.projectInfo&&a(!1),g({projectInfo:{projectInfo:s,publishInfo:c,ownerInfo:h}});var e=r.onProjectInfoUpdated(()=>{var e,t,n;a(!1),l(null===(e=r.projectInfo)||void 0===e?void 0:e.projectInfo),u(null===(t=r.projectInfo)||void 0===t?void 0:t.publishInfo),p(null===(n=r.projectInfo)||void 0===n?void 0:n.ownerInfo),g({projectInfo:r.projectInfo}),v(r.initialValue)});return()=>{var t;null==e||null===(t=e.dispose)||void 0===t||t.call(e)}},[]),{loading:o,initialValue:f,projectInfo:s,ownerInfo:h,publishInfo:c,updateProjectInfo:r.updateProjectInfo.bind(r)}},eg=n("479886"),eb=n.n(eg),ey=n("378925"),e_=n("407821"),ew=n.n(e_),ex=n("472772"),eS=n.n(ex),ek=n("395245"),eC=n.n(ek),ej=n("297998"),eE=n.n(ej),eT=n("646576"),eI=n.n(eT),eP=n("606121"),eM=n.n(eP),eR=n("840486"),eD={};eD.styleTagTransform=eM(),eD.setAttributes=eE(),eD.insert=eC().bind(null,"head"),eD.domAPI=eS(),eD.insertStyleElement=eI(),ew()(eR.Z,eD);var eA=eR.Z&&eR.Z.locals?eR.Z.locals:void 0,eN=e=>{var t=Number(e);return isNaN(t)?"-":eb().unix(t).format("YYYY-MM-DD HH:mm:ss")},eL=e=>{var{spaceId:t,projectInfo:n,publishInfo:r,ownerInfo:o}=e,a=(0,ey.$_)(t);if(!n)return null;var s=eN(null==n?void 0:n.create_time);return(0,l.jsxs)("div",{className:eA.content,children:[(0,l.jsx)(ep.EZ,{type:"bot",size:"xl",src:null==n?void 0:n.icon_url}),(0,l.jsx)("div",{className:eA.title,children:null==n?void 0:n.name}),(0,l.jsx)("div",{className:eA.description,children:null==n?void 0:n.description}),(0,l.jsxs)("div",{className:eA["tag-container"],children:[a?(0,l.jsx)(ep.Vp,{className:eA.tag,color:"primary",prefixIcon:(0,l.jsx)(ep.EZ,{size:"mini",src:a.icon_url}),children:a.name}):null,(null==r?void 0:r.has_published)?(0,l.jsx)(ep.Vp,{className:eA.tag,color:"green",prefixIcon:(0,l.jsx)(g.Lz_,{}),children:ef.o.t("Published_1")}):null]}),o?(0,l.jsxs)("div",{className:eA["owner-container"],children:[(0,l.jsx)(ep.EZ,{size:"micro",src:null==o?void 0:o.avatar_url}),(0,l.jsx)("div",{children:null==o?void 0:o.nickname}),(0,l.jsxs)("div",{children:["@",null==o?void 0:o.user_unique_name]})]}):null,(0,l.jsx)("div",{className:eA.time,children:ef.o.t("project_ide_info_created_on",{time:s})})]})},{Title:ez}=ep.ZT,eO=()=>{var{loading:e,initialValue:t,projectInfo:n,updateProjectInfo:r,publishInfo:o,ownerInfo:a}=ev(),s=(0,m.aQ)(),c=(0,m.vp)(),{version:u}=(0,m.jo)(),{modalContextHolder:h,openModal:p}=(0,em.AZ)({onSuccess:()=>{r(),ep.FN.success(ef.o.t("project_ide_toast_edit_success"))}}),f=(0,S.Qb)(S.PL.EDIT_INFO,c||"",s||""),v=(0,d.useCallback)(()=>{p({initialValue:t})},[t]),b=null==o?void 0:o.has_published;return e?(0,l.jsx)(ep.Od.Title,{style:{width:24,height:24}}):(0,l.jsxs)("div",{className:eA["project-info"],children:[(0,l.jsxs)(ep.J2,{content:(0,l.jsx)(eL,{projectInfo:n,publishInfo:o,ownerInfo:a,spaceId:s}),children:[(0,l.jsx)(ep.EZ,{type:"bot",size:"small",src:null==n?void 0:n.icon_url}),b?(0,l.jsx)("div",{className:eA["check-icon"],children:(0,l.jsx)(g.Lz_,{color:"green"})}):null]}),(0,l.jsx)(ez,{ellipsis:{showTooltip:{opts:{content:null==n?void 0:n.name}}},className:eA.title,fontSize:"16px",style:{maxWidth:320},children:null==n?void 0:n.name}),f&&!u?(0,l.jsx)(ep.hU,{color:"secondary",icon:(0,l.jsx)(g.JAz,{}),onClick:v}):null,h]})},eB=n("120454"),eW=n("174470");n("297751"),n("616405");var eF=()=>{var e=(0,c.useNavigate)(),t=(0,m.aQ)(),n=(0,m.vp)(),{version:r}=(0,m.jo)(),{modalContextHolder:o,deleteIntelligence:a}=(0,em.wU)({onDeleteProjectSuccess:()=>{ep.FN.success(ef.o.t("project_ide_toast_delete_success")),e("/space/".concat(t,"/develop"))}}),{modalContextHolder:s,openModal:u}=(0,em.Z$)({onSuccess:()=>e("/space/".concat(t,"/develop"))}),{projectInfo:p,initialValue:f}=ev(),v=(0,S.kc)(n),b=(0,d.useCallback)(()=>{u({initialValue:(0,eB._)((0,L._)({},f),{to_space_id:t})})},[f,t]),y=(0,d.useCallback)(()=>{a({name:f.name||"",projectId:(null==p?void 0:p.id)||""})},[f,p]),_=(0,S.Qb)(S.PL.DELETE,n,t);return r?(0,l.jsx)(ep.Vp,{prefixIcon:(0,l.jsx)(g.SA_,{}),children:ef.o.t("app_ide_viewing_archive")}):(0,l.jsxs)("div",{className:"flex items-center justify-end grow gap-[8px] overflow-hidden",children:[s,v.length?(0,l.jsxs)(l.Fragment,{children:[o,(0,l.jsxs)(eH,{children:[(0,l.jsx)(h,{}),null]}),(0,l.jsx)(ep.iz,{layout:"vertical",className:"first:hidden"}),(0,l.jsx)(eW.PublishButton,{spaceId:t,projectId:n,hasPublished:!!Number(null==p?void 0:p.publish_time)}),(0,l.jsx)(ep.J2,{trigger:"click",className:"rounded-[8px]",content:(0,l.jsxs)(ep.v2,{children:[(0,l.jsx)(ep.v2.Item,{className:"min-w-[190px] h-[32px] rounded-[4px]",onClick:b,children:ef.o.t("project_ide_duplicate")}),_?(0,l.jsx)(ep.v2.Item,{className:"min-w-[190px] h-[32px] rounded-[4px]",onClick:y,children:ef.o.t("project_ide_delete_project")}):(0,l.jsx)(ep.u,{position:"left",content:ef.o.t("project_delete_permission_tooltips"),children:(0,l.jsx)(ep.v2.Item,{disabled:!0,className:"min-w-[190px] h-[32px] rounded-[4px]",onClick:y,children:ef.o.t("project_ide_delete_project")})})]}),children:(0,l.jsx)(ep.hU,{icon:(0,l.jsx)(g.NsR,{}),color:"secondary"})})]}):(0,l.jsx)(ep.zx,{onClick:b,children:ef.o.t("project_ide_create_duplicate")})]})};function eH(e){var{children:t}=e;return t}var eU=()=>{var e=(0,c.useNavigate)(),t=(0,m.aQ)(),n=(0,d.useCallback)(()=>{e("/space/".concat(t,"/develop"))},[t,e]);return(0,l.jsx)(ep.hU,{color:"secondary",icon:(0,l.jsx)(g.$1i,{}),onClick:n})},eV=n("11549"),eK={};eK.styleTagTransform=eM(),eK.setAttributes=eE(),eK.insert=eC().bind(null,"head"),eK.domAPI=eS(),eK.insertStyleElement=eI(),ew()(eV.Z,eK);var eq=eV.Z&&eV.Z.locals?eV.Z.locals:void 0,eZ=()=>(0,l.jsx)("div",{className:eq.container,children:(0,l.jsxs)(ep.X2,{className:eq["top-bar"],children:[(0,l.jsxs)(ep.JX,{span:8,className:eq["left-col"],children:[(0,l.jsx)(eU,{}),(0,l.jsx)(eO,{})]}),(0,l.jsx)(ep.JX,{span:8,className:eq["middle-col"],children:(0,l.jsx)(u,{})}),(0,l.jsx)(ep.JX,{span:8,className:eq["right-col"],children:(0,l.jsx)(eF,{})})]})}),eY=n("252237"),eX=n.n(eY),eQ=n("450562"),eG=n("189284"),eJ=n("909776"),e$=n("833047"),e0=n("610382"),e1=n("529223"),e2=e=>{var t,{projectId:n}=e,r=(0,x.S4)();return t=(0,T._)(function*(e){var{scene:t,resource:o}=e;try{console.log("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t,">>>"),o),yield r({scene:t,res_id:null==o?void 0:o.id,res_type:e1.ResType.Plugin,project_id:n,res_name:(null==o?void 0:o.name)||""})}catch(e){console.error("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t," error>>>"),e)}}),function(e){return t.apply(this,arguments)}},e4=()=>{var e,t,n,r,o=(0,x.Un)(e=>e.refetch),a=(0,m.aQ)(),s=(0,m.vp)(),c=(0,x.j2)(),[u,h]=(0,d.useState)(!1);var p=(0,d.useCallback)((e=(0,T._)(function*(e){try{console.log("[ResourceFolder]on change name>>>",e);var t=yield R.Js.UpdatePluginMeta({plugin_id:e.id,name:e.name});console.log("[ResourceFolder]rename plugin response>>>",t)}catch(e){console.log("[ResourceFolder]rename plugin error>>>",e)}finally{o()}}),function(t){return e.apply(this,arguments)}),[o]);var f=(0,d.useCallback)((t=(0,T._)(function*(e){try{console.log("[ResourceFolder]on delete>>>",e);var t,n=yield R.Js.DelPlugin({plugin_id:null===(t=e.filter(e=>e.type===x.LC.Plugin))||void 0===t?void 0:t[0].res_id});ep.FN.success(ef.o.t("project_plugin_delete_success_toast")),o(),console.log("[ResourceFolder]delete plugin response>>>",n)}catch(e){console.log("[ResourceFolder]delete plugin error>>>",e)}}),function(e){return t.apply(this,arguments)}),[o,a]);var{node:v,open:g,close:b}=(0,e0.qz)({from:e$.tx.ProjectIde,pluginApiList:[],projectId:s,showCopyPlugin:!0,showButton:!1,hideCreateBtn:!0,onCopyPluginCallback:e=>{var{pluginID:t,name:n}=e;t&&(y({scene:eJ.K2.CopyResourceFromLibrary,resource:{id:t,res_id:t,name:null!=n?n:""}}),b())},onCreateSuccess:(n=(0,T._)(function*(e){if(!!(null==e?void 0:e.pluginId))yield null==o?void 0:o(),c({resourceType:x.LC.Plugin,resourceId:null==e?void 0:e.pluginId}),b()}),function(e){return n.apply(this,arguments)}),isShowStorePlugin:!1}),y=e2({projectId:s}),_=e=>{var{label:t}=e;return t?t.length>30?ef.o.t("project_resource_sidebar_warning_length_exceeds"):RegExp("^[\\w\\s\\u4e00-\\u9fa5]+$","u").test(t)?"":ef.o.t("create_plugin_modal_nameerror_cn"):ef.o.t("create_plugin_modal_name1_error")};return{onChangeName:p,onAction:(e,t)=>{switch(console.log("on action>>>",e,t),e){case x.lW.ImportLibraryResource:return g();case x.lW.DuplicateResource:return y({scene:eJ.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return y({scene:eJ.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return y({scene:eJ.K2.CopyResourceToLibrary,resource:t});default:console.warn("[PluginResource]unsupported action>>>",e)}},onDelete:f,onCustomCreate:(e,t)=>{console.log("[ResourceFolder]on custom create>>>",e,t),h(!0)},modals:[(0,l.jsx)(e0.rm,{projectId:s,isCreate:!0,visible:u,onSuccess:(r=(0,T._)(function*(e){yield null==o?void 0:o(),c({resourceType:x.LC.Plugin,resourceId:e})}),function(e){return r.apply(this,arguments)}),onCancel:()=>{h(!1)}}),v],validateConfig:{customValidator:e=>_(e)||""}}},e6=n("328591"),e5=n("402635"),e3=e=>{var t,{projectId:n}=e,r=(0,x.S4)();return t=(0,T._)(function*(e){var{scene:t,resource:o}=e;try{console.log("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t,">>>"),o),yield r({scene:t,res_id:null==o?void 0:o.id,res_type:null==o?void 0:o.res_type,project_id:n,res_name:(null==o?void 0:o.name)||""})}catch(e){console.error("[ResourceFolder]workflow resource copy dispatch, scene ".concat(t," error>>>"),e)}}),function(e){return t.apply(this,arguments)}},e8=()=>{var e,t,n,r=(0,x.Un)(e=>e.refetch),o=(0,m.aQ)(),a=(0,m.vp)(),s=(0,m.d0)(),{modal:l,open:c,close:u}=(0,e6.Eb)({projectID:a,onFinish:(e,t,n)=>{r(),u(),s("/knowledge/".concat(e,"?type=").concat(t).concat(n?"&module=upload":""))}});var h=(e=(0,T._)(function*(e,t,n){try{yield R.MJ.UpdateDataset({dataset_id:e,name:t,status:n})}catch(e){console.log("[ResourceFolder]update knowledge error>>>",e)}finally{r()}}),function(t,n,r){return e.apply(this,arguments)});var p=(t=(0,T._)(function*(e){try{yield R.MJ.UpdateDataset({dataset_id:e.id,name:e.name})}catch(e){console.log("[ResourceFolder]rename knowledge error>>>",e)}finally{r()}}),function(e){return t.apply(this,arguments)});var f=(0,d.useCallback)((n=(0,T._)(function*(e){try{var t;yield R.MJ.DeleteDataset({dataset_id:null===(t=e.filter(e=>e.type===x.LC.Knowledge))||void 0===t?void 0:t[0].res_id}),ep.FN.success(ef.o.t("Delete_success")),r()}catch(e){ep.FN.error(ef.o.t("Delete_failed"))}}),function(e){return n.apply(this,arguments)}),[r,o]),v=e3({projectId:a});return{onChangeName:p,onAction:(e,t)=>{switch(e){case x.lW.DuplicateResource:return v({scene:eJ.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return v({scene:eJ.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return v({scene:eJ.K2.CopyResourceToLibrary,resource:t});case x.lW.DisableKnowledge:(null==t?void 0:t.id)&&h(t.id,t.name,e5._z.DatasetForbid);break;case x.lW.EnableKnowledge:(null==t?void 0:t.id)&&h(t.id,t.name,e5._z.DatasetReady)}},onDelete:f,onCustomCreate:()=>{c()},modals:[l]}},e9=n("695673"),e7=n("299464"),te=n("775699"),tt=e=>{var{label:t,onClick:n,selected:r}=e;return(0,l.jsxs)("div",{onClick:n,className:eX()(["flex items-center gap-[8px] px-[12px]","px-[12px] py-[6px] rounded-[8px]","cursor-pointer","hover:text-[var(--light-usage-text-color-text-0,#1c1f23)]","hover:bg-[var(--light-usage-fill-color-fill-0,rgba(46,50,56,5%))]",r&&"text-[var(--light-usage-text-color-text-0,#1c1d23)] bg-[var(--light-usage-fill-color-fill-0,rgba(46,47,56,5%))]"]),children:[(0,l.jsx)(g.Iqn,{}),t]})},tn=e=>{var t,n,{onClose:r}=e,[o,a]=(0,d.useState)("knowledge"),s=(0,m.vp)(),c=(0,m.aQ)(),u=(0,x.Un)(e=>e.refetch),h=e3({projectId:s});var{renderContent:p,renderSearch:f}=(0,e6.ey)({showFilters:["scope-type","search-type"],datasetList:[],onDatasetListChange:(t=(0,T._)(function*(e){e[0].dataset_id&&e[0].name&&(yield h({scene:eJ.K2.CopyResourceFromLibrary,resource:{id:e[0].dataset_id,res_id:e[0].dataset_id,name:e[0].name,res_type:eJ.b0.Knowledge}}),u(),null==r||r())}),function(e){return t.apply(this,arguments)}),canCreate:!1,defaultType:e9.AT.ALL});var{renderContent:v,renderFilter:g,renderInput:b}=(0,e7.a8)({visible:!0,onClose:()=>void 0,onAddDatabase:(n=(0,T._)(function*(e){yield h({scene:eJ.K2.CopyResourceFromLibrary,resource:{id:e,res_id:e,name:"",res_type:eJ.b0.Database}}),u(),null==r||r()}),function(e){return n.apply(this,arguments)}),onClickDatabase:()=>void 0,enterFrom:"project",spaceId:c});return(0,l.jsx)(te.tz,{keepDOM:!1,visible:!0,onCancel:r,tabs:{tabsProps:{lazyRender:!0,activeKey:o,onChange:e=>a(e)},tabPanes:[{tabPaneProps:{tab:ef.o.t("resource_type_knowledge"),itemKey:"knowledge"},content:(0,l.jsxs)("div",{className:"w-full h-full flex",children:[(0,l.jsxs)("div",{className:"w-[218px] pt-[16px] px-[12px] shrink-0 flex flex-col gap-[12px]",children:[f(),(0,l.jsx)(tt,{label:ef.o.t("project_resource_modal_library_resources",{resource:ef.o.t("resource_type_knowledge")}),selected:!0})]}),(0,l.jsx)("div",{className:"grow-[1] bg-[white] pt-[16px] px-[12px]",children:p()})]})},{tabPaneProps:{tab:ef.o.t("resource_type_database"),itemKey:"database"},content:(0,l.jsxs)("div",{className:"w-full h-full flex",children:[(0,l.jsxs)("div",{className:"w-[218px] pt-[16px] px-[12px] shrink-0 flex flex-col gap-[12px]",children:[b(),(0,l.jsx)(tt,{label:ef.o.t("project_resource_modal_library_resources",{resource:ef.o.t("resource_type_database")}),selected:!0})]}),(0,l.jsxs)("div",{className:"grow-[1] bg-[white] pt-[16px] px-[12px] flex flex-col",children:[g(),v()]})]})}]}})},tr=()=>{var[e,t]=(0,d.useState)(!1),n=()=>{t(!1)};return{modal:e?(0,l.jsx)(tn,{onClose:n}):null,open:()=>{t(!0)},close:n}},ti=()=>{var e,t,n=(0,x.Un)(e=>e.refetch),r=(0,m.aQ)(),o=(0,m.vp)(),a=(0,m.d0)(),{modal:s,open:l,close:c}=(0,e7.Gx)({projectID:o,enterFrom:"project",onFinish:e=>{n(),c(),a("/database/".concat(e,"?page_modal=normal&from=create"))}});var u=(e=(0,T._)(function*(e){try{console.log("[ResourceFolder]on change name>>>",e);var t=yield R.v6.UpdateDatabase({id:e.id,table_name:e.name});console.log("[ResourceFolder]rename database response>>>",t)}catch(e){console.log("[ResourceFolder]rename database error>>>",e)}finally{n()}}),function(t){return e.apply(this,arguments)});var h=(0,d.useCallback)((t=(0,T._)(function*(e){try{console.log("[ResourceFolder]on delete>>>",e);var t,r=yield R.v6.DeleteDatabase({id:null===(t=e.filter(e=>e.type===x.LC.Database))||void 0===t?void 0:t[0].res_id});ep.FN.success(ef.o.t("Delete_success")),n(),console.log("[ResourceFolder]delete database response>>>",r)}catch(e){console.log("[ResourceFolder]delete database error>>>",e),ep.FN.error(ef.o.t("Delete_failed"))}}),function(e){return t.apply(this,arguments)}),[n,r]),p=e3({projectId:o});return{onChangeName:u,onAction:(e,t)=>{switch(console.log("on action>>>",e,t),e){case x.lW.ImportLibraryResource:return;case x.lW.DuplicateResource:return p({scene:eJ.K2.CopyProjectResource,resource:t});case x.lW.MoveToLibrary:return p({scene:eJ.K2.MoveResourceToLibrary,resource:t});case x.lW.CopyToLibrary:return p({scene:eJ.K2.CopyResourceToLibrary,resource:t});default:console.warn("[DatabaseResource]unsupported action>>>",e)}},onDelete:h,onCustomCreate:(e,t)=>{console.log("[ResourceFolder]on custom create>>>",e,t),l()},modals:[s]}},to=()=>{var e=(0,d.useMemo)(()=>[{icon:(0,l.jsx)(g.Guk,{}),label:ef.o.t("project_resource_sidebar_create_new_resource",{resource:ef.o.t("performance_knowledge")}),subType:x.LC.Knowledge,tooltip:null},{icon:(0,l.jsx)(g.Dzy,{}),label:ef.o.t("project_resource_sidebar_create_new_resource",{resource:ef.o.t("review_bot_database")}),subType:x.LC.Database,tooltip:null}],[]),{modal:t,open:n}=tr(),r=e8(),o=ti();return{onCustomCreate(e,t){var n,a;t===x.LC.Knowledge&&(null===(n=r.onCustomCreate)||void 0===n||n.call(r,e,t)),t===x.LC.Database&&(null===(a=o.onCustomCreate)||void 0===a||a.call(o,e,t))},onChangeName(e){var t,n,a,s;(null===(t=e.resource)||void 0===t?void 0:t.res_type)===eJ.b0.Knowledge&&(null===(a=r.onChangeName)||void 0===a||a.call(r,e)),(null===(n=e.resource)||void 0===n?void 0:n.res_type)===eJ.b0.Database&&(null===(s=o.onChangeName)||void 0===s||s.call(o,e))},onAction(e,t){if(e===x.lW.ImportLibraryResource)n();else{var a,s;(null==t?void 0:t.res_type)===eJ.b0.Knowledge&&(null===(a=r.onAction)||void 0===a||a.call(r,e,t)),(null==t?void 0:t.res_type)===eJ.b0.Database&&(null===(s=o.onAction)||void 0===s||s.call(o,e,t))}},onDelete(e){var t,n,a=e.filter(e=>(null==e?void 0:e.res_type)===eJ.b0.Knowledge),s=e.filter(e=>(null==e?void 0:e.res_type)===eJ.b0.Database);a.length&&(null===(t=r.onDelete)||void 0===t||t.call(r,a)),s.length&&(null===(n=o.onDelete)||void 0===n||n.call(o,s))},createResourceConfig:e,modals:[r.modals,o.modals,t],validateConfig:{customValidator:e=>e.label?/^[^"'`\\]+$/.test(e.label)?(0,x.nU)(e):ef.o.t("dataset-name-has-wrong-word-tooltip"):ef.o.t("dataset-name-empty-tooltip")}}},ta=n("280053"),ts={[ta.a5.Text]:(0,l.jsx)(g.da8,{}),[ta.a5.Table]:(0,l.jsx)(g.E4X,{}),[ta.a5.Image]:(0,l.jsx)(g.Q2$,{})},tl=e=>{var{idPrefix:t="fixed-sidebar"}=e,{onCustomCreate:n,onDelete:r,onChangeName:o,onAction:a,createResourceConfig:s,iconRender:c,modals:u}=(0,v.qn)(),{onCustomCreate:h,onDelete:p,onChangeName:f,onAction:b,validateConfig:y,modals:_}=e4(),{onCustomCreate:w,onDelete:k,onChangeName:C,onAction:j,createResourceConfig:E,modals:T,validateConfig:I}=to(),P=(0,m.aQ)(),M=(0,m.vp)(),{version:R}=(0,m.jo)(),D=(0,S.Qb)(S.PL.CREATE_RESOURCE,M,P);R&&(D=!1);var A=(0,S.kc)(M),N=(0,d.useMemo)(()=>{var e;return(null!==(e=null==A?void 0:A.length)&&void 0!==e?e:0)===0||!!R},[A,R]),{workflowResource:L,pluginResource:z,dataResource:O,initLoaded:B}=(0,x.rA)();return(0,l.jsxs)("div",{children:[(0,l.jsx)(x.dg,{id:"".concat(t,"_").concat(x.ai.Workflow),groupType:x.ai.Workflow,defaultResourceType:x.LC.Workflow,resourceTree:L,canCreate:D,initLoaded:B,onChangeName:o,onCustomCreate:n,onDelete:r,onAction:a,createResourceConfig:s,iconRender:c,hideMoreBtn:N}),(0,l.jsx)(x.dg,{id:"".concat(t,"_").concat(x.ai.Plugin),groupType:x.ai.Plugin,defaultResourceType:x.LC.Plugin,resourceTree:z,canCreate:D,initLoaded:B,onChangeName:f,onCustomCreate:h,onDelete:p,onAction:b,iconRender:()=>(0,l.jsx)(g.QWX,{}),hideMoreBtn:N,validateConfig:y}),(0,l.jsx)(x.dg,{id:"".concat(t,"_").concat(x.ai.Data),groupType:x.ai.Data,resourceTree:O,canCreate:D,initLoaded:B,createResourceConfig:E,onChangeName:C,onDelete:k,onAction:j,onCustomCreate:w,hideMoreBtn:N,validateConfig:I,iconRender:e=>{var t,{resource:n}=e;return(console.log(n),n.id===x.Vx)?(0,l.jsx)(g.pFl,{}):n.type===x.LC.Database?(0,l.jsx)(g.Dzy,{}):n.type===x.LC.Knowledge?(0,l.jsxs)("div",{className:"flex items-center",children:[ts[null===(t=n.biz_extend)||void 0===t?void 0:t.format_type],3===n.biz_res_status?(0,l.jsx)("span",{className:"ml-[3px]",children:"已禁用"}):null]}):(0,l.jsx)(l.Fragment,{})}}),u,_,T]})},tc=n("362845"),td={};td.styleTagTransform=eM(),td.setAttributes=eE(),td.insert=eC().bind(null,"head"),td.domAPI=eS(),td.insertStyleElement=eI(),ew()(tc.Z,td);var tu=tc.Z&&tc.Z.locals?tc.Z.locals:void 0,th=(0,d.lazy)(()=>n.e("9905").then(n.bind(n,163206)).then(e=>({default:e.ResourceTreeModal}))),tp=(0,eQ._Uw)(e=>{var{hideExpand:t,idPrefix:n}=e,r=(0,m.XO)(),{workflowResource:o}=(0,x.rA)(),[a,s]=(0,d.useState)(!1),[c]=(0,eG.V)();return(0,l.jsxs)("div",{className:tu["primary-sidebar"],children:[(0,l.jsxs)("div",{className:eX()(tu["primary-sidebar-header"],"h-[".concat(44,"px]")),children:[(0,l.jsxs)("div",{className:tu.title,children:[ef.o.t("project_resource_sidebar_title"),c["bot.automation.dependency_tree"]?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ep.zx,{size:"small",icon:(0,l.jsx)(g.CfL,{}),color:"primary",disabled:!(null==o?void 0:o.length),onClick:()=>s(!0),children:ef.o.t("reference_graph_entry_button")}),a?(0,l.jsx)(d.Suspense,{fallback:null,children:(0,l.jsx)(th,{modalVisible:a,setModalVisible:s})}):null]}):null]}),t?null:(0,l.jsx)(ep.hU,{"data-testid":"project-expand-button",icon:(0,l.jsx)(g.m7o,{className:"coz-fg-primary"}),color:"secondary",size:"small",onClick:()=>{r.view.primarySidebar.changeVisible(!1)}})]}),(0,l.jsx)("div",{className:tu["resource-list-wrapper"],style:{height:"calc(100% - ".concat(44,"px)")},children:(0,l.jsx)(tl,{idPrefix:n})})]})}),tf=n("746131"),tm={};tm.styleTagTransform=eM(),tm.setAttributes=eE(),tm.insert=eC().bind(null,"head"),tm.domAPI=eS(),tm.insertStyleElement=eI(),ew()(tf.Z,tm);var tv=tf.Z&&tf.Z.locals?tf.Z.locals:void 0,tg=e=>{var{commandRegistry:t,title:n,widget:r,uiState:o,registry:a}=e,[s,c]=(0,d.useState)(!1),u=(0,d.useMemo)(()=>(null==a?void 0:a.renderIcon)&&"function"==typeof(null==a?void 0:a.renderIcon)?a.renderIcon(r.context):null,[a]),h=(0,d.useMemo)(()=>{if(s)return(0,l.jsx)(g.syE,{className:"coz-fg-secondary",style:{fontSize:16},onClick:e=>{e.stopPropagation(),t.executeCommand(m.mY.Default.VIEW_SAVING_WIDGET_CLOSE_CONFIRM,[null==r?void 0:r.title])}});if(n){if("saving"===o)return(0,l.jsx)(ep.gb,{size:"mini",loading:!0});else if("error"===o)return(0,l.jsx)(g.wR2,{className:"text-lg coz-fg-hglt-red"})}else;return null},[o,r,s,t,n]),p=(0,d.useCallback)(()=>{c(!0)},[]),f=(0,d.useCallback)(()=>{c(!1)},[]);return(0,l.jsx)("div",{className:tv["title-container"],onMouseOver:p,onMouseLeave:f,children:"loading"!==o&&n?(0,l.jsxs)("div",{className:tv["widget-title"],children:[(0,l.jsxs)("div",{className:tv["title-label"],children:[(0,l.jsx)("div",{className:tv["label-icon"],children:u}),(0,l.jsx)("div",{className:tv["label-text"],children:(0,l.jsx)(ep.ZT.Text,{ellipsis:{showTooltip:!0},children:n})})]}),(0,l.jsx)("div",{className:eX()(tv["close-icon"],m.xO),children:h})]}):(0,l.jsxs)("div",{className:tv["widget-title"],children:[(0,l.jsx)("div",{className:tv["title-label"],children:(0,l.jsx)(ep.Od.Title,{style:{width:"100px"}})}),(0,l.jsx)("div",{className:eX()(tv["close-icon"],m.xO),children:h})]})})},tb=e=>(0,l.jsx)(tg,(0,L._)({},e));n.p,n.p,n.p;var ty=n.p+"static/image/cn-workflow-frame.71d4a119.png";n.p;var t_=n.p+"static/image/cn-knowledge-frame.1e7b48d8.png",tw=n("618461"),tx={};tx.styleTagTransform=eM(),tx.setAttributes=eE(),tx.insert=eC().bind(null,"head"),tx.domAPI=eS(),tx.insertStyleElement=eI(),ew()(tw.Z,tx);var tS=tw.Z&&tw.Z.locals?tw.Z.locals:void 0,tk=()=>{var e=(0,m.XO)(),t=(0,m.eo)(),{keybinding:n}=(0,m.XU)(m.mY.Default.VIEW_FULL_SCREEN),r=(0,m.Lj)(t.currentURI,t.tabBar),[o,a]=(0,d.useState)(!1),[s,c]=(0,d.useState)(e.view.isFullScreenMode);(0,d.useEffect)(()=>{var t=e.view.onFullScreenModeChange(e=>{c(e)});return()=>{t.dispose()}},[]);var u=(0,d.useMemo)(()=>s?(0,l.jsx)(g.qSn,{}):(0,l.jsx)(g.ltt,{}),[s]),h=(0,d.useMemo)(()=>(0,l.jsxs)("div",{className:tS.shortcut,children:[(0,l.jsx)("div",{className:tS.label,children:s?ef.o.t("project_ide_restore"):ef.o.t("project_ide_maximize")}),(0,l.jsx)("div",{className:tS.keybinding,children:n})]}),[s,n]);return"left"===r?null:(0,l.jsx)(ep.u,{content:h,position:"bottom",trigger:"custom",visible:o,children:(0,l.jsx)(ep.hU,{className:tS["icon-button"],icon:u,color:"secondary",onClick:()=>{e.view.switchFullScreenMode(),a(!1)},onMouseOver:()=>a(!0),onMouseOut:()=>a(!1)})})},tC=n("260776"),tj={};tj.styleTagTransform=eM(),tj.setAttributes=eE(),tj.insert=eC().bind(null,"head"),tj.domAPI=eS(),tj.insertStyleElement=eI(),ew()(tC.Z,tj);var tE=tC.Z&&tC.Z.locals?tC.Z.locals:void 0,tT=()=>{var e=(0,m.XO)(),t=(0,m.eo)(),n=(0,m.Lj)(t.currentURI,t.tabBar),{pathname:r}=(0,c.useLocation)(),[o,a]=(0,d.useState)(e.view.primarySidebar.getVisible()),s=(0,x.Un)(e=>e.canClosePopover),[u,h]=(0,d.useState)(!1),p=(0,d.useRef)(),f=(0,d.useRef)(),v=()=>{h(!0),clearTimeout(p.current),f.current=!1},b=()=>{if(f.current=!0,!!s)p.current=setTimeout(()=>{h(!1)},100)};(0,d.useEffect)(()=>{s&&f.current&&h(!1)},[s]),(0,d.useLayoutEffect)(()=>{a(e.view.primarySidebar.getVisible())},[r]),(0,d.useEffect)(()=>{var t=e.view.onSidebarVisibleChange(e=>{a(e)});return()=>{t.dispose()}},[]);var y=(0,d.useCallback)(()=>{e.view.primarySidebar.changeVisible(!0),h(!1)},[]);return"right"===n?null:o?null:(0,l.jsx)(ep.J2,{motion:!1,visible:u,trigger:"custom",zIndex:1e3,style:{background:"transparent",border:"none",boxShadow:"none",padding:0},content:(0,l.jsx)("div",{onMouseEnter:v,onMouseLeave:b,className:tE["sidebar-wrapper"],children:(0,l.jsx)(tp,{hideExpand:!0,idPrefix:"popover-sidebar"})}),children:(0,l.jsx)(ep.hU,{className:tE["icon-button"],icon:(0,l.jsx)(g.m7o,{style:{rotate:"180deg"}}),color:"secondary",onClick:y,onMouseEnter:v,onMouseLeave:b})})},tI=n("130493"),tP={};tP.styleTagTransform=eM(),tP.setAttributes=eE(),tP.insert=eC().bind(null,"head"),tP.domAPI=eS(),tP.insertStyleElement=eI(),ew()(tI.Z,tP);var tM=tI.Z&&tI.Z.locals?tI.Z.locals:void 0,tR=e=>{var{item:t}=e,{key:n,label:r,keybinding:o}=t;return(0,l.jsxs)("div",{className:tM["shortcut-item"],children:[(0,l.jsx)("div",{className:tM.label,children:r}),(0,l.jsx)("div",{className:tM.keybinding,children:o.map(e=>e.map(e=>(0,l.jsx)("div",{className:tM["keybinding-block"],children:e},e)))})]},n)},tD=n("676466"),tA={};tA.styleTagTransform=eM(),tA.setAttributes=eE(),tA.insert=eC().bind(null,"head"),tA.domAPI=eS(),tA.insertStyleElement=eI(),ew()(tD.Z,tA);var tN=tD.Z&&tD.Z.locals?tD.Z.locals:void 0,tL=[m.mY.Default.VIEW_CLOSE_ALL_WIDGET,m.mY.Default.VIEW_CLOSE_CURRENT_WIDGET,m.mY.Default.VIEW_CLOSE_OTHER_WIDGET],tz=()=>{var e=(0,m.RX)(m.L),t=(0,m.RX)(m.Ho),n=e.shortcutsHandlers.filter(e=>tL.includes(e.commandId)).map(n=>{var r;return{key:n.commandId,label:(null===(r=t.getCommand(n.commandId))||void 0===r?void 0:r.label)||n.commandId,keybinding:e.getShortcutByCommandId(n.commandId)}}),r=(0,d.useCallback)(()=>{window.open("/docs/guides/build_project_in_projectide")},[]);(0,d.useCallback)(()=>{window.open("/docs/guides/build_ui_interface")},[]);var o=(0,d.useCallback)(()=>{window.open("/docs/guides/add_resources_to_project")},[]);return(0,l.jsxs)("div",{className:tN["default-container"],children:[(0,l.jsx)("div",{className:tN["icon-expand"],children:(0,l.jsx)(tT,{})}),(0,l.jsx)("div",{className:tN["full-screen"],children:(0,l.jsx)(tk,{})}),(0,l.jsx)("div",{className:tN.title,children:ef.o.t("project_ide_welcome_title")}),(0,l.jsx)("div",{className:tN["sub-title"],children:ef.o.t("project_ide_welcome_describe")}),(0,l.jsxs)("div",{className:tN.gallery,children:[(0,l.jsxs)("div",{className:tN["gallery-block"],children:[(0,l.jsx)(ep.Ee,{preview:!1,src:ty,width:320,height:160}),(0,l.jsx)("div",{className:tN["gallery-title"],children:ef.o.t("project_ide_welcome_workflow_title")}),(0,l.jsx)("div",{className:tN["gallery-description"],children:ef.o.t("project_ide_welcome_workflow_describe")}),(0,l.jsx)(ep.zx,{className:tN["doc-search"],icon:(0,l.jsx)(g.da8,{}),color:"primary",onClick:r,children:ef.o.t("project_ide_view_document")})]}),null,(0,l.jsxs)("div",{className:tN["gallery-block"],children:[(0,l.jsx)(ep.Ee,{preview:!1,src:t_,width:320,height:160}),(0,l.jsx)("div",{className:tN["gallery-title"],children:ef.o.t("project_ide_welcome_db_title")}),(0,l.jsx)("div",{className:tN["gallery-description"],children:ef.o.t("project_ide_welcome_db_describ")}),(0,l.jsx)(ep.zx,{className:tN["doc-search"],icon:(0,l.jsx)(g.da8,{}),color:"primary",onClick:o,children:ef.o.t("project_ide_view_document")})]})]}),(0,l.jsx)("div",{className:tN["shortcuts-list"],children:n.map(e=>(0,l.jsx)(tR,{item:e},e.key))})]})},tO=e=>{var{widget:t}=e,{keybinding:n}=(0,m.XU)(m.yJ.RELOAD),[r,o]=(0,d.useState)(!1),a=(0,d.useMemo)(()=>(0,l.jsxs)("div",{className:tS.shortcut,children:[(0,l.jsx)("div",{className:tS.label,children:ef.o.t("refresh_project_tags")}),(0,l.jsx)("div",{className:tS.keybinding,children:n})]}),[n]);return(0,l.jsx)(ep.u,{content:a,position:"bottom",trigger:"custom",visible:r,children:(0,l.jsx)(ep.hU,{className:tS["icon-button"],icon:(0,l.jsx)(g.mxP,{}),color:"secondary",onClick:()=>{t.refresh(),t.context.widget.setUIState("loading")},onMouseOver:()=>o(!0),onMouseOut:()=>o(!1)})})},tB=e=>{var{widget:t}=e;return(0,l.jsxs)("div",{style:{display:"flex"},children:[(0,l.jsx)(tO,{widget:t}),(0,l.jsx)(tk,{})]})},tW=n("184983"),tF={};tF.styleTagTransform=eM(),tF.setAttributes=eE(),tF.insert=eC().bind(null,"head"),tF.domAPI=eS(),tF.insertStyleElement=eI(),ew()(tW.Z,tF);var tH=tW.Z&&tW.Z.locals?tW.Z.locals:void 0,tU=e=>{var{scene:t,resourceName:n}=e,r=(0,d.useMemo)(()=>{switch(t){case eJ.K2.CopyResourceFromLibrary:return ef.o.t("resource_process_modal_text_copying_resource_to_project",{resourceName:n});case eJ.K2.MoveResourceToLibrary:return ef.o.t("resource_process_modal_text_moving_resource_to_library",{resourceName:n});case eJ.K2.CopyResourceToLibrary:return ef.o.t("resource_process_modal_text_copying_resource_to_library",{resourceName:n});case eJ.K2.CopyProjectResource:return ef.o.t("project_toast_copying_resource",{resourceName:n});default:return""}},[t,n]),o=(0,d.useMemo)(()=>t===eJ.K2.MoveResourceToLibrary?ef.o.t("resource_process_modal_text_moving_process_interrupt_warning"):ef.o.t("resource_process_modal_text_copying_process_interrupt_warning"),[t]);return(0,l.jsxs)("div",{className:tH["description-container"],children:[(0,l.jsx)(ep.gb,{loading:!0,wrapperClassName:tH.spin}),(0,l.jsx)("div",{children:r}),(0,l.jsx)("div",{children:o})]})},tV=()=>{var[e,t]=(0,d.useState)(!1),[n,r]=(0,d.useState)(void 0),[o,a]=(0,d.useState)(!1),[s,c]=(0,d.useState)(""),u=(0,m.RX)(m.Z7),h=(0,d.useCallback)(()=>{u.onCloseResourceModal()},[]),p=(0,d.useCallback)(()=>{o&&u.retry()},[o]),f=(0,d.useMemo)(()=>{switch(n){case eJ.K2.CopyResourceFromLibrary:return ef.o.t("resource_process_modal_title_import_resource_from_library");case eJ.K2.MoveResourceToLibrary:return ef.o.t("resource_process_modal_title_move_resource_to_library");case eJ.K2.CopyResourceToLibrary:return ef.o.t("resource_process_modal_title_copy_resource_to_library");case eJ.K2.CopyProjectResource:return ef.o.t("workflow_add_list_copy");default:return""}},[n]),v=(0,d.useMemo)(()=>{if("string"==typeof o&&"no_task_id"!==o)return o;switch(n){case eJ.K2.CopyResourceFromLibrary:return ef.o.t("resource_toast_copy_to_project_fail");case eJ.K2.MoveResourceToLibrary:return ef.o.t("resource_toast_move_to_library_fail");case eJ.K2.CopyResourceToLibrary:return ef.o.t("resource_toast_copy_to_library_fail");case eJ.K2.CopyProjectResource:return ef.o.t("project_toast_copy_failed");default:return""}},[n,o]),b=(0,d.useMemo)(()=>o?(0,l.jsxs)("div",{className:tH["error-container"],children:[(0,l.jsx)(g.U6C,{className:"coz-fg-hglt-red",fontSize:22}),v]}):(0,l.jsx)(tU,{scene:n,resourceName:s}),[o,v,s,n]),y=(0,d.useMemo)(()=>"",[o]);(0,d.useEffect)(()=>{var e=u.onModalVisibleChange(e=>{var{type:n,visible:o=!0,scene:s,resourceName:l}=e;n===m.w8.RESOURCE&&(t(!!o),r(s),c(l||""),a(!1))}),n=u.onError(e=>{a(e)});return()=>{e.dispose(),n.dispose()}},[]);var _=(0,d.useMemo)(()=>o?ef.o.t("resource_process_modal_cancel_button"):void 0,[o]);return(0,l.jsx)(ep.u_,{visible:e,width:384,type:"dialog",title:f,okText:y,onOk:p,cancelText:_,onCancel:h,maskClosable:!1,children:(0,l.jsx)("div",{className:tH.content,children:b})})},tK=n("626496"),tq={};tq.styleTagTransform=eM(),tq.setAttributes=eE(),tq.insert=eC().bind(null,"head"),tq.domAPI=eS(),tq.insertStyleElement=eI(),ew()(tK.Z,tq);var tZ=tK.Z&&tK.Z.locals?tK.Z.locals:void 0,tY=()=>{var e=(0,m.RX)(m.Z7),t=(0,m.RX)(m.un),n=(0,m.RX)(m.s1),r=(0,d.useRef)(),[o,a]=(0,d.useState)(!1),s=(0,d.useCallback)(()=>{(r.current||[]).forEach(e=>{var t;null==e||null===(t=e.owner)||void 0===t||t.close()}),a(!1)},[]),c=(0,d.useCallback)(()=>{a(!1)},[]);return(0,d.useEffect)(()=>{var o=t.onBeforeUnload(e=>{if(n.getOpenTitles().some(e=>e.saving))return e.preventDefault(),e.stopPropagation(),e.returnValue="",""}),s=e.onModalVisibleChange(e=>{var{type:t,options:n,visible:o=!0}=e;t===m.w8.CLOSE_CONFIRM&&(a(!!o),r.current=n)});return()=>{o.dispose(),s.dispose()}},[]),(0,l.jsx)(ep.u_,{visible:o,type:"dialog",title:ef.o.t("project_ide_unsaved_changes"),okText:ef.o.t("project_ide_quit"),okButtonColor:"red",cancelText:ef.o.t("project_ide_cancel"),onOk:s,onCancel:c,maskClosable:!1,children:(0,l.jsx)("div",{className:tZ.content,children:ef.o.t("project_ide_unsaved_describe")})})},tX=()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tV,{}),(0,l.jsx)(tY,{})]}),tQ=n("110808"),tG={};tG.styleTagTransform=eM(),tG.setAttributes=eE(),tG.insert=eC().bind(null,"head"),tG.domAPI=eS(),tG.insertStyleElement=eI(),ew()(tQ.Z,tG);var tJ=tQ.Z&&tQ.Z.locals?tQ.Z.locals:void 0;new m.ov("".concat(m.OG,":///session"));var t$=new m.ov("".concat(m.OG,":///variables")),t0=()=>{var e=(0,m.d0)(),t=(0,m.eo)(),n=(0,m.VM)(),[r,o]=(0,d.useState)(!0);(0,d.useCallback)(()=>{e("/session")},[]);var a=(0,d.useCallback)(()=>{e("/variables")},[]);return(0,l.jsxs)("div",{className:tJ["config-container"],children:[(0,l.jsxs)("div",{className:eX()(tJ["primary-sidebar-header"],"h-[".concat(44,"px]")),children:[(0,l.jsx)("div",{className:tJ.title,children:ef.o.t("wf_chatflow_143")}),(0,l.jsx)(ep.hU,{icon:r?(0,l.jsx)(g.Wdl,{className:"coz-fg-primary"}):(0,l.jsx)(g.uDC,{className:"coz-fg-primary"}),color:"secondary",size:"small",onClick:()=>{t&&t.toggleSubWidget(m.KO),o(!r)}})]}),null,(0,l.jsxs)("div",{className:eX()(tJ.item,(0,m.fZ)(null==n?void 0:n.uri,t$)&&tJ.activate),onClick:a,children:[(0,l.jsx)(g.pFl,{className:"coz-fg-plus",style:{marginRight:4}}),ef.o.t("dataide002")]})]})},t1=n("794800"),t2=()=>(0,l.jsx)(ep.ub,{size:"full_screen",icon:(0,l.jsx)(t1.JD,{}),title:"An error occurred",description:"Please try again later."}),t4=n("307765"),t6=[t4.z.Database,t4.z.Dataset,t4.z.Plugin,t4.z.Workflow],t5=e=>{var{spaceId:t,projectId:n}=e,[r,o]=(0,d.useState)(!1),a=(0,m.d0)(),s=(0,m.RX)(m.T_),l=(0,m.RX)(m.cw),{version:c}=(0,m.jo)(),[u]=(0,eG.V)(),h=(0,m.qj)(window.location.pathname);if(r)throw Error("project ide global handler error");var p=(0,x.Un)(e=>e.fetchResource),f=(0,x.Un)(e=>e.refetch),[v,g]=(0,d.useState)(""),[b,y]=(0,d.useState)(""),_=(0,m.CW)("/".concat(x.LC.Workflow,"/").concat(v));return(0,d.useEffect)(()=>{if(!!v)f(e=>{var t,n,r,o=(null==e?void 0:null===(t=e.find(e=>e.groupType===x.ai.Workflow))||void 0===t?void 0:t.resourceList)||[],a=null==o?void 0:null===(n=o.find(e=>e.id===v))||void 0===n?void 0:n.name;a&&_&&(null===(r=_.context.widget)||void 0===r||r.setTitle(a))})},[v,_,b]),(0,m.q9)(e=>{if(!u["bot.automation.project_multi_tab"]||!t6.includes(e.bizType))return;var t,n,r,o=e.operateType===t4.X.Update,a=(null==e?void 0:null===(t=e.extra)||void 0===t?void 0:t.Scene)==="RollbackProject";if(o&&a){window.location.reload();return}var s=e.operateType===t4.X.Create,l=(null==e?void 0:null===(n=e.extra)||void 0===n?void 0:n.methodName)==="CreateWorkflow",c=(null==e?void 0:null===(r=e.extra)||void 0===r?void 0:r.methodName)==="EncapsulateWorkflow";if(s&&(l||c)){f();return}if(!!(null==e?void 0:e.resId))g(null==e?void 0:e.resId),y(new Date().getTime().toString())}),(0,d.useEffect)(()=>{p(t,n,c,e=>{var t,n=(null===(t=(e||[]).find(e=>e.groupType===x.ai.Workflow))||void 0===t?void 0:t.resourceList)||[],r=null==n?void 0:n[0];!h&&l.openFirstWorkflow&&r&&(a("/workflow/".concat(r.id)),l.openFirstWorkflow=!1)})},[t,n]),(0,d.useEffect)(()=>{var e=s.onError(()=>{o(!0)});return()=>{null==e||e.dispose()}},[]),null},t3=n("59955"),t8=()=>{var{projectInfo:e}=ev();return(0,l.jsx)(t3.q,{children:(0,l.jsx)("title",{children:ef.o.t("project_ide_tab_title",{project_name:null==e?void 0:e.name})})})},t9=n("740552"),t7={};t7.styleTagTransform=eM(),t7.setAttributes=eE(),t7.insert=eC().bind(null,"head"),t7.domAPI=eS(),t7.insertStyleElement=eI(),ew()(t9.Z,t7);var ne=t9.Z&&t9.Z.locals?t9.Z.locals:void 0,nt=()=>{var[e,t]=(0,d.useState)(!1),n=(0,m.RX)(el);return((0,d.useEffect)(()=>{var e=n.onStarted(()=>{t(!0)});return()=>e.dispose()},[n]),e)?null:(0,l.jsx)("div",{className:ne["global-loading"],children:(0,l.jsx)(ep.yC,{})})},nn=()=>{var{projectInfo:e}=ev();return(0,l.jsx)(f,{projectInfo:e})},nr=n("981071"),ni={};ni.styleTagTransform=eM(),ni.setAttributes=eE(),ni.insert=eC().bind(null,"head"),ni.domAPI=eS(),ni.insertStyleElement=eI(),ew()(nr.Z,ni),nr.Z&&nr.Z.locals&&nr.Z.locals;var no=n("998486"),na={};na.styleTagTransform=eM(),na.setAttributes=eE(),na.insert=eC().bind(null,"head"),na.domAPI=eS(),na.insertStyleElement=eI(),ew()(no.Z,na),no.Z&&no.Z.locals&&no.Z.locals;var ns=(0,d.memo)(e=>{var{spaceId:t,projectId:n,version:r}=e,o=(0,c.useNavigate)(),a=(0,S.Qb)(S.PL.View,n,t),s=(0,d.useMemo)(()=>({view:{widgetRegistries:[v.Q4,w,y,b,_],secondarySidebar:p,topBar:eZ,primarySideBar:tp,configuration:t0,widgetTitleRender:tb,widgetDefaultRender:tz,widgetFallbackRender:e=>{var{widget:t}=e;return(0,l.jsx)(t2,{})},preToolbar:()=>(0,l.jsx)(tT,{}),toolbar:e=>(0,l.jsx)(tB,{widget:e}),uiBuilder:()=>(0,l.jsx)(nn,{})}}),[]),u=(0,d.useMemo)(()=>[ec({spaceId:t,projectId:n,navigate:o,version:r}),(0,x.X5)()],[t,n,r,o]);if(!a)throw Error("can not view");return(0,l.jsx)(m.X9,{spaceId:t,projectId:n,version:r,children:(0,l.jsxs)(m.Xe,{presetOptions:s,plugins:u,children:[(0,l.jsx)(t8,{}),(0,l.jsx)(tX,{}),(0,l.jsx)(t5,{spaceId:t,projectId:n}),(0,l.jsx)(nt,{})]})})})},297751:function(e,t,n){"use strict";n.d(t,{vp:()=>g,zF:()=>b,TH:()=>v});var r=n("808549"),o=n("120454"),a=n("473980"),s=n("151064"),l=n("455069"),c=n("529801"),d=n("659596"),u=n("392300"),h=n("416290"),p=(0,l.createContext)({showText:!0,setItems:u.Z}),f=(e,t)=>{var{showText:n,setItems:a}=(0,l.useContext)(p),s=(0,h.Z)(t);return(0,l.useEffect)(()=>{a(t=>{var n;return(0,o._)((0,r._)({},t),{[e]:{width:null!==(n=null==s?void 0:s.width)&&void 0!==n?n:0}})})},[null==s?void 0:s.width]),(0,l.useEffect)(()=>()=>{a(t=>(0,c.Z)(t,e))},[]),n},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[n,r]=(0,l.useState)(),o=(0,h.Z)(e),a=Object.getOwnPropertySymbols(n||{}).reduce((e,r,o)=>{var a,s;return e+(null!==(s=null==n?void 0:null===(a=n[r])||void 0===a?void 0:a.width)&&void 0!==s?s:0)+(o>0?t:0)},0),s=!!(null==o?void 0:o.width)&&o.width>=a;return(0,l.useMemo)(()=>({showText:s,setItems:r}),[s])},v=e=>{var{children:t,gap:n=12}=e,r=(0,l.useRef)(null),o=m(r,n);return(0,s.jsx)("div",{ref:r,className:"flex items-center justify-end flex-1 overflow-hidden",style:{gap:n},children:(0,s.jsx)(p.Provider,{value:o,children:t})})},g=(0,l.forwardRef)((e,t)=>{var{itemKey:n,text:u}=e,h=(0,a._)(e,["itemKey","text"]),p=(0,l.useRef)(null),m=f(n,p);return(0,s.jsxs)("span",{ref:t,children:[(0,s.jsx)("div",{className:m?"":"fixed left-[-999px]",ref:p,children:(0,s.jsx)(d.zx,(0,o._)((0,r._)({size:"default",color:"secondary"},m?h:(0,c.Z)(h,"data-testid")),{children:u}))}),!m&&(0,s.jsx)(d.u,{content:u,children:(0,s.jsx)(d.hU,(0,r._)({size:"default",color:"secondary"},h))})]})}),b=(0,l.forwardRef)((e,t)=>{var{itemKey:n,fullContent:r,collapsedContent:o,collapsedTooltip:a}=e,c=(0,l.useRef)(null),u=f(n,c);return(0,s.jsxs)("span",{ref:t,children:[(0,s.jsx)("div",{className:u?"":"fixed left-[-999px]",ref:c,children:r}),!u&&(0,s.jsx)(d.u,{trigger:a?"hover":"custom",content:a,children:(0,s.jsx)("span",{children:o})})]})})},616405:function(e,t,n){"use strict";n.d(t,{kt:()=>u});var r=n("151064"),o=n("336205");n.p;var a=n("122206");a.g.Unknown,o.o.t("coze_premium_credits_cycle_4"),a.g.Never,o.o.t("coze_premium_credits_cycle_4"),a.g.Day,o.o.t("coze_premium_credits_cycle_1"),a.g.Week,o.o.t("coze_premium_credits_cycle_2"),a.g.Month,o.o.t("coze_premium_credits_cycle_3");var s=n("252237"),l=n.n(s),c=n("873183"),d=n("659596");function u(e){var{className:t,monetizeConfig:n,supportPlatforms:a}=e,s=a.map(e=>e.name).join(", ");return(0,r.jsxs)("div",{className:l()("flex justify-end items-center gap-[12px]",t),children:[(0,r.jsxs)("div",{className:"flex items-center gap-[4px]",children:[(0,r.jsx)("span",{className:"font-medium coz-fg-plus",children:"".concat(o.o.t("monetization"),": ").concat(n.is_enable?o.o.t("monetization_publish_on"):o.o.t("monetization_publish_off"))}),(0,r.jsx)(d.u,{content:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("div",{children:n.is_enable?o.o.t("monetization_on_des"):o.o.t("monetization_off_des")}),n.is_enable?(0,r.jsx)("div",{className:"mt-[8px] pt-[8px] border-0 border-t border-solid coz-stroke-primary",children:"".concat(o.o.t("free_chat_allowance")," : ").concat(n.free_chat_allowance_count)}):null]}),children:(0,r.jsx)(c.L03,{className:"w-[16px] h-[16px] coz-fg-secondary"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-[4px]",children:[(0,r.jsxs)("span",{className:"font-normal coz-fg-tertiary",children:[o.o.t("monetization_support"),":"]}),(0,r.jsx)("span",{className:"flex items-center gap-[4px]",children:a.map(e=>(0,r.jsx)(d.qE,{className:"h-[16px] w-[16px] rounded-[4px]",size:"extra-extra-small",shape:"square",src:e.icon},e.id))}),(0,r.jsx)(d.u,{content:"".concat(o.o.t("monetization_support_tips"),": ").concat(s),children:(0,r.jsx)(c.L03,{className:"w-[16px] h-[16px] coz-fg-secondary"})})]})]})}},319276:function(e,t,n){"use strict";n.d(t,{a2:function(){return o},bQ:function(){return a},pl:function(){return r}});var r="https://lf3-static.bytednsdoc.com/obj/eden-cn/rkzild_lgvj/ljhwZthlaukjlkulzlp/",o="undefined"!=typeof location?location.origin:"https://api.xxx.com",a=e=>""},76313:function(e,t,n){"use strict";n.d(t,{N:()=>l});var r=n("825955"),o=n("455069"),a=n("735114"),s=n("382534"),l=e=>{var{type:t,intelligenceId:n,spaceId:l,enable:c}=e,[d,u]=(0,o.useState)(!1),h=(0,a.Z)((0,r._)(function*(){var e,r;return null===(r=(yield s.sD.PublishIntelligenceList({space_id:l,intelligence_type:t,intelligence_ids:[n],size:1},{__disableErrorToast:!0})).data)||void 0===r?void 0:null===(e=r.intelligences)||void 0===e?void 0:e[0]}),{manual:!0,ready:c,pollingInterval:6e4,pollingErrorRetryCount:3,onSuccess:e=>{e&&h.cancel()},onFinally:()=>{u(!0)}});return(0,o.useEffect)(()=>(u(!1),h.run(),h.cancel),[t,n,l,c]),{inited:d,ready:!!h.data}}},174470:function(e,t,n){"use strict";n.r(t),n.d(t,{usePublishStatus:()=>tJ,useBizConnectorAnchor:()=>eW,PublishButton:()=>t0,ProjectPublish:()=>tX});var r,o,a,s,l,c,d,u,h,p=n("151064"),f=n("455069"),m=n("664319"),v=n("297158"),g=n("659596"),b=n("157728"),y=n("808549"),_=n("120454"),w=n("479910"),x=n("598208"),S=n("61111"),k="10000129",C={connectorList:[],connectorUnionMap:{},selectedConnectorIds:[],showPublishResult:!1,lastVersionNumber:"",versionNumber:"",versionDescription:"",connectorPublishConfig:{},socialPlatformChatflow:{},templateConfigured:!0,connectors:{},unions:{},publishRecordDetail:{},pageLoading:!1},j=(0,x.Ue)()((0,w.mW)((e,t)=>{var n;return(0,_._)((0,y._)({},C),{reset:()=>{e(C)},setMonetizeConfig:t=>e({monetizeConfig:t}),setConnectorList:t=>{e({connectorList:t})},setSelectedConnectorIds:t=>{e({selectedConnectorIds:t})},updateSelectedConnectorIds:t=>{e(e=>({selectedConnectorIds:t(e.selectedConnectorIds)}))},setShowPublishResult:t=>{e({showPublishResult:t})},setProjectPublishInfo:(n=e,(e,t)=>{(null==t?void 0:t.replace)?n(e):n(t=>(0,y._)({},t,e))}),setProjectPublishInfoByImmer:n=>{e({connectorPublishConfig:(0,S.Uy)(t().connectorPublishConfig,n)},!1,"setProjectPublishInfoByImmer")},setPublishRecordDetail:t=>e(e=>({publishRecordDetail:(0,y._)({},e.publishRecordDetail,t)})),resetProjectPublishInfo:()=>{e(C)},exportDraft:e=>{var{versionNumber:n,versionDescription:r,selectedConnectorIds:o,connectorPublishConfig:a,unions:s,socialPlatformChatflow:l}=t();return{projectId:e,versionNumber:n,versionDescription:r,selectedConnectorIds:o,unions:s,sdkConfig:a["999"],socialPlatformConfig:l}}})},{enabled:!1,name:"botStudio.projectPublishStore"})),E=n("298203"),T="coz_project_publish_draft",I=n("825955");var P=((r={})[r.NoBindRequired=1]="NoBindRequired",r[r.AuthBind=2]="AuthBind",r[r.KvBind=3]="KvBind",r[r.KvAuthBind=4]="KvAuthBind",r[r.ApiBind=5]="ApiBind",r[r.WebSDKBind=6]="WebSDKBind",r[r.StoreBind=7]="StoreBind",r[r.AuthAndConfig=8]="AuthAndConfig",r[r.TemplateBind=9]="TemplateBind",r);var M=((o={})[o.APIOrSDK=1]="APIOrSDK",o[o.SocialPlatform=2]="SocialPlatform",o[o.Coze=3]="Coze",o[o.MiniProgram=4]="MiniProgram",o[o.CozeSpaceExtensionLibrary=5]="CozeSpaceExtensionLibrary",o);var R=((a={})[a.Normal=0]="Normal",a[a.InReview=1]="InReview",a[a.Offline=2]="Offline",a),D=n("382534"),A=e=>e.replace(/(\d+)\.(\d+)\.(\d+)/g,(e,t,n,r)=>{var o=parseInt(String(r),10)+1;return"".concat(t,".").concat(n,".").concat(o)}),N=e=>{var{lastPublishVersionNumber:t,draftVersionNumber:n,defaultVersionNumber:r}=e;return t&&!n?A(t):n?n:r};var L=((s={})[s.Configured=1]="Configured",s[s.NotConfigured=2]="NotConfigured",s[s.Disconnected=3]="Disconnected",s[s.Configuring=4]="Configuring",s[s.NeedReconfiguring=5]="NeedReconfiguring",s);var z=((l={})[l.Default=0]="Default",l[l.Auditing=1]="Auditing",l[l.Success=2]="Success",l[l.Failed=3]="Failed",l[l.Disable=4]="Disable",l);var O=((c={})[c.Packing=0]="Packing",c[c.PackFailed=1]="PackFailed",c[c.Auditing=2]="Auditing",c[c.AuditNotPass=3]="AuditNotPass",c[c.ConnectorPublishing=4]="ConnectorPublishing",c[c.PublishDone=5]="PublishDone",c),B=e=>{var{bind_type:t,config_status:n}=e;return[P.KvBind,P.AuthBind,P.KvAuthBind,P.TemplateBind].includes(t)&&n===L.NotConfigured},W=e=>{var{allow_publish:t}=e,n=B(e);return n||!t};function F(){return(F=(0,I._)(function*(e,t,n){var{setProjectPublishInfo:r,setSelectedConnectorIds:o,setMonetizeConfig:a}=j.getState();r({pageLoading:!0});try{var s,l,c=function(e){var t=h.find(t=>t.id===e);if(!t||W(t))return"continue";t.connector_union_id?g.push(t.connector_union_id):g.push(t.id),b[t.id]=t.bind_info},[d,u]=yield Promise.all([D.sD.PublishConnectorList({project_id:e}),Promise.resolve(void 0)]),{connector_list:h=[],last_publish_info:p={},connector_union_info_map:f={}}=null!==(I=d.data)&&void 0!==I?I:{},{connector_ids:m=[],connector_publish_config:v={}}=p,g=[],b={};for(var y of m)c(y);var _={};for(var[w,x]of Object.entries(f))_[w]=null!==(R=null===(P=x.connector_options.find(e=>m.includes(e.connector_id)))||void 0===P?void 0:P.connector_id)&&void 0!==R?R:x.connector_options[0].connector_id;if(null==n?void 0:null===(C=n.socialPlatformConfig)||void 0===C?void 0:null===(k=C.selected_workflows)||void 0===k?void 0:k[0].workflow_id)A=n.socialPlatformConfig;else for(var S of h){if(!!g.includes(S.id)&&S.connector_classification===M.SocialPlatform){var k,C,E,T,I,P,R,A,L,z=v[S.id];if(null==z?void 0:null===(L=z.selected_workflows)||void 0===L?void 0:L[0].workflow_id){A=z;break}}}(null==n?void 0:null===(T=n.sdkConfig)||void 0===T?void 0:null===(E=T.selected_workflows)||void 0===E?void 0:E[0].workflow_id)&&(v["999"]=n.sdkConfig),o(null!==(s=null==n?void 0:n.selectedConnectorIds)&&void 0!==s?s:g);var O=p.version_number,B=N({lastPublishVersionNumber:O,draftVersionNumber:null==n?void 0:n.versionNumber,defaultVersionNumber:"v0.0.1"});r({lastVersionNumber:O,versionNumber:B,versionDescription:null==n?void 0:n.versionDescription,connectorPublishConfig:v,connectorList:h,connectorUnionMap:f,connectors:b,unions:null!==(l=null==n?void 0:n.unions)&&void 0!==l?l:_,socialPlatformChatflow:A}),a(null==u?void 0:u.data)}catch(e){t(e)}finally{r({pageLoading:!1})}})).apply(this,arguments)}var H=n("59955"),U=n("735114"),V=n("336205"),K=n("873183");function q(e){var t,n,r=e.publish_status===O.PackFailed||e.publish_status===O.AuditNotPass,o=null!==(n=null===(t=e.connector_publish_result)||void 0===t?void 0:t.every(e=>e.connector_publish_status===z.Auditing||e.connector_publish_status===z.Failed||e.connector_publish_status===z.Success))&&void 0!==n&&n;return r||o}var Z=(0,f.createContext)({getContainerRef:()=>null,publishHeaderHeight:0,setPublishHeaderHeight:()=>0}),Y=()=>(0,f.useContext)(Z);function X(){var e,t,n=(0,b.useNavigate)(),r=(0,g.XQ)(),{space_id:o="",project_id:a=""}=(0,b.useParams)(),s=()=>n("/space/".concat(o,"/project-ide/").concat(a)),{connectorList:l,showPublishResult:c,setShowPublishResult:d,versionDescription:u,versionNumber:h,connectors:v,unions:y,connectorPublishConfig:_,socialPlatformChatflow:w,selectedConnectorIds:x,setPublishRecordDetail:S}=j((0,m.N)(e=>({connectorList:e.connectorList,showPublishResult:e.showPublishResult,setShowPublishResult:e.setShowPublishResult,versionNumber:e.versionNumber,versionDescription:e.versionDescription,connectors:e.connectors,unions:e.unions,connectorPublishConfig:e.connectorPublishConfig,socialPlatformChatflow:e.socialPlatformChatflow,selectedConnectorIds:e.selectedConnectorIds,setPublishRecordDetail:e.setPublishRecordDetail}))),[k,C]=(0,f.useState)(!1),{publishHeaderHeight:E,setPublishHeaderHeight:T}=Y();var{run:P,cancel:R}=(0,U.Z)((e=(0,I._)(function*(e){return yield D.sD.GetPublishRecordDetail(e)}),function(t){return e.apply(this,arguments)}),{pollingInterval:3e3,pollingWhenHidden:!1,pollingErrorRetryCount:3,manual:!0,onSuccess:e=>{(null==e?void 0:e.data)?(S(e.data),q(e.data)&&R(),!c&&d(!0)):R()},onError:()=>{R()}});var A=(t=(0,I._)(function*(){if(c)s();else try{if(C(!0),yield r.validate(),!x.length){g.FN.error(V.o.t("publish_tooltip_select_platform"));return}var e={},t={};x.forEach(n=>{var r,o,a,s=null!==(o=y[n])&&void 0!==o?o:n;e[s]=null!==(a=v[s])&&void 0!==a?a:{},(null===(r=l.find(e=>e.id===s))||void 0===r?void 0:r.connector_classification)===M.SocialPlatform?t[s]=w:_[s]&&(t[s]=_[s])});var{data:n}=yield D.sD.PublishProject({project_id:a,version_number:h,description:u,connectors:e,connector_publish_config:t});S({publish_monetization_result:null==n?void 0:n.publish_monetization_result}),(null==n?void 0:n.publish_record_id)&&P({publish_record_id:n.publish_record_id,project_id:a})}catch(e){"string"==typeof Object.values(e)[0]&&g.FN.error(Object.values(e)[0])}finally{C(!1)}}),function(){return t.apply(this,arguments)});return(0,p.jsxs)("div",{className:"sticky top-0 z-[100] coz-bg-primary overflow-y-hidden",style:{height:E},children:[(0,p.jsx)(H.q,{children:(0,p.jsx)("title",{children:V.o.t("Publish")})}),(0,p.jsxs)("div",{className:"flex p-[16px] justify-between items-center coz-stroke-primary border-b border-x-0 border-t-0 border-solid pl-2",children:[(0,p.jsxs)("div",{className:"flex items-center",children:[(0,p.jsx)(g.hU,{icon:(0,p.jsx)(K.$1i,{className:"h-[18px] w-[18px]"}),color:"secondary",iconSize:"large",onClick:s}),(0,p.jsx)("span",{className:"ml-[8px] font-medium text-[20px]",children:V.o.t("Publish")})]}),(0,p.jsx)(g.zx,{onClick:A,loading:k,"data-testid":"project.publish",children:c?V.o.t("bot_publish_success_back"):V.o.t("Publish")})]}),(0,p.jsx)(g.jL,{type:"info",description:V.o.t("project_release_notify"),onClose:()=>{T(65)}})]})}var Q=n("252237"),G=n.n(Q),J=n("28260"),$=n("189284"),ee=n("76313");var et=((d={})[d.Plugin=1]="Plugin",d[d.Workflow=2]="Workflow",d[d.Imageflow=3]="Imageflow",d[d.Knowledge=4]="Knowledge",d[d.UI=5]="UI",d[d.Prompt=6]="Prompt",d[d.Database=7]="Database",d[d.Variable=8]="Variable",d),en=n("319276"),er=n("193893"),ei=n("407821"),eo=n.n(ei),ea=n("472772"),es=n.n(ea),el=n("395245"),ec=n.n(el),ed=n("297998"),eu=n.n(ed),eh=n("646576"),ep=n.n(eh),ef=n("606121"),em=n.n(ef),ev=n("727683"),eg={};eg.styleTagTransform=em(),eg.setAttributes=eu(),eg.insert=ec().bind(null,"head"),eg.domAPI=es(),eg.insertStyleElement=ep(),eo()(ev.Z,eg);var eb=ev.Z&&ev.Z.locals?ev.Z.locals:void 0;function ey(e){var{index:t}=e;return(0,p.jsx)("div",{className:"w-[20px] h-[20px] rounded-full inline-flex items-center justify-center mr-[4px] coz-mg-primary",children:(0,p.jsx)("span",{className:"font-medium coz-fg-secondary",children:t})})}function e_(){var[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(""),o=()=>t(!1);return{node:(0,p.jsxs)(g.u_,{title:V.o.t("app_publish_sdk_title"),closable:!0,visible:e,width:640,onCancel:o,footer:(0,p.jsx)(g.zx,{onClick:o,children:V.o.t("app_publish_sdk_confirm")}),zIndex:2e3,children:[(0,p.jsxs)(g.ZT.Paragraph,{className:"font-medium mb-[8px]",children:[(0,p.jsx)(ey,{index:1}),V.o.t("app_publish_sdk_step_1",{doc_link:(0,p.jsx)(g.ZT.Text,{link:{href:"/docs/developer_guides/oauth_apps",target:"_blank"},children:V.o.t("app_publish_sdk_step_1_doc")})})]}),(0,p.jsxs)(g.ZT.Paragraph,{className:"font-medium mb-[8px]",children:[(0,p.jsx)(ey,{index:2}),V.o.t("app_publish_sdk_step_2")]}),(0,p.jsx)(er.HK,{className:eb["web-sdk-guide"],markDown:n}),(0,p.jsxs)(g.ZT.Paragraph,{className:"font-medium mb-[8px]",children:[(0,p.jsx)(ey,{index:3}),V.o.t("app_publish_sdk_step_3")]})]}),show:e=>{r(function(e){var{projectId:t,workflowId:n,version:r="<version>"}=e;return"```html\n<script type=\"text/javascript\">\nvar webSdkScript = document.createElement('script');\nwebSdkScript.src = '".concat((0,en.bQ)(r),'\';\ndocument.head.appendChild(webSdkScript);\nwebSdkScript.onload = function () {\n new CozeWebSDK.WebChatClient({\n "config": {\n "type": "app",\n "appInfo": {\n "appId": "').concat(t,'",\n "workflowId": "').concat(n,'"\n }\n },\n "auth": {\n "type": "token",\n "token": "pat_********",\n onRefreshToken: function () {\n return "pat_********"\n }\n }\n });\n}\n<\/script>\n',"```")}(e)),t(!0)}}}function ew(e){var{title:t,tag:n,color:r}=e;return(0,p.jsxs)("div",{className:"flex items-center gap-[4px]",children:[(0,p.jsx)(g.ZT.Text,{className:"leading-[20px] font-normal","data-testid":"project.publish.result",children:t}),"string"==typeof n?(0,p.jsx)(g.Vp,{size:"mini",color:r,children:n}):null]})}function ex(e){var{status:t}=e,n={width:"16px",height:"16px"};switch(t){case"wait":return(0,p.jsx)(K.kSS,(0,y._)({className:"coz-fg-secondary"},n));case"process":return(0,p.jsx)(K.gO2,(0,y._)({className:"coz-fg-hglt"},n));case"finish":return(0,p.jsx)(K.G70,(0,y._)({className:"coz-fg-hglt-green"},n));case"warn":return(0,p.jsx)(K.UoC,(0,y._)({className:"coz-fg-hglt-yellow"},n));case"error":return(0,p.jsx)(K.AYy,(0,y._)({className:"coz-fg-hglt-red"},n));default:return null}}var eS={[z.Default]:{color:"brand",text:"project_releasing"},[z.Auditing]:{color:"brand",text:"under_review"},[z.Failed]:{color:"red",text:"project_release_failed"},[z.Success]:{color:"green",text:"project_release_success"},[z.Disable]:null};function ek(e){var t,n,r,o,{result:a,showTag:s,onShowWebSdkGuide:l}=e,c=eS[null!==(o=a.connector_publish_status)&&void 0!==o?o:0],d="999"===a.connector_id&&a.connector_publish_status===z.Success,u=null===(r=a.connector_publish_config)||void 0===r?void 0:null===(n=r.selected_workflows)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.workflow_id;return(0,p.jsxs)("div",{className:"h-[40px] flex items-center border-0 border-b border-solid coz-stroke-primary last:border-none",children:[(0,p.jsx)(g.EZ,{size:"small",type:"platform",className:"mr-[8px] rounded-[6px] shrink-0",src:a.connector_icon_url}),(0,p.jsx)(g.ZT.Text,{weight:500,className:"whitespace-nowrap",ellipsis:{showTooltip:!0},children:a.connector_name}),!1!==s&&c?(0,p.jsx)(g.Vp,{size:"mini",color:c.color,className:"!px-[4px] ml-[4px] shrink-0",children:V.o.t(c.text)}):null,(0,p.jsxs)("div",{className:"px-[8px] ml-auto max-w-[206px]",children:[a.connector_publish_status_msg?(0,p.jsx)(g.ZT.Text,{type:"secondary",fontSize:"14px",ellipsis:{showTooltip:{type:"tooltip",opts:{theme:"dark",style:{maxWidth:200}}}},children:a.connector_publish_status_msg}):null,d?(0,p.jsx)(g.ZT.Text,{fontSize:"14px",link:!0,onClick:()=>null==l?void 0:l(null!=u?u:""),children:V.o.t("project_release_guide")}):null,a.download_link?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(g.ZT.Text,{fontSize:"14px",link:{href:a.download_link,target:"_blank"},children:V.o.t("project_release_download_code")}),(0,p.jsx)(g.ZT.Text,{className:"ml-[12px]",fontSize:"14px",link:{href:function(e){switch(e){case"10000130":return"/docs/guides/publish_app_to_douyin_microapp";case"10000131":return"/docs/guides/publish_app_to_wechat_mini_program";default:return""}}(a.connector_id),target:"_blank"},children:V.o.t("project_release_guide")})]}):null,a.share_link?(0,p.jsx)(g.ZT.Text,{fontSize:"14px",link:{href:a.share_link,target:"_blank"},children:V.o.t("project_release_open_in_store")}):null]})]},a.connector_id)}function eC(e){return{icon:(0,p.jsx)(ex,{status:"wait"}),title:(0,p.jsx)(ew,{title:e})}}function ej(e){var t,n=(0,f.useRef)(null),[r,o]=(0,f.useState)(void 0),a=function(e,t,n){var r=V.o.t("project_release_package");if("number"!=typeof e.publish_status)return eC(r);switch(e.publish_status){case O.Packing:return{icon:(0,p.jsx)(ex,{status:"process"}),title:(0,p.jsx)(ew,{title:r,tag:V.o.t("project_release_in_progress"),color:"brand"})};case O.PackFailed:var o,a,s=null===(a=e.publish_status_detail)||void 0===a?void 0:null===(o=a.pack_failed_detail)||void 0===o?void 0:o.map(e=>({tagKey:e.entity_id,className:"pack-status-tag",prefixIcon:e.entity_type===et.Workflow?(0,p.jsx)(K.eTH,{}):(0,p.jsx)(K.QWX,{}),children:e.entity_name}));return{icon:(0,p.jsx)(ex,{status:"error"}),title:(0,p.jsx)(ew,{title:r,tag:V.o.t("project_release_package_failed"),color:"red"}),description:s?(0,p.jsxs)("div",{ref:t,children:[(0,p.jsx)(g.ZT.Paragraph,{className:"coz-fg-secondary mb-[4px]",children:V.o.t("project_release_pack_fail_reason")}),(0,p.jsx)(g.QS,{tagList:s,maxTagCount:n,showPopover:!0,popoverProps:{position:"top",style:{padding:8,maxWidth:800}}})]}):null};default:return{icon:(0,p.jsx)(ex,{status:"finish"}),title:(0,p.jsx)(ew,{title:r,tag:V.o.t("project_release_finish"),color:"green"})}}}(e.record,n,r);return(0,f.useLayoutEffect)(()=>{if(!n.current)return;var e=n.current.getElementsByClassName("pack-status-tag");if(!(e.length<=0))for(var t=-1,r=0,a=0;a<e.length;a++){var s=e[a].offsetTop;if(t!==s&&(t=s,++r>=3)){o(a);break}}},[null===(t=e.record.publish_status_detail)||void 0===t?void 0:t.pack_failed_detail]),(0,p.jsx)(g.Rg.Step,(0,y._)({},a))}function eE(e){var t,n,r,o,a,{project_id:s=""}=(0,b.useParams)(),{node:l,show:c}=e_();var d=(t=e.record,n=t=>{var n,r,o;return c({projectId:s,workflowId:t,version:null===(o=e.record.connector_publish_result)||void 0===o?void 0:null===(r=o.find(e=>"999"===e.connector_id))||void 0===r?void 0:null===(n=r.connector_bind_info)||void 0===n?void 0:n.sdk_version})},a=V.o.t("project_release_channel"),"number"!=typeof t.publish_status?eC(a):t.publish_status<O.ConnectorPublishing?(0,_._)((0,y._)({},eC(a)),{description:null===(o=t.connector_publish_result)||void 0===o?void 0:o.map(e=>(0,p.jsx)(ek,{result:e,showTag:!1}))}):{icon:(0,p.jsx)(ex,{status:function(e){var t,n=null!==(t=e.connector_publish_result)&&void 0!==t?t:[];if(n.length<=0)return"wait";var r=n.filter(e=>e.connector_publish_status===z.Failed).length;return r>0?r===n.length?"error":"warn":n.filter(e=>e.connector_publish_status===z.Default||e.connector_publish_status===z.Auditing).length>0?"process":"finish"}(t)}),title:(0,p.jsx)(ew,(0,y._)({title:a},!1)),description:null===(r=t.connector_publish_result)||void 0===r?void 0:r.map(e=>(0,p.jsx)(ek,{result:e,onShowWebSdkGuide:n}))});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(g.Rg.Step,(0,y._)({},d)),l]})}function eT(e){var{record:t}=e;return(0,p.jsxs)(g.Rg,{type:"basic",direction:"vertical",size:"small",children:[(0,p.jsx)(ej,{record:t}),(0,p.jsx)(g.Rg.Step,(0,y._)({},function(e){var t=V.o.t("project_release_coze_audit");if("number"!=typeof e.publish_status)return eC(t);switch(e.publish_status){case O.Packing:case O.PackFailed:return eC(t);case O.Auditing:return{status:"process",icon:(0,p.jsx)(ex,{status:"process"}),title:(0,p.jsx)(ew,{title:t,tag:V.o.t("project_release_in_progress"),color:"brand"})};case O.AuditNotPass:return{status:"error",icon:(0,p.jsx)(ex,{status:"error"}),title:(0,p.jsx)(ew,{title:t,tag:V.o.t("project_release_not_pass"),color:"red"})};default:return{status:"finish",icon:(0,p.jsx)(ex,{status:"finish"}),title:(0,p.jsx)(ew,{title:t,tag:V.o.t("project_release_pass"),color:"green"})}}}(t))),(0,p.jsx)(eE,{record:t})]})}var eI=e=>{var{projectId:t,spaceId:n}=e,{publishRecordDetail:r}=j((0,m.N)(e=>({publishRecordDetail:e.publishRecordDetail}))),[o]=(0,$.V)(),{ready:a,inited:s}=(0,ee.N)({type:J.jH.Project,spaceId:n,intelligenceId:t,enable:o["bot.studio.publish_management"]&&!1});return(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:"my-[32px] p-[16px] flex flex-col items-center",children:[(0,p.jsx)(K.G70,{className:"text-[48px] coz-fg-dim"}),(0,p.jsx)("div",{className:"text-[16px] font-medium mt-[8px] leading-[22px]",children:V.o.t("project_release_already_released")}),(0,p.jsx)("div",{className:"text-[12px] coz-fg-dim leading-[16px]",children:V.o.t("project_release_already_released_desc")}),(o["bot.studio.publish_management"],null)]}),(0,p.jsx)("div",{className:"rounded-[12px] w-[480px] coz-stroke-primary coz-bg-max border border-solid px-[24px] pt-[16px] m-auto mb-[48px]",children:(0,p.jsx)(eT,{record:r})})]})};n("616405");var eP=n("988179"),eM=n("998600"),eR=()=>({[M.APIOrSDK]:(0,f.useRef)(null),[M.MiniProgram]:(0,f.useRef)(null),[M.SocialPlatform]:(0,f.useRef)(null),[M.Coze]:(0,f.useRef)(null),[M.CozeSpaceExtensionLibrary]:(0,f.useRef)(null)}),eD=e=>{var{containerScrollTop:t,connectorRefMap:n,connectorBarHeight:r,publishHeaderHeight:o}=e,a=Object.entries(n).map(e=>{var[,t]=e;return t.current}).filter(e=>!!e).map(e=>({offsetTop:e.offsetTop-t-o-r,target:e})).sort((e,t)=>e.offsetTop-t.offsetTop),s=a.filter(e=>e.offsetTop<=0),l=s.length?s.at(-1):a.at(0);return null==l?void 0:l.target},eA=()=>{var[e,t]=(0,f.useState)(),n=(0,f.useRef)(null),{getContainerRef:r}=Y(),o=eR(),{publishHeaderHeight:a}=Y(),[s,l]=(0,f.useState)({[M.APIOrSDK]:!1,[M.MiniProgram]:!1,[M.SocialPlatform]:!1,[M.Coze]:!1,[M.CozeSpaceExtensionLibrary]:!1}),c=(0,f.useRef)(!1),d=()=>{c.current=!0},u=()=>{c.current=!1},h=(0,eM.Z)(u,{wait:300}),p=(0,eM.Z)(u,{wait:300});(0,f.useEffect)(()=>{var e,s=null===(e=r())||void 0===e?void 0:e.current,l=n.current;if(!!s&&!!l){var d=()=>{if(!c.current)t(eD({containerScrollTop:s.scrollTop,connectorRefMap:o,connectorBarHeight:l.offsetHeight,publishHeaderHeight:a}))};d();var u=()=>{p.cancel(),h.run(),d()};return s.addEventListener("scroll",u),()=>{s.removeEventListener("scroll",u)}}},[r,o,a]);var m=e=>{l(t=>(0,_._)((0,y._)({},t),{[e]:!0}))};return{connectorRefMap:o,activeConnectorTarget:e,connectorBarRef:n,scrollToConnector:e=>{var s,l=n.current,c=null===(s=r())||void 0===s?void 0:s.current,u=o[e].current;if(!!l&&!!c&&!!u)c.scrollTo({behavior:"smooth",top:u.offsetTop-a-l.offsetHeight}),m(e),t(u),d(),p.run()},closeAnimation:e=>{l(t=>(0,_._)((0,y._)({},t),{[e]:!1}))},animationStateMap:s}},eN=n("378925"),eL=n("670324"),ez=eL.z.object({projectId:eL.z.string(),connectorIdBeforeRedirect:eL.z.string()}),eO=eL.z.record(ez),eB=new class e{constructor(){this.PUBLISH_ANCHOR_KEY="coz_project_publish_anchor",this.anchorValues={},this.load=()=>{try{var e=localStorage.getItem(this.PUBLISH_ANCHOR_KEY),t=(0,E.f5)(e),n=eO.parse(t);this.anchorValues=n}catch(e){this.anchorValues={}}},this.save=()=>{localStorage.setItem(this.PUBLISH_ANCHOR_KEY,JSON.stringify(this.anchorValues))},this.setAnchor=e=>{var{userId:t,projectId:n,connectorId:r}=e;this.anchorValues=(0,S.Uy)(this.anchorValues,e=>{e[t]={projectId:n,connectorIdBeforeRedirect:r}}),this.save()},this.getAnchor=e=>{var{userId:t,projectId:n}=e,r=this.anchorValues[t];if((null==r?void 0:r.projectId)===n)return r},this.removeAnchor=e=>{var{userId:t,projectId:n}=e;if(!!this.getAnchor({userId:t,projectId:n}))delete this.anchorValues[t],this.save()},this.clearAll=()=>{localStorage.removeItem(this.PUBLISH_ANCHOR_KEY),this.anchorValues={}},this.load()}},eW=()=>{var e,t=null===(e=(0,eN.Pc)())||void 0===e?void 0:e.user_id_str,n=(0,b.useParams)().project_id;return{setAnchor:e=>{if(!!t&&!!n)return eB.setAnchor({projectId:n,userId:t,connectorId:e})},getAnchor:()=>{if(!!t&&!!n)return eB.getAnchor({userId:t,projectId:n})},removeAnchor:()=>{if(!!t&&!!n)return eB.removeAnchor({userId:t,projectId:n})}}},eF=e=>{var{connectorGroupList:t,connectorRefMap:n}=e,{getAnchor:r,removeAnchor:o}=eW(),{getContainerRef:a}=Y();(0,f.useEffect)(()=>{var e,s,l,c=r();if(!c)return;var d=t.find(e=>e.connectors.some(e=>e.id===c.connectorIdBeforeRedirect));if(!!d){var u=n[d.type],{updateSelectedConnectorIds:h}=j.getState();h(e=>e.some(e=>e===c.connectorIdBeforeRedirect)?e:e.concat(c.connectorIdBeforeRedirect)),null===(l=a())||void 0===l||null===(s=l.current)||void 0===s||s.scrollTo({top:null===(e=u.current)||void 0===e?void 0:e.offsetTop,behavior:"smooth"}),o()}},[t,n])},eH=n("567282");function eU(e){var t=void 0!==e,{space_id:n="",project_id:r=""}=(0,b.useParams)(),{data:o,loading:a}=(0,U.Z)((0,I._)(function*(){var o;return null===(o=(yield D.OH.GetWorkFlowList({space_id:n,project_id:r,flow_mode:eH.wz.ChatFlow,page:1,size:100,checker:t?[e]:void 0})).data.workflow_list)||void 0===o?void 0:o.map(n=>{var r,o,a,s;return{label:n.name,value:n.workflow_id,disabled:!!t&&(null===(o=n.check_result)||void 0===o?void 0:null===(r=o.find(t=>t.type===e))||void 0===r?void 0:r.is_pass)!==!0,tooltip:null===(s=n.check_result)||void 0===s?void 0:null===(a=s.find(t=>t.type===e))||void 0===a?void 0:a.reason}})}));return{chatflowOptions:o,loading:a}}function eV(e){var{option:t,tooltip:n,children:r}=e,o=(0,p.jsxs)("div",{className:G()("coz-select-option-item p-[8px] gap-x-[8px] items-center",{"!cursor-not-allowed":t.disabled}),onClick:t.onClick,children:[(0,p.jsx)("div",{className:"w-[16px] h-[16px] shrink-0",children:t.selected?(0,p.jsx)(K.P03,{className:"coz-fg-hglt"}):null}),null!=r?r:(0,p.jsx)(g.ZT.Text,{className:"leading-[16px]",disabled:t.disabled,children:t.label})]});return n?(0,p.jsx)(g.u,{theme:"dark",position:"right",trigger:"hover",content:n,children:o}):o}var eK=e=>{var t,n,{className:r}=e,{connectorList:o,selectedConnectorIds:a,socialPlatformChatflow:s,setProjectPublishInfo:l}=j((0,m.N)(e=>({connectorList:e.connectorList,selectedConnectorIds:e.selectedConnectorIds,socialPlatformChatflow:e.socialPlatformChatflow,setProjectPublishInfo:e.setProjectPublishInfo}))),c=o.some(e=>a.includes(e.id)&&e.connector_classification===M.SocialPlatform),{chatflowOptions:d}=eU(eH.gf.SocialPublish),u=e=>{l({socialPlatformChatflow:{selected_workflows:[{workflow_id:e.value,workflow_name:e.label}]}})};return(0,p.jsx)("div",{className:G()("w-[50%] pr-[6px]",r),children:(0,p.jsx)(g.ih,{field:"social_platform_chatflow",noLabel:!0,label:V.o.t("project_release_chatflow2"),placeholder:V.o.t("project_release_chatflow_choose"),optionList:d,initValue:null==s?void 0:null===(n=s.selected_workflows)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.workflow_id,className:"w-full mb-[4px]",renderOptionItem:e=>(0,p.jsx)(eV,{option:e,tooltip:e.tooltip}),onSelect:(e,t)=>u(t),rules:[{required:c},{validator:(e,t)=>{if(!c)return!0;var n=null==d?void 0:d.find(e=>e.value===t);return n?!n.disabled||Error(n.tooltip):Error(V.o.t("project_release_chatflow3"))}}]})})},eq=n("960878"),eZ={};eZ.styleTagTransform=em(),eZ.setAttributes=eu(),eZ.insert=ec().bind(null,"head"),eZ.domAPI=es(),eZ.insertStyleElement=ep(),eo()(eq.Z,eZ);var eY=eq.Z&&eq.Z.locals?eq.Z.locals:void 0,eX=e=>{var{onClick:t,isActive:n,children:r,selectedConnectorCount:o}=e;return(0,p.jsxs)(g.zx,{onClick:t,color:n?"highlight":"secondary",className:"!px-8px !font-medium",children:[r,o>0?(0,p.jsx)(g.Ct,{countClassName:G()(!n&&"!coz-mg-plus !coz-fg-secondary","!font-medium"),className:"ml-4px",count:o,type:"alt"}):null]})},eQ=(0,f.forwardRef)((e,t)=>{var{className:n,style:r,children:o}=e;return(0,p.jsx)("div",{ref:t,className:G()("flex items-center gap-x-8px h-[80px] relative",eY.mask,n),style:r,children:o})}),eG=n("177001"),eJ=n("801210"),e$={};e$.styleTagTransform=em(),e$.setAttributes=eu(),e$.insert=ec().bind(null,"head"),e$.domAPI=es(),e$.insertStyleElement=ep(),eo()(eJ.Z,e$);var e0=eJ.Z&&eJ.Z.locals?eJ.Z.locals:void 0;function e1(e){var{label:t,tooltipContent:n,showTooltipInfo:r,isHighlight:o,type:a,onAnimationEnd:s}=e,l=a===M.APIOrSDK,c=(0,eG.CZ)({scene:eG.ej.API}),{node:d,open:u}=(0,eG.zv)({scene:eG.ej.API});return(0,p.jsxs)("div",{className:G()("mb-8px px-2px coz-fg-secondary flex items-center gap-x-4px",o&&e0.highlight),onAnimationEnd:s,children:[(0,p.jsx)("p",{className:"text-[14px] font-[500] leading-[20px]",children:t}),l&&!c?(0,p.jsxs)(g.T,{className:"text-[12px] ml-[8px]",spacing:2,children:[(0,p.jsx)(K.sWZ,{className:"coz-fg-hglt"}),V.o.t("coze_quota_exemption_notice",{link:(0,p.jsx)("div",{className:"coz-fg-hglt cursor-pointer",onClick:u,children:V.o.t("coze_upgrade_package")})})]}):null,r?(0,p.jsx)(g.u,{theme:"dark",trigger:"hover",content:n,children:(0,p.jsx)(K.L03,{className:"text-xxl"})}):null,d]})}var e2=n("484782"),e4=n("966140"),e6=e=>{var{category_id:t,display_screen:n}={category_id:"category_id",display_screen:"display_screen"};return!!e[t]&&!!e[n]},e5=n("808914"),e3=n("653894"),e8=n("61910"),e9=n("963246"),e7=n("904896"),te=(0,e8.Z)(function(e){return(0,e9.Z)((0,e3.Z)(e,1,e7.Z,!0))}),tt=n("311807"),tn=n("974235"),tr=e=>{var t,n,r,{record:o}=e,[a,s]=(0,f.useState)(!1),[l,c]=(0,f.useState)(""),[d,u]=(0,f.useState)([]),{space_id:h="",project_id:v=""}=(0,b.useParams)(),{connectorPublishConfig:w,setProjectPublishInfo:x,connectorList:S,selectedConnectorIds:k}=j((0,m.N)(e=>({connectorPublishConfig:e.connectorPublishConfig,setProjectPublishInfo:e.setProjectPublishInfo,connectorList:e.connectorList,selectedConnectorIds:e.selectedConnectorIds}))),C=(0,f.useRef)(null);var{loading:E,data:T,loadingMore:P}=(0,tn.Z)((t=(0,I._)(function*(e){var t,n,r,o,a,s=yield D.OH.GetWorkFlowList({space_id:h,project_id:v,flow_mode:eH.wz.All,checker:[eH.gf.MCPPublish],size:15,page:null!==(r=null==e?void 0:e.nextPageIndex)&&void 0!==r?r:1,name:l});return{list:null!==(o=null===(t=s.data)||void 0===t?void 0:t.workflow_list)&&void 0!==o?o:[],total:Number(null!==(a=null===(n=s.data)||void 0===n?void 0:n.total)&&void 0!==a?a:0),nextPageIndex:((null==e?void 0:e.nextPageIndex)||1)+1}}),function(e){return t.apply(this,arguments)}),{target:C,reloadDeps:[l],isNoMore:e=>!!(!(null==e?void 0:e.total)||(e.nextPageIndex-1)*15>=e.total)}),M=null==T?void 0:null===(n=T.list)||void 0===n?void 0:n.filter(e=>{var t;return null===(t=(0,e5.Z)(null==e?void 0:e.check_result,{type:eH.gf.MCPPublish}))||void 0===t?void 0:t.is_pass}),R=d.length>0&&d.length<((null==M?void 0:M.length)||0),A=d.length===((null==M?void 0:M.length)||0),N=()=>{s(!1)};return{open:()=>{s(!0);var e,t,n=null==w?void 0:null===(e=w[o.id])||void 0===e?void 0:e.selected_workflows;u(null!==(t=null==n?void 0:n.map(e=>{var t;return null!==(t=e.workflow_id)&&void 0!==t?t:""}))&&void 0!==t?t:[])},close:N,node:(0,p.jsxs)(g.u_,{title:V.o.t("app_publish_connector_space_mcp_config_dialog_title"),size:"large",visible:a,onCancel:N,okButtonProps:{loading:E,disabled:!d.length},okText:V.o.t("app_publish_connector_space_mcp_config_dialog_confirm"),cancelText:V.o.t("app_publish_connector_space_mcp_config_dialog_cancel"),onOk:()=>{x({connectorPublishConfig:(0,_._)((0,y._)({},w),{[o.id]:{selected_workflows:d.map(e=>{var t=(0,e5.Z)(null==T?void 0:T.list,{workflow_id:e});return{workflow_id:null==t?void 0:t.workflow_id,workflow_name:null==t?void 0:t.name}})}}),connectorList:S.map(e=>e.id===o.id?(0,_._)((0,y._)({},e),{config_status:L.Configured}):e),selectedConnectorIds:te(k,[o.id])}),N()},children:[(0,p.jsx)("div",{className:"text-[12px]",children:V.o.t("app_publish_connector_space_mcp_config_dialog_desc")}),(0,p.jsxs)(g.T,{className:"mb-[16px]",spacing:4,children:[(0,p.jsx)("div",{className:"text-[12px]",children:V.o.t("app_publish_connector_space_mcp_config_dialog_desc2")}),(0,p.jsx)(g.u,{position:"top",content:(0,p.jsx)("div",{className:"whitespace-pre-line",children:V.o.t("app_publish_connector_space_mcp_config_dialog_hover_wf_constraints")}),children:(0,p.jsx)(K.L03,{className:"text-[14px]"})})]}),(0,p.jsxs)("div",{className:"font-[500] mb-[12px]",children:[V.o.t("app_publish_connector_space_mcp_config_dialog_choose_wf"),(0,p.jsx)("span",{className:"coz-fg-hglt-red",children:"*"})]}),(0,p.jsxs)("div",{className:"border border-solid coz-stroke-primary rounded py-[12px]",children:[(0,p.jsx)("div",{className:"mx-[12px]",children:(0,p.jsx)(g.ol,{className:"!w-full",placeholder:V.o.t("app_publish_connector_space_mcp_config_dialog_search_placeholder"),value:l,onSearch:(0,tt.Z)(e=>{c(e)},500)})}),(0,p.jsx)(g.iz,{className:"my-[8px]"}),(0,p.jsxs)("div",{className:"mx-[12px]",children:[(null==T?void 0:T.list.length)?(0,p.jsx)(g.XZ,{className:"my-[8px] px-[4px]",indeterminate:R,checked:A,onChange:e=>{u(e.target.checked&&(null==M?void 0:M.map(e=>e.workflow_id||""))||[])},children:V.o.t("app_publish_connector_space_mcp_config_dialog_filter_all")}):null,(0,p.jsxs)("div",{ref:C,className:"max-h-[300px] overflow-x-hidden overflow-y-auto",children:[(0,p.jsx)(g.XZ.Group,{className:"gap-[4px]",value:d,onChange:u,children:null==T?void 0:null===(r=T.list)||void 0===r?void 0:r.map(e=>{var t=(0,e5.Z)(null==e?void 0:e.check_result,{type:eH.gf.MCPPublish});return(0,p.jsx)(g.XZ,{className:"p-[4px]",value:e.workflow_id,disabled:!(null==t?void 0:t.is_pass),children:(null==t?void 0:t.is_pass)?e.name:(0,p.jsx)(g.u,{position:"top",content:null==t?void 0:t.reason,children:e.name})},e.workflow_id)})}),P&&(null==T?void 0:T.list.length)?(0,p.jsx)("div",{className:"text-center",children:(0,p.jsx)(g.yC,{size:"small"})}):null,(null==T?void 0:T.list.length)?null:(0,p.jsx)(g.ub,{className:"my-[80px] mx-auto",icon:(0,p.jsx)(K.nL$,{}),title:V.o.t("app_publish_connector_space_mcp_config_dialog_no_results_found")})]})]})]})]})}},ti=e=>{var{record:t}=e,{node:n,open:r}=tr({record:t});return(0,p.jsxs)("div",{className:"basis-full self-end",onClick:e=>{e.stopPropagation()},children:[(0,p.jsx)(g.zx,{color:"primary",size:"small",onClick:()=>{r()},children:t.config_status===L.Configured?V.o.t("enterprise_sso_seetings_page_desc_button1"):V.o.t("bot_publish_action_configure")}),n]})},to=n("44172"),ta=e=>{var t,n,r,{record:o}=e,{connectorUnionMap:a,unions:s,setProjectPublishInfo:l}=j((0,m.N)(e=>({connectorUnionMap:e.connectorUnionMap,unions:e.unions,setProjectPublishInfo:e.setProjectPublishInfo}))),c=null!==(n=o.connector_union_id)&&void 0!==n?n:"",d=(null!==(r=null===(t=a[c])||void 0===t?void 0:t.connector_options)&&void 0!==r?r:[]).map(e=>({label:e.show_name,value:e.connector_id})),u=e=>{l({unions:(0,_._)((0,y._)({},s),{[c]:e})})};return(0,p.jsx)("div",{className:"flex",onClick:e=>e.stopPropagation(),children:(0,p.jsx)(g.ih,{noLabel:!0,field:"union_select_".concat(c),fieldClassName:"w-[172px]",className:"w-full",optionList:d,initValue:s[c],arrowIcon:(0,p.jsx)(to.Wdl,{}),onSelect:e=>u(e)})})},ts=n("243238"),tl=n("601477");function tc(e){var t,n,r,{checked:o,record:a,onClick:s}=e,{connectorPublishConfig:l,setProjectPublishInfo:c}=j((0,m.N)(e=>({connectorPublishConfig:e.connectorPublishConfig,setProjectPublishInfo:e.setProjectPublishInfo}))),d=null==l?void 0:null===(r=l[a.id])||void 0===r?void 0:null===(n=r.selected_workflows)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.workflow_id,{chatflowOptions:u}=eU(),h=e=>{c({connectorPublishConfig:(0,_._)((0,y._)({},l),{[a.id]:{selected_workflows:[{workflow_id:e.value,workflow_name:e.label}]}})})},f=()=>{j.getState().setProjectPublishInfoByImmer(e=>{var t=e[a.id];if(!!(null==t?void 0:t.selected_workflows))delete t.selected_workflows})};return(0,p.jsx)("div",{className:G()("flex mt-auto"),onClick:s,children:(0,p.jsx)(g.ih,{field:"sdk_chatflow",noLabel:!0,showClear:!0,noErrorMessage:!0,fieldClassName:"w-[172px]",className:"w-full",placeholder:V.o.t("project_release_Please_select"),initValue:d,optionList:u,renderOptionItem:e=>(0,p.jsx)(eV,{option:e,tooltip:e.tooltip}),onChange:e=>{if(void 0===e)f()},onSelect:(e,t)=>h(t),rules:[{required:o,message:V.o.t("project_release_Please_select")},{validator:(e,t)=>{if(!o)return!0;var n=null==u?void 0:u.find(e=>e.value===t);return n?!n.disabled||Error(n.tooltip):Error(V.o.t("project_release_chatflow3"))}}]})})}var td=n("117140");function tu(e){var t={disabled:!1===e.available,tooltip:e.unavailable_reason};return e.ui_channel===td.T9.Web.toString()?(0,y._)({value:"web",label:V.o.t("builder_canvas_tools_pc")},t):(0,y._)({value:"mobile",label:V.o.t("builder_canvas_tools_phone")},t)}function th(e){var t,n,r,o;return{title:e.name,cover_uri:null!==(r=null===(n=e.covers)||void 0===n?void 0:null===(t=n[0].response)||void 0===t?void 0:t.uri)&&void 0!==r?r:"",description:e.description,readme:e.readme,display_screen:e.preview_type,category_id:null!==(o=e.category)&&void 0!==o?o:""}}var tp=n("178626"),tf=n("902845");var tm=(u=(0,I._)(function*(e){var{fileInstance:t,onProgress:n,onSuccess:r,onError:o}=e;try{if(!t)throw Error("no file to upload");var a,s=yield D.yF.PublicUploadImage({data:yield(a=t,new Promise((e,t)=>{var n=new FileReader;n.onload=n=>{var r,o=null===(r=n.target)||void 0===r?void 0:r.result;"string"==typeof o?e(o.slice(o.indexOf(",")+1)):t(Error("readAsDataURL failed"))},n.readAsDataURL(a)}))},{onUploadProgress:e=>{var r;return n({total:null!==(r=e.total)&&void 0!==r?r:t.size,loaded:e.loaded})}});r(s.data)}catch(e){o(e instanceof tf.d7?e.request:{})}}),function(e){return u.apply(this,arguments)});var tv=(h=(0,I._)(function*(e){var{fileInstance:t,onProgress:n,onSuccess:r,onError:o}=e;try{if(!t)throw Error("no file to upload");var a,s=yield(0,E.fr)({biz:"store",file:t,fileType:"image",getUploadAuthToken:(0,I._)(function*(){var{data:e}=yield D.yF.PublicGetImageUploadToken();return{data:{service_id:(null==e?void 0:e.service_id)||"",upload_host:(null==e?void 0:e.upload_host)||"",auth:{current_time:(null==e?void 0:e.current_time)||"",expired_time:(null==e?void 0:e.expired_time)||"",session_token:(null==e?void 0:e.session_token)||"",access_key_id:(null==e?void 0:e.access_key_id)||"",secret_access_key:(null==e?void 0:e.secret_access_key)||""}}}}),getProgress:e=>{n({total:t.size,loaded:e})}}),l=yield D.yF.PublicGetImageURL({uri:s});r({uri:s,url:null===(a=l.data)||void 0===a?void 0:a.url})}catch(e){o(e instanceof tf.d7?e.request:{})}}),function(e){return h.apply(this,arguments)});function tg(e){var{data:t,loading:n}=(0,U.Z)((0,I._)(function*(){var t,n;return null===(n=(yield D.yF.PublicGetProductCategoryList({need_empty_category:!0,entity_type:e})).data)||void 0===n?void 0:null===(t=n.categories)||void 0===t?void 0:t.map(e=>({label:e.name,value:e.id}))}));return{categoryOptions:t,loading:n}}var tb=n("824113");function ty(e){var{userInfo:t,cover:n,name:r,description:o}=e,a=(null==t?void 0:t.user_label)?{name:t.user_label.label_name,icon:t.user_label.icon_url,href:t.user_label.jump_link}:void 0;return(0,p.jsxs)("div",{className:"flex flex-col overflow-hidden p-[12px] pb-[16px] rounded-[16px] border border-solid coz-stroke-primary coz-bg-max coz-shadow-small",children:[(0,p.jsx)("div",{className:"relative w-full h-[140px] rounded-[8px] overflow-hidden",children:(0,p.jsx)(g.Ee,{preview:!1,src:n,className:"w-full h-full",imgCls:"w-full h-full object-cover object-center",placeholder:(0,p.jsx)(K.Q2$,{className:"w-[32px] h-[32px]"})})}),(0,p.jsxs)("div",{className:"mt-[8px] px-[4px] grow flex flex-col",children:[(0,p.jsx)("div",{className:"flex items-center gap-[8px] overflow-hidden",children:(0,p.jsx)(g.ZT.Text,{className:"!font-medium text-[16px] leading-[22px] coz-fg-primary !max-w-[180px]",ellipsis:{showTooltip:!0,rows:1},children:null!=r?r:V.o.t("project_release_template_info_name")})}),(0,p.jsx)(tb.gj,{className:"mt-[4px]",avatar:null==t?void 0:t.avatar_url,name:null==t?void 0:t.name,username:null==t?void 0:t.user_name,label:a}),(0,p.jsx)("div",{className:"mt-[8px] flex flex-col justify-between grow",children:(0,p.jsx)(g.ZT.Text,{className:"min-h-[44px] leading-[20px] coz-fg-secondary",ellipsis:{showTooltip:!0,rows:2},children:null!=o?o:V.o.t("project_release_template_info_desc")})})]})]})}var t_=n("903979"),tw={};tw.styleTagTransform=em(),tw.setAttributes=eu(),tw.insert=ec().bind(null,"head"),tw.domAPI=es(),tw.insertStyleElement=ep(),eo()(t_.Z,tw);var tx=t_.Z&&t_.Z.locals?t_.Z.locals:void 0;function tS(e){return[{required:!0,message:V.o.t("project_release_template_info_not",{template_info_type:V.o.t(e)})}]}var tk=(0,f.forwardRef)((e,t)=>{var n,r,o,a,{record:s,userInfo:l}=e,[c]=(0,$.V)(),d=c["bot.studio.project_publish_imagex"]?tv:tm,u=null!==(a=null===(n=s.UIOptions)||void 0===n?void 0:n.map(tu))&&void 0!==a?a:[],h=(0,f.useRef)(null),[m,v]=(0,f.useState)({}),b=(0,f.useRef)(),{categoryOptions:_}=tg(td._J.TemplateCommon);(0,f.useImperativeHandle)(t,()=>({fillInitialValues:e=>{var t,n,r=null===(t=h.current)||void 0===t?void 0:t.formApi;if(!!r){r.setValues(e,{isOverride:!0});var o=(0,E.f5)(e.readme);o&&(null===(n=b.current)||void 0===n||n.setContent(new tp.DeltaSet((0,tp.normalizeSchema)(o)))),Object.keys(e).forEach(e=>r.setError(e,null))}},validate:()=>{var e,t;return null===(t=h.current)||void 0===t?void 0:null===(e=t.formApi)||void 0===e?void 0:e.validate()}}));var w=V.o.language.startsWith("zh");return(0,p.jsxs)(g.l0,{ref:h,className:G()("flex gap-[24px]",tx["template-form"]),onValueChange:e=>v((0,y._)({},e)),children:[(0,p.jsxs)("div",{className:"w-[320px] absolute flex flex-col h-full justify-center",children:[(0,p.jsx)(ty,{userInfo:l,cover:null==m?void 0:null===(o=m.covers)||void 0===o?void 0:null===(r=o[0])||void 0===r?void 0:r.url,name:null==m?void 0:m.name,description:null==m?void 0:m.description}),(0,p.jsx)(g.l0.Checkbox,{field:"agreement",noLabel:!0,className:"mt-[16px]",rules:[{validator:(e,t)=>!0===t,message:V.o.t("template_buy_paid_agreement_toast")}],children:(0,p.jsxs)(g.ZT.Text,{children:[V.o.t("template_buy_paid_agreement_action"),(0,p.jsx)(g.ZT.Text,{className:"ml-[4px]",link:{href:"/docs/guides/terms_of_template",target:"_blank"},children:V.o.t("template_buy_paid_agreement_detail")})]})})]}),(0,p.jsx)("div",{className:"w-[320px] shrink-0"}),(0,p.jsxs)("div",{className:"grow",children:[(0,p.jsx)(g.yt,{field:"name",label:V.o.t("project_release_template_info_name"),maxLength:w?10:30,rules:tS("project_release_template_info_name")}),(0,p.jsx)(g.l0.Upload,{field:"covers",label:V.o.t("project_release_template_info_poster"),listType:"picture",accept:".jpeg,.jpg,.png,.webp",limit:1,maxSize:5120,action:"",customRequest:d,picWidth:80,picHeight:80,rules:[...tS("project_release_template_info_poster"),{validator:(e,t)=>(null==t?void 0:t.every(e=>!e._sizeInvalid&&"success"===e.status))===!0,message:""}],children:(0,p.jsx)(K.PwN,{className:"w-[24px] h-[24px] coz-fg-primary"})}),(0,p.jsx)(g.yt,{field:"description",label:V.o.t("project_release_template_info_desc"),maxLength:w?100:300,rules:tS("project_release_template_info_desc")}),(0,p.jsx)(f.Suspense,{fallback:null,children:(0,p.jsx)(tp.LazyEditorFullInput,{field:"readme_text",label:V.o.t("project_release_template_info_info"),className:G()("h-[132px]",tx["editor-container"]),maxCount:w?1e3:3e3,getEditor:e=>{b.current=e,e.on(tp.EditorEventType.CONTENT_CHANGE,t=>{var n,r;null===(r=h.current)||void 0===r||null===(n=r.formApi)||void 0===n||n.setValue("readme",JSON.stringify(e.getContent().deltas))})},rules:tS("project_release_template_info_info")})}),(0,p.jsx)(g.ih,{field:"preview_type",label:V.o.t("project_release_template_info_display"),optionList:u,renderOptionItem:e=>(0,p.jsx)(eV,{option:e,tooltip:e.tooltip}),fieldClassName:"w-full",className:"w-full",rules:tS("project_release_template_info_display")}),(0,p.jsx)(g.ih,{field:"category",label:V.o.t("project_release_template_info_category"),optionList:_,fieldClassName:"w-full",className:"w-full",rules:tS("project_release_template_info_category")})]})]})});function tC(e){var t,n,{record:r,onClick:o}=e,[a,s]=(0,f.useState)(!1),[l,c]=(0,f.useState)(),d=(0,f.useRef)(null),[u,h]=(0,f.useState)(),{connectors:v,setProjectPublishInfo:w}=j((0,m.N)(e=>({connectors:e.connectors,setProjectPublishInfo:e.setProjectPublishInfo}))),{project_id:x=""}=(0,b.useParams)();var S=(t=(0,I._)(function*(){var e=yield D.yF.PublicGetProductEntityInfo({entity_id:x,entity_type:td._J.ProjectTemplate});if(null===(m=e.data.meta_info)||void 0===m?void 0:m.name){var t,n,o,a,s,l,d,u,p,f,m,g,b,S=(t=e.data,n=null===(b=r.UIOptions)||void 0===b?void 0:b.find(e=>e.available),d=V.o.language.startsWith("zh"),f={agreement:(u=null!==(l=t.meta_info)&&void 0!==l?l:{}).status!==td.Pt.NeverListed||""!==u.readme,name:u.name,covers:null===(o=u.covers)||void 0===o?void 0:o.map(e=>({url:e.url,response:e,status:"success",_sizeInvalid:!1})),description:null===(a=u.description)||void 0===a?void 0:a.substring(0,d?100:300),readme:u.readme||((p=u.description)?'{"0":{"ops":[{"insert":"'.concat(p,'\\n"}],"zoneId":"0","zoneType":"Z"}}'):""),category:null===(s=u.category)||void 0===s?void 0:s.id},n&&(f.preview_type=tu(n).value),f);h(S),w({templateConfigured:!0===S.agreement,connectors:(0,_._)((0,y._)({},v),{[r.id]:th(S)})})}(null===(g=e.data.meta_info)||void 0===g?void 0:g.user_info)&&c(e.data.meta_info.user_info)}),function(){return t.apply(this,arguments)});(0,f.useEffect)(()=>{S()},[]);var k=()=>{s(!1)};var C=(n=(0,I._)(function*(){var e,t=yield null===(e=d.current)||void 0===e?void 0:e.validate();if(!!t)h(t),w({templateConfigured:!0,connectors:(0,_._)((0,y._)({},v),{[r.id]:th(t)})}),k()}),function(){return n.apply(this,arguments)});return(0,p.jsxs)("div",{className:G()("h-full flex items-end",{hidden:!r.allow_publish}),onClick:o,children:[(0,p.jsx)(g.zx,{size:"small",color:"primary",onClick:()=>{var e;null===(e=d.current)||void 0===e||e.fillInitialValues(null!=u?u:{}),s(!0)},children:V.o.t("project_release_template_info")}),(0,p.jsx)(g.u_,{title:V.o.t("project_release_template_info"),width:800,visible:a,closable:!0,onCancel:k,onOk:C,okText:V.o.t("prompt_submit"),lazyRender:!1,keepDOM:!0,children:(0,p.jsx)(tk,{ref:d,record:r,userInfo:l})})]})}var tj=e=>{var t,{checked:n,record:r,onClick:o}=e,{bind_info:a,id:s="",UIOptions:l}=r,c=null!==(t=null==l?void 0:l.map(tu))&&void 0!==t?t:[],d=null==a?void 0:a.display_screen,{connectors:u,setProjectPublishInfo:h}=j((0,m.N)(e=>({connectors:e.connectors,setProjectPublishInfo:e.setProjectPublishInfo}))),{categoryOptions:f}=tg(td._J.Bot),v=(e,t)=>{h({connectors:(0,_._)((0,y._)({},u),{[s]:(0,_._)((0,y._)({},a,u[s]),{[e]:t})})})};return(0,p.jsxs)("div",{className:G()("flex w-full gap-[6px] mt-auto"),onClick:o,children:[(0,p.jsx)(g.ih,{noLabel:!0,field:"store_display_screen",insetLabel:V.o.t("project_release_display_label"),fieldClassName:"w-[50%]",className:"w-full",initValue:d,optionList:c,renderOptionItem:e=>(0,p.jsx)(eV,{option:e,tooltip:e.tooltip}),rules:[{required:n}],onSelect:e=>v("display_screen",e)}),(0,p.jsx)(g.ih,{noLabel:!0,field:"store_category_id",insetLabel:V.o.t("mkpl_bots_category"),fieldClassName:"w-[50%]",className:"w-full",placeholder:V.o.t("select_category"),initValue:null==a?void 0:a.category_id,optionList:f,rules:[{required:n,message:V.o.t("select_category")}],onSelect:e=>v("category_id",e)})]})};function tE(e){var t,n,{record:r,checked:o,authActionWrapperClassName:a}=e,{setProjectPublishInfo:s,connectorList:l,selectedConnectorIds:c}=j((0,m.N)(e=>({setProjectPublishInfo:e.setProjectPublishInfo,connectorList:e.connectorList,selectedConnectorIds:e.selectedConnectorIds}))),{setAnchor:d}=eW(),u=e=>{e.stopPropagation()};switch(r.bind_type){case P.KvBind:case P.KvAuthBind:return(0,p.jsx)("div",{className:G()("basis-full self-end",a),children:(0,p.jsx)("div",{className:"inline-flex",onClick:u,children:(0,p.jsx)(ts.S,{record:r,bindSuccessCallback:e=>{if(e){var t=!e.bind_id,n=(0,_._)((0,y._)({},e),{config_status:t?L.NotConfigured:L.Configured,connector_status:t?R.Normal:e.connector_status});s({connectorList:l.map(t=>t.id===e.id?n:t)})}},origin:"project"})})});case P.AuthBind:return(0,p.jsx)("div",{className:G()("basis-full self-end",a),children:(0,p.jsx)("div",{className:"inline-flex",onClick:u,children:(0,p.jsx)(tl.S,{origin:"publish",id:r.id,agentType:"project",channelName:r.name,status:null!==(t=r.config_status)&&void 0!==t?t:L.NotConfigured,onBeforeAuthRedirect:e=>{var{id:t}=e;d(t)},revokeSuccess:()=>{s({connectorList:l.map(e=>e.id===r.id?(0,_._)((0,y._)({},e),{config_status:L.NotConfigured}):e),selectedConnectorIds:c.filter(e=>e!==r.id)})},authInfo:null!==(n=null==r?void 0:r.auth_login_info)&&void 0!==n?n:{},isV2:!0,v2ButtonProps:{color:"primary",size:"small"}})})});case P.WebSDKBind:return(0,p.jsx)(tc,{checked:o,record:r,onClick:u});case P.StoreBind:return(0,p.jsx)(tj,{checked:o,record:r,onClick:u});case P.TemplateBind:if(r.id===k)return(0,p.jsx)(tC,{record:r,onClick:u});return null;default:return null}}var tT=e=>{var{bind_type:t}=e;return t===P.KvBind||t===P.KvAuthBind||t===P.TemplateBind?tI(e):tP(e)},tI=e=>{var{config_status:t=L.Configured}=e,n=t===L.Configured;return{text:({[L.Configured]:V.o.t("bot_publish_columns_status_configured"),[L.NotConfigured]:V.o.t("bot_publish_columns_status_not_configured"),[L.Configuring]:"",[L.Disconnected]:"",[L.NeedReconfiguring]:""})[t],color:n?"green":"primary"}},tP=e=>{var{config_status:t=L.Configured}=e,n=t===L.Configured;return{text:({[L.Configured]:V.o.t("bot_publish_columns_status_authorized"),[L.NotConfigured]:V.o.t("bot_publish_columns_status_unauthorized"),[L.Configuring]:V.o.t("publish_douyin_config_ing"),[L.Disconnected]:"",[L.NeedReconfiguring]:""})[t],color:n?"green":"primary"}},tM=e=>{var{showText:t,tip:n,tagProps:r}=e;return(0,p.jsx)(g.u,{content:n,children:t?(0,p.jsxs)(g.Vp,(0,_._)((0,y._)({color:"yellow"},r),{size:"mini",className:"font-[500]",children:[t,(0,p.jsx)(K.L03,{})]})):(0,p.jsx)(K.L03,{})})},tR=[M.SocialPlatform,M.MiniProgram,M.CozeSpaceExtensionLibrary],tD=e=>{var{record:t}=e;if(!tR.includes(t.connector_classification)||t.bind_type===P.NoBindRequired)return null;var{text:n,color:r}=tT(t);return(0,p.jsxs)("div",{className:"flex gap-[6px]",children:[(0,p.jsx)(g.Vp,{color:r,size:"mini",className:"font-[500]",children:n}),(null==t?void 0:t.connector_status)===R.Normal?null:(0,p.jsx)(tM,{showText:(null==t?void 0:t.connector_status)===R.InReview?V.o.t("bot_publish_columns_status_in_review"):V.o.t("bot_publish_columns_status_offline"),tip:(null==t?void 0:t.connector_status)===R.InReview?V.o.t("bot_publish_in_review_notice"):V.o.t("bot_publish_offline_notice_no_certain_time",{platform:null==t?void 0:t.name})})]})},tA=e=>{var{bindId:t,checked:n,connectorId:r,className:o,onClick:a}=e,{space_id:s="",project_id:l=""}=(0,b.useParams)(),{setProjectPublishInfo:c,selectedConnectorIds:d,connectorList:u}=j((0,m.N)(e=>({selectedConnectorIds:e.selectedConnectorIds,setProjectPublishInfo:e.setProjectPublishInfo,connectorList:e.connectorList})));return t&&n?(0,p.jsx)(g.zx,{onClick:e=>{a(e),g.u_.confirm({title:V.o.t("project_release_cancel1"),content:V.o.t("project_release_cancel1_desc"),okText:V.o.t("project_release_cancel"),okButtonColor:"red",cancelText:V.o.t("Cancel"),onOk:(0,I._)(function*(){yield D.nA.UnBindConnector({bind_id:t,agent_type:1,space_id:s,bot_id:l,connector_id:r}),c({selectedConnectorIds:d.filter(e=>e!==r),connectorList:u.map(e=>e.id===r?(0,_._)((0,y._)({},e),{bind_id:""}):e)})})})},size:"small",color:"primary",className:G()("w-max",o),children:V.o.t("project_release_cancel")}):null};function tN(e){var t,n,r,{connectorInfo:o,checked:a,onCheckedChange:s,onShowWebSdkGuide:l}=e,{id:c,name:d,description:u,bind_id:h=""}=o,{templateConfigured:v,socialPlatformChatflow:b,connectorPublishConfig:w,connectors:x}=j((0,m.N)(e=>({templateConfigured:e.templateConfigured,socialPlatformChatflow:e.socialPlatformChatflow,connectorPublishConfig:e.connectorPublishConfig,connectors:e.connectors}))),S=(0,f.useRef)(null),C=(0,e4.Z)(S.current),T=function(e){var t,n,r,{connector:o,socialPlatformConfig:a,templateConfigured:s,connectorPublishConfig:l,connectorConfigMap:c}=e;if(o.connector_classification===M.SocialPlatform&&!(null==a?void 0:null===(n=a.selected_workflows)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.workflow_id))return{reason:0,text:V.o.t("project_release_chatflow4")};var d={reason:1,text:V.o.t("project_release_set_desc")};if(B(o))return d;if(!o.allow_publish&&o.not_allow_publish_reason)return{reason:2,text:o.not_allow_publish_reason};if(o.id===k&&!s)return{reason:3,text:V.o.t("project_release_template_info")};var u=o.connector_classification===M.APIOrSDK&&o.bind_type===P.WebSDKBind,h=!!(null===(r=l[o.id])||void 0===r?void 0:r.selected_workflows);if(u&&!h)return d;var p=o.connector_classification===M.Coze&&o.bind_type===P.StoreBind,f=c[o.id];if(p&&(!f||!e6(f)))return d}({connector:o,socialPlatformConfig:b,templateConfigured:v,connectorPublishConfig:w,connectorConfigMap:x}),I=(null==T?void 0:T.reason)===0,R=null!==(r=(0,E.f5)(o.description_extra))&&void 0!==r?r:{};(0,f.useEffect)(()=>{a&&T&&s(!1)},[a,T]);var D=(0,p.jsx)(g.XZ,{checked:a,onChange:()=>{!T&&s(!a)},"data-testid":"project.publish.select.connector",disabled:!!T}),A=e=>{e.stopPropagation()};var N=(t=[P.KvBind,P.KvAuthBind,P.AuthBind].includes(o.bind_type),n=o.config_status===L.Configured,!t||!n||n&&C),z=(0,p.jsxs)("div",{ref:S,className:G()("w-full min-h-[132px] rounded-[8px] coz-stroke-primary border border-solid coz-mg-card p-[12px] flex",I||T?"cursor-not-allowed":"cursor-pointer",C&&"coz-shadow-default"),onClick:()=>{!T&&s(!a)},children:[(0,p.jsxs)("div",{className:G()("h-full w-full flex flex-col",{"opacity-30 pointer-events-none":I}),children:[(0,p.jsxs)("div",{className:"flex gap-[6px] items-center font-medium",children:[(0,p.jsx)("img",{src:o.icon_url,className:"w-[24px] h-[24px] rounded-[6px] coz-stroke-primary border-[0.5px] border-solid border-solid"}),R.text?(0,p.jsx)(g.u,{theme:"dark",style:{minWidth:"240px",textAlign:"center"},content:(0,p.jsx)(e2.D,{skipHtml:!0,linkTarget:"_blank",components:{img:e=>(0,p.jsx)("img",(0,_._)((0,y._)({},e),{className:"max-w-[224px] max-h-[208px]"}))},children:R.text}),children:(0,p.jsx)("div",{className:"coz-fg-primary cursor-default",children:d})}):(0,p.jsx)("div",{className:"coz-fg-primary cursor-default",children:d}),(0,p.jsx)(tD,{record:o})]}),(0,p.jsx)("div",{className:"mt-[4px] mb-[8px]",children:u?(0,p.jsx)(e2.D,{skipHtml:!0,transformLinkUri:!1,components:{p:e=>(0,p.jsx)(g.ZT.Paragraph,{type:"secondary",fontSize:"12px",children:e.children}),a:e=>{var t="coze://web-sdk-guide"===e.href?{link:!0,onClick:e=>{A(e),l()}}:{link:{href:e.href,target:"_blank",onClick:A}};return(0,p.jsx)(g.ZT.Text,(0,_._)((0,y._)({fontSize:"12px"},t),{children:e.children}))}},children:u}):null}),(0,p.jsxs)("div",{className:"flex flex-wrap grow gap-[6px]",children:[o.connector_union_id?(0,p.jsx)(ta,{record:o}):null,(0,p.jsx)(tE,{record:o,checked:a,authActionWrapperClassName:G()(!N&&"hidden")}),o.connector_classification===M.APIOrSDK?(0,p.jsx)(tA,{bindId:h,checked:a,connectorId:c,className:G()(!N&&"hidden","mt-auto"),onClick:A}):null,o.connector_classification===M.CozeSpaceExtensionLibrary&&o.bind_type===P.TemplateBind&&(0,p.jsx)(ti,{record:o})]})]}),(0,p.jsx)("div",{children:T&&!I?(0,p.jsx)(g.u,{theme:"dark",content:T.text,children:D}):D})]});return(0,p.jsx)(g.u,{theme:"dark",visible:I&&C,content:null==T?void 0:T.text,trigger:"custom",children:z})}var tL=n("788504"),tz={};tz.styleTagTransform=em(),tz.setAttributes=eu(),tz.insert=ec().bind(null,"head"),tz.domAPI=es(),tz.insertStyleElement=ep(),eo()(tL.Z,tz);var tO=tL.Z&&tL.Z.locals?tL.Z.locals:void 0,tB=e=>e.filter(e=>e.privacy_policy||e.user_agreement).map(e=>({name:e.name,icon:e.icon_url,privacy_policy:e.privacy_policy,user_agreement:e.user_agreement}));function tW(){var{project_id:e=""}=(0,b.useParams)(),{connectorList:t,connectorUnionMap:n,monetizeConfig:r,selectedConnectorIds:o,connectorPublishConfig:a,unions:s,updateSelectedConnectorIds:l}=j((0,m.N)(e=>({connectorList:e.connectorList,connectorUnionMap:e.connectorUnionMap,monetizeConfig:e.monetizeConfig,selectedConnectorIds:e.selectedConnectorIds,connectorPublishConfig:e.connectorPublishConfig,unions:e.unions,updateSelectedConnectorIds:e.updateSelectedConnectorIds}))),c=(0,f.useMemo)(()=>tB(t),[t]),d=(0,f.useMemo)(()=>(function(e,t,n){var r=function(r){var a=o.find(e=>e.type===r.connector_classification);if(!a)return"continue";if(r.connector_union_id){var s=r.connector_union_id;if(a.connectors.some(e=>e.connector_union_id===s))return"continue";var l=r,c=e.find(e=>e.id===n[s]);if(c)l=c;else{var d=t[s].connector_options[0].connector_id,u=e.find(e=>e.id===d);u&&(l=u)}var h=t[s];a.connectors.push((0,_._)((0,y._)({},l),{name:h.name,description:h.description,icon_url:h.icon_url}))}else a.connectors.push(r)},o=[{type:M.APIOrSDK,label:V.o.t("project_release_api1"),desc:V.o.t("project_release_api_sdk_desc"),connectors:[]},{type:M.MiniProgram,label:V.o.t("project_release_miniprogram1"),desc:V.o.t("project_release_h5_desc"),connectors:[]},{type:M.SocialPlatform,label:V.o.t("project_release_social1"),desc:V.o.t("project_release_social_desc1"),connectors:[]},{type:M.Coze,label:V.o.t("project_release_coze1"),desc:V.o.t("project_release_ts_desc"),connectors:[]},{type:M.CozeSpaceExtensionLibrary,label:V.o.t("app_publish_connector_mcp"),desc:V.o.t("app_publish_connector_mcp"),connectors:[]}];for(var a of e)r(a);return o})(t,n,s).filter(e=>e.connectors.length>0),[t,n,s]),{publishHeaderHeight:u}=Y(),{connectorRefMap:h,activeConnectorTarget:v,connectorBarRef:w,scrollToConnector:x,closeAnimation:S,animationStateMap:k}=eA();eF({connectorGroupList:d,connectorRefMap:h});var C=e=>{var t;return o.includes(null!==(t=e.connector_union_id)&&void 0!==t?t:e.id)},E=(e,t)=>{var n,r=null!==(n=e.connector_union_id)&&void 0!==n?n:e.id;t?l(e=>e.concat(r)):l(e=>e.filter(e=>e!==r))},T=e=>{var t=d.find(t=>t.type===e);return t?t.connectors.filter(e=>{var t;return o.includes(null!==(t=e.connector_union_id)&&void 0!==t?t:e.id)}):[]},{node:I,show:P}=e_(),R=()=>{var n,r,o,s,l,c=t.find(e=>"999"===e.id),d=a["999"];P({projectId:e,workflowId:null!==(s=null==d?void 0:null===(r=d.selected_workflows)||void 0===r?void 0:null===(n=r[0])||void 0===n?void 0:n.workflow_id)&&void 0!==s?s:"",version:null!==(l=null==c?void 0:null===(o=c.bind_info)||void 0===o?void 0:o.sdk_version)&&void 0!==l?l:""})};return(0,p.jsxs)("div",{className:"flex flex-col mt-[24px] w-full coz-bg-plus rounded-md p-24px",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between",children:[(0,p.jsx)(g.l0.Label,{required:!0,className:"text-20px font-medium leading-[24px]",children:V.o.t("bot_publish_select_title")}),null]}),c.length?(0,p.jsx)(eP.B5,{scene:"project",termServiceData:c,className:"mt-8px py-0 coz-fg-secondary"}):null,(0,p.jsx)(eQ,{className:"sticky",ref:w,style:{top:u,zIndex:1},children:d.map(e=>(0,p.jsx)(eX,{selectedConnectorCount:T(e.type).length,isActive:v===h[e.type].current,onClick:()=>x(e.type),children:e.label},e.type))}),d.map((e,t)=>{var n=e.type===M.SocialPlatform;return(0,p.jsxs)("div",{ref:h[e.type],style:{marginTop:0===t?0:24},children:[(0,p.jsx)(e1,{label:e.label,tooltipContent:e.desc,showTooltipInfo:n,isHighlight:k[e.type],type:e.type,onAnimationEnd:()=>{S(e.type)}}),n?(0,p.jsx)(eK,{className:"mb-8px"}):null,(0,p.jsx)("div",{className:G()("grid grid-cols-2 gap-[12px]",tO["publish-cards"]),children:e.connectors.map(e=>(0,p.jsx)(tN,{connectorInfo:e,checked:C(e),onCheckedChange:t=>E(e,t),onShowWebSdkGuide:R},e.id))})]},e.type)}),t.length?null:(0,p.jsxs)("div",{className:"flex flex-col justify-center items-center w-full h-full gap-[4px]",children:[(0,p.jsx)(K.nL$,{className:"w-[32px] h-[32px] coz-fg-dim"}),(0,p.jsx)("div",{className:"text-[14px] font-medium coz-fg-primary",children:V.o.t("publish_page_no_channel_status_title")}),(0,p.jsx)("div",{className:"text-[12px] coz-fg-primary",children:V.o.t("publish_page_no_channel_status_desc")})]}),I]})}function tF(){return(tF=(0,I._)(function*(e,t){if(!e)return V.o.t("project_release_example2");var{data:n}=yield D.sD.CheckProjectVersionNumber({project_id:t,version_number:e});return(null==n?void 0:n.is_duplicate)?V.o.t("project_release_example3"):""})).apply(this,arguments)}var tH=n("473980"),tU=n("793828"),tV={};tV.styleTagTransform=em(),tV.setAttributes=eu(),tV.insert=ec().bind(null,"head"),tV.domAPI=es(),tV.insertStyleElement=ep(),eo()(tU.Z,tV);var tK=tU.Z&&tU.Z.locals?tU.Z.locals:void 0,tq=(0,g.Q2)(e=>{var{inputClassName:t,textAreaClassName:n,wrapperClassName:r,textAreaStyle:o}=e,a=(0,tH._)(e,["inputClassName","textAreaClassName","wrapperClassName","textAreaStyle"]),[s,l]=(0,f.useState)("input"),c=(0,f.useRef)(null);return((0,f.useEffect)(()=>{var e,t=c.current;if("textarea"!==s||!t)return;var n=null===(e=a.value)||void 0===e?void 0:e.length;if(t.focus(),!!n)t.setSelectionRange(n,n)},[s]),"input"===s)?(0,p.jsx)(g.II,(0,_._)((0,y._)({},a),{className:G()(tK["desc-input"],t),onFocus:()=>{l("textarea")}})):(0,p.jsx)("div",{className:r,children:(0,p.jsx)(g.Kx,(0,_._)((0,y._)({},a),{ref:c,className:n,style:o,autoFocus:!0,autosize:{minRows:1,maxRows:10},onBlur:()=>{l("input")}}))})});function tZ(){var{project_id:e=""}=(0,b.useParams)(),{lastVersionNumber:t,versionNumber:n,versionDescription:r,setProjectPublishInfo:o}=j((0,m.N)(e=>({lastVersionNumber:e.lastVersionNumber,versionNumber:e.versionNumber,versionDescription:e.versionDescription,setProjectPublishInfo:e.setProjectPublishInfo})));return(0,p.jsxs)("div",{className:"flex flex-col gap-[8px] w-full coz-bg-plus rounded-md p-24px",children:[(0,p.jsx)("div",{className:"text-[20px] coz-fg-plus font-[500] leading-[28px]",children:V.o.t("project_release_version_info")}),(0,p.jsxs)("div",{className:"flex gap-x-12px",children:[(0,p.jsx)(g.l0.Input,{field:"version_num",fieldClassName:"!p-0 flex-[1]",label:(0,p.jsx)("span",{className:"text-14px font-medium",children:V.o.t("builder_publish_version_label")}),placeholder:t?V.o.t("project_release_example1",{version:t}):V.o.t("project_release_example"),initValue:n,className:"bg-transparent coz-stroke-plus",rules:[{required:!0,message:V.o.t("project_release_example2")}],onChange:e=>{o({versionNumber:e})},validate:t=>(function(e,t){return tF.apply(this,arguments)})(t,e),trigger:"blur",maxLength:20}),(0,p.jsx)(tq,{field:"version_desc",fieldClassName:"!p-0 !overflow-visible flex-[1]",label:(0,p.jsx)("span",{className:"text-14px font-medium",children:V.o.t("builder_publish_changelog_label")}),placeholder:V.o.t("builder_publish_changelog_placeholder"),initValue:r,maxLength:800,maxCount:800,wrapperClassName:"relative overflow-visible",inputClassName:"",textAreaClassName:G()("","absolute","top-0","left-0","!coz-bg-max"),textAreaStyle:{zIndex:2},onChange:e=>{o({versionDescription:e})}})]})]})}var tY=e=>{var{children:t}=e,n=(0,f.useRef)(null),[r,o]=(0,f.useState)(97);return(0,p.jsx)(Z.Provider,{value:{getContainerRef:()=>n,publishHeaderHeight:r,setPublishHeaderHeight:o},children:(0,p.jsx)("div",{ref:n,className:"flex-[1] w-full h-full overflow-x-hidden coz-bg-primary",children:t})})};function tX(){var{project_id:e="",space_id:t=""}=(0,b.useParams)(),{showPublishResult:n,pageLoading:r,resetProjectPublishInfo:o,exportDraft:a}=j((0,m.N)(e=>({showPublishResult:e.showPublishResult,pageLoading:e.pageLoading,resetProjectPublishInfo:e.resetProjectPublishInfo,exportDraft:e.exportDraft}))),s=(0,v.UQ)();return(0,f.useEffect)(()=>{var t=()=>{var t;t=a(e),localStorage.setItem(T,JSON.stringify(t))};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[a,e]),(0,f.useEffect)(()=>(!function(e,t,n){F.apply(this,arguments)}(e,s,function(e){var t=localStorage.getItem(T);if(localStorage.removeItem(T),!!t){var n=(0,E.f5)(t);if((null==n?void 0:n.projectId)===e)return n}}(e)),()=>{o()}),[]),r?(0,p.jsx)(g.yC,{spinning:!0,wrapperClassName:"flex justify-center h-full w-full items-center"}):(0,p.jsx)(tY,{children:(0,p.jsxs)(g.l0,{className:tO.project,showValidateIcon:!1,children:[(0,p.jsx)(X,{}),n?(0,p.jsx)(eI,{projectId:e,spaceId:t}):(0,p.jsx)("div",{className:"flex justify-center pt-[32px] pb-[48px] coz-bg-primary",children:(0,p.jsxs)("div",{className:"w-[800px]",children:[(0,p.jsx)(tZ,{}),(0,p.jsx)(tW,{})]})})]})})}var tQ=n("942185"),tG={0:{prefixIcon:(0,p.jsx)(K.kSS,{}),color:"brand",text:"project_releasing"},1:{prefixIcon:(0,p.jsx)(K.AYy,{}),color:"red",text:"project_release_failed"},2:{prefixIcon:(0,p.jsx)(K.G70,{}),color:"green",text:"project_release_success"}};function tJ(e){var t,n,{spaceId:r,projectId:o,defaultRecordID:a}=e,[s,l]=(0,f.useState)(),[c,d]=(0,f.useState)(),[u,h]=(0,f.useState)([]),[m,v]=(0,f.useState)(a),[b,y]=(0,f.useState)(),[_,w]=(0,f.useState)(!1),x=(0,U.Z)(()=>D.sD.GetPublishRecordDetail({project_id:o}),{manual:!0,pollingInterval:5e3,pollingWhenHidden:!1,pollingErrorRetryCount:3,onSuccess:e=>{var t,n=e.data;if(!n||"number"!=typeof n.publish_status){x.cancel();return}l(function(e){var t,n,r,o,a=e.publish_status===O.PackFailed||e.publish_status===O.AuditNotPass,s=null!==(r=null===(t=e.connector_publish_result)||void 0===t?void 0:t.some(e=>e.connector_publish_status===z.Failed))&&void 0!==r&&r;if(a||s)return 1;var l=e.publish_status===O.Packing||e.publish_status===O.Auditing||e.publish_status===O.ConnectorPublishing,c=null!==(o=null===(n=e.connector_publish_result)||void 0===n?void 0:n.some(e=>e.connector_publish_status===z.Default||e.connector_publish_status===z.Auditing))&&void 0!==o&&o;return l||c?0:2}(n)),d(n),m?m===n.publish_record_id&&y(n):(h([{value:n.publish_record_id,label:n.version_number}]),v(null!==(t=n.publish_record_id)&&void 0!==t?t:"")),q(n)&&x.cancel()}}),S=(0,U.Z)(()=>D.sD.GetPublishRecordList({project_id:o}),{manual:!0,onSuccess:e=>{var t,n;h(null!==(n=null===(t=e.data)||void 0===t?void 0:t.map(e=>({value:e.publish_record_id,label:e.version_number})))&&void 0!==n?n:[])}}),k=(0,tQ.Qb)(tQ.PL.PUBLISH,o,r);(0,f.useEffect)(()=>{if(!!k&&!a)x.run()},[k,a]);var C=(0,U.Z)(e=>D.sD.GetPublishRecordDetail({project_id:o,publish_record_id:e}),{manual:!0,onSuccess:e=>{var t=e.data;y(t),(null==t?void 0:t.publish_record_id)===(null==c?void 0:c.publish_record_id)&&d(t)}}),j=tG[null!=s?s:1],E=null!=b?b:c;var T=(t=(0,I._)(function*(){yield S.runAsync(),a&&(yield P(a)),w(!0)}),function(){return t.apply(this,arguments)});var P=(n=(0,I._)(function*(e){v(e),yield C.run(e)}),function(e){return n.apply(this,arguments)});return{latestVersion:c,currentVersion:u.find(e=>e.value===m),open:T,close:()=>{w(!1)},modal:(0,p.jsx)(g.u_,{title:V.o.t("project_release_stage"),visible:_,footer:null,onCancel:()=>w(!1),children:(0,p.jsxs)("div",{className:"flex flex-col gap-[16px]",children:[(0,p.jsx)(g.Ph,{className:"w-full",optionList:u,value:m,onSelect:e=>{"string"==typeof e&&P(e)}}),E?(0,p.jsx)(eT,{record:E}):null]})}),tag:(0,p.jsx)(g.Vp,{size:"mini",prefixIcon:j.prefixIcon,color:j.color,className:"flex !px-[3px] font-medium",children:V.o.t(j.text)})}}var t$=()=>new URLSearchParams(location.search).has("devBlock"),t0=e=>{var{spaceId:t,projectId:n,hasPublished:r}=e,o=(0,b.useNavigate)(),{modal:a,tag:s,latestVersion:l,open:c}=tJ({spaceId:t,projectId:n}),d=(0,tQ.Qb)(tQ.PL.PUBLISH,n,t),{removeAnchor:u}=eW(),h=(0,f.useCallback)(()=>{u(),o("/space/".concat(t,"/project-ide/").concat(n,"/publish"))},[t,n,u]),m=(0,tQ.kc)(n),[v]=(0,$.V)(),{ready:y,inited:_}=(0,ee.N)({type:J.jH.Project,intelligenceId:n,spaceId:t,enable:(v["bot.studio.publish_management"]&&r&&m.length,!1)});return(V.o.t("analytics_page_title"),K.O84,V.o.t("release_management_trace"),K.da8,V.o.t("release_management_trigger"),K.VGH,d)?r?(0,p.jsxs)(p.Fragment,{children:[a,(0,p.jsx)(g.J2,{trigger:"click",zIndex:999,content:(0,p.jsxs)("div",{className:"px-[4px] py-[8px] rounded-[12px] w-[244px] flex flex-col gap-[12px]",children:[(null==l?void 0:l.version_number)?(0,p.jsxs)("div",{className:"flex justify-between items-center h-[32px] px-[4px] cursor-pointer",onClick:()=>c(),children:[(0,p.jsx)("span",{className:"flex-grow mr-[8px]",children:"".concat(V.o.t("app_ide_publish_modal_recent_publication")," ").concat(null==l?void 0:l.version_number)}),s,(0,p.jsx)(g.hU,{size:"small",className:"ml-[4px]",icon:(0,p.jsx)(K.x5d,{}),color:"secondary"})]}):null,(0,p.jsx)("div",{className:"px-[8px] w-full",children:(0,p.jsx)(g.iz,{})}),(v["bot.studio.publish_management"],null),(0,p.jsx)("div",{className:"px-[4px] w-full",children:(0,p.jsx)(g.zx,{className:"w-full",onClick:h,disabled:t$(),"data-testid":"project.goto.publish-button",children:V.o.t("app_ide_publish_modal_publish_button")})})]}),children:(0,p.jsxs)(g.zx,{children:[(0,p.jsx)("span",{className:"mr-[4px]",children:V.o.t("project_ide_frame_publish")}),(0,p.jsx)(K.Wdl,{})]})})]}):(0,p.jsx)(g.zx,{onClick:h,disabled:t$(),"data-testid":"project.goto.publish-button",children:V.o.t("project_ide_frame_publish")}):null}},841622:function(e,t,n){"use strict";var r=n(407821),o=n.n(r),a=n(472772),s=n.n(a),l=n(395245),c=n.n(l),d=n(297998),u=n.n(d),h=n(646576),p=n.n(h),f=n(606121),m=n.n(f),v=n(854385),g={};g.styleTagTransform=m(),g.setAttributes=u(),g.insert=c().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=p(),o()(v.Z,g),t.Z=v.Z&&v.Z.locals?v.Z.locals:void 0},782095:function(e,t,n){"use strict";e.exports=n.p+"static/font/codicon.81ea7998.ttf"},269087:function(e,t,n){"use strict";n(151064),n(455069),t.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04LjMzMzk4IDIuOTk5OTJDOC4zMzM5OCAxLjUyNzE2IDkuNTI3ODkgMC4zMzMyNTIgMTEuMDAwNyAwLjMzMzI1MkgyNy4wMDA2QzI4LjQ3MzQgMC4zMzMyNTIgMjkuNjY3MyAxLjUyNzE2IDI5LjY2NzMgMi45OTk5MlYxOC45OTk5QzI5LjY2NzMgMjAuNDcyNyAyOC40NzM0IDIxLjY2NjYgMjcuMDAwNiAyMS42NjY2SDIxLjY2NzNWMjYuOTk5OUMyMS42NjczIDI4LjQ3MjcgMjAuNDczNCAyOS42NjY2IDE5LjAwMDcgMjkuNjY2NkgzLjAwMDY1QzEuNTI3ODkgMjkuNjY2NiAwLjMzMzk4NCAyOC40NzI3IDAuMzMzOTg0IDI2Ljk5OTlWMTAuOTk5OUMwLjMzMzk4NCA5LjUyNzE2IDEuNTI3ODkgOC4zMzMyNSAzLjAwMDY1IDguMzMzMjVIOC4zMzM5OFYyLjk5OTkyWk04LjMzMzk4IDEwLjk5OTlIMy4wMDA2NVYyNi45OTk5SDE5LjAwMDdWMjEuNjY2NkgxMS4wMDA3QzkuNTI3ODkgMjEuNjY2NiA4LjMzMzk4IDIwLjQ3MjcgOC4zMzM5OCAxOC45OTk5VjEwLjk5OTlaTTE5LjAwMDcgMTguOTk5OUgxMS4wMDA3VjEwLjk5OTlIMTkuMDAwN1YxOC45OTk5Wk0yMS42NjczIDE4Ljk5OTlWMTAuOTk5OUMyMS42NjczIDkuNTI3MTYgMjAuNDczNCA4LjMzMzI1IDE5LjAwMDcgOC4zMzMyNUgxMS4wMDA3VjIuOTk5OTJIMjcuMDAwNlYxOC45OTk5SDIxLjY2NzNaIiBmaWxsPSIjMUQxQzIzIiBmaWxsLW9wYWNpdHk9IjAuMzUiLz4KPC9zdmc+Cg=="},376756:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".editor-container-JPBTxq{height:100%;position:relative}.editor-VinOIJ{background-color:#fff;border:1px solid rgba(29,28,35,.12);border-radius:8px;height:100%;padding:0}.editor-VinOIJ .monaco-editor .scroll-decoration{box-shadow:unset}",""]),s.locals={"editor-container":"editor-container-JPBTxq",editorContainer:"editor-container-JPBTxq",editor:"editor-VinOIJ"},t.Z=s},367689:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,'.multiline-text-GVNO_v{word-break:break-word;white-space:pre-wrap}.multiline-container-uIOXgz{flex:1;grid-template-columns:100px 36px 100px;display:grid;overflow:hidden}.editor-container-YQ76sR{border:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));border-radius:8px;min-height:400px;margin-top:20px;overflow:hidden}.editor-header-rVNsYI{border-bottom:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));width:100%;display:flex}.editor-title-TtUkQu{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8));flex:1;padding:12px;font-size:14px;font-weight:500;overflow:hidden}.editor-divider-sAapKP{width:1px;height:46px;color:var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1))}.editor-cj3RsF{background-color:transparent;min-height:400px;max-height:600px}.editor-cj3RsF .monaco-editor-background{background-color:#f9f9f9!important}.editor-cj3RsF .monaco-editor .vertical{box-shadow:0 0 0 0 var(--guide-color)inset!important}.editor-cj3RsF .margin{background-color:#f9f9f9!important}.editor-cj3RsF .monaco-diff-editor.side-by-side .editor.modified{border-left:1px solid var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));box-shadow:none!important}.editor-cj3RsF .mtk1{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.6))}.editor-cj3RsF .margin-view-overlays .line-numbers{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3));width:24px!important}.editor-cj3RsF .monaco-editor .diagonal-fill{background-size:8px 8px;background-image:linear-gradient(-45deg,rgba(34,34,34,.1) 12.5%,transparent 12.5%,transparent 50%,rgba(34,34,34,.1) 50%,rgba(34,34,34,.1) 62.5%,transparent 62.5%,transparent 100%)!important}.editor-cj3RsF .margin-view-overlays:after{pointer-events:none;background:var(--Stroke-COZ-stroke-primary,rgba(6,7,9,.1));width:1px;position:absolute;top:0;bottom:0;right:3px;content:" "!important}.editor-cj3RsF .line-numbers.active-line-number{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8))!important}.editor-cj3RsF .monaco-editor .delete-sign{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3))!important;font-size:8px!important;font-weight:900!important;left:29px!important}.editor-cj3RsF .monaco-editor .insert-sign{color:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3))!important;font-size:8px!important;font-weight:900!important;left:29px!important}.editor-cj3RsF .monaco-editor .view-overlays .current-line{border:0!important}.editor-cj3RsF .monaco-scrollable-element>.scrollbar>.slider{background:var(--Fg-COZ-fg-dim,rgba(6,7,9,.3));border-radius:3px;width:8px!important}.editor-cj3RsF .decorationsOverviewRuler{display:none!important}.editor-cj3RsF .modified .slider{left:6px!important}.editor-cj3RsF .modified .presentation{width:12px!important;right:-4px!important}.editor-cj3RsF .original .slider{left:6px!important}.editor-cj3RsF .original .presentation{width:12px!important;left:3px!important}.editor-cj3RsF .gutter-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))!important}.editor-cj3RsF .gutter-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))!important}',""]),s.locals={"multiline-text":"multiline-text-GVNO_v",multilineText:"multiline-text-GVNO_v","multiline-container":"multiline-container-uIOXgz",multilineContainer:"multiline-container-uIOXgz","editor-container":"editor-container-YQ76sR",editorContainer:"editor-container-YQ76sR","editor-header":"editor-header-rVNsYI",editorHeader:"editor-header-rVNsYI","editor-title":"editor-title-TtUkQu",editorTitle:"editor-title-TtUkQu","editor-divider":"editor-divider-sAapKP",editorDivider:"editor-divider-sAapKP",editor:"editor-cj3RsF"},t.Z=s},675940:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".list-utyqSJ{padding:.75rem 0 .75rem .75rem}.list-utyqSJ .semi-list-item-body-header{flex:1;width:0;overflow:hidden}",""]),s.locals={list:"list-utyqSJ"},t.Z=s},434414:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".error-container-_IyY_2 .error-link-Pq2VWp .error-link-underline-EVkAXO{color:var(--semi-color-danger);max-width:200px;margin-left:2px;font-size:14px;text-decoration:underline}.error-container-_IyY_2 .error-link-Pq2VWp .error-link-underline-EVkAXO a{color:var(--semi-color-danger)}",""]),s.locals={"error-container":"error-container-_IyY_2",errorContainer:"error-container-_IyY_2","error-link":"error-link-Pq2VWp",errorLink:"error-link-Pq2VWp","error-link-underline":"error-link-underline-EVkAXO",errorLinkUnderline:"error-link-underline-EVkAXO"},t.Z=s},293758:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".disable-field-jMLuez{padding:12px 0 24px}.disable-field-jMLuez .title-s26PF2{margin-bottom:8px;font-size:14px;font-weight:600}.input-XYeEI3.input-XYeEI3{padding-top:4px}.input-XYeEI3 .semi-input-suffix{cursor:pointer;padding:8px}.link-button-tWRlPA.link-button-tWRlPA.link-button-tWRlPA{background-color:transparent}",""]),s.locals={"disable-field":"disable-field-jMLuez",disableField:"disable-field-jMLuez",title:"title-s26PF2",input:"input-XYeEI3","link-button":"link-button-tWRlPA",linkButton:"link-button-tWRlPA"},t.Z=s},205136:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".step-order-La7ARW{background:var(--light-color-brand-brand-5,#4d53e8);width:16px;height:16px;color:var(--light-color-white-white,#fff);border-radius:50%;justify-content:center;align-items:center;margin-top:2px;font-size:10px;font-weight:600;display:flex}.step-title-vWRtVL{color:#000;margin-bottom:8px;font-size:14px;font-weight:600;line-height:22px}.markdown-qLZ0zo{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}",""]),s.locals={"step-order":"step-order-La7ARW",stepOrder:"step-order-La7ARW","step-title":"step-title-vWRtVL",stepTitle:"step-title-vWRtVL",markdown:"markdown-qLZ0zo"},t.Z=s},783915:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".start-text-pXfZ2p{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.config-link-HEiJGW{color:var(--light-color-brand-brand-5,#4d53e8);font-size:12px;line-height:16px}.markdown-PFR8kZ{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.guide-XLqN5c{margin-bottom:32px}",""]),s.locals={"start-text":"start-text-pXfZ2p",startText:"start-text-pXfZ2p","config-link":"config-link-HEiJGW",configLink:"config-link-HEiJGW",markdown:"markdown-PFR8kZ",guide:"guide-XLqN5c"},t.Z=s},642801:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".step-order-kS8rzB{background:var(--light-color-brand-brand-5,#4d53e8);width:16px;height:16px;color:var(--light-color-white-white,#fff);border-radius:50%;justify-content:center;align-items:center;margin-top:2px;font-size:10px;font-weight:600;display:flex}.step-title-fbaFcC{color:#000;margin-bottom:8px;font-size:14px;font-weight:600;line-height:22px}.markdown-ihOOii{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;line-height:22px}.link-area-yqpTLT .link-list-hCIt6h{margin-top:16px}.link-area-yqpTLT .link-list-hCIt6h .title-HQq6si{color:var(--light-usage-text-color-text-0,#1d1c23);font-size:14px;font-weight:600;line-height:22px}.link-area-yqpTLT .link-list-hCIt6h .link-zMA1OB{word-break:break-word}.link-area-yqpTLT .link-list-hCIt6h .semi-form-field-error-message-ig2k1h{position:absolute}",""]),s.locals={"step-order":"step-order-kS8rzB",stepOrder:"step-order-kS8rzB","step-title":"step-title-fbaFcC",stepTitle:"step-title-fbaFcC",markdown:"markdown-ihOOii","link-area":"link-area-yqpTLT",linkArea:"link-area-yqpTLT","link-list":"link-list-hCIt6h",linkList:"link-list-hCIt6h",title:"title-HQq6si",link:"link-zMA1OB","semi-form-field-error-message":"semi-form-field-error-message-ig2k1h",semiFormFieldErrorMessage:"semi-form-field-error-message-ig2k1h"},t.Z=s},854385:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".info-title-hM03fu{margin-bottom:8px;font-size:16px;font-weight:600}.info-subtitle-xJLDxa{margin-top:12px;margin-bottom:8px;font-size:14px;font-weight:500}.container-LF_kv1{width:100%;height:100%}.diff-table-tF4K3Z{margin-bottom:24px}.diff-table-tF4K3Z .semi-table-row-head{border-bottom:1px solid var(--semi-color-border);font-size:12px;background-color:rgba(46,46,56,.04)!important;padding:4px 8px!important}.diff-table-tF4K3Z .semi-table-row-cell{font-size:12px;padding:10px 8px!important}.cell-span-H_nQzL{word-break:break-word;font-weight:400;font-size:12px!important}.property-tooltip-ji9W4V{word-break:break-word}.empty-container-YLcORh{flex-direction:column;justify-content:center;align-items:center;height:100%;min-height:200px;display:flex}.empty-info-q193R7{margin-top:4px}.list-BE2Xcy{border-radius:8px;border:1px solid var(--Stroke-COZ-stroke-plus,rgba(6,7,9,.15))!important;background-color:#fff!important}.list-BE2Xcy .semi-list-item{border-bottom:1px solid var(--Stroke-COZ-stroke-plus,rgba(6,7,9,.15))!important}.list-BE2Xcy .semi-list-item:last-child{border-bottom:none!important}.list-item-vLj8Sw{grid-template-columns:280px 120px 1fr;align-items:center;display:grid}.tag-1-aqUUN6{color:#3ec254;background-color:#d2f3d5}.tag-2-CdvW0P,.tag-4-MC5w82{color:#ff441e;background-color:#ffe0d2}.tag-3-KTmcm_{color:#ff9600;background-color:#fff1cc}.property-title-Tuf6E1{color:var(--Fg-COZ-fg-primary,rgba(6,7,9,.8));font-size:12px;font-weight:500}.info-block-s33QB0:not(:first-child){margin-top:24px}.mask-U3tgbz{pointer-events:none;background:linear-gradient(to top,rgba(var(--coze-bg-2),1)0,rgba(var(--coze-bg-2),0)100%);width:100%;height:32px;position:absolute;bottom:80px}",""]),s.locals={"info-title":"info-title-hM03fu",infoTitle:"info-title-hM03fu","info-subtitle":"info-subtitle-xJLDxa",infoSubtitle:"info-subtitle-xJLDxa",container:"container-LF_kv1","diff-table":"diff-table-tF4K3Z",diffTable:"diff-table-tF4K3Z","cell-span":"cell-span-H_nQzL",cellSpan:"cell-span-H_nQzL","property-tooltip":"property-tooltip-ji9W4V",propertyTooltip:"property-tooltip-ji9W4V","empty-container":"empty-container-YLcORh",emptyContainer:"empty-container-YLcORh","empty-info":"empty-info-q193R7",emptyInfo:"empty-info-q193R7",list:"list-BE2Xcy","list-item":"list-item-vLj8Sw",listItem:"list-item-vLj8Sw","tag-1":"tag-1-aqUUN6",tag1:"tag-1-aqUUN6","tag-2":"tag-2-CdvW0P",tag2:"tag-2-CdvW0P","tag-4":"tag-4-MC5w82",tag4:"tag-4-MC5w82","tag-3":"tag-3-KTmcm_",tag3:"tag-3-KTmcm_","property-title":"property-title-Tuf6E1",propertyTitle:"property-title-Tuf6E1","info-block":"info-block-s33QB0",infoBlock:"info-block-s33QB0",mask:"mask-U3tgbz"},t.Z=s},864539:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".resource-group-YhQutA .resource-group-header-dQYzYW{cursor:pointer;justify-content:space-between;align-items:center;height:36px;padding:0 14px 0 17px;display:flex}.resource-group-YhQutA .resource-group-header-dQYzYW .header-left-PI8WU3{align-items:center;gap:4px;display:flex}.resource-group-YhQutA .resource-group-header-dQYzYW .header-title-m6jh2J{font-size:14px;font-weight:500;line-height:20px}.resource-group-YhQutA .resource-group-header-dQYzYW .action-group-wHBVve{align-items:center;gap:2px;display:flex}.resource-group-YhQutA .resource-group-content-s59UBy{padding:0 6px}",""]),s.locals={"resource-group":"resource-group-YhQutA",resourceGroup:"resource-group-YhQutA","resource-group-header":"resource-group-header-dQYzYW",resourceGroupHeader:"resource-group-header-dQYzYW","header-left":"header-left-PI8WU3",headerLeft:"header-left-PI8WU3","header-title":"header-title-m6jh2J",headerTitle:"header-title-m6jh2J","action-group":"action-group-wHBVve",actionGroup:"action-group-wHBVve","resource-group-content":"resource-group-content-s59UBy",resourceGroupContent:"resource-group-content-s59UBy"},t.Z=s},802086:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".resource-list-UL45IN{width:100%;height:100%}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-selected{background-color:var(--coz-mg-primary)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-selected:hover{background-color:var(--coz-mg-secondary-hovered)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .item-is-temp-selected.item-is-selected{background-color:var(--coz-mg-primary)}.resource-folder-coze-XUy3TX .resource-list-wrapper .resource-list-drag-and-drop-wrapper .base-item-hover-class:hover{background-color:var(--coz-mg-secondary-hovered)}.shortcut-lk6Mtn{color:var(--coz-fg-dim);font-family:Inter,sans-serif;font-size:12px;font-weight:700}.file-list-wrapper-EnRR5A{border:1px solid var(--coz-stroke-primary);border-radius:var(--coze-8);max-height:124px;margin-top:4px;overflow:auto}.file-list-wrapper-EnRR5A::-webkit-scrollbar{background:0 0;width:0;height:10px}.file-list-wrapper-EnRR5A::-webkit-scrollbar:hover{background:0 0}.file-list-wrapper-EnRR5A::-webkit-scrollbar-thumb{background:0 0}.file-list-wrapper-EnRR5A::-webkit-scrollbar-corner{background:0 0}.file-list-Ve2P05{flex-direction:column;align-items:flex-start;padding:6px 0;display:flex}.file-list-Ve2P05 .file-item-pzkzjD{text-overflow:ellipsis;white-space:nowrap;width:100%;height:22px;padding:0 8px;overflow:hidden}.file-list-Ve2P05 .file-item-pzkzjD .file-icon-n_bTZZ{color:var(--coz-fg-secondary);margin-right:4px;position:relative;top:2px}.file-list-Ve2P05 .file-item-pzkzjD .file-name-Ijw7og{color:var(--coz-fg-primary);font-size:14px}.empty-RIYl2e{flex-direction:column;justify-content:center;align-items:center;gap:12px;width:232px;height:80px;margin:0 auto;display:flex}.empty-RIYl2e .empty-card-gahwex{background-color:var(--coz-bg-max);border-radius:var(--coze-4);border:.5px solid #f0f0f0;flex-direction:row;justify-content:flex-start;align-items:center;gap:4px;padding:4.5px;display:flex}.empty-RIYl2e .empty-icon-TXAZwQ{background-color:var(--coz-mg-primary);border-radius:var(--coze-3);width:15px;height:15px}.empty-RIYl2e .empty-skeleton-DONg5h{opacity:.12;flex-direction:column;align-items:flex-start;gap:2.5px;display:flex}.empty-RIYl2e .empty-skeleton-DONg5h span{background-color:var(--coz-fg-secondary);border-radius:var(--coze-2);height:4.5px}.empty-RIYl2e .empty-skeleton-DONg5h span:first-child{width:20px}.empty-RIYl2e .empty-skeleton-DONg5h span:last-child{width:33px}.empty-RIYl2e .empty-title-NilH4m{color:var(--coz-fg-dim);font-size:12px;font-weight:400;line-height:16px}",""]),s.locals={"resource-list":"resource-list-UL45IN",resourceList:"resource-list-UL45IN","resource-folder-coze":"resource-folder-coze-XUy3TX",resourceFolderCoze:"resource-folder-coze-XUy3TX",shortcut:"shortcut-lk6Mtn","file-list-wrapper":"file-list-wrapper-EnRR5A",fileListWrapper:"file-list-wrapper-EnRR5A","file-list":"file-list-Ve2P05",fileList:"file-list-Ve2P05","file-item":"file-item-pzkzjD",fileItem:"file-item-pzkzjD","file-icon":"file-icon-n_bTZZ",fileIcon:"file-icon-n_bTZZ","file-name":"file-name-Ijw7og",fileName:"file-name-Ijw7og",empty:"empty-RIYl2e","empty-card":"empty-card-gahwex",emptyCard:"empty-card-gahwex","empty-icon":"empty-icon-TXAZwQ",emptyIcon:"empty-icon-TXAZwQ","empty-skeleton":"empty-skeleton-DONg5h",emptySkeleton:"empty-skeleton-DONg5h","empty-title":"empty-title-NilH4m",emptyTitle:"empty-title-NilH4m"},t.Z=s},307321:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".resource-list-wrapper-mXc1nd{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%}.resource-list-wrapper-mXc1nd .resource-list-custom-event-wrapper{width:100%;height:100%}.resource-list-wrapper-mXc1nd .resource-list-scroll-container{height:100%;overflow-x:hidden;overflow-y:auto}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper{height:100%}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-wrapper{border-radius:4px;position:relative}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-wrapper .item-wrapper-indent-line{border-left-style:solid;border-left-width:1px;transition:all .2s ease-in-out;position:absolute}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-hover-class:hover{background-color:rgba(6,7,9,.08)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-temp-selected{background-color:rgba(6,7,9,.04);border-radius:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-in-edit{background-color:rgba(6,7,9,.04)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .item-is-selected{background-color:rgba(6,7,9,.14)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .dragging-hover-class{background-color:rgba(148,152,247,.44);border-radius:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item{align-items:center;width:100%;padding-right:8px;transition:all .1s ease-in-out;display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-icon{align-items:center;margin-right:4px;display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input{align-items:center;width:100%;display:flex;position:relative}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .semi-input-wrapper{border-radius:6px;height:20px;line-height:20px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .semi-input-wrapper-focus{background-color:#fff}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input [class~=semi-input]{height:20px;padding:0 4px;line-height:20px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input .base-item-name-input-error-msg-absolute{z-index:999;color:rgba(6,7,9,.5);background-color:#fff1f2;border:1px solid #f22435;border-radius:6px;align-items:center;width:100%;padding:2px 4px;font-size:12px;font-weight:700;line-height:16px;display:flex;position:absolute;top:26px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-name-input-error [class~=semi-input-wrapper]{border-color:#f22435}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item .base-item-more-hover-display-class{display:none}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item:hover .base-item-more-hover-display-class{display:flex}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn{color:rgba(6,7,9,.96);background-color:transparent;justify-content:center;align-items:center;width:16px;min-width:16px;height:16px;padding-left:0;padding-right:0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn:hover{background-color:rgba(6,7,9,.14)}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-item-more-btn svg{width:12px;height:12px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-first{border-radius:4px 4px 0 0}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-last{border-radius:0 0 4px 4px}.resource-list-wrapper-mXc1nd .resource-list-drag-and-drop-wrapper .base-radius-class-single{border-radius:4px}",""]),s.locals={"resource-list-wrapper":"resource-list-wrapper-mXc1nd",resourceListWrapper:"resource-list-wrapper-mXc1nd"},t.Z=s},110808:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".config-container-_jKhXq{background:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-top:none;border-radius:0 0 8px 8px;width:100%;height:100%;overflow:hidden}.config-container-_jKhXq .primary-sidebar-header-GIDj0H{justify-content:space-between;align-items:center;width:100%;padding:0 14px;font-size:14px;line-height:20px;display:flex}.config-container-_jKhXq .primary-sidebar-header-GIDj0H .title-FeuhvF{color:var(--coz-fg-plus);font-weight:500}.config-container-_jKhXq .item-WJQ3kG{color:var(--coz-fg-primary);border-radius:8px;align-items:center;margin:0 8px;padding:4px 8px 4px 20px;font-size:14px;line-height:1.5;display:flex}.config-container-_jKhXq .item-WJQ3kG:hover,.config-container-_jKhXq .item-WJQ3kG.activate-uBUYqB{cursor:pointer;color:var(--coz-fg-plus);background-color:var(--coz-mg-primary)}",""]),s.locals={"config-container":"config-container-_jKhXq",configContainer:"config-container-_jKhXq","primary-sidebar-header":"primary-sidebar-header-GIDj0H",primarySidebarHeader:"primary-sidebar-header-GIDj0H",title:"title-FeuhvF",item:"item-WJQ3kG",activate:"activate-uBUYqB"},t.Z=s},740552:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".global-loading-orDTkw{background:var(--coz-bg-max);justify-content:center;align-items:center;width:100%;height:100vh;display:flex;position:fixed;top:0;left:0}",""]),s.locals={"global-loading":"global-loading-orDTkw",globalLoading:"global-loading-orDTkw"},t.Z=s},626496:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".content-ixXohr{color:var(--coz-fg-secondary);margin-top:4px;font-size:14px;line-height:20px}",""]),s.locals={content:"content-ixXohr"},t.Z=s},184983:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".content-bHOPf6{color:var(--coz-fg-secondary);margin-top:4px;font-size:14px;line-height:20px}.content-bHOPf6 .error-container-_Y28mV{white-space:pre-wrap;flex-direction:column;flex:1 0 0;justify-content:center;align-items:center;gap:22px;margin:24px 0 22px;display:flex}.content-bHOPf6 .description-container-NlI420{text-align:center;flex-direction:column;justify-content:center;align-items:center;margin:28px 0 12px;display:flex}.content-bHOPf6 .description-container-NlI420 .spin-oAh06F{margin-bottom:12px}",""]),s.locals={content:"content-bHOPf6","error-container":"error-container-_Y28mV",errorContainer:"error-container-_Y28mV","description-container":"description-container-NlI420",descriptionContainer:"description-container-NlI420",spin:"spin-oAh06F"},t.Z=s},362845:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".primary-sidebar-HKe_Js{background:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-bottom:none;border-radius:8px 8px 0 0;width:100%;height:100%;overflow:hidden}.primary-sidebar-header-LcvDBK{justify-content:space-between;align-items:center;width:100%;padding:0 14px;font-size:14px;line-height:20px;display:flex}.primary-sidebar-header-LcvDBK .title-ugz3Nx{color:var(--coz-fg-plus);font-weight:500}.resource-list-wrapper-JlJNdV{overflow-y:auto}.resource-list-wrapper-JlJNdV::-webkit-scrollbar{background:0 0;width:0;height:10px}.resource-list-wrapper-JlJNdV::-webkit-scrollbar:hover{background:0 0}.resource-list-wrapper-JlJNdV::-webkit-scrollbar-thumb{background:0 0}.resource-list-wrapper-JlJNdV::-webkit-scrollbar-corner{background:0 0}",""]),s.locals={"primary-sidebar":"primary-sidebar-HKe_Js",primarySidebar:"primary-sidebar-HKe_Js","primary-sidebar-header":"primary-sidebar-header-LcvDBK",primarySidebarHeader:"primary-sidebar-header-LcvDBK",title:"title-ugz3Nx","resource-list-wrapper":"resource-list-wrapper-JlJNdV",resourceListWrapper:"resource-list-wrapper-JlJNdV"},t.Z=s},260776:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".icon-button-rjXhPW{margin-right:6px}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW{background-color:var(--coz-bg-max)}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW:hover{background-color:var(--coz-bg-6)}.icon-button-rjXhPW.icon-button-rjXhPW.icon-button-rjXhPW:active{background-color:var(--coz-bg-8)}.sidebar-wrapper-sSaaGq{width:282px;height:calc(100vh - 114px)}",""]),s.locals={"icon-button":"icon-button-rjXhPW",iconButton:"icon-button-rjXhPW","sidebar-wrapper":"sidebar-wrapper-sSaaGq",sidebarWrapper:"sidebar-wrapper-sSaaGq"},t.Z=s},618461:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".full-screen-button-ZxxIiN{border:1px solid var(--coz-stroke-primary);justify-content:center;align-items:center;display:flex}.shortcut-tE6S6S{justify-content:space-between;align-items:center;display:flex}.shortcut-tE6S6S .label-bhLPgL{font-size:14px;line-height:20px}.shortcut-tE6S6S .keybinding-jC_YMY{color:var(--coz-fg-dim);font-weight:700}",""]),s.locals={"full-screen-button":"full-screen-button-ZxxIiN",fullScreenButton:"full-screen-button-ZxxIiN",shortcut:"shortcut-tE6S6S",label:"label-bhLPgL",keybinding:"keybinding-jC_YMY"},t.Z=s},840486:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".project-info-lhSc0J{align-items:center;display:flex}.project-info-lhSc0J .title-kATuFD{color:var(--coz-fg-plus);margin:0 4px 0 8px;font-size:16px;font-weight:500;line-height:22px}.project-info-lhSc0J .check-icon-IOuXVa{background-color:#fff;border-radius:50%;justify-content:center;align-items:center;width:16px;height:16px;display:flex;position:absolute;top:31px;left:54px}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ{background-color:var(--coz-bg-plus)}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ:hover{background-color:var(--coz-bg-6)}.icon-xLquXQ.icon-xLquXQ.icon-xLquXQ:active{background-color:var(--coz-bg-8)}.content-ViYH65{flex-direction:column;justify-content:center;align-items:center;min-width:252px;max-width:320px;padding:16px;display:flex}.content-ViYH65 .title-kATuFD{word-break:break-all;margin:16px 0 2px;font-size:16px;font-weight:500;line-height:22px}.content-ViYH65 .description-OERQCC{word-break:break-all;font-size:14px;line-height:20px}.content-ViYH65 .tag-container-dngyT5{-moz-column-gap:4px;column-gap:4px;margin-top:8px;font-weight:500;display:flex}.content-ViYH65 .tag-container-dngyT5 .tag-daM42A{padding:2px 6px}.content-ViYH65 .owner-container-mJpSns{-moz-column-gap:4px;color:var(--coz-fg-secondary);align-items:center;column-gap:4px;margin-top:24px;font-size:12px;display:flex}.content-ViYH65 .time-IOV6xS{color:var(--coz-fg-secondary);word-break:break-all;margin-top:6px;font-size:12px;line-height:16px}",""]),s.locals={"project-info":"project-info-lhSc0J",projectInfo:"project-info-lhSc0J",title:"title-kATuFD","check-icon":"check-icon-IOuXVa",checkIcon:"check-icon-IOuXVa",icon:"icon-xLquXQ",content:"content-ViYH65",description:"description-OERQCC","tag-container":"tag-container-dngyT5",tagContainer:"tag-container-dngyT5",tag:"tag-daM42A","owner-container":"owner-container-mJpSns",ownerContainer:"owner-container-mJpSns",time:"time-IOV6xS"},t.Z=s},11549:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".container-bkmzif{width:100%;height:100%;height:-moz-fit-content;flex-direction:column;height:fit-content;display:flex}.container-bkmzif .banner-a1qDt3{justify-content:center;align-items:center;width:100%;height:36px;display:flex}.top-bar-PkNJU7{align-items:center;width:100%;height:56px;display:flex}.top-bar-PkNJU7 .left-col-JvoTh0{-moz-column-gap:4px;align-items:center;column-gap:4px;height:100%;padding-left:4px;display:flex}.top-bar-PkNJU7 .middle-col-Xvqg6n{justify-content:center;align-items:center;height:100%;display:flex}.top-bar-PkNJU7 .right-col-bh6Ml1{-moz-column-gap:8px;justify-content:flex-end;align-items:center;column-gap:8px;height:100%;display:flex}",""]),s.locals={container:"container-bkmzif",banner:"banner-a1qDt3","top-bar":"top-bar-PkNJU7",topBar:"top-bar-PkNJU7","left-col":"left-col-JvoTh0",leftCol:"left-col-JvoTh0","middle-col":"middle-col-Xvqg6n",middleCol:"middle-col-Xvqg6n","right-col":"right-col-bh6Ml1",rightCol:"right-col-bh6Ml1"},t.Z=s},130493:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".shortcut-item-yQPPVF{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.shortcut-item-yQPPVF .label-R4NN_Y{font-size:14px;font-weight:500;line-height:20px}.shortcut-item-yQPPVF .keybinding-iByntU{display:flex}.shortcut-item-yQPPVF .keybinding-iByntU .keybinding-block-x6N_fk{min-width:20px;height:20px;color:var(--coz-fg-secondary);background:var(--coz-mg-primary);border:.5px solid var(--coz-stroke-primary);border-radius:4px;justify-content:center;align-items:center;margin-left:6px;font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:9px;font-weight:800;display:flex}",""]),s.locals={"shortcut-item":"shortcut-item-yQPPVF",shortcutItem:"shortcut-item-yQPPVF",label:"label-R4NN_Y",keybinding:"keybinding-iByntU","keybinding-block":"keybinding-block-x6N_fk",keybindingBlock:"keybinding-block-x6N_fk"},t.Z=s},676466:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".default-container-diUeCI{background:rgba(0,0,0,.03);flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.default-container-diUeCI img{pointer-events:none}.default-container-diUeCI .title-DpF6rw{font-size:28px;font-weight:700;line-height:36px}.default-container-diUeCI .sub-title-LLGSdG{color:var(--coz-fg-secondary,rgba(6,7,9,.5));margin-bottom:40px;font-size:14px;line-height:20px}.default-container-diUeCI .gallery-ZgGwgK{justify-content:center;gap:12px;width:100%;display:flex}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH{cursor:pointer;flex-direction:column;width:320px;display:flex}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-image-D9NPd3{border:1px solid var(--coz-stroke-primary);border-radius:12px;flex-shrink:0}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-title-hOnIe8{font-size:16px;font-weight:500;font-weight:22px;margin:12px 0 8px}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .gallery-description-Vyu9aR{font-size:14px;font-weight:20px;color:var(--coz-fg-secondary,rgba(6,7,9,.05))}.default-container-diUeCI .gallery-ZgGwgK .gallery-block-zSgEFH .doc-search-i1EWnU{visibility:hidden;margin-top:12px}.default-container-diUeCI .gallery-block-zSgEFH:hover>.doc-search-i1EWnU{visibility:visible}.default-container-diUeCI .item-WeupOT{cursor:pointer;background-color:var(--coz-bg-max);border:1px solid var(--coz-stroke-primary);border-radius:8px;justify-content:space-between;align-items:center;width:320px;height:48px;margin-bottom:16px;padding:8px 12px 8px 8px;display:flex}.default-container-diUeCI .item-WeupOT:hover{background-color:var(--coz-bg-6)}.default-container-diUeCI .item-WeupOT:active{background-color:var(--coz-bg-8)}.default-container-diUeCI .item-WeupOT .item-pre-xa2oun{align-items:center;display:flex}.default-container-diUeCI .item-WeupOT .item-text-RDDB7K{margin-left:8px;font-size:14px;font-weight:500;line-height:20px}.default-container-diUeCI .icon-expand-nkgAqW{position:absolute;top:6px;left:8px}.default-container-diUeCI .full-screen-A096_5{position:absolute;top:6px;right:8px}.default-container-diUeCI .shortcuts-list-tL2iMa{flex-direction:column;width:320px;margin-top:48px;display:flex}",""]),s.locals={"default-container":"default-container-diUeCI",defaultContainer:"default-container-diUeCI",title:"title-DpF6rw","sub-title":"sub-title-LLGSdG",subTitle:"sub-title-LLGSdG",gallery:"gallery-ZgGwgK","gallery-block":"gallery-block-zSgEFH",galleryBlock:"gallery-block-zSgEFH","gallery-image":"gallery-image-D9NPd3",galleryImage:"gallery-image-D9NPd3","gallery-title":"gallery-title-hOnIe8",galleryTitle:"gallery-title-hOnIe8","gallery-description":"gallery-description-Vyu9aR",galleryDescription:"gallery-description-Vyu9aR","doc-search":"doc-search-i1EWnU",docSearch:"doc-search-i1EWnU",item:"item-WeupOT","item-pre":"item-pre-xa2oun",itemPre:"item-pre-xa2oun","item-text":"item-text-RDDB7K",itemText:"item-text-RDDB7K","icon-expand":"icon-expand-nkgAqW",iconExpand:"icon-expand-nkgAqW","full-screen":"full-screen-A096_5",fullScreen:"full-screen-A096_5","shortcuts-list":"shortcuts-list-tL2iMa",shortcutsList:"shortcuts-list-tL2iMa"},t.Z=s},746131:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".title-container-yiq3lB{margin:0 8px}.widget-title-lxpZLH{justify-content:space-between;align-items:center;display:flex}.widget-title-lxpZLH .semi-spin.coz-loading-wrapper{line-height:0}.title-label-IGa1w0{-moz-column-gap:8px;flex-grow:1;flex-shrink:1;align-items:center;column-gap:8px;width:0;display:flex}.label-icon-Lq44hT{align-items:center;display:flex}.label-text-DGsQEw{flex-grow:1;flex-shrink:1;width:0;line-height:20px}.close-icon-hwNTjH{cursor:pointer;align-items:center;display:flex}",""]),s.locals={"title-container":"title-container-yiq3lB",titleContainer:"title-container-yiq3lB","widget-title":"widget-title-lxpZLH",widgetTitle:"widget-title-lxpZLH","title-label":"title-label-IGa1w0",titleLabel:"title-label-IGa1w0","label-icon":"label-icon-Lq44hT",labelIcon:"label-icon-Lq44hT","label-text":"label-text-DGsQEw",labelText:"label-text-DGsQEw","close-icon":"close-icon-hwNTjH",closeIcon:"close-icon-hwNTjH"},t.Z=s},998486:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,'body{overscroll-behavior:none;background:var(--coz-bg-primary)}.flowide-container{padding:0 8px 8px;background:var(--coz-bg-primary)!important}.flowide-container .gedit-playground{background-color:transparent!important}.flowide-container .project-ide-workflow-playground{background-color:rgba(0,0,0,.03)!important}.flowide-container #flowide-top-bar{background:var(--coz-bg-primary)!important;border-bottom:none!important;min-height:56px!important}.flowide-container #flowide-main-panel{border-radius:8px;background:var(--coz-bg-primary)!important}.flowide-container #flowide-secondary-sidebar{min-width:250px;max-width:250px;background:var(--coz-bg-primary)!important;border:none!important}.flowide-container .lm-DockPanel-widget{border-radius:0 0 8px 8px;min-width:360px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar{background:var(--coz-bg-primary)!important;border:none!important;width:268px!important;min-width:268px!important;max-width:500px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-child{min-height:44px}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle{border-right:1px solid var(--coz-stroke-primary);border-left:1px solid var(--coz-stroke-primary);transition:transform .2s ease-in-out;background:linear-gradient(to right,white 6px,var(--coz-stroke-primary)6px,var(--coz-stroke-primary)calc(100% - 6px),white calc(100% - 6px))!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:after{margin-right:6px;min-height:4px!important}.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:hover:after,.flowide-container .lm-BoxPanel #flowide-primary-sidebar .lm-SplitPanel-handle:active:after{background:linear-gradient(to right,white 6px,var(--coz-stroke-hglt)6px,var(--coz-stroke-hglt)calc(100% - 6px),white calc(100% - 6px))!important}.flowide-container .lm-TabBar{padding:6px 8px;background:rgba(0,0,0,.03)!important;border-radius:8px 8px 0 0!important;height:44px!important;min-height:44px!important;max-height:44px!important}.flowide-container .lm-DockPanel-overlay{background:rgba(148,152,247,.16);border:none;border-radius:0 0 8px 8px;margin-top:44px}.flowide-container .lm-DockPanel-handle{opacity:0;transition:opacity .35s ease-out;background:0 0!important}.flowide-container .lm-DockPanel-handle:hover,.flowide-container .lm-DockPanel-handle:active{opacity:1;background:linear-gradient(to right,var(--coz-bg-plus)0,var(--coz-bg-plus)1px,var(--coz-stroke-hglt)1px,var(--coz-stroke-hglt)5px,var(--coz-bg-plus)5px)!important}.flowide-container .lm-TabBar-tab{border-radius:6px;position:relative;min-height:32px!important;max-height:32px!important;margin:0 4px!important;padding:0!important;overflow:visible!important}.flowide-container .lm-TabBar-tab:not(:first-child):after{content:"";background:var(--coz-stroke-primary);width:1px;height:16px;position:absolute;top:8px;left:-4px}.flowide-container .lm-TabBar-tab.lm-mod-current .flowide-container .lm-TabBar-tab:not(:first-child):after,.flowide-container .lm-TabBar-tab.lm-mod-current+.lm-TabBar-tab:not(:first-child):after,.flowide-container .lm-TabBar-tab:hover:after,.flowide-container .lm-TabBar-tab:hover+.lm-TabBar-tab:after,.flowide-container .lm-TabBar-tab .lm-TabBar-tabCloseIcon{display:none}.flowide-container .lm-TabBar-tab:hover:not(.lm-mod-current){background:var(--coz-mg-secondary-hovered)}.flowide-container .lm-TabBar-tab.lm-mod-current:before,.flowide-container .lm-TabBar-tab.lm-mod-current:after{display:none!important}.flowide-container .lm-TabBar-tab.lm-mod-current span{font-weight:500!important}.flowide-container .lm-TabBar-tabIcon{width:100%;display:block}.lm-mod-drag-image{border-radius:6px;position:relative;min-height:32px!important;max-height:32px!important;margin:0 4px!important;padding:0!important;overflow:visible!important}.lm-mod-drag-image .flow-tab-icon-label{align-items:center;width:100%;display:flex;overflow:hidden}.lm-mod-drag-image .flow-tab-icon-label .flow-TabBar-tabLabel-text{text-overflow:ellipsis;word-break:keep-all;white-space:nowrap;overflow:hidden}.lm-mod-drag-image .flow-tab-icon-label span{font-weight:500!important}.lm-mod-drag-image .flow-tab-icon-label .lm-TabBar-tabIcon{width:100%;display:block}.flow-tab-icon-label{cursor:pointer!important}.flow-Menu .flow-Menu-item .flow-Menu-itemLabel{font-size:14px;line-height:20px}.flow-Menu .flow-Menu-item .flow-Menu-itemShortcut{color:var(--coz-fg-dim);letter-spacing:1.2px;font-weight:700}.flow-Menu .flow-Menu-item[role~=menuitem]{min-height:32px!important}.flow-Menu .flow-Menu-item[role~=presentation]{background-color:var(--coz-stroke-primary);margin:4px 0;height:1px!important}',""]),t.Z=s},903979:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".template-form-kind2m .editor-container-v9qzn_{border:1px solid rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha))}.template-form-kind2m .editor-container-v9qzn_:focus-within{border-color:var(--semi-color-focus-border)}.template-form-kind2m .semi-form-field{padding-top:0}.template-form-kind2m .semi-upload-picture .semi-upload-picture-add{border:1px solid rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha));background-color:transparent}.template-form-kind2m .semi-upload-picture .semi-upload-picture-file-card-error{outline-offset:-1px}.template-form-kind2m .coz-single-select .semi-radio{margin-top:3px;margin-bottom:3px}.template-form-kind2m .coz-single-select .semi-radio .semi-radio-addon-buttonRadio{border-radius:6px}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-wrapper{border-color:rgba(var(--coze-stroke-6),var(--coze-stroke-6-alpha))}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-wrapper-focus{border-color:var(--semi-color-focus-border)}.template-form-kind2m .coz-input-number.semi-input-number .semi-input-suffix{margin-right:30px;font-size:12px;font-weight:400}",""]),s.locals={"template-form":"template-form-kind2m",templateForm:"template-form-kind2m","editor-container":"editor-container-v9qzn_",editorContainer:"editor-container-v9qzn_"},t.Z=s},801210:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".highlight-EyZl50{border-radius:4px;animation:3s forwards highlight-animation-FUji_T}@keyframes highlight-animation-FUji_T{0%{background-color:rgba(var(--coze-brand-0),var(--coze-brand-0-alpha))}to{background-color:transparent}}",""]),s.locals={highlight:"highlight-EyZl50","highlight-animation":"highlight-animation-FUji_T",highlightAnimation:"highlight-animation-FUji_T"},t.Z=s},960878:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".mask-B9qkmd{background:linear-gradient(180deg,rgba(var(--coze-bg-2),var(--coze-bg-2-alpha))0 85%,transparent 100%)}",""]),s.locals={mask:"mask-B9qkmd"},t.Z=s},793828:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".desc-input-ty8_FN>input{text-overflow:ellipsis}",""]),s.locals={"desc-input":"desc-input-ty8_FN",descInput:"desc-input-ty8_FN"},t.Z=s},788504:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,'.publish-collapse-VlVg4U .semi-collapse-item{border-bottom:1px solid var(--coz-stroke-primary);position:relative}.publish-collapse-VlVg4U .semi-collapse-item:hover{border-color:var(--coz-bg-primary)}.publish-collapse-VlVg4U .semi-collapse-header:hover:before{content:"";background-color:var(--coz-bg-primary);width:100%;height:1px;position:absolute;top:-1px;left:0}.publish-collapse-VlVg4U .semi-collapse-header{border-radius:0;margin:0;padding:8px 0}.publish-collapse-VlVg4U .semi-collapse-header:hover{background:var(--coz-mg-secondary-hovered);border-radius:8px}.publish-collapse-VlVg4U .semi-collapse-header:active{background:var(--coz-mg-secondary-pressed)}.publish-collapse-VlVg4U .semi-collapse-header-icon{margin:4px}.publish-collapse-VlVg4U .semi-collapse-content{padding:4px 0 16px}.publish-collapse-VlVg4U .semi-collapse-item:last-child{border:none}.publish-collapse-VlVg4U .semi-form-field-label{line-height:20px}.publish-cards-cgmQMc .semi-select.coz-select{border-radius:var(--small,6px);height:24px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-inset-label{color:var(--coz-fg-secondary);margin:0 4px;font-size:12px;font-weight:400}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-selection .semi-select-selection-text{font-size:12px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-arrow{width:22px}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-empty{margin-left:0}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse{align-items:center;gap:2px;line-height:normal}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse .semi-overflow-list-item{display:flex}.publish-cards-cgmQMc .semi-select.coz-select .semi-select-content-wrapper-collapse .semi-overflow-list-overflow{display:flex}.publish-cards-cgmQMc .semi-select.coz-select .semi-tag{background:var(--coz-mg_primary,rgba(6,7,9,.08));border-radius:2px;height:16px;padding:2px}.publish-cards-cgmQMc .semi-select-error{border:1px solid var(--coz-stroke-hglt-red)}.publish-cards-cgmQMc .coz-checkbox.semi-checkbox-unChecked .semi-checkbox-inner-display{border-color:var(--coz-stroke-plus)}.project-vxjogy .semi-form-field-error-message{color:var(--coz-fg-hglt-red);font-size:12px;line-height:16px}.project-vxjogy .semi-input{border-radius:8px}.project-vxjogy .semi-form-field{padding:0}.project-vxjogy .semi-input-textarea{height:72px}',""]),s.locals={"publish-collapse":"publish-collapse-VlVg4U",publishCollapse:"publish-collapse-VlVg4U","publish-cards":"publish-cards-cgmQMc",publishCards:"publish-cards-cgmQMc",project:"project-vxjogy"},t.Z=s},727683:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,".web-sdk-guide-_xvOoZ ol li::marker{color:var(--coz-fg-secondary);font-weight:500}.web-sdk-guide-_xvOoZ [class^=code-block-element]{height:160px}.web-sdk-guide-_xvOoZ [class^=code-block-element] [class^=content]{flex-shrink:1;overflow:auto}.web-sdk-guide-_xvOoZ [class^=code-block-element] [class^=content] pre{overflow:visible}",""]),s.locals={"web-sdk-guide":"web-sdk-guide-_xvOoZ",webSdkGuide:"web-sdk-guide-_xvOoZ"},t.Z=s},950367:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a),l=n(964824),c=n.n(l),d=new URL(n(782095),n.b),u=s()(o()),h=c()(d);u.push([e.id,`@font-face{font-family:codicon;font-display:block;src:url(${h})format("truetype")}.codicon[class*=codicon-]{text-rendering:auto;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font:16px/1 codicon;text-decoration:none;display:inline-block}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin{animation:1.5s steps(30,end) infinite codicon-spin}.codicon-modifier-disabled{opacity:.5}.codicon-modifier-hidden{opacity:0}.codicon-loading{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.codicon-add:before,.codicon-plus:before,.codicon-gist-new:before,.codicon-repo-create:before{content:""}.codicon-lightbulb:before,.codicon-light-bulb:before{content:""}.codicon-repo:before,.codicon-repo-delete:before{content:""}.codicon-gist-fork:before,.codicon-repo-forked:before{content:""}.codicon-git-pull-request:before,.codicon-git-pull-request-abandoned:before{content:""}.codicon-record-keys:before,.codicon-keyboard:before{content:""}.codicon-tag:before,.codicon-git-pull-request-label:before,.codicon-tag-add:before,.codicon-tag-remove:before{content:""}.codicon-person:before,.codicon-person-follow:before,.codicon-person-outline:before,.codicon-person-filled:before{content:""}.codicon-git-branch:before,.codicon-git-branch-create:before,.codicon-git-branch-delete:before,.codicon-source-control:before{content:""}.codicon-mirror:before,.codicon-mirror-public:before{content:""}.codicon-star:before,.codicon-star-add:before,.codicon-star-delete:before,.codicon-star-empty:before{content:""}.codicon-comment:before,.codicon-comment-add:before{content:""}.codicon-alert:before,.codicon-warning:before{content:""}.codicon-search:before,.codicon-search-save:before{content:""}.codicon-log-out:before,.codicon-sign-out:before{content:""}.codicon-log-in:before,.codicon-sign-in:before{content:""}.codicon-eye:before,.codicon-eye-unwatch:before,.codicon-eye-watch:before{content:""}.codicon-circle-filled:before,.codicon-primitive-dot:before,.codicon-close-dirty:before,.codicon-debug-breakpoint:before,.codicon-debug-breakpoint-disabled:before,.codicon-debug-hint:before,.codicon-terminal-decoration-success:before{content:""}.codicon-primitive-square:before{content:""}.codicon-edit:before,.codicon-pencil:before{content:""}.codicon-info:before,.codicon-issue-opened:before{content:""}.codicon-gist-private:before,.codicon-git-fork-private:before,.codicon-lock:before,.codicon-mirror-private:before{content:""}.codicon-close:before,.codicon-remove-close:before,.codicon-x:before{content:""}.codicon-repo-sync:before,.codicon-sync:before{content:""}.codicon-clone:before,.codicon-desktop-download:before{content:""}.codicon-beaker:before,.codicon-microscope:before{content:""}.codicon-vm:before,.codicon-device-desktop:before{content:""}.codicon-file:before,.codicon-file-text:before{content:""}.codicon-more:before,.codicon-ellipsis:before,.codicon-kebab-horizontal:before{content:""}.codicon-mail-reply:before,.codicon-reply:before{content:""}.codicon-organization:before,.codicon-organization-filled:before,.codicon-organization-outline:before{content:""}.codicon-new-file:before,.codicon-file-add:before{content:""}.codicon-new-folder:before,.codicon-file-directory-create:before{content:""}.codicon-trash:before,.codicon-trashcan:before{content:""}.codicon-history:before,.codicon-clock:before{content:""}.codicon-folder:before,.codicon-file-directory:before,.codicon-symbol-folder:before{content:""}.codicon-logo-github:before,.codicon-mark-github:before,.codicon-github:before{content:""}.codicon-terminal:before,.codicon-console:before,.codicon-repl:before{content:""}.codicon-zap:before,.codicon-symbol-event:before{content:""}.codicon-error:before,.codicon-stop:before{content:""}.codicon-variable:before,.codicon-symbol-variable:before{content:""}.codicon-array:before,.codicon-symbol-array:before{content:""}.codicon-symbol-module:before,.codicon-symbol-package:before,.codicon-symbol-namespace:before,.codicon-symbol-object:before{content:""}.codicon-symbol-method:before,.codicon-symbol-function:before,.codicon-symbol-constructor:before{content:""}.codicon-symbol-boolean:before,.codicon-symbol-null:before{content:""}.codicon-symbol-numeric:before,.codicon-symbol-number:before{content:""}.codicon-symbol-structure:before,.codicon-symbol-struct:before{content:""}.codicon-symbol-parameter:before,.codicon-symbol-type-parameter:before{content:""}.codicon-symbol-key:before,.codicon-symbol-text:before{content:""}.codicon-symbol-reference:before,.codicon-go-to-file:before{content:""}.codicon-symbol-enum:before,.codicon-symbol-value:before{content:""}.codicon-symbol-ruler:before,.codicon-symbol-unit:before{content:""}.codicon-activate-breakpoints:before{content:""}.codicon-archive:before{content:""}.codicon-arrow-both:before{content:""}.codicon-arrow-down:before{content:""}.codicon-arrow-left:before{content:""}.codicon-arrow-right:before{content:""}.codicon-arrow-small-down:before{content:""}.codicon-arrow-small-left:before{content:""}.codicon-arrow-small-right:before{content:""}.codicon-arrow-small-up:before{content:""}.codicon-arrow-up:before{content:""}.codicon-bell:before{content:""}.codicon-bold:before{content:""}.codicon-book:before{content:""}.codicon-bookmark:before{content:""}.codicon-debug-breakpoint-conditional-unverified:before{content:""}.codicon-debug-breakpoint-conditional:before,.codicon-debug-breakpoint-conditional-disabled:before{content:""}.codicon-debug-breakpoint-data-unverified:before{content:""}.codicon-debug-breakpoint-data:before,.codicon-debug-breakpoint-data-disabled:before{content:""}.codicon-debug-breakpoint-log-unverified:before{content:""}.codicon-debug-breakpoint-log:before,.codicon-debug-breakpoint-log-disabled:before{content:""}.codicon-briefcase:before{content:""}.codicon-broadcast:before{content:""}.codicon-browser:before{content:""}.codicon-bug:before{content:""}.codicon-calendar:before{content:""}.codicon-case-sensitive:before{content:""}.codicon-check:before{content:""}.codicon-checklist:before{content:""}.codicon-chevron-down:before{content:""}.codicon-chevron-left:before{content:""}.codicon-chevron-right:before{content:""}.codicon-chevron-up:before{content:""}.codicon-chrome-close:before{content:""}.codicon-chrome-maximize:before{content:""}.codicon-chrome-minimize:before{content:""}.codicon-chrome-restore:before{content:""}.codicon-circle-outline:before,.codicon-circle:before,.codicon-debug-breakpoint-unverified:before,.codicon-terminal-decoration-incomplete:before{content:""}.codicon-circle-slash:before{content:""}.codicon-circuit-board:before{content:""}.codicon-clear-all:before{content:""}.codicon-clippy:before{content:""}.codicon-close-all:before{content:""}.codicon-cloud-download:before{content:""}.codicon-cloud-upload:before{content:""}.codicon-code:before{content:""}.codicon-collapse-all:before{content:""}.codicon-color-mode:before{content:""}.codicon-comment-discussion:before{content:""}.codicon-credit-card:before{content:""}.codicon-dash:before{content:""}.codicon-dashboard:before{content:""}.codicon-database:before{content:""}.codicon-debug-continue:before{content:""}.codicon-debug-disconnect:before{content:""}.codicon-debug-pause:before{content:""}.codicon-debug-restart:before{content:""}.codicon-debug-start:before{content:""}.codicon-debug-step-into:before{content:""}.codicon-debug-step-out:before{content:""}.codicon-debug-step-over:before{content:""}.codicon-debug-stop:before{content:""}.codicon-debug:before{content:""}.codicon-device-camera-video:before{content:""}.codicon-device-camera:before{content:""}.codicon-device-mobile:before{content:""}.codicon-diff-added:before{content:""}.codicon-diff-ignored:before{content:""}.codicon-diff-modified:before{content:""}.codicon-diff-removed:before{content:""}.codicon-diff-renamed:before{content:""}.codicon-diff:before,.codicon-diff-sidebyside:before{content:""}.codicon-discard:before{content:""}.codicon-editor-layout:before{content:""}.codicon-empty-window:before{content:""}.codicon-exclude:before{content:""}.codicon-extensions:before{content:""}.codicon-eye-closed:before{content:""}.codicon-file-binary:before{content:""}.codicon-file-code:before{content:""}.codicon-file-media:before{content:""}.codicon-file-pdf:before{content:""}.codicon-file-submodule:before{content:""}.codicon-file-symlink-directory:before{content:""}.codicon-file-symlink-file:before{content:""}.codicon-file-zip:before{content:""}.codicon-files:before{content:""}.codicon-filter:before{content:""}.codicon-flame:before{content:""}.codicon-fold-down:before{content:""}.codicon-fold-up:before{content:""}.codicon-fold:before{content:""}.codicon-folder-active:before{content:""}.codicon-folder-opened:before{content:""}.codicon-gear:before{content:""}.codicon-gift:before{content:""}.codicon-gist-secret:before{content:""}.codicon-gist:before{content:""}.codicon-git-commit:before{content:""}.codicon-git-compare:before,.codicon-compare-changes:before{content:""}.codicon-git-merge:before{content:""}.codicon-github-action:before{content:""}.codicon-github-alt:before{content:""}.codicon-globe:before{content:""}.codicon-grabber:before{content:""}.codicon-graph:before{content:""}.codicon-gripper:before{content:""}.codicon-heart:before{content:""}.codicon-home:before{content:""}.codicon-horizontal-rule:before{content:""}.codicon-hubot:before{content:""}.codicon-inbox:before{content:""}.codicon-issue-reopened:before{content:""}.codicon-issues:before{content:""}.codicon-italic:before{content:""}.codicon-jersey:before{content:""}.codicon-json:before{content:""}.codicon-kebab-vertical:before{content:""}.codicon-key:before{content:""}.codicon-law:before{content:""}.codicon-lightbulb-autofix:before{content:""}.codicon-link-external:before{content:""}.codicon-link:before{content:""}.codicon-list-ordered:before{content:""}.codicon-list-unordered:before{content:""}.codicon-live-share:before{content:""}.codicon-loading:before{content:""}.codicon-location:before{content:""}.codicon-mail-read:before{content:""}.codicon-mail:before{content:""}.codicon-markdown:before{content:""}.codicon-megaphone:before{content:""}.codicon-mention:before{content:""}.codicon-milestone:before,.codicon-git-pull-request-milestone:before{content:""}.codicon-mortar-board:before{content:""}.codicon-move:before{content:""}.codicon-multiple-windows:before{content:""}.codicon-mute:before{content:""}.codicon-no-newline:before{content:""}.codicon-note:before{content:""}.codicon-octoface:before{content:""}.codicon-open-preview:before{content:""}.codicon-package:before{content:""}.codicon-paintcan:before{content:""}.codicon-pin:before{content:""}.codicon-play:before,.codicon-run:before{content:""}.codicon-plug:before{content:""}.codicon-preserve-case:before{content:""}.codicon-preview:before{content:""}.codicon-project:before{content:""}.codicon-pulse:before{content:""}.codicon-question:before{content:""}.codicon-quote:before{content:""}.codicon-radio-tower:before{content:""}.codicon-reactions:before{content:""}.codicon-references:before{content:""}.codicon-refresh:before{content:""}.codicon-regex:before{content:""}.codicon-remote-explorer:before{content:""}.codicon-remote:before{content:""}.codicon-remove:before{content:""}.codicon-replace-all:before{content:""}.codicon-replace:before{content:""}.codicon-repo-clone:before{content:""}.codicon-repo-force-push:before{content:""}.codicon-repo-pull:before{content:""}.codicon-repo-push:before{content:""}.codicon-report:before{content:""}.codicon-request-changes:before{content:""}.codicon-rocket:before{content:""}.codicon-root-folder-opened:before{content:""}.codicon-root-folder:before{content:""}.codicon-rss:before{content:""}.codicon-ruby:before{content:""}.codicon-save-all:before{content:""}.codicon-save-as:before{content:""}.codicon-save:before{content:""}.codicon-screen-full:before{content:""}.codicon-screen-normal:before{content:""}.codicon-search-stop:before{content:""}.codicon-server:before{content:""}.codicon-settings-gear:before{content:""}.codicon-settings:before{content:""}.codicon-shield:before{content:""}.codicon-smiley:before{content:""}.codicon-sort-precedence:before{content:""}.codicon-split-horizontal:before{content:""}.codicon-split-vertical:before{content:""}.codicon-squirrel:before{content:""}.codicon-star-full:before{content:""}.codicon-star-half:before{content:""}.codicon-symbol-class:before{content:""}.codicon-symbol-color:before{content:""}.codicon-symbol-constant:before{content:""}.codicon-symbol-enum-member:before{content:""}.codicon-symbol-field:before{content:""}.codicon-symbol-file:before{content:""}.codicon-symbol-interface:before{content:""}.codicon-symbol-keyword:before{content:""}.codicon-symbol-misc:before{content:""}.codicon-symbol-operator:before{content:""}.codicon-symbol-property:before,.codicon-wrench:before,.codicon-wrench-subaction:before{content:""}.codicon-symbol-snippet:before{content:""}.codicon-tasklist:before{content:""}.codicon-telescope:before{content:""}.codicon-text-size:before{content:""}.codicon-three-bars:before{content:""}.codicon-thumbsdown:before{content:""}.codicon-thumbsup:before{content:""}.codicon-tools:before{content:""}.codicon-triangle-down:before{content:""}.codicon-triangle-left:before{content:""}.codicon-triangle-right:before{content:""}.codicon-triangle-up:before{content:""}.codicon-twitter:before{content:""}.codicon-unfold:before{content:""}.codicon-unlock:before{content:""}.codicon-unmute:before{content:""}.codicon-unverified:before{content:""}.codicon-verified:before{content:""}.codicon-versions:before{content:""}.codicon-vm-active:before{content:""}.codicon-vm-outline:before{content:""}.codicon-vm-running:before{content:""}.codicon-watch:before{content:""}.codicon-whitespace:before{content:""}.codicon-whole-word:before{content:""}.codicon-window:before{content:""}.codicon-word-wrap:before{content:""}.codicon-zoom-in:before{content:""}.codicon-zoom-out:before{content:""}.codicon-list-filter:before{content:""}.codicon-list-flat:before{content:""}.codicon-list-selection:before,.codicon-selection:before{content:""}.codicon-list-tree:before{content:""}.codicon-debug-breakpoint-function-unverified:before{content:""}.codicon-debug-breakpoint-function:before,.codicon-debug-breakpoint-function-disabled:before{content:""}.codicon-debug-stackframe-active:before{content:""}.codicon-circle-small-filled:before,.codicon-debug-stackframe-dot:before,.codicon-terminal-decoration-mark:before{content:""}.codicon-debug-stackframe:before,.codicon-debug-stackframe-focused:before{content:""}.codicon-debug-breakpoint-unsupported:before{content:""}.codicon-symbol-string:before{content:""}.codicon-debug-reverse-continue:before{content:""}.codicon-debug-step-back:before{content:""}.codicon-debug-restart-frame:before{content:""}.codicon-debug-alt:before{content:""}.codicon-call-incoming:before{content:""}.codicon-call-outgoing:before{content:""}.codicon-menu:before{content:""}.codicon-expand-all:before{content:""}.codicon-feedback:before,.codicon-git-pull-request-reviewer:before{content:""}.codicon-group-by-ref-type:before{content:""}.codicon-ungroup-by-ref-type:before{content:""}.codicon-account:before,.codicon-git-pull-request-assignee:before{content:""}.codicon-bell-dot:before{content:""}.codicon-debug-console:before{content:""}.codicon-library:before{content:""}.codicon-output:before{content:""}.codicon-run-all:before{content:""}.codicon-sync-ignored:before{content:""}.codicon-pinned:before{content:""}.codicon-github-inverted:before{content:""}.codicon-server-process:before{content:""}.codicon-server-environment:before{content:""}.codicon-pass:before,.codicon-issue-closed:before{content:""}.codicon-stop-circle:before{content:""}.codicon-play-circle:before{content:""}.codicon-record:before{content:""}.codicon-debug-alt-small:before{content:""}.codicon-vm-connect:before{content:""}.codicon-cloud:before{content:""}.codicon-merge:before{content:""}.codicon-export:before{content:""}.codicon-graph-left:before{content:""}.codicon-magnet:before{content:""}.codicon-notebook:before{content:""}.codicon-redo:before{content:""}.codicon-check-all:before{content:""}.codicon-pinned-dirty:before{content:""}.codicon-pass-filled:before{content:""}.codicon-circle-large-filled:before{content:""}.codicon-circle-large:before,.codicon-circle-large-outline:before{content:""}.codicon-combine:before,.codicon-gather:before{content:""}.codicon-table:before{content:""}.codicon-variable-group:before{content:""}.codicon-type-hierarchy:before{content:""}.codicon-type-hierarchy-sub:before{content:""}.codicon-type-hierarchy-super:before{content:""}.codicon-git-pull-request-create:before{content:""}.codicon-run-above:before{content:""}.codicon-run-below:before{content:""}.codicon-notebook-template:before{content:""}.codicon-debug-rerun:before{content:""}.codicon-workspace-trusted:before{content:""}.codicon-workspace-untrusted:before{content:""}.codicon-workspace-unknown:before{content:""}.codicon-terminal-cmd:before{content:""}.codicon-terminal-debian:before{content:""}.codicon-terminal-linux:before{content:""}.codicon-terminal-powershell:before{content:""}.codicon-terminal-tmux:before{content:""}.codicon-terminal-ubuntu:before{content:""}.codicon-terminal-bash:before{content:""}.codicon-arrow-swap:before{content:""}.codicon-copy:before{content:""}.codicon-person-add:before{content:""}.codicon-filter-filled:before{content:""}.codicon-wand:before{content:""}.codicon-debug-line-by-line:before{content:""}.codicon-inspect:before{content:""}.codicon-layers:before{content:""}.codicon-layers-dot:before{content:""}.codicon-layers-active:before{content:""}.codicon-compass:before{content:""}.codicon-compass-dot:before{content:""}.codicon-compass-active:before{content:""}.codicon-azure:before{content:""}.codicon-issue-draft:before{content:""}.codicon-git-pull-request-closed:before{content:""}.codicon-git-pull-request-draft:before{content:""}.codicon-debug-all:before{content:""}.codicon-debug-coverage:before{content:""}.codicon-run-errors:before{content:""}.codicon-folder-library:before{content:""}.codicon-debug-continue-small:before{content:""}.codicon-beaker-stop:before{content:""}.codicon-graph-line:before{content:""}.codicon-graph-scatter:before{content:""}.codicon-pie-chart:before{content:""}.codicon-bracket:before{content:""}.codicon-bracket-dot:before{content:""}.codicon-bracket-error:before{content:""}.codicon-lock-small:before{content:""}.codicon-azure-devops:before{content:""}.codicon-verified-filled:before{content:""}.codicon-newline:before{content:""}.codicon-layout:before{content:""}.codicon-layout-activitybar-left:before{content:""}.codicon-layout-activitybar-right:before{content:""}.codicon-layout-panel-left:before{content:""}.codicon-layout-panel-center:before{content:""}.codicon-layout-panel-justify:before{content:""}.codicon-layout-panel-right:before{content:""}.codicon-layout-panel:before{content:""}.codicon-layout-sidebar-left:before{content:""}.codicon-layout-sidebar-right:before{content:""}.codicon-layout-statusbar:before{content:""}.codicon-layout-menubar:before{content:""}.codicon-layout-centered:before{content:""}.codicon-target:before{content:""}.codicon-indent:before{content:""}.codicon-record-small:before{content:""}.codicon-error-small:before,.codicon-terminal-decoration-error:before{content:""}.codicon-arrow-circle-down:before{content:""}.codicon-arrow-circle-left:before{content:""}.codicon-arrow-circle-right:before{content:""}.codicon-arrow-circle-up:before{content:""}.codicon-layout-sidebar-right-off:before{content:""}.codicon-layout-panel-off:before{content:""}.codicon-layout-sidebar-left-off:before{content:""}.codicon-blank:before{content:""}.codicon-heart-filled:before{content:""}.codicon-map:before,.codicon-map-horizontal:before,.codicon-fold-horizontal:before{content:""}.codicon-map-filled:before,.codicon-map-horizontal-filled:before,.codicon-fold-horizontal-filled:before{content:""}.codicon-circle-small:before{content:""}.codicon-bell-slash:before{content:""}.codicon-bell-slash-dot:before{content:""}.codicon-comment-unresolved:before{content:""}.codicon-git-pull-request-go-to-changes:before{content:""}.codicon-git-pull-request-new-changes:before{content:""}.codicon-search-fuzzy:before{content:""}.codicon-comment-draft:before{content:""}.codicon-send:before{content:""}.codicon-sparkle:before{content:""}.codicon-insert:before{content:""}.codicon-mic:before{content:""}.codicon-thumbsdown-filled:before{content:""}.codicon-thumbsup-filled:before{content:""}.codicon-coffee:before{content:""}.codicon-snake:before{content:""}.codicon-game:before{content:""}.codicon-vr:before{content:""}.codicon-chip:before{content:""}.codicon-piano:before{content:""}.codicon-music:before{content:""}.codicon-mic-filled:before{content:""}.codicon-repo-fetch:before{content:""}.codicon-copilot:before{content:""}.codicon-lightbulb-sparkle:before{content:""}.codicon-robot:before{content:""}.codicon-sparkle-filled:before{content:""}.codicon-diff-single:before{content:""}.codicon-diff-multiple:before{content:""}.codicon-surround-with:before{content:""}.codicon-share:before{content:""}.codicon-git-stash:before{content:""}.codicon-git-stash-apply:before{content:""}.codicon-git-stash-pop:before{content:""}.codicon-vscode:before{content:""}.codicon-vscode-insiders:before{content:""}.codicon-code-oss:before{content:""}.codicon-run-coverage:before{content:""}.codicon-run-all-coverage:before{content:""}.codicon-coverage:before{content:""}.codicon-github-project:before{content:""}.codicon-map-vertical:before,.codicon-fold-vertical:before{content:""}.codicon-map-vertical-filled:before,.codicon-fold-vertical-filled:before{content:""}.codicon-go-to-search:before{content:""}.codicon-percentage:before,.codicon-sort-percentage:before{content:""}.codicon-git-fetch:before{content:""}`,""]),t.Z=u},981071:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,'.lm-Widget{box-sizing:border-box;position:relative;overflow:hidden}.lm-Widget.lm-mod-hidden{display:none!important}.lm-DockPanel,.lm-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.lm-DockPanel-handle:after{content:"";width:100%;height:100%;position:absolute;top:0;left:0}.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after{min-width:8px;left:50%;transform:translate(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-DockPanel-overlay{pointer-events:none;z-index:3;box-sizing:border-box}.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.lm-SplitPanel-child{z-index:0}.lm-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.lm-SplitPanel-handle:after{content:"";width:100%;height:100%;position:absolute;top:0;left:0}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{min-width:8px;left:50%;transform:translate(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{min-height:8px;top:50%;transform:translateY(-50%)}.lm-TabBar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex}.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.lm-TabBar-content{flex:auto;margin:0;padding:0;list-style-type:none;display:flex}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.lm-TabBar-tab{touch-action:none;box-sizing:border-box;flex-direction:row;display:flex;overflow:hidden}.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:none}.lm-TabBar-tabLabel{white-space:nowrap;flex:auto;overflow:hidden}.lm-TabBar-tabInput{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;box-sizing:border-box;width:100%}.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{transition:left .15s;left:0}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{transition:top .15s;top:0}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;box-sizing:border-box;background:inherit;width:100%}.lm-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel{z-index:0}.lm-DockPanel-overlay{background:rgba(255,255,255,.6);border:1px dashed #000;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.lm-TabBar{min-height:24px;max-height:24px}.lm-TabBar-content{border-bottom:1px solid silver;align-items:flex-end;min-width:0;min-height:0}.lm-TabBar-tab{background:#e5e5e5;border:1px solid silver;border-bottom:none;flex:0 125px;min-width:35px;min-height:20px;max-height:20px;margin-left:-1px;padding:0 10px;font:12px/20px Helvetica,Arial,sans-serif}.lm-TabBar-tabLabel .lm-TabBar-tabInput{border:0;padding:0;font:12px Helvetica,Arial,sans-serif}.lm-TabBar-tab.lm-mod-current{background:#fff;min-height:23px;max-height:23px;transform:translateY(1px)}.lm-TabBar-tab:hover:not(.lm-mod-current){background:#f0f0f0}.lm-TabBar-tab:first-child{margin-left:0}.lm-TabBar-tabIcon,.lm-TabBar-tabLabel,.lm-TabBar-tabCloseIcon{display:inline-block}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon{margin-left:4px}.lm-TabBar .lm-TabBar-addButton{border-bottom:1px solid silver;padding:0 6px}.lm-TabBar-tab.lm-mod-drag-image{border:none;min-width:125px;min-height:23px;max-height:23px;box-shadow:1px 1px 2px rgba(0,0,0,.3)}',""]),t.Z=s},268063:function(e,t,n){"use strict";var r=n(125161),o=n.n(r),a=n(404442),s=n.n(a)()(o());s.push([e.id,'.ide-ps{overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto;overflow:hidden!important}.ide-ps__rail-x{opacity:0;height:15px;transition:background-color .2s linear,opacity .2s linear;display:none;position:absolute;bottom:0}.ide-ps__rail-y{opacity:0;width:15px;transition:background-color .2s linear,opacity .2s linear;display:none;position:absolute;right:0}.ide-ps--active-x>.ide-ps__rail-x,.ide-ps--active-y>.ide-ps__rail-y{background-color:transparent;display:block}.ide-ps:hover>.ide-ps__rail-x,.ide-ps:hover>.ide-ps__rail-y,.ide-ps--focus>.ide-ps__rail-x,.ide-ps--focus>.ide-ps__rail-y,.ide-ps--scrolling-x>.ide-ps__rail-x,.ide-ps--scrolling-y>.ide-ps__rail-y{opacity:.6}.ide-ps .ide-ps__rail-x:hover,.ide-ps .ide-ps__rail-y:hover,.ide-ps .ide-ps__rail-x:focus,.ide-ps .ide-ps__rail-y:focus,.ide-ps .ide-ps__rail-x.ide-ps--clicking,.ide-ps .ide-ps__rail-y.ide-ps--clicking{opacity:.9}.ide-ps__thumb-x{background-color:#aaa;border-radius:6px;height:6px;transition:background-color .2s linear,height .2s ease-in-out;position:absolute;bottom:2px}.ide-ps__thumb-y{background-color:#aaa;border-radius:6px;width:6px;transition:background-color .2s linear,width .2s ease-in-out;position:absolute;right:2px}.ide-ps__rail-x:hover>.ide-ps__thumb-x,.ide-ps__rail-x:focus>.ide-ps__thumb-x,.ide-ps__rail-x.ide-ps--clicking .ide-ps__thumb-x{background-color:#999;height:11px}.ide-ps__rail-y:hover>.ide-ps__thumb-y,.ide-ps__rail-y:focus>.ide-ps__thumb-y,.ide-ps__rail-y.ide-ps--clicking .ide-ps__thumb-y{background-color:#999;width:11px}.lm-Widget::-webkit-scrollbar{background:0 0;width:10px;height:10px}.lm-Widget::-webkit-scrollbar:hover{background:0 0}.lm-Widget::-webkit-scrollbar-thumb{background:0 0}.lm-Widget::-webkit-scrollbar-corner{background:0 0}.lm-cursor-backdrop{will-change:transform;z-index:100;scrollbar-width:none;-ms-overflow-style:none;width:200px;height:200px;margin-top:-100px;margin-left:-100px;position:fixed;top:0;left:0;overflow:scroll}.lm-cursor-backdrop:after{content:"";width:1200px;height:1200px;display:block}.lm-cursor-backdrop::-webkit-scrollbar{display:none}.lm-mod-drag-image{will-change:transform;top:0;left:0}',""]),t.Z=s},354428:function(e,t,n){"use strict";n.r(t),n.d(t,{useMonaco:()=>X,DiffEditor:()=>Y,Editor:()=>J,loader:()=>z,default:()=>$});function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){var r,o,a;r=e,o=t,a=n[t],o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){var r,o,a;r=e,o=t,a=n[t],o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e){return function t(){for(var n=this,r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++)r[a]=arguments[a];return t.apply(n,[].concat(o,r))}}}function d(e){return({}).toString.call(e).includes("Object")}function u(e){return"function"==typeof e}var h,p,f,m=c(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),v=function(e,t){return!d(t)&&m("changeType"),Object.keys(t).some(function(t){var n,r;return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r)})&&m("changeField"),t},g=function(e){!u(e)&&m("selectorType")},b=function(e){!(u(e)||d(e))&&m("handlerType"),d(e)&&Object.values(e).some(function(e){return!u(e)})&&m("handlersType")},y=function(e){if(!e&&m("initialIsRequired"),!d(e)&&m("initialType"),!Object.keys(e).length)m("initialContent")};function _(e,t){return u(t)?t(e.current):t}function w(e,t){return e.current=l(l({},e.current),t),t}function x(e,t,n){return u(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var S={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "};var k=(h=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return r.length>=h.length?h.apply(this,r):function(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];return e.apply(t,[].concat(r,o))}})(S),C=function(e){var t;if(!e&&k("configIsRequired"),t=e,!({}).toString.call(t).includes("Object"))k("configType");return e.urls?(function(){console.warn(S.deprecation)}(),{paths:{vs:e.urls.monacoBase}}):e},j=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},E={type:"cancelation",msg:"operation is manually canceled"},T=function(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(E):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n};var I=(f=2,function(e){if(Array.isArray(e))return e}(p=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(e),b(t);var n={current:e},r=c(x)(n,t),o=c(w)(n),a=c(v)(e),s=c(_)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return g(e),e(n.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(r,o,a,s)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var s,l=e[Symbol.iterator]();!(r=(s=l.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&null!=l.return&&l.return()}finally{if(o)throw a}}return n}}(p,2)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}(p,f)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),P=I[0],M=I[1];function R(e){return document.body.appendChild(e)}function D(e){var t,n,r=P(function(e){return{config:e.config,reject:e.reject}});var o=(t="".concat(r.config.paths.vs,"/loader.js"),n=document.createElement("script"),t&&(n.src=t),n);return o.onload=function(){return e()},o.onerror=r.reject,o}function A(){var e=P(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){N(t),e.resolve(t)},function(t){e.reject(t)})}function N(e){!P().monaco&&M({monaco:e})}var L=new Promise(function(e,t){return M({resolve:e,reject:t})}),z={config:function(e){var t=C(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++){if(n=a[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(t,["monaco"]);M(function(e){return{config:function e(t,n){return Object.keys(n).forEach(function(r){n[r]instanceof Object&&t[r]&&Object.assign(n[r],e(t[r],n[r]))}),o(o({},t),n)}(e.config,r),monaco:n}})},init:function(){var e=P(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(M({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),T(L);if(window.monaco&&window.monaco.editor)return N(window.monaco),e.resolve(window.monaco),T(L);j(R,D)(A)}return T(L)},__getMonacoInstance:function(){return P(function(e){return e.monaco})}},O=n("455069"),B={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},W={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},F=function({children:e}){return O.createElement("div",{style:W},e)},H=(0,O.memo)(function({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:a,wrapperProps:s}){return O.createElement("section",{style:{...B.wrapper,width:e,height:t},...s},!n&&O.createElement(F,null,r),O.createElement("div",{ref:o,style:{...B.fullWidth,...!n&&B.hide},className:a}))}),U=function(e){(0,O.useEffect)(e,[])},V=function(e,t,n=!0){let r=(0,O.useRef)(!0);(0,O.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)};function K(){}function q(e,t,n,r){return function(e,t){return e.editor.getModel(Z(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?Z(e,r):void 0)}(e,t,n,r)}function Z(e,t){return e.Uri.parse(t)}var Y=(0,O.memo)(function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:a,modifiedModelPath:s,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:c=!1,theme:d="light",loading:u="Loading...",options:h={},height:p="100%",width:f="100%",className:m,wrapperProps:v={},beforeMount:g=K,onMount:b=K}){let[y,_]=(0,O.useState)(!1),[w,x]=(0,O.useState)(!0),S=(0,O.useRef)(null),k=(0,O.useRef)(null),C=(0,O.useRef)(null),j=(0,O.useRef)(b),E=(0,O.useRef)(g),T=(0,O.useRef)(!1);U(()=>{let e=z.init();return e.then(e=>(k.current=e)&&x(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>S.current?function(){let e=S.current?.getModel();l||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}():e.cancel()}),V(()=>{if(S.current&&k.current){let t=S.current.getOriginalEditor(),o=q(k.current,e||"",r||n||"text",a||"");o!==t.getModel()&&t.setModel(o)}},[a],y),V(()=>{if(S.current&&k.current){let e=S.current.getModifiedEditor(),r=q(k.current,t||"",o||n||"text",s||"");r!==e.getModel()&&e.setModel(r)}},[s],y),V(()=>{let e=S.current.getModifiedEditor();e.getOption(k.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],y),V(()=>{S.current?.getModel()?.original.setValue(e||"")},[e],y),V(()=>{let{original:e,modified:t}=S.current.getModel();k.current.editor.setModelLanguage(e,r||n||"text"),k.current.editor.setModelLanguage(t,o||n||"text")},[n,r,o],y),V(()=>{k.current?.editor.setTheme(d)},[d],y),V(()=>{S.current?.updateOptions(h)},[h],y);let I=(0,O.useCallback)(()=>{if(!k.current)return;E.current(k.current);let l=q(k.current,e||"",r||n||"text",a||""),c=q(k.current,t||"",o||n||"text",s||"");S.current?.setModel({original:l,modified:c})},[n,t,o,e,r,a,s]),P=(0,O.useCallback)(()=>{!T.current&&C.current&&(S.current=k.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...h}),I(),k.current?.editor.setTheme(d),_(!0),T.current=!0)},[h,d,I]);return(0,O.useEffect)(()=>{y&&j.current(S.current,k.current)},[y]),(0,O.useEffect)(()=>{w||y||P()},[w,y,P]),O.createElement(H,{width:f,height:p,isEditorReady:y,loading:u,_ref:C,className:m,wrapperProps:v})}),X=function(){let[e,t]=(0,O.useState)(z.__getMonacoInstance());return U(()=>{let n;return e||(n=z.init()).then(e=>{t(e)}),()=>n?.cancel()}),e},Q=function(e){let t=(0,O.useRef)();return(0,O.useEffect)(()=>{t.current=e},[e]),t.current},G=new Map,J=(0,O.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:a,theme:s="light",line:l,loading:c="Loading...",options:d={},overrideServices:u={},saveViewState:h=!0,keepCurrentModel:p=!1,width:f="100%",height:m="100%",className:v,wrapperProps:g={},beforeMount:b=K,onMount:y=K,onChange:_,onValidate:w=K}){let[x,S]=(0,O.useState)(!1),[k,C]=(0,O.useState)(!0),j=(0,O.useRef)(null),E=(0,O.useRef)(null),T=(0,O.useRef)(null),I=(0,O.useRef)(y),P=(0,O.useRef)(b),M=(0,O.useRef)(),R=(0,O.useRef)(r),D=Q(a),A=(0,O.useRef)(!1),N=(0,O.useRef)(!1);U(()=>{let e=z.init();return e.then(e=>(j.current=e)&&C(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>E.current?function(){M.current?.dispose(),p?h&&G.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}():e.cancel()}),V(()=>{let s=q(j.current,e||r||"",t||o||"",a||n||"");s!==E.current?.getModel()&&(h&&G.set(D,E.current?.saveViewState()),E.current?.setModel(s),h&&E.current?.restoreViewState(G.get(a)))},[a],x),V(()=>{E.current?.updateOptions(d)},[d],x),V(()=>{E.current&&void 0!==r&&(E.current.getOption(j.current.editor.EditorOption.readOnly)?E.current.setValue(r):r===E.current.getValue()||(N.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),N.current=!1))},[r],x),V(()=>{let e=E.current?.getModel();e&&o&&j.current?.editor.setModelLanguage(e,o)},[o],x),V(()=>{void 0!==l&&E.current?.revealLine(l)},[l],x),V(()=>{j.current?.editor.setTheme(s)},[s],x);let L=(0,O.useCallback)(()=>{if(!(!T.current||!j.current)&&!A.current){P.current(j.current);let c=a||n,p=q(j.current,r||e||"",t||o||"",c||"");E.current=j.current?.editor.create(T.current,{model:p,automaticLayout:!0,...d},u),h&&E.current.restoreViewState(G.get(c)),j.current.editor.setTheme(s),void 0!==l&&E.current.revealLine(l),S(!0),A.current=!0}},[e,t,n,r,o,a,d,u,h,s,l]);return(0,O.useEffect)(()=>{x&&I.current(E.current,j.current)},[x]),(0,O.useEffect)(()=>{k||x||L()},[k,x,L]),R.current=r,(0,O.useEffect)(()=>{x&&_&&(M.current?.dispose(),M.current=E.current?.onDidChangeModelContent(e=>{N.current||_(E.current.getValue(),e)}))},[x,_]),(0,O.useEffect)(()=>{if(x){let e=j.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=j.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,w]),O.createElement(H,{width:f,height:m,isEditorReady:x,loading:c,_ref:T,className:v,wrapperProps:g})}),$=J},484782:function(e,t,n){"use strict";n.d(t,{D:()=>eC});var r={};n.r(r),n.d(r,{boolean:()=>z,booleanish:()=>O,commaOrSpaceSeparated:()=>U,commaSeparated:()=>H,number:()=>W,overloadedBoolean:()=>B,spaceSeparated:()=>F});var o=n("455069"),a=n("830644"),s=n("812579"),l=n("651088"),c=n("930602");function d(e){let t=[],n=-1,r=0,o=0;for(;++n<e.length;){let a=e.charCodeAt(n),s="";if(37===a&&(0,c.H$)(e.charCodeAt(n+1))&&(0,c.H$)(e.charCodeAt(n+2)))o=2;else if(a<128)!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))&&(s=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(s=String.fromCharCode(a,t),o=1):s="<22>"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}var u=n("527678");let h=f("start"),p=f("end");function f(e){return function(t){let n=t&&t.position&&t.position[e]||{};return{line:n.line||null,column:n.column||null,offset:n.offset>-1?n.offset:null}}}let m={}.hasOwnProperty;function v(e){return String(e||"").toUpperCase()}function g(e,t){let n;let r=String(t.identifier).toUpperCase(),o=d(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);-1===a?(e.footnoteOrder.push(r),e.footnoteCounts[r]=1,n=e.footnoteOrder.length):(e.footnoteCounts[r]++,n=a+1);let s=e.footnoteCounts[r],l={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+o,id:e.clobberPrefix+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,l);let c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function b(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return{type:"text",value:"!["+t.alt+r};let o=e.all(t),a=o[0];a&&"text"===a.type?a.value="["+a.value:o.unshift({type:"text",value:"["});let s=o[o.length-1];return s&&"text"===s.type?s.value+=r:o.push({type:"text",value:r}),o}function y(e){let t=e.spread;return null==t?e.children.length>1:t}function _(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}let w={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,o={};r&&(o.className=["language-"+r]);let a={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:g,footnote:function(e,t){let n=e.footnoteById,r=1;for(;r in n;)r++;let o=String(r);return n[o]={type:"footnoteDefinition",identifier:o,children:[{type:"paragraph",children:t.children}],position:t.position},g(e,{type:"footnoteReference",identifier:o,position:t.position})},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.dangerous){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null},imageReference:function(e,t){let n=e.definition(t.identifier);if(!n)return b(e,t);let r={src:d(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(r.title=n.title);let o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){let n={src:d(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=e.definition(t.identifier);if(!n)return b(e,t);let r={href:d(n.url||"")};null!==n.title&&void 0!==n.title&&(r.title=n.title);let o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){let n={href:d(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=y(n[r])}return t}(n):y(t),a={},s=[];if("boolean"==typeof t.checked){let e;let n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){let e=r[l];(o||0!==l||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?s.push(e):s.push(...e.children)}let c=r[r.length-1];c&&(o||"element"!==c.type||"p"!==c.tagName)&&s.push({type:"text",value:"\n"});let d={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,d),e.applyData(t,d)},list:function(e,t){let n={},r=e.all(t),o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){let e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),o=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=h(t.children[1]),s=p(t.children[t.children.length-1]);a.line&&s.line&&(r.position={start:a,end:s}),o.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,s=a?a.length:t.children.length,l=-1,c=[];for(;++l<s;){let n=t.children[l],r={},s=a?a[l]:void 0;s&&(r.align=s);let d={type:"element",tagName:o,properties:r,children:[]};n&&(d.children=e.all(n),e.patch(n,d),d=e.applyData(t,d)),c.push(d)}let d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),o=0,a=[];for(;r;)a.push(_(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(_(t.slice(o),o>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:x,yaml:x,definition:x,footnoteDefinition:x};function x(){return null}let S={}.hasOwnProperty;function k(e,t){if(e.position){var n;t.position={start:h(n=e),end:p(n)}}}function C(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:[]}),"element"===n.type&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function j(e,t,n){let r=t&&t.type;if(!r)throw Error("Expected node, got `"+t+"`");return S.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:E(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):function(e,t){let n=t.data||{},r="value"in t&&!(S.call(n,"hProperties")||S.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:E(e,t)};return e.patch(t,r),e.applyData(t,r)}(e,t)}function E(e,t){let n=[];if("children"in t){let r=t.children,o=-1;for(;++o<r.length;){let a=j(e,r[o],t);if(a){if(o&&"break"===r[o-1].type&&(!Array.isArray(a)&&"text"===a.type&&(a.value=a.value.replace(/^\s+/,"")),!Array.isArray(a)&&"element"===a.type)){let e=a.children[0];e&&"text"===e.type&&(e.value=e.value.replace(/^\s+/,""))}Array.isArray(a)?n.push(...a):n.push(a)}}}return n}function T(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function I(e,t){let n=function(e,t){let n=t||{},r=n.allowDangerousHtml||!1,o={};return s.dangerous=r,s.clobberPrefix=void 0===n.clobberPrefix||null===n.clobberPrefix?"user-content-":n.clobberPrefix,s.footnoteLabel=n.footnoteLabel||"Footnotes",s.footnoteLabelTagName=n.footnoteLabelTagName||"h2",s.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},s.footnoteBackLabel=n.footnoteBackLabel||"Back to content",s.unknownHandler=n.unknownHandler,s.passThrough=n.passThrough,s.handlers={...w,...n.handlers},s.definition=function(e){let t=Object.create(null);if(!e||!e.type)throw Error("mdast-util-definitions expected node");return(0,u.Vn)(e,"definition",e=>{let n=v(e.identifier);n&&!m.call(t,n)&&(t[n]=e)}),function(e){let n=v(e);return n&&m.call(t,n)?t[n]:null}}(e),s.footnoteById=o,s.footnoteOrder=[],s.footnoteCounts={},s.patch=k,s.applyData=C,s.one=function(e,t){return j(s,e,t)},s.all=function(e){return E(s,e)},s.wrap=T,s.augment=a,(0,u.Vn)(e,"footnoteDefinition",e=>{let t=String(e.identifier).toUpperCase();!S.call(o,t)&&(o[t]=e)}),s;function a(e,t){if(e&&"data"in e&&e.data){let n=e.data;n.hName&&("element"!==t.type&&(t={type:"element",tagName:"",properties:{},children:[]}),t.tagName=n.hName),"element"===t.type&&n.hProperties&&(t.properties={...t.properties,...n.hProperties}),"children"in t&&t.children&&n.hChildren&&(t.children=n.hChildren)}if(e){var n;let r="type"in e?e:{position:e};if(!(!(n=r)||!n.position||!n.position.start||!n.position.start.line||!n.position.start.column||!n.position.end||!n.position.end.line||!n.position.end.column))t.position={start:h(r),end:p(r)}}return t}function s(e,t,n,r){return Array.isArray(n)&&(r=n,n={}),a(e,{type:"element",tagName:t,properties:n||{},children:r||[]})}}(e,t),r=n.one(e,null),o=function(e){let t=[],n=-1;for(;++n<e.footnoteOrder.length;){let r=e.footnoteById[e.footnoteOrder[n]];if(!r)continue;let o=e.all(r),a=String(r.identifier).toUpperCase(),s=d(a.toLowerCase()),l=0,c=[];for(;++l<=e.footnoteCounts[a];){let t={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};l>1&&t.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(l)}]}),c.length>0&&c.push({type:"text",value:" "}),c.push(t)}let u=o[o.length-1];if(u&&"element"===u.type&&"p"===u.tagName){let e=u.children[u.children.length-1];e&&"text"===e.type?e.value+=" ":u.children.push({type:"text",value:" "}),u.children.push(...c)}else o.push(...c);let h={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+s},children:e.wrap(o,!0)};e.patch(r,h),t.push(h)}if(0!==t.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:"\n"}]}}(n);return o&&r.children.push({type:"text",value:"\n"},o),Array.isArray(r)?{type:"root",children:r}:r}var P=function(e,t){return e&&"run"in e?function(e,t){return(n,r,o)=>{e.run(I(n,t),r,e=>{o(e)})}}(e,t):function(e){return t=>I(t,e)}(e||t)},M=n("274325");class R{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function D(e,t){let n={},r={},o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new R(n,r,t)}function A(e){return e.toLowerCase()}R.prototype.property={},R.prototype.normal={},R.prototype.space=null;class N{constructor(e,t){this.property=e,this.attribute=t}}N.prototype.space=null,N.prototype.boolean=!1,N.prototype.booleanish=!1,N.prototype.overloadedBoolean=!1,N.prototype.number=!1,N.prototype.commaSeparated=!1,N.prototype.spaceSeparated=!1,N.prototype.commaOrSpaceSeparated=!1,N.prototype.mustUseProperty=!1,N.prototype.defined=!1;let L=0,z=V(),O=V(),B=V(),W=V(),F=V(),H=V(),U=V();function V(){return 2**++L}let K=Object.keys(r);class q extends N{constructor(e,t,n,o){let a=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",o),"number"==typeof n)for(;++a<K.length;){let e=K[a];(function(e,t,n){n&&(e[t]=n)})(this,K[a],(n&r[e])===r[e])}}}function Z(e,t,n){n&&(e[t]=n)}q.prototype.defined=!0;let Y={}.hasOwnProperty;function X(e){let t;let n={},r={};for(t in e.properties)if(Y.call(e.properties,t)){let o=e.properties[t],a=new q(t,e.transform(e.attributes||{},t),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(t)&&(a.mustUseProperty=!0),n[t]=a,r[A(t)]=t,r[A(a.attribute)]=t}return new R(n,r,e.space)}let Q=X({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),G=X({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function J(e,t){return t in e?e[t]:t}function $(e,t){return J(e,t.toLowerCase())}let ee=X({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:$,properties:{xmlns:null,xmlnsXLink:null}}),et=X({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:O,ariaAutoComplete:null,ariaBusy:O,ariaChecked:O,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:F,ariaCurrent:null,ariaDescribedBy:F,ariaDetails:null,ariaDisabled:O,ariaDropEffect:F,ariaErrorMessage:null,ariaExpanded:O,ariaFlowTo:F,ariaGrabbed:O,ariaHasPopup:null,ariaHidden:O,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:F,ariaLevel:W,ariaLive:null,ariaModal:O,ariaMultiLine:O,ariaMultiSelectable:O,ariaOrientation:null,ariaOwns:F,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:O,ariaReadOnly:O,ariaRelevant:null,ariaRequired:O,ariaRoleDescription:F,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:O,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null}}),en=X({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:$,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:H,acceptCharset:F,accessKey:F,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:F,autoFocus:z,autoPlay:z,blocking:F,capture:null,charSet:null,checked:z,cite:null,className:F,cols:W,colSpan:null,content:null,contentEditable:O,controls:z,controlsList:F,coords:W|H,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:B,draggable:O,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:F,height:W,hidden:z,high:W,href:null,hrefLang:null,htmlFor:F,httpEquiv:F,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:F,itemRef:F,itemScope:z,itemType:F,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:z,optimum:W,pattern:null,ping:F,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:F,required:z,reversed:z,rows:W,rowSpan:W,sandbox:F,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:O,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:O,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:F,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:O,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:z,disableRemotePlayback:z,prefix:null,property:null,results:W,security:null,unselectable:null}}),er=X({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:J,properties:{about:U,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:F,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:H,g2:H,glyphName:H,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:U,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:F,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:U,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:U,rev:U,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:U,requiredFeatures:U,requiredFonts:U,requiredFormats:U,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:U,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:U,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:U,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),ei=D([G,Q,ee,et,en],"html"),eo=D([G,Q,ee,et,er],"svg");function ea(e){if(e.allowedElements&&e.disallowedElements)throw TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{(0,u.Vn)(t,"element",(t,n,r)=>{let o;if(e.allowedElements?o=!e.allowedElements.includes(t.tagName):e.disallowedElements&&(o=e.disallowedElements.includes(t.tagName)),!o&&e.allowElement&&"number"==typeof n&&(o=!e.allowElement(t,n,r)),o&&"number"==typeof n)return e.unwrapDisallowed&&t.children?r.children.splice(n,1,...t.children):r.children.splice(n,1),n})}}var es=n("339922");let el=/^data[-\w.:]+$/i,ec=/-[a-z]/g,ed=/[A-Z]/g;function eu(e){return"-"+e.toLowerCase()}function eh(e){return e.charAt(1).toUpperCase()}let ep={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var ef=n("263055"),em=n("889514"),ev=n("578419"),eg=n("657285");let eb={}.hasOwnProperty,ey=new Set(["table","thead","tbody","tfoot","tr"]);function e_(e,t){let n;let r=[],a=-1;for(;++a<t.children.length;)"element"===(n=t.children[a]).type?r.push(function(e,t,n,r){let a;let s=e.options,l=void 0===s.transformLinkUri?eg.A:s.transformLinkUri,c=e.schema,d=t.tagName,u={},h=c;if("html"===c.space&&"svg"===d&&(h=eo,e.schema=h),t.properties)for(a in t.properties)eb.call(t.properties,a)&&function(e,t,n,r){let o=function(e,t){let n=A(t),r=t,o=N;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&el.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(ec,eh);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ec.test(e)){let n=e.replace(ed,eu);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=q}return new o(r,t)}(r.schema,t),a=n;if(null!=a&&a==a)Array.isArray(a)&&(a=o.commaSeparated?(0,em.P)(a):(0,ef.P)(a)),"style"===o.property&&"string"==typeof a&&(a=function(e){let t={};try{ev(e,function(e,n){t[("-ms-"===e.slice(0,4)?`ms-${e.slice(4)}`:e).replace(/-([a-z])/g,ex)]=n})}catch{}return t}(a)),o.space&&o.property?e[eb.call(ep,o.property)?ep[o.property]:o.property]=a:o.attribute&&(e[o.attribute]=a)}(u,a,t.properties[a],e);("ol"===d||"ul"===d)&&e.listDepth++;let p=e_(e,t);("ol"===d||"ul"===d)&&e.listDepth--,e.schema=c;let f=t.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},m=s.components&&eb.call(s.components,d)?s.components[d]:d,v="string"==typeof m||m===o.Fragment;if(!es.isValidElementType(m))throw TypeError(`Component for name \`${d}\` not defined or is not renderable`);if(u.key=n,"a"===d&&s.linkTarget&&(u.target="function"==typeof s.linkTarget?s.linkTarget(String(u.href||""),t.children,"string"==typeof u.title?u.title:null):s.linkTarget),"a"===d&&l&&(u.href=l(String(u.href||""),t.children,"string"==typeof u.title?u.title:null)),!v&&"code"===d&&"element"===r.type&&"pre"!==r.tagName&&(u.inline=!0),!v&&("h1"===d||"h2"===d||"h3"===d||"h4"===d||"h5"===d||"h6"===d)&&(u.level=Number.parseInt(d.charAt(1),10)),"img"===d&&s.transformImageUri&&(u.src=s.transformImageUri(String(u.src||""),String(u.alt||""),"string"==typeof u.title?u.title:null)),!v&&"li"===d&&"element"===r.type){let e=function(e){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if("element"===n.type&&"input"===n.tagName)return n}return null}(t);u.checked=e&&e.properties?!!e.properties.checked:null,u.index=ew(r,t),u.ordered="ol"===r.tagName}return!v&&("ol"===d||"ul"===d)&&(u.ordered="ol"===d,u.depth=e.listDepth),("td"===d||"th"===d)&&(u.align&&(!u.style&&(u.style={}),u.style.textAlign=u.align,delete u.align),!v&&(u.isHeader="th"===d)),!v&&"tr"===d&&"element"===r.type&&(u.isHeader="thead"===r.tagName),s.sourcePos&&(u["data-sourcepos"]=function(e){return[e.start.line,":",e.start.column,"-",e.end.line,":",e.end.column].map(String).join("")}(f)),!v&&s.rawSourcePos&&(u.sourcePosition=t.position),!v&&s.includeElementIndex&&(u.index=ew(r,t),u.siblingCount=ew(r)),!v&&(u.node=t),p.length>0?o.createElement(m,u,p):o.createElement(m,u)}(e,n,a,t)):"text"===n.type?("element"!==t.type||!ey.has(t.tagName)||!function(e){let t=e&&"object"==typeof e&&"text"===e.type?e.value||"":e;return"string"==typeof t&&""===t.replace(/[ \t\n\f\r]/g,"")}(n))&&r.push(n.value):"raw"===n.type&&!e.options.skipHtml&&r.push(n.value);return r}function ew(e,t){let n=-1,r=0;for(;++n<e.children.length&&e.children[n]!==t;){;"element"===e.children[n].type&&r++}return r}function ex(e,t){return t.toUpperCase()}let eS={}.hasOwnProperty,ek={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function eC(e){for(let t in ek)if(eS.call(ek,t)&&eS.call(e,t)){let e=ek[t];console.warn(`[react-markdown] Warning: please ${e.to?`use \`${e.to}\` instead of`:"remove"} \`${t}\` (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#${e.id}> for more info)`),delete ek[t]}let t=(0,s.l)().use(l.Z).use(e.remarkPlugins||[]).use(P,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(ea,e),n=new a.k;"string"==typeof e.children?n.value=e.children:void 0!==e.children&&null!==e.children&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);let r=t.runSync(t.parse(n),n);if("root"!==r.type)throw TypeError("Expected a `root` node");let c=o.createElement(o.Fragment,{},e_({options:e,schema:ei,listDepth:0},r));return e.className&&(c=o.createElement("div",{className:e.className},c)),c}eC.propTypes={children:M.string,className:M.string,allowElement:M.func,allowedElements:M.arrayOf(M.string),disallowedElements:M.arrayOf(M.string),unwrapDisallowed:M.bool,remarkPlugins:M.arrayOf(M.oneOfType([M.object,M.func,M.arrayOf(M.oneOfType([M.bool,M.string,M.object,M.func,M.arrayOf(M.any)]))])),rehypePlugins:M.arrayOf(M.oneOfType([M.object,M.func,M.arrayOf(M.oneOfType([M.bool,M.string,M.object,M.func,M.arrayOf(M.any)]))])),sourcePos:M.bool,rawSourcePos:M.bool,skipHtml:M.bool,includeElementIndex:M.bool,transformLinkUri:M.oneOfType([M.func,M.bool]),linkTarget:M.oneOfType([M.func,M.string]),transformImageUri:M.func,components:M.object}},657285:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});let r=["http","https","mailto","tel"];function o(e){let t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;let o=t.indexOf(":");if(-1===o)return t;let a=-1;for(;++a<r.length;){let e=r[a];if(o===e.length&&t.slice(0,e.length).toLowerCase()===e)return t}return -1!==(a=t.indexOf("?"))&&o>a||-1!==(a=t.indexOf("#"))&&o>a?t:"javascript:void(0)"}}}]);
//# sourceMappingURL=6219.9016cdb0.js.map