mftsccs-browser 2.2.47-beta → 2.2.48-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! For license information please see wico-metadata.bundle.js.LICENSE.txt */
2
+ var e={38:e=>{class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},71:(e,t)=>{t.__esModule=!0,t.word=t.tilde=t.tab=t.str=t.space=t.slash=t.singleQuote=t.semicolon=t.plus=t.pipe=t.openSquare=t.openParenthesis=t.newline=t.greaterThan=t.feed=t.equals=t.doubleQuote=t.dollar=t.cr=t.comment=t.comma=t.combinator=t.colon=t.closeSquare=t.closeParenthesis=t.caret=t.bang=t.backslash=t.at=t.asterisk=t.ampersand=void 0;t.ampersand=38;t.asterisk=42;t.at=64;t.comma=44;t.colon=58;t.semicolon=59;t.openParenthesis=40;t.closeParenthesis=41;t.openSquare=91;t.closeSquare=93;t.dollar=36;t.tilde=126;t.caret=94;t.plus=43;t.equals=61;t.pipe=124;t.greaterThan=62;t.space=32;t.singleQuote=39;t.doubleQuote=34;t.slash=47;t.bang=33;t.backslash=92;t.cr=13;t.feed=12;t.newline=10;t.tab=9;t.str=39;t.comment=-1;t.word=-2;t.combinator=-3},145:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s},197:()=>{},263:(e,t)=>{t.__esModule=!0,t.default=function(e){return e.sort(function(e,t){return e-t})},e.exports=t.default},339:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.SELECTOR,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=a,e.exports=t.default},396:(e,t,n)=>{let o=n(7793);class i extends o{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=i,i.default=i,o.registerAtRule(i)},425:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.COMMENT,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=a,e.exports=t.default},518:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.ROOT,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,a(t,n);var i,c,l,d=o.prototype;return d.toString=function(){var e=this.reduce(function(e,t){return e.push(String(t)),e},[]).join(",");return this.trailingComma?e+",":e},d.error=function(e,t){return this._error?this._error(e,t):new Error(e)},i=o,(c=[{key:"errorGenerator",set:function(e){this._error=e}}])&&s(i.prototype,c),l&&s(i,l),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=c,e.exports=t.default},680:(e,t,n)=>{t.__esModule=!0;var o=n(1581);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||(t[e]=o[e]))});var i=n(4451);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||(t[e]=i[e]))});var r=n(8500);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||(t[e]=r[e]))})},1106:(e,t,n)=>{let{nanoid:o}=n(5042),{isAbsolute:i,resolve:r}=n(197),{SourceMapConsumer:s,SourceMapGenerator:a}=n(1866),{fileURLToPath:c,pathToFileURL:l}=n(2739),d=n(3614),u=n(3878),h=n(9746),p=Symbol("lineToIndexCache"),f=Boolean(s&&a),y=Boolean(r&&i);function m(e){if(e[p])return e[p];let t=e.css.split("\n"),n=new Array(t.length),o=0;for(let e=0,i=t.length;e<i;e++)n[e]=o,o+=t[e].length+1;return e[p]=n,n}class v{get from(){return this.file||this.id}constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!y||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=r(t.from)),y&&f){let e=new u(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,o={}){let i,r,s,a,c;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){a=e.offset;let o=this.fromOffset(a);t=o.line,n=o.col}else t=e.line,n=e.column,a=this.fromLineAndColumn(t,n);if("number"==typeof o.offset){s=o.offset;let e=this.fromOffset(s);r=e.line,i=e.col}else r=o.line,i=o.column,s=this.fromLineAndColumn(o.line,o.column)}else if(n)a=this.fromLineAndColumn(t,n);else{a=t;let e=this.fromOffset(a);t=e.line,n=e.col}let u=this.origin(t,n,r,i);return c=u?new d(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,o.plugin):new d(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,o.plugin),c.input={column:n,endColumn:i,endLine:r,endOffset:s,line:t,offset:a,source:this.css},this.file&&(l&&(c.input.url=l(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,t){return m(this)[e-1]+t-1}fromOffset(e){let t=m(this),n=0;if(e>=t[t.length-1])n=t.length-1;else{let o,i=t.length-2;for(;n<i;)if(o=n+(i-n>>1),e<t[o])i=o-1;else{if(!(e>=t[o+1])){n=o;break}n=o+1}}return{col:e-t[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,o){if(!this.map)return!1;let r,s,a=this.map.consumer(),d=a.originalPositionFor({column:t,line:e});if(!d.source)return!1;"number"==typeof n&&(r=a.originalPositionFor({column:o,line:n})),s=i(d.source)?l(d.source):new URL(d.source,this.map.consumer().sourceRoot||l(this.map.mapFile));let u={column:d.column,endColumn:r&&r.column,endLine:r&&r.line,line:d.line,url:s.toString()};if("file:"===s.protocol){if(!c)throw new Error("file: protocol is not available in this PostCSS build");u.file=c(s)}let h=a.sourceContentFor(d.source);return h&&(u.source=h),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}e.exports=v,v.default=v,h&&h.registerInput&&h.registerInput(v)},1534:(e,t,n)=>{let o=n(7793),i=n(1752);class r extends o{get selectors(){return i.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=r,r.default=r,o.registerRule(r)},1557:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(;n.length>0;){var i=n.shift();e[i]||(e[i]={}),e=e[i]}},e.exports=t.default},1581:(e,t)=>{t.__esModule=!0,t.UNIVERSAL=t.TAG=t.STRING=t.SELECTOR=t.ROOT=t.PSEUDO=t.NESTING=t.ID=t.COMMENT=t.COMBINATOR=t.CLASS=t.ATTRIBUTE=void 0;t.TAG="tag";t.STRING="string";t.SELECTOR="selector";t.ROOT="root";t.PSEUDO="pseudo";t.NESTING="nesting";t.ID="id";t.COMMENT="comment";t.COMBINATOR="combinator";t.CLASS="class";t.ATTRIBUTE="attribute";t.UNIVERSAL="universal"},1669:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3295))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.UNIVERSAL,n.value="*",n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=a,e.exports=t.default},1704:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.COMBINATOR,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=a,e.exports=t.default},1752:e=>{let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let o=[],i="",r=!1,s=0,a=!1,c="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:a?n===c&&(a=!1):'"'===n||"'"===n?(a=!0,c=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(r=!0),r?(""!==i&&o.push(i.trim()),i="",r=!1):i+=n;return(n||""!==i)&&o.push(i.trim()),o}};e.exports=t,t.default=t},1866:()=>{},2110:(e,t,n)=>{const{AtRule:o,Rule:i}=n(2895);let r=n(7149);function s(e,t){let n;try{r(e=>{n=e}).processSync(e)}catch(n){throw e.includes(":")?t?t.error("Missed semicolon"):n:t?t.error(n.message):n}return n.at(0)}function a(e,t){let n=!1;return e.each(e=>{if("nesting"===e.type){let o=t.clone({});"&"!==e.value?e.replaceWith(s(e.value.replace("&",o.toString()))):e.replaceWith(o),n=!0}else"nodes"in e&&e.nodes&&a(e,t)&&(n=!0)}),n}function c(e,t){let n=[];for(let o of e.selectors){let i=s(o,e);for(let e of t.selectors){if(!e)continue;let o=s(e,t);a(o,i)||(o.prepend(r.combinator({value:" "})),o.prepend(i.clone({}))),n.push(o.toString())}}return n}function l(e,t){if("comment"!==e.prev()?.type)return t.after(e),e;let n=e.prev();return e.parent.toString().match(/[*]\/ *\n.*{/)?t.after(e).after(n):t.after(e),e}function d(e,t,n,o=!0){return t.length?(n=function(e,t,n){let o=new i({nodes:[],selector:e});return o.append(t),n.after(o),o}(e,t,n),o&&(t=[]),[n,t]):[n,t]}function u(e,t=""){let n=e.concat(t),o={};for(let e of n)o[e.replace(/^@/,"")]=!0;return o}function h(e){let t=e[f];if(t){let n,i,r,s,a=e.nodes,c=-1,l=function(e){let t=[],n=e.parent;for(;n&&n instanceof o;)t.push(n),n=n.parent;return t}(e);if(l.forEach((e,o)=>{if(t(e.name))n=e,c=o,r=s;else{let t=s;s=e.clone({nodes:[]}),t&&s.append(t),i=i||s}}),n)if(r){i.append(a),n.after(r)}else n.after(a);else e.after(a);if(e.next()&&n){let t;l.slice(0,c+1).forEach((n,o,i)=>{let r=t;t=n.clone({nodes:[]}),r&&t.append(r);let s=[],a=(i[o-1]||e).next();for(;a;)s.push(a),a=a.next();t.append(s)}),t&&(r||a[a.length-1]).after(t)}}else e.after(e.nodes);e.remove()}const p=Symbol("rootRuleMergeSel"),f=Symbol("rootRuleEscapes");function y(e){let{params:t}=e,{escapes:n,selector:o,type:r}=function(e){let t=(e=e.trim()).match(/^\((.*)\)$/);if(!t)return{selector:e,type:"basic"};let n=t[1].match(/^(with(?:out)?):(.+)$/);if(n){let e="with"===n[1],t=Object.fromEntries(n[2].trim().split(/\s+/).map(e=>[e,!0]));if(e&&t.all)return{type:"noop"};let o=e=>!!t[e];return t.all?o=()=>!0:e&&(o=e=>"all"!==e&&!t[e]),{escapes:o,type:"withrules"}}return{type:"unknown"}}(t);if("unknown"===r)throw e.error(`Unknown @${e.name} parameter ${JSON.stringify(t)}`);if("basic"===r&&o){let t=new i({nodes:e.nodes,selector:o});e.removeAll(),e.append(t)}e[f]=n,e[p]=n?!n("all"):"noop"===r}const m=Symbol("hasRootRule");e.exports=(e={})=>{let t=u(["media","supports","layer","container","starting-style"],e.bubble),n=function(e){return function t(n,o,i,r=i){let s=[];if(o.each(a=>{"rule"===a.type&&i?r&&(a.selectors=c(n,a)):"atrule"===a.type&&a.nodes?e[a.name]?t(n,a,r):!1!==o[p]&&s.push(a):s.push(a)}),i&&s.length){let e=n.clone({nodes:[]});for(let t of s)e.append(t);o.prepend(e)}}}(t),o=u(["document","font-face","keyframes","-webkit-keyframes","-moz-keyframes"],e.unwrap),i=(e.rootRuleName||"at-root").replace(/^@/,""),r=e.preserveEmpty;return{Once(e){e.walkAtRules(i,t=>{y(t),e[m]=!0})},postcssPlugin:"postcss-nested",RootExit(e){e[m]&&(e.walkAtRules(i,h),e[m]=!1)},Rule(e){let s=!1,a=e,u=!1,h=[];e.each(r=>{switch(r.type){case"atrule":[a,h]=d(e.selector,h,a),r.name===i?(s=!0,n(e,r,!0,r[p]),a=l(r,a)):t[r.name]?(u=!0,s=!0,n(e,r,!0),a=l(r,a)):o[r.name]?(u=!0,s=!0,n(e,r,!1),a=l(r,a)):u&&h.push(r);break;case"decl":u&&h.push(r);break;case"rule":[a,h]=d(e.selector,h,a),u=!0,s=!0,r.selectors=c(e,r),a=l(r,a)}}),d(e.selector,h,a,!1),s&&!0!==r&&(e.raws.semicolon=!0,0===e.nodes.length&&e.remove())}}},e.exports.postcss=!0},2648:(e,t,n)=>{t.__esModule=!0,t.FIELDS=void 0,t.default=function(e){var t,n,o,i,s,a,c,l,d,u,p,f,y=[],m=e.css.valueOf(),v=m.length,g=-1,C=1,w=0,I=0;function T(t,n){if(!e.safe)throw e.error("Unclosed "+t,C,w-g,w);l=(m+=n).length-1}for(;w<v;){switch((t=m.charCodeAt(w))===r.newline&&(g=w,C+=1),t){case r.space:case r.tab:case r.newline:case r.cr:case r.feed:l=w;do{l+=1,(t=m.charCodeAt(l))===r.newline&&(g=l,C+=1)}while(t===r.space||t===r.newline||t===r.tab||t===r.cr||t===r.feed);f=r.space,o=C,n=l-g-1,I=l;break;case r.plus:case r.greaterThan:case r.tilde:case r.pipe:l=w;do{l+=1,t=m.charCodeAt(l)}while(t===r.plus||t===r.greaterThan||t===r.tilde||t===r.pipe);f=r.combinator,o=C,n=w-g,I=l;break;case r.asterisk:case r.ampersand:case r.bang:case r.comma:case r.equals:case r.dollar:case r.caret:case r.openSquare:case r.closeSquare:case r.colon:case r.semicolon:case r.openParenthesis:case r.closeParenthesis:f=t,o=C,n=w-g,I=(l=w)+1;break;case r.singleQuote:case r.doubleQuote:p=t===r.singleQuote?"'":'"',l=w;do{for(i=!1,-1===(l=m.indexOf(p,l+1))&&T("quote",p),s=l;m.charCodeAt(s-1)===r.backslash;)s-=1,i=!i}while(i);f=r.str,o=C,n=w-g,I=l+1;break;default:t===r.slash&&m.charCodeAt(w+1)===r.asterisk?(0===(l=m.indexOf("*/",w+2)+1)&&T("comment","*/"),(a=(c=m.slice(w,l+1).split("\n")).length-1)>0?(d=C+a,u=l-c[a].length):(d=C,u=g),f=r.comment,C=d,o=d,n=l-u):t===r.slash?(f=t,o=C,n=w-g,I=(l=w)+1):(l=h(m,w),f=r.word,o=C,n=l-g),I=l+1}y.push([f,C,w-g,o,n,w,I]),u&&(g=u,u=null),w=I}return y};var o,i,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var a=i?Object.getOwnPropertyDescriptor(e,r):null;a&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r]}o.default=e,n&&n.set(e,o);return o}(n(71));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}for(var a=((o={})[r.tab]=!0,o[r.newline]=!0,o[r.cr]=!0,o[r.feed]=!0,o),c=((i={})[r.space]=!0,i[r.tab]=!0,i[r.newline]=!0,i[r.cr]=!0,i[r.feed]=!0,i[r.ampersand]=!0,i[r.asterisk]=!0,i[r.bang]=!0,i[r.comma]=!0,i[r.colon]=!0,i[r.semicolon]=!0,i[r.openParenthesis]=!0,i[r.closeParenthesis]=!0,i[r.openSquare]=!0,i[r.closeSquare]=!0,i[r.singleQuote]=!0,i[r.doubleQuote]=!0,i[r.plus]=!0,i[r.pipe]=!0,i[r.tilde]=!0,i[r.greaterThan]=!0,i[r.equals]=!0,i[r.dollar]=!0,i[r.caret]=!0,i[r.slash]=!0,i),l={},d="0123456789abcdefABCDEF",u=0;u<22;u++)l[d.charCodeAt(u)]=!0;function h(e,t){var n,o=t;do{if(n=e.charCodeAt(o),c[n])return o-1;n===r.backslash?o=p(e,o)+1:o++}while(o<e.length);return o-1}function p(e,t){var n=t,o=e.charCodeAt(n+1);if(a[o]);else if(l[o]){var i=0;do{n++,i++,o=e.charCodeAt(n+1)}while(l[o]&&i<6);i<6&&o===r.space&&n++}else n++;return n}t.FIELDS={TYPE:0,START_LINE:1,START_COL:2,END_LINE:3,END_COL:4,START_POS:5,END_POS:6}},2739:()=>{},2895:(e,t,n)=>{let o=n(396),i=n(9371),r=n(7793),s=n(3614),a=n(5238),c=n(145),l=n(3438),d=n(1106),u=n(6966),h=n(1752),p=n(3152),f=n(9577),y=n(6846),m=n(3717),v=n(5644),g=n(1534),C=n(3303),w=n(38);function I(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new y(e)}I.plugin=function(e,t){let n,o=!1;function i(...n){console&&console.warn&&!o&&(o=!0,process.env.LANG&&process.env.LANG.startsWith("cn"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new y).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return I([i(n)]).process(e,t)},i},I.stringify=C,I.parse=f,I.fromJSON=l,I.list=h,I.comment=e=>new i(e),I.atRule=e=>new o(e),I.decl=e=>new a(e),I.rule=e=>new g(e),I.root=e=>new v(e),I.document=e=>new c(e),I.CssSyntaxError=s,I.Declaration=a,I.Container=r,I.Processor=y,I.Document=c,I.Comment=i,I.Warning=w,I.AtRule=o,I.Result=m,I.Input=d,I.Rule=g,I.Root=v,I.Node=p,u.registerPostcss(I),e.exports=I,I.default=I},2918:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.NESTING,n.value="&",n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=a,e.exports=t.default},3152:(e,t,n)=>{let o=n(3614),i=n(7668),r=n(3303),{isClean:s,my:a}=n(4151);function c(e,t){let n=new e.constructor;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;if("proxyCache"===o)continue;let i=e[o],r=typeof i;"parent"===o&&"object"===r?t&&(n[o]=t):"source"===o?n[o]=i:Array.isArray(i)?n[o]=i.map(e=>c(e,n)):("object"===r&&null!==i&&(i=c(i)),n[o]=i)}return n}function l(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,o=1,i=0;for(let r=0;r<e.length;r++){if(o===t.line&&n===t.column){i=r;break}"\n"===e[r]?(n=1,o+=1):n+=1}return i}class d{get proxyOf(){return this}constructor(e={}){this.raws={},this[s]=!1,this[a]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=c(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:o}=this.rangeBy(t);return this.source.input.error(e,{column:o.column,line:o.line},{column:n.column,line:n.line},t)}return new o(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let e=this;for(;e=e.parent;)e[s]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n="document"in this.source.input?this.source.input.document:this.source.input.css,o=n.slice(l(n,this.source.start),l(n,this.source.end)).indexOf(e.word);-1!==o&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,i=l(o,this.source.start),r=i+e;for(let e=i;e<r;e++)"\n"===o[e]?(t=1,n+=1):t+=1;return{column:t,line:n,offset:r}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,n={column:this.source.start.column,line:this.source.start.line,offset:l(t,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:l(t,this.source.end)+1}:{column:n.column+1,line:n.line,offset:n.offset+1};if(e.word){let i=t.slice(l(t,this.source.start),l(t,this.source.end)).indexOf(e.word);-1!==i&&(n=this.positionInside(i),o=this.positionInside(i+e.word.length))}else e.start?n={column:e.start.column,line:e.start.line,offset:l(t,e.start)}:e.index&&(n=this.positionInside(e.index)),e.end?o={column:e.end.column,line:e.end.line,offset:l(t,e.end)}:"number"==typeof e.endIndex?o=this.positionInside(e.endIndex):e.index&&(o=this.positionInside(e.index+1));return(o.line<n.line||o.line===n.line&&o.column<=n.column)&&(o={column:n.column+1,line:n.line,offset:n.offset+1}),{end:o,start:n}}raw(e,t){return(new i).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let o of e)o===this?n=!0:n?(this.parent.insertAfter(t,o),t=o):this.parent.insertBefore(t,o);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},o=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let o=this[e];if(Array.isArray(o))n[e]=o.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof o&&o.toJSON)n[e]=o.toJSON(null,t);else if("source"===e){if(null==o)continue;let r=t.get(o.input);null==r&&(r=i,t.set(o.input,i),i++),n[e]={end:o.end,inputId:r,start:o.start}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=r){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n={}){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}}e.exports=d,d.default=d},3295:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=r(n(8937)),i=n(9606);function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}var c=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,a(t,n);var c,l,d,u=r.prototype;return u.qualifiedName=function(e){return this.namespace?this.namespaceString+"|"+e:e},u.valueToString=function(){return this.qualifiedName(e.prototype.valueToString.call(this))},c=r,(l=[{key:"namespace",get:function(){return this._namespace},set:function(e){if(!0===e||"*"===e||"&"===e)return this._namespace=e,void(this.raws&&delete this.raws.namespace);var t=(0,o.default)(e,{isIdentifier:!0});this._namespace=e,t!==e?((0,i.ensureObject)(this,"raws"),this.raws.namespace=t):this.raws&&delete this.raws.namespace}},{key:"ns",get:function(){return this._namespace},set:function(e){this.namespace=e}},{key:"namespaceString",get:function(){if(this.namespace){var e=this.stringifyProperty("namespace");return!0===e?"":e}return""}}])&&s(c.prototype,l),d&&s(c,d),Object.defineProperty(c,"prototype",{writable:!1}),r}(r(n(4646)).default);t.default=c,e.exports=t.default},3303:(e,t,n)=>{let o=n(7668);function i(e,t){new o(t).stringify(e)}e.exports=i,i.default=i},3438:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(1106),a=n(3878),c=n(5644),l=n(1534);function d(e,t){if(Array.isArray(e))return e.map(e=>d(e));let{inputs:n,...u}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:s.prototype};n.map&&(n.map={...n.map,__proto__:a.prototype}),t.push(n)}}if(u.nodes&&(u.nodes=e.nodes.map(e=>d(e,t))),u.source){let{inputId:e,...n}=u.source;u.source=n,null!=e&&(u.source.input=t[e])}if("root"===u.type)return new c(u);if("decl"===u.type)return new r(u);if("rule"===u.type)return new l(u);if("comment"===u.type)return new i(u);if("atrule"===u.type)return new o(u);throw new Error("Unknown node type: "+e.type)}e.exports=d,d.default=d},3604:(e,t,n)=>{let{dirname:o,relative:i,resolve:r,sep:s}=n(197),{SourceMapConsumer:a,SourceMapGenerator:c}=n(1866),{pathToFileURL:l}=n(2739),d=n(1106),u=Boolean(a&&c),h=Boolean(o&&r&&i&&s);e.exports=class{constructor(e,t,n,o){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),i=e.root||o(e.file);!1===this.mapOpts.sourcesContent?(t=new a(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),h&&u&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=c.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new c({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new c({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,o=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,c)=>{if(this.css+=s,a&&"end"!==c&&(r.generated.line=n,r.generated.column=o-1,a.source&&a.source.start?(r.source=this.sourcePath(a),r.original.line=a.source.start.line,r.original.column=a.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),t=s.match(/\n/g),t?(n+=t.length,e=s.lastIndexOf("\n"),o=s.length-e):o+=s.length,a&&"start"!==c){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(r.source=this.sourcePath(a),r.original.line=a.source.end.line,r.original.column=a.source.end.column-1,r.generated.line=n,r.generated.column=o-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=n,r.generated.column=o-1,this.map.addMapping(r)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=o(r(n,this.mapOpts.annotation)));let s=i(n,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new d(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let o=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(o,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(l){let t=l(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===s&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},3614:(e,t,n)=>{let o=n(8633),i=n(9746);class r extends Error{constructor(e,t,n,o,i,s){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),o&&(this.source=o),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=o.isColorSupported);let n=e=>e,r=e=>e,s=e=>e;if(e){let{bold:e,gray:t,red:a}=o.createColors(!0);r=t=>e(a(t)),n=e=>t(e),i&&(s=e=>i(e))}let a=t.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),d=String(l).length;return a.slice(c,l).map((e,t)=>{let o=c+1+t,i=" "+(" "+o).slice(-d)+" | ";if(o===this.line){if(e.length>160){let t=20,o=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),c=e.slice(o,a),l=n(i.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return r(">")+n(i)+s(c)+"\n "+l+r("^")}let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+s(e)+"\n "+t+r("^")}return" "+n(i)+s(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=r,r.default=r},3631:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var a=i?Object.getOwnPropertyDescriptor(e,r):null;a&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r]}o.default=e,n&&n.set(e,o);return o}(n(1581));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var u=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).nodes||(n.nodes=[]),n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,d(t,n);var i,s,c,u=o.prototype;return u.append=function(e){return e.parent=this,this.nodes.push(e),this},u.prepend=function(e){for(var t in e.parent=this,this.nodes.unshift(e),this.indexes)this.indexes[t]++;return this},u.at=function(e){return this.nodes[e]},u.index=function(e){return"number"==typeof e?e:this.nodes.indexOf(e)},u.removeChild=function(e){var t;for(var n in e=this.index(e),this.at(e).parent=void 0,this.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this},u.removeAll=function(){for(var e,t=a(this.nodes);!(e=t()).done;){e.value.parent=void 0}return this.nodes=[],this},u.empty=function(){return this.removeAll()},u.insertAfter=function(e,t){var n;t.parent=this;for(var o,i=this.index(e),r=[],s=2;s<arguments.length;s++)r.push(arguments[s]);for(var a in(n=this.nodes).splice.apply(n,[i+1,0,t].concat(r)),t.parent=this,this.indexes)i<(o=this.indexes[a])&&(this.indexes[a]=o+arguments.length-1);return this},u.insertBefore=function(e,t){var n;t.parent=this;for(var o,i=this.index(e),r=[],s=2;s<arguments.length;s++)r.push(arguments[s]);for(var a in(n=this.nodes).splice.apply(n,[i,0,t].concat(r)),t.parent=this,this.indexes)(o=this.indexes[a])>=i&&(this.indexes[a]=o+arguments.length-1);return this},u._findChildAtPosition=function(e,t){var n=void 0;return this.each(function(o){if(o.atPosition){var i=o.atPosition(e,t);if(i)return n=i,!1}else if(o.isAtPosition(e,t))return n=o,!1}),n},u.atPosition=function(e,t){return this.isAtPosition(e,t)?this._findChildAtPosition(e,t)||this:void 0},u._inferEndPosition=function(){this.last&&this.last.source&&this.last.source.end&&(this.source=this.source||{},this.source.end=this.source.end||{},Object.assign(this.source.end,this.last.source.end))},u.each=function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var t=this.lastEach;if(this.indexes[t]=0,this.length){for(var n,o;this.indexes[t]<this.length&&(n=this.indexes[t],!1!==(o=e(this.at(n),n)));)this.indexes[t]+=1;return delete this.indexes[t],!1!==o&&void 0}},u.walk=function(e){return this.each(function(t,n){var o=e(t,n);if(!1!==o&&t.length&&(o=t.walk(e)),!1===o)return!1})},u.walkAttributes=function(e){var t=this;return this.walk(function(n){if(n.type===r.ATTRIBUTE)return e.call(t,n)})},u.walkClasses=function(e){var t=this;return this.walk(function(n){if(n.type===r.CLASS)return e.call(t,n)})},u.walkCombinators=function(e){var t=this;return this.walk(function(n){if(n.type===r.COMBINATOR)return e.call(t,n)})},u.walkComments=function(e){var t=this;return this.walk(function(n){if(n.type===r.COMMENT)return e.call(t,n)})},u.walkIds=function(e){var t=this;return this.walk(function(n){if(n.type===r.ID)return e.call(t,n)})},u.walkNesting=function(e){var t=this;return this.walk(function(n){if(n.type===r.NESTING)return e.call(t,n)})},u.walkPseudos=function(e){var t=this;return this.walk(function(n){if(n.type===r.PSEUDO)return e.call(t,n)})},u.walkTags=function(e){var t=this;return this.walk(function(n){if(n.type===r.TAG)return e.call(t,n)})},u.walkUniversals=function(e){var t=this;return this.walk(function(n){if(n.type===r.UNIVERSAL)return e.call(t,n)})},u.split=function(e){var t=this,n=[];return this.reduce(function(o,i,r){var s=e.call(t,i);return n.push(i),s?(o.push(n),n=[]):r===t.length-1&&o.push(n),o},[])},u.map=function(e){return this.nodes.map(e)},u.reduce=function(e,t){return this.nodes.reduce(e,t)},u.every=function(e){return this.nodes.every(e)},u.some=function(e){return this.nodes.some(e)},u.filter=function(e){return this.nodes.filter(e)},u.sort=function(e){return this.nodes.sort(e)},u.toString=function(){return this.map(String).join("")},i=o,(s=[{key:"first",get:function(){return this.at(0)}},{key:"last",get:function(){return this.at(this.length-1)}},{key:"length",get:function(){return this.nodes.length}}])&&l(i.prototype,s),c&&l(i,c),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=u,e.exports=t.default},3717:(e,t,n)=>{let o=n(38);class i{get content(){return this.css}constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new o(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}e.exports=i,i.default=i},3878:(e,t,n)=>{let{existsSync:o,readFileSync:i}=n(9977),{dirname:r,join:s}=n(197),{SourceMapConsumer:a,SourceMapGenerator:c}=n(1866);class l{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,o=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new a(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return o=e.substr(n[0].length),Buffer?Buffer.from(o,"base64").toString():window.atob(o);var o;let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),o=e.indexOf("*/",n);n>-1&&o>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,o)))}loadFile(e){if(this.root=r(e),o(e))return this.mapFile=e,i(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof a)return c.fromSourceMap(t).toString();if(t instanceof c)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=s(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=l,l.default=l},4151:e=>{e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},4195:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=a(n(8937)),i=n(9606),r=a(n(4646)),s=n(1581);function a(e){return e&&e.__esModule?e:{default:e}}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var d=function(e){var t,n,r,a,d;function u(t){var n;return(n=e.call(this,t)||this).type=s.CLASS,n._constructed=!0,n}return n=e,(t=u).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n),u.prototype.valueToString=function(){return"."+e.prototype.valueToString.call(this)},r=u,(a=[{key:"value",get:function(){return this._value},set:function(e){if(this._constructed){var t=(0,o.default)(e,{isIdentifier:!0});t!==e?((0,i.ensureObject)(this,"raws"),this.raws.value=t):this.raws&&delete this.raws.value}this._value=e}}])&&c(r.prototype,a),d&&c(r,d),Object.defineProperty(r,"prototype",{writable:!1}),u}(r.default);t.default=d,e.exports=t.default},4211:(e,t,n)=>{let o=n(3604),i=n(9577);const r=n(3717);let s=n(3303);n(6156);class a{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=i;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,n){let i;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let a=s;this.result=new r(this._processor,i,this._opts),this.result.css=t;let c=this;Object.defineProperty(this.result,"root",{get:()=>c.root});let l=new o(a,i,this._opts,t);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}e.exports=a,a.default=a},4451:(e,t,n)=>{t.__esModule=!0,t.universal=t.tag=t.string=t.selector=t.root=t.pseudo=t.nesting=t.id=t.comment=t.combinator=t.className=t.attribute=void 0;var o=y(n(5588)),i=y(n(4195)),r=y(n(1704)),s=y(n(425)),a=y(n(7071)),c=y(n(2918)),l=y(n(7324)),d=y(n(518)),u=y(n(339)),h=y(n(5799)),p=y(n(9720)),f=y(n(1669));function y(e){return e&&e.__esModule?e:{default:e}}t.attribute=function(e){return new o.default(e)};t.className=function(e){return new i.default(e)};t.combinator=function(e){return new r.default(e)};t.comment=function(e){return new s.default(e)};t.id=function(e){return new a.default(e)};t.nesting=function(e){return new c.default(e)};t.pseudo=function(e){return new l.default(e)};t.root=function(e){return new d.default(e)};t.selector=function(e){return new u.default(e)};t.string=function(e){return new h.default(e)};t.tag=function(e){return new p.default(e)};t.universal=function(e){return new f.default(e)}},4643:(e,t,n)=>{function o(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(o("noDeprecation"))return e;var n=!1;return function(){if(!n){if(o("throwDeprecation"))throw new Error(t);o("traceDeprecation"),n=!0}return e.apply(this,arguments)}}},4646:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=n(9606);function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var r=function e(t,n){if("object"!=typeof t||null===t)return t;var o=new t.constructor;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];"parent"===i&&"object"===typeof r?n&&(o[i]=n):o[i]=r instanceof Array?r.map(function(t){return e(t,o)}):e(r,o)}return o},s=function(){function e(e){void 0===e&&(e={}),Object.assign(this,e),this.spaces=this.spaces||{},this.spaces.before=this.spaces.before||"",this.spaces.after=this.spaces.after||""}var t,n,s,a=e.prototype;return a.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},a.replaceWith=function(){if(this.parent){for(var e in arguments)this.parent.insertBefore(this,arguments[e]);this.remove()}return this},a.next=function(){return this.parent.at(this.parent.index(this)+1)},a.prev=function(){return this.parent.at(this.parent.index(this)-1)},a.clone=function(e){void 0===e&&(e={});var t=r(this);for(var n in e)t[n]=e[n];return t},a.appendToPropertyAndEscape=function(e,t,n){this.raws||(this.raws={});var o=this[e],i=this.raws[e];this[e]=o+t,i||n!==t?this.raws[e]=(i||o)+n:delete this.raws[e]},a.setPropertyAndEscape=function(e,t,n){this.raws||(this.raws={}),this[e]=t,this.raws[e]=n},a.setPropertyWithoutEscape=function(e,t){this[e]=t,this.raws&&delete this.raws[e]},a.isAtPosition=function(e,t){if(this.source&&this.source.start&&this.source.end)return!(this.source.start.line>e)&&(!(this.source.end.line<e)&&(!(this.source.start.line===e&&this.source.start.column>t)&&!(this.source.end.line===e&&this.source.end.column<t)))},a.stringifyProperty=function(e){return this.raws&&this.raws[e]||this[e]},a.valueToString=function(){return String(this.stringifyProperty("value"))},a.toString=function(){return[this.rawSpaceBefore,this.valueToString(),this.rawSpaceAfter].join("")},t=e,(n=[{key:"rawSpaceBefore",get:function(){var e=this.raws&&this.raws.spaces&&this.raws.spaces.before;return void 0===e&&(e=this.spaces&&this.spaces.before),e||""},set:function(e){(0,o.ensureObject)(this,"raws","spaces"),this.raws.spaces.before=e}},{key:"rawSpaceAfter",get:function(){var e=this.raws&&this.raws.spaces&&this.raws.spaces.after;return void 0===e&&(e=this.spaces.after),e||""},set:function(e){(0,o.ensureObject)(this,"raws","spaces"),this.raws.spaces.after=e}}])&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s,e.exports=t.default},5042:e=>{e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",i=0|n;for(;i--;)o+=e[Math.random()*e.length|0];return o}}},5170:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i,r=b(n(518)),s=b(n(339)),a=b(n(4195)),c=b(n(425)),l=b(n(7071)),d=b(n(9720)),u=b(n(5799)),h=b(n(7324)),p=k(n(5588)),f=b(n(1669)),y=b(n(1704)),m=b(n(2918)),v=b(n(263)),g=k(n(2648)),C=k(n(71)),w=k(n(1581)),I=n(9606);function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function k(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var s=i?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r]}return o.default=e,n&&n.set(e,o),o}function b(e){return e&&e.__esModule?e:{default:e}}function A(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var S=((o={})[C.space]=!0,o[C.cr]=!0,o[C.feed]=!0,o[C.newline]=!0,o[C.tab]=!0,o),N=Object.assign({},S,((i={})[C.comment]=!0,i));function _(e){return{line:e[g.FIELDS.START_LINE],column:e[g.FIELDS.START_COL]}}function P(e){return{line:e[g.FIELDS.END_LINE],column:e[g.FIELDS.END_COL]}}function E(e,t,n,o){return{start:{line:e,column:t},end:{line:n,column:o}}}function L(e){return E(e[g.FIELDS.START_LINE],e[g.FIELDS.START_COL],e[g.FIELDS.END_LINE],e[g.FIELDS.END_COL])}function x(e,t){if(e)return E(e[g.FIELDS.START_LINE],e[g.FIELDS.START_COL],t[g.FIELDS.END_LINE],t[g.FIELDS.END_COL])}function R(e,t){var n=e[t];if("string"==typeof n)return-1!==n.indexOf("\\")&&((0,I.ensureObject)(e,"raws"),e[t]=(0,I.unesc)(n),void 0===e.raws[t]&&(e.raws[t]=n)),e}function O(e,t){for(var n=-1,o=[];-1!==(n=e.indexOf(t,n+1));)o.push(n);return o}var D=function(){function e(e,t){void 0===t&&(t={}),this.rule=e,this.options=Object.assign({lossy:!1,safe:!1},t),this.position=0,this.css="string"==typeof this.rule?this.rule:this.rule.selector,this.tokens=(0,g.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var n=x(this.tokens[0],this.tokens[this.tokens.length-1]);this.root=new r.default({source:n}),this.root.errorGenerator=this._errorGenerator();var o=new s.default({source:{start:{line:1,column:1}},sourceIndex:0});this.root.append(o),this.current=o,this.loop()}var t,n,o,i=e.prototype;return i._errorGenerator=function(){var e=this;return function(t,n){return"string"==typeof e.rule?new Error(t):e.rule.error(t,n)}},i.attribute=function(){var e=[],t=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[g.FIELDS.TYPE]!==C.closeSquare;)e.push(this.currToken),this.position++;if(this.currToken[g.FIELDS.TYPE]!==C.closeSquare)return this.expected("closing square bracket",this.currToken[g.FIELDS.START_POS]);var n=e.length,o={source:E(t[1],t[2],this.currToken[3],this.currToken[4]),sourceIndex:t[g.FIELDS.START_POS]};if(1===n&&!~[C.word].indexOf(e[0][g.FIELDS.TYPE]))return this.expected("attribute",e[0][g.FIELDS.START_POS]);for(var i=0,r="",s="",a=null,c=!1;i<n;){var l=e[i],d=this.content(l),u=e[i+1];switch(l[g.FIELDS.TYPE]){case C.space:if(c=!0,this.options.lossy)break;if(a){(0,I.ensureObject)(o,"spaces",a);var h=o.spaces[a].after||"";o.spaces[a].after=h+d;var f=(0,I.getProp)(o,"raws","spaces",a,"after")||null;f&&(o.raws.spaces[a].after=f+d)}else r+=d,s+=d;break;case C.asterisk:if(u[g.FIELDS.TYPE]===C.equals)o.operator=d,a="operator";else if((!o.namespace||"namespace"===a&&!c)&&u){r&&((0,I.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=r,s=""),o.namespace=(o.namespace||"")+d,((0,I.getProp)(o,"raws","namespace")||null)&&(o.raws.namespace+=d),a="namespace"}c=!1;break;case C.dollar:if("value"===a){var y=(0,I.getProp)(o,"raws","value");o.value+="$",y&&(o.raws.value=y+"$");break}case C.caret:u[g.FIELDS.TYPE]===C.equals&&(o.operator=d,a="operator"),c=!1;break;case C.combinator:if("~"===d&&u[g.FIELDS.TYPE]===C.equals&&(o.operator=d,a="operator"),"|"!==d){c=!1;break}u[g.FIELDS.TYPE]===C.equals?(o.operator=d,a="operator"):o.namespace||o.attribute||(o.namespace=!0),c=!1;break;case C.word:if(u&&"|"===this.content(u)&&e[i+2]&&e[i+2][g.FIELDS.TYPE]!==C.equals&&!o.operator&&!o.namespace)o.namespace=d,a="namespace";else if(!o.attribute||"attribute"===a&&!c){r&&((0,I.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=s,s=""),o.attribute=(o.attribute||"")+d,((0,I.getProp)(o,"raws","attribute")||null)&&(o.raws.attribute+=d),a="attribute"}else if(!o.value&&""!==o.value||"value"===a&&!c&&!o.quoteMark){var m=(0,I.unesc)(d),v=(0,I.getProp)(o,"raws","value")||"",w=o.value||"";o.value=w+m,o.quoteMark=null,(m!==d||v)&&((0,I.ensureObject)(o,"raws"),o.raws.value=(v||w)+d),a="value"}else{var T="i"===d||"I"===d;!o.value&&""!==o.value||!o.quoteMark&&!c?(o.value||""===o.value)&&(a="value",o.value+=d,o.raws.value&&(o.raws.value+=d)):(o.insensitive=T,T&&"I"!==d||((0,I.ensureObject)(o,"raws"),o.raws.insensitiveFlag=d),a="insensitive",r&&((0,I.ensureObject)(o,"spaces","insensitive"),o.spaces.insensitive.before=r,r=""),s&&((0,I.ensureObject)(o,"raws","spaces","insensitive"),o.raws.spaces.insensitive.before=s,s=""))}c=!1;break;case C.str:if(!o.attribute||!o.operator)return this.error("Expected an attribute followed by an operator preceding the string.",{index:l[g.FIELDS.START_POS]});var k=(0,p.unescapeValue)(d),b=k.unescaped,A=k.quoteMark;o.value=b,o.quoteMark=A,a="value",(0,I.ensureObject)(o,"raws"),o.raws.value=d,c=!1;break;case C.equals:if(!o.attribute)return this.expected("attribute",l[g.FIELDS.START_POS],d);if(o.value)return this.error('Unexpected "=" found; an operator was already defined.',{index:l[g.FIELDS.START_POS]});o.operator=o.operator?o.operator+d:d,a="operator",c=!1;break;case C.comment:if(a)if(c||u&&u[g.FIELDS.TYPE]===C.space||"insensitive"===a){var S=(0,I.getProp)(o,"spaces",a,"after")||"",N=(0,I.getProp)(o,"raws","spaces",a,"after")||S;(0,I.ensureObject)(o,"raws","spaces",a),o.raws.spaces[a].after=N+d}else{var _=o[a]||"",P=(0,I.getProp)(o,"raws",a)||_;(0,I.ensureObject)(o,"raws"),o.raws[a]=P+d}else s+=d;break;default:return this.error('Unexpected "'+d+'" found.',{index:l[g.FIELDS.START_POS]})}i++}R(o,"attribute"),R(o,"namespace"),this.newNode(new p.default(o)),this.position++},i.parseWhitespaceEquivalentTokens=function(e){e<0&&(e=this.tokens.length);var t=this.position,n=[],o="",i=void 0;do{if(S[this.currToken[g.FIELDS.TYPE]])this.options.lossy||(o+=this.content());else if(this.currToken[g.FIELDS.TYPE]===C.comment){var r={};o&&(r.before=o,o=""),i=new c.default({value:this.content(),source:L(this.currToken),sourceIndex:this.currToken[g.FIELDS.START_POS],spaces:r}),n.push(i)}}while(++this.position<e);if(o)if(i)i.spaces.after=o;else if(!this.options.lossy){var s=this.tokens[t],a=this.tokens[this.position-1];n.push(new u.default({value:"",source:E(s[g.FIELDS.START_LINE],s[g.FIELDS.START_COL],a[g.FIELDS.END_LINE],a[g.FIELDS.END_COL]),sourceIndex:s[g.FIELDS.START_POS],spaces:{before:o,after:""}}))}return n},i.convertWhitespaceNodesToSpace=function(e,t){var n=this;void 0===t&&(t=!1);var o="",i="";return e.forEach(function(e){var r=n.lossySpace(e.spaces.before,t),s=n.lossySpace(e.rawSpaceBefore,t);o+=r+n.lossySpace(e.spaces.after,t&&0===r.length),i+=r+e.value+n.lossySpace(e.rawSpaceAfter,t&&0===s.length)}),i===o&&(i=void 0),{space:o,rawSpace:i}},i.isNamedCombinator=function(e){return void 0===e&&(e=this.position),this.tokens[e+0]&&this.tokens[e+0][g.FIELDS.TYPE]===C.slash&&this.tokens[e+1]&&this.tokens[e+1][g.FIELDS.TYPE]===C.word&&this.tokens[e+2]&&this.tokens[e+2][g.FIELDS.TYPE]===C.slash},i.namedCombinator=function(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]),t=(0,I.unesc)(e).toLowerCase(),n={};t!==e&&(n.value="/"+e+"/");var o=new y.default({value:"/"+t+"/",source:E(this.currToken[g.FIELDS.START_LINE],this.currToken[g.FIELDS.START_COL],this.tokens[this.position+2][g.FIELDS.END_LINE],this.tokens[this.position+2][g.FIELDS.END_COL]),sourceIndex:this.currToken[g.FIELDS.START_POS],raws:n});return this.position=this.position+3,o}this.unexpected()},i.combinator=function(){var e=this;if("|"===this.content())return this.namespace();var t=this.locateNextMeaningfulToken(this.position);if(!(t<0||this.tokens[t][g.FIELDS.TYPE]===C.comma||this.tokens[t][g.FIELDS.TYPE]===C.closeParenthesis)){var n,o=this.currToken,i=void 0;if(t>this.position&&(i=this.parseWhitespaceEquivalentTokens(t)),this.isNamedCombinator()?n=this.namedCombinator():this.currToken[g.FIELDS.TYPE]===C.combinator?(n=new y.default({value:this.content(),source:L(this.currToken),sourceIndex:this.currToken[g.FIELDS.START_POS]}),this.position++):S[this.currToken[g.FIELDS.TYPE]]||i||this.unexpected(),n){if(i){var r=this.convertWhitespaceNodesToSpace(i),s=r.space,a=r.rawSpace;n.spaces.before=s,n.rawSpaceBefore=a}}else{var c=this.convertWhitespaceNodesToSpace(i,!0),l=c.space,d=c.rawSpace;d||(d=l);var u={},h={spaces:{}};l.endsWith(" ")&&d.endsWith(" ")?(u.before=l.slice(0,l.length-1),h.spaces.before=d.slice(0,d.length-1)):l.startsWith(" ")&&d.startsWith(" ")?(u.after=l.slice(1),h.spaces.after=d.slice(1)):h.value=d,n=new y.default({value:" ",source:x(o,this.tokens[this.position-1]),sourceIndex:o[g.FIELDS.START_POS],spaces:u,raws:h})}return this.currToken&&this.currToken[g.FIELDS.TYPE]===C.space&&(n.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(n)}var p=this.parseWhitespaceEquivalentTokens(t);if(p.length>0){var f=this.current.last;if(f){var m=this.convertWhitespaceNodesToSpace(p),v=m.space,w=m.rawSpace;void 0!==w&&(f.rawSpaceAfter+=w),f.spaces.after+=v}else p.forEach(function(t){return e.newNode(t)})}},i.comma=function(){if(this.position===this.tokens.length-1)return this.root.trailingComma=!0,void this.position++;this.current._inferEndPosition();var e=new s.default({source:{start:_(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][g.FIELDS.START_POS]});this.current.parent.append(e),this.current=e,this.position++},i.comment=function(){var e=this.currToken;this.newNode(new c.default({value:this.content(),source:L(e),sourceIndex:e[g.FIELDS.START_POS]})),this.position++},i.error=function(e,t){throw this.root.error(e,t)},i.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[g.FIELDS.START_POS]})},i.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[g.FIELDS.START_POS])},i.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[g.FIELDS.START_POS])},i.unexpected=function(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[g.FIELDS.START_POS])},i.unexpectedPipe=function(){return this.error("Unexpected '|'.",this.currToken[g.FIELDS.START_POS])},i.namespace=function(){var e=this.prevToken&&this.content(this.prevToken)||!0;return this.nextToken[g.FIELDS.TYPE]===C.word?(this.position++,this.word(e)):this.nextToken[g.FIELDS.TYPE]===C.asterisk?(this.position++,this.universal(e)):void this.unexpectedPipe()},i.nesting=function(){if(this.nextToken&&"|"===this.content(this.nextToken))return void this.position++;var e=this.currToken;this.newNode(new m.default({value:this.content(),source:L(e),sourceIndex:e[g.FIELDS.START_POS]})),this.position++},i.parentheses=function(){var e=this.current.last,t=1;if(this.position++,e&&e.type===w.PSEUDO){var n=new s.default({source:{start:_(this.tokens[this.position])},sourceIndex:this.tokens[this.position][g.FIELDS.START_POS]}),o=this.current;for(e.append(n),this.current=n;this.position<this.tokens.length&&t;)this.currToken[g.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[g.FIELDS.TYPE]===C.closeParenthesis&&t--,t?this.parse():(this.current.source.end=P(this.currToken),this.current.parent.source.end=P(this.currToken),this.position++);this.current=o}else{for(var i,r=this.currToken,a="(";this.position<this.tokens.length&&t;)this.currToken[g.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[g.FIELDS.TYPE]===C.closeParenthesis&&t--,i=this.currToken,a+=this.parseParenthesisToken(this.currToken),this.position++;e?e.appendToPropertyAndEscape("value",a,a):this.newNode(new u.default({value:a,source:E(r[g.FIELDS.START_LINE],r[g.FIELDS.START_COL],i[g.FIELDS.END_LINE],i[g.FIELDS.END_COL]),sourceIndex:r[g.FIELDS.START_POS]}))}if(t)return this.expected("closing parenthesis",this.currToken[g.FIELDS.START_POS])},i.pseudo=function(){for(var e=this,t="",n=this.currToken;this.currToken&&this.currToken[g.FIELDS.TYPE]===C.colon;)t+=this.content(),this.position++;return this.currToken?this.currToken[g.FIELDS.TYPE]!==C.word?this.expected(["pseudo-class","pseudo-element"],this.currToken[g.FIELDS.START_POS]):void this.splitWord(!1,function(o,i){t+=o,e.newNode(new h.default({value:t,source:x(n,e.currToken),sourceIndex:n[g.FIELDS.START_POS]})),i>1&&e.nextToken&&e.nextToken[g.FIELDS.TYPE]===C.openParenthesis&&e.error("Misplaced parenthesis.",{index:e.nextToken[g.FIELDS.START_POS]})}):this.expected(["pseudo-class","pseudo-element"],this.position-1)},i.space=function(){var e=this.content();0===this.position||this.prevToken[g.FIELDS.TYPE]===C.comma||this.prevToken[g.FIELDS.TYPE]===C.openParenthesis||this.current.nodes.every(function(e){return"comment"===e.type})?(this.spaces=this.optionalSpace(e),this.position++):this.position===this.tokens.length-1||this.nextToken[g.FIELDS.TYPE]===C.comma||this.nextToken[g.FIELDS.TYPE]===C.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(e),this.position++):this.combinator()},i.string=function(){var e=this.currToken;this.newNode(new u.default({value:this.content(),source:L(e),sourceIndex:e[g.FIELDS.START_POS]})),this.position++},i.universal=function(e){var t=this.nextToken;if(t&&"|"===this.content(t))return this.position++,this.namespace();var n=this.currToken;this.newNode(new f.default({value:this.content(),source:L(n),sourceIndex:n[g.FIELDS.START_POS]}),e),this.position++},i.splitWord=function(e,t){for(var n=this,o=this.nextToken,i=this.content();o&&~[C.dollar,C.caret,C.equals,C.word].indexOf(o[g.FIELDS.TYPE]);){this.position++;var r=this.content();if(i+=r,r.lastIndexOf("\\")===r.length-1){var s=this.nextToken;s&&s[g.FIELDS.TYPE]===C.space&&(i+=this.requiredSpace(this.content(s)),this.position++)}o=this.nextToken}var c=O(i,".").filter(function(e){var t="\\"===i[e-1],n=/^\d+\.\d+%$/.test(i);return!t&&!n}),u=O(i,"#").filter(function(e){return"\\"!==i[e-1]}),h=O(i,"#{");h.length&&(u=u.filter(function(e){return!~h.indexOf(e)}));var p=(0,v.default)(function(){var e=Array.prototype.concat.apply([],arguments);return e.filter(function(t,n){return n===e.indexOf(t)})}([0].concat(c,u)));p.forEach(function(o,r){var s,h=p[r+1]||i.length,f=i.slice(o,h);if(0===r&&t)return t.call(n,f,p.length);var y=n.currToken,m=y[g.FIELDS.START_POS]+p[r],v=E(y[1],y[2]+o,y[3],y[2]+(h-1));if(~c.indexOf(o)){var C={value:f.slice(1),source:v,sourceIndex:m};s=new a.default(R(C,"value"))}else if(~u.indexOf(o)){var w={value:f.slice(1),source:v,sourceIndex:m};s=new l.default(R(w,"value"))}else{var I={value:f,source:v,sourceIndex:m};R(I,"value"),s=new d.default(I)}n.newNode(s,e),e=null}),this.position++},i.word=function(e){var t=this.nextToken;return t&&"|"===this.content(t)?(this.position++,this.namespace()):this.splitWord(e)},i.loop=function(){for(;this.position<this.tokens.length;)this.parse(!0);return this.current._inferEndPosition(),this.root},i.parse=function(e){switch(this.currToken[g.FIELDS.TYPE]){case C.space:this.space();break;case C.comment:this.comment();break;case C.openParenthesis:this.parentheses();break;case C.closeParenthesis:e&&this.missingParenthesis();break;case C.openSquare:this.attribute();break;case C.dollar:case C.caret:case C.equals:case C.word:this.word();break;case C.colon:this.pseudo();break;case C.comma:this.comma();break;case C.asterisk:this.universal();break;case C.ampersand:this.nesting();break;case C.slash:case C.combinator:this.combinator();break;case C.str:this.string();break;case C.closeSquare:this.missingSquareBracket();case C.semicolon:this.missingBackslash();default:this.unexpected()}},i.expected=function(e,t,n){if(Array.isArray(e)){var o=e.pop();e=e.join(", ")+" or "+o}var i=/^[aeiou]/.test(e[0])?"an":"a";return n?this.error("Expected "+i+" "+e+', found "'+n+'" instead.',{index:t}):this.error("Expected "+i+" "+e+".",{index:t})},i.requiredSpace=function(e){return this.options.lossy?" ":e},i.optionalSpace=function(e){return this.options.lossy?"":e},i.lossySpace=function(e,t){return this.options.lossy?t?" ":"":e},i.parseParenthesisToken=function(e){var t=this.content(e);return e[g.FIELDS.TYPE]===C.space?this.requiredSpace(t):t},i.newNode=function(e,t){return t&&(/^ +$/.test(t)&&(this.options.lossy||(this.spaces=(this.spaces||"")+t),t=!0),e.namespace=t,R(e,"namespace")),this.spaces&&(e.spaces.before=this.spaces,this.spaces=""),this.current.append(e)},i.content=function(e){return void 0===e&&(e=this.currToken),this.css.slice(e[g.FIELDS.START_POS],e[g.FIELDS.END_POS])},i.locateNextMeaningfulToken=function(e){void 0===e&&(e=this.position+1);for(var t=e;t<this.tokens.length;){if(!N[this.tokens[t][g.FIELDS.TYPE]])return t;t++}return-1},t=e,(n=[{key:"currToken",get:function(){return this.tokens[this.position]}},{key:"nextToken",get:function(){return this.tokens[this.position+1]}},{key:"prevToken",get:function(){return this.tokens[this.position-1]}}])&&A(t.prototype,n),o&&A(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=D,e.exports=t.default},5238:(e,t,n)=>{let o=n(3152);class i extends o{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=i,i.default=i},5286:(e,t)=>{function n(e){for(var t=e.toLowerCase(),n="",o=!1,i=0;i<6&&void 0!==t[i];i++){var r=t.charCodeAt(i);if(o=32===r,!(r>=97&&r<=102||r>=48&&r<=57))break;n+=t[i]}if(0!==n.length){var s=parseInt(n,16);return s>=55296&&s<=57343||0===s||s>1114111?["�",n.length+(o?1:0)]:[String.fromCodePoint(s),n.length+(o?1:0)]}}t.__esModule=!0,t.default=function(e){if(!o.test(e))return e;for(var t="",i=0;i<e.length;i++)if("\\"!==e[i])t+=e[i];else{var r=n(e.slice(i+1,i+7));if(void 0!==r){t+=r[0],i+=r[1];continue}if("\\"===e[i+1]){t+="\\",i++;continue}e.length===i+1&&(t+=e[i])}return t};var o=/\\/;e.exports=t.default},5588:(e,t,n)=>{t.__esModule=!0,t.default=void 0,t.unescapeValue=m;var o,i=c(n(8937)),r=c(n(5286)),s=c(n(3295)),a=n(1581);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var u=n(4643),h=/^('|")([^]*)\1$/,p=u(function(){},"Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."),f=u(function(){},"Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."),y=u(function(){},"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");function m(e){var t=!1,n=null,o=e,i=o.match(h);return i&&(n=i[1],o=i[2]),(o=(0,r.default)(o))!==e&&(t=!0),{deprecatedUsage:t,unescaped:o,quoteMark:n}}var v=function(e){var t,n;function o(t){var n;return void 0===t&&(t={}),n=e.call(this,function(e){if(void 0!==e.quoteMark)return e;if(void 0===e.value)return e;y();var t=m(e.value),n=t.quoteMark,o=t.unescaped;return e.raws||(e.raws={}),void 0===e.raws.value&&(e.raws.value=e.value),e.value=o,e.quoteMark=n,e}(t))||this,n.type=a.ATTRIBUTE,n.raws=n.raws||{},Object.defineProperty(n.raws,"unquoted",{get:u(function(){return n.value},"attr.raws.unquoted is deprecated. Call attr.value instead."),set:u(function(){return n.value},"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")}),n._constructed=!0,n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,d(t,n);var r,s,c,h=o.prototype;return h.getQuotedValue=function(e){void 0===e&&(e={});var t=this._determineQuoteMark(e),n=g[t];return(0,i.default)(this._value,n)},h._determineQuoteMark=function(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)},h.setValue=function(e,t){void 0===t&&(t={}),this._value=e,this._quoteMark=this._determineQuoteMark(t),this._syncRawValue()},h.smartQuoteMark=function(e){var t=this.value,n=t.replace(/[^']/g,"").length,r=t.replace(/[^"]/g,"").length;if(n+r===0){var s=(0,i.default)(t,{isIdentifier:!0});if(s===t)return o.NO_QUOTE;var a=this.preferredQuoteMark(e);if(a===o.NO_QUOTE){var c=this.quoteMark||e.quoteMark||o.DOUBLE_QUOTE,l=g[c];if((0,i.default)(t,l).length<s.length)return c}return a}return r===n?this.preferredQuoteMark(e):r<n?o.DOUBLE_QUOTE:o.SINGLE_QUOTE},h.preferredQuoteMark=function(e){var t=e.preferCurrentQuoteMark?this.quoteMark:e.quoteMark;return void 0===t&&(t=e.preferCurrentQuoteMark?e.quoteMark:this.quoteMark),void 0===t&&(t=o.DOUBLE_QUOTE),t},h._syncRawValue=function(){var e=(0,i.default)(this._value,g[this.quoteMark]);e===this._value?this.raws&&delete this.raws.value:this.raws.value=e},h._handleEscapes=function(e,t){if(this._constructed){var n=(0,i.default)(t,{isIdentifier:!0});n!==t?this.raws[e]=n:delete this.raws[e]}},h._spacesFor=function(e){var t=this.spaces[e]||{},n=this.raws.spaces&&this.raws.spaces[e]||{};return Object.assign({before:"",after:""},t,n)},h._stringFor=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=C);var o=this._spacesFor(t);return n(this.stringifyProperty(e),o)},h.offsetOf=function(e){var t=1,n=this._spacesFor("attribute");if(t+=n.before.length,"namespace"===e||"ns"===e)return this.namespace?t:-1;if("attributeNS"===e)return t;if(t+=this.namespaceString.length,this.namespace&&(t+=1),"attribute"===e)return t;t+=this.stringifyProperty("attribute").length,t+=n.after.length;var o=this._spacesFor("operator");t+=o.before.length;var i=this.stringifyProperty("operator");if("operator"===e)return i?t:-1;t+=i.length,t+=o.after.length;var r=this._spacesFor("value");t+=r.before.length;var s=this.stringifyProperty("value");return"value"===e?s?t:-1:(t+=s.length,t+=r.after.length,t+=this._spacesFor("insensitive").before.length,"insensitive"===e&&this.insensitive?t:-1)},h.toString=function(){var e=this,t=[this.rawSpaceBefore,"["];return t.push(this._stringFor("qualifiedAttribute","attribute")),this.operator&&(this.value||""===this.value)&&(t.push(this._stringFor("operator")),t.push(this._stringFor("value")),t.push(this._stringFor("insensitiveFlag","insensitive",function(t,n){return!(t.length>0)||e.quoted||0!==n.before.length||e.spaces.value&&e.spaces.value.after||(n.before=" "),C(t,n)}))),t.push("]"),t.push(this.rawSpaceAfter),t.join("")},r=o,(s=[{key:"quoted",get:function(){var e=this.quoteMark;return"'"===e||'"'===e},set:function(e){f()}},{key:"quoteMark",get:function(){return this._quoteMark},set:function(e){this._constructed?this._quoteMark!==e&&(this._quoteMark=e,this._syncRawValue()):this._quoteMark=e}},{key:"qualifiedAttribute",get:function(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function(){return this.insensitive?"i":""}},{key:"value",get:function(){return this._value},set:function(e){if(this._constructed){var t=m(e),n=t.deprecatedUsage,o=t.unescaped,i=t.quoteMark;if(n&&p(),o===this._value&&i===this._quoteMark)return;this._value=o,this._quoteMark=i,this._syncRawValue()}else this._value=e}},{key:"insensitive",get:function(){return this._insensitive},set:function(e){e||(this._insensitive=!1,!this.raws||"I"!==this.raws.insensitiveFlag&&"i"!==this.raws.insensitiveFlag||(this.raws.insensitiveFlag=void 0)),this._insensitive=e}},{key:"attribute",get:function(){return this._attribute},set:function(e){this._handleEscapes("attribute",e),this._attribute=e}}])&&l(r.prototype,s),c&&l(r,c),Object.defineProperty(r,"prototype",{writable:!1}),o}(s.default);t.default=v,v.NO_QUOTE=null,v.SINGLE_QUOTE="'",v.DOUBLE_QUOTE='"';var g=((o={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}}).null={isIdentifier:!0},o);function C(e,t){return""+t.before+e+t.after}},5644:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s,r.registerRoot(s)},5781:e=>{const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),i="/".charCodeAt(0),r="\n".charCodeAt(0),s=" ".charCodeAt(0),a="\f".charCodeAt(0),c="\t".charCodeAt(0),l="\r".charCodeAt(0),d="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),y="}".charCodeAt(0),m=";".charCodeAt(0),v="*".charCodeAt(0),g=":".charCodeAt(0),C="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,I=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,T=/.[\r\n"'(/\\]/,k=/[\da-f]/i;e.exports=function(e,b={}){let A,S,N,_,P,E,L,x,R,O,D=e.css.valueOf(),U=b.ignoreErrors,F=D.length,B=0,M=[],G=[];function j(t){throw e.error("Unclosed "+t,B)}return{back:function(e){G.push(e)},endOfFile:function(){return 0===G.length&&B>=F},nextToken:function(e){if(G.length)return G.pop();if(B>=F)return;let b=!!e&&e.ignoreUnclosed;switch(A=D.charCodeAt(B),A){case r:case s:case c:case l:case a:_=B;do{_+=1,A=D.charCodeAt(_)}while(A===s||A===r||A===c||A===l||A===a);E=["space",D.slice(B,_)],B=_-1;break;case d:case u:case f:case y:case g:case m:case p:{let e=String.fromCharCode(A);E=[e,e,B];break}case h:if(O=M.length?M.pop()[1]:"",R=D.charCodeAt(B+1),"url"===O&&R!==t&&R!==n&&R!==s&&R!==r&&R!==c&&R!==a&&R!==l){_=B;do{if(L=!1,_=D.indexOf(")",_+1),-1===_){if(U||b){_=B;break}j("bracket")}for(x=_;D.charCodeAt(x-1)===o;)x-=1,L=!L}while(L);E=["brackets",D.slice(B,_+1),B,_],B=_}else _=D.indexOf(")",B+1),S=D.slice(B,_+1),-1===_||T.test(S)?E=["(","(",B]:(E=["brackets",S,B,_],B=_);break;case t:case n:P=A===t?"'":'"',_=B;do{if(L=!1,_=D.indexOf(P,_+1),-1===_){if(U||b){_=B+1;break}j("string")}for(x=_;D.charCodeAt(x-1)===o;)x-=1,L=!L}while(L);E=["string",D.slice(B,_+1),B,_],B=_;break;case C:w.lastIndex=B+1,w.test(D),_=0===w.lastIndex?D.length-1:w.lastIndex-2,E=["at-word",D.slice(B,_+1),B,_],B=_;break;case o:for(_=B,N=!0;D.charCodeAt(_+1)===o;)_+=1,N=!N;if(A=D.charCodeAt(_+1),N&&A!==i&&A!==s&&A!==r&&A!==c&&A!==l&&A!==a&&(_+=1,k.test(D.charAt(_)))){for(;k.test(D.charAt(_+1));)_+=1;D.charCodeAt(_+1)===s&&(_+=1)}E=["word",D.slice(B,_+1),B,_],B=_;break;default:A===i&&D.charCodeAt(B+1)===v?(_=D.indexOf("*/",B+2)+1,0===_&&(U||b?_=D.length:j("comment")),E=["comment",D.slice(B,_+1),B,_],B=_):(I.lastIndex=B+1,I.test(D),_=0===I.lastIndex?D.length-1:I.lastIndex-2,E=["word",D.slice(B,_+1),B,_],M.push(E),B=_)}return B++,E},position:function(){return B}}}},5799:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.STRING,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=a,e.exports=t.default},6156:e=>{let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn)}},6291:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(;n.length>0;){var i=n.shift();if(!e[i])return;e=e[i]}return e},e.exports=t.default},6846:(e,t,n)=>{let o=n(145),i=n(6966),r=n(4211),s=n(5644);class a{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new i(this,e,t):new r(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=a,a.default=a,s.registerProcessor(a),o.registerProcessor(a)},6966:(e,t,n)=>{let o=n(7793),i=n(145),r=n(3604),s=n(9577),a=n(3717),c=n(5644),l=n(3303),{isClean:d,my:u}=n(4151);n(6156);const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function y(e){return"object"==typeof e&&"function"==typeof e.then}function m(e){let t=!1,n=h[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function v(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:m(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(e){return e[d]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let C={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(e,t,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof w||t instanceof a)i=g(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=s;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(t,n)}catch(e){this.processed=!0,this.error=e}i&&!i[u]&&o.rebuild(i)}else i=g(t);this.result=new a(e,i,n),this.helpers={...C,postcss:C,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!p[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if("object"==typeof t[n])for(let o in t[n])e(t,"*"===o?n:n+"-"+o.toLowerCase(),t[n][o]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(y(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[d];){e[d]=!0;let t=[v(e)];for(;t.length>0;){let e=this.visitTick(t);if(y(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return y(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=l;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(y(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[d];)e[d]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,o]of e){let e;this.result.lastPlugin=n;try{e=o(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(y(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:o}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(o.length>0&&t.visitorIndex<o.length){let[e,i]=o[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===o.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let o,i=t.iterator;for(;o=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!o[d])return o[d]=!0,void e.push(v(o));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[d]=!0;let t=m(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[d]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}w.registerPostcss=e=>{C=e},e.exports=w,w.default=w,c.registerLazyResult(w),i.registerLazyResult(w)},7071:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.ID,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o.prototype.valueToString=function(){return"#"+e.prototype.valueToString.call(this)},o}(i.default);t.default=a,e.exports=t.default},7149:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(8349))&&o.__esModule?o:{default:o},r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var a=i?Object.getOwnPropertyDescriptor(e,r):null;a&&(a.get||a.set)?Object.defineProperty(o,r,a):o[r]=e[r]}o.default=e,n&&n.set(e,o);return o}(n(680));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}var a=function(e){return new i.default(e)};Object.assign(a,r),delete a.__esModule;var c=a;t.default=c,e.exports=t.default},7324:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3631))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.PSEUDO,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o.prototype.toString=function(){var e=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),e,this.rawSpaceAfter].join("")},o}(i.default);t.default=a,e.exports=t.default},7668:e=>{const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+o+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let o=e.parent,i=0;for(;o&&"root"!==o.type;)i+=1,o=o.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,o=this.raw(e,"between","beforeOpen");this.builder(t+o+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let o=0;o<e.nodes.length;o++){let i=e.nodes[o],r=this.raw(i,"before");r&&this.builder(r),this.stringify(i,t!==o||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=e.raws.important||" !important"),t&&(o+=";"),this.builder(o,e)}document(e){this.body(e)}raw(e,n,o){let i;if(o||(o=n),n&&(i=e.raws[n],void 0!==i))return i;let r=e.parent;if("before"===o){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)return t[o];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[o])return s.rawCache[o];if("before"===o||"after"===o)return this.beforeAfter(e,o);{let t="raw"+((a=o)[0].toUpperCase()+a.slice(1));this[t]?i=this[t](s,e):s.walk(e=>{if(i=e.raws[n],void 0!==i)return!1})}var a;return void 0===i&&(i=t[o]),s.rawCache[o]=i,i}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let o=n.parent;if(o&&o!==e&&o.parent&&o.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let n=e[t],o=e.raws[t];return o&&o.value===n?o.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},7793:(e,t,n)=>{let o,i,r,s,a=n(9371),c=n(5238),l=n(3152),{isClean:d,my:u}=n(4151);function h(e){return e.map(e=>(e.nodes&&(e.nodes=h(e.nodes)),delete e.source,e))}function p(e){if(e[d]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)p(t)}class f extends l{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,o=this.getIterator();for(;this.indexes[o]<this.proxyOf.nodes.length&&(t=this.indexes[o],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[o]+=1;return delete this.indexes[o],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,o=this.index(e),i=this.normalize(t,this.proxyOf.nodes[o]).reverse();o=this.index(e);for(let e of i)this.proxyOf.nodes.splice(o+1,0,e);for(let e in this.indexes)n=this.indexes[e],o<n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,o=this.index(e),i=0===o&&"prepend",r=this.normalize(t,this.proxyOf.nodes[o],i).reverse();o=this.index(e);for(let e of r)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+r.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=h(i(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new c(e)]}else if(e.selector||e.selectors)e=[new s(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new a(e)]}return e.map(e=>(e[u]||f.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[d]&&p(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(o=>{t.props&&!t.props.includes(o.prop)||t.fast&&!o.value.includes(t.fast)||(o.value=o.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let o;try{o=e(t,n)}catch(e){throw t.addToError(e)}return!1!==o&&t.walk&&(o=t.walk(e)),o})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("atrule"===n.type&&e.test(n.name))return t(n,o)}):this.walk((n,o)=>{if("atrule"===n.type&&n.name===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("decl"===n.type&&e.test(n.prop))return t(n,o)}):this.walk((n,o)=>{if("decl"===n.type&&n.prop===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("rule"===n.type&&e.test(n.selector))return t(n,o)}):this.walk((n,o)=>{if("rule"===n.type&&n.selector===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}}f.registerParse=e=>{i=e},f.registerRule=e=>{s=e},f.registerAtRule=e=>{o=e},f.registerRoot=e=>{r=e},e.exports=f,f.default=f,f.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,o.prototype):"rule"===e.type?Object.setPrototypeOf(e,s.prototype):"decl"===e.type?Object.setPrototypeOf(e,c.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,r.prototype),e[u]=!0,e.nodes&&e.nodes.forEach(e=>{f.rebuild(e)})}},8339:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(5644),a=n(1534),c=n(5781);const l={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,i,r=new o;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let s=!1,a=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(c.length>0){for(i=c.length-1,n=c[i];n&&"space"===n[0];)n=c[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}c.push(e)}else c.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(r.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(r,"params",c),s&&(e=c[c.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,o=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(o+=1,2!==o));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,o,i=0;for(let[r,s]of e.entries()){if(n=s,o=n[0],"("===o&&(i+=1),")"===o&&(i-=1),0===i&&":"===o){if(t){if("word"===t[0]&&"progid"===t[1])continue;return r}this.doubleColon(n)}t=n}return!1}comment(e){let t=new i;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=c(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let o,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],o=n[3]||n[2];if(o)return o}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(o=e.shift(),":"===o[0]){n.raws.between+=o[1];break}"word"===o[0]&&/\w/.test(o[1])&&this.unknownWord([o]),n.raws.between+=o[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(o=e[t],"!important"===o[1].toLowerCase()){n.important=!0;let o=this.stringFrom(e,t);o=this.spacesFromEnd(e)+o," !important"!==o&&(n.raws.important=o);break}if("important"===o[1].toLowerCase()){let o=e.slice(0),i="";for(let e=t;e>0;e--){let t=o[e][0];if(i.trim().startsWith("!")&&"space"!==t)break;i=o.pop()[1]+i}i.trim().startsWith("!")&&(n.important=!0,n.raws.important=i,e=o)}if("space"!==o[0]&&"comment"!==o[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,o=!1,i=null,r=[],s=e[1].startsWith("--"),a=[],c=e;for(;c;){if(n=c[0],a.push(c),"("===n||"["===n)i||(i=c),r.push("("===n?")":"]");else if(s&&o&&"{"===n)i||(i=c),r.push("}");else if(0===r.length){if(";"===n){if(o)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(o=!0)}else n===r[r.length-1]&&(r.pop(),0===r.length&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),r.length>0&&this.unclosedBracket(i),t&&o){if(!s)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,o){let i,r,s,a,c=n.length,d="",u=!0;for(let e=0;e<c;e+=1)i=n[e],r=i[0],"space"!==r||e!==c-1||o?"comment"===r?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",l[a]||l[s]||","===d.slice(-1)?u=!1:d+=i[1]):d+=i[1]:u=!1;if(!u){let o=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:o,value:d}}e[t]=d}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let o=t;o<e.length;o++)n+=e[o][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},8349:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(5170))&&o.__esModule?o:{default:o};var r=function(){function e(e,t){this.func=e||function(){},this.funcRes=null,this.options=t}var t=e.prototype;return t._shouldUpdateSelector=function(e,t){return void 0===t&&(t={}),!1!==Object.assign({},this.options,t).updateSelector&&"string"!=typeof e},t._isLossy=function(e){return void 0===e&&(e={}),!1===Object.assign({},this.options,e).lossless},t._root=function(e,t){return void 0===t&&(t={}),new i.default(e,this._parseOptions(t)).root},t._parseOptions=function(e){return{lossy:this._isLossy(e)}},t._run=function(e,t){var n=this;return void 0===t&&(t={}),new Promise(function(o,i){try{var r=n._root(e,t);Promise.resolve(n.func(r)).then(function(o){var i=void 0;return n._shouldUpdateSelector(e,t)&&(i=r.toString(),e.selector=i),{transform:o,root:r,string:i}}).then(o,i)}catch(e){return void i(e)}})},t._runSync=function(e,t){void 0===t&&(t={});var n=this._root(e,t),o=this.func(n);if(o&&"function"==typeof o.then)throw new Error("Selector processor returned a promise to a synchronous call.");var i=void 0;return t.updateSelector&&"string"!=typeof e&&(i=n.toString(),e.selector=i),{transform:o,root:n,string:i}},t.ast=function(e,t){return this._run(e,t).then(function(e){return e.root})},t.astSync=function(e,t){return this._runSync(e,t).root},t.transform=function(e,t){return this._run(e,t).then(function(e){return e.transform})},t.transformSync=function(e,t){return this._runSync(e,t).transform},t.process=function(e,t){return this._run(e,t).then(function(e){return e.string||e.root.toString()})},t.processSync=function(e,t){var n=this._runSync(e,t);return n.string||n.root.toString()},e}();t.default=r,e.exports=t.default},8354:(e,t)=>{t.__esModule=!0,t.default=function(e){var t="",n=e.indexOf("/*"),o=0;for(;n>=0;){t+=e.slice(o,n);var i=e.indexOf("*/",n+2);if(i<0)return t;o=i+2,n=e.indexOf("/*",o)}return t+=e.slice(o)},e.exports=t.default},8500:(e,t,n)=>{t.__esModule=!0,t.isComment=t.isCombinator=t.isClassName=t.isAttribute=void 0,t.isContainer=function(e){return!(!s(e)||!e.walk)},t.isIdentifier=void 0,t.isNamespace=function(e){return c(e)||g(e)},t.isNesting=void 0,t.isNode=s,t.isPseudo=void 0,t.isPseudoClass=function(e){return f(e)&&!w(e)},t.isPseudoElement=w,t.isUniversal=t.isTag=t.isString=t.isSelector=t.isRoot=void 0;var o,i=n(1581),r=((o={})[i.ATTRIBUTE]=!0,o[i.CLASS]=!0,o[i.COMBINATOR]=!0,o[i.COMMENT]=!0,o[i.ID]=!0,o[i.NESTING]=!0,o[i.PSEUDO]=!0,o[i.ROOT]=!0,o[i.SELECTOR]=!0,o[i.STRING]=!0,o[i.TAG]=!0,o[i.UNIVERSAL]=!0,o);function s(e){return"object"==typeof e&&r[e.type]}function a(e,t){return s(t)&&t.type===e}var c=a.bind(null,i.ATTRIBUTE);t.isAttribute=c;var l=a.bind(null,i.CLASS);t.isClassName=l;var d=a.bind(null,i.COMBINATOR);t.isCombinator=d;var u=a.bind(null,i.COMMENT);t.isComment=u;var h=a.bind(null,i.ID);t.isIdentifier=h;var p=a.bind(null,i.NESTING);t.isNesting=p;var f=a.bind(null,i.PSEUDO);t.isPseudo=f;var y=a.bind(null,i.ROOT);t.isRoot=y;var m=a.bind(null,i.SELECTOR);t.isSelector=m;var v=a.bind(null,i.STRING);t.isString=v;var g=a.bind(null,i.TAG);t.isTag=g;var C=a.bind(null,i.UNIVERSAL);function w(e){return f(e)&&e.value&&(e.value.startsWith("::")||":before"===e.value.toLowerCase()||":after"===e.value.toLowerCase()||":first-letter"===e.value.toLowerCase()||":first-line"===e.value.toLowerCase())}t.isUniversal=C},8633:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},8937:e=>{var t={}.hasOwnProperty,n=/[ -,\.\/:-@\[-\^`\{-~]/,o=/[ -,\.\/:-@\[\]\^`\{-~]/,i=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,r=function e(r,s){"single"!=(s=function(e,n){if(!e)return n;var o={};for(var i in n)o[i]=t.call(e,i)?e[i]:n[i];return o}(s,e.options)).quotes&&"double"!=s.quotes&&(s.quotes="single");for(var a="double"==s.quotes?'"':"'",c=s.isIdentifier,l=r.charAt(0),d="",u=0,h=r.length;u<h;){var p=r.charAt(u++),f=p.charCodeAt(),y=void 0;if(f<32||f>126){if(f>=55296&&f<=56319&&u<h){var m=r.charCodeAt(u++);56320==(64512&m)?f=((1023&f)<<10)+(1023&m)+65536:u--}y="\\"+f.toString(16).toUpperCase()+" "}else y=s.escapeEverything?n.test(p)?"\\"+p:"\\"+f.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(p)?"\\"+f.toString(16).toUpperCase()+" ":"\\"==p||!c&&('"'==p&&a==p||"'"==p&&a==p)||c&&o.test(p)?"\\"+p:p;d+=y}return c&&(/^-[-\d]/.test(d)?d="\\-"+d.slice(1):/\d/.test(l)&&(d="\\3"+l+" "+d.slice(1))),d=d.replace(i,function(e,t,n){return t&&t.length%2?e:(t||"")+n}),!c&&s.wrap?a+d+a:d};r.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1},r.version="3.0.0",e.exports=r},9371:(e,t,n)=>{let o=n(3152);class i extends o{constructor(e){super(e),this.type="comment"}}e.exports=i,i.default=i},9577:(e,t,n)=>{let o=n(7793),i=n(1106),r=n(8339);function s(e,t){let n=new i(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=s,s.default=s,o.registerParse(s)},9606:(e,t,n)=>{t.__esModule=!0,t.unesc=t.stripComments=t.getProp=t.ensureObject=void 0;var o=a(n(5286));t.unesc=o.default;var i=a(n(6291));t.getProp=i.default;var r=a(n(1557));t.ensureObject=r.default;var s=a(n(8354));function a(e){return e&&e.__esModule?e:{default:e}}t.stripComments=s.default},9720:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(3295))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var a=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).type=r.TAG,n}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n),o}(i.default);t.default=a,e.exports=t.default},9746:()=>{},9977:()=>{}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{ADMIN:()=>oa,ALLID:()=>Kr,AccessControlService:()=>Kc,AccessTracker:()=>De,AddGhostConcept:()=>$r,Anomaly:()=>Cc,BaseUrl:()=>r,BinaryTree:()=>b,BuildWidgetFromId:()=>Wc,BuilderStatefulWidget:()=>uc,Composition:()=>yr,CompositionBinaryTree:()=>dr,CompositionNode:()=>cr,Concept:()=>A,ConceptsData:()=>U,Connection:()=>Ue,ConnectionData:()=>Je,CountInfo:()=>ss,CreateComposition:()=>Jn,CreateConnection:()=>ro,CreateConnectionBetweenEntityLocal:()=>Uc,CreateConnectionBetweenTwoConcepts:()=>So,CreateConnectionBetweenTwoConceptsGeneral:()=>_o,CreateConnectionBetweenTwoConceptsLocal:()=>$s,CreateData:()=>Fl,CreateDefaultConcept:()=>S,CreateDefaultLConcept:()=>pt,CreateSession:()=>Lr,CreateSessionVisit:()=>Rr,CreateTheCompositionLocal:()=>yo,CreateTheCompositionWithCache:()=>vr,CreateTheConnection:()=>xn,CreateTheConnectionGeneral:()=>Co,CreateTheConnectionLocal:()=>io,DATAID:()=>zr,DATAIDDATE:()=>Qr,DATAV2:()=>Xr,DelayFunctionExecution:()=>Zs,DeleteConceptById:()=>ei,DeleteConceptLocal:()=>zs,DeleteConnectionById:()=>ko,DeleteConnectionByIdBulk:()=>bo,DeleteConnectionByType:()=>bc,DeleteConnectionByTypeBulk:()=>Ac,DeleteUser:()=>ti,DependencyObserver:()=>la,Environments:()=>Z,FilterSearch:()=>xa,FormatFromConnections:()=>As,FormatFromConnectionsAltered:()=>ks,FreeschemaQuery:()=>Nc,FreeschemaQueryApi:()=>Pc,GetAllConnectionsOfComposition:()=>Ut,GetAllConnectionsOfCompositionBulk:()=>rt,GetAllLinkerConnectionsFromTheConcept:()=>$o,GetAllTheConnectionsByTypeAndOfTheConcept:()=>Sc,GetComposition:()=>Gt,GetCompositionBulk:()=>yi,GetCompositionBulkWithDataId:()=>mi,GetCompositionFromConnectionsWithDataId:()=>vi,GetCompositionFromConnectionsWithDataIdFromConnections:()=>gi,GetCompositionFromConnectionsWithDataIdInObject:()=>ki,GetCompositionFromConnectionsWithDataIdIndex:()=>Ci,GetCompositionFromConnectionsWithIndex:()=>wi,GetCompositionFromConnectionsWithIndexFromConnections:()=>Ii,GetCompositionFromMemoryWithConnections:()=>$t,GetCompositionList:()=>fn,GetCompositionListAll:()=>yn,GetCompositionListAllWithId:()=>mn,GetCompositionListListener:()=>ga,GetCompositionListLocal:()=>An,GetCompositionListLocalWithId:()=>Sn,GetCompositionListWithId:()=>vn,GetCompositionListWithIdUpdated:()=>gn,GetCompositionListener:()=>ya,GetCompositionLocal:()=>In,GetCompositionLocalWithId:()=>Tn,GetCompositionWithAllIds:()=>jt,GetCompositionWithCache:()=>Ar,GetCompositionWithDataIdBulk:()=>_r,GetCompositionWithDataIdWithCache:()=>Nr,GetCompositionWithId:()=>Qt,GetCompositionWithIdAndDateFromMemory:()=>Jt,GetConceptBulk:()=>Xe,GetConceptByCharacter:()=>ln,GetConceptByCharacterAndCategoryLocal:()=>hn,GetConceptByCharacterAndType:()=>Dn,GetConnectionBetweenTwoConceptsLinker:()=>Ks,GetConnectionBulk:()=>pi,GetConnectionById:()=>ai,GetConnectionDataPrefetch:()=>Ti,GetConnectionOfTheConcept:()=>vo,GetConnectionTypeForCount:()=>ls,GetConnectionsBetweenApi:()=>pc,GetFreeschemaImage:()=>Zl,GetFreeschemaImageUrl:()=>Xl,GetImageApi:()=>Yl,GetInstanceConceptByCharacterType:()=>na,GetLink:()=>Oo,GetLinkListListener:()=>Na,GetLinkListener:()=>Ia,GetLinkRaw:()=>Do,GetLinkerConnectionFromConcepts:()=>Qo,GetLinkerConnectionToConcepts:()=>Yo,GetRelation:()=>Fr,GetRelationLocal:()=>Ds,GetRelationNew:()=>Br,GetRelationRaw:()=>Mr,GetTheConcept:()=>on,GetTheConceptLocal:()=>Es,GetUserGhostId:()=>qr,JUSTDATA:()=>Jr,LConcept:()=>_a,LConnection:()=>Pa,LISTNORMAL:()=>Zr,LocalConceptsData:()=>xt,LocalSyncData:()=>_t,LocalTransaction:()=>mc,LogEvent:()=>Hc,Logger:()=>no,LoginToBackend:()=>Qi,MakeTheInstanceConcept:()=>Hn,MakeTheInstanceConceptLocal:()=>po,MakeTheTimestamp:()=>di,MakeTheTypeConceptApi:()=>Vo,MakeTheTypeConceptLocal:()=>uo,NORMAL:()=>Hr,PRIVATE:()=>ia,PUBLIC:()=>ra,PatcherStructure:()=>Ea,Prototype:()=>Vl,RAW:()=>Yr,RecursiveSearchApi:()=>Ni,RecursiveSearchApiNewRawFullLinker:()=>Li,RecursiveSearchApiRaw:()=>Pi,RecursiveSearchApiRawFullLinker:()=>Ei,RecursiveSearchApiWithInternalConnections:()=>_i,RecursiveSearchListener:()=>ba,SchemaQuery:()=>Rc,SchemaQueryListener:()=>xc,SearchAllConcepts:()=>Ir,SearchLinkInternal:()=>Ws,SearchLinkInternalAll:()=>Vs,SearchLinkMultipleAll:()=>Ts,SearchLinkMultipleAllObservable:()=>ua,SearchLinkMultipleApi:()=>Ee,SearchQuery:()=>ui,SearchStructure:()=>Ra,SearchWithLinker:()=>kr,SearchWithTypeAndLinker:()=>fs,SearchWithTypeAndLinkerApi:()=>aa,Selector:()=>zc,SessionData:()=>La,Signin:()=>er,Signup:()=>Ki,SignupEntity:()=>Zi,SplitStrings:()=>Le,StatefulWidget:()=>sc,SyncData:()=>Ln,TokenStorage:()=>he,TrashTheConcept:()=>oi,UpdateComposition:()=>Cr,UpdateCompositionLocal:()=>xs,UserBinaryTree:()=>Wr,Validator:()=>Ic,ViewInternalData:()=>Ms,ViewInternalDataApi:()=>Fs,WidgetTree:()=>Oc,buildFetchConnection:()=>fc,clearAllCaches:()=>qc,convertFromConceptToLConcept:()=>Ss,convertFromLConceptToConcept:()=>Ns,convertWidgetTreeToWidget:()=>_l,convertWidgetTreeToWidgetWithWrapper:()=>El,createFormFieldData:()=>Tc,createPrototypeLocal:()=>Hl,dispatchIdEvent:()=>wd,getFromDatabaseWithType:()=>Lo,getObjectsFromIndexDb:()=>xo,getR2PresignedUploadUrl:()=>ji,getUploadFileLimit:()=>zi,getUserDetails:()=>cc,getUserDetailsWithRefresh:()=>lc,getWidgetBulkFromId:()=>Nl,getWidgetFromId:()=>Sl,handleServiceWorkerException:()=>Td,hasActivatedSW:()=>ud,importLatestWidget:()=>gl,importRecentWidget:()=>Cl,init:()=>fd,orderTheConnections:()=>us,recursiveFetch:()=>Zt,recursiveFetchNew:()=>hr,removeAllChildren:()=>$c,renderImportedWidget:()=>wl,renderLatestWidget:()=>Il,renderPage:()=>vl,renderWidget:()=>Tl,searchLinkMultipleListener:()=>ha,sendEmail:()=>tc,sendMessage:()=>yd,sendPersonalEmail:()=>nc,serviceWorker:()=>ed,setHasActivatedSW:()=>hd,storeToDatabase:()=>Eo,subscribedListeners:()=>od,unwrapContainers:()=>Rl,updateAccessToken:()=>pd,uploadAttachment:()=>Mi,uploadFile:()=>Hi,uploadImage:()=>qi,uploadImageV2:()=>$i,uploadR2Storage:()=>Gi,uploadToR2PresignedUrl:()=>Wi,uploadWithR2PresignedUrl:()=>Vi,validDocumentFormats:()=>Oi,validImageFormats:()=>Ri});class i{constructor(e){this.id=1,this.isOnlineSync=!1,this.isOnlineSync=e}}class r{static setRandomizer(e){this.BASE_RANDOMIZER=e}static getRandomizer(){return this.BASE_RANDOMIZER}static GetConceptUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/getConcept":this.NODE_CACHE_URL+"/api/getConcept"}static GetConnectionUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get-connection-by-id":this.NODE_CACHE_URL+"/api/get-connection-by-id"}static GetConceptBulkUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get_concept_bulk":this.NODE_CACHE_URL+"/api/get_concept_bulk"}static GetConnectionBulkUrl(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get_connection_bulk":this.NODE_CACHE_URL+"/api/get_connection_bulk"}static GetAllConceptsOfUserUrl(){return this.BASE_URL+"/api/get_all_concepts_of_user"}static GetAllConnectionsOfUserUrl(){return this.BASE_URL+"/api/get_all_connections_of_user"}static GetAllConnectionsOfCompositionUrl(){return this.BASE_URL+"/api/get_all_connections_of_composition"}static GetAllConnectionsOfCompositionBulkUrl(){return this.BASE_URL+"/api/get_all_connections_of_composition_bulk"}static GetConceptByCharacterValueUrl(){return this.BASE_URL+"/api/get_concept_by_character_value"}static GetConceptByCharacterAndTypeUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_type"}static GetConceptByCharacterAndCategoryUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_category"}static GetInstanceConceptByCharacterTypeUrl(){return this.BASE_URL+"/api/get_instance_concept_by_character_type"}static GetConceptByCharacterAndCategoryDirectUrl(){return this.BASE_URL+"/api/get_concept_by_character_and_category_direct"}static GetCharacterByCharacterUrl(){return this.BASE_URL+"/api/get_character_by_character"}static GetAllConceptsByTypeUrl(){return this.BASE_URL+"/api/get_all_concepts_by_type"}static GetAllConnectionsOfConceptUrl(){return this.BASE_URL+"/api/get-link-connections"}static GetAllConnectionsToConceptUrl(){return this.BASE_URL+"/api/get-link-reverse-connections"}static GetAllAiData(){return this.BASE_URL+"/api/get-preloaded-concepts"}static getAppConfig(){return this.NODE_URL+"/api/v1/config"}static PostPrefetchConceptConnections(){return this.NODE_URL+"/api/v1/access-tracker/sync-access-tracker"}static GetSuggestedConcepts(){return this.NODE_URL+"/api/v1/access-tracker/list-concepts-file"}static GetSuggestedConnections(){return this.NODE_URL+"/api/v1/access-tracker/list-connections-file"}static PostLogger(){return this.LOG_SERVER+"/api/logger"}static LogHealth(){return this.LOG_SERVER+"/api/check"}static GetAllPrefetchConnectionsUrl(){return this.BASE_URL+"/api/get_all_connections_of_user?inpage=500"}static GetAllLinkerConnectionOfConceptUrl(){return this.BASE_URL+"/api/get-all-linkers-from-concept"}static GetAllLinkerConnectionToConceptUrl(){return this.BASE_URL+"/api/get-all-linkers-to-concept"}static DeleteConceptUrl(){return this.BASE_URL+"/api/delete_concept"}static DeleteUserUrl(){return this.BASE_URL+"/api/deleteuser"}static RecursiveSearchUrl(){return this.BASE_URL+"/api/recursivesearch-concept-connection"}static SearchLinkMultipleAllApiUrl(){return this.BASE_URL+"/api/Connection/search-link-multiple-all-ccs"}static MakeTheNameInBackendUrl(){return this.BASE_URL+"/api/make-name-from-frontend"}static SearchAllTypeWithLinker(e=!0){return e?this.BASE_URL+"/api/search-all-with-linker-ccs":this.BASE_URL+"/api-search-compositions-internal-clean-ccs"}static LoginUrl(){return this.BASE_URL+"/api/auth/login"}static RefreshTokenUrl(){return this.BASE_URL+"/api/auth/refresh"}static SignupUrl(){return this.BASE_URL+"/api/auth/signup"}static GetCompositionConnectionBetweenTwoConceptsUrl(){return this.BASE_URL+"/api/get-composition-connection-between-two-concepts"}static SearchCompositionsUrl(){return this.BASE_URL+"/api/search-compositions"}static SearchLinkMultipleAll(){return this.BASE_URL+"/api/Connection/search-link-multiple-all"}static CreateSessionId(){return this.BASE_URL+"/api/create-session-id-remote"}static CreateSessionVisitUrl(){return this.BASE_URL+"/api/create-remote-session-visit"}static ViewInternalDataUrl(){return this.BASE_URL+"/api/view-api-internal-data-ccs-id-bulk"}static SearchInternalWithAuthenticatedCcsUrl(){return this.BASE_URL+"/api/search-composition-internal-authenticated-ccs"}static SearchInternalWithCcsUrl(){return this.BASE_URL+"/api-search-compositions-internal-clean-ccs"}static CreateGhostConceptApiUrl(e=!0){return e?r.NODE_URL+"/api/v1/local-concepts":r.NODE_URL+"/api/v1/local-concepts-without-auth"}static CreateGhostConnectionApiUrl(){return r.NODE_URL+"/api/v1/local-connections"}static GetRealConceptById(){return r.NODE_URL+"/api/v1/local-concepts-translate"}static GetReservedIdUrl(){return this.BASE_URL+"/api/get_reserved_ids"}static GetReservedConnectionIdUrl(){return this.BASE_URL+"/api/get_reserved_connection_ids"}static CreateTheTextDataUrl(){return this.BASE_URL+"/api/create_text_data"}static CreateTheCharacterDataUrl(){return this.BASE_URL+"/api/create_character_data"}static CreateTheConceptUrl(){return this.BASE_URL+"/api/create_the_concept"}static CreateTheConnectionUrl(){return this.BASE_URL+"/api/create_the_connection"}static CreateTheConnectionNewUrl(){return this.BASE_URL+"/api/create_the_connection_new"}static MakeTheTypeConceptUrl(){return this.BASE_URL+"/api/make_the_type_concept"}static DeleteTheConnectionUrl(){return this.BASE_URL+"/api/delete_connection"}static DeleteTheConnectionBulkUrl(){return this.BASE_URL+"/api/delete_connection_bulk"}static GetTypeConceptBulk(){return this.BASE_URL+"/api/get_type_concept_by_character_bulk"}static UploadFileLimitUrl(){return this.BASE_URL+"/api/upload/limit"}static FreeschemaQueryUrl(){return this.BASE_URL+"/api/freeschema-query"}static uploadImageUrl(){return this.uploadR2StorageUrl()}static uploadImageUrlWithSmall(){return this.BASE_URL+"/api/Image/UploadImageV2"}static uploadFileUrl(){return this.uploadR2StorageUrl()}static uploadR2StorageUrl(){return this.BASE_URL+"/api/R2Storage/upload"}static r2PresignedUploadUrl(){return this.BASE_URL+"/api/R2Storage/presigned-upload-url"}static sendMail(){return this.BASE_URL+"/api/sendmail"}static sendBulkMail(){return this.BASE_URL+"/api/sendmail/bulk"}static sendPersonalMail(){return this.BASE_URL+"/api/sendmail/personal"}static getWidgetData(){return this.BASE_URL+"/api/get-widget"}static getLatestWidgetData(){return!this.NODE_CACHE_URL||this.NODE_CACHE_URL&&"string"==typeof this.NODE_CACHE_URL&&""===this.NODE_CACHE_URL.trim()?this.BASE_URL+"/api/get-latest-widget":this.NODE_CACHE_URL+"/api/get-latest-widget"}static getRecentWidgetData(){return this.BASE_URL+"/api/get-recent-widget"}static getConnectionsByTypes(){return this.BASE_URL+"/api/get-connection-by-types"}static GetConnectionsBetweenUrl(){return this.BASE_URL+"/api/get-connection-between"}static CreatePrototypeUrl(){return this.BASE_URL+"/api/create-prototype"}static GetCachedImage(e){return"https://cdn.boomconcole.com/freeschema/"+e}}r.BASE_URL="https://localhost:7053/",r.NODE_CACHE_URL="",r.AI_URL="https://ai.freeschema.com",r.MQTT_URL="192.168.1.249",r.NODE_URL="http://localhost:5001",r.LOG_SERVER="https://logdev.freeschema.com",r.BASE_APPLICATION="",r.DOCUMENTATION_WIDGET=0,r.isNearestCache=!0,r.ACCESS_CONTROL_BASE_URL="http://localhost:5001",r.isPwa=!1,r.FLAGS={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1},r.RECAPTCHA_SITE_KEY="",r.RECAPTCHA_ACTION="send_mail",r.BASE_RANDOMIZER=999;class s{constructor(e,t,n,o){this.url=r.BASE_URL,this.message=e,this.ok=t,this.status=n,this.data=o}getMessage(){return this.message}setMessage(e){return this.message=e,this}getStatus(){return this.status}setStatus(e){return this.status=e,this}getData(){return this.data}setData(e){return this.data=e,this}getOk(){return this.ok}setOk(e){return this.ok=e,this}getUrl(){return this.url}setUrl(e){return this.url=e,this}}function a(e){if(no.log("ERROR",e.statusText,{code:e.status,data:e.statusText}),401==e.status||406==e.status){let t=new s(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}if(500==e.status){let t=new s(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}}function c(e,t={}){if(no.log("ERROR",t.statusText,{code:e.status,data:e.status}),401==e.status||406==e.status){let n=new s(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}if(500==e.status){let n=new s(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}}function l(e,t=""){if(no.log("ERROR",e.message,{code:e.status,data:e.stack}),e.status){let n=new s(e.message,!1,e.status,e.stack);throw n.setUrl(t),n}{let n=new s(e.message,!1,500,e.stack);throw n.setUrl(t),n}}function d(e,t,n){var o;try{if(!e)return;const t=Date.now();e.startTime=null!==(o=e.startTime)&&void 0!==o?o:t,e.responseTime=t-e.startTime+" ms",e.level="ERROR",e.errorMessage=(null==n?void 0:n.message)||"Unknown error occurred"}catch(e){}}var u=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};let h=10;class p{}let f=null;function y(e){const t=no.logfunction("openDatabase",[e,"indexdb"]);return p.db?(no.logUpdate(t),Promise.resolve(p.db)):f||(f=new Promise(function(e,n){let o=r.BASE_URL+"_FreeSchema"+r.BASE_APPLICATION;const i=indexedDB.open(o,h);i.onupgradeneeded=e=>{let t=e.target.result,n="concept",o="connection",i="settings";t.objectStoreNames.contains(n)&&t.deleteObjectStore(n),t.objectStoreNames.contains(o)&&t.deleteObjectStore(o),t.objectStoreNames.contains(i)&&t.deleteObjectStore(i),t.createObjectStore(n,{keyPath:"id"}),t.createObjectStore(o,{keyPath:"id"}),t.createObjectStore(i,{keyPath:"id"})},i.onsuccess=function(n){let o=n.target;p.db=o.result,no.logUpdate(t),e(p.db)},i.onerror=e=>{f=null,d(t,0,e),n(e)}}),f)}function m(e,t){const n=no.logfunction("UpdateToDatabase",[e,"indexdb"]);return new Promise(function(o,i){y(e).then(r=>{const s=r.transaction(e,"readwrite").objectStore(e).put(t);s.onsuccess=e=>{no.logUpdate(n),o(t)},s.onerror=o=>{let r={status:400,ok:!1,message:"Cannot Update to the database"+e,data:o,body:t};d(n,0,r),i(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the database",data:e};d(n,0,t),i(t)})})}function v(e){return u(this,void 0,void 0,function*(){const t=no.logfunction("getObjectsFromIndexDb",[e,"indexdb"]);return new Promise(function(n,o){y(e).then(o=>{let i=[],r=o.transaction(e,"readwrite").objectStore(e).getAll();r.onsuccess=()=>{const e=r.result;for(let t=0;t<e.length;t++)i.push(e[t]);no.logUpdate(t),n(i)}}).catch(e=>{let n={status:400,ok:!1,message:"Cannot get objects from the database because you cannot open the database",data:e};d(t,0,n),o(n)})})})}function g(e,t){const n=no.logfunction("removeFromDatabase",[e,"indexdb"]);return new Promise(function(o,i){y(e).then(r=>{const s=r.transaction(e,"readwrite").objectStore(e).delete(Number(t));s.onsuccess=function(e){no.logUpdate(n),o(t)},s.onerror=t=>{let o={status:400,ok:!1,message:"Cannot remove from the database"+e,data:t};d(n,0,o),i(o)}}).catch(e=>{let o={status:400,ok:!1,message:"Cannot remove from the database because you cannot open the database",data:e,body:t};d(n,0,o),i(o)})})}class C{}C.isTypeLoaded=!1,C.isCharacterLoaded=!1,C.isDataLoaded=!1,C.isLocalDataLoaded=!1,C.isLocalCharacterLoaded=!1,C.isLocalTypeLoaded=!1,C.isConnectionLoaded=!1,C.isConnectionTypeLoaded=!1,C.isLocalConnectionLoaded=!1;class w{constructor(e,t,n,o){this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return t=e;let n=!1;for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}addNode(e,t,n){if(null==t)return t=e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}checkIfIdsInNode(e,t,n,o){if(e){if(t.includes(e.key)){n.push(e.value);let o=t.indexOf(e.key);t.splice(o,1)}e.leftNode&&this.checkIfIdsInNode(e.leftNode,t,n,o),e.rightNode&&this.checkIfIdsInNode(e.rightNode,t,n,o)}}addCharacterNode(e,t,n){let o=!1;if(""!=e.value.characterValue){if(null==t)return t=e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addCharacterNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&""!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addCharacterNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}else o;return t}addTypeNode(e,t,n){let o=!1;if(0!=e.value.typeId){if(null==t)return t=e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}else o;return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getCharacterFromNodeUpdated(e,t){var n;return t?e==t.key||51==(null===(n=t.value)||void 0===n?void 0:n.typeId)?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getFromNodeWithCharacterAndType(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.typeId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.typeId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndType(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndType(e,t,n.rightNode)}return null}return n}getFromNodeWithCharacterAndCategory(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.categoryId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.categoryId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.rightNode)}return null}return n}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){let t=e.variants[0];if(t)return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var I=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class T{static waitForDataToLoad(){return I(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isCharacterLoaded)return e("done");setTimeout(T.checkFlag,1e3,e)}static addNodeToTree(e){return I(this,void 0,void 0,function*(){return null==this.characterRoot?(this.characterRoot=e,this.characterRoot):(this.characterRoot=this.characterRoot.addCharacterNode(e,this.characterRoot,this.characterRoot.height),this.characterRoot)})}static removeNodeByCharacter(e,t){return I(this,void 0,void 0,function*(){this.characterRoot&&this.characterRoot.removeNodeWithVariants(this.characterRoot,e,t)})}static countNumberOfNodes(){return this.characterRoot?this.characterRoot.countNodeBelow(this.characterRoot):0}static addConceptToTree(e){if(""!=e.characterValue){var t=new w(e.characterValue,e,null,null);this.addNodeToTree(t)}}static getNodeFromTree(e){return this.characterRoot?this.characterRoot.getCharacterFromNode(e,this.characterRoot):this.characterRoot}static getNodeFromTreeUpdated(e){return this.characterRoot?this.characterRoot.getCharacterFromNode(e,this.characterRoot):this.characterRoot}static getCharacterAndTypeFromTree(e,t){return I(this,void 0,void 0,function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndType(e,t,this.characterRoot):this.characterRoot})}static getCharacterAndCategoryFromTree(e,t){return I(this,void 0,void 0,function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndCategory(e,t,this.characterRoot):this.characterRoot})}static removeConceptCharacter(e){this.characterRoot&&(this.characterRoot=this.characterRoot.removeNode(this.characterRoot,e))}}T.characterRoot=null;var k=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class b{static normalizeId(e){return Number(e)}static addNodeToTree(e){this.conceptMap.set(this.normalizeId(e.key),e.value),null===this.root&&(this.root=e)}static waitForDataToLoad(){return k(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isDataLoaded)return e("done");setTimeout(b.checkFlag,1e3,e)}static addConceptToTree(e){let t=new w(e.characterValue,e,null,null);T.addNodeToTree(t);const n=this.normalizeId(e.id);this.conceptMap.set(n,e),null===this.root&&(this.root=new w(n,e,null,null))}static getNodeFromTree(e){return k(this,void 0,void 0,function*(){const t=this.normalizeId(e),n=this.conceptMap.get(t);return n?{key:t,value:n}:null})}static removeNodeFromTree(e){return k(this,void 0,void 0,function*(){const t=this.normalizeId(e);this.conceptMap.has(t)&&(wd(t),this.conceptMap.delete(t),0===this.conceptMap.size&&(this.root=null))})}static getConceptListFromIds(e,t,n){return k(this,void 0,void 0,function*(){for(let n=e.length-1;n>=0;n--){const o=this.conceptMap.get(this.normalizeId(e[n]));o&&(t.push(o),e.splice(n,1))}})}static countNumberOfNodes(){return this.conceptMap.size}}b.root=null,b.conceptMap=new Map;class A{constructor(e,t,n,o,i,s,a,c=!1,l,d,u){this.count=0,this.typeCharacter="",this.referent=null,this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=r.getRandomizer(),this.x=0,this.y=0,this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=o,this.referentId=i,this.characterValue=`${s}`,this.accessId=a,this.typeCharacter=u,this.type=null,this.isNew=c,this.entryTimeStamp=l,this.updatedTimeStamp=d}getType(){}}function S(){let e=N(new Date),t=N(new Date);return new A(0,0,0,0,0,"0",0,!1,e,t,"0")}function N(e){const t=e.getMonth()+1,n=e.getDate(),o=e.getFullYear();let i=e.getHours();const r=e.getMinutes(),s=e.getSeconds(),a=i>=12?"PM":"AM";i%=12,i=i||12;const c=e=>e.toString().padStart(2,"0");return`${t}/${n}/${o} ${i}:${c(r)}:${c(s)} ${a}`}class _{constructor(e,t){this.value=[],this.height=1,this.key=e,this.value.push(t),this.leftNode=null,this.rightNode=null,this.currentNode=null}addType(e,t,n){var o,i,r,s;if(null==e)return wd(t,{detail:n}),new _(t,n);if(t<e.key)e.leftNode=this.addType(e.leftNode,t,n);else{if(!(t>e.key))return e.value.includes(n)||(wd(t,{detail:n}),e.value.push(n)),e;e.rightNode=this.addType(e.rightNode,t,n)}e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1;const a=this.getBalanceFactor(e);return a>1&&t<(null===(o=e.leftNode)||void 0===o?void 0:o.key)?this.rightRotate(e):a<-1&&t>(null===(i=e.rightNode)||void 0===i?void 0:i.key)?this.leftRotate(e):a>1&&t>(null===(r=e.leftNode)||void 0===r?void 0:r.key)?(e.leftNode=this.leftRotate(e.leftNode),this.rightRotate(e)):a<-1&&t<(null===(s=e.rightNode)||void 0===s?void 0:s.key)?(e.rightNode=this.rightRotate(e.rightNode),this.leftRotate(e)):e}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.value.length>0)for(let t=0;t<e.value.length;t++)if(n==e.value[t])return e.value.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var P=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class E{static addType(e){return P(this,void 0,void 0,function*(){if(null==this.root){this.root=e;new CustomEvent(`${e.key}`,{detail:e.value[0]});return wd(e.key,{detail:e.value[0]}),this.root}return this.root=this.root.addType(this.root,e.key,e.value[0]),this.root})}static addConceptToTree(e){if(0!=e.typeId){let t=new _(e.typeId,e.id);this.addType(t)}}static removeTypeConcept(e,t){this.root&&(this.root=this.root.removeNodeWithVariants(this.root,e,t))}static getNodeFromTreeNew(e){if(this.root){return this.root.getFromNode(e,this.root)}return this.root}static getTypeVariantsFromTreeNew(e){return P(this,void 0,void 0,function*(){let t=this.getNodeFromTreeNew(e),n=[],o=[];if(t){n=t.value;for(let e=0;e<n.length;e++){let t=!1;for(let i=0;i<o.length;i++)o[i].id==n[e]&&(t=!0);t||o.push(yield on(n[e]))}}return o})}static waitForDataToLoad(){return P(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isTypeLoaded)return e("done");setTimeout(E.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserIdNew(e,t){return P(this,void 0,void 0,function*(){let n=[],o=yield this.getTypeVariantsFromTreeNew(e);for(let e=0;e<o.length;e++)o[e].userId==t&&n.push(o[e]);return n})}static getTypeVariantsWithCharacterValueNew(e,t){return P(this,void 0,void 0,function*(){let n=yield this.getTypeVariantsFromTreeNew(t),o=S();for(let t=0;t<n.length;t++)n[t].characterValue==e&&(o=n[t]);return o})}static countNumberOfNodes(){return this.typeRoot?this.typeRoot.countNodeBelow(this.typeRoot):0}}E.typeRoot=null,E.root=null;class L{constructor(e,t,n,o){this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return t=e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.rightNode=this.removeNode(e.rightNode,t.key),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var x=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class R{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addWidgetToTree(e){let t=new L(e.widgetId,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return x(this,void 0,void 0,function*(){if(this.root){return this.root.getFromNode(e,this.root)}return null})}static removeNodeFromTree(e){return x(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}R.root=null;class O{constructor(){this.widgetId=0,this.mainId=0,this.conceptIds=[],this.linkers=[],this.reverse=[],this.mainCompositionIds=[],this.countinfo=[]}}var D=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class U{constructor(){this.name="conceptsArray"}static CheckContains(e){for(var t=!1,n=0;n<this.conceptsArray.length;n++)this.conceptsArray[n].id==e.id&&(t=!0);return t}static AddNpc(e){this.NPC.includes(e)||(this.NPC.length>10&&(this.NPC=[]),this.NPC.push(e))}static GetNpc(e){return!!this.NPC.includes(e)}static AddConceptToStorage(e){e.id>0&&m("concept",e)}static GetConceptBulkData(e,t,n){return D(this,void 0,void 0,function*(){yield b.getConceptListFromIds(e,t,n)})}static AddWidget(e){if(ed)try{yd("ConceptsData__AddWidget",{widgetDetails:e})}catch(e){Td(e)}e.widgetId>0&&R.addWidgetToTree(e)}static AddConcept(e){if(ed)try{yd("ConceptsData__AddConcept",{concept:e})}catch(e){Td(e)}e.id>0&&(b.addConceptToTree(e),E.addConceptToTree(e))}static AddConceptToMemory(e){e.id>0&&(b.addConceptToTree(e),E.addConceptToTree(e))}static AddConceptTemporary(e){var t=this.CheckContains(e);this.conceptDictionary[e.id]=e,t&&this.RemoveConcept(e),this.conceptsArray.push(e)}static RemoveConcept(e){for(var t=0;t<this.conceptsArray.length;t++)this.conceptsArray[t].id==e.id&&this.conceptsArray.splice(t,1);g("concept",e.id)}static GetWidget(e){return D(this,void 0,void 0,function*(){let t=new O;if(ed)try{return(yield yd("ConceptsData__GetWidget",{id:e})).data}catch(e){Td(e)}let n=yield R.getNodeFromTree(e);return null!=n&&(t=n.value),t})}static RemoveWidget(e){return D(this,void 0,void 0,function*(){if(ed)try{return(yield yd("ConceptsData__RemoveWidget",{id:e})).data}catch(e){Td(e)}yield R.removeNodeFromTree(e)})}static GetConcept(e){return D(this,void 0,void 0,function*(){if(ed)try{return(yield yd("ConceptsData__GetConcept",{id:e})).data}catch(e){Td(e)}if(0==e||null==e||null==e)return S();var t=S(),n=yield b.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static GetConceptByCharacter(e){return D(this,void 0,void 0,function*(){var t=S(),n=T.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterUpdated(e){return D(this,void 0,void 0,function*(){var t=S(),n=T.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterAndTypeLocal(e,t){return D(this,void 0,void 0,function*(){S();return yield E.getTypeVariantsWithCharacterValueNew(e,t)})}static GetConceptByCharacterAndCategoryLocal(e,t){return D(this,void 0,void 0,function*(){var n=S(),o=yield T.getCharacterAndCategoryFromTree(e,t);return o&&(n=o.value),n})}static GetConceptsByTypeId(e){let t=[];for(var n=0;n<this.conceptsArray.length;n++)this.conceptsArray[n].typeId==e&&t.push(this.conceptsArray[n]);return t}static GetConceptsByTypeIdAndUser(e,t){var n=arguments;return D(this,void 0,void 0,function*(){if(no.logfunction("ConceptsData.GetConceptsByTypeIdAndUser",n),ed)try{return(yield yd("ConceptsData__GetConceptsByTypeIdAndUser",{typeId:e,userId:t})).data}catch(e){Td(e)}let o=[];return o=yield E.getTypeVariantsFromTreeWithUserIdNew(e,t),o})}static GetBinaryCharacterTree(){return T.characterRoot}getName(){return this.name}}U.conceptsArray=[],U.NPC=[],U.conceptDictionary=[];var F=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const B=500;function M(){return new Promise(e=>setTimeout(e,0))}function G(){return F(this,void 0,void 0,function*(){try{let e=[];if(r.isPwa&&(e=yield v("concept")),Array.isArray(e))for(let t=0;t<e.length;t++)U.AddConceptToMemory(e[t]),t>0&&t%B===0&&(yield M());C.isDataLoaded=!0,C.isCharacterLoaded=!0,C.isTypeLoaded=!0}catch(e){throw yield Zs(2e3,G()),{message:"Cannot create Binary Tree Concept",ok:!1,status:400,data:e}}})}var j=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const W="widgetCache",V="latestWidgetCache",q="recentWidgetCache",$="queryCache";let H=null;function z(){return new Promise((e,t)=>{if(H)return void e(H);const n=r.BASE_URL+"_CacheStore"+r.BASE_APPLICATION,o=indexedDB.open(n,1);o.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains(W)||t.createObjectStore(W,{keyPath:"id"}),t.objectStoreNames.contains(V)||t.createObjectStore(V,{keyPath:"id"}),t.objectStoreNames.contains(q)||t.createObjectStore(q,{keyPath:"id"}),t.objectStoreNames.contains($)||t.createObjectStore($)},o.onsuccess=t=>{H=t.target.result,e(H)},o.onerror=e=>{t(e)}})}function J(e,t,n){return j(this,void 0,void 0,function*(){const o=yield z();return new Promise((i,r)=>{const s=o.transaction(e,"readwrite").objectStore(e),a=void 0!==n?s.put(t,n):s.put(t);a.onsuccess=()=>i(),a.onerror=e=>{r(e)}})})}function Q(e,t){return j(this,void 0,void 0,function*(){const n=yield z();return new Promise((o,i)=>{const r=n.transaction(e,"readwrite").objectStore(e).delete(t);r.onsuccess=()=>o(),r.onerror=e=>{i(e)}})})}function Y(e){return j(this,void 0,void 0,function*(){const t=yield z();return new Promise((n,o)=>{const i=t.transaction(e,"readwrite").objectStore(e).clear();i.onsuccess=()=>n(),i.onerror=e=>{o(e)}})})}function K(e){return j(this,void 0,void 0,function*(){const t=yield z();return new Promise((n,o)=>{const i=t.transaction(e,"readonly").objectStore(e).getAll();i.onsuccess=()=>{var e;n(null!==(e=i.result)&&void 0!==e?e:[])},i.onerror=e=>{o(e)}})})}class Z{static getValue(e,t=null){if(e in this.environments){return this.environments[e]}return t}static setValue(e,t){return this.environments[e]=t,this}}Z.environments={};var X=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})},ee=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};class te{static init(){return X(this,void 0,void 0,function*(){if(Z.getValue("enableCache",!0))try{const[e,t,n]=yield Promise.all([K(W),K(V),K(q)]);for(const t of e)if(t&&null!=t.id){const{id:e}=t,n=ee(t,["id"]);this.widgetMap.set(e,n)}for(const e of t)if(e&&null!=e.id){const{id:t}=e,n=ee(e,["id"]);this.latestMap.set(t,n)}for(const e of n)if(e&&null!=e.id){const{id:t}=e,n=ee(e,["id"]);this.recentMap.set(t,n)}}catch(e){}})}static getWidget(e){var t;return Z.getValue("enableCache",!0)&&null!==(t=this.widgetMap.get(e))&&void 0!==t?t:null}static setWidget(e,t){Z.getValue("enableCache",!0)&&(this._isDuplicate(this.widgetMap,e,t)||(this.widgetMap.set(e,t),J(W,Object.assign({id:e},t)).catch(()=>{})))}static removeWidget(e){this.widgetMap.delete(e),Q(W,e).catch(()=>{})}static getLatest(e){var t;return Z.getValue("enableCache",!0)&&null!==(t=this.latestMap.get(e))&&void 0!==t?t:null}static setLatest(e,t){Z.getValue("enableCache",!0)&&(this._isDuplicate(this.latestMap,e,t)||(this.latestMap.set(e,t),J(V,Object.assign({id:e},t)).catch(()=>{})))}static removeLatest(e){this.latestMap.delete(e),Q(V,e).catch(()=>{})}static getRecent(e){var t;return Z.getValue("enableCache",!0)&&null!==(t=this.recentMap.get(e))&&void 0!==t?t:null}static setRecent(e,t){Z.getValue("enableCache",!0)&&(this._isDuplicate(this.recentMap,e,t)||(this.recentMap.set(e,t),J(q,Object.assign({id:e},t)).catch(()=>{})))}static removeRecent(e){this.recentMap.delete(e),Q(q,e).catch(()=>{})}static clearAll(){this.widgetMap.clear(),this.latestMap.clear(),this.recentMap.clear(),Promise.all([Y(W),Y(V),Y(q)]).catch(()=>{})}static _isDuplicate(e,t,n){const o=e.get(t);return!!o&&JSON.stringify(o)===JSON.stringify(n)}}te.widgetMap=new Map,te.latestMap=new Map,te.recentMap=new Map;var ne=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class oe{static init(){return ne(this,void 0,void 0,function*(){if(Z.getValue("enableCache",!0))try{const e=yield function(e){return ne(this,void 0,void 0,function*(){const t=yield z();return new Promise((n,o)=>{const i=t.transaction(e,"readonly").objectStore(e),r=[],s=i.openCursor();s.onsuccess=()=>{const e=s.result;e?(r.push({key:e.key,value:e.value}),e.continue()):n(r)},s.onerror=e=>{o(e)}})})}($);for(const{key:t,value:n}of e)this.cacheMap.set(t,n)}catch(e){}})}static getHash(e){return ne(this,void 0,void 0,function*(){return yield function(e){return ne(this,void 0,void 0,function*(){const t=JSON.stringify(e,(e,t)=>t&&"object"==typeof t&&!Array.isArray(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t),n=(new TextEncoder).encode(t),o=yield crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,"0")).join("")})}(e)})}static get(e){var t;return Z.getValue("enableCache",!0)&&null!==(t=this.cacheMap.get(e))&&void 0!==t?t:null}static set(e,t){if(!Z.getValue("enableCache",!0))return;const n=this.cacheMap.get(e),o=JSON.stringify(t);n&&JSON.stringify(n)===o||(this.cacheMap.set(e,t),J($,t,e).catch(()=>{}),window.dispatchEvent(new CustomEvent(this.prefix+e,{detail:t})))}static subscribe(e,t){const n=e=>{t(e.detail)};return window.addEventListener(this.prefix+e,n),()=>{window.removeEventListener(this.prefix+e,n)}}static remove(e){this.cacheMap.delete(e),Q($,e).catch(()=>{})}static clearAll(){this.cacheMap.clear(),Y($).catch(()=>{})}}oe.prefix="FREESCHEMA_CACHE_",oe.cacheMap=new Map;var ie=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const re="ccs_profile",se="AES-GCM";function ae(e){return ie(this,void 0,void 0,function*(){const t=(new TextEncoder).encode("mftsccs-browser-v1"),n=yield crypto.subtle.importKey("raw",t.buffer,"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:e.buffer,iterations:1e5,hash:"SHA-256"},n,{name:se,length:256},!1,["encrypt","decrypt"])})}function ce(e){return ie(this,void 0,void 0,function*(){if("undefined"==typeof localStorage||"undefined"==typeof crypto||!crypto.subtle)return;const t=new TextEncoder,n=crypto.getRandomValues(new Uint8Array(16)),o=crypto.getRandomValues(new Uint8Array(12)),i=yield ae(n),r=t.encode(JSON.stringify(e)),s=yield crypto.subtle.encrypt({name:se,iv:o.buffer},i,r.buffer),a=new Uint8Array(n.length+o.length+new Uint8Array(s).length);a.set(n,0),a.set(o,n.length),a.set(new Uint8Array(s),n.length+o.length);try{localStorage.setItem(re,function(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}(a))}catch(e){}})}function le(){return ie(this,void 0,void 0,function*(){if("undefined"==typeof localStorage||"undefined"==typeof crypto||!crypto.subtle)return null;const e=localStorage.getItem(re);if(!e)return null;let t;try{if(t=function(e){const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e),t.length<29)throw new Error("too short")}catch(e){return de(),null}try{const e=t.slice(0,16),n=t.slice(16,28),o=t.slice(28),i=yield ae(e),r=yield crypto.subtle.decrypt({name:se,iv:n.buffer},i,o.buffer);return JSON.parse((new TextDecoder).decode(r))}catch(e){return de(),null}})}function de(){"undefined"!=typeof localStorage&&localStorage.removeItem(re)}var ue=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class he{static setSession(e){e&&(he.sessionId=e)}static saveUserProfile(e){return ue(this,void 0,void 0,function*(){var t,n,o,i,r,s,a,c,l,d,u,h,p,f,y,m,v,g,C,w,I,T,k,b,A,S,N;try{const _=null!==(t=null==e?void 0:e.data)&&void 0!==t?t:e,P=null!==(i=null!==(o=null!==(n=null==_?void 0:_.token)&&void 0!==n?n:null==_?void 0:_.accessToken)&&void 0!==o?o:he.BearerAccessToken)&&void 0!==i?i:"",E=null!==(s=null!==(r=null==_?void 0:_.refreshtoken)&&void 0!==r?r:null==_?void 0:_.refreshToken)&&void 0!==s?s:"",L=null!==(a=he.profileCache)&&void 0!==a?a:{};he.BearerAccessToken=P,he.refreshToken=E||he.refreshToken;const x={token:P,refreshToken:he.refreshToken,email:null!==(l=null!==(c=null==_?void 0:_.email)&&void 0!==c?c:L.email)&&void 0!==l?l:"",userId:null!==(y=null!==(f=null!==(p=null!==(h=null===(u=null===(d=null==_?void 0:_.entity)||void 0===d?void 0:d[0])||void 0===u?void 0:u.userId)&&void 0!==h?h:null==_?void 0:_.userId)&&void 0!==p?p:null==_?void 0:_.theUserId)&&void 0!==f?f:L.userId)&&void 0!==y?y:0,userConcept:null!==(v=null!==(m=null==_?void 0:_.userConcept)&&void 0!==m?m:L.userConcept)&&void 0!==v?v:0,entityId:null!==(I=null!==(w=null!==(C=null===(g=null==_?void 0:_.entityDetails)||void 0===g?void 0:g.id)&&void 0!==C?C:null==_?void 0:_.entityId)&&void 0!==w?w:L.entityId)&&void 0!==I?I:0,roles:null!==(k=null!==(T=null==_?void 0:_.roles)&&void 0!==T?T:L.roles)&&void 0!==k?k:[],amcode:null!==(A=null!==(b=null==_?void 0:_.amcode)&&void 0!==b?b:L.amcode)&&void 0!==A?A:btoa(JSON.stringify(null!==(N=null!==(S=null==_?void 0:_.roles)&&void 0!==S?S:L.roles)&&void 0!==N?N:[]))};return he.profileCache=x,yield ce(x),!0}catch(e){return!1}})}static updateTokens(){return ue(this,arguments,void 0,function*(e="",t=""){e&&(he.BearerAccessToken=e),t&&(he.refreshToken=t),he.profileCache&&(he.profileCache=Object.assign(Object.assign({},he.profileCache),{token:he.BearerAccessToken,refreshToken:he.refreshToken}),yield ce(he.profileCache))})}static hydrateProfile(){return ue(this,void 0,void 0,function*(){var e,t;if(!he.profileCache){const n=yield le();n&&(he.profileCache=n,he.BearerAccessToken||(he.BearerAccessToken=null!==(e=n.token)&&void 0!==e?e:""),he.refreshToken||(he.refreshToken=null!==(t=n.refreshToken)&&void 0!==t?t:""))}})}static logout(){he.BearerAccessToken="",he.refreshToken="",he.profileCache=null,de()}}he.BearerAccessToken="",he.refreshToken="",he.sessionId=998,he.profileCache=null;let pe=null;function fe(){return pe||(pe=new BroadcastChannel("Freeschema_mftsccs_browser_channel")),pe}const ye={addEventListener(e,t){fe().addEventListener(e,t)},removeEventListener(e,t){fe().removeEventListener(e,t)},postMessage(e){fe().postMessage(e)},close(){pe&&(pe.close(),pe=null)}};var me=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const ve=60,ge=new Set([401]),Ce=new Set([400,401,406]);let we=null;function Ie(){return me(this,arguments,void 0,function*(e="application/json",t="application/json"){return Se(e,t,yield Ae())})}function Te(){return me(this,arguments,void 0,function*(e="application/json",t="",n="application/json"){return Se(e,n,yield Ae(t))})}function ke(){return me(this,void 0,void 0,function*(){var e,t;const n=yield Ae(),o=null!==(t=null===(e=he.sessionId)||void 0===e?void 0:e.toString())&&void 0!==t?t:"",i=new Headers;return n&&i.append("Authorization","Bearer "+n),i.append("X-Session-Id",o),i})}function be(e){return me(this,arguments,void 0,function*(e,t={}){const n=yield fetch(e,t);if(!ge.has(n.status)||!he.refreshToken)return n;try{const n=yield Ne(he.BearerAccessToken),o=new Headers(t.headers);return n&&o.set("Authorization","Bearer "+n),yield fetch(e,Object.assign(Object.assign({},t),{headers:o}))}catch(e){return n}})}function Ae(){return me(this,arguments,void 0,function*(e=""){yield he.hydrateProfile();const t=e||he.BearerAccessToken;return!t&&he.refreshToken||t&&function(e){const t=function(e){try{const t=e.split(".")[1];if(!t)return null;const n=JSON.parse(function(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(t.length+(4-t.length%4)%4,"=");return atob(n)}(t));return"number"!=typeof n.exp?null:1e3*n.exp}catch(e){return null}}(e);if(!t)return!1;const n=t-1e3*ve;return Date.now()>=n}(t)&&he.refreshToken?Ne(t):t})}function Se(e,t,n=""){var o,i;const r={Accept:t,"X-Session-id":null!==(i=null===(o=he.sessionId)||void 0===o?void 0:o.toString())&&void 0!==i?i:""};return e&&(r["Content-Type"]=e),n&&(r.Authorization="Bearer "+n),r}function Ne(){return me(this,arguments,void 0,function*(e=""){return we||(we=function(){return me(this,arguments,void 0,function*(e=""){var t,n,o,i,s;const a=he.refreshToken;if(!a)return he.BearerAccessToken;const c=yield fetch(r.RefreshTokenUrl(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({accessToken:e||he.BearerAccessToken,refreshToken:a})}),l=yield c.json().catch(()=>({}));if(!c.ok){Ce.has(c.status)&&_e();const e=new Error(`Refresh token request failed with status ${c.status}`);throw e.status=c.status,e}const d=null!==(t=null==l?void 0:l.data)&&void 0!==t?t:l,u=null!==(o=null!==(n=null==d?void 0:d.accessToken)&&void 0!==n?n:null==d?void 0:d.token)&&void 0!==o?o:"",h=null!==(s=null!==(i=null==d?void 0:d.refreshToken)&&void 0!==i?i:null==d?void 0:d.refreshtoken)&&void 0!==s?s:a;if(!u){_e();const e=new Error("Refresh token response did not include an access token");throw e.status=401,e}return yield he.updateTokens(u,h),u})}(e).finally(()=>{we=null})),we})}function _e(){he.logout();try{ye.postMessage({type:"AUTH_LOGOUT",payload:{reason:"refresh-failed"}})}catch(e){}}var Pe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ee(e){var t=arguments;return Pe(this,arguments,void 0,function*(e,n=""){const o=no.logfunction("SearchLinkMultipleApi",t);let i=performance.now();var s=yield Te("application/json",n);const c=r.SearchLinkMultipleAllApiUrl(),u=JSON.stringify(e);try{const t=yield be(c,{method:"POST",headers:s,body:u});if(t.ok){let e=yield t.json();return no.logUpdate(o),e}return a(t),no.logError(i,"unknown","search","unknown",void 0,t.status,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),[]}catch(t){no.logError(i,"unknown","search","unknown",void 0,500,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),l(t,c),d(o,0,t)}})}function Le(e){const t=e.lastIndexOf("_");let n=[];if(t>0){n=[e.substring(0,t),e.substring(t+1,e.length)]}else n=[e];return n}var xe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Re(e,t){var n=arguments;return xe(this,void 0,void 0,function*(){const o=no.logfunction("GetAllConceptsByType",n);try{var i=new URLSearchParams;i.append("type",e),i.append("user_id",t.toString());var s=yield Ie("application/x-www-form-urlencoded");const n=yield be(r.GetAllConceptsByTypeUrl(),{method:"POST",headers:s,body:i});if(n.ok){const e=yield n.json();for(var c=0;c<e.length;c++)U.AddConcept(e[c])}else a(n)}catch(e){Error,l(e,r.GetAllConceptsByTypeUrl()),d(o,0,e)}})}var Oe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class De{static incrementConcept(e){try{e&&(this.conceptsData[e]=(this.conceptsData[e]||0)+1)}catch(e){}}static incrementConnection(e){try{e&&(this.connectionsData[e]=(this.connectionsData[e]||0)+1)}catch(e){}}static getTopConcepts(e){return Object.entries(this.conceptsData).map(([e,t])=>[parseInt(e),t]).sort((e,t)=>t[1]-e[1]).slice(0,e)}static getTopConnections(e){return Object.entries(this.connectionsData).map(([e,t])=>[parseInt(e),t]).sort((e,t)=>t[1]-e[1]).slice(0,e)}static saveDataToLocalStorage(){const e={concepts:this.conceptsData,connections:this.connectionsData};null===localStorage||void 0===localStorage||localStorage.setItem(this.accessData,JSON.stringify(e))}static loadDataFromLocalStorage(){const e=null===localStorage||void 0===localStorage?void 0:localStorage.getItem(this.accessData);if(e){const t=JSON.parse(e);this.conceptsData=t.concepts||{},this.connectionsData=t.connections||{}}}static sendToServer(){return Oe(this,void 0,void 0,function*(){try{yield this.syncToServer()}catch(e){}})}static syncToServer(){return Oe(this,void 0,void 0,function*(){try{if(!Object.keys(this.conceptsData).length&&!Object.keys(this.connectionsData).length)return;const e=yield Ie();if(!e.Authorization)return;const t=this.conceptsData&&Object.keys(this.conceptsData).length>0?this.conceptsData:{},n=this.connectionsData&&Object.keys(this.connectionsData).length>0?this.connectionsData:{},o=yield be(r.PostPrefetchConceptConnections(),{method:"POST",headers:e,body:JSON.stringify({concepts:t,connections:n})});if(!o.ok)throw new Error("Failed to sync data to the server.");yield o.json(),this.conceptsData={},this.connectionsData={},this.setNextSyncTime()}catch(e){}})}static setNextSyncTime(){this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS}static startAutoSync(){this.autoSyncInterval||(this.setNextSyncTime(),this.autoSyncInterval=setInterval(()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&this.syncNow().catch(console.error)},6e4))}static stopAutoSync(){null!==this.autoSyncInterval&&(clearInterval(this.autoSyncInterval),this.autoSyncInterval=null)}static syncNow(){return Oe(this,void 0,void 0,function*(){try{this.activateStatus&&(yield this.syncToServer())}catch(e){}})}static GetSuggestedConcepts(e){return Oe(this,void 0,void 0,function*(){try{const t=yield Ie(),n=new URL(r.GetSuggestedConcepts());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield be(n.toString(),{method:"GET",headers:t});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load concepts: ${o.status} ${o.statusText}. Details: ${e}`)}const i=(yield o.json())||[];return yield this.addConceptToBinaryTree(i.data),i}catch(e){throw e instanceof Error?new Error("Unable to fetch suggested concepts. Please try again later."):new Error("An unexpected error occurred while fetching suggested concepts.")}})}static GetSuggestedConnections(e){return Oe(this,void 0,void 0,function*(){try{const t=yield Ie(),n=new URL(r.GetSuggestedConnections());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield be(n.toString(),{method:"GET",headers:t});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load connections: ${o.status} ${o.statusText}. Details: ${e}`)}const i=(yield o.json())||[];return yield this.addConnectionToBinaryTree(i.data),i}catch(e){throw e instanceof Error?new Error("Unable to fetch suggested connections. Please try again later."):new Error("An unexpected error occurred while fetching suggested Connections.")}})}static addConceptToBinaryTree(e){return Oe(this,void 0,void 0,function*(){try{e.forEach(e=>{U.AddConcept(e)})}catch(e){}})}static addConnectionToBinaryTree(e){return Oe(this,void 0,void 0,function*(){try{e.forEach(e=>{Je.AddConnection(e)})}catch(e){}})}}De.conceptsData={},De.connectionsData={},De.SYNC_INTERVAL_MS=12e4,De.nextSyncTime=Date.now(),De.activateStatus=!1,De.accessData="Access Data",De.autoSyncInterval=null;class Ue{constructor(e=0,t,n,o,i,s,a){this.count=0,this.isTemp=!1,this.toUpdate=!1,this.applicationId=r.getRandomizer(),this.type=S(),this.ofConcept=S(),this.toConcept=S(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.userId=o,this.typeId=i,this.ghostId=e,this.orderId=s,this.accessId=a,this.entryTimeStamp=N(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date,this.typeCharacter=""}}class Fe{constructor(e,t,n,o){this.leftNode=null,this.rightNode=null,this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return t=e;let n=!1;e.value.id==t.value.id&&(n=!0);for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}getMax(e,t){return e>t?e:t}addNode(e,t,n){if(null==t)return wd(e.value.ofTheConceptId),e;let o=t.leftNode,i=t.rightNode;if(e.key<t.key)t.leftNode=this.addNode(e,o,n);else{if(!(e.key>t.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(this.getBalanceFactor(t.leftNode)>=0)return this.rightRotate(t);if(this.getBalanceFactor(t.leftNode)<0)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(this.getBalanceFactor(t.rightNode)<=0)return this.leftRotate(t);if(this.getBalanceFactor(t.rightNode)>0)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}addTypeNode(e,t,n){let o=!1;if(0!=e.value.typeId){if(null==t)return t=e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,o,n);else{if(!(t.key<e.key))return t.key==e.key&&0!=t.key&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addTypeNode(e,i,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}}else o;return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=this.getMax(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}throw new Error("Cannot perform right rotation: left node is null.")}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=this.getMax(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=this.getMax(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}throw new Error("Cannot perform left rotation: right node is null.")}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){try{if(t)return e==t.key?(t.value.count?t.value.count++:t.value.count=1,t):e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t}catch(e){}return t}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}checkIfIdsInNode(e,t,n,o){if(e){if(t.includes(e.key)){n.push(e.value);let o=t.indexOf(e.key);t.splice(o,1)}e.leftNode&&this.checkIfIdsInNode(e.leftNode,t,n,o),e.rightNode&&this.checkIfIdsInNode(e.rightNode,t,n,o)}}traverse(e){let t=0;return e&&(t+=1,(null==e?void 0:e.leftNode)&&(t+=this.traverse(e.leftNode)),e.rightNode&&(t+=this.traverse(e.rightNode))),t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;new Event(`${e.value.ofTheConceptId}`);if(wd(e.value.ofTheConceptId),null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){let t=e.variants[0];if(t)return e.value=t.value,e.key=t.key,e.currentNode=t.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,t.key,n),e}}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var Be=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Me{static addNodeToTree(e){try{this.connectionMap.set(e.key,e.value),null===this.connectionroot&&(this.connectionroot=e)}catch(e){throw e}}static addConnectionToTree(e){this.connectionMap.has(e.id)||wd(e.ofTheConceptId),this.connectionMap.set(e.id,e),null===this.connectionroot&&(this.connectionroot=new Fe(e.id,e,null,null))}static traverse(){return this.connectionMap.size}static waitForDataToLoad(){return Be(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isConnectionLoaded)return e("done");setTimeout(Me.checkFlag,1e3,e)}static removeNodeFromTree(e){return Be(this,void 0,void 0,function*(){const t=this.connectionMap.get(e);t&&(wd(t.ofTheConceptId),this.connectionMap.delete(e),0===this.connectionMap.size&&(this.connectionroot=null))})}static getNodeFromTree(e){return Be(this,void 0,void 0,function*(){try{const t=this.connectionMap.get(e);return t?(t.count?t.count++:t.count=1,{key:e,value:t}):null}catch(e){return}})}static getConnectionListFromIds(e,t,n){return Be(this,void 0,void 0,function*(){for(let n=e.length-1;n>=0;n--){const o=this.connectionMap.get(e[n]);o&&(t.push(o),e.splice(n,1))}})}}Me.connectionroot=null,Me.connectionMap=new Map;class Ge{constructor(e,t,n,o){this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}{let t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.variants=t.variants,e.currentNode=t.currentNode,e.rightNode=this.removeNode(e.rightNode,t.key),e}}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}class je extends Ge{constructor(e,t,n,o){super(e,t,n,o),this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(this.getBalanceFactor(t.leftNode)>=0){return this.rightRotate(t)}if(this.getBalanceFactor(t.leftNode)<0){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(this.getBalanceFactor(t.rightNode)<=0){return this.leftRotate(t)}if(this.getBalanceFactor(t.rightNode)>0){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}return t}}var We=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Ve{static CreateCompositionKey(e,t){return e}static GetConnectionByOfTheConceptAndTypeId(e,t){let n=this.CreateCompositionKey(e,t);if(this.node){let e=this.node.getFromNode(n,this.node);if(e)return e.value}return null}static addConnection(e){if(e.id>0){let t=this.CreateCompositionKey(e.ofTheConceptId,e.typeId);if(this.node){let n=this.node.getFromNode(t,this.node);if(n){let t=null==n?void 0:n.value;0==t.length&&(n.value=[]),t.includes(e.id)||t.push(e.id)}else{let n=[];n.push(e.id);let o=new je(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new je(t,n,null,null);this.addNodeToTree(o)}new Event(`${t}`)}}static addNodeToTree(e){return We(this,void 0,void 0,function*(){return null==this.node?(this.node=e,wd(e.key),this.node):(this.node=this.node.addNode(e,this.node,this.node.height),this.node)})}static removeNodeFromTree(e){return We(this,void 0,void 0,function*(){this.node&&(this.node=this.node.removeNode(this.node,e))})}}Ve.node=null;class qe extends Ge{constructor(e,t,n,o){super(e,t,n,o),this.key="",this.value=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return t=e;let o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key){return this.rightRotate(t)}if(e.key>t.leftNode.key){return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key){return this.leftRotate(t)}if(e.key<t.rightNode.key){return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}return t}}var $e=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class He{static CreateCompositionKey(e){return e}static addNodeToTree(e){return $e(this,void 0,void 0,function*(){return null==this.connectionTypeRoot?(this.connectionTypeRoot=e,this.connectionTypeRoot):(this.connectionTypeRoot=this.connectionTypeRoot.addNode(e,this.connectionTypeRoot,this.connectionTypeRoot.height),this.connectionTypeRoot)})}static addConnectionToTree(e){if(e.id>0){let t=this.CreateCompositionKey(e.typeId);if(this.connectionTypeRoot){let n=this.connectionTypeRoot.getFromNode(t,this.connectionTypeRoot);if(n){let t=null==n?void 0:n.value;0==t.length&&(n.value=[]),t.includes(e.id)||t.push(e.id)}else{let n=[];n.push(e.id);let o=new qe(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new qe(t,n,null,null);this.addNodeToTree(o)}}}static GetConnectionByOfTheConceptAndTypeId(e,t){let n=this.CreateCompositionKey(t);if(this.connectionTypeRoot){let e=this.connectionTypeRoot.getFromNode(n,this.connectionTypeRoot);if(e)return e.value}return null}}He.connectionTypeRoot=null;var ze=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Je{constructor(){this.name="Connection Array"}static CheckContains(e){let t=!1;for(let n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e.id&&(t=!0);return t}static AddConnectionToStorage(e){m("connection",e)}static AddNpConn(e){this.deletedConnections.includes(e)||this.deletedConnections.push(e)}static GetNpConn(e){return!!this.deletedConnections.includes(e)}static AddConnection(e){try{Me.addConnectionToTree(e),He.addConnectionToTree(e),Ve.addConnection(e)}catch(e){throw e}}static AddConnectionToMemory(e){e.isTemp||(Me.addConnectionToTree(e),He.addConnectionToTree(e),Ve.addConnection(e))}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){0!=e.id&&(g("connection",e.id),Me.removeNodeFromTree(e.id),Ve.removeNodeFromTree(e.id))}static GetConnectionTypeOfTree(){Ve.node}static GetConnectionByOfTheConceptAndType(e,t){return ze(this,void 0,void 0,function*(){try{if(ed)try{return(yield yd("ConnectionData__GetConnectionByOfTheConceptAndType",{ofTheConceptId:e,typeId:t})).data}catch(e){Td(e)}let n=Ve.GetConnectionByOfTheConceptAndTypeId(e,t);return n||[]}catch(e){return[]}})}static GetConnectionByOfType(e,t){const n=no.logfunction("ConnectionData.GetConnectionByOfType",arguments);let o=He.GetConnectionByOfTheConceptAndTypeId(e,t);return o?(no.logUpdate(n),o):(no.logUpdate(n),[])}static GetConnectionTree(){return Me.connectionroot}static GetConnectionTypeTree(){return He.connectionTypeRoot}static GetConnectionBulkData(e,t,n){return ze(this,void 0,void 0,function*(){yield Me.getConnectionListFromIds(e,t,n)})}static GetConnection(e){return ze(this,void 0,void 0,function*(){De.incrementConnection(e);let t=new Ue(0,0,0,0,0,0,0);try{if(ed)try{return(yield yd("ConnectionData__GetConnection",{id:e})).data}catch(e){Td(e)}let n=yield Me.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}return t}catch(e){return t}})}static GetConnectionsOfCompositionLocal(e){var t=arguments;return ze(this,void 0,void 0,function*(){const n=no.logfunction("ConnectionData.GetConnectionsOfCompositionLocal",t)||{};let o=[];try{if(ed){n.serviceWorker=!0;try{const t=yield yd("ConnectionData__GetConnectionsOfCompositionLocal",{id:e});return no.logUpdate(n),t.data}catch(e){d(n,0,e),Td(e)}}let t=[];t=Je.GetConnectionByOfType(e,e);for(let e=0;e<t.length;e++){let i=yield Me.getNodeFromTree(t[e]);i&&o.push(i.value),no.logUpdate(n)}}catch(e){d(n,0,e)}return o})}static GetConnectionsOfConcept(e){return ze(this,void 0,void 0,function*(){let t=[],n=[];try{if(ed)try{return(yield yd("ConnectionData__GetConnectionsOfConcept",{id:e})).data}catch(e){Td(e)}t=yield Je.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<t.length;e++){let o=yield Me.getNodeFromTree(t[e]);o&&n.push(o.value)}return n}catch(e){return n}})}getName(){return this.name}}Je.deletedConnections=[],Je.connectionArray=[],Je.connectionDictionary=[];var Qe=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ye(){const e=r.NODE_CACHE_URL;let t=r.BASE_APPLICATION+"_cacheServers";if(e===r.BASE_URL)throw new Error("Base Server Down");let n=function(e){try{const t=sessionStorage.getItem(e),n=JSON.parse(null!=t?t:"[]");return Array.isArray(n)?n:[]}catch(e){return[]}}(t);const o=n.indexOf(e);if(r.isNearestCache=!1,n.includes(e)&&-1!==o&&n.splice(o,1),sessionStorage.setItem(t,JSON.stringify(n)),n.length){const e=n[0];r.NODE_CACHE_URL=e}else r.NODE_CACHE_URL=r.BASE_URL;"undefined"!=typeof navigator&&navigator.serviceWorker&&navigator.serviceWorker.controller&&yd("SESSION_DATA",{type:"SESSION_DATA",data:r.NODE_CACHE_URL,session:he.sessionId})}function Ke(e,t){return Qe(this,void 0,void 0,function*(){if("undefined"!=typeof self&&"undefined"!=typeof ServiceWorkerGlobalScope&&self instanceof ServiceWorkerGlobalScope)throw new Error("Cannot switch server from service worker");try{Ye();try{return yield fetch(`${r.NODE_CACHE_URL}${t}`,e)}catch(n){return yield Ke(e,t)}}catch(e){throw e}})}var Ze=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Xe(e){return Ze(this,void 0,void 0,function*(){const t=no.logfunction("GetConceptBulk",[e.length])||{};let n=[],o=((new Date).getTime(),performance.now()),i=Array.from(new Set(e));try{if(ed){t.serviceWorker=!0;try{const n=yield yd("GetConceptBulk",{passedConcepts:e});if(n.data&&n.data.length>0)for(const e of n.data)U.AddConceptToMemory(e);return no.logUpdate(t),n.data}catch(e){d(t,0,e),Td(e)}}if(i.length>0){let s=[];for(let e=0;e<i.length;e++)if(!U.GetNpc(i[e])){Number(i[e]);let t=yield U.GetConcept(i[e]);0==t.id?s.push(i[e]):n.push(t)}if(0==s.length)return no.logfunction(t),n;{let i;const c={method:"POST",headers:yield Ie(),body:JSON.stringify(s)};try{i=yield be(r.GetConceptBulkUrl(),c)}catch(e){i=yield Ke(c,"/api/get_concept_bulk")}yield function(e,t,n,o,i){return Ze(this,void 0,void 0,function*(){if(e.ok){let t=yield e.json();if(t.length>0)for(let e=0;e<t.length;e++){let o=t[e];U.AddConcept(o),n.push(o)}no.logUpdate(o)}else no.logError(i,"unknown","read","unknown",void 0,e.status,e,"GetConceptBulk",[t],"unknown",void 0),a(e)})}(i,e,n,t,o)}}}catch(n){Error,no.logError(o,"unknown","read","unknown",void 0,500,n,"GetConceptBulk",[e],"unknown",void 0),l(n,r.GetConceptBulkUrl()),d(t,0,n)}return n})}var et=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function tt(){return et(this,arguments,void 0,function*(e=[]){const t=no.logfunction("FindConceptsFromConnections",[e.length]);let n=[];if(e.length>0){for(let t=0;t<e.length;t++)n.includes(e[t].ofTheConceptId)||n.push(Number(e[t].ofTheConceptId)),n.includes(e[t].toTheConceptId)||n.push(Number(e[t].toTheConceptId)),n.includes(e[t].typeId)||n.push(Number(e[t].typeId));yield Xe(n)}no.logUpdate(t)})}var nt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ot(){return nt(this,arguments,void 0,function*(e=[]){const t=no.logfunction("FindConnectionsOfCompositionsBulkInMemory",[e.length])||{};let n=[];try{if(ed){t.serviceWorker=!0;try{const n=yield yd("FindConnectionsOfCompositionsBulkInMemory",{composition_ids:e});return no.logUpdate(t),n.data}catch(e){d(t,0,e),Td(e)}}for(let t=0;t<e.length;t++){let o=yield Je.GetConnectionsOfConcept(e[t]);n.push(...o)}return no.logUpdate(t),n}catch(e){return d(t,0,e),n}})}var it=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function rt(){var e=arguments;return it(this,arguments,void 0,function*(t=[]){const n=no.logfunction("GetAllConnectionsOfCompositionBulk",e)||{};if(ed){n.serviceWorker=!0;try{const e=yield yd("GetAllConnectionsOfCompositionBulk",{composition_ids:t});return no.logUpdate(n),e.data}catch(e){d(n,0,e),Td(e)}}var o=[];if(t.length<=0)return o;yield ot(t);var i=yield function(){var e=arguments;return it(this,arguments,void 0,function*(t=[]){const n=no.logfunction("GetAllConnectionsOfCompositionOnline",e);var o=[];try{var i=yield Ie();const e=yield be(r.GetAllConnectionsOfCompositionBulkUrl(),{method:"POST",headers:i,body:JSON.stringify(t)});if(e.ok){const t=yield e.json();for(var s=0;s<t.length;s++)Je.AddConnection(t[s]),o.push(t[s])}else a(e);return no.logUpdate(n),o}catch(e){Error,l(e,r.GetAllConnectionsOfCompositionBulkUrl()),d(n,0,e)}})}(t);return o=i,yield tt(o),no.logUpdate(n),o})}class st{constructor(e,t,n,o){this.variants=[],this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o,this.currentNode=null}addCurrentNode(e,t){return null==t?t=e:(e.value.typeId!=t.value.typeId&&(t.currentNode=this.addCurrentNode(e,t.currentNode)),t)}addCurrentNodeType(e,t){if(null==t)return t=e;var n=!1;for(let o=0;o<t.variants.length;o++)t.variants[o].value.id==e.value.id&&(n=!0);return n||t.variants.push(e),t}addNode(e,t,n){if(null==t)return t=e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}addCharacterNode(e,t,n){var o=!1;if(""!=e.value.characterValue){if(null==t)return t=e;var i=t.leftNode,r=t.rightNode;if(t.key>e.key)t.leftNode=this.addCharacterNode(e,i,n);else{if(!(t.key<e.key))return t.key==e.key&&""!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addCharacterNode(e,r,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let o=this.getBalanceFactor(t);if(o>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(o<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}else o;return t}addTypeNode(e,t,n){var o=!1;if(0!=e.value.typeId){if(null==t)return t=e;var i=t.leftNode,r=t.rightNode;if(t.key>e.key)t.leftNode=this.addTypeNode(e,i,n);else{if(!(t.key<e.key))return t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),t;t.rightNode=this.addTypeNode(e,r,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let o=this.getBalanceFactor(t);if(o>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(o<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}}else o;return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}updateNodeSyncStatus(e,t,n){if(n){if(e==n.key){let e=n.value;return e.isSynced=t,n.value=e,n}return e<n.key?this.updateNodeSyncStatus(e,t,n.leftNode):e>n.key?this.updateNodeSyncStatus(e,t,n.rightNode):n}return n}getCharacterFromNode(e,t){return t?e==t.key?t:e<t.key?this.getCharacterFromNode(e,t.leftNode):e>t.key?this.getCharacterFromNode(e,t.rightNode):t:t}getFromNodeWithCharacterAndType(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.typeId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.typeId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndType(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndType(e,t,n.rightNode)}return null}return n}getFromNodeWithCharacterAndCategory(e,t,n){if(e=`${e}`,n){if(e==n.key){if(e==n.value.characterValue&&t==n.value.categoryId)return n;for(let e=0;e<n.variants.length;e++)if(n.variants[e].value.categoryId==t)return n.variants[e]}else{if(e<n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.leftNode);if(e>n.key)return this.getFromNodeWithCharacterAndCategory(e,t,n.rightNode)}return null}return n}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var n=this.inOrderSuccessor(e.rightNode);return e.value=n.value,e.key=n.key,e.variants=n.variants,e.currentNode=n.currentNode,e.rightNode=this.removeNode(e.rightNode,n.key),e}removeNodeWithVariants(e,t,n){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNodeWithVariants(e.leftNode,t,n),e;if(e.key<t)return e.rightNode=this.removeNodeWithVariants(e.rightNode,t,n),e;if(e.variants.length>0)if(e.value.id==n){var o=e.variants[0];if(o)return e.value=o.value,e.key=o.key,e.currentNode=o.currentNode,e.variants.splice(0,1),e}else for(let t=0;t<e.variants.length;t++)if(n==e.variants[t].value.id)return e.variants.splice(t,1),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var i=this.inOrderSuccessor(e.rightNode);return e.value=i.value,e.key=i.key,e.variants=i.variants,e.currentNode=i.currentNode,e.rightNode=this.removeNodeWithVariants(e.rightNode,i.key,n),e}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var at=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class ct{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addConceptToTree(e){var t=new st(e.id,e,null,null);new st(e.characterValue,e,null,null);this.addNodeToTree(t)}static waitForDataToLoad(){return at(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isLocalDataLoaded)return e("done");setTimeout(ct.checkFlag,1e3,e)}static getNodeFromTree(e){return at(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static getCharacterAndTypeFromTree(e,t){return this.root?this.root.getFromNodeWithCharacterAndType(e,t,this.root):this.root}static updateSyncStatus(e){return this.root?this.root.updateNodeSyncStatus(e,!0,this.root):this.root}static removeNodeFromTree(e){return at(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}}ct.root=null;var lt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class dt{static waitForDataToLoad(){return lt(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isLocalCharacterLoaded)return e("done");setTimeout(dt.checkFlag,1e3,e)}static addNodeToTree(e){return lt(this,void 0,void 0,function*(){return null==this.LocalCharacterRoot?(this.LocalCharacterRoot=e,this.LocalCharacterRoot):(this.LocalCharacterRoot=this.LocalCharacterRoot.addCharacterNode(e,this.LocalCharacterRoot,this.LocalCharacterRoot.height),this.LocalCharacterRoot)})}static addConceptToTree(e){if(""!=e.characterValue){var t=new st(e.characterValue,e,null,null);this.addNodeToTree(t)}}static getNodeFromTree(e){return this.LocalCharacterRoot?this.LocalCharacterRoot.getCharacterFromNode(e,this.LocalCharacterRoot):this.LocalCharacterRoot}static getCharacterAndTypeFromTree(e,t){return lt(this,void 0,void 0,function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndType(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot})}static getCharacterAndCategoryFromTree(e,t){return lt(this,void 0,void 0,function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndCategory(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot})}static removeConceptType(e,t){this.LocalCharacterRoot&&(this.LocalCharacterRoot=this.LocalCharacterRoot.removeNodeWithVariants(this.LocalCharacterRoot,e,t))}}dt.LocalCharacterRoot=null;var ut=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class ht{static addNodeToTree(e){return ut(this,void 0,void 0,function*(){return null==this.LocalTypeRoot?(this.LocalTypeRoot=e,this.LocalTypeRoot):(this.LocalTypeRoot=this.LocalTypeRoot.addTypeNode(e,this.LocalTypeRoot,this.LocalTypeRoot.height),this.LocalTypeRoot)})}static addConceptToTree(e){if(0!=e.typeId){var t=new st(e.typeId,e,null,null);this.addNodeToTree(t)}}static removeConceptType(e,t){this.LocalTypeRoot&&(this.LocalTypeRoot=this.LocalTypeRoot.removeNodeWithVariants(this.LocalTypeRoot,e,t))}static getNodeFromTree(e){return this.LocalTypeRoot?this.LocalTypeRoot.getFromNode(e,this.LocalTypeRoot):this.LocalTypeRoot}static getTypeVariantsFromTree(e){var t=this.getNodeFromTree(e),n=[];if(t){n.push(null==t?void 0:t.value);for(let e=0;e<t.variants.length;e++)n.push(t.variants[e].value);return n}}static waitForDataToLoad(){return ut(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isLocalTypeLoaded)return e("done");setTimeout(ht.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserId(e,t){return ut(this,void 0,void 0,function*(){var n=[],o=this.getNodeFromTree(e);if(o){o.value.userId!=t&&999!=o.value.userId||n.push(null==o?void 0:o.value);for(let e=0;e<o.variants.length;e++)o.variants[e].value.userId!=t&&999!=o.value.userId||n.push(o.variants[e].value)}return n})}}function pt(){let e=new Date,t=new Date;return new A(0,0,0,0,0,"0",0,!1,e,t,"0")}ht.LocalTypeRoot=null;var ft=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class yt{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addConceptToTree(e){var t=new st(e.ghostId,e,null,null);this.addNodeToTree(t)}static waitForDataToLoad(){return ft(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isLocalDataLoaded)return e("done");setTimeout(yt.checkFlag,1e3,e)}static getNodeFromTree(e){return ft(this,void 0,void 0,function*(){return this.root?this.root.getFromNode(e,this.root):null})}static removeNodeFromTree(e){return ft(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}}yt.root=null;var mt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const vt=(e,t,...n)=>mt(void 0,[e,t,...n],void 0,function*(e,t,n=!0){let o={concepts:[],connections:[]};try{let i={concepts:e,connections:t};const s=yield Te("application/json",he.BearerAccessToken);s.Randomizer=r.getRandomizer().toString();const c=yield be(r.CreateGhostConceptApiUrl(n),{method:"POST",headers:s,body:JSON.stringify(i)});if(!c.ok)throw a(c),new Error(`Error! status: ${c.status}`);const l=yield c.json();return o.concepts=l.concepts,o.connections=l.connections,o}catch(e){throw Error,e}});function gt(e,t){const n=[];for(let o=0;o<e.length;o+=t){const i=e.slice(o,o+t);n.push(i)}return n}const Ct=(...e)=>mt(void 0,[...e],void 0,function*(e=[]){return yield Promise.all(e.map(e=>{let t=JSON.parse(JSON.stringify(e));return delete t.type,delete t.ofConcept,delete t.toConcept,t}))});var wt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};let It=10;class Tt{}function kt(e){const t=no.logfunction("openDatabase",arguments);return new Promise(function(n,o){Tt.db&&(no.logUpdate(t),n(Tt.db));let i=r.BASE_URL+"_FreeSchemaLocal"+r.BASE_APPLICATION;const s=indexedDB.open(i,It);s.onupgradeneeded=e=>{var t=e.target.result,o="localconcept",i="localconnection",s="localid";if(t.objectStoreNames.contains(o)&&t.deleteObjectStore(o),t.objectStoreNames.contains(i)&&t.deleteObjectStore(i),t.objectStoreNames.contains(s)&&t.deleteObjectStore(s),!t.objectStoreNames.contains(o)){t.createObjectStore(o,{keyPath:"id"}).transaction.oncomplete=e=>{}}if(!t.objectStoreNames.contains(i)){t.createObjectStore(i,{keyPath:"id"}).transaction.oncomplete=e=>{}}if(!t.objectStoreNames.contains(s)){t.createObjectStore(s,{keyPath:"id"}).transaction.oncomplete=e=>{At(s,{id:0,value:-100}),At(s,{id:1,value:-200}),At(s,{id:3,value:r.getRandomizer()})}}n(t)},s.onerror=n=>{indexedDB.deleteDatabase(i),kt(e),d(t,0,n),o(n)},s.onsuccess=function(e){var o=e.target;Tt.db=o.result,no.logUpdate(t),n(Tt.db)}})}function bt(e){var t=arguments;return wt(this,void 0,void 0,function*(){const n=no.logfunction("getObjectsFromLocalIndexDb",t);return new Promise(function(t,o){kt(e).then(o=>{var i=[];var r=o.transaction(e,"readwrite").objectStore(e).getAll();r.onsuccess=()=>{const e=r.result;for(var o=0;o<e.length;o++)i.push(e[o]);no.logUpdate(n),t(i)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot get objects from database because you cannot open the Local database",data:e};d(n,0,t),o(t)})})})}function At(e,t){const n=no.logfunction("storeToDatabase",[e,"localindexdb"]);return new Promise(function(o,i){kt(e).then(r=>{const s=r.transaction(e,"readwrite").objectStore(e).add(t);s.onsuccess=e=>{no.logUpdate(n),o(t)},s.onerror=o=>{let r={status:400,ok:!1,message:"Cannot store to the Local database "+e,data:o,body:t};d(n,0,r),i(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot store to database because you cannot open the Local database",data:e};d(n,0,t),i(t)})})}function St(e,t){const n=no.logfunction("UpdateToDatabase",arguments);return new Promise(function(o,i){kt(e).then(r=>{const s=r.transaction(e,"readwrite").objectStore(e).put(t);s.onsuccess=e=>{no.logUpdate(n),o(t)},s.onerror=o=>{let r={status:400,ok:!1,message:"Cannot Update to the Local database"+e,data:o,body:t};d(n,0,r),i(r)}}).catch(e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the Local database",data:e};d(n,0,t),i(t)})})}var Nt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class _t{static CheckContains(e){for(var t=!1,n=0;n<this.conceptsSyncArray.length;n++)this.conceptsSyncArray[n].id==e.id&&(t=!0);return t}static SyncDataDelete(e){for(var t=0;t<this.conceptsSyncArray.length;t++)e==this.conceptsSyncArray[t].id&&this.conceptsSyncArray.splice(t,1);for(t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].ofTheConceptId!=e&&this.connectionSyncArray[t].toTheConceptId!=e&&this.connectionSyncArray[t].typeId!=e||this.connectionSyncArray.splice(t,1)}static CheckContainsConnection(e){for(var t=!1,n=0;n<this.connectionSyncArray.length;n++)this.connectionSyncArray[n].id==e.id&&(t=!0);return t}static AddConcept(e){try{let t=!1;0!=_t.CheckIfTheConceptIdExists(e.id,this.conceptsSyncArray).id&&(t=!0),t||this.conceptsSyncArray.push(e)}catch(e){throw e}}static RemoveConcept(e){for(var t=0;t<this.conceptsSyncArray.length;t++)this.conceptsSyncArray[t].id==e.id&&this.conceptsSyncArray.splice(t,1)}static SyncDataOnlineWithoutAuth(e,t){return Nt(this,arguments,void 0,function*(e,t,n=!1){return _t.SyncDataOnline(e,t,n)})}static SyncDataOnline(e,t){return Nt(this,arguments,void 0,function*(e,t,n=!0){let o=performance.now();setTimeout(()=>{},5e3);try{if(ed)try{return(yield yd("LocalSyncData__SyncDataOnline",{transactionId:e,withAuth:n})).data}catch(e){Td(e)}let o=[],i=[];if(e&&this.transactionCollections.some(t=>t.id==e)){const t=this.transactionCollections.find(t=>t.id==e);if(this.transactionCollections=this.transactionCollections.filter(t=>t.id!=e),this.transactionCollections=this.transactionCollections.filter(e=>new Date(e.createdDate).getTime()>(new Date).getTime()-6048e5),!t)return;o=t.data.concepts.slice(),i=t.data.connections.slice()}else Array.isArray(null==t?void 0:t.concepts)&&Array.isArray(null==t?void 0:t.connections)?(o=t.concepts.slice(),i=t.connections.slice(),this.conceptsSyncArray=this.conceptsSyncArray.filter(e=>{const n=t.concepts.some(t=>e.id==t.id||e.ghostId==t.ghostId);return n}),this.connectionSyncArray=this.connectionSyncArray.filter(e=>{const n=t.connections.some(t=>e.id==t.id||e.ghostId==t.ghostId);return n})):(o=this.conceptsSyncArray.slice()||[],i=this.connectionSyncArray.slice()||[],this.connectionSyncArray=[],this.conceptsSyncArray=[]);let r=[];for(let e=0;e<o.length;e++)r.push(o[e]),yield xt.UpdateConceptSyncStatus(o[e].id);if(0===r.length&&0===i.length)return o;yield this.UpdateConceptListToIncludeRelatedConcepts(i,r);let s=yield function(e,t){return mt(this,arguments,void 0,function*(e,t,n=!0){const o=no.logfunction("CreateTheGhostConceptApi",[e.length,t.length]);try{const i=300;let r={concepts:[],connections:[]};if(0===e.length&&0===t.length)return no.logUpdate(o),r;const s=yield Ct(e),a=yield Ct(t);if(e.length+t.length<=i){const e=yield vt(s,a,n);return Array.isArray(null==e?void 0:e.concepts)&&(r.concepts=[...r.concepts,...e.concepts]),Array.isArray(null==e?void 0:e.connections)&&(r.connections=[...r.connections,...e.connections]),no.logUpdate(o),r}const c=gt(s,i),l=gt(a,i);for(let e=0;e<c.length;e++){const t=c[e],o=yield vt(t,[],n);Array.isArray(null==o?void 0:o.concepts)&&(r.concepts=[...r.concepts,...o.concepts]),Array.isArray(null==o?void 0:o.connections)&&(r.connections=[...r.connections,...o.connections])}for(let e=0;e<l.length;e++){const t=l[e],o=yield vt([],t,n);Array.isArray(null==o?void 0:o.concepts)&&(r.concepts=[...r.concepts,...o.concepts]),Array.isArray(null==o?void 0:o.connections)&&(r.connections=[...r.connections,...o.connections])}return no.logUpdate(o),r}catch(e){throw d(o,0,e),e}})}(r,i,n),a=s.concepts,c=s.connections;for(let e=0;e<a.length;e++)xt.AddPermanentConcept(a[e]);for(let e=0;e<c.length;e++)Et.AddPermanentConnection(c[e]);return oe.clearAll(),o}catch(e){throw no.logError(o,"unknown",void 0,"unknown",void 0,500,e,"SyncDataOnline",[],"unknown",void 0),e}})}static ConvertGhostIdsInConnections(e){var t,n,o;for(let i=0;i<e.length;i++){let r=e[i].ofTheConceptId,s=e[i].toTheConceptId,a=e[i].typeId,c=null!==(t=_t.ghostIdMap.get(r))&&void 0!==t?t:r,l=null!==(n=_t.ghostIdMap.get(s))&&void 0!==n?n:s,d=null!==(o=_t.ghostIdMap.get(a))&&void 0!==o?o:a;e[i].ofTheConceptId=c,e[i].toTheConceptId=l,e[i].typeId=d}}static UpdateConceptListToIncludeRelatedConcepts(e,t){return Nt(this,void 0,void 0,function*(){for(let n=0;n<e.length;n++){let o=e[n].ofTheConceptId,i=e[n].toTheConceptId,r=e[n].typeId;if(o<0){let i=this.CheckIfTheConceptIdExists(o,t);0==i.id&&(i=yield xt.GetConceptByGhostId(o),0!=i.id?i.id!=i.ghostId&&(e[n].ofTheConceptId=i.id):(i=yield xt.GetConcept(o),this.AddConceptIfDoesNotExist(i,t)))}if(i<0){let o=this.CheckIfTheConceptIdExists(i,t);0==o.id&&(o=yield xt.GetConceptByGhostId(i),0!=o.id?o.id!=o.ghostId&&(e[n].toTheConceptId=o.id):(o=yield xt.GetConcept(i),this.AddConceptIfDoesNotExist(o,t)))}if(r<0){let o=this.CheckIfTheConceptIdExists(r,t);0==o.id&&(o=yield xt.GetConceptByGhostId(r),0!=o.id?o.id!=o.ghostId&&(e[n].typeId=o.id):(o=yield xt.GetConcept(r),this.AddConceptIfDoesNotExist(o,t)))}}})}static AddConceptIfDoesNotExist(e,t=[]){let n=!1;for(let o=0;o<t.length;o++)e.ghostId==t[o].ghostId&&(n=!0);n||t.push(e)}static CheckIfTheConceptIdExists(e,t=[]){let n=pt();for(let o=0;o<t.length;o++)e!=t[o].ghostId&&e!=t[o].id||(n=t[o]);return n}static AddConnection(e){this.connectionSyncArray.push(e)}static RemoveConnection(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e.id&&this.connectionSyncArray.splice(t,1)}static RemoveConnectionById(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e&&this.connectionSyncArray.splice(t,1)}static syncDataLocalDb(){return Nt(this,void 0,void 0,function*(){if(this.conceptsSyncArray.length>0){for(let e=0;e<this.conceptsSyncArray.length;e++)St("localconcept",this.conceptsSyncArray[e]);this.conceptsSyncArray=[]}if(this.connectionSyncArray.length>0){for(let e=0;e<this.connectionSyncArray.length;e++)St("localconnection",this.connectionSyncArray[e]);this.connectionSyncArray=[]}return"done"})}static initializeTransaction(e){return Nt(this,void 0,void 0,function*(){try{if(ed)try{return(yield yd("LocalSyncData__initializeTransaction",{transactionId:e})).data}catch(e){Td(e)}if(this.transactionCollections.some(t=>t.id==e))return;this.transactionCollections.push({id:e,data:{concepts:[],connections:[]},createdDate:(new Date).toISOString()})}catch(e){}})}static markTransactionActions(e,t){return Nt(this,void 0,void 0,function*(){try{if(ed)try{return(yield yd("LocalSyncData__markTransactionActions",{transactionId:e,actions:t})).data}catch(e){Td(e)}this.transactionCollections=this.transactionCollections.map(n=>n.id==e?Object.assign(Object.assign({},n),{data:JSON.parse(JSON.stringify(t))}):n),this.conceptsSyncArray=this.conceptsSyncArray.filter(e=>!t.concepts.some(t=>t.id==e.id||t.ghostId==e.id)),this.connectionSyncArray=this.connectionSyncArray.filter(e=>!t.connections.some(t=>t.id==e.id||t.ghostId==e.id))}catch(e){}})}static rollbackTransaction(e,t){return Nt(this,void 0,void 0,function*(){try{if(ed)try{return(yield yd("LocalSyncData__rollbackTransaction",{transactionId:e,actions:t})).data}catch(e){Td(e)}if(this.transactionCollections.some(t=>t.id==e))return;this.transactionCollections=this.transactionCollections.filter(t=>t.id!=e)}catch(e){}})}}_t.conceptsSyncArray=[],_t.connectionSyncArray=[],_t.ghostIdMap=new Map,_t.transactionCollections=[];var Pt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Et{constructor(){this.name="Connection Array"}static CheckContains(e){for(var t=!1,n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e.id&&(t=!0);return t}static AddConnection(e){this.CheckContains(e)&&this.RemoveConnection(e),e.id,this.connectionArray.push(e)}static AddConnectionToMemory(e){this.CheckContains(e)&&this.RemoveConnection(e),this.connectionArray.push(e)}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){for(var t=0;t<this.connectionArray.length;t++)this.connectionArray[t].id==e.id&&this.connectionArray.splice(t,1);e.id}static RemoveConnectionById(e){for(var t=0;t<this.connectionArray.length;t++)this.connectionArray[t].id==e&&this.connectionArray.splice(t,1);_t.RemoveConnectionById(e)}static AddPermanentConnection(e){e.id>0&&Je.AddConnection(function(e){let t=new Ue(0,0,0,0,0,0,0);return t.ofTheConceptId=e.ofTheConceptId,t.toTheConceptId=e.toTheConceptId,t.typeId=e.typeId,t.orderId=e.orderId,t.id=e.id,t}(e))}static GetConnection(e){var t;t=null;for(var n=0;n<this.connectionArray.length;n++)this.connectionArray[n].id==e&&(t=this.connectionArray[n]);return t}static waitForDataToLoad(){return Pt(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isLocalConnectionLoaded)return e("done");setTimeout(Et.checkFlag,1e3,e)}static GetConnectionsOfCompositionLocal(e){return Pt(this,void 0,void 0,function*(){var t=[];try{for(var n=0;n<this.connectionArray.length;n++)this.connectionArray[n].typeId==e&&t.push(this.connectionArray[n]);return t}catch(e){return t}})}static GetConnectionOfCompositionAndTypeLocal(e,t){return Pt(this,void 0,void 0,function*(){var n=[];try{for(var o=0;o<this.connectionArray.length;o++)this.connectionArray[o].typeId==e&&this.connectionArray[o].ofTheConceptId==t&&n.push(this.connectionArray[o]);return n}catch(e){return n}})}getName(){return this.name}}Et.connectionArray=[],Et.connectionDictionary=[];var Lt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class xt{constructor(){this.name="conceptsArray"}static AddConcept(e){0!=e.id&&(ct.addConceptToTree(e),dt.addConceptToTree(e),ht.addConceptToTree(e),this.localconceptsArray.push(e))}static AddPermanentConcept(e){0!=e.id&&(ct.removeNodeFromTree(e.ghostId),dt.removeConceptType(e.characterValue,e.ghostId),ht.removeConceptType(e.typeId,e.ghostId),yt.addConceptToTree(e),U.AddConcept(e),$r(e,e.userId,he.sessionId))}static RemoveConcept(e){return Lt(this,void 0,void 0,function*(){try{0!=e.id&&(ct.removeNodeFromTree(e.ghostId),dt.removeConceptType(e.characterValue,e.ghostId),ht.removeConceptType(e.typeId,e.ghostId))}catch(e){throw e}})}static RemoveConceptById(e){return Lt(this,void 0,void 0,function*(){try{let t=yield xt.GetConcept(e);0!=t.id&&(ct.removeNodeFromTree(e),dt.removeConceptType(t.characterValue,t.ghostId),ht.removeConceptType(t.typeId,t.ghostId),_t.RemoveConcept(t))}catch(e){throw e}})}static AddConceptToMemory(e){0!=e.id&&(ct.addConceptToTree(e),dt.addConceptToTree(e),ht.addConceptToTree(e))}static GetConcept(e){return Lt(this,void 0,void 0,function*(){var t=pt(),n=yield ct.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static UpdateConceptSyncStatus(e){return Lt(this,void 0,void 0,function*(){ct.updateSyncStatus(e)})}static GetConceptByGhostId(e){return Lt(this,void 0,void 0,function*(){var t=pt(),n=yield yt.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t})}static GetConceptByCharacter(e){return Lt(this,void 0,void 0,function*(){var t=pt(),n=dt.getNodeFromTree(e);return n&&(t=n.value),t})}static GetConceptByCharacterAndTypeLocal(e,t){return Lt(this,void 0,void 0,function*(){var n=pt(),o=yield dt.getCharacterAndTypeFromTree(e,t);return o&&(n=o.value),n})}static GetConceptByCharacterAndCategoryLocal(e,t){return Lt(this,void 0,void 0,function*(){var n=pt(),o=yield dt.getCharacterAndCategoryFromTree(e,t);return o&&(n=o.value),n})}static GetConceptsByTypeId(e){let t=[];for(var n=0;n<this.localconceptsArray.length;n++)this.localconceptsArray[n].typeId==e&&t.push(this.localconceptsArray[n]);return t}static GetConceptsByTypeIdAndUser(e,t){return Lt(this,void 0,void 0,function*(){let n=[];return n=yield ht.getTypeVariantsFromTreeWithUserId(e,t),n})}static ClearData(){return Lt(this,void 0,void 0,function*(){this.localconceptsArray=[],Et.connectionArray=[]})}getName(){return this.name}}xt.localconceptsArray=[];var Rt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ot(e){var t=arguments;return Rt(this,void 0,void 0,function*(){const n=no.logfunction("GetConcept",t)||{};let o=S();const i=new FormData;i.append("id",e.toString());try{if(ed){n.serviceWorker=!0;try{const t=yield yd("GetConcept",{id:e});return no.logUpdate(n),t.data}catch(e){d(n,0,e),Td(e)}}if(0==e||null==e||null==e)return o;var s=yield U.GetConcept(e);let t=U.GetNpc(e);if(0!=s.id||t)return no.logUpdate(n),s;{let t;const s={method:"POST",body:i,headers:yield ke()};try{t=yield be(r.GetConceptUrl(),s)}catch(e){t=yield Ke(s,"/api/getConcept")}return yield function(e,t,n,o){return Rt(this,void 0,void 0,function*(){return e.ok?(t=yield e.json()).id>0?U.AddConcept(t):U.AddNpc(o):a(e),no.logUpdate(n),t})}(t,o,n,e)}}catch(e){Error,l(e,r.GetConceptUrl()),d(n,0,e)}})}var Dt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ut(e){var t=arguments;return Dt(this,void 0,void 0,function*(){const n=no.logfunction("GetAllConnectionsOfComposition",t);var o=[];if(0==(o=yield Je.GetConnectionsOfConcept(e)).length){o=yield Ft(e)}else{var i=yield Ft(e);o=i}return no.logUpdate(n),o})}function Ft(e){var t=arguments;return Dt(this,void 0,void 0,function*(){const n=no.logfunction("GetAllConnectionsOfCompositionOnline",t);var o=[];try{var i=yield Ie(null);const t=new FormData;t.append("composition_id",e.toString());const c=yield be(r.GetAllConnectionsOfCompositionUrl(),{method:"POST",headers:i,body:t});if(!c.ok)throw a(c),new Error(`Error! status: ${c.status}`);const l=yield c.json();for(var s=0;s<l.length;s++)Je.AddConnection(l[s]),o.push(l[s]);return no.logUpdate(n),o}catch(e){Error,l(e,r.GetAllConnectionsOfCompositionUrl()),d(n,0,e)}})}var Bt=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Mt(e,t,n){return Bt(this,void 0,void 0,function*(){var o,i;let r={},s=yield U.GetConcept(e);if(0==s.id&&null!=e&&null!=e){s=yield Ot(e)}let a=yield Zt(e,t,n);return r[null!==(i=null===(o=null==s?void 0:s.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:""]=a,r})}function Gt(e){return Bt(this,void 0,void 0,function*(){var t,n;if(ed)try{return(yield yd("GetComposition",{id:e})).data}catch(e){Td(e)}let o=[],i={};o=yield Ut(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield U.GetConcept(e);if(0==s.id&&null!=e&&null!=e){s=yield Ot(e)}let a=yield Zt(e,o,r);return i[null!==(n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=a,i})}function jt(e){return Bt(this,void 0,void 0,function*(){var t,n;let o=[],i={};o=yield Ut(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield U.GetConcept(e);if(0==s.id&&null!=e&&null!=e){s=yield Ot(e)}let a=yield Xt(e,o,r);return i[null!==(n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=a,i})}function Wt(e){return Bt(this,void 0,void 0,function*(){var t,n;if(ed)try{return(yield yd("GetCompositionFromMemory",{id:e})).data}catch(e){Td(e)}let o=[],i={};o=yield Je.GetConnectionsOfCompositionLocal(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield U.GetConcept(e);if(0==s.id&&null!=e&&null!=e){s=yield Ot(e)}let a=yield Yt(s,o,r);return i[null!==(n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=a,i})}function Vt(e){return Bt(this,void 0,void 0,function*(){var t,n;if(ed)try{return(yield yd("GetCompositionFromMemoryNormal",{id:e})).data}catch(e){Td(e)}let o=[],i={};o=yield Je.GetConnectionsOfCompositionLocal(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield U.GetConcept(e);if(0==s.id&&null!=e&&null!=e){s=yield Ot(e)}let a=yield Kt(s,o,r);return i[null!==(n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=a,i})}function qt(e){var t=arguments;return Bt(this,void 0,void 0,function*(){var n,o;const i=no.logfunction("GetCompositionWithIdFromMemory",t)||{};if(ed){i.serviceWorker=!0;try{const t=yield yd("GetCompositionWithIdFromMemory",{id:e});return no.logUpdate(i),t.data}catch(e){d(i,0,e),Td(e)}}let r={},s=[],a={};try{s=yield Je.GetConnectionsOfCompositionLocal(e);let t=[];for(let e=0;e<s.length;e++)t.includes(s[e].ofTheConceptId)||t.push(s[e].ofTheConceptId);let i=yield U.GetConcept(e);if(0==i.id&&null!=e&&null!=e){i=yield Ot(e)}let c=yield Yt(i,s,t);a[null!==(o=null===(n=null==i?void 0:i.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c,r.created_at=i.entryTimeStamp,r.data=a,r.id=e}catch(e){d(i,0,e)}return no.logUpdate(i),r})}function $t(e,t){var n=arguments;return Bt(this,void 0,void 0,function*(){var o,i;const r=no.logfunction("GetCompositionFromMemoryWithConnections",n)||{};if(ed){r.serviceWorker=!0;try{const n=yield yd("GetCompositionFromMemoryWithConnections",{id:e,connectionList:t});return no.logUpdate(r),n.data}catch(e){d(r,0,e),Td(e)}}let s={},a=[];for(let e=0;e<t.length;e++)a.includes(t[e].ofTheConceptId)||a.push(t[e].ofTheConceptId);let c=yield U.GetConcept(e);if(0==c.id&&null!=e&&null!=e){c=yield Ot(e)}let l=yield Yt(c,t,a);s[null!==(i=null===(o=null==c?void 0:c.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:""]=l;let u={};return u.created_at=c.entryTimeStamp,u.data=s,u.id=e,no.logUpdate(r),u})}function Ht(e,t){return Bt(this,void 0,void 0,function*(){var n,o;const i=no.logfunction("GetCompositionWithIdFromMemoryFromConnection",[e])||{};if(ed){i.serviceWorker=!0;try{const t=yield yd("GetCompositionWithIdFromMemory",{id:e});return no.logUpdate(i),t.data}catch(e){d(i,0,e),Td(e)}}let r={},s=[];for(let e=0;e<t.length;e++)s.includes(t[e].ofTheConceptId)||s.push(t[e].ofTheConceptId);let a=yield U.GetConcept(e);if(0==a.id&&null!=e&&null!=e){a=yield Ot(e)}let c=yield Yt(a,t,s);r[null!==(o=null===(n=null==a?void 0:a.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c;let l={};return l.created_at=a.entryTimeStamp,l.data=r,l.id=e,no.logUpdate(i),l})}function zt(e){return Bt(this,void 0,void 0,function*(){var t,n;if(ed)try{return(yield yd("GetCompositionWithIdFromMemoryNew",{id:e})).data}catch(e){Td(e)}let o=[],i={};o=yield Je.GetConnectionsOfCompositionLocal(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield U.GetConcept(e);if(0==s.id&&null!=e&&null!=e){s=yield Ot(e)}(new Date).getTime();let a=yield function(e,t,n){return Bt(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a,c,l,d,u;let h={},p=e.id,f=((new Date).getTime(),null!==(r=null===(i=null==e?void 0:e.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"");if(!n.includes(p)){let t=f;return{[t]:null==e?void 0:e.characterValue}}if(o.includes(p))return"";o.push(p);for(let e=0;e<t.length;e++){let n=yield on(t[e].ofTheConceptId),o=yield on(t[e].toTheConceptId);t[e].ofConcept=n,t[e].toConcept=o;let i=n.id,r="the_",c=(null!==(a=null===(s=null==o?void 0:o.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(r,"");null!=h[i]&&null!=h[i]||(h[i]={}),h[i][c]=o.characterValue}let y={};for(let e=0;e<t.length;e++){let n=t[e].ofConcept,o=t[e].toConcept,i=null!==(l=null===(c=null==n?void 0:n.type)||void 0===c?void 0:c.characterValue)&&void 0!==l?l:"",r="the_",s=(null!==(u=null===(d=null==o?void 0:o.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"").replace(r,"");null!=y[n.id]&&null!=y[n.id]||(y[n.id]={});let a=y[n.id];null!=a[i]&&null!=a[i]||(a[i]={}),null!=h[t[e].ofTheConceptId]&&null!=h[t[e].toTheConceptId]?a[i][s]=h[o.id]:a[i][s]=o.characterValue}return y[e.id]})}(s,o,r);n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue;i=a;let c={};return c.created_at=s.entryTimeStamp,c.data=i,c.id=e,c})}function Jt(e){return Bt(this,void 0,void 0,function*(){var t,n;if(ed)try{return(yield yd("GetCompositionWithIdAndDateFromMemory",{id:e})).data}catch(e){Td(e)}let o=[],i={};o=yield Je.GetConnectionsOfCompositionLocal(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let s=yield U.GetConcept(e);if(0==s.id&&null!=e&&null!=e){s=yield Ot(e)}let a=yield Zt(e,o,r);i[null!==(n=null===(t=null==s?void 0:s.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=a;let c={};return c.data=i,c.id=e,c.created_at=s.entryTimeStamp,c})}function Qt(e){var t=arguments;return Bt(this,void 0,void 0,function*(){var n,o;const i=no.logfunction("GetCompositionWithId",t)||{};if(ed){i.serviceWorker=!0;try{const t=yield yd("GetCompositionWithId",{id:e});return no.logUpdate(i),t.data}catch(e){d(i,0,e),Td(e)}}let r=[],s={};r=yield Ut(e);let a=[];for(let e=0;e<r.length;e++)a.includes(r[e].ofTheConceptId)||a.push(r[e].ofTheConceptId);let c=yield U.GetConcept(e);if(0==c.id&&null!=e&&null!=e){c=yield Ot(e)}let l=yield Zt(e,r,a);s[null!==(o=null===(n=null==c?void 0:c.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=l;let u={};return u.data=s,u.id=e,no.logUpdate(i),u})}function Yt(e,t,n){return Bt(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a;let c={},l=[],d=e.id;r=null===(i=null==e?void 0:e.type)||void 0===i?void 0:i.characterValue;if(!n.includes(d))return null==e?void 0:e.characterValue;if(o.includes(d))return"";o.push(d);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==d&&d!=t[e].toTheConceptId){let i=t[e].toTheConceptId,r=yield U.GetConcept(i);if((null==r||0==r.id)&&null!=i&&null!=i){r=yield Ot(i)}if(0!=r.id&&null==(null==r?void 0:r.type)){let e=r.typeId,t=yield U.GetConcept(e);if(r.type=t,null==t&&null!=e&&null!=e){t=yield Ot(e),r.type=t}}let d="the_",u=(null!==(a=null===(s=null==r?void 0:r.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(d,"");if(isNaN(Number(u))){if(u){const e=yield Yt(r,t,n,o);c[u]=e}}else{const e=yield Yt(r,t,n,o);l[u]=e,c=l}}return c})}function Kt(e,t,n){return Bt(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a;const c=no.logfunction("recursiveFetchConceptNormal",[e]);(new Date).getTime();let l={},d=[],u=e.id;l.id=u;r=null===(i=null==e?void 0:e.type)||void 0===i?void 0:i.characterValue;if(!n.includes(u))return null==e?void 0:e.characterValue;if(o.includes(u))return"";o.push(u);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==u&&u!=t[e].toTheConceptId){let i=t[e].toTheConceptId,r=yield U.GetConcept(i);if((null==r||0==r.id)&&null!=i&&null!=i){r=yield Ot(i)}if(0!=r.id&&null==(null==r?void 0:r.type)){let e=r.typeId,t=yield U.GetConcept(e);if(r.type=t,null==t&&null!=e&&null!=e){t=yield Ot(e),r.type=t}}let c="the_",u=(null!==(a=null===(s=null==r?void 0:r.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(c,"");if(isNaN(Number(u))){if(u){const e=yield Yt(r,t,n,o);l[u]=e}}else{const e=yield Yt(r,t,n,o);d[u]=e,l=d}}return no.logUpdate(c),l})}function Zt(e,t,n){return Bt(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a;let c={},l=[];if(0==e)return null;let d=yield U.GetConcept(e);if((null==d||0==d.id)&&null!=e&&null!=e){d=yield Ot(e)}if(0!=d.id&&null==d.type){let e=d.typeId,t=yield U.GetConcept(e);if(d.type=t,null==t&&null!=e&&null!=e){t=yield Ot(e),d.type=t}}r=null===(i=null==d?void 0:d.type)||void 0===i?void 0:i.characterValue;if(!n.includes(e))return null==d?void 0:d.characterValue;if(o.includes(e))return"";o.push(e);for(let i=0;i<t.length;i++){(new Date).getTime();if(t[i].ofTheConceptId==e&&e!=t[i].toTheConceptId){let e=t[i].toTheConceptId,r=yield U.GetConcept(e);if((null==r||0==r.id)&&null!=e&&null!=e){r=yield Ot(e)}if(0!=r.id&&null==(null==r?void 0:r.type)){let e=r.typeId,t=yield U.GetConcept(e);if(r.type=t,null==t&&null!=e&&null!=e){t=yield Ot(e),r.type=t}}let d="the_",u=(null!==(a=null===(s=null==r?void 0:r.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(d,"");if(isNaN(Number(u))){if(u){const i=yield Zt(e,t,n,o);c[u]=i}}else{const i=yield Zt(e,t,n,o);l[u]=i,c=l}}}return c})}function Xt(e,t,n){return Bt(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a;let c={},l=[];if(0==e)return null;let d=yield U.GetConcept(e);if((null==d||0==d.id)&&null!=e&&null!=e){d=yield Ot(e)}if(0!=d.id&&null==d.type){let e=d.typeId,t=yield U.GetConcept(e);if(d.type=t,null==t&&null!=e&&null!=e){t=yield Ot(e),d.type=t}}r=null===(i=null==d?void 0:d.type)||void 0===i?void 0:i.characterValue;if(!n.includes(e))return null==d?void 0:d.characterValue;if(o.includes(e))return"";o.push(e),c.id=e;for(let o=0;o<t.length;o++)if(t[o].ofTheConceptId==e){let e=t[o].toTheConceptId,i=yield U.GetConcept(e);if((null==i||0==i.id)&&null!=e&&null!=e){i=yield Ot(e)}if(i&&null==(null==i?void 0:i.type)){let e=i.typeId,t=yield U.GetConcept(e);if(i.type=t,null==t&&null!=e&&null!=e){t=yield Ot(e),i.type=t}}let r="the_",d=(null!==(a=null===(s=null==i?void 0:i.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(r,"");if(isNaN(Number(d))){if(d){const o=yield Xt(e,t,n);c[d]=o}}else{const o=yield Xt(e,t,n);l[d]=o,c=l}}return c})}var en=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const tn=new Map;function nn(e){return en(this,void 0,void 0,function*(){if(null==e.type){let t=yield U.GetConcept(e.typeId);if(0==t.id&&null!=e.typeId&&0!=e.typeId&&999!=e.typeId){let t=yield Ot(e.typeId);e.type=t}else e.type=t}})}function on(e){return en(this,arguments,void 0,function*(e,t=999){e=Number(e);let n=performance.now();if(De.activateStatus)try{De.incrementConcept(e)}catch(e){no.log("ERROR","Error Adding Connection")}if(e>0){const t=yield b.getNodeFromTree(e);if((null==t?void 0:t.value)&&t.value.id>0)return yield nn(t.value),t.value}let o=S();if(tn.has(e))return tn.get(e)||o;const i=(()=>en(this,void 0,void 0,function*(){try{if(ed)try{const n=(yield yd("GetTheConcept",{id:e,userId:t})).data;return n&&n.id>0&&U.AddConceptToMemory(n),n}catch(e){Td(e)}if(e<0){return yield xt.GetConceptByGhostId(e)}if(o=yield U.GetConcept(e),(null==o||0==o.id)&&null!=e&&null!=e){let t=yield Ot(e);o=t}return 0!=o.id&&(yield nn(o)),o}catch(o){throw no.logError(n,t,"read","unknown",void 0,500,o,"GetTheConcept",[e,t],"unknown",void 0),o}finally{tn.delete(e)}}))();return tn.set(e,i),i})}function rn(e){return en(this,void 0,void 0,function*(){if(ed)try{return(yield yd("AddTypeConcept",{concept:e})).data}catch(e){Td(e)}yield nn(e)})}var sn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function an(e){var t=arguments;return sn(this,void 0,void 0,function*(){const n=no.logfunction("GetConceptByCharacterValue",t);let o=S();try{const t=yield Ie(null,"application/json"),i=new FormData;i.append("character_value",e);const s=yield be(r.GetConceptByCharacterValueUrl(),{method:"POST",headers:t,body:i});s.ok?(o=yield s.json(),o.id>0&&rn(o).then(e=>{U.AddConcept(o)}),no.logUpdate(n)):a(s)}catch(e){Error,l(e,r.GetConceptByCharacterValueUrl()),d(n,0,e)}return o})}var cn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ln(e){var t=arguments;return cn(this,void 0,void 0,function*(){const n=no.logfunction("GetConceptByCharacter",t)||{};if(ed){n.serviceWorker=!0;try{const t=yield yd("GetConceptByCharacter",{characterValue:e});return no.logUpdate(n),t.data}catch(e){d(n,0,e),Td(e)}}let o=yield U.GetConceptByCharacter(e),i=`${e}`;return null!=o&&0!=(null==o?void 0:o.id)||!i||(yield an(e),o=yield U.GetConceptByCharacterAndTypeLocal(e,51),0==o.id&&(o=yield U.GetConceptByCharacter(e))),no.logUpdate(n),o})}var dn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function un(e){return dn(this,void 0,void 0,function*(){return yield xt.GetConceptByCharacterAndTypeLocal(e,51)})}function hn(e){return dn(this,void 0,void 0,function*(){if(ed)try{return(yield yd("GetConceptByCharacterAndCategoryLocal",{character:e})).data}catch(e){Td(e)}let t=pt();if("the"==e)return t.id=1,t.typeId=5,t.characterValue="the",t;let n=Le(e);if(n.length>1){let o=1,i=yield hn(n[0]);0!=i.id&&(o=i.id),t=yield function(e,t){return dn(this,void 0,void 0,function*(){return xt.GetConceptByCharacterAndCategoryLocal(e,t)})}(e,o)}else n[0]==e&&(t=yield un(e));return t})}var pn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function fn(e,t){var n=arguments;return pn(this,arguments,void 0,function*(e,t,o=10,i=1){const r=no.logfunction("GetCompositionList",n)||{};if(ed){r.serviceWorker=!0;try{const n=yield yd("GetCompositionList",{compositionName:e,userId:t,inpage:o,page:i});return no.logUpdate(r),n.data}catch(e){d(r,0,e),Td(e)}}let s=yield ln(e),a=[];if(s){yield Re(e,t);let n=yield U.GetConceptsByTypeIdAndUser(s.id,t),r=o*(i-1),c=[];for(let e=r;e<r+o;e++)n[e]&&c.push(n[e].id);yield rt(c);for(let e=r;e<r+o;e++)if(n[e]){let t=yield Wt(n[e].id);a.push(t)}}return no.logUpdate(r),a})}function yn(e,t){return pn(this,arguments,void 0,function*(e,t,n=10,o=1){let i=An(e,t),r=fn(e,t),s=[];return Promise.race([i,r]).then(e=>{s.push(...e)}).catch(e=>{}),r.then(e=>{s.push(...e)}),s})}function mn(e,t){return pn(this,arguments,void 0,function*(e,t,n=10,o=1){if(ed)try{return(yield yd("GetCompositionListAllWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){Td(e)}let i=yield un(e),r=yield ln(e),s=[],a=[],c=[],l=[];0!=i.id&&(a=yield xt.GetConceptsByTypeIdAndUser(i.id,t)),0!=r.id&&(yield Re(e,t),l=yield U.GetConceptsByTypeIdAndUser(r.id,t),s=l);for(let e=0;e<a.length;e++){let t=!1;for(let n=0;n<l.length;n++)a[e].ghostId==l[n].ghostId&&(t=!0);t||c.push(a[e])}let d=[];return d=yield function(e,t){return pn(this,arguments,void 0,function*(e,t,n=10,o=1){let i=[],r=n*(o-1),s=[],a=t.length;for(let t=r;t<r+n-a;t++)e[t]&&s.push(e[t].id);for(let e=0;e<t.length;e++){let n=yield Tn(t[e].id);i.push(n)}yield rt(s);for(let t=r;t<r+n-a;t++)if(e[t]){let n=yield qt(e[t].id);i.push(n)}return i})}(s,c,n,o),d})}function vn(e,t){return pn(this,arguments,void 0,function*(e,t,n=10,o=1){if(ed)try{return(yield yd("GetCompositionListWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){Td(e)}let i=yield ln(e),r=[];if(i){yield Re(e,t);let s=yield U.GetConceptsByTypeIdAndUser(i.id,t),a=n*(o-1),c=[];for(let e=a;e<a+n;e++)s[e]&&c.push(s[e].id);yield rt(c);for(let e=a;e<a+n;e++)if(s[e]){let t=yield qt(s[e].id);r.push(t)}}return r})}function gn(e,t){return pn(this,arguments,void 0,function*(e,t,n=10,o=1){let i=yield function(e){var t=arguments;return cn(this,void 0,void 0,function*(){const n=no.logfunction("GetConceptByCharacterUpdated",t)||{};if(ed){n.serviceWorker=!0;try{const t=yield yd("GetConceptByCharacterUpdated",{characterValue:e});return no.logUpdate(n),t.data}catch(e){d(n,0,e),Td(e)}}let o=yield U.GetConceptByCharacter(e),i=`${e}`;return null!=o&&0!=(null==o?void 0:o.id)||!i||(yield an(e),o=yield U.GetConceptByCharacter(e)),no.logUpdate(n),o})}(e),r=[];if(i){yield Re(e,t);let s=yield U.GetConceptsByTypeIdAndUser(i.id,t),a=n*(o-1),c=[];for(let e=a;e<a+n;e++)s[e]&&c.push(s[e].id);yield rt(c);for(let e=a;e<a+n;e++)if(s[e]){let t=yield qt(s[e].id);r.push(t)}}return r})}var Cn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var wn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function In(e){return wn(this,void 0,void 0,function*(){var t,n;try{if(ed)try{return(yield yd("GetCompositionLocal",{id:e})).data}catch(e){Td(e)}let o=[],i={};o=yield Et.GetConnectionsOfCompositionLocal(e);let s=[];for(let e=0;e<o.length;e++)s.includes(o[e].ofTheConceptId)||s.push(o[e].ofTheConceptId);let c=yield xt.GetConcept(e);if(0==c.id){let t=yield function(e){var t=arguments;return Cn(this,void 0,void 0,function*(){const n=no.logfunction("TranslateLocalToReal",t);let o=S();try{var i=yield Te("application/x-www-form-urlencoded");const t=yield be(r.GetRealConceptById(),{method:"POST",headers:i,body:`id=${e}`});if(t.ok)return o=yield t.json(),o.id>0&&U.AddConcept(o),o;a(t),no.logUpdate(n)}catch(e){Error,l(e,r.GetRealConceptById()),d(n,0,e)}return o})}(e);if(t.id>0)return yield Gt(t.id)}let u=yield kn(e,o,s);return i[null!==(n=null===(t=null==c?void 0:c.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"top"]=u,i}catch(e){throw e}})}function Tn(e){return wn(this,void 0,void 0,function*(){var t,n;try{if(ed)try{return(yield yd("GetCompositionLocalWithId",{id:e})).data}catch(e){Td(e)}let o=[],i={},r={};o=yield Et.GetConnectionsOfCompositionLocal(e);let s=[];for(let e=0;e<o.length;e++)s.includes(o[e].ofTheConceptId)||s.push(o[e].ofTheConceptId);let a=yield xt.GetConcept(e);if(0!=a.id){let r=yield kn(e,o,s);i[null!==(n=null===(t=null==a?void 0:a.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"top"]=r}return r.data=i,r.id=e,r}catch(e){throw e}})}function kn(e,t,n){return wn(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s,a;let c={},l=[],d=yield xt.GetConcept(e);if(0!=d.id&&null==d.type){let e=d.typeId,t=yield xt.GetConcept(e);d.type=t}r=null===(i=null==d?void 0:d.type)||void 0===i?void 0:i.characterValue;if(!n.includes(e))return null==d?void 0:d.characterValue;if(o.includes(e))return"";o.push(e);for(let o=0;o<t.length;o++)if(t[o].ofTheConceptId==e){let e=t[o].toTheConceptId,i=yield xt.GetConcept(e);if(0!=i.id&&null==(null==i?void 0:i.type)){let e=i.typeId,t=yield xt.GetConcept(e);i.type=t}let r="the_",d=(null!==(a=null===(s=null==i?void 0:i.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"top").replace(r,"");if(isNaN(Number(d))){if(d){const o=yield kn(e,t,n);c[d]=o}}else{const o=yield kn(e,t,n);l[d]=o,c=l}}return c})}var bn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function An(e,t){return bn(this,void 0,void 0,function*(){if(ed)try{return(yield yd("GetCompositionListLocal",{compositionName:e,userId:t})).data}catch(e){Td(e)}try{let n=yield un(e),o=[];if(0!=n.id){let e=yield xt.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield In(e[t].id);o.push(n)}}return o}catch(e){throw e}})}function Sn(e,t){return bn(this,void 0,void 0,function*(){if(ed)try{return(yield yd("GetCompositionListLocalWithId",{compositionName:e,userId:t})).data}catch(e){Td(e)}try{let n=yield un(e),o=[];if(0!=n.id){let e=yield xt.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield Tn(e[t].id);o.push(n)}}return o}catch(e){throw e}})}var Nn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function _n(e){return Nn(this,void 0,void 0,function*(){const t=no.logfunction("CreateTheConceptApi",e);let n=S();try{var o=yield Ie();const i=yield be(r.CreateTheConceptUrl(),{method:"POST",headers:o,body:JSON.stringify(e)});if(!i.ok)throw a(i),new Error(`Error! status: ${i.status}`);return n=yield i.json(),no.logUpdate(t),n}catch(e){Error,l(e,r.CreateTheConceptUrl()),d(t,0,e)}})}var Pn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var En=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Ln{static CheckContains(e){for(var t=!1,n=0;n<this.conceptsSyncArray.length;n++)this.conceptsSyncArray[n].id==e.id&&(t=!0);return t}static SyncDataDelete(e){for(var t=0;t<this.conceptsSyncArray.length;t++)e==this.conceptsSyncArray[t].id&&this.conceptsSyncArray.splice(t,1);for(t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].ofTheConceptId!=e&&this.connectionSyncArray[t].toTheConceptId!=e&&this.connectionSyncArray[t].typeId!=e||this.connectionSyncArray.splice(t,1)}static CheckContainsConnection(e){for(var t=!1,n=0;n<this.connectionSyncArray.length;n++)this.connectionSyncArray[n].id==e.id&&(t=!0);return t}static AddConcept(e){this.conceptsSyncArray.push(e)}static RemoveConcept(e){for(var t=0;t<this.conceptsSyncArray.length;t++)this.conceptsSyncArray[t].id==e.id&&this.conceptsSyncArray.splice(t,1)}static AddConnection(e){this.connectionSyncArray.push(e)}static RemoveConnection(e){for(var t=0;t<this.connectionSyncArray.length;t++)this.connectionSyncArray[t].id==e.id&&this.connectionSyncArray.splice(t,1)}static SyncDataOnline(){return En(this,void 0,void 0,function*(){if(ed)try{return(yield yd("SyncData__SyncDataOnline",{})).data}catch(e){Td(e)}for(let e=0;e<this.conceptsSyncArray.length;e++)U.AddConcept(this.conceptsSyncArray[e]);for(let e=0;e<this.connectionSyncArray.length;e++)Je.AddConnection(this.connectionSyncArray[e]);if(this.conceptsSyncArray.length>0){let e=this.conceptsSyncArray.slice();this.conceptsSyncArray=[],_n(e)}if(this.connectionSyncArray.length>0){let e=this.connectionSyncArray.slice();this.connectionSyncArray=[],yield function(e){return Pn(this,void 0,void 0,function*(){let t=new Ue(0,0,0,0,0,0,0);try{var n=yield Ie(),o=JSON.stringify(e);const i=yield be(r.CreateTheConnectionUrl(),{method:"POST",headers:n,body:o});return i.ok?yield i.json():a(i),t}catch(e){throw Error,e}})}(e)}return oe.clearAll(),"done"})}}function xn(e,t,n,o){var i=new Ue(0,e,n,t,o,1,4);if(e==n)return i.ofTheConceptId=0,i.toTheConceptId=1,i;try{i.isTemp=!0,i.id=Math.floor(1e8*Math.random()),Ln.AddConnection(i)}catch(e){l(e)}return i}Ln.conceptsSyncArray=[],Ln.connectionSyncArray=[];var Rn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var On=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Dn(e,t){var n=arguments;return On(this,void 0,void 0,function*(){const o=no.logfunction("GetConceptByCharacterAndType",n);try{if(ed)try{return(yield yd("GetConceptByCharacterAndType",{characterValue:e,typeId:t})).data}catch(e){Td(e)}let n=yield U.GetConceptByCharacterAndTypeLocal(e,t);if(null==n||0==n.id){var i={character_value:`${e}`,type_id:t},s=JSON.stringify(i),c=yield Ie();const o=yield be(r.GetConceptByCharacterAndTypeUrl(),{method:"POST",headers:c,body:s});if(o.ok){let e=yield o.json();n=e,rn(n).then(e=>{U.AddConcept(n)})}else a(o)}return no.logUpdate(o),n}catch(e){Error,l(e,r.GetConceptByCharacterAndTypeUrl()),d(o,0,e)}})}var Un=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Fn{constructor(e,t,n,o,i,r,s,a,c,l){this.id=0,this.userId=e,this.data=t,this.securityId=n,this.securityUserId=o,this.accessId=i,this.accessUserId=r,this.sessionId=s,this.sessionUserId=a,this.entryTimestamp=c,this.isNew=l}}var Bn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Mn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Gn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class jn{static getId(){return Gn(this,void 0,void 0,function*(){if(this.ids.length<5)yield function(){var e=arguments;return Mn(this,void 0,void 0,function*(){const t=no.logfunction("GetReservedIds",e);try{let e=yield Ie("application/x-www-form-urlencoded");const n=yield be(r.GetReservedIdUrl(),{method:"GET",headers:e});if(!n.ok)throw a(n),new Error(`Error! status: ${n.status}`);const o=yield n.json();for(let e=0;e<o.length;e++)jn.AddId(o[e]);no.logUpdate(t)}catch(e){Error,l(e,r.GetReservedIdUrl()),d(t,0,e)}})}();var e=this.ids[0];return this.ids.shift(),e})}static AddId(e){this.ids.includes(e)||this.ids.push(e)}}jn.ids=[];class Wn{static getId(){return Gn(this,void 0,void 0,function*(){if(this.connectionIds.length<5)yield function(){var e=arguments;return Bn(this,void 0,void 0,function*(){const t=no.logfunction("GetReservedConnectionIds",e);try{let e=yield Ie("application/x-www-form-urlencoded");const n=yield be(r.GetReservedConnectionIdUrl(),{method:"GET",headers:e});if(!n.ok)throw a(n),new Error(`Error! status: ${n.status}`);const o=yield n.json();for(let e=0;e<o.length;e++)Wn.AddId(o[e]);no.logUpdate(t)}catch(e){Error,l(e,r.GetReservedConnectionIdUrl()),d(t,0,e)}})}();var e=this.connectionIds[0];return this.connectionIds.shift(),e})}static AddId(e){this.connectionIds.includes(e)||this.connectionIds.push(e)}}Wn.connectionIds=[];var Vn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function qn(e,t,n,o,i,r,s){return Vn(this,void 0,void 0,function*(){let a=yield jn.getId(),c=new Date,l=new Date,d=new A(a,t,o,n,i,e,r,!0,c,l,s);return d.isTemp=!1,Ln.AddConcept(d),d})}var $n=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Hn(e,t){var n=arguments;return $n(this,arguments,void 0,function*(e,t,o=!1,i,s=4,c=999,u=0){i=o?i:999;const h=no.logfunction("MakeTheInstanceConcept",n)||{};if(ed){h.serviceWorker=!0;try{const n=yield yd("MakeTheInstanceConcept",{type:e,referent:t,composition:o,userId:i,passedAccessId:s,passedSessionId:c,referentId:u});return no.logUpdate(h),n.data}catch(e){d(h,0,e),Td(e)}}let p,f=c,y=i,m=i,v=s,g=i,C="",w=t.length,I=S();if(C=e.startsWith("the_")?e:"the_"+e,o){I=yield Vo(e,i),p=yield qn(t,i,4,I.id,u,v,e)}else if(w>255){I=yield Vo(C,i),p=yield qn(t,i,4,I.id,u,v,C),function(e){Rn(this,void 0,void 0,function*(){try{var t=yield Ie();const n=yield be(r.CreateTheTextDataUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(!n.ok)throw a(n),new Error(`Error! status: ${n.status}`);return yield n.json()}catch(e){throw Error,e}})}(new Fn(i,t,999,y,v,g,f,m,Date.now().toString(),!0))}else{I=yield Vo(C,i);let e=yield Dn(t,I.id);if(p=e,0==e.id&&0==e.userId){let e=yield function(e,t,n,o,i,r,s){return Vn(this,void 0,void 0,function*(){let a=yield jn.getId(),c=new Date,l=new Date,d=new A(a,t,o,n,i,e,r,!1,c,l,s);return U.AddConcept(d),_n([d]),d})}(t,i,4,I.id,12,v,C);p=e,function(e,t,n,o){var i=arguments;Un(this,void 0,void 0,function*(){const s=no.logfunction("MakeTheNameInBackend",i);try{let i={newConceptId:e,referent:t,typeId:n,typeUserId:o},c=yield Ie(),l=JSON.stringify(i);const d=yield be(r.MakeTheNameInBackendUrl(),{method:"POST",headers:c,body:l});no.logUpdate(s),d.ok||a(d)}catch(e){Error,l(e,r.MakeTheNameInBackendUrl()),d(s,0,e)}})}(p.id,`${t}`,I.id,i)}}return p.type=I,no.logUpdate(h),p})}var zn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Jn(e){return zn(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null){if(ed)try{return(yield yd("CreateTheComposition",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:o,userId:i,accessId:r,sessionInformationId:s})).data}catch(e){Td(e)}let a=null!=i?i:999,c=null!=r?r:4,l=null!=s?s:999,d=null!=o?o:0,u=S();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=d,n=yield Hn(o,"",!0,a,c,l);u=n,t=n.id,d=n.id,yield Jn(e[o],n.id,n.userId,t,i,r,s)}else{let h=null!=t?t:999,p=null!=n?n:999,f=d,y=yield Hn(o,"",!0,a,c,l);u=y,yield xn(h,p,y.id,f),yield Jn(e[o],y.id,y.userId,f,i,r,s)}else{let i=null!=t?t:999,r=null!=n?n:10267,s=d,u=yield Hn(o,e[o].toString(),!1,a,c,l);yield xn(i,r,u.id,s)}return u})}var Qn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Yn(){return Qn(this,void 0,void 0,function*(){const e=no.logfunction("CreateLocalBinaryTreeFromIndexDb");try{let t=[];if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];xt.AddConceptToMemory(n)}C.isLocalDataLoaded=!0,C.isLocalTypeLoaded=!0,C.isLocalCharacterLoaded=!0,no.logUpdate(e)}catch(t){yield Zs(2e3,Yn());let n={message:"Cannot create local binary tree from index db",data:t,ok:!1,status:400};throw d(e,0,t),n}})}function Kn(){return Qn(this,void 0,void 0,function*(){var e;const t=no.logfunction("PopulateTheLocalConceptsToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",e=>Qn(this,void 0,void 0,function*(){let e=yield bt("localid");if(Array.isArray(e)){if(e[0]){let t=e[0].value;if(t)eo.AddConceptId(e[0]),yield St("localid",{id:0,value:t-10});else{t=-Math.floor(1e8*Math.random());let e={id:0,value:t},n={id:0,value:t-10};eo.AddConceptId(e),yield St("localid",n)}}e[2]}})),no.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw d(t,0,e),n}})}function Zn(){return Qn(this,void 0,void 0,function*(){var e;const t=no.logfunction("PopulateTheLocalConnectionToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",e=>Qn(this,void 0,void 0,function*(){let e=yield bt("localid");if(Array.isArray(e)){if(e[1]){let t=e[1].value;if(t)eo.AddConnectionId(e[1]),yield St("localid",{id:1,value:t-10});else{t=-Math.floor(1e8*Math.random());let e={id:0,value:t},n={id:0,value:t-10};eo.AddConnectionId(e),yield St("localid",n)}}e[2]}})),no.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw d(t,0,e),n}})}var Xn=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class eo{static AddConceptId(e){this.localId=e.value,St("localid",e)}static getConceptId(){return Xn(this,void 0,void 0,function*(){try{if(this.localId){if(this.ReservedLocalId.length<5){yield Kn().then(()=>{let e=this.localId;for(let t=1;t<10;t++){let n=this.localId-t;this.ReservedLocalId.push(n),e=n}this.AddConceptId({id:0,value:e})}).catch(e=>-Math.floor(1e8*Math.random()));let e=this.ReservedLocalId[0];return this.ReservedLocalId.shift(),e}{let e=this.ReservedLocalId[0];return this.ReservedLocalId.shift(),e}}return yield Kn().then(()=>{let e=this.localId;for(let t=1;t<10;t++){let n=this.localId-t;this.ReservedLocalId.push(n),e=n}this.AddConceptId({id:0,value:e})}),this.getConceptId()}catch(e){return-Math.floor(1e8*Math.random())}})}static AddConnectionId(e){this.localConnectionId=e.value}static getConnectionId(){return Xn(this,void 0,void 0,function*(){try{if(this.localConnectionId){if(this.ReservedConnectionId.length<5){yield Zn().then(()=>{let e=this.localConnectionId;for(let t=1;t<10;t++){let n=this.localConnectionId-t;this.ReservedConnectionId.push(n),e=n}}).catch(e=>-Math.floor(1e8*Math.random()));let e=this.ReservedConnectionId[0];return this.ReservedConnectionId.shift(),e}{let e=this.ReservedConnectionId[0];return this.ReservedConnectionId.shift(),e}}return yield Zn().then(()=>{let e=this.localConnectionId;for(let t=1;t<10;t++){let n=this.localConnectionId-t;this.ReservedConnectionId.push(n),e=n}this.AddConnectionId({id:1,value:e})}),this.getConnectionId()}catch(e){return-Math.floor(1e8*Math.random())}})}}eo.ReservedLocalId=[],eo.ReservedConnectionId=[];var to=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class no{static startAutoSync(){this.autoSyncInterval||(this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS,this.autoSyncInterval=setInterval(()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&(this.nextSyncTime=e+this.SYNC_INTERVAL_MS,this.sendPackageLogsToServer(),this.sendApplicationLogsToServer())},3e4))}static stopAutoSync(){null!==this.autoSyncInterval&&(clearInterval(this.autoSyncInterval),this.autoSyncInterval=null,this.nextSyncTime=null)}static setLogLevel(e){this.logLevel=e}static shouldLog(e){return this.LOG_LEVELS.indexOf(e)>=this.LOG_LEVELS.indexOf(this.logLevel)}static formatLogData(e,t,n){const o=Object.assign({timestamp:(new Date).toISOString(),level:e,message:t},n);return this.packageLogsData.push(o),"ERROR"==e&&(this.sendPackageLogsToServer(),this.sendApplicationLogsToServer()),o}static log(e,t,n){if(this.logPackageActivationStatus)try{this.formatLogData(e,t,n||null)}catch(e){}}static logUpdate(e){var t;try{if(!this.logPackageActivationStatus)return{};if(!e)return{};const n=Date.now();e.startTime=null!==(t=e.startTime)&&void 0!==t?t:n;const o=n-e.startTime;e.responseTime=`${o} ms`,!0==!e.serviceWorker&&(e.serviceWorker=!1)}catch(t){d(e,0,t)}}static logfunction(e,...t){if(!this.logPackageActivationStatus)return{};const n=Date.now();let o=t;const i=r.getRandomizer(),s=he.sessionId;let a={startTime:n,functionName:e,functionParameters:o,requestFrom:r.BASE_APPLICATION,sessionId:s,applicationId:i};return this.formatLogData("INFO","function called",a)}static logError(e,t,n,o,i,r,s,a,c,l,d){try{const u=he.sessionId,h=`${(performance.now()-e).toFixed(3)}ms`,p={startTime:e,userId:t,operationType:n,requestFrom:o,requestIP:i,responseStatus:r,responseTime:h,responseSize:s?`${JSON.stringify(s).length}`:"0",sessionId:null==u?void 0:u.toString(),functionName:a,functionParameters:c,userAgent:l,conceptsUsed:d};this.formatLogData("ERROR",`Information logged for ${a}`,p)}catch(e){}}static logApplication(e,t,n){if(this.logApplicationActivationStatus)try{const o={timestamp:(new Date).toISOString(),level:e,message:t,data:n||null};this.applicationLogsData.push(o),"ROUTE"!=e&&"USER_EVENT"!=e||(this.sendPackageLogsToServer(),this.sendApplicationLogsToServer())}catch(e){}}static checkLoggerServerStatus(){return to(this,void 0,void 0,function*(){let e=1e4+no.checkInterval;const t=new Date;if(!(no.lastCheck&&t.getTime()-no.lastCheck.getTime()<e)){try{let e=r.LogHealth();no.lastCheck=new Date;(yield fetch(e,{method:"GET"})).ok&&(no.isLoggerActive=!0,no.checkInterval=0)}catch(e){}no.checkInterval=no.checkInterval+500}})}static sendApplicationLogsToServer(){return to(this,void 0,void 0,function*(){const e=this.applicationLogsData;try{if(!no.isLoggerActive)return void no.checkLoggerServerStatus();if(0===e.length)return;this.applicationLogsData=[];he.BearerAccessToken;const t=50;let n=yield Ie(),o=0;for(;0!=e.length;){const i=e.slice(0,t),s=yield fetch(r.PostLogger(),{method:"POST",headers:n,body:JSON.stringify({logType:this.appLogs,logData:i})});s.ok||404===s.status&&(no.isLoggerActive=!1),e.splice(0,t),o+=t,o++}}catch(e){no.isLoggerActive=!1}})}static sendPackageLogsToServer(){return to(this,void 0,void 0,function*(){const e=this.packageLogsData;try{if(!no.isLoggerActive)return void no.checkLoggerServerStatus();if(0===e.length)return;this.packageLogsData=[];const t=300;let n=0;for(;0!=e.length;){const o=e.slice(0,t);let i=yield Ie();const s=yield fetch(r.PostLogger(),{method:"POST",headers:i,body:JSON.stringify({logType:this.mftsccsBrowser,logData:o})});if(!s.ok)return void(404===s.status&&(no.isLoggerActive=!1));e.splice(0,t),n++}}catch(e){no.isLoggerActive=!1}})}static saveLogToLocalStorage(e,t){try{if(void 0===typeof localStorage)return;{const n=JSON.parse((null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e))||"[]");n.push(t),null===localStorage||void 0===localStorage||localStorage.setItem(e,JSON.stringify(n))}}catch(e){this.log("ERROR","Error while saving log in local storage")}}static clearLogsFromLocalStorage(e){void 0!==typeof localStorage&&(null===localStorage||void 0===localStorage||localStorage.removeItem(e))}}no.isLoggerActive=!0,no.lastCheck=new Date,no.checkInterval=0,no.logLevel="INFO",no.packageLogsData=[],no.applicationLogsData=[],no.LOG_LEVELS=["DEBUG","INFO","WARNING","ERROR","ROUTE"],no.SYNC_INTERVAL_MS=6e4,no.nextSyncTime=null,no.appLogs="app",no.mftsccsBrowser="mftsccs",no.logApplicationActivationStatus=!1,no.logPackageActivationStatus=!1,no.autoSyncInterval=null;var oo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function io(e,t,n){return oo(this,arguments,void 0,function*(e,t,n,o=1,i="",r=999,s={concepts:[],connections:[]}){var a,c,l,d;let u=performance.now();if(ed)try{const u=yield yd("CreateTheConnectionLocal",{ofTheConceptId:e,toTheConceptId:t,typeId:n,orderId:o,typeString:i,userId:r,actions:s});return(null===(c=null===(a=null==u?void 0:u.actions)||void 0===a?void 0:a.concepts)||void 0===c?void 0:c.length)&&(s.concepts=JSON.parse(JSON.stringify(u.actions.concepts))),(null===(d=null===(l=null==u?void 0:u.actions)||void 0===l?void 0:l.connections)||void 0===d?void 0:d.length)&&(s.connections=JSON.parse(JSON.stringify(u.actions.connections))),u.data}catch(e){Td(e)}try{let a=4,c=yield eo.getConnectionId(),l=0,d=0,u=0;l=e,d=t,u=n;let h=new Ue(0,0,0,0,0,0,0);return e!=t&&(h=new Ue(c,l,d,r,n,o,a),h.isTemp=!0,h.typeCharacter=i,_t.AddConnection(h),Et.AddConnection(h),s.connections.push(h)),h}catch(s){throw no.logError(u,r,"create","Unknown","Unknown",500,void 0,"CreateTheConnectionLocal",[e,t,n,o,i,r],"UnknownUserAgent",[]),s}})}function ro(e,t,n){return oo(this,arguments,void 0,function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,a;if(ed)try{const c=yield yd("CreateConnection",{ofTheConcept:e,toTheConcept:t,connectionTypeString:n,actions:o});return(null===(r=null===(i=null==c?void 0:c.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(c.actions.concepts))),(null===(a=null===(s=null==c?void 0:c.actions)||void 0===s?void 0:s.connections)||void 0===a?void 0:a.length)&&(o.connections=JSON.parse(JSON.stringify(c.actions.connections))),c.data}catch(e){Td(e)}let c=yield uo(n,999,999,999),l=e.userId;return yield io(e.id,t.id,c.id,1e3,n,l,o)})}var so=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ao(e,t,n,o,i,r){return so(this,arguments,void 0,function*(e,t,n,o,i,r,s=!1,a=0,c={concepts:[],connections:[]}){var l,d,u,h;let p=performance.now();try{if(ed)try{const p=yield yd("CreateTheConceptLocal",{referent:e,typecharacter:t,userId:n,categoryId:o,typeId:i,accessId:r,isComposition:s,referentId:a});return(null===(d=null===(l=null==p?void 0:p.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(c.concepts=JSON.parse(JSON.stringify(p.actions.concepts))),(null===(h=null===(u=null==p?void 0:p.actions)||void 0===u?void 0:u.connections)||void 0===h?void 0:h.length)&&(c.connections=JSON.parse(JSON.stringify(p.actions.connections))),p.data}catch(e){Td(e)}let p=yield eo.getConceptId(),f=!0,y=new Date,m=new Date;if("the"==e){return new A(1,999,5,5,a,e,r,f,y,m,t)}let v=new A(p,n,i,o,a,e,r,f,y,m,t);return v.isTemp=!0,v.isComposition=s,xt.AddConcept(v),c.concepts.push(v),v}catch(a){throw no.logError(p,n,"create","unknown","unknown",500,void 0,"createTheConceptLocal",[e,t,n,o,i,r,s],void 0),a}})}var co=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var lo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function uo(e,t,n,o){var i=arguments;return lo(this,arguments,void 0,function*(e,t,n,o,r={concepts:[],connections:[]}){var s,a,c,l;const u=no.logfunction("MakeTheTypeConceptLocal",i)||{};if(ed){u.serviceWorker=!0;try{const i=yield yd("MakeTheTypeConceptLocal",{typeString:e,sessionId:t,sessionUserId:n,userId:o,actions:r});return(null===(a=null===(s=null==i?void 0:i.actions)||void 0===s?void 0:s.concepts)||void 0===a?void 0:a.length)&&(r.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(l=null===(c=null==i?void 0:i.actions)||void 0===c?void 0:c.connections)||void 0===l?void 0:l.length)&&(r.connections=JSON.parse(JSON.stringify(i.actions.connections))),no.logUpdate(u),i.data}catch(e){d(u,0,e),Td(e)}}let h=yield hn(e);if(h&&(0==h.id||0==h.userId)){let i=Le(e);if(i[0]==e){let t=yield function(e,t,n,o,i){return co(this,arguments,void 0,function*(e,t,n,o,i,r={concepts:[],connections:[]}){var s,a,c,l;if(ed)try{const d=yield yd("MakeTheConceptLocal",{referent:e,typeCharacter:t,userId:n,categoryId:o,typeId:i,actions:r});return(null===(a=null===(s=null==d?void 0:d.actions)||void 0===s?void 0:s.concepts)||void 0===a?void 0:a.length)&&(r.concepts=JSON.parse(JSON.stringify(d.actions.concepts))),(null===(l=null===(c=null==d?void 0:d.actions)||void 0===c?void 0:c.connections)||void 0===l?void 0:l.length)&&(r.connections=JSON.parse(JSON.stringify(d.actions.connections))),d.data}catch(e){Td(e)}let d=yield xt.GetConceptByCharacterAndTypeLocal(e,i),u=d;return"the"==t&&(o=1),0==u.id&&(d=yield ao(e,t,n,o,i,4,void 0,null,r),u=d),u})}(e,"the",o,1,51,r);h=t}else{let s=yield uo(i[0],t,n,o,r),a=yield uo(i[1],t,n,o,r);h=yield ao(e,i[1],o,s.id,a.id,4,void 0,null,r)}}return no.logUpdate(u),h})}var ho=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function po(e,t){var n=arguments;return ho(this,arguments,void 0,function*(e,t,o=!1,i,r,s=999,a=0,c={concepts:[],connections:[]}){var l,u,h,p;0==o&&(i=999);const f=no.logfunction("MakeTheInstanceConceptLocal",n)||{};if(ed){f.serviceWorker=!0;try{const n=yield yd("MakeTheInstanceConceptLocal",{type:e,referent:t,composition:o,userId:i,accessId:r,sessionInformationId:s,referentId:a,actions:c});return(null===(u=null===(l=null==n?void 0:n.actions)||void 0===l?void 0:l.concepts)||void 0===u?void 0:u.length)&&(c.concepts=JSON.parse(JSON.stringify(n.actions.concepts))),(null===(p=null===(h=null==n?void 0:n.actions)||void 0===h?void 0:h.connections)||void 0===p?void 0:p.length)&&(c.connections=JSON.parse(JSON.stringify(n.actions.connections))),no.logUpdate(f),n.data}catch(e){d(f,0,e),Td(e)}}try{let n,r,s=999,l=4,d=i,u=4,h="",p=t.length;if(h=e.startsWith("the_")?e:"the_"+e,o){n=yield uo(e,s,i,i,c),r=yield ao(t,e,i,l,n.id,u,!0,a,c)}else if(p>255){n=yield uo(h,s,d,i,c),r=yield ao(t,h,i,l,n.id,u,void 0,void 0,c)}else{n=yield uo(h,s,d,i,c);let e=yield xt.GetConceptByCharacterAndTypeLocal(t,n.id);if(r=e,0==e.id&&0==e.userId){r=yield ao(t,h,i,l,n.id,u,void 0,void 0,c)}}return r.type=n,_t.AddConcept(r),c.concepts.push(r),no.logUpdate(f),r}catch(e){throw d(f,0,e),e}})}var fo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function yo(e){return fo(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null,a=!1,c={concepts:[],connections:[]}){var l,u,h,p;const f=no.logfunction("CreateTheCompositionLocal")||{};if(ed){f.serviceWorker=!0;try{const a=yield yd("CreateTheCompositionLocal",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:o,userId:i,accessId:r,sessionInformationId:s,actions:c});return(null===(u=null===(l=null==a?void 0:a.actions)||void 0===l?void 0:l.concepts)||void 0===u?void 0:u.length)&&(c.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(p=null===(h=null==a?void 0:a.actions)||void 0===h?void 0:h.connections)||void 0===p?void 0:p.length)&&(c.connections=JSON.parse(JSON.stringify(a.actions.connections))),no.logUpdate(f),a.data}catch(e){d(f,0,e),Td(e)}}let y=null!=i?i:999,m=null!=r?r:999,v=null!=s?s:999,g=null!=o?o:0,C=pt();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=g,n=yield po(o,"",!0,y,m,v,void 0,c);C=n,t=n.id,g=n.id,yield yo(e[o],n.id,n.userId,t,i,r,s,void 0,c)}else{let n=null!=t?t:999,a=g,l=yield po(o,"",!0,y,m,v,void 0,c);yield io(n,l.id,a,void 0,void 0,void 0,c),yield yo(e[o],l.id,l.userId,a,i,r,s,void 0,c)}else{let n=null!=t?t:999,i=g,r=yield po(o,e[o].toString(),!1,y,m,v,void 0,c);yield io(n,r.id,i,void 0,void 0,void 0,c)}return no.logUpdate(f),C})}var mo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function vo(e,t,n){var o=arguments;return mo(this,arguments,void 0,function*(e,t,n,i=10,s=1){const c=no.logfunction("GetConnectionOfTheConcept",o)||{};let u=[];try{if(ed){c.serviceWorker=!0;try{const o=yield yd("GetConnectionOfTheConcept",{typeId:e,ofTheConceptId:t,userId:n,inpage:i,page:s});return no.logUpdate(c),o.data}catch(e){d(c,0,e),Td(e)}}let o=new URLSearchParams;o.append("typeId",`${e}`),o.append("ofTheConceptId",`${t}`),o.append("userId",`${n}`),o.append("inpage",`${i}`),o.append("page",`${s}`);let l=yield Ie("application/x-www-form-urlencoded");const h=yield be(r.GetAllConnectionsOfConceptUrl(),{method:"POST",headers:l,body:o});return h.ok?u=yield h.json():(d(c,0,h.status),a(h)),no.logUpdate(c),u}catch(e){Error,l(e,r.GetAllConnectionsOfConceptUrl()),d(c,0,e)}})}var go=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Co(e,t,n,o){return go(this,arguments,void 0,function*(e,t,n,o,i=1,r=4){if(e>0&&n>0){var a=t,c=yield Wn.getId(),l=new Ue(c,e,n,a,o,i,r);return e==n?(l.ofTheConceptId=0,l.toTheConceptId=1,l):(l.toUpdate=!0,l.isTemp=!1,Ln.AddConnection(l),l)}throw new s("cannot create connection because id are negative ",!1,400,"")})}var wo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Io=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var To=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ko(e){var t=arguments;return To(this,void 0,void 0,function*(){const n=no.logfunction("DeleteConnectionById",t);if(ed)try{return(yield yd("DeleteConnectionById",{id:e})).data}catch(e){Td(e)}let o=!0;return e>0?(o=yield function(e){var t=arguments;return Io(this,void 0,void 0,function*(){const n=no.logfunction("DeleteTheConnection",t);let o=!1;try{const t=new FormData;t.append("id",e.toString());let i=yield ke();const s=yield be(r.DeleteTheConnectionUrl(),{method:"POST",headers:i,body:t,redirect:"follow"});no.logUpdate(n),s.ok?o=(yield s.json()).success:a(s),o&&Je.AddNpConn(e)}catch(e){Error,l(e,r.DeleteTheConnectionUrl()),d(n,0,e)}return o})}(e),Me.removeNodeFromTree(e)):Et.RemoveConnectionById(e),no.logUpdate(n),o})}function bo(e){var t=arguments;return To(this,void 0,void 0,function*(){const n=no.logfunction("DeleteConnectionByIdBulk",t);if(ed)try{return(yield yd("DeleteConnectionByIdBulk",{ids:e})).data}catch(e){Td(e)}let o=yield function(e){var t=arguments;return wo(this,void 0,void 0,function*(){const n=no.logfunction("DeleteTheConnectionBulkApi",t);let o=!1;try{let t=yield ke();t.append("Content-Type","application/json");const i=yield be(r.DeleteTheConnectionBulkUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(no.logUpdate(n),i.ok?o=(yield i.json()).success:a(i),o)for(let t=0;t<e.length;t++){let n=e[t];Je.AddNpConn(n)}}catch(e){Error,l(e,r.DeleteTheConnectionUrl()),d(n,0,e)}return o})}(e);if(o)for(let t=0;t<e.length;t++){let n=e[t];n>0?Me.removeNodeFromTree(n):Et.RemoveConnectionById(n)}return no.logUpdate(n),o})}var Ao=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function So(e,t,n){return Ao(this,arguments,void 0,function*(e,t,n,o=!1,i=!1){var r,s;if(ed)try{return(yield yd("CreateConnectionBetweenTwoConcepts",{ofTheConcept:e,toTheConcept:t,linker:n,both:o,count:i})).data}catch(e){Td(e)}let a=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s"+"_"+o;i&&(yield No(o,t,a));let c=yield Hn("connection",s,!1,999,999,999),l=new Ue(0,t.id,e.id,a,c.id,1e3,4);Ln.AddConnection(l)}let c=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s"+"_"+c;i&&(yield No(c,e,a));let d=yield Hn("connection",l,!1,999,999,999),u=new Ue(0,e.id,t.id,a,d.id,1e3,4);return Ln.AddConnection(u),u})}function No(e,t){return Ao(this,arguments,void 0,function*(e,t,n=null){var o;let i=t,r=null!=n?n:t.userId,s=e+"_count",a=(null===(o=t.type)||void 0===o?void 0:o.characterValue)+"_s_"+s,c=yield Hn("connection",a,!1,r,4,999),l=yield vo(c.id,t.id,r,10,1),d=[],u=S();for(let e=0;e<l.length;e++){let t=yield on(l[e].toTheConceptId);d.push(t)}if(d.length<1)u=yield Hn("count","1",!1,r,4,999);else{let e=d[0],t=0;try{t=Number(e.characterValue)}catch(e){t=0}t+=1,u=yield Hn("count",t.toString(),!1,r,4,999);for(let e=0;e<l.length;e++)ko(l[e].id)}let h=new Ue(0,i.id,u.id,i.userId,c.id,1e3,4);yield Ln.AddConnection(h)})}function _o(e,t,n){return Ao(this,arguments,void 0,function*(e,t,n,o=!1,i=!1){var r,s;let a=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s"+"_"+o;i&&(yield No(o,t,a));let c=yield Hn("connection",s,!1,999,999,999),l=new Ue(0,t.id,e.id,a,c.id,1e3,4);Ln.AddConnection(l)}let c=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s"+"_"+c;i&&(yield No(c,e,a));let d=yield Hn("connection",l,!1,999,999,999);return yield Co(e.id,e.userId,t.id,d.id,1e3,4)})}var Po=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Eo(e,t){const n=no.logfunction("storeToDatabase",[e,"noindexdb"]);no.logUpdate(n)}function Lo(e,t,n){return Po(this,void 0,void 0,function*(){const t=no.logfunction("getFromDatabaseWithType",[e,"noindexdb"]);no.logUpdate(t)})}function xo(e){return Po(this,void 0,void 0,function*(){const t=no.logfunction("getObjectsFromIndexDb",[e,"noindexdb"]);no.logUpdate(t)})}var Ro=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Oo(e,t){var n=arguments;return Ro(this,arguments,void 0,function*(e,t,o=10,i=1){var r;const s=no.logfunction("GetLink",n)||{};if(ed){s.serviceWorker=!0;try{const n=yield yd("GetLink",{id:e,linker:t,inpage:o,page:i});return no.logUpdate(s),n.data}catch(e){d(s,0,e),Td(e)}}let a=[],c=yield on(e),l=(null===(r=c.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,u=yield Dn(l,16);if(u.id>0){let e=yield vo(u.id,c.id,c.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);yield rt(t);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield on(n),i=yield Jt(o.id);a.push(i)}}return no.logUpdate(s),a})}function Do(e,t){var n=arguments;return Ro(this,arguments,void 0,function*(e,t,o=10,i=1){var r;const s=no.logfunction("GetLinkRaw",n);let a=[],c=yield on(e),l=(null===(r=c.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield Dn(l,16);if(d.id>0){let e=yield vo(d.id,c.id,c.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield on(n);a.push(o)}}return no.logUpdate(s),a})}var Uo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Fo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Bo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Mo(e){return Bo(this,void 0,void 0,function*(){const t=no.logfunction("GetConceptByCharacterAndCategory",e);let n=S();if("the"==e)return n.id=1,n.typeId=5,n.characterValue="the",n;let o=Le(e);if(o.length>1){let t=1,i=yield Mo(o[0]);0!=i.id&&(t=i.id),n=yield function(e,t){var n=arguments;return Bo(this,void 0,void 0,function*(){const o=no.logfunction("GetConceptByCharacterAndCategoryFromMemory",n);let i=yield U.GetConceptByCharacterAndCategoryLocal(e,t);return 0==i.id&&(i=yield function(e,t){var n=arguments;return Uo(this,void 0,void 0,function*(){const o=no.logfunction("GetConceptByCharacterAndCategoryDirectApi",n);let i=S();try{var s=yield Ie("application/x-www-form-urlencoded");const n=yield be(r.GetConceptByCharacterAndCategoryDirectUrl(),{method:"POST",headers:s,body:`character_value=${e}&category_id=${t}`});if(n.ok){let e=yield n.json();i=e,rn(i).then(()=>{U.AddConcept(i),m("concept",i).catch(()=>{})})}else a(n);no.logUpdate(o)}catch(e){Error,l(e,r.GetConceptByCharacterAndCategoryDirectUrl()),d(o,0,e)}return i})}(e,t)),no.logUpdate(o),i})}(e,t)}else o[0]==e&&(n=yield function(e){var t=arguments;return Bo(this,void 0,void 0,function*(){const n=no.logfunction("GetConceptByCharacter",t);let o=yield U.GetConceptByCharacterAndTypeLocal(e,51);return 0==o.id&&(o=yield an(e)),no.logUpdate(n),o})}(e));return no.logUpdate(t),n})}function Go(e){return Bo(this,void 0,void 0,function*(){let t=[];try{t=yield function(e){return Fo(this,void 0,void 0,function*(){let t=[];try{let n=JSON.stringify(e),o=yield Ie();const i=yield be(r.GetTypeConceptBulk(),{method:"POST",headers:o,body:n});if(i.ok){let e=yield i.json();t=yield Xe(e)}else a(i)}catch(e){Error,l(e,r.GetConceptByCharacterAndCategoryDirectUrl())}return t})}(e)}catch(e){}return t})}var jo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const Wo=new Map;function Vo(e,t){var n=arguments;return jo(this,void 0,void 0,function*(){const t=no.logfunction("MakeTheTypeConceptApi",n);let o=S();if(Wo.has(e))return Wo.get(e)||o;const i=(()=>jo(this,void 0,void 0,function*(){try{if(o=yield Mo(e),0==o.id||4==o.typeId){let n=yield Ie("application/x-www-form-urlencoded");const i=yield be(r.MakeTheTypeConceptUrl(),{method:"POST",headers:n,body:`type=${e}`});if(!i.ok)throw a(i),new Error(`Error! status: ${i.status}`);let s=yield i.json();o=s,no.logUpdate(t)}}catch(e){Error,l(e,r.MakeTheTypeConceptUrl()),d(t,0,e)}finally{Wo.delete(e)}return o}))();return Wo.set(e,i),i})}var qo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function $o(e){var t=arguments;return qo(this,void 0,void 0,function*(){no.logfunction("GetAllLinkerConnectionsFromTheConcept",t);var n=[];try{(new Date).getTime();var o=yield Ie("application/x-www-form-urlencoded");const t=yield be(r.GetAllLinkerConnectionOfConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:o});if(t.ok){const e=yield t.json();for(var i=0;i<e.length;i++){var s=e[i];n.push(s)}}else a(t)}catch(e){Error,l(e,r.GetAllLinkerConnectionOfConceptUrl())}return n})}var Ho=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function zo(e){var t=arguments;return Ho(this,void 0,void 0,function*(){const n=no.logfunction("GetAllLinkerConnectionsToTheConcept",t);var o=[];try{(new Date).getTime();var i=yield Ie("application/x-www-form-urlencoded");const t=yield be(r.GetAllLinkerConnectionToConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:i});if(t.ok){const e=yield t.json();for(var s=0;s<e.length;s++){var c=e[s];o.push(c)}no.logUpdate(n)}else a(t)}catch(e){Error,l(e,r.GetAllLinkerConnectionToConceptUrl()),d(n,0,e)}return o})}var Jo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Qo(e){var t=arguments;return Jo(this,void 0,void 0,function*(){const n=no.logfunction("GetLinkerConnectionFromConcepts",t);let o=yield $o(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield on(n);t.type=i}return no.logUpdate(n),o})}function Yo(e){var t=arguments;return Jo(this,void 0,void 0,function*(){const n=no.logfunction("GetLinkerConnectionToConcepts",t);let o=yield zo(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield on(n);t.type=i}return no.logUpdate(n),o})}var Ko=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Zo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Xo=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ei(e){var t=arguments;return Xo(this,void 0,void 0,function*(){const n=no.logfunction("DeleteConceptById",t);if(ed)try{return(yield yd("DeleteConceptById",{id:e})).data}catch(e){Td(e)}if(e>0){var o=yield U.GetConcept(e);if(o.id>0){var i=o.typeId,s=o.characterValue;yield E.removeTypeConcept(i,e),yield T.removeNodeByCharacter(s,e),yield function(e){var t=arguments;return Zo(this,void 0,void 0,function*(){let n=!1;const o=no.logfunction("DeleteTheConcept",t);try{const t=new FormData;t.append("id",e.toString());let i=yield ke();const s=yield be(r.DeleteConceptUrl(),{method:"POST",headers:i,body:t});s.ok?n=(yield s.json()).success:a(s),n&&U.AddNpc(e),no.logUpdate(o)}catch(e){Error,l(e,r.DeleteConceptUrl()),d(o,0,e)}return n})}(e),yield b.removeNodeFromTree(e),yield Ve.removeNodeFromTree(e)}}else xt.RemoveConceptById(e);no.logUpdate(n)})}function ti(e){return Xo(this,void 0,void 0,function*(){if(ed)try{return(yield yd("DeleteUser",{id:e})).data}catch(e){Td(e)}e>0?function(e){var t=arguments;Ko(this,void 0,void 0,function*(){const n=no.logfunction("DeleteUserInBackend",t);try{var o=yield Te("application/json","");let t=r.DeleteUserUrl();t=t+"?conceptId="+e+"&apiKey=freeschema";const i=yield be(t,{method:"POST",headers:o});if(i.ok){let e=yield i.json(),t=Number(e.data);return ei(t),no.logUpdate(n),t}throw a(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){Error,l(e,r.DeleteConceptUrl()),d(n,0,e)}})}(e):xt.RemoveConceptById(e)})}var ni=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function oi(e,t){return ni(this,void 0,void 0,function*(){try{const n=yield Te(null,t),o=new FormData;o.append("id",e.toString());const i=yield be(r.DeleteConceptUrl(),{method:"POST",body:o,headers:n});if(!i.ok)throw a(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){Error,l(e,r.DeleteConceptUrl())}})}var ii=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ri(e){var t=arguments;return ii(this,void 0,void 0,function*(){const n=no.logfunction("GetConnection",t);let o=yield Je.GetConnection(e);try{if(0!=o.id)return o;{const t=new FormData;t.append("id",e.toString());const i={method:"POST",headers:yield ke(),body:t};let s;try{s=yield be(r.GetConnectionUrl(),i)}catch(e){s=yield Ke(i,"/api/get-connection-by-id")}return yield function(e,t){return ii(this,void 0,void 0,function*(){e.ok?(t=yield e.json(),Je.AddConnection(t)):a(e)})}(s,o),no.logUpdate(n),o}}catch(e){Error,l(e,r.GetConnectionUrl()),d(n,0,e)}})}var si=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ai(e){var t=arguments;return si(this,void 0,void 0,function*(){const n=no.logfunction("GetConnectionById",t);if(!0===De.activateStatus)try{De.incrementConnection(e)}catch(e){no.log("ERROR","Error Adding Connection")}if(ed)try{return(yield yd("GetConnectionById",{id:e})).data}catch(e){Td(e)}let o=yield Je.GetConnection(e);if((null==o||0==o.id)&&null!=e&&null!=e){o=yield ri(e)}return no.logUpdate(n),o})}var ci=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var li=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function di(e,t,n){return li(this,arguments,void 0,function*(e,t,n,o=4,i=999){const r=no.logfunction("MakeTheTimestamp")||{};if(ed){r.serviceWorker=!0;try{const s=yield yd("MakeTheTimestamp",{type:e,referent:t,userId:n,accessId:o,sessionInformationId:i});return no.logUpdate(r),s.data}catch(e){d(r,0,e),Td(e)}}let s,a="",c=e.startsWith("the_"),l=S();a=c?e:"the_"+e,l=yield Vo(a,n);let u=yield function(e,t,n,o,i,r,s){return ci(this,void 0,void 0,function*(){let a=yield Dn(e,o),c=a;return 0==c.id&&(a=yield qn(e,t,n,o,i,r,s),c=a),c})}(t,n,4,l.id,0,o,a);return s=u,no.logUpdate(r),s})}class ui{constructor(){this.composition=0,this.type="",this.linker="",this.inpage=10,this.page=1,this.listLinkers=[],this.fullLinkers=[],this.textSearch="",this.logic="or",this.reverse=!1,this.doFilter=!1,this.filterSearches=[],this.selectors=[],this.ofCompositions=[]}}var hi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function pi(){return hi(this,arguments,void 0,function*(e=[]){const t=no.logfunction("GetConnectionBulk",e.length)||{};let n=[];try{if(ed){t.serviceWorker=!0;try{const n=yield yd("GetConnectionBulk",{connectionIds:e});return no.logUpdate(t),n.data}catch(e){d(t,0,e),Td(e)}}if(e.length>0){let o=[];for(let t=0;t<e.length;t++)if(!Je.GetNpConn(e[t])){let i=yield Je.GetConnection(e[t]);0==i.id?o.push(e[t]):n.push(i)}if(0==o.length)return no.logUpdate(t),yield tt(n),n;{let e;const i={method:"POST",headers:yield Ie(),body:JSON.stringify(o)};try{e=yield be(r.GetConnectionBulkUrl(),i)}catch(t){e=yield Ke(i,"/api/get_connection_bulk")}yield function(e,t,n){return hi(this,void 0,void 0,function*(){if(e.ok){const n=yield e.json();if(n.length>0)for(let e=0;e<n.length;e++){let o=n[e];t.push(o),Je.AddConnection(o)}}else d(n,0,e.status),a(e)})}(e,n,t),no.logUpdate(t)}}}catch(e){Error,d(t,0,e),l(e,r.GetConnectionBulkUrl())}return yield tt(n),n})}var fi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function yi(){return fi(this,arguments,void 0,function*(e=[]){yield rt(e);let t=[];for(let n=0;n<e.length;n++){let o=yield Wt(e[n]);t.push(o)}return t})}function mi(){return fi(this,arguments,void 0,function*(e=[]){yield rt(e);let t=[];for(let n=0;n<e.length;n++){let o=yield qt(e[n]);t.push(o)}return t})}function vi(){return fi(this,arguments,void 0,function*(e=[],t=[]){const n=no.logfunction("GetCompositionFromConnectionsWithDataId",[e])||{};if(ed){n.serviceWorker=!0;try{const o=yield yd("GetCompositionFromConnectionsWithDataId",{conceptIds:e,connectionIds:t});return no.logUpdate(n),o.data}catch(e){d(n,0,e),Td(e)}}let o=[];yield Xe(e);for(let t=0;t<e.length;t++){let n=yield qt(e[t]);o.push(n)}return no.logUpdate(n),o})}function gi(){var e=arguments;return fi(this,arguments,void 0,function*(t=[],n=[]){const o=no.logfunction("GetCompositionFromConnectionsWithDataIdFromConnections",e)||{};if(ed){o.serviceWorker=!0;try{const e=yield yd("GetCompositionFromConnectionsWithDataIdFromConnections",{conceptIds:t,connectionIds:n});return no.logUpdate(o),e.data}catch(e){d(o,0,e),Td(e)}}let i=yield pi(n);yield Xe(t);let r=[];for(let e=0;e<t.length;e++){let n=yield Ht(t[e],i);r.push(n)}return no.logUpdate(o),r})}function Ci(){var e=arguments;return fi(this,arguments,void 0,function*(t=[],n=[]){const o=no.logfunction("GetCompositionFromConnectionsWithDataIdIndex",e)||{};if(ed){o.serviceWorker=!0;try{const e=yield yd("GetCompositionFromConnectionsWithDataIdIndex",{conceptIds:t,connectionIds:n});return no.logUpdate(o),e.data}catch(e){d(o,0,e),Td(e)}}yield pi(n),yield ot(t);let i={};for(let e=0;e<t.length;e++){let n=yield qt(t[e]);i[t[e]]=n}return no.logUpdate(o),i})}function wi(){return fi(this,arguments,void 0,function*(e=[],t=[]){yield pi(t),yield ot(e);let n={};for(let t=0;t<e.length;t++){let o=yield Wt(e[t]);n[e[t]]=o}return n})}function Ii(){return fi(this,arguments,void 0,function*(e=[],t=[]){if(ed)try{return(yield yd("GetCompositionFromConnectionsWithIndexFromConnections",{conceptIds:e,connectionIds:t})).data}catch(e){Td(e)}let n=yield pi(t),o=[];for(let t=0;t<e.length;t++){let i=yield $t(e[t],n);o[e[t]]=i}return o})}function Ti(e){var t=arguments;return fi(this,void 0,void 0,function*(){const n=no.logfunction("GetConnectionDataPrefetch",t)||{};if(ed){n.serviceWorker=!0;try{const t=yield yd("GetConnectionDataPrefetch",{connectionIds:e});return no.logUpdate(n),t.data}catch(e){d(n,0,e),Td(e)}}const o=yield Promise.all(e.map(e=>Je.GetConnection(e))),i=[],r=[];for(let t=0;t<o.length;t++){const n=o[t];0===(null==n?void 0:n.id)?r.push(e[t]):i.push(n)}const s=yield pi(r),a=[...i,...s],c=new Set;for(const e of a)c.add(e.ofTheConceptId),c.add(e.toTheConceptId),c.add(e.typeId);return yield Xe([...c]),no.logUpdate(n),a})}function ki(){var e=arguments;return fi(this,arguments,void 0,function*(t=[],n=[]){const o=no.logfunction("GetCompositionFromConnectionsWithDataIdInObject",e);yield pi(n);let i={};for(let e=0;e<t.length;e++){let n=yield qt(t[e]);i[t[e]]=n}return no.logUpdate(o),i})}function bi(){return fi(this,arguments,void 0,function*(e=[],t=[]){yield pi(t);let n={};for(let t=0;t<e.length;t++){let o=yield Wt(e[t]);n[e[t]]=o}return n})}function Ai(){return fi(this,arguments,void 0,function*(e=[],t=[]){yield pi(t);let n={};for(let t=0;t<e.length;t++){let o=yield Vt(e[t]);n[e[t]]=o}return n})}var Si=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ni(){var e=arguments;return Si(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const s=no.logfunction("RecursiveSearchApi",e)||{};let c=[];try{if(ed){s.serviceWorker=!0;try{const e=yield yd("RecursiveSearchApi",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return no.logUpdate(s),e.data}catch(e){d(s,0,e),Td(e)}}let e=new ui;e.composition=t,e.listLinkers=n,e.fullLinkers=i,e.textSearch=o;let l=JSON.stringify(e),u=yield Ie();const h=yield be(r.RecursiveSearchUrl(),{method:"POST",headers:u,body:l});if(h.ok){const e=yield h.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections;c=yield vi(t,n)}else d(s,0,h.status),a(h);no.logUpdate(s)}catch(e){Error,d(s,0,e),l(e,r.RecursiveSearchUrl())}return c})}function _i(){var e=arguments;return Si(this,arguments,void 0,function*(t=0,n=[],o=""){const i=no.logfunction("RecursiveSearchApiWithInternalConnections",e)||{};let s=[];try{if(ed){i.serviceWorker=!0;try{const e=yield yd("RecursiveSearchApiWithInternalConnections",{composition:t,listLinkers:n,textSearch:o});return no.logUpdate(i),e.data}catch(e){d(i,0,e),Td(e)}}let e=new ui;e.composition=t,e.listLinkers=n,e.textSearch=o;let c=JSON.stringify(e),l=yield Ie();const u=yield be(r.RecursiveSearchUrl(),{method:"POST",headers:l,body:c});if(u.ok){const e=yield u.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections;s=yield gi(t,n),no.logUpdate(i)}else d(i,0,u.status),a(u)}catch(e){Error,d(i,0,e),l(e,r.RecursiveSearchUrl())}return s})}function Pi(){var e=arguments;return Si(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const s=no.logfunction("RecursiveSearchApiRaw",e)||{};try{if(ed){s.serviceWorker=!0;try{const e=yield yd("RecursiveSearchApiRaw",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return no.logUpdate(s),e.data}catch(e){d(s,0,e),Td(e)}}let e=new ui;e.composition=t,e.listLinkers=n,e.textSearch=o,e.fullLinkers=i;let c=JSON.stringify(e),l=yield Ie();const u=yield be(r.RecursiveSearchUrl(),{method:"POST",headers:l,body:c});if(u.ok){const e=yield u.json();e.compositionIds,e.internalConnections,e.externalConnections;return no.logUpdate(s),e}return d(s,0,u.status),a(u),no.logUpdate(s),[]}catch(e){Error,d(s,0,e),l(e,r.RecursiveSearchUrl())}})}function Ei(){var e=arguments;return Si(this,arguments,void 0,function*(t=0,n=[],o=""){const i=no.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(ed){i.serviceWorker=!0;try{const e=yield yd("RecursiveSearchApiRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return no.logUpdate(i),e.data}catch(e){d(i,0,e),Td(e)}}let e=new ui;e.composition=t,e.fullLinkers=n,e.textSearch=o;let s=JSON.stringify(e),c=yield Ie();const l=yield be(r.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(l.ok){const e=yield l.json();e.compositionIds,e.internalConnections,e.externalConnections;return no.logUpdate(i),e}return d(i,0,l.status),a(l),no.logUpdate(i),[]}catch(e){Error,l(e,r.RecursiveSearchUrl()),d(i,0,e)}})}function Li(){var e=arguments;return Si(this,arguments,void 0,function*(t=0,n=[],o=""){const i=no.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(ed)try{i.serviceWorker=!0;const e=yield yd("RecursiveSearchApiNewRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return no.logUpdate(i),e.data}catch(e){d(i,0,e),Td(e)}let e=new ui;e.composition=t,e.fullLinkers=n,e.textSearch=o;let s=JSON.stringify(e),c=yield Ie();const l=yield be(r.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(l.ok){const e=yield l.json();e.compositionIds,e.internalConnections,e.externalConnections;return no.logUpdate(i),e}return d(i,0,l.status),a(l),no.logUpdate(i),[]}catch(e){Error,l(e,r.RecursiveSearchUrl()),d(i,0,e)}})}var xi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const Ri=["image/jpeg","image/jpg","image/png","image/webp"],Oi=["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","text/plain","application/pdf"];function Di(e,t){return"function"==typeof e.get?e.get(t):void 0}function Ui(e,t){return xi(this,arguments,void 0,function*(e,t,n=""){try{const o=yield Te(null,n),i=yield be(e,{method:"POST",body:t,headers:o});if(!i.ok){yield i.text();return null}return yield i.json()}catch(e){return null}})}function Fi(e,t){if(t.fileName)return t.fileName;if("string"==typeof(null==e?void 0:e.name)&&e.name)return e.name;if("string"==typeof(null==e?void 0:e.uri)){const[t]=e.uri.split("?"),n=t.split("/").pop();if(n)return n}return"upload"}function Bi(e){return xi(this,void 0,void 0,function*(){if(function(e){return"undefined"!=typeof Blob&&e instanceof Blob}(e)||"string"==typeof e)return e;if(e instanceof ArrayBuffer)return e;if("string"==typeof(null==e?void 0:e.uri))try{const t=yield fetch(e.uri);if(t.ok)return yield t.blob()}catch(e){}return e})}function Mi(e,t){return xi(this,void 0,void 0,function*(){const n=no.logfunction("uploadAttachment");try{const o=Oi.includes(e.type)||e.name.toLowerCase().endsWith(".md"),i=Ri.includes(e.type);if(!o&&!i)return{message:"Invalid File Format",success:!1};const r=yield Vi(e,{},t),s=function(e){const t=null==e?void 0:e.data;return"string"==typeof t?t:t&&"string"==typeof t.url?t.url:"string"==typeof(null==e?void 0:e.url)?e.url:void 0}(r);return s?(no.logUpdate(n),{message:r.message||"Upload Success",success:!0,url:s}):{message:r.message||"File Upload Failed",success:!1}}catch(e){throw d(n,0,e),e}})}function Gi(e){return xi(this,arguments,void 0,function*(e,t=""){return Ui(r.uploadR2StorageUrl(),function(e){if(function(e,t){return"function"==typeof e.has&&e.has(t)}(e,"file"))return e;const t=Di(e,"image");return null!=t&&function(e,t){const n="object"==typeof t&&t?t.name:void 0;n?e.append("file",t,n):e.append("file",t)}(e,t),e}(e),t)})}function ji(e){return xi(this,arguments,void 0,function*(e,t=""){return function(e,t){return xi(this,arguments,void 0,function*(e,t,n=""){try{const o=yield be(e,{method:"POST",body:JSON.stringify(t),headers:yield Te("application/json",n)});return o.ok?yield o.json():(yield o.text(),null)}catch(e){return null}})}(r.r2PresignedUploadUrl(),e,t)})}function Wi(e,t,n){return xi(this,void 0,void 0,function*(){return fetch(e,{method:"PUT",headers:{"Content-Type":n},body:yield Bi(t)})})}function Vi(e){return xi(this,arguments,void 0,function*(e,t={},n=""){var o,i,r,s;const a=function(e,t){return t.contentType||(null==e?void 0:e.type)||"application/octet-stream"}(e,t),c=yield ji({fileName:Fi(e,t),contentType:a,folder:null!==(o=t.folder)&&void 0!==o?o:"",expiresInSeconds:null!==(i=t.expiresInSeconds)&&void 0!==i?i:900},n);if(!(null==c?void 0:c.success)||!(null===(r=c.data)||void 0===r?void 0:r.uploadUrl))return{message:null!==(s=null==c?void 0:c.message)&&void 0!==s?s:"Unable to create pre-signed R2 upload URL.",success:!1};const l=yield Wi(c.data.uploadUrl,e,c.data.contentType||a);if(!l.ok){let e="";try{e=yield l.text()}catch(t){e=""}return{message:`R2 upload failed with HTTP ${l.status}${e?`: ${e}`:""}`,success:!1,data:c.data}}return{message:"Upload Success",success:!0,url:c.data.publicUrl,data:c.data,eTag:l.headers.get("etag")}})}function qi(e){return xi(this,arguments,void 0,function*(e,t=""){const n=no.logfunction("uploadImage");try{const o=function(e){var t;return null!==(t=Di(e,"file"))&&void 0!==t?t:Di(e,"image")}(e);if(null==o)return no.logUpdate(n),{message:"Missing image file",success:!1};const i=yield Vi(o,{},t);return no.logUpdate(n),i}catch(e){return d(n,0,e),{message:"File Upload Failed",success:!1}}})}function $i(e){return xi(this,arguments,void 0,function*(e,t=""){const n=no.logfunction("uploadImageV2");try{const o=yield Ui(r.uploadImageUrlWithSmall(),e,t);return no.logUpdate(n),o}catch(e){return d(n,0,e),null}})}function Hi(e){return xi(this,arguments,void 0,function*(e,t=""){const n=no.logfunction("uploadFile");try{const o=yield Gi(e,t);return no.logUpdate(n),o}catch(e){return d(n,0,e),null}})}function zi(){return xi(this,void 0,void 0,function*(){let e=yield Ie(),t={};try{const n=yield be(r.UploadFileLimitUrl(),{method:"GET",headers:e});n.ok&&(t=yield n.json())}catch(e){throw e}return t})}var Ji=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Qi(e,t){var n=arguments;return Ji(this,arguments,void 0,function*(e,t,o="boomconsole.com"){const i=no.logfunction("LoginToBackend",n);try{let n={email:e,password:t,application:o},s=new Headers;s.append("Content-Type","application/json");let a=JSON.stringify(n);const l=yield fetch(r.LoginUrl(),{method:"POST",headers:s,body:a}),d=yield l.json();if(l.ok)return yield he.saveUserProfile(d),pd(he.BearerAccessToken,void 0,he.refreshToken),no.logUpdate(i),d;c(l,d)}catch(e){Error,l(e,r.LoginUrl()),d(i,0,e)}})}var Yi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ki(e){return Yi(this,void 0,void 0,function*(){const t=yield function(){return Yi(this,arguments,void 0,function*(e="",t={}){let n={message:"success",status:!1,statusCode:200,data:"cannot signup"};try{const o=yield fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(t)}),i=yield o.json();return o.ok?n={message:"success",status:!0,statusCode:200,data:i}:c(o,i),n}catch(t){l(t,e)}})}(r.SignupUrl(),e);return t})}function Zi(e){return Yi(this,void 0,void 0,function*(){const t=r.NODE_URL,n=yield fetch(`${t}/api/v1/entity/signup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok)return n.json();{if(404===n.status)throw new Error("404, Not found");if(500===n.status)throw new Error("500, internal server error");let e=yield n.json();throw new Error(e.message)}})}var Xi=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function er(e){return Xi(this,void 0,void 0,function*(){const t=JSON.stringify({email:e.email,password:e.password});let n={message:"success",status:!1,statusCode:200,data:""};const o=new Headers;o.append("Content-Type","application/json");const i=r.LoginUrl();try{const e=yield fetch(i,{method:"POST",headers:o,body:t,redirect:"follow"}),r=yield e.json();if(e.ok){const e=null==r?void 0:r.data;n={message:"success",status:!0,statusCode:200,data:e},pd(e.token)}else c(e,r);return n}catch(e){l(e,i)}})}function tr(e,t){return-1===e.indexOf(t)&&e.push(t),e}function nr(e=[],t){var n,o;let i=[],r=null===(n=t.type)||void 0===n?void 0:n.characterValue;if((null==r?void 0:r.startsWith("the_"))||(r="the_"+r),Array.isArray(e))for(let n=0;n<e.length;n++){let s=null===(o=e[n].type)||void 0===o?void 0:o.characterValue;(null==s?void 0:s.startsWith("the_"))||(s="the_"+s),t.typeId!=e[n].typeId&&r!=s||i.push(e[n])}return i}function or(e=[],t){let n=[],o=t.typeCharacter;if((null==o?void 0:o.startsWith("the_"))||(o="the_"+o),Array.isArray(e))for(let i=0;i<e.length;i++){let r=e[i].typeCharacter;(null==r?void 0:r.startsWith("the_"))||(r="the_"+r),t.typeId!=e[i].typeId&&o!=r||n.push(e[i])}return n}function ir(e=[],t){let n=[];if(Array.isArray(e)){const o=e.find(e=>e.toTheConceptId==t);o&&n.push(o);const i=e.find(e=>e.ofTheConceptId==t);i&&n.push(i)}return n}function rr(e=[],t){let n=[];if(Array.isArray(e)){const o=e.find(e=>e.toTheConceptId==t);o&&n.push(o);const i=e.find(e=>e.ofTheConceptId==t);i&&n.push(i)}return n}function sr(e=[],t){Array.isArray(e)&&e.splice(e.findIndex(function(e){return e.id===t.id}),1)}function ar(e=[],t){Array.isArray(e)&&e.splice(e.findIndex(function(e){return e.id===t.id}),1)}class cr{constructor(e,t,n,o){this.expiryTime=new Date(Date.now()+6e5),this.height=1,this.key=e,this.value=t,this.leftNode=n,this.rightNode=o}isValid(){const e=new Date(Date.now());return!(this.expiryTime<e)||(dr.removeNodeFromTree(this.key),!1)}saveToCache(e){this.value.cached=e}addNode(e,t,n){if(null==t)return t=e;const o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return this.isValid(),t=e;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));const r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return this.isValid(),t}rightRotate(e){if(e){const t=e.leftNode;if(t){const n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){const t=e.rightNode;if(t){const n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key&&t.isValid()?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){const t=e.rightNode;return e=null,t}if(null==e.rightNode){const t=e.leftNode;return e=null,t}{const t=this.inOrderSuccessor(e.rightNode);return e.value=t.value,e.key=t.key,e.rightNode=this.removeNode(e.rightNode,t.key),e}}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var lr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class dr{static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static addCompositionToTree(e){const t=new cr(e.id,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return lr(this,void 0,void 0,function*(){if(this.root){return this.root.getFromNode(e,this.root)}return null})}static removeNodeFromTree(e){return lr(this,void 0,void 0,function*(){this.root&&(this.root=this.root.removeNode(this.root,e))})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}dr.root=null;var ur=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function hr(e,t,n,o){return ur(this,arguments,void 0,function*(e,t,n,o,i=[]){var r,s;let a={};const c=[];if(0==e)return"";let l=pr(n,e);if((null==l||0==l.id)&&null!=e&&null!=e){l=yield on(e)}if(0!=l.id&&null==l.type){const e=l.typeId;let t=pr(n,e);if(l.type=t,null==t&&null!=e&&null!=e){t=yield on(e),l.type=t}}if(!o.includes(e))return null==l?void 0:l.characterValue;if(i.includes(e))return"";i.push(e);for(let l=0;l<t.length;l++)if(t[l].ofTheConceptId==e){const d=t[l].toTheConceptId;if(o.includes(e)){let e=pr(n,d);if((null==e||0==e.id)&&null!=d&&null!=d){e=yield on(d)}if(0!=e.id&&null==(null==e?void 0:e.type)){const t=e.typeId;let n=yield U.GetConcept(t);if(e.type=n,null==n&&null!=t&&null!=t){n=yield on(t),e.type=n}}const l="the_",u=(null!==(s=null===(r=null==e?void 0:e.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"").replace(l,"");if(isNaN(Number(u))){if(u){const e=yield hr(d,t,n,o,i);a[u]=e}}else{const e=yield hr(d,t,n,o,i);c[u]=e,a=c}}}return a})}function pr(e,t){let n=S();for(let o=0;o<e.length;o++)if(t==e[o].id)return n=e[o],n;return n}var fr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class yr{constructor(){this.id=0,this.mainConcept=S(),this.connections=[],this.concepts=[],this.subcompositions=[],this.cached={}}updateCache(){return fr(this,void 0,void 0,function*(){if(0==this.mainConcept.id)for(let e=0;e<this.concepts.length;e++)this.concepts[e].id==this.id&&(this.mainConcept=this.concepts[e]);this.cached=yield hr(this.id,this.connections,this.concepts,this.subcompositions,[])})}UpdateAcrossDistributedSystem(){var e,t,n;try{0!=this.id&&(t="compositionUpdate",n=null===(e=this.id)||void 0===e?void 0:e.toString(),r.MQTT_CONNECTION&&r.MQTT_CONNECTION.publish(t,n))}catch(e){}}isUpdating(){this.UpdateAcrossDistributedSystem()}GetDataCache(){var e,t,n;const o={};o[null!==(n=null===(t=null===(e=this.mainConcept)||void 0===e?void 0:e.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=this.cached;const i={};return i.data=o,i.id=this.id,i}}var mr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function vr(e){return mr(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null,a=null){const c=null!=i?i:999,l=null!=r?r:4,d=null!=s?s:999;let u=null!=o?o:0,h=S();null==a&&(a=new yr);for(const o in e)if("object"==typeof e[o]||Array.isArray(e[o])){const p=yield Hn(o,"",!0,c,l,d);if(null==t&&null==n){let t=u;h=p,t=p.id,u=p.id,a.concepts.push(p),a.id=p.id,yield vr(e[o],p.id,p.userId,t,i,r,s,a)}else{const c=null!=t?t:999,l=null!=n?n:999,d=u;h=p,a.concepts.push(p);const f=yield xn(c,l,p.id,d);a.connections.push(f),yield vr(e[o],p.id,p.userId,d,i,r,s,a)}null!=e[o]&&null!=e[o]&&a.subcompositions.push(p.id)}else{const i=null!=t?t:999,r=null!=n?n:999,s=u,h=yield Hn(o,e[o],!1,c,l,d);a.concepts.push(h);const p=yield xn(i,r,h.id,s);a.connections.push(p)}return h})}var gr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Cr(e){return gr(this,void 0,void 0,function*(){const t=no.logfunction("UpdateComposition")||{};if(ed){t.serviceWorker=!0;try{const n=yield yd("UpdateComposition",{patcherStructure:e});return no.logUpdate(t),n.data}catch(e){d(t,0,e),Td(e)}}const n=e.userId,o=e.sessionId,i=e.accessId;let r=[];const s=[];let a=S(),c=S();const l=[];let u=e.compositionId;const h=e.ofTheCompositionId;let p=[];if(u<0){let e=yield on(u,n);if(!(e.id>0))return null;u=e.id}r=yield Ut(u);const f=[],y=new yr,m=[];y.id=u,y.isUpdating();let v=[];for(let e=0;e<r.length;e++)tr(m,r[e].ofTheConceptId),tr(f,r[e].ofTheConceptId),tr(f,r[e].toTheConceptId),v.push(r[e].ofTheConceptId);y.subcompositions=m,y.connections=r;for(let e=0;e<f.length;e++){const t=yield on(f[e]);u==f[e]&&(a=t),h==f[e]&&(c=t),s.push(t)}const g=e.patchObject;for(const e in g){let t=S();const r=g[e];let d=a;if(c.id>0&&(d=c),Array.isArray(r)||"object"==typeof r){t=yield Hn(e,"",!0,a.userId,4,999),y.subcompositions.push(t.id);const n=nr(s,t);for(let e=0;e<n.length;e++)if(n[e].id>0){const t=ir(y.connections,n[e].id);p=p.concat(t),l.push(n[e])}yield vr(g[e],t.id,t.userId,a.id,a.userId,4,999,y)}else{t=yield Hn(e,r,!1,n,i,o);const a=nr(s,t);for(let e=0;e<a.length;e++)if(a[e].id>0){const t=ir(y.connections,a[e].id);p=p.concat(t),l.push(a[e])}}const u=xn(d.id,d.userId,t.id,a.id);s.push(t),y.connections.push(u)}for(let e=0;e<p.length;e++)ar(y.connections,p[e]),ko(p[e].id);for(let e=0;e<l.length;e++)sr(s,l[e]);y.concepts=y.concepts.concat(s),y.mainConcept=a,y.id=a.id,yield y.updateCache(),dr.addCompositionToTree(y),Ln.SyncDataOnline();let C=y.GetDataCache();return no.logUpdate(t),C})}var wr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ir(e,t,n,o){return wr(this,arguments,void 0,function*(e,t,n,o,i=10,s=1){var c=yield Te("application/x-www-form-urlencoded",o),d=new URLSearchParams;d.append("type",e),d.append("search",t),d.append("composition",n),d.append("inpage",i.toString()),d.append("page",s.toString());const u=r.SearchCompositionsUrl()+"?"+d.toString();try{const e=yield be(u,{method:"GET",headers:c});if(e.ok){return yield e.json()}return a(e),[]}catch(e){l(e,u)}})}var Tr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function kr(e){return Tr(this,arguments,void 0,function*(e,t=""){var n=yield Te("application/json",t);const o=r.SearchLinkMultipleAll(),i=JSON.stringify(e);try{const e=yield be(o,{method:"POST",headers:n,body:i});if(e.ok){return yield e.json()}return a(e),[]}catch(e){l(e,o)}})}var br=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ar(e){return br(this,arguments,void 0,function*(e,t=[]){var n,o;let i=[];const r=[];let s={},a={};const c=yield dr.getNodeFromTree(e),l=[];let d=yield U.GetConcept(e);if(0==d.id&&null!=e&&null!=e){d=yield Ot(e)}if(null==c){let c=[];c=t.length>0?Sr(e,t):yield Ut(e),i=c;for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||(l.push(i[e].ofTheConceptId),r.push(i[e].ofTheConceptId)),r.includes(i[e].toTheConceptId)||r.push(i[e].toTheConceptId);Pr(d,i,r,l);let u=[];a=yield Zt(e,i,l,u);s[null!==(o=null===(n=null==d?void 0:d.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=a}else a=c.value.GetDataCache(),s=a;return 0==d.id?"":s})}function Sr(e,t){const n=[];for(let o=0;o<t.length;o++)t[o].typeId==e&&n.push(t[o]);return n}function Nr(e){return br(this,arguments,void 0,function*(e,t=[]){var n,o;let i={},r=[];const s=[];let a;const c={},l=yield dr.getNodeFromTree(e),d=[];let u=yield U.GetConcept(e);if(0==u.id&&null!=e&&null!=e){u=yield Ot(e)}if(null==l){let l=[];l=t.length>0?Sr(e,t):yield Ut(e),r=l;for(let e=0;e<r.length;e++)d.includes(r[e].ofTheConceptId)||(d.push(r[e].ofTheConceptId),s.push(r[e].ofTheConceptId)),s.includes(r[e].toTheConceptId)||s.push(r[e].toTheConceptId);Pr(u,r,s,d),a=yield Zt(e,r,d);c[null!==(o=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=a,i.created_at=u.entryTimeStamp,i.data=c,i.id=e}else a=l.value.GetDataCache(),i=a;return 0==u.id?"":i})}function _r(e,t){return br(this,void 0,void 0,function*(){let n=[];const o=[];n=yield pi(t);for(let t=0;t<e.length;t++){const i=yield Nr(e[t],n);i&&o.push(i)}return o})}function Pr(e,t,n,o){return br(this,void 0,void 0,function*(){const i=new yr,s=yield function(e){return br(this,void 0,void 0,function*(){let t=[];const n=[];for(let o=0;o<(null==e?void 0:e.length);o++){const i=yield U.GetConcept(e[o]);0==i.id?n.push(e[o]):t.push(i)}return 0==(null==n?void 0:n.length)||(t=yield function(e){return Ze(this,void 0,void 0,function*(){const t=[];if(e.length>0){const n=yield Ie("application/json");try{const o=yield be(r.GetConceptBulkUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(o.ok){const e=yield o.json();if(e.length>0)for(let n=0;n<e.length;n++){const o=e[n];t.push(o),U.AddConcept(o)}}else a(o)}catch(e){Error,l(e,r.GetConceptBulkUrl())}}return t})}(n)),t})}(n);i.connections=t,i.concepts=s,i.id=e.id,i.subcompositions=o,i.mainConcept=e;const c=yield hr(e.id,t,s,o,[]);i.cached=c,dr.addCompositionToTree(i)})}var Er=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Lr(e){return Er(this,void 0,void 0,function*(){try{var t=yield Ie();const n=JSON.stringify(e),o=yield be(r.CreateSessionId(),{method:"POST",headers:t,body:n});return o.ok?o.json():(a(o),null)}catch(e){l(e,r.CreateSessionId())}})}var xr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Rr(e,t){return xr(this,void 0,void 0,function*(){try{var n=yield Ie("application/x-www-form-urlencoded");const o=new URLSearchParams;o.append("sessionId",e.toString()),o.append("url",t);const i=yield be(r.CreateSessionVisitUrl(),{method:"POST",headers:n,body:o});return i.ok?i.json():(a(i),null)}catch(e){l(e,r.CreateSessionVisitUrl())}})}var Or=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Dr(e,t,n){return Or(this,arguments,void 0,function*(e,t,n,o=10,i=1){let s=[];try{var c=new URLSearchParams;c.append("typeId",`${e}`),c.append("toTheConceptId",`${t}`),c.append("userId",`${n}`),c.append("inpage",`${o}`),c.append("page",`${i}`);var l=yield Ie("application/x-www-form-urlencoded");const d=yield be(r.GetAllConnectionsToConceptUrl(),{method:"POST",headers:l,body:c});return d.ok?s=yield d.json():a(d),s}catch(e){throw Error,e}})}var Ur=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Fr(e,t){var n=arguments;return Ur(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=no.logfunction("GetRelation",n)||{};if(ed){s.serviceWorker=!0;try{const n=yield yd("GetRelation",{id:e,relation:t,inpage:o,page:i,reverse:r});return no.logUpdate(s),n.data}catch(e){d(s,0,e),Td(e)}}let a=[],c=yield on(e),l=yield Mo(t),u=[];if(l.id>0)if(r){u=yield Dr(l.id,c.id,c.userId,o,i);let e=[];for(var h=0;h<u.length;h++)e.push(u[h].ofTheConceptId);yield rt(e);for(let e=0;e<u.length;e++){let t=u[e].ofTheConceptId,n=yield on(t),o=yield Jt(n.id);a.push(o)}}else{u=yield vo(l.id,c.id,c.userId,o,i);let e=[];for(let t=0;t<u.length;t++)e.push(u[t].toTheConceptId);yield rt(e);for(let e=0;e<u.length;e++){let t=u[e].toTheConceptId,n=yield on(t),o=yield Jt(n.id);a.push(o)}}return no.logUpdate(s),a})}function Br(e,t){return Ur(this,arguments,void 0,function*(e,t,n=10,o=1,i=!1){let r=new Nc;return r.conceptIds=[e],r.selectors=[t],r.outputFormat=zr,r.inpage=n,r.page=o,r.limit=!0,yield Rc(r,"")})}function Mr(e,t){var n=arguments;return Ur(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=no.logfunction("GetRelationRaw",n)||{};if(ed){s.serviceWorker=!0;try{const n=yield yd("GetRelationRaw",{id:e,relation:t,inpage:o,page:i,reverse:r});return no.logUpdate(s),n.data}catch(e){d(s,0,e),Td(e)}}let a=[],c=yield on(e),l=yield Mo(t),u=[],h=[];if(l.id>0){if(r){u=yield Dr(l.id,c.id,c.userId,o,i);for(var p=0;p<u.length;p++)h.push(u[p].ofTheConceptId)}else{u=yield vo(l.id,c.id,c.userId,o,i);for(let e=0;e<u.length;e++)h.push(u[e].toTheConceptId)}a=yield Xe(h)}return no.logUpdate(s),a})}class Gr{constructor(e,t,n,o){this.value=[],this.height=1,this.key=e,this.value.push(t),this.leftNode=n,this.rightNode=o}addNode(e,t,n){if(null==t)return t=e;var o=t.leftNode,i=t.rightNode;if(t.key>e.key)t.leftNode=this.addNode(e,o,n);else{if(!(t.key<e.key))return t.value.push(...e.value),t;t.rightNode=this.addNode(e,i,n)}t.height=1+Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let r=this.getBalanceFactor(t);if(r>1&&t.leftNode){if(e.key<t.leftNode.key)return this.rightRotate(t);if(e.key>t.leftNode.key)return t.leftNode=this.leftRotate(t.leftNode),this.rightRotate(t)}if(r<-1&&t.rightNode){if(e.key>t.rightNode.key)return this.leftRotate(t);if(e.key<t.rightNode.key)return t.rightNode=this.rightRotate(t.rightNode),this.leftRotate(t)}return t}rightRotate(e){if(e){let t=e.leftNode;if(t){let n=t.rightNode;return e.leftNode=n,t.rightNode=e,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(t.rightNode))+1,t}}return e}leftRotate(e){if(e){let t=e.rightNode;if(t){let n=t.leftNode;return t.leftNode=e,e.rightNode=n,e.height=Math.max(this.getHeight(e.leftNode),this.getHeight(e.rightNode))+1,t.height=Math.max(this.getHeight(t.leftNode),this.getHeight(e.rightNode))+1,t}}return e}getHeight(e){return e?e.height:0}getBalanceFactor(e){return null==e?0:this.getHeight(e.leftNode)-this.getHeight(e.rightNode)}getFromNode(e,t){return t?e==t.key?t:e<t.key?this.getFromNode(e,t.leftNode):e>t.key?this.getFromNode(e,t.rightNode):t:t}removeNode(e,t){if(null==e)return e;if(e.key>t)return e.leftNode=this.removeNode(e.leftNode,t),e;if(e.key<t)return e.rightNode=this.removeNode(e.rightNode,t),e;if(null==e.leftNode){let t=e.rightNode;return e=null,t}if(null==e.rightNode){let t=e.leftNode;return e=null,t}var n=this.inOrderSuccessor(e.rightNode);return e.value=n.value,e.key=n.key,e.rightNode=this.removeNode(e.rightNode,n.key),e}countNodeBelow(e){return null==e?0:1+this.countNodeBelow(e.leftNode)+this.countNodeBelow(e.rightNode)}inOrderSuccessor(e){for(;null!=e.leftNode;)e=e.leftNode;return e}}var jr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Wr{static compositeKey(e,t){return("0000"+e.toString(16).toUpperCase()).slice(-4)+("0000"+t.toString(16).toUpperCase()).slice(-4)}static addNodeToTree(e){if(null==this.root)return this.root=e,this.root;this.root=this.root.addNode(e,this.root,this.root.height)}static waitForDataToLoad(){return jr(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.checkFlag(e),setTimeout(()=>{t("not")},25e3)})})}static checkFlag(e){if(C.isDataLoaded)return e("done");setTimeout(Wr.checkFlag,1e3,e)}static addConceptToTree(e,t,n=999){let o=this.compositeKey(t,n);var i=new Gr(o,e,null,null);this.addNodeToTree(i)}static getNodeFromTree(e,t){return jr(this,void 0,void 0,function*(){let n=this.compositeKey(e,t);return this.root?this.root.getFromNode(n,this.root):null})}static removeNodeFromTree(e){return jr(this,arguments,void 0,function*(e,t=999){if(this.root){let n=this.compositeKey(e,t);this.root=this.root.removeNode(this.root,n)}})}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}Wr.root=null;var Vr=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function qr(e,t){return Vr(this,arguments,void 0,function*(e,t,n=999){let o=yield Wr.getNodeFromTree(e,n),i=pt();if(o)for(let e=0;e<o.value.length;e++){let n=o.value[e];n.ghostId==t&&(i=n)}return i})}function $r(e,t){return Vr(this,arguments,void 0,function*(e,t,n=999){Wr.addConceptToTree(e,t,n)})}const Hr=1,zr=2,Jr=3,Qr=4,Yr=5,Kr=6,Zr=7,Xr=8;function es(e){return e.startsWith("the_")?e.slice(4):e}var ts=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ns(e,t,n){return ts(this,void 0,void 0,function*(){var o,i,r,s,a,c,l,d;let u=[];for(let t=0;t<e.length;t++)u.push(e[t].toTheConceptId),u.push(e[t].ofTheConceptId),u.push(e[t].typeId);for(let u=0;u<e.length;u++){let h=!1;n.includes(e[u].id)&&(h=!0);let p=yield on(e[u].ofTheConceptId),f=yield on(e[u].toTheConceptId);if(1==h&&0!=p.id&&0!=f.id){let n,a=null!==(i=null===(o=f.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:"self";e[u].toTheConceptId in t?n=t[e[u].toTheConceptId]:(n={},n[a]={},t[e[u].toTheConceptId]=n);let c=yield on(e[u].typeId);try{let e=null!==(s=null===(r=null==p?void 0:p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"none",n=p.characterValue;c.characterValue;c.characterValue.includes("_s_")&&(p.id in t||(t[p.id]={}),t[p.id][e]=n),t[f.id]={}}catch(e){}}if(0!=p.id&&0!=f.id){let n,o=null!==(c=null===(a=p.type)||void 0===a?void 0:a.characterValue)&&void 0!==c?c:"self";e[u].ofTheConceptId in t?n=t[e[u].ofTheConceptId]:(n={},n[o]={},t[e[u].ofTheConceptId]=n);let i=yield on(e[u].typeId);try{let e=null!==(d=null===(l=null==f?void 0:f.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"none",n=f.characterValue;i.characterValue.includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[p.id]={}}catch(e){}}}return t})}var os=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function is(e,t,n){if(e in t){let o=t[e];if(o){n[o.connectionType+"_count"]=o.count}}}var rs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class ss{constructor(){this.conceptId=0,this.connectionTypeId=0,this.connectionType="",this.count=0}}var as=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function cs(e=[]){let t=[];if(e.length>0)for(let n=0;n<e.length;n++){let o=ds(e[n]);t.push(o)}return t}function ls(e){var t=arguments;return as(this,void 0,void 0,function*(){const n=no.logfunction("GetConnectionTypeForCount",t);let o={};for(let t=0;t<e.length;t++){let n=yield Ot(e[t].connectionTypeId);e[t].connectionType=n.characterValue,o[e[t].conceptId]=e[t]}return no.logUpdate(n),o})}function ds(e){const t=e.split("_");if(3===t.length){let e=new ss;return e.conceptId=Number(t[0]),e.connectionTypeId=Number(t[1]),e.count=Number(t[2]),e}throw new Error("Input string must contain exactly three parts separated by underscores.")}function us(e,t="DESC"){return"ASC"==t?e.sort(function(e,t){return e.id-t.id}):e.sort(function(e,t){return t.id-e.id}),e}var hs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var ps=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function fs(e,t){return ps(this,arguments,void 0,function*(e,t,n=""){let o=yield aa(e,t,n),i=o.compositionIds,r=o.internalConnections,s=o.linkers,a=o.reverse,c=o.mainCompositionIds,l=yield Ti(s),d=yield bi(i,r);return yield bs(l,d,c,a)})}function ys(e,t,n,o,i){return ps(this,void 0,void 0,function*(){let r=yield Ti(e),s=yield ki(t,n),a=yield function(e,t,n,o){return Is(this,arguments,void 0,function*(e,t,n,o,i=[]){(new Date).getTime();let r=[],s=[];for(let t=0;t<e.length;t++)s.push(e[t].toTheConceptId),s.push(e[t].ofTheConceptId),s.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let o=!1;if(i.includes(e[n].id)&&(o=!0),1==o){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield on(e[n].typeId),r=null==o?void 0:o.data,s=Object.keys(r)[0];try{let o=i.characterValue+"_reverse";"string"==typeof r&&(r={}),Array.isArray(r[s][o])||("string"==typeof r[s]&&(r[s]={}),r[s][o]=[]),r[s][o].push(t[e[n].ofTheConceptId])}catch(e){}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield on(e[n].typeId),r=null==o?void 0:o.data,s=Object.keys(r)[0];try{"string"==typeof r&&(r={}),Array.isArray(r[s][i.characterValue])||("string"==typeof r[s]&&(r[s]={}),r[s][i.characterValue]=[]),r[s][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){}}}for(let e=0;e<o.length;e++){let n=t[o[e]];n&&r.push(n)}return r})}(r,s,t,o,i);return a})}function ms(e,t,n,o,i){return ps(this,void 0,void 0,function*(){let r=yield Ti(e),s=yield Ai(t,n);return yield bs(r,s,o,i)})}function vs(e,t,n,o,i){return ps(this,void 0,void 0,function*(){if(ed)try{return(yield yd("formatConnections",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:o,countInfos:i})).data}catch(e){Td(e)}let r=yield Ti(e);r=us(r);let s=[];s=yield ns(r,s,o),s=yield function(e,t,n){return ts(this,void 0,void 0,function*(){var o,i,r,s,a,c,l,d;let u=[];for(let t=0;t<e.length;t++)u.push(e[t].toTheConceptId),u.push(e[t].ofTheConceptId),u.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let u=0;u<e.length;u++){let h=!1;n.includes(e[u].id)&&(h=!0);let p=yield on(e[u].ofTheConceptId),f=yield on(e[u].toTheConceptId);if(1==h&&0!=p.id&&0!=f.id){let n,a=null!==(i=null===(o=f.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:"self";e[u].toTheConceptId in t?(n=t[e[u].toTheConceptId],a in n||(n[a]={})):(n={},n[a]={},t[e[u].toTheConceptId]=n);let c=yield on(e[u].typeId);try{let e=null!==(s=null===(r=null==p?void 0:p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"none",t=p.characterValue,o=c.characterValue;""==o&&(o=e,o=es(o));let i={[e]:t},l=o+"_reverse";c.characterValue.includes("_s_")||("string"==typeof n[a]&&(n[a]={}),n[a][l]=i)}catch(e){}}if(0!=p.id&&0!=f.id){let n,o=null!==(c=null===(a=p.type)||void 0===a?void 0:a.characterValue)&&void 0!==c?c:"self";e[u].ofTheConceptId in t?(n=t[e[u].ofTheConceptId],o in n||(n[o]={})):(n={},n[o]={},t[e[u].ofTheConceptId]=n);let i=yield on(e[u].typeId);try{let e=null!==(d=null===(l=null==f?void 0:f.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"none",t=f.characterValue,r=i.characterValue,s=(i.characterValue,!1);""==r&&(r=e,r=es(r),s=!0);let a={[e]:t};isNaN(Number(r))?i.characterValue.includes("_s_")||("string"==typeof n[o]&&(n[o]={}),n[o][r]=s?t:a):(Array.isArray(n[o])||(n[o]=[]),n[o].push(t))}catch(e){}}}return t})}(r,s,o);let a=yield function(e,t,n,o){return ts(this,arguments,void 0,function*(e,t,n,o,i=[]){var r,s,a,c,l,d;let u=[],h=[];for(let t=0;t<e.length;t++)h.push(e[t].toTheConceptId),h.push(e[t].ofTheConceptId),h.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let o=!1;i.includes(e[n].id)&&(o=!0);let u=yield on(e[n].ofTheConceptId),h=yield on(e[n].toTheConceptId);if(1==o&&0!=u.id&&0!=h.id&&h.id in t){let o,i=null!==(s=null===(r=h.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self";e[n].toTheConceptId in t?o=t[e[n].toTheConceptId]:(o={},o[i]={},t[e[n].toTheConceptId]=o);let a=yield on(e[n].typeId);try{let r=a.characterValue+"_reverse",s=t[e[n].ofTheConceptId];s&&(Array.isArray(o[i][r])?o[i][r].push(s):a.characterValue.includes("_s_")?(o[i][r]=[],o[i][r].push(s)):o[i][r]=s)}catch(e){}}if(0!=u.id&&0!=h.id&&u.id in t){let o,i=null!==(c=null===(a=u.type)||void 0===a?void 0:a.characterValue)&&void 0!==c?c:"self";e[n].ofTheConceptId in t?(o=t[e[n].ofTheConceptId],"string"==typeof o[i]&&(o[i]={})):(o={},o[i]={},t[e[n].ofTheConceptId]=o);let r=!1,s=(yield on(e[n].typeId)).characterValue;""==s&&(s=h.characterValue,r=!0),""==s&&(s=null!==(d=null===(l=null==h?void 0:h.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"");try{let a=t[e[n].toTheConceptId];a&&(Array.isArray(o[i])?r?o[i].push(a[s]):o[i].push(a):Array.isArray(o[i][s])?o[i][s].push(a):s.includes("_s_")?(o[i][s]=[],r?o[i][s].push(a[s]):o[i][s].push(a)):o[i][s]=r?a[s]:a)}catch(e){}}}for(let e=0;e<n.length;e++){let o=t[n[e]];o?(o.id=n[e],u.push(o)):0!=(yield U.GetConcept(n[e])).id&&(o={},o.id=n[e],u.push(o))}return u})}(r,s,n,[],o);return a})}function gs(e,t,n,o,i){return ps(this,arguments,void 0,function*(e,t,n,o,i,r="DESC"){if(ed)try{return(yield yd("formatConnectionsJustId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:o,countInfos:i,order:r})).data}catch(e){Td(e)}let s=yield Ti(e),a=yield ls(i);s=us(s,r);let c=[];c=yield ns(s,c,o),c=yield function(e,t){return os(this,arguments,void 0,function*(e,t,n=[]){var o,i,r,s,a,c,l,d;let u=[];for(let t=0;t<e.length;t++)u.push(e[t].toTheConceptId),u.push(e[t].ofTheConceptId),u.push(e[t].typeId);for(let u=0;u<e.length;u++){let h=!1,p=yield on(e[u].ofTheConceptId),f=yield on(e[u].toTheConceptId);if(n.includes(e[u].id)&&(h=!0),1==h&&0!=p.id&&0!=f.id){let n,a=yield on(e[u].typeId),c=null!==(i=null===(o=f.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:"self";e[u].toTheConceptId in t?(n=t[e[u].toTheConceptId],c in n||(n[c]={})):(n={},n[c]={},t[e[u].toTheConceptId]=n);try{let t=null!==(s=null===(r=null==p?void 0:p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"none",o=p.characterValue,i=a.characterValue;""==i&&(i=t,i=es(i));let l={id:p.id,[t]:o,created_on:e[u].entryTimeStamp},d=i+"_reverse";d.includes("_s_")||("string"==typeof n[c]&&(n[c]={}),n[c][d]=l)}catch(e){}}if(0!=p.id&&0!=f.id){let n,o=yield on(e[u].typeId),i=null!==(c=null===(a=p.type)||void 0===a?void 0:a.characterValue)&&void 0!==c?c:"self";e[u].ofTheConceptId in t?(n=t[e[u].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[u].ofTheConceptId]=n);try{let t=null!==(d=null===(l=null==f?void 0:f.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"none",r=f.characterValue,s=o.characterValue,a=!1;""==s&&(s=t,s=es(s),a=!0);let c={};c[t]={id:f.id,data:r,created_on:e[u].entryTimeStamp},isNaN(Number(s))?s.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][s]=a?c[t]:c):(Array.isArray(n[i])||(n[i]=[]),n[i].push(c[t]))}catch(e){}}}return t})}(s,c,o);let l=yield function(e,t,n){return os(this,arguments,void 0,function*(e,t,n,o=[],i){var r,s,a,c,l,d,u;(new Date).getTime();let h=[],p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);for(let n=0;n<e.length;n++){let h=!1,p=yield on(e[n].ofTheConceptId),f=yield on(e[n].toTheConceptId);if(o.includes(e[n].id)&&(h=!0),1==h&&0!=p.id&&0!=f.id&&f.id in t){let o,i=yield on(e[n].typeId),a=null!==(s=null===(r=f.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self",c=!1;e[n].toTheConceptId in t&&(c=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[a]&&(o[a]={})):(o={},o[a]={},t[e[n].toTheConceptId]=o);try{if(t[e[n].ofTheConceptId]){let r=t[e[n].ofTheConceptId];r&&(r.id=p.id,r.created_on=p.entryTimeStamp);let s=i.characterValue+"_reverse";Array.isArray(o[a][s])?o[a][s].push(r):s.includes("_s_")?(o[a][s]=[],o[a][s].push(r)):o[a][s]=r}}catch(e){}}if(0!=p.id&&0!=f.id&&p.id in t){let o,r=yield on(e[n].typeId),s=null!==(c=null===(a=p.type)||void 0===a?void 0:a.characterValue)&&void 0!==c?c:"self",h=!1;e[n].toTheConceptId in t&&(h=!0),e[n].ofTheConceptId in t?(o=t[e[n].ofTheConceptId],"string"==typeof o[s]&&(o[s]={})):(o={},o[s]={},t[e[n].ofTheConceptId]=o),is(p.id,i,o);let y=!1,m=r.characterValue;""==m&&(m=f.characterValue,y=!0),""==m&&(m=(null===(l=null==f?void 0:f.type)||void 0===l?void 0:l.characterValue)||"");try{let r=null!==(u=null===(d=null==f?void 0:f.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"none",a=t[e[n].toTheConceptId];if(a){let t={};t[r]={data:a[r],id:f.id,created_on:e[n].entryTimeStamp},Array.isArray(o[s])?y?o[s].push(a[m]):o[s].push(a):Array.isArray(o[s][m])?o[s][m].push(t):m.includes("_s_")?(o[s][m]=[],y?o[s][m].push(t[r]):o[s][m].push(t)):o[s][m]=y?t[r]:t,is(f.id,i,t)}}catch(e){}}}for(let e=0;e<n.length;e++){let o={};o=t[n[e]],o?o.id=n[e]:0!=(yield U.GetConcept(n[e])).id&&(o={},o.id=n[e]),h.push(o)}return h})}(s,c,n,o,a);return l})}function Cs(e,t,n,o,i){return ps(this,arguments,void 0,function*(e,t,n,o,i,r="DESC"){try{if(ed)try{return(yield yd("formatConnectionsDataId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:o,countInfos:i,order:r})).data}catch(e){Td(e)}let s,a;try{s=yield Ti(e)}catch(e){throw new Error(`Failed to prefetch connections: ${e instanceof Error?e.message:String(e)}`)}try{a=yield ls(i)}catch(e){throw new Error(`Failed to get connection type for count: ${e instanceof Error?e.message:String(e)}`)}try{s=us(s,r)}catch(e){throw new Error(`Failed to order connections: ${e instanceof Error?e.message:String(e)}`)}let c,l=[],d=[];try{l=yield function(e,t){var n=arguments;return rs(this,arguments,void 0,function*(e,t,o=[]){var i,r,s,a,c,l,d,u;try{const h=no.logfunction("FormatFunctionData",n);let p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);for(let n=0;n<e.length;n++)try{let h=!1,p=yield on(e[n].ofTheConceptId),f=yield on(e[n].toTheConceptId);if(o.includes(e[n].id)&&(h=!0),1==h&&0!=p.id&&0!=f.id){let o,c=yield on(e[n].typeId),l=null!==(r=null===(i=f.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self";e[n].toTheConceptId in t?o=t[e[n].toTheConceptId]:(o={},o[l]={},t[e[n].toTheConceptId]=o);try{let e=null!==(a=null===(s=null==p?void 0:p.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"none",n=p.characterValue;(c.characterValue+"_reverse").includes("_s_")&&(p.id in t||(t[p.id]={}),t[p.id][e]=n),t[f.id]={}}catch(e){}}if(0!=p.id&&0!=f.id){let o,i=yield on(e[n].typeId),r=null!==(l=null===(c=p.type)||void 0===c?void 0:c.characterValue)&&void 0!==l?l:"self";e[n].ofTheConceptId in t?o=t[e[n].ofTheConceptId]:(o={},o[r]={},t[e[n].ofTheConceptId]=o);try{let e=null!==(u=null===(d=null==f?void 0:f.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"none",n=f.characterValue;i.characterValue.includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[p.id]={}}catch(e){}}}catch(e){}return no.logUpdate(h),t}catch(e){throw e}})}(s,l,o)}catch(e){throw new Error(`Failed to format function data: ${e instanceof Error?e.message:String(e)}`)}try{l=yield function(e){var t=arguments;return rs(this,arguments,void 0,function*(e,n=[],o=[]){var i,r,s,a,c,l,d,u;try{const h=no.logfunction("FormatFunctionDataForData",t);let p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.push(e[t].typeId);for(let t=0;t<e.length;t++)try{let h=!1,p=yield on(e[t].ofTheConceptId),f=yield on(e[t].toTheConceptId);if(o.includes(e[t].id)&&(h=!0),1==h&&0!=p.id&&0!=f.id){let o,c=yield on(e[t].typeId),l=null!==(r=null===(i=f.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self";e[t].toTheConceptId in n?(o=n[e[t].toTheConceptId],l in o||(o[l]={})):(o={},o[l]={},n[e[t].toTheConceptId]=o);try{let e=null!==(a=null===(s=null==p?void 0:p.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"none",t=p.characterValue,n=c.characterValue;""==n&&(n=e,n=es(n));let i={id:p.id,data:{[e]:t}},r=n+"_reverse";r.includes("_s_")||("string"==typeof o[l]&&(o[l]={}),o[l][r]=i)}catch(e){}}if(0!=p.id&&0!=f.id){let o,i=yield on(e[t].typeId),r=null!==(l=null===(c=p.type)||void 0===c?void 0:c.characterValue)&&void 0!==l?l:"self";e[t].ofTheConceptId in n?(o=n[e[t].ofTheConceptId],r in o||(o[r]={})):(o={},o[r]={},n[e[t].ofTheConceptId]=o);try{let e=null!==(u=null===(d=null==f?void 0:f.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"none",t=f.characterValue,n=i.characterValue,s=!1;""==n&&(n=e,n=es(n),s=!0);let a={id:f.id,data:{[e]:t}};isNaN(Number(n))?n.includes("_s_")||("string"==typeof o[r]&&(o[r]={}),o[r][n]=a):(Array.isArray(o[r])||(o[r]=[]),o[r].push(a))}catch(e){}}}catch(e){}return no.logUpdate(h),n}catch(e){throw e}})}(s,l,o)}catch(e){throw new Error(`Failed to format function data for data: ${e instanceof Error?e.message:String(e)}`)}try{c=yield function(e,t,n,o){var i=arguments;return rs(this,arguments,void 0,function*(e,t,n,o,r=[],s){var a,c,l,d,u,h;try{const n=no.logfunction("FormatFromConnectionsAlteredArrayExternal",i);let p=[],f=[];for(let t=0;t<e.length;t++)f.push(e[t].toTheConceptId),f.push(e[t].ofTheConceptId),f.push(e[t].typeId);for(let n=0;n<e.length;n++)try{let o=!1,i=yield on(e[n].ofTheConceptId),p=yield on(e[n].toTheConceptId);if(r.includes(e[n].id)&&(o=!0),1==o&&0!=i.id&&0!=p.id&&p.id in t){let o,r=yield on(e[n].typeId),l=null!==(c=null===(a=p.type)||void 0===a?void 0:a.characterValue)&&void 0!==c?c:"self",d=!1;e[n].toTheConceptId in t&&(d=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[l]&&(o[l]={})):(o={},o[l]={},t[e[n].toTheConceptId]=o),is(p.id,s,o);try{if(t[e[n].ofTheConceptId]){let s={id:i.id,data:t[e[n].ofTheConceptId],created_on:e[n].entryTimeStamp},a=r.characterValue+"_reverse";Array.isArray(o[l][a])?o[l][a].push(s):a.includes("_s_")?(o[l][a]=[],o[l][a].push(s)):o[l][a]=s}}catch(e){}}if(0!=i.id&&0!=p.id&&i.id in t){let o,r=yield on(e[n].typeId),a=null!==(d=null===(l=i.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self",c=!1;e[n].toTheConceptId in t&&(c=!0),e[n].ofTheConceptId in t?(o=t[e[n].ofTheConceptId],"string"==typeof o[a]&&(o[a]={})):(o={},o[a]={},t[e[n].ofTheConceptId]=o),is(i.id,s,o);let f=!0,y=r.characterValue;""==y&&(y=p.characterValue,f=!0),""==y&&(y=(null===(u=null==p?void 0:p.type)||void 0===u?void 0:u.characterValue)||"");try{null===(h=null==p?void 0:p.type)||void 0===h?void 0:h.characterValue;let i=t[e[n].toTheConceptId];if(i){let c={id:p.id,data:t[e[n].toTheConceptId],created_on:e[n].entryTimeStamp};Array.isArray(o[a])?o[a].push(i):Array.isArray(o[a][y])?o[a][r.characterValue].push(c):y.includes("_s_")?(o[a][y]=[],o[a][y].push(c)):o[a][y]=c,is(p.id,s,c)}}catch(e){}}}catch(e){}for(let e=0;e<o.length;e++)try{let n={};n.id=o[e];let i=yield on(n.id);n.data=t[o[e]],n.created_on=i.entryTimeStamp,p.push(n)}catch(e){}return no.logUpdate(n),p}catch(e){throw e}})}(s,l,d,n,o,a)}catch(e){throw new Error(`Failed to format from connections altered array external: ${e instanceof Error?e.message:String(e)}`)}return c}catch(e){throw e}})}function ws(e,t,n,o,i){return ps(this,arguments,void 0,function*(e,t,n,o,i,r="DESC"){if(ed)try{return(yield yd("formatConnectionsV2",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:o,countInfos:i,order:r})).data}catch(e){Td(e)}let s=yield Ti(e),a=yield ls(i);s=us(s,r);let c={};c=yield function(e){var t=arguments;return hs(this,arguments,void 0,function*(e,n={},o=[]){var i,r,s,a,c;const l=no.logfunction("FormatFunctionDataV2",t);for(const t of e){const e=o.includes(t.id),l=yield on(t.ofTheConceptId),d=yield on(t.toTheConceptId),u=yield on(t.typeId);if(0===l.id||0===d.id)continue;const h=e?d:l,p=e?l:d,f=null!==(r=null===(i=h.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self",y=null!==(a=null===(s=p.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"none",m=p.characterValue;null===(c=u.characterValue)||void 0===c||c.includes("_s_"),n[h.id]||(n[h.id]={}),n[h.id][f]||(n[h.id][f]={}),n[p.id]||(n[p.id]={}),n[p.id][y]=m}return no.logUpdate(l),n})}(s,c,o),c=yield function(e){var t=arguments;return hs(this,arguments,void 0,function*(e,n={},o=[]){var i,r,s,a,c;const l=no.logfunction("FormatFunctionDataForDataV2",t);for(const t of e){const e=o.includes(t.id),l=yield on(t.ofTheConceptId),d=yield on(t.toTheConceptId),u=yield on(t.typeId);if(0===l.id||0===d.id)continue;const h=e?d:l,p=e?l:d,f=null!==(r=null===(i=h.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self",y=null!==(a=null===(s=p.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"none",m=p.characterValue,v=null!==(c=u.characterValue)&&void 0!==c?c:"";let g=""===v?es(y):v;const C=g.includes("_s_"),w=!isNaN(Number(g)),I={id:p.id,data:{[y]:m}};n[h.id]||(n[h.id]={}),f in n[h.id]&&"string"!=typeof n[h.id][f]||(n[h.id][f]=w?[]:{});try{if(C)continue;w?n[h.id][f].push(I):n[h.id][f][e?`${g}_reverse`:g]=I}catch(e){}}return no.logUpdate(l),n})}(s,c,o);let l=yield function(e,t,n){var o=arguments;return hs(this,arguments,void 0,function*(e,t,n,i=[],r){var s,a,c;const l=no.logfunction("FormatFromConnectionsAlteredArrayExternal",o),d=[];for(const n of e){const e=i.includes(n.id),o=yield on(n.ofTheConceptId),l=yield on(n.toTheConceptId),d=yield on(n.typeId);if(0===o.id||0===l.id)continue;const u=e?l:o,h=e?o:l,p=u.id,f=h.id,y=null!==(a=null===(s=u.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"self",m=d.characterValue+"_reverse",v=d.characterValue||h.characterValue||(null===(c=h.type)||void 0===c?void 0:c.characterValue)||"";if(t[p]){const o=t[p][y],i=t[f],s={id:h.id,data:i,created_on:n.entryTimeStamp};is(p,r,t[p]);try{e?Array.isArray(o[m])?o[m].push(s):o[m]=[s]:Array.isArray(o)?o.push(i):Array.isArray(o[v])?o[v].push(s):v.includes("_s_")?(o[v]=[],o[v].push(s)):o[v]=[s],is(f,r,s)}catch(e){}}}for(const e of n){const n=yield on(e);d.push({id:e,data:t[e],created_on:n.entryTimeStamp})}return no.logUpdate(l),d})}(s,c,n,o,a);return l})}var Is=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ts(e){var t=arguments;return Is(this,arguments,void 0,function*(e,n="",o=null,i=zr){var r,s,a,c,l,u,h,p;const f=no.logfunction("SearchLinkMultipleAll",t)||{};try{try{if(ed){f.serviceWorker=!0;const t=yield yd("SearchLinkMultipleAll",{searchQuery:e,token:n,caller:o,format:i});return no.logUpdate(f),t.data}}catch(e){d(f,0,e),Td(e)}let t=[],y=[],m=[],v=[],g=e[0].composition,C={},w={};(null==o?void 0:o.isDataLoaded)?(C.compositionIds=null===(r=o.conceptIds)||void 0===r?void 0:r.slice(),C.internalConnections=null===(s=o.internalConnections)||void 0===s?void 0:s.slice(),C.linkers=null===(a=o.linkers)||void 0===a?void 0:a.slice(),C.reverse=null===(c=o.reverse)||void 0===c?void 0:c.slice(),w=C,t=w.compositionIds,m=w.internalConnections,y=w.linkers,v=w.reverse):(C=yield Ee(e,n),o&&(o.conceptIds=null===(l=C.compositionIds)||void 0===l?void 0:l.slice(),o.internalConnections=null===(u=C.internalConnections)||void 0===u?void 0:u.slice(),o.linkers=null===(h=C.linkers)||void 0===h?void 0:h.slice(),o.reverse=null===(p=C.reverse)||void 0===p?void 0:p.slice(),o.isDataLoaded=!0),w=C,t=w.compositionIds,m=w.internalConnections,y=w.linkers,v=w.reverse);let I=yield function(e,t,n,o,i,r){return Is(this,arguments,void 0,function*(e,t,n,o,i,r,s=zr){try{let a,c,l=yield Ti(e);return s==Jr?(a=yield bi(t,n),c=yield As(e,a,i,o)):s==Hr?(a=yield Ai(t,n),c=yield As(e,a,i,o)):100==s?(a=yield function(){return fi(this,arguments,void 0,function*(e=[],t=[]){yield pi(t);let n={};for(let t=0;t<e.length;t++){let o=yield zt(e[t]);n[e[t]]=o}return n})}(t,n),c=yield ks(l,a,i,o)):s==Zr?c=yield ms(e,t,n,r.ofCompositions,o):(a=yield ki(t,n),c=yield ks(l,a,i,o)),c}catch(e){return}})}(y,t,m,v,g,e[0],i);return no.logUpdate(f),I}catch(e){throw d(f,0,e),e}})}function ks(e,t,n){return Is(this,arguments,void 0,function*(e,t,n,o=[]){(new Date).getTime();let i={},r=[];for(let t=0;t<e.length;t++)r.push(e[t].toTheConceptId),r.push(e[t].ofTheConceptId),r.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;if(o.includes(e[n].id)&&(i=!0),1==i){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield on(e[n].typeId),r=null==o?void 0:o.data,s=Object.keys(r)[0];try{let o=i.characterValue+"_reverse";"string"==typeof r&&(r={}),Array.isArray(r[s][o])||("string"==typeof r[s]&&(r[s]={}),r[s][o]=[]),r[s][o].push(t[e[n].ofTheConceptId])}catch(e){}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield on(e[n].typeId),r=null==o?void 0:o.data,s=Object.keys(r)[0];try{"string"==typeof r&&(r={}),Array.isArray(r[s][i.characterValue])||("string"==typeof r[s]&&(r[s]={}),r[s][i.characterValue]=[]),r[s][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){}}}return i=t[n],i})}function bs(e,t,n){return Is(this,arguments,void 0,function*(e,t,n,o=[]){let i=[],r=[];for(let t=0;t<e.length;t++)r.push(e[t].toTheConceptId),r.push(e[t].ofTheConceptId),r.push(e[t].typeId);e.sort(function(e,t){return t.id-e.id});for(let n=0;n<e.length;n++){let i=!1;if(o.includes(e[n].id)&&(i=!0),1==i){if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].toTheConceptId],i=yield on(e[n].typeId),r=Object.keys(o)[0];try{let s=i.characterValue+"_reverse";"string"==typeof o&&(o={}),Array.isArray(o[r][s])||("string"==typeof o[r]&&(o[r]={}),o[r][s]=[]),o[r][s].push(t[e[n].ofTheConceptId])}catch(e){}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield on(e[n].typeId),r=Object.keys(o)[0];try{"string"==typeof o&&(o={}),Array.isArray(o[r][i.characterValue])||("string"==typeof o[r]&&(o[r]={}),o[r][i.characterValue]=[]),o[r][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){}}}for(let e=0;e<n.length;e++){let o=t[n[e]];o&&i.push(o)}return i})}function As(e,t,n){return Is(this,arguments,void 0,function*(e,t,n,o=[]){let i={},r=yield pi(e),s=[];for(let e=0;e<r.length;e++)s.push(r[e].toTheConceptId),s.push(r[e].ofTheConceptId),s.push(r[e].typeId);yield Xe(s),r.sort(function(e,t){return t.id-e.id});for(let e=0;e<r.length;e++){let n=!1;if(o.includes(r[e].id)&&(n=!0),1==n){if(t[r[e].ofTheConceptId]&&t[r[e].toTheConceptId]){let n=t[r[e].toTheConceptId],o=yield on(r[e].typeId),i=n,s=Object.keys(i)[0];try{let n=o.characterValue+"_reverse";"string"==typeof i&&(i={}),Array.isArray(i[s][n])||("string"==typeof i[s]&&(i[s]={}),i[s][n]=[]),i[s][n].push(t[r[e].ofTheConceptId])}catch(e){}}}else if(t[r[e].ofTheConceptId]&&t[r[e].toTheConceptId]){let n=t[r[e].ofTheConceptId],o=yield on(r[e].typeId),i=n,s=Object.keys(i)[0];try{"string"==typeof i&&(i={}),Array.isArray(i[s][o.characterValue])||("string"==typeof i[s]&&(i[s]={}),i[s][o.characterValue]=[]),i[s][o.characterValue].push(t[r[e].toTheConceptId])}catch(e){}}}return i=t[n],i})}function Ss(e){var t,n;const o=pt();return o.id=e.id,o.ghostId=e.ghostId,o.userId=e.userId,o.accessId=e.accessId,o.categoryId=e.categoryId,o.characterValue=e.characterValue,o.entryTimeStamp=e.entryTimeStamp,o.typeId=e.typeId,o.type=e.type,o.isTemp=!1,o.typeCharacter=null!==(n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"",o}function Ns(e){const t=S();return t.id=e.id,t.ghostId=e.ghostId,t.userId=e.userId,t.accessId=e.accessId,t.entryTimeStamp=e.entryTimeStamp,t.typeId=e.typeId,t.categoryId=e.categoryId,t}function _s(e){const t=new Ue(0,0,0,0,0,0,0);return t.id=e.id,t.ghostId=e.ghostId,t.accessId=e.accessId,t.ofTheConceptId=e.ofTheConceptId,t.toTheConceptId=e.toTheConceptId,t.entryTimeStamp=e.entryTimeStamp,t.typeId=e.typeId,t.isTemp=!1,t}var Ps=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Es(e){return Ps(this,void 0,void 0,function*(){let t=performance.now();try{if(ed)try{return(yield yd("GetTheConceptLocal",{id:e})).data}catch(e){Td(e)}let t=pt();if(e<0){if(t=yield xt.GetConcept(e),0==t.id){let n=yield yt.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}}}else{t=Ss(yield on(e))}return t}catch(n){throw no.logError(t,"unknown","read","unknown",void 0,200,void 0,"GetTheConceptLocal",[e],"unknown",void 0),n}})}var Ls=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function xs(e){return Ls(this,arguments,void 0,function*(e,t={concepts:[],connections:[]}){var n,o,i,r;performance.now();if(ed)try{const s=yield yd("UpdateCompositionLocal",{patcherStructure:e,actions:t});return(null===(o=null===(n=null==s?void 0:s.actions)||void 0===n?void 0:n.concepts)||void 0===o?void 0:o.length)&&(t.concepts=JSON.parse(JSON.stringify(s.actions.concepts))),(null===(r=null===(i=null==s?void 0:s.actions)||void 0===i?void 0:i.connections)||void 0===r?void 0:r.length)&&(t.connections=JSON.parse(JSON.stringify(s.actions.connections))),s.data}catch(e){Td(e)}const s=e.userId,a=e.sessionId,c=e.accessId;let l=[];const d=[];let u=pt(),h=pt();const p=[],f=e.compositionId,y=e.ofTheCompositionId;let m=[];let v=yield Ut(f);for(let e=0;e<v.length;e++)l.push(_s(v[e]));const g=[],C=[];let w=[];for(let e=0;e<l.length;e++)tr(C,l[e].ofTheConceptId),tr(g,l[e].ofTheConceptId),tr(g,l[e].toTheConceptId),w.push(l[e].ofTheConceptId);for(let e=0;e<g.length;e++){const t=yield on(g[e]);f==g[e]&&(u=Ss(t)),y==g[e]&&(h=Ss(t)),d.push(Ss(t))}const I=e.patchObject;for(const e in I){let n=pt();const o=I[e];let i=u;h.id>0&&(i=h),Array.isArray(o)||"object"==typeof o?(n=yield po(e,"",!0,u.userId,4,999,void 0,t),yield yo(I[e],n.id,n.userId,u.id,u.userId,4,999,void 0,t)):n=yield po(e,o,!1,s,c,a,void 0,t);const r=or(d,n);for(let e=0;e<r.length;e++)if(r[e].id>0){const t=rr(l,r[e].id);m=m.concat(t),p.push(r[e])}yield io(i.id,n.id,u.id,2,void 0,void 0,t);d.push(n)}for(let e=0;e<m.length;e++)yield ko(m[e].id);yield _t.SyncDataOnline(void 0,t)})}var Rs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var Os=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ds(e,t,n){return Os(this,void 0,void 0,function*(){try{if(ed)try{return(yield yd("GetRelationLocal",{id:e,relation:t,userId:n})).data}catch(e){Td(e)}let o=yield hn(t),i=[];0!=o.id&&(i=yield function(e,t){return Rs(this,void 0,void 0,function*(){try{return yield Et.GetConnectionOfCompositionAndTypeLocal(t,e)}catch(e){throw e}})}(e,o.id));let r=[];for(let e=0;e<i.length;e++){let t=yield In(i[e].toTheConceptId);r.push(t)}return r}catch(e){throw e}})}var Us=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Fs(e){return Us(this,void 0,void 0,function*(){let t=[];try{var n=yield Ie();const o=yield be(r.ViewInternalDataUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(o.ok){let e=yield o.json(),n={};for(let o=0;o<e.length;o++){let i=e[o].concepts;t=e[o].connections;let r=e[o].id;Xe(i),n[r]=t}return n}return a(o),t}catch(e){throw Error,e}})}var Bs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ms(e){return Bs(this,void 0,void 0,function*(){var t;try{let n=yield Fs(e),o=[];for(let i=0;i<e.length;i++){let r=e[i],s=n[r];if(r&&s){let e=[],t={};for(let t=0;t<s.length;t++)e.includes(s[t].ofTheConceptId)||e.push(s[t].ofTheConceptId);let n=yield Zt(r,s,e);t.data=n,t.id=r,o.push(t)}else{let e={};e.id=r;let n=yield on(r),i={};n.type&&(i[null===(t=null==n?void 0:n.type)||void 0===t?void 0:t.characterValue]=n.characterValue,e.data=i,o.push(e))}}return o}catch(e){throw e}})}var Gs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};var js=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ws(e){return js(this,arguments,void 0,function*(e,t=""){try{let n=yield function(e){return Gs(this,arguments,void 0,function*(e,t=""){var n=yield Te("application/json",t);let o=r.SearchInternalWithAuthenticatedCcsUrl();o=o+"?composition="+e.composition+"&search="+e.search+"&internalComposition="+e.internalComposition+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;try{const e=yield be(o,{method:"GET",headers:n});return e.ok?yield e.json():(a(e),[])}catch(e){l(e,o)}})}(e,t);return yield Ms(n)}catch(e){throw e}})}function Vs(e){return js(this,arguments,void 0,function*(e,t=""){try{return yield function(e){return Gs(this,void 0,void 0,function*(){var t=yield Te("application/json","");let n=r.SearchInternalWithCcsUrl();n=n+"?composition="+e.composition+"&search="+e.search+"&internalComposition="+e.internalComposition+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;try{const e=yield be(n,{method:"GET",headers:t});return e.ok?yield e.json():(a(e),[])}catch(e){l(e,n)}})}(e)}catch(e){throw e}})}var qs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function $s(e,t,n){var o=arguments;return qs(this,arguments,void 0,function*(e,t,n,i=!1,r={concepts:[],connections:[]}){var s,a,c,l,u,h;const p=no.logfunction("CreateConnectionBetweenTwoConceptsLocal",o)||{};let f=performance.now();try{if(ed){p.serviceWorker=!0;try{const o=yield yd("CreateConnectionBetweenTwoConceptsLocal",{ofTheConcept:e,toTheConcept:t,linker:n,both:i,actions:r});return(null===(a=null===(s=null==o?void 0:o.actions)||void 0===s?void 0:s.concepts)||void 0===a?void 0:a.length)&&(r.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(l=null===(c=null==o?void 0:o.actions)||void 0===c?void 0:c.connections)||void 0===l?void 0:l.length)&&(r.connections=JSON.parse(JSON.stringify(o.actions.connections))),no.logUpdate(p),o.data}catch(e){d(p,0,e),Td(e)}}e.userId;if(i){let o=(null===(u=t.type)||void 0===u?void 0:u.characterValue)+"_s"+"_"+(n+"_by");var y=yield po("connection",o,!1,999,999,999,0,r);yield io(t.id,e.id,y.id,1e3,void 0,void 0,r)}let o=(null===(h=e.type)||void 0===h?void 0:h.characterValue)+"_s"+"_"+(n+"_s");var m=yield po("connection",o,!1,999,999,999,void 0,r);let f=yield io(e.id,t.id,m.id,1e3,void 0,void 0,r);return no.logUpdate(p),f}catch(o){throw no.logError(f,e.userId,"create",void 0,void 0,500,o,"CreateConnectionBetweenTwoConceptsLocal",[e,t,n,i],void 0,void 0),d(p,0,o),o}})}var Hs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function zs(e){return Hs(this,void 0,void 0,function*(){if(ed)try{return(yield yd("DeleteConceptLocal",{id:e})).data}catch(e){Td(e)}let t=yield Es(e);xt.RemoveConcept(t)})}var Js=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Qs(e,t,n){var o=arguments;return Js(this,void 0,void 0,function*(){const i=no.logfunction("GetCompositionConnectionsBetweenTwoConcepts",o)||{};var s=[];try{if(ed){i.serviceWorker=!0;try{const o=yield yd("GetCompositionConnectionsBetweenTwoConcepts",{ofConceptId:e,toConcept:t,mainKey:n});return no.logUpdate(i),o.data}catch(e){d(i,0,e),Td(e)}}var c=new FormData;c.append("ofConceptId",e.toString()),c.append("mainKey",n.toString()),c.append("toConceptId",t.toString());const o=yield Ie(null,"application/json"),l=yield be(r.GetCompositionConnectionBetweenTwoConceptsUrl(),{method:"POST",headers:o,body:c,redirect:"follow"});if(l.ok){const e=yield l.json();for(var u=0;u<e.length;u++)Je.AddConnection(e[u]),s.push(e[u]);no.logUpdate(i)}else a(l)}catch(e){Error,l(e,r.GetCompositionConnectionBetweenTwoConceptsUrl()),d(i,0,e)}return s})}var Ys=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ks(e,t,n,o){return Ys(this,arguments,void 0,function*(e,t,n,o,i=!0){var r,s;const a=no.logfunction("GetConnectionBetweenTwoConceptsLinker")||{};if(ed){a.serviceWorker=!0;try{const r=yield yd("GetConnectionBetweenTwoConceptsLinker",{ofTheConcept:e,toTheConcept:t,linker:n,fullLinker:o,forward:i});return no.logUpdate(a),r.data}catch(e){d(a,0,e),Td(e)}}let c=S();if(""!=n){let o="";if(i){o=(null===(r=e.type)||void 0===r?void 0:r.characterValue)+"_s"+"_"+(n+"_s")}else{o=(null===(s=t.type)||void 0===s?void 0:s.characterValue)+"_s"+"_"+(n+"_by")}c=yield Hn("connection",o,!1,999)}""!=o&&(c=yield Vo(o,999));let l=[];return l=i?yield Qs(e.id,t.id,c.id):yield Qs(t.id,e.id,c.id),no.logUpdate(a),l})}function Zs(e,t){return new Promise((n,o)=>{setTimeout(()=>{n(t)},e)})}var Xs=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ea(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ta(){const e=new Date;return new A(0,0,0,0,0,"",0,!1,e,e,"")}function na(e,t){return Xs(this,void 0,void 0,function*(){let n=ta();if(!e||!t)return n;try{const o=yield be(r.GetInstanceConceptByCharacterTypeUrl(),{method:"POST",headers:yield Ie("application/json"),body:JSON.stringify({characterValue:e,type:t})});if(200===o.status){n=function(e){var t,n,o,i,r,s,a,c,l,d,u;if(!e||"object"!=typeof e||Array.isArray(e))return ta();try{const h=e,p=ta(),f=new A(null!==(t=h.id)&&void 0!==t?t:0,null!==(n=h.userId)&&void 0!==n?n:0,null!==(o=h.typeId)&&void 0!==o?o:0,null!==(i=h.categoryId)&&void 0!==i?i:0,ea(h,"referentId")?null!==(r=h.referentId)&&void 0!==r?r:null:0,null!==(s=h.characterValue)&&void 0!==s?s:"",null!==(a=h.accessId)&&void 0!==a?a:4,!1,null!==(c=h.entryTimeStamp)&&void 0!==c?c:p.entryTimeStamp,null!==(l=h.updatedTimeStamp)&&void 0!==l?l:p.updatedTimeStamp,"");return f.typeCharacter=null!==(d=h.typeCharacter)&&void 0!==d?d:"",f.isComposition=null!==(u=h.isComposition)&&void 0!==u&&u,ea(h,"ghostId")&&(f.ghostId=h.ghostId),f}catch(e){return ta()}}(yield o.json())}}catch(e){e instanceof Error&&e.message;TypeError}return n})}const oa=3,ia=4,ra=5;var sa=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function aa(e,t){return sa(this,arguments,void 0,function*(e,t,n=""){let o=r.SearchAllTypeWithLinker(e.auth);var i=yield Te("application/json",n);o=o+"?search="+e.search+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;const s=JSON.stringify(t);try{const e=yield be(o,{method:"POST",headers:i,body:s});if(e.ok){return yield e.json()}return a(e),[]}catch(e){l(e,o)}})}var ca=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class la{constructor(){this.subscribers=[],this.mainConcept=0,this.compositionIds=[],this.conceptIds=[],this.internalConnections=[],this.reverse=[],this.linkers=[],this.newIds=[],this.dependency=[],this.isDataLoaded=!1,this.isUpdating=!1,this.fetched=!1,this.format=Hr,this.eventHandlers={},this.eventNames={},this.isDisposed=!1}addTrackedEventListener(e,t,n){const o=`${e}`;if(this.eventHandlers[o])return;const i=`${t}`;this.eventHandlers[o]=n,this.eventNames[o]=i,window.addEventListener(i,n)}removeTrackedEventListener(e){var t;const n=`${e}`,o=this.eventHandlers[n];o&&(window.removeEventListener(null!==(t=this.eventNames[n])&&void 0!==t?t:n,o),delete this.eventHandlers[n],delete this.eventNames[n])}onDispose(){}dispose(){for(const e of Object.keys(this.eventHandlers))this.removeTrackedEventListener(e);this.isDataLoaded=!1,this.isDisposed=!0,this.onDispose()}listenToEventType(e){const t=`type:${e}`;if(this.eventHandlers[t])return;this.addTrackedEventListener(t,e,e=>ca(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return ca(this,void 0,void 0,function*(){try{let n=e;if(!t.compositionIds.includes(null==n?void 0:n.detail)){t.compositionIds.unshift(null==n?void 0:n.detail),t.listenToEvent(null==n?void 0:n.detail);let e=null==n?void 0:n.detail,o=yield Je.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<o.length;e++)yield Je.GetConnection(o[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||t.compositionIds.push(e.ofTheConceptId)})}t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw t.isUpdating=!1,e}})},200)}}))}listenToEvent(e){const t=`concept:${e}`;if(this.eventHandlers[t])return;this.addTrackedEventListener(t,e,t=>ca(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return ca(this,void 0,void 0,function*(){try{let n=yield Je.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield Je.GetConnection(n[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||(t.compositionIds.push(e.ofTheConceptId),t.newIds.includes(e.ofTheConceptId)||t.newIds.push(e.ofTheConceptId))});t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw t.isUpdating=!1,e}})},200)}}))}removeListenToEvent(e){this.removeTrackedEventListener(`concept:${e}`),this.removeTrackedEventListener(e)}listenToEventConnectionType(e,t){const n=`concept:${e}:type:${t}`;if(this.eventHandlers[n])return;this.addTrackedEventListener(n,e,n=>ca(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let n=this;setTimeout(function(){return ca(this,void 0,void 0,function*(){try{let o=yield Je.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<o.length;e++)o[e].typeId==t&&(yield Je.GetConnection(o[e]).then(e=>{e.typeId==n.mainConcept?n.internalConnections.includes(e.id)||n.internalConnections.push(e.id):n.linkers.includes(e.id)||n.linkers.push(e.id),n.conceptIds.includes(e.toTheConceptId)||n.conceptIds.push(e.toTheConceptId),n.compositionIds.includes(e.ofTheConceptId)||n.compositionIds.push(e.ofTheConceptId)}));n.isUpdating=!1,yield n.bind(),n.notify()}catch(e){throw n.isUpdating=!1,e}})},200)}}))}bind(){return ca(this,void 0,void 0,function*(){})}run(){return ca(this,void 0,void 0,function*(){})}update(){return ca(this,void 0,void 0,function*(){this.isDataLoaded=!1,yield this.bind(),this.notify()})}subscribe(e,t){this.isDisposed=!1,0===this.subscribers.length&&0===Object.keys(this.eventHandlers).length&&(this.isDataLoaded=!1),this.subscribers.push(e);const n=()=>this.unsubscribe(e),o=this.bind().then(()=>ca(this,void 0,void 0,function*(){return yield e(this.data,this),{unsubscribe:n}})).catch(e=>{throw t&&t(e),e});return o.unsubscribe=n,o}execute(){return ca(this,void 0,void 0,function*(){return yield this.run()})}unsubscribe(e){return this.subscribers=this.subscribers.filter(t=>t!=e),0===this.subscribers.length&&this.dispose(),this.subscribers.length}notify(){this.subscribers.map(e=>{e(this.data,this)})}}var da=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class ua extends la{constructor(e,t,n=zr){super(),this.searchQuery=[],this.format=zr,this.searchQuery=e,this.format=n}bind(){return da(this,void 0,void 0,function*(){return this.data=yield Ts(this.searchQuery,"",this,this.format),this.mainConcept=this.searchQuery[0].composition,this.listenToEvent(this.mainConcept),this.data})}}function ha(e,t,n=zr){return new ua(e,null!=t?t:"",n)}var pa=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class fa extends la{constructor(e,t=Jr){super(),this.id=e,this.format=t}bind(){return pa(this,void 0,void 0,function*(){if(!this.isDataLoaded){let e=yield function(e){return Bt(this,void 0,void 0,function*(){let t={connectionList:[],compositionList:[]};try{if(ed)try{return(yield yd("GetCompositionById",{id:e})).data}catch(e){Td(e)}let n=yield Ut(e);t.connectionList=n;for(let e=0;e<t.connectionList.length;e++)t.compositionList.includes(t.connectionList[e].ofTheConceptId)||t.compositionList.push(t.connectionList[e].ofTheConceptId);return t}catch(e){return t}})}(this.id);this.mainConcept=this.id,this.compositionIds=e.compositionList;let t=e.connectionList;for(let e=0;e<t.length;e++)this.internalConnections.push(t[e].id);this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return pa(this,void 0,void 0,function*(){let e=[],t=this.internalConnections;for(let n=0;n<t.length;n++)e.push(yield Je.GetConnection(t[n]));return this.format==Jr?this.data=yield Mt(this.mainConcept,e,this.compositionIds):this.format==zr?this.data=yield function(e,t,n){return Bt(this,void 0,void 0,function*(){var o,i;let r={},s=yield U.GetConcept(e);0==s.id&&null!=e&&null!=e&&(s=yield Ot(e));let a=yield Zt(e,t,n);r[null!==(i=null===(o=null==s?void 0:s.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:""]=a;let c={};return c.created_at=s.entryTimeStamp,c.data=r,c.id=e,c})}(this.mainConcept,e,this.compositionIds):this.format==Hr?this.data=yield function(e,t,n){return Bt(this,void 0,void 0,function*(){var o,i;let r={},s=yield U.GetConcept(e);0==s.id&&null!=e&&null!=e&&(s=yield Ot(e));let a=yield Kt(s,t,n);return r[null!==(i=null===(o=null==s?void 0:s.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:""]=a,r})}(this.mainConcept,e,this.compositionIds):this.data=yield Mt(this.mainConcept,e,this.compositionIds),this.data})}}function ya(e,t=Jr){return new fa(e,t)}var ma=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class va extends la{constructor(e,t,n,o,i){super(),this.data=[],this.startPage=0,this.compositionName=e,this.userId=t,this.inpage=n,this.page=o,this.format=i}bind(){return ma(this,void 0,void 0,function*(){if(!this.isDataLoaded){var e=yield ln(this.compositionName);if(e){yield Re(this.compositionName,this.userId);let o=yield U.GetConceptsByTypeIdAndUser(e.id,this.userId);for(var t=this.inpage*(this.page-1),n=t;n<t+this.inpage;n++)o[n]&&this.compositionIds.push(o[n].id)}yield rt(this.compositionIds),this.isDataLoaded=!0,this.listenToEventType(e.id);for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e])}return yield this.build()})}build(){return ma(this,void 0,void 0,function*(){if(this.data=[],this.format==Jr){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield Wt(this.compositionIds[e]);this.data.push(t)}}else if(this.format==zr){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield qt(this.compositionIds[e]);this.data.push(t)}}else if(this.format==Hr){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield Vt(this.compositionIds[e]);this.data.push(t)}}else for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield Wt(this.compositionIds[e]);this.data.push(t)}return this.data})}}function ga(e,t,n,o,i=Jr){return new va(e,t,n,o,i)}var Ca=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class wa extends la{constructor(e,t,n,o,i){super(),this.connections=[],this.data=[],this.mainConcept=e,this.linker=t,this.inpage=n,this.page=o,this.format=i}bind(){return Ca(this,void 0,void 0,function*(){var e;if(!this.isDataLoaded){let o=yield on(this.mainConcept),i=(null===(e=o.type)||void 0===e?void 0:e.characterValue)+"_s_"+this.linker,r=yield Dn(i,16);if(r.id>0){let e=yield vo(r.id,o.id,o.userId,this.inpage,this.page);this.connections=e;for(var t=[],n=0;n<this.connections.length;n++)t.push(this.connections[n].toTheConceptId),this.linkers.push(this.connections[n].id),this.listenToEvent(this.connections[n].toTheConceptId);yield rt(t)}this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return Ca(this,void 0,void 0,function*(){this.data=[],this.connections=yield pi(this.linkers);for(var e=0;e<this.connections.length;e++){let t=this.connections[e].toTheConceptId,n=yield on(t);if(this.format==Hr){let e=yield qt(n.id);this.data.push(e)}else if(this.format==Jr){let e=yield Wt(n.id);this.data.push(e)}else if(this.format==Qr){let e=yield Jt(n.id);this.data.push(e)}else{let e=yield Jt(n.id);this.data.push(e)}}return this.data})}}function Ia(e,t,n,o,i=Hr){return new wa(e,t,n,o,i)}var Ta=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class ka extends la{constructor(e,t,n="",o){super(),this.searchText="",this.connections=[],this.externalConnectionIds=[],this.data=[],this.mainConcept=e,this.searchLinkers=t,this.textSearch=n,o&&(this.format=o)}listenToEvent(e){const t=`concept:${e}`;if(this.eventHandlers[t])return;this.addTrackedEventListener(t,e,t=>Ta(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return Ta(this,void 0,void 0,function*(){try{let n=yield Je.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield Je.GetConnection(n[e]).then(e=>{e.typeId==t.mainConcept?t.internalConnections.includes(e.id)||t.internalConnections.push(e.id):t.linkers.includes(e.id)||t.linkers.push(e.id),t.conceptIds.includes(e.toTheConceptId)||t.conceptIds.push(e.toTheConceptId),t.compositionIds.includes(e.ofTheConceptId)||t.compositionIds.push(e.ofTheConceptId),t.compositionIds.includes(e.toTheConceptId)||t.compositionIds.push(e.toTheConceptId)});t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw t.isUpdating=!1,e}})},200)}}))}bind(){return Ta(this,void 0,void 0,function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;const e=yield Pi(this.mainConcept,this.searchLinkers,this.textSearch);this.compositionIds=e.compositionIds||[],this.internalConnections=e.internalConnections||[],this.externalConnectionIds=e.externalConnections||[],this.linkers=this.externalConnectionIds,this.connections=yield pi(this.externalConnectionIds);for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);this.listenToEvent(this.mainConcept)}return yield this.build()})}build(){return Ta(this,void 0,void 0,function*(){return this.externalConnectionIds=this.linkers,this.format&&this.format==Yr?this.data={compositionIds:this.compositionIds,internalConnections:this.internalConnections,externalConnections:this.externalConnectionIds}:this.data=yield vi(this.compositionIds,this.internalConnections),this.data})}}function ba(e,t,n="",o){return new ka(e,t,n,o)}var Aa=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Sa extends la{constructor(e,t,n,o=zr){super(),this.searchQuery=[],this.format=zr,this.mainCompositionIds=[],this.searchCharacter="",this.token="",this.searchStructure=e,this.searchQuery=t,this.searchQuery[0].type=e.composition,this.searchCharacter=e.composition,this.format=o,this.token=he.BearerAccessToken}listenToEventType(e){const t=`type:${e}`;if(this.eventHandlers[t])return;this.addTrackedEventListener(t,e,e=>Aa(this,void 0,void 0,function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout(function(){return Aa(this,void 0,void 0,function*(){try{let n=e;t.mainCompositionIds.includes(null==n?void 0:n.detail)||(t.mainCompositionIds.unshift(null==n?void 0:n.detail),t.conceptIds.push(null==n?void 0:n.detail),t.listenToEvent(null==n?void 0:n.detail),Je.GetConnectionsOfConcept(null==n?void 0:n.detail).then(e=>{for(let n=0;n<e.length;n++)t.linkers.push(e[n].id)})),t.isUpdating=!1,yield t.bind(),t.notify()}catch(e){throw t.isUpdating=!1,e}})},200)}}))}bind(){return Aa(this,void 0,void 0,function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;var e=yield ln(this.searchCharacter);let t=yield aa(this.searchStructure,this.searchQuery,this.token);this.conceptIds=t.compositionIds,this.internalConnections=t.internalConnections,this.linkers=t.linkers,this.reverse=t.reverse,this.mainCompositionIds=t.mainCompositionIds,this.listenToEventType(e.id);for(let e=0;e<this.mainCompositionIds.length;e++)this.listenToEvent(this.mainCompositionIds[e])}return yield this.build()})}build(){return Aa(this,void 0,void 0,function*(){return yield Xe(this.conceptIds),this.format==zr?this.data=yield ys(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse):this.data=yield ms(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse),this.data})}}function Na(e,t,n,o=zr){return new Sa(e,t,n,o)}class _a{constructor(e,t,n,o,i,s,a,c=!1,l,d,u){this.structureType="lconcept",this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=r.getRandomizer(),this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=o,this.characterValue=s,this.accessId=i,this.type=null,this.isNew=c,this.typeCharacter=a,this.entryTimeStamp=l,this.updatedTimeStamp=d,this.isSynced=!1,this.referentId=u}getType(){}}class Pa{constructor(e,t,n,o,i,s){this.isTemp=!1,this.applicationId=r.getRandomizer(),this.type=S(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.typeId=o,this.ghostId=e,this.orderId=i,this.typeCharacter="",this.accessId=s,this.typeCharacter="",this.entryTimeStamp=N(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date}}class Ea{constructor(){this.compositionId=0,this.userId=999,this.sessionId=999,this.accessId=4,this.ofTheCompositionId=0,this.patchObject={}}}class La{constructor(){this.id="0",this.remote_address="",this.server_port="",this.server_address="",this.server_name="",this.server_software="",this.http_user_agent="",this.self="",this.port="",this.userId="",this.email=""}}class xa{constructor(){this.type="",this.search="",this.logicoperator="=",this.index=0,this.composition=!0,this.name="",this.operateon=""}}class Ra{constructor(){this.type="",this.search="",this.composition="",this.internalComposition="",this.userId=999,this.inpage=10,this.page=1,this.auth=!0}}var Oa=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const Da=500;function Ua(){return new Promise(e=>setTimeout(e,0))}function Fa(){return Oa(this,void 0,void 0,function*(){try{let e=[];if(r.isPwa&&(e=yield v("connection")),Array.isArray(e))for(let t=0;t<e.length;t++)Je.AddConnectionToMemory(e[t]),t>0&&t%Da===0&&(yield Ua())}catch(e){throw{message:"Cannot create Connection Binary Tree Concept",ok:!1,status:400,data:e}}})}function Ba(){return Oa(this,void 0,void 0,function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)Et.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Local Connection Binary Tree Concept",ok:!1,status:400,data:e}}})}var Ma=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Ga(){return Ma(this,void 0,void 0,function*(){const e=no.logfunction("GetAiData");try{const o=(new Date).getTime();var t=yield Te("application/x-www-form-urlencoded");const s=yield be(r.GetAllAiData(),{method:"GET",headers:t});s.ok||a(s);const c=yield s.json();for(var n=0;n<c.length;n++)U.AddConcept(c[n]);!function(){Wa(this,void 0,void 0,function*(){ja.isOnlineSync=!0,function(e){const t=no.logfunction("AiUpdateFlag",["indexdb"]);new Promise(function(n,o){let i="settings";y(i).then(r=>{const s=r.transaction(i,"readwrite").objectStore(i).put(e);s.onsuccess=o=>{no.logUpdate(t),n(e)},s.onerror=n=>{let i={status:400,ok:!1,message:"Cannot update AI flag",data:n,body:e};d(t,0,i),o(i)}}).catch(e=>{let n={status:400,ok:!1,message:"Cannot update AI flag because you cannot open the database",data:e};d(t,0,n),o(n)})})}(new i(ja.isOnlineSync))})}();(new Date).getTime();no.logUpdate(e)}catch(e){Error,l(e,r.GetAllAiData())}})}class ja{}ja.isUpdated=!1,ja.isOnlineSync=!1;var Wa=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Va(){return Wa(this,arguments,void 0,function*(e=!0){try{if(yield y("concepts"),yield kt("concepts"),e){if((yield function(){const e=no.logfunction("GetLastSettingsFromDatabase",["indexdb"]);return new Promise(function(t,n){let o="settings";y(o).then(r=>{let s=r.transaction(o,"readwrite").objectStore(o).getAll();s.onsuccess=()=>{let n=new i(!1),o=s.result;for(let e=0;e<o.length;e++)n=o[e];no.logUpdate(e),t(n)},s.onerror=t=>{d(e,0,t),n(t)}}).catch(t=>{let o={status:400,ok:!1,message:"Cannot get last object from database because you cannot open the database",data:t};d(e,0,o),n(o)})})}()).isOnlineSync)return!0;yield Ga()}return!0}catch(e){return!0}})}var qa=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class $a{static initialize(){try{if(!this.isBrowser())return;this.initGlobalErrorHandlers(),this.logCatchError(),this.logErrorEvent(),this.logUnhandledError(),this.logUserInteractions(),this.logNetworkRequests(),this.logRouteChanges()}catch(e){}}static initGlobalErrorHandlers(){try{if(!this.isBrowser()||this.globalErrorHandlersInitialized)return;this.globalErrorHandlersInitialized=!0,window.onerror=(e,t,n,o,i)=>{const s=he.sessionId||"unknown",a={message:e,source:t,lineno:n,colno:o,stack:(null==i?void 0:i.stack)||"undefined",requestFrom:r.BASE_APPLICATION,sessionId:s};no.logApplication("ERROR","Runtime Error",a),no.log("ERROR","Runtime Error",a)},window.onunhandledrejection=e=>{const t=he.sessionId||"unknown";no.logApplication("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:r.BASE_APPLICATION,sessionId:t}),no.log("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:r.BASE_APPLICATION,sessionId:t})}}catch(e){}}static logCatchError(){try{if(this.consoleErrorPatched)return;this.consoleErrorPatched=!0;const e=console.error;console.error=function(...t){if("Intercepted Fetch Error:"==(null==t?void 0:t[0]))return;const n="Console Error",o=he.sessionId||"unknown",i={arguments:t.map(e=>Ha(e)),requestFrom:r.BASE_APPLICATION,sessionId:o};no.logApplication("ERROR",n,i),no.log("ERROR",n,i),e.apply(console,t)}}catch(e){}}static logErrorEvent(){try{if(!this.isBrowser()||this.errorEventListenerRegistered)return;this.errorEventListenerRegistered=!0,window.addEventListener("error",e=>{var t;const n=he.sessionId||"unknown",o={error:(null===(t=e.error)||void 0===t?void 0:t.message)||e.message,source:e.filename,line:e.lineno,column:e.colno,stack:e.error?Ha(e.error.stack):void 0,requestFrom:r.BASE_APPLICATION,sessionId:n},i="Unhandled Error";no.logApplication("ERROR",i,o),no.log("ERROR",i,o)})}catch(e){}}static logUnhandledError(){try{if(!this.isBrowser()||this.unhandledErrorListenerRegistered)return;this.unhandledErrorListenerRegistered=!0,window.addEventListener("unhandledrejection",e=>{var t,n;const o=he.sessionId||"unknown",i={reason:(null===(t=e.reason)||void 0===t?void 0:t.message)||String(e.reason),stack:(null===(n=e.reason)||void 0===n?void 0:n.stack)||"No stack trace available",requestFrom:r.BASE_APPLICATION,sessionId:o};no.logApplication("ERROR","Unhandled Promise Rejection",i),no.log("ERROR","Unhandled Promise Rejection",i)})}catch(e){}}static logUserInteractions(){this.isBrowser()&&"undefined"!=typeof document&&!this.userInteractionListenersRegistered&&(this.userInteractionListenersRegistered=!0,document.addEventListener("click",e=>{var t;const n=he.sessionId||"unknown",o=e.target,i={element:o.tagName,id:o.id,classes:o.className,text:null===(t=o.innerText)||void 0===t?void 0:t.slice(0,50),requestFrom:r.BASE_APPLICATION,sessionId:n};no.logApplication("INFO","User Click",i)}),document.addEventListener("input",e=>{const t=e.target;he.sessionId,t.tagName,t.id,t.value,r.BASE_APPLICATION}),document.addEventListener("scroll",()=>{he.sessionId,window.scrollY,r.BASE_APPLICATION}))}static logNetworkRequests(){try{if(!this.isBrowser()||this.networkRequestsPatched)return;this.networkRequestsPatched=!0;const e=null===window||void 0===window?void 0:window.fetch;if(!e)throw new Error("Original fetch is not available.");const t=[r.PostLogger(),r.PostPrefetchConceptConnections()];window.fetch=(...n)=>qa(this,void 0,void 0,function*(){const o=he.sessionId||"unknown",[i,s]=n,a=i instanceof Request?i.url:i instanceof URL?i.toString():i;if(t.includes(a)){return e(...n)}let c={request:{type:"REQUEST",message:"Network Request",method:(null==s?void 0:s.method)||"GET",url:a,body:null==s?void 0:s.body,requestFrom:r.BASE_APPLICATION,sessionId:o}};try{const t=yield e(...n);return c.response={type:"RESPONSE",message:"Network Response",url:a,status:t.status,requestFrom:r.BASE_APPLICATION,sessionId:o},t}catch(e){throw c.response={type:"ERROR",message:"Network Request Failed",url:a,error:e instanceof Error?e.message:String(e),requestFrom:r.BASE_APPLICATION,sessionId:o},no.logApplication("ERROR","Failed Network Request",c),new Error(`Network request failed for ${a}: ${e.message}`)}})}catch(e){}}static logPerformanceMetrics(){this.isBrowser()&&!this.performanceMetricsRegistered&&(this.performanceMetricsRegistered=!0,null===window||void 0===window||window.addEventListener("load",()=>{const e=performance.timing;he.sessionId,e.loadEventEnd,e.navigationStart,e.domContentLoadedEventEnd,e.navigationStart,r.BASE_APPLICATION}))}static logRouteChanges(){if(!this.isBrowser()||"undefined"==typeof history||this.routeChangeListenersRegistered)return;this.routeChangeListenersRegistered=!0;const e=history.pushState;this.initialLoadTimeout=setTimeout(()=>{$a.logOnWindowLoad()},3e3),history.pushState=function(...t){const n=he.sessionId||"unknown";let o=document.referrer;const i={url:t[2]?new URL(t[2],location.origin).href:location.href,requestFrom:r.BASE_APPLICATION,sessionId:n,referrer:o};return no.logApplication("ROUTE","Route Change",i),e.apply(this,t)},null===window||void 0===window||window.addEventListener("beforeunload",()=>{const e=he.sessionId||"unknown",t={url:location.href,requestFrom:r.BASE_APPLICATION,sessionId:e};no.logApplication("ROUTE","Unload",t)}),null===window||void 0===window||window.addEventListener("popstate",()=>{const e=he.sessionId||"unknown";let t=document.referrer;const n={url:location.href,requestFrom:r.BASE_APPLICATION,sessionId:e,referrer:t};no.logApplication("ROUTE","Route Changed (Back/Forward)",n)})}static logOnWindowLoad(){if(!this.isBrowser()||"undefined"==typeof localStorage)return;const e=he.sessionId||"unknown";let t=document.referrer;const n=JSON.stringify(Object.entries(localStorage)),o={url:location.href,requestFrom:r.BASE_APPLICATION,sessionId:e,referrer:t,localdata:n};no.logApplication("ROUTE","Initial Load",o)}static logSample(){if(!this.isBrowser())return;const e=he.sessionId||"unknown",t={url:location.href,requestFrom:r.BASE_APPLICATION,sessionId:e};no.logApplication("ROUTE","Sample",t)}static logWebSocketEvents(){if(!this.isBrowser()||"undefined"==typeof WebSocket||this.webSocketEventsPatched)return;this.webSocketEventsPatched=!0;const e=he.sessionId||"unknown",t=WebSocket;window.WebSocket=class extends t{constructor(t,n){super(t,n);const o={url:t.toString(),requestFrom:r.BASE_APPLICATION,sessionId:e};no.logApplication("INFO","WebSocket Open",o),this.addEventListener("message",e=>{const n=he.sessionId||"unknown",o={url:t,data:e.data,requestFrom:r.BASE_APPLICATION,sessionId:n};no.logApplication("INFO","WebSocket Message",o)}),this.addEventListener("error",e=>{const n=he.sessionId||"unknown",o={url:t,error:e instanceof Error?e.message:String(e),requestFrom:r.BASE_APPLICATION,sessionId:n};no.logApplication("ERROR","WebSocket Error",o)}),this.addEventListener("close",()=>{const e=he.sessionId||"unknown",n={url:t,requestFrom:r.BASE_APPLICATION,sessionId:e};no.logApplication("INFO","WebSocket Closed",n)})}}}static isBrowser(){return"undefined"!=typeof window}}function Ha(e){try{return JSON.stringify(e,(e,t)=>t&&"object"==typeof t&&t instanceof Error?{message:t.message,stack:t.stack}:t)}catch(e){return"Error while serializing value"}}$a.globalErrorHandlersInitialized=!1,$a.consoleErrorPatched=!1,$a.errorEventListenerRegistered=!1,$a.unhandledErrorListenerRegistered=!1,$a.userInteractionListenersRegistered=!1,$a.networkRequestsPatched=!1,$a.performanceMetricsRegistered=!1,$a.routeChangeListenersRegistered=!1,$a.webSocketEventsPatched=!1,$a.initialLoadTimeout=null;var za=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const Ja="CaptchaToken",Qa="recaptchaAction";let Ya=null;function Ka(){if("undefined"!=typeof window)return window.grecaptcha}function Za(e,t){return za(this,void 0,void 0,function*(){yield function(e){if(Ka())return Promise.resolve();if("undefined"==typeof document)return Promise.reject(new Error("reCAPTCHA requires a browser document"));if(!Ya){const t=new Promise((t,n)=>{const o=document.createElement("script");o.src=`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e)}`,o.async=!0,o.defer=!0,o.onload=()=>t(),o.onerror=()=>n(new Error("Failed to load reCAPTCHA script")),document.head.appendChild(o)});Ya=t.catch(e=>{throw Ya=null,e})}return Ya}(e);const n=Ka();if(!n)throw new Error("reCAPTCHA is not available");return yield new Promise(e=>{n.ready(e)}),n.execute(e,{action:t})})}function Xa(e,t){var n,o,i,r;if(e instanceof FormData){if(!(null==t?void 0:t.token))return e;const i=null!==(n=t.fieldName)&&void 0!==n?n:Ja,r=null!==(o=t.actionFieldName)&&void 0!==o?o:Qa;return e.has(i)||e.append(i,t.token),t.action&&!e.has(r)&&e.append(r,t.action),e}const s=Object.assign({},e);if(null==t?void 0:t.token){const e=null!==(i=t.fieldName)&&void 0!==i?i:Ja,n=null!==(r=t.actionFieldName)&&void 0!==r?r:Qa;void 0===s[e]&&(s[e]=t.token),t.action&&void 0===s[n]&&(s[n]=t.action)}return JSON.stringify(s)}function ec(e,t,n){var o;const i={};return t&&(i.Authorization=`Bearer ${t}`),e||(i["Content-Type"]="application/json"),(null==n?void 0:n.token)&&(i[null!==(o=n.headerName)&&void 0!==o?o:"X-Recaptcha-Token"]=n.token),i}const tc=(e,t,...n)=>za(void 0,[e,t,...n],void 0,function*(e,t,n=!1,o){var i;try{const s=function(e=!1,t){var n;return"boolean"==typeof e?{bulk:e,recaptcha:t}:Object.assign(Object.assign({},e),{recaptcha:null!==(n=e.recaptcha)&&void 0!==n?n:t})}(n,o),a=yield function(e){return za(this,void 0,void 0,function*(){var t;if(null==e?void 0:e.token)return e;if(!r.RECAPTCHA_SITE_KEY)return e;const n=null!==(t=null==e?void 0:e.action)&&void 0!==t?t:r.RECAPTCHA_ACTION,o=yield Za(r.RECAPTCHA_SITE_KEY,n);return Object.assign(Object.assign({},e),{token:o,action:n})})}(function(e){return e?"string"==typeof e?{token:e}:e:null}(s.recaptcha)),c=e instanceof FormData,l=function(e){return e.personal?r.sendPersonalMail():e.bulk?r.sendBulkMail():r.sendMail()}(s);!function(e){null==e||e.token}(a);const d=yield fetch(l,{method:"POST",body:Xa(e,a),headers:ec(c,t,a)}),u=null!==(i=d.headers.get("content-type"))&&void 0!==i?i:"";if(!d.ok){u.includes("application/json")?yield d.json():yield d.text();return null}return u.includes("text/plain")?yield d.text():yield d.json()}catch(e){return null}}),nc=(e,t,...n)=>za(void 0,[e,t,...n],void 0,function*(e,t,n={}){return tc(e,t,Object.assign(Object.assign({},n),{personal:!0}))});class oc{constructor(){this.inDevelopment=!1,this.subscribers=[]}notify(e=null){this.subscribers.map(t=>{t(e||this.data)})}dataChange(e){this.subscribers.push(e)}}class ic extends oc{constructor(){super(...arguments),this.element=null,this.elementIdentifier=0,this.widgetMounted=!1}getComponent(){return this.element}getElementById(e){let t=this.getComponent(),n=document.body;if(t){let o=t.querySelector("#"+e);if(o)return n=o,n}return null}createWidgetWrapperIdentifier(){return this.elementIdentifier=1e4*Math.random(),this.elementIdentifier.toString()}}var rc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class sc extends ic{constructor(){super(...arguments),this.html="",this.css="",this.js="",this.state={},this.previousState={},this.childWidgets=[],this.childWidgetElement=[],this.widgetState={},this.parentElement=""}querySelector(e){return this.element?this.element.querySelector(e):null}querySelectorAll(e){return this.element?this.element.querySelectorAll(e):null}getElement(){return this.element}setTitle(e){document.title=e}getHtml(){return this.html}UpdateChildData(e,t){let n=t;n.data=e,n.render(),n.update()}update(){}setState(e){this.previousState=Object.assign({},this),this.data=e,this.state=Object.assign({},this),this.hasStateChanged()&&(this.notify(),this.render())}setStateProperty(e){this.previousState=Object.assign({},this),Object.assign(this,e),this.state=Object.assign({},this),this.hasStateChanged()&&(this.notify(),this.render())}hasStateChanged(){return!this.isPropertyEqual(this.state,this.previousState)}isPropertyEqual(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let i of n){if(!o.includes(i))return!1;for(let n of o)if(i==n&&"state"!=i&&"previousState"!=i){if(e[i]!=t[i])return!1}}return!0}loadChildWidgets(){this.childWidgets.map(e=>{let t=this.getElementById(e.parentElement);t&&(t.innerHTML=""),e.mount(t)})}render(){this.element&&(this.element.innerHTML=this.getHtml()),this.loadChildWidgets(),this.after_render()}getElementByClassName(e){let t=this.getComponent();if(t){return null==t?void 0:t.querySelectorAll("."+e)}return[]}mount_child(){}mount(e){return rc(this,void 0,void 0,function*(){e&&(this.element=document.createElement("div"),this.element.id=this.createWidgetWrapperIdentifier(),this.element.innerHTML=this.getHtml(),this.element.classList.add("mftsccs-marking-rendered"),e.appendChild(this.element),this.parentElement=e.id,this.before_render(),this.mount_child(),this.widgetMounted=!0)})}before_render(){this.render()}after_render(){}renderChildWidgets(){function e(t){var n;t&&(null===(n=t.childWidgets)||void 0===n||n.forEach(t=>{e(t)}),t.render())}this.childWidgets.forEach(t=>{e(t)})}setWidgetState(e,t){this.widgetState[e]=t,function e(t){t&&Array.isArray(t.childWidgets)&&t.childWidgets.forEach(n=>{n.widgetState=Object.assign(Object.assign({},n.widgetState),t.widgetState),e(n)})}(this),this.renderChildWidgets()}getWidgetState(e,t){return Object.keys.length&&this.widgetState[e]?this.widgetState[e]:t}}var ac=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function cc(){var e,t,n,o,i,r,s,a,c,l,d,u;let h={entity:0,userConcept:0,userId:0,token:he.BearerAccessToken,email:"",amcode:"",roles:[]};const p=he.profileCache;if(p)return h.entity=null!==(e=p.entityId)&&void 0!==e?e:0,h.userConcept=null!==(t=p.userConcept)&&void 0!==t?t:0,h.userId=null!==(n=p.userId)&&void 0!==n?n:0,h.token=he.BearerAccessToken||p.token||"",h.email=null!==(o=p.email)&&void 0!==o?o:"",h.amcode=null!==(i=p.amcode)&&void 0!==i?i:"",h.roles=null!==(r=p.roles)&&void 0!==r?r:[],h;try{const e=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";if(e){const t=JSON.parse(e);h.entity=null!==(s=null==t?void 0:t.entityId)&&void 0!==s?s:0,h.userConcept=null!==(a=null==t?void 0:t.userConcept)&&void 0!==a?a:0,h.userId=null!==(c=null==t?void 0:t.userId)&&void 0!==c?c:0,h.email=null!==(l=null==t?void 0:t.email)&&void 0!==l?l:"",h.amcode=null!==(d=null==t?void 0:t.amcode)&&void 0!==d?d:"",h.token||(h.token=null!==(u=null==t?void 0:t.token)&&void 0!==u?u:"")}}catch(e){}return h}function lc(){return ac(this,void 0,void 0,function*(){const e=yield Ae(),t=cc();return t.token=e,t})}var dc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class uc extends sc{constructor(){super(...arguments),this.childComponents=[],this.componentMounted=!1,this.oldHtml=null,this.phonebooks=[],this.childrenData={},this.childWidgets=[],this.typeValueList=[],this.widgetType="the_element_name",this.parentConceptList=[],this.customFunctions=[],this.widgetDependenciesData=""}getUserId(){return cc().userId}getTypeValueList(){return dc(this,arguments,void 0,function*(e=""){return new Promise(t=>dc(this,void 0,void 0,function*(){const n=null==(e=this.widgetType)?void 0:e.match(/^[a-z0-9]+_[a-z0-9]+/i),o=n?n[0]:"",i=null==e?void 0:e.match(/^([a-z0-9]+).*_([a-z0-9]+)$/i),r=i?`${i[1]}_${i[2]}`:"";let s=[],a=new xa;a.type=r,a.search="1",a.logicoperator=">",a.name="emailfilter",a.operateon="entityEmail",a.composition=!1,s.push(a);let c=new Nc;c.typeConnection=e,c.name="entityEmail";let l=new Nc;l.type=o,l.filterLogic="( emailfilter )",l.filters=s,l.name="top",l.inpage=100,l.freeschemaQueries=[c],l.outputFormat=zr,xc(l,"").subscribe(n=>{if(null==n?void 0:n.length){const i=null==n?void 0:n.map(t=>{var n,i,s,a,c,l,d;const u=null===(a=null===(s=null===(i=null===(n=t.data)||void 0===n?void 0:n[o])||void 0===i?void 0:i[e])||void 0===s?void 0:s.data)||void 0===a?void 0:a[r];return{id:null===(d=null===(l=null===(c=t.data)||void 0===c?void 0:c[o])||void 0===l?void 0:l[e])||void 0===d?void 0:d.id,name:u,text:u}});return this.typeValueList=i,t(i),i}})}))})}setTitle(e){document.title=e}getHtml(){return this.html}createRandomNumber(){return this.elementIdentifier=1e4*Math.random(),this.elementIdentifier}mount_child(){return dc(this,void 0,void 0,function*(){try{new Function("tsccs",`\n return (async function() {\n ${this.mountChildWidgetsFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw e}})}setProperty(e){return dc(this,void 0,void 0,function*(){return this.widgetType=e,this.getTypeValueList(this.widgetType).then(()=>{var e,t,n;null===(e=this.element)||void 0===e||e.setAttribute("data-type-value",this.widgetType),null===(n=null===(t=this.element)||void 0===t?void 0:t.parentElement)||void 0===n||n.setAttribute("data-type-value",this.widgetType),this.render()}),this})}createTypeEditor(e){!function(e,t){if(e){const n=document.querySelector("#widget-properties #widget-type"),o=null==n?void 0:n.querySelectorAll("input");null==o||o.forEach(e=>{null==e||e.remove()});const i=e.target.closest(".added-widget-container"),r=e.target.closest("div");let s="";i?s=null==i?void 0:i.getAttribute("data-type-value"):r&&(s=null==r?void 0:r.getAttribute("data-type-value"));const a=document.createElement("input");a.setAttribute("type","text"),a.setAttribute("name","input-widgetTypeValue"),a.setAttribute("of",t.elementIdentifier.toString()),a.setAttribute("class","form-control"),a.setAttribute("id","widgetType"),a.setAttribute("onchange","updateWidgetTypeValue(event)"),t.widgetType?a.value=t.widgetType:a.setAttribute("placeholder","e.g. the_entity");let c=t;a.addEventListener("change",function(e){var t,n,o;const i=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value;c.widgetType=i,c.before_render(),c.loadChildWidgets(),null===(o=null===(n=c.element)||void 0===n?void 0:n.parentElement)||void 0===o||o.setAttribute("data-type-value",c.widgetType)}),null==n||n.appendChild(a)}}(e,this)}mount(e){return dc(this,void 0,void 0,function*(){if(e){this.element=document.createElement("div"),this.element.id=this.createWidgetWrapperIdentifier();let t=this;this.inDevelopment?(this.element.onclick=function(e){e.preventDefault(),t.createTypeEditor(e)},this.element.className="mftsccs-marking-element"):this.element.classList.add("mftsccs-marking-rendered"),this.element.innerHTML=this.getHtml(),null==e||e.setAttribute("data-type-value",t.widgetType),e.appendChild(this.element),this.parentElement=e.id,0==this.componentMounted||0==this.widgetMounted?(this.render_custom_functions(),this.render_widgetDependencies(),this.before_render(),this.mount_child(),this.widgetMounted=!0,this.componentMounted=!0):this.render(),this.childWidgetElement=this.getElementByClassName("added-widget-container")}})}render_widgetDependencies(){try{new Function("tsccs",`\n return (async function() {\n ${this.widgetDependenciesData}\n }).call(this);\n `).bind(this)(o)}catch(e){throw e}}render_custom_functions(){var e;const t=null===(e=this.customFunctions)||void 0===e?void 0:e.map(e=>null==e?void 0:e.code).join("");try{new Function("tsccs",`\n return (async function() {\n ${t}\n }).call(this);\n `).bind(this)(o)}catch(e){throw e}}before_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.componentDidMountFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw e}}after_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.addEventFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw e}}CreateConnectionBetweenEntityLocal(e,t,n){return dc(this,void 0,void 0,function*(){var o;const i=e.userId,r=(null===(o=e.type)||void 0===o?void 0:o.characterValue)+"_"+n,s=yield uo(r,999,999,i);return yield io(e.id,t.id,s.id,1e3),"connection created"})}}var hc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function pc(e){var t=arguments;return hc(this,void 0,void 0,function*(){const n=no.logfunction("GetConnectionsBetweenApi",t);let o=[];try{const t=yield Ie(),i=yield be(r.GetConnectionsBetweenUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(!i.ok)throw a(i),new Error(`GetConnectionsBetweenApi error: ${i.status}`);return o=yield i.json(),no.logUpdate(n),o}catch(e){return Error,l(e,r.GetConnectionsBetweenUrl()),d(n,0,e),o}})}function fc(e){var t,n,o,i,r,s,a;return{ofTheConceptId:null!==(t=e.ofTheConceptId)&&void 0!==t?t:0,toTheConceptId:null!==(n=e.toTheConceptId)&&void 0!==n?n:0,typeId:null!==(o=e.typeId)&&void 0!==o?o:0,type:null!==(i=e.type)&&void 0!==i?i:"",oldType:null!==(r=e.oldType)&&void 0!==r?r:"",reverse:null!==(s=e.reverse)&&void 0!==s&&s,isComposition:null!==(a=e.isComposition)&&void 0!==a&&a,connectionIds:[]}}var yc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class mc{constructor(){this.actions={concepts:[],connections:[]},this.success=!0,this.pendingConnectionDeletions=[],this.transactionId=Math.random().toString().substring(5)}initialize(){return yc(this,void 0,void 0,function*(){yield _t.initializeTransaction(this.transactionId)})}commitTransaction(){return yc(this,void 0,void 0,function*(){if(!this.success)throw Error("Query Transaction Expired");yield _t.SyncDataOnline(this.transactionId),yield this.flushPendingConnectionDeletions(),this.actions={concepts:[],connections:[]},this.pendingConnectionDeletions=[],this.success=!1})}commitTransactionWithoutAuth(){return yc(this,void 0,void 0,function*(){if(!this.success)throw Error("Query Transaction Expired");yield _t.SyncDataOnlineWithoutAuth(this.transactionId),yield this.flushPendingConnectionDeletions(),this.actions={concepts:[],connections:[]},this.pendingConnectionDeletions=[],this.success=!1})}rollbackTransaction(){return yc(this,void 0,void 0,function*(){this.success=!1,this.actions={concepts:[],connections:[]},this.pendingConnectionDeletions=[],yield _t.rollbackTransaction(this.transactionId,this.actions)})}markAction(){return yc(this,void 0,void 0,function*(){yield _t.markTransactionActions(this.transactionId,this.actions)})}flushPendingConnectionDeletions(){return yc(this,void 0,void 0,function*(){for(let e=0;e<this.pendingConnectionDeletions.length;e+=300){const t=this.pendingConnectionDeletions.slice(e,e+300);yield bo(t)}})}DeleteConnectionsBetween(e){return yc(this,void 0,void 0,function*(){return this.DeleteConnectionsBetweenBulk([e])})}DeleteConnectionsBetweenBulk(e){return yc(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const t=e.map(fc),n=yield pc(t),o=[];for(const e of n)o.push(...e.connectionIds);return this.pendingConnectionDeletions.push(...o),o}catch(e){throw this.success=!1,e}})}MakeTheInstanceConceptLocal(e,t){return yc(this,arguments,void 0,function*(e,t,n=!1,o,i,r=999,s=0){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield po(e,t,n,o,i,r,s,this.actions);return yield this.markAction(),a}catch(e){throw this.success=!1,e}})}MakeTheTypeConceptLocal(e,t,n,o){return yc(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield uo(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw this.success=!1,e}})}CreateTheConceptLocal(e,t,n,o,i,r){return yc(this,arguments,void 0,function*(e,t,n,o,i,r,s=!1,a=0,c={concepts:[],connections:[]}){try{if(!this.success)throw Error("Query Transaction Expired");const c=yield ao(e,t,n,o,i,r,s,a,this.actions);return yield this.markAction(),c}catch(e){throw this.success=!1,e}})}CreateConnectionBetweenTwoConceptsLocal(e,t,n){return yc(this,arguments,void 0,function*(e,t,n,o=!1){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield $s(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw this.success=!1,e}})}CreateTheConnectionLocal(e,t,n){return yc(this,arguments,void 0,function*(e,t,n,o=1,i="",r=999){try{if(!this.success)throw Error("Query Transaction Expired");const s=yield io(e,t,n,o,i,r,this.actions);return yield this.markAction(),s}catch(e){throw this.success=!1,e}})}CreateConnection(e,t,n){return yc(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield ro(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw this.success=!1,e}})}CreateConnectionBetweenEntityLocal(e,t,n){return yc(this,void 0,void 0,function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield Uc(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw this.success=!1,e}})}CreateTheCompositionLocal(e){return yc(this,arguments,void 0,function*(e,t=null,n=null,o=null,i=null,r=null,s=null,a=!1){try{if(!this.success)throw Error("Query Transaction Expired");const c=yield yo(e,t,n,o,i,r,s,a,this.actions);return yield this.markAction(),c}catch(e){throw this.success=!1,e}})}}const vc={number:/^\d+(\.\d+)?$/,text:/^[\s\S]*$/,textOnly:/^[A-Za-z\s]+$/,email:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,document:/\.(pdf|docx?|pptx?|xlsx?)$/i,sound:/\.(mp3|wav|ogg|flac)$/i,image:/\.(jpg|jpeg|png|gif|bmp|svg|webp)$/i,video:/\.(mp4|avi|mov|mkv|flv|webm)$/i,url:/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/,date:/^\d{4}-\d{2}-\d{2}$/,time:/^(?:[01]\d|2[0-3]):[0-5]\d$/,password:/^.{6,}$/,ipaddress:/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$|^([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})$/,uuid:/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/};var gc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Cc{constructor(){Cc.cacheInitialized||Cc.initializeAnomalyParameters()}static initializeAnomalyParameters(){return gc(this,void 0,void 0,function*(){try{yield Cc.getAnomalyParameters();Cc.refreshCache(),Cc.cacheInitialized=!0}catch(e){}})}static getAnomalyParameters(){return gc(this,void 0,void 0,function*(){const e=Date.now();if(Cc.anomalyParamsCache&&e-Cc.lastFetchedTime<Cc.cacheExpiryThreshold)return Cc.anomalyParamsCache;try{return yield Cc.fetchAnomalyParameters()}catch(e){throw e}})}static fetchAnomalyParameters(){return gc(this,void 0,void 0,function*(){try{const e=yield fetch("https://devai.freeschema.com/v1/get-frontend-anomaly-parameters",{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to fetch anomaly parameters");const t=yield e.json();return Cc.anomalyParamsCache=t.data,Cc.lastFetchedTime=Date.now(),t.data}catch(e){throw e}})}static refreshCache(){return gc(this,void 0,void 0,function*(){try{Date.now()-Cc.lastFetchedTime>Cc.cacheExpiryThreshold&&(yield Cc.getAnomalyParameters())}catch(e){}})}detectDataType(e){for(const[t,n]of Object.entries(vc))if(n.test(e))return t;return null}checkConceptAnomaly(e,t){return gc(this,void 0,void 0,function*(){const n=[];try{if(!t)return n.push("Null value"),{valid:!1,warnings:n};const o=Cc.anomalyParamsCache;e.startsWith("the_")||(e=`the_${e}`);const i=o[e];if(!i)return n.push(`No concept details found for type: ${e}`),{valid:!1,warnings:n};const r=t.length,{min_length:s,max_length:a,data_types:c}=i,l=r>=s&&r<=a,d=this.detectDataType(t),u=c.includes(d);return l||n.push(`Length of '${t}' is outside the allowed range (min: ${s}, max: ${a}). Current length: ${r}.`),u||n.push(`Type mismatch for '${t}'. Expected types: ${c.join(", ")}, detected type: ${d}.`),l&&u&&n.push(`Concept ${e} is valid. Length: ${r}, Type: ${d}`),{valid:l&&u,warnings:n}}catch(e){return{valid:!1,warnings:n}}})}static checkAnomalyInBulk(e){return gc(this,void 0,void 0,function*(){Cc.cacheInitialized||(yield Cc.initializeAnomalyParameters());try{const t={};for(const[n,o]of Object.entries(e)){const e=o.value,{valid:i,warnings:r}=yield(new Cc).checkConceptAnomaly(n,e);t[n]={valid:i,warnings:r}}return t}catch(e){throw e}})}static getExportedFunction(){return Object.keys(o)}static getFunctionaAnomalyParameters(){}}Cc.anomalyParamsCache=null,Cc.cacheInitialized=!1,Cc.lastFetchedTime=0,Cc.cacheExpiryThreshold=6e5;var wc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Ic{checkUniqueness(e,t){return wc(this,void 0,void 0,function*(){const n=no.logfunction("checkUniqueness");e.startsWith("the_")||(e="the_"+e);let o=(yield Vo(e,999)).id;return!((yield Dn(t,o)).id>0)&&(no.logUpdate(n),!0)})}validateField(e){return wc(this,void 0,void 0,function*(){var t;const n=no.logfunction("validateField");try{performance.now();const o={},{name:i,value:r,type:s,dataType:a,pattern:c,conceptType:l,maxLength:d,minLength:u,minValue:h,maxValue:p,accept:f,file:y,required:m,isUnique:v}=e;if(!m||null!==r&&""!==r||(o.required=`The field ${i} is required.`),a&&r){let e=vc[a];e&&""!==r&&!e.test(r)&&(o.dataType=`Invalid value for ${a}`)}if(c&&r){const e="string"==typeof c?new RegExp(c):c;""===r||e.test(r)||(o.pattern="Pattern doesn't match with value")}if(r&&null!=d&&r.length>d&&(o.maxLength=`Length exceeds the maximum length of ${d}`),r&&null!=u&&r.length<u&&(o.minLength=`Length must be at least ${u} characters long`),null!=h&&r&&!isNaN(Number(r))&&Number(r)<h&&(o.minValue=`Value must be greater than or equal to ${h}`),null!=p&&r&&!isNaN(Number(r))&&Number(r)>p&&(o.maxValue=`Value must be less than or equal to ${p}`),y&&s&&f){const e=f.split(",").map(e=>e.trim().toLowerCase()),n=null===(t=y.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();n&&!e.includes(n)&&(o.accept=`File must be a valid file type: ${e.join(", ")}`)}if(l&&v&&r){(yield this.checkUniqueness(l,r))||(o.unique="Value is not unique")}return no.logUpdate(n),o}catch(e){throw d(n,0,e),e}})}validateForm(e){return wc(this,void 0,void 0,function*(){const t=no.logfunction("validateForm");try{performance.now();const n={};for(const t in e){const o=yield this.validateField(e[t]);Object.keys(o).length>0&&(n[t]=o)}return no.logUpdate(t),n}catch(e){throw d(t,0,e),e}})}validate(e){const t=no.logfunction("validate");try{let n={};return this.validateField(e).then(e=>{Object.keys(e).length>0?(n.status=!1,n.details=e):n.status=!0}),no.logUpdate(t),n}catch(e){d(t,0,e)}}}const Tc=e=>{var t;const n=document.getElementsByName(e)[0];if(!n)return{name:null,value:null,type:null,dataType:null,pattern:null,conceptType:null,maxLength:null,minLength:null,minValue:null,maxValue:null,accept:null,file:null,required:!1,isUnique:!0};const o=n.hasAttribute("required")||"true"===n.getAttribute("data-required"),i=n.hasAttribute("isUnique")&&"true"===n.getAttribute("isUnique");return{name:n.name,value:n.value,type:n.type,dataType:n.getAttribute("data-type"),pattern:n.getAttribute("data-pattern"),conceptType:n.getAttribute("concept-type"),maxLength:n.getAttribute("maxlength")?parseInt(n.getAttribute("maxlength")):null,minLength:n.getAttribute("minlength")?parseInt(n.getAttribute("minlength")):null,minValue:n.getAttribute("min")?parseInt(n.getAttribute("min")):null,maxValue:n.getAttribute("max")?parseInt(n.getAttribute("max")):null,accept:n.getAttribute("accept")||null,file:"file"===n.type&&(null===(t=n.files)||void 0===t?void 0:t[0])||null,required:o,isUnique:i}};var kc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function bc(e,t){var n=arguments;return kc(this,void 0,void 0,function*(){const o=no.logfunction("DeleteConnectionByType",n)||{};if(ed){o.serviceWorker=!0;try{const n=yield yd("DeleteConnectionByType",{id:e,linker:t});return no.logUpdate(o),n.data}catch(e){d(o,0,e),Td(e)}}let i=yield $o(e);for(let e=0;e<i.length;e++)Je.AddConnection(i[e]);let r=yield Je.GetConnectionsOfConcept(e),s=yield ln(t),a=[];for(let e=0;e<r.length;e++)r[e].typeId==s.id&&a.push(r[e]);let c=!1;for(let e=0;e<a.length;e++)c=yield ko(a[e].id);return no.logUpdate(o),c})}function Ac(e,t){var n=arguments;return kc(this,void 0,void 0,function*(){const o=no.logfunction("DeleteConnectionByTypeBulk",n)||{};if(ed){o.serviceWorker=!0;try{const n=yield yd("DeleteConnectionByTypeBulk",{id:e,linkers:t});return no.logUpdate(o),n.data}catch(e){d(o,0,e),Td(e)}}let i=yield $o(e);for(let e=0;e<i.length;e++)Je.AddConnection(i[e]);let r=yield Je.GetConnectionsOfConcept(e),s=[];s=yield Go(t);let a=[];for(let e=0;e<r.length;e++)for(let t=0;t<s.length;t++)r[e].typeId==s[t].id&&a.push(r[e].id);return no.logUpdate(o),yield bo(a)})}function Sc(e,t){return kc(this,arguments,void 0,function*(e,t,n=!1){if(ed)try{return(yield yd("GetAllTheConnectionsByTypeAndOfTheConcept",{id:e,linker:t,reverse:n})).data}catch(e){Td(e)}let o=[];if(n){let n=yield zo(e),i=yield Vo(t,999);for(let e=0;e<n.length;e++)n[e].typeId==i.id&&o.push(n[e])}else{let n=yield $o(e);for(let e=0;e<n.length;e++)Je.AddConnection(n[e]);let i=yield Je.GetConnectionsOfConcept(e),r=yield ln(t);for(let e=0;e<i.length;e++)i[e].typeId==r.id&&o.push(i[e])}return o})}class Nc{constructor(){this.type="",this.inpage=10,this.page=1,this.concepts=[],this.conceptIds=[],this.selectors=[],this.freeschemaQueries=[],this.filters=[],this.filterLogic="",this.typeConnection="",this.order="DESC",this.outputFormat=Hr,this.name="",this.filterAncestor="",this.reverse=!1,this.limit=!1,this.isSecure=!0,this.includeInFilter=!1,this.isOldConnectionType=!1,this.cache=!0,this.usePipelineQuery=!1}}var _c=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Pc(e){var t=arguments;return _c(this,arguments,void 0,function*(e,n=""){const o=no.logfunction("FreeschemaQueryApi",t);var i=yield Te("application/json",n);const s=r.FreeschemaQueryUrl(),c=JSON.stringify(e),u=yield oe.getHash(e),h=!1!==e.cache?oe.get(u):null;if(h)return be(s,{method:"POST",headers:i,body:c}).then(e=>_c(this,void 0,void 0,function*(){if(e.ok){const t=yield e.json();oe.set(u,t)}else a(e)})).catch(e=>{l(e,s),d(o,0,e)}),h;try{const e=yield be(s,{method:"POST",headers:i,body:c});if(e.ok){let t=yield e.json();return oe.set(u,t),no.logUpdate(o),t}return a(e),[]}catch(e){l(e,s),d(o,0,e)}})}var Ec=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Lc extends la{constructor(e,t){super(),this.query=new Nc,this.countInfoStrings=[],this.order="DESC",this.totalCount=0,this.unsubscribeCache=null,this.cacheSubscriptionStarted=!1,this.query=e,this.format=e.outputFormat,this.order=e.order}ensureCacheSubscription(){this.cacheSubscriptionStarted||(this.cacheSubscriptionStarted=!0,oe.getHash(this.query).then(e=>{this.isDisposed||(this.unsubscribeCache=oe.subscribe(e,e=>Ec(this,void 0,void 0,function*(){this.isDataLoaded=!1,yield this.bind(),this.notify()})))}))}onDispose(){this.unsubscribeCache&&(this.unsubscribeCache(),this.unsubscribeCache=null),this.cacheSubscriptionStarted=!1}run(){return Ec(this,void 0,void 0,function*(){var e,t;try{this.query.outputFormat=Kr,this.compositionIds=[];let n=yield Pc(this.query,"");return this.conceptIds=n.conceptIds,this.internalConnections=null!==(e=n.internalConnections)&&void 0!==e?e:[],this.linkers=null!==(t=n.linkers)&&void 0!==t?t:[],this.reverse=n.reverse,this.compositionIds=n.mainCompositionIds,this.totalCount=n.mainCount,this.countInfoStrings=n.countinfo,yield this.build()}catch(e){throw e}})}bind(){return Ec(this,void 0,void 0,function*(){var e,t;try{if(this.ensureCacheSubscription(),this.compositionIds.length>0)for(let e=0;e<this.compositionIds.length;e++)this.removeListenToEvent(this.compositionIds[e]);if(this.isDataLoaded)for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);else{this.query.outputFormat=Kr,this.compositionIds=[];let n=yield Pc(this.query,"");this.conceptIds=n.conceptIds,this.internalConnections=null!==(e=n.internalConnections)&&void 0!==e?e:[],this.linkers=null!==(t=n.linkers)&&void 0!==t?t:[],this.reverse=n.reverse,this.compositionIds=n.mainCompositionIds,this.totalCount=n.mainCount,this.countInfoStrings=n.countinfo}let n=yield this.build();if(!this.isDataLoaded){this.isDataLoaded=!0;for(let e=0;e<this.compositionIds.length;e++)this.listenToEvent(this.compositionIds[e]);if(""!=this.query.type){let e=yield Vo(this.query.type,999);e.id>0&&this.listenToEventType(e.id)}}for(let e=0;e<this.newIds.length;e++)this.listenToEvent(this.newIds[e]);return this.newIds=[],n}catch(e){throw e}})}build(){return Ec(this,void 0,void 0,function*(){try{no.logfunction("build",["schemaquery",this.compositionIds]);let e=cs(this.countInfoStrings);return this.format==zr?this.data=yield Cs(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==Jr?this.data=yield gs(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==Xr?this.data=yield ws(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==Yr?(this.data={},this.data.linkers=this.linkers,this.data.conceptIds=this.conceptIds,this.data.compositionIds=this.compositionIds,this.data.reverse=this.reverse,this.data.countInfos=e,this.data.order=this.order):this.data=yield vs(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e),this.data}catch(e){throw e}})}}function xc(e,t){return new Lc(e,t)}function Rc(e,t){return Ec(this,void 0,void 0,function*(){const n=new Lc(e,t);try{return yield n.execute()}finally{n.dispose()}})}class Oc{constructor(){this.id=0,this.name="",this.html="",this.css="",this.js="",this.library={css:[],js:[]},this.assistant={id:"",input:"",type:""},this.timestamp="",this.widgetId=0,this.type="",this.clean="",this.after_render="",this.before_render="",this.custom_functions=[],this.update="",this.origin=0,this.version=0,this.mount_child="",this.children=[],this.wrapper="0",this.widget=new uc,this.dependency="",this.root=0}}var Dc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Uc(e,t,n){return Dc(this,arguments,void 0,function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,a,c;const l=no.logfunction("CreateConnectionBetweenEntityLocal",[e.id,t.id,n]);if(ed)try{const c=yield yd("CreateConnectionBetweenEntityLocal",{concept1Data:e,concept2Data:t,linker:n,actions:o});return(null===(r=null===(i=null==c?void 0:c.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(c.actions.concepts))),(null===(a=null===(s=null==c?void 0:c.actions)||void 0===s?void 0:s.connections)||void 0===a?void 0:a.length)&&(o.connections=JSON.parse(JSON.stringify(c.actions.connections))),c.data}catch(e){Td(e)}const d=e.userId,u=(null===(c=e.type)||void 0===c?void 0:c.characterValue)+"_"+n,h=yield uo(u,999,999,d,o);if(!h)return;const p=yield io(e.id,t.id,h.id,1e3,void 0,void 0,o);return no.logUpdate(l),p})}var Fc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const Bc=new Map,Mc=new Map,Gc=new Map;function jc(e,t){r.isPwa&&(()=>Fc(this,void 0,void 0,function*(){const n=new Set(t);for(const t of e){const e=yield Je.GetConnection(t);e&&(null==e?void 0:e.id)>0&&(n.add(e.ofTheConceptId),n.add(e.toTheConceptId),n.add(e.typeId),m("connection",e))}for(const e of n)if(e>0){const t=yield U.GetConcept(e);t&&t.id>0&&m("concept",t)}}))().catch(()=>{})}function Wc(e){var t=arguments;return Fc(this,void 0,void 0,function*(){no.logfunction("BuildWidgetFromId",t);try{if(ed){return(yield yd("BuildWidgetFromId",{id:e})).data}}catch(e){Td(e)}let n={};if(Bc.has(e))return Bc.get(e)||n;let o=yield Ie("application/json"),i=r.getWidgetData()+"?id="+e;const s=te.getWidget(e);if(s){be(i,{method:"GET",headers:o}).then(t=>Fc(this,void 0,void 0,function*(){if(t.ok){const n=yield t.json();te.setWidget(e,n)}else a(t)})).catch(()=>{});let t=cs(s.countinfo),n=yield Cs(s.linkers,s.conceptIds,s.mainCompositionIds,s.reverse,t,"DESC");return jc(s.linkers,s.conceptIds),n}const c=(()=>Fc(this,void 0,void 0,function*(){try{const t=yield be(i,{method:"GET",headers:o});if(t.ok){let o=yield t.json();te.setWidget(e,o);let i=cs(o.countinfo);return n=yield Cs(o.linkers,o.conceptIds,o.mainCompositionIds,o.reverse,i,"DESC"),jc(o.linkers,o.conceptIds),n}return a(t),[]}catch(e){throw e}finally{Bc.delete(e)}}))();return Bc.set(e,c),c})}function Vc(e){var t=arguments;return Fc(this,void 0,void 0,function*(){no.logfunction("BuildWidgetFromIdForLatest",t);try{if(ed){return(yield yd("BuildWidgetFromIdForLatest",{id:e})).data}}catch(e){Td(e)}let n={};if(Mc.has(e))return Mc.get(e)||n;let o=yield Ie("application/json");const i=te.getLatest(e);if(i){(()=>Fc(this,void 0,void 0,function*(){let t;try{let n=r.getLatestWidgetData()+"?id="+e;t=yield be(n,{method:"GET",headers:o})}catch(n){t=yield Ke({method:"GET",headers:o},"?id="+e)}if(t.ok){const n=yield t.json();te.setLatest(e,n)}else a(t)}))().catch(()=>{});let t=cs(i.countinfo),n=yield Cs(i.linkers,i.conceptIds,i.mainCompositionIds,i.reverse,t,"DESC");return jc(i.linkers,i.conceptIds),{data:n,mainId:i.mainId}}const s=(()=>Fc(this,void 0,void 0,function*(){try{let t;try{let n=r.getLatestWidgetData()+"?id="+e;t=yield be(n,{method:"GET",headers:o})}catch(n){t=yield Ke({method:"GET",headers:o},"?id="+e)}if(t.ok){let o=yield t.json();te.setLatest(e,o);let i=cs(o.countinfo);return n=yield Cs(o.linkers,o.conceptIds,o.mainCompositionIds,o.reverse,i,"DESC"),jc(o.linkers,o.conceptIds),{data:n,mainId:o.mainId}}return a(t),[]}catch(e){throw e}finally{Mc.delete(e)}}))();return Mc.set(e,s),s})}function qc(){te.clearAll(),oe.clearAll()}function $c(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Hc(e,t,n){const o=he.sessionId||"unknown",i={url:location.href,requestFrom:r.BASE_APPLICATION,sessionId:o,description:t};no.logApplication("USER_EVENT",e,i)}class zc extends sc{constructor(e,t,n,o="",i=10){super(),this.inpage=10,this.selector=t,this.mainType=e,this.filterType=o,this.inpage=i,this.parentDomElement=n,this.mount(this.parentDomElement)}before_render(){this.render()}addFilter(e){if(""!=e){let t=new xa;t.search=e,t.type=this.filterType,t.logicoperator="like",t.operateon="selector",t.name="selector_filter";let n="( selector_filter )";this.query.filters=[t],this.query.filterLogic=n}else this.query.filters=[],this.query.filterLogic=""}after_render(){let e=this.getElementById("selector"),t=this.getElementById("search-bar"),n=this;t.onchange=()=>{n.addFilter(t.value),n.mainDetails.update()};let o=new Nc;o.type=this.mainType,o.inpage=this.inpage;let i=new Nc;i.typeConnection=this.selector,i.name="selector",o.freeschemaQueries=[i],this.query=o,xc(this.query,"").subscribe((t,n)=>{let o={};this.mainDetails=n;for(let e=0;e<t.length;e++){let n=t[e],i=n.id,r=n[this.mainType];if(r){let e=r[this.selector];if(e){const t=Object.values(e)[0];o[i]=t}}}$c(e);for(const[t,n]of Object.entries(o)){const o=document.createElement("option");o.value=t,o.textContent=n,e.appendChild(o)}})}getHtml(){const e=document.createElement("style");return e.textContent="\n.search-select-wrapper {\n width: 300px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n font-family: Arial, sans-serif;\n}\n\n#search-bar {\n padding: 8px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 6px;\n}\n\n#selector {\n padding: 6px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 6px;\n}\n",document.head.prepend(e),this.html='\n <div class="search-select-wrapper">\n <input type="text" placeholder="Select or type..." id=\'search-bar\'>\n <select id=\'selector\'>\n </div>',this.html}}var Jc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Qc{static get baseUrl(){return r.ACCESS_CONTROL_BASE_URL}static getAsync(e){return Jc(this,void 0,void 0,function*(){const t=yield be(`${this.baseUrl}${e}`,{method:"GET",headers:yield Ie()});if(!t.ok)throw new Error(`GET '${e}' failed with status ${t.status}`);const n=yield t.json();if(null==n)throw new Error(`The response for GET '${e}' returned null.`);return n})}static postAsync(e,t){return Jc(this,void 0,void 0,function*(){const n=yield be(`${this.baseUrl}${e}`,{method:"POST",headers:yield Ie(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`POST '${e}' failed with status ${n.status}`);const o=yield n.json();if(null==o)throw new Error(`The response for POST '${e}' returned null.`);return o})}static deleteAsync(e,t){return Jc(this,void 0,void 0,function*(){const n={method:"DELETE",headers:yield Ie()};null!=t&&(n.body=JSON.stringify(t));const o=yield be(`${this.baseUrl}${e}`,n);if(!o.ok)throw new Error(`DELETE '${e}' failed with status ${o.status}`);const i=yield o.json();if(null==i)throw new Error(`The response for DELETE '${e}' returned null.`);return i})}assignAccessAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/assign",e)})}checkAccessAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/check",e)})}revokeAccessAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.deleteAsync("/access/revoke",e)})}assignAccessBulkAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/assign/bulk",e)})}revokeAccessBulkAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.deleteAsync("/access/revoke/bulk",e)})}checkAccessBulkAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/check/bulk",e)})}getAccessByIdAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.getAsync(`/access/${e}`)})}setAccessInheritanceAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/inheritance",e)})}getAccessInheritanceStatusAsync(e){return Jc(this,arguments,void 0,function*(e,t=999){return Qc.getAsync(`/access/inheritance/status?accessId=${e}&connectionTypeId=${t}`)})}assignSuperAdminAccessAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/super-admin",e)})}revokeSuperAdminAccessAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.deleteAsync("/access/super-admin",e)})}checkSuperAdminStatusAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.getAsync(`/access/super-admin?accessId=${e}`)})}assignConceptAccessAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/concept/assign",e)})}assignConceptAccessBulkAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/concept/assign/bulk",e)})}revokeConceptAccessBulkAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/concept/revoke/bulk",e)})}setParentAccessInheritanceAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/inheritance/parent",e)})}removeParentAccessInheritanceAsync(e,t){return Jc(this,void 0,void 0,function*(){let n=`/access/inheritance/parent?accessId=${e}`;return null!=t&&(n+=`&parentAccessId=${t}`),Qc.deleteAsync(n)})}hasParentAccessInheritanceAsync(e,t){return Jc(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/status?accessId=${e}`;return null!=t&&(n+=`&parentAccessId=${t}`),Qc.getAsync(n)})}getParentAccessIdAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.getAsync(`/access/inheritance/parent?accessId=${e}`)})}setParentAccessInheritanceByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/inheritance/parent/concept",e)})}setParentAccessInheritanceBulkByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/inheritance/parent/concept/bulk",e)})}removeParentAccessInheritanceByConceptAsync(e,t){return Jc(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/concept?childConceptId=${e}`;return null!=t&&(n+=`&parentConceptId=${t}`),Qc.deleteAsync(n)})}removeParentAccessInheritanceBulkByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.deleteAsync("/access/inheritance/parent/concept/bulk",e)})}hasParentAccessInheritanceByConceptAsync(e,t){return Jc(this,void 0,void 0,function*(){let n=`/access/inheritance/parent/concept/status?childConceptId=${e}`;return null!=t&&(n+=`&parentConceptId=${t}`),Qc.getAsync(n)})}getParentAccessIdByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.getAsync(`/access/inheritance/parent/concept?childConceptId=${e}`)})}assignSuperAdminByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/super-admin/concept",e)})}revokeSuperAdminByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.deleteAsync("/access/super-admin/concept",e)})}checkSuperAdminByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.getAsync(`/access/super-admin/concept?conceptId=${e}`)})}setAccessInheritanceByConceptAsync(e){return Jc(this,void 0,void 0,function*(){return Qc.postAsync("/access/inheritance/concept",e)})}getAccessInheritanceStatusByConceptAsync(e){return Jc(this,arguments,void 0,function*(e,t=999){return Qc.getAsync(`/access/inheritance/concept/status?conceptId=${e}&connectionTypeId=${t}`)})}}var Yc=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class Kc{constructor(e){this.apiClient=e||new Qc}checkAccess(e,t,n){return Yc(this,void 0,void 0,function*(){var o;if(!t||""===t.trim())throw new Error("Permission is required");return null!==(o=(yield this.checkAccessBulk([e],t.toLowerCase(),n)).get(e))&&void 0!==o&&o})}checkAccessBulk(e,t,n){return Yc(this,void 0,void 0,function*(){var o,i,s,a,c,l;if(!t||""===t.trim())throw new Error("Permission is required");t=t.toLowerCase();const d=new Map;if(!e||0===e.length)return d;if(!r.FLAGS||!r.FLAGS.accessControl){for(const t of e)d.set(t,!0);return d}if(null!=n&&n>0)try{if(yield this.isSuperAdmin(n)){for(const t of e)d.set(t,!0);return d}}catch(e){}const u=[],h=new Set,p=new Map;let f=null;if(null!=n&&n>0)try{f=yield on(n)}catch(e){}const y=yield Xe(e),m=new Map;for(const e of y)m.set(e.id,e);const v=new Map;for(const t of e){const e=null!==(o=m.get(t))&&void 0!==o?o:yield on(t);if(!e||0===e.id){d.set(t,!1);continue}const n=null!==(i=e.accessId)&&void 0!==i?i:0,r=null!==(s=e.typeId)&&void 0!==s?s:0;if(f&&f.userId&&f.userId===e.userId){d.set(t,!0);continue}if(null===e.referentId||void 0===e.referentId||0===e.referentId){d.set(t,!0);continue}if(n<1e4){d.set(t,!0);continue}let c=0;if(r>0){let e=v.get(r);if(!e)try{e=yield on(r),v.set(r,e)}catch(e){}e&&(c=null!==(a=e.accessId)&&void 0!==a?a:0)}u.push({conceptId:t,accessId:n,typeAccessId:c}),n>0&&(h.add(n),p.set(n,t)),c>0&&h.add(c)}if(0===u.length)return d;const g=yield this.resolveBulkInheritanceGraph(h,0,p),C=[],w=new Set;for(const e of g.values())for(const t of e)w.has(t)||(w.add(t),C.push(t));const I=yield this.resolveSubjects(n),T=yield this.resolveBulkDecisions(C,t,I);for(const e of u){const t=null!==(c=g.get(e.accessId))&&void 0!==c?c:[e.accessId],n=e.typeAccessId>0?null!==(l=g.get(e.typeAccessId))&&void 0!==l?l:[e.typeAccessId]:[];d.set(e.conceptId,this.hasAnyGrant(t,n,I,T))}return d})}getConceptIdsWithPermission(e,t,n){return Yc(this,void 0,void 0,function*(){if(!e||""===e.trim())throw new Error("Permission is required");if(!t||0===t.length)return[];const o=yield this.checkAccessBulk(t,e.toLowerCase(),n);return t.filter(e=>!0===o.get(e))})}resolveBulkInheritanceGraph(e,t,n){return Yc(this,void 0,void 0,function*(){var o,i,r,s,a,c,l,d,u,h,p,f,y,m;const v=new Map,g=new Set;let C=new Set(e),w=0;for(;C.size>0&&!(w>=10);){w++;const e=new Set;for(const e of C)g.add(e);const I=Array.from(C);for(const t of I)try{const n=null!==(o=yield $o(t))&&void 0!==o?o:[];for(const o of n){if("the_parent_access_inheritance"!==(null!==(a=null!==(r=null!==(i=o.connectionTypeName)&&void 0!==i?i:o.typeName)&&void 0!==r?r:null===(s=o.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").toString().toLowerCase())continue;const n=null!==(l=null!==(c=o.toTheConceptId)&&void 0!==c?c:o.toConceptId)&&void 0!==l?l:0;n>0&&!g.has(n)&&(v.has(t)||v.set(t,[]),v.get(t).push(n),e.add(n))}}catch(e){}for(const t of I)try{const n=yield this.apiClient.getParentAccessIdAsync(t);if(!0===(null==n?void 0:n.status)&&void 0!==n.data&&null!==n.data){const o=Kc.parseIntData(n);null!==o&&o>0&&!g.has(o)&&(v.has(t)||v.set(t,[]),v.get(t).push(o),e.add(o))}}catch(e){}for(const o of I)try{const i=yield this.apiClient.getAccessInheritanceStatusAsync(o);if(!Kc.parseBoolData(i))continue;const r=n.get(o);if(!r||0===r)continue;const s=null!==(d=yield $o(r))&&void 0!==d?d:[];for(const i of s){if((null!==(h=null!==(u=i.ofTheConceptId)&&void 0!==u?u:i.ofConceptId)&&void 0!==h?h:0)!==r)continue;if(t>0&&(null!==(p=i.typeId)&&void 0!==p?p:0)!==t)continue;const s=null!==(y=null!==(f=i.toTheConceptId)&&void 0!==f?f:i.toConceptId)&&void 0!==y?y:0;if(s)try{const t=yield on(s),i=null!==(m=null==t?void 0:t.accessId)&&void 0!==m?m:0;i>0&&!g.has(i)&&(v.has(o)||v.set(o,[]),v.get(o).push(i),n.set(i,s),e.add(i))}catch(e){}}}catch(e){}for(const t of g)e.delete(t);C=e}const I=new Map;for(const t of e){const e=[t],n=new Set([t]),o=[t];for(;o.length>0&&e.length<100;){const t=o.shift(),i=v.get(t);if(i)for(const t of i)n.has(t)||(n.add(t),e.push(t),o.push(t))}I.set(t,e)}return I})}resolveBulkDecisions(e,t,n){return Yc(this,void 0,void 0,function*(){var o;const i=new Map;for(const r of n)try{const n={accessIds:e,permission:t,entityId:r},s=yield this.apiClient.checkAccessBulkAsync(n);if(!0===(null==s?void 0:s.status)&&s.data&&Array.isArray(s.data)){const t=new Map;for(const e of s.data)t.set(e.accessId,e.hasAccess);for(const n of e)i.set(`${n}:${null!=r?r:0}`,null!==(o=t.get(n))&&void 0!==o&&o)}else for(const t of e)i.set(`${t}:${null!=r?r:0}`,!1)}catch(t){for(const t of e)i.set(`${t}:${null!=r?r:0}`,!1)}return i})}resolveSubjects(e){return Yc(this,void 0,void 0,function*(){var t,n,o,i,r,s,a;const c=[null];if(null!=e&&e>0){c.push(e);try{const l=null!==(t=yield $o(e))&&void 0!==t?t:[];for(const e of l){if("the_entity_s_group"!==(null!==(r=null!==(o=null!==(n=e.connectionTypeName)&&void 0!==n?n:e.typeName)&&void 0!==o?o:null===(i=e.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"").toString().toLowerCase())continue;const t=null!==(a=null!==(s=e.toTheConceptId)&&void 0!==s?s:e.toConceptId)&&void 0!==a?a:0;t>0&&c.push(t)}}catch(e){}}return c})}hasAnyGrant(e,t,n,o){for(const t of e)for(const e of n)if(!0===o.get(`${t}:${null!=e?e:0}`))return!0;for(const e of t)for(const t of n)if(!0===o.get(`${e}:${null!=t?t:0}`))return!0;return!1}assignAccess(e){return Yc(this,void 0,void 0,function*(){if(!e||!e.conceptIds||0===e.conceptIds.length)throw new Error("Request must contain at least one conceptId");try{const t=yield this.apiClient.assignConceptAccessBulkAsync(e);if(!0!==(null==t?void 0:t.status))throw new Error((null==t?void 0:t.message)||"Failed to assign bulk access");return(null==t?void 0:t.data)&&Array.isArray(t.data)?t.data:[]}catch(e){throw e}})}revokeAccess(e,t,n){return Yc(this,void 0,void 0,function*(){var o;try{const i=null!==(o=(yield on(e)).accessId)&&void 0!==o?o:0;if(0===i)throw new Error(`Concept with ID ${e} does not have a valid accessId`);const r=yield this.apiClient.revokeAccessAsync({accessId:i,permission:t,entityId:n});return!0===(null==r?void 0:r.status)}catch(o){throw new Error(`Error revoking access for concept ${e}, permission '${t}', entityId ${n}: ${o}`)}})}revokeAccessBulk(e){return Yc(this,void 0,void 0,function*(){if(!e||!e.conceptIds||0===e.conceptIds.length)throw new Error("Request must contain at least one conceptId");try{const t=yield this.apiClient.revokeConceptAccessBulkAsync(e);if(!0!==(null==t?void 0:t.status))throw new Error((null==t?void 0:t.message)||"Failed to revoke bulk concept access");return(null==t?void 0:t.data)&&Array.isArray(t.data)?t.data:[]}catch(e){throw e}})}setAccessInheritance(e){return Yc(this,void 0,void 0,function*(){var t;try{const n=yield this.apiClient.setAccessInheritanceByConceptAsync({conceptId:e,connectionTypeId:999});return null!==(t=null==n?void 0:n.status)&&void 0!==t&&t}catch(t){throw new Error(`Error setting access inheritance for conceptId ${e}: ${t}`)}})}getAccessInheritanceStatus(e){return Yc(this,arguments,void 0,function*(e,t=999){try{const n=yield this.apiClient.getAccessInheritanceStatusByConceptAsync(e,t);return Kc.parseBoolData(n)}catch(t){throw new Error(`Error getting access inheritance status for conceptId ${e}: ${t}`)}})}setAccessInheritanceStatus(e,t){return Yc(this,arguments,void 0,function*(e,t,n=999){var o;try{const i=yield this.apiClient.setAccessInheritanceByConceptAsync({conceptId:e,enable:t,connectionTypeId:n});return null!==(o=null==i?void 0:i.status)&&void 0!==o&&o}catch(t){throw new Error(`Error setting access inheritance status for conceptId ${e}: ${t}`)}})}setParentAccessInheritance(e,t){return Yc(this,void 0,void 0,function*(){try{const n=yield this.apiClient.setParentAccessInheritanceByConceptAsync({parentConceptId:t,childConceptId:e});if(!0===(null==n?void 0:n.status)){const e=Kc.parseIntData(n);if(null!==e&&e>0)return e}return 0}catch(t){throw new Error(`Error setting parent access inheritance for conceptId ${e}: ${t}`)}})}setParentAccessInheritanceBulk(e,t){return Yc(this,void 0,void 0,function*(){try{const n=yield this.apiClient.setParentAccessInheritanceBulkByConceptAsync({parentConceptId:t,childConceptIds:e});return!0===(null==n?void 0:n.status)&&Array.isArray(n.data)?n.data:[]}catch(e){throw new Error(`Error setting bulk parent access inheritance for parentConceptId ${t}: ${e}`)}})}removeParentAccessInheritance(e,t){return Yc(this,void 0,void 0,function*(){var n;try{const o=yield this.apiClient.removeParentAccessInheritanceByConceptAsync(e,t);return null!==(n=null==o?void 0:o.message)&&void 0!==n?n:"Parent access inheritance removal failed"}catch(t){throw new Error(`Error removing parent access inheritance for conceptId ${e}: ${t}`)}})}removeParentAccessInheritanceBulk(e,t){return Yc(this,void 0,void 0,function*(){try{const n=yield this.apiClient.removeParentAccessInheritanceBulkByConceptAsync({parentConceptId:null!=t?t:0,childConceptIds:e});return!0===(null==n?void 0:n.status)&&Array.isArray(n.data)?n.data:[]}catch(e){throw new Error(`Error removing bulk parent access inheritance: ${e}`)}})}hasParentAccessInheritance(e,t){return Yc(this,void 0,void 0,function*(){try{const n=yield this.apiClient.hasParentAccessInheritanceByConceptAsync(e,t);return Kc.parseBoolData(n)}catch(t){throw new Error(`Error checking parent access inheritance for conceptId ${e}: ${t}`)}})}getParentAccessId(e){return Yc(this,void 0,void 0,function*(){try{const t=yield this.apiClient.getParentAccessIdByConceptAsync(e);return Kc.parseIntData(t)}catch(t){throw new Error(`Error getting parent access ID for conceptId ${e}: ${t}`)}})}isSuperAdmin(e){return Yc(this,void 0,void 0,function*(){try{if(0===e)return!1;if(!r.FLAGS||!r.FLAGS.accessControl)return!0;const t=yield this.apiClient.checkSuperAdminByConceptAsync(e);return Kc.parseBoolData(t)}catch(t){throw new Error(`Error checking super admin status for entityId ${e}: ${t}`)}})}assignSuperAdmin(e){return Yc(this,void 0,void 0,function*(){try{const t=yield this.apiClient.assignSuperAdminByConceptAsync({conceptId:e});return!0===(null==t?void 0:t.status)&&void 0!==t.data?e:0}catch(t){throw new Error(`Failed to assign super admin for entityId ${e}: ${t}`)}})}revokeSuperAdmin(e){return Yc(this,void 0,void 0,function*(){try{const t=yield this.apiClient.revokeSuperAdminByConceptAsync({conceptId:e});return!0===(null==t?void 0:t.status)&&t.message?t.message:"Super admin access deletion failed"}catch(t){throw new Error(`Failed to revoke super admin for entityId ${e}: ${t}`)}})}makeConceptPrivate(e){return Yc(this,void 0,void 0,function*(){var t,n,o,i,r,s,a,c;try{if(!e)throw new Error("conceptId is required");const l=yield on(e);if(!l||0===l.id)throw new Error(`Concept with ID ${e} not found`);const d="function"==typeof globalThis.getUserDetails?globalThis.getUserDetails():null;let u=Number(null!==(i=null!==(o=null!==(n=null!==(t=null==d?void 0:d.entity)&&void 0!==t?t:null==d?void 0:d.entityId)&&void 0!==n?n:null==d?void 0:d.userConcept)&&void 0!==o?o:null==d?void 0:d.userId)&&void 0!==i?i:0)||0;if(!u)throw new Error("Logged-in entity id not found");if(l.userId!==u)throw new Error("Only the owner may make the concept private");const h=["read","write","execute","delete"];let p=null!==(r=l.accessId)&&void 0!==r?r:0;const f={conceptIds:[e],permissions:h,entityId:u},y=yield this.apiClient.assignConceptAccessBulkAsync(f);if(!y||!0!==y.status)throw new Error(`Failed to assign permissions for entity ${u} via bulk API`);if(Array.isArray(y.data))for(const e of y.data){const t=null!==(a=null!==(s=e.accessId)&&void 0!==s?s:e.data)&&void 0!==a?a:0;"number"==typeof t&&t>p&&(p=t)}else"number"==typeof y.data&&y.data>p&&(p=y.data);return p&&p!==(null!==(c=l.accessId)&&void 0!==c?c:0)&&(l.accessId=p,U.AddConcept(l)),!0}catch(t){throw new Error(`Error making concept ${e} private: ${t}`)}})}static parseBoolData(e){if(!(null==e?void 0:e.status)||void 0===e.data||null===e.data)return!1;const t=e.data;if("boolean"==typeof t)return t;if("string"==typeof t)return"true"===t.toLowerCase();if("number"==typeof t)return 0!==t;if("object"==typeof t)for(const e of["enabled","Enabled","isEnabled","IsEnabled","status","Status","hasAccess","HasAccess"])if(e in t){const n=t[e];if("boolean"==typeof n)return n;if("string"==typeof n)return"true"===n.toLowerCase()}return!1}static parseIntData(e){if(!(null==e?void 0:e.status)||void 0===e.data||null===e.data)return null;const t=e.data;if("number"==typeof t)return t;if("string"==typeof t){const e=parseInt(t,10);return isNaN(e)?null:e}if("object"==typeof t)for(const e of["id","Id","accessId","AccessId","parentAccessId","ParentAccessId"])if(e in t){const n=t[e];if("number"==typeof n)return n;if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return e}}return null}static isSuperAdmin(e){return Yc(this,void 0,void 0,function*(){return Xc().isSuperAdmin(e)})}static assignSuperAdmin(e){return Yc(this,void 0,void 0,function*(){return Xc().assignSuperAdmin(e)})}static revokeSuperAdmin(e){return Yc(this,void 0,void 0,function*(){return Xc().revokeSuperAdmin(e)})}static checkAccess(e,t,n){return Yc(this,void 0,void 0,function*(){return Xc().checkAccess(e,t,n)})}static checkAccessBulk(e,t,n){return Yc(this,void 0,void 0,function*(){return Xc().checkAccessBulk(e,t,n)})}static assignAccess(e){return Yc(this,void 0,void 0,function*(){return Xc().assignAccess(e)})}static revokeAccess(e,t,n){return Yc(this,void 0,void 0,function*(){return Xc().revokeAccess(e,t,n)})}static revokeAccessBulk(e){return Yc(this,void 0,void 0,function*(){return Xc().revokeAccessBulk(e)})}static setParentAccessInheritance(e,t){return Yc(this,void 0,void 0,function*(){return Xc().setParentAccessInheritance(e,t)})}static setParentAccessInheritanceBulk(e,t){return Yc(this,void 0,void 0,function*(){return Xc().setParentAccessInheritanceBulk(e,t)})}static removeParentAccessInheritance(e,t){return Yc(this,void 0,void 0,function*(){return Xc().removeParentAccessInheritance(e,t)})}static removeParentAccessInheritanceBulk(e,t){return Yc(this,void 0,void 0,function*(){return Xc().removeParentAccessInheritanceBulk(e,t)})}static hasParentAccessInheritance(e,t){return Yc(this,void 0,void 0,function*(){return Xc().hasParentAccessInheritance(e,t)})}static getParentAccessId(e){return Yc(this,void 0,void 0,function*(){return Xc().getParentAccessId(e)})}}let Zc=null;function Xc(){return Zc||(Zc=new Kc),Zc}const el='\n/* CKEditor content styles */\n.ck-content {\n /* Container styles */\n max-width: 100%;\n margin: 0 auto;\n font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;\n line-height: 1.5;\n padding: 0.75rem;\n background: #fff;\n color: #333;\n border: 1px solid #ccced1;\n}\n\n/* Headings */\n.ck-content h1, .ck-content h2, .ck-content h3, \n.ck-content h4, .ck-content h5, .ck-content h6 {\n font-weight: 700;\n line-height: 1.2;\n margin: 1em 0 0.5em;\n}\n\n.ck-content h1 { font-size: 2.5em; }\n.ck-content h2 { font-size: 2em; }\n.ck-content h3 { font-size: 1.75em; }\n.ck-content h4 { font-size: 1.5em; }\n.ck-content h5 { font-size: 1.25em; }\n.ck-content h6 { font-size: 1em; }\n\n/* Paragraphs and spacing */\n.ck-content p {\n margin: 1em 0;\n line-height: 1.6;\n}\n\n/* Links */\n.ck-content a {\n color: #1a73e8;\n text-decoration: none;\n}\n\n.ck-content a:hover {\n text-decoration: underline;\n}\n\n/* Lists */\n.ck-content ul,\n.ck-content ol {\n padding-left: 2em;\n margin: 1em 0;\n}\n\n.ck-content ul {\n list-style: disc;\n}\n\n.ck-content ol {\n list-style: decimal;\n}\n\n.ck-content li {\n margin: 0.5em 0;\n}\n\n/* Blockquotes */\n.ck-content blockquote {\n margin: 1em 0;\n padding-left: 1em;\n border-left: 5px solid #ccc;\n font-style: italic;\n color: #666;\n}\n\n/* Code blocks */\n.ck-content pre {\n background: #f5f5f5;\n border: 1px solid #ddd;\n border-radius: 4px;\n padding: 1em;\n margin: 1em 0;\n overflow-x: auto;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;\n}\n\n.ck-content code {\n background: #f5f5f5;\n padding: 0.2em 0.4em;\n border-radius: 3px;\n font-size: 0.9em;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;\n}\n\n/* Tables */\n.ck-content table {\n border-collapse: collapse;\n width: 100%;\n margin: 1em 0;\n}\n\n.ck-content table th,\n.ck-content table td {\n border: 1px solid #ddd;\n padding: 0.75em;\n text-align: left;\n}\n\n.ck-content table th {\n background: #f5f5f5;\n font-weight: bold;\n}\n\n/* Images */\n.ck-content img {\n max-width: 100%;\n height: auto;\n margin: 1em 0;\n}\n\n.ck-content figure {\n margin: 1em 0;\n text-align: center;\n}\n\n.ck-content figure img {\n margin: 0;\n}\n\n.ck-content figcaption {\n color: #666;\n font-size: 0.9em;\n margin-top: 0.5em;\n}\n\n/* Dark mode */\n/*\n@media (prefers-color-scheme: dark) {\n .ck-content {\n background: #1a1a1a;\n color: #e0e0e0;\n }\n\n .ck-content a {\n color: #64b5f6;\n }\n\n .ck-content blockquote {\n border-left-color: #404040;\n color: #b0b0b0;\n }\n\n .ck-content pre,\n .ck-content code {\n background: #2d2d2d;\n border-color: #404040;\n }\n\n .ck-content table th,\n .ck-content table td {\n border-color: #404040;\n }\n\n .ck-content table th {\n background: #2d2d2d;\n }\n\n .ck-content figcaption {\n color: #b0b0b0;\n }\n}\n*/\n\n/* CUSTOM DOCUMENTATION CSS */\n\n#documentation-preview {\n border: 1px solid #ccc;\n padding: 1rem;\n}\n\n#documentation-preview h3 {\n font-size: 1.5rem;\n margin-bottom: 1rem;\n}\n\n.pre-wrapper {\n background: #f2f5f9;\n border: 1px solid #cecece;\n display: block;\n padding: 1rem;\n border-radius: 0.25rem;\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pre-wrapper pre {\n margin: 0;\n color: #e87aa2;\n}\n\n.widget-doc-section pre {\n background-color: transparent;\n}\n\n.widget-doc-section p {\n margin: 0;\n}\n\n.widget-doc-section code {\n color: #e87aa2;\n font-size: 0.875rem;\n}\n\n.mv-3 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pv-3 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n\n .widget-documentation-heading {\n background-color: #6e757d;\n color: #eee;\n font-size: 1.5rem;\n padding: 0.5rem 1rem;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .widget-documentation-heading h4 {\n margin-bottom: 0;\n }\n\n .close-documentation-button {\n border: none;\n outline: none;\n background-color: transparent;\n line-height: 0;\n margin: 0;\n padding: 0;\n cursor: pointer;\n }\n\n .close-documentation-button:hover,\n .close-documentation-button:focus {\n background-color: transparent;\n }\n\n .documentation-creator {\n text-align: right;\n color: #666;\n margin: 0;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n }\n\n .documentation-creator span {\n font-style: italic;\n }\n\n .documentation-attachments {\n display: flex;\n flex-wrap: wrap;\n }\n\n .documentation-attachments img {\n width: 25%;\n height: auto;\n border: 1px solid #ccc;\n padding: 0.25rem;\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .documentation-attachments iframe {\n width: 50%;\n border: 1px solid #ccc;\n padding: 0.25rem;\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n\n .widget-documentation-footer {\n text-align: right;\n margin-top: 1rem;\n }\n\n .widget-documentation-footer button {\n border-radius: 0;\n border: none;\n padding: 0.5rem 1.5rem;\n text-align: center;\n background: #6e757d;\n color: #eee;\n }\n\n #widget-details {\n position: absolute;\n right: 0px;\n top: 0px;\n z-index: 9999;\n }\n\n #widget-details button {\n background: #fff;\n border: 1px solid #ccc;\n border-radius: 0 0 0 0.25rem;\n height: auto;\n width: auto;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n }\n\n #widget-details button:hover, \n #widget-details button:focus {\n opacity: 0.75;\n }\n\n #widget-details button span {\n pointer-events: none;\n font-size: 1rem;\n }\n\n #widget-details button svg {\n pointer-events: none;\n width: 16px;\n height: 16px;\n fill: #999;\n }\n\n #widget-documentation-preview-modal {\n border: none;\n }\n\n @media (min-width: 768px) {\n #widget-documentation-preview-modal {\n flex: 0 0 auto;\n width: 66.66666667%;\n }\n }\n\n',tl={PAGE_COMP_NAME:"page",WIDGET_COMP_NAME:"widget",PROJECT_COMP_NAME:"project"};var nl=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};class ol{static get(e,t){return nl(this,void 0,void 0,function*(){if(ol.cache.has(e))return ol.cache.get(e);if(ol.promises.has(e))return ol.promises.get(e);const n=t().then(t=>(ol.cache.set(e,t),ol.promises.delete(e),t)).catch(t=>{throw ol.promises.delete(e),t});return ol.promises.set(e,n),n})}static has(e){return ol.cache.has(e)}static peek(e){return ol.cache.get(e)}static invalidate(e){ol.cache.delete(e),ol.promises.delete(e)}static clear(){ol.cache.clear(),ol.promises.clear()}static set(e,t){return nl(this,void 0,void 0,function*(){return ol.promises.delete(e),ol.cache.set(e,t),t})}static stats(){return{cacheSize:ol.cache.size,pendingRequests:ol.promises.size,keys:Array.from(ol.cache.keys())}}}ol.cache=new Map,ol.promises=new Map;var il=n(2895);const rl=il;il.stringify,il.fromJSON,il.plugin,il.parse,il.list,il.document,il.comment,il.atRule,il.rule,il.decl,il.root,il.CssSyntaxError,il.Declaration,il.Container,il.Processor,il.Document,il.Comment,il.Warning,il.AtRule,il.Result,il.Input,il.Rule,il.Root,il.Node;var sl=n(2110),al=n.n(sl),cl=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ll(e){return cl(this,void 0,void 0,function*(){try{return(yield rl([al()()]).process(e,{from:void 0})).css}catch(e){return null}})}var dl=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function ul(e){return dl(this,void 0,void 0,function*(){var t,n,o,i,r,s,a,c,l,d,u,h,p,f;[{key:"meta_title",value:null===(n=null===(t=null==e?void 0:e[`the_${tl.PAGE_COMP_NAME}_meta_title`])||void 0===t?void 0:t.data)||void 0===n?void 0:n.the_meta_title},{key:"meta_description",value:null===(i=null===(o=null==e?void 0:e[`the_${tl.PAGE_COMP_NAME}_meta_description`])||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_meta_description},{key:"meta_keywords",value:null===(s=null===(r=null==e?void 0:e[`the_${tl.PAGE_COMP_NAME}_meta_keywords`])||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_meta_keywords},{key:"width",value:null===(c=null===(a=null==e?void 0:e[`the_${tl.PAGE_COMP_NAME}_width`])||void 0===a?void 0:a.data)||void 0===c?void 0:c.the_width},{key:"font_size",value:null===(d=null===(l=null==e?void 0:e[`the_${tl.PAGE_COMP_NAME}_font_size`])||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_font_size},{key:"font_family",value:null===(h=null===(u=null==e?void 0:e[`the_${tl.PAGE_COMP_NAME}_font_family`])||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_font_family},{key:"type",value:null===(f=null===(p=null==e?void 0:e[`the_${tl.PAGE_COMP_NAME}_type`])||void 0===p?void 0:p.data)||void 0===f?void 0:f.the_type}].forEach(e=>{e.value&&function(e,t){dl(this,void 0,void 0,function*(){const n=document.getElementById("fspage-properties")||function(){const e=document.createElement("style");return e.id="fspage-properties",document.head.appendChild(e),e}();let o="";switch(e){case"width":hl(".fspage { width: [^;]+ !important; }"),o=t?`.fspage { width: ${t} !important; }`:"";break;case"font_size":hl(".fspage { font-size: [^;]+; }"),o=t?`.fspage { font-size: ${t}px; }`:"";break;case"font_family":hl(".fspage { font-family: [^;]+; }"),o=t?`.fspage { font-family: ${t}; }`:"";break;case"type":hl(".fspage { width: 1200px; margin: 0 auto; }"),hl(".fspage { width: 100%; padding: 0; }"),o="fixed"===t?".fspage { width: 1200px; margin: 0 auto; }":"fluid"===t?".fspage { width: 100%; padding: 0; }":"";break;case"meta_title":document.title=t;break;case"meta_keywords":pl(e.replace("meta_",""),t);break;case"meta_description":return void pl(e.replace("meta_",""),t)}n.textContent+=o})}(e.key,e.value)})})}function hl(e){const t=document.getElementById("fspage-properties");if(!t)return;let n=null==t?void 0:t.textContent;n=n?n.replace(new RegExp(e,"g"),""):"",t.textContent=n}function pl(e,t){let n=document.querySelector(`meta[name="${e}"]`);n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t)}var fl=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function yl(e){return fl(this,void 0,void 0,function*(){var t,n,o,i;(null===(n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.css)||void 0===n?void 0:n.length)&&function(e){var t;const n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.css,o=`vde-css-${(null==e?void 0:e.origin)?null==e?void 0:e.origin:null==e?void 0:e.widgetId}`;(function(e){const t=`link.${e}`,n=document.querySelectorAll(t);(null==n?void 0:n.length)&&(null==n||n.forEach(e=>{e.remove()}))})(o),(null==n?void 0:n.length)&&(null==n||n.sort((e,t)=>Number(null==e?void 0:e.order)-Number(null==t?void 0:t.order)));null==n||n.forEach(e=>{const t=document.createElement("link");t.classList.add(o),t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.url),document.head.appendChild(t)})}(e),(null===(i=null===(o=null==e?void 0:e.library)||void 0===o?void 0:o.js)||void 0===i?void 0:i.length)&&(yield function(e){return fl(this,void 0,void 0,function*(){var t;const n=null===(t=null==e?void 0:e.library)||void 0===t?void 0:t.js,o=`vde-js-${(null==e?void 0:e.origin)?null==e?void 0:e.origin:null==e?void 0:e.widgetId}`;if(function(e){const t=`script.${e}`,n=document.querySelectorAll(t);(null==n?void 0:n.length)&&(null==n||n.forEach(e=>{e.remove()}))}(o),null==n?void 0:n.length){n.sort((e,t)=>Number(null==e?void 0:e.order)-Number(null==t?void 0:t.order));for(const e of n){if(!(null==e?void 0:e.url))continue;document.querySelector(`script[src="${e.url}"]`)||(yield new Promise((t,n)=>{const i=document.createElement("script");i.classList.add(o),i.setAttribute("type","text/javascript"),i.setAttribute("src",e.url),i.setAttribute("crossorigin","anonymous"),i.onload=()=>{t()},i.onerror=t=>{n(new Error(`Failed to load script: ${e.url}`))},document.head.appendChild(i)}))}}})}(e))})}var ml=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function vl(e,t,n,o){return ml(this,void 0,void 0,function*(){var i,r,s,a,c,l,d,u,h,p;const f=new Nc;f.conceptIds=[e],f.inpage=100,f.outputFormat=zr,f.selectors=["the_page_body","the_page_title","the_page_slug","the_page_font_family","the_page_font_size","the_page_width","the_page_type","the_page_meta_title","the_page_meta_description","the_page_meta_keywords"];let y=yield Rc(f,"");ul(null===(r=null===(i=null==y?void 0:y[0])||void 0===i?void 0:i.data)||void 0===r?void 0:r[`the_${tl.PAGE_COMP_NAME}`]);document.getElementById("app").classList.add("fspage");const m=document.head.querySelectorAll("style#mystyleid");Array.from(m).forEach(e=>e.remove()),(null===(l=null===(c=null===(a=null===(s=null==y?void 0:y[0])||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_page)||void 0===c?void 0:c.the_page_body)||void 0===l?void 0:l.id)?yield Il(null===(p=null===(h=null===(u=null===(d=null==y?void 0:y[0])||void 0===d?void 0:d.data)||void 0===u?void 0:u.the_page)||void 0===h?void 0:h.the_page_body)||void 0===p?void 0:p.id,t,n,o):t.innerHTML="<h4>Invalid or Page doesn't exist</h4> "+e})}function gl(e,t,n,o){return ml(this,void 0,void 0,function*(){try{let t=yield Vc(e),n=t.mainId,o=t.data;const i=yield Al(o,n),r=yield Nl(n,[],i);return ol.cache.set(`wdgt_${n}`,r),r}catch(e){}})}function Cl(e,t,n,o){return ml(this,void 0,void 0,function*(){try{let t=yield function(e){var t=arguments;return Fc(this,void 0,void 0,function*(){no.logfunction("BuildWidgetFromIdForRecent",t);try{if(ed)return(yield yd("BuildWidgetFromIdForRecent",{id:e})).data}catch(e){Td(e)}let n={};if(Gc.has(e))return Gc.get(e)||n;let o=yield Ie("application/json");const i=te.getRecent(e);if(i){(()=>Fc(this,void 0,void 0,function*(){let t;try{let n=r.getRecentWidgetData()+"?id="+e;t=yield be(n,{method:"GET",headers:o})}catch(n){t=yield Ke({method:"GET",headers:o},"?id="+e)}if(t.ok){const n=yield t.json();te.setRecent(e,n)}else a(t)}))().catch(()=>{});let t=cs(i.countinfo),n=yield Cs(i.linkers,i.conceptIds,i.mainCompositionIds,i.reverse,t,"DESC");return jc(i.linkers,i.conceptIds),{data:n,mainId:i.mainId}}const s=(()=>Fc(this,void 0,void 0,function*(){try{let t;try{let n=r.getRecentWidgetData()+"?id="+e;t=yield be(n,{method:"GET",headers:o})}catch(n){t=yield Ke({method:"GET",headers:o},"?id="+e)}if(t.ok){let o=yield t.json();te.setRecent(e,o);let i=cs(o.countinfo);return n=yield Cs(o.linkers,o.conceptIds,o.mainCompositionIds,o.reverse,i,"DESC"),jc(o.linkers,o.conceptIds),{data:n,mainId:o.mainId}}return a(t),[]}catch(e){throw e}finally{Gc.delete(e)}}))();return Gc.set(e,s),s})}(e),n=t.mainId,o=t.data;const i=yield Al(o,n);return yield Nl(n,[],i)}catch(e){}})}function wl(e,t,n,o){return ml(this,void 0,void 0,function*(){let i=(yield Vc(e)).mainId;const r=ol.cache.get(`wdgt_${i}`);if(!r.name)return void(t.innerHTML="<h4>Invalid or Widget doesn't exist</h4>"+e);const s=t;yield yl(r);const a=yield _l(r,s,void 0,n),c=Array.from({length:32},()=>"abcdef"[Math.floor(6*Math.random())]).join("");t.classList.add(`${c}`),t.style.position="relative";const l=document.createElement("style");l.id="mystyleid",l.classList.add("mftsccs-css");const d=`\n .${c} {\n ${r.css+a.css+el} \n }\n `,u=(yield ll(d))||"";if(l.innerHTML=u,document.head.appendChild(l),r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&yl(e)})),o){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;Ol(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{Dl("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),a})}function Il(e,t,n,o){return ml(this,void 0,void 0,function*(){try{let i=yield Vc(e),r=i.mainId,s=i.data;const a=yield Al(s,r);return yield kl(r,a,t,n,o)}catch(e){t.textContent=`Error: ${e.message}`}})}function Tl(e,t,n,o){return ml(this,void 0,void 0,function*(){try{const i=yield Wc(e);return yield kl(e,i,t,n,o)}catch(e){}})}function kl(e,t,n,o){return ml(this,arguments,void 0,function*(e,t,n,o,i=!0){const r=yield Nl(e,[],t);if(!r.name)return void(n.innerHTML="<h4>Invalid or Widget doesn't exist</h4>"+e);const s=n;yield yl(r);const a=yield _l(r,s,void 0,o),c=Array.from({length:32},()=>"abcdef"[Math.floor(6*Math.random())]).join("");n.classList.add(`${c}`),n.style.position="relative";const l=document.createElement("style");l.id="mystyleid",l.classList.add("mftsccs-css");const d=`\n .${c} {\n ${r.css+a.css+el} \n }\n `,u=(yield ll(d))||"";l.innerHTML=u,r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&yl(e)})),document.head.appendChild(l);const h=document.createElement("script");if(h.innerHTML=r.js,s.appendChild(h),i){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n \x3c!-- <div id="documentation-preview" class="ck-content"></div> --\x3e\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;Ol(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{Dl("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),a})}function bl(e,t){return ml(this,void 0,void 0,function*(){var n,o,i,r,s,a,c,l,d,u,h;const p=null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.the_widget)||void 0===o?void 0:o.the_widget_s_child;if(t.push(e),p&&p.length)for(let e=0;e<p.length;e++){const n=p[e];let o=null===(c=null===(a=null===(s=null===(r=null===(i=null==n?void 0:n.data.the_child_widget)||void 0===i?void 0:i.the_child_widget_info)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_widget)||void 0===a?void 0:a.the_widget_root)||void 0===c?void 0:c.id;const f=!!(null===(u=null===(d=null===(l=null==n?void 0:n.data)||void 0===l?void 0:l.the_child_widget)||void 0===d?void 0:d.the_child_widget_use_latest)||void 0===u?void 0:u.data);o=Number(o)||!1;let y=null;if(f&&o){const e=yield Vc(o);y=(null===(h=null==e?void 0:e.data)||void 0===h?void 0:h[0])||[],y.useLatest=!0,n.data.the_child_widget.the_child_widget_info=y}n.data.the_child_widget.the_child_widget_info.sChildId=n.id,yield bl(n.data.the_child_widget.the_child_widget_info,t)}})}function Al(e,t){return ml(this,void 0,void 0,function*(){const n=[],o=[...e];try{const e=o.find(e=>e.id===t);yield bl(e,n)}catch(e){}return n})}function Sl(e){return ml(this,arguments,void 0,function*(e,t=[],n=""){let o=yield Wc(e);const i=yield Al(o,e);return yield Nl(e,[],i)})}function Nl(e){return ml(this,arguments,void 0,function*(e,t=[],n,o=""){var i,r,s,a,c,l,d,u,h,p,f,y,m,v,g,C,w,I,T,k,b,A,S,N,_,P,E,L,x,R,O,D,U,F,B,M,G,j,W,V,q,$,H,z,J,Q,Y,K,Z,X,ee,te,ne,oe,ie,re,se;try{const ae=new Oc,ce=function(e,t){for(let n=0;n<e.length;n++)if(e[n].id==t)return e[n]}(n,e);t.push(e);const le=null===(i=null==ce?void 0:ce.data)||void 0===i?void 0:i.the_widget;ae.name=null===(s=null===(r=null==le?void 0:le.the_widget_name)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_name,ae.html=null===(c=null===(a=null==le?void 0:le.the_widget_html)||void 0===a?void 0:a.data)||void 0===c?void 0:c.the_html,ae.css=null===(d=null===(l=null==le?void 0:le.the_widget_css)||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_css,ae.js=null===(h=null===(u=null==le?void 0:le.the_widget_js)||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_js,ae.root=Number(null!==(f=null===(p=null==le?void 0:le.the_widget_root)||void 0===p?void 0:p.id)&&void 0!==f?f:0),ae.origin=ae.root,ae.version=null===(m=null===(y=null==le?void 0:le.the_widget_version)||void 0===y?void 0:y.data)||void 0===m?void 0:m.the_version,ae.clean=null===(g=null===(v=null==le?void 0:le.the_widget_clean)||void 0===v?void 0:v.data)||void 0===g?void 0:g.the_clean,ae.timestamp=null===(w=null===(C=null==le?void 0:le.the_widget_timestamp)||void 0===C?void 0:C.data)||void 0===w?void 0:w.the_timestamp,ae.id=null==ce?void 0:ce.id;const de=null===(T=null===(I=null==le?void 0:le.the_widget_type)||void 0===I?void 0:I.data)||void 0===T?void 0:T.the_type;ae.type="null"==de||null==de?"the_element_name":de,ae.after_render=null===(b=null===(k=null==le?void 0:le.the_widget_after_render)||void 0===k?void 0:k.data)||void 0===b?void 0:b.the_after_render,ae.before_render=null===(S=null===(A=null==le?void 0:le.the_widget_before_render)||void 0===A?void 0:A.data)||void 0===S?void 0:S.the_before_render,ae.dependency=null===(_=null===(N=null==le?void 0:le.the_widget_dependency)||void 0===N?void 0:N.data)||void 0===_?void 0:_.the_dependency,ae.update=null===(E=null===(P=null==le?void 0:le.the_widget_update)||void 0===P?void 0:P.data)||void 0===E?void 0:E.the_update,ae.widgetId=e,ae.mount_child=null===(x=null===(L=null==le?void 0:le.the_widget_mount_child)||void 0===L?void 0:L.data)||void 0===x?void 0:x.the_mount_child;const ue=null==le?void 0:le.the_widget_s_child;(null==ce?void 0:ce.useLatest)&&(ae.useLatest=!0),(null==ce?void 0:ce.sChildId)&&(ae.sChildId=ce.sChildId);const he=null===(R=null==le?void 0:le.the_widget_s_css_library)||void 0===R?void 0:R.map(e=>{var t,n,o,i,r,s,a,c;return{order:null===(i=null===(o=null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_css_library)||void 0===n?void 0:n.the_css_library_order)||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_order,url:null===(c=null===(a=null===(s=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_css_library)||void 0===s?void 0:s.the_css_library_url)||void 0===a?void 0:a.data)||void 0===c?void 0:c.the_url}}),pe=null===(O=null==le?void 0:le.the_widget_s_js_library)||void 0===O?void 0:O.map(e=>{var t,n,o,i,r,s,a,c;return{order:null===(i=null===(o=null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_js_library)||void 0===n?void 0:n.the_js_library_order)||void 0===o?void 0:o.data)||void 0===i?void 0:i.the_order,url:null===(c=null===(a=null===(s=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_js_library)||void 0===s?void 0:s.the_js_library_url)||void 0===a?void 0:a.data)||void 0===c?void 0:c.the_url}});ae.library={css:he||[],js:pe||[]};const fe=null===(U=null===(D=null==le?void 0:le.the_widget_assistant)||void 0===D?void 0:D.data)||void 0===U?void 0:U.the_assistant;ae.assistant={id:null===(B=null===(F=null==fe?void 0:fe.the_assistant_id)||void 0===F?void 0:F.data)||void 0===B?void 0:B.the_id,input:null===(G=null===(M=null==fe?void 0:fe.the_assistant_input)||void 0===M?void 0:M.data)||void 0===G?void 0:G.the_input,type:null===(W=null===(j=null==fe?void 0:fe.the_assistant_type)||void 0===j?void 0:j.data)||void 0===W?void 0:W.the_type};const ye=null===(V=null==le?void 0:le.the_widget_s_custom_function)||void 0===V?void 0:V.map(e=>{var t,n,o,i,r,s,a;const c=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_custom_function;return{id:null==e?void 0:e.id,name:null===(o=null===(n=null==c?void 0:c.the_custom_function_name)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_name,slug:null===(r=null===(i=null==c?void 0:c.the_custom_function_slug)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_slug,code:null===(a=null===(s=null==c?void 0:c.the_custom_function_code)||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_code}});if(ae.custom_functions=ye,null==ue?void 0:ue.length)for(let e=0;e<ue.length;e++){const i=(null===(H=null===($=null===(q=ue[e])||void 0===q?void 0:q.data.the_child_widget)||void 0===$?void 0:$.the_child_widget_info)||void 0===H?void 0:H.id)||(null===(Y=null===(Q=null===(J=null===(z=ue[e])||void 0===z?void 0:z.data.the_child_widget)||void 0===J?void 0:J.the_child_widget_parent)||void 0===Q?void 0:Q.data)||void 0===Y?void 0:Y.the_parent),r=yield Nl(i,t,n,o),s=null===(te=null===(ee=null===(X=null===(Z=null===(K=ue[e])||void 0===K?void 0:K.data)||void 0===Z?void 0:Z.the_child_widget)||void 0===X?void 0:X.the_child_widget_type)||void 0===ee?void 0:ee.data)||void 0===te?void 0:te.the_type,a=null===(se=null===(re=null===(ie=null===(oe=null===(ne=ue[e])||void 0===ne?void 0:ne.data)||void 0===oe?void 0:oe.the_child_widget)||void 0===ie?void 0:ie.the_child_widget_wrapper)||void 0===re?void 0:re.data)||void 0===se?void 0:se.the_wrapper;r.type="null"==s||null==s?"the_element_name":s,r.wrapper=a,ae.children.push(r)}return ae}catch(e){throw Error,e}})}function _l(e,t){return ml(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,a;const c=new uc;c.html=e.html,r&&(c.parentWidget=Pl(r)),c.widgetType=e.type,c.componentDidMountFunction=e.before_render,c.addEventFunction=e.after_render,c.mountChildWidgetsFunction=e.mount_child,c.widgetState=Object.assign({},i),c.customFunctions=e.custom_functions,c.widgetDependenciesData=e.dependency,o&&(c.data=o),t.innerHTML="";const l=t;if(l&&(yield c.mount(l),e.widget=c,e.children.length>0&&(null===(s=c.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(a=e.children)||void 0===a?void 0:a.length);t++){const n=e.children[t];for(let e=0;e<c.childWidgetElement.length;e++){const t=c.childWidgetElement[e];if(n.wrapper===t.id){const e=Ll(n);n.html=`<div id="${n.wrapper}">${n.html}</div>`;const o=yield _l(e,t,false,c.data,c.widgetState,c);c.childWidgets.push(o),c.css=c.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange(e=>{var t;const n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(c.childrenData[n]=e)})}}}return yield Rl(t,".widget_container"),c})}function Pl(e){const t={};for(const[n,o]of Object.entries(e))"object"==typeof o&&null!==o&&Array.isArray(o)||(t[n]=o);return t}function El(e,t){return ml(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,a;let c=new uc;c.html=e.html,r&&(c.parentWidget=Pl(r)),c.widgetState=Object.assign({},o),c.widgetType=e.type,c.componentDidMountFunction=e.before_render,c.addEventFunction=e.after_render,c.mountChildWidgetsFunction=e.mount_child,c.customFunctions=e.custom_functions,c.widgetDependenciesData=e.dependency,c.inDevelopment=!1!==i,t.innerHTML="";let l=t;if(l&&(yield c.mount(l),e.widget=c,e.children.length>0&&(null===(s=c.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(a=e.children)||void 0===a?void 0:a.length);t++){let n=e.children[t];for(let e=0;e<c.childWidgetElement.length;e++){let t=c.childWidgetElement[e];if(n.wrapper===t.id){const e=Ll(n),o=yield El(e,t,false,c.widgetState,i,c);c.childWidgets.push(o),c.css=c.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange(e=>{var t;let n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(c.childrenData[n]=e)})}}}return c})}function Ll(e){return e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bwidget_container\b[^"']*["'][^>]*>/g,e=>e.replace(/\bwidget_container\b/g,"").trim()),e.html=e.html.replace(/<[^>]*\bdraggable=["'][^"']*\btrue\b[^"']*["'][^>]*>/g,e=>e.replace(/\btrue\b/g,"false").trim()),e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bhover-element\b[^"']*["'][^>]*>/g,e=>e.replace(/\bhover-element\b/g,"").trim()),e.html=e.html.replace(/<[^>]*\bclass=["'][^"']*\bwb-block\b[^"']*["'][^>]*>/g,e=>e.replace(/\bwb-block\b/g,"").trim()),e.html=e.html.replace(/<[^>]*onclick="widgetSelected\(event\)"\s*,?\s*ondragover="_dragService\.dragOverWidgetElement\(event\)"\s*,?\s*ondrop="_dragService\.dropWidgetElement\(event\)"\s*,?\s*ondragstart="_dragService\.dragStartWidgetElement\(event\)"\s*,?\s*ondragend="_dragService\.dragEndWidgetElement\(event\)"[^>]*>/g,e=>e.replace(/onclick="widgetSelected\(event\)"/g,'onclick=""').replace(/ondragover="_dragService\.dragOverWidgetElement\(event\)"/g,'ondragover=""').replace(/ondrop="_dragService\.dropWidgetElement\(event\)"/g,'ondrop=""').replace(/ondragstart="_dragService\.dragStartWidgetElement\(event\)"/g,'ondragstart=""').replace(/ondragend="_dragService\.dragEndWidgetElement\(event\)"/g,'ondragend=""').trim()),e.html=e.html.replace(/<[^>]*\bondragstart=["'][^"']*\b_dragService\.onWidgetDragStart\(event\)\b[^"']*["'][^>]*>/g,e=>e.replace(/\b_dragService\.onWidgetDragStart\(event\)\b/g,"").trim()),e}function xl(e,t){return ml(this,void 0,void 0,function*(){if(e&&1===e.nodeType){e.querySelectorAll(t).forEach(e=>{for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.remove()})}return e})}function Rl(e,t){return ml(this,void 0,void 0,function*(){const n=e.querySelectorAll(t);for(const e of n){const n=e.parentElement;if(n){for(;e.firstChild;){const o=yield xl(e.firstChild,t);n.insertBefore(o,e)}n.removeChild(e)}}})}function Ol(e){return ml(this,void 0,void 0,function*(){const t=new Nc;t.typeConnection="the_widget_documentation",t.name="documentationText",t.selectors=["the_documentation_text"];const n=new Nc;n.typeConnection="the_widget_s_documentation",n.name="documentationBlank",n.selectors=["the_documentation_text","the_documentation_content","the_documentation_language","the_documentation_doc_title","the_documentation_folder","the_documentation_creator_email","the_documentation_created_by","the_documentation_content","the_documentation_type","the_documentation_s_doc_url","the_documentation_s_image_url","the_documentation_s_video_link","the_documentation_auth_type","the_documentation_bearer_token","the_documentation_method","the_documentation_method_url","the_documentation_username","the_documentation_password","the_documentation_s_json_list","the_documentation_api_script","the_documentation_api_body","the_documentation_code_editor","the_documentation_return"];const o=new Nc;o.typeConnection="the_documentation_s_json_list",o.name="documentationJSON",o.selectors=["the_json_list_key","the_json_list_value"],n.freeschemaQueries=[o];const i=new Nc;i.conceptIds=[e],i.freeschemaQueries=[t,n],i.inpage=100,i.outputFormat=zr,yield xc(i,"").subscribe(t=>ml(this,void 0,void 0,function*(){var n,o,i,s,a,c,l,d,u,h,p;let f;const y=(null===(d=null===(l=null===(c=null===(a=null===(s=null===(i=null===(o=null===(n=null==t?void 0:t[0])||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_widget)||void 0===i?void 0:i.the_widget_documentation)||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_documentation)||void 0===c?void 0:c.the_documentation_text)||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_text)||"";y&&(f=y);const m=null===(p=null===(h=null===(u=null==t?void 0:t[0])||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_widget)||void 0===p?void 0:p.the_widget_s_documentation;if(null==m?void 0:m.length){const e=null==m?void 0:m.map(e=>{var t,n,o,i,r,s,a,c,l,d,u,h,p,f,y,m,v,g,C,w,I,T,k,b,A,S,N,_,P,E,L;const x=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_documentation,R=null===(o=null===(n=null==x?void 0:x.the_documentation_type)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_type,O=null===(r=null===(i=null==x?void 0:x.the_documentation_content)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_content,D=null===(a=null===(s=null==x?void 0:x.the_documentation_creator_email)||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_creator_email,U=null===(l=null===(c=null==x?void 0:x.the_documentation_doc_title)||void 0===c?void 0:c.data)||void 0===l?void 0:l.the_doc_title,F=null===(u=null===(d=null==x?void 0:x.the_documentation_method)||void 0===d?void 0:d.data)||void 0===u?void 0:u.the_method,B=null===(p=null===(h=null==x?void 0:x.the_documentation_method_url)||void 0===h?void 0:h.data)||void 0===p?void 0:p.the_method_url,M=null===(y=null===(f=null==x?void 0:x.the_documentation_bearer_token)||void 0===f?void 0:f.data)||void 0===y?void 0:y.the_bearer_token,G=null===(v=null===(m=null==x?void 0:x.the_documentation_username)||void 0===m?void 0:m.data)||void 0===v?void 0:v.the_username,j=null===(C=null===(g=null==x?void 0:x.the_documentation_password)||void 0===g?void 0:g.data)||void 0===C?void 0:C.the_password,W=null===(I=null===(w=null==x?void 0:x.the_documentation_auth_type)||void 0===w?void 0:w.data)||void 0===I?void 0:I.the_auth_type,V=null==x?void 0:x.the_documentation_s_json_list,q=null===(k=null===(T=null==x?void 0:x.the_documentation_api_script)||void 0===T?void 0:T.data)||void 0===k?void 0:k.the_api_script,$=null===(A=null===(b=null==x?void 0:x.the_documentation_api_body)||void 0===b?void 0:b.data)||void 0===A?void 0:A.the_api_body,H=null===(N=null===(S=null==x?void 0:x.the_documentation_language)||void 0===S?void 0:S.data)||void 0===N?void 0:N.the_language,z=null===(P=null===(_=null==x?void 0:x.the_documentation_return)||void 0===_?void 0:_.data)||void 0===P?void 0:P.the_return,J=null===(L=null===(E=null==x?void 0:x.the_documentation_code_editor)||void 0===E?void 0:E.data)||void 0===L?void 0:L.the_code_editor,Q=null==x?void 0:x.the_documentation_s_doc_url,Y=null==x?void 0:x.the_documentation_s_image_url,K=null==x?void 0:x.the_documentation_s_video_link;let Z={type:R,content:O,creatorEmail:D,title:U};if("blank"===R)Z=Object.assign({},Z);else if("api"===R){const e=[];(null==V?void 0:V.length)&&(null==V||V.forEach(t=>{var n,o,i,r,s,a,c,l;e.push({key:null===(r=null===(i=null===(o=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.the_json_list)||void 0===o?void 0:o.the_json_list_key)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_key,value:null===(l=null===(c=null===(a=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.the_json_list)||void 0===a?void 0:a.the_json_list_value)||void 0===c?void 0:c.data)||void 0===l?void 0:l.the_value})})),Z=Object.assign(Object.assign({},Z),{method:F,methodURL:B,authType:W,username:G,password:j,bearerToken:M,json:e,script:q,body:$})}else"function"===R&&(Z=Object.assign(Object.assign({},Z),{language:H,return:z,codeEditor:J}));const X=[],ee=[],te=[];return(null==Y?void 0:Y.length)&&(null==Y||Y.forEach(e=>{var t;X.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_image_url)})),(null==K?void 0:K.length)&&(null==K||K.forEach(e=>{var t;ee.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_video_link)})),(null==Q?void 0:Q.length)&&(null==Q||Q.forEach(e=>{var t;te.push(null===(t=e.data)||void 0===t?void 0:t.the_doc_url)})),Z=Object.assign(Object.assign({},Z),{imageList:X,linkList:te,videoList:ee}),Z});f=e}yield function(e){return ml(this,void 0,void 0,function*(){document.getElementById(e).showModal()})}("widget-documentation-preview-modal"),function(e,t){ml(this,void 0,void 0,function*(){const n=document.getElementById("documentation-view");if(0!=r.DOCUMENTATION_WIDGET)return void(yield Il(r.DOCUMENTATION_WIDGET,n,{currentWidgetId:t}));const o=document.getElementById("documentation-preview");o.innerHTML="",e&&(null==e?void 0:e.length)&&"string"!=typeof e?null==e||e.forEach(e=>{var t,n,i,r;const s=document.createElement("h3");let a="";switch(null==e?void 0:e.type){case"api":a="API";break;case"function":a="Functions and Classes";break;case"imgAndLink":a="Images and Links";break;default:a=""}s.innerHTML=`\n ${null==e?void 0:e.title} ${a?"("+a+")":""}\n `,null==o||o.appendChild(s);const c=document.createElement("div");c.classList.add("widget-doc-content"),(null==e?void 0:e.content)&&(c.innerHTML=e.content,null==o||o.appendChild(c));const l=document.createElement("div");if(l.classList.add("widget-doc-section"),"api"===e.type){let n="";n="basicAuth"===e.authType?`\n <p>username: <code>${null==e?void 0:e.username}</code></p>\n <p>password: <code>${null==e?void 0:e.password}</code></p>\n `:"bearerToken"===e.authType?`\n <h6>Token: <code>${null==e?void 0:e.bearerToken}</code></h6>\n `:"None";const o=e.json.map(e=>`${null==e?void 0:e.key}: ${null==e?void 0:e.value}`).join(", "),i=document.createElement("pre");i.textContent=o,l.innerHTML=`\n <div class="pv-3">\n <h6>Method Type: <code>${null==e?void 0:e.method.toUpperCase()}</code></h6>\n <h6>Endpoint: <code>${null==e?void 0:e.methodURL}</code></h6>\n </div>\n <div class="pv-3">\n <h6>Auth Type: <code>${(null===(t=null==e?void 0:e.authType)||void 0===t?void 0:t.toUpperCase())||""}</code></h6>\n ${n}\n </div>\n <div class="pv-3">\n <h6>JSON</h6>\n <code class="pre-wrapper" id="json-list-pre"></code>\n </div>\n <div class="pv-3">\n <h6>Body</h6>\n ${e.body}\n </div>\n <div class="pv-3">\n <h6>Scripts</h6>\n ${e.script}\n </div>\n `;const r=l.querySelector("#json-list-pre");r&&(r.appendChild(i),r.removeAttribute("id"))}else if("function"===e.type){const t=document.createElement("pre");t.textContent=null==e?void 0:e.codeEditor;const n=document.createElement("pre");n.textContent=null==e?void 0:e.return,l.innerHTML=`\n <div class="mv-3">\n <h6>Parameter</h6>\n <p>Language: ${null==e?void 0:e.language}</p>\n <code class="pre-wrapper" id="editor-pre"></pre></code>\n <h6>Returns</h6>\n <code class="pre-wrapper" id="return-pre"></code>\n </div>\n `;const o=l.querySelector("#editor-pre");o&&(o.appendChild(t),o.removeAttribute("id"));const i=l.querySelector("#return-pre");i&&(i.appendChild(n),i.removeAttribute("id"))}const d=document.createElement("div");d.classList.add("mv-3");const u=null===(n=null==e?void 0:e.linkList)||void 0===n?void 0:n.map(e=>`\n <p>${e}</p>\n `).join(""),h=null===(i=null==e?void 0:e.imageList)||void 0===i?void 0:i.map(e=>`\n <img src="${e}">\n `).join(""),p=null===(r=null==e?void 0:e.videoList)||void 0===r?void 0:r.map(e=>`\n <iframe width="560" height="315" src="${e}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>\n `).join(""),f=(null==u?void 0:u.length)?`\n <div class="mv-3">\n <h6>Web links</h6>\n ${u}\n </div>\n `:"",y=(null==h?void 0:h.length)?`\n <h6>Attachments</h6>\n <div class="documentation-attachments">\n ${h}\n </div>\n `:"",m=(null==p?void 0:p.length)?`\n <h6>Videos</h6>\n <div class="documentation-attachments">\n ${p}\n </div>\n `:"";d.innerHTML=`\n <div class="mv-3">\n ${f}\n ${y}\n ${m}\n </div>\n <p class="documentation-creator">- added by: <span>${null==e?void 0:e.creatorEmail}</span></p>\n `,null==l||l.appendChild(d),null==o||o.appendChild(l)}):void 0!==e&&(o.innerHTML=e)})}(f,e)}))})}function Dl(e){return ml(this,void 0,void 0,function*(){const t=document.getElementById(e),n=null==t?void 0:t.querySelector("form");null==n||n.reset(),null==t||t.close()})}var Ul=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Fl(e){return Ul(this,arguments,void 0,function*(e,t=null,n="",o={concepts:[],connections:[]}){var i,r,s,a;if(ed)try{const c=yield yd("CreateData",{json:e,ofConcept:t,typeConcept:n,actions:o});return(null===(r=null===(i=null==c?void 0:c.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(c.actions.concepts))),(null===(a=null===(s=null==c?void 0:c.actions)||void 0===s?void 0:s.connections)||void 0===a?void 0:a.length)&&(o.connections=JSON.parse(JSON.stringify(c.actions.connections))),c.data}catch(e){Td(e)}let c=999,l=999,d=S();for(const i in e){let r=Bl(i);if("string"!=typeof e[i]&&"number"!=typeof e[i])if(null==t||0==t.id){d=yield po(r,"",!0,c,4,l,void 0,o),Array.isArray(e[i])&&(r=Ml(r)),yield Fl(e[i],d,r,o)}else{Array.isArray(e[i])&&(r=Gl(r));let s=Gl(i),a=yield po(r,"",!0,c,4,l,void 0,o);d=a;let u=Wl(n,s),h=yield uo(u,l,c,c,o);yield io(t.id,a.id,h.id,1e3,h.characterValue,c,o),Array.isArray(e[i])&&(r=Ml(r)),yield Fl(e[i],a,r,o)}else{let r=Wl(n,i),s=yield uo(r,l,c,c,o),a=yield po(i,e[i].toString(),!1,c,4,l,void 0,o);null!=t&&(yield io(t.id,a.id,s.id,1e3,r,c,o))}}return d})}function Bl(e){return e.startsWith("the_")?e:"the_"+e}function Ml(e){return e.endsWith("_s")?e:e+"_s"}function Gl(e){return e.replace(/_s$/,"")}const jl=e=>/^[+-]?\d+(\.\d+)?$/.test(e);function Wl(e,t){return jl(t)?e+"_":e+"_"+function(e){return e.startsWith("the_")?e.slice(4):e}(t)}class Vl{constructor(){this.prototype="",this.required=[],this.optional=[],this.field="string",this.childPrototypes=[],this.isCompositional=!1,this.options=[],this.isQueryType=!1,this.querySelector=null,this.concepts=[],this.connections=[],this.addedConcepts=[],this.addedConnections=[]}}function ql(e,t){if(Array.isArray(e)&&Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);return e}var $l=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Hl(e){return $l(this,arguments,void 0,function*(e,t=null){let n=[],o=[],i=[],r=S();try{null==t&&(t=new mc,yield t.initialize());let s=[];if(e.isCompositional){if(r=yield function(e,t,n,o){return $l(this,void 0,void 0,function*(){let i=S(),r=yield o.MakeTheInstanceConceptLocal("the_composition","",!0,999,999,999),s=yield o.MakeTheTypeConceptLocal("the_composition_type",999,999,999),a=yield o.MakeTheTypeConceptLocal(e,999,999,999),c=yield o.CreateTheConnectionLocal(r.id,a.id,s.id,1e3,"the_composition_type");return i=r,t.push(s),t.push(a),n.push(c),i})}(e.prototype,n,o,t),e.isQueryType){let o=yield function(e,t,n){return $l(this,void 0,void 0,function*(){let o=[],i=[],r=function(){let e="the_composition_filter_type";return e}(0,!0),s=function(){let e="the_composition_selector";return e}(0,!0),a=yield n.MakeTheTypeConceptLocal(r,999,999,999),c=yield n.MakeTheTypeConceptLocal(s,999,999,999);if(null!=e){let l=yield n.MakeTheTypeConceptLocal(e.selector,999,999,999);o.push(l);let d=yield n.MakeTheTypeConceptLocal(e.filterType,999,999,999);o.push(l),o.push(d);let u=yield n.CreateTheConnectionLocal(t.id,l.id,c.id,1e3,s,999);i.push(u);let h=yield n.CreateTheConnectionLocal(t.id,d.id,a.id,1e3,r,999);i.push(h)}return{concepts:o,connections:i}})}(e.querySelector,r,t),s=o.concepts;ql(i,o.connections),ql(n,s)}if(e.options.length>0){let o=yield function(e,t,n){return $l(this,void 0,void 0,function*(){let o=[],i=[],r=function(){let e="the_composition_s_option";return e}(0,!0),s=yield n.MakeTheTypeConceptLocal(r,999,999,999);for(let a=0;a<e.length;a++){let c=e[a].type,l=e[a].value,d=yield n.MakeTheInstanceConceptLocal(c,l,!1,999,999,999);o.push(d);let u=yield n.CreateTheConnectionLocal(t.id,d.id,s.id,1e3,r,999);i.push(u)}return{concepts:o,connections:i}})}(e.options,r,t),s=o.concepts;ql(i,o.connections),ql(n,s)}}else r=yield function(e,t){return $l(this,void 0,void 0,function*(){let n=yield on(5124),o=yield t.MakeTheTypeConceptLocal(e,999,999,999),i=yield function(e,t,n,o){return $l(this,void 0,void 0,function*(){let n=yield o.CreateTheConceptLocal("",t.characterValue,999,e.id,t.id,4,!1);return n.characterValue=t.characterValue,n.typeCharacter=t.characterValue,n.isComposition=!0,n.type=t,n})}(n,o,0,t);return i})}(e.prototype,t),i=yield Jl(e.required,r,n,t,!0),s=yield Jl(e.optional,r,n,t),n.push(r);let a=zl(r,!0,!0),c=yield t.MakeTheTypeConceptLocal(a,999,999,999);if(n.push(c),e.childPrototypes.length>0)for(let o=0;o<e.childPrototypes.length;o++){let s=yield Hl(e.childPrototypes[o]),l=s.mainConcept,d=s.connections,u=s.concepts,h=yield t.CreateTheConnectionLocal(r.id,l.id,c.id,1e3,a,999);i.push(h),ql(i,d),ql(n,u),n.push(l)}ql(i,s),ql(i,o),ql(n,e.addedConcepts),ql(i,e.addedConnections),e.concepts=n,e.connections=i}catch(e){null==t||t.rollbackTransaction()}return{concepts:n,connections:i,mainConcept:r}})}function zl(e,t=!0,n=!1){var o;let i="the_prototype_of_"+(null===(o=e.type)||void 0===o?void 0:o.characterValue);return i+=t?"_requires":"_optional",n&&(i+="_the_composition"),i}function Jl(e,t,n,o){return $l(this,arguments,void 0,function*(e,t,n,o,i=!1,r=!1){let s=[],a=[],c=zl(t,i,r),l=yield o.MakeTheTypeConceptLocal(c,999,999,999);n.push(l);for(let t=0;t<e.length;t++){let n=yield o.MakeTheTypeConceptLocal(e[t],999,999,999);s.push(n)}for(let e=0;e<s.length;e++){let n=yield o.CreateTheConnectionLocal(t.id,s[e].id,l.id,1e3,c,999);a.push(n)}for(let e=0;e<s.length;e++)n.push(s[e]);return a})}var Ql=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Yl(e){return Ql(this,void 0,void 0,function*(){let t;try{const n=yield fetch(r.GetCachedImage(e),{method:"GET"});return n.ok?t=n.body:a(n),t}catch(e){throw Error,t}})}var Kl=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};function Zl(e){return Kl(this,arguments,void 0,function*(e,t="normal"){let n;let o=e.split("/").pop();if("small"==t){let e=null==o?void 0:o.split(".");if(e){o=e[0]+"_small."+e[1]}}return o&&(n=yield Yl(o)),n})}function Xl(e,t="normal"){let n=e;try{if(e){let o=e.split("/").pop();if("small"==t){let e=null==o?void 0:o.split(".");if(e){o=e[0]+"_small."+e[1]}}o&&(n=r.GetCachedImage(o))}}catch(e){}return n}var ed,td=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})};const nd=Date.now().toString(36)+Math.random().toString(36).substring(2);let od=[],id=[],rd=!1,sd=!1,ad=null,cd=!1,ld=!1;const dd=new WeakSet;let ud=!1;function hd(e){ud=e}function pd(e="",t,n=""){he.BearerAccessToken=e,arguments.length>=3&&(he.refreshToken=n),ed&&yd("updateAccessToken",{accessToken:e,refreshToken:he.refreshToken,session:he.sessionId})}function fd(){return td(this,arguments,void 0,function*(e="",t="",n="",o="",i=!0,s="",a=void 0,c={},l={},u=""){var h,p,f,y,m;try{r.BASE_URL=e,r.AI_URL=t,r.NODE_URL=o,r.BASE_APPLICATION=s,r.LOG_SERVER=null!==(h=l.logserver)&&void 0!==h?h:"https://logdev.freeschema.com",r.RECAPTCHA_SITE_KEY=null!==(p=l.recaptchaSiteKey)&&void 0!==p?p:"",r.RECAPTCHA_ACTION=null!==(f=l.recaptchaAction)&&void 0!==f?f:"send_mail",pd(n),r.ACCESS_CONTROL_BASE_URL=u;const i=(null!=n?n:"").trim();i&&pd(i),yield he.hydrateProfile(),!i&&he.BearerAccessToken&&pd(he.BearerAccessToken);let v=Math.floor(1e8*Math.random());r.setRandomizer(v),r.isPwa=null!==(y=l.isPwa)&&void 0!==y&&y,Z.setValue("enableCache",null===(m=l.enableCache)||void 0===m||m);const g={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1,accessControl:!1};if(r.FLAGS=g,r.FLAGS=Object.assign(Object.assign({},g),c),function(e){const t=no.logfunction("initializeFlags",arguments);try{return e.logApplication?($a.initialize(),no.logApplicationActivationStatus=!0,no.startAutoSync()):no.logApplicationActivationStatus=!1,e.logPackage?(no.logPackageActivationStatus=!0,no.startAutoSync()):no.logPackageActivationStatus=!1,e.logApplication||e.logPackage||no.stopAutoSync(),e.accessTracker?(De.activateStatus=!0,De.startAutoSync()):(De.activateStatus=!1,De.stopAutoSync()),e.isTest&&(C.isDataLoaded=!0,C.isCharacterLoaded=!0,C.isTypeLoaded=!0,C.isLocalDataLoaded=!0,C.isLocalTypeLoaded=!0,C.isLocalCharacterLoaded=!0,C.isConnectionLoaded=!0,C.isConnectionTypeLoaded=!0,C.isLocalConnectionLoaded=!0),no.logUpdate(t),e}catch(e){throw d(t,0,e),e}}(r.FLAGS),r.FLAGS&&r.FLAGS.accessControl&&r.ACCESS_CONTROL_BASE_URL,!("serviceWorker"in navigator))return void(yield Cd());if(yield function(){return td(this,void 0,void 0,function*(){var e;let t=r.BASE_APPLICATION+"_cacheServers",n=r.BASE_APPLICATION+"_config",o=r.BASE_APPLICATION+"_session",i=sessionStorage.getItem(t),s=sessionStorage.getItem(n),a=null!==(e=sessionStorage.getItem(o))&&void 0!==e?e:"999",c=parseInt(a);void 0!==i&&"undefined"!==i||(r.NODE_CACHE_URL=r.BASE_URL),i=JSON.parse(i);const l=JSON.parse(s);function d(){return td(this,arguments,void 0,function*(e=!0){var i;let s;try{let a=null!==(i=r.BASE_APPLICATION)&&void 0!==i?i:"boomconsole";if(s=yield fetch(r.getAppConfig()+"?application="+a,{method:"POST"}),!s.ok)throw new Error("Failed to sync data to the server.");const c=yield s.json();c.success&&(sessionStorage.setItem(t,JSON.stringify(c.servers)),sessionStorage.setItem(n,JSON.stringify(c.config)),e&&(sessionStorage.setItem(o,c.session),he.setSession(c.session)),c.servers?r.NODE_CACHE_URL=c.servers[0]:r.NODE_CACHE_URL=r.BASE_URL,c.config&&(r.DOCUMENTATION_WIDGET=c.config.documentationWidget))}catch(e){}})}i&&l&&l.documentationWidget&&999!=c?(Array.isArray(i)&&i.length?r.NODE_CACHE_URL=i[0]:r.NODE_CACHE_URL=r.BASE_URL,he.setSession(c),r.DOCUMENTATION_WIDGET=l.documentationWidget,d(!1)):yield d(),navigator.serviceWorker&&navigator.serviceWorker.controller&&yd("SESSION_DATA",{type:"SESSION_DATA",data:r.NODE_CACHE_URL,session:he.sessionId}).catch(e=>{})})}(),function(){if(sd)return;navigator.serviceWorker.addEventListener("message",gd),sd=!0}(),function(){if(rd)return;ye.addEventListener("message",vd),rd=!0}(),a&&a.activate&&a.manual)yield new Promise((e,t)=>{navigator.serviceWorker.ready.then(t=>td(this,void 0,void 0,function*(){ed=t.active,yield kd(),e("done")})).catch(e=>{t(e)}).finally(()=>{}),setTimeout(()=>t("Timeout ready"),3e4)});else if(a&&(null==a?void 0:a.activate))try{yield function(e){var t=arguments;return td(this,void 0,void 0,function*(){const n=no.logfunction("handleRegisterServiceWorker",t);yield new Promise((t,o)=>{var i,r;let s=!1;navigator.serviceWorker.register(null!==(i=e.pathToSW)&&void 0!==i?i:"./serviceWorker.bundle.js",{scope:null!==(r=e.scope)&&void 0!==r?r:"/"}).then(e=>td(this,void 0,void 0,function*(){!function(){if(ad)return;ad=setInterval(()=>{id.length&&Id().catch(e=>{})},2e3)}(),e.onupdatefound=()=>{const n=e.installing;n&&(n.onstatechange=()=>td(this,void 0,void 0,function*(){"installing"===n.state&&(ed=void 0),"activated"!==n.state&&"redundant"!==n.state||!navigator.serviceWorker.controller||(ed=n,setTimeout(()=>{Id()},5e3),yield kd(),s=!0,Id(),t())}))},function(){if(ld)return;navigator.serviceWorker.addEventListener("controllerchange",()=>td(this,void 0,void 0,function*(){navigator.serviceWorker.controller&&(ed=navigator.serviceWorker.controller,yield kd())})),ld=!0}(),function(e){const t=[e.installing,e.waiting,e.active];t.forEach(e=>{e&&!dd.has(e)&&(dd.add(e),e.addEventListener("statechange",e=>td(this,void 0,void 0,function*(){var t;"activating"===(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.state)&&(ed=navigator.serviceWorker.controller,yield kd())})))})}(e),e.active?(ed=e.active,yield kd(),Id(),t()):setTimeout(()=>{s||o("Not Completed Initialization")},1e4)})).catch(e=>td(this,void 0,void 0,function*(){yield Cd(),o(e),d(n,0,e)}))})})}(a)}catch(e){yield Cd()}else yield Cd();return!0}catch(e){yield Cd()}})}function yd(e,t){return td(this,arguments,void 0,function*(e,t,n=0){let o=!1;const i="checkProcess"!==e&&"SESSION_DATA"!==e&&"updateAccessToken"!==e,r=Math.random().toString(36).substring(2);t.messageId=r,t.TABID=nd;const s=JSON.parse(JSON.stringify(t));let c;return new Promise((d,u)=>{let h,p,f,y=!1;const m=()=>{c&&(clearInterval(c),c=void 0),h&&(clearTimeout(h),h=void 0),p&&(clearTimeout(p),p=void 0),f&&(null===navigator||void 0===navigator?void 0:navigator.serviceWorker)&&(navigator.serviceWorker.removeEventListener("message",f),f=void 0)},v=e=>{y||(y=!0,m(),d(e))},g=e=>{y||(y=!0,m(),u(e))},C=()=>{!i||n>0||(c=setInterval(()=>td(this,void 0,void 0,function*(){o||(yield function(e){return td(this,void 0,void 0,function*(){var t;try{const n=yield function(e,t,n=1500){var o;const i=(null===(o=navigator.serviceWorker)||void 0===o?void 0:o.controller)||ed;if(!i)return Promise.resolve(null);const r=Math.random().toString(36).substring(2),s=Object.assign(Object.assign({},t),{messageId:r,TABID:nd});return new Promise(t=>{var o;let a;const c=()=>{var e;a&&(clearTimeout(a),a=void 0),null===(e=navigator.serviceWorker)||void 0===e||e.removeEventListener("message",l)},l=e=>{var n;(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.messageId)===r&&(c(),t(e.data))};null===(o=navigator.serviceWorker)||void 0===o||o.addEventListener("message",l),a=setTimeout(()=>{c(),t(null)},n);try{i.postMessage({type:e,payload:s})}catch(e){c(),t(null)}})}("checkProcess",{checkMessageId:e});return!n||!!(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.processing)}catch(e){return!0}})}(r))||o||(m(),0==n&&i?yd(e,t,n+1).then(v).catch(g):g(`Failed to handle type ${e} ${r}`))}),2e3))};if(navigator.serviceWorker.controller,navigator.serviceWorker.controller||ed){if(f=n=>{var i,s,c,d,u,h;if((null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.messageId)==r){if(o=!0,!n.data.success)return void(401==(null===(s=null==n?void 0:n.data)||void 0===s?void 0:s.status)?g(a(new Response("Unauthorized",{status:401,statusText:null===(c=null==n?void 0:n.data)||void 0===c?void 0:c.statusText}))):500==(null===(d=null==n?void 0:n.data)||void 0===d?void 0:d.status)?g(l(new Response("Internal Server Error",{status:500,statusText:null===(u=null==n?void 0:n.data)||void 0===u?void 0:u.statusText}))):g(`Failed to handle action ${e} ${JSON.stringify(t)}, Response: ${JSON.stringify(n.data)}`));(null===(h=n.data)||void 0===h?void 0:h.actions)&&(t.actions=JSON.parse(JSON.stringify(n.data.actions))),v(n.data)}},navigator.serviceWorker.addEventListener("message",f),C(),navigator.serviceWorker.controller)navigator.serviceWorker.controller.postMessage({type:e,payload:s});else if(ed)try{ed.postMessage({type:e,payload:s})}catch(t){ed.postMessage({type:e,payload:s})}else p=setTimeout(()=>{ed?null==ed||ed.postMessage({type:e,payload:t}):g("Service worker not ready")},3e4);h=setTimeout(()=>{g(`No response from service worker after timeout: ${e}`)},21e4)}else id.push({message:{type:e,payload:s},resolve:v,reject:g}),"init"==e&&v(null)})})}const md={GetLinkListener:e=>td(void 0,void 0,void 0,function*(){const t=od.find(t=>t.listenerId==e.listenerId);return null==t||t.callback(e.data),{success:!0}}),AUTH_LOGOUT:()=>td(void 0,void 0,void 0,function*(){if(he.logout(),ed)try{yield yd("updateAccessToken",{accessToken:"",refreshToken:"",session:he.sessionId})}catch(e){}return{success:!0}}),dispatchEvent:e=>td(void 0,void 0,void 0,function*(){if(ed){let t=new CustomEvent(e.id||"",e.data);dispatchEvent(t)}return{success:!0}}),checkInit:e=>td(void 0,void 0,void 0,function*(){return navigator.serviceWorker.controller&&(ed=navigator.serviceWorker.controller),yield kd(),{success:!0}})};function vd(e){return td(this,void 0,void 0,function*(){const{type:t,payload:n}=e.data;if(!t)return;let o={success:!1,data:void 0};md[t]&&(o=yield md[t](n))})}function gd(e){return td(this,void 0,void 0,function*(){var t,n,o,i;try{if(e.data&&"API_401"===e.data.type){const{requestDetails:o}=e.data,i={method:o.method,headers:new Headers(o.headers),body:o.body},r=yield fetch(o.url,i),s=yield null==r?void 0:r.json();null===(n=null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||void 0===n||n.postMessage({type:"API_RESPONSE",messageId:e.data.messageId,response:new Response(s,{status:r.status,statusText:r.statusText,headers:r.headers})})}}catch(t){null===(i=null===(o=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===o?void 0:o.controller)||void 0===i||i.postMessage({type:"API_RESPONSE",messageId:e.data.messageId})}})}function Cd(){return td(this,void 0,void 0,function*(){yield Va();(new Date).getTime();yield Promise.all([G().then(()=>{}),Yn().then(()=>{}),Fa().then(()=>{C.isConnectionLoaded=!0,C.isConnectionTypeLoaded=!0}),Ba().then(()=>{C.isLocalConnectionLoaded=!0}),Zn().catch(e=>{throw e}),te.init(),oe.init()]).catch(e=>{})})}function wd(e,t={}){if(ed||"undefined"!=typeof window){let n=new CustomEvent(`${e}`,t);dispatchEvent(n)}else ye.postMessage({type:"dispatchEvent",payload:{id:e,data:t}})}function Id(){return td(this,void 0,void 0,function*(){if(!cd){cd=!0;try{const e=id.find(e=>{var t;return"init"==(null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.type)});if(e){const t=id.indexOf(e);t>-1&&id.splice(t,1),yield yd(e.message.type,e.message.payload).then(e.resolve).catch(e.reject)}for(;id.length>0;){const e=id.shift();if(!e)continue;const{message:t,resolve:n,reject:o}=e;yield yd(t.type,t.payload).then(n).catch(o)}}finally{cd=!1}}})}const Td=e=>{if(e instanceof s)throw e};function kd(){return td(this,void 0,void 0,function*(){yield yd("init",{url:r.BASE_URL,aiurl:r.AI_URL,accessToken:he.BearerAccessToken,refreshToken:he.refreshToken,nodeUrl:r.NODE_URL,enableAi:!1,applicationName:r.BASE_APPLICATION,flags:r.FLAGS,accessControlUrl:r.ACCESS_CONTROL_BASE_URL})})}const bd={AccessControlService:{assignAccess:{parameters:["request"]},assignSuperAdmin:{parameters:["entityId"]},checkAccess:{parameters:["conceptId","permission","entityId"]},checkAccessBulk:{parameters:["conceptIds","permission","entityId"]},getAccessInheritanceStatus:{parameters:["conceptId","connectionTypeId"]},getConceptIdsWithPermission:{parameters:["permission","conceptIdsFilter","entityId"],documentation:"Get all conceptIds which have a certain permission for an entity.\nDelegates to checkAccessBulk for full inheritance support."},getParentAccessId:{parameters:["conceptId"]},hasAnyGrant:{parameters:["ownChain","typeChain","subjects","decisions"]},hasParentAccessInheritance:{parameters:["conceptId","parentConceptId"]},isSuperAdmin:{parameters:["entityId"]},makeConceptPrivate:{parameters:["conceptId"]},parseBoolData:{parameters:["response"]},parseIntData:{parameters:["response"]},removeParentAccessInheritance:{parameters:["conceptId","parentConceptId"]},removeParentAccessInheritanceBulk:{parameters:["childConceptIds","parentConceptId"]},resolveBulkDecisions:{parameters:["accessIds","permission","subjects"]},resolveBulkInheritanceGraph:{parameters:["seedAccessIds","inheritTypeId","accessIdToConceptId"],documentation:'Resolve inheritance graph via 3-source BFS, depth-limited to MAX_BFS_DEPTH.\n\nSource 1: FreeSchema internal connections ("the_parent_access_inheritance")\nSource 2: Explicit parent access links (via Access API)\nSource 3: Concept-connection access inheritance'},resolveSubjects:{parameters:["entityId"]},revokeAccess:{parameters:["conceptId","permission","entityId"]},revokeAccessBulk:{parameters:["request"]},revokeSuperAdmin:{parameters:["entityId"]},setAccessInheritance:{parameters:["conceptId"]},setAccessInheritanceStatus:{parameters:["conceptId","isEnabled","connectionTypeId"]},setParentAccessInheritance:{parameters:["conceptId","parentConceptId"]},setParentAccessInheritanceBulk:{parameters:["childConceptIds","parentConceptId"]}},AccessTracker:{GetSuggestedConcepts:{parameters:["top"],documentation:"Fetch suggested concepts from the server with proper error handling."},GetSuggestedConnections:{parameters:["top"],documentation:"Fetch suggested connections from the server with proper error handling.\nParam: top number of connections to get load"},addConceptToBinaryTree:{parameters:["conceptsDataArray"],documentation:"Add Concepts to Binary Tree"},addConnectionToBinaryTree:{parameters:["connectionsDataArray"],documentation:"Add Concepts to Binary Tree"},getTopConcepts:{parameters:["n"],documentation:"Retrieves the top N concepts by their counts."},getTopConnections:{parameters:["n"],documentation:"Retrieves the top N connections by their counts."},incrementConcept:{parameters:["conceptId"],documentation:"Increments the count for a specific conceptId."},incrementConnection:{parameters:["connectionId"],documentation:"Increments the count for a specific connectionId."},loadDataFromLocalStorage:{parameters:[],documentation:"Loads the concept and connection data from localStorage."},saveDataToLocalStorage:{parameters:[],documentation:"Saves the concept and connection data to localStorage."},sendToServer:{parameters:[]},setNextSyncTime:{parameters:[],documentation:"Sets the next sync time based on the current time and sync interval."},startAutoSync:{parameters:[],documentation:"Starts auto-syncing to the server every specified time interval.\nThis will automatically call `syncToServer` every 5 minutes"},stopAutoSync:{parameters:[],documentation:"Stops the access tracker auto-sync timer."},syncNow:{parameters:[],documentation:"Sync immediately called by setInterval when time to sync has arrived."},syncToServer:{parameters:[],documentation:"Syncs the concept and connection data with the server."}},Anomaly:{checkAnomalyInBulk:{parameters:["formData"],documentation:"Checks anomalies for multiple concepts in bulk.\nIterates over a record of concept-value pairs and detects anomalies.\n\nParam: {Record<string, string>} instanceData - An object where each key is a concept type and each value is the corresponding data value.\nReturns: {Promise<Record<string, { valid: boolean, warnings: string[] }>>} - A promise that resolves to an object where each key is a concept type\nand the value is an object containing `valid` (boolean) and `warnings` (array of warning messages)."},checkConceptAnomaly:{parameters:["typeConcept","value"],documentation:"Checks whether a given concept and value pair contains an anomaly.\nAn anomaly is detected based on the concept's length and type rules.\n\nParam: {string} typeConcept - The concept type (e.g., `the_name`).\nParam: {string} value - The value to check for anomalies.\nReturns: {Promise<{ valid: boolean, warnings: string[] }>} - A promise that resolves to an object containing:\n- `valid`: A boolean indicating whether the value is valid according to the anomaly rules.\n- `warnings`: An array of warning messages related to the value's anomalies."},detectDataType:{parameters:["value"],documentation:"Detects the data type of a given value based on predefined rules.\nIt checks the value against the `DATA_TYPES_RULES` to find the matching data type.\n\nParam: {string} value - The value to check.\nReturns: {string | null} - The detected data type, or `null` if no match is found."},fetchAnomalyParameters:{parameters:[],documentation:"Fetches anomaly parameters directly from the backend API.\nThis method is used internally by `getAnomalyParameters` to retrieve fresh data.\n\nReturns: {Promise<any>} - A promise that resolves to the fetched anomaly parameters."},getAnomalyParameters:{parameters:[],documentation:"Fetches the anomaly parameters.\nIt first checks if the parameters are cached and whether the cache is still valid (not expired).\nIf the cache is valid, it returns the cached data. If not, it fetches the data from the API.\n\nReturns: {Promise<any>} - A promise that resolves to the anomaly parameters."},getExportedFunction:{parameters:[],documentation:"List all the exported functions of the package\nReturns: Keys of the Object which has exported functions"},getFunctionaAnomalyParameters:{parameters:[]},initializeAnomalyParameters:{parameters:[],documentation:"Initializes the anomaly parameters by fetching them from the API.\nThis method is only run once on startup to ensure the cache is ready for use.\nIt will fetch the parameters from the API and store them in a static cache.\n\nReturns: {Promise<void>} - A promise that resolves once the parameters have been initialized."},refreshCache:{parameters:[],documentation:"Refreshes the anomaly parameters cache if the cache has expired.\nIf the cache expiry threshold has been surpassed, the method re-fetches the data from the API.\n\nReturns: {Promise<void>} - A promise that resolves when the cache has been refreshed."}},BaseUrl:{CreateGhostConceptApiUrl:{parameters:["withAuth"]},CreateGhostConnectionApiUrl:{parameters:[]},CreatePrototypeUrl:{parameters:[]},CreateSessionId:{parameters:[]},CreateSessionVisitUrl:{parameters:[]},CreateTheCharacterDataUrl:{parameters:[]},CreateTheConceptUrl:{parameters:[]},CreateTheConnectionNewUrl:{parameters:[]},CreateTheConnectionUrl:{parameters:[]},CreateTheTextDataUrl:{parameters:[]},DeleteConceptUrl:{parameters:[]},DeleteTheConnectionBulkUrl:{parameters:[]},DeleteTheConnectionUrl:{parameters:[]},DeleteUserUrl:{parameters:[]},FreeschemaQueryUrl:{parameters:[]},GetAllAiData:{parameters:[]},GetAllConceptsByTypeUrl:{parameters:[]},GetAllConceptsOfUserUrl:{parameters:[]},GetAllConnectionsOfCompositionBulkUrl:{parameters:[]},GetAllConnectionsOfCompositionUrl:{parameters:[]},GetAllConnectionsOfConceptUrl:{parameters:[]},GetAllConnectionsOfUserUrl:{parameters:[]},GetAllConnectionsToConceptUrl:{parameters:[]},GetAllLinkerConnectionOfConceptUrl:{parameters:[]},GetAllLinkerConnectionToConceptUrl:{parameters:[]},GetAllPrefetchConnectionsUrl:{parameters:[]},GetCachedImage:{parameters:["ImageName"]},GetCharacterByCharacterUrl:{parameters:[]},GetCompositionConnectionBetweenTwoConceptsUrl:{parameters:[]},GetConceptBulkUrl:{parameters:[]},GetConceptByCharacterAndCategoryDirectUrl:{parameters:[]},GetConceptByCharacterAndCategoryUrl:{parameters:[]},GetConceptByCharacterAndTypeUrl:{parameters:[]},GetConceptByCharacterValueUrl:{parameters:[]},GetConceptUrl:{parameters:[]},GetConnectionBulkUrl:{parameters:[]},GetConnectionUrl:{parameters:[]},GetConnectionsBetweenUrl:{parameters:[]},GetInstanceConceptByCharacterTypeUrl:{parameters:[]},GetRealConceptById:{parameters:[]},GetReservedConnectionIdUrl:{parameters:[]},GetReservedIdUrl:{parameters:[]},GetSuggestedConcepts:{parameters:[]},GetSuggestedConnections:{parameters:[]},GetTypeConceptBulk:{parameters:[]},LogHealth:{parameters:[]},LoginUrl:{parameters:[]},MakeTheNameInBackendUrl:{parameters:[]},MakeTheTypeConceptUrl:{parameters:[]},PostLogger:{parameters:[]},PostPrefetchConceptConnections:{parameters:[]},RecursiveSearchUrl:{parameters:[]},RefreshTokenUrl:{parameters:[]},SearchAllTypeWithLinker:{parameters:["auth"]},SearchCompositionsUrl:{parameters:[]},SearchInternalWithAuthenticatedCcsUrl:{parameters:[]},SearchInternalWithCcsUrl:{parameters:[]},SearchLinkMultipleAll:{parameters:[]},SearchLinkMultipleAllApiUrl:{parameters:[]},SignupUrl:{parameters:[]},UploadFileLimitUrl:{parameters:[]},ViewInternalDataUrl:{parameters:[]},getAppConfig:{parameters:[]},getConnectionsByTypes:{parameters:[]},getLatestWidgetData:{parameters:[]},getRandomizer:{parameters:[]},getRecentWidgetData:{parameters:[]},getWidgetData:{parameters:[]},r2PresignedUploadUrl:{parameters:[]},sendBulkMail:{parameters:[]},sendMail:{parameters:[]},sendPersonalMail:{parameters:[]},setRandomizer:{parameters:["id"]},uploadFileUrl:{parameters:[]},uploadImageUrl:{parameters:[]},uploadImageUrlWithSmall:{parameters:[]},uploadR2StorageUrl:{parameters:[]}},BinaryTree:{addConceptToTree:{parameters:["concept"],documentation:"Adds a concept to both the ID map and the character tree.\n\nThe character tree (BinaryCharacterTree) is still an AVL tree because\nit supports character-based search which is out of scope for this refactor.\n\nParam: concept - The Concept to store"},addNodeToTree:{parameters:["node"],documentation:"Low-level add — stores the node's key/value in the Map.\nKept for API compatibility (called internally by addConceptToTree).\nParam: node - Node with numeric key and Concept value"},checkFlag:{parameters:["resolve"],documentation:"Recursive polling helper for waitForDataToLoad"},countNumberOfNodes:{parameters:[],documentation:"Returns the total number of concepts stored.\nReturns: Number of concepts in the Map"},getConceptListFromIds:{parameters:["ids","conceptArray","remainingIds"],documentation:'Bulk concept retrieval by ID list.\n\nFor each ID found in the Map, pushes the Concept into conceptArray\nand removes the ID from the ids array. IDs remaining in the array\nafter this call are "not found" and will be fetched from the backend.\n\nPerformance: O(k) where k = ids.length (was O(N) full tree traversal).\n\nParam: ids - Array of concept IDs to look up (mutated: found IDs are spliced out)\nParam: conceptArray - Output array (mutated: found Concepts are pushed)\nParam: remainingIds - Not used directly but kept for API compatibility'},getNodeFromTree:{parameters:["id"],documentation:"Retrieves a concept by ID from the Map.\n\nReturns a { key, value } wrapper matching the Node shape that callers expect.\nCallers access the returned object's .value property to get the Concept.\n\nParam: id - The concept ID to look up\nReturns: Node-like wrapper with .value = Concept, or null if not found"},normalizeId:{parameters:["id"]},removeNodeFromTree:{parameters:["id"],documentation:"Removes a concept by ID. Dispatches an event before deletion\nso listeners (e.g. UI components) can react to the removal.\n\nParam: id - The concept ID to remove"},waitForDataToLoad:{parameters:[],documentation:"Polls until IdentifierFlags.isDataLoaded is true (max 25 seconds).\nUsed by callers that need to wait for the initial IndexedDB load to finish."}},BuilderStatefulWidget:{CreateConnectionBetweenEntityLocal:{parameters:["concept1Data","concept2Data","linker"],documentation:'Creates a local connection between two concepts with a specified linker type.\n\nThis helper method creates a connection relationship between two entity concepts\nusing local storage (not immediately synced to backend). The linker name is\nautomatically prefixed with the first concept\'s type to create a typed connection.\n\n**Process:**\n1. Extracts userId from first concept\n2. Creates linker name: "{concept1Type}_{linkerName}"\n3. Creates or gets the connection type concept locally\n4. Creates the connection between the two concepts\n\n**Use Cases:**\n- Creating relationships in offline mode\n- Building entity associations within widgets\n- Temporary connections before sync\n- Development/testing without backend\n\nParam: concept1Data - The source concept (FROM)\nParam: concept2Data - The target concept (TO)\nParam: linker - The relationship name (e.g., "email", "phone", "address")\nThis will be prefixed with concept1\'s type\n\nReturns: Promise resolving to "connection created" string'},after_render:{parameters:[],documentation:"Executes event binding code after the widget renders.\n\nThis lifecycle method runs after the DOM is updated to attach event listeners\nand perform post-render operations. It executes user-defined code stored in\naddEventFunction.\n\n**Lifecycle Position:**\nRuns after render() completes and DOM is updated.\n\n**Common Uses:**\n- Attach click, input, or other event listeners\n- Set up keyboard shortcuts\n- Initialize interactive features\n- Bind form validation\n- Set up drag-and-drop handlers\n\n@throws Will log and re-throw errors if event binding code fails"},before_render:{parameters:[],documentation:"Executes the componentDidMount lifecycle hook.\n\nThis function is called after the component mounts to the DOM, similar to\nReact's componentDidMount. It executes user-defined initialization code\nstored in componentDidMountFunction.\n\n**Lifecycle Position:**\nRuns after render_custom_functions() and render_widgetDependencies(),\nbut before mount_child().\n\n**Common Uses:**\n- Fetch initial data from API\n- Set up subscriptions or listeners\n- Initialize third-party libraries\n- Perform DOM manipulations\n- Set initial state based on props\n\n@throws Will log and re-throw errors if componentDidMount code fails"},createRandomNumber:{parameters:[],documentation:"Generates a random identifier for this widget element.\n\nReturns: A random number used as the element identifier"},createTypeEditor:{parameters:["event"],documentation:"Opens the type editor interface for this widget.\n\nThis method is called in development mode when the widget is clicked.\nIt opens a visual editor for modifying the widget's type and properties.\n\nParam: event - The click event that triggered the editor"},getHtml:{parameters:[],documentation:"Returns the HTML content of this widget.\n\nReturns: The HTML string for this widget"},getTypeValueList:{parameters:["typeName"],documentation:'Fetches a list of type values from the backend based on the widget\'s type.\n\nThis method performs a filtered search using FreeschemaQuery to retrieve all entities\nof a specific type. The results are formatted as options for dropdowns or selection lists.\n\n**Process:**\n1. Parses widgetType to extract main composition and type-value key\n2. Creates filter for entities (e.g., filter by ID > 1)\n3. Executes FreeschemaQuery with filters\n4. Formats results into { id, name, text } objects\n5. Stores in this.typeValueList\n\n**Type Name Format:**\n- widgetType: "the_element_name"\n- mainComposition: "the_element"\n- typevalueKey: "the_name"\n\nParam: typeName - Optional type name (defaults to this.widgetType)\n\nReturns: Promise resolving to array of formatted type values:\n[{ id: number, name: string, text: string }, ...]'},getUserId:{parameters:[],documentation:"Retrieves the current user's ID from local storage.\n\nThis method fetches the user profile from localStorage and extracts the userId.\nUsed for user-specific operations and data access within widgets.\n\nReturns: Promise resolving to the user ID (number) or undefined if not found"},mount:{parameters:["parent"],documentation:"Mounts the widget to a parent DOM element and initializes the lifecycle.\n\nThis is the primary method for rendering a widget to the DOM. It:\n1. Creates a wrapper div element\n2. Attaches click handlers (if in development mode)\n3. Inserts HTML content\n4. Executes lifecycle hooks in order\n5. Mounts child widgets\n\n**Lifecycle Execution Order:**\n1. render_custom_functions() - Execute custom functions\n2. render_widgetDependencies() - Load dependencies\n3. before_render() - componentDidMount equivalent\n4. mount_child() - Mount child widgets\n5. render() - Update DOM\n\n**Development Mode:**\nWhen `inDevelopment` is true, the widget becomes clickable and opens\nthe type editor for visual configuration.\n\nParam: parent - The parent HTMLElement to mount this widget to"},mount_child:{parameters:[],documentation:"Mounts child widgets by executing the mountChildWidgetsFunction.\n\nThis method dynamically executes user-defined JavaScript code for mounting\nchild widgets. The code is executed within the widget's context with access\nto the tsccs package.\n\n**Execution Context:**\n- Code is bound to `this` (the widget instance)\n- Has access to `tsccs` module for TSCCS operations\n- Runs asynchronously\n\n@throws Will log and re-throw errors if mount_child code fails"},render_custom_functions:{parameters:[],documentation:"Executes all custom functions defined for this widget.\n\nThis method runs during the mount phase to execute user-defined custom\nfunctions. All functions in the customFunctions array are concatenated\nand executed together in the widget's context.\n\n**Custom Functions:**\n- Defined in widget.customFunctions array\n- Each function is a TCustomFunction object with a code property\n- All functions execute with access to `this` (widget) and `tsccs` module\n- Functions can define methods, initialize state, or set up utilities\n\n@throws Will log and re-throw errors if custom function code fails"},render_widgetDependencies:{parameters:[],documentation:"Executes widget dependencies initialization code.\n\nThis lifecycle method runs during the mount phase to load and initialize\nany dependencies required by the widget. Dependencies code is executed\nwith access to the tsccs module.\n\n**Execution:**\n- Runs before before_render()\n- Code in widgetDependenciesData is executed\n- Bound to widget context (this)\n- Has access to tsccs package\n\n@throws Will log and re-throw errors if dependency code fails"},setProperty:{parameters:["widgetTypeName"],documentation:'Sets the widget type and fetches associated type values.\n\nThis method updates the widget\'s type, fetches the corresponding type values\nfrom the backend, updates DOM attributes, and triggers a re-render.\n\nParam: widgetTypeName - The new widget type name (e.g., "the_person_name")\n\nReturns: Promise resolving to this widget instance (for method chaining)'},setTitle:{parameters:["title"],documentation:"Sets the browser document title.\n\nParam: title - The title string to set as the document title"}},Composition:{GetDataCache:{parameters:[]},UpdateAcrossDistributedSystem:{parameters:[]},isUpdating:{parameters:[]},updateCache:{parameters:[]}},CompositionBinaryTree:{addCompositionToTree:{parameters:["composition"]},addNodeToTree:{parameters:["node"]},countNumberOfNodes:{parameters:[]},getNodeFromTree:{parameters:["id"]},removeNodeFromTree:{parameters:["id"]}},CompositionNode:{addNode:{parameters:["passedNode","node","height"]},countNodeBelow:{parameters:["root"]},getBalanceFactor:{parameters:["N"]},getFromNode:{parameters:["id","node"]},getHeight:{parameters:["node"]},inOrderSuccessor:{parameters:["root"]},isValid:{parameters:[]},leftRotate:{parameters:["x"]},removeNode:{parameters:["passedNode","id"]},rightRotate:{parameters:["y"]},saveToCache:{parameters:["data"]}},Concept:{getType:{parameters:[]}},ConceptsData:{AddConcept:{parameters:["concept"]},AddConceptTemporary:{parameters:["concept"]},AddConceptToMemory:{parameters:["concept"]},AddConceptToStorage:{parameters:["concept"]},AddNpc:{parameters:["id"]},AddWidget:{parameters:["widgetDetails"]},CheckContains:{parameters:["concept"]},GetBinaryCharacterTree:{parameters:[]},GetConcept:{parameters:["id"]},GetConceptBulkData:{parameters:["ids","connectionArray","remainingIds"]},GetConceptByCharacter:{parameters:["characterValue"]},GetConceptByCharacterAndCategoryLocal:{parameters:["character_value","categoryId"]},GetConceptByCharacterAndTypeLocal:{parameters:["character_value","typeId"]},GetConceptByCharacterUpdated:{parameters:["characterValue"]},GetConceptsByTypeId:{parameters:["typeId"]},GetConceptsByTypeIdAndUser:{parameters:["typeId","userId"]},GetNpc:{parameters:["id"]},GetWidget:{parameters:["id"]},RemoveConcept:{parameters:["concept"]},RemoveWidget:{parameters:["id"]},getName:{parameters:[]}},Connection:{},ConnectionData:{AddConnection:{parameters:["connection"]},AddConnectionToMemory:{parameters:["connection"]},AddConnectionToStorage:{parameters:["connection"]},AddNpConn:{parameters:["id"]},AddToDictionary:{parameters:["connection"]},CheckContains:{parameters:["connection"]},GetConnection:{parameters:["id"]},GetConnectionBulkData:{parameters:["ids","connectionArray","remainingIds"]},GetConnectionByOfTheConceptAndType:{parameters:["ofTheConceptId","typeId"]},GetConnectionByOfType:{parameters:["ofTheConceptId","typeId"]},GetConnectionTree:{parameters:[]},GetConnectionTypeOfTree:{parameters:[]},GetConnectionTypeTree:{parameters:[]},GetConnectionsOfCompositionLocal:{parameters:["id"]},GetConnectionsOfConcept:{parameters:["id"]},GetNpConn:{parameters:["id"]},RemoveConnection:{parameters:["connection"]},getName:{parameters:[]}},CountInfo:{},DependencyObserver:{addTrackedEventListener:{parameters:["key","eventName","handler"],documentation:"Registers a window listener and tracks enough metadata to remove it later.\nThe key identifies the logical subscription; eventName is the CustomEvent name."},bind:{parameters:[],documentation:"Binds and refreshes the observable data. Override in subclasses to implement specific data fetching logic.\nReturns: The bound data"},dispose:{parameters:[],documentation:"Removes all listeners owned by this observer."},execute:{parameters:[],documentation:"Executes the observable once without subscribing to updates.\nReturns: The executed data"},listenToEvent:{parameters:["id"],documentation:"Listens to connection changes for a specific concept and updates subscribers when connections are modified.\nParam: id - The concept ID to track"},listenToEventConnectionType:{parameters:["id","connectionType"],documentation:"Listens to connection changes filtered by connection type for a specific concept.\nParam: id - The concept ID to track\nParam: connectionType - The connection type ID to filter by"},listenToEventType:{parameters:["id"],documentation:"Listens to changes for a specific concept type and updates subscribers when new concepts of that type are created.\nParam: id - The type concept ID to track"},notify:{parameters:[],documentation:"Notifies all subscribers with the current data."},onDispose:{parameters:[],documentation:"Hook for subclasses that maintain additional subscriptions."},removeListenToEvent:{parameters:["id"],documentation:"Removes an event listener for a specific concept ID.\nParam: id - The concept ID to stop tracking"},removeTrackedEventListener:{parameters:["key"],documentation:"Removes a previously tracked window listener by its logical key."},run:{parameters:[],documentation:"Executes the observable without subscribing. Override in subclasses for non-reactive data fetching.\nReturns: The executed data"},subscribe:{parameters:["callback","errorCallback"],documentation:"Subscribes a callback to receive data updates whenever tracked concepts/connections change.\nParam: callback - Function to call with (data, observer) when updates occur\nParam: errorCallback - Optional function to call when errors occur\nReturns: Result of calling the callback with current data"},unsubscribe:{parameters:["callback"],documentation:"Removes a callback from the subscriber list.\nParam: callback - The callback function to remove\nReturns: Number of remaining subscribers"},update:{parameters:[],documentation:"Forces a data refresh and notifies all subscribers."}},Environments:{getValue:{parameters:["key","defaultValue"],documentation:"Retrieves a stored value by key.\n\nParam: key - The key to look up.\nParam: defaultValue - Value returned when the key has never been set. Defaults to `null`.\nReturns: The stored value, or `defaultValue` if the key is absent."},setValue:{parameters:["key","value"],documentation:"Stores a value under the given key. Overwrites any existing value.\nTakes effect immediately — the next call to `getValue` with the same key\nreturns the new value.\n\nParam: key - The key to store under.\nParam: value - The value to store.\nReturns: The `Environments` class itself for chaining."}},FilterSearch:{},FreeschemaQuery:{},LConcept:{getType:{parameters:[]}},LConnection:{},LocalConceptsData:{AddConcept:{parameters:["concept"]},AddConceptToMemory:{parameters:["concept"]},AddPermanentConcept:{parameters:["concept"]},ClearData:{parameters:[]},GetConcept:{parameters:["id"]},GetConceptByCharacter:{parameters:["characterValue"]},GetConceptByCharacterAndCategoryLocal:{parameters:["character_value","categoryId"]},GetConceptByCharacterAndTypeLocal:{parameters:["character_value","typeId"]},GetConceptByGhostId:{parameters:["id"]},GetConceptsByTypeId:{parameters:["typeId"]},GetConceptsByTypeIdAndUser:{parameters:["typeId","userId"]},RemoveConcept:{parameters:["concept"]},RemoveConceptById:{parameters:["conceptId"]},UpdateConceptSyncStatus:{parameters:["id"]},getName:{parameters:[]}},LocalSyncData:{AddConcept:{parameters:["concept"]},AddConceptIfDoesNotExist:{parameters:["concept","conceptList"]},AddConnection:{parameters:["connection"]},CheckContains:{parameters:["concept"]},CheckContainsConnection:{parameters:["connection"]},CheckIfTheConceptIdExists:{parameters:["id","conceptList"]},ConvertGhostIdsInConnections:{parameters:["connectionArray"]},RemoveConcept:{parameters:["concept"]},RemoveConnection:{parameters:["connection"]},RemoveConnectionById:{parameters:["connectionId"]},SyncDataDelete:{parameters:["id"]},SyncDataOnline:{parameters:["transactionId","actions","withAuth"]},SyncDataOnlineWithoutAuth:{parameters:["transactionId","actions","withAuth"]},UpdateConceptListToIncludeRelatedConcepts:{parameters:["connectionArray","conceptsArray"]},initializeTransaction:{parameters:["transactionId"]},markTransactionActions:{parameters:["transactionId","actions"]},rollbackTransaction:{parameters:["transactionId","actions"]},syncDataLocalDb:{parameters:[]}},LocalTransaction:{CreateConnection:{parameters:["ofTheConcept","toTheConcept","connectionTypeString"]},CreateConnectionBetweenEntityLocal:{parameters:["concept1Data","concept2Data","linker"]},CreateConnectionBetweenTwoConceptsLocal:{parameters:["ofTheConcept","toTheConcept","linker","both"]},CreateTheCompositionLocal:{parameters:["json","ofTheConceptId","ofTheConceptUserId","mainKey","userId","accessId","sessionInformationId","automaticSync"]},CreateTheConceptLocal:{parameters:["referent","typecharacter","userId","categoryId","typeId","accessId","isComposition","referentId","actions"]},CreateTheConnectionLocal:{parameters:["ofTheConceptId","toTheConceptId","typeId","orderId","typeString","userId"]},DeleteConnectionsBetween:{parameters:["query"],documentation:"Queries the backend for connections matching the given criteria and queues all\nreturned connection IDs for batched bulk deletion when commitTransaction() is called.\n\n**Nothing is deleted until commitTransaction() is called.**\nCalling rollbackTransaction() discards the queue without touching the backend.\n\nSupported query permutations:\n1. `ofTheConceptId` + `toTheConceptId` + `type` — connections between two specific concepts\n2. `ofTheConceptId` + `type` — all connections FROM a concept of that type\n3. `toTheConceptId` + `type` — all connections TO a concept of that type\n4. `typeId` + `isComposition: true` — all internal connections of a composition\n\nFor multiple queries in one go use {@link DeleteConnectionsBetweenBulk} — it sends\nall queries in a single HTTP request.\n\nParam: query - Partial FetchConnectionQuery with only the fields relevant to your permutation.\nReturns: The connection IDs queued for deletion by this call."},DeleteConnectionsBetweenBulk:{parameters:["queries"],documentation:"Same as {@link DeleteConnectionsBetween} but resolves multiple queries in a single\nHTTP request to POST /api/get-connection-between.\n\nPrefer this over looping DeleteConnectionsBetween — all queries go to the backend\nin one round trip, and all returned IDs are merged into the same pending-deletion queue.\nThe actual deletion fires in 300-id bulk batches inside commitTransaction().\n\nParam: queries - Array of partial FetchConnectionQuery objects, one per query permutation.\nReturns: All connection IDs queued for deletion across every query in this call."},MakeTheInstanceConceptLocal:{parameters:["type","referent","composition","userId","accessId","sessionInformationId","referentId"]},MakeTheTypeConceptLocal:{parameters:["typeString","sessionId","sessionUserId","userId"]},commitTransaction:{parameters:[],documentation:"Method to commi the created Transactions"},commitTransactionWithoutAuth:{parameters:[]},flushPendingConnectionDeletions:{parameters:[]},initialize:{parameters:[],documentation:"Method to initialize the transactions for specified transaction"},markAction:{parameters:[],documentation:"Method to move concepts and connection to transaction collection\nParam: concept Concept"},rollbackTransaction:{parameters:[],documentation:"Method to rollback all the tranctions occured"}},Logger:{checkLoggerServerStatus:{parameters:[]},clearLogsFromLocalStorage:{parameters:["logType"]},formatLogData:{parameters:["level","message","data"],documentation:"Logs a message with optional additional structured data."},log:{parameters:["level","message","data"]},logApplication:{parameters:["level","message","data"]},logError:{parameters:["startTime","userId","operationType","requestFrom","requestIP","responseStatus","responseData","functionName","functionParameters","userAgent","conceptsUsed"]},logUpdate:{parameters:["logData"],documentation:"Updates log data with execution details.\nParam: logData The log data object to be updated."},logfunction:{parameters:["myFunction","args"]},saveLogToLocalStorage:{parameters:["logType","logMessage"],documentation:"Helper method to save logs to localStorage."},sendApplicationLogsToServer:{parameters:[],documentation:"Helper method to send logs to the server."},sendPackageLogsToServer:{parameters:[]},setLogLevel:{parameters:["level"],documentation:'Set the log level (e.g., "DEBUG", "INFO", "WARNING", "ERROR").'},shouldLog:{parameters:["level"],documentation:"Determines whether the current log level permits the given level to be logged."},startAutoSync:{parameters:[],documentation:"Automatically starts the auto-sync mechanism.\nThis is private and does not need external interaction."},stopAutoSync:{parameters:[],documentation:"Automatically stops the auto-sync mechanism when required."}},PatcherStructure:{},Prototype:{},SearchLinkMultipleAllObservable:{bind:{parameters:[],documentation:"Executes the search queries and sets up change listeners.\nReturns: Formatted search results"}},SearchQuery:{},SearchStructure:{},Selector:{addFilter:{parameters:["value"]},after_render:{parameters:[]},before_render:{parameters:[]},getHtml:{parameters:[]}},SessionData:{},StatefulWidget:{UpdateChildData:{parameters:["value","widget"],documentation:"Updates a child widget's data and triggers re-render.\n\nParam: value - New data to pass to the child widget\nParam: widget - The child widget instance to update"},after_render:{parameters:[],documentation:"Lifecycle hook called after rendering.\nOverride to add event listeners or post-render logic."},before_render:{parameters:[],documentation:"Lifecycle hook called before rendering.\nOverride for initialization logic. Default implementation calls render()."},getElement:{parameters:[],documentation:"Gets the root DOM element of this widget.\n\nReturns: The widget's root HTML element"},getElementByClassName:{parameters:["identifier"],documentation:"Finds all elements with a specific class name within this widget.\n\nParam: identifier - Class name to search for (without '.' prefix)\nReturns: NodeList of matching elements"},getHtml:{parameters:[],documentation:"Gets the HTML template for this widget.\n\nReturns: HTML string to be rendered"},getWidgetState:{parameters:["key","defaultValue"],documentation:"Retrieves shared state data by key.\n\nParam: key - State property key to retrieve\nParam: defaultValue - Default value if key doesn't exist\nReturns: The state value or default value"},hasStateChanged:{parameters:[],documentation:"Checks if the widget state has changed since last update.\n\nReturns: True if state changed, false otherwise"},isPropertyEqual:{parameters:["obj1","obj2"],documentation:"Compares two state objects for shallow equality.\n\nParam: obj1 - First state object\nParam: obj2 - Second state object\nReturns: True if objects are equal, false otherwise"},loadChildWidgets:{parameters:[],documentation:"Mounts all registered child widgets to their designated parent elements."},mount:{parameters:["parent"],documentation:"Mounts the widget to a parent DOM element and initializes lifecycle.\n\nCreates a wrapper div, assigns unique ID, renders HTML, and executes\nlifecycle hooks in sequence.\n\nParam: parent - The parent HTML element to mount this widget into"},mount_child:{parameters:[],documentation:"Lifecycle hook for mounting child widgets.\nOverride this method to define custom child mounting logic."},querySelector:{parameters:["selector"],documentation:"Finds the first element matching a CSS selector within this widget.\n\nParam: selector - CSS selector string\nReturns: The first matching element or null"},querySelectorAll:{parameters:["selector"],documentation:"Finds all elements matching a CSS selector within this widget.\n\nParam: selector - CSS selector string\nReturns: NodeList of matching elements or null"},render:{parameters:[],documentation:"Re-renders the widget by updating the DOM with current HTML template.\nAlso triggers child widget loading and after_render hook."},renderChildWidgets:{parameters:[],documentation:"Recursively renders all child widgets in the hierarchy."},setState:{parameters:["newState"],documentation:"Updates the entire widget state and triggers re-render if changed.\n\nParam: newState - New state data to replace current state"},setStateProperty:{parameters:["newProperty"],documentation:"Updates specific state properties and triggers re-render if changed.\n\nParam: newProperty - Object containing properties to update"},setTitle:{parameters:["title"],documentation:"Sets the browser document title.\n\nParam: title - The new document title"},setWidgetState:{parameters:["key","value"],documentation:"Sets shared state data and propagates to all child widgets recursively.\n\nParam: key - State property key\nParam: value - State value to set"},update:{parameters:[],documentation:"Lifecycle hook called after widget data is updated.\nOverride this method to handle post-update logic."}},SyncData:{AddConcept:{parameters:["concept"]},AddConnection:{parameters:["connection"]},CheckContains:{parameters:["concept"]},CheckContainsConnection:{parameters:["connection"]},RemoveConcept:{parameters:["concept"]},RemoveConnection:{parameters:["connection"]},SyncDataDelete:{parameters:["id"]},SyncDataOnline:{parameters:[]}},TokenStorage:{hydrateProfile:{parameters:[],documentation:"Call once at app startup (e.g. in init()) to decrypt the stored profile\ninto memory so that getUserDetails() can read it synchronously."},logout:{parameters:[],documentation:"Clears all stored credentials and profile data."},saveUserProfile:{parameters:["signinResponse"],documentation:"Stores user profile securely (encrypted in sessionStorage)\nand keeps the token in memory for API calls.\nAlso populates profileCache so getUserDetails() works synchronously."},setSession:{parameters:["sessionId"]},updateTokens:{parameters:["accessToken","refreshToken"]}},UserBinaryTree:{addConceptToTree:{parameters:["concept","userId","sessionId"]},addNodeToTree:{parameters:["node"]},checkFlag:{parameters:["resolve"]},compositeKey:{parameters:["userId","sessionId"]},countNumberOfNodes:{parameters:[]},getNodeFromTree:{parameters:["userId","sessionId"]},removeNodeFromTree:{parameters:["userId","sessionId"]},waitForDataToLoad:{parameters:[]}},Validator:{checkUniqueness:{parameters:["type","value"],documentation:"Checks if a concept with the given type and value is unique.\nParam: type concept type where to check\nParam: value value to check\nReturns: boolean indicating uniqueness"},validate:{parameters:["options"],documentation:"Take field element attributes\nParam: options Object conist of attributes\nReturns: Object with status and details"},validateField:{parameters:["options"],documentation:"Validates a single form field based on its constraints and uniqueness.\nParam: options - An object containing field properties including name, value, type, and validation constraints.\nReturns: An object containing validation errors if validation fails."},validateForm:{parameters:["formData"],documentation:"Validates all form fields by iterating over the provided form data.\nIt checks each field's value, data type, and constraints, collecting errors where necessary.\n\nParam: formData - An object representing the form data, where each key is a field name\nand each value is an object containing the `value`, `dataType`, and constraints (e.g., `maxLength`, `minLength`).\n\nReturns: An object containing validation errors for fields that failed validation.\nIf no errors exist, the object will be empty."}},WidgetTree:{},tsccs:{AccessControlService:{parameters:["apiClient"]},AccessTracker:{parameters:[]},AddGhostConcept:{parameters:["concept","userId","sessionId"]},Anomaly:{parameters:[],documentation:"Constructor that initializes anomaly parameters if the cache is not yet initialized.\nIt ensures that the anomaly parameters are loaded and cached for use."},BaseUrl:{parameters:[]},BinaryTree:{parameters:[],documentation:"BinaryTree — In-memory concept store keyed by numeric concept ID.\n\nBacked by a Map<number, Concept> for O(1) lookups, inserts, and deletes.\nAlso maintains the BinaryCharacterTree (character-indexed) on every insert\nso character-based search continues to work.\n\nAll public method signatures are preserved for backward compatibility.\ngetNodeFromTree returns a { key, value } wrapper so callers that access\nnode.value continue to work without changes."},BuildWidgetFromId:{parameters:["id"],documentation:"Fetches and builds widget data from the backend by widget ID.\n\nRetrieves complete widget structure including concepts, connections, and metadata.\nUses caching to prevent duplicate requests for the same widget.\n\nParam: id - The widget ID to fetch\nReturns: Promise resolving to formatted widget data"},BuilderStatefulWidget:{parameters:[],documentation:"BuilderStatefulWidget - A dynamic, stateful widget component for building interactive UI elements.\n\nThis class extends StatefulWidget to provide a powerful widget system that supports:\n- Dynamic HTML rendering with lifecycle hooks\n- Child widget composition and mounting\n- Custom function execution and event handling\n- Type-based data binding and queries\n- Development mode with visual editing capabilities\n- Widget dependencies and custom functions\n\n**Key Features:**\n- **Lifecycle Management**: before_render, render, after_render hooks\n- **Dynamic Code Execution**: Safely executes user-defined JavaScript functions\n- **Child Widgets**: Supports hierarchical widget composition\n- **Type Integration**: Connects to TSCCS type system for data binding\n- **Development Mode**: Visual editing and type editor integration\n- **Custom Functions**: Execute user-defined functions within widget context\n- **Local Connections**: Create relationships between entities at the widget level\n\n**Lifecycle Flow:**\n1. Constructor creates widget instance\n2. mount() attaches to parent DOM element\n3. render_custom_functions() executes custom code\n4. render_widgetDependencies() loads dependencies\n5. before_render() (componentDidMount equivalent) executes\n6. mount_child() mounts child widgets\n7. render() updates the DOM\n8. after_render() (addEvent) attaches event listeners\n\n**Use Cases:**\n- Building dynamic forms with type-based data\n- Creating reusable UI components\n- Widget-based page builders\n- Interactive dashboards\n- Data-driven UI components\n\n@extends StatefulWidget"},Composition:{parameters:[]},CompositionBinaryTree:{parameters:[]},CompositionNode:{parameters:["key","value","leftNode","rightNode"]},Concept:{parameters:["id","userId","typeId","categoryId","referentId","characterValue","accessId","isNew","entryTimeStamp","updatedTimeStamp","typeCharacter"]},ConceptsData:{parameters:[]},Connection:{parameters:["id","ofTheConceptId","toTheConceptId","userId","typeId","orderId","accessId"]},ConnectionData:{parameters:[]},CountInfo:{parameters:[]},CreateComposition:{parameters:["json","ofTheConceptId","ofTheConceptUserId","mainKey","userId","accessId","sessionInformationId"]},CreateConnection:{parameters:["ofTheConcept","toTheConcept","connectionTypeString","actions"],documentation:"Simplified connection creator that accepts concepts and a type string.\n\nThis is a convenience wrapper around CreateTheConnectionLocal that:\n1. Accepts Concept objects instead of IDs\n2. Creates the connection type concept if it doesn't exist\n3. Extracts necessary IDs automatically\n4. Sets appropriate defaults for local connections\n\n**Advantages:**\n- More intuitive API (pass concepts, not IDs)\n- Automatic type concept creation/retrieval\n- Less boilerplate code\n- Type-safe with TypeScript\n\n**Process:**\n1. Creates/retrieves type concept from connectionTypeString\n2. Extracts userId from source concept\n3. Calls CreateTheConnectionLocal with extracted IDs\n4. Returns the created connection\n\nParam: ofTheConcept - The source Concept object (FROM)\nParam: toTheConcept - The target Concept object (TO)\nParam: connectionTypeString - Type name as string (e.g., \"the_person_email\").\nA type concept will be created if it doesn't exist.\nParam: actions - Action tracking object for batch operations. Defaults to empty arrays.\n\nReturns: Promise resolving to the created Connection object"},CreateConnectionBetweenEntityLocal:{parameters:["concept1Data","concept2Data","linker","actions"]},CreateConnectionBetweenTwoConcepts:{parameters:["ofTheConcept","toTheConcept","linker","both","count"]},CreateConnectionBetweenTwoConceptsGeneral:{parameters:["ofTheConcept","toTheConcept","linker","both","count"]},CreateConnectionBetweenTwoConceptsLocal:{parameters:["ofTheConcept","toTheConcept","linker","both","actions"],documentation:'Creates a named connection between two concepts with optional bidirectional linking.\n\n**Complex Naming Logic**:\n- Forward connection type: "{ofType}_s_{linker}_s" (e.g., "person_s_knows_s")\n- Backward connection type: "{toType}_s_{linker}_by" (e.g., "person_s_knows_by")\n- Uses type.characterValue from concepts to build meaningful connection names\n\n**Bidirectional Mode (both=true)**:\n- Creates two connections: A→B and B→A\n- Forward: ofTheConcept → toTheConcept with "{ofType}_s_{linker}_s"\n- Backward: toTheConcept → ofTheConcept with "{toType}_s_{linker}_by"\n\nParam: ofTheConcept - Source concept (connection starts here)\nParam: toTheConcept - Target concept (connection points here)\nParam: linker - Relationship name (e.g., "knows", "works_at", "has")\nParam: both - If true, creates bidirectional connection (both A→B and B→A)\nParam: actions - Action tracking for batch operations\nReturns: The forward connection object\n@throws Error if connection creation fails'},CreateData:{parameters:["json","ofConcept","typeConcept","actions"]},CreateDefaultConcept:{parameters:[]},CreateDefaultLConcept:{parameters:[],documentation:'Creates a default empty local concept with all properties set to zero/default values.\n\nThis utility function generates a blank Concept object that can be used as a placeholder\nor default return value when a concept is not found. All IDs and values are set to 0\nor empty defaults.\n\n**Default Values:**\n- id: 0 (indicates empty/not found)\n- userId: 0\n- typeId: 0\n- categoryId: 0\n- referentId: 0\n- characterValue: "0"\n- accessId: 0\n- isNew: false\n- entryTimeStamp: current date\n- updatedTimeStamp: current date\n- typeCharacter: "0"\n\n**Use Cases:**\n- Default return value when concept not found\n- Placeholder for conditional logic\n- Initial state before loading data\n- Template for creating new concepts\n\nReturns: A Concept object with all properties set to default/zero values'},CreateSession:{parameters:["sessionData"],documentation:"Creates a new session for tracking user activity.\nRecords session metadata including user agent, IP, and timestamp.\n\nParam: sessionData - SessionData object containing session information\nReturns: Session object with generated ID, or null on error"},CreateSessionVisit:{parameters:["sessionId","url"],documentation:"Records a URL visit within an existing session.\nTracks page navigation and user journey through the application.\n\nParam: sessionId - ID of the session to associate the visit with\nParam: url - URL being visited\nReturns: Session visit object or null on error"},CreateTheCompositionLocal:{parameters:["json","ofTheConceptId","ofTheConceptUserId","mainKey","userId","accessId","sessionInformationId","automaticSync","actions"],documentation:'Converts a JSON object into a local composition structure with concepts and connections.\n\nThis powerful function recursively transforms any JSON object into the concept-connection\nsystem, creating local concepts for each key-value pair and establishing connections\nbetween them to preserve the hierarchical structure.\n\n**JSON to Composition Conversion:**\n- JSON keys become type concepts (e.g., "name", "email")\n- JSON string/number values become instance concepts\n- Nested objects/arrays create sub-compositions\n- Connections preserve parent-child relationships\n- All data stored locally (IndexedDB) for offline use\n\n**Recursive Process:**\n1. Iterates through each key in JSON object\n2. For nested objects/arrays: Creates composition concept + recurse\n3. For primitive values: Creates instance concept\n4. Creates connections from parent to child concepts\n5. Returns the main/root concept\n\n**Example Transformation:**\n```javascript\nInput JSON:\n{\nname: "Alice",\nemail: "alice@example.com",\naddress: {\ncity: "NYC",\nzip: "10001"\n}\n}\n\nCreates:\n- Concept: "name" (type) → "Alice" (instance)\n- Concept: "email" (type) → "alice@example.com" (instance)\n- Concept: "address" (composition concept)\n- Concept: "city" → "NYC"\n- Concept: "zip" → "10001"\n- Connections linking all concepts in hierarchy\n```\n\nParam: json - The JSON object/array to convert to composition structure.\nCan be any depth of nesting.\nParam: ofTheConceptId - Parent concept ID if this is a sub-composition.\nNull for root composition. Used for connecting to parent.\nParam: ofTheConceptUserId - User ID of the parent concept.\nUsed for ownership tracking in nested structures.\nParam: mainKey - The main composition ID (root concept ID).\nUsed as typeId for internal connections. Null for root.\nParam: userId - User ID of the creator. Defaults to 999 (system).\nParam: accessId - Access control level. Defaults to 999 (system).\nParam: sessionInformationId - Session ID. Defaults to 999 (system).\nParam: automaticSync - Reserved for future automatic sync feature.\nCurrently not fully implemented.\nParam: actions - Action tracking object that accumulates all created concepts\nand connections for batch operations. Defaults to empty arrays.\n\nReturns: Promise resolving to the main/root Concept of the composition'},CreateTheCompositionWithCache:{parameters:["json","ofTheConceptId","ofTheConceptUserId","mainKey","userId","accessId","sessionInformationId","composition"]},CreateTheConnection:{parameters:["ofTheConceptId","userId","toTheConceptId","typeId"],documentation:'Creates a connection (relationship) between two concepts and adds it to the sync queue.\n\nThis is the primary function for establishing relationships in the knowledge graph.\nConnections are directed edges that link two concepts together, representing relationships\nlike "works at", "belongs to", "authored by", etc.\n\n**Connection Structure:**\n- FROM concept (ofTheConceptId) → TO concept (toTheConceptId)\n- The relationship is directional\n- Type ID classifies what kind of relationship it is\n- Order ID allows sorting when multiple connections of the same type exist\n\n**Important Behaviors:**\n- Connections are marked as temporary (isTemp = true) for internal compositions\n- Added to SyncData queue for backend synchronization\n- Assigned a random temporary ID until persisted\n- Self-connections (same from/to) are prevented (returns invalid connection)\n- Default access level is 4 (typically means "admin" or "restricted")\n\nParam: ofTheConceptId - The source concept ID (start of the relationship).\nThis is where the connection originates FROM.\nParam: userId - The ID of the user creating this connection. Used for ownership and permissions.\nParam: toTheConceptId - The target concept ID (end of the relationship).\nThis is where the connection points TO.\nParam: typeId - The type classification for this connection. Defines the nature of the relationship.\n(e.g., 5="works_at", 6="manages", 7="member_of")\n\nReturns: The created Connection object with all properties set, including a temporary ID'},CreateTheConnectionGeneral:{parameters:["ofTheConceptId","ofTheConceptUserId","toTheConceptId","typeId","orderId","accessId"]},CreateTheConnectionLocal:{parameters:["ofTheConceptId","toTheConceptId","typeId","orderId","typeString","userId","actions"],documentation:'Creates a connection in local storage (IndexedDB) without syncing to the backend.\n\nThis is the primary function for creating offline-first connections. The connection is stored\nlocally in IndexedDB and memory, but NOT immediately sent to the backend. Sync happens\nlater via LocalSyncData.SyncDataOnline().\n\n**Virtual ID System:**\n- Generates a negative ID (e.g., -67890) to indicate local/virtual status\n- id and ghostId are initially equal and both negative\n- After backend sync: id becomes positive (real backend ID)\n- ghostId remains negative (preserves original local ID)\n- Mapping is stored in backend and LocalGhostIdTree\n\n**Connection Types:**\n- **Internal Connections**: orderId < 3 (within a composition)\n- typeId is typically the composition ID\n- **External Connections**: orderId >= 999 (between different entities)\n- typeId is a type concept ID\n- typeString provides human-readable type name\n\n**Self-Connection Prevention:**\nIf ofTheConceptId equals toTheConceptId, returns an empty connection (prevents loops).\n\nParam: ofTheConceptId - Source concept ID (FROM). The connection originates here.\nCan be negative (local) or positive (server) ID.\nParam: toTheConceptId - Target concept ID (TO). The connection points here.\nCan be negative (local) or positive (server) ID.\nParam: typeId - The type classification for this connection.\n- For internal connections: composition ID\n- For external connections: type concept ID\nParam: orderId - Order identifier for sorting multiple connections.\n- < 3: Internal connection\n- >= 999: External connection\n- Defaults to 1\nParam: typeString - Human-readable type name (e.g., "the_person_email").\nUsed primarily for external connections. Defaults to empty string.\nParam: userId - The ID of the user creating this connection. Defaults to 999 (system).\nParam: actions - Action tracking object that accumulates created concepts and connections.\nUsed for batch operations and rollback. Defaults to empty arrays.\n\nReturns: Promise resolving to the created Connection object with negative ID.\nReturns empty connection (all IDs = 0) if self-connection attempted.'},DelayFunctionExecution:{parameters:["ms","callback"],documentation:"Param: ms The time required to wait before executing this function\nParam: callback This is the function that needs to be executed\nReturns: returns a promise for the resolve"},DeleteConceptById:{parameters:["id"]},DeleteConceptLocal:{parameters:["id"],documentation:"Deletes a concept from local storage (IndexedDB).\n\nThis function removes a concept from LocalConceptsData, effectively deleting it\nfrom the local IndexedDB cache. This is a local-only delete - it does NOT sync\nthe deletion to the backend.\n\n**Important Notes:**\n- Only deletes from local storage (IndexedDB)\n- Does NOT delete from backend server\n- Does NOT automatically delete related connections\n- For full deletion including backend, use DeleteConceptById\n- Works with both negative (local) and positive (synced) IDs\n\n**Use Cases:**\n- Cleaning up local draft concepts\n- Removing concepts before they're synced\n- Local cache management\n- Testing and development\n\n**Process:**\n1. Fetches the concept via GetTheConceptLocal\n2. Removes it from LocalConceptsData\n3. Updates IndexedDB\n\nParam: id - The concept ID to delete (negative for local, positive for synced)\n\nReturns: Promise that resolves when deletion is complete"},DeleteConnectionById:{parameters:["id"]},DeleteConnectionByIdBulk:{parameters:["ids"]},DeleteConnectionByType:{parameters:["id","linker"],documentation:"Param: id\nParam: linker\n@returns"},DeleteConnectionByTypeBulk:{parameters:["id","linkers"]},DeleteUser:{parameters:["id"]},DependencyObserver:{parameters:[],documentation:"Base observable class that tracks concepts and connections for reactive state management.\nImplements the observer pattern to notify subscribers when tracked data changes."},Environments:{parameters:[],documentation:"Static key-value store for runtime configuration values.\n\nUsed throughout the package for feature flags and settings that need to be\nreadable anywhere without passing parameters down the call stack.\n\n**Built-in keys:**\n- `'enableCache'` — controls widget and query caching (default `true`).\nSet via `init()` parameters or toggled at runtime. Checked on every\ncache read/write in `QueryCacheManager` and `WidgetCacheManager`."},FilterSearch:{parameters:[]},FormatFromConnections:{parameters:["linkers","compositionData","mainComposition","reverse"],documentation:"########## Format works with JUSTDATA / NORMAL ########### used for single origin concept\nParam: linkers this is the list of linkers that\nParam: compositionData\nParam: mainComposition\nParam: reverse list of connection ids that need to show reverse conneciton.\n@returns"},FormatFromConnectionsAltered:{parameters:["connections","compositionData","mainComposition","reverse"],documentation:"## Format is DATAID ##\nThis is altered format and is different from others because it passes all the connections prebuilt/prefetched\nThis will not let the connections to be again fetched from the memory.\nParam: connections the type connections that need (external connections) to be passed\nParam: compositionData this is a dictionary type of format that has all the build compositions {id: { actual data}}\nParam: mainComposition this is the id of the main composition that builds the tree\nParam: reverse this is the list of connections ids that needs to go to the reverse direction (to----\x3efrom)\n@returns"},FreeschemaQuery:{parameters:[]},FreeschemaQueryApi:{parameters:["query","token"],documentation:"Executes a freeschema query for flexible, schema-free data retrieval.\nSupports custom query structures with filters, pagination, and nested queries.\n\nParam: query - FreeschemaQuery object containing query parameters, filters, and nested queries\nParam: token - Authentication token (optional, defaults to empty string)\nReturns: Query results array or empty array on error"},GetAllConnectionsOfComposition:{parameters:["composition_id"],documentation:"Retrieves all connections belonging to a specific composition.\nChecks local cache first, then fetches from backend if needed.\n\n**Complex Logic**: First checks ConnectionData cache, then fetches from API,\ncompares with cached data to detect deletions, and updates cache.\n\nParam: composition_id - ID of the composition whose connections to retrieve\nReturns: Array of Connection objects for the composition"},GetAllConnectionsOfCompositionBulk:{parameters:["composition_ids"],documentation:"Retrieves connections for multiple compositions in bulk.\nOptimizes fetching by batching multiple composition IDs in one request.\n\n**Complex Logic**: Checks in-memory cache, fetches from API, detects deletions\nby comparing old and new data, and bulk-fetches related concepts.\n\nParam: composition_ids - Array of composition IDs to fetch connections for\nReturns: Array of Connection objects for all compositions"},GetAllLinkerConnectionsFromTheConcept:{parameters:["conceptId"],documentation:"Retrieves all linker connections originating from a specific concept.\nFetches connections where the concept is the source/origin.\n\nParam: conceptId - ID of the concept to get linker connections from\nReturns: Array of Connection objects originating from the concept"},GetAllTheConnectionsByTypeAndOfTheConcept:{parameters:["id","linker","reverse"],documentation:"This function returns all the connections from the ofTheConceptId and connection type\nParam: id ofTheConceptId\nParam: linker the connection type\nReturns: Array of connections"},GetComposition:{parameters:["id"],documentation:'Retrieves a complete composition structure for a given concept ID in JUSTDATA format.\n\nThis is a primary composition retrieval function that builds a hierarchical structure\ncontaining the main concept, all its connections, and recursively fetched related concepts.\nThe result is formatted as a nested object organized by concept types.\n\n**What is a Composition?**\nA composition represents a concept along with its connected relationships and sub-structures.\nThink of it as getting a "full profile" of a concept including everything connected to it.\n\n**Process:**\n1. Fetches all connections associated with the concept\n2. Identifies all related concept IDs from those connections\n3. Recursively builds the composition tree\n4. Fetches the main concept details\n5. Organizes output by concept type (e.g., result["Person"] = {...})\n6. Routes through service worker if enabled for better performance\n\n**Output Format (JUSTDATA):**\nReturns an object keyed by the main concept\'s type character value:\n```\n{\n"Person": {\nid: 123,\ncharacterValue: "Alice",\nconnections: [...],\nrelatedConcepts: {...}\n}\n}\n```\n\nParam: id - The unique identifier of the concept for which to build the composition.\nThis becomes the root of the composition tree.\n\nReturns: Promise resolving to an object containing the composition data organized by\nthe main concept\'s type. Returns empty object if concept not found or on error.'},GetCompositionBulk:{parameters:["conceptIds"],documentation:"## Format JUSTDATA ##\nFunction converts the conceptIds to json (compositions)\nThis function takes in the conceptIds and returns a list of compositions related to those concepts.\nParam: conceptIds list of concept ids that are compositions.\nReturns: compositions"},GetCompositionBulkWithDataId:{parameters:["conceptIds"],documentation:"## FORMAT DATAIDDATE ##\nFunction converts the conceptIds to json (compositions)\nParam: conceptIds this is the list of concept ids that should be converted to compostions in data - id format.\nReturns: list of compositions in the data - id format."},GetCompositionFromConnectionsWithDataId:{parameters:["conceptIds","connectionIds"],documentation:"## FORMAT DATAIDDATE ##\nThis function converts the conceptIds and internal connectionIds to compositions in data-Id format.\nParam: conceptIds This is the list of concept ids that need to be converted to compositions.\nParam: connectionIds These are the internal connectionIds that need to be passed to create the compositions.\nReturns: list of compositions created from the passed conceptIds and connectionIds."},GetCompositionFromConnectionsWithDataIdFromConnections:{parameters:["conceptIds","connectionIds"],documentation:"## FORMAT DATAIDDATE ##\nThis is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\nit also prints out internal connections.\nThis function converts the conceptIds and internal connectionIds to compositions in data-Id format.\nParam: conceptIds This is the list of concept ids that need to be converted to compositions.\nParam: connectionIds These are the internal connectionIds that need to be passed to create the compositions.\nReturns: list of compositions created from the passed conceptIds and connectionIds."},GetCompositionFromConnectionsWithDataIdInObject:{parameters:["conceptIds","connections"],documentation:"## Format DATAIDDATE ##\nThis function converts the conceptIds and internal connections to create compositions.\nFormat is of a dictionary with ids as the key and value is the composition data.\nParam: conceptIds these are the concept ids that need to be fetched to create their compositions\nParam: connections these are the connections that are used to create the structure.\nReturns: a dictionary / object that has key as their conceptId and the value as their composition object."},GetCompositionFromConnectionsWithDataIdIndex:{parameters:["conceptIds","connectionIds"],documentation:"## Format DATAIDDATE ##\nThis function converts the conceptIds and internal connectionIds to compositions in data-Id format with index(conceptId).\nParam: conceptIds This is the list of concept ids that need to be converted to compositions.\nParam: connectionIds These are the internal connectionIds that need to be passed to create the compositions.\nReturns: dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index ."},GetCompositionFromConnectionsWithIndex:{parameters:["conceptIds","connectionIds"],documentation:"## Format is dictionary with key as concept id and value as data (json) ##\nThis function converts the conceptIds and internal connectionIds to compositions format with index(conceptId).\nParam: conceptIds This is the list of concept ids that need to be converted to compositions.\nParam: connectionIds These are the internal connectionIds that need to be passed to create the compositions.\nReturns: dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index ."},GetCompositionFromConnectionsWithIndexFromConnections:{parameters:["conceptIds","connectionIds"],documentation:"## FORMAT DATAIDDATE ##\nThis is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\nit also prints out internal connections.\nThis function converts the conceptIds and internal connectionIds to compositions in data-Id format.\nParam: conceptIds This is the list of concept ids that need to be converted to compositions.\nParam: connectionIds These are the internal connectionIds that need to be passed to create the compositions.\nReturns: list of compositions created from the passed conceptIds and connectionIds."},GetCompositionFromMemoryWithConnections:{parameters:["id","connectionList"],documentation:"### Format Normal ####\nGets data just from memory\nParam: id\n@returns"},GetCompositionList:{parameters:["compositionName","userId","inpage","page"]},GetCompositionListAll:{parameters:["compositionName","userId","inpage","page"]},GetCompositionListAllWithId:{parameters:["compositionName","userId","inpage","page"]},GetCompositionListListener:{parameters:["compositionName","userId","inpage","page","format"],documentation:"Creates an observable that tracks a paginated list of compositions and updates subscribers when they change.\nParam: compositionName - The composition type name\nParam: userId - The user ID who owns the compositions\nParam: inpage - Number of items per page\nParam: page - Page number (1-indexed)\nParam: format - Output format (JUSTDATA, DATAID, NORMAL)\nReturns: Observable instance for the composition list"},GetCompositionListLocal:{parameters:["compositionName","userId"],documentation:'Retrieves all compositions of a specific type from local storage.\n\n**Process Flow**:\n1. Finds the type concept by compositionName (e.g., "the_project")\n2. Queries all concepts with that typeId belonging to the user\n3. Fetches full composition for each concept\n4. Returns array of complete compositions\n\nParam: compositionName - The type name of compositions to retrieve (e.g., "the_project", "the_person")\nParam: userId - User ID to filter compositions by ownership\nReturns: Array of composition objects (empty array if type not found)\n@throws Error if lookup or composition fetching fails'},GetCompositionListLocalWithId:{parameters:["compositionName","userId"],documentation:"Retrieves all compositions of a specific type with DATAID format (includes concept ID).\n\nSame as GetCompositionListLocal but returns compositions in data-id wrapper format,\nwhich includes both the composition data and its concept ID for easier reference.\n\nParam: compositionName - The type name of compositions to retrieve\nParam: userId - User ID to filter compositions by ownership\nReturns: Array of composition objects in {id, data} format\n@throws Error if lookup or composition fetching fails"},GetCompositionListWithId:{parameters:["compositionName","userId","inpage","page"]},GetCompositionListWithIdUpdated:{parameters:["compositionName","userId","inpage","page"]},GetCompositionListener:{parameters:["id","format"],documentation:"Creates an observable that tracks a composition and updates subscribers when it changes.\nParam: id - The composition concept ID to observe\nParam: format - Output format (JUSTDATA, DATAID, NORMAL)\nReturns: Observable instance for the composition"},GetCompositionLocal:{parameters:["id"],documentation:'Retrieves a complete composition structure from local storage (IndexedDB).\n\nThis function fetches a composition using local-only data, building a hierarchical\nstructure from local connections and concepts. If the concept has been synced to the\nbackend, it can automatically fall back to fetching from the server.\n\n**Process:**\n1. Fetches all local connections for the composition\n2. Identifies all connected concept IDs\n3. Retrieves the main concept from LocalConceptsData\n4. If concept not found locally, checks if it\'s been synced (TranslateLocalToReal)\n5. Falls back to server GetComposition if concept is synced\n6. Recursively builds composition tree from local data\n7. Organizes output by concept type\n\n**Local vs Server:**\n- Prioritizes local data (IndexedDB)\n- Automatic fallback to server if concept synced\n- Uses LocalConnectionData for connections\n- Uses LocalConceptsData for concepts\n\n**Output Format (JUSTDATA):**\nReturns an object keyed by the main concept\'s type:\n```\n{\n"Person": {\nname: "Alice",\nemail: {...},\nprojects: {...}\n}\n}\n```\n\nParam: id - The concept ID (can be negative for local or positive for synced)\n\nReturns: Promise resolving to composition data organized by concept type'},GetCompositionLocalWithId:{parameters:["id"],documentation:'Retrieves a local composition with ID and data wrapper (DATAID format).\n\nThis is a variant of GetCompositionLocal that returns the composition data\nwrapped in an object that includes both the data and the concept ID. This format\nis useful for tracking which concept the data belongs to.\n\n**Output Format (DATAID):**\n```\n{\ndata: {\n"Person": {\nname: "Alice",\nemail: {...}\n}\n},\nid: 12345\n}\n```\n\n**Differences from GetCompositionLocal:**\n- Returns { data, id } wrapper object\n- Same local data retrieval process\n- Same recursive building logic\n- No automatic server fallback\n\nParam: id - The concept ID (negative for local, positive for synced)\n\nReturns: Promise resolving to object with { data, id } structure'},GetCompositionWithAllIds:{parameters:["id"]},GetCompositionWithCache:{parameters:["id","connectionListPassed"]},GetCompositionWithDataIdBulk:{parameters:["ids","connections"]},GetCompositionWithDataIdWithCache:{parameters:["id","connectionListPassed"]},GetCompositionWithId:{parameters:["id"],documentation:"#### Format DATAID ####\n## This will return the composition even if it is not in the local memory ##\nParam: id\n@returns"},GetCompositionWithIdAndDateFromMemory:{parameters:["id"],documentation:"### Format DATAIDDATE #####\n### This just returns composition from memory and not from anywhere else.\nParam: id\n@returns"},GetConceptBulk:{parameters:["passedConcepts"],documentation:"This function takes in a list of ids and returns a list of concepts . This uses local memory to find concepts\nnamely in the concept binary tree. If it could not find the concepts in local memory then it fetches those from\nthe api. The fetched concepts from api are then stored in the memory for further use in future.\nParam: conceptIds list of concept ids that need to be fetched\nReturns: list of concepts"},GetConceptByCharacter:{parameters:["characterValue"]},GetConceptByCharacterAndCategoryLocal:{parameters:["character"],documentation:'Retrieves a local concept by character value, handling hierarchical type names.\n\n**Complex Logic**: For compound names (e.g., "the_person_email"):\n1. Splits string by underscore\n2. Recursively processes first part to get category ID\n3. Searches using character value and derived category\n4. Falls back to simple character search for single words\n\n**Special Case**: Returns concept with id=1 for character value "the".\n\nParam: character - The character value to find (e.g., "the_status", "the_person_email")\nReturns: Concept associated with the character value'},GetConceptByCharacterAndType:{parameters:["characterValue","typeId"],documentation:"Retrieves a concept by character value and type ID.\nChecks local cache first, then fetches from backend if not found.\n\n**Complex Logic**: Checks local ConceptsData cache, falls back to API,\nsupports service worker for offline capability.\n\nParam: characterValue - Character value string to search for\nParam: typeId - Type ID to filter by\nReturns: Concept object or null if not found"},GetConnectionBetweenTwoConceptsLinker:{parameters:["ofTheConcept","toTheConcept","linker","fullLinker","forward"],documentation:"This function will give you all the connections between two concepts by their linker or fullLinker\nParam: ofTheConcept start of the connecction\nParam: toTheConcept end of the connection\nParam: linker the primitive linkers with type connection (16) these are the old type of linkers (if you want full linker then put this as empty string)\nParam: fullLinker fullLinker is the modern linker (if you want linker then put this as empty string)\nParam: forward if you want to get the forward relation in the primitive linker put true else for backward linker false.\nReturns: list of connections"},GetConnectionBulk:{parameters:["connectionIds"],documentation:"After fetching these connections it is saved in the local static ConnectionBinaryTree so it can be reused without being fetched\nParam: connectionIds array of connection ids that need to fetched by the local system\nReturns: the list of connections that have been fetched"},GetConnectionById:{parameters:["id"]},GetConnectionDataPrefetch:{parameters:["connectionIds"],documentation:"Used to prefetch all the connections and their related concepts.\nParam: connectionIds these are the connection ids that are used to fetch all the connections and also their related concepts.\nReturns: all the connections that are passed as ids."},GetConnectionOfTheConcept:{parameters:["typeId","ofTheConceptId","userId","inpage","page"],documentation:"Retrieves connections originating from a specific concept.\nFetches connections filtered by type, concept, user, and pagination.\n\nParam: typeId - Type ID to filter connections by\nParam: ofTheConceptId - Concept ID that is the source of connections\nParam: userId - User ID to filter by\nParam: inpage - Number of results per page (default: 10)\nParam: page - Page number (default: 1)\nReturns: Array of Connection objects"},GetConnectionTypeForCount:{parameters:["countInfos"]},GetConnectionsBetweenApi:{parameters:["fetchConnections"],documentation:"Fetches connections matching the given criteria from POST /api/get-connection-between.\n\nAccepts an array so multiple independent queries can be resolved in one HTTP request.\nEach item in the array is resolved independently by the backend; results are returned\nin the same order with `connectionIds` and the resolved `typeId` populated.\n\n**Supported query permutations (per item):**\n1. `ofTheConceptId` + `toTheConceptId` + `type` — connections between two specific concepts of that type\n2. `ofTheConceptId` + `type` — all connections FROM a concept of that type\n3. `toTheConceptId` + `type` — all connections TO a concept of that type\n4. `typeId` + `isComposition: true` — all internal connections of a composition\n\nFields not relevant to the chosen permutation should be left at their zero/empty defaults.\nUse {@link buildFetchConnection} to build items without specifying every field manually.\n\nParam: fetchConnections - Array of query objects; each item is resolved independently.\nReturns: The same array with `connectionIds` and resolved `typeId` populated by the backend.\nReturns an empty array on error (error is logged internally)."},GetFreeschemaImage:{parameters:["url","format"],documentation:"Param: url this is the url of the image that you have. This image will be cached in the cache server\nParam: format this is the format it can be either normal , small, by default it is normal\n@returns"},GetFreeschemaImageUrl:{parameters:["url","format"],documentation:"Param: url this is the url of the image that you have. This image will be cached in the cache server\nParam: format this is the format it can be either normal , small, by default it is normal\n@returns"},GetImageApi:{parameters:["imageName"],documentation:"Retrieves an image by name from the cached images endpoint.\nReturns a readable stream for the image data.\n\nParam: imageName - Name/identifier of the image to retrieve\nReturns: Promise resolving to ReadableStream of image data, or null/undefined on error\n@throws Image stream on error (legacy behavior)"},GetInstanceConceptByCharacterType:{parameters:["characterValue","type"],documentation:'Fetches an instance concept from the backend API by its character value and type.\n\nParam: characterValue - The character value of the concept, such as a URL or identifier.\nParam: type - The type string that qualifies the character value, such as "the_source_url".\nReturns: The matching Concept object, or a default empty Concept if not found.'},GetLink:{parameters:["id","linker","inpage","page"]},GetLinkListListener:{parameters:["searchStructure","searchQuery","token","format"],documentation:"Creates an observable that tracks search results with complex query conditions and updates subscribers when results change.\nParam: searchStructure - Defines composition and linker types for the search\nParam: searchQuery - Array of query conditions to filter results\nParam: token - Authentication token\nParam: format - Output format (DATAID, NORMAL)\nReturns: Observable instance for the search results"},GetLinkListener:{parameters:["id","linker","inpage","page","format"],documentation:"Creates an observable that tracks linked concepts and updates subscribers when links change.\nParam: id - The source concept ID whose links to retrieve\nParam: linker - The linker type name defining the relationship\nParam: inpage - Number of items per page\nParam: page - Page number (1-indexed)\nParam: format - Output format (NORMAL, DATAID, JUSTDATA, DATAIDDATE)\nReturns: Observable instance for the linked concepts"},GetLinkRaw:{parameters:["id","linker","inpage","page"]},GetLinkerConnectionFromConcepts:{parameters:["id"]},GetLinkerConnectionToConcepts:{parameters:["id"]},GetRelation:{parameters:["id","relation","inpage","page","reverse"]},GetRelationLocal:{parameters:["id","relation","userId"],documentation:'Retrieves all related compositions from local storage by relation name.\n\n**Process Flow (Complex Logic)**:\n1. Converts relation string to type concept (e.g., "the_email" → type concept)\n2. Finds all connections from source concept with that relation type\n3. For each connection, retrieves the target composition\n4. Returns array of all related compositions\n\nParam: id - The source concept ID to get relations from\nParam: relation - The relation name (e.g., "the_email", "the_address")\nParam: userId - User ID for permissions\nReturns: Array of composition objects representing related entities\n@throws Error if relation lookup or composition retrieval fails'},GetRelationNew:{parameters:["id","relation","inpage","page","reverse"]},GetRelationRaw:{parameters:["id","relation","inpage","page","reverse"]},GetTheConcept:{parameters:["id","userId"],documentation:"Retrieves a concept by its ID with intelligent caching and multi-source lookup.\n\nThis is the primary function for fetching concepts in the system. It implements a sophisticated\nmulti-level retrieval strategy:\n\n**Retrieval Strategy:**\n1. Checks in-memory promise cache to prevent duplicate requests\n2. For negative IDs: Fetches from local IndexedDB (LocalConceptsData)\n3. For positive IDs: Checks local ConceptsData cache first\n4. If not in cache: Fetches from backend API\n5. Automatically resolves and attaches the concept's type information\n6. Routes through service worker if enabled for better performance\n\n**Features:**\n- Promise caching prevents duplicate concurrent requests for the same concept\n- Automatic type resolution (fetches and attaches type concept)\n- Access tracking integration (increments access counter if enabled)\n- Service worker support for background processing\n- Error logging and performance monitoring\n- Supports both server concepts (positive IDs) and local concepts (negative IDs)\n\nParam: id - The unique identifier of the concept to retrieve.\nPositive IDs = server concepts, Negative IDs = local-only concepts\nParam: userId - The ID of the user requesting the concept. Used for access tracking\nand audit logging. Defaults to 999 (system/anonymous user)\n\nReturns: Promise resolving to the Concept object if found, or a default empty Concept if not found"},GetTheConceptLocal:{parameters:["id"],documentation:"Retrieves a concept by ID with support for both local (virtual) and server concepts.\n\nThis is the primary function for fetching concepts in offline/local mode. It intelligently\nhandles three types of concept IDs and retrieves from appropriate sources:\n\n**ID Types Handled:**\n1. **Negative IDs (Virtual/Local)**: Concepts created locally not yet synced\n- Stored in LocalConceptsData (IndexedDB)\n- Return negative IDs\n\n2. **Synced Virtual IDs**: Originally local concepts now synced to backend\n- Looked up via LocalGhostIdTree (maps negative to positive IDs)\n- Returns positive (real) ID with ghostId reference\n\n3. **Positive IDs (Server)**: Real backend concepts\n- Fetched via GetTheConcept from backend\n- Converted to LConcept format\n- May have undefined ghostId\n\n**Retrieval Strategy:**\n- If id < 0: Check LocalConceptsData → Check LocalGhostIdTree\n- If id >= 0: Fetch from backend → Convert to LConcept\n- Routes through service worker if enabled\n- Returns default empty concept if not found\n\n**Ghost ID System:**\n- ghostId: Original negative ID (preserved after sync)\n- id: Current ID (negative if local, positive if synced)\n- LocalGhostIdTree maintains the mapping\n\nParam: id - The concept ID to retrieve. Can be:\n- Negative (e.g., -12345) for local-only concepts\n- Positive (e.g., 789) for server concepts\n\nReturns: Promise resolving to a Concept object in LConcept format.\nReturns default concept (id=0) if not found."},GetUserGhostId:{parameters:["userId","ghostId","sessionId"]},LConcept:{parameters:["id","userId","typeId","categoryId","accessId","characterValue","typeCharacter","isNew","entryTimeStamp","updatedTimeStamp","referentId"]},LConnection:{parameters:["id","ofTheConceptId","toTheConceptId","typeId","orderId","accessId"]},LocalConceptsData:{parameters:[]},LocalSyncData:{parameters:[]},LocalTransaction:{parameters:[]},LogEvent:{parameters:["EventName","EventDescription","event"]},Logger:{parameters:[]},LoginToBackend:{parameters:["email","password","application"],documentation:"Authenticates a user with the backend API and obtains an access token.\n\nThis is the primary authentication function that validates user credentials against the backend\nserver and retrieves a JWT bearer token for subsequent API requests.\n\n**Authentication Flow:**\n1. Sends email and password to backend login endpoint\n2. Receives JWT token in response\n3. Automatically stores token in TokenStorage.BearerAccessToken\n4. Token is used for all subsequent authenticated API calls\n5. Logs the authentication attempt for audit purposes\n\n**Features:**\n- Automatic token storage (no manual handling required)\n- Error handling and logging\n- Application-specific authentication\n- Performance and audit logging\n\n**Security Notes:**\n- Credentials are sent over HTTPS (ensure BaseUrl uses HTTPS)\n- Token is stored in memory (TokenStorage)\n- Token should be refreshed before expiration\n- Never log or expose the token in client-side code\n\nParam: email - The user's email address. Must be a valid registered email.\nUsed as the primary login identifier.\nParam: password - The user's password. Sent to backend for verification.\nShould meet password complexity requirements.\nParam: application - The application identifier for multi-tenant authentication.\nDefaults to \"boomconsole.com\". Used to scope authentication\nto specific applications in the system.\n\nReturns: Promise resolving to the authentication result object containing:\n- data.token: The JWT bearer token\n- user information\n- session details\nReturns undefined on error"},MakeTheInstanceConcept:{parameters:["type","referent","composition","userId","passedAccessId","passedSessionId","referentId"],documentation:"This is the basic function of the concept connection system. This function let's you create a concept within the constraints of the\nconcept connection system. This function is the building block of the concept connection system.\nParam: type this is the type of the concept. You can also think of this as the key of concept. first_name, last_name etc.\nParam: referent the actual value of the concept. The actual name of value of the concept.\nParam: composition this is a boolean that defines if the concept is a composition or not. If this is a composition then other things are also\nconnected internally with this concept. If composition is true then always a new concept is created otherwise it checks if the concept already exists\nand creates only in the case that the concept does not already exists with its type and value as its unique identifier.\nParam: userId the userId of the creator.\nParam: passedAccessId this is the accessId of the creator. By default should be 4.\nParam: passedSessionId this is the session that is created by the system.\nParam: referentId In case we need this concept to refer to any other concept.\nReturns: a concept which is either newly created or an older concept that already exists."},MakeTheInstanceConceptLocal:{parameters:["type","referent","composition","userId","accessId","sessionInformationId","referentId","actions"],documentation:'Creates or retrieves an instance concept locally - the core building block of the concept-connection system.\n\nThis is THE fundamental function for creating concepts in local storage. It implements an intelligent\nget-or-create pattern that checks for existing concepts before creating new ones, preventing duplicates\nwhile supporting both unique instances and composition concepts.\n\n**Core Behaviors:**\n1. **Composition Mode (composition=true)**: Always creates a new concept\n- Used for containers/objects that need unique instances\n- Marks concept with isComposition flag\n- Example: Each "Project" is unique, even with same name\n\n2. **Instance Mode (composition=false)**: Get-or-create pattern\n- Checks if concept with same type and value exists\n- Returns existing if found (deduplication)\n- Creates new only if not found\n- Example: "Published" status concept reused across items\n\n3. **Long Text Handling**: Values >255 characters always create new\n- Prevents expensive lookups on large text\n- Each long text gets unique concept\n\n**Type String Processing:**\n- **Best Practice**: Always pass type with "the_" prefix (e.g., "the_name", "the_email")\n- Auto-correction: If missing, "the_" is automatically added internally\n- "name" → "the_name" (auto-corrected)\n- "email" → "the_email" (auto-corrected)\n- "the_status" → "the_status" (already correct)\n- Creates type concept if it doesn\'t exist\n- **Recommendation**: Use explicit "the_" prefix for code clarity and consistency\n\n**Sync and Storage:**\n- Adds concept to LocalSyncData queue for backend sync\n- Stores in LocalConceptsData (IndexedDB)\n- Tracks in actions parameter for batch operations\n- Assigns negative ID (virtual/local)\n\n**Process Flow:**\n1. Normalizes type string (adds "the_" prefix)\n2. Creates/retrieves type concept via MakeTheTypeConceptLocal\n3. If composition=true: Creates new concept immediately\n4. If referent length >255: Creates new concept\n5. If regular instance: Checks for existing by type+value\n6. Returns existing or creates new\n7. Attaches type information\n8. Adds to sync queue\n\nParam: type - The type/key of the concept. **Should follow the format "the_xyz"**.\nRepresents what kind of data this is.\nExamples: "the_name", "the_email", "the_status", "the_first_name"\n\n**Note**: If you pass without "the_" prefix (e.g., "name"), the code will\nautomatically add it internally (becomes "the_name"). However, best practice\nis to always include the "the_" prefix for clarity and consistency.\n\nParam: referent - The actual value/content of the concept.\nThe human-readable data (e.g., "Alice", "alice@example.com", "Active").\nCan be empty string for composition concepts.\n\nParam: composition - Boolean flag determining creation behavior.\n- true: Always creates new concept (unique instances)\n- false: Get-or-create pattern (reuses existing)\nDefaults to false.\n\nParam: userId - The ID of the user creating this concept. Used for ownership and permissions.\n\nParam: accessId - Access control level. Typically 4 (default internal access).\nControls who can view/modify this concept.\n\nParam: sessionInformationId - Session identifier for tracking. Defaults to 999 (system).\nUsed for audit logging and session management.\n\nParam: referentId - Optional reference to another concept ID.\nUsed when this concept is an instance of or refers to another concept.\nDefaults to 0 (no reference).\n\nParam: actions - Action tracking object that accumulates all created concepts and connections.\nUsed for batch operations, rollback, and sync management.\nStructure: { concepts: Concept[], connections: Connection[] }\n\nReturns: Promise resolving to the created or retrieved Concept object with:\n- Negative ID if newly created locally\n- Attached type information (concept.type)\n- All standard concept properties'},MakeTheTimestamp:{parameters:["type","referent","userId","accessId","sessionInformationId"]},MakeTheTypeConceptApi:{parameters:["type","userId"],documentation:'This function is used to check the type concpet of a passed string\nif the text is "the_person" then the function finds the related concept\nParam: type This is the type of the concept that needs to be created.\nParam: userId This is the userId of the creator.\nReturns: the concept created.'},MakeTheTypeConceptLocal:{parameters:["typeString","sessionId","sessionUserId","userId","actions"],documentation:'Creates or retrieves a type concept locally - handles hierarchical type system.\n\nType concepts are placeholders/templates (e.g., "the_first_name", "the_email") that define\nwhat kind of data a concept represents. They have no actual value themselves.\n\n**Hierarchical Processing (Complex Logic)**:\n- Single word (e.g., "status"): Creates simple type concept with typeId=51\n- Compound words (e.g., "the_person_email"): Splits into parts and creates hierarchy:\n1. Creates category concept from first part ("the_person")\n2. Creates type concept from second part ("email")\n3. Creates final concept with category and type linked\n**Uses recursion** to build multi-level type hierarchies\n\nAlways checks for existing type concept before creating to prevent duplicates.\n\nParam: typeString - The type name to create (e.g., "the_status", "the_person_email")\nParam: sessionId - Session identifier (typically 999)\nParam: sessionUserId - Session user ID (typically 999, not used)\nParam: userId - User creating the type concept\nParam: actions - Action tracking for batch operations\nReturns: Type Concept (existing or newly created)'},PatcherStructure:{parameters:[]},Prototype:{parameters:[]},RecursiveSearchApi:{parameters:["composition","listLinkers","textSearch","fullLinkers"],documentation:'Performs recursive search through composition hierarchy.\nSearches through nested compositions using linker relationships.\n\n**Complex Logic**: Constructs SearchQuery, fetches composition IDs and connections,\nprocesses internal/external connections, and builds composition objects from results.\n\nParam: composition - Root composition ID to start search from (default: 0)\nParam: listLinkers - Array of linker strings to traverse (default: [])\nParam: textSearch - Text search filter (default: "")\nParam: fullLinkers - Array of full linker paths (default: [])\nReturns: Array of composition objects with connections'},RecursiveSearchApiNewRawFullLinker:{parameters:["composition","fullLinkers","textSearch"],documentation:'New version of recursive search with full linker paths.\nAlternative implementation of RecursiveSearchApiRawFullLinker.\n\nParam: composition - Root composition ID (default: 0)\nParam: fullLinkers - Array of complete linker path strings (default: [])\nParam: textSearch - Text search filter (default: "")\nReturns: Raw API response object with compositionIds and connections'},RecursiveSearchApiRaw:{parameters:["composition","listLinkers","textSearch","fullLinkers"],documentation:'Performs recursive search returning raw API response.\nReturns unprocessed result with composition IDs and connection arrays.\n\nParam: composition - Root composition ID (default: 0)\nParam: listLinkers - Array of linker strings (default: [])\nParam: textSearch - Text search filter (default: "")\nParam: fullLinkers - Array of full linker paths (default: [])\nReturns: Raw API response object with compositionIds, internalConnections, externalConnections'},RecursiveSearchApiRawFullLinker:{parameters:["composition","fullLinkers","textSearch"],documentation:'Performs recursive search using full linker paths, returning raw response.\nUses complete linker path specifications instead of partial linkers.\n\nParam: composition - Root composition ID (default: 0)\nParam: fullLinkers - Array of complete linker path strings (default: [])\nParam: textSearch - Text search filter (default: "")\nReturns: Raw API response object with compositionIds and connections'},RecursiveSearchApiWithInternalConnections:{parameters:["composition","listLinkers","textSearch"],documentation:'Performs recursive search returning results with internal connections.\nSimilar to RecursiveSearchApi but uses different connection formatting.\n\nParam: composition - Root composition ID to start search from (default: 0)\nParam: listLinkers - Array of linker strings to traverse (default: [])\nParam: textSearch - Text search filter (default: "")\nReturns: Array of composition objects with internal connections'},RecursiveSearchListener:{parameters:["id","linkers","searchText","format"],documentation:"Creates an observable that performs recursive multi-level searches and updates subscribers when results change.\nParam: id - The starting concept ID for the recursive search\nParam: linkers - Array of linker type names defining the traversal path\nParam: searchText - Optional text to search for in linked concepts\nParam: format - Output format (RAW for raw IDs, undefined for formatted compositions)\nReturns: Observable instance for the recursive search"},SchemaQuery:{parameters:["query","token"],documentation:"Executes a free-schema query once without creating a subscription.\nParam: query - FreeschemaQuery object with search parameters\nParam: token - Authentication token\nReturns: Promise resolving to formatted query results"},SchemaQueryListener:{parameters:["query","token"],documentation:"Creates an observable that executes a free-schema query and updates subscribers when results change.\nParam: query - FreeschemaQuery object with search, filter, sort, and pagination parameters\nParam: token - Authentication token\nReturns: Observable instance for the query results"},SearchAllConcepts:{parameters:["type","search","composition","token","inpage","page"],documentation:'Searches for concepts matching specified criteria with pagination support.\n\nThis is the primary search function for querying concepts in the system. It performs a\nbackend API search with multiple filter parameters and returns paginated results.\n\n**Search Capabilities:**\n- Text-based search on concept character values\n- Type filtering (search within specific concept types)\n- Composition filtering (search within specific compositions)\n- Pagination support (page size and page number)\n- Authenticated requests (requires valid access token)\n\n**Use Cases:**\n- Finding concepts by name or partial text match\n- Filtering results by concept type (e.g., only "Person" concepts)\n- Searching within a specific composition context\n- Building paginated search UIs\n\nParam: type - The type filter for the search. Can be a type name (e.g., "Person", "Document")\nor empty string to search all types. Used to narrow results to specific concept types.\nParam: search - The search query string. Searches against concept character values (names/titles).\nCan be partial matches depending on backend implementation.\nParam: composition - Composition context filter. Can be a composition ID or identifier to limit\nsearch scope to concepts within a specific composition. Use empty string for global search.\nParam: token - The JWT authentication token. Required for authorized access to backend search API.\nShould be the BearerAccessToken from TokenStorage.\nParam: inpage - Number of results per page. Controls page size for pagination. Defaults to 10.\nMust be a positive integer.\nParam: page - The page number to retrieve (1-indexed). Defaults to 1 (first page).\nUse for pagination: page 1, page 2, etc.\n\nReturns: Promise resolving to an array of matching Concept objects, or empty array on error/no results'},SearchLinkInternal:{parameters:["searchQuery","token"]},SearchLinkInternalAll:{parameters:["searchQuery","token"]},SearchLinkMultipleAll:{parameters:["searchQuery","token","caller","format"]},SearchLinkMultipleAllObservable:{parameters:["searchQuery","token","format"],documentation:"Creates a new multi-search observable.\nParam: searchQuery - Array of SearchQuery objects defining search conditions\nParam: token - Authentication token\nParam: format - Output format (DATAID by default)"},SearchLinkMultipleApi:{parameters:["searchQuery","token"],documentation:"Searches for concepts using multiple linked queries with performance tracking.\nExecutes complex multi-criteria searches across concept relationships.\n\nParam: searchQuery - Array of SearchQuery objects defining linked search criteria\nParam: token - Authentication token (optional, defaults to empty string)\nReturns: Array of search results or empty array on error"},SearchQuery:{parameters:[]},SearchStructure:{parameters:[]},SearchWithLinker:{parameters:["searchQuery","token"],documentation:"Searches concepts using multiple linker queries with authentication.\nAllows complex searches by combining multiple search query conditions.\n\nParam: searchQuery - Array of search query objects defining search criteria\nParam: token - Authentication token (optional, defaults to empty string)\nReturns: Array of matching search results or empty array on error"},SearchWithTypeAndLinker:{parameters:["searchStructure","searchQuery","token"],documentation:"This function will help you search a concept by their type and also to query inside of it.\nPut the number of compositions you want to get in the searchStructure which can be set by inpage and page\nThen the type should be set in searchQuery for the compositionName.\nInside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\nThis will not give the id of the structures."},SearchWithTypeAndLinkerApi:{parameters:["searchStructure","searchQuery","token"],documentation:"Searches concepts by type with additional linker query filters.\nCombines type-based search with linker queries for refined results.\n\n**Complex Logic**: Constructs URL with search structure parameters, then applies\nlinker queries as POST body for multi-dimensional filtering.\n\nParam: searchStructure - Structure containing search text, type, pagination, and auth flag\nParam: searchQuery - Array of linker query objects for additional filtering\nParam: token - Authentication token (optional, defaults to empty string)\nReturns: Array of concepts matching both type and linker criteria, or empty array on error"},Selector:{parameters:["mainType","selector","parentElement","filterType","inpage"]},SessionData:{parameters:[]},Signin:{parameters:["signinInfo"],documentation:"Alternative sign-in function using SigninModel structure.\n\nSimilar to LoginToBackend but returns FreeschemaResponse format and\ndoes NOT automatically store the token. You must manually handle the token.\n\nParam: signinInfo - SigninModel object containing email and password\nReturns: FreeschemaResponse with {status, statusCode, message, data} structure\ndata contains user information and token (not auto-stored)"},Signup:{parameters:["signupModel"],documentation:"Registers a new user account on the backend server.\n\nCreates a new user with provided signup information including email, password,\nusername, and profile details.\n\nParam: signupModel - SignupModel object containing:\n- email: User's email address\n- password: User's password\n- username: Unique username\n- fname: First name\n- lname: Last name\n- title: Title/gender\n- type: User type\nReturns: FreeschemaResponse with signup result (status, message, data)"},SignupEntity:{parameters:["signupData"],documentation:"Registers a new entity (organization/company account) on the backend.\n\nCreates entity-type accounts (different from regular user accounts).\nIncludes timestamp for registration tracking.\n\nParam: signupData - Signup data object containing:\n- type: Entity type\n- username: Unique username\n- title: Title/designation\n- email: Entity email\n- password: Account password\n- timestamp: Registration timestamp (ISO string)\n- fname: First name / Entity name\n- lname: Last name / Additional info\nReturns: Response JSON with entity creation result\n@throws Error if signup fails (404, 500, or other HTTP errors)"},SplitStrings:{parameters:["typeString"]},StatefulWidget:{parameters:[],documentation:"Stateful widget with lifecycle management and hierarchical composition.\n\nProvides a React-like component system with state management, lifecycle hooks,\nand parent-child widget relationships. Extend this class to create custom widgets\ncompatible with the concept connection system."},SyncData:{parameters:[]},TokenStorage:{parameters:[]},TrashTheConcept:{parameters:["id","token"],documentation:"Deletes (trashes) a concept from the backend with explicit token auth.\n\nAlternative delete function that requires manual token passing.\nSimilar to DeleteTheConcept but with explicit authentication parameter.\n\nParam: id - The concept ID to delete\nParam: token - Bearer authentication token\n@throws Error if deletion fails"},UpdateComposition:{parameters:["patcherStructure"]},UpdateCompositionLocal:{parameters:["patcherStructure","actions"],documentation:"Updates/patches a composition in local storage with new or modified properties.\n\n**Complex Patching Logic** (197 lines):\n1. Fetches latest composition data from backend (all connections and concepts)\n2. Iterates through patchObject properties to add/update\n3. For each property:\n- If value is object/array: Creates composition concept and nested composition\n- If value is primitive: Creates instance concept with value\n- Checks if concept type already exists in composition\n- If exists: Marks old connections for deletion (replaces old value)\n- If new: Simply adds new connection\n4. Creates connections between parent composition and new/updated concepts\n5. Deletes old connections (cleanup)\n6. Syncs changes to backend\n\n**Use Case**: Updating fields in an existing composition without recreating it entirely.\n\nParam: patcherStructure - Object containing:\n- compositionId: The composition to update\n- ofTheCompositionId: Optional parent composition for nested updates\n- patchObject: Object with key-value pairs to add/update\n- userId, sessionId, accessId: User context\nParam: actions - Action tracking for batch operations and rollback"},UserBinaryTree:{parameters:[]},Validator:{parameters:[]},ViewInternalData:{parameters:["ids"]},ViewInternalDataApi:{parameters:["ids"],documentation:"Retrieves internal data (connections and concepts) for multiple compositions.\nReturns a dictionary mapping composition IDs to their internal connection arrays.\n\n**Complex Logic**: For each composition ID, fetches connections and related concepts,\nbuilds a dictionary structure, and bulk-loads concepts for efficiency.\n\nParam: ids - Array of composition IDs to fetch internal data for\nReturns: Dictionary mapping composition ID to Connection arrays, or empty array on error"},WidgetTree:{parameters:[],documentation:"Hierarchical widget tree structure for nested widget composition.\n\nRepresents a widget and its complete metadata including HTML, styles, scripts,\nlifecycle hooks, and child widgets. Used for building complex widget hierarchies."},buildFetchConnection:{parameters:["query"],documentation:"Builds a complete FetchConnection request object from a partial query,\nfilling unspecified fields with their zero/empty defaults.\n\nUse this instead of constructing FetchConnection manually so you only\nneed to specify the fields relevant to your query permutation.\n\nParam: query - Partial query with only the fields you need.\nReturns: A fully initialised FetchConnection ready to send to the API."},clearAllCaches:{parameters:[],documentation:"Clears all application caches (both in-memory and IndexedDB).\n\nCall this on user logout or when you need to force-refresh all cached data.\nClears widget caches (standard, latest, recent) and query caches."},convertFromConceptToLConcept:{parameters:["concept"]},convertFromLConceptToConcept:{parameters:["lconcept"]},convertWidgetTreeToWidget:{parameters:["tree","parentElement","isMain","props","state","parentWidget"],documentation:"Converts a widget tree structure into live widget instances and mounts to DOM.\n\nRecursively instantiates widgets from tree data, sets up parent-child relationships,\napplies styles, and mounts to the specified parent element.\n\nParam: tree - The widget tree to convert\nParam: parentElement - DOM element to mount the widget to\nParam: isMain - Whether this is the main/root widget\nParam: props - Optional properties to pass to the widget\nParam: state - Optional state data to pass to the widget\nParam: parentWidget - Parent widget instance for context\nReturns: Promise resolving to the instantiated widget"},convertWidgetTreeToWidgetWithWrapper:{parameters:["tree","parentElement","isMain","state","isInDevelopment","parentWidget"],documentation:"Converts widget tree to widget instances with development mode wrapper support.\n\nSimilar to convertWidgetTreeToWidget but includes development mode features\nlike visual editing and type selection.\n\nParam: tree - The widget tree to convert\nParam: parentElement - DOM element to mount the widget to\nParam: isMain - Whether this is the main/root widget\nParam: state - Optional state data to pass to the widget\nParam: isInDevelopment - Enable development mode features\nParam: parentWidget - Parent widget instance for context\nReturns: Promise resolving to the instantiated widget"},createFormFieldData:{parameters:["fieldName"]},createPrototypeLocal:{parameters:["prototype","passedTransaction"]},dispatchIdEvent:{parameters:["id","data"],documentation:"Method to dispatch Event received from SW\nParam: id number|string\nParam: data any"},getFromDatabaseWithType:{parameters:["databaseName","type","id"]},getObjectsFromIndexDb:{parameters:["databaseName"]},getR2PresignedUploadUrl:{parameters:["body","token"],documentation:"Method to request an R2 pre-signed upload URL from the backend.\nParam: body Request metadata for the file to upload.\nParam: token string?\nReturns: UploadResponse<R2PresignedUploadUrlData> | null"},getUploadFileLimit:{parameters:[]},getUserDetails:{parameters:[],documentation:'Returns user details synchronously.\nPriority: in-memory profileCache (encrypted) → legacy localStorage("profile") fallback.'},getUserDetailsWithRefresh:{parameters:[],documentation:"Returns user details after hydrating storage and refreshing an expired token.\nUse this when callers need a valid token from the user details object."},getWidgetBulkFromId:{parameters:["widgetId","visitedWidgets","bulkWidget","token"],documentation:"Builds a complete widget tree from bulk widget data.\n\nRecursively processes widget hierarchy including children, custom functions,\nlibraries, and lifecycle hooks to create a full WidgetTree structure.\n\nParam: widgetId - The widget ID to build tree for\nParam: visitedWidgets - Array tracking visited widgets to prevent cycles\nParam: bulkWidget - Bulk widget data from backend\nParam: token - Optional authentication token\nReturns: Promise resolving to the complete widget tree"},getWidgetFromId:{parameters:["widgetId","visitedWidgets","token"],documentation:"Fetches and builds a complete widget tree from a widget ID.\n\nParam: widgetId - The widget ID to fetch\nParam: visitedWidgets - Array to track visited widgets (prevents cycles)\nParam: token - Optional authentication token\nReturns: Promise resolving to the widget tree"},importLatestWidget:{parameters:["widgetId","attachNode","props","showDocumentation"],documentation:"Imports the latest version of a widget into cache for later rendering.\n\nFetches widget data, builds widget tree, and stores in DataCache.\nUsed for pre-loading widgets before rendering.\n\nParam: widgetId - The widget origin ID to import\nParam: attachNode - Optional DOM element (for future use)\nParam: props - Optional properties to pass to the widget\nParam: showDocumentation - Whether to show documentation button\nReturns: Promise resolving to the widget tree"},importRecentWidget:{parameters:["widgetId","attachNode","props","showDocumentation"],documentation:"Imports the latest version of a widget into cache for later rendering.\n\nFetches widget data, builds widget tree, and stores in DataCache.\nUsed for pre-loading widgets before rendering.\n\nParam: widgetId - The widget origin ID to import\nParam: attachNode - Optional DOM element (for future use)\nParam: props - Optional properties to pass to the widget\nParam: showDocumentation - Whether to show documentation button\nReturns: Promise resolving to the widget tree"},init:{parameters:["url","aiurl","accessToken","nodeUrl","enableAi","applicationName","enableSW","flags","parameters","accessControlUrl"],documentation:'Initializes the mftsccs-browser package and sets up all required subsystems.\n\nThis is the FIRST function you must call before using any other functionality in the package.\nIt configures the backend connections, initializes local databases, sets up service workers,\nand prepares the system for concept and connection operations.\n\n**Initialization Process:**\n1. Configures Base URLs for backend, AI, and node servers\n2. Sets up access token for authenticated requests\n3. Generates unique application randomizer for IndexedDB identification\n4. Initializes feature flags (logging, access tracking, etc.)\n5. Checks for service worker support\n6. Initializes local IndexedDB databases for caching\n7. Sets up message listeners for service worker communication\n8. Optionally registers and activates service worker\n9. Falls back to main thread if service worker unavailable\n\n**Subsystems Initialized:**\n- IndexedDB databases (concepts, connections, settings)\n- Service worker (if enabled and supported)\n- Message passing between main thread and service worker\n- Broadcast channel for cross-tab communication\n- Access token storage\n- Logging and monitoring systems\n- Access tracking (if enabled)\n\nParam: url - The backend API base URL (C# data fabric server).\nThis is the primary server for concept and connection data.\nExample: "https://api.example.com" or "https://backend.yourdomain.com"\n**Required** for most operations.\n\nParam: aiurl - The AI service URL for AI-powered features and data preloading.\nIf not using AI features, pass empty string and set enableAi to false.\nExample: "https://ai.example.com"\n\nParam: accessToken - JWT bearer token for authenticated API requests.\nCan be empty string on initialization - set later with updateAccessToken().\nToken is obtained through LoginToBackend() or Signin().\nExample: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."\n\nParam: nodeUrl - The Node.js server URL for business logic and security features.\nUsed for additional server-side operations.\nExample: "https://node.example.com"\n\nParam: enableAi - Flag to enable/disable AI features and AI data preloading to IndexedDB.\nSet to false if not using AI features or if aiurl is not provided.\nDefault: true\n\nParam: applicationName - Unique identifier for your application.\nUsed to create separate IndexedDB instances for different apps.\nExample: "my-app-v1", "project-manager", "knowledge-base"\nUseful when multiple applications share the same domain.\n\nParam: enableSW - Service worker configuration object. Service worker enables background\nprocessing for better performance and offline capabilities.\n- activate: boolean - Enable/disable service worker\n- scope: string (optional) - Service worker scope path (default: "/")\n- pathToSW: string (optional) - Path to service worker file (default: "/service-worker.js")\n- manual: boolean (optional) - If true, assumes SW already registered manually\nExample: {activate: true, scope: "/", pathToSW: "/sw.js"}\n\nParam: flags - Feature flags object for enabling/disabling various features:\n- logApplication: boolean - Enable application-level logging\n- logPackage: boolean - Enable package-level logging\n- accessTracker: boolean - Enable access tracking/analytics\n- isTest: boolean - Mark as test environment\nAll default to false if not specified.\n\nParam: parameters - Additional configuration parameters:\n- logserver: string - Custom log server URL (default: "https://logdev.freeschema.com")\n- isPwa: boolean - Enable PWA offline persistence to IndexedDB (default: false)\n- enableCache: boolean - Enable/disable widget and FreeschemaQuery caching.\nWhen false, QueryCacheManager and WidgetCacheManager skip all reads and writes\n(memory and IndexedDB). Stored in Environments under key \'enableCache\' so it\ncan be read or changed at runtime via Environments.getValue/setValue.\nDefault: true.\n\nReturns: Promise<boolean> - Returns true if initialization succeeds, undefined if it fails.\nOn failure, falls back to main thread operation and logs warnings.'},orderTheConnections:{parameters:["connections","order"]},recursiveFetch:{parameters:["id","connectionList","compositionList","visitedConcepts"],documentation:"## Format justdata ##\nParam: id\nParam: connectionList\nParam: compositionList\nParam: visitedConcepts\n@returns"},recursiveFetchNew:{parameters:["id","connectionList","conceptList","compositionList","visitedConcepts"]},removeAllChildren:{parameters:["parent"]},renderImportedWidget:{parameters:["widgetId","attachNode","props","showDocumentation"],documentation:"Renders a previously imported widget from cache.\n\nRetrieves widget tree from DataCache and renders it to the DOM.\nMust call importLatestWidget() first to populate cache.\n\nParam: widgetId - The widget origin ID to render\nParam: attachNode - DOM element to attach the widget to\nParam: props - Optional properties to pass to the widget\nParam: showDocumentation - Whether to show documentation button\nReturns: Promise resolving to the rendered widget instance"},renderLatestWidget:{parameters:["widgetId","attachNode","props","showDocumentation"],documentation:'Renders the latest published version of a widget.\n\nFetches and renders the most recent version of a widget by origin ID.\nAutomatically handles "use latest" flag for child widgets.\n\nParam: widgetId - The widget origin ID to render\nParam: attachNode - DOM element to attach the widget to\nParam: props - Optional properties to pass to the widget\nParam: showDocumentation - Whether to show documentation button'},renderPage:{parameters:["pageId","attachNode","props","showDocumentation"],documentation:"Renders a complete page with its widgets and properties.\n\nFetches page data, applies page-level properties (meta tags, styles), and renders\nthe page body widget. Adds fspage class for styling.\n\nParam: pageId - The page concept ID to render\nParam: attachNode - DOM element to attach the page to\nParam: props - Optional properties to pass to the page widget\nParam: showDocumentation - Whether to show documentation button"},renderWidget:{parameters:["widgetId","attachNode","props","showDocumentation"],documentation:"Renders a specific widget by ID.\n\nFetches widget data and renders the exact version specified (not latest).\n\nParam: widgetId - The specific widget ID to render\nParam: attachNode - DOM element to attach the widget to\nParam: props - Optional properties to pass to the widget\nParam: showDocumentation - Whether to show documentation button\nReturns: Promise resolving to the rendered widget instance"},searchLinkMultipleListener:{parameters:["searchQueries","token","format"],documentation:"Creates an observable that executes multiple search queries and updates subscribers when results change.\nParam: searchQueries - Array of SearchQuery objects defining search conditions\nParam: token - Authentication token\nParam: format - Output format (DATAID by default)\nReturns: Observable instance for the search results"},sendEmail:{parameters:["body","token","bulkOrOptions","recaptchaToken"]},sendMessage:{parameters:["type","payload","retryCount"],documentation:"Method to send message to the service worker from main thread\nParam: type string\nParam: payload any\nReturns: Promise<any>"},sendPersonalEmail:{parameters:["body","token","options"]},setHasActivatedSW:{parameters:["value"]},storeToDatabase:{parameters:["databaseName","object"]},unwrapContainers:{parameters:["parentElement","selector"],documentation:"Recursively unwraps all matching container elements within a parent.\n\nParam: parentElement - Parent element to search within\nParam: selector - CSS selector for containers to unwrap"},updateAccessToken:{parameters:["accessToken","session","refreshToken"],documentation:'Updates the JWT access token used for authenticated API requests.\n\nThis function should be called after user authentication to set or update the bearer token\nthat will be used for all subsequent authenticated operations. The token is stored in\nTokenStorage and automatically included in API request headers.\n\n**When to Use:**\n- After successful login (LoginToBackend or Signin)\n- When refreshing an expired token\n- When switching between user sessions\n- When restoring a saved session on app reload\n\n**Token Flow:**\n1. User logs in via LoginToBackend() or Signin()\n2. Backend returns JWT token\n3. Call updateAccessToken() with the token\n4. Token is stored in memory (TokenStorage.BearerAccessToken)\n5. All API calls automatically use this token\n6. If service worker enabled, token is synced to service worker\n\n**Security Notes:**\n- Token is stored in memory only (not persisted to disk)\n- Token is cleared on page refresh (unless you save/restore it)\n- Never expose token in logs or client-side code\n- Token should be refreshed before expiration\n\nParam: accessToken - The JWT bearer token obtained from authentication.\nFormat: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."\nPass empty string to clear the token (logout).\n\nParam: session - Optional session information to sync with token.\nReserved for future use. Currently not fully implemented.\n\nReturns: void'},uploadAttachment:{parameters:["file","token"],documentation:"Generic method to upload file or image\nParam: file File\nReturns: Promise<{message: string, success: boolean, url?: string}>"},uploadFile:{parameters:["body","token"],documentation:"Method to upload file to server\nParam: body FormData\nParam: token string?\nReturns: JSON | string | null"},uploadImage:{parameters:["body","token"],documentation:"Method to upload image to server\nParam: body FormData\nParam: token string?\nReturns: JSON | string | null"},uploadImageV2:{parameters:["body","token"],documentation:"Method to upload image to server\nParam: body FormData\nParam: token string?\nReturns: JSON | string | null"},uploadR2Storage:{parameters:["body","token"],documentation:'Method to upload a file or image to R2 storage.\nParam: body FormData. Append the file under the "file" key.\nParam: token string?\nReturns: UploadResponse<R2UploadData> | null'},uploadToR2PresignedUrl:{parameters:["uploadUrl","file","contentType"],documentation:"Method to upload a file body to a pre-signed R2 URL.\nParam: uploadUrl URL returned by getR2PresignedUploadUrl\nParam: file Blob/File, raw body, or compatible file-like object\nParam: contentType Must match the contentType used when creating the signed URL.\nReturns: Response from R2"},uploadWithR2PresignedUrl:{parameters:["file","options","token"],documentation:"Full R2 pre-signed upload workflow: create URL, PUT file to R2, return public URL.\nParam: file Blob/File, raw body, or compatible file-like object\nParam: options Optional fileName/contentType/folder/expiresInSeconds overrides.\nParam: token string?\nReturns: R2PresignedUploadResult"}}};function Ad(){return bd}export{oa as ADMIN,Kr as ALLID,Kc as AccessControlService,De as AccessTracker,$r as AddGhostConcept,Cc as Anomaly,r as BaseUrl,b as BinaryTree,Wc as BuildWidgetFromId,uc as BuilderStatefulWidget,yr as Composition,dr as CompositionBinaryTree,cr as CompositionNode,A as Concept,U as ConceptsData,Ue as Connection,Je as ConnectionData,ss as CountInfo,Jn as CreateComposition,ro as CreateConnection,Uc as CreateConnectionBetweenEntityLocal,So as CreateConnectionBetweenTwoConcepts,_o as CreateConnectionBetweenTwoConceptsGeneral,$s as CreateConnectionBetweenTwoConceptsLocal,Fl as CreateData,S as CreateDefaultConcept,pt as CreateDefaultLConcept,Lr as CreateSession,Rr as CreateSessionVisit,yo as CreateTheCompositionLocal,vr as CreateTheCompositionWithCache,xn as CreateTheConnection,Co as CreateTheConnectionGeneral,io as CreateTheConnectionLocal,zr as DATAID,Qr as DATAIDDATE,Xr as DATAV2,Zs as DelayFunctionExecution,ei as DeleteConceptById,zs as DeleteConceptLocal,ko as DeleteConnectionById,bo as DeleteConnectionByIdBulk,bc as DeleteConnectionByType,Ac as DeleteConnectionByTypeBulk,ti as DeleteUser,la as DependencyObserver,Z as Environments,xa as FilterSearch,As as FormatFromConnections,ks as FormatFromConnectionsAltered,Nc as FreeschemaQuery,Pc as FreeschemaQueryApi,Ut as GetAllConnectionsOfComposition,rt as GetAllConnectionsOfCompositionBulk,$o as GetAllLinkerConnectionsFromTheConcept,Sc as GetAllTheConnectionsByTypeAndOfTheConcept,Gt as GetComposition,yi as GetCompositionBulk,mi as GetCompositionBulkWithDataId,vi as GetCompositionFromConnectionsWithDataId,gi as GetCompositionFromConnectionsWithDataIdFromConnections,ki as GetCompositionFromConnectionsWithDataIdInObject,Ci as GetCompositionFromConnectionsWithDataIdIndex,wi as GetCompositionFromConnectionsWithIndex,Ii as GetCompositionFromConnectionsWithIndexFromConnections,$t as GetCompositionFromMemoryWithConnections,fn as GetCompositionList,yn as GetCompositionListAll,mn as GetCompositionListAllWithId,ga as GetCompositionListListener,An as GetCompositionListLocal,Sn as GetCompositionListLocalWithId,vn as GetCompositionListWithId,gn as GetCompositionListWithIdUpdated,ya as GetCompositionListener,In as GetCompositionLocal,Tn as GetCompositionLocalWithId,jt as GetCompositionWithAllIds,Ar as GetCompositionWithCache,_r as GetCompositionWithDataIdBulk,Nr as GetCompositionWithDataIdWithCache,Qt as GetCompositionWithId,Jt as GetCompositionWithIdAndDateFromMemory,Xe as GetConceptBulk,ln as GetConceptByCharacter,hn as GetConceptByCharacterAndCategoryLocal,Dn as GetConceptByCharacterAndType,Ks as GetConnectionBetweenTwoConceptsLinker,pi as GetConnectionBulk,ai as GetConnectionById,Ti as GetConnectionDataPrefetch,vo as GetConnectionOfTheConcept,ls as GetConnectionTypeForCount,pc as GetConnectionsBetweenApi,Zl as GetFreeschemaImage,Xl as GetFreeschemaImageUrl,Yl as GetImageApi,na as GetInstanceConceptByCharacterType,Oo as GetLink,Na as GetLinkListListener,Ia as GetLinkListener,Do as GetLinkRaw,Qo as GetLinkerConnectionFromConcepts,Yo as GetLinkerConnectionToConcepts,Fr as GetRelation,Ds as GetRelationLocal,Br as GetRelationNew,Mr as GetRelationRaw,on as GetTheConcept,Es as GetTheConceptLocal,qr as GetUserGhostId,Jr as JUSTDATA,_a as LConcept,Pa as LConnection,Zr as LISTNORMAL,xt as LocalConceptsData,_t as LocalSyncData,mc as LocalTransaction,Hc as LogEvent,no as Logger,Qi as LoginToBackend,Hn as MakeTheInstanceConcept,po as MakeTheInstanceConceptLocal,di as MakeTheTimestamp,Vo as MakeTheTypeConceptApi,uo as MakeTheTypeConceptLocal,Hr as NORMAL,ia as PRIVATE,ra as PUBLIC,Ea as PatcherStructure,Vl as Prototype,Yr as RAW,Ni as RecursiveSearchApi,Li as RecursiveSearchApiNewRawFullLinker,Pi as RecursiveSearchApiRaw,Ei as RecursiveSearchApiRawFullLinker,_i as RecursiveSearchApiWithInternalConnections,ba as RecursiveSearchListener,Rc as SchemaQuery,xc as SchemaQueryListener,Ir as SearchAllConcepts,Ws as SearchLinkInternal,Vs as SearchLinkInternalAll,Ts as SearchLinkMultipleAll,ua as SearchLinkMultipleAllObservable,Ee as SearchLinkMultipleApi,ui as SearchQuery,Ra as SearchStructure,kr as SearchWithLinker,fs as SearchWithTypeAndLinker,aa as SearchWithTypeAndLinkerApi,zc as Selector,La as SessionData,er as Signin,Ki as Signup,Zi as SignupEntity,Le as SplitStrings,sc as StatefulWidget,Ln as SyncData,he as TokenStorage,oi as TrashTheConcept,Cr as UpdateComposition,xs as UpdateCompositionLocal,Wr as UserBinaryTree,Ic as Validator,Ms as ViewInternalData,Fs as ViewInternalDataApi,Oc as WidgetTree,fc as buildFetchConnection,qc as clearAllCaches,Ss as convertFromConceptToLConcept,Ns as convertFromLConceptToConcept,_l as convertWidgetTreeToWidget,El as convertWidgetTreeToWidgetWithWrapper,Tc as createFormFieldData,Hl as createPrototypeLocal,wd as dispatchIdEvent,Lo as getFromDatabaseWithType,xo as getObjectsFromIndexDb,ji as getR2PresignedUploadUrl,Ad as getTsccsAutocompleteMetadata,zi as getUploadFileLimit,cc as getUserDetails,lc as getUserDetailsWithRefresh,Nl as getWidgetBulkFromId,Sl as getWidgetFromId,Td as handleServiceWorkerException,ud as hasActivatedSW,gl as importLatestWidget,Cl as importRecentWidget,fd as init,us as orderTheConnections,Zt as recursiveFetch,hr as recursiveFetchNew,$c as removeAllChildren,wl as renderImportedWidget,Il as renderLatestWidget,vl as renderPage,Tl as renderWidget,ha as searchLinkMultipleListener,tc as sendEmail,yd as sendMessage,nc as sendPersonalEmail,ed as serviceWorker,hd as setHasActivatedSW,Eo as storeToDatabase,od as subscribedListeners,bd as tsccsAutocompleteMetadata,Rl as unwrapContainers,pd as updateAccessToken,Mi as uploadAttachment,Hi as uploadFile,qi as uploadImage,$i as uploadImageV2,Gi as uploadR2Storage,Wi as uploadToR2PresignedUrl,Vi as uploadWithR2PresignedUrl,Oi as validDocumentFormats,Ri as validImageFormats};