mftsccs-browser 2.2.8-beta → 2.2.10-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.
- package/dist/bundle-report.html +39 -0
- package/dist/main.bundle.js +2 -1
- package/dist/main.bundle.js.LICENSE.txt +1 -4
- package/dist/serviceWorker.bundle.js +2 -1
- package/dist/serviceWorker.bundle.js.LICENSE.txt +1 -4
- package/dist/types/Api/Create/CreateTheGhostConceptApi.d.ts +1 -1
- package/dist/types/Api/Images/GetImages.d.ts +1 -0
- package/dist/types/Api/Login.d.ts +1 -1
- package/dist/types/Constants/FormatConstants.d.ts +1 -0
- package/dist/types/DataStructures/BaseUrl.d.ts +5 -2
- package/dist/types/DataStructures/Local/LocalSyncData.d.ts +2 -1
- package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +1 -0
- package/dist/types/DataStructures/Security/TokenStorage.d.ts +1 -0
- package/dist/types/Middleware/logger.service.d.ts +6 -2
- package/dist/types/Services/AccessControl/AccessControl.d.ts +83 -1
- package/dist/types/Services/Search/DataIdFormat.d.ts +1 -1
- package/dist/types/Services/Search/NewFormat.d.ts +4 -0
- package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +1 -0
- package/dist/types/Services/Security/GetRequestHeader.d.ts +1 -1
- package/dist/types/Services/Transaction/LocalTransaction.d.ts +4 -0
- package/dist/types/Services/Upload.d.ts +7 -0
- package/dist/types/Services/assets/GetImageService.d.ts +14 -0
- package/dist/types/Widgets/NormalizeStyles.service.d.ts +1 -0
- package/dist/types/Widgets/RenderWidgetService.d.ts +8 -7
- package/dist/types/Widgets/StatefulWidget.d.ts +1 -0
- package/dist/types/Widgets/WidgetTree.d.ts +3 -0
- package/dist/types/app.d.ts +8 -5
- package/package.json +3 -5
package/dist/main.bundle.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
var e={1735:(e,t,n)=>{n.d(t,{J:()=>s});var o,i=n(5983),r=n(3278),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class s{static incrementConcept(e){try{e&&(this.conceptsData[e]=(this.conceptsData[e]||0)+1)}catch(e){console.error("Failed on increment concept")}}static incrementConnection(e){try{e&&(this.connectionsData[e]=(this.connectionsData[e]||0)+1)}catch(e){console.error("Failed on increment connection")}}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 c(this,void 0,void 0,(function*(){try{yield this.syncToServer()}catch(e){console.error("Failed to process Access Tracker Sync with Server")}}))}static syncToServer(){return c(this,void 0,void 0,(function*(){try{if(!Object.keys(this.conceptsData).length&&!Object.keys(this.connectionsData).length)return;const e=r.b.BearerAccessToken;if(!e)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 fetch(i.BaseUrl.PostPrefetchConceptConnections(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${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){console.error("Sync error:",e)}}))}static setNextSyncTime(){this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS}static startAutoSync(){setInterval((()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&this.syncNow().catch(console.error)}),6e4)}static syncNow(){return c(this,void 0,void 0,(function*(){try{this.activateStatus?yield this.syncToServer():console.warn("Access Tracker inactive.")}catch(e){console.error("Error on sync access tracker")}}))}static GetSuggestedConcepts(e){return c(this,void 0,void 0,(function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConcepts());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load concepts: ${o.status} ${o.statusText}. Details: ${e}`)}const c=(yield o.json())||[];return yield this.addConceptToBinaryTree(c.data),c}catch(e){throw e instanceof Error?(console.error("Error fetching suggested concepts:",e.message),new Error("Unable to fetch suggested concepts. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested concepts."))}}))}static GetSuggestedConnections(e){return c(this,void 0,void 0,(function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConnections());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load connections: ${o.status} ${o.statusText}. Details: ${e}`)}const c=(yield o.json())||[];return yield this.addConnectionToBinaryTree(c.data),c}catch(e){throw e instanceof Error?(console.error("Error fetching suggested Connections:",e.message),new Error("Unable to fetch suggested connections. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested Connections."))}}))}static addConceptToBinaryTree(e){return c(this,void 0,void 0,(function*(){try{e.forEach((e=>{i.ConceptsData.AddConcept(e)}))}catch(e){console.error("Error on adding Concepts Data into tree")}}))}static addConnectionToBinaryTree(e){return c(this,void 0,void 0,(function*(){try{e.forEach((e=>{i.ConnectionData.AddConnection(e)}))}catch(e){console.error("Error on adding Connections Data into tree")}}))}}o=s,s.conceptsData={},s.connectionsData={},s.SYNC_INTERVAL_MS=12e4,s.nextSyncTime=Date.now(),s.activateStatus=!1,s.accessData="Access Data",o.startAutoSync()},1167:(e,t,n)=>{n.d(t,{Y:()=>a});var o=n(9581),i=n(3518),r=n(5983),c=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function a(e){return s(this,void 0,void 0,(function*(){const t=r.Logger.logfunction("CreateTheConceptApi",e);let n=(0,r.CreateDefaultConcept)();try{var s=(0,i.Xr)();const a=yield fetch(o.B.CreateTheConceptUrl(),{method:"POST",headers:s,body:JSON.stringify(e)});if(!a.ok)throw(0,c.ry)(a),new Error(`Error! status: ${a.status}`);return n=yield a.json(),r.Logger.logUpdate(t),n}catch(e){e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),(0,c.Mb)(e,o.B.CreateTheConceptUrl()),(0,c.ey)(t,"CreateTheConceptApi",e)}}))}},2:(e,t,n)=>{n.d(t,{s:()=>d});var o=n(8286),i=n(9581),r=n(1412),c=n(3518),s=n(1863),a=n(5983),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=a.Logger.logfunction("GetAllConnectionsOfComposition",t);var i=[];if(0==(i=yield o.d.GetConnectionsOfConcept(e)).length)i=yield h(e);else{var c=yield h(e);(0,r.e)(c,i),i=c}return a.Logger.logUpdate(n),i}))}function h(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=a.Logger.logfunction("GetAllConnectionsOfCompositionOnline",t);var r=[];try{(0,c.Xr)("application/json");const t=new Headers,d=new FormData;d.append("composition_id",e.toString());const h=yield fetch(i.B.GetAllConnectionsOfCompositionUrl(),{method:"POST",headers:t,body:d});if(console.log("this is getting connection from online",i.B.GetAllConnectionsOfCompositionUrl(),e),!h.ok)throw(0,s.ry)(h),new Error(`Error! status: ${h.status}`);const u=yield h.json();for(var l=0;l<u.length;l++)o.d.AddConnection(u[l]),r.push(u[l]);return a.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connection of composition error : ",e.message):console.log("Get all connection of composition error : ",e),(0,s.Mb)(e,i.B.GetAllConnectionsOfCompositionUrl()),(0,s.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}}))}},8642:(e,t,n)=>{n.d(t,{Y:()=>u});var o=n(8286),i=n(9581),r=n(4364),c=n(5284),s=n(1412),a=n(3518),l=n(1863),d=n(5983),h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function u(){var e=arguments;return h(this,arguments,void 0,(function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionBulk",e)||{};if(d.serviceWorker){n.serviceWorker=!0;try{const e=yield(0,d.sendMessage)("GetAllConnectionsOfCompositionBulk",{composition_ids:t});return d.Logger.logUpdate(n),e.data}catch(e){console.error("GetAllConnectionsOfCompositionBulk sw error: ",e),(0,l.ey)(n,"GetAllConnectionsOfCompositionBulk",e),(0,d.handleServiceWorkerException)(e)}}var u=[];if(t.length<=0)return u;var p=yield(0,c.B)(t),f=yield function(){var e=arguments;return h(this,arguments,void 0,(function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionOnline",e);var r=[];try{var c=(0,a.Xr)("application/json");const e=yield fetch(i.B.GetAllConnectionsOfCompositionBulkUrl(),{method:"POST",headers:c,body:JSON.stringify(t)});if(e.ok){const t=yield e.json();for(var s=0;s<t.length;s++)o.d.AddConnection(t[s]),r.push(t[s])}else console.log("Get all connections of composition bulk error message: ","Cannot get response"),(0,l.ry)(e);return d.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connections of composition bulk error message: ",e.message):console.log("Get all connections of composition bulk unexpected error: ",e),(0,l.Mb)(e,i.B.GetAllConnectionsOfCompositionBulkUrl()),(0,l.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}}))}(t);return u=f,(0,s.e)(u,p),yield(0,r.s)(u),d.Logger.logUpdate(n),u}))}},8675:(e,t,n)=>{n.d(t,{l:()=>s});var o=n(1863),i=n(3518),r=n(5983),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(e){var t=arguments;return c(this,void 0,void 0,(function*(){r.Logger.logfunction("GetAllLinkerConnectionsFromTheConcept",t);var n=[];try{(new Date).getTime();var c=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionOfConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:c});if(t.ok){const e=yield t.json();for(var s=0;s<e.length;s++){var a=e[s];n.push(a)}}else console.log("Get all linker connection from the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection from the concepts error: ",e.message):console.log("Get all linker connection from the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionOfConceptUrl())}return n}))}},6058:(e,t,n)=>{n.d(t,{W:()=>s});var o=n(1863),i=n(3518),r=n(5983),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(e){var t=arguments;return c(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetAllLinkerConnectionsToTheConcept",t);var c=[];try{(new Date).getTime();var s=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionToConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:s});if(t.ok){const e=yield t.json();for(var a=0;a<e.length;a++){var l=e[a];c.push(l)}r.Logger.logUpdate(n)}else console.log("Get all linker connection To the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection To the concepts error: ",e.message):console.log("Get all linker connection To the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionToConceptUrl()),(0,o.ey)(n,"GetAllLinkerConnectionsToTheConcept",e)}return c}))}},2803:(e,t,n)=>{n.d(t,{x:()=>a});var o=n(8286),i=n(9581),r=n(1863),c=n(5983),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function a(e,t,n){var a=arguments;return s(this,void 0,void 0,(function*(){const s=c.Logger.logfunction("GetCompositionConnectionsBetweenTwoConcepts",a)||{};var l=[];try{if(c.serviceWorker){s.serviceWorker=!0;try{const o=yield(0,c.sendMessage)("GetCompositionConnectionsBetweenTwoConcepts",{ofConceptId:e,toConcept:t,mainKey:n});return c.Logger.logUpdate(s),o.data}catch(e){console.error("GetCompositionConnectionsBetweenTwoConcepts sw error: ",e),(0,r.ey)(s,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,c.handleServiceWorkerException)(e)}}var d=new FormData;d.append("ofConceptId",e.toString()),d.append("mainKey",n.toString()),d.append("toConceptId",t.toString());const a=yield fetch(i.B.GetCompositionConnectionBetweenTwoConceptsUrl(),{method:"POST",body:d,redirect:"follow"});if(a.ok){const e=yield a.json();for(var h=0;h<e.length;h++)o.d.AddConnection(e[h]),l.push(e[h]);c.Logger.logUpdate(s)}else console.log("Get composition connection between two concepts",a.status),(0,r.ry)(a)}catch(e){e instanceof Error?console.log("Get composition connection between two concepts error message: ",e.message):console.log("Get composition connection between two concepts unexpected error: ",e),(0,r.Mb)(e,i.B.GetCompositionConnectionBetweenTwoConceptsUrl()),(0,r.ey)(s,"GetCompositionConnectionsBetweenTwoConcepts",e)}return l}))}},7139:(e,t,n)=>{n.d(t,{r:()=>d});var o=n(3026),i=n(9581),r=n(5983),c=n(1863),s=n(1596),a=n(3278),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetConcept",t)||{};let d=(0,r.CreateDefaultConcept)();const h=new FormData;h.append("id",e.toString());try{if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConcept",{id:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConcept sw error: ",e),(0,c.ey)(n,"GetConcept",e),(0,r.handleServiceWorkerException)(e)}}if(0==e||null==e||null==e)return d;var u=yield o.I.GetConcept(e);let t=o.I.GetNpc(e);if(0!=u.id||t)return r.Logger.logUpdate(n),u;{let t;const u={method:"POST",body:h,headers:{Authorization:"Bearer "+a.b.BearerAccessToken}};try{console.log("this is the url",i.B.GetConceptUrl()),t=yield fetch(i.B.GetConceptUrl(),u)}catch(e){t=yield(0,s.g)(u,"/api/getConcept")}return yield function(e,t,n,i){return l(this,void 0,void 0,(function*(){return e.ok?(t=yield e.json()).id>0?o.I.AddConcept(t):o.I.AddNpc(i):(console.log("Get the concept error",e.status),(0,c.ry)(e)),r.Logger.logUpdate(n),t}))}(t,d,n,e)}}catch(e){e instanceof Error?console.log("Get the concept error message: ",e.message):console.log("Get the concept unexpected error: ",e),(0,c.Mb)(e,i.B.GetConceptUrl()),(0,c.ey)(n,"GetConcept",e)}}))}},1239:(e,t,n)=>{n.d(t,{I:()=>h,r:()=>d});var o=n(3026),i=n(9581),r=n(3518),c=n(1863),s=n(5983),a=n(1596),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e){return l(this,void 0,void 0,(function*(){const t=s.Logger.logfunction("GetConceptBulk",[e.length])||{};let n=[],d=((new Date).getTime(),performance.now()),h=Array.from(new Set(e));try{if(s.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,s.sendMessage)("GetConceptBulk",{passedConcepts:e});return s.Logger.logUpdate(t),n.data}catch(e){console.error("GetConceptBulk sw error: ",e),(0,c.ey)(t,"GetConceptBulk",e),(0,s.handleServiceWorkerException)(e)}}if(h.length>0){let u=[];for(let e=0;e<h.length;e++)if(!o.I.GetNpc(h[e])){let t=yield o.I.GetConcept(h[e]);0==t.id?u.push(h[e]):n.push(t)}if(0==u.length)return s.Logger.logfunction(t),n;{let h;const p={method:"POST",headers:(0,r.Xr)("application/json"),body:JSON.stringify(u)};try{h=yield fetch(i.B.GetConceptBulkUrl(),p)}catch(e){h=yield(0,a.g)(p,"/api/get_concept_bulk")}yield function(e,t,n,i,r){return l(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 i=t[e];o.I.AddConcept(i),n.push(i)}console.log("added the concepts"),s.Logger.logUpdate(i)}else console.log("Get Concept Bulk error",e.status),s.Logger.logError(r,"unknown","read","unknown",void 0,e.status,e,"GetConceptBulk",[t],"unknown",void 0),(0,c.ry)(e)}))}(h,e,n,t,d)}}}catch(n){n instanceof Error?console.log("Get Concept Bulk error message: ",n.message):console.log("Get Concept Bulk unexpected error: ",n),s.Logger.logError(d,"unknown","read","unknown",void 0,500,n,"GetConceptBulk",[e],"unknown",void 0),(0,c.Mb)(n,i.B.GetConceptBulkUrl()),(0,c.ey)(t,"GetConceptBulk",n)}return n}))}function h(e){return l(this,void 0,void 0,(function*(){const t=[];if(e.length>0){const n=(0,r.Xr)("application/json");try{const r=yield fetch(i.B.GetConceptBulkUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(r.ok){const e=yield r.json();if(e.length>0)for(let n=0;n<e.length;n++){const i=e[n];t.push(i),o.I.AddConcept(i)}}else console.log("bulk concept getter api error: ",r.status),(0,c.ry)(r)}catch(e){e instanceof Error?console.log("bulk concept getter api error: ",e.message):console.log("bulk concept getter api error: ",e),(0,c.Mb)(e,i.B.GetConceptBulkUrl())}}return t}))}},4402:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(3026),i=n(9581),r=n(3518),c=n(1863),s=n(5983),a=n(7876),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){const l=s.Logger.logfunction("GetConceptByCharacterAndType",n);try{if(s.serviceWorker)try{return(yield(0,s.sendMessage)("GetConceptByCharacterAndType",{characterValue:e,typeId:t})).data}catch(e){console.error("GetConceptByCharacterAndType sw error: ",e),(0,s.handleServiceWorkerException)(e)}let n=yield o.I.GetConceptByCharacterAndTypeLocal(e,t);if(null==n||0==n.id){var d={character_value:`${e}`,type_id:t},h=JSON.stringify(d),u=(0,r.Xr)("application/json");const s=yield fetch(i.B.GetConceptByCharacterAndTypeUrl(),{method:"POST",headers:u,body:h});if(s.ok){let e=yield s.json();n=e,(0,a.K)(n).then((e=>{o.I.AddConcept(n)}))}else(0,c.ry)(s),console.log("This is the concept by type and character error",s.status)}return s.Logger.logUpdate(l),n}catch(e){e instanceof Error?console.log(" This is the concept by type and character error message: ",e.message):console.log(" This is the concept by type and character unexpected error: ",e),(0,c.Mb)(e,i.B.GetConceptByCharacterAndTypeUrl()),(0,c.ey)(l,"GetConceptByCharacterAndType",e)}}))}},8146:(e,t,n)=>{n.d(t,{Y:()=>l});var o=n(3026),i=n(9581),r=n(5983),c=n(1863),s=n(7876),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function l(e){var t=arguments;return a(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetConceptByCharacterValue",t);let a=(0,r.CreateDefaultConcept)();try{const t=new FormData;t.append("character_value",e);const l=yield fetch(i.B.GetConceptByCharacterValueUrl(),{method:"POST",body:t});l.ok?(a=yield l.json(),a.id>0&&(0,s.K)(a).then((e=>{o.I.AddConcept(a)})),r.Logger.logUpdate(n)):((0,c.ry)(l),console.log("Error in Getting concept by character value Error",l.status))}catch(e){e instanceof Error?console.log("Error in Getting concept by character value error message: ",e):console.log("Error in Getting concept by character value unexpected error: ",e),(0,c.Mb)(e,i.B.GetConceptByCharacterValueUrl()),(0,c.ey)(n,"GetConceptByCharacterValue",e)}return a}))}},7467:(e,t,n)=>{n.d(t,{j:()=>h});var o=n(8286),i=n(9581),r=n(4364),c=n(3518),s=n(1863),a=n(5983),l=n(1596),d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function h(){return d(this,arguments,void 0,(function*(e=[]){const t=a.Logger.logfunction("GetConnectionBulk",e.length)||{};let n=[];try{if(a.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("GetConnectionBulk",{connectionIds:e});return a.Logger.logUpdate(t),n.data}catch(e){console.error("GetConnectionBulk sw error: ",e),(0,s.ey)(t,"GetConnectionBulk",e),(0,a.handleServiceWorkerException)(e)}}if(e.length>0){let r=[];for(let t=0;t<e.length;t++)if(!o.d.GetNpConn(e[t])){let i=yield o.d.GetConnection(e[t]);0==i.id?r.push(e[t]):n.push(i)}if(0==r.length)return a.Logger.logUpdate(t),n;{let e;const h={method:"POST",headers:(0,c.Xr)("application/json"),body:JSON.stringify(r)};try{e=yield fetch(i.B.GetConnectionBulkUrl(),h)}catch(t){e=yield(0,l.g)(h,"/api/get_connection_bulk")}yield function(e,t,n){return d(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 i=n[e];t.push(i),o.d.AddConnection(i)}}else(0,s.ey)(n,"GetConnectionBulk",e.status),(0,s.ry)(e),console.log("Get Connection Bulk error",e.status)}))}(e,n,t),a.Logger.logUpdate(t)}}}catch(e){e instanceof Error?console.log("Get Connection Bulk error message: ",e):console.log("Get Connection Bulk unexpected error: ",e),(0,s.ey)(t,"GetConnectionBulk",e),(0,s.Mb)(e,i.B.GetConnectionBulkUrl())}return yield(0,r.s)(n),n}))}},2832:(e,t,n)=>{n.d(t,{j:()=>a});var o=n(5983),i=n(9581),r=n(1863),c=n(3518),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function a(e){var t=arguments;return s(this,arguments,void 0,(function*(e,n=""){const s=o.Logger.logfunction("SearchLinkMultipleApi",t);let a=performance.now();var l=(0,c.ab)("application/json",n);const d=i.B.SearchLinkMultipleAllApiUrl(),h=JSON.stringify(e);try{const t=yield fetch(d,{method:"POST",headers:l,body:h});if(t.ok){let e=yield t.json();return o.Logger.logUpdate(s),e}return(0,r.ry)(t),console.log("This is the searching multiple error",t.status),o.Logger.logError(a,"unknown","search","unknown",void 0,t.status,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),[]}catch(t){console.log("This is the searching multiple error",t),o.Logger.logError(a,"unknown","search","unknown",void 0,500,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),(0,r.Mb)(t,d),(0,r.ey)(s,"SearchLinkMultipleApi",t)}}))}},3130:(e,t,n)=>{n.d(t,{BG:()=>a,SL:()=>l,XZ:()=>s,ZJ:()=>r,iw:()=>c,y0:()=>i,yv:()=>o});const o=1,i=2,r=3,c=4,s=5,a=6,l=7},9635:(e,t,n)=>{n.d(t,{x:()=>o});const o=new BroadcastChannel("Freeschema_mftsccs_browser_channel")},9581:(e,t,n)=>{n.d(t,{B:()=>o});class o{static setRandomizer(e){console.log("set randomizer",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 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 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 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(){return o.NODE_URL+"/api/v1/local-concepts"}static CreateGhostConnectionApiUrl(){return o.NODE_URL+"/api/v1/local-connections"}static GetRealConceptById(){return o.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 FreeschemaQueryUrl(){return this.BASE_URL+"/api/freeschema-query"}static uploadImageUrl(){return this.BASE_URL+"/api/Image/UploadImage"}static uploadFileUrl(){return this.BASE_URL+"/api/Image/UploadFile"}static sendMail(){return this.BASE_URL+"/api/sendmail"}static sendBulkMail(){return this.BASE_URL+"/api/sendmail/bulk"}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 getConnectionsByTypes(){return this.BASE_URL+"/api/get-connection-by-types"}static CreatePrototypeUrl(){return this.BASE_URL+"/api/create-prototype"}}o.BASE_URL="https://localhost:7053/",o.NODE_CACHE_URL="",o.AI_URL="https://ai.freeschema.com",o.MQTT_URL="192.168.1.249",o.NODE_URL="http://localhost:5001",o.LOG_SERVER="https://logdev.freeschema.com",o.BASE_APPLICATION="",o.DOCUMENTATION_WIDGET=0,o.ACCESS_CONTROL_BASE_URL="http://localhost:5001",o.FLAGS={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1},o.BASE_RANDOMIZER=999},6963:(e,t,n)=>{n.d(t,{f:()=>c});var o=n(205),i=n(6731),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class c{static waitForDataToLoad(){return r(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isCharacterLoaded)return e("done");setTimeout(c.checkFlag,1e3,e)}static addNodeToTree(e){return r(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 r(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 i.b(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 r(this,void 0,void 0,(function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndType(e,t,this.characterRoot):this.characterRoot}))}static getCharacterAndCategoryFromTree(e,t){return r(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))}}c.characterRoot=null},2202:(e,t,n)=>{n.d(t,{W:()=>a});var o=n(6963),i=n(6731),r=n(205),c=n(5983),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class a{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 s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addConceptToTree(e){let t=new i.b(e.id,e,null,null),n=new i.b(e.characterValue,e,null,null);o.f.addNodeToTree(n),this.addNodeToTree(t)}static getNodeFromTree(e){return s(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return s(this,void 0,void 0,(function*(){if(this.root){let t=new Event(`${e}`);console.log("this is the fired event after delete",t),(0,c.dispatchIdEvent)(e),this.root=this.root.removeNode(this.root,e)}}))}static getConceptListFromIds(e,t,n){return s(this,void 0,void 0,(function*(){this.root&&this.root.checkIfIdsInNode(this.root,e,t,n)}))}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}a.root=null},5457:(e,t,n)=>{n.d(t,{c:()=>a});var o=n(5983),i=n(7282),r=n(205);class c{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 i,r,s,a;if(null==e)return(0,o.dispatchIdEvent)(t,{detail:n}),new c(t,n);if(t<e.key)e.leftNode=this.addType(e.leftNode,t,n);else{if(!(t>e.key))return e.value.includes(n)||((0,o.dispatchIdEvent)(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 l=this.getBalanceFactor(e);return l>1&&t<(null===(i=e.leftNode)||void 0===i?void 0:i.key)?this.rightRotate(e):l<-1&&t>(null===(r=e.rightNode)||void 0===r?void 0:r.key)?this.leftRotate(e):l>1&&t>(null===(s=e.leftNode)||void 0===s?void 0:s.key)?(e.leftNode=this.leftRotate(e.leftNode),this.rightRotate(e)):l<-1&&t<(null===(a=e.rightNode)||void 0===a?void 0:a.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 s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class a{static addType(e){return s(this,void 0,void 0,(function*(){return null==this.root?(this.root=e,new CustomEvent(`${e.key}`,{detail:e.value[0]}),(0,o.dispatchIdEvent)(e.key,{detail:e.value[0]}),this.root):(this.root=this.root.addType(this.root,e.key,e.value[0]),this.root)}))}static addConceptToTree(e){if(0!=e.typeId){let t=new c(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){return this.root?this.root.getFromNode(e,this.root):this.root}static getTypeVariantsFromTreeNew(e){return s(this,void 0,void 0,(function*(){let t=this.getNodeFromTreeNew(e),n=[],i=[];if(t){n=t.value;for(let e=0;e<n.length;e++){let t=!1;for(let o=0;o<i.length;o++)i[o].id==n[e]&&(t=!0);t||i.push(yield(0,o.GetTheConcept)(n[e]))}}return i}))}static waitForDataToLoad(){return s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isTypeLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserIdNew(e,t){return s(this,void 0,void 0,(function*(){let n=[],o=yield this.getTypeVariantsFromTreeNew(e);console.log("these are all the concepts",o);for(let e=0;e<o.length;e++)o[e].userId==t&&n.push(o[e]);return n}))}static getTypeVariantsWithCharacterValueNew(e,t){return s(this,void 0,void 0,(function*(){let n=yield this.getTypeVariantsFromTreeNew(t);console.log("this is all the concepts for character",n);let o=(0,i.o)();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}}a.typeRoot=null,a.root=null},2615:(e,t,n)=>{n.d(t,{j:()=>i});var o=n(5983);class i{constructor(e,t,n,i,r,c,s,a=!1,l,d,h){this.count=0,this.typeCharacter="",this.referent=null,this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=o.BaseUrl.getRandomizer(),this.x=0,this.y=0,this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=i,this.referentId=r,this.characterValue=`${c}`,this.accessId=s,this.typeCharacter=h,this.type=null,this.isNew=a,this.entryTimeStamp=l,this.updatedTimeStamp=d}getType(){console.log(this.typeId)}}},3026:(e,t,n)=>{n.d(t,{I:()=>f});var o=n(3655),i=n(2202),r=n(6963),c=n(5457),s=n(7282),a=n(5983);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 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 d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class h{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 d(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return d(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}}h.root=null;class u{constructor(){this.widgetId=0,this.mainId=0,this.conceptIds=[],this.linkers=[],this.reverse=[],this.mainCompositionIds=[],this.countinfo=[]}}var p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class f{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&&(0,o.kH)("concept",e)}static GetConceptBulkData(e,t,n){return p(this,void 0,void 0,(function*(){yield i.W.getConceptListFromIds(e,t,n)}))}static AddWidget(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddWidget",{widgetDetails:e})}catch(e){console.error("Concept Data, Add Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.widgetId>0&&h.addWidgetToTree(e)}static AddConcept(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddConcept",{concept:e})}catch(e){console.error("Concept Data, Add Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.id>0&&(i.W.addConceptToTree(e),c.c.addConceptToTree(e))}static AddConceptToMemory(e){e.id>0&&(i.W.addConceptToTree(e),c.c.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);(0,o.wh)("concept",e.id)}static GetWidget(e){return p(this,void 0,void 0,(function*(){let t=new u;if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetWidget",{id:e})).data}catch(e){console.error("Concept Data, Get Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}let n=yield h.getNodeFromTree(e);return null!=n&&(t=n.value),t}))}static RemoveWidget(e){return p(this,void 0,void 0,(function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__RemoveWidget",{id:e})).data}catch(e){console.error("Concept Data, Remove Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}yield h.removeNodeFromTree(e)}))}static GetConcept(e){return p(this,void 0,void 0,(function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConcept",{id:e})).data}catch(e){console.error("Concept Data, Get Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}if(0==e||null==e||null==e)return(0,s.o)();var t=(0,s.o)(),n=yield i.W.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t}))}static GetConceptByCharacter(e){return p(this,void 0,void 0,(function*(){var t=(0,s.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t}))}static GetConceptByCharacterUpdated(e){return p(this,void 0,void 0,(function*(){var t=(0,s.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t}))}static GetConceptByCharacterAndTypeLocal(e,t){return p(this,void 0,void 0,(function*(){return(0,s.o)(),yield c.c.getTypeVariantsWithCharacterValueNew(e,t)}))}static GetConceptByCharacterAndCategoryLocal(e,t){return p(this,void 0,void 0,(function*(){var n=(0,s.o)(),o=yield r.f.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 p(this,void 0,void 0,(function*(){if(a.Logger.logfunction("ConceptsData.GetConceptsByTypeIdAndUser",n),a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConceptsByTypeIdAndUser",{typeId:e,userId:t})).data}catch(e){console.error("Concept Data, Get Concpet sw error:",e),(0,a.handleServiceWorkerException)(e)}let o=[];return o=yield c.c.getTypeVariantsFromTreeWithUserIdNew(e,t),o}))}static GetBinaryCharacterTree(){return r.f.characterRoot}getName(){return this.name}}f.conceptsArray=[],f.NPC=[],f.conceptDictionary=[]},2155:(e,t,n)=>{n.d(t,{N:()=>r});var o=n(7282),i=n(9581);class r{constructor(e=0,t,n,r,c,s,a){this.count=0,this.isTemp=!1,this.toUpdate=!1,this.applicationId=i.B.getRandomizer(),this.type=(0,o.o)(),this.ofConcept=(0,o.o)(),this.toConcept=(0,o.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.userId=r,this.typeId=c,this.ghostId=e,this.orderId=s,this.accessId=a,this.entryTimeStamp=(0,o.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date,this.typeCharacter=""}}},5239:(e,t,n)=>{n.d(t,{O:()=>s});var o=n(205),i=n(5983);class r{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 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(0,i.dispatchIdEvent)(e.value.ofTheConceptId),e;let o=t.leftNode,r=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,r,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let c=this.getBalanceFactor(t);if(c>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(c<-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){if(0!=e.value.typeId){if(null==t)return 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)}}}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 console.log("this is the error in right rotation",e,t),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 console.log("this is the error in left rotation",e,t),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(n){console.log("this is the exception",e,t,null==t?void 0:t.leftNode,null==t?void 0:t.rightNode)}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;if(new Event(`${e.value.ofTheConceptId}`),(0,i.dispatchIdEvent)(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 c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class s{static addNodeToTree(e){try{if(null==this.connectionroot)return this.connectionroot=e,this.connectionroot;this.connectionroot=this.connectionroot.addNode(e,this.connectionroot,this.connectionroot.height)}catch(e){throw console.log("This is the error in making the tree",e),e}}static addConnectionToTree(e){let t=new r(e.id,e,null,null);this.addNodeToTree(t)}static traverse(){var e;return null===(e=this.connectionroot)||void 0===e?void 0:e.traverse(this.connectionroot)}static waitForDataToLoad(){return c(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isConnectionLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static removeNodeFromTree(e){return c(this,void 0,void 0,(function*(){this.connectionroot&&(this.connectionroot=this.connectionroot.removeNode(this.connectionroot,e))}))}static getNodeFromTree(e){return c(this,void 0,void 0,(function*(){try{return this.connectionroot?this.connectionroot.getFromNode(e,this.connectionroot):this.connectionroot}catch(t){console.log("this is the getNodeFromTree",e,this.connectionroot)}}))}static getConnectionListFromIds(e,t,n){return c(this,void 0,void 0,(function*(){this.connectionroot&&this.connectionroot.checkIfIdsInNode(this.connectionroot,e,t,n)}))}}s.connectionroot=null},991:(e,t,n)=>{n.d(t,{H:()=>s});var o=n(5983),i=n(3996);class r extends i.i{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 c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class s{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 r(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new r(t,n,null,null);this.addNodeToTree(o)}new Event(`${t}`)}else console.log("cannot insert key id with n 0 to the connection tree",e)}static addNodeToTree(e){return c(this,void 0,void 0,(function*(){return null==this.node?(this.node=e,console.log("this is type dispatch in connection",e),(0,o.dispatchIdEvent)(e.key),this.node):(this.node=this.node.addNode(e,this.node,this.node.height),this.node)}))}static removeNodeFromTree(e){return c(this,void 0,void 0,(function*(){this.node&&(this.node=this.node.removeNode(this.node,e))}))}}s.node=null},3996:(e,t,n)=>{n.d(t,{i:()=>o});class o{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}}},8286:(e,t,n)=>{n.d(t,{d:()=>f});var o=n(1735),i=n(5983),r=n(3655),c=n(1863),s=n(2155),a=n(5239),l=n(991),d=n(3996);class h extends d.i{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(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}}class u{static CreateCompositionKey(e){return e}static addNodeToTree(e){return t=this,n=void 0,i=function*(){return null==this.connectionTypeRoot?(this.connectionTypeRoot=e,this.connectionTypeRoot):(this.connectionTypeRoot=this.connectionTypeRoot.addNode(e,this.connectionTypeRoot,this.connectionTypeRoot.height),this.connectionTypeRoot)},new((o=void 0)||(o=Promise))((function(e,r){function c(e){try{a(i.next(e))}catch(e){r(e)}}function s(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(c,s)}a((i=i.apply(t,n||[])).next())}));var t,n,o,i}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 h(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new h(t,n,null,null);this.addNodeToTree(o)}}else console.log("cannot insert key id with n 0 to the connection tree",e)}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}}u.connectionTypeRoot=null;var p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class f{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){(0,r.kH)("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{a.O.addConnectionToTree(e),u.addConnectionToTree(e),l.H.addConnection(e)}catch(e){throw console.log("this is the error in making the connection"),e}}static AddConnectionToMemory(e){e.isTemp||(a.O.addConnectionToTree(e),u.addConnectionToTree(e),l.H.addConnection(e))}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){0!=e.id&&((0,r.wh)("connection",e.id),a.O.removeNodeFromTree(e.id),l.H.removeNodeFromTree(e.id))}static GetConnectionTypeOfTree(){l.H.node}static GetConnectionByOfTheConceptAndType(e,t){return p(this,void 0,void 0,(function*(){try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionByOfTheConceptAndType",{ofTheConceptId:e,typeId:t})).data}catch(e){console.error("GetConnectionByOfTheConceptAndType sw error: ",e),(0,i.handleServiceWorkerException)(e)}return l.H.GetConnectionByOfTheConceptAndTypeId(e,t)||[]}catch(e){return console.log("this is the error in GetConnectionByOfTheConceptAndType",e),[]}}))}static GetConnectionByOfType(e,t){const n=i.Logger.logfunction("ConnectionData.GetConnectionByOfType",arguments);let o=u.GetConnectionByOfTheConceptAndTypeId(e,t);return o?(i.Logger.logUpdate(n),o):(i.Logger.logUpdate(n),[])}static GetConnectionTree(){return a.O.connectionroot}static GetConnectionTypeTree(){return u.connectionTypeRoot}static GetConnectionBulkData(e,t,n){return p(this,void 0,void 0,(function*(){yield a.O.getConnectionListFromIds(e,t,n)}))}static GetConnection(e){return p(this,void 0,void 0,(function*(){o.J.incrementConnection(e);let t=new s.N(0,0,0,0,0,0,0);try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnection",{id:e})).data}catch(e){console.error("GetConnection sw error: ",e),(0,i.handleServiceWorkerException)(e)}let n=yield a.O.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}return t}catch(e){return console.log("this is the error in GetConnection",e),t}}))}static GetConnectionsOfCompositionLocal(e){var t=arguments;return p(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("ConnectionData.GetConnectionsOfCompositionLocal",t)||{};let o=[];try{if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfCompositionLocal",{id:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionsOfCompositionLocal sw error: ",e),(0,c.ey)(n,"GetConnectionsOfCompositionLocal",e),(0,i.handleServiceWorkerException)(e)}}let t=[];t=f.GetConnectionByOfType(e,e);for(let e=0;e<t.length;e++){let r=yield a.O.getNodeFromTree(t[e]);r&&o.push(r.value),i.Logger.logUpdate(n)}}catch(t){console.log("this is the error GetConnectionsOfCompositionLocal",e,o),(0,c.ey)(n,"ConnectionData.GetConnectionsOfCompositionLocal",t)}return o}))}static GetConnectionsOfConcept(e){return p(this,void 0,void 0,(function*(){let t=[],n=[];try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfConcept",{id:e})).data}catch(e){console.error("GetConnectionsOfConcept sw error: ",e),(0,i.handleServiceWorkerException)(e)}t=yield f.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<t.length;e++){let o=yield a.O.getNodeFromTree(t[e]);o&&n.push(o.value)}return n}catch(e){return console.log("this is the error in GetConnectionsOfConcept",e),n}}))}getName(){return this.name}}f.deletedConnections=[],f.connectionArray=[],f.connectionDictionary=[]},205:(e,t,n)=>{n.d(t,{B:()=>o});class o{}o.isTypeLoaded=!1,o.isCharacterLoaded=!1,o.isDataLoaded=!1,o.isLocalDataLoaded=!1,o.isLocalCharacterLoaded=!1,o.isLocalTypeLoaded=!1,o.isConnectionLoaded=!1,o.isConnectionTypeLoaded=!1,o.isLocalConnectionLoaded=!1},2515:(e,t,n)=>{n.d(t,{x:()=>o});class o{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 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 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){if(""!=e.value.characterValue){if(null==t)return e;var 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)}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return e;var 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)}}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}}},9736:(e,t,n)=>{n.d(t,{v:()=>C});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class c{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 i.x(e.id,e,null,null);new i.x(e.characterValue,e,null,null),this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(c.checkFlag,1e3,e)}static getNodeFromTree(e){return r(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 r(this,void 0,void 0,(function*(){this.root&&(this.root=this.root.removeNode(this.root,e))}))}}c.root=null;var s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class a{static waitForDataToLoad(){return s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalCharacterLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addNodeToTree(e){return s(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 i.x(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 s(this,void 0,void 0,(function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndType(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot}))}static getCharacterAndCategoryFromTree(e,t){return s(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))}}a.LocalCharacterRoot=null;var l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class d{static addNodeToTree(e){return l(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 i.x(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 l(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalTypeLoaded)return e("done");setTimeout(d.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserId(e,t){return l(this,void 0,void 0,(function*(){var n=[],o=this.getNodeFromTree(e);if(o){console.log("this is the node to type",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}))}}d.LocalTypeRoot=null;var h=n(6416),u=n(3026),p=n(7820),f=n(4864),y=n(628),v=n(5983),g=n(3278),m=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class C{constructor(){this.name="conceptsArray"}static AddConcept(e){0!=e.id&&(c.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e),this.localconceptsArray.push(e))}static AddPermanentConcept(e){0!=e.id&&(c.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId),p.G.addConceptToTree(e),u.I.AddConcept(e),(0,v.AddGhostConcept)(e,e.userId,g.b.sessionId))}static RemoveConcept(e){return m(this,void 0,void 0,(function*(){try{0!=e.id&&(c.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId))}catch(e){throw e}}))}static RemoveConceptById(e){return m(this,void 0,void 0,(function*(){try{let t=yield C.GetConcept(e);0!=t.id&&(c.removeNodeFromTree(e),a.removeConceptType(t.characterValue,t.ghostId),d.removeConceptType(t.typeId,t.ghostId),y.H.RemoveConcept(t))}catch(e){throw e}}))}static AddConceptToMemory(e){0!=e.id&&(c.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e))}static GetConcept(e){return m(this,void 0,void 0,(function*(){var t=(0,h.u)(),n=yield c.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t}))}static UpdateConceptSyncStatus(e){return m(this,void 0,void 0,(function*(){c.updateSyncStatus(e)}))}static GetConceptByGhostId(e){return m(this,void 0,void 0,(function*(){var t=(0,h.u)(),n=yield p.G.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t}))}static GetConceptByCharacter(e){return m(this,void 0,void 0,(function*(){var t=(0,h.u)(),n=a.getNodeFromTree(e);return n&&(t=n.value),t}))}static GetConceptByCharacterAndTypeLocal(e,t){return m(this,void 0,void 0,(function*(){var n=(0,h.u)(),o=yield a.getCharacterAndTypeFromTree(e,t);return o&&(n=o.value),n}))}static GetConceptByCharacterAndCategoryLocal(e,t){return m(this,void 0,void 0,(function*(){var n=(0,h.u)(),o=yield a.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 m(this,void 0,void 0,(function*(){let n=[];return n=yield d.getTypeVariantsFromTreeWithUserId(e,t),n}))}static ClearData(){return m(this,void 0,void 0,(function*(){this.localconceptsArray=[],f.G.connectionArray=[]}))}getName(){return this.name}}C.localconceptsArray=[]},4864:(e,t,n)=>{n.d(t,{G:()=>a});var o=n(2155),i=n(8286),r=n(205),c=n(628),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class a{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);c.H.RemoveConnectionById(e)}static AddPermanentConnection(e){e.id>0&&i.d.AddConnection(function(e){let t=new o.N(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 s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isLocalConnectionLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static GetConnectionsOfCompositionLocal(e){return s(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 s(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}}a.connectionArray=[],a.connectionDictionary=[]},7820:(e,t,n)=>{n.d(t,{G:()=>c});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class c{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 i.x(e.ghostId,e,null,null);this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(c.checkFlag,1e3,e)}static getNodeFromTree(e){return r(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return r(this,void 0,void 0,(function*(){this.root&&(this.root=this.root.removeNode(this.root,e))}))}}c.root=null},5257:(e,t,n)=>{n.d(t,{R:()=>c});var o=n(9003),i=n(3075),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class c{static AddConceptId(e){this.localId=e.value,(0,o.kH)("localid",e)}static getConceptId(){return r(this,void 0,void 0,(function*(){try{if(this.localId){if(this.ReservedLocalId.length<5){yield(0,i.EO)().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=>(console.log(" getid: cannot get the id from indexdb"),-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(0,i.EO)().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 console.log(" getid: this is the eror in concept",e),-Math.floor(1e8*Math.random())}}))}static AddConnectionId(e){this.localConnectionId=e.value}static getConnectionId(){return r(this,void 0,void 0,(function*(){try{if(this.localConnectionId){if(this.ReservedConnectionId.length<5){yield(0,i.xd)().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=>(console.log("this is the new event",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(0,i.xd)().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())}}))}}c.ReservedLocalId=[],c.ReservedConnectionId=[]},628:(e,t,n)=>{n.d(t,{H:()=>y});var o=n(9581),i=n(3278),r=n(5983),c=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};const a=(e,t)=>s(void 0,void 0,void 0,(function*(){let n={concepts:[],connections:[]};try{const r=new Headers;let s={concepts:e,connections:t};r.set("Content-Type","application/json"),r.set("Authorization","Bearer "+i.b.BearerAccessToken),r.set("Accept","application/json"),r.set("Randomizer",o.B.getRandomizer().toString());const a=yield fetch(o.B.CreateGhostConceptApiUrl(),{method:"POST",headers:r,body:JSON.stringify(s)});if(!a.ok)throw(0,c.ry)(a),new Error(`Error! status: ${a.status}`);const l=yield a.json();return n.concepts=l.concepts,n.connections=l.connections,n}catch(e){throw e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),e}}));function l(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 d=(...e)=>s(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 h=n(9003),u=n(9736),p=n(4864),f=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class y{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!=y.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 SyncDataOnline(e,t){return f(this,void 0,void 0,(function*(){let n=performance.now();console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker),setTimeout((()=>{console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker)}),5e3);try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__SyncDataOnline",{transactionId:e})).data}catch(e){console.error("LocalSyncData__SyncDataOnline sw error: ",e),(0,r.handleServiceWorkerException)(e)}let n=[],o=[];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;n=t.data.concepts.slice(),o=t.data.connections.slice()}else Array.isArray(null==t?void 0:t.concepts)&&Array.isArray(null==t?void 0:t.connections)?(console.log("this is the concepts and connections array",null==t?void 0:t.concepts,null==t?void 0:t.connections),n=t.concepts.slice(),o=t.connections.slice(),console.log("this is the concepts and connections array",n,o),this.conceptsSyncArray=this.conceptsSyncArray.filter((e=>{const n=t.concepts.some((t=>e.id==t.id||e.ghostId==t.ghostId));return n||console.warn(`Concept not found in sync array: ${e.id||e.ghostId}`),n})),this.connectionSyncArray=this.connectionSyncArray.filter((e=>{const n=t.connections.some((t=>e.id==t.id||e.ghostId==t.ghostId));return n||console.warn(`Connection not found in sync array: ${e.id||e.ghostId}`),n}))):(console.warn("Syncing this way has been Depreceted in service worker."),console.info("Only if serive worker is not running"),n=this.conceptsSyncArray.slice()||[],o=this.connectionSyncArray.slice()||[],this.connectionSyncArray=[],this.conceptsSyncArray=[]);let i=[];for(let e=0;e<n.length;e++)i.push(n[e]),yield u.v.UpdateConceptSyncStatus(n[e].id);yield this.UpdateConceptListToIncludeRelatedConcepts(o,i);let h=yield function(e,t){return s(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("CreateTheGhostConceptApi",[e.length,t.length]);try{const o=1e3;let i={concepts:[],connections:[]};const c=yield d(e),s=yield d(t);if(e.length+t.length<=2*o){const e=yield a(c,s);return Array.isArray(null==e?void 0:e.concepts)&&(i.concepts=[...i.concepts,...e.concepts]),Array.isArray(null==e?void 0:e.connections)&&(i.connections=[...i.connections,...e.connections]),r.Logger.logUpdate(n),i}const h=l(c,o),u=l(s,o),p=[],f=[];for(let e=0;e<h.length;e++){const t=h[e];p.push(a(t,[]))}const y=yield Promise.all(p);for(let e=0;e<y.length;e++){const t=y[e];Array.isArray(null==t?void 0:t.concepts)&&(i.concepts=[...i.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(i.connections=[...i.connections,...t.connections])}for(let e=0;e<u.length;e++){const t=u[e];f.push(a([],t))}const v=yield Promise.all(f);for(let e=0;e<v.length;e++){const t=v[e];Array.isArray(null==t?void 0:t.concepts)&&(i.concepts=[...i.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(i.connections=[...i.connections,...t.connections])}return r.Logger.logUpdate(n),i}catch(e){throw console.log(e),(0,c.ey)(n,"CreateTheGhostConceptApi",e),e}}))}(i,o),f=h.concepts,y=h.connections;for(let e=0;e<f.length;e++)u.v.AddPermanentConcept(f[e]);for(let e=0;e<y.length;e++)p.G.AddPermanentConnection(y[e]);return n}catch(e){throw r.Logger.logError(n,"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,c=e[i].toTheConceptId,s=e[i].typeId,a=null!==(t=y.ghostIdMap.get(r))&&void 0!==t?t:r,l=null!==(n=y.ghostIdMap.get(c))&&void 0!==n?n:c,d=null!==(o=y.ghostIdMap.get(s))&&void 0!==o?o:s;e[i].ofTheConceptId=a,e[i].toTheConceptId=l,e[i].typeId=d}}static UpdateConceptListToIncludeRelatedConcepts(e,t){return f(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 u.v.GetConceptByGhostId(o),0!=i.id?i.id!=i.ghostId&&(e[n].ofTheConceptId=i.id):(i=yield u.v.GetConcept(o),this.AddConceptIfDoesNotExist(i,t)))}if(i<0){let o=this.CheckIfTheConceptIdExists(i,t);0==o.id&&(o=yield u.v.GetConceptByGhostId(i),0!=o.id?o.id!=o.ghostId&&(e[n].toTheConceptId=o.id):(o=yield u.v.GetConcept(i),this.AddConceptIfDoesNotExist(o,t)))}if(r<0){let o=this.CheckIfTheConceptIdExists(r,t);0==o.id&&(o=yield u.v.GetConceptByGhostId(r),0!=o.id?o.id!=o.ghostId&&(e[n].typeId=o.id):(o=yield u.v.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=(0,r.CreateDefaultLConcept)();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 f(this,void 0,void 0,(function*(){if(this.conceptsSyncArray.length>0){for(let e=0;e<this.conceptsSyncArray.length;e++)(0,h.kH)("localconcept",this.conceptsSyncArray[e]);this.conceptsSyncArray=[]}if(this.connectionSyncArray.length>0){for(let e=0;e<this.connectionSyncArray.length;e++)(0,h.kH)("localconnection",this.connectionSyncArray[e]);this.connectionSyncArray=[]}return"done"}))}static initializeTransaction(e){return f(this,void 0,void 0,(function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__initializeTransaction",{transactionId:e})).data}catch(e){console.error("LocalSyncData__initializeTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some((t=>t.id==e)))return;this.transactionCollections.push({id:e,data:{concepts:[],connections:[]},createdDate:(new Date).toISOString()})}catch(e){console.log("error in initializeTransaction",e)}}))}static markTransactionActions(e,t){return f(this,void 0,void 0,(function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__markTransactionActions",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__markTransactionActions sw error: ",e),(0,r.handleServiceWorkerException)(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){console.log("error in markTransactionActions",e)}}))}static rollbackTransaction(e,t){return f(this,void 0,void 0,(function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__rollbackTransaction",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__rollbackTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some((t=>t.id==e)))return;this.transactionCollections=this.transactionCollections.filter((t=>t.id!=e))}catch(e){console.log("LocalSyncData, roll",e)}}))}}y.conceptsSyncArray=[],y.connectionSyncArray=[],y.ghostIdMap=new Map,y.transactionCollections=[]},6731:(e,t,n)=>{n.d(t,{b:()=>o});class o{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 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 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){if(""!=e.value.characterValue){if(null==t)return 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)}}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return console.log("adding the type node to the tree",e),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 console.log("adding the type node to the tree down",e),t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),console.log("adding the type node to the tree last",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)}}}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}}},5976:(e,t,n)=>{n.d(t,{p:()=>l,B:()=>a});var o=n(9581),i=n(3518),r=n(1863),c=n(5983),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class a{static getId(){return s(this,void 0,void 0,(function*(){this.ids.length<5&&(yield function(){var e,t,n,s,l=arguments;return e=this,t=void 0,s=function*(){const e=c.Logger.logfunction("GetReservedIds",l);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const s=yield n.json();for(let e=0;e<s.length;e++)a.AddId(s[e]);c.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved ids error message: ",t.message):console.log("get reserved ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedIdUrl()),(0,r.ey)(e,"GetReservedIds",t)}},new((n=void 0)||(n=Promise))((function(o,i){function r(e){try{a(s.next(e))}catch(e){i(e)}}function c(e){try{a(s.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,c)}a((s=s.apply(e,t||[])).next())}))}());var e=this.ids[0];return this.ids.shift(),e}))}static AddId(e){this.ids.includes(e)||this.ids.push(e)}}a.ids=[];class l{static getId(){return s(this,void 0,void 0,(function*(){this.connectionIds.length<5&&(yield function(){var e,t,n,s,a=arguments;return e=this,t=void 0,s=function*(){const e=c.Logger.logfunction("GetReservedConnectionIds",a);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedConnectionIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const s=yield n.json();for(let e=0;e<s.length;e++)l.AddId(s[e]);c.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved connection ids error message: ",t.message):console.log("get reserved connection ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedConnectionIdUrl()),(0,r.ey)(e,"GetReservedConnectionIds",t)}},new((n=void 0)||(n=Promise))((function(o,i){function r(e){try{a(s.next(e))}catch(e){i(e)}}function c(e){try{a(s.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,c)}a((s=s.apply(e,t||[])).next())}))}());var e=this.connectionIds[0];return this.connectionIds.shift(),e}))}static AddId(e){this.connectionIds.includes(e)||this.connectionIds.push(e)}}l.connectionIds=[]},7273:(e,t,n)=>{n.d(t,{z:()=>i});var o=n(9581);class i{constructor(e,t,n,i){this.url=o.B.BASE_URL,this.message=e,this.ok=t,this.status=n,this.data=i}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}}},3278:(e,t,n)=>{n.d(t,{b:()=>o});class o{}o.BearerAccessToken="",o.sessionId=998},2299:(e,t,n)=>{n.d(t,{B:()=>o});class o{constructor(e){this.id=1,this.isOnlineSync=!1,this.isOnlineSync=e}}},442:(e,t,n)=>{n.d(t,{Y:()=>h});var o=n(1167),i=n(2155),r=n(9581),c=n(3518),s=n(1863),a=n(3026),l=n(8286),d=n(5983);class h{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 e=this,t=void 0,h=function*(){if(d.serviceWorker)try{return(yield(0,d.sendMessage)("SyncData__SyncDataOnline",{})).data}catch(e){console.error("SyncData__SyncDataOnline sw error: ",e),(0,d.handleServiceWorkerException)(e)}for(let e=0;e<this.conceptsSyncArray.length;e++)a.I.AddConcept(this.conceptsSyncArray[e]);for(let e=0;e<this.connectionSyncArray.length;e++)l.d.AddConnection(this.connectionSyncArray[e]);if(this.conceptsSyncArray.length>0){let e=this.conceptsSyncArray.slice();this.conceptsSyncArray=[],(0,o.Y)(e)}if(this.connectionSyncArray.length>0){let e=this.connectionSyncArray.slice();this.connectionSyncArray=[],yield function(e){return t=this,n=void 0,a=function*(){let t=new i.N(0,0,0,0,0,0,0);try{var n=(0,c.Xr)(),o=JSON.stringify(e);const i=yield fetch(r.B.CreateTheConnectionUrl(),{method:"POST",headers:n,body:o});return i.ok?yield i.json():(console.log("Create the connection error message: ",i.status),(0,s.ry)(i)),t}catch(e){throw e instanceof Error?console.log("Create the connection error message: ",e.message):console.log(" Create the connection unexpected error: ",e),e}},new((o=void 0)||(o=Promise))((function(e,i){function r(e){try{s(a.next(e))}catch(e){i(e)}}function c(e){try{s(a.throw(e))}catch(e){i(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,c)}s((a=a.apply(t,n||[])).next())}));var t,n,o,a}(e)}return"done"},new((n=void 0)||(n=Promise))((function(o,i){function r(e){try{s(h.next(e))}catch(e){i(e)}}function c(e){try{s(h.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,c)}s((h=h.apply(e,t||[])).next())}));var e,t,n,h}}h.conceptsSyncArray=[],h.connectionSyncArray=[]},9003:(e,t,n)=>{n.d(t,{S5:()=>l,kH:()=>h,qI:()=>a});var o=n(1863),i=n(5983),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};let c=10;class s{}function a(e){const t=i.Logger.logfunction("openDatabase",arguments);return new Promise((function(n,r){s.db&&(i.Logger.logUpdate(t),n(s.db));let l=i.BaseUrl.BASE_URL+"_FreeSchemaLocal"+i.BaseUrl.BASE_APPLICATION;const h=indexedDB.open(l,c);h.onupgradeneeded=e=>{var t=e.target.result,o="localconcept",r="localconnection",s="localid";console.log("this is the version upgrade",c),t.objectStoreNames.contains(o)&&t.deleteObjectStore(o),t.objectStoreNames.contains(r)&&t.deleteObjectStore(r),t.objectStoreNames.contains(s)&&t.deleteObjectStore(s),t.objectStoreNames.contains(o)||(t.createObjectStore(o,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(r)||(t.createObjectStore(r,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(s)||(t.createObjectStore(s,{keyPath:"id"}).transaction.oncomplete=e=>{d(s,{id:0,value:-100}),d(s,{id:1,value:-200}),d(s,{id:3,value:i.BaseUrl.getRandomizer()})}),n(t)},h.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(l),a(e),(0,o.ey)(t,"openDatabase",n),r(n)},h.onsuccess=function(e){var o=e.target;s.db=o.result,i.Logger.logUpdate(t),n(s.db)}}))}function l(e){var t=arguments;return r(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("getObjectsFromLocalIndexDb",t);return new Promise((function(t,r){a(e).then((o=>{var r=[],c=o.transaction(e,"readwrite").objectStore(e).getAll();c.onsuccess=()=>{const e=c.result;for(var o=0;o<e.length;o++)r.push(e[o]);i.Logger.logUpdate(n),t(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot get objects from database because you cannot open the Local database",data:e};(0,o.ey)(n,"getObjectsFromLocalIndexDb",t),r(t)}))}))}))}function d(e,t){const n=i.Logger.logfunction("storeToDatabase",[e,"localindexdb"]);return new Promise((function(r,c){a(e).then((s=>{const a=s.transaction(e,"readwrite").objectStore(e).add(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot store to the Local database "+e,data:i,body:t};(0,o.ey)(n,"storeToDatabase",r),c(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot store to database because you cannot open the Local database",data:e};(0,o.ey)(n,"storeToDatabase",t),c(t)}))}))}function h(e,t){const n=i.Logger.logfunction("UpdateToDatabase",arguments);return new Promise((function(r,c){a(e).then((s=>{const a=s.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot Update to the Local database"+e,data:i,body:t};(0,o.ey)(n,"UpdateToDatabase",r),c(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the Local database",data:e};(0,o.ey)(n,"UpdateToDatabase",t),c(t)}))}))}},3655:(e,t,n)=>{n.d(t,{El:()=>u,b8:()=>h,kH:()=>d,qI:()=>l,wh:()=>p});var o=n(2299),i=n(9581),r=n(5983),c=n(1863);let s=10;class a{}function l(e){const t=r.Logger.logfunction("openDatabase",[e,"indexdb"]);return new Promise((function(n,o){a.db&&(r.Logger.logUpdate(t),n(a.db));let d=i.B.BASE_URL+"_FreeSchema"+i.B.BASE_APPLICATION;const h=indexedDB.open(d,s);console.log("this is the update version",s,h),h.onupgradeneeded=e=>{let o=e.target.result,i="concept",c="connection",a="settings";console.log("this is the version update for index",s),o.objectStoreNames.contains(i)&&o.deleteObjectStore(i),o.objectStoreNames.contains(c)&&o.deleteObjectStore(c),o.objectStoreNames.contains(a)&&o.deleteObjectStore(a),o.objectStoreNames.contains(i)||(o.createObjectStore(i,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(c)||(o.createObjectStore(c,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(a)||(o.createObjectStore(a,{keyPath:"id"}).transaction.oncomplete=e=>{}),r.Logger.logUpdate(t),n(o)},h.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(d),l(e),(0,c.ey)(t,"openDatabase",n),o(n)},h.onsuccess=function(e){let o=e.target;a.db=o.result,r.Logger.logUpdate(t),n(a.db)}}))}function d(e,t){const n=r.Logger.logfunction("UpdateToDatabase",[e,"indexdb"]);return new Promise((function(o,i){l(e).then((s=>{const a=s.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{r.Logger.logUpdate(n),o(t)},a.onerror=o=>{let r={status:400,ok:!1,message:"Cannot Update to the database"+e,data:o,body:t};(0,c.ey)(n,"UpdateToDatabase",r),i(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the database",data:e};(0,c.ey)(n,"UpdateToDatabase",t),i(t)}))}))}function h(){const e=r.Logger.logfunction("GetLastSettingsFromDatabase",["indexdb"]);return new Promise((function(t,n){let i="settings";l(i).then((s=>{let a=s.transaction(i,"readwrite").objectStore(i).getAll();a.onsuccess=()=>{let n=new o.B(!1),i=a.result;for(let e=0;e<i.length;e++)n=i[e];r.Logger.logUpdate(e),t(n)},a.onerror=t=>{(0,c.ey)(e,"GetLastSettingsFromDatabase",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};(0,c.ey)(e,"GetLastSettingsFromDatabase",o),n(o)}))}))}function u(e){const t=r.Logger.logfunction("AiUpdateFlag",["indexdb"]);return new Promise((function(n,o){let i="settings";l(i).then((s=>{const a=s.transaction(i,"readwrite").objectStore(i).put(e);a.onsuccess=o=>{r.Logger.logUpdate(t),n(e)},a.onerror=n=>{let i={status:400,ok:!1,message:"Cannot update AI flag",data:n,body:e};(0,c.ey)(t,"AiUpdateFlag",i),o(i)}})).catch((e=>{let n={status:400,ok:!1,message:"Cannot update AI flag because you cannot open the database",data:e};(0,c.ey)(t,"AiUpdateFlag",n),o(n)}))}))}function p(e,t){const n=r.Logger.logfunction("removeFromDatabase",[e,"indexdb"]);return new Promise((function(o,i){l(e).then((s=>{const a=s.transaction(e,"readwrite").objectStore(e).delete(Number(t));a.onsuccess=function(e){r.Logger.logUpdate(n),o(t)},a.onerror=t=>{let o={status:400,ok:!1,message:"Cannot remove from the database"+e,data:t};(0,c.ey)(n,"removeFromDatabase",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};(0,c.ey)(n,"removeFromDatabase",o),i(o)}))}))}},4485:(e,t,n)=>{function o(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 c=null===(o=e[n].type)||void 0===o?void 0:o.characterValue;(null==c?void 0:c.startsWith("the_"))||(c="the_"+c),t.typeId!=e[n].typeId&&r!=c||i.push(e[n])}return i}function i(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 r(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 c(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}n.d(t,{gt:()=>c,nm:()=>i,vo:()=>o,wS:()=>r}),n(2155),n(7282)},9934:(e,t,n)=>{function o(e,t){return-1===e.indexOf(t)&&e.push(t),e}n.d(t,{A:()=>o})},9700:(e,t,n)=>{n.d(t,{R:()=>d,V:()=>l});var o,i=n(5983),r=n(3278),c=n(1863),s=n(3518),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class l{static startAutoSync(){this.autoSyncInterval?console.warn("Auto-sync is already running."):(this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS,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){console.error("Error on Logger Log : ",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`,1==!e.serviceWorker&&(e.serviceWorker=!1)}catch(t){(0,c.ey)(e,"Logger.logUpdate",t)}}static logfunction(e,...t){if(!this.logPackageActivationStatus)return{};const n=Date.now();let o=t;const c=i.BaseUrl.getRandomizer(),s=r.b.sessionId;let a={startTime:n,functionName:e,functionParameters:o,requestFrom:i.BaseUrl.BASE_APPLICATION,sessionId:s,applicationId:c};return this.formatLogData("INFO","function called",a)}static logError(e,t,n,o,i,r,c,s,a,l,h){try{const u=d("SessionId"),p={startTime:e,userId:t,operationType:n,requestFrom:o,requestIP:i,responseStatus:r,responseTime:`${(performance.now()-e).toFixed(3)}ms`,responseSize:c?`${JSON.stringify(c).length}`:"0",sessionId:null==u?void 0:u.toString(),functionName:s,functionParameters:a,userAgent:l,conceptsUsed:h};this.formatLogData("ERROR",`Information logged for ${s}`,p)}catch(e){console.error("Error on logError")}}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)}catch(e){console.error("Failed to log application activity:",e)}}static sendApplicationLogsToServer(){return a(this,void 0,void 0,(function*(){const e=this.applicationLogsData;try{if(0===e.length)return;this.applicationLogsData=[],r.b.BearerAccessToken;const t=50;let n=(0,s.Xr)(),o=0;for(;0!=e.length;){const r=e.slice(0,t),c=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:n,body:JSON.stringify({logType:this.appLogs,logData:r})});c.ok||(yield c.text()),e.splice(0,t),o+=t,o++}}catch(e){}}))}static sendPackageLogsToServer(){return a(this,void 0,void 0,(function*(){const e=this.packageLogsData;try{if(0===e.length)return;this.packageLogsData=[];const t=300;let n=0;for(;0!=e.length;){const o=e.slice(0,t);let r=(0,s.Xr)();const c=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:r,body:JSON.stringify({logType:this.mftsccsBrowser,logData:o})});if(!c.ok)return void(yield c.text());e.splice(0,t),n++}}catch(e){}}))}static saveLogToLocalStorage(e,t){try{if(void 0===typeof localStorage)return void console.warn("Local Storage type undefined");{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){console.error("Error on saving log in localstorage"),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):console.warn("localStorage is not available")}}function d(e){try{let t=e+"=",n=decodeURIComponent(document.cookie).split(";");for(let e=0;e<n.length;e++){let o=n[e];for(;" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}catch(e){return console.error("Error on getcookie"),""}}o=l,l.logLevel="INFO",l.packageLogsData=[],l.applicationLogsData=[],l.LOG_LEVELS=["DEBUG","INFO","WARNING","ERROR"],l.SYNC_INTERVAL_MS=6e4,l.nextSyncTime=null,l.appLogs="app",l.mftsccsBrowser="mftsccs",l.logApplicationActivationStatus=!1,l.logPackageActivationStatus=!1,l.autoSyncInterval=null,o.startAutoSync()},1412:(e,t,n)=>{function o(e=[],t=[]){}n.d(t,{e:()=>o})},5898:(e,t,n)=>{n.d(t,{w:()=>s,V:()=>a});var o=n(7139),i=n(5983);class r{constructor(){this.conceptId=0,this.connectionTypeId=0,this.connectionType="",this.count=0}}var c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(e=[]){let t=[];if(e.length>0)for(let n=0;n<e.length;n++){let o=l(e[n]);t.push(o)}return t}function a(e){var t=arguments;return c(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("GetConnectionTypeForCount",t);let r={};for(let t=0;t<e.length;t++){let n=yield(0,o.r)(e[t].connectionTypeId);e[t].connectionType=n.characterValue,r[e[t].conceptId]=e[t]}return i.Logger.logUpdate(n),r}))}function l(e){const t=e.split("_");if(3===t.length){let e=new r;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.")}},1863:(e,t,n)=>{n.d(t,{ER:()=>c,Mb:()=>s,ey:()=>a,ry:()=>r});var o=n(5983),i=n(7273);function r(e){if(o.Logger.log("ERROR",e.statusText,{code:e.status,data:e.statusText}),401==e.status||406==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}if(500==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}}function c(e,t={}){if(o.Logger.log("ERROR",t.statusText,{code:e.status,data:e.status}),401==e.status||406==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}if(500==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}}function s(e,t=""){if(o.Logger.log("ERROR",e.message,{code:e.status,data:e.stack}),e.status){let n=new i.z(e.message,!1,e.status,e.stack);throw n.setUrl(t),n}{let n=new i.z(e.message,!1,500,e.stack);throw n.setUrl(t),n}}function a(e,t,n){var o;try{if(!e)return void console.error(`Error in ${t}: logData is undefined`);const i=Date.now();e.startTime=null!==(o=e.startTime)&&void 0!==o?o:i,e.responseTime=i-e.startTime+" ms",e.level="ERROR",e.errorMessage=(null==n?void 0:n.message)||"Unknown error occurred",console.error(`Error in function ${t}:`,n)}catch(e){console.error("Failed to handle package function error:",e)}}},1708:(e,t,n)=>{n.d(t,{Az:()=>u});var o=n(8146),i=n(3026),r=n(9581),c=n(3518),s=n(5983),a=n(1863),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function u(e){return h(this,void 0,void 0,(function*(){const t=s.Logger.logfunction("GetConceptByCharacterAndCategory",e);let n=(0,s.CreateDefaultConcept)();if("the"==e)return n.id=1,n.typeId=5,n.characterValue="the",n;let p=(0,s.SplitStrings)(e);if(p.length>1){let t=1,o=yield u(p[0]);0!=o.id&&(t=o.id),n=yield function(e,t){var n=arguments;return h(this,void 0,void 0,(function*(){const o=s.Logger.logfunction("GetConceptByCharacterAndCategoryFromMemory",n);let h=yield s.ConceptsData.GetConceptByCharacterAndCategoryLocal(e,t);return 0==h.id&&(h=yield function(e,t){var n=arguments;return d(this,void 0,void 0,(function*(){const o=s.Logger.logfunction("GetConceptByCharacterAndCategoryDirectApi",n);let d=(0,s.CreateDefaultConcept)();try{var h=(0,c.Xr)("application/x-www-form-urlencoded");const n=yield fetch(r.B.GetConceptByCharacterAndCategoryDirectUrl(),{method:"POST",headers:h,body:`character_value=${e}&category_id=${t}`});if(n.ok){let e=yield n.json();d=e,(0,l.K)(d).then((()=>{i.I.AddConcept(d)}))}else console.log("This is the concept by category and character error",n.status),(0,a.ry)(n);s.Logger.logUpdate(o)}catch(e){e instanceof Error?console.log(" This is the concept by category and character error message: ",e.message):console.log(" This is the concept by category and character unexpected error: ",e),(0,a.Mb)(e,r.B.GetConceptByCharacterAndCategoryDirectUrl()),(0,a.ey)(o,"GetConceptByCharacterAndCategoryDirectApi",e)}return d}))}(e,t)),s.Logger.logUpdate(o),h}))}(e,t)}else p[0]==e&&(n=yield function(e){var t=arguments;return h(this,void 0,void 0,(function*(){const n=s.Logger.logfunction("GetConceptByCharacter",t);let i=yield s.ConceptsData.GetConceptByCharacterAndTypeLocal(e,51);return 0==i.id&&(i=yield(0,o.Y)(e)),s.Logger.logUpdate(n),i}))}(e));return s.Logger.logUpdate(t),n}))}},176:(e,t,n)=>{n.d(t,{F4:()=>c,P6:()=>a,dp:()=>s});var o=n(2155),i=n(7282),r=n(6416);function c(e){var t,n;const o=(0,r.u)();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 s(e){const t=(0,i.o)();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 a(e){const t=new o.N(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}},5020:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(5983),i=n(3026),r=n(205),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(){return c(this,void 0,void 0,(function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++){let n=e[t];i.I.AddConceptToMemory(n)}r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0}catch(e){throw yield(0,o.DelayFunctionExecution)(2e3,s()),{message:"Cannot create Binary Tree Concept",ok:!1,status:400,data:e}}}))}},7282:(e,t,n)=>{n.d(t,{Y:()=>r,o:()=>i});var o=n(2615);function i(){let e=r(new Date),t=r(new Date);return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}function r(e){const t=e.getMonth()+1,n=e.getDate(),o=e.getFullYear();let i=e.getHours();const r=e.getMinutes(),c=e.getSeconds(),s=i>=12?"PM":"AM";i%=12,i=i||12;const a=e=>e.toString().padStart(2,"0");return`${t}/${n}/${o} ${i}:${a(r)}:${a(c)} ${s}`}},1218:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(5983),i=n(7282),r=n(1666),c=n(8407),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function a(e){return s(this,arguments,void 0,(function*(e,t=null,n=null,s=null,l=null,d=null,h=null){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("CreateTheComposition",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:s,userId:l,accessId:d,sessionInformationId:h})).data}catch(e){console.error("CreateTheComposition sw error: ",e),(0,o.handleServiceWorkerException)(e)}let u=null!=l?l:999,p=null!=d?d:4,f=null!=h?h:999,y=null!=s?s:0,v=(0,i.o)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=y,n=yield(0,c.A)(o,"",!0,u,p,f);v=n,t=n.id,y=n.id,yield a(e[o],n.id,n.userId,t,l,d,h)}else{let i=null!=t?t:999,s=null!=n?n:999,g=y,m=yield(0,c.A)(o,"",!0,u,p,f);v=m,yield(0,r.q)(i,s,m.id,g),yield a(e[o],m.id,m.userId,g,l,d,h)}else{let i=null!=t?t:999,s=null!=n?n:10267,a=y,l=yield(0,c.A)(o,e[o].toString(),!1,u,p,f);yield(0,r.q)(i,s,l.id,a)}return v}))}},2212:(e,t,n)=>{n.d(t,{Ay:()=>l,N:()=>d});var o=n(1167),i=n(2615),r=n(5976),c=n(442),s=n(5983),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function l(e,t,n,o,s,l,d){return a(this,void 0,void 0,(function*(){let a=yield r.B.getId(),h=new Date,u=new Date,p=new i.j(a,t,o,n,s,e,l,!0,h,u,d);return p.isTemp=!1,c.Y.AddConcept(p),p}))}function d(e,t,n,c,l,d,h){return a(this,void 0,void 0,(function*(){let a=yield r.B.getId(),u=new Date,p=new Date,f=new i.j(a,t,c,n,l,e,d,!1,u,p,h);return s.ConceptsData.AddConcept(f),(0,o.Y)([f]),f}))}},1666:(e,t,n)=>{n.d(t,{q:()=>c});var o=n(2155),i=n(442),r=n(1863);function c(e,t,n,c){var s=t,a=new o.N(0,e,n,s,c,1,4);if(e==n)return a.ofTheConceptId=0,a.toTheConceptId=1,a;try{a.isTemp=!0,a.id=Math.floor(1e8*Math.random()),i.Y.AddConnection(a)}catch(e){(0,r.Mb)(e)}return a}},4818:(e,t,n)=>{n.d(t,{m:()=>u,E:()=>p});var o=n(5983),i=n(1863),r=n(3518),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},s=n(9581),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},l=n(5239),d=n(4864),h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function u(e){var t=arguments;return h(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteConnectionById",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionById",{id:e})).data}catch(e){console.error("DeleteConnectionById sw error: ",e),(0,o.handleServiceWorkerException)(e)}let c=!0;return e>0?(c=yield function(e){var t=arguments;return a(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteTheConnection",t);let c=!1;try{const t=new FormData;t.append("id",e.toString());let a=(0,r.BZ)();const l=yield fetch(s.B.DeleteTheConnectionUrl(),{method:"POST",headers:a,body:t,redirect:"follow"});o.Logger.logUpdate(n),l.ok?c=(yield l.json()).success:(console.log("Delete connection error status: ",l.status),(0,i.ry)(l)),c&&o.ConnectionData.AddNpConn(e)}catch(e){e instanceof Error?console.log("Delete connection error message: ",e.message):console.log("Delete connection unexpected error: ",e),(0,i.Mb)(e,s.B.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnection",e)}return c}))}(e),l.O.removeNodeFromTree(e)):d.G.RemoveConnectionById(e),o.Logger.logUpdate(n),c}))}function p(e){var t=arguments;return h(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteConnectionByIdBulk",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionByIdBulk",{ids:e})).data}catch(e){console.error("DeleteConnectionByIdBulk sw error: ",e),(0,o.handleServiceWorkerException)(e)}let s=yield function(e){var t=arguments;return c(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteTheConnectionBulkApi",t);let c=!1;try{let t=(0,r.BZ)();t.append("Content-Type","application/json");const s=yield fetch(o.BaseUrl.DeleteTheConnectionBulkUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(o.Logger.logUpdate(n),s.ok?c=(yield s.json()).success:(console.log("Delete connection Bulk Api error status: ",s.status),(0,i.ry)(s)),c)for(let t=0;t<e.length;t++){let n=e[t];o.ConnectionData.AddNpConn(n)}}catch(e){e instanceof Error?console.log("Delete connection Bulk Api error message: ",e.message):console.log("Delete connection Bulk Api unexpected error: ",e),(0,i.Mb)(e,o.BaseUrl.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnectionBulkApi",e)}return c}))}(e);if(s)for(let t=0;t<e.length;t++){let n=e[t];n>0?l.O.removeNodeFromTree(n):d.G.RemoveConnectionById(n)}return o.Logger.logUpdate(n),s}))}},2289:(e,t,n)=>{n.d(t,{$S:()=>d,L0:()=>h,WC:()=>u});var o=n(8675),i=n(6058),r=n(5983),c=n(1863);n(3518);var s=n(1708),a=n(4818),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){const i=r.Logger.logfunction("DeleteConnectionByType",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByType",{id:e,linker:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByType sw error: ",e),(0,c.ey)(i,"DeleteConnectionByType",e),(0,r.handleServiceWorkerException)(e)}}let s=yield(0,o.l)(e);for(let e=0;e<s.length;e++)r.ConnectionData.AddConnection(s[e]);let a=yield r.ConnectionData.GetConnectionsOfConcept(e),l=yield(0,r.GetConceptByCharacter)(t),d=[];for(let e=0;e<a.length;e++)a[e].typeId==l.id&&d.push(a[e]);let h=!1;for(let e=0;e<d.length;e++)h=yield(0,r.DeleteConnectionById)(d[e].id);return r.Logger.logUpdate(i),h}))}function h(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){const i=r.Logger.logfunction("DeleteConnectionByTypeBulk",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByTypeBulk",{id:e,linkers:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByTypeBulk sw error: ",e),(0,c.ey)(i,"DeleteConnectionByTypeBulk",e),(0,r.handleServiceWorkerException)(e)}}let l=yield(0,o.l)(e);for(let e=0;e<l.length;e++)r.ConnectionData.AddConnection(l[e]);let d=yield r.ConnectionData.GetConnectionsOfConcept(e),h=[];for(let e=0;e<t.length;e++){let n=t[e],o=yield(0,s.Az)(n);h.push(o)}let u=[];console.log("this is all the connections for deleting taken",d,h,t);for(let e=0;e<d.length;e++)for(let t=0;t<h.length;t++)d[e].typeId==h[t].id&&u.push(d[e].id);return console.log("these are the to delete",u),r.Logger.logUpdate(i),yield(0,a.E)(u)}))}function u(e,t){return l(this,arguments,void 0,(function*(e,t,n=!1){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetAllTheConnectionsByTypeAndOfTheConcept",{id:e,linker:t,reverse:n})).data}catch(e){console.error("GetAllTheConnectionsByTypeAndOfTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let c=[];if(n){let n=yield(0,i.W)(e),o=yield(0,r.MakeTheTypeConceptApi)(t,999);for(let e=0;e<n.length;e++)n[e].typeId==o.id&&c.push(n[e])}else{let n=yield(0,o.l)(e);for(let e=0;e<n.length;e++)r.ConnectionData.AddConnection(n[e]);let i=yield r.ConnectionData.GetConnectionsOfConcept(e),s=yield(0,r.GetConceptByCharacter)(t);for(let e=0;e<i.length;e++)i[e].typeId==s.id&&c.push(i[e])}return c}))}},4364:(e,t,n)=>{n.d(t,{s:()=>c});var o=n(1239),i=n(5983),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function c(){return r(this,arguments,void 0,(function*(e=[]){const t=i.Logger.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(e[t].ofTheConceptId),n.includes(e[t].toTheConceptId)||n.push(e[t].toTheConceptId),n.includes(e[t].typeId)||n.push(e[t].typeId);yield(0,o.r)(n)}i.Logger.logUpdate(t)}))}},5284:(e,t,n)=>{n.d(t,{B:()=>s});var o=n(5983),i=n(8286),r=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(){return c(this,arguments,void 0,(function*(e=[]){const t=o.Logger.logfunction("FindConnectionsOfCompositionsBulkInMemory",[e.length])||{};let n=[];try{if(o.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,o.sendMessage)("FindConnectionsOfCompositionsBulkInMemory",{composition_ids:e});return o.Logger.logUpdate(t),n.data}catch(e){console.error("FindConnectionsOfCompositionsBulkInMemory sw error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),(0,o.handleServiceWorkerException)(e)}}for(let t=0;t<e.length;t++){let o=yield i.d.GetConnectionsOfConcept(e[t]);n.push(...o)}return o.Logger.logUpdate(t),n}catch(e){return console.error("FindConnectionsOfCompositionsBulkInMemory error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),n}}))}},8939:(e,t,n)=>{n.d(t,{$N:()=>w,$V:()=>u,Ez:()=>I,JA:()=>C,Mb:()=>y,Nj:()=>f,PT:()=>T,RW:()=>m,XI:()=>g,ay:()=>h,hL:()=>d,kx:()=>v,re:()=>p,yz:()=>k,zN:()=>L});var o=n(7139),i=n(2),r=n(3026),c=n(8286),s=n(5983),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e){return l(this,void 0,void 0,(function*(){let t={connectionList:[],compositionList:[]};try{if(s.serviceWorker)try{return(yield(0,s.sendMessage)("GetCompositionById",{id:e})).data}catch(e){console.error("GetCompositionById error sw: ",e),(0,s.handleServiceWorkerException)(e)}let n=yield(0,i.s)(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 console.error("GetCompositionById error: ",e),t}}))}function h(e,t,n){return l(this,void 0,void 0,(function*(){var i,c;let s={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield L(e,t,n);return s[null!==(c=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==c?c:""]=l,s}))}function u(e,t,n){return l(this,void 0,void 0,(function*(){var i,c;let s={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield L(e,t,n);s[null!==(c=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==c?c:""]=l;let d={};return d.created_at=a.entryTimeStamp,d.data=s,d.id=e,d}))}function p(e,t,n){return l(this,void 0,void 0,(function*(){var i,c;let s={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield A(a,t,n);return s[null!==(c=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==c?c:""]=l,s}))}function f(e){return l(this,void 0,void 0,(function*(){var t,n;if(s.serviceWorker)try{return(yield(0,s.sendMessage)("GetComposition",{id:e})).data}catch(e){console.error("GetComposition error sw: ",e),(0,s.handleServiceWorkerException)(e)}let c=[],a={};c=yield(0,i.s)(e);let l=[];for(let e=0;e<c.length;e++)l.includes(c[e].ofTheConceptId)||l.push(c[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let h=yield L(e,c,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=h,a}))}function y(e){return l(this,void 0,void 0,(function*(){var t,n;let c=[],s={};c=yield(0,i.s)(e);let a=[];for(let e=0;e<c.length;e++)a.includes(c[e].ofTheConceptId)||a.push(c[e].ofTheConceptId);let l=yield r.I.GetConcept(e);0==l.id&&null!=e&&null!=e&&(l=yield(0,o.r)(e));let d=yield S(e,c,a);return s[null!==(n=null===(t=null==l?void 0:l.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=d,s}))}function v(e){return l(this,void 0,void 0,(function*(){var t,n;if(s.serviceWorker)try{return(yield(0,s.sendMessage)("GetCompositionFromMemory",{id:e})).data}catch(e){console.error("GetCompositionFromMemory error sw: ",e),(0,s.handleServiceWorkerException)(e)}let i=[],a={};i=yield c.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let h=yield N(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=h,a}))}function g(e){return l(this,void 0,void 0,(function*(){var t,n;if(s.serviceWorker)try{return(yield(0,s.sendMessage)("GetCompositionFromMemoryNormal",{id:e})).data}catch(e){console.error("GetCompositionFromMemoryNormal error sw: ",e),(0,s.handleServiceWorkerException)(e)}let i=[],a={};i=yield c.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let h=yield A(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=h,a}))}function m(e){var t=arguments;return l(this,void 0,void 0,(function*(){var n,i;const l=s.Logger.logfunction("GetCompositionWithIdFromMemory",t)||{};if(s.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,s.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return s.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",e),(0,s.handleServiceWorkerException)(e)}}let d={},h=[],u={};try{h=yield c.d.GetConnectionsOfCompositionLocal(e);let t=[];for(let e=0;e<h.length;e++)t.includes(h[e].ofTheConceptId)||t.push(h[e].ofTheConceptId);let s=yield r.I.GetConcept(e);0==s.id&&null!=e&&null!=e&&(s=yield(0,o.r)(e));let a=yield N(s,h,t);u[null!==(i=null===(n=null==s?void 0:s.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=a,d.created_at=s.entryTimeStamp,d.data=u,d.id=e}catch(t){console.log("this is the exception in GetCompositionWithIdFromMemory",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",t)}return s.Logger.logUpdate(l),d}))}function C(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){var i,c;const l=s.Logger.logfunction("GetCompositionFromMemoryWithConnections",n)||{};if(s.serviceWorker){l.serviceWorker=!0;try{const n=yield(0,s.sendMessage)("GetCompositionFromMemoryWithConnections",{id:e,connectionList:t});return s.Logger.logUpdate(l),n.data}catch(e){console.error("GetCompositionFromMemoryWithConnections error sw: ",e),(0,a.ey)(l,"GetCompositionFromMemoryWithConnections",e),(0,s.handleServiceWorkerException)(e)}}let d={},h=[];for(let e=0;e<t.length;e++)h.includes(t[e].ofTheConceptId)||h.push(t[e].ofTheConceptId);let u=yield r.I.GetConcept(e);0==u.id&&null!=e&&null!=e&&(u=yield(0,o.r)(e));let p=yield N(u,t,h);d[null!==(c=null===(i=null==u?void 0:u.type)||void 0===i?void 0:i.characterValue)&&void 0!==c?c:""]=p;let f={};return f.created_at=u.entryTimeStamp,f.data=d,f.id=e,s.Logger.logUpdate(l),f}))}function T(e,t){return l(this,void 0,void 0,(function*(){var n,i;const c=s.Logger.logfunction("GetCompositionWithIdFromMemoryFromConnection",[e])||{};if(s.serviceWorker){c.serviceWorker=!0;try{const t=yield(0,s.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return s.Logger.logUpdate(c),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(c,"GetCompositionWithIdFromMemoryFromConnection",e),(0,s.handleServiceWorkerException)(e)}}let l={},d=[];for(let e=0;e<t.length;e++)d.includes(t[e].ofTheConceptId)||d.push(t[e].ofTheConceptId);let h=yield r.I.GetConcept(e);0==h.id&&null!=e&&null!=e&&(h=yield(0,o.r)(e));let u=yield N(h,t,d);l[null!==(i=null===(n=null==h?void 0:h.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=u;let p={};return p.created_at=h.entryTimeStamp,p.data=l,p.id=e,s.Logger.logUpdate(c),p}))}function w(e){return l(this,void 0,void 0,(function*(){var t;if(s.serviceWorker)try{return(yield(0,s.sendMessage)("GetCompositionWithIdFromMemoryNew",{id:e})).data}catch(e){console.error("GetCompositionWithIdFromMemoryNew error sw: ",e),(0,s.handleServiceWorkerException)(e)}let n=[],i={};n=yield c.d.GetConnectionsOfCompositionLocal(e);let a=[];for(let e=0;e<n.length;e++)a.includes(n[e].ofTheConceptId)||a.push(n[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(console.log("this concept you cannot find ",e),d=yield(0,o.r)(e)),(new Date).getTime();let h=yield function(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){var i,r,c,a,l,d,h,u;let p={},f=e.id,y=((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(f)){let t=y;return{[t]:null==e?void 0:e.characterValue}}if(o.includes(f))return"";o.push(f);for(let e=0;e<t.length;e++){let n=yield(0,s.GetTheConcept)(t[e].ofTheConceptId),o=yield(0,s.GetTheConcept)(t[e].toTheConceptId);t[e].ofConcept=n,t[e].toConcept=o;let i=n.id,r="the_",l=(null!==(a=null===(c=null==o?void 0:o.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(r,"");null!=p[i]&&null!=p[i]||(p[i]={}),p[i][l]=o.characterValue}let v={};for(let e=0;e<t.length;e++){let n=t[e].ofConcept,o=t[e].toConcept,i=null!==(d=null===(l=null==n?void 0:n.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"",r="the_",c=(null!==(u=null===(h=null==o?void 0:o.type)||void 0===h?void 0:h.characterValue)&&void 0!==u?u:"").replace(r,"");null!=v[n.id]&&null!=v[n.id]||(v[n.id]={});let s=v[n.id];null!=s[i]&&null!=s[i]||(s[i]={}),null!=p[t[e].ofTheConceptId]&&null!=p[t[e].toTheConceptId]?s[i][c]=p[o.id]:s[i][c]=o.characterValue}return v[e.id]}))}(d,n,a);null===(t=null==d?void 0:d.type)||void 0===t||t.characterValue,i=h;let u={};return u.created_at=d.entryTimeStamp,u.data=i,u.id=e,u}))}function I(e){return l(this,void 0,void 0,(function*(){var t,n;if(s.serviceWorker)try{return(yield(0,s.sendMessage)("GetCompositionWithIdAndDateFromMemory",{id:e})).data}catch(e){console.error("GetCompositionWithIdAndDateFromMemory error sw: ",e),(0,s.handleServiceWorkerException)(e)}let i=[],a={};i=yield c.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let h=yield L(e,i,l);a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=h;let u={};return u.data=a,u.id=e,u.created_at=d.entryTimeStamp,u}))}function k(e){var t=arguments;return l(this,void 0,void 0,(function*(){var n,c;const l=s.Logger.logfunction("GetCompositionWithId",t)||{};if(s.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,s.sendMessage)("GetCompositionWithId",{id:e});return s.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithId error sw: ",e),(0,a.ey)(l,"GetCompositionWithId",e),(0,s.handleServiceWorkerException)(e)}}let d=[],h={};d=yield(0,i.s)(e);let u=[];for(let e=0;e<d.length;e++)u.includes(d[e].ofTheConceptId)||u.push(d[e].ofTheConceptId);let p=yield r.I.GetConcept(e);0==p.id&&null!=e&&null!=e&&(p=yield(0,o.r)(e));let f=yield L(e,d,u);h[null!==(c=null===(n=null==p?void 0:p.type)||void 0===n?void 0:n.characterValue)&&void 0!==c?c:""]=f;let y={};return y.data=h,y.id=e,s.Logger.logUpdate(l),y}))}function N(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var c,s,a;let l={},d=[],h=e.id;if(null===(c=null==e?void 0:e.type)||void 0===c?void 0:c.characterValue,!n.includes(h))return null==e?void 0:e.characterValue;if(i.includes(h))return"";i.push(h);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==h)if(h!=t[e].toTheConceptId){let c=t[e].toTheConceptId,h=yield r.I.GetConcept(c);if(null!=h&&0!=h.id||null==c||null==c||(h=yield(0,o.r)(c)),0!=h.id&&null==(null==h?void 0:h.type)){let e=h.typeId,t=yield r.I.GetConcept(e);h.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),h.type=t)}let u="the_",p=(null!==(a=null===(s=null==h?void 0:h.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(u,"");if(isNaN(Number(p))){if(p){const e=yield N(h,t,n,i);l[p]=e}}else{const e=yield N(h,t,n,i);d[p]=e,l=d}}else console.log("this is the faulty connection ",t[e]);return l}))}function A(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var c,a,l;const d=s.Logger.logfunction("recursiveFetchConceptNormal",[e]);(new Date).getTime();let h={},u=[],p=e.id;if(h.id=p,null===(c=null==e?void 0:e.type)||void 0===c?void 0:c.characterValue,!n.includes(p))return null==e?void 0:e.characterValue;if(i.includes(p))return"";i.push(p);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==p)if(p!=t[e].toTheConceptId){let c=t[e].toTheConceptId,s=yield r.I.GetConcept(c);if(null!=s&&0!=s.id||null==c||null==c||(s=yield(0,o.r)(c)),0!=s.id&&null==(null==s?void 0:s.type)){let e=s.typeId,t=yield r.I.GetConcept(e);s.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),s.type=t)}let d="the_",p=(null!==(l=null===(a=null==s?void 0:s.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"").replace(d,"");if(isNaN(Number(p))){if(p){const e=yield N(s,t,n,i);h[p]=e}}else{const e=yield N(s,t,n,i);u[p]=e,h=u}}else console.log("this is the faulty connection ",t[e]);return s.Logger.logUpdate(d),h}))}function L(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var c,s,a;let l={},d=[];if(0==e)return null;let h=yield r.I.GetConcept(e);if(null!=h&&0!=h.id||null==e||null==e||(h=yield(0,o.r)(e)),0!=h.id&&null==h.type){let e=h.typeId,t=yield r.I.GetConcept(e);h.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),h.type=t)}if(null===(c=null==h?void 0:h.type)||void 0===c?void 0:c.characterValue,!n.includes(e))return null==h?void 0:h.characterValue;if(i.includes(e))return"";i.push(e);for(let c=0;c<t.length;c++)if((new Date).getTime(),t[c].ofTheConceptId==e)if(e!=t[c].toTheConceptId){let e=t[c].toTheConceptId,h=yield r.I.GetConcept(e);if(null!=h&&0!=h.id||null==e||null==e||(h=yield(0,o.r)(e)),0!=h.id&&null==(null==h?void 0:h.type)){let e=h.typeId,t=yield r.I.GetConcept(e);h.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),h.type=t)}let u="the_",p=(null!==(a=null===(s=null==h?void 0:h.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(u,"");if(isNaN(Number(p))){if(p){const o=yield L(e,t,n,i);l[p]=o}}else{const o=yield L(e,t,n,i);d[p]=o,l=d}}else console.log("this is the faulty connection ",t[c]);return l}))}function S(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var c,s,a;let l={},d=[];if(0==e)return null;let h=yield r.I.GetConcept(e);if(null!=h&&0!=h.id||null==e||null==e||(h=yield(0,o.r)(e)),0!=h.id&&null==h.type){let e=h.typeId,t=yield r.I.GetConcept(e);h.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),h.type=t)}if(null===(c=null==h?void 0:h.type)||void 0===c?void 0:c.characterValue,!n.includes(e))return null==h?void 0:h.characterValue;if(i.includes(e))return"";i.push(e),l.id=e;for(let i=0;i<t.length;i++)if(t[i].ofTheConceptId==e){let e=t[i].toTheConceptId,c=yield r.I.GetConcept(e);if(null!=c&&0!=c.id||null==e||null==e||(c=yield(0,o.r)(e)),c&&null==(null==c?void 0:c.type)){let e=c.typeId,t=yield r.I.GetConcept(e);c.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),c.type=t)}let h="the_",u=(null!==(a=null===(s=null==c?void 0:c.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(h,"");if(isNaN(Number(u))){if(u){const o=yield S(e,t,n);l[u]=o}}else{const o=yield S(e,t,n);d[u]=o,l=d}}return l}))}},6687:(e,t,n)=>{n.d(t,{D:()=>w,MT:()=>T,Nt:()=>f,QL:()=>g,as:()=>y,cw:()=>h,dF:()=>d,hG:()=>v,km:()=>p,nr:()=>C,p8:()=>u,rv:()=>m});var o=n(8642),i=n(7467),r=n(5983),c=n(1863),s=n(5284),a=n(8939),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(){return l(this,arguments,void 0,(function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.kx)(e[n]);t.push(o)}return t}))}function h(){return l(this,arguments,void 0,(function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.RW)(e[n]);t.push(o)}return t}))}function u(){return l(this,arguments,void 0,(function*(e=[],t=[]){const n=r.Logger.logfunction("GetCompositionFromConnectionsWithDataId",[e])||{};if(r.serviceWorker){n.serviceWorker=!0;try{const o=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataId",{conceptIds:e,connectionIds:t});return r.Logger.logUpdate(n),o.data}catch(e){console.error("GetCompositionFromConnectionsWithDataId error sw: ",e),(0,c.ey)(n,"GetCompositionFromConnectionsWithDataId",e),(0,r.handleServiceWorkerException)(e)}}let o=[];for(let t=0;t<e.length;t++){let n=yield(0,a.RW)(e[t]);o.push(n)}return r.Logger.logUpdate(n),o}))}function p(){var e=arguments;return l(this,arguments,void 0,(function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdFromConnections",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdFromConnections",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdFromConnections error sw: ",e),(0,c.ey)(o,"GetCompositionFromConnectionsWithDataIdFromConnections",e),(0,r.handleServiceWorkerException)(e)}}let s=yield(0,i.j)(n),l=[];for(let e=0;e<t.length;e++){let n=yield(0,a.PT)(t[e],s);l.push(n)}return r.Logger.logUpdate(o),l}))}function f(){var e=arguments;return l(this,arguments,void 0,(function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdIndex",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdIndex",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdIndex error sw: ",e),(0,c.ey)(o,"GetCompositionFromConnectionsWithDataIdIndex",e),(0,r.handleServiceWorkerException)(e)}}yield(0,i.j)(n),yield(0,s.B)(t);let l={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);l[t[e]]=n}return r.Logger.logUpdate(o),l}))}function y(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t),yield(0,s.B)(e);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n}))}function v(){return l(this,arguments,void 0,(function*(e=[],t=[]){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetCompositionFromConnectionsWithIndexFromConnections",{conceptIds:e,connectionIds:t})).data}catch(e){console.error("GetCompositionFromConnectionsWithIndexFromConnections error sw: ",e),(0,r.handleServiceWorkerException)(e)}let n=yield(0,i.j)(t),o=[];for(let t=0;t<e.length;t++){let i=yield(0,a.JA)(e[t],n);o[e[t]]=i}return o}))}function g(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetConnectionDataPrefetch",t)||{};if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConnectionDataPrefetch",{connectionIds:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionDataPrefetch error sw: ",e),(0,c.ey)(n,"GetConnectionDataPrefetch",e),(0,r.handleServiceWorkerException)(e)}}const o=yield Promise.all(e.map((e=>r.ConnectionData.GetConnection(e)))),s=[],a=[];for(let t=0;t<o.length;t++){const n=o[t];0===(null==n?void 0:n.id)?a.push(e[t]):s.push(n)}const l=yield(0,i.j)(a),d=[...s,...l],h=new Set;for(const e of d)h.add(e.ofTheConceptId),h.add(e.toTheConceptId),h.add(e.typeId);return yield(0,r.GetConceptBulk)([...h]),r.Logger.logUpdate(n),d}))}function m(){var e=arguments;return l(this,arguments,void 0,(function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdInObject",e);yield(0,i.j)(n);let c={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);c[t[e]]=n}return r.Logger.logUpdate(o),c}))}function C(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.$N)(e[t]);n[e[t]]=o}return n}))}function T(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n}))}function w(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.XI)(e[t]);n[e[t]]=o,console.log("this is the normal data",e[t],o)}return n}))}},2013:(e,t,n)=>{n.d(t,{A:()=>a,w:()=>l});var o=n(8146),i=n(5983),r=n(3026),c=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function a(e){var t=arguments;return s(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("GetConceptByCharacter",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacter",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacter sw error: ",e),(0,c.ey)(n,"GetConceptByCharacter",e),(0,i.handleServiceWorkerException)(e)}}let s=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=s&&0!=(null==s?void 0:s.id)||!a||(yield(0,o.Y)(e),s=yield r.I.GetConceptByCharacterAndTypeLocal(e,51),0==s.id&&(s=yield r.I.GetConceptByCharacter(e))),i.Logger.logUpdate(n),s}))}function l(e){var t=arguments;return s(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("GetConceptByCharacterUpdated",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacterUpdated",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacterUpdated error sw: ",e),(0,c.ey)(n,"GetConceptByCharacterUpdated",e),(0,i.handleServiceWorkerException)(e)}}let s=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=s&&0!=(null==s?void 0:s.id)||!a||(yield(0,o.Y)(e),s=yield r.I.GetConceptByCharacter(e)),i.Logger.logUpdate(n),s}))}},7887:(e,t,n)=>{n.d(t,{a:()=>c,p:()=>s});var o=n(8286),i=n(4864),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function c(){return r(this,void 0,void 0,(function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)o.d.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Connection Binary Tree Concept",ok:!1,status:400,data:e}}}))}function s(){return r(this,void 0,void 0,(function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)i.G.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Local Connection Binary Tree Concept",ok:!1,status:400,data:e}}}))}},7876:(e,t,n)=>{n.d(t,{A:()=>d,K:()=>h});var o=n(1735),i=n(7139),r=n(5983),c=n(3026),s=n(7282),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};const l=new Map;function d(e){return a(this,arguments,void 0,(function*(e,t=999){let n=performance.now();if(o.J.activateStatus)try{o.J.incrementConcept(e)}catch(e){console.error("Error adding connection in access tracker"),r.Logger.log("ERROR","Error Adding Connection")}if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConcept",{id:e,userId:t})).data}catch(e){console.error("GetTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let d=(0,s.o)();if(l.has(e))return l.get(e)||d;const h=(()=>a(this,void 0,void 0,(function*(){try{if(e<0)return yield r.LocalConceptsData.GetConceptByGhostId(e);if(d=yield c.I.GetConcept(e),(null==d||0==d.id)&&null!=e&&null!=e){let t=yield(0,i.r)(e);d=t}if(0!=d.id&&null==d.type&&null==(yield c.I.GetConcept(d.typeId))&&null!=d.typeId&&null!=d.typeId){let e=yield(0,i.r)(d.typeId);d.type=e}return d}catch(o){throw console.error("this is the error in the getting concept",o),r.Logger.logError(n,t,"read","unknown",void 0,500,o,"GetTheConcept",[e,t],"unknown",void 0),o}finally{l.delete(e)}})))();return l.set(e,h),h}))}function h(e){return a(this,void 0,void 0,(function*(){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("AddTypeConcept",{concept:e})).data}catch(e){console.error("AddTypeConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(null==e.type){let t=yield c.I.GetConcept(e.typeId);if(0==t.id&&0!=e.typeId&&999!=e.typeId){let t=yield(0,i.r)(e.typeId);e.type=t}else e.type=t}}))}},7869:(e,t,n)=>{n.d(t,{_:()=>y,A:()=>f});var o=n(9581),i=n(3026),r=n(1863),c=n(3518),s=n(5983),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},l=n(2299);class d{}d.isUpdated=!1,d.isOnlineSync=!1;var h=n(3655),u=n(9003),p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function f(){return p(this,arguments,void 0,(function*(e=!0){try{if(yield(0,h.qI)("concepts"),yield(0,u.qI)("concepts"),e){if((yield(0,h.b8)()).isOnlineSync)return!0;yield function(){return a(this,void 0,void 0,(function*(){const e=s.Logger.logfunction("GetAiData");try{const a=(new Date).getTime();var t=(0,c.ab)("application/x-www-form-urlencoded");const l=yield fetch(o.B.GetAllAiData(),{method:"GET",headers:t});l.ok||(console.log("Ai Error Message: ","Cannot get response"),(0,r.ry)(l));const d=yield l.json();for(var n=0;n<d.length;n++)i.I.AddConcept(d[n]);y();let h=(new Date).getTime()-a;console.log("The time taken is ",h),s.Logger.logUpdate(e)}catch(e){e instanceof Error?console.log("Ai Error Message: ",e.message):console.log("Ai Error Message: ",e),(0,r.Mb)(e,o.B.GetAllAiData())}}))}()}return!0}catch(e){let t={message:"cannot initlize the AI system",ok:!1,status:400,data:e};return console.log(t),!0}}))}function y(){return p(this,void 0,void 0,(function*(){d.isOnlineSync=!0;var e=new l.B(d.isOnlineSync);(0,h.El)(e)}))}},8095:(e,t,n)=>{n.d(t,{h:()=>s});var o=n(5983),i=n(9700),r=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(e,t,n){var s=arguments;return c(this,arguments,void 0,(function*(e,t,n,c=!1,a={concepts:[],connections:[]}){var l,d,h,u,p,f;const y=i.V.logfunction("CreateConnectionBetweenTwoConceptsLocal",s)||{};let v=performance.now();try{if(o.serviceWorker){y.serviceWorker=!0;try{const r=yield(0,o.sendMessage)("CreateConnectionBetweenTwoConceptsLocal",{ofTheConcept:e,toTheConcept:t,linker:n,both:c,actions:a});return(null===(d=null===(l=null==r?void 0:r.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(r.actions.concepts))),(null===(u=null===(h=null==r?void 0:r.actions)||void 0===h?void 0:h.connections)||void 0===u?void 0:u.length)&&(a.connections=JSON.parse(JSON.stringify(r.actions.connections))),i.V.logUpdate(y),r.data}catch(e){console.error("CreateConnectionBetweenTwoConceptsLocal sw error: ",e),(0,r.ey)(y,"CreateConnectionBetweenTwoConceptsLocal",e),(0,o.handleServiceWorkerException)(e)}}if(e.userId,c){let i=(null===(p=t.type)||void 0===p?void 0:p.characterValue)+"_s_"+n+"_by";var g=yield(0,o.MakeTheInstanceConceptLocal)("connection",i,!1,999,999,999,0,a);yield(0,o.CreateTheConnectionLocal)(t.id,e.id,g.id,1e3,void 0,void 0,a)}let s=(null===(f=e.type)||void 0===f?void 0:f.characterValue)+"_s_"+n+"_s";var m=yield(0,o.MakeTheInstanceConceptLocal)("connection",s,!1,999,999,999,void 0,a);let v=yield(0,o.CreateTheConnectionLocal)(e.id,t.id,m.id,1e3,void 0,void 0,a);return i.V.logUpdate(y),v}catch(o){throw i.V.logError(v,e.userId,"create",void 0,void 0,500,o,"CreateConnectionBetweenTwoConceptsLocal",[e,t,n,c],void 0,void 0),(0,r.ey)(y,"CreateConnectionBetweenTwoConceptsLocal",o),o}}))}},6416:(e,t,n)=>{n.d(t,{u:()=>i});var o=n(2615);function i(){let e=new Date,t=new Date;return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}},3075:(e,t,n)=>{n.d(t,{Ay:()=>d,EO:()=>h,xd:()=>u});var o=n(205),i=n(9736),r=n(5257),c=n(9003),s=n(5983),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(){return l(this,void 0,void 0,(function*(){const e=s.Logger.logfunction("CreateLocalBinaryTreeFromIndexDb");try{let t=[];if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];i.v.AddConceptToMemory(n)}o.B.isLocalDataLoaded=!0,o.B.isLocalTypeLoaded=!0,o.B.isLocalCharacterLoaded=!0,s.Logger.logUpdate(e)}catch(t){yield(0,s.DelayFunctionExecution)(2e3,d());let n={message:"Cannot create local binary tree from index db",data:t,ok:!1,status:400};throw(0,a.ey)(e,"CreateLocalBinaryTreeFromIndexDb",t),n}}))}function h(){return l(this,void 0,void 0,(function*(){var e;const t=s.Logger.logfunction("PopulateTheLocalConceptsToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",(e=>l(this,void 0,void 0,(function*(){let e=yield(0,c.S5)("localid");if(Array.isArray(e)){if(e[0]){let t=e[0].value;if(t)r.R.AddConceptId(e[0]),yield(0,c.kH)("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};r.R.AddConceptId(e),yield(0,c.kH)("localid",n)}}e[2]}})))),s.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConceptsToMemory",e),n}}))}function u(){return l(this,void 0,void 0,(function*(){var e;const t=s.Logger.logfunction("PopulateTheLocalConnectionToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",(e=>l(this,void 0,void 0,(function*(){let e=yield(0,c.S5)("localid");if(Array.isArray(e)){if(e[1]){let t=e[1].value;if(t)r.R.AddConnectionId(e[1]),yield(0,c.kH)("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};r.R.AddConnectionId(e),yield(0,c.kH)("localid",n)}}e[2]}})))),s.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConnectionToMemory",e),n}}))}},999:(e,t,n)=>{n.d(t,{R:()=>l});var o=n(5983),i=n(1863),r=n(6416),c=n(4711),s=n(5868),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function l(e){return a(this,arguments,void 0,(function*(e,t=null,n=null,a=null,d=null,h=null,u=null,p=!1,f={concepts:[],connections:[]}){var y,v,g,m;const C=o.Logger.logfunction("CreateTheCompositionLocal")||{};if(o.serviceWorker){C.serviceWorker=!0;try{const i=yield(0,o.sendMessage)("CreateTheCompositionLocal",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:a,userId:d,accessId:h,sessionInformationId:u,actions:f});return(null===(v=null===(y=null==i?void 0:i.actions)||void 0===y?void 0:y.concepts)||void 0===v?void 0:v.length)&&(f.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(m=null===(g=null==i?void 0:i.actions)||void 0===g?void 0:g.connections)||void 0===m?void 0:m.length)&&(f.connections=JSON.parse(JSON.stringify(i.actions.connections))),o.Logger.logUpdate(C),i.data}catch(e){console.error("CreateTheCompositionLocal error sw: ",e),(0,i.ey)(C,"CreateTheCompositionLocal",e),(0,o.handleServiceWorkerException)(e)}}let T=null!=d?d:999,w=null!=h?h:999,I=null!=u?u:999,k=null!=a?a:0,N=(0,r.u)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=k,n=yield(0,s.k)(o,"",!0,T,w,I,void 0,f);N=n,t=n.id,k=n.id,yield l(e[o],n.id,n.userId,t,d,h,u,void 0,f)}else{let n=null!=t?t:999,i=k,r=yield(0,s.k)(o,"",!0,T,w,I,void 0,f);yield(0,c.F)(n,r.id,i,void 0,void 0,void 0,f),yield l(e[o],r.id,r.userId,i,d,h,u,void 0,f)}else{let n=null!=t?t:999,i=k,r=yield(0,s.k)(o,e[o].toString(),!1,T,w,I,void 0,f);yield(0,c.F)(n,r.id,i,void 0,void 0,void 0,f)}return o.Logger.logUpdate(C),N}))}},3077:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(5983),i=n(2615),r=n(9736),c=n(5257),s=n(9700),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function l(e,t,n,l,d,h){return a(this,arguments,void 0,(function*(e,t,n,a,l,d,h=!1,u=0,p={concepts:[],connections:[]}){var f,y,v,g;let m=performance.now();try{if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("CreateTheConceptLocal",{referent:e,typecharacter:t,userId:n,categoryId:a,typeId:l,accessId:d,isComposition:h,referentId:u});return(null===(y=null===(f=null==i?void 0:i.actions)||void 0===f?void 0:f.concepts)||void 0===y?void 0:y.length)&&(p.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(g=null===(v=null==i?void 0:i.actions)||void 0===v?void 0:v.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("CreateTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let s=yield c.R.getConceptId(),m=!0,C=new Date,T=new Date;if("the"==e)return new i.j(1,999,5,5,u,e,d,m,C,T,t);let w=new i.j(s,n,l,a,u,e,d,m,C,T,t);return w.isTemp=!0,w.isComposition=h,r.v.AddConcept(w),p.concepts.push(w),w}catch(o){throw s.V.logError(m,n,"create","unknown","unknown",500,void 0,"createTheConceptLocal",[e,t,n,a,l,d,h],void 0),o}}))}},4711:(e,t,n)=>{n.d(t,{F:()=>l,d:()=>d});var o=n(2155),i=n(4864),r=n(5257),c=n(9700),s=n(5983),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function l(e,t,n){return a(this,arguments,void 0,(function*(e,t,n,a=1,l="",d=999,h={concepts:[],connections:[]}){var u,p,f,y;let v=performance.now();if(s.serviceWorker)try{const o=yield(0,s.sendMessage)("CreateTheConnectionLocal",{ofTheConceptId:e,toTheConceptId:t,typeId:n,orderId:a,typeString:l,userId:d,actions:h});return(null===(p=null===(u=null==o?void 0:o.actions)||void 0===u?void 0:u.concepts)||void 0===p?void 0:p.length)&&(h.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(y=null===(f=null==o?void 0:o.actions)||void 0===f?void 0:f.connections)||void 0===y?void 0:y.length)&&(h.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.log("CreateTheConnectionLocal error sw: ",e),(0,s.handleServiceWorkerException)(e)}try{let c=4,u=yield r.R.getConnectionId(),p=0,f=0,y=0;p=e,f=t,y=n;let v=new o.N(0,0,0,0,0,0,0);return e!=t&&(v=new o.N(u,p,f,d,n,a,c),v.isTemp=!0,v.typeCharacter=l,s.LocalSyncData.AddConnection(v),i.G.AddConnection(v),h.connections.push(v)),v}catch(o){throw c.V.logError(v,d,"create","Unknown","Unknown",500,void 0,"CreateTheConnectionLocal",[e,t,n,a,l,d],"UnknownUserAgent",[]),o}}))}function d(e,t,n){return a(this,arguments,void 0,(function*(e,t,n,o={concepts:[],connections:[]}){var i,r,c,a;if(s.serviceWorker)try{const l=yield(0,s.sendMessage)("CreateConnection",{ofTheConcept:e,toTheConcept:t,connectionTypeString:n,actions:o});return(null===(r=null===(i=null==l?void 0:l.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(l.actions.concepts))),(null===(a=null===(c=null==l?void 0:l.actions)||void 0===c?void 0:c.connections)||void 0===a?void 0:a.length)&&(o.connections=JSON.parse(JSON.stringify(l.actions.connections))),l.data}catch(e){console.log("CreateConnection error sw: ",e),(0,s.handleServiceWorkerException)(e)}let d=yield(0,s.MakeTheTypeConceptLocal)(n,999,999,999),h=e.userId;return yield l(e.id,t.id,d.id,1e3,n,h,o)}))}},8064:(e,t,n)=>{n.d(t,{$I:()=>s,Ay:()=>c});var o=n(9736),i=(n(9581),n(3518),n(5983));n(1863);var r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function c(e){return r(this,void 0,void 0,(function*(){return yield o.v.GetConceptByCharacterAndTypeLocal(e,51)}))}function s(e){return r(this,void 0,void 0,(function*(){if(i.serviceWorker)try{return(yield(0,i.sendMessage)("GetConceptByCharacterAndCategoryLocal",{character:e})).data}catch(e){console.error("GetConceptByCharacterAndCategoryLocal error sw: ",e),(0,i.handleServiceWorkerException)(e)}let t=(0,i.CreateDefaultLConcept)();if("the"==e)return t.id=1,t.typeId=5,t.characterValue="the",t;let n=(0,i.SplitStrings)(e);if(n.length>1){let i=1,c=yield s(n[0]);0!=c.id&&(i=c.id),t=yield function(e,t){return r(this,void 0,void 0,(function*(){return o.v.GetConceptByCharacterAndCategoryLocal(e,t)}))}(e,i)}else n[0]==e&&(t=yield c(e));return t}))}},1213:(e,t,n)=>{n.d(t,{f:()=>a});var o=n(9736),i=n(7820),r=n(5983),c=n(176),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function a(e){return s(this,void 0,void 0,(function*(){let t=performance.now();try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConceptLocal",{id:e})).data}catch(e){console.error("GetTheConceptLocal error sw: ",e),(0,r.handleServiceWorkerException)(e)}let t=(0,r.CreateDefaultLConcept)();if(e<0){if(t=yield o.v.GetConcept(e),0==t.id){let n=yield i.G.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}}}else{let n=yield(0,r.GetTheConcept)(e);t=(0,c.F4)(n)}return t}catch(n){throw r.Logger.logError(t,"unknown","read","unknown",void 0,200,void 0,"GetTheConceptLocal",[e],"unknown",void 0),n}}))}},9975:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(5983),i=n(9736),r=n(3077),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(e,t,n,s,a){return c(this,arguments,void 0,(function*(e,t,n,c,s,a={concepts:[],connections:[]}){var l,d,h,u;if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("MakeTheConceptLocal",{referent:e,typeCharacter:t,userId:n,categoryId:c,typeId:s,actions:a});return(null===(d=null===(l=null==i?void 0:i.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(u=null===(h=null==i?void 0:i.actions)||void 0===h?void 0:h.connections)||void 0===u?void 0:u.length)&&(a.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("MakeTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let p=yield i.v.GetConceptByCharacterAndTypeLocal(e,s),f=p;return"the"==t&&(c=1),0==f.id&&(p=yield(0,r.A)(e,t,n,c,s,4,void 0,null,a),f=p),f}))}},5868:(e,t,n)=>{n.d(t,{k:()=>l});var o=n(3077),i=n(8357),r=n(9736),c=n(5983),s=n(1863),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function l(e,t){var n=arguments;return a(this,arguments,void 0,(function*(e,t,a=!1,l,d,h=999,u=0,p={concepts:[],connections:[]}){var f,y,v,g;0==a&&(l=999);const m=c.Logger.logfunction("MakeTheInstanceConceptLocal",n)||{};if(c.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,c.sendMessage)("MakeTheInstanceConceptLocal",{type:e,referent:t,composition:a,userId:l,accessId:d,sessionInformationId:h,referentId:u,actions:p});return(null===(y=null===(f=null==n?void 0:n.actions)||void 0===f?void 0:f.concepts)||void 0===y?void 0:y.length)&&(p.concepts=JSON.parse(JSON.stringify(n.actions.concepts))),(null===(g=null===(v=null==n?void 0:n.actions)||void 0===v?void 0:v.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(n.actions.connections))),c.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConceptLocal error sw: ",e),(0,s.ey)(m,"MakeTheInstanceConceptLocal",e),(0,c.handleServiceWorkerException)(e)}}try{let n,s,d=999,h=4,f=l,y=4,v="",g=t.length;if(v=e.startsWith("the_")?e:"the_"+e,a)n=yield(0,i.$)(e,d,l,l,p),s=yield(0,o.A)(t,e,l,h,n.id,y,!0,u,p);else if(g>255)n=yield(0,i.$)(v,d,f,l,p),s=yield(0,o.A)(t,v,l,h,n.id,y,void 0,void 0,p);else{n=yield(0,i.$)(v,d,f,l,p);let e=yield r.v.GetConceptByCharacterAndTypeLocal(t,n.id);s=e,0==e.id&&0==e.userId&&(s=yield(0,o.A)(t,v,l,h,n.id,y,void 0,void 0,p))}return s.type=n,c.LocalSyncData.AddConcept(s),p.concepts.push(s),c.Logger.logUpdate(m),s}catch(e){throw(0,s.ey)(m,"MakeTheInstanceConceptLocal",e),e}}))}},8357:(e,t,n)=>{n.d(t,{$:()=>d});var o=n(3077),i=n(8064),r=n(6467),c=n(9975),s=n(5983),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e,t,n,h){var u=arguments;return l(this,arguments,void 0,(function*(e,t,n,l,h={concepts:[],connections:[]}){var p,f,y,v;const g=s.Logger.logfunction("MakeTheTypeConceptLocal",u)||{};if(s.serviceWorker){g.serviceWorker=!0;try{const o=yield(0,s.sendMessage)("MakeTheTypeConceptLocal",{typeString:e,sessionId:t,sessionUserId:n,userId:l,actions:h});return(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.concepts)||void 0===f?void 0:f.length)&&(h.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(v=null===(y=null==o?void 0:o.actions)||void 0===y?void 0:y.connections)||void 0===v?void 0:v.length)&&(h.connections=JSON.parse(JSON.stringify(o.actions.connections))),s.Logger.logUpdate(g),o.data}catch(e){console.error("MakeTheTypeConceptLocal error sw: ",e),(0,a.ey)(g,"MakeTheTypeConceptLocal",e),(0,s.handleServiceWorkerException)(e)}}let m=yield(0,i.$I)(e);if(m&&(0==m.id||0==m.userId)){let i=(0,r.f)(e);if(i[0]==e)m=yield(0,c.A)(e,"the",l,1,51,h);else{let r=yield d(i[0],t,n,l,h),c=yield d(i[1],t,n,l,h);m=yield(0,o.A)(e,i[1],l,r.id,c.id,4,void 0,null,h)}}return s.Logger.logUpdate(g),m}))}},3729:(e,t,n)=>{n.d(t,{D:()=>p});var o=n(9934),i=n(4485),r=n(2),c=n(7876),s=n(4818),a=n(999),l=n(5868),d=n(5983),h=n(176),u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function p(e){return u(this,arguments,void 0,(function*(e,t={concepts:[],connections:[]}){var n,u,p,f;if(performance.now(),d.serviceWorker)try{const o=yield(0,d.sendMessage)("UpdateCompositionLocal",{patcherStructure:e,actions:t});return(null===(u=null===(n=null==o?void 0:o.actions)||void 0===n?void 0:n.concepts)||void 0===u?void 0:u.length)&&(t.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.connections)||void 0===f?void 0:f.length)&&(t.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.error("UpdateCompositionLocal error sw: ",e),(0,d.handleServiceWorkerException)(e)}const y=e.userId,v=e.sessionId,g=e.accessId;let m=[];const C=[];let T=(0,d.CreateDefaultLConcept)(),w=(0,d.CreateDefaultLConcept)();const I=[],k=e.compositionId,N=e.ofTheCompositionId;let A=[],L=yield(0,r.s)(k);for(let e=0;e<L.length;e++)m.push((0,h.P6)(L[e]));const S=[],_=[];let b=[];for(let e=0;e<m.length;e++)(0,o.A)(_,m[e].ofTheConceptId),(0,o.A)(S,m[e].ofTheConceptId),(0,o.A)(S,m[e].toTheConceptId),b.push(m[e].ofTheConceptId);for(let e=0;e<S.length;e++){const t=yield(0,c.A)(S[e]);k==S[e]&&(T=(0,h.F4)(t)),N==S[e]&&(w=(0,h.F4)(t)),C.push((0,h.F4)(t))}const B=e.patchObject;for(const e in B){let n=(0,d.CreateDefaultLConcept)();const o=B[e];let r=T;w.id>0&&(r=w),Array.isArray(o)||"object"==typeof o?(n=yield(0,l.k)(e,"",!0,T.userId,4,999,void 0,t),yield(0,a.R)(B[e],n.id,n.userId,T.id,T.userId,4,999,void 0,t)):n=yield(0,l.k)(e,o,!1,y,g,v,void 0,t);const c=(0,i.nm)(C,n);for(let e=0;e<c.length;e++)if(c[e].id>0){const t=(0,i.gt)(m,c[e].id);A=A.concat(t),I.push(c[e])}yield(0,d.CreateTheConnectionLocal)(r.id,n.id,T.id,2,void 0,void 0,t),C.push(n)}for(let e=0;e<A.length;e++)yield(0,s.m)(A[e].id);yield d.LocalSyncData.SyncDataOnline(void 0,t)}))}},8407:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(9581),i=n(3518),r=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},s=n(4402),a=n(5983),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class d{constructor(e,t,n,o,i,r,c,s,a,l){this.id=0,this.userId=e,this.data=t,this.securityId=n,this.securityUserId=o,this.accessId=i,this.accessUserId=r,this.sessionId=c,this.sessionUserId=s,this.entryTimestamp=a,this.isNew=l}}var h=n(7282),u=n(2212),p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function f(e,t){var n=arguments;return p(this,arguments,void 0,(function*(e,t,p=!1,f,y=4,v=999,g=0){f=p?f:999;const m=a.Logger.logfunction("MakeTheInstanceConcept",n)||{};if(a.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("MakeTheInstanceConcept",{type:e,referent:t,composition:p,userId:f,passedAccessId:y,passedSessionId:v,referentId:g});return a.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConcept sw error: ",e),(0,r.ey)(m,"MakeTheInstanceConcept",e),(0,a.handleServiceWorkerException)(e)}}let C,T=v,w=f,I=f,k=y,N=f,A="",L=t.length,S=(0,h.o)();if(A=e.startsWith("the_")?e:"the_"+e,p)S=yield(0,a.MakeTheTypeConceptApi)(e,f),C=yield(0,u.Ay)(t,f,4,S.id,g,k,e);else if(L>255)S=yield(0,a.MakeTheTypeConceptApi)(A,f),C=yield(0,u.Ay)(t,f,4,S.id,g,k,A),function(e){c(this,void 0,void 0,(function*(){try{var t=(0,i.Xr)();const n=yield fetch(o.B.CreateTheTextDataUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);return yield n.json()}catch(e){throw e instanceof Error?console.log("Create the text error message: ",e.message):console.log("Create the text unexpected error: ",e),e}}))}(new d(f,t,999,w,k,N,T,I,Date.now().toString(),!0));else{S=yield(0,a.MakeTheTypeConceptApi)(A,f);let e=yield(0,s.A)(t,S.id);C=e,0==e.id&&0==e.userId&&(C=yield(0,u.N)(t,f,4,S.id,12,k,A),function(e,t,n,c){var s=arguments;l(this,void 0,void 0,(function*(){const l=a.Logger.logfunction("MakeTheNameInBackend",s);try{let s={newConceptId:e,referent:t,typeId:n,typeUserId:c},d=(0,i.Xr)(),h=JSON.stringify(s);const u=yield fetch(o.B.MakeTheNameInBackendUrl(),{method:"POST",headers:d,body:h});a.Logger.logUpdate(l),u.ok||(0,r.ry)(u)}catch(e){e instanceof Error?console.log("make the name in backend error message: ",e.message):console.log("make the name in backend unexpected error: ",e),(0,r.Mb)(e,o.B.MakeTheNameInBackendUrl()),(0,r.ey)(l,"MakeTheNameInBackend",e)}}))}(C.id,`${t}`,S.id,f))}return C.type=S,a.Logger.logUpdate(m),C}))}},5312:(e,t,n)=>{n.d(t,{NK:()=>u,Ve:()=>p,cf:()=>d,vw:()=>f,y8:()=>h});var o=n(2832),i=n(3130),r=n(5983),c=n(1863),s=n(6687),a=n(7106),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function d(e){var t=arguments;return l(this,arguments,void 0,(function*(e,n="",d=null,u=i.y0){var p,y,v,g,m,C,T,w;const I=r.Logger.logfunction("SearchLinkMultipleAll",t)||{};try{try{if(r.serviceWorker){I.serviceWorker=!0;const t=yield(0,r.sendMessage)("SearchLinkMultipleAll",{searchQuery:e,token:n,caller:d,format:u});return r.Logger.logUpdate(I),t.data}}catch(e){console.error("SearchLinkMultipleAll error sw: ",e),(0,c.ey)(I,"SearchLinkMultipleAll",e),(0,r.handleServiceWorkerException)(e)}let t=[],k=[],N=[],A=[],L=e[0].composition,S={},_={};(null==d?void 0:d.isDataLoaded)?(S.compositionIds=null===(p=d.conceptIds)||void 0===p?void 0:p.slice(),S.internalConnections=null===(y=d.internalConnections)||void 0===y?void 0:y.slice(),S.linkers=null===(v=d.linkers)||void 0===v?void 0:v.slice(),S.reverse=null===(g=d.reverse)||void 0===g?void 0:g.slice(),_=S,t=_.compositionIds,N=_.internalConnections,k=_.linkers,A=_.reverse):(S=yield(0,o.j)(e,n),d&&(d.conceptIds=null===(m=S.compositionIds)||void 0===m?void 0:m.slice(),d.internalConnections=null===(C=S.internalConnections)||void 0===C?void 0:C.slice(),d.linkers=null===(T=S.linkers)||void 0===T?void 0:T.slice(),d.reverse=null===(w=S.reverse)||void 0===w?void 0:w.slice(),d.isDataLoaded=!0),_=S,t=_.compositionIds,N=_.internalConnections,k=_.linkers,A=_.reverse);let b=yield function(e,t,n,o,r,c){return l(this,arguments,void 0,(function*(e,t,n,o,r,c,l=i.y0){try{let d,u,p=yield(0,s.QL)(e);return l==i.ZJ?(d=yield(0,s.MT)(t,n),u=yield f(e,d,r,o)):l==i.yv?(d=yield(0,s.D)(t,n),u=yield f(e,d,r,o)):100==l?(d=yield(0,s.nr)(t,n),u=yield h(p,d,r,o)):l==i.SL?u=yield(0,a._W)(e,t,n,c.ofCompositions,o):(d=yield(0,s.rv)(t,n),u=yield h(p,d,r,o)),u}catch(e){return void console.log("Error Occured in build layer",e)}}))}(k,t,N,A,L,e[0],u);return r.Logger.logUpdate(I),b}catch(e){throw console.log("this is the error in the search link multiple",e),(0,c.ey)(I,"SearchLinkMultipleAll",e),e}}))}function h(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){(new Date).getTime();let i={},c=[];for(let t=0;t<e.length;t++)c.push(e[t].toTheConceptId),c.push(e[t].ofTheConceptId),c.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(0,r.GetTheConcept)(e[n].typeId),c=null==o?void 0:o.data,s=Object.keys(c)[0];try{let o=i.characterValue+"_reverse";"string"==typeof c&&(c={}),Array.isArray(c[s][o])||("string"==typeof c[s]&&(c[s]={}),c[s][o]=[]),c[s][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),c=null==o?void 0:o.data,s=Object.keys(c)[0];try{"string"==typeof c&&(c={}),Array.isArray(c[s][i.characterValue])||("string"==typeof c[s]&&(c[s]={}),c[s][i.characterValue]=[]),c[s][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i}))}function u(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){let i=[],c=[];for(let t=0;t<e.length;t++)c.push(e[t].toTheConceptId),c.push(e[t].ofTheConceptId),c.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(0,r.GetTheConcept)(e[n].typeId),c=Object.keys(o)[0];try{let r=i.characterValue+"_reverse";"string"==typeof o&&(o={}),Array.isArray(o[c][r])||("string"==typeof o[c]&&(o[c]={}),o[c][r]=[]),o[c][r].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),c=Object.keys(o)[0];try{"string"==typeof o&&(o={}),Array.isArray(o[c][i.characterValue])||("string"==typeof o[c]&&(o[c]={}),o[c][i.characterValue]=[]),o[c][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let o=t[n[e]];o&&i.push(o)}return i}))}function p(e,t,n,o){return l(this,arguments,void 0,(function*(e,t,n,o,i=[]){(new Date).getTime();let c=[],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(0,r.GetTheConcept)(e[n].typeId),c=null==o?void 0:o.data,s=Object.keys(c)[0];try{let o=i.characterValue+"_reverse";"string"==typeof c&&(c={}),Array.isArray(c[s][o])||("string"==typeof c[s]&&(c[s]={}),c[s][o]=[]),c[s][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),c=null==o?void 0:o.data,s=Object.keys(c)[0];try{"string"==typeof c&&(c={}),Array.isArray(c[s][i.characterValue])||("string"==typeof c[s]&&(c[s]={}),c[s][i.characterValue]=[]),c[s][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<o.length;e++){let n=t[o[e]];n&&c.push(n)}return c}))}function f(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){let i={},c=yield(0,r.GetConnectionBulk)(e),s=[];for(let e=0;e<c.length;e++)s.push(c[e].toTheConceptId),s.push(c[e].ofTheConceptId),s.push(c[e].typeId);yield(0,r.GetConceptBulk)(s),c.sort((function(e,t){return t.id-e.id}));for(let e=0;e<c.length;e++){let n=!1;if(o.includes(c[e].id)&&(n=!0),1==n){if(t[c[e].ofTheConceptId]&&t[c[e].toTheConceptId]){let n=t[c[e].toTheConceptId],o=yield(0,r.GetTheConcept)(c[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[c[e].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[c[e].ofTheConceptId]&&t[c[e].toTheConceptId]){let n=t[c[e].ofTheConceptId],o=yield(0,r.GetTheConcept)(c[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[c[e].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i}))}},7106:(e,t,n)=>{n.d(t,{zl:()=>v,b6:()=>C,e$:()=>w,y6:()=>T,yV:()=>g,_W:()=>m});var o=n(5983),i=n(6687);function r(e){return e.startsWith("the_")?e.slice(4):e}var c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function s(e,t,n){return c(this,void 0,void 0,(function*(){var i,r,c,s,a,l,d,h;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 p=!1;n.includes(e[u].id)&&(p=!0);let f=yield(0,o.GetTheConcept)(e[u].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[u].toTheConceptId);if(1==p&&0!=f.id&&0!=y.id){let n,a=null!==(r=null===(i=y.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self";e[u].toTheConceptId in t?n=t[e[u].toTheConceptId]:(n={},n[a]={},t[e[u].toTheConceptId]=n);let l=yield(0,o.GetTheConcept)(e[u].typeId);try{let e=null!==(s=null===(c=null==f?void 0:f.type)||void 0===c?void 0:c.characterValue)&&void 0!==s?s:"none",n=f.characterValue;l.characterValue,l.characterValue.includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[y.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=y.id){let n,i=null!==(l=null===(a=f.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[u].ofTheConceptId in t?n=t[e[u].ofTheConceptId]:(n={},n[i]={},t[e[u].ofTheConceptId]=n);let r=yield(0,o.GetTheConcept)(e[u].typeId);try{let e=null!==(h=null===(d=null==y?void 0:y.type)||void 0===d?void 0:d.characterValue)&&void 0!==h?h:"none",n=y.characterValue;r.characterValue.includes("_s_")&&(y.id in t||(t[y.id]={}),t[y.id][e]=n),t[f.id]={}}catch(e){console.log("this is error",e)}}}return t}))}var a=n(5312),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function h(e,t,n){if(e in t){let o=t[e];o&&(n[o.connectionType+"_count"]=o.count)}}var u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},p=n(5898);function f(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 y=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function v(e,t){return y(this,arguments,void 0,(function*(e,t,n=""){let r=yield(0,o.SearchWithTypeAndLinkerApi)(e,t,n),c=r.compositionIds,s=r.internalConnections,l=r.linkers,d=r.reverse,h=r.mainCompositionIds,u=yield(0,i.QL)(l),p=yield(0,i.MT)(c,s);return yield(0,a.NK)(u,p,h,d)}))}function g(e,t,n,o,r){return y(this,void 0,void 0,(function*(){let c=yield(0,i.QL)(e),s=yield(0,i.rv)(t,n);return yield(0,a.Ve)(c,s,t,o,r)}))}function m(e,t,n,o,r){return y(this,void 0,void 0,(function*(){let c=yield(0,i.QL)(e),s=yield(0,i.D)(t,n);return yield(0,a.NK)(c,s,o,r)}))}function C(e,t,n,a,l){return y(this,void 0,void 0,(function*(){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnections",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:a,countInfos:l})).data}catch(e){console.error("formatConnections error sw: ",e),(0,o.handleServiceWorkerException)(e)}let d=yield(0,i.QL)(e);d=f(d);let h=[];h=yield s(d,h,a),h=yield function(e,t,n){return c(this,void 0,void 0,(function*(){var i,c,s,a,l,d,h,u;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);e.sort((function(e,t){return t.id-e.id}));for(let p=0;p<e.length;p++){let f=!1;n.includes(e[p].id)&&(f=!0);let y=yield(0,o.GetTheConcept)(e[p].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[p].toTheConceptId);if(1==f&&0!=y.id&&0!=v.id){let n,l=null!==(c=null===(i=v.type)||void 0===i?void 0:i.characterValue)&&void 0!==c?c:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],l in n||(n[l]={})):(n={},n[l]={},t[e[p].toTheConceptId]=n);let d=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(a=null===(s=null==y?void 0:y.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"none",t=y.characterValue,o=d.characterValue;""==o&&(o=e,o=r(o));let i={[e]:t},c=o+"_reverse";d.characterValue.includes("_s_")||("string"==typeof n[l]&&(n[l]={}),n[l][c]=i)}catch(e){console.log("this is error",e)}}if(0!=y.id&&0!=v.id){let n,i=null!==(d=null===(l=y.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);let c=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(u=null===(h=null==v?void 0:v.type)||void 0===h?void 0:h.characterValue)&&void 0!==u?u:"none",t=v.characterValue,o=c.characterValue,s=(c.characterValue,!1);""==o&&(o=e,o=r(o),s=!0);let a={[e]:t};isNaN(Number(o))?c.characterValue.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][o]=s?t:a):(Array.isArray(n[i])||(n[i]=[]),n[i].push(t))}catch(e){console.log("this is error",e)}}}return t}))}(d,h,a);let u=yield function(e,t,n,i){return c(this,arguments,void 0,(function*(e,t,n,i,r=[]){var c,s,a,l,d,h;let u=[],p=[];for(let t=0;t<e.length;t++)p.push(e[t].toTheConceptId),p.push(e[t].ofTheConceptId),p.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;r.includes(e[n].id)&&(i=!0);let u=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),p=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(1==i&&0!=u.id&&0!=p.id&&p.id in t){let i,r=null!==(s=null===(c=p.type)||void 0===c?void 0:c.characterValue)&&void 0!==s?s:"self";e[n].toTheConceptId in t?i=t[e[n].toTheConceptId]:(i={},i[r]={},t[e[n].toTheConceptId]=i);let a=yield(0,o.GetTheConcept)(e[n].typeId);try{let o=a.characterValue+"_reverse",c=t[e[n].ofTheConceptId];c&&(Array.isArray(i[r][o])?i[r][o].push(c):a.characterValue.includes("_s_")?(i[r][o]=[],i[r][o].push(c)):i[r][o]=c)}catch(e){console.log("this is error",e)}}if(0!=u.id&&0!=p.id&&u.id in t){let i,r=null!==(l=null===(a=u.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],"string"==typeof i[r]&&(i[r]={})):(i={},i[r]={},t[e[n].ofTheConceptId]=i);let c=!1,s=(yield(0,o.GetTheConcept)(e[n].typeId)).characterValue;""==s&&(s=p.characterValue,c=!0),""==s&&(s=null!==(h=null===(d=null==p?void 0:p.type)||void 0===d?void 0:d.characterValue)&&void 0!==h?h:"");try{let o=t[e[n].toTheConceptId];o&&(Array.isArray(i[r])?c?i[r].push(o[s]):i[r].push(o):Array.isArray(i[r][s])?i[r][s].push(o):s.includes("_s_")?(i[r][s]=[],c?i[r][s].push(o[s]):i[r][s].push(o)):i[r][s]=c?o[s]:o)}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i=t[n[e]];i?(i.id=n[e],u.push(i)):0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e],u.push(i))}return u}))}(d,h,n,[],a);return u}))}function T(e,t,n,c,a){return y(this,arguments,void 0,(function*(e,t,n,c,a,u="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsJustId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:c,countInfos:a,order:u})).data}catch(e){console.error("formatConnectionsJustId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let y=yield(0,i.QL)(e),v=yield(0,p.V)(a);y=f(y,u);let g=[];g=yield s(y,g,c),g=yield function(e,t){return d(this,arguments,void 0,(function*(e,t,n=[]){var o,i,c,s,a,d,h,u;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 p=0;p<e.length;p++){let f=!1,y=yield(0,l.A)(e[p].ofTheConceptId),v=yield(0,l.A)(e[p].toTheConceptId);if(n.includes(e[p].id)&&(f=!0),1==f&&0!=y.id&&0!=v.id){let n,a=yield(0,l.A)(e[p].typeId),d=null!==(i=null===(o=v.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],d in n||(n[d]={})):(n={},n[d]={},t[e[p].toTheConceptId]=n);try{let t=null!==(s=null===(c=null==y?void 0:y.type)||void 0===c?void 0:c.characterValue)&&void 0!==s?s:"none",o=y.characterValue,i=a.characterValue;""==i&&(i=t,i=r(i));let l={id:y.id,[t]:o,created_on:e[p].entryTimeStamp},h=i+"_reverse";h.includes("_s_")||("string"==typeof n[d]&&(n[d]={}),n[d][h]=l)}catch(e){console.log("this is error",e)}}if(0!=y.id&&0!=v.id){let n,o=yield(0,l.A)(e[p].typeId),i=null!==(d=null===(a=y.type)||void 0===a?void 0:a.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);try{let t=null!==(u=null===(h=null==v?void 0:v.type)||void 0===h?void 0:h.characterValue)&&void 0!==u?u:"none",c=v.characterValue,s=o.characterValue,a=!1;""==s&&(s=t,s=r(s),a=!0);let l={};l[t]={id:v.id,data:c,created_on:e[p].entryTimeStamp},isNaN(Number(s))?s.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][s]=a?l[t]:l):(Array.isArray(n[i])||(n[i]=[]),n[i].push(l[t]))}catch(e){console.log("this is error",e)}}}return t}))}(y,g,c);let m=yield function(e,t,n){return d(this,arguments,void 0,(function*(e,t,n,i=[],r){var c,s,a,d,u,p,f;(new Date).getTime();let y=[],v=[];for(let t=0;t<e.length;t++)v.push(e[t].toTheConceptId),v.push(e[t].ofTheConceptId),v.push(e[t].typeId);for(let n=0;n<e.length;n++){let o=!1,y=yield(0,l.A)(e[n].ofTheConceptId),v=yield(0,l.A)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(o=!0),1==o&&0!=y.id&&0!=v.id&&v.id in t){let o,i=yield(0,l.A)(e[n].typeId),r=null!==(s=null===(c=v.type)||void 0===c?void 0:c.characterValue)&&void 0!==s?s:"self",a=!1;e[n].toTheConceptId in t&&(a=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[r]&&(o[r]={})):(o={},o[r]={},t[e[n].toTheConceptId]=o);try{if(t[e[n].ofTheConceptId]){let c=t[e[n].ofTheConceptId];c&&(c.id=y.id,c.created_on=y.entryTimeStamp);let s=i.characterValue+"_reverse";Array.isArray(o[r][s])?o[r][s].push(c):s.includes("_s_")?(o[r][s]=[],o[r][s].push(c)):o[r][s]=c}}catch(e){console.log("this is error",e)}}if(0!=y.id&&0!=v.id&&y.id in t){let o,i=yield(0,l.A)(e[n].typeId),c=null!==(d=null===(a=y.type)||void 0===a?void 0:a.characterValue)&&void 0!==d?d:"self",s=!1;e[n].toTheConceptId in t&&(s=!0),e[n].ofTheConceptId in t?(o=t[e[n].ofTheConceptId],"string"==typeof o[c]&&(o[c]={})):(o={},o[c]={},t[e[n].ofTheConceptId]=o),h(y.id,r,o);let g=!1,m=i.characterValue;""==m&&(m=v.characterValue,g=!0),""==m&&(m=(null===(u=null==v?void 0:v.type)||void 0===u?void 0:u.characterValue)||"");try{let i=null!==(f=null===(p=null==v?void 0:v.type)||void 0===p?void 0:p.characterValue)&&void 0!==f?f:"none",s=t[e[n].toTheConceptId];if(s){let t={};t[i]={data:s[i],id:v.id,created_on:e[n].entryTimeStamp},Array.isArray(o[c])?g?o[c].push(s[m]):o[c].push(s):Array.isArray(o[c][m])?o[c][m].push(t):m.includes("_s_")?(o[c][m]=[],g?o[c][m].push(t[i]):o[c][m].push(t)):o[c][m]=g?t[i]:t,h(v.id,r,t)}}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i={};i=t[n[e]],i?i.id=n[e]:0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e]),y.push(i)}return y}))}(y,g,n,c,v);return m}))}function w(e,t,n,c,s){return y(this,arguments,void 0,(function*(e,t,n,c,s,a="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsDataId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:c,countInfos:s,order:a})).data}catch(e){console.error("GetConnectionDataPrefetch error sw: ",e),(0,o.handleServiceWorkerException)(e)}let l=yield(0,i.QL)(e),d=yield(0,p.V)(s);l=f(l,a);let y=[];y=yield function(e,t){var n=arguments;return u(this,arguments,void 0,(function*(e,t,i=[]){var r,c,s,a,l,d,h,u;const p=o.Logger.logfunction("FormatFunctionData",n),f=new Set;for(const t of e)f.add(t.ofTheConceptId),f.add(t.toTheConceptId),f.add(t.typeId);const y=Array.from(f),v=yield(0,o.GetConceptBulk)(y),g=new Map;y.forEach(((e,t)=>{g.set(e,v[t])}));for(const n of e){const e=i.includes(n.id),o=g.get(n.ofTheConceptId),p=g.get(n.toTheConceptId),f=g.get(n.typeId);if(o&&p&&0!==o.id&&0!==p.id)try{if(e){const e=null!==(c=null===(r=p.type)||void 0===r?void 0:r.characterValue)&&void 0!==c?c:"self",i=t[n.toTheConceptId]||{};i[e]=i[e]||{},t[n.toTheConceptId]=i;const l=null!==(a=null===(s=null==o?void 0:o.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"none",d=o.characterValue;(f.characterValue+"_reverse").includes("_s_")&&(t[o.id]=t[o.id]||{},t[o.id][l]=d),t[p.id]={}}else{const e=null!==(d=null===(l=o.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self",i=t[n.ofTheConceptId]||{};i[e]=i[e]||{},t[n.ofTheConceptId]=i;const r=null!==(u=null===(h=null==p?void 0:p.type)||void 0===h?void 0:h.characterValue)&&void 0!==u?u:"none",c=p.characterValue;f.characterValue.includes("_s_")&&(t[p.id]=t[p.id]||{},t[p.id][r]=c),t[o.id]={}}}catch(e){console.log("this is error",e)}}return o.Logger.logUpdate(p),t}))}(l,y,c),y=yield function(e){var t=arguments;return u(this,arguments,void 0,(function*(e,n=[],i=[]){var c,s,a,l,d,h,u,p;const f=o.Logger.logfunction("FormatFunctionDataForData",t),y=new Set;for(const t of e)y.add(t.ofTheConceptId),y.add(t.toTheConceptId),y.add(t.typeId);const v=Array.from(y),g=yield(0,o.GetConceptBulk)(v),m=new Map;g.forEach((e=>{m.set(e.id,e)}));const C=(e,t,n)=>(t in e||(e[t]=n),e[t]);for(const t of e){const e=i.includes(t.id),o=m.get(t.ofTheConceptId),f=m.get(t.toTheConceptId),y=m.get(t.typeId);if(o&&f&&0!==o.id&&0!==f.id)try{if(e){const e=null!==(s=null===(c=f.type)||void 0===c?void 0:c.characterValue)&&void 0!==s?s:"self",i=C(n,t.toTheConceptId,{});C(i,e,{});let d=null!==(l=null===(a=null==o?void 0:o.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",h=o.characterValue;const u=(y.characterValue||r(d))+"_reverse";u.includes("_s_")||("string"==typeof i[e]&&(i[e]={}),i[e][u]={id:o.id,data:{[d]:h}})}else{const e=null!==(h=null===(d=o.type)||void 0===d?void 0:d.characterValue)&&void 0!==h?h:"self",i=C(n,t.ofTheConceptId,{});C(i,e,{});let c=null!==(p=null===(u=null==f?void 0:f.type)||void 0===u?void 0:u.characterValue)&&void 0!==p?p:"none",s=f.characterValue,a=y.characterValue||r(c);const l={id:f.id,data:{[c]:s}};isNaN(Number(a))?a.includes("_s_")||("string"==typeof i[e]&&(i[e]={}),i[e][a]=l):(Array.isArray(i[e])||(i[e]=[]),i[e].push(l))}}catch(e){console.log("this is error",e)}}return o.Logger.logUpdate(f),n}))}(l,y,c);let v=yield function(e,t,n,i){var r=arguments;return u(this,arguments,void 0,(function*(e,t,n,i,c=[],s){var a,l,d,u,p,f,y;const v=o.Logger.logfunction("FormatFromConnectionsAlteredArrayExternal",r),g=new Set;for(const t of e)g.add(t.ofTheConceptId),g.add(t.toTheConceptId),g.add(t.typeId);for(const e of i)g.add(e);const m=yield(0,o.GetConceptBulk)(Array.from(g)),C=new Map;for(const e of m)e&&"number"==typeof e.id&&C.set(e.id,e);let T=[];for(let n=0;n<e.length;n++){let o=c.includes(e[n].id);const i=C.get(e[n].ofTheConceptId),r=C.get(e[n].toTheConceptId);if(o&&0!==i.id&&0!==r.id&&r.id in t){let o;const c=C.get(e[n].typeId),s=null!==(l=null===(a=r.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";let d=!1;e[n].toTheConceptId in t&&(d=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[s]&&(o[s]={})):(o={},o[s]={},t[e[n].toTheConceptId]=o);try{if(t[e[n].ofTheConceptId]){const r={id:i.id,data:t[e[n].ofTheConceptId],created_on:e[n].entryTimeStamp},a=c.characterValue+"_reverse";Array.isArray(o[s][a])?o[s][a].push(r):a.includes("_s_")?(o[s][a]=[],o[s][a].push(r)):o[s][a]=r}}catch(e){console.log("this is error",e)}}if(0!==i.id&&0!==r.id&&i.id in t){let o;const c=C.get(e[n].typeId),a=null!==(u=null===(d=i.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"self";let l=!1;e[n].toTheConceptId in t&&(l=!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),h(i.id,s,o);let y=!0,v=c.characterValue;""===v&&(v=r.characterValue,y=!0),""===v&&(v=(null===(p=null==r?void 0:r.type)||void 0===p?void 0:p.characterValue)||"");try{null===(f=null==r?void 0:r.type)||void 0===f||f.characterValue;const i=t[e[n].toTheConceptId];if(i){const l={id:r.id,data:t[e[n].toTheConceptId],created_on:e[n].entryTimeStamp};Array.isArray(o[a])?o[a].push(i):Array.isArray(o[a][v])?o[a][c.characterValue].push(l):v.includes("_s_")?(o[a][v]=[],o[a][v].push(l)):o[a][v]=l,h(r.id,s,l)}}catch(e){console.log("this is error",e)}}}for(let e=0;e<i.length;e++){const n=i[e],o=C.get(n),r={id:n,data:null!==(y=t[n])&&void 0!==y?y:{},created_on:null==o?void 0:o.entryTimeStamp};T.push(r)}return o.Logger.logUpdate(v),T}))}(l,y,[],n,c,d);return v}))}},3518:(e,t,n)=>{n.d(t,{BZ:()=>s,Xr:()=>r,ab:()=>c});var o=n(3278),i=n(490);function r(e="application/json",t="application/json"){const n={},i=o.b.BearerAccessToken;return console.log("this is the token",i),i&&(n.Authorization=`Bearer ${i}`),e&&(n["Content-Type"]=e),t&&(n.Accept=t),n}function c(e="application/json",t="",n="application/json"){""==t&&(t=o.b.BearerAccessToken);let i={};return i=""!=t?{"Content-Type":e,Authorization:"Bearer "+t,Accept:n}:{"Content-Type":e,Accept:n},i}function s(){let e=o.b.BearerAccessToken;if(""==e){let t=(0,i.s)();""!=t.token&&(o.b.BearerAccessToken=t.token,e=t.token)}let t=new Headers;return t.append("Authorization","Bearer "+e),t}},6467:(e,t,n)=>{function o(e){const t=e.lastIndexOf("_");let n=[];return n=t>0?[e.substring(0,t),e.substring(t+1,e.length)]:[e],n}n.d(t,{f:()=>o})},490:(e,t,n)=>{function o(){var e,t,n,o;let i={entity:0,userConcept:0,userId:0,token:""};try{let r=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";if(r){const c=JSON.parse(r);i.entity=null!==(e=null==c?void 0:c.entityId)&&void 0!==e?e:0,i.userConcept=null!==(t=null==c?void 0:c.userConcept)&&void 0!==t?t:0,i.userId=null!==(n=null==c?void 0:c.userId)&&void 0!==n?n:0,i.token=null!==(o=null==c?void 0:c.token)&&void 0!==o?o:""}}catch(e){console.log("This is the exception in getting user details from local storage")}return i}n.d(t,{s:()=>o})},1596:(e,t,n)=>{n.d(t,{g:()=>r});var o=n(5983),i=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function r(e,t){return i(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{!function(){const e=o.BaseUrl.NODE_CACHE_URL;if(e===o.BaseUrl.BASE_URL)throw new Error("Base Server Down");let t=sessionStorage.getItem("cacheServers");t=JSON.parse(t);const n=t.indexOf(e);if(t.includes(e)&&-1!==n&&t.splice(n,1),sessionStorage.setItem("cacheServers",JSON.stringify(t)),t.length){const e=t[0];o.BaseUrl.NODE_CACHE_URL=e}else o.BaseUrl.NODE_CACHE_URL=o.BaseUrl.BASE_URL;navigator.serviceWorker&&navigator.serviceWorker.controller&&(0,o.sendMessage)("SESSION_DATA",{type:"SESSION_DATA",data:o.BaseUrl.NODE_CACHE_URL})}();try{return yield fetch(`${o.BaseUrl.NODE_CACHE_URL}${t}`,e)}catch(n){return yield r(e,t)}}catch(e){throw e}}))}},4310:(e,t,n)=>{n.d(t,{Cp:()=>u,ix:()=>f,qj:()=>p});var o=n(5983),i=n(1596),r=n(5898),c=n(1863),s=n(7106),a=n(3518),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};const d=new Map,h=new Map;function u(e){var t=arguments;return l(this,void 0,void 0,(function*(){o.Logger.logfunction("BuildWidgetFromId",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromId",{id:e})).data}catch(e){console.error("BuildWidgetFromId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(d.has(e))return d.get(e)||n;const i=(()=>l(this,void 0,void 0,(function*(){try{let t=[],i=[],l=[],d=[],h="DESC",u=[],p={},f=(0,a.Xr)("application/json"),y=o.BaseUrl.getWidgetData()+"?id="+e;const v=yield fetch(y,{method:"GET",headers:f});if(!v.ok)return(0,c.ry)(v),console.log("This is the BuildWidgetFromId error",v.status),[];p=yield v.json(),t=p.conceptIds,i=p.linkers,l=p.reverse,d=p.mainCompositionIds,u=p.countinfo;let g=(0,r.w)(u);return n=yield(0,s.e$)(i,t,d,l,g,h),n}catch(e){throw console.log("this is the error in the build widget",e),e}finally{d.delete(e)}})))();return d.set(e,i),i}))}function p(e){var t=arguments;return l(this,void 0,void 0,(function*(){o.Logger.logfunction("BuildWidgetFromIdForLatest",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromIdForLatest",{id:e})).data}catch(e){console.error("BuildWidgetFromIdForLatest error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(h.has(e))return h.get(e)||n;const d=(()=>l(this,void 0,void 0,(function*(){try{let t,l=[],d=[],h=[],u=[],p="DESC",f=[],y={},v=(0,a.Xr)("application/json");try{let n=o.BaseUrl.getLatestWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:v})}catch(n){t=yield(0,i.g)({method:"GET",headers:v},"?id="+e)}if(!t.ok)return(0,c.ry)(t),console.log("This is the BuildWidgetFromId error",t.status),[];y=yield t.json(),l=y.conceptIds,d=y.linkers,h=y.reverse,u=y.mainCompositionIds,f=y.countinfo;let g=(0,r.w)(f);return n=yield(0,s.e$)(d,l,u,h,g,p),{data:n,mainId:y.mainId}}catch(e){throw console.log("this is the error in the build widget",e),e}finally{h.delete(e)}})))();return h.set(e,d),d}))}function f(e,t){for(let n=0;n<e.length;n++)if(e[n].id==t)return e[n]}},4287:(e,t,n)=>{n.d(t,{w:()=>c});var o=n(5983),i=n(3130),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class c{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=i.yv,this.eventHandlers={}}listenToEventType(e){if(this.eventHandlers[e])return;const t=t=>r(this,void 0,void 0,(function*(){if(this.isUpdating)console.log("rejected this",e);else{this.isUpdating=!0;let e=this;setTimeout((function(){return r(this,void 0,void 0,(function*(){let n=t;if(!e.compositionIds.includes(null==n?void 0:n.detail)){e.compositionIds.unshift(null==n?void 0:n.detail),e.listenToEvent(null==n?void 0:n.detail);let t=null==n?void 0:n.detail,i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(t,t);for(let t=0;t<i.length;t++)yield o.ConnectionData.GetConnection(i[t]).then((t=>{t.typeId==e.mainConcept?e.internalConnections.includes(t.id)||e.internalConnections.push(t.id):e.linkers.includes(t.id)||e.linkers.push(t.id),e.conceptIds.includes(t.toTheConceptId)||e.conceptIds.push(t.toTheConceptId),e.compositionIds.includes(t.ofTheConceptId)||e.compositionIds.push(t.ofTheConceptId)}))}e.isUpdating=!1,yield e.bind(),e.notify()}))}),200)}}));this.eventHandlers[e]=t,console.log("added listener",e),window.addEventListener(`${e}`,t)}listenToEvent(e){if(this.eventHandlers[e])return;const t=t=>r(this,void 0,void 0,(function*(){if(this.isUpdating)console.log("rejected this",e);else{this.isUpdating=!0;let t=this;setTimeout((function(){return r(this,void 0,void 0,(function*(){let n=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield o.ConnectionData.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()}))}),200)}}));this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}removeListenToEvent(e){const t=this.eventHandlers[e];t&&(window.removeEventListener(`${e}`,t),delete this.eventHandlers[e])}listenToEventConnectionType(e,t){window.addEventListener(`${e}`,(n=>{if(this.isUpdating)console.log("rejected this");else{this.isUpdating=!0;let n=this;setTimeout((function(){return r(this,void 0,void 0,(function*(){let i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<i.length;e++)i.typeId==t&&(yield o.ConnectionData.GetConnection(i[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()}))}),200)}}))}bind(){return r(this,void 0,void 0,(function*(){console.log("this is the old execute data")}))}run(){return r(this,void 0,void 0,(function*(){console.log("this is non subscriber data")}))}update(){return r(this,void 0,void 0,(function*(){this.isDataLoaded=!1,yield this.bind(),this.notify()}))}subscribe(e){return r(this,void 0,void 0,(function*(){return this.subscribers.push(e),console.log("again executing data"),yield this.bind(),e(this.data,this)}))}execute(){return r(this,void 0,void 0,(function*(){return yield this.run()}))}unsubscribe(e){return this.subscribers.filter((t=>t!=e)),this.subscribers.length}notify(){console.log("notifiers",this.subscribers),this.subscribers.map((e=>{console.log("notify"),e(this.data,this)}))}}},5328:(e,t,n)=>{n.d(t,{d:()=>l});var o=n(5983),i=n(3130),r=n(8939),c=n(4287),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class a extends c.w{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 s(this,void 0,void 0,(function*(){var e;if(!this.isDataLoaded){let i=yield(0,o.GetTheConcept)(this.mainConcept),r=(null===(e=i.type)||void 0===e?void 0:e.characterValue)+"_s_"+this.linker,c=yield(0,o.GetConceptByCharacterAndType)(r,16);if(c.id>0){let e=yield(0,o.GetConnectionOfTheConcept)(c.id,i.id,i.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(0,o.GetAllConnectionsOfCompositionBulk)(t)}this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()}))}build(){return s(this,void 0,void 0,(function*(){this.data=[],this.connections=yield(0,o.GetConnectionBulk)(this.linkers);for(var e=0;e<this.connections.length;e++){let t=this.connections[e].toTheConceptId,n=yield(0,o.GetTheConcept)(t);if(console.log("this is the format",this.format),this.format==i.yv){let e=yield(0,r.RW)(n.id);this.data.push(e)}else if(this.format==i.ZJ){let e=yield(0,r.kx)(n.id);this.data.push(e)}else if(this.format==i.iw){let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}else{let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}}return this.data}))}}function l(e,t,n,o,r=i.yv){return new a(e,t,n,o,r)}},5983:(e,t,n)=>{n.r(t),n.d(t,{ADMIN:()=>kn,ALLID:()=>In.BG,AccessControlService:()=>Wo,AccessTracker:()=>Be.J,AddGhostConcept:()=>Zt,Anomaly:()=>mo,BaseUrl:()=>l.B,BinaryTree:()=>Ie.W,BuildWidgetFromId:()=>Ro.Cp,BuilderStatefulWidget:()=>uo,Composition:()=>Tt,CompositionBinaryTree:()=>vt,CompositionNode:()=>ft,Concept:()=>Hn.j,ConceptsData:()=>a.I,Connection:()=>W.N,ConnectionData:()=>Ee.d,CreateComposition:()=>D.A,CreateConnection:()=>Jt.d,CreateConnectionBetweenEntityLocal:()=>xo,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>yn.h,CreateData:()=>ci,CreateDefaultConcept:()=>P.o,CreateDefaultLConcept:()=>Ht.u,CreateSession:()=>Ut,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>O.R,CreateTheCompositionWithCache:()=>It,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>Jt.F,DATAID:()=>In.y0,DATAIDDATE:()=>In.iw,DelayFunctionExecution:()=>wn,DeleteConceptById:()=>Le,DeleteConceptLocal:()=>gn,DeleteConnectionById:()=>J.m,DeleteConnectionByIdBulk:()=>J.E,DeleteConnectionByType:()=>Io.$S,DeleteConnectionByTypeBulk:()=>Io.L0,DeleteUser:()=>Se,DependencyObserver:()=>_n.w,FilterSearch:()=>Xn,FormatFromConnections:()=>Kt.vw,FormatFromConnectionsAltered:()=>Kt.y8,FreeschemaQuery:()=>ko,FreeschemaQueryApi:()=>Ao,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllTheConnectionsByTypeAndOfTheConcept:()=>Io.WC,GetComposition:()=>v.Nj,GetCompositionBulk:()=>Ve.dF,GetCompositionBulkWithDataId:()=>Ve.cw,GetCompositionFromConnectionsWithDataId:()=>Ve.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>Ve.km,GetCompositionFromConnectionsWithDataIdInObject:()=>Ve.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>Ve.Nt,GetCompositionFromConnectionsWithIndex:()=>Ve.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>Ve.hG,GetCompositionFromMemoryWithConnections:()=>v.JA,GetCompositionList:()=>T,GetCompositionListAll:()=>w,GetCompositionListAllWithId:()=>I,GetCompositionListListener:()=>On,GetCompositionListLocal:()=>G,GetCompositionListLocalWithId:()=>x,GetCompositionListWithId:()=>k,GetCompositionListWithIdUpdated:()=>N,GetCompositionListener:()=>xn,GetCompositionLocal:()=>_,GetCompositionLocalWithId:()=>b,GetCompositionWithAllIds:()=>v.Mb,GetCompositionWithCache:()=>Et,GetCompositionWithDataIdBulk:()=>Rt,GetCompositionWithDataIdWithCache:()=>xt,GetCompositionWithId:()=>v.yz,GetCompositionWithIdAndDateFromMemory:()=>v.Ez,GetConceptBulk:()=>tt.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>nt.j,GetConnectionById:()=>Oe,GetConnectionDataPrefetch:()=>Ve.QL,GetConnectionOfTheConcept:()=>F,GetLink:()=>se,GetLinkListListener:()=>$n,GetLinkListener:()=>Fn.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>jt,GetRelationLocal:()=>rn,GetRelationRaw:()=>$t,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>en.f,GetUserGhostId:()=>Xt,JUSTDATA:()=>In.ZJ,LConcept:()=>Jn,LConnection:()=>zn,LISTNORMAL:()=>In.SL,LocalConceptsData:()=>y.v,LocalSyncData:()=>Yn.H,LocalTransaction:()=>yo,Logger:()=>oo.V,LoginToBackend:()=>it,MakeTheInstanceConcept:()=>q.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>Me,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>In.yv,PRIVATE:()=>Nn,PUBLIC:()=>An,PatcherStructure:()=>qn,Prototype:()=>ui,RAW:()=>In.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>qe,RecursiveSearchApiRaw:()=>Je,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>Pn,SchemaQuery:()=>Bo,SchemaQueryListener:()=>bo,SearchAllConcepts:()=>Lt,SearchLinkInternal:()=>pn,SearchLinkInternalAll:()=>fn,SearchLinkMultipleAll:()=>Kt.cf,SearchLinkMultipleAllObservable:()=>bn,SearchLinkMultipleApi:()=>c.j,SearchQuery:()=>Pe,SearchStructure:()=>Zn,SearchWithLinker:()=>_t,SearchWithTypeAndLinker:()=>Un.zl,SearchWithTypeAndLinkerApi:()=>Sn,Selector:()=>Uo,SessionData:()=>Qn,Signin:()=>lt,Signup:()=>ct,SignupEntity:()=>st,SplitStrings:()=>s.f,StatefulWidget:()=>lo,SyncData:()=>M.Y,TrashTheConcept:()=>be,UpdateComposition:()=>Nt,UpdateCompositionLocal:()=>tn.D,UserBinaryTree:()=>Qt,Validator:()=>To,ViewInternalData:()=>ln,ViewInternalDataApi:()=>sn,WidgetTree:()=>Eo,convertFromConceptToLConcept:()=>dn.F4,convertFromLConceptToConcept:()=>dn.dp,convertWidgetTreeToWidget:()=>ei,convertWidgetTreeToWidgetWithWrapper:()=>ti,createFormFieldData:()=>wo,createPrototypeLocal:()=>yi,dispatchIdEvent:()=>Bi,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUserDetails:()=>Oo.s,getWidgetBulkFromId:()=>Ko,getWidgetFromId:()=>Zo,handleServiceWorkerException:()=>Gi,hasActivatedSW:()=>ki,init:()=>Li,recursiveFetch:()=>v.zN,recursiveFetchNew:()=>mt,removeAllChildren:()=>Do,renderLatestWidget:()=>Qo,renderPage:()=>qo,renderWidget:()=>Yo,searchLinkMultipleListener:()=>Bn,sendEmail:()=>co,sendMessage:()=>Si,serviceWorker:()=>mi,setHasActivatedSW:()=>Ni,storeToDatabase:()=>te,subscribedListeners:()=>wi,unwrapContainers:()=>ii,updateAccessToken:()=>Ai,uploadAttachment:()=>Ze,uploadFile:()=>et,uploadImage:()=>Ke,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye});var o={};n.r(o),n.d(o,{ADMIN:()=>kn,ALLID:()=>In.BG,AccessControlService:()=>Wo,AccessTracker:()=>Be.J,AddGhostConcept:()=>Zt,Anomaly:()=>mo,BaseUrl:()=>l.B,BinaryTree:()=>Ie.W,BuildWidgetFromId:()=>Ro.Cp,BuilderStatefulWidget:()=>uo,Composition:()=>Tt,CompositionBinaryTree:()=>vt,CompositionNode:()=>ft,Concept:()=>Hn.j,ConceptsData:()=>a.I,Connection:()=>W.N,ConnectionData:()=>Ee.d,CreateComposition:()=>D.A,CreateConnection:()=>Jt.d,CreateConnectionBetweenEntityLocal:()=>xo,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>yn.h,CreateData:()=>ci,CreateDefaultConcept:()=>P.o,CreateDefaultLConcept:()=>Ht.u,CreateSession:()=>Ut,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>O.R,CreateTheCompositionWithCache:()=>It,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>Jt.F,DATAID:()=>In.y0,DATAIDDATE:()=>In.iw,DelayFunctionExecution:()=>wn,DeleteConceptById:()=>Le,DeleteConceptLocal:()=>gn,DeleteConnectionById:()=>J.m,DeleteConnectionByIdBulk:()=>J.E,DeleteConnectionByType:()=>Io.$S,DeleteConnectionByTypeBulk:()=>Io.L0,DeleteUser:()=>Se,DependencyObserver:()=>_n.w,FilterSearch:()=>Xn,FormatFromConnections:()=>Kt.vw,FormatFromConnectionsAltered:()=>Kt.y8,FreeschemaQuery:()=>ko,FreeschemaQueryApi:()=>Ao,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllTheConnectionsByTypeAndOfTheConcept:()=>Io.WC,GetComposition:()=>v.Nj,GetCompositionBulk:()=>Ve.dF,GetCompositionBulkWithDataId:()=>Ve.cw,GetCompositionFromConnectionsWithDataId:()=>Ve.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>Ve.km,GetCompositionFromConnectionsWithDataIdInObject:()=>Ve.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>Ve.Nt,GetCompositionFromConnectionsWithIndex:()=>Ve.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>Ve.hG,GetCompositionFromMemoryWithConnections:()=>v.JA,GetCompositionList:()=>T,GetCompositionListAll:()=>w,GetCompositionListAllWithId:()=>I,GetCompositionListListener:()=>On,GetCompositionListLocal:()=>G,GetCompositionListLocalWithId:()=>x,GetCompositionListWithId:()=>k,GetCompositionListWithIdUpdated:()=>N,GetCompositionListener:()=>xn,GetCompositionLocal:()=>_,GetCompositionLocalWithId:()=>b,GetCompositionWithAllIds:()=>v.Mb,GetCompositionWithCache:()=>Et,GetCompositionWithDataIdBulk:()=>Rt,GetCompositionWithDataIdWithCache:()=>xt,GetCompositionWithId:()=>v.yz,GetCompositionWithIdAndDateFromMemory:()=>v.Ez,GetConceptBulk:()=>tt.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>nt.j,GetConnectionById:()=>Oe,GetConnectionDataPrefetch:()=>Ve.QL,GetConnectionOfTheConcept:()=>F,GetLink:()=>se,GetLinkListListener:()=>$n,GetLinkListener:()=>Fn.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>jt,GetRelationLocal:()=>rn,GetRelationRaw:()=>$t,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>en.f,GetUserGhostId:()=>Xt,JUSTDATA:()=>In.ZJ,LConcept:()=>Jn,LConnection:()=>zn,LISTNORMAL:()=>In.SL,LocalConceptsData:()=>y.v,LocalSyncData:()=>Yn.H,LocalTransaction:()=>yo,Logger:()=>oo.V,LoginToBackend:()=>it,MakeTheInstanceConcept:()=>q.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>Me,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>In.yv,PRIVATE:()=>Nn,PUBLIC:()=>An,PatcherStructure:()=>qn,Prototype:()=>ui,RAW:()=>In.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>qe,RecursiveSearchApiRaw:()=>Je,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>Pn,SchemaQuery:()=>Bo,SchemaQueryListener:()=>bo,SearchAllConcepts:()=>Lt,SearchLinkInternal:()=>pn,SearchLinkInternalAll:()=>fn,SearchLinkMultipleAll:()=>Kt.cf,SearchLinkMultipleAllObservable:()=>bn,SearchLinkMultipleApi:()=>c.j,SearchQuery:()=>Pe,SearchStructure:()=>Zn,SearchWithLinker:()=>_t,SearchWithTypeAndLinker:()=>Un.zl,SearchWithTypeAndLinkerApi:()=>Sn,Selector:()=>Uo,SessionData:()=>Qn,Signin:()=>lt,Signup:()=>ct,SignupEntity:()=>st,SplitStrings:()=>s.f,StatefulWidget:()=>lo,SyncData:()=>M.Y,TrashTheConcept:()=>be,UpdateComposition:()=>Nt,UpdateCompositionLocal:()=>tn.D,UserBinaryTree:()=>Qt,Validator:()=>To,ViewInternalData:()=>ln,ViewInternalDataApi:()=>sn,WidgetTree:()=>Eo,convertFromConceptToLConcept:()=>dn.F4,convertFromLConceptToConcept:()=>dn.dp,convertWidgetTreeToWidget:()=>ei,convertWidgetTreeToWidgetWithWrapper:()=>ti,createFormFieldData:()=>wo,createPrototypeLocal:()=>yi,dispatchIdEvent:()=>Bi,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUserDetails:()=>Oo.s,getWidgetBulkFromId:()=>Ko,getWidgetFromId:()=>Zo,handleServiceWorkerException:()=>Gi,hasActivatedSW:()=>ki,init:()=>Li,recursiveFetch:()=>v.zN,recursiveFetchNew:()=>mt,removeAllChildren:()=>Do,renderLatestWidget:()=>Qo,renderPage:()=>qo,renderWidget:()=>Yo,searchLinkMultipleListener:()=>Bn,sendEmail:()=>co,sendMessage:()=>Si,serviceWorker:()=>mi,setHasActivatedSW:()=>Ni,storeToDatabase:()=>te,subscribedListeners:()=>wi,unwrapContainers:()=>ii,updateAccessToken:()=>Ai,uploadAttachment:()=>Ze,uploadFile:()=>et,uploadImage:()=>Ke,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye});var i=n(5020),r=n(205),c=n(2832),s=n(6467),a=n(3026),l=n(9581),d=n(3518),h=n(1863),u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function p(e,t){var n=arguments;return u(this,void 0,void 0,(function*(){const o=oo.V.logfunction("GetAllConceptsByType",n);try{var i=new URLSearchParams;i.append("type",e),i.append("user_id",t.toString());var r=(0,d.Xr)("application/x-www-form-urlencoded");const n=yield fetch(l.B.GetAllConceptsByTypeUrl(),{method:"POST",headers:r,body:i});if(n.ok){const e=yield n.json();for(var c=0;c<e.length;c++)a.I.AddConcept(e[c])}else console.log("GetAllConceptsByType error",n.status),(0,h.ry)(n)}catch(e){e instanceof Error?console.log("GetAllConceptsByType error message: ",e.message):console.log("GetAllConceptsByType unexpected error: ",e),(0,h.Mb)(e,l.B.GetAllConceptsByTypeUrl()),(0,h.ey)(o,"GetAllConceptsByType",e)}}))}var f=n(8642),y=n(9736),v=n(8939),g=n(2013),m=n(8064),C=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function T(e,t){var n=arguments;return C(this,arguments,void 0,(function*(e,t,o=10,i=1){const r=oo.V.logfunction("GetCompositionList",n)||{};if(mi){r.serviceWorker=!0;try{const n=yield Si("GetCompositionList",{compositionName:e,userId:t,inpage:o,page:i});return oo.V.logUpdate(r),n.data}catch(e){console.error("GetCompositionList sw error: ",e),(0,h.ey)(r,"GetCompositionList",e),Gi(e)}}let c=yield(0,g.A)(e),s=[];if(c){yield p(e,t);let n=yield a.I.GetConceptsByTypeIdAndUser(c.id,t),r=o*(i-1),l=[];for(let e=r;e<r+o;e++)n[e]&&l.push(n[e].id);yield(0,f.Y)(l);for(let e=r;e<r+o;e++)if(n[e]){let t=yield(0,v.kx)(n[e].id);s.push(t)}}return oo.V.logUpdate(r),s}))}function w(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){let i=G(e,t),r=T(e,t),c=[];return Promise.race([i,r]).then((e=>{console.log("Promise result",e),c.push(...e)})).catch((e=>{console.log("error in handling",e)})),r.then((e=>{console.log("This is the second promise result",e),c.push(...e)})),c}))}function I(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){if(mi)try{return(yield Si("GetCompositionListAllWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListAllWithId sw error: ",e),Gi(e)}let i=yield(0,m.Ay)(e),r=yield(0,g.A)(e),c=[],s=[],l=[],d=[];0!=i.id&&(s=yield y.v.GetConceptsByTypeIdAndUser(i.id,t)),0!=r.id&&(yield p(e,t),d=yield a.I.GetConceptsByTypeIdAndUser(r.id,t),c=d);for(let e=0;e<s.length;e++){let t=!1;for(let n=0;n<d.length;n++)s[e].ghostId==d[n].ghostId&&(t=!0);t||l.push(s[e])}console.log("This is the all list",l);let h=[];return h=yield function(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){let i=[],r=n*(o-1),c=[],s=t.length;for(let t=r;t<r+n-s;t++)e[t]&&c.push(e[t].id);for(let e=0;e<t.length;e++){let n=yield b(t[e].id);i.push(n)}yield(0,f.Y)(c);for(let t=r;t<r+n-s;t++)if(e[t]){let n=yield(0,v.RW)(e[t].id);i.push(n)}return i}))}(c,l,n,o),h}))}function k(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){if(mi)try{return(yield Si("GetCompositionListWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListWithId sw error: ",e),Gi(e)}let i=yield(0,g.A)(e),r=[];if(i){yield p(e,t);let c=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),s=n*(o-1),l=[];for(let e=s;e<s+n;e++)c[e]&&l.push(c[e].id);yield(0,f.Y)(l);for(let e=s;e<s+n;e++)if(c[e]){let t=yield(0,v.RW)(c[e].id);r.push(t)}}return r}))}function N(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){let i=yield(0,g.w)(e),r=[];if(i){yield p(e,t);let c=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),s=n*(o-1),l=[];for(let e=s;e<s+n;e++)c[e]&&l.push(c[e].id);yield(0,f.Y)(l);for(let e=s;e<s+n;e++)if(c[e]){let t=yield(0,v.RW)(c[e].id);r.push(t)}}return r}))}var A=n(4864),L=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},S=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function _(e){return S(this,void 0,void 0,(function*(){var t,n;try{if(mi)try{return(yield Si("GetCompositionLocal",{id:e})).data}catch(e){console.error("GetCompositionLocal error sw: ",e),Gi(e)}let o=[],i={};o=yield A.G.GetConnectionsOfCompositionLocal(e);let r=[];for(let e=0;e<o.length;e++)r.includes(o[e].ofTheConceptId)||r.push(o[e].ofTheConceptId);let c=yield y.v.GetConcept(e);if(0==c.id){let t=yield function(e){var t=arguments;return L(this,void 0,void 0,(function*(){const n=oo.V.logfunction("TranslateLocalToReal",t);let o=(0,P.o)();try{var i=(0,d.ab)("application/x-www-form-urlencoded");const t=yield fetch(l.B.GetRealConceptById(),{method:"POST",headers:i,body:`id=${e}`});if(t.ok)return o=yield t.json(),o.id>0&&a.I.AddConcept(o),o;console.log("Error in Getting Translating concept Error",t.status),(0,h.ry)(t),oo.V.logUpdate(n)}catch(e){e instanceof Error?console.log("Error in Getting Translating concept error message: ",e):console.log("Error in Getting Translating concept unexpected error: ",e),(0,h.Mb)(e,l.B.GetRealConceptById()),(0,h.ey)(n,"TranslateLocalToReal",e)}return o}))}(e);if(t.id>0)return yield(0,v.Nj)(t.id)}let s=yield B(e,o,r);return i[null!==(n=null===(t=null==c?void 0:c.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:"top"]=s,i}catch(e){throw e}}))}function b(e){return S(this,void 0,void 0,(function*(){var t,n;try{if(mi)try{return(yield Si("GetCompositionLocalWithId",{id:e})).data}catch(e){console.error("GetCompositionLocalWithId error sw: ",e),Gi(e)}let o=[],i={},r={};o=yield A.G.GetConnectionsOfCompositionLocal(e);let c=[];for(let e=0;e<o.length;e++)c.includes(o[e].ofTheConceptId)||c.push(o[e].ofTheConceptId);let s=yield y.v.GetConcept(e);if(0!=s.id){let r=yield B(e,o,c);i[null!==(n=null===(t=null==s?void 0:s.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 B(e,t,n){return S(this,arguments,void 0,(function*(e,t,n,o=[]){var i,r,c;let s={},a=[],l=yield y.v.GetConcept(e);if(0!=l.id&&null==l.type){let e=l.typeId,t=yield y.v.GetConcept(e);l.type=t}if(null===(i=null==l?void 0:l.type)||void 0===i?void 0:i.characterValue,!n.includes(e))return null==l?void 0:l.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 y.v.GetConcept(e);if(0!=i.id&&null==(null==i?void 0:i.type)){let e=i.typeId,t=yield y.v.GetConcept(e);i.type=t}let l="the_",d=(null!==(c=null===(r=null==i?void 0:i.type)||void 0===r?void 0:r.characterValue)&&void 0!==c?c:"top").replace(l,"");if(isNaN(Number(d))){if(d){const o=yield B(e,t,n);s[d]=o}}else{const o=yield B(e,t,n);a[d]=o,s=a}}return s}))}var E=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function G(e,t){return E(this,void 0,void 0,(function*(){if(mi)try{return(yield Si("GetCompositionListLocal",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocal error sw: ",e),Gi(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield y.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield _(e[t].id);o.push(n)}}return o}catch(e){throw e}}))}function x(e,t){return E(this,void 0,void 0,(function*(){if(mi)try{return(yield Si("GetCompositionListLocalWithId",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocalWithId error sw: ",e),Gi(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield y.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield b(e[t].id);o.push(n)}}return o}catch(e){throw e}}))}var R=n(2),D=n(1218),O=n(999),U=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function F(e,t,n){var o=arguments;return U(this,arguments,void 0,(function*(e,t,n,i=10,r=1){const c=oo.V.logfunction("GetConnectionOfTheConcept",o)||{};let s=[];try{if(mi){c.serviceWorker=!0;try{const o=yield Si("GetConnectionOfTheConcept",{typeId:e,ofTheConceptId:t,userId:n,inpage:i,page:r});return oo.V.logUpdate(c),o.data}catch(e){console.error("GetConnectionOfTheConcept sw error: ",e),(0,h.ey)(c,"GetConnectionOfTheConcept",e),Gi(e)}}let o=new URLSearchParams;o.append("typeId",`${e}`),o.append("ofTheConceptId",`${t}`),o.append("userId",`${n}`),o.append("inpage",`${i}`),o.append("page",`${r}`);let a=(0,d.Xr)("application/x-www-form-urlencoded");const u=yield fetch(l.B.GetAllConnectionsOfConceptUrl(),{method:"POST",headers:a,body:o});return u.ok?s=yield u.json():((0,h.ey)(c,"GetConnectionOfTheConcept",u.status),(0,h.ry)(u),console.log("Get connection of concept error",u.status)),oo.V.logUpdate(c),s}catch(e){e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),(0,h.Mb)(e,l.B.GetAllConnectionsOfConceptUrl()),(0,h.ey)(c,"GetConnectionOfTheConcept",e)}}))}var W=n(2155),M=n(442),P=n(7282),V=n(5976),j=n(7273),$=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function H(e,t,n,o){return $(this,arguments,void 0,(function*(e,t,n,o,i=1,r=4){if(e>0&&n>0){var c=t,s=yield V.p.getId(),a=new W.N(s,e,n,c,o,i,r);return e==n?(a.ofTheConceptId=0,a.toTheConceptId=1,a):(a.toUpdate=!0,a.isTemp=!1,M.Y.AddConnection(a),a)}throw new j.z("cannot create connection because id are negative ",!1,400,"")}))}var J=n(4818),z=n(7876),q=n(8407),Q=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Y(e,t,n){return Q(this,arguments,void 0,(function*(e,t,n,o=!1,i=!1){var r,c;if(mi)try{return(yield Si("CreateConnectionBetweenTwoConcepts",{ofTheConcept:e,toTheConcept:t,linker:n,both:o,count:i})).data}catch(e){console.error("CreateConnectionBetweenTwoConcepts sw error: ",e),Gi(e)}let s=e.userId;if(o){let o=n+"_by",c=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,s));let a=yield(0,q.A)("connection",c,!1,999,999,999),l=new W.N(0,t.id,e.id,s,a.id,1e3,4);M.Y.AddConnection(l)}let a=n+"_s",l=(null===(c=e.type)||void 0===c?void 0:c.characterValue)+"_s_"+a;i&&(yield X(a,e,s));let d=yield(0,q.A)("connection",l,!1,999,999,999),h=new W.N(0,e.id,t.id,s,d.id,1e3,4);return M.Y.AddConnection(h),h}))}function X(e,t){return Q(this,arguments,void 0,(function*(e,t,n=null){var o;let i=t,r=null!=n?n:t.userId,c=e+"_count",s=(null===(o=t.type)||void 0===o?void 0:o.characterValue)+"_s_"+c,a=yield(0,q.A)("connection",s,!1,r,4,999),l=yield F(a.id,t.id,r,10,1),d=[],h=(0,P.o)();for(let e=0;e<l.length;e++){let t=yield(0,z.A)(l[e].toTheConceptId);d.push(t)}if(d.length<1)h=yield(0,q.A)("count","1",!1,r,4,999);else{let e=d[0],t=0;try{t=Number(e.characterValue)}catch(e){t=0}t+=1,h=yield(0,q.A)("count",t.toString(),!1,r,4,999);for(let e=0;e<l.length;e++)(0,J.m)(l[e].id)}let u=new W.N(0,i.id,h.id,i.userId,a.id,1e3,4);yield M.Y.AddConnection(u)}))}function Z(e,t,n){return Q(this,arguments,void 0,(function*(e,t,n,o=!1,i=!1){var r,c;let s=e.userId;if(o){let o=n+"_by",c=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,s));let a=yield(0,q.A)("connection",c,!1,999,999,999),l=new W.N(0,t.id,e.id,s,a.id,1e3,4);M.Y.AddConnection(l)}let a=n+"_s",l=(null===(c=e.type)||void 0===c?void 0:c.characterValue)+"_s_"+a;i&&(yield X(a,e,s));let d=yield(0,q.A)("connection",l,!1,999,999,999);return yield H(e.id,e.userId,t.id,d.id,1e3,4)}))}var K=n(5868),ee=(n(3655),function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))});function te(e,t){const n=oo.V.logfunction("storeToDatabase",[e,"noindexdb"]);oo.V.logUpdate(n)}function ne(e,t,n){return ee(this,void 0,void 0,(function*(){const t=oo.V.logfunction("getFromDatabaseWithType",[e,"noindexdb"]);oo.V.logUpdate(t)}))}function oe(e){return ee(this,void 0,void 0,(function*(){const t=oo.V.logfunction("getObjectsFromIndexDb",[e,"noindexdb"]);oo.V.logUpdate(t)}))}var ie=n(1666),re=n(4402),ce=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function se(e,t){var n=arguments;return ce(this,arguments,void 0,(function*(e,t,o=10,i=1){var r;const c=oo.V.logfunction("GetLink",n)||{};if(mi){c.serviceWorker=!0;try{const n=yield Si("GetLink",{id:e,linker:t,inpage:o,page:i});return oo.V.logUpdate(c),n.data}catch(e){console.error("GetLink sw error: ",e),(0,h.ey)(c,"GetLink",e),Gi(e)}}let s=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield F(d.id,a.id,a.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);yield(0,f.Y)(t);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield(0,z.A)(n),i=yield(0,v.Ez)(o.id);s.push(i)}}return oo.V.logUpdate(c),s}))}function ae(e,t){var n=arguments;return ce(this,arguments,void 0,(function*(e,t,o=10,i=1){var r;const c=oo.V.logfunction("GetLinkRaw",n);let s=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield F(d.id,a.id,a.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(0,z.A)(n);s.push(o)}}return oo.V.logUpdate(c),s}))}var le=n(8357),de=n(1708),he=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};const ue=new Map;function pe(e,t){var n=arguments;return he(this,void 0,void 0,(function*(){const t=oo.V.logfunction("MakeTheTypeConceptApi",n);let o=(0,P.o)();if(ue.has(e))return ue.get(e)||o;const i=(()=>he(this,void 0,void 0,(function*(){try{if(o=yield(0,de.Az)(e),0==o.id||4==o.typeId){let n=(0,d.Xr)("application/x-www-form-urlencoded");const i=yield fetch(l.B.MakeTheTypeConceptUrl(),{method:"POST",headers:n,body:`type=${e}`});if(!i.ok)throw(0,h.ry)(i),new Error(`Error! status: ${i.status}`);let r=yield i.json();o=r,oo.V.logUpdate(t)}}catch(e){e instanceof Error?console.log("Make The Type Concept Api error : ",e.message):console.log("Make The Type Concept Api error : ",e),(0,h.Mb)(e,l.B.MakeTheTypeConceptUrl()),(0,h.ey)(t,"MakeTheTypeConceptApi",e)}finally{ue.delete(e)}return o})))();return ue.set(e,i),i}))}var fe=n(8675),ye=n(6058),ve=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function ge(e){var t=arguments;return ve(this,void 0,void 0,(function*(){const n=oo.V.logfunction("GetLinkerConnectionFromConcepts",t);let o=yield(0,fe.l)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return oo.V.logUpdate(n),o}))}function me(e){var t=arguments;return ve(this,void 0,void 0,(function*(){const n=oo.V.logfunction("GetLinkerConnectionToConcepts",t);let o=yield(0,ye.W)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return oo.V.logUpdate(n),o}))}var Ce=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},Te=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},we=n(6963),Ie=n(2202),ke=n(5457),Ne=n(991),Ae=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Le(e){var t=arguments;return Ae(this,void 0,void 0,(function*(){const n=oo.V.logfunction("DeleteConceptById",t);if(mi)try{return(yield Si("DeleteConceptById",{id:e})).data}catch(e){console.error("DeleteConceptById sw error: ",e),Gi(e)}if(e>0){var o=yield a.I.GetConcept(e);if(o.id>0){var i=o.typeId,r=o.characterValue;yield ke.c.removeTypeConcept(i,e),yield we.f.removeNodeByCharacter(r,e),yield function(e){var t=arguments;return Te(this,void 0,void 0,(function*(){let n=!1;const o=oo.V.logfunction("DeleteTheConcept",t);try{const t=new FormData;t.append("id",e.toString());let i=(0,d.BZ)();const r=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",headers:i,body:t});r.ok?n=(yield r.json()).success:(console.log("Delete concept error",r.status),(0,h.ry)(r)),n&&a.I.AddNpc(e),oo.V.logUpdate(o)}catch(e){e instanceof Error?console.log("Delete concept error message: ",e.message):console.log("Delete concept unexpected error: ",e),(0,h.Mb)(e,l.B.DeleteConceptUrl()),(0,h.ey)(o,"DeleteTheConcept",e)}return n}))}(e),yield Ie.W.removeNodeFromTree(e),yield Ne.H.removeNodeFromTree(e)}}else y.v.RemoveConceptById(e);oo.V.logUpdate(n)}))}function Se(e){return Ae(this,void 0,void 0,(function*(){if(mi)try{return(yield Si("DeleteUser",{id:e})).data}catch(e){console.error("DeleteUser sw error: ",e),Gi(e)}e>0?function(e){var t=arguments;Ce(this,void 0,void 0,(function*(){const n=oo.V.logfunction("DeleteUserInBackend",t);try{var o=(0,d.ab)("application/json","");let t=l.B.DeleteUserUrl();t=t+"?conceptId="+e+"&apiKey=freeschema";const i=yield fetch(t,{method:"POST",headers:o});if(i.ok){let e=yield i.json(),t=Number(e.data);return console.log("this is the delete email concept",t),Le(t),oo.V.logUpdate(n),t}throw(0,h.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,h.Mb)(e,l.B.DeleteConceptUrl()),(0,h.ey)(n,"DeleteUserInBackend",e)}}))}(e):y.v.RemoveConceptById(e)}))}var _e=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function be(e,t){return _e(this,void 0,void 0,(function*(){try{const n=new Headers;n.append("Authorization","Bearer "+t);const o=new FormData;o.append("id",e.toString());const i=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",body:o,headers:n});if(!i.ok)throw(0,h.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,h.Mb)(e,l.B.DeleteConceptUrl())}}))}var Be=n(1735),Ee=n(8286),Ge=n(1596),xe=n(3278),Re=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};var De=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Oe(e){var t=arguments;return De(this,void 0,void 0,(function*(){const n=oo.V.logfunction("GetConnectionById",t);if(console.log("AccessTracker activation status from GetConnectionById"),!0===Be.J.activateStatus)try{Be.J.incrementConnection(e)}catch(e){console.error("Error adding connection in access tracker"),oo.V.log("ERROR","Error Adding Connection")}if(mi)try{return(yield Si("GetConnectionById",{id:e})).data}catch(e){console.error("GetConnectionById sw error: ",e),Gi(e)}let o=yield Ee.d.GetConnection(e);return null!=o&&0!=o.id||null==e||null==e||(o=yield function(e){var t=arguments;return Re(this,void 0,void 0,(function*(){const n=oo.V.logfunction("GetConnection",t);let o=yield Ee.d.GetConnection(e);try{if(0!=o.id)return o;{const t=new FormData;t.append("id",e.toString());const i={method:"POST",headers:{Authorization:"Bearer "+xe.b.BearerAccessToken},body:t};let r;try{r=yield fetch(l.B.GetConnectionUrl(),i)}catch(e){r=yield(0,Ge.g)(i,"/api/get-connection-by-id")}return yield function(e,t){return Re(this,void 0,void 0,(function*(){e.ok?(t=yield e.json(),Ee.d.AddConnection(t)):((0,h.ry)(e),console.log("Get Connection Error",e.status))}))}(r,o),oo.V.logUpdate(n),o}}catch(e){e instanceof Error?console.log("Get Connection error message: ",e.message):console.log("Get Connection unexpected error: ",e),(0,h.Mb)(e,l.B.GetConnectionUrl()),(0,h.ey)(n,"GetConnection",e)}}))}(e)),oo.V.logUpdate(n),o}))}var Ue=n(2212),Fe=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},We=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Me(e,t,n){return We(this,arguments,void 0,(function*(e,t,n,o=4,i=999){const r=oo.V.logfunction("MakeTheTimestamp")||{};if(mi){r.serviceWorker=!0;try{const c=yield Si("MakeTheTimestamp",{type:e,referent:t,userId:n,accessId:o,sessionInformationId:i});return oo.V.logUpdate(r),c.data}catch(e){console.error("MakeTheTimestamp sw error: ",e),(0,h.ey)(r,"MakeTheTimestamp",e),Gi(e)}}let c,s="",a=e.startsWith("the_"),l=(0,P.o)();s=a?e:"the_"+e,l=yield pe(s,n);let d=yield function(e,t,n,o,i,r,c){return Fe(this,void 0,void 0,(function*(){let n=yield(0,re.A)(e,o),i=n;return 0==i.id&&(n=yield(0,Ue.Ay)(e,t,4,o,0,r,c),i=n),i}))}(t,n,0,l.id,0,o,s);return c=d,oo.V.logUpdate(r),c}))}class Pe{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 Ve=n(6687),je=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function $e(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o="",i=[]){const r=oo.V.logfunction("RecursiveSearchApi",e)||{};let c=[];try{if(mi){r.serviceWorker=!0;try{const e=yield Si("RecursiveSearchApi",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return oo.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApi sw error: ",e),(0,h.ey)(r,"RecursiveSearchApi",e),Gi(e)}}let e=new Pe;e.composition=t,e.listLinkers=n,e.fullLinkers=i,e.textSearch=o;let s=JSON.stringify(e),a=(0,d.Xr)("application/json");const u=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:a,body:s});if(u.ok){const e=yield u.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,c=yield(0,Ve.p8)(t,n)}else console.log("recursive search error ",u.status),(0,h.ey)(r,"RecursiveSearchApi",u.status),(0,h.ry)(u);oo.V.logUpdate(r)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,h.ey)(r,"RecursiveSearchApi",e),(0,h.Mb)(e,l.B.RecursiveSearchUrl())}return c}))}function He(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o=""){const i=oo.V.logfunction("RecursiveSearchApiWithInternalConnections",e)||{};let r=[];try{if(mi){i.serviceWorker=!0;try{const e=yield Si("RecursiveSearchApiWithInternalConnections",{composition:t,listLinkers:n,textSearch:o});return oo.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiWithInternalConnections sw error: ",e),(0,h.ey)(i,"RecursiveSearchApiWithInternalConnections",e),Gi(e)}}let e=new Pe;e.composition=t,e.listLinkers=n,e.textSearch=o;let c=JSON.stringify(e),s=(0,d.Xr)("application/json");const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:c});if(a.ok){const e=yield a.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,r=yield(0,Ve.km)(t,n),oo.V.logUpdate(i)}else console.log("recursive search error ",a.status),(0,h.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",a.status),(0,h.ry)(a)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,h.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,h.Mb)(e,l.B.RecursiveSearchUrl())}return r}))}function Je(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o="",i=[]){const r=oo.V.logfunction("RecursiveSearchApiRaw",e)||{};try{if(mi){r.serviceWorker=!0;try{const e=yield Si("RecursiveSearchApiRaw",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return oo.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApiRaw sw error: ",e),(0,h.ey)(r,"RecursiveSearchApiRaw",e),Gi(e)}}let e=new Pe;e.composition=t,e.listLinkers=n,e.textSearch=o,e.fullLinkers=i;let c=JSON.stringify(e),s=(0,d.Xr)("application/json");const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:c});if(a.ok){const e=yield a.json();return e.compositionIds,e.internalConnections,e.externalConnections,oo.V.logUpdate(r),e}return console.log("recursive search error ",a.status),(0,h.ey)(r,"RecursiveSearchApiRaw",a.status),(0,h.ry)(a),oo.V.logUpdate(r),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,h.ey)(r,"RecursiveSearchApiRaw",e),(0,h.Mb)(e,l.B.RecursiveSearchUrl())}}))}function ze(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o=""){const i=oo.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(mi){i.serviceWorker=!0;try{const e=yield Si("RecursiveSearchApiRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return oo.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiRawFullLinker sw error: ",e),(0,h.ey)(i,"RecursiveSearchApiRawFullLinker",e),Gi(e)}}let e=new Pe;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),c=(0,d.Xr)("application/json");const s=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:r});if(s.ok){const e=yield s.json();return e.compositionIds,e.internalConnections,e.externalConnections,oo.V.logUpdate(i),e}return console.log("recursive search error ",s.status),(0,h.ey)(i,"RecursiveSearchApiRawFullLinker",s.status),(0,h.ry)(s),oo.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,h.Mb)(e,l.B.RecursiveSearchUrl()),(0,h.ey)(i,"RecursiveSearchApiRawFullLinker",e)}}))}function qe(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o=""){const i=oo.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(mi)try{i.serviceWorker=!0;const e=yield Si("RecursiveSearchApiNewRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return oo.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiNewRawFullLinker sw error: ",e),(0,h.ey)(i,"RecursiveSearchApiNewRawFullLinker",e),Gi(e)}let e=new Pe;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),c=(0,d.Xr)("application/json");const s=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:r});if(s.ok){const e=yield s.json();return e.compositionIds,e.internalConnections,e.externalConnections,oo.V.logUpdate(i),e}return console.log("recursive search error ",s.status),(0,h.ey)(i,"RecursiveSearchApiNewRawFullLinker",s.status),(0,h.ry)(s),oo.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,h.Mb)(e,l.B.RecursiveSearchUrl()),(0,h.ey)(i,"RecursiveSearchApiNewRawFullLinker",e)}}))}var Qe=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};const Ye=["image/jpeg","image/jpg","image/png","image/webp"],Xe=["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","text/plain","application/pdf"];function Ze(e,t){return Qe(this,void 0,void 0,(function*(){const n=oo.V.logfunction("uploadAttachment");try{console.log("File Type",e.type);const o=new FormData;let i;if(Xe.includes(e.type))o.append("file",e,e.name),i=yield et(o,t);else{if(!Ye.includes(e.type))return{message:"Invalid File Format",success:!1};o.append("image",e,e.name),i=yield Ke(o,t)}return(null==i?void 0:i.data)?(oo.V.logUpdate(n),{message:"Upload Success",success:!0,url:i.data}):{message:"File Upload Failed",success:!1}}catch(e){throw console.error(e),(0,h.ey)(n,"uploadAttachment",e),e}}))}function Ke(e){return Qe(this,arguments,void 0,(function*(e,t=""){const n=oo.V.logfunction("uploadImage");try{const o=yield fetch(l.B.uploadImageUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(null==o?void 0:o.text());const t=yield null==o?void 0:o.text();return console.error(`${o.status} ${t}`),oo.V.logUpdate(n),null}return yield o.json()}catch(e){return console.error(e),(0,h.ey)(n,"uploadImage",e),null}}))}function et(e){return Qe(this,arguments,void 0,(function*(e,t=""){const n=oo.V.logfunction("uploadFile");try{const o=yield fetch(l.B.uploadFileUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(o.text());const t=yield o.text();return console.error(`${o.status} ${t}`),null}return oo.V.logUpdate(n),yield o.json()}catch(e){return console.error(e),(0,h.ey)(n,"uploadFile",e),null}}))}var tt=n(1239),nt=n(7467),ot=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function it(e,t){var n=arguments;return ot(this,void 0,void 0,(function*(){const o=oo.V.logfunction("LoginToBackend",n);try{let n={email:e,password:t},i=new Headers;i.append("Content-Type","application/json");let r=JSON.stringify(n);const c=yield fetch(l.B.LoginUrl(),{method:"POST",headers:i,body:r}),s=yield c.json();if(c.ok)return xe.b.BearerAccessToken=s.data.token,oo.V.logUpdate(o),s;console.log("Login tsccs error message: ",c.status),(0,h.ER)(c,s)}catch(e){e instanceof Error?console.log("Login tsccs error message: ",e.message):console.log(" Login tsccs unexpected error: ",e),(0,h.Mb)(e,l.B.LoginUrl()),(0,h.ey)(o,"LoginToBackend",e)}}))}var rt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function ct(e){return rt(this,void 0,void 0,(function*(){const t=yield function(){return rt(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}:(0,h.ER)(o,i),n}catch(t){console.log("Signup Error: ",t),(0,h.Mb)(t,e)}}))}(l.B.SignupUrl(),e);return t}))}function st(e){return rt(this,void 0,void 0,(function*(){const t=l.B.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");throw new Error(n.status)}))}var at=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function lt(e){return at(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=l.B.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},Ai(e.token)}else(0,h.ER)(e,r);return n}catch(e){console.log("Sign in api error",e),(0,h.Mb)(e,i)}}))}var dt=n(9934),ht=n(4485);function ut(e=[],t){Array.isArray(e)&&e.splice(e.findIndex((function(e){return e.id===t.id})),1)}function pt(e=[],t){Array.isArray(e)&&e.splice(e.findIndex((function(e){return e.id===t.id})),1)}class ft{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&&(vt.removeNodeFromTree(this.key),1))}saveToCache(e){this.value.cached=e}addNode(e,t,n){if(null==t)return 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(),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 yt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class vt{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 ft(e.id,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return yt(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return yt(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}}vt.root=null;var gt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function mt(e,t,n,o){return gt(this,arguments,void 0,(function*(e,t,n,o,i=[]){var r,c;let s={};const l=[];if(0==e)return"";let d=Ct(n,e);if(null!=d&&0!=d.id||null==e||null==e||(d=yield(0,z.A)(e)),0!=d.id&&null==d.type){const e=d.typeId;let t=Ct(n,e);d.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,z.A)(e),d.type=t)}if(!o.includes(e))return null==d?void 0:d.characterValue;if(i.includes(e))return"";i.push(e);for(let d=0;d<t.length;d++)if(t[d].ofTheConceptId==e){const h=t[d].toTheConceptId;if(o.includes(e)){let e=Ct(n,h);if(null!=e&&0!=e.id||null==h||null==h||(e=yield(0,z.A)(h)),0!=e.id&&null==(null==e?void 0:e.type)){const t=e.typeId;let n=yield a.I.GetConcept(t);e.type=n,null==n&&null!=t&&null!=t&&(n=yield(0,z.A)(t),e.type=n)}const d="the_",u=(null!==(c=null===(r=null==e?void 0:e.type)||void 0===r?void 0:r.characterValue)&&void 0!==c?c:"").replace(d,"");if(isNaN(Number(u))){if(u){const e=yield mt(h,t,n,o,i);s[u]=e}}else{const e=yield mt(h,t,n,o,i);l[u]=e,s=l}}}return s}))}function Ct(e,t){let n=(0,P.o)();for(let o=0;o<e.length;o++)if(t==e[o].id)return n=e[o],n;return n}class Tt{constructor(){this.id=0,this.mainConcept=(0,P.o)(),this.connections=[],this.concepts=[],this.subcompositions=[],this.cached={}}updateCache(){return e=this,t=void 0,o=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 mt(this.id,this.connections,this.concepts,this.subcompositions,[])},new((n=void 0)||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}));var e,t,n,o}UpdateAcrossDistributedSystem(){var e,t;try{0!=this.id&&(t=null===(e=this.id)||void 0===e?void 0:e.toString(),l.B.MQTT_CONNECTION&&l.B.MQTT_CONNECTION.publish("compositionUpdate",t))}catch(e){console.log("Error while publishing message",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 wt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function It(e){return wt(this,arguments,void 0,(function*(e,t=null,n=null,o=null,i=null,r=null,c=null,s=null){const a=null!=i?i:999,l=null!=r?r:4,d=null!=c?c:999;let h=null!=o?o:0,u=(0,P.o)();null==s&&(s=new Tt);for(const o in e)if("object"==typeof e[o]||Array.isArray(e[o])){const p=yield(0,q.A)(o,"",!0,a,l,d);if(null==t&&null==n){let t=h;u=p,t=p.id,h=p.id,s.concepts.push(p),s.id=p.id,yield It(e[o],p.id,p.userId,t,i,r,c,s)}else{const a=null!=t?t:999,l=null!=n?n:999,d=h;u=p,s.concepts.push(p);const f=yield(0,ie.q)(a,l,p.id,d);s.connections.push(f),yield It(e[o],p.id,p.userId,d,i,r,c,s)}null!=e[o]&&null!=e[o]&&s.subcompositions.push(p.id)}else{const i=null!=t?t:999,r=null!=n?n:999,c=h,u=yield(0,q.A)(o,e[o],!1,a,l,d);s.concepts.push(u);const p=yield(0,ie.q)(i,r,u.id,c);s.connections.push(p)}return u}))}var kt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Nt(e){return kt(this,void 0,void 0,(function*(){const t=oo.V.logfunction("UpdateComposition")||{};if(mi){t.serviceWorker=!0;try{const n=yield Si("UpdateComposition",{patcherStructure:e});return oo.V.logUpdate(t),n.data}catch(e){console.error("UpdateComposition sw error: ",e),(0,h.ey)(t,"UpdateComposition",e),Gi(e)}}const n=e.userId,o=e.sessionId,i=e.accessId;let r=[];const c=[];let s=(0,P.o)(),a=(0,P.o)();const l=[];let d=e.compositionId;const u=e.ofTheCompositionId;let p=[];if(d<0){let e=yield(0,z.A)(d,n);if(!(e.id>0))return null;d=e.id}r=yield(0,R.s)(d);const f=[],y=new Tt,v=[];y.id=d,y.isUpdating();let g=[];for(let e=0;e<r.length;e++)(0,dt.A)(v,r[e].ofTheConceptId),(0,dt.A)(f,r[e].ofTheConceptId),(0,dt.A)(f,r[e].toTheConceptId),g.push(r[e].ofTheConceptId);y.subcompositions=v,y.connections=r;for(let e=0;e<f.length;e++){const t=yield(0,z.A)(f[e]);d==f[e]&&(s=t),u==f[e]&&(a=t),c.push(t)}const m=e.patchObject;for(const e in m){let t=(0,P.o)();const r=m[e];let d=s;if(a.id>0&&(d=a),Array.isArray(r)||"object"==typeof r){t=yield(0,q.A)(e,"",!0,s.userId,4,999),y.subcompositions.push(t.id);const n=(0,ht.vo)(c,t);for(let e=0;e<n.length;e++)if(n[e].id>0){const t=(0,ht.wS)(y.connections,n[e].id);p=p.concat(t),l.push(n[e])}yield It(m[e],t.id,t.userId,s.id,s.userId,4,999,y)}else{t=yield(0,q.A)(e,r,!1,n,i,o);const s=(0,ht.vo)(c,t);for(let e=0;e<s.length;e++)if(s[e].id>0){const t=(0,ht.wS)(y.connections,s[e].id);p=p.concat(t),l.push(s[e])}}const h=(0,ie.q)(d.id,d.userId,t.id,s.id);c.push(t),y.connections.push(h)}for(let e=0;e<p.length;e++)pt(y.connections,p[e]),(0,J.m)(p[e].id);for(let e=0;e<l.length;e++)ut(c,l[e]);y.concepts=y.concepts.concat(c),y.mainConcept=s,y.id=s.id,yield y.updateCache(),vt.addCompositionToTree(y),M.Y.SyncDataOnline();let C=y.GetDataCache();return oo.V.logUpdate(t),C}))}var At=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Lt(e,t,n,o){return At(this,arguments,void 0,(function*(e,t,n,o,i=10,r=1){var c=(0,d.ab)("application/x-www-form-urlencoded",o),s=new URLSearchParams;s.append("type",e),s.append("search",t),s.append("composition",n),s.append("inpage",i.toString()),s.append("page",r.toString());const a=l.B.SearchCompositionsUrl()+"?"+s.toString();try{const e=yield fetch(a,{method:"GET",headers:c});return e.ok?yield e.json():((0,h.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,h.Mb)(e,a)}}))}var St=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function _t(e){return St(this,arguments,void 0,(function*(e,t=""){var n=(0,d.ab)("application/json",t);const o=l.B.SearchLinkMultipleAll(),i=JSON.stringify(e);try{const e=yield fetch(o,{method:"POST",headers:n,body:i});return e.ok?yield e.json():(console.log("This is the searching error",e.status),(0,h.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,h.Mb)(e,o)}}))}var bt=n(7139),Bt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Et(e){return Bt(this,arguments,void 0,(function*(e,t=[]){var n,o;let i=[];const r=[];let c={},s={};const l=yield vt.getNodeFromTree(e),d=[];let h=yield a.I.GetConcept(e);if(0==h.id&&null!=e&&null!=e&&(h=yield(0,bt.r)(e)),null==l){let a=[];a=t.length>0?Gt(e,t):yield(0,R.s)(e),i=a;for(let e=0;e<i.length;e++)d.includes(i[e].ofTheConceptId)||(d.push(i[e].ofTheConceptId),r.push(i[e].ofTheConceptId)),r.includes(i[e].toTheConceptId)||r.push(i[e].toTheConceptId);Dt(h,i,r,d);let l=[];s=yield(0,v.zN)(e,i,d,l),c[null!==(o=null===(n=null==h?void 0:h.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=s}else s=l.value.GetDataCache(),c=s;return 0==h.id?"":c}))}function Gt(e,t){const n=[];for(let o=0;o<t.length;o++)t[o].typeId==e&&n.push(t[o]);return n}function xt(e){return Bt(this,arguments,void 0,(function*(e,t=[]){var n,o;let i={},r=[];const c=[];let s;const l={},d=yield vt.getNodeFromTree(e),h=[];let u=yield a.I.GetConcept(e);if(0==u.id&&null!=e&&null!=e&&(u=yield(0,bt.r)(e)),null==d){let a=[];a=t.length>0?Gt(e,t):yield(0,R.s)(e),r=a;for(let e=0;e<r.length;e++)h.includes(r[e].ofTheConceptId)||(h.push(r[e].ofTheConceptId),c.push(r[e].ofTheConceptId)),c.includes(r[e].toTheConceptId)||c.push(r[e].toTheConceptId);Dt(u,r,c,h),s=yield(0,v.zN)(e,r,h),l[null!==(o=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=s,i.created_at=u.entryTimeStamp,i.data=l,i.id=e}else s=d.value.GetDataCache(),i=s;return 0==u.id?"":i}))}function Rt(e,t){return Bt(this,void 0,void 0,(function*(){let n=[];const o=[];n=yield(0,nt.j)(t);for(let t=0;t<e.length;t++){const i=yield xt(e[t],n);i&&o.push(i)}return o}))}function Dt(e,t,n,o){return Bt(this,void 0,void 0,(function*(){const i=new Tt,r=yield function(e){return Bt(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 a.I.GetConcept(e[o]);0==i.id?n.push(e[o]):t.push(i)}return 0==(null==n?void 0:n.length)||(t=yield(0,tt.I)(n)),t}))}(n);i.connections=t,i.concepts=r,i.id=e.id,i.subcompositions=o,i.mainConcept=e;const c=yield mt(e.id,t,r,o,[]);i.cached=c,vt.addCompositionToTree(i)}))}var Ot=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Ut(e){return Ot(this,void 0,void 0,(function*(){try{var t=(0,d.Xr)();const n=JSON.stringify(e),o=yield fetch(l.B.CreateSessionId(),{method:"POST",headers:t,body:n});return o.ok?o.json():(console.log("Creating session failed",yield o.json()),(0,h.ry)(o),null)}catch(e){console.log("Creating session failed",e),(0,h.Mb)(e,l.B.CreateSessionId())}}))}var Ft=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Wt(e,t){return Ft(this,void 0,void 0,(function*(){try{var n=(0,d.Xr)("application/x-www-form-urlencoded");const o=new URLSearchParams;o.append("sessionId",e.toString()),o.append("url",t);const i=yield fetch(l.B.CreateSessionVisitUrl(),{method:"POST",headers:n,body:o});return i.ok?i.json():(console.log("Creating session url failed",yield i.json()),(0,h.ry)(i),null)}catch(e){console.log("Creating session url failed",e),(0,h.Mb)(e,l.B.CreateSessionVisitUrl())}}))}var Mt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Pt(e,t,n){return Mt(this,arguments,void 0,(function*(e,t,n,o=10,i=1){let r=[];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 s=(0,d.Xr)("application/x-www-form-urlencoded");const a=yield fetch(l.B.GetAllConnectionsToConceptUrl(),{method:"POST",headers:s,body:c});return a.ok?r=yield a.json():(console.log("Get connection of concept error",a.status),(0,h.ry)(a)),r}catch(e){throw e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),e}}))}var Vt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function jt(e,t){var n=arguments;return Vt(this,arguments,void 0,(function*(e,t,o=10,i=1,r=!1){const c=oo.V.logfunction("GetRelation",n)||{};if(mi){c.serviceWorker=!0;try{const n=yield Si("GetRelation",{id:e,relation:t,inpage:o,page:i,reverse:r});return oo.V.logUpdate(c),n.data}catch(e){console.error("GetRelation error sw: ",e),(0,h.ey)(c,"GetRelation",e),Gi(e)}}let s=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[];if(l.id>0)if(r){d=yield Pt(l.id,a.id,a.userId,o,i);let e=[];for(var u=0;u<d.length;u++)e.push(d[u].ofTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].ofTheConceptId,n=yield(0,z.A)(t),o=yield(0,v.Ez)(n.id);s.push(o)}}else{d=yield F(l.id,a.id,a.userId,o,i);let e=[];for(let t=0;t<d.length;t++)e.push(d[t].toTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].toTheConceptId,n=yield(0,z.A)(t),o=yield(0,v.Ez)(n.id);s.push(o)}}return oo.V.logUpdate(c),s}))}function $t(e,t){var n=arguments;return Vt(this,arguments,void 0,(function*(e,t,o=10,i=1,r=!1){const c=oo.V.logfunction("GetRelationRaw",n)||{};if(mi){c.serviceWorker=!0;try{const n=yield Si("GetRelationRaw",{id:e,relation:t,inpage:o,page:i,reverse:r});return oo.V.logUpdate(c),n.data}catch(e){console.error("GetRelationRaw error sw: ",e),(0,h.ey)(c,"GetRelationRaw",e),Gi(e)}}let s=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[],u=[];if(l.id>0){if(r){d=yield Pt(l.id,a.id,a.userId,o,i);for(var p=0;p<d.length;p++)u.push(d[p].ofTheConceptId)}else{d=yield F(l.id,a.id,a.userId,o,i);for(let e=0;e<d.length;e++)u.push(d[e].toTheConceptId)}s=yield(0,tt.r)(u)}return oo.V.logUpdate(c),s}))}var Ht=n(6416),Jt=n(4711);class zt{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 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 qt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class Qt{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 qt(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(Qt.checkFlag,1e3,e)}static addConceptToTree(e,t,n=999){let o=this.compositeKey(t,n);var i=new zt(o,e,null,null);this.addNodeToTree(i)}static getNodeFromTree(e,t){return qt(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 qt(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}}Qt.root=null;var Yt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Xt(e,t){return Yt(this,arguments,void 0,(function*(e,t,n=999){let o=yield Qt.getNodeFromTree(e,n),i=(0,Ht.u)();if(o)for(let e=0;e<o.value.length;e++){let n=o.value[e];n.ghostId==t&&(i=n)}return i}))}function Zt(e,t){return Yt(this,arguments,void 0,(function*(e,t,n=999){Qt.addConceptToTree(e,t,n)}))}var Kt=n(5312),en=n(1213),tn=n(3729),nn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},on=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function rn(e,t,n){return on(this,void 0,void 0,(function*(){try{if(mi)try{return(yield Si("GetRelationLocal",{id:e,relation:t,userId:n})).data}catch(e){console.error("GetRelationLocal error sw: ",e),Gi(e)}let o=yield(0,m.$I)(t),i=[];0!=o.id&&(i=yield function(e,t){return nn(this,void 0,void 0,(function*(){try{return yield A.G.GetConnectionOfCompositionAndTypeLocal(t,e)}catch(e){throw e}}))}(e,o.id));let r=[];for(let e=0;e<i.length;e++){let t=yield _(i[e].toTheConceptId);r.push(t)}return r}catch(e){throw e}}))}var cn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function sn(e){return cn(this,void 0,void 0,(function*(){let t=[];try{var n=(0,d.Xr)();const o=yield fetch(l.B.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;(0,tt.r)(i),n[r]=t}return n}return console.log("View Internal Data error",o.status),(0,h.ry)(o),t}catch(e){throw e instanceof Error?console.log(" This is the view internal data error message: ",e.message):console.log(" This is the view internal data unexpected error: ",e),e}}))}var an=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function ln(e){return an(this,void 0,void 0,(function*(){var t;try{let n=yield sn(e),o=[];for(let i=0;i<e.length;i++){let r=e[i],c=n[r];if(r&&c){let e=[],t={};for(let t=0;t<c.length;t++)e.includes(c[t].ofTheConceptId)||e.push(c[t].ofTheConceptId);let n=yield(0,v.zN)(r,c,e);t.data=n,t.id=r,o.push(t)}else{let e={};e.id=r;let n=yield(0,z.A)(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 dn=n(176),hn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))},un=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function pn(e){return un(this,arguments,void 0,(function*(e,t=""){try{let n=yield function(e){return hn(this,arguments,void 0,(function*(e,t=""){var n=(0,d.ab)("application/json",t);let o=l.B.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 fetch(o,{method:"GET",headers:n});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,h.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,h.Mb)(e,o)}}))}(e,t);return yield ln(n)}catch(e){throw e}}))}function fn(e){return un(this,arguments,void 0,(function*(e,t=""){try{return yield function(e){return hn(this,void 0,void 0,(function*(){var t=(0,d.ab)("application/json","");let n=l.B.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 fetch(n,{method:"GET",headers:t});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,h.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,h.Mb)(e,n)}}))}(e)}catch(e){throw e}}))}var yn=n(8095),vn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function gn(e){return vn(this,void 0,void 0,(function*(){if(mi)try{return(yield Si("DeleteConceptLocal",{id:e})).data}catch(e){console.error("DeleteConceptLocal error sw: ",e),Gi(e)}let t=yield(0,en.f)(e);y.v.RemoveConcept(t)}))}var mn=n(2803),Cn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Tn(e,t,n,o){return Cn(this,arguments,void 0,(function*(e,t,n,o,i=!0){var r,c;const s=oo.V.logfunction("GetConnectionBetweenTwoConceptsLinker")||{};if(mi){s.serviceWorker=!0;try{const r=yield Si("GetConnectionBetweenTwoConceptsLinker",{ofTheConcept:e,toTheConcept:t,linker:n,fullLinker:o,forward:i});return oo.V.logUpdate(s),r.data}catch(e){console.error("GetConnectionBetweenTwoConceptsLinker sw error: ",e),(0,h.ey)(s,"GetConnectionBetweenTwoConceptsLinker",e),Gi(e)}}let a=(0,P.o)();if(""!=n){let o="";o=i?(null===(r=e.type)||void 0===r?void 0:r.characterValue)+"_s_"+n+"_s":(null===(c=t.type)||void 0===c?void 0:c.characterValue)+"_s_"+n+"_by",a=yield(0,q.A)("connection",o,!1,999)}""!=o&&(a=yield pe(o,999));let l=[];return l=i?yield(0,mn.x)(e.id,t.id,a.id):yield(0,mn.x)(t.id,e.id,a.id),oo.V.logUpdate(s),l}))}function wn(e,t){return new Promise(((n,o)=>{setTimeout((()=>{n(t)}),e)}))}var In=n(3130);const kn=3,Nn=4,An=5;var Ln=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Sn(e,t){return Ln(this,arguments,void 0,(function*(e,t,n=""){let o=l.B.SearchAllTypeWithLinker(e.auth);var i=(0,d.ab)("application/json",n);o=o+"?search="+e.search+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;const r=JSON.stringify(t);try{const e=yield fetch(o,{method:"POST",headers:i,body:r});return e.ok?yield e.json():((0,h.ry)(e),console.log("This is the searching multiple error",e.status),[])}catch(e){console.log("This is the searching SearchWithTypeAndLinker error",e),(0,h.Mb)(e,o)}}))}var _n=n(4287);class bn extends _n.w{constructor(e,t,n=In.y0){super(),this.searchQuery=[],this.format=In.y0,this.searchQuery=e,this.format=n}bind(){return e=this,t=void 0,o=function*(){return this.data=yield(0,Kt.cf)(this.searchQuery,"",this,this.format),this.mainConcept=this.searchQuery[0].composition,this.listenToEvent(this.mainConcept),console.log("this is the data",this.data),this.data},new((n=void 0)||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}));var e,t,n,o}}function Bn(e,t,n=In.y0){return new bn(e,null!=t?t:"",n)}var En=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class Gn extends _n.w{constructor(e,t=In.ZJ){super(),this.id=e,this.format=t}bind(){return En(this,void 0,void 0,(function*(){if(!this.isDataLoaded){let e=yield(0,v.hL)(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 En(this,void 0,void 0,(function*(){let e=[],t=this.internalConnections;for(let n=0;n<t.length;n++)e.push(yield Ee.d.GetConnection(t[n]));return this.format==In.ZJ?this.data=yield(0,v.ay)(this.mainConcept,e,this.compositionIds):this.format==In.y0?this.data=yield(0,v.$V)(this.mainConcept,e,this.compositionIds):this.format==In.yv?this.data=yield(0,v.re)(this.mainConcept,e,this.compositionIds):this.data=yield(0,v.ay)(this.mainConcept,e,this.compositionIds),this.data}))}}function xn(e,t=In.ZJ){return new Gn(e,t)}var Rn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class Dn extends _n.w{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 Rn(this,void 0,void 0,(function*(){if(!this.isDataLoaded){var e=yield(0,g.A)(this.compositionName);if(e){yield p(this.compositionName,this.userId);let o=yield a.I.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(0,f.Y)(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 Rn(this,void 0,void 0,(function*(){if(this.data=[],this.format==In.ZJ){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,v.kx)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==In.y0){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,v.RW)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==In.yv){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,v.XI)(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(0,v.kx)(this.compositionIds[e]);this.data.push(t)}return this.data}))}}function On(e,t,n,o,i=In.ZJ){return new Dn(e,t,n,o,i)}var Un=n(7106),Fn=n(5328),Wn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class Mn extends _n.w{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){window.addEventListener(`${e}`,(t=>{if(this.isUpdating)console.log("rejected this");else{this.isUpdating=!0;let t=this;setTimeout((function(){return Wn(this,void 0,void 0,(function*(){let n=yield Ee.d.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield Ee.d.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()}))}),200)}}))}bind(){return Wn(this,void 0,void 0,(function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;const e=yield Je(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(0,nt.j)(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 Wn(this,void 0,void 0,(function*(){return this.externalConnectionIds=this.linkers,this.format&&this.format==In.XZ?this.data={compositionIds:this.compositionIds,internalConnections:this.internalConnections,externalConnections:this.externalConnectionIds}:this.data=yield(0,Ve.p8)(this.compositionIds,this.internalConnections),this.data}))}}function Pn(e,t,n="",o){return new Mn(e,t,n,o)}var Vn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class jn extends _n.w{constructor(e,t,n,o=In.y0){super(),this.searchQuery=[],this.format=In.y0,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=xe.b.BearerAccessToken}listenToEventType(e){window.addEventListener(`${e}`,(e=>{if(this.isUpdating)console.log("rejected this");else{this.isUpdating=!0;let t=this;setTimeout((function(){return Vn(this,void 0,void 0,(function*(){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),Ee.d.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()}))}),200)}}))}bind(){return Vn(this,void 0,void 0,(function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;var e=yield(0,g.A)(this.searchCharacter);let t=yield Sn(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 Vn(this,void 0,void 0,(function*(){return yield(0,tt.r)(this.conceptIds),this.format==In.y0?this.data=yield(0,Un.yV)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse):this.data=yield(0,Un._W)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse),this.data}))}}function $n(e,t,n,o=In.y0){return new jn(e,t,n,o)}var Hn=n(2615);class Jn{constructor(e,t,n,o,i,r,c,s=!1,a,d,h){this.structureType="lconcept",this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=l.B.getRandomizer(),this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=o,this.characterValue=r,this.accessId=i,this.type=null,this.isNew=s,this.typeCharacter=c,this.entryTimeStamp=a,this.updatedTimeStamp=d,this.isSynced=!1,this.referentId=h}getType(){console.log(this.typeId)}}class zn{constructor(e,t,n,o,i,r){this.isTemp=!1,this.applicationId=l.B.getRandomizer(),this.type=(0,P.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.typeId=o,this.ghostId=e,this.orderId=i,this.typeCharacter="",this.accessId=r,this.typeCharacter="",this.entryTimeStamp=(0,P.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date}}class qn{constructor(){this.compositionId=0,this.userId=999,this.sessionId=999,this.accessId=4,this.ofTheCompositionId=0,this.patchObject={}}}class Qn{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=""}}var Yn=n(628);class Xn{constructor(){this.type="",this.search="",this.logicoperator="=",this.index=0,this.composition=!0,this.name="",this.operateon=""}}class Zn{constructor(){this.type="",this.search="",this.composition="",this.internalComposition="",this.userId=999,this.inpage=10,this.page=1,this.auth=!0}}var Kn=n(7887),eo=n(3075),to=n(7869),no=n(9635),oo=n(9700);class io{static initialize(){try{console.warn("Initialized Application Monitoring for tracking errors..."),this.initGlobalErrorHandlers(),this.logCatchError(),this.logErrorEvent(),this.logUnhandledError(),this.logUserInteractions(),this.logNetworkRequests(),this.logRouteChanges(),this.logPerformanceMetrics(),this.logWebSocketEvents()}catch(e){console.error("Error during Application Monitoring initialization:",e)}}static initGlobalErrorHandlers(){try{if(console.log("this is the window",window),void 0===typeof window)return;const e=xe.b.sessionId||"unknown";window.onerror=(t,n,o,i,r)=>{const c={message:t,source:n,lineno:o,colno:i,stack:(null==r?void 0:r.stack)||"undefined",requestFrom:l.B.BASE_APPLICATION,sessionId:e};oo.V.logApplication("ERROR","Runtime Error",c),oo.V.log("ERROR","Runtime Error",c)},window.onunhandledrejection=t=>{oo.V.logApplication("ERROR","Unhandled Promise Rejection",{message:t.reason?t.reason.message:t.reason,stack:t.reason?t.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:e}),oo.V.log("ERROR","Unhandled Promise Rejection",{message:t.reason?t.reason.message:t.reason,stack:t.reason?t.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:e})}}catch(e){console.warn("Failed to initialize global error handlers:",e)}}static logCatchError(){try{const e=console.error;console.log("Inside originalConsoleError...");const t=xe.b.sessionId||"unknown";console.error=function(...n){const o="Console Error",i={arguments:n.map((e=>ro(e))),requestFrom:l.B.BASE_APPLICATION,sessionId:t};oo.V.logApplication("ERROR",o,i),oo.V.log("ERROR",o,i),e.apply(console,n)}}catch(e){console.warn("Failed to override console.error:",e)}}static logErrorEvent(){try{window.addEventListener("error",(e=>{var t;console.log("Inside error event...");const n=xe.b.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?ro(e.error.stack):void 0,requestFrom:l.B.BASE_APPLICATION,sessionId:n},i="Unhandled Error";oo.V.logApplication("ERROR",i,o),oo.V.log("ERROR",i,o)}))}catch(e){console.warn("Failed to add error event listener:",e)}}static logUnhandledError(){try{window.addEventListener("unhandledrejection",(e=>{var t,n;console.log("Inside unhandledrejection...");const o=xe.b.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:l.B.BASE_APPLICATION,sessionId:o};oo.V.logApplication("ERROR","Unhandled Promise Rejection",i),oo.V.log("ERROR","Unhandled Promise Rejection",i)}))}catch(e){console.warn("Failed to add unhandled rejection event listener:",e)}}static logUserInteractions(){document.addEventListener("click",(e=>{var t;const n=xe.b.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:l.B.BASE_APPLICATION,sessionId:n};oo.V.logApplication("INFO","User Click",i)})),document.addEventListener("input",(e=>{const t=e.target;xe.b.sessionId,t.tagName,t.id,t.value,l.B.BASE_APPLICATION})),document.addEventListener("scroll",(()=>{xe.b.sessionId,window.scrollY,l.B.BASE_APPLICATION}))}static logNetworkRequests(){try{if(void 0===typeof window)return;const e=xe.b.sessionId||"unknown",t=null===window||void 0===window?void 0:window.fetch;if(!t)throw new Error("Original fetch is not available.");const n=[l.B.PostLogger(),l.B.PostPrefetchConceptConnections()];window.fetch=(...o)=>{return i=this,r=void 0,s=function*(){const[i,r]=o,c=i instanceof Request?i.url:i instanceof URL?i.toString():i;if(n.includes(c))return console.log("Ignored URLs detected : ",c),t(...o);let s={request:{type:"REQUEST",message:"Network Request",method:(null==r?void 0:r.method)||"GET",url:c,body:null==r?void 0:r.body,requestFrom:l.B.BASE_APPLICATION,sessionId:e}};try{const n=yield t(...o);return s.response={type:"RESPONSE",message:"Network Response",url:c,status:n.status,requestFrom:l.B.BASE_APPLICATION,sessionId:e},n}catch(t){throw s.response={type:"ERROR",message:"Network Request Failed",url:c,error:t instanceof Error?t.message:String(t),requestFrom:l.B.BASE_APPLICATION,sessionId:e},oo.V.logApplication("ERROR","Failed Network Request",s),new Error(`Network request failed for ${c}: ${t.message}`)}},new((c=void 0)||(c=Promise))((function(e,t){function n(e){try{a(s.next(e))}catch(e){t(e)}}function o(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c((function(e){e(i)}))).then(n,o)}a((s=s.apply(i,r||[])).next())}));var i,r,c,s}}catch(e){console.warn("Failed to override network requests:",e)}}static logPerformanceMetrics(){void 0!==typeof window&&(null===window||void 0===window||window.addEventListener("load",(()=>{const e=performance.timing;xe.b.sessionId,e.loadEventEnd,e.navigationStart,e.domContentLoadedEventEnd,e.navigationStart,l.B.BASE_APPLICATION})))}static logRouteChanges(){const e=history.pushState,t=xe.b.sessionId||"unknown";history.pushState=function(...n){var o;const i={url:null===(o=n[2])||void 0===o?void 0:o.toString(),requestFrom:l.B.BASE_APPLICATION,sessionId:t};return oo.V.logApplication("INFO","Route Change",i),e.apply(this,n)},null===window||void 0===window||window.addEventListener("popstate",(()=>{const e={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:t};oo.V.logApplication("INFO","Route Changed (Back/Forward)",e)}))}static logWebSocketEvents(){if(void 0===typeof window)return;const e=xe.b.sessionId||"unknown",t=WebSocket;window.WebSocket=class extends t{constructor(t,n){super(t,n);const o={url:t.toString(),requestFrom:l.B.BASE_APPLICATION,sessionId:e};oo.V.logApplication("INFO","WebSocket Open",o),this.addEventListener("message",(n=>{const o={url:t,data:n.data,requestFrom:l.B.BASE_APPLICATION,sessionId:e};oo.V.logApplication("INFO","WebSocket Message",o)})),this.addEventListener("error",(n=>{const o={url:t,error:n instanceof Error?n.message:String(n),requestFrom:l.B.BASE_APPLICATION,sessionId:e};oo.V.logApplication("ERROR","WebSocket Error",o)})),this.addEventListener("close",(()=>{const n={url:t,requestFrom:l.B.BASE_APPLICATION,sessionId:e};oo.V.logApplication("INFO","WebSocket Closed",n)}))}}}}function ro(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"}}const co=(e,t,...n)=>{return o=void 0,i=[e,t,...n],c=function*(e,t,n=!1){try{let o=l.B.sendMail();n&&(o=l.B.sendBulkMail());const i=yield fetch(o,{method:"POST",body:e instanceof FormData?e:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),r=i.headers.get("content-type");if(!i.ok){const e=yield i.json();return console.info(`${i.status} ${e}`),null}const c=yield i.json();return r&&r.includes("text/plain")?yield i.text():c}catch(e){return console.error(e),null}},new((r=void 0)||(r=Promise))((function(e,t){function n(e){try{a(c.next(e))}catch(e){t(e)}}function s(e){try{a(c.throw(e))}catch(e){t(e)}}function a(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r((function(e){e(o)}))).then(n,s)}a((c=c.apply(o,i||[])).next())}));var o,i,r,c};class so{constructor(){this.inDevelopment=!1,this.subscribers=[]}notify(e=null){this.subscribers.map((t=>{t(e||this.data)}))}dataChange(e){this.subscribers.push(e)}}class ao extends so{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()}}class lo extends ao{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&&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();return t?null==t?void 0:t.querySelectorAll("."+e):[]}mount_child(){}mount(e){return t=this,n=void 0,i=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)},new((o=void 0)||(o=Promise))((function(e,r){function c(e){try{a(i.next(e))}catch(e){r(e)}}function s(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(c,s)}a((i=i.apply(t,n||[])).next())}));var t,n,o,i}before_render(){this.render()}after_render(){console.log("this is calling the after render",this)}renderChildWidgets(){function e(t){var n;t&&(null===(n=t.childWidgets)||void 0===n||n.forEach((t=>{e(t)})),t.render())}console.log("this is the render child widget",this),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 ho=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class uo extends lo{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=[]}getUserId(){return ho(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{let t=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";t?e(JSON.parse(t)):e()}));return null==e?void 0:e.userId}))}getTypeValueList(){return ho(this,arguments,void 0,(function*(e=""){return new Promise((t=>ho(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 c=[],s=new Xn;s.type=r,s.search="1",s.logicoperator=">",s.name="emailfilter",s.operateon="entityEmail",s.composition=!1,c.push(s);let a=new ko;a.typeConnection=e,a.name="entityEmail";let l=new ko;l.type=o,l.filterLogic="( emailfilter )",l.filters=c,l.name="top",l.inpage=100,l.freeschemaQueries=[a],l.outputFormat=In.y0,bo(l,"").subscribe((n=>{if(null==n?void 0:n.length){const i=null==n?void 0:n.map((t=>{var n,i,c,s,a,l,d;const h=null===(s=null===(c=null===(i=null===(n=t.data)||void 0===n?void 0:n[o])||void 0===i?void 0:i[e])||void 0===c?void 0:c.data)||void 0===s?void 0:s[r];return{id:null===(d=null===(l=null===(a=t.data)||void 0===a?void 0:a[o])||void 0===l?void 0:l[e])||void 0===d?void 0:d.id,name:h,text:h}}));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 ho(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 console.log("This is the error in the mount child",e),e}}))}setProperty(e){return ho(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 c="";i?c=null==i?void 0:i.getAttribute("data-type-value"):r&&(c=null==r?void 0:r.getAttribute("data-type-value"));const s=document.createElement("input");s.setAttribute("type","text"),s.setAttribute("name","input-widgetTypeValue"),s.setAttribute("of",t.elementIdentifier.toString()),s.setAttribute("class","form-control"),s.setAttribute("id","widgetType"),s.setAttribute("onchange","updateWidgetTypeValue(event)"),t.widgetType?s.value=t.widgetType:s.setAttribute("placeholder","e.g. the_entity");let a=t;s.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;a.widgetType=i,a.before_render(),a.loadChildWidgets(),null===(o=null===(n=a.element)||void 0===n?void 0:n.parentElement)||void 0===o||o.setAttribute("data-type-value",a.widgetType)})),null==n||n.appendChild(s)}}(e,this)}mount(e){return ho(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.before_render(),this.mount_child(),this.widgetMounted=!0,this.componentMounted=!0):this.render(),this.childWidgetElement=this.getElementByClassName("added-widget-container")}}))}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 console.error("This is the error in the render_custom_functions",e),e}}before_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.componentDidMountFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the before render",e),e}}after_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.addEventFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the after render",e),e}}CreateConnectionBetweenEntityLocal(e,t,n){return ho(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,c=yield(0,le.$)(r,999,999,i);return yield(0,Jt.F)(e.id,t.id,c.id,1e3),"connection created"}))}}var po=n(3077),fo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class yo{constructor(){this.actions={concepts:[],connections:[]},this.success=!0,this.transactionId=Math.random().toString().substring(5)}initialize(){return fo(this,void 0,void 0,(function*(){yield Yn.H.initializeTransaction(this.transactionId)}))}commitTransaction(){return fo(this,void 0,void 0,(function*(){if(!this.success)throw Error("Query Transaction Expired");yield Yn.H.SyncDataOnline(this.transactionId),this.actions={concepts:[],connections:[]},this.success=!1}))}rollbackTransaction(){return fo(this,void 0,void 0,(function*(){this.success=!1,this.actions={concepts:[],connections:[]},yield Yn.H.rollbackTransaction(this.transactionId,this.actions)}))}markAction(){return fo(this,void 0,void 0,(function*(){yield Yn.H.markTransactionActions(this.transactionId,this.actions)}))}MakeTheInstanceConceptLocal(e,t){return fo(this,arguments,void 0,(function*(e,t,n=!1,o,i,r=999,c=0){try{if(!this.success)throw Error("Query Transaction Expired");const s=yield(0,K.k)(e,t,n,o,i,r,c,this.actions);return yield this.markAction(),s}catch(e){throw console.log(e),this.success=!1,e}}))}MakeTheTypeConceptLocal(e,t,n,o){return fo(this,void 0,void 0,(function*(){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,le.$)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}}))}CreateTheConceptLocal(e,t,n,o,i,r){return fo(this,arguments,void 0,(function*(e,t,n,o,i,r,c=!1,s=0,a={concepts:[],connections:[]}){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,po.A)(e,t,n,o,i,r,c,s,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}}))}CreateConnectionBetweenTwoConceptsLocal(e,t,n){return fo(this,arguments,void 0,(function*(e,t,n,o=!1){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,yn.h)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}}))}CreateTheConnectionLocal(e,t,n){return fo(this,arguments,void 0,(function*(e,t,n,o=1,i="",r=999){try{if(!this.success)throw Error("Query Transaction Expired");const c=yield(0,Jt.F)(e,t,n,o,i,r,this.actions);return yield this.markAction(),c}catch(e){throw console.log(e),this.success=!1,e}}))}CreateConnection(e,t,n){return fo(this,void 0,void 0,(function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield(0,Jt.d)(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}}))}CreateConnectionBetweenEntityLocal(e,t,n){return fo(this,void 0,void 0,(function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield xo(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}}))}CreateTheCompositionLocal(e){return fo(this,arguments,void 0,(function*(e,t=null,n=null,o=null,i=null,r=null,c=null,s=!1){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,O.R)(e,t,n,o,i,r,c,s,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}}))}}const vo={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 go=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class mo{constructor(){mo.cacheInitialized||mo.initializeAnomalyParameters()}static initializeAnomalyParameters(){return go(this,void 0,void 0,(function*(){try{yield mo.getAnomalyParameters(),mo.refreshCache(),mo.cacheInitialized=!0}catch(e){console.error("Error during anomaly parameter initialization:",e)}}))}static getAnomalyParameters(){return go(this,void 0,void 0,(function*(){const e=Date.now();if(mo.anomalyParamsCache&&e-mo.lastFetchedTime<mo.cacheExpiryThreshold)return console.log("Returning cached anomaly parameters"),mo.anomalyParamsCache;try{return yield mo.fetchAnomalyParameters()}catch(e){throw console.error("Error fetching anomaly parameters:",e),e}}))}static fetchAnomalyParameters(){return go(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 mo.anomalyParamsCache=t.data,mo.lastFetchedTime=Date.now(),t.data}catch(e){throw console.error("API Fetch Error:",e),e}}))}static refreshCache(){return go(this,void 0,void 0,(function*(){try{Date.now()-mo.lastFetchedTime>mo.cacheExpiryThreshold&&(yield mo.getAnomalyParameters())}catch(e){console.error("Error refreshing anomaly parameters cache:",e)}}))}detectDataType(e){for(const[t,n]of Object.entries(vo))if(n.test(e))return t;return null}checkConceptAnomaly(e,t){return go(this,void 0,void 0,(function*(){const n=[];try{if(!t)return n.push("Null value"),{valid:!1,warnings:n};const o=mo.anomalyParamsCache;e.startsWith("the_")||(e=`the_${e}`);const i=o[e];if(console.log("Concept Details : ",i),!i)return console.warn(`No concept details found for type: ${e}`),n.push(`No concept details found for type: ${e}`),{valid:!1,warnings:n};const r=t.length,{min_length:c,max_length:s,data_types:a}=i,l=r>=c&&r<=s,d=this.detectDataType(t),h=a.includes(d);return l||n.push(`Length of '${t}' is outside the allowed range (min: ${c}, max: ${s}). Current length: ${r}.`),h||n.push(`Type mismatch for '${t}'. Expected types: ${a.join(", ")}, detected type: ${d}.`),l&&h&&n.push(`Concept ${e} is valid. Length: ${r}, Type: ${d}`),{valid:l&&h,warnings:n}}catch(o){return console.error(`Error checking anomaly for ${e} with value ${t}:`,o),{valid:!1,warnings:n}}}))}static checkAnomalyInBulk(e){return go(this,void 0,void 0,(function*(){mo.cacheInitialized||(yield mo.initializeAnomalyParameters());try{const t={};for(const[n,o]of Object.entries(e)){const e=o.value,{valid:i,warnings:r}=yield(new mo).checkConceptAnomaly(n,e);t[n]={valid:i,warnings:r}}return t}catch(e){throw console.error("Bulk Anomaly Check Error:",e),e}}))}static getExportedFunction(){console.log("Main : ",o);const e=Object.keys(o);return console.log("The exported List : ",e),e}static getFunctionaAnomalyParameters(){}}mo.anomalyParamsCache=null,mo.cacheInitialized=!1,mo.lastFetchedTime=0,mo.cacheExpiryThreshold=6e5;var Co=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class To{checkUniqueness(e,t){return Co(this,void 0,void 0,(function*(){const n=oo.V.logfunction("checkUniqueness");e.startsWith("the_")||(e="the_"+e);let o=(yield pe(e,999)).id,i=yield(0,re.A)(t,o);return console.log("This is the concept for validator",i),!(i.id>0||(oo.V.logUpdate(n),0))}))}validateField(e){return Co(this,void 0,void 0,(function*(){var t;const n=oo.V.logfunction("validateField");try{performance.now();const o={},{name:i,value:r,type:c,dataType:s,pattern:a,conceptType:l,maxLength:d,minLength:h,minValue:u,maxValue:p,accept:f,file:y,required:v,isUnique:g}=e;if(console.log("Validation is happening on : \n",e),!v||null!==r&&""!==r||(o.required=`The field ${i} is required.`),s&&r){let e=vo[s];e&&""!==r&&!e.test(r)&&(o.dataType=`Invalid value for ${s}`)}if(a&&r){const e="string"==typeof a?new RegExp(a):a;""===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!=h&&r.length<h&&(o.minLength=`Length must be at least ${h} characters long`),null!=u&&r&&!isNaN(Number(r))&&Number(r)<u&&(o.minValue=`Value must be greater than or equal to ${u}`),null!=p&&r&&!isNaN(Number(r))&&Number(r)>p&&(o.maxValue=`Value must be less than or equal to ${p}`),y&&c&&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(", ")}`)}return l&&g&&r&&((yield this.checkUniqueness(l,r))||(o.unique="Value is not unique")),oo.V.logUpdate(n),console.log("Before Validation Result : ",o),o}catch(e){throw(0,h.ey)(n,"Validator.validateField",e),e}}))}validateForm(e){return Co(this,void 0,void 0,(function*(){const t=oo.V.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 oo.V.logUpdate(t),n}catch(e){throw(0,h.ey)(t,"Validator.validateForm",e),e}}))}validate(e){const t=oo.V.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})),console.error("Error on validate object"),oo.V.logUpdate(t),n}catch(e){(0,h.ey)(t,"Validator.validate",e)}}}const wo=e=>{var t;const n=document.getElementsByName(e)[0];if(!n)return console.warn(`Element with NAME "${e}" not found.`),{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 Io=n(2289);class ko{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=In.yv,this.name="",this.reverse=!1,this.limit=!1,this.isSecure=!0,this.includeInFilter=!1,this.isOldConnectionType=!1}}var No=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Ao(e){var t=arguments;return No(this,arguments,void 0,(function*(e,n=""){const o=oo.V.logfunction("FreeschemaQueryApi",t);var i=(0,d.ab)("application/json",n);const r=l.B.FreeschemaQueryUrl(),c=JSON.stringify(e);try{const e=yield fetch(r,{method:"POST",headers:i,body:c});return e.ok?yield e.json():((0,h.ry)(e),console.log("This is the freeschema query error",e.status),[])}catch(e){console.log("This is the freeschema query error others",e),(0,h.Mb)(e,r),(0,h.ey)(o,"FreeschemaQueryApi",e)}}))}var Lo=n(5898),So=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class _o extends _n.w{constructor(e,t){super(),this.query=new ko,this.countInfoStrings=[],this.order="DESC",this.totalCount=0,this.query=e,this.format=e.outputFormat,this.order=e.order}run(){return So(this,void 0,void 0,(function*(){var e,t;this.query.outputFormat=In.BG,this.compositionIds=[];let n=yield Ao(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()}))}bind(){return So(this,void 0,void 0,(function*(){var e,t;if(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=In.BG,this.compositionIds=[];let n=yield Ao(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 pe(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}))}build(){return So(this,void 0,void 0,(function*(){oo.V.logfunction("build",["schemaquery",this.compositionIds]);let e=(0,Lo.w)(this.countInfoStrings);return this.format==In.y0?this.data=yield(0,Un.e$)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==In.ZJ?this.data=yield(0,Un.y6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.data=yield(0,Un.b6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e),this.data}))}}function bo(e,t){return new _o(e,t)}function Bo(e,t){return new _o(e,t).execute()}class Eo{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 uo}}var Go=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function xo(e,t,n){return Go(this,arguments,void 0,(function*(e,t,n,o={concepts:[],connections:[]}){var i,r,c,s,a;const l=oo.V.logfunction("CreateConnectionBetweenEntityLocal",[e.id,t.id,n]);if(mi)try{const a=yield Si("CreateConnectionBetweenEntityLocal",{concept1Data:e,concept2Data:t,linker:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(s=null===(c=null==a?void 0:a.actions)||void 0===c?void 0:c.connections)||void 0===s?void 0:s.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.log("CreateConnectionBetweenEntityLocal error sw: ",e),Gi(e)}const d=e.userId,h=(null===(a=e.type)||void 0===a?void 0:a.characterValue)+"_"+n,u=yield(0,le.$)(h,999,999,d,o);console.log(yield(0,Jt.F)(e.id,t.id,u.id,1e3,void 0,void 0,o)),oo.V.logUpdate(l)}))}var Ro=n(4310);function Do(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var Oo=n(490);class Uo extends lo{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 Xn;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="";console.log("this is the filters",this.query)}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 ko;o.type=this.mainType,o.inpage=this.inpage;let i=new ko;i.typeConnection=this.selector,i.name="selector",o.freeschemaQueries=[i],this.query=o,bo(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(console.log("this is the selected data myItem",r,t[e],this.mainType,n),r){let e=r[this.selector];if(e){const t=Object.values(e)[0];o[i]=t}}}Do(e);for(const[t,n]of Object.entries(o)){const o=document.createElement("option");o.value=t,o.textContent=n,e.appendChild(o)}console.log("this is the output from selector",t)}))}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 Fo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};class Wo{static assignAccessToEntity(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to assign access to entity");return n.json()}))}static assignPublicAccess(e){return Fo(this,void 0,void 0,(function*(){var t,n;const o=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/public-access`,i=yield fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign({},e),{nestedAccessLevel:null!==(t=e.nestedAccessLevel)&&void 0!==t?t:0,conceptIdList:null!==(n=e.conceptIdList)&&void 0!==n?n:[]}))});if(!i.ok)throw new Error("Failed to assign public access");return i.json()}))}static assignPublicAccessBlukConcept(e){return Fo(this,void 0,void 0,(function*(){var t,n;const o=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/public-access`,i=yield fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign({},e),{nestedAccessLevel:null!==(t=e.nestedAccessLevel)&&void 0!==t?t:0,conceptId:null!==(n=e.conceptId)&&void 0!==n?n:0}))});if(!i.ok)throw new Error("Failed to assign public access");return i.json()}))}static assignAccessToEntityBulk(e){return Fo(this,void 0,void 0,(function*(){var t;const n=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access/bulk`,o=yield fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign({},e),{nestedAccessLevel:null!==(t=e.nestedAccessLevel)&&void 0!==t?t:0}))});if(!o.ok)throw new Error("Failed to assign access in bulk");return o.json()}))}static assignAccessByUser(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/user-access`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to assign access by user");return n.json()}))}static revokeAccess(e){return Fo(this,void 0,void 0,(function*(){const{conceptId:t,access:n,entityId:o}=e,i=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access?conceptId=${t}&access=${encodeURIComponent(n)}&entityId=${o}`,r=yield fetch(i,{method:"DELETE"});if(!r.ok)throw new Error("Failed to revoke access");return r.json()}))}static revokeAccessBulk(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access/bulk`,n=yield fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to revoke access in bulk");return n.json()}))}static getAccessList(e,t){return Fo(this,void 0,void 0,(function*(){const n=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access-list?conceptId=${e}&userId=${t}`,o=yield fetch(n,{method:"GET"});if(!o.ok)throw new Error("Failed to get access list");return o.json()}))}static getPublicAccessList(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/public-access/by-concept-ids`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to get public access list");return n.json()}))}static revokePublicAccess(e){return Fo(this,void 0,void 0,(function*(){var t;const n=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/public-access`,o=yield fetch(n,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign(Object.assign({},e),{nestedAccessLevel:null!==(t=e.nestedAccessLevel)&&void 0!==t?t:0}))});if(!o.ok)throw new Error("Failed to revoke public access");return o.json()}))}static checkAccess(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access/check?conceptId=${e.conceptId}&permission=${encodeURIComponent(e.permission)}&entityId=${e.entityId}`,n=yield fetch(t,{method:"GET"});if(!n.ok)throw new Error("Failed to check access");return n.json()}))}static checkAccessByUser(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/user-access/check`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to check access by user");return n.json()}))}static filterConceptsByAccess(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/concepts/filter-by-access`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to filter concepts by access");return n.json()}))}static checkAccessOfConceptBulk(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/concepts/check-access-bulk`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to check access of concept bulk");return n.json()}))}static getEntitiesByAccess(e,t){return Fo(this,void 0,void 0,(function*(){const n=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/entities/by-access?conceptId=${e}&access=${encodeURIComponent(t)}`,o=yield fetch(n,{method:"GET"});if(!o.ok)throw new Error("Failed to get entities by access");return o.json()}))}static getEntitiesWithAccess(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/entities/with-access?conceptId=${e}`,n=yield fetch(t,{method:"GET"});if(!n.ok)throw new Error("Failed to get entities with access");return n.json()}))}static getAccessGroupByEntity(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access-group/by-entity${void 0!==e?`?entityId=${e}`:""}`,n=yield fetch(t,{method:"GET"});if(!n.ok)throw new Error("Failed to get access group by entity");return n.json()}))}static getAccessGroupByUser(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access-group/by-user${void 0!==e?`?userId=${e}`:""}`,n=yield fetch(t,{method:"GET"});if(!n.ok)throw new Error("Failed to get access group by user");return n.json()}))}static getPublicAccessByAccessIds(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/public-access/by-access-ids`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to get public access by access ids");return n.json()}))}static getFullAccessMappingForPublic(){return Fo(this,void 0,void 0,(function*(){const e=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/concepts/by-public-access`,t=yield fetch(e,{method:"GET"});if(!t.ok)throw new Error("Failed to get full access mapping for public");return t.json()}))}static assignPublicAccessForAllUser(){return Fo(this,void 0,void 0,(function*(){const e=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/public-access/assign-for-all-users`,t=yield fetch(e,{method:"POST"});if(!t.ok)throw new Error("Failed to assign public access for all user");return t.json()}))}static assignAccessByConncetionTypeOfUser(){return Fo(this,void 0,void 0,(function*(){const e=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access/by-connection-type`,t=yield fetch(e,{method:"POST"});if(!t.ok)throw new Error("Failed to assign access by connection type of user");return t.json()}))}static setAccessInheritance(e){return Fo(this,void 0,void 0,(function*(){const t=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access-inheritance`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to set access inheritance");return n.json()}))}static getAccessInheritanceStatus(e){return Fo(this,arguments,void 0,(function*(e,t=999){const n=`${l.B.ACCESS_CONTROL_BASE_URL}/api/access-control/access-inheritance/status?mainConceptId=${e}&connectionTypeId=${t}`,o=yield fetch(n,{method:"GET"});if(!o.ok)throw new Error("Failed to get access inheritance status");return o.json()}))}}const Mo='\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',Po={PAGE_COMP_NAME:"page",WIDGET_COMP_NAME:"widget",PROJECT_COMP_NAME:"project"};var Vo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function jo(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 $o(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 Ho=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function Jo(e){return Ho(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 Ho(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)(null==e?void 0:e.url)?document.querySelector(`script[src="${e.url}"]`)?console.log("Library already loaded:",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=>{console.error("Failed to load script:",e.url,t),n(new Error(`Failed to load script: ${e.url}`))},document.head.appendChild(i)})):console.warn("Skipping library with invalid URL:",e);console.log("All JavaScript libraries loaded successfully")}}))}(e))}))}var zo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function qo(e,t,n){return zo(this,void 0,void 0,(function*(){var o;const i=yield jt(e,"the_page_body"),r=new ko;r.conceptIds=[e],r.inpage=100,r.outputFormat=In.y0,r.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"],bo(r,"").subscribe((e=>zo(this,void 0,void 0,(function*(){var t,n;console.log("SchemaQueryListener data --\x3e",e),yield function(e){return Vo(this,void 0,void 0,(function*(){var t,n,o,i,r,c,s,a,l,d,h,u,p,f;[{key:"meta_title",value:null===(n=null===(t=null==e?void 0:e[`the_${Po.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_${Po.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===(c=null===(r=null==e?void 0:e[`the_${Po.PAGE_COMP_NAME}_meta_keywords`])||void 0===r?void 0:r.data)||void 0===c?void 0:c.the_meta_keywords},{key:"width",value:null===(a=null===(s=null==e?void 0:e[`the_${Po.PAGE_COMP_NAME}_width`])||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_width},{key:"font_size",value:null===(d=null===(l=null==e?void 0:e[`the_${Po.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===(u=null===(h=null==e?void 0:e[`the_${Po.PAGE_COMP_NAME}_font_family`])||void 0===h?void 0:h.data)||void 0===u?void 0:u.the_font_family},{key:"type",value:null===(f=null===(p=null==e?void 0:e[`the_${Po.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){Vo(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":jo(".fspage { width: [^;]+ !important; }"),o=t?`.fspage { width: ${t} !important; }`:"";break;case"font_size":jo(".fspage { font-size: [^;]+; }"),o=t?`.fspage { font-size: ${t}px; }`:"";break;case"font_family":jo(".fspage { font-family: [^;]+; }"),o=t?`.fspage { font-family: ${t}; }`:"";break;case"type":jo(".fspage { width: 1200px; margin: 0 auto; }"),jo(".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":$o(e.replace("meta_",""),t);break;case"meta_description":return void $o(e.replace("meta_",""),t)}n.textContent+=o}))}(e.key,e.value)}))}))}(null===(n=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.data)||void 0===n?void 0:n[`the_${Po.PAGE_COMP_NAME}`])})))),document.getElementById("app").classList.add("fspage"),(null===(o=null==i?void 0:i[0])||void 0===o?void 0:o.id)?yield Qo(i[0].id,t,n):t.innerHTML="<h4>Invalid or Page doesn't exist</h4>"}))}function Qo(e,t,n){return zo(this,void 0,void 0,(function*(){try{t.innerHTML='\n <div style="display: flex; align-items: center; gap: 10px; width: 100%">\n <div style="\n width: 20px;\n height: 20px;\n border: 3px solid #f3f3f3;\n border-top: 3px solid #3498db;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n "></div>\n <span>Please Wait...</span>\n </div>\n \n <style>\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n </style>\n';let o=yield(0,Ro.qj)(e),i=o.mainId,r=o.data;return yield Xo(i,r,t,n)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`),t.textContent=`Error: ${e.message}`}}))}function Yo(e,t,n){return zo(this,void 0,void 0,(function*(){try{const o=yield(0,Ro.Cp)(e);return yield Xo(e,o,t,n)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}}))}function Xo(e,t,n,o){return zo(this,void 0,void 0,(function*(){const i=yield Ko(e,[],t);if(!i.name)return void(n.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const r=n;yield Jo(i);const c=yield ei(i,r,void 0,o),s=Array.from({length:32},(()=>"abcdef"[Math.floor(6*Math.random())])).join("");n.classList.add(`${s}`),n.style.position="relative";const a=document.createElement("style");a.id="mystyleid",a.innerHTML=`\n .${s} {\n ${i.css+c.css+Mo} \n }\n`,i.children.length&&(null==i||i.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))&&Jo(e)}))),document.head.appendChild(a);const d=document.createElement("script");d.innerHTML=i.js,r.appendChild(d);const h=document.createElement("div");h.id="widget-details",h.innerHTML="",h.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==i?void 0:i.origin)||(null==i?void 0:i.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 `,r.appendChild(h);const u=document.createElement("dialog");u.id="widget-documentation-preview-modal",u.className="col-md-8",u.innerHTML="",u.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 ',r.appendChild(u);const p=r.querySelectorAll(".widget-documentation-btn");null==p||p.forEach((e=>{e.addEventListener("click",(e=>{const t=null==e?void 0:e.target;!function(e){zo(this,void 0,void 0,(function*(){console.log("openDocumentationPreviewModal widgetId",e);const t=new ko;t.typeConnection="the_widget_documentation",t.name="documentationText",t.selectors=["the_documentation_text"];const n=new ko;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 ko;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 ko;i.conceptIds=[e],i.freeschemaQueries=[t,n],i.inpage=100,i.outputFormat=In.y0,yield bo(i,"").subscribe((t=>zo(this,void 0,void 0,(function*(){var n,o,i,r,c,s,a,d,h,u,p;let f;console.log("widget documentation preview data ->",t);const y=(null===(d=null===(a=null===(s=null===(c=null===(r=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===r?void 0:r.data)||void 0===c?void 0:c.the_documentation)||void 0===s?void 0:s.the_documentation_text)||void 0===a?void 0:a.data)||void 0===d?void 0:d.the_text)||"";y&&(f=y);const v=null===(p=null===(u=null===(h=null==t?void 0:t[0])||void 0===h?void 0:h.data)||void 0===u?void 0:u.the_widget)||void 0===p?void 0:p.the_widget_s_documentation;if(null==v?void 0:v.length){const e=null==v?void 0:v.map((e=>{var t,n,o,i,r,c,s,a,l,d,h,u,p,f,y,v,g,m,C,T,w,I,k,N,A,L,S,_,b,B,E;const G=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_documentation,x=null===(o=null===(n=null==G?void 0:G.the_documentation_type)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_type,R=null===(r=null===(i=null==G?void 0:G.the_documentation_content)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_content,D=null===(s=null===(c=null==G?void 0:G.the_documentation_creator_email)||void 0===c?void 0:c.data)||void 0===s?void 0:s.the_creator_email,O=null===(l=null===(a=null==G?void 0:G.the_documentation_doc_title)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_doc_title,U=null===(h=null===(d=null==G?void 0:G.the_documentation_method)||void 0===d?void 0:d.data)||void 0===h?void 0:h.the_method,F=null===(p=null===(u=null==G?void 0:G.the_documentation_method_url)||void 0===u?void 0:u.data)||void 0===p?void 0:p.the_method_url,W=null===(y=null===(f=null==G?void 0:G.the_documentation_bearer_token)||void 0===f?void 0:f.data)||void 0===y?void 0:y.the_bearer_token,M=null===(g=null===(v=null==G?void 0:G.the_documentation_username)||void 0===v?void 0:v.data)||void 0===g?void 0:g.the_username,P=null===(C=null===(m=null==G?void 0:G.the_documentation_password)||void 0===m?void 0:m.data)||void 0===C?void 0:C.the_password,V=null===(w=null===(T=null==G?void 0:G.the_documentation_auth_type)||void 0===T?void 0:T.data)||void 0===w?void 0:w.the_auth_type,j=null==G?void 0:G.the_documentation_s_json_list,$=null===(k=null===(I=null==G?void 0:G.the_documentation_api_script)||void 0===I?void 0:I.data)||void 0===k?void 0:k.the_api_script,H=null===(A=null===(N=null==G?void 0:G.the_documentation_api_body)||void 0===N?void 0:N.data)||void 0===A?void 0:A.the_api_body,J=null===(S=null===(L=null==G?void 0:G.the_documentation_language)||void 0===L?void 0:L.data)||void 0===S?void 0:S.the_language,z=null===(b=null===(_=null==G?void 0:G.the_documentation_return)||void 0===_?void 0:_.data)||void 0===b?void 0:b.the_return,q=null===(E=null===(B=null==G?void 0:G.the_documentation_code_editor)||void 0===B?void 0:B.data)||void 0===E?void 0:E.the_code_editor,Q=null==G?void 0:G.the_documentation_s_doc_url,Y=null==G?void 0:G.the_documentation_s_image_url,X=null==G?void 0:G.the_documentation_s_video_link;let Z={type:x,content:R,creatorEmail:D,title:O};if("blank"===x)Z=Object.assign({},Z);else if("api"===x){const e=[];(null==j?void 0:j.length)&&(null==j||j.forEach((t=>{var n,o,i,r,c,s,a,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===(a=null===(s=null===(c=null==t?void 0:t.data)||void 0===c?void 0:c.the_json_list)||void 0===s?void 0:s.the_json_list_value)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_value})}))),Z=Object.assign(Object.assign({},Z),{method:U,methodURL:F,authType:V,username:M,password:P,bearerToken:W,json:e,script:$,body:H})}else"function"===x&&(Z=Object.assign(Object.assign({},Z),{language:J,return:z,codeEditor:q}));const K=[],ee=[],te=[];return(null==Y?void 0:Y.length)&&(null==Y||Y.forEach((e=>{var t;K.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_image_url)}))),(null==X?void 0:X.length)&&(null==X||X.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:K,linkList:te,videoList:ee}),Z}));f=e}yield function(){return zo(this,void 0,void 0,(function*(){document.getElementById("widget-documentation-preview-modal").showModal()}))}(),function(e,t){zo(this,void 0,void 0,(function*(){const n=document.getElementById("documentation-view");if(0!=l.B.DOCUMENTATION_WIDGET)return void(yield Qo(l.B.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 c=document.createElement("h3");let s="";switch(null==e?void 0:e.type){case"api":s="API";break;case"function":s="Functions and Classes";break;case"imgAndLink":s="Images and Links";break;default:s=""}c.innerHTML=`\n ${null==e?void 0:e.title} ${s?"("+s+")":""}\n `,null==o||o.appendChild(c);const a=document.createElement("div");a.classList.add("widget-doc-content"),(null==e?void 0:e.content)&&(a.innerHTML=e.content,null==o||o.appendChild(a));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 h=null===(n=null==e?void 0:e.linkList)||void 0===n?void 0:n.map((e=>`\n <p>${e}</p>\n `)).join(""),u=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==h?void 0:h.length)?`\n <div class="mv-3">\n <h6>Web links</h6>\n ${h}\n </div>\n `:"",y=(null==u?void 0:u.length)?`\n <h6>Attachments</h6>\n <div class="documentation-attachments">\n ${u}\n </div>\n `:"",v=(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 ${v}\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)}))))}))}(null==t?void 0:t.getAttribute("widget-id"))}))}));const f=r.querySelectorAll(".document-preview-close-button");return null==f||f.forEach((e=>{e.addEventListener("click",(()=>{!function(){zo(this,void 0,void 0,(function*(){const e=document.getElementById("widget-documentation-preview-modal"),t=null==e?void 0:e.querySelector("form");null==t||t.reset(),null==e||e.close()}))}()}))})),r.querySelectorAll(".wb-initial-empty").forEach((e=>{e.classList.remove("wb-initial-empty")})),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach((e=>{e.removeAttribute("onclick")})),c}))}function Zo(e){return zo(this,arguments,void 0,(function*(e,t=[],n=""){const o=yield(0,Ro.Cp)(e);return yield Ko(e,[],o)}))}function Ko(e){return zo(this,arguments,void 0,(function*(e,t=[],n,o=""){var i,r,c,s,a,l,d,h,u,p,f,y,v,g,m,C,T,w,I,k,N,A,L,S,_,b,B,E,G,x,R,D,O,U,F,W,M,P,V,j,$,H,J,z,q,Q,Y,X,Z,K,ee,te,ne,oe,ie;try{const re=new Eo,ce=(0,Ro.ix)(n,e);console.log("getWidgetBulkFromId output ->",ce),t.push(e);const se=null===(i=null==ce?void 0:ce.data)||void 0===i?void 0:i.the_widget;re.name=null===(c=null===(r=null==se?void 0:se.the_widget_name)||void 0===r?void 0:r.data)||void 0===c?void 0:c.the_name,re.html=null===(a=null===(s=null==se?void 0:se.the_widget_html)||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_html,re.css=null===(d=null===(l=null==se?void 0:se.the_widget_css)||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_css,re.js=null===(u=null===(h=null==se?void 0:se.the_widget_js)||void 0===h?void 0:h.data)||void 0===u?void 0:u.the_js,re.origin=Number(null===(f=null===(p=null==se?void 0:se.the_widget_origin)||void 0===p?void 0:p.data)||void 0===f?void 0:f.the_origin),re.version=null===(v=null===(y=null==se?void 0:se.the_widget_version)||void 0===y?void 0:y.data)||void 0===v?void 0:v.the_version,re.clean=null===(m=null===(g=null==se?void 0:se.the_widget_clean)||void 0===g?void 0:g.data)||void 0===m?void 0:m.the_clean,re.timestamp=null===(T=null===(C=null==se?void 0:se.the_widget_timestamp)||void 0===C?void 0:C.data)||void 0===T?void 0:T.the_timestamp,re.id=ce.id;const ae=null===(I=null===(w=null==se?void 0:se.the_widget_type)||void 0===w?void 0:w.data)||void 0===I?void 0:I.the_type;re.type="null"==ae||null==ae?"the_element_name":ae,re.after_render=null===(N=null===(k=null==se?void 0:se.the_widget_after_render)||void 0===k?void 0:k.data)||void 0===N?void 0:N.the_after_render,re.before_render=null===(L=null===(A=null==se?void 0:se.the_widget_before_render)||void 0===A?void 0:A.data)||void 0===L?void 0:L.the_before_render,re.update=null===(_=null===(S=null==se?void 0:se.the_widget_update)||void 0===S?void 0:S.data)||void 0===_?void 0:_.the_update,re.widgetId=e,re.mount_child=null===(B=null===(b=null==se?void 0:se.the_widget_mount_child)||void 0===b?void 0:b.data)||void 0===B?void 0:B.the_mount_child;const le=null==se?void 0:se.the_widget_s_child,de=null===(E=null==se?void 0:se.the_widget_s_css_library)||void 0===E?void 0:E.map((e=>{var t,n,o,i,r,c,s,a;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===(a=null===(s=null===(c=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_css_library)||void 0===c?void 0:c.the_css_library_url)||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_url}})),he=null===(G=null==se?void 0:se.the_widget_s_js_library)||void 0===G?void 0:G.map((e=>{var t,n,o,i,r,c,s,a;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===(a=null===(s=null===(c=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.the_js_library)||void 0===c?void 0:c.the_js_library_url)||void 0===s?void 0:s.data)||void 0===a?void 0:a.the_url}}));re.library={css:de||[],js:he||[]};const ue=null===(R=null===(x=null==se?void 0:se.the_widget_assistant)||void 0===x?void 0:x.data)||void 0===R?void 0:R.the_assistant;re.assistant={id:null===(O=null===(D=null==ue?void 0:ue.the_assistant_id)||void 0===D?void 0:D.data)||void 0===O?void 0:O.the_id,input:null===(F=null===(U=null==ue?void 0:ue.the_assistant_input)||void 0===U?void 0:U.data)||void 0===F?void 0:F.the_input,type:null===(M=null===(W=null==ue?void 0:ue.the_assistant_type)||void 0===W?void 0:W.data)||void 0===M?void 0:M.the_type};const pe=null===(P=null==se?void 0:se.the_widget_s_custom_function)||void 0===P?void 0:P.map((e=>{var t,n,o,i,r,c,s;const a=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==a?void 0:a.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==a?void 0:a.the_custom_function_slug)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_slug,code:null===(s=null===(c=null==a?void 0:a.the_custom_function_code)||void 0===c?void 0:c.data)||void 0===s?void 0:s.the_code}}));if(console.log("customFunctionList -> ",pe),re.custom_functions=pe,null==le?void 0:le.length)for(let e=0;e<le.length;e++){const i=(null===($=null===(j=null===(V=le[e])||void 0===V?void 0:V.data.the_child_widget)||void 0===j?void 0:j.the_child_widget_info)||void 0===$?void 0:$.id)||(null===(q=null===(z=null===(J=null===(H=le[e])||void 0===H?void 0:H.data.the_child_widget)||void 0===J?void 0:J.the_child_widget_parent)||void 0===z?void 0:z.data)||void 0===q?void 0:q.the_parent),r=yield Ko(i,t,n,o),c=null===(K=null===(Z=null===(X=null===(Y=null===(Q=le[e])||void 0===Q?void 0:Q.data)||void 0===Y?void 0:Y.the_child_widget)||void 0===X?void 0:X.the_child_widget_type)||void 0===Z?void 0:Z.data)||void 0===K?void 0:K.the_type,s=null===(ie=null===(oe=null===(ne=null===(te=null===(ee=le[e])||void 0===ee?void 0:ee.data)||void 0===te?void 0:te.the_child_widget)||void 0===ne?void 0:ne.the_child_widget_wrapper)||void 0===oe?void 0:oe.data)||void 0===ie?void 0:ie.the_wrapper;r.type="null"==c||null==c?"the_element_name":c,r.wrapper=s,re.children.push(r)}return re}catch(e){throw console.error("error",e),e}}))}function ei(e,t){return zo(this,arguments,void 0,(function*(e,t,n=!0,o,i){var r,c;const s=new uo;s.html=e.html,s.widgetType=e.type,s.componentDidMountFunction=e.before_render,s.addEventFunction=e.after_render,s.mountChildWidgetsFunction=e.mount_child,s.widgetState=Object.assign({},i),s.customFunctions=e.custom_functions,o&&(s.data=o),t.innerHTML="";const a=t;if(a&&(yield s.mount(a),e.widget=s,e.children.length>0&&(null===(r=s.childWidgetElement)||void 0===r?void 0:r.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){const n=e.children[t];for(let e=0;e<s.childWidgetElement.length;e++){const t=s.childWidgetElement[e];if(n.wrapper===t.id){const e=ni(n);n.html=`<div id="${n.wrapper}">${n.html}</div>`;const o=yield ei(e,t,!1,s.data,s.widgetState);s.childWidgets.push(o),s.css=s.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&&(s.childrenData[n]=e)}))}}}return console.log("newWidget ->",s,e),yield ii(t,".widget_container"),s}))}function ti(e,t){return zo(this,arguments,void 0,(function*(e,t,n=!0,o,i){var r,c;let s=new uo;s.html=e.html,s.widgetState=Object.assign({},o),s.widgetType=e.type,s.componentDidMountFunction=e.before_render,s.addEventFunction=e.after_render,s.mountChildWidgetsFunction=e.mount_child,s.customFunctions=e.custom_functions,s.inDevelopment=!1!==i,t.innerHTML="";let a=t;if(a&&(yield s.mount(a),e.widget=s,e.children.length>0&&(null===(r=s.childWidgetElement)||void 0===r?void 0:r.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){let n=e.children[t];for(let e=0;e<s.childWidgetElement.length;e++){let t=s.childWidgetElement[e];if(n.wrapper===t.id){const e=ni(n),o=yield ti(e,t,!1,s.widgetState,i);s.childWidgets.push(o),s.css=s.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange((e=>{var t;console.log("This is the data change in child",e);let n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(s.childrenData[n]=e),console.log("new child data",s.childrenData)}))}}}return console.log("newWidget ->",s,e),s}))}function ni(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 oi(e,t){return zo(this,void 0,void 0,(function*(){return e&&1===e.nodeType&&e.querySelectorAll(t).forEach((e=>{for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.remove()})),e}))}function ii(e,t){return zo(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 oi(e.firstChild,t);n.insertBefore(o,e)}n.removeChild(e)}}}))}var ri=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function ci(e){return ri(this,arguments,void 0,(function*(e,t=null,n="",o={concepts:[],connections:[]}){var i,r,c,s;if(mi)try{const a=yield Si("CreateData",{json:e,ofConcept:t,typeConcept:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(s=null===(c=null==a?void 0:a.actions)||void 0===c?void 0:c.connections)||void 0===s?void 0:s.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.error("CreateTheComposition sw error: ",e),Gi(e)}let a=999,l=999,d=(0,P.o)();for(const i in e){let r=si(i);if("string"!=typeof e[i]&&"number"!=typeof e[i])if(null==t||0==t.id)d=yield(0,K.k)(r,"",!0,a,4,l,void 0,o),Array.isArray(e[i])&&(r=ai(r)),yield ci(e[i],d,r,o);else{Array.isArray(e[i])&&(r=li(r));let c=li(i),s=yield(0,K.k)(r,"",!0,a,4,l,void 0,o);d=s;let h=hi(n,c),u=yield(0,le.$)(h,l,a,a,o);yield(0,Jt.F)(t.id,s.id,u.id,1e3,u.characterValue,a,o),Array.isArray(e[i])&&(r=ai(r)),yield ci(e[i],s,r,o)}else{let r=hi(n,i),c=yield(0,le.$)(r,l,a,a,o),s=yield(0,K.k)(i,e[i].toString(),!1,a,4,l,void 0,o);console.log("this is the type concept in down",c,s),null!=t&&(yield(0,Jt.F)(t.id,s.id,c.id,1e3,r,a,o))}}return d}))}function si(e){return e.startsWith("the_")?e:"the_"+e}function ai(e){return e.endsWith("_s")?e:e+"_s"}function li(e){return e.replace(/_s$/,"")}const di=e=>/^[+-]?\d+(\.\d+)?$/.test(e);function hi(e,t){return di(t)?e+"_":e+"_"+function(e){return e.startsWith("the_")?e.slice(4):e}(t)}class ui{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 pi(e,t){if(Array.isArray(e)&&Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);return e}var fi=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};function yi(e){return fi(this,arguments,void 0,(function*(e,t=null){let n=[],o=[],i=[],r=(0,P.o)();try{null==t&&(t=new yo,yield t.initialize());let c=[];if(e.isCompositional){if(r=yield function(e,t,n,o){return fi(this,void 0,void 0,(function*(){let i=(0,P.o)(),r=yield o.MakeTheInstanceConceptLocal("the_composition","",!0,999,999,999),c=yield o.MakeTheTypeConceptLocal("the_composition_type",999,999,999),s=yield o.MakeTheTypeConceptLocal(e,999,999,999),a=yield o.CreateTheConnectionLocal(r.id,s.id,c.id,1e3,"the_composition_type");return i=r,t.push(c),t.push(s),n.push(a),i}))}(e.prototype,n,o,t),e.isQueryType){let o=yield function(e,t,n){return fi(this,void 0,void 0,(function*(){let o=[],i=[],r="the_composition_filter_type",c="the_composition_selector",s=yield n.MakeTheTypeConceptLocal(r,999,999,999),a=yield n.MakeTheTypeConceptLocal(c,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 h=yield n.CreateTheConnectionLocal(t.id,l.id,a.id,1e3,c,999);i.push(h);let u=yield n.CreateTheConnectionLocal(t.id,d.id,s.id,1e3,r,999);i.push(u)}return{concepts:o,connections:i}}))}(e.querySelector,r,t),c=o.concepts;pi(i,o.connections),pi(n,c)}if(e.options.length>0){let o=yield function(e,t,n){return fi(this,void 0,void 0,(function*(){let o=[],i=[],r="the_composition_s_option",c=yield n.MakeTheTypeConceptLocal(r,999,999,999);for(let s=0;s<e.length;s++){let a=e[s].type,l=e[s].value,d=yield n.MakeTheInstanceConceptLocal(a,l,!1,999,999,999);o.push(d);let h=yield n.CreateTheConnectionLocal(t.id,d.id,c.id,1e3,r,999);i.push(h)}return{concepts:o,connections:i}}))}(e.options,r,t),c=o.concepts;pi(i,o.connections),pi(n,c)}}else r=yield function(e,t){return fi(this,void 0,void 0,(function*(){let n=yield(0,z.A)(5124),o=yield t.MakeTheTypeConceptLocal(e,999,999,999),i=yield function(e,t,n,o){return fi(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 gi(e.required,r,n,t,!0),c=yield gi(e.optional,r,n,t),n.push(r);let s=vi(r,!0,!0),a=yield t.MakeTheTypeConceptLocal(s,999,999,999);if(n.push(a),e.childPrototypes.length>0)for(let o=0;o<e.childPrototypes.length;o++){let c=yield yi(e.childPrototypes[o]),l=c.mainConcept,d=c.connections,h=c.concepts,u=yield t.CreateTheConnectionLocal(r.id,l.id,a.id,1e3,s,999);i.push(u),pi(i,d),pi(n,h),n.push(l)}pi(i,c),pi(i,o),pi(n,e.addedConcepts),pi(i,e.addedConnections),e.concepts=n,e.connections=i,console.log("this is the connections",i)}catch(e){null==t||t.rollbackTransaction()}return{concepts:n,connections:i,mainConcept:r}}))}function vi(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 gi(e,t,n,o){return fi(this,arguments,void 0,(function*(e,t,n,o,i=!1,r=!1){let c=[],s=[],a=vi(t,i,r),l=yield o.MakeTheTypeConceptLocal(a,999,999,999);n.push(l);for(let t=0;t<e.length;t++){let n=yield o.MakeTheTypeConceptLocal(e[t],999,999,999);c.push(n)}for(let e=0;e<c.length;e++){let n=yield o.CreateTheConnectionLocal(t.id,c[e].id,l.id,1e3,a,999);s.push(n)}for(let e=0;e<c.length;e++)n.push(c[e]);return s}))}var mi,Ci=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function c(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((o=o.apply(e,t||[])).next())}))};const Ti=Date.now().toString(36)+Math.random().toString(36).substring(2);let wi=[],Ii=[],ki=!1;function Ni(e){ki=e}function Ai(e="",t){xe.b.BearerAccessToken=e,null==typeof document?xe.b.sessionId=t:xe.b.sessionId=parseInt((0,oo.R)("SessionId")),mi&&Si("updateAccessToken",{accessToken:e,session:parseInt((0,oo.R)("SessionId"))})}function Li(){return Ci(this,arguments,void 0,(function*(e="",t="",n="",o="",i=!0,c="",s=void 0,a={},d={},u=""){var p;try{l.B.BASE_URL=e,l.B.AI_URL=t,l.B.NODE_URL=o,l.B.BASE_APPLICATION=c,l.B.LOG_SERVER=null!==(p=d.logserver)&&void 0!==p?p:"https://logdev.freeschema.com",l.B.ACCESS_CONTROL_BASE_URL=u,console.log("setting the logserver",l.B.LOG_SERVER,d.logserver),n&&Ai(n);let i=Math.floor(1e8*Math.random());l.B.setRandomizer(i);const f={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1};if(l.B.FLAGS=f,l.B.FLAGS=Object.assign(Object.assign({},f),a),function(e){const t=oo.V.logfunction("initializeFlags",arguments);try{return e.logApplication&&(io.initialize(),oo.V.logApplicationActivationStatus=!0,console.warn("Application log started.")),e.logPackage&&(oo.V.logPackageActivationStatus=!0,console.warn("Package log started.")),e.accessTracker&&(Be.J.activateStatus=!0,console.warn("Access Tracker Activated.")),e.isTest&&(r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0,r.B.isLocalDataLoaded=!0,r.B.isLocalTypeLoaded=!0,r.B.isLocalCharacterLoaded=!0,r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0,r.B.isLocalConnectionLoaded=!0),oo.V.logUpdate(t),e}catch(e){throw(0,h.ey)(t,"initializeFlags",e),e}}(l.B.FLAGS),!("serviceWorker"in navigator))return yield bi(),void console.warn("Service Worker not supported in this browser.");if(yield function(){return Ci(this,void 0,void 0,(function*(){let e=sessionStorage.getItem("cacheServers"),t=sessionStorage.getItem("config");if(void 0===e||"undefined"===e)return void(l.B.NODE_CACHE_URL=l.B.BASE_URL);e=JSON.parse(e);const n=JSON.parse(t);e&&n&&n.documentationWidget?(Array.isArray(e)&&e.length?l.B.NODE_CACHE_URL=e[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,l.B.DOCUMENTATION_WIDGET=n.documentationWidget):yield function(){return Ci(this,void 0,void 0,(function*(){let e;try{if(e=yield fetch(l.B.getAppConfig(),{method:"POST"}),!e.ok)throw new Error("Failed to sync data to the server.");const t=yield e.json();t.success&&(sessionStorage.setItem("cacheServers",JSON.stringify(t.servers)),sessionStorage.setItem("config",JSON.stringify(t.config)),t.servers?l.B.NODE_CACHE_URL=t.servers[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,t.config&&(l.B.DOCUMENTATION_WIDGET=t.config.documentationWidget))}catch(e){console.error("error getting app config from server",e.message)}}))}(),navigator.serviceWorker&&navigator.serviceWorker.controller&&Si("SESSION_DATA",{type:"SESSION_DATA",data:l.B.NODE_CACHE_URL})}))}(),function(){navigator.serviceWorker.addEventListener("message",(e=>Ci(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),c=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(c,{status:r.status,statusText:r.statusText,headers:r.headers})})}}catch(t){console.error("Error during listenPostMessage",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(){no.x.addEventListener("message",(e=>Ci(this,void 0,void 0,(function*(){const{type:t,payload:n}=e.data;if(!t)return;let o={success:!1,data:void 0};_i[t]?yield _i[t](n):console.warn(`Unable to handle "${t}" case in BC service worker`)}))))}(),s&&s.activate&&s.manual)yield new Promise(((e,t)=>{navigator.serviceWorker.ready.then((t=>Ci(this,void 0,void 0,(function*(){console.log("registraions ready",t),mi=t.active,yield xi(),e("done")})))).catch((e=>{console.error("Error: Ready service worker",e),t(e)})).finally((()=>console.log("Finally service worker ready done"))),setTimeout((()=>t("Timeout ready")),3e4)}));else if(s&&(null==s?void 0:s.activate))try{console.log("service worker initialiing"),yield function(e){var t=arguments;return Ci(this,void 0,void 0,(function*(){const n=oo.V.logfunction("handleRegisterServiceWorker",t);yield new Promise(((t,o)=>{var i,r;let c=!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=>Ci(this,void 0,void 0,(function*(){console.log("Service Worker registered:",e),setInterval((()=>{Ii.length&&Ei()}),2e3),console.log("update listen start"),e.onupdatefound=()=>{const n=e.installing;console.log("new worker",n),n&&(n.onstatechange=()=>Ci(this,void 0,void 0,(function*(){console.warn("on state change triggered",n.state,navigator.serviceWorker.controller),"installing"===n.state&&(console.log("Service Worker installing"),mi=void 0),"activated"!==n.state&&"redundant"!==n.state||!navigator.serviceWorker.controller||(mi=n,console.log("New Service Worker is active",e),setTimeout((()=>{console.log("Message Processed after some time"),Ei()}),5e3),yield xi(),c=!0,Ei(),t())})))},e.addEventListener("controllerchange",(()=>Ci(this,void 0,void 0,(function*(){console.warn("controller change triggered",navigator.serviceWorker.controller),navigator.serviceWorker.controller&&(mi=navigator.serviceWorker.controller,console.warn("Service worker has been activated; controller change"),yield xi())})))),(e.installing||e.waiting||e.active)&&e.addEventListener("statechange",(e=>Ci(this,void 0,void 0,(function*(){var t;"activating"===(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.state)&&(mi=navigator.serviceWorker.controller,console.warn("Service Worker is activating statechange"),yield xi())})))),e.active?(console.log("active sw"),mi=e.active,yield xi(),Ei(),t()):setTimeout((()=>{c||o("Not Completed Initialization")}),1e4)})))).catch((e=>Ci(this,void 0,void 0,(function*(){yield bi(),o(e),console.error("Service Worker registration failed:",e),(0,h.ey)(n,"handleRegisterServiceWorker",e)}))))}))}))}(s)}catch(e){yield bi(),console.error("Unable to start service worker",e)}else yield bi(),console.warn("Service Worker not activated");return!0}catch(e){yield bi(),console.warn("Cannot initialize the system",e)}}))}function Si(e,t){return Ci(this,arguments,void 0,(function*(e,t,n=0){let o=!1;const i=Math.random().toString(36).substring(2);t.messageId=i,t.TABID=Ti;const r=JSON.parse(JSON.stringify(t));let c;return"checkProcess"!=e&&0==n&&(c=setInterval((()=>Ci(this,void 0,void 0,(function*(){if(console.log("process took more than one second",i,e,o),!o&&!(yield function(e,t){return Ci(this,void 0,void 0,(function*(){var n;try{const o=yield Si("checkProcess",{checkMessageId:e});if(console.log("check interval data res for type ",t,e,o.data),null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.processing)return!0}catch(n){return console.error("error on checing executing process",t,e,n),!1}}))}(i,e))&&(clearInterval(c),!o)){if(console.log("Failed to handle type "+e+" message not found "+i,"retrying: ",0==n,e),0==n&&"checkProcess"!=e)return console.log("retrying ",e,i),yield Si(e,t,n+1);console.log("Failed to handle type "+e+" "+i)}}))),2e3)),new Promise(((n,s)=>{if(navigator.serviceWorker.controller||mi||console.log("will go to queue",navigator.serviceWorker.controller,mi,e),navigator.serviceWorker.controller||mi){const a=r=>{var l,d,u,p,f,y;(null===(l=null==r?void 0:r.data)||void 0===l?void 0:l.messageId)==i&&(o=!0,clearInterval(c),r.data.success||(401==(null===(d=null==r?void 0:r.data)||void 0===d?void 0:d.status)?s((0,h.ry)(new Response("Unauthorized",{status:401,statusText:null===(u=null==r?void 0:r.data)||void 0===u?void 0:u.statusText}))):500==(null===(p=null==r?void 0:r.data)||void 0===p?void 0:p.status)?s((0,h.Mb)(new Response("Internal Server Error",{status:500,statusText:null===(f=null==r?void 0:r.data)||void 0===f?void 0:f.statusText}))):(console.error("Error in the response from worker:",r),s(`Failed to handle action ${e} ${JSON.stringify(t)}, Response: ${JSON.stringify(r.data)}`))),(null===(y=r.data)||void 0===y?void 0:y.actions)&&(t.actions=JSON.parse(JSON.stringify(r.data.actions))),n(r.data),navigator.serviceWorker.removeEventListener("message",a))};if(navigator.serviceWorker.addEventListener("message",a),navigator.serviceWorker.controller)"checkProcess"!=e&&console.log("sent to sw",e,i),navigator.serviceWorker.controller.postMessage({type:e,payload:r});else if(mi){console.warn(`controller not found but serviceWorker is available. messageId: ${i}, type: ${e}`);try{mi.postMessage({type:e,payload:r})}catch(t){console.log("Retrying again on catch service worker",t),mi.postMessage({type:e,payload:r})}}else console.warn(`Service Worker hasn't loaded yet. messageId: ${i}, type: ${e}`),console.info("ready",navigator.serviceWorker.ready),setTimeout((()=>{console.warn(`Re-Trying after certain time. messageId: ${i}, type: ${e}`),mi?(console.info("This is triggered "),null==mi||mi.postMessage({type:e,payload:t})):(console.log("not ready",e),clearInterval(c),s("Service worker not ready"))}),3e4);setTimeout((()=>{clearInterval(c),s(`No response from service worker after timeout: ${e}`),navigator.serviceWorker.removeEventListener("message",a)}),21e4)}else Ii.push({message:{type:e,payload:r}}),console.log("Message Queued",e,t),console.log(navigator.serviceWorker.controller,mi,e),"init"==e&&(clearInterval(c),n(null))}))}))}const _i={GetLinkListener:e=>Ci(void 0,void 0,void 0,(function*(){const t=wi.find((t=>t.listenerId==e.listenerId));return null==t||t.callback(e.data),{success:!0}})),dispatchEvent:e=>Ci(void 0,void 0,void 0,(function*(){if(mi){let t=new CustomEvent(e.id||"",e.data);dispatchEvent(t)}return{success:!0}})),checkInit:e=>Ci(void 0,void 0,void 0,(function*(){return console.log("service worker init 0"),navigator.serviceWorker.controller&&(console.log("service worker init 1"),mi=navigator.serviceWorker.controller),yield xi(),{success:!0}}))};function bi(){return Ci(this,void 0,void 0,(function*(){yield(0,to.A)();const e=(new Date).getTime();yield(0,i.A)().then((()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare concept data is ",t)})).catch((e=>{throw e})),yield(0,eo.Ay)().then((()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare local concept ",t)})).catch((e=>{throw e})),yield(0,Kn.p)().then((()=>{r.B.isLocalConnectionLoaded=!0})).catch((e=>{throw e})),yield(0,eo.xd)().catch((e=>{throw console.log("This is the error in populating binary tree"),e})),yield(0,Kn.a)().then((()=>{r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0;let t=(new Date).getTime()-e;console.log("The time taken to prepare connections ",t)})).catch((e=>{throw e}))}))}function Bi(e,t={}){if(mi||"undefined"!=typeof window){let n=new CustomEvent(`${e}`,t);dispatchEvent(n)}else no.x.postMessage({type:"dispatchEvent",payload:{id:e,data:t}})}function Ei(){return Ci(this,void 0,void 0,(function*(){console.log("message queue",Ii);const e=Ii.find((e=>{var t;return"init"==(null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.type)}));if(e){console.log("Processing Init Queue poped",null==e?void 0:e.type,e);const t=Ii.indexOf(e);t>-1&&Ii.splice(t,1),yield Si(null==e?void 0:e.type,null==e?void 0:e.payload)}for(console.log("message queue while",Ii);Ii.length>0;){const{message:e,resolve:t,reject:n}=Ii.shift();console.log("Queue poped",e.type,e),yield Si(e.type,e.payload)}}))}const Gi=e=>{if(e instanceof j.z)throw console.error("FreeSchemaResponse Error",e),e;console.error("Service Worker Error",e)};function xi(){return Ci(this,void 0,void 0,(function*(){yield Si("init",{url:l.B.BASE_URL,aiurl:l.B.AI_URL,accessToken:xe.b.BearerAccessToken,nodeUrl:l.B.NODE_URL,enableAi:!1,applicationName:l.B.BASE_APPLICATION,flags:l.B.FLAGS,accessControlUrl:l.B.ACCESS_CONTROL_BASE_URL})}))}}},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.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.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(5983),i=o.ADMIN,r=o.ALLID,c=o.AccessControlService,s=o.AccessTracker,a=o.AddGhostConcept,l=o.Anomaly,d=o.BaseUrl,h=o.BinaryTree,u=o.BuildWidgetFromId,p=o.BuilderStatefulWidget,f=o.Composition,y=o.CompositionBinaryTree,v=o.CompositionNode,g=o.Concept,m=o.ConceptsData,C=o.Connection,T=o.ConnectionData,w=o.CreateComposition,I=o.CreateConnection,k=o.CreateConnectionBetweenEntityLocal,N=o.CreateConnectionBetweenTwoConcepts,A=o.CreateConnectionBetweenTwoConceptsGeneral,L=o.CreateConnectionBetweenTwoConceptsLocal,S=o.CreateData,_=o.CreateDefaultConcept,b=o.CreateDefaultLConcept,B=o.CreateSession,E=o.CreateSessionVisit,G=o.CreateTheCompositionLocal,x=o.CreateTheCompositionWithCache,R=o.CreateTheConnection,D=o.CreateTheConnectionGeneral,O=o.CreateTheConnectionLocal,U=o.DATAID,F=o.DATAIDDATE,W=o.DelayFunctionExecution,M=o.DeleteConceptById,P=o.DeleteConceptLocal,V=o.DeleteConnectionById,j=o.DeleteConnectionByIdBulk,$=o.DeleteConnectionByType,H=o.DeleteConnectionByTypeBulk,J=o.DeleteUser,z=o.DependencyObserver,q=o.FilterSearch,Q=o.FormatFromConnections,Y=o.FormatFromConnectionsAltered,X=o.FreeschemaQuery,Z=o.FreeschemaQueryApi,K=o.GetAllConnectionsOfComposition,ee=o.GetAllConnectionsOfCompositionBulk,te=o.GetAllTheConnectionsByTypeAndOfTheConcept,ne=o.GetComposition,oe=o.GetCompositionBulk,ie=o.GetCompositionBulkWithDataId,re=o.GetCompositionFromConnectionsWithDataId,ce=o.GetCompositionFromConnectionsWithDataIdFromConnections,se=o.GetCompositionFromConnectionsWithDataIdInObject,ae=o.GetCompositionFromConnectionsWithDataIdIndex,le=o.GetCompositionFromConnectionsWithIndex,de=o.GetCompositionFromConnectionsWithIndexFromConnections,he=o.GetCompositionFromMemoryWithConnections,ue=o.GetCompositionList,pe=o.GetCompositionListAll,fe=o.GetCompositionListAllWithId,ye=o.GetCompositionListListener,ve=o.GetCompositionListLocal,ge=o.GetCompositionListLocalWithId,me=o.GetCompositionListWithId,Ce=o.GetCompositionListWithIdUpdated,Te=o.GetCompositionListener,we=o.GetCompositionLocal,Ie=o.GetCompositionLocalWithId,ke=o.GetCompositionWithAllIds,Ne=o.GetCompositionWithCache,Ae=o.GetCompositionWithDataIdBulk,Le=o.GetCompositionWithDataIdWithCache,Se=o.GetCompositionWithId,_e=o.GetCompositionWithIdAndDateFromMemory,be=o.GetConceptBulk,Be=o.GetConceptByCharacter,Ee=o.GetConceptByCharacterAndCategoryLocal,Ge=o.GetConceptByCharacterAndType,xe=o.GetConnectionBetweenTwoConceptsLinker,Re=o.GetConnectionBulk,De=o.GetConnectionById,Oe=o.GetConnectionDataPrefetch,Ue=o.GetConnectionOfTheConcept,Fe=o.GetLink,We=o.GetLinkListListener,Me=o.GetLinkListener,Pe=o.GetLinkRaw,Ve=o.GetLinkerConnectionFromConcepts,je=o.GetLinkerConnectionToConcepts,$e=o.GetRelation,He=o.GetRelationLocal,Je=o.GetRelationRaw,ze=o.GetTheConcept,qe=o.GetTheConceptLocal,Qe=o.GetUserGhostId,Ye=o.JUSTDATA,Xe=o.LConcept,Ze=o.LConnection,Ke=o.LISTNORMAL,et=o.LocalConceptsData,tt=o.LocalSyncData,nt=o.LocalTransaction,ot=o.Logger,it=o.LoginToBackend,rt=o.MakeTheInstanceConcept,ct=o.MakeTheInstanceConceptLocal,st=o.MakeTheTimestamp,at=o.MakeTheTypeConceptApi,lt=o.MakeTheTypeConceptLocal,dt=o.NORMAL,ht=o.PRIVATE,ut=o.PUBLIC,pt=o.PatcherStructure,ft=o.Prototype,yt=o.RAW,vt=o.RecursiveSearchApi,gt=o.RecursiveSearchApiNewRawFullLinker,mt=o.RecursiveSearchApiRaw,Ct=o.RecursiveSearchApiRawFullLinker,Tt=o.RecursiveSearchApiWithInternalConnections,wt=o.RecursiveSearchListener,It=o.SchemaQuery,kt=o.SchemaQueryListener,Nt=o.SearchAllConcepts,At=o.SearchLinkInternal,Lt=o.SearchLinkInternalAll,St=o.SearchLinkMultipleAll,_t=o.SearchLinkMultipleAllObservable,bt=o.SearchLinkMultipleApi,Bt=o.SearchQuery,Et=o.SearchStructure,Gt=o.SearchWithLinker,xt=o.SearchWithTypeAndLinker,Rt=o.SearchWithTypeAndLinkerApi,Dt=o.Selector,Ot=o.SessionData,Ut=o.Signin,Ft=o.Signup,Wt=o.SignupEntity,Mt=o.SplitStrings,Pt=o.StatefulWidget,Vt=o.SyncData,jt=o.TrashTheConcept,$t=o.UpdateComposition,Ht=o.UpdateCompositionLocal,Jt=o.UserBinaryTree,zt=o.Validator,qt=o.ViewInternalData,Qt=o.ViewInternalDataApi,Yt=o.WidgetTree,Xt=o.convertFromConceptToLConcept,Zt=o.convertFromLConceptToConcept,Kt=o.convertWidgetTreeToWidget,en=o.convertWidgetTreeToWidgetWithWrapper,tn=o.createFormFieldData,nn=o.createPrototypeLocal,on=o.dispatchIdEvent,rn=o.getFromDatabaseWithType,cn=o.getObjectsFromIndexDb,sn=o.getUserDetails,an=o.getWidgetBulkFromId,ln=o.getWidgetFromId,dn=o.handleServiceWorkerException,hn=o.hasActivatedSW,un=o.init,pn=o.recursiveFetch,fn=o.recursiveFetchNew,yn=o.removeAllChildren,vn=o.renderLatestWidget,gn=o.renderPage,mn=o.renderWidget,Cn=o.searchLinkMultipleListener,Tn=o.sendEmail,wn=o.sendMessage,In=o.serviceWorker,kn=o.setHasActivatedSW,Nn=o.storeToDatabase,An=o.subscribedListeners,Ln=o.unwrapContainers,Sn=o.updateAccessToken,_n=o.uploadAttachment,bn=o.uploadFile,Bn=o.uploadImage,En=o.validDocumentFormats,Gn=o.validImageFormats;export{i as ADMIN,r as ALLID,c as AccessControlService,s as AccessTracker,a as AddGhostConcept,l as Anomaly,d as BaseUrl,h as BinaryTree,u as BuildWidgetFromId,p as BuilderStatefulWidget,f as Composition,y as CompositionBinaryTree,v as CompositionNode,g as Concept,m as ConceptsData,C as Connection,T as ConnectionData,w as CreateComposition,I as CreateConnection,k as CreateConnectionBetweenEntityLocal,N as CreateConnectionBetweenTwoConcepts,A as CreateConnectionBetweenTwoConceptsGeneral,L as CreateConnectionBetweenTwoConceptsLocal,S as CreateData,_ as CreateDefaultConcept,b as CreateDefaultLConcept,B as CreateSession,E as CreateSessionVisit,G as CreateTheCompositionLocal,x as CreateTheCompositionWithCache,R as CreateTheConnection,D as CreateTheConnectionGeneral,O as CreateTheConnectionLocal,U as DATAID,F as DATAIDDATE,W as DelayFunctionExecution,M as DeleteConceptById,P as DeleteConceptLocal,V as DeleteConnectionById,j as DeleteConnectionByIdBulk,$ as DeleteConnectionByType,H as DeleteConnectionByTypeBulk,J as DeleteUser,z as DependencyObserver,q as FilterSearch,Q as FormatFromConnections,Y as FormatFromConnectionsAltered,X as FreeschemaQuery,Z as FreeschemaQueryApi,K as GetAllConnectionsOfComposition,ee as GetAllConnectionsOfCompositionBulk,te as GetAllTheConnectionsByTypeAndOfTheConcept,ne as GetComposition,oe as GetCompositionBulk,ie as GetCompositionBulkWithDataId,re as GetCompositionFromConnectionsWithDataId,ce as GetCompositionFromConnectionsWithDataIdFromConnections,se as GetCompositionFromConnectionsWithDataIdInObject,ae as GetCompositionFromConnectionsWithDataIdIndex,le as GetCompositionFromConnectionsWithIndex,de as GetCompositionFromConnectionsWithIndexFromConnections,he as GetCompositionFromMemoryWithConnections,ue as GetCompositionList,pe as GetCompositionListAll,fe as GetCompositionListAllWithId,ye as GetCompositionListListener,ve as GetCompositionListLocal,ge as GetCompositionListLocalWithId,me as GetCompositionListWithId,Ce as GetCompositionListWithIdUpdated,Te as GetCompositionListener,we as GetCompositionLocal,Ie as GetCompositionLocalWithId,ke as GetCompositionWithAllIds,Ne as GetCompositionWithCache,Ae as GetCompositionWithDataIdBulk,Le as GetCompositionWithDataIdWithCache,Se as GetCompositionWithId,_e as GetCompositionWithIdAndDateFromMemory,be as GetConceptBulk,Be as GetConceptByCharacter,Ee as GetConceptByCharacterAndCategoryLocal,Ge as GetConceptByCharacterAndType,xe as GetConnectionBetweenTwoConceptsLinker,Re as GetConnectionBulk,De as GetConnectionById,Oe as GetConnectionDataPrefetch,Ue as GetConnectionOfTheConcept,Fe as GetLink,We as GetLinkListListener,Me as GetLinkListener,Pe as GetLinkRaw,Ve as GetLinkerConnectionFromConcepts,je as GetLinkerConnectionToConcepts,$e as GetRelation,He as GetRelationLocal,Je as GetRelationRaw,ze as GetTheConcept,qe as GetTheConceptLocal,Qe as GetUserGhostId,Ye as JUSTDATA,Xe as LConcept,Ze as LConnection,Ke as LISTNORMAL,et as LocalConceptsData,tt as LocalSyncData,nt as LocalTransaction,ot as Logger,it as LoginToBackend,rt as MakeTheInstanceConcept,ct as MakeTheInstanceConceptLocal,st as MakeTheTimestamp,at as MakeTheTypeConceptApi,lt as MakeTheTypeConceptLocal,dt as NORMAL,ht as PRIVATE,ut as PUBLIC,pt as PatcherStructure,ft as Prototype,yt as RAW,vt as RecursiveSearchApi,gt as RecursiveSearchApiNewRawFullLinker,mt as RecursiveSearchApiRaw,Ct as RecursiveSearchApiRawFullLinker,Tt as RecursiveSearchApiWithInternalConnections,wt as RecursiveSearchListener,It as SchemaQuery,kt as SchemaQueryListener,Nt as SearchAllConcepts,At as SearchLinkInternal,Lt as SearchLinkInternalAll,St as SearchLinkMultipleAll,_t as SearchLinkMultipleAllObservable,bt as SearchLinkMultipleApi,Bt as SearchQuery,Et as SearchStructure,Gt as SearchWithLinker,xt as SearchWithTypeAndLinker,Rt as SearchWithTypeAndLinkerApi,Dt as Selector,Ot as SessionData,Ut as Signin,Ft as Signup,Wt as SignupEntity,Mt as SplitStrings,Pt as StatefulWidget,Vt as SyncData,jt as TrashTheConcept,$t as UpdateComposition,Ht as UpdateCompositionLocal,Jt as UserBinaryTree,zt as Validator,qt as ViewInternalData,Qt as ViewInternalDataApi,Yt as WidgetTree,Xt as convertFromConceptToLConcept,Zt as convertFromLConceptToConcept,Kt as convertWidgetTreeToWidget,en as convertWidgetTreeToWidgetWithWrapper,tn as createFormFieldData,nn as createPrototypeLocal,on as dispatchIdEvent,rn as getFromDatabaseWithType,cn as getObjectsFromIndexDb,sn as getUserDetails,an as getWidgetBulkFromId,ln as getWidgetFromId,dn as handleServiceWorkerException,hn as hasActivatedSW,un as init,pn as recursiveFetch,fn as recursiveFetchNew,yn as removeAllChildren,vn as renderLatestWidget,gn as renderPage,mn as renderWidget,Cn as searchLinkMultipleListener,Tn as sendEmail,wn as sendMessage,In as serviceWorker,kn as setHasActivatedSW,Nn as storeToDatabase,An as subscribedListeners,Ln as unwrapContainers,Sn as updateAccessToken,_n as uploadAttachment,bn as uploadFile,Bn as uploadImage,En as validDocumentFormats,Gn as validImageFormats};
|
|
1
|
+
/*! For license information please see main.bundle.js.LICENSE.txt */
|
|
2
|
+
var e={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 c="double"==s.quotes?'"':"'",a=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 v=r.charCodeAt(u++);56320==(64512&v)?f=((1023&f)<<10)+(1023&v)+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||!a&&('"'==p&&c==p||"'"==p&&c==p)||a&&o.test(p)?"\\"+p:p;d+=y}return a&&(/^-[-\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})),!a&&s.wrap?c+d+c:d};r.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1},r.version="3.0.0",e.exports=r},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},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 c(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&&c(e,t)&&(n=!0)})),n}function a(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);c(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,c=e.nodes,a=-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,a=o,r=s;else{let t=s;s=e.clone({nodes:[]}),t&&s.append(t),i=i||s}})),n?r?(i.append(c),n.after(r)):n.after(c):e.after(c),e.next()&&n){let t;l.slice(0,a+1).forEach(((n,o,i)=>{let r=t;t=n.clone({nodes:[]}),r&&t.append(r);let s=[],c=(i[o-1]||e).next();for(;c;)s.push(c),c=c.next();t.append(s)})),t&&(r||c[c.length-1]).after(t)}}else e.after(e.nodes);e.remove()}const p=Symbol("rootRuleMergeSel"),f=Symbol("rootRuleEscapes");const y=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((c=>{"rule"===c.type&&i?r&&(c.selectors=a(n,c)):"atrule"===c.type&&c.nodes?e[c.name]?t(n,c,r):!1!==o[p]&&s.push(c):s.push(c)})),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),r=(e.rootRuleName||"at-root").replace(/^@/,""),s=e.preserveEmpty;return{Once(e){e.walkAtRules(r,(t=>{(function(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})(t),e[y]=!0}))},postcssPlugin:"postcss-nested",RootExit(e){e[y]&&(e.walkAtRules(r,h),e[y]=!1)},Rule(e){let i=!1,c=e,u=!1,h=[];e.each((s=>{switch(s.type){case"atrule":[c,h]=d(e.selector,h,c),s.name===r?(i=!0,n(e,s,!0,s[p]),c=l(s,c)):t[s.name]?(u=!0,i=!0,n(e,s,!0),c=l(s,c)):o[s.name]?(u=!0,i=!0,n(e,s,!1),c=l(s,c)):u&&h.push(s);break;case"decl":u&&h.push(s);break;case"rule":[c,h]=d(e.selector,h,c),u=!0,i=!0,s.selectors=a(e,s),c=l(s,c)}})),d(e.selector,h,c,!1),i&&!0!==s&&(e.raws.semicolon=!0,0===e.nodes.length&&e.remove())}}},e.exports.postcss=!0},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(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 c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),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 c=function(e){return new i.default(e)};Object.assign(c,r),delete c.__esModule;var a=c;t.default=a,e.exports=t.default},5170:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i,r=S(n(518)),s=S(n(339)),c=S(n(4195)),a=S(n(425)),l=S(n(7071)),d=S(n(9720)),u=S(n(5799)),h=S(n(7324)),p=I(n(5588)),f=S(n(1669)),y=S(n(1704)),v=S(n(2918)),g=S(n(263)),m=I(n(2648)),C=I(n(71)),w=I(n(1581)),T=n(9606);function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function I(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=k(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 S(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 N=((o={})[C.space]=!0,o[C.cr]=!0,o[C.feed]=!0,o[C.newline]=!0,o[C.tab]=!0,o),L=Object.assign({},N,((i={})[C.comment]=!0,i));function b(e){return{line:e[m.FIELDS.START_LINE],column:e[m.FIELDS.START_COL]}}function _(e){return{line:e[m.FIELDS.END_LINE],column:e[m.FIELDS.END_COL]}}function x(e,t,n,o){return{start:{line:e,column:t},end:{line:n,column:o}}}function E(e){return x(e[m.FIELDS.START_LINE],e[m.FIELDS.START_COL],e[m.FIELDS.END_LINE],e[m.FIELDS.END_COL])}function O(e,t){if(e)return x(e[m.FIELDS.START_LINE],e[m.FIELDS.START_COL],t[m.FIELDS.END_LINE],t[m.FIELDS.END_COL])}function B(e,t){var n=e[t];if("string"==typeof n)return-1!==n.indexOf("\\")&&((0,T.ensureObject)(e,"raws"),e[t]=(0,T.unesc)(n),void 0===e.raws[t]&&(e.raws[t]=n)),e}function R(e,t){for(var n=-1,o=[];-1!==(n=e.indexOf(t,n+1));)o.push(n);return o}var G=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,m.default)({css:this.css,error:this._errorGenerator(),safe:this.options.safe});var n=O(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=e.prototype;return o._errorGenerator=function(){var e=this;return function(t,n){return"string"==typeof e.rule?new Error(t):e.rule.error(t,n)}},o.attribute=function(){var e=[],t=this.currToken;for(this.position++;this.position<this.tokens.length&&this.currToken[m.FIELDS.TYPE]!==C.closeSquare;)e.push(this.currToken),this.position++;if(this.currToken[m.FIELDS.TYPE]!==C.closeSquare)return this.expected("closing square bracket",this.currToken[m.FIELDS.START_POS]);var n=e.length,o={source:x(t[1],t[2],this.currToken[3],this.currToken[4]),sourceIndex:t[m.FIELDS.START_POS]};if(1===n&&!~[C.word].indexOf(e[0][m.FIELDS.TYPE]))return this.expected("attribute",e[0][m.FIELDS.START_POS]);for(var i=0,r="",s="",c=null,a=!1;i<n;){var l=e[i],d=this.content(l),u=e[i+1];switch(l[m.FIELDS.TYPE]){case C.space:if(a=!0,this.options.lossy)break;if(c){(0,T.ensureObject)(o,"spaces",c);var h=o.spaces[c].after||"";o.spaces[c].after=h+d;var f=(0,T.getProp)(o,"raws","spaces",c,"after")||null;f&&(o.raws.spaces[c].after=f+d)}else r+=d,s+=d;break;case C.asterisk:u[m.FIELDS.TYPE]===C.equals?(o.operator=d,c="operator"):o.namespace&&("namespace"!==c||a)||!u||(r&&((0,T.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,T.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=r,s=""),o.namespace=(o.namespace||"")+d,(0,T.getProp)(o,"raws","namespace")&&(o.raws.namespace+=d),c="namespace"),a=!1;break;case C.dollar:if("value"===c){var y=(0,T.getProp)(o,"raws","value");o.value+="$",y&&(o.raws.value=y+"$");break}case C.caret:u[m.FIELDS.TYPE]===C.equals&&(o.operator=d,c="operator"),a=!1;break;case C.combinator:if("~"===d&&u[m.FIELDS.TYPE]===C.equals&&(o.operator=d,c="operator"),"|"!==d){a=!1;break}u[m.FIELDS.TYPE]===C.equals?(o.operator=d,c="operator"):o.namespace||o.attribute||(o.namespace=!0),a=!1;break;case C.word:if(u&&"|"===this.content(u)&&e[i+2]&&e[i+2][m.FIELDS.TYPE]!==C.equals&&!o.operator&&!o.namespace)o.namespace=d,c="namespace";else if(!o.attribute||"attribute"===c&&!a)r&&((0,T.ensureObject)(o,"spaces","attribute"),o.spaces.attribute.before=r,r=""),s&&((0,T.ensureObject)(o,"raws","spaces","attribute"),o.raws.spaces.attribute.before=s,s=""),o.attribute=(o.attribute||"")+d,(0,T.getProp)(o,"raws","attribute")&&(o.raws.attribute+=d),c="attribute";else if(!o.value&&""!==o.value||"value"===c&&!a&&!o.quoteMark){var v=(0,T.unesc)(d),g=(0,T.getProp)(o,"raws","value")||"",w=o.value||"";o.value=w+v,o.quoteMark=null,(v!==d||g)&&((0,T.ensureObject)(o,"raws"),o.raws.value=(g||w)+d),c="value"}else{var k="i"===d||"I"===d;!o.value&&""!==o.value||!o.quoteMark&&!a?(o.value||""===o.value)&&(c="value",o.value+=d,o.raws.value&&(o.raws.value+=d)):(o.insensitive=k,k&&"I"!==d||((0,T.ensureObject)(o,"raws"),o.raws.insensitiveFlag=d),c="insensitive",r&&((0,T.ensureObject)(o,"spaces","insensitive"),o.spaces.insensitive.before=r,r=""),s&&((0,T.ensureObject)(o,"raws","spaces","insensitive"),o.raws.spaces.insensitive.before=s,s=""))}a=!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[m.FIELDS.START_POS]});var I=(0,p.unescapeValue)(d),S=I.unescaped,A=I.quoteMark;o.value=S,o.quoteMark=A,c="value",(0,T.ensureObject)(o,"raws"),o.raws.value=d,a=!1;break;case C.equals:if(!o.attribute)return this.expected("attribute",l[m.FIELDS.START_POS],d);if(o.value)return this.error('Unexpected "=" found; an operator was already defined.',{index:l[m.FIELDS.START_POS]});o.operator=o.operator?o.operator+d:d,c="operator",a=!1;break;case C.comment:if(c)if(a||u&&u[m.FIELDS.TYPE]===C.space||"insensitive"===c){var N=(0,T.getProp)(o,"spaces",c,"after")||"",L=(0,T.getProp)(o,"raws","spaces",c,"after")||N;(0,T.ensureObject)(o,"raws","spaces",c),o.raws.spaces[c].after=L+d}else{var b=o[c]||"",_=(0,T.getProp)(o,"raws",c)||b;(0,T.ensureObject)(o,"raws"),o.raws[c]=_+d}else s+=d;break;default:return this.error('Unexpected "'+d+'" found.',{index:l[m.FIELDS.START_POS]})}i++}B(o,"attribute"),B(o,"namespace"),this.newNode(new p.default(o)),this.position++},o.parseWhitespaceEquivalentTokens=function(e){e<0&&(e=this.tokens.length);var t=this.position,n=[],o="",i=void 0;do{if(N[this.currToken[m.FIELDS.TYPE]])this.options.lossy||(o+=this.content());else if(this.currToken[m.FIELDS.TYPE]===C.comment){var r={};o&&(r.before=o,o=""),i=new a.default({value:this.content(),source:E(this.currToken),sourceIndex:this.currToken[m.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],c=this.tokens[this.position-1];n.push(new u.default({value:"",source:x(s[m.FIELDS.START_LINE],s[m.FIELDS.START_COL],c[m.FIELDS.END_LINE],c[m.FIELDS.END_COL]),sourceIndex:s[m.FIELDS.START_POS],spaces:{before:o,after:""}}))}return n},o.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}},o.isNamedCombinator=function(e){return void 0===e&&(e=this.position),this.tokens[e+0]&&this.tokens[e+0][m.FIELDS.TYPE]===C.slash&&this.tokens[e+1]&&this.tokens[e+1][m.FIELDS.TYPE]===C.word&&this.tokens[e+2]&&this.tokens[e+2][m.FIELDS.TYPE]===C.slash},o.namedCombinator=function(){if(this.isNamedCombinator()){var e=this.content(this.tokens[this.position+1]),t=(0,T.unesc)(e).toLowerCase(),n={};t!==e&&(n.value="/"+e+"/");var o=new y.default({value:"/"+t+"/",source:x(this.currToken[m.FIELDS.START_LINE],this.currToken[m.FIELDS.START_COL],this.tokens[this.position+2][m.FIELDS.END_LINE],this.tokens[this.position+2][m.FIELDS.END_COL]),sourceIndex:this.currToken[m.FIELDS.START_POS],raws:n});return this.position=this.position+3,o}this.unexpected()},o.combinator=function(){var e=this;if("|"===this.content())return this.namespace();var t=this.locateNextMeaningfulToken(this.position);if(!(t<0||this.tokens[t][m.FIELDS.TYPE]===C.comma||this.tokens[t][m.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[m.FIELDS.TYPE]===C.combinator?(n=new y.default({value:this.content(),source:E(this.currToken),sourceIndex:this.currToken[m.FIELDS.START_POS]}),this.position++):N[this.currToken[m.FIELDS.TYPE]]||i||this.unexpected(),n){if(i){var r=this.convertWhitespaceNodesToSpace(i),s=r.space,c=r.rawSpace;n.spaces.before=s,n.rawSpaceBefore=c}}else{var a=this.convertWhitespaceNodesToSpace(i,!0),l=a.space,d=a.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:O(o,this.tokens[this.position-1]),sourceIndex:o[m.FIELDS.START_POS],spaces:u,raws:h})}return this.currToken&&this.currToken[m.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 v=this.convertWhitespaceNodesToSpace(p),g=v.space,w=v.rawSpace;void 0!==w&&(f.rawSpaceAfter+=w),f.spaces.after+=g}else p.forEach((function(t){return e.newNode(t)}))}},o.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:b(this.tokens[this.position+1])},sourceIndex:this.tokens[this.position+1][m.FIELDS.START_POS]});this.current.parent.append(e),this.current=e,this.position++},o.comment=function(){var e=this.currToken;this.newNode(new a.default({value:this.content(),source:E(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++},o.error=function(e,t){throw this.root.error(e,t)},o.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[m.FIELDS.START_POS]})},o.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[m.FIELDS.START_POS])},o.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[m.FIELDS.START_POS])},o.unexpected=function(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[m.FIELDS.START_POS])},o.unexpectedPipe=function(){return this.error("Unexpected '|'.",this.currToken[m.FIELDS.START_POS])},o.namespace=function(){var e=this.prevToken&&this.content(this.prevToken)||!0;return this.nextToken[m.FIELDS.TYPE]===C.word?(this.position++,this.word(e)):this.nextToken[m.FIELDS.TYPE]===C.asterisk?(this.position++,this.universal(e)):void this.unexpectedPipe()},o.nesting=function(){if(this.nextToken&&"|"===this.content(this.nextToken))this.position++;else{var e=this.currToken;this.newNode(new v.default({value:this.content(),source:E(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++}},o.parentheses=function(){var e=this.current.last,t=1;if(this.position++,e&&e.type===w.PSEUDO){var n=new s.default({source:{start:b(this.tokens[this.position])},sourceIndex:this.tokens[this.position][m.FIELDS.START_POS]}),o=this.current;for(e.append(n),this.current=n;this.position<this.tokens.length&&t;)this.currToken[m.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[m.FIELDS.TYPE]===C.closeParenthesis&&t--,t?this.parse():(this.current.source.end=_(this.currToken),this.current.parent.source.end=_(this.currToken),this.position++);this.current=o}else{for(var i,r=this.currToken,c="(";this.position<this.tokens.length&&t;)this.currToken[m.FIELDS.TYPE]===C.openParenthesis&&t++,this.currToken[m.FIELDS.TYPE]===C.closeParenthesis&&t--,i=this.currToken,c+=this.parseParenthesisToken(this.currToken),this.position++;e?e.appendToPropertyAndEscape("value",c,c):this.newNode(new u.default({value:c,source:x(r[m.FIELDS.START_LINE],r[m.FIELDS.START_COL],i[m.FIELDS.END_LINE],i[m.FIELDS.END_COL]),sourceIndex:r[m.FIELDS.START_POS]}))}if(t)return this.expected("closing parenthesis",this.currToken[m.FIELDS.START_POS])},o.pseudo=function(){for(var e=this,t="",n=this.currToken;this.currToken&&this.currToken[m.FIELDS.TYPE]===C.colon;)t+=this.content(),this.position++;return this.currToken?this.currToken[m.FIELDS.TYPE]!==C.word?this.expected(["pseudo-class","pseudo-element"],this.currToken[m.FIELDS.START_POS]):void this.splitWord(!1,(function(o,i){t+=o,e.newNode(new h.default({value:t,source:O(n,e.currToken),sourceIndex:n[m.FIELDS.START_POS]})),i>1&&e.nextToken&&e.nextToken[m.FIELDS.TYPE]===C.openParenthesis&&e.error("Misplaced parenthesis.",{index:e.nextToken[m.FIELDS.START_POS]})})):this.expected(["pseudo-class","pseudo-element"],this.position-1)},o.space=function(){var e=this.content();0===this.position||this.prevToken[m.FIELDS.TYPE]===C.comma||this.prevToken[m.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[m.FIELDS.TYPE]===C.comma||this.nextToken[m.FIELDS.TYPE]===C.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(e),this.position++):this.combinator()},o.string=function(){var e=this.currToken;this.newNode(new u.default({value:this.content(),source:E(e),sourceIndex:e[m.FIELDS.START_POS]})),this.position++},o.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:E(n),sourceIndex:n[m.FIELDS.START_POS]}),e),this.position++},o.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[m.FIELDS.TYPE]);){this.position++;var r=this.content();if(i+=r,r.lastIndexOf("\\")===r.length-1){var s=this.nextToken;s&&s[m.FIELDS.TYPE]===C.space&&(i+=this.requiredSpace(this.content(s)),this.position++)}o=this.nextToken}var a=R(i,".").filter((function(e){var t="\\"===i[e-1],n=/^\d+\.\d+%$/.test(i);return!t&&!n})),u=R(i,"#").filter((function(e){return"\\"!==i[e-1]})),h=R(i,"#{");h.length&&(u=u.filter((function(e){return!~h.indexOf(e)})));var p=(0,g.default)(function(){var e=Array.prototype.concat.apply([],arguments);return e.filter((function(t,n){return n===e.indexOf(t)}))}([0].concat(a,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,v=y[m.FIELDS.START_POS]+p[r],g=x(y[1],y[2]+o,y[3],y[2]+(h-1));if(~a.indexOf(o)){var C={value:f.slice(1),source:g,sourceIndex:v};s=new c.default(B(C,"value"))}else if(~u.indexOf(o)){var w={value:f.slice(1),source:g,sourceIndex:v};s=new l.default(B(w,"value"))}else{var T={value:f,source:g,sourceIndex:v};B(T,"value"),s=new d.default(T)}n.newNode(s,e),e=null})),this.position++},o.word=function(e){var t=this.nextToken;return t&&"|"===this.content(t)?(this.position++,this.namespace()):this.splitWord(e)},o.loop=function(){for(;this.position<this.tokens.length;)this.parse(!0);return this.current._inferEndPosition(),this.root},o.parse=function(e){switch(this.currToken[m.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()}},o.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})},o.requiredSpace=function(e){return this.options.lossy?" ":e},o.optionalSpace=function(e){return this.options.lossy?"":e},o.lossySpace=function(e,t){return this.options.lossy?t?" ":"":e},o.parseParenthesisToken=function(e){var t=this.content(e);return e[m.FIELDS.TYPE]===C.space?this.requiredSpace(t):t},o.newNode=function(e,t){return t&&(/^ +$/.test(t)&&(this.options.lossy||(this.spaces=(this.spaces||"")+t),t=!0),e.namespace=t,B(e,"namespace")),this.spaces&&(e.spaces.before=this.spaces,this.spaces=""),this.current.append(e)},o.content=function(e){return void 0===e&&(e=this.currToken),this.css.slice(e[m.FIELDS.START_POS],e[m.FIELDS.END_POS])},o.locateNextMeaningfulToken=function(e){void 0===e&&(e=this.position+1);for(var t=e;t<this.tokens.length;){if(!L[this.tokens[t][m.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),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=G,e.exports=t.default},8349:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(5170))&&o.__esModule?o:{default:o},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},5588:(e,t,n)=>{t.__esModule=!0,t.default=void 0,t.unescapeValue=v;var o,i=a(n(8937)),r=a(n(5286)),s=a(n(3295)),c=n(1581);function a(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 v(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 g=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=v(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=c.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,a=o.prototype;return a.getQuotedValue=function(e){void 0===e&&(e={});var t=this._determineQuoteMark(e),n=m[t];return(0,i.default)(this._value,n)},a._determineQuoteMark=function(e){return e.smart?this.smartQuoteMark(e):this.preferredQuoteMark(e)},a.setValue=function(e,t){void 0===t&&(t={}),this._value=e,this._quoteMark=this._determineQuoteMark(t),this._syncRawValue()},a.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 c=this.preferredQuoteMark(e);if(c===o.NO_QUOTE){var a=this.quoteMark||e.quoteMark||o.DOUBLE_QUOTE,l=m[a];if((0,i.default)(t,l).length<s.length)return a}return c}return r===n?this.preferredQuoteMark(e):r<n?o.DOUBLE_QUOTE:o.SINGLE_QUOTE},a.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},a._syncRawValue=function(){var e=(0,i.default)(this._value,m[this.quoteMark]);e===this._value?this.raws&&delete this.raws.value:this.raws.value=e},a._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]}},a._spacesFor=function(e){var t=this.spaces[e]||{},n=this.raws.spaces&&this.raws.spaces[e]||{};return Object.assign({before:"",after:""},t,n)},a._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)},a.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)},a.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=v(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),Object.defineProperty(r,"prototype",{writable:!1}),o}(s.default);t.default=g,g.NO_QUOTE=null,g.SINGLE_QUOTE="'",g.DOUBLE_QUOTE='"';var m=((o={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}}).null={isIdentifier:!0},o);function C(e,t){return""+t.before+e+t.after}},4195:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=c(n(8937)),i=n(9606),r=c(n(4646)),s=n(1581);function c(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)}}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,c;function d(t){var n;return(n=e.call(this,t)||this).type=s.CLASS,n._constructed=!0,n}return n=e,(t=d).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n),d.prototype.valueToString=function(){return"."+e.prototype.valueToString.call(this)},r=d,(c=[{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}}])&&a(r.prototype,c),Object.defineProperty(r,"prototype",{writable:!1}),d}(r.default);t.default=d,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 c=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=c,e.exports=t.default},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 c=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=c,e.exports=t.default},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)),c=y(n(7071)),a=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 c.default(e)},t.nesting=function(e){return new a.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)}},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(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 c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),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 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 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)}}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;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,l(t,n);var i,s,d=o.prototype;return d.append=function(e){return e.parent=this,this.nodes.push(e),this},d.prepend=function(e){for(var t in e.parent=this,this.nodes.unshift(e),this.indexes)this.indexes[t]++;return this},d.at=function(e){return this.nodes[e]},d.index=function(e){return"number"==typeof e?e:this.nodes.indexOf(e)},d.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},d.removeAll=function(){for(var e,t=function(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){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(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.")}(this.nodes);!(e=t()).done;)e.value.parent=void 0;return this.nodes=[],this},d.empty=function(){return this.removeAll()},d.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 c in(n=this.nodes).splice.apply(n,[i+1,0,t].concat(r)),t.parent=this,this.indexes)i<(o=this.indexes[c])&&(this.indexes[c]=o+arguments.length-1);return this},d.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 c in(n=this.nodes).splice.apply(n,[i,0,t].concat(r)),t.parent=this,this.indexes)(o=this.indexes[c])>=i&&(this.indexes[c]=o+arguments.length-1);return this},d._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},d.atPosition=function(e,t){return this.isAtPosition(e,t)?this._findChildAtPosition(e,t)||this:void 0},d._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))},d.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}},d.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}))},d.walkAttributes=function(e){var t=this;return this.walk((function(n){if(n.type===r.ATTRIBUTE)return e.call(t,n)}))},d.walkClasses=function(e){var t=this;return this.walk((function(n){if(n.type===r.CLASS)return e.call(t,n)}))},d.walkCombinators=function(e){var t=this;return this.walk((function(n){if(n.type===r.COMBINATOR)return e.call(t,n)}))},d.walkComments=function(e){var t=this;return this.walk((function(n){if(n.type===r.COMMENT)return e.call(t,n)}))},d.walkIds=function(e){var t=this;return this.walk((function(n){if(n.type===r.ID)return e.call(t,n)}))},d.walkNesting=function(e){var t=this;return this.walk((function(n){if(n.type===r.NESTING)return e.call(t,n)}))},d.walkPseudos=function(e){var t=this;return this.walk((function(n){if(n.type===r.PSEUDO)return e.call(t,n)}))},d.walkTags=function(e){var t=this;return this.walk((function(n){if(n.type===r.TAG)return e.call(t,n)}))},d.walkUniversals=function(e){var t=this;return this.walk((function(n){if(n.type===r.UNIVERSAL)return e.call(t,n)}))},d.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}),[])},d.map=function(e){return this.nodes.map(e)},d.reduce=function(e,t){return this.nodes.reduce(e,t)},d.every=function(e){return this.nodes.every(e)},d.some=function(e){return this.nodes.some(e)},d.filter=function(e){return this.nodes.filter(e)},d.sort=function(e){return this.nodes.sort(e)},d.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}}])&&a(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=d,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 a(e)||m(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 c(e,t){return s(t)&&t.type===e}var a=c.bind(null,i.ATTRIBUTE);t.isAttribute=a;var l=c.bind(null,i.CLASS);t.isClassName=l;var d=c.bind(null,i.COMBINATOR);t.isCombinator=d;var u=c.bind(null,i.COMMENT);t.isComment=u;var h=c.bind(null,i.ID);t.isIdentifier=h;var p=c.bind(null,i.NESTING);t.isNesting=p;var f=c.bind(null,i.PSEUDO);t.isPseudo=f;var y=c.bind(null,i.ROOT);t.isRoot=y;var v=c.bind(null,i.SELECTOR);t.isSelector=v;var g=c.bind(null,i.STRING);t.isString=g;var m=c.bind(null,i.TAG);t.isTag=m;var C=c.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},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 c=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=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]))}))},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 c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var a=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,c(t,n);var a,l,d=r.prototype;return d.qualifiedName=function(e){return this.namespace?this.namespaceString+"|"+e:e},d.valueToString=function(){return this.qualifiedName(e.prototype.valueToString.call(this))},a=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(a.prototype,l),Object.defineProperty(a,"prototype",{writable:!1}),r}(r(n(4646)).default);t.default=a,e.exports=t.default},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 c=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=c,e.exports=t.default},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=e.prototype;return s.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},s.replaceWith=function(){if(this.parent){for(var e in arguments)this.parent.insertBefore(this,arguments[e]);this.remove()}return this},s.next=function(){return this.parent.at(this.parent.index(this)+1)},s.prev=function(){return this.parent.at(this.parent.index(this)-1)},s.clone=function(e){void 0===e&&(e={});var t=r(this);for(var n in e)t[n]=e[n];return t},s.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]},s.setPropertyAndEscape=function(e,t,n){this.raws||(this.raws={}),this[e]=t,this.raws[e]=n},s.setPropertyWithoutEscape=function(e,t){this[e]=t,this.raws&&delete this.raws[e]},s.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)},s.stringifyProperty=function(e){return this.raws&&this.raws[e]||this[e]},s.valueToString=function(){return String(this.stringifyProperty("value"))},s.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),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s,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 c=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=c,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 c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var a=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,c(t,n);var i,a,l=o.prototype;return l.toString=function(){var e=this.reduce((function(e,t){return e.push(String(t)),e}),[]).join(",");return this.trailingComma?e+",":e},l.error=function(e,t){return this._error?this._error(e,t):new Error(e)},i=o,(a=[{key:"errorGenerator",set:function(e){this._error=e}}])&&s(i.prototype,a),Object.defineProperty(i,"prototype",{writable:!1}),o}(i.default);t.default=a,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 c=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=c,e.exports=t.default},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 c=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=c,e.exports=t.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 c=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=c,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 c=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=c,e.exports=t.default},263:(e,t)=>{t.__esModule=!0,t.default=function(e){return e.sort((function(e,t){return e-t}))},e.exports=t.default},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},2648:(e,t,n)=>{t.__esModule=!0,t.FIELDS=void 0,t.default=function(e){var t,n,o,i,s,c,a,l,d,h,p,f,y=[],v=e.css.valueOf(),g=v.length,m=-1,C=1,w=0,T=0;function k(t,n){if(!e.safe)throw e.error("Unclosed "+t,C,w-m,w);l=(v+=n).length-1}for(;w<g;){switch((t=v.charCodeAt(w))===r.newline&&(m=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=v.charCodeAt(l))===r.newline&&(m=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-m-1,T=l;break;case r.plus:case r.greaterThan:case r.tilde:case r.pipe:l=w;do{l+=1,t=v.charCodeAt(l)}while(t===r.plus||t===r.greaterThan||t===r.tilde||t===r.pipe);f=r.combinator,o=C,n=w-m,T=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-m,T=(l=w)+1;break;case r.singleQuote:case r.doubleQuote:p=t===r.singleQuote?"'":'"',l=w;do{for(i=!1,-1===(l=v.indexOf(p,l+1))&&k("quote",p),s=l;v.charCodeAt(s-1)===r.backslash;)s-=1,i=!i}while(i);f=r.str,o=C,n=w-m,T=l+1;break;default:t===r.slash&&v.charCodeAt(w+1)===r.asterisk?(0===(l=v.indexOf("*/",w+2)+1)&&k("comment","*/"),(c=(a=v.slice(w,l+1).split("\n")).length-1)>0?(d=C+c,h=l-a[c].length):(d=C,h=m),f=r.comment,C=d,o=d,n=l-h):t===r.slash?(f=t,o=C,n=w-m,T=(l=w)+1):(l=u(v,w),f=r.word,o=C,n=l-m),T=l+1}y.push([f,C,w-m,o,n,w,T]),h&&(m=h,h=null),w=T}return y};var o,i,r=function(e,t){if(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 c=i?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(o,r,c):o[r]=e[r]}return o.default=e,n&&n.set(e,o),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 c=((o={})[r.tab]=!0,o[r.newline]=!0,o[r.cr]=!0,o[r.feed]=!0,o),a=((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=0;d<22;d++)l["0123456789abcdefABCDEF".charCodeAt(d)]=!0;function u(e,t){var n,o=t;do{if(n=e.charCodeAt(o),a[n])return o-1;n===r.backslash?o=h(e,o)+1:o++}while(o<e.length);return o-1}function h(e,t){var n=t,o=e.charCodeAt(n+1);if(c[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}},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},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},9606:(e,t,n)=>{t.__esModule=!0,t.unesc=t.stripComments=t.getProp=t.ensureObject=void 0;var o=c(n(5286));t.unesc=o.default;var i=c(n(6291));t.getProp=i.default;var r=c(n(1557));t.ensureObject=r.default;var s=c(n(8354));function c(e){return e&&e.__esModule?e:{default:e}}t.stripComments=s.default},8354:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t="",n=e.indexOf("/*"),o=0;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},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},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)},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},7793:(e,t,n)=>{let o,i,r,s,c=n(9371),a=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 a(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 c(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,a.prototype):"comment"===e.type?Object.setPrototypeOf(e,c.prototype):"root"===e.type&&Object.setPrototypeOf(e,r.prototype),e[u]=!0,e.nodes&&e.nodes.forEach((e=>{f.rebuild(e)}))}},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:c}=o.createColors(!0);r=t=>e(c(t)),n=e=>t(e),i&&(s=e=>i(e))}let c=t.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,c.length),d=String(l).length;return c.slice(a,l).map(((e,t)=>{let o=a+1+t,i=" "+(" "+o).slice(-d)+" | ";if(o===this.line){if(e.length>160){let t=20,o=Math.max(0,this.column-t),c=Math.max(this.column+t,this.endColumn+t),a=e.slice(o,c),l=n(i.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return r(">")+n(i)+s(a)+"\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},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},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},3438:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(1106),c=n(3878),a=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__:c.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 a(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},1106:(e,t,n)=>{let{nanoid:o}=n(5042),{isAbsolute:i,resolve:r}=n(197),{SourceMapConsumer:s,SourceMapGenerator:c}=n(1866),{fileURLToPath:a,pathToFileURL:l}=n(2739),d=n(3614),u=n(3878),h=n(9746),p=Symbol("lineToIndexCache"),f=Boolean(s&&c),y=Boolean(r&&i);function v(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 g{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,c,a;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){c=e.offset;let o=this.fromOffset(c);t=o.line,n=o.col}else t=e.line,n=e.column,c=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)c=this.fromLineAndColumn(t,n);else{c=t;let e=this.fromOffset(c);t=e.line,n=e.col}let u=this.origin(t,n,r,i);return a=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),a.input={column:n,endColumn:i,endLine:r,endOffset:s,line:t,offset:c,source:this.css},this.file&&(l&&(a.input.url=l(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return v(this)[e-1]+t-1}fromOffset(e){let t=v(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,c=this.map.consumer(),d=c.originalPositionFor({column:t,line:e});if(!d.source)return!1;"number"==typeof n&&(r=c.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(!a)throw new Error("file: protocol is not available in this PostCSS build");u.file=a(s)}let h=c.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=g,g.default=g,h&&h.registerInput&&h.registerInput(g)},6966:(e,t,n)=>{let o=n(7793),i=n(145),r=n(3604),s=n(9577),c=n(3717),a=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 v(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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:v(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(e){return e[d]=!1,e.nodes&&e.nodes.forEach((e=>m(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 c)i=m(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=m(t);this.result=new c(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&&console.error(e)}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=[g(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(g(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=v(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,a.registerLazyResult(w),i.registerLazyResult(w)},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,c=!1,a="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:c?n===a&&(c=!1):'"'===n||"'"===n?(c=!0,a=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},3604:(e,t,n)=>{let{dirname:o,relative:i,resolve:r,sep:s}=n(197),{SourceMapConsumer:c,SourceMapGenerator:a}=n(1866),{pathToFileURL:l}=n(2739),d=n(1106),u=Boolean(c&&a),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 c(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=a.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new a({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 a({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,c,a)=>{if(this.css+=s,c&&"end"!==a&&(r.generated.line=n,r.generated.column=o-1,c.source&&c.source.start?(r.source=this.sourcePath(c),r.original.line=c.source.start.line,r.original.column=c.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,c&&"start"!==a){let e=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===e.last&&!e.raws.semicolon||(c.source&&c.source.end?(r.source=this.sourcePath(c),r.original.line=c.source.end.line,r.original.column=c.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}}},4211:(e,t,n)=>{let o=n(3604),i=n(9577);const r=n(3717);let s=n(3303);n(6156);class c{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 c=s;this.result=new r(this._processor,i,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new o(c,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=c,c.default=c},3152:(e,t,n)=>{let o=n(3614),i=n(7668),r=n(3303),{isClean:s,my:c}=n(4151);function a(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=>a(e,n))):("object"===r&&null!==i&&(i=a(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[c]=!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=a(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},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)},8339:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(5644),c=n(1534),a=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,c=!1,a=[],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){c=!0;break}if("}"===t){if(a.length>0){for(i=a.length-1,n=a[i];n&&"space"===n[0];)n=a[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),s&&(e=a[a.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=""),c&&(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=a(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,c=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)c.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+=c.map((e=>e[1])).join(""),c=[]),this.raw(n,"value",c.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 c;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("--"),c=[],a=e;for(;a;){if(n=a[0],c.push(a),"("===n||"["===n)i||(i=a),r.push("("===n?")":"]");else if(s&&o&&"{"===n)i||(i=a),r.push("}");else if(0===r.length){if(";"===n){if(o)return void this.decl(c,s);break}if("{"===n)return void this.rule(c);if("}"===n){this.tokenizer.back(c.pop()),t=!0;break}":"===n&&(o=!0)}else n===r[r.length-1]&&(r.pop(),0===r.length&&(i=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),r.length>0&&this.unclosedBracket(i),t&&o){if(!s)for(;c.length&&(a=c[c.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(c.pop());this.decl(c,s)}else this.unknownWord(c)}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,c,a=n.length,d="",u=!0;for(let e=0;e<a;e+=1)i=n[e],r=i[0],"space"!==r||e!==a-1||o?"comment"===r?(c=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",l[c]||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 c;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})}}},2895:(e,t,n)=>{let o=n(396),i=n(9371),r=n(7793),s=n(3614),c=n(5238),a=n(145),l=n(3438),d=n(1106),u=n(6966),h=n(1752),p=n(3152),f=n(9577),y=n(6846),v=n(3717),g=n(5644),m=n(1534),C=n(3303),w=n(38);function T(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new y(e)}T.plugin=function(e,t){let n,o=!1;function i(...n){console&&console.warn&&!o&&(o=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));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 T([i(n)]).process(e,t)},i},T.stringify=C,T.parse=f,T.fromJSON=l,T.list=h,T.comment=e=>new i(e),T.atRule=e=>new o(e),T.decl=e=>new c(e),T.rule=e=>new m(e),T.root=e=>new g(e),T.document=e=>new a(e),T.CssSyntaxError=s,T.Declaration=c,T.Container=r,T.Processor=y,T.Document=a,T.Comment=i,T.Warning=w,T.AtRule=o,T.Result=v,T.Input=d,T.Rule=m,T.Root=g,T.Node=p,u.registerPostcss(T),e.exports=T,T.default=T},3878:(e,t,n)=>{let{existsSync:o,readFileSync:i}=n(9977),{dirname:r,join:s}=n(197),{SourceMapConsumer:c,SourceMapGenerator:a}=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 c(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 c)return a.fromSourceMap(t).toString();if(t instanceof a)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},6846:(e,t,n)=>{let o=n(145),i=n(6966),r=n(4211),s=n(5644);class c{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=c,c.default=c,s.registerProcessor(c),o.registerProcessor(c)},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},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)},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)},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"+((c=o)[0].toUpperCase()+c.slice(1));this[t]?i=this[t](s,e):s.walk((e=>{if(i=e.raws[n],void 0!==i)return!1}))}var c;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},3303:(e,t,n)=>{let o=n(7668);function i(e,t){new o(t).stringify(e)}e.exports=i,i.default=i},4151:e=>{e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},5781:e=>{const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),i="/".charCodeAt(0),r="\n".charCodeAt(0),s=" ".charCodeAt(0),c="\f".charCodeAt(0),a="\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),v=";".charCodeAt(0),g="*".charCodeAt(0),m=":".charCodeAt(0),C="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,T=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,k=/.[\r\n"'(/\\]/,I=/[\da-f]/i;e.exports=function(e,S={}){let A,N,L,b,_,x,E,O,B,R,G=e.css.valueOf(),D=S.ignoreErrors,F=G.length,P=0,U=[],W=[];function M(t){throw e.error("Unclosed "+t,P)}return{back:function(e){W.push(e)},endOfFile:function(){return 0===W.length&&P>=F},nextToken:function(e){if(W.length)return W.pop();if(P>=F)return;let S=!!e&&e.ignoreUnclosed;switch(A=G.charCodeAt(P),A){case r:case s:case a:case l:case c:b=P;do{b+=1,A=G.charCodeAt(b)}while(A===s||A===r||A===a||A===l||A===c);x=["space",G.slice(P,b)],P=b-1;break;case d:case u:case f:case y:case m:case v:case p:{let e=String.fromCharCode(A);x=[e,e,P];break}case h:if(R=U.length?U.pop()[1]:"",B=G.charCodeAt(P+1),"url"===R&&B!==t&&B!==n&&B!==s&&B!==r&&B!==a&&B!==c&&B!==l){b=P;do{if(E=!1,b=G.indexOf(")",b+1),-1===b){if(D||S){b=P;break}M("bracket")}for(O=b;G.charCodeAt(O-1)===o;)O-=1,E=!E}while(E);x=["brackets",G.slice(P,b+1),P,b],P=b}else b=G.indexOf(")",P+1),N=G.slice(P,b+1),-1===b||k.test(N)?x=["(","(",P]:(x=["brackets",N,P,b],P=b);break;case t:case n:_=A===t?"'":'"',b=P;do{if(E=!1,b=G.indexOf(_,b+1),-1===b){if(D||S){b=P+1;break}M("string")}for(O=b;G.charCodeAt(O-1)===o;)O-=1,E=!E}while(E);x=["string",G.slice(P,b+1),P,b],P=b;break;case C:w.lastIndex=P+1,w.test(G),b=0===w.lastIndex?G.length-1:w.lastIndex-2,x=["at-word",G.slice(P,b+1),P,b],P=b;break;case o:for(b=P,L=!0;G.charCodeAt(b+1)===o;)b+=1,L=!L;if(A=G.charCodeAt(b+1),L&&A!==i&&A!==s&&A!==r&&A!==a&&A!==l&&A!==c&&(b+=1,I.test(G.charAt(b)))){for(;I.test(G.charAt(b+1));)b+=1;G.charCodeAt(b+1)===s&&(b+=1)}x=["word",G.slice(P,b+1),P,b],P=b;break;default:A===i&&G.charCodeAt(P+1)===g?(b=G.indexOf("*/",P+2)+1,0===b&&(D||S?b=G.length:M("comment")),x=["comment",G.slice(P,b+1),P,b],P=b):(T.lastIndex=P+1,T.test(G),b=0===T.lastIndex?G.length-1:T.lastIndex-2,x=["word",G.slice(P,b+1),P,b],U.push(x),P=b)}return P++,x},position:function(){return P}}}},6156:e=>{let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(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},1735:(e,t,n)=>{n.d(t,{J:()=>c});var o,i=n(949),r=n(3278),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class c{static incrementConcept(e){try{e&&(this.conceptsData[e]=(this.conceptsData[e]||0)+1)}catch(e){console.error("Failed on increment concept")}}static incrementConnection(e){try{e&&(this.connectionsData[e]=(this.connectionsData[e]||0)+1)}catch(e){console.error("Failed on increment connection")}}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 s(this,void 0,void 0,(function*(){try{yield this.syncToServer()}catch(e){console.error("Failed to process Access Tracker Sync with Server")}}))}static syncToServer(){return s(this,void 0,void 0,(function*(){try{if(!Object.keys(this.conceptsData).length&&!Object.keys(this.connectionsData).length)return;const e=r.b.BearerAccessToken;if(!e)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 fetch(i.BaseUrl.PostPrefetchConceptConnections(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${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){console.error("Sync error:",e)}}))}static setNextSyncTime(){this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS}static startAutoSync(){setInterval((()=>{const e=Date.now();this.nextSyncTime&&e>=this.nextSyncTime&&this.syncNow().catch(console.error)}),6e4)}static syncNow(){return s(this,void 0,void 0,(function*(){try{this.activateStatus?yield this.syncToServer():console.warn("Access Tracker inactive.")}catch(e){console.error("Error on sync access tracker")}}))}static GetSuggestedConcepts(e){return s(this,void 0,void 0,(function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConcepts());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load concepts: ${o.status} ${o.statusText}. Details: ${e}`)}const s=(yield o.json())||[];return yield this.addConceptToBinaryTree(s.data),s}catch(e){throw e instanceof Error?(console.error("Error fetching suggested concepts:",e.message),new Error("Unable to fetch suggested concepts. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested concepts."))}}))}static GetSuggestedConnections(e){return s(this,void 0,void 0,(function*(){try{const t=r.b.BearerAccessToken,n=new URL(i.BaseUrl.GetSuggestedConnections());void 0!==e&&n.searchParams.append("top",e.toString());const o=yield fetch(n.toString(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const e=yield o.text();throw new Error(`Failed to load connections: ${o.status} ${o.statusText}. Details: ${e}`)}const s=(yield o.json())||[];return yield this.addConnectionToBinaryTree(s.data),s}catch(e){throw e instanceof Error?(console.error("Error fetching suggested Connections:",e.message),new Error("Unable to fetch suggested connections. Please try again later.")):(console.error("An unexpected error occurred:",e),new Error("An unexpected error occurred while fetching suggested Connections."))}}))}static addConceptToBinaryTree(e){return s(this,void 0,void 0,(function*(){try{e.forEach((e=>{i.ConceptsData.AddConcept(e)}))}catch(e){console.error("Error on adding Concepts Data into tree")}}))}static addConnectionToBinaryTree(e){return s(this,void 0,void 0,(function*(){try{e.forEach((e=>{i.ConnectionData.AddConnection(e)}))}catch(e){console.error("Error on adding Connections Data into tree")}}))}}o=c,c.conceptsData={},c.connectionsData={},c.SYNC_INTERVAL_MS=12e4,c.nextSyncTime=Date.now(),c.activateStatus=!1,c.accessData="Access Data",o.startAutoSync()},1167:(e,t,n)=>{n.d(t,{Y:()=>a});var o=n(9581),i=n(3518),r=n(949),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function a(e){return c(this,void 0,void 0,(function*(){const t=r.Logger.logfunction("CreateTheConceptApi",e);let n=(0,r.CreateDefaultConcept)();try{var c=(0,i.Xr)();const a=yield fetch(o.B.CreateTheConceptUrl(),{method:"POST",headers:c,body:JSON.stringify(e)});if(!a.ok)throw(0,s.ry)(a),new Error(`Error! status: ${a.status}`);return n=yield a.json(),r.Logger.logUpdate(t),n}catch(e){e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),(0,s.Mb)(e,o.B.CreateTheConceptUrl()),(0,s.ey)(t,"CreateTheConceptApi",e)}}))}},2:(e,t,n)=>{n.d(t,{s:()=>d});var o=n(8286),i=n(9581),r=n(1412),s=n(3518),c=n(1863),a=n(949),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=a.Logger.logfunction("GetAllConnectionsOfComposition",t);var i=[];if(0==(i=yield o.d.GetConnectionsOfConcept(e)).length)i=yield u(e);else{var s=yield u(e);(0,r.e)(s,i),i=s}return a.Logger.logUpdate(n),i}))}function u(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=a.Logger.logfunction("GetAllConnectionsOfCompositionOnline",t);var r=[];try{(0,s.Xr)("application/json");const t=new Headers,d=new FormData;d.append("composition_id",e.toString());const u=yield fetch(i.B.GetAllConnectionsOfCompositionUrl(),{method:"POST",headers:t,body:d});if(console.log("this is getting connection from online",i.B.GetAllConnectionsOfCompositionUrl(),e),!u.ok)throw(0,c.ry)(u),new Error(`Error! status: ${u.status}`);const h=yield u.json();for(var l=0;l<h.length;l++)o.d.AddConnection(h[l]),r.push(h[l]);return a.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connection of composition error : ",e.message):console.log("Get all connection of composition error : ",e),(0,c.Mb)(e,i.B.GetAllConnectionsOfCompositionUrl()),(0,c.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}}))}},8642:(e,t,n)=>{n.d(t,{Y:()=>h});var o=n(8286),i=n(9581),r=n(4364),s=n(5284),c=n(1412),a=n(3518),l=n(1863),d=n(949),u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function h(){var e=arguments;return u(this,arguments,void 0,(function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionBulk",e)||{};if(d.serviceWorker){n.serviceWorker=!0;try{const e=yield(0,d.sendMessage)("GetAllConnectionsOfCompositionBulk",{composition_ids:t});return d.Logger.logUpdate(n),e.data}catch(e){console.error("GetAllConnectionsOfCompositionBulk sw error: ",e),(0,l.ey)(n,"GetAllConnectionsOfCompositionBulk",e),(0,d.handleServiceWorkerException)(e)}}var h=[];if(t.length<=0)return h;var p=yield(0,s.B)(t),f=yield function(){var e=arguments;return u(this,arguments,void 0,(function*(t=[]){const n=d.Logger.logfunction("GetAllConnectionsOfCompositionOnline",e);var r=[];try{var s=(0,a.Xr)();const e=yield fetch(i.B.GetAllConnectionsOfCompositionBulkUrl(),{method:"POST",headers:s,body:JSON.stringify(t)});if(e.ok){const t=yield e.json();for(var c=0;c<t.length;c++)o.d.AddConnection(t[c]),r.push(t[c])}else console.log("Get all connections of composition bulk error message: ","Cannot get response"),(0,l.ry)(e);return d.Logger.logUpdate(n),r}catch(e){e instanceof Error?console.log("Get all connections of composition bulk error message: ",e.message):console.log("Get all connections of composition bulk unexpected error: ",e),(0,l.Mb)(e,i.B.GetAllConnectionsOfCompositionBulkUrl()),(0,l.ey)(n,"GetAllConnectionsOfCompositionOnline",e)}}))}(t);return h=f,(0,c.e)(h,p),yield(0,r.s)(h),d.Logger.logUpdate(n),h}))}},8675:(e,t,n)=>{n.d(t,{l:()=>c});var o=n(1863),i=n(3518),r=n(949),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(e){var t=arguments;return s(this,void 0,void 0,(function*(){r.Logger.logfunction("GetAllLinkerConnectionsFromTheConcept",t);var n=[];try{(new Date).getTime();var s=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionOfConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:s});if(t.ok){const e=yield t.json();for(var c=0;c<e.length;c++){var a=e[c];n.push(a)}}else console.log("Get all linker connection from the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection from the concepts error: ",e.message):console.log("Get all linker connection from the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionOfConceptUrl())}return n}))}},6058:(e,t,n)=>{n.d(t,{W:()=>c});var o=n(1863),i=n(3518),r=n(949),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(e){var t=arguments;return s(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetAllLinkerConnectionsToTheConcept",t);var s=[];try{(new Date).getTime();var c=(0,i.Xr)("application/x-www-form-urlencoded");const t=yield fetch(r.BaseUrl.GetAllLinkerConnectionToConceptUrl()+`?conceptId=${e}`,{method:"GET",headers:c});if(t.ok){const e=yield t.json();for(var a=0;a<e.length;a++){var l=e[a];s.push(l)}r.Logger.logUpdate(n)}else console.log("Get all linker connection To the concepts error","cannot get respone"),(0,o.ry)(t)}catch(e){e instanceof Error?console.log("Get all linker connection To the concepts error: ",e.message):console.log("Get all linker connection To the concepts error(Unexpected): ",e),(0,o.Mb)(e,r.BaseUrl.GetAllLinkerConnectionToConceptUrl()),(0,o.ey)(n,"GetAllLinkerConnectionsToTheConcept",e)}return s}))}},2803:(e,t,n)=>{n.d(t,{x:()=>a});var o=n(8286),i=n(9581),r=n(1863),s=n(949),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function a(e,t,n){var a=arguments;return c(this,void 0,void 0,(function*(){const c=s.Logger.logfunction("GetCompositionConnectionsBetweenTwoConcepts",a)||{};var l=[];try{if(s.serviceWorker){c.serviceWorker=!0;try{const o=yield(0,s.sendMessage)("GetCompositionConnectionsBetweenTwoConcepts",{ofConceptId:e,toConcept:t,mainKey:n});return s.Logger.logUpdate(c),o.data}catch(e){console.error("GetCompositionConnectionsBetweenTwoConcepts sw error: ",e),(0,r.ey)(c,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,s.handleServiceWorkerException)(e)}}var d=new FormData;d.append("ofConceptId",e.toString()),d.append("mainKey",n.toString()),d.append("toConceptId",t.toString());const a=yield fetch(i.B.GetCompositionConnectionBetweenTwoConceptsUrl(),{method:"POST",body:d,redirect:"follow"});if(a.ok){const e=yield a.json();for(var u=0;u<e.length;u++)o.d.AddConnection(e[u]),l.push(e[u]);s.Logger.logUpdate(c)}else console.log("Get composition connection between two concepts",a.status),(0,r.ry)(a)}catch(e){e instanceof Error?console.log("Get composition connection between two concepts error message: ",e.message):console.log("Get composition connection between two concepts unexpected error: ",e),(0,r.Mb)(e,i.B.GetCompositionConnectionBetweenTwoConceptsUrl()),(0,r.ey)(c,"GetCompositionConnectionsBetweenTwoConcepts",e)}return l}))}},7139:(e,t,n)=>{n.d(t,{r:()=>d});var o=n(3026),i=n(9581),r=n(949),s=n(1863),c=n(1596),a=n(3278),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetConcept",t)||{};let d=(0,r.CreateDefaultConcept)();const u=new FormData;u.append("id",e.toString());try{if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConcept",{id:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConcept sw error: ",e),(0,s.ey)(n,"GetConcept",e),(0,r.handleServiceWorkerException)(e)}}if(0==e||null==e||null==e)return d;var h=yield o.I.GetConcept(e);let t=o.I.GetNpc(e);if(0!=h.id||t)return r.Logger.logUpdate(n),h;{let t;const h={method:"POST",body:u,headers:{Authorization:"Bearer "+a.b.BearerAccessToken}};try{console.log("this is the url",i.B.GetConceptUrl()),t=yield fetch(i.B.GetConceptUrl(),h)}catch(e){t=yield(0,c.g)(h,"/api/getConcept")}return yield function(e,t,n,i){return l(this,void 0,void 0,(function*(){return e.ok?(t=yield e.json()).id>0?o.I.AddConcept(t):o.I.AddNpc(i):(console.log("Get the concept error",e.status),(0,s.ry)(e)),r.Logger.logUpdate(n),t}))}(t,d,n,e)}}catch(e){e instanceof Error?console.log("Get the concept error message: ",e.message):console.log("Get the concept unexpected error: ",e),(0,s.Mb)(e,i.B.GetConceptUrl()),(0,s.ey)(n,"GetConcept",e)}}))}},1239:(e,t,n)=>{n.d(t,{I:()=>u,r:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(1863),c=n(949),a=n(1596),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e){return l(this,void 0,void 0,(function*(){const t=c.Logger.logfunction("GetConceptBulk",[e.length])||{};let n=[],d=((new Date).getTime(),performance.now()),u=Array.from(new Set(e));try{if(c.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,c.sendMessage)("GetConceptBulk",{passedConcepts:e});return c.Logger.logUpdate(t),n.data}catch(e){console.error("GetConceptBulk sw error: ",e),(0,s.ey)(t,"GetConceptBulk",e),(0,c.handleServiceWorkerException)(e)}}if(u.length>0){let h=[];for(let e=0;e<u.length;e++)if(!o.I.GetNpc(u[e])){let t=yield o.I.GetConcept(u[e]);0==t.id?h.push(u[e]):n.push(t)}if(0==h.length)return c.Logger.logfunction(t),n;{let u;const p={method:"POST",headers:(0,r.Xr)(),body:JSON.stringify(h)};try{u=yield fetch(i.B.GetConceptBulkUrl(),p)}catch(e){u=yield(0,a.g)(p,"/api/get_concept_bulk")}yield function(e,t,n,i,r){return l(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 i=t[e];o.I.AddConcept(i),n.push(i)}c.Logger.logUpdate(i)}else console.log("Get Concept Bulk error",e.status),c.Logger.logError(r,"unknown","read","unknown",void 0,e.status,e,"GetConceptBulk",[t],"unknown",void 0),(0,s.ry)(e)}))}(u,e,n,t,d)}}}catch(n){n instanceof Error?console.log("Get Concept Bulk error message: ",n.message):console.log("Get Concept Bulk unexpected error: ",n),c.Logger.logError(d,"unknown","read","unknown",void 0,500,n,"GetConceptBulk",[e],"unknown",void 0),(0,s.Mb)(n,i.B.GetConceptBulkUrl()),(0,s.ey)(t,"GetConceptBulk",n)}return n}))}function u(e){return l(this,void 0,void 0,(function*(){const t=[];if(e.length>0){const n={"Content-Type":"application/json"};try{const r=yield fetch(i.B.GetConceptBulkUrl(),{method:"POST",headers:n,body:JSON.stringify(e)});if(r.ok){const e=yield r.json();if(e.length>0)for(let n=0;n<e.length;n++){const i=e[n];t.push(i),o.I.AddConcept(i)}}else console.log("bulk concept getter api error: ",r.status),(0,s.ry)(r)}catch(e){e instanceof Error?console.log("bulk concept getter api error: ",e.message):console.log("bulk concept getter api error: ",e),(0,s.Mb)(e,i.B.GetConceptBulkUrl())}}return t}))}},4402:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(1863),c=n(949),a=n(7876),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){const l=c.Logger.logfunction("GetConceptByCharacterAndType",n);try{if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetConceptByCharacterAndType",{characterValue:e,typeId:t})).data}catch(e){console.error("GetConceptByCharacterAndType sw error: ",e),(0,c.handleServiceWorkerException)(e)}let n=yield o.I.GetConceptByCharacterAndTypeLocal(e,t);if(null==n||0==n.id){var d={character_value:`${e}`,type_id:t},u=JSON.stringify(d),h=(0,r.Xr)();const c=yield fetch(i.B.GetConceptByCharacterAndTypeUrl(),{method:"POST",headers:h,body:u});if(c.ok){let e=yield c.json();n=e,(0,a.K)(n).then((e=>{o.I.AddConcept(n)}))}else(0,s.ry)(c),console.log("This is the concept by type and character error",c.status)}return c.Logger.logUpdate(l),n}catch(e){e instanceof Error?console.log(" This is the concept by type and character error message: ",e.message):console.log(" This is the concept by type and character unexpected error: ",e),(0,s.Mb)(e,i.B.GetConceptByCharacterAndTypeUrl()),(0,s.ey)(l,"GetConceptByCharacterAndType",e)}}))}},8146:(e,t,n)=>{n.d(t,{Y:()=>l});var o=n(3026),i=n(9581),r=n(949),s=n(1863),c=n(7876),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function l(e){var t=arguments;return a(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetConceptByCharacterValue",t);let a=(0,r.CreateDefaultConcept)();try{const t=new FormData;t.append("character_value",e);const l=yield fetch(i.B.GetConceptByCharacterValueUrl(),{method:"POST",body:t});l.ok?(a=yield l.json(),a.id>0&&(0,c.K)(a).then((e=>{o.I.AddConcept(a)})),r.Logger.logUpdate(n)):((0,s.ry)(l),console.log("Error in Getting concept by character value Error",l.status))}catch(e){e instanceof Error?console.log("Error in Getting concept by character value error message: ",e):console.log("Error in Getting concept by character value unexpected error: ",e),(0,s.Mb)(e,i.B.GetConceptByCharacterValueUrl()),(0,s.ey)(n,"GetConceptByCharacterValue",e)}return a}))}},7467:(e,t,n)=>{n.d(t,{j:()=>u});var o=n(8286),i=n(9581),r=n(4364),s=n(3518),c=n(1863),a=n(949),l=n(1596),d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function u(){return d(this,arguments,void 0,(function*(e=[]){const t=a.Logger.logfunction("GetConnectionBulk",e.length)||{};let n=[];try{if(a.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("GetConnectionBulk",{connectionIds:e});return a.Logger.logUpdate(t),n.data}catch(e){console.error("GetConnectionBulk sw error: ",e),(0,c.ey)(t,"GetConnectionBulk",e),(0,a.handleServiceWorkerException)(e)}}if(e.length>0){let r=[];for(let t=0;t<e.length;t++)if(!o.d.GetNpConn(e[t])){let i=yield o.d.GetConnection(e[t]);0==i.id?r.push(e[t]):n.push(i)}if(0==r.length)return a.Logger.logUpdate(t),n;{let e;const u={method:"POST",headers:(0,s.Xr)(),body:JSON.stringify(r)};try{e=yield fetch(i.B.GetConnectionBulkUrl(),u)}catch(t){e=yield(0,l.g)(u,"/api/get_connection_bulk")}yield function(e,t,n){return d(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 i=n[e];t.push(i),o.d.AddConnection(i)}}else(0,c.ey)(n,"GetConnectionBulk",e.status),(0,c.ry)(e),console.log("Get Connection Bulk error",e.status)}))}(e,n,t),a.Logger.logUpdate(t)}}}catch(e){e instanceof Error?console.log("Get Connection Bulk error message: ",e):console.log("Get Connection Bulk unexpected error: ",e),(0,c.ey)(t,"GetConnectionBulk",e),(0,c.Mb)(e,i.B.GetConnectionBulkUrl())}return yield(0,r.s)(n),n}))}},2832:(e,t,n)=>{n.d(t,{j:()=>a});var o=n(949),i=n(9581),r=n(1863),s=n(3518),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function a(e){var t=arguments;return c(this,arguments,void 0,(function*(e,n=""){const c=o.Logger.logfunction("SearchLinkMultipleApi",t);let a=performance.now();var l=(0,s.ab)("application/json",n);const d=i.B.SearchLinkMultipleAllApiUrl(),u=JSON.stringify(e);try{const t=yield fetch(d,{method:"POST",headers:l,body:u});if(t.ok){let e=yield t.json();return o.Logger.logUpdate(c),e}return(0,r.ry)(t),console.log("This is the searching multiple error",t.status),o.Logger.logError(a,"unknown","search","unknown",void 0,t.status,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),[]}catch(t){console.log("This is the searching multiple error",t),o.Logger.logError(a,"unknown","search","unknown",void 0,500,t,"SearchLinkMultipleApi",[e,n],"unknown",void 0),(0,r.Mb)(t,d),(0,r.ey)(c,"SearchLinkMultipleApi",t)}}))}},3130:(e,t,n)=>{n.d(t,{BG:()=>a,SL:()=>l,XZ:()=>c,ZJ:()=>r,iw:()=>s,pU:()=>d,y0:()=>i,yv:()=>o});const o=1,i=2,r=3,s=4,c=5,a=6,l=7,d=8},9635:(e,t,n)=>{n.d(t,{x:()=>o});const o=new BroadcastChannel("Freeschema_mftsccs_browser_channel")},9581:(e,t,n)=>{n.d(t,{B:()=>o});class o{static setRandomizer(e){console.log("set randomizer",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 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 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?o.NODE_URL+"/api/v1/local-concepts":o.NODE_URL+"/api/v1/local-concepts-without-auth"}static CreateGhostConnectionApiUrl(){return o.NODE_URL+"/api/v1/local-connections"}static GetRealConceptById(){return o.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 FreeschemaQueryUrl(){return this.BASE_URL+"/api/freeschema-query"}static uploadImageUrl(){return this.BASE_URL+"/api/Image/UploadImage"}static uploadImageUrlWithSmall(){return this.BASE_URL+"/api/Image/UploadImageV2"}static uploadFileUrl(){return this.BASE_URL+"/api/Image/UploadFile"}static sendMail(){return this.BASE_URL+"/api/sendmail"}static sendBulkMail(){return this.BASE_URL+"/api/sendmail/bulk"}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 getConnectionsByTypes(){return this.BASE_URL+"/api/get-connection-by-types"}static CreatePrototypeUrl(){return this.BASE_URL+"/api/create-prototype"}static GetCachedImage(e){return"https://cdn.boomconcole.com/freeschema/"+e}}o.BASE_URL="https://localhost:7053/",o.NODE_CACHE_URL="",o.AI_URL="https://ai.freeschema.com",o.MQTT_URL="192.168.1.249",o.NODE_URL="http://localhost:5001",o.LOG_SERVER="https://logdev.freeschema.com",o.BASE_APPLICATION="",o.DOCUMENTATION_WIDGET=0,o.isNearestCache=!0,o.FLAGS={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1},o.BASE_RANDOMIZER=999},6963:(e,t,n)=>{n.d(t,{f:()=>s});var o=n(205),i=n(6731),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class s{static waitForDataToLoad(){return r(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isCharacterLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static addNodeToTree(e){return r(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 r(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 i.b(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 r(this,void 0,void 0,(function*(){return this.characterRoot?this.characterRoot.getFromNodeWithCharacterAndType(e,t,this.characterRoot):this.characterRoot}))}static getCharacterAndCategoryFromTree(e,t){return r(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))}}s.characterRoot=null},2202:(e,t,n)=>{n.d(t,{W:()=>a});var o=n(6963),i=n(6731),r=n(205),s=n(949),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class a{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 c(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addConceptToTree(e){let t=new i.b(e.id,e,null,null),n=new i.b(e.characterValue,e,null,null);o.f.addNodeToTree(n),this.addNodeToTree(t)}static getNodeFromTree(e){return c(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return c(this,void 0,void 0,(function*(){if(this.root){let t=new Event(`${e}`);console.log("this is the fired event after delete",t),(0,s.dispatchIdEvent)(e),this.root=this.root.removeNode(this.root,e)}}))}static getConceptListFromIds(e,t,n){return c(this,void 0,void 0,(function*(){this.root&&this.root.checkIfIdsInNode(this.root,e,t,n)}))}static countNumberOfNodes(){return this.root?this.root.countNodeBelow(this.root):0}}a.root=null},5457:(e,t,n)=>{n.d(t,{c:()=>a});var o=n(949),i=n(7282),r=n(205);class s{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 i,r,c,a;if(null==e)return(0,o.dispatchIdEvent)(t,{detail:n}),new s(t,n);if(t<e.key)e.leftNode=this.addType(e.leftNode,t,n);else{if(!(t>e.key))return e.value.includes(n)||((0,o.dispatchIdEvent)(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 l=this.getBalanceFactor(e);return l>1&&t<(null===(i=e.leftNode)||void 0===i?void 0:i.key)?this.rightRotate(e):l<-1&&t>(null===(r=e.rightNode)||void 0===r?void 0:r.key)?this.leftRotate(e):l>1&&t>(null===(c=e.leftNode)||void 0===c?void 0:c.key)?(e.leftNode=this.leftRotate(e.leftNode),this.rightRotate(e)):l<-1&&t<(null===(a=e.rightNode)||void 0===a?void 0:a.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 c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class a{static addType(e){return c(this,void 0,void 0,(function*(){return null==this.root?(this.root=e,new CustomEvent(`${e.key}`,{detail:e.value[0]}),(0,o.dispatchIdEvent)(e.key,{detail:e.value[0]}),this.root):(this.root=this.root.addType(this.root,e.key,e.value[0]),this.root)}))}static addConceptToTree(e){if(0!=e.typeId){let t=new s(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){return this.root?this.root.getFromNode(e,this.root):this.root}static getTypeVariantsFromTreeNew(e){return c(this,void 0,void 0,(function*(){let t=this.getNodeFromTreeNew(e),n=[],i=[];if(t){n=t.value;for(let e=0;e<n.length;e++){let t=!1;for(let o=0;o<i.length;o++)i[o].id==n[e]&&(t=!0);t||i.push(yield(0,o.GetTheConcept)(n[e]))}}return i}))}static waitForDataToLoad(){return c(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isTypeLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserIdNew(e,t){return c(this,void 0,void 0,(function*(){let n=[],o=yield this.getTypeVariantsFromTreeNew(e);console.log("these are all the concepts",o);for(let e=0;e<o.length;e++)o[e].userId==t&&n.push(o[e]);return n}))}static getTypeVariantsWithCharacterValueNew(e,t){return c(this,void 0,void 0,(function*(){let n=yield this.getTypeVariantsFromTreeNew(t);console.log("this is all the concepts for character",n);let o=(0,i.o)();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}}a.typeRoot=null,a.root=null},2615:(e,t,n)=>{n.d(t,{j:()=>i});var o=n(949);class i{constructor(e,t,n,i,r,s,c,a=!1,l,d,u){this.count=0,this.typeCharacter="",this.referent=null,this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=o.BaseUrl.getRandomizer(),this.x=0,this.y=0,this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=i,this.referentId=r,this.characterValue=`${s}`,this.accessId=c,this.typeCharacter=u,this.type=null,this.isNew=a,this.entryTimeStamp=l,this.updatedTimeStamp=d}getType(){console.log(this.typeId)}}},3026:(e,t,n)=>{n.d(t,{I:()=>f});var o=n(3655),i=n(2202),r=n(6963),s=n(5457),c=n(7282),a=n(949);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 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 d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class u{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 d(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return d(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}}u.root=null;class h{constructor(){this.widgetId=0,this.mainId=0,this.conceptIds=[],this.linkers=[],this.reverse=[],this.mainCompositionIds=[],this.countinfo=[]}}var p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class f{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&&(0,o.kH)("concept",e)}static GetConceptBulkData(e,t,n){return p(this,void 0,void 0,(function*(){yield i.W.getConceptListFromIds(e,t,n)}))}static AddWidget(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddWidget",{widgetDetails:e})}catch(e){console.error("Concept Data, Add Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.widgetId>0&&u.addWidgetToTree(e)}static AddConcept(e){if(a.serviceWorker)try{(0,a.sendMessage)("ConceptsData__AddConcept",{concept:e})}catch(e){console.error("Concept Data, Add Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}e.id>0&&(i.W.addConceptToTree(e),s.c.addConceptToTree(e))}static AddConceptToMemory(e){e.id>0&&(i.W.addConceptToTree(e),s.c.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);(0,o.wh)("concept",e.id)}static GetWidget(e){return p(this,void 0,void 0,(function*(){let t=new h;if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetWidget",{id:e})).data}catch(e){console.error("Concept Data, Get Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}let n=yield u.getNodeFromTree(e);return null!=n&&(t=n.value),t}))}static RemoveWidget(e){return p(this,void 0,void 0,(function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__RemoveWidget",{id:e})).data}catch(e){console.error("Concept Data, Remove Widget sw error: ",e),(0,a.handleServiceWorkerException)(e)}yield u.removeNodeFromTree(e)}))}static GetConcept(e){return p(this,void 0,void 0,(function*(){if(a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConcept",{id:e})).data}catch(e){console.error("Concept Data, Get Concpet sw error: ",e),(0,a.handleServiceWorkerException)(e)}if(0==e||null==e||null==e)return(0,c.o)();var t=(0,c.o)(),n=yield i.W.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t}))}static GetConceptByCharacter(e){return p(this,void 0,void 0,(function*(){var t=(0,c.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t}))}static GetConceptByCharacterUpdated(e){return p(this,void 0,void 0,(function*(){var t=(0,c.o)(),n=r.f.getNodeFromTree(e);return n&&(t=n.value),t}))}static GetConceptByCharacterAndTypeLocal(e,t){return p(this,void 0,void 0,(function*(){return(0,c.o)(),yield s.c.getTypeVariantsWithCharacterValueNew(e,t)}))}static GetConceptByCharacterAndCategoryLocal(e,t){return p(this,void 0,void 0,(function*(){var n=(0,c.o)(),o=yield r.f.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 p(this,void 0,void 0,(function*(){if(a.Logger.logfunction("ConceptsData.GetConceptsByTypeIdAndUser",n),a.serviceWorker)try{return(yield(0,a.sendMessage)("ConceptsData__GetConceptsByTypeIdAndUser",{typeId:e,userId:t})).data}catch(e){console.error("Concept Data, Get Concpet sw error:",e),(0,a.handleServiceWorkerException)(e)}let o=[];return o=yield s.c.getTypeVariantsFromTreeWithUserIdNew(e,t),o}))}static GetBinaryCharacterTree(){return r.f.characterRoot}getName(){return this.name}}f.conceptsArray=[],f.NPC=[],f.conceptDictionary=[]},2155:(e,t,n)=>{n.d(t,{N:()=>r});var o=n(7282),i=n(9581);class r{constructor(e=0,t,n,r,s,c,a){this.count=0,this.isTemp=!1,this.toUpdate=!1,this.applicationId=i.B.getRandomizer(),this.type=(0,o.o)(),this.ofConcept=(0,o.o)(),this.toConcept=(0,o.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.userId=r,this.typeId=s,this.ghostId=e,this.orderId=c,this.accessId=a,this.entryTimeStamp=(0,o.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date,this.typeCharacter=""}}},5239:(e,t,n)=>{n.d(t,{O:()=>c});var o=n(205),i=n(949);class r{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 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(0,i.dispatchIdEvent)(e.value.ofTheConceptId),e;let o=t.leftNode,r=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,r,n)}t.height=1+this.getMax(this.getHeight(t.leftNode),this.getHeight(t.rightNode));let s=this.getBalanceFactor(t);if(s>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(s<-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){if(0!=e.value.typeId){if(null==t)return 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)}}}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 console.log("this is the error in right rotation",e,t),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 console.log("this is the error in left rotation",e,t),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(n){console.log("this is the exception",e,t,null==t?void 0:t.leftNode,null==t?void 0:t.rightNode)}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;if(new Event(`${e.value.ofTheConceptId}`),(0,i.dispatchIdEvent)(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 s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class c{static addNodeToTree(e){try{if(null==this.connectionroot)return this.connectionroot=e,this.connectionroot;this.connectionroot=this.connectionroot.addNode(e,this.connectionroot,this.connectionroot.height)}catch(e){throw console.log("This is the error in making the tree",e),e}}static addConnectionToTree(e){let t=new r(e.id,e,null,null);this.addNodeToTree(t)}static traverse(){var e;return null===(e=this.connectionroot)||void 0===e?void 0:e.traverse(this.connectionroot)}static waitForDataToLoad(){return s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isConnectionLoaded)return e("done");setTimeout(c.checkFlag,1e3,e)}static removeNodeFromTree(e){return s(this,void 0,void 0,(function*(){this.connectionroot&&(this.connectionroot=this.connectionroot.removeNode(this.connectionroot,e))}))}static getNodeFromTree(e){return s(this,void 0,void 0,(function*(){try{return this.connectionroot?this.connectionroot.getFromNode(e,this.connectionroot):this.connectionroot}catch(t){console.log("this is the getNodeFromTree",e,this.connectionroot)}}))}static getConnectionListFromIds(e,t,n){return s(this,void 0,void 0,(function*(){this.connectionroot&&this.connectionroot.checkIfIdsInNode(this.connectionroot,e,t,n)}))}}c.connectionroot=null},991:(e,t,n)=>{n.d(t,{H:()=>c});var o=n(949),i=n(3996);class r extends i.i{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 s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class c{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 r(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new r(t,n,null,null);this.addNodeToTree(o)}new Event(`${t}`)}else console.log("cannot insert key id with n 0 to the connection tree",e)}static addNodeToTree(e){return s(this,void 0,void 0,(function*(){return null==this.node?(this.node=e,console.log("this is type dispatch in connection",e),(0,o.dispatchIdEvent)(e.key),this.node):(this.node=this.node.addNode(e,this.node,this.node.height),this.node)}))}static removeNodeFromTree(e){return s(this,void 0,void 0,(function*(){this.node&&(this.node=this.node.removeNode(this.node,e))}))}}c.node=null},3996:(e,t,n)=>{n.d(t,{i:()=>o});class o{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}}},8286:(e,t,n)=>{n.d(t,{d:()=>f});var o=n(1735),i=n(949),r=n(3655),s=n(1863),c=n(2155),a=n(5239),l=n(991),d=n(3996);class u extends d.i{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(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}}class h{static CreateCompositionKey(e){return e}static addNodeToTree(e){return t=this,n=void 0,i=function*(){return null==this.connectionTypeRoot?(this.connectionTypeRoot=e,this.connectionTypeRoot):(this.connectionTypeRoot=this.connectionTypeRoot.addNode(e,this.connectionTypeRoot,this.connectionTypeRoot.height),this.connectionTypeRoot)},new((o=void 0)||(o=Promise))((function(e,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,c)}a((i=i.apply(t,n||[])).next())}));var t,n,o,i}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 u(t,n,null,null);this.addNodeToTree(o)}}else{let n=[];n.push(e.id);let o=new u(t,n,null,null);this.addNodeToTree(o)}}else console.log("cannot insert key id with n 0 to the connection tree",e)}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}}h.connectionTypeRoot=null;var p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class f{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){(0,r.kH)("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{a.O.addConnectionToTree(e),h.addConnectionToTree(e),l.H.addConnection(e)}catch(e){throw console.log("this is the error in making the connection"),e}}static AddConnectionToMemory(e){e.isTemp||(a.O.addConnectionToTree(e),h.addConnectionToTree(e),l.H.addConnection(e))}static AddToDictionary(e){this.connectionDictionary[e.id]=e}static RemoveConnection(e){0!=e.id&&((0,r.wh)("connection",e.id),a.O.removeNodeFromTree(e.id),l.H.removeNodeFromTree(e.id))}static GetConnectionTypeOfTree(){l.H.node}static GetConnectionByOfTheConceptAndType(e,t){return p(this,void 0,void 0,(function*(){try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionByOfTheConceptAndType",{ofTheConceptId:e,typeId:t})).data}catch(e){console.error("GetConnectionByOfTheConceptAndType sw error: ",e),(0,i.handleServiceWorkerException)(e)}return l.H.GetConnectionByOfTheConceptAndTypeId(e,t)||[]}catch(e){return console.log("this is the error in GetConnectionByOfTheConceptAndType",e),[]}}))}static GetConnectionByOfType(e,t){const n=i.Logger.logfunction("ConnectionData.GetConnectionByOfType",arguments);let o=h.GetConnectionByOfTheConceptAndTypeId(e,t);return o?(i.Logger.logUpdate(n),o):(i.Logger.logUpdate(n),[])}static GetConnectionTree(){return a.O.connectionroot}static GetConnectionTypeTree(){return h.connectionTypeRoot}static GetConnectionBulkData(e,t,n){return p(this,void 0,void 0,(function*(){yield a.O.getConnectionListFromIds(e,t,n)}))}static GetConnection(e){return p(this,void 0,void 0,(function*(){o.J.incrementConnection(e);let t=new c.N(0,0,0,0,0,0,0);try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnection",{id:e})).data}catch(e){console.error("GetConnection sw error: ",e),(0,i.handleServiceWorkerException)(e)}let n=yield a.O.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}return t}catch(e){return console.log("this is the error in GetConnection",e),t}}))}static GetConnectionsOfCompositionLocal(e){var t=arguments;return p(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("ConnectionData.GetConnectionsOfCompositionLocal",t)||{};let o=[];try{if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfCompositionLocal",{id:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionsOfCompositionLocal sw error: ",e),(0,s.ey)(n,"GetConnectionsOfCompositionLocal",e),(0,i.handleServiceWorkerException)(e)}}let t=[];t=f.GetConnectionByOfType(e,e);for(let e=0;e<t.length;e++){let r=yield a.O.getNodeFromTree(t[e]);r&&o.push(r.value),i.Logger.logUpdate(n)}}catch(t){console.log("this is the error GetConnectionsOfCompositionLocal",e,o),(0,s.ey)(n,"ConnectionData.GetConnectionsOfCompositionLocal",t)}return o}))}static GetConnectionsOfConcept(e){return p(this,void 0,void 0,(function*(){let t=[],n=[];try{if(i.serviceWorker)try{return(yield(0,i.sendMessage)("ConnectionData__GetConnectionsOfConcept",{id:e})).data}catch(e){console.error("GetConnectionsOfConcept sw error: ",e),(0,i.handleServiceWorkerException)(e)}t=yield f.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<t.length;e++){let o=yield a.O.getNodeFromTree(t[e]);o&&n.push(o.value)}return n}catch(e){return console.log("this is the error in GetConnectionsOfConcept",e),n}}))}getName(){return this.name}}f.deletedConnections=[],f.connectionArray=[],f.connectionDictionary=[]},276:(e,t,n)=>{n.d(t,{y:()=>o});class o{constructor(){this.conceptId=0,this.connectionTypeId=0,this.connectionType="",this.count=0}}},205:(e,t,n)=>{n.d(t,{B:()=>o});class o{}o.isTypeLoaded=!1,o.isCharacterLoaded=!1,o.isDataLoaded=!1,o.isLocalDataLoaded=!1,o.isLocalCharacterLoaded=!1,o.isLocalTypeLoaded=!1,o.isConnectionLoaded=!1,o.isConnectionTypeLoaded=!1,o.isLocalConnectionLoaded=!1},2515:(e,t,n)=>{n.d(t,{x:()=>o});class o{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 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 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){if(""!=e.value.characterValue){if(null==t)return e;var 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)}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return e;var 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)}}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}}},9736:(e,t,n)=>{n.d(t,{v:()=>C});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class s{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 i.x(e.id,e,null,null);new i.x(e.characterValue,e,null,null),this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static getNodeFromTree(e){return r(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 r(this,void 0,void 0,(function*(){this.root&&(this.root=this.root.removeNode(this.root,e))}))}}s.root=null;var c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class a{static waitForDataToLoad(){return c(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalCharacterLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static addNodeToTree(e){return c(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 i.x(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 c(this,void 0,void 0,(function*(){return this.LocalCharacterRoot?this.LocalCharacterRoot.getFromNodeWithCharacterAndType(e,t,this.LocalCharacterRoot):this.LocalCharacterRoot}))}static getCharacterAndCategoryFromTree(e,t){return c(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))}}a.LocalCharacterRoot=null;var l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class d{static addNodeToTree(e){return l(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 i.x(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 l(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalTypeLoaded)return e("done");setTimeout(d.checkFlag,1e3,e)}static getTypeVariantsFromTreeWithUserId(e,t){return l(this,void 0,void 0,(function*(){var n=[],o=this.getNodeFromTree(e);if(o){console.log("this is the node to type",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}))}}d.LocalTypeRoot=null;var u=n(6416),h=n(3026),p=n(7820),f=n(4864),y=n(628),v=n(949),g=n(3278),m=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class C{constructor(){this.name="conceptsArray"}static AddConcept(e){0!=e.id&&(s.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e),this.localconceptsArray.push(e))}static AddPermanentConcept(e){0!=e.id&&(s.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId),p.G.addConceptToTree(e),h.I.AddConcept(e),(0,v.AddGhostConcept)(e,e.userId,g.b.sessionId))}static RemoveConcept(e){return m(this,void 0,void 0,(function*(){try{0!=e.id&&(s.removeNodeFromTree(e.ghostId),a.removeConceptType(e.characterValue,e.ghostId),d.removeConceptType(e.typeId,e.ghostId))}catch(e){throw e}}))}static RemoveConceptById(e){return m(this,void 0,void 0,(function*(){try{let t=yield C.GetConcept(e);0!=t.id&&(s.removeNodeFromTree(e),a.removeConceptType(t.characterValue,t.ghostId),d.removeConceptType(t.typeId,t.ghostId),y.H.RemoveConcept(t))}catch(e){throw e}}))}static AddConceptToMemory(e){0!=e.id&&(s.addConceptToTree(e),a.addConceptToTree(e),d.addConceptToTree(e))}static GetConcept(e){return m(this,void 0,void 0,(function*(){var t=(0,u.u)(),n=yield s.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t}))}static UpdateConceptSyncStatus(e){return m(this,void 0,void 0,(function*(){s.updateSyncStatus(e)}))}static GetConceptByGhostId(e){return m(this,void 0,void 0,(function*(){var t=(0,u.u)(),n=yield p.G.getNodeFromTree(e);if(null==n?void 0:n.value){var o=n.value;o&&(t=o)}return t}))}static GetConceptByCharacter(e){return m(this,void 0,void 0,(function*(){var t=(0,u.u)(),n=a.getNodeFromTree(e);return n&&(t=n.value),t}))}static GetConceptByCharacterAndTypeLocal(e,t){return m(this,void 0,void 0,(function*(){var n=(0,u.u)(),o=yield a.getCharacterAndTypeFromTree(e,t);return o&&(n=o.value),n}))}static GetConceptByCharacterAndCategoryLocal(e,t){return m(this,void 0,void 0,(function*(){var n=(0,u.u)(),o=yield a.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 m(this,void 0,void 0,(function*(){let n=[];return n=yield d.getTypeVariantsFromTreeWithUserId(e,t),n}))}static ClearData(){return m(this,void 0,void 0,(function*(){this.localconceptsArray=[],f.G.connectionArray=[]}))}getName(){return this.name}}C.localconceptsArray=[]},4864:(e,t,n)=>{n.d(t,{G:()=>a});var o=n(2155),i=n(8286),r=n(205),s=n(628),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class a{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);s.H.RemoveConnectionById(e)}static AddPermanentConnection(e){e.id>0&&i.d.AddConnection(function(e){let t=new o.N(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 c(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isLocalConnectionLoaded)return e("done");setTimeout(a.checkFlag,1e3,e)}static GetConnectionsOfCompositionLocal(e){return c(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 c(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}}a.connectionArray=[],a.connectionDictionary=[]},7820:(e,t,n)=>{n.d(t,{G:()=>s});var o=n(205),i=n(2515),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class s{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 i.x(e.ghostId,e,null,null);this.addNodeToTree(t)}static waitForDataToLoad(){return r(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(o.B.isLocalDataLoaded)return e("done");setTimeout(s.checkFlag,1e3,e)}static getNodeFromTree(e){return r(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return r(this,void 0,void 0,(function*(){this.root&&(this.root=this.root.removeNode(this.root,e))}))}}s.root=null},5257:(e,t,n)=>{n.d(t,{R:()=>s});var o=n(9003),i=n(3075),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class s{static AddConceptId(e){this.localId=e.value,(0,o.kH)("localid",e)}static getConceptId(){return r(this,void 0,void 0,(function*(){try{if(this.localId){if(this.ReservedLocalId.length<5){yield(0,i.EO)().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=>(console.log(" getid: cannot get the id from indexdb"),-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(0,i.EO)().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 console.log(" getid: this is the eror in concept",e),-Math.floor(1e8*Math.random())}}))}static AddConnectionId(e){this.localConnectionId=e.value}static getConnectionId(){return r(this,void 0,void 0,(function*(){try{if(this.localConnectionId){if(this.ReservedConnectionId.length<5){yield(0,i.xd)().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=>(console.log("this is the new event",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(0,i.xd)().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())}}))}}s.ReservedLocalId=[],s.ReservedConnectionId=[]},628:(e,t,n)=>{n.d(t,{H:()=>y});var o=n(9581),i=n(3278),r=n(949),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};const a=(e,t,...n)=>c(void 0,[e,t,...n],void 0,(function*(e,t,n=!0){let r={concepts:[],connections:[]};try{const c=new Headers;let a={concepts:e,connections:t};c.set("Content-Type","application/json"),c.set("Authorization","Bearer "+i.b.BearerAccessToken),c.set("Accept","application/json"),c.set("X-Session-Id",i.b.sessionId.toString()),c.set("Randomizer",o.B.getRandomizer().toString());const l=yield fetch(o.B.CreateGhostConceptApiUrl(n),{method:"POST",headers:c,body:JSON.stringify(a)});if(!l.ok)throw(0,s.ry)(l),new Error(`Error! status: ${l.status}`);const d=yield l.json();return r.concepts=d.concepts,r.connections=d.connections,r}catch(e){throw e instanceof Error?console.log("Create the concept api error message: ",e.message):console.log("Create the concept api unexpected error: ",e),e}}));function l(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 d=(...e)=>c(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 u=n(9003),h=n(9736),p=n(4864),f=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class y{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!=y.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 f(this,arguments,void 0,(function*(e,t,n=!1){return y.SyncDataOnline(e,t,n)}))}static SyncDataOnline(e,t){return f(this,arguments,void 0,(function*(e,t,n=!0){let o=performance.now();console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker,n),setTimeout((()=>{console.log("syncing...",e,t,"aa: ",this.conceptsSyncArray,this.connectionSyncArray,!!r.serviceWorker,n)}),5e3);try{if(r.serviceWorker)try{return console.log("syncing in the service worker",e,n),(yield(0,r.sendMessage)("LocalSyncData__SyncDataOnline",{transactionId:e,withAuth:n})).data}catch(e){console.error("LocalSyncData__SyncDataOnline sw error: ",e),(0,r.handleServiceWorkerException)(e)}console.log("syncing in the without service worker syncing",e,n);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)?(console.log("this is the concepts and connections array",null==t?void 0:t.concepts,null==t?void 0:t.connections),o=t.concepts.slice(),i=t.connections.slice(),console.log("this is the concepts and connections array",o,i),this.conceptsSyncArray=this.conceptsSyncArray.filter((e=>{const n=t.concepts.some((t=>e.id==t.id||e.ghostId==t.ghostId));return n||console.warn(`Concept not found in sync array: ${e.id||e.ghostId}`),n})),this.connectionSyncArray=this.connectionSyncArray.filter((e=>{const n=t.connections.some((t=>e.id==t.id||e.ghostId==t.ghostId));return n||console.warn(`Connection not found in sync array: ${e.id||e.ghostId}`),n}))):(console.warn("Syncing this way has been Depreceted in service worker."),console.info("Only if serive worker is not running"),o=this.conceptsSyncArray.slice()||[],i=this.connectionSyncArray.slice()||[],this.connectionSyncArray=[],this.conceptsSyncArray=[]);console.log("syncing... inside the syncer",n);let u=[];for(let e=0;e<o.length;e++)u.push(o[e]),yield h.v.UpdateConceptSyncStatus(o[e].id);console.log("syncing... inside the syncer 2",n,o),yield this.UpdateConceptListToIncludeRelatedConcepts(i,u);let f=yield function(e,t){return c(this,arguments,void 0,(function*(e,t,n=!0){const o=r.Logger.logfunction("CreateTheGhostConceptApi",[e.length,t.length]);try{const i=1e3;let s={concepts:[],connections:[]};const c=yield d(e),u=yield d(t);if(e.length+t.length<=2*i){const e=yield a(c,u,n);return Array.isArray(null==e?void 0:e.concepts)&&(s.concepts=[...s.concepts,...e.concepts]),Array.isArray(null==e?void 0:e.connections)&&(s.connections=[...s.connections,...e.connections]),r.Logger.logUpdate(o),s}const h=l(c,i),p=l(u,i),f=[],y=[];console.log("This is the with auth in syncing",n);for(let e=0;e<h.length;e++){const t=h[e];f.push(a(t,[],n))}const v=yield Promise.all(f);for(let e=0;e<v.length;e++){const t=v[e];Array.isArray(null==t?void 0:t.concepts)&&(s.concepts=[...s.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(s.connections=[...s.connections,...t.connections])}for(let e=0;e<p.length;e++){const t=p[e];y.push(a([],t,n))}const g=yield Promise.all(y);for(let e=0;e<g.length;e++){const t=g[e];Array.isArray(null==t?void 0:t.concepts)&&(s.concepts=[...s.concepts,...t.concepts]),Array.isArray(null==t?void 0:t.connections)&&(s.connections=[...s.connections,...t.connections])}return r.Logger.logUpdate(o),s}catch(e){throw console.log(e),(0,s.ey)(o,"CreateTheGhostConceptApi",e),e}}))}(u,i,n);console.log("syncing... inside the syncer 3",n);let y=f.concepts,v=f.connections;for(let e=0;e<y.length;e++)h.v.AddPermanentConcept(y[e]);for(let e=0;e<v.length;e++)p.G.AddPermanentConnection(v[e]);return o}catch(e){throw r.Logger.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,c=e[i].typeId,a=null!==(t=y.ghostIdMap.get(r))&&void 0!==t?t:r,l=null!==(n=y.ghostIdMap.get(s))&&void 0!==n?n:s,d=null!==(o=y.ghostIdMap.get(c))&&void 0!==o?o:c;e[i].ofTheConceptId=a,e[i].toTheConceptId=l,e[i].typeId=d}}static UpdateConceptListToIncludeRelatedConcepts(e,t){return f(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 h.v.GetConceptByGhostId(o),0!=i.id?i.id!=i.ghostId&&(e[n].ofTheConceptId=i.id):(i=yield h.v.GetConcept(o),this.AddConceptIfDoesNotExist(i,t)))}if(i<0){let o=this.CheckIfTheConceptIdExists(i,t);0==o.id&&(o=yield h.v.GetConceptByGhostId(i),0!=o.id?o.id!=o.ghostId&&(e[n].toTheConceptId=o.id):(o=yield h.v.GetConcept(i),this.AddConceptIfDoesNotExist(o,t)))}if(r<0){let o=this.CheckIfTheConceptIdExists(r,t);0==o.id&&(o=yield h.v.GetConceptByGhostId(r),0!=o.id?o.id!=o.ghostId&&(e[n].typeId=o.id):(o=yield h.v.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=(0,r.CreateDefaultLConcept)();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 f(this,void 0,void 0,(function*(){if(this.conceptsSyncArray.length>0){for(let e=0;e<this.conceptsSyncArray.length;e++)(0,u.kH)("localconcept",this.conceptsSyncArray[e]);this.conceptsSyncArray=[]}if(this.connectionSyncArray.length>0){for(let e=0;e<this.connectionSyncArray.length;e++)(0,u.kH)("localconnection",this.connectionSyncArray[e]);this.connectionSyncArray=[]}return"done"}))}static initializeTransaction(e){return f(this,void 0,void 0,(function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__initializeTransaction",{transactionId:e})).data}catch(e){console.error("LocalSyncData__initializeTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some((t=>t.id==e)))return;this.transactionCollections.push({id:e,data:{concepts:[],connections:[]},createdDate:(new Date).toISOString()})}catch(e){console.log("error in initializeTransaction",e)}}))}static markTransactionActions(e,t){return f(this,void 0,void 0,(function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__markTransactionActions",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__markTransactionActions sw error: ",e),(0,r.handleServiceWorkerException)(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){console.log("error in markTransactionActions",e)}}))}static rollbackTransaction(e,t){return f(this,void 0,void 0,(function*(){try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("LocalSyncData__rollbackTransaction",{transactionId:e,actions:t})).data}catch(e){console.error("LocalSyncData__rollbackTransaction sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(this.transactionCollections.some((t=>t.id==e)))return;this.transactionCollections=this.transactionCollections.filter((t=>t.id!=e))}catch(e){console.log("LocalSyncData, roll",e)}}))}}y.conceptsSyncArray=[],y.connectionSyncArray=[],y.ghostIdMap=new Map,y.transactionCollections=[]},6731:(e,t,n)=>{n.d(t,{b:()=>o});class o{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 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 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){if(""!=e.value.characterValue){if(null==t)return 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)}}}return t}addTypeNode(e,t,n){if(0!=e.value.typeId){if(null==t)return console.log("adding the type node to the tree",e),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 console.log("adding the type node to the tree down",e),t.key==e.key&&0!=t.key&&t.value.id!=e.value.id&&t.addCurrentNodeType(e,t),console.log("adding the type node to the tree last",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)}}}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}}},5976:(e,t,n)=>{n.d(t,{p:()=>l,B:()=>a});var o=n(9581),i=n(3518),r=n(1863),s=n(949),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class a{static getId(){return c(this,void 0,void 0,(function*(){this.ids.length<5&&(yield function(){var e,t,n,c,l=arguments;return e=this,t=void 0,c=function*(){const e=s.Logger.logfunction("GetReservedIds",l);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const c=yield n.json();for(let e=0;e<c.length;e++)a.AddId(c[e]);s.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved ids error message: ",t.message):console.log("get reserved ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedIdUrl()),(0,r.ey)(e,"GetReservedIds",t)}},new((n=void 0)||(n=Promise))((function(o,i){function r(e){try{a(c.next(e))}catch(e){i(e)}}function s(e){try{a(c.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}a((c=c.apply(e,t||[])).next())}))}());var e=this.ids[0];return this.ids.shift(),e}))}static AddId(e){this.ids.includes(e)||this.ids.push(e)}}a.ids=[];class l{static getId(){return c(this,void 0,void 0,(function*(){this.connectionIds.length<5&&(yield function(){var e,t,n,c,a=arguments;return e=this,t=void 0,c=function*(){const e=s.Logger.logfunction("GetReservedConnectionIds",a);try{let t=(0,i.Xr)("application/x-www-form-urlencoded");const n=yield fetch(o.B.GetReservedConnectionIdUrl(),{method:"GET",headers:t});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);const c=yield n.json();for(let e=0;e<c.length;e++)l.AddId(c[e]);s.Logger.logUpdate(e)}catch(t){t instanceof Error?console.log("get reserved connection ids error message: ",t.message):console.log("get reserved connection ids unexpected error: ",t),(0,r.Mb)(t,o.B.GetReservedConnectionIdUrl()),(0,r.ey)(e,"GetReservedConnectionIds",t)}},new((n=void 0)||(n=Promise))((function(o,i){function r(e){try{a(c.next(e))}catch(e){i(e)}}function s(e){try{a(c.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}a((c=c.apply(e,t||[])).next())}))}());var e=this.connectionIds[0];return this.connectionIds.shift(),e}))}static AddId(e){this.connectionIds.includes(e)||this.connectionIds.push(e)}}l.connectionIds=[]},7273:(e,t,n)=>{n.d(t,{z:()=>i});var o=n(9581);class i{constructor(e,t,n,i){this.url=o.B.BASE_URL,this.message=e,this.ok=t,this.status=n,this.data=i}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}}},3278:(e,t,n)=>{n.d(t,{b:()=>o});class o{static setSession(e){e&&(o.sessionId=e)}}o.BearerAccessToken="",o.sessionId=998},2299:(e,t,n)=>{n.d(t,{B:()=>o});class o{constructor(e){this.id=1,this.isOnlineSync=!1,this.isOnlineSync=e}}},442:(e,t,n)=>{n.d(t,{Y:()=>u});var o=n(1167),i=n(2155),r=n(9581),s=n(3518),c=n(1863),a=n(3026),l=n(8286),d=n(949);class u{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 e=this,t=void 0,u=function*(){if(d.serviceWorker)try{return(yield(0,d.sendMessage)("SyncData__SyncDataOnline",{})).data}catch(e){console.error("SyncData__SyncDataOnline sw error: ",e),(0,d.handleServiceWorkerException)(e)}for(let e=0;e<this.conceptsSyncArray.length;e++)a.I.AddConcept(this.conceptsSyncArray[e]);for(let e=0;e<this.connectionSyncArray.length;e++)l.d.AddConnection(this.connectionSyncArray[e]);if(this.conceptsSyncArray.length>0){let e=this.conceptsSyncArray.slice();this.conceptsSyncArray=[],(0,o.Y)(e)}if(this.connectionSyncArray.length>0){let e=this.connectionSyncArray.slice();this.connectionSyncArray=[],yield function(e){return t=this,n=void 0,a=function*(){let t=new i.N(0,0,0,0,0,0,0);try{var n=(0,s.Xr)(),o=JSON.stringify(e);const i=yield fetch(r.B.CreateTheConnectionUrl(),{method:"POST",headers:n,body:o});return i.ok?yield i.json():(console.log("Create the connection error message: ",i.status),(0,c.ry)(i)),t}catch(e){throw e instanceof Error?console.log("Create the connection error message: ",e.message):console.log(" Create the connection unexpected error: ",e),e}},new((o=void 0)||(o=Promise))((function(e,i){function r(e){try{c(a.next(e))}catch(e){i(e)}}function s(e){try{c(a.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}c((a=a.apply(t,n||[])).next())}));var t,n,o,a}(e)}return"done"},new((n=void 0)||(n=Promise))((function(o,i){function r(e){try{c(u.next(e))}catch(e){i(e)}}function s(e){try{c(u.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}c((u=u.apply(e,t||[])).next())}));var e,t,n,u}}u.conceptsSyncArray=[],u.connectionSyncArray=[]},9003:(e,t,n)=>{n.d(t,{S5:()=>l,kH:()=>u,qI:()=>a});var o=n(1863),i=n(949),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};let s=10;class c{}function a(e){const t=i.Logger.logfunction("openDatabase",arguments);return new Promise((function(n,r){c.db&&(i.Logger.logUpdate(t),n(c.db));let l=i.BaseUrl.BASE_URL+"_FreeSchemaLocal"+i.BaseUrl.BASE_APPLICATION;const u=indexedDB.open(l,s);u.onupgradeneeded=e=>{var t=e.target.result,o="localconcept",r="localconnection",c="localid";console.log("this is the version upgrade",s),t.objectStoreNames.contains(o)&&t.deleteObjectStore(o),t.objectStoreNames.contains(r)&&t.deleteObjectStore(r),t.objectStoreNames.contains(c)&&t.deleteObjectStore(c),t.objectStoreNames.contains(o)||(t.createObjectStore(o,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(r)||(t.createObjectStore(r,{keyPath:"id"}).transaction.oncomplete=e=>{}),t.objectStoreNames.contains(c)||(t.createObjectStore(c,{keyPath:"id"}).transaction.oncomplete=e=>{d(c,{id:0,value:-100}),d(c,{id:1,value:-200}),d(c,{id:3,value:i.BaseUrl.getRandomizer()})}),n(t)},u.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(l),a(e),(0,o.ey)(t,"openDatabase",n),r(n)},u.onsuccess=function(e){var o=e.target;c.db=o.result,i.Logger.logUpdate(t),n(c.db)}}))}function l(e){var t=arguments;return r(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("getObjectsFromLocalIndexDb",t);return new Promise((function(t,r){a(e).then((o=>{var r=[],s=o.transaction(e,"readwrite").objectStore(e).getAll();s.onsuccess=()=>{const e=s.result;for(var o=0;o<e.length;o++)r.push(e[o]);i.Logger.logUpdate(n),t(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot get objects from database because you cannot open the Local database",data:e};(0,o.ey)(n,"getObjectsFromLocalIndexDb",t),r(t)}))}))}))}function d(e,t){const n=i.Logger.logfunction("storeToDatabase",[e,"localindexdb"]);return new Promise((function(r,s){a(e).then((c=>{const a=c.transaction(e,"readwrite").objectStore(e).add(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot store to the Local database "+e,data:i,body:t};(0,o.ey)(n,"storeToDatabase",r),s(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot store to database because you cannot open the Local database",data:e};(0,o.ey)(n,"storeToDatabase",t),s(t)}))}))}function u(e,t){const n=i.Logger.logfunction("UpdateToDatabase",arguments);return new Promise((function(r,s){a(e).then((c=>{const a=c.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{i.Logger.logUpdate(n),r(t)},a.onerror=i=>{let r={status:400,ok:!1,message:"Cannot Update to the Local database"+e,data:i,body:t};(0,o.ey)(n,"UpdateToDatabase",r),s(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the Local database",data:e};(0,o.ey)(n,"UpdateToDatabase",t),s(t)}))}))}},3655:(e,t,n)=>{n.d(t,{El:()=>h,b8:()=>u,kH:()=>d,qI:()=>l,wh:()=>p});var o=n(2299),i=n(9581),r=n(949),s=n(1863);let c=10;class a{}function l(e){const t=r.Logger.logfunction("openDatabase",[e,"indexdb"]);return new Promise((function(n,o){a.db&&(r.Logger.logUpdate(t),n(a.db));let d=i.B.BASE_URL+"_FreeSchema"+i.B.BASE_APPLICATION;const u=indexedDB.open(d,c);console.log("this is the update version",c,u),u.onupgradeneeded=e=>{let o=e.target.result,i="concept",s="connection",a="settings";console.log("this is the version update for index",c),o.objectStoreNames.contains(i)&&o.deleteObjectStore(i),o.objectStoreNames.contains(s)&&o.deleteObjectStore(s),o.objectStoreNames.contains(a)&&o.deleteObjectStore(a),o.objectStoreNames.contains(i)||(o.createObjectStore(i,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(s)||(o.createObjectStore(s,{keyPath:"id"}).transaction.oncomplete=e=>{}),o.objectStoreNames.contains(a)||(o.createObjectStore(a,{keyPath:"id"}).transaction.oncomplete=e=>{}),r.Logger.logUpdate(t),n(o)},u.onerror=n=>{console.error("Why didn't you allow my web app to use IndexedDB?!",n),indexedDB.deleteDatabase(d),l(e),(0,s.ey)(t,"openDatabase",n),o(n)},u.onsuccess=function(e){let o=e.target;a.db=o.result,r.Logger.logUpdate(t),n(a.db)}}))}function d(e,t){const n=r.Logger.logfunction("UpdateToDatabase",[e,"indexdb"]);return new Promise((function(o,i){l(e).then((c=>{const a=c.transaction(e,"readwrite").objectStore(e).put(t);a.onsuccess=e=>{r.Logger.logUpdate(n),o(t)},a.onerror=o=>{let r={status:400,ok:!1,message:"Cannot Update to the database"+e,data:o,body:t};(0,s.ey)(n,"UpdateToDatabase",r),i(r)}})).catch((e=>{let t={status:400,ok:!1,message:"Cannot update to database because you cannot open the database",data:e};(0,s.ey)(n,"UpdateToDatabase",t),i(t)}))}))}function u(){const e=r.Logger.logfunction("GetLastSettingsFromDatabase",["indexdb"]);return new Promise((function(t,n){let i="settings";l(i).then((c=>{let a=c.transaction(i,"readwrite").objectStore(i).getAll();a.onsuccess=()=>{let n=new o.B(!1),i=a.result;for(let e=0;e<i.length;e++)n=i[e];r.Logger.logUpdate(e),t(n)},a.onerror=t=>{(0,s.ey)(e,"GetLastSettingsFromDatabase",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};(0,s.ey)(e,"GetLastSettingsFromDatabase",o),n(o)}))}))}function h(e){const t=r.Logger.logfunction("AiUpdateFlag",["indexdb"]);return new Promise((function(n,o){let i="settings";l(i).then((c=>{const a=c.transaction(i,"readwrite").objectStore(i).put(e);a.onsuccess=o=>{r.Logger.logUpdate(t),n(e)},a.onerror=n=>{let i={status:400,ok:!1,message:"Cannot update AI flag",data:n,body:e};(0,s.ey)(t,"AiUpdateFlag",i),o(i)}})).catch((e=>{let n={status:400,ok:!1,message:"Cannot update AI flag because you cannot open the database",data:e};(0,s.ey)(t,"AiUpdateFlag",n),o(n)}))}))}function p(e,t){const n=r.Logger.logfunction("removeFromDatabase",[e,"indexdb"]);return new Promise((function(o,i){l(e).then((c=>{const a=c.transaction(e,"readwrite").objectStore(e).delete(Number(t));a.onsuccess=function(e){r.Logger.logUpdate(n),o(t)},a.onerror=t=>{let o={status:400,ok:!1,message:"Cannot remove from the database"+e,data:t};(0,s.ey)(n,"removeFromDatabase",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};(0,s.ey)(n,"removeFromDatabase",o),i(o)}))}))}},4485:(e,t,n)=>{function o(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 i(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 r(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 s(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}n.d(t,{gt:()=>s,nm:()=>i,vo:()=>o,wS:()=>r}),n(2155),n(7282)},9934:(e,t,n)=>{function o(e,t){return-1===e.indexOf(t)&&e.push(t),e}n.d(t,{A:()=>o})},9700:(e,t,n)=>{n.d(t,{V:()=>l});var o,i=n(949),r=n(3278),s=n(1863),c=n(3518),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class l{static startAutoSync(){this.autoSyncInterval?console.warn("Auto-sync is already running."):(this.nextSyncTime=Date.now()+this.SYNC_INTERVAL_MS,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){console.error("Error on Logger Log : ",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`,1==!e.serviceWorker&&(e.serviceWorker=!1)}catch(t){(0,s.ey)(e,"Logger.logUpdate",t)}}static logfunction(e,...t){if(!this.logPackageActivationStatus)return{};const n=Date.now();let o=t;const s=i.BaseUrl.getRandomizer(),c=r.b.sessionId;let a={startTime:n,functionName:e,functionParameters:o,requestFrom:i.BaseUrl.BASE_APPLICATION,sessionId:c,applicationId:s};return this.formatLogData("INFO","function called",a)}static logError(e,t,n,o,i,s,c,a,l,d,u){try{const h=r.b.sessionId,p={startTime:e,userId:t,operationType:n,requestFrom:o,requestIP:i,responseStatus:s,responseTime:`${(performance.now()-e).toFixed(3)}ms`,responseSize:c?`${JSON.stringify(c).length}`:"0",sessionId:null==h?void 0:h.toString(),functionName:a,functionParameters:l,userAgent:d,conceptsUsed:u};this.formatLogData("ERROR",`Information logged for ${a}`,p)}catch(e){console.error("Error on logError")}}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&&(this.sendPackageLogsToServer(),this.sendApplicationLogsToServer())}catch(e){console.error("Failed to log application activity:",e)}}static checkLoggerServerStatus(){return a(this,void 0,void 0,(function*(){let e=1e4+o.checkInterval;const t=new Date;if(o.lastCheck&&t.getTime()-o.lastCheck.getTime()<e)console.log("still cooling down");else{try{let e=i.BaseUrl.LogHealth();o.lastCheck=new Date,(yield fetch(e,{method:"GET"})).ok&&(o.isLoggerActive=!0,o.checkInterval=0)}catch(e){console.warn("This is error in the logger check")}o.checkInterval=o.checkInterval+500}}))}static sendApplicationLogsToServer(){return a(this,void 0,void 0,(function*(){const e=this.applicationLogsData;try{if(!o.isLoggerActive)return void o.checkLoggerServerStatus();if(0===e.length)return;this.applicationLogsData=[],r.b.BearerAccessToken;const t=50;let n=(0,c.Xr)(),s=0;for(;0!=e.length;){const r=e.slice(0,t),c=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:n,body:JSON.stringify({logType:this.appLogs,logData:r})});c.ok||404===c.status&&(o.isLoggerActive=!1),e.splice(0,t),s+=t,s++}}catch(e){o.isLoggerActive=!1}}))}static sendPackageLogsToServer(){return a(this,void 0,void 0,(function*(){const e=this.packageLogsData;try{if(!o.isLoggerActive)return void o.checkLoggerServerStatus();if(0===e.length)return;this.packageLogsData=[];const t=300;let n=0;for(;0!=e.length;){const r=e.slice(0,t);let s=(0,c.Xr)();const a=yield fetch(i.BaseUrl.PostLogger(),{method:"POST",headers:s,body:JSON.stringify({logType:this.mftsccsBrowser,logData:r})});if(!a.ok)return void(404===a.status&&(o.isLoggerActive=!1));e.splice(0,t),n++}}catch(e){o.isLoggerActive=!1}}))}static saveLogToLocalStorage(e,t){try{if(void 0===typeof localStorage)return void console.warn("Local Storage type undefined");{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){console.error("Error on saving log in localstorage"),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):console.warn("localStorage is not available")}}o=l,l.isLoggerActive=!0,l.lastCheck=new Date,l.checkInterval=0,l.logLevel="INFO",l.packageLogsData=[],l.applicationLogsData=[],l.LOG_LEVELS=["DEBUG","INFO","WARNING","ERROR","ROUTE"],l.SYNC_INTERVAL_MS=6e4,l.nextSyncTime=null,l.appLogs="app",l.mftsccsBrowser="mftsccs",l.logApplicationActivationStatus=!1,l.logPackageActivationStatus=!1,l.autoSyncInterval=null,o.startAutoSync()},1412:(e,t,n)=>{function o(e=[],t=[]){}n.d(t,{e:()=>o})},4698:(e,t,n)=>{n.d(t,{V:()=>a,w:()=>c});var o=n(7139),i=n(949),r=n(276),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(e=[]){let t=[];if(e.length>0)for(let n=0;n<e.length;n++){let o=l(e[n]);t.push(o)}return t}function a(e){var t=arguments;return s(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("GetConnectionTypeForCount",t);let r={};for(let t=0;t<e.length;t++){let n=yield(0,o.r)(e[t].connectionTypeId);e[t].connectionType=n.characterValue,r[e[t].conceptId]=e[t]}return i.Logger.logUpdate(n),r}))}function l(e){const t=e.split("_");if(3===t.length){let e=new r.y;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.")}},1863:(e,t,n)=>{n.d(t,{ER:()=>s,Mb:()=>c,ey:()=>a,ry:()=>r});var o=n(949),i=n(7273);function r(e){if(o.Logger.log("ERROR",e.statusText,{code:e.status,data:e.statusText}),401==e.status||406==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}if(500==e.status){let t=new i.z(e.statusText,!1,e.status,"");throw t.setUrl(e.url),t}}function s(e,t={}){if(o.Logger.log("ERROR",t.statusText,{code:e.status,data:e.status}),401==e.status||406==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}if(500==e.status){let n=new i.z(t.statusText,!1,e.status,"");throw n.setUrl(e.url),n}}function c(e,t=""){if(o.Logger.log("ERROR",e.message,{code:e.status,data:e.stack}),e.status){let n=new i.z(e.message,!1,e.status,e.stack);throw n.setUrl(t),n}{let n=new i.z(e.message,!1,500,e.stack);throw n.setUrl(t),n}}function a(e,t,n){var o;try{if(!e)return void console.error(`Error in ${t}: logData is undefined`);const i=Date.now();e.startTime=null!==(o=e.startTime)&&void 0!==o?o:i,e.responseTime=i-e.startTime+" ms",e.level="ERROR",e.errorMessage=(null==n?void 0:n.message)||"Unknown error occurred",console.error(`Error in function ${t}:`,n)}catch(e){console.error("Failed to handle package function error:",e)}}},1708:(e,t,n)=>{n.d(t,{Az:()=>h});var o=n(8146),i=n(3026),r=n(9581),s=n(3518),c=n(949),a=n(1863),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function h(e){return u(this,void 0,void 0,(function*(){const t=c.Logger.logfunction("GetConceptByCharacterAndCategory",e);let n=(0,c.CreateDefaultConcept)();if("the"==e)return n.id=1,n.typeId=5,n.characterValue="the",n;let p=(0,c.SplitStrings)(e);if(p.length>1){let t=1,o=yield h(p[0]);0!=o.id&&(t=o.id),n=yield function(e,t){var n=arguments;return u(this,void 0,void 0,(function*(){const o=c.Logger.logfunction("GetConceptByCharacterAndCategoryFromMemory",n);let u=yield c.ConceptsData.GetConceptByCharacterAndCategoryLocal(e,t);return 0==u.id&&(u=yield function(e,t){var n=arguments;return d(this,void 0,void 0,(function*(){const o=c.Logger.logfunction("GetConceptByCharacterAndCategoryDirectApi",n);let d=(0,c.CreateDefaultConcept)();try{var u=(0,s.Xr)("application/x-www-form-urlencoded");const n=yield fetch(r.B.GetConceptByCharacterAndCategoryDirectUrl(),{method:"POST",headers:u,body:`character_value=${e}&category_id=${t}`});if(n.ok){let e=yield n.json();d=e,(0,l.K)(d).then((()=>{i.I.AddConcept(d)}))}else console.log("This is the concept by category and character error",n.status),(0,a.ry)(n);c.Logger.logUpdate(o)}catch(e){e instanceof Error?console.log(" This is the concept by category and character error message: ",e.message):console.log(" This is the concept by category and character unexpected error: ",e),(0,a.Mb)(e,r.B.GetConceptByCharacterAndCategoryDirectUrl()),(0,a.ey)(o,"GetConceptByCharacterAndCategoryDirectApi",e)}return d}))}(e,t)),c.Logger.logUpdate(o),u}))}(e,t)}else p[0]==e&&(n=yield function(e){var t=arguments;return u(this,void 0,void 0,(function*(){const n=c.Logger.logfunction("GetConceptByCharacter",t);let i=yield c.ConceptsData.GetConceptByCharacterAndTypeLocal(e,51);return 0==i.id&&(i=yield(0,o.Y)(e)),c.Logger.logUpdate(n),i}))}(e));return c.Logger.logUpdate(t),n}))}},176:(e,t,n)=>{n.d(t,{F4:()=>s,P6:()=>a,dp:()=>c});var o=n(2155),i=n(7282),r=n(6416);function s(e){var t,n;const o=(0,r.u)();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 c(e){const t=(0,i.o)();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 a(e){const t=new o.N(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}},5020:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(949),i=n(3026),r=n(205),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(){return s(this,void 0,void 0,(function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++){let n=e[t];i.I.AddConceptToMemory(n)}r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0}catch(e){throw yield(0,o.DelayFunctionExecution)(2e3,c()),{message:"Cannot create Binary Tree Concept",ok:!1,status:400,data:e}}}))}},7282:(e,t,n)=>{n.d(t,{Y:()=>r,o:()=>i});var o=n(2615);function i(){let e=r(new Date),t=r(new Date);return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}function r(e){const t=e.getMonth()+1,n=e.getDate(),o=e.getFullYear();let i=e.getHours();const r=e.getMinutes(),s=e.getSeconds(),c=i>=12?"PM":"AM";i%=12,i=i||12;const a=e=>e.toString().padStart(2,"0");return`${t}/${n}/${o} ${i}:${a(r)}:${a(s)} ${c}`}},1218:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(949),i=n(7282),r=n(1666),s=n(8407),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function a(e){return c(this,arguments,void 0,(function*(e,t=null,n=null,c=null,l=null,d=null,u=null){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("CreateTheComposition",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:c,userId:l,accessId:d,sessionInformationId:u})).data}catch(e){console.error("CreateTheComposition sw error: ",e),(0,o.handleServiceWorkerException)(e)}let h=null!=l?l:999,p=null!=d?d:4,f=null!=u?u:999,y=null!=c?c:0,v=(0,i.o)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=y,n=yield(0,s.A)(o,"",!0,h,p,f);v=n,t=n.id,y=n.id,yield a(e[o],n.id,n.userId,t,l,d,u)}else{let i=null!=t?t:999,c=null!=n?n:999,g=y,m=yield(0,s.A)(o,"",!0,h,p,f);v=m,yield(0,r.q)(i,c,m.id,g),yield a(e[o],m.id,m.userId,g,l,d,u)}else{let i=null!=t?t:999,c=null!=n?n:10267,a=y,l=yield(0,s.A)(o,e[o].toString(),!1,h,p,f);yield(0,r.q)(i,c,l.id,a)}return v}))}},2212:(e,t,n)=>{n.d(t,{Ay:()=>l,N:()=>d});var o=n(1167),i=n(2615),r=n(5976),s=n(442),c=n(949),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function l(e,t,n,o,c,l,d){return a(this,void 0,void 0,(function*(){let a=yield r.B.getId(),u=new Date,h=new Date,p=new i.j(a,t,o,n,c,e,l,!0,u,h,d);return p.isTemp=!1,s.Y.AddConcept(p),p}))}function d(e,t,n,s,l,d,u){return a(this,void 0,void 0,(function*(){let a=yield r.B.getId(),h=new Date,p=new Date,f=new i.j(a,t,s,n,l,e,d,!1,h,p,u);return c.ConceptsData.AddConcept(f),(0,o.Y)([f]),f}))}},1666:(e,t,n)=>{n.d(t,{q:()=>s});var o=n(2155),i=n(442),r=n(1863);function s(e,t,n,s){var c=t,a=new o.N(0,e,n,c,s,1,4);if(e==n)return a.ofTheConceptId=0,a.toTheConceptId=1,a;try{a.isTemp=!0,a.id=Math.floor(1e8*Math.random()),i.Y.AddConnection(a)}catch(e){(0,r.Mb)(e)}return a}},4818:(e,t,n)=>{n.d(t,{m:()=>h,E:()=>p});var o=n(949),i=n(1863),r=n(3518),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},c=n(9581),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},l=n(5239),d=n(4864),u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function h(e){var t=arguments;return u(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteConnectionById",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionById",{id:e})).data}catch(e){console.error("DeleteConnectionById sw error: ",e),(0,o.handleServiceWorkerException)(e)}let s=!0;return e>0?(s=yield function(e){var t=arguments;return a(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteTheConnection",t);let s=!1;try{const t=new FormData;t.append("id",e.toString());let a=(0,r.BZ)();const l=yield fetch(c.B.DeleteTheConnectionUrl(),{method:"POST",headers:a,body:t,redirect:"follow"});o.Logger.logUpdate(n),l.ok?s=(yield l.json()).success:(console.log("Delete connection error status: ",l.status),(0,i.ry)(l)),s&&o.ConnectionData.AddNpConn(e)}catch(e){e instanceof Error?console.log("Delete connection error message: ",e.message):console.log("Delete connection unexpected error: ",e),(0,i.Mb)(e,c.B.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnection",e)}return s}))}(e),l.O.removeNodeFromTree(e)):d.G.RemoveConnectionById(e),o.Logger.logUpdate(n),s}))}function p(e){var t=arguments;return u(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteConnectionByIdBulk",t);if(o.serviceWorker)try{return(yield(0,o.sendMessage)("DeleteConnectionByIdBulk",{ids:e})).data}catch(e){console.error("DeleteConnectionByIdBulk sw error: ",e),(0,o.handleServiceWorkerException)(e)}let c=yield function(e){var t=arguments;return s(this,void 0,void 0,(function*(){const n=o.Logger.logfunction("DeleteTheConnectionBulkApi",t);let s=!1;try{let t=(0,r.BZ)();t.append("Content-Type","application/json");const c=yield fetch(o.BaseUrl.DeleteTheConnectionBulkUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(o.Logger.logUpdate(n),c.ok?s=(yield c.json()).success:(console.log("Delete connection Bulk Api error status: ",c.status),(0,i.ry)(c)),s)for(let t=0;t<e.length;t++){let n=e[t];o.ConnectionData.AddNpConn(n)}}catch(e){e instanceof Error?console.log("Delete connection Bulk Api error message: ",e.message):console.log("Delete connection Bulk Api unexpected error: ",e),(0,i.Mb)(e,o.BaseUrl.DeleteTheConnectionUrl()),(0,i.ey)(n,"DeleteTheConnectionBulkApi",e)}return s}))}(e);if(c)for(let t=0;t<e.length;t++){let n=e[t];n>0?l.O.removeNodeFromTree(n):d.G.RemoveConnectionById(n)}return o.Logger.logUpdate(n),c}))}},2289:(e,t,n)=>{n.d(t,{$S:()=>d,L0:()=>u,WC:()=>h});var o=n(8675),i=n(6058),r=n(949),s=n(1863);n(3518);var c=n(1708),a=n(4818),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){const i=r.Logger.logfunction("DeleteConnectionByType",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByType",{id:e,linker:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByType sw error: ",e),(0,s.ey)(i,"DeleteConnectionByType",e),(0,r.handleServiceWorkerException)(e)}}let c=yield(0,o.l)(e);for(let e=0;e<c.length;e++)r.ConnectionData.AddConnection(c[e]);let a=yield r.ConnectionData.GetConnectionsOfConcept(e),l=yield(0,r.GetConceptByCharacter)(t),d=[];for(let e=0;e<a.length;e++)a[e].typeId==l.id&&d.push(a[e]);let u=!1;for(let e=0;e<d.length;e++)u=yield(0,r.DeleteConnectionById)(d[e].id);return r.Logger.logUpdate(i),u}))}function u(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){const i=r.Logger.logfunction("DeleteConnectionByTypeBulk",n)||{};if(r.serviceWorker){i.serviceWorker=!0;try{const n=yield(0,r.sendMessage)("DeleteConnectionByTypeBulk",{id:e,linkers:t});return r.Logger.logUpdate(i),n.data}catch(e){console.error("DeleteConnectionByTypeBulk sw error: ",e),(0,s.ey)(i,"DeleteConnectionByTypeBulk",e),(0,r.handleServiceWorkerException)(e)}}let l=yield(0,o.l)(e);for(let e=0;e<l.length;e++)r.ConnectionData.AddConnection(l[e]);let d=yield r.ConnectionData.GetConnectionsOfConcept(e),u=[];for(let e=0;e<t.length;e++){let n=t[e],o=yield(0,c.Az)(n);u.push(o)}let h=[];console.log("this is all the connections for deleting taken",d,u,t);for(let e=0;e<d.length;e++)for(let t=0;t<u.length;t++)d[e].typeId==u[t].id&&h.push(d[e].id);return console.log("these are the to delete",h),r.Logger.logUpdate(i),yield(0,a.E)(h)}))}function h(e,t){return l(this,arguments,void 0,(function*(e,t,n=!1){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetAllTheConnectionsByTypeAndOfTheConcept",{id:e,linker:t,reverse:n})).data}catch(e){console.error("GetAllTheConnectionsByTypeAndOfTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let s=[];if(n){let n=yield(0,i.W)(e),o=yield(0,r.MakeTheTypeConceptApi)(t,999);for(let e=0;e<n.length;e++)n[e].typeId==o.id&&s.push(n[e])}else{let n=yield(0,o.l)(e);for(let e=0;e<n.length;e++)r.ConnectionData.AddConnection(n[e]);let i=yield r.ConnectionData.GetConnectionsOfConcept(e),c=yield(0,r.GetConceptByCharacter)(t);for(let e=0;e<i.length;e++)i[e].typeId==c.id&&s.push(i[e])}return s}))}},4364:(e,t,n)=>{n.d(t,{s:()=>s});var o=n(1239),i=n(949),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function s(){return r(this,arguments,void 0,(function*(e=[]){const t=i.Logger.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(e[t].ofTheConceptId),n.includes(e[t].toTheConceptId)||n.push(e[t].toTheConceptId),n.includes(e[t].typeId)||n.push(e[t].typeId);yield(0,o.r)(n)}i.Logger.logUpdate(t)}))}},5284:(e,t,n)=>{n.d(t,{B:()=>c});var o=n(949),i=n(8286),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(){return s(this,arguments,void 0,(function*(e=[]){const t=o.Logger.logfunction("FindConnectionsOfCompositionsBulkInMemory",[e.length])||{};let n=[];try{if(o.serviceWorker){t.serviceWorker=!0;try{const n=yield(0,o.sendMessage)("FindConnectionsOfCompositionsBulkInMemory",{composition_ids:e});return o.Logger.logUpdate(t),n.data}catch(e){console.error("FindConnectionsOfCompositionsBulkInMemory sw error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),(0,o.handleServiceWorkerException)(e)}}for(let t=0;t<e.length;t++){let o=yield i.d.GetConnectionsOfConcept(e[t]);n.push(...o)}return o.Logger.logUpdate(t),n}catch(e){return console.error("FindConnectionsOfCompositionsBulkInMemory error: ",e),(0,r.ey)(t,"FindConnectionsOfCompositionsBulkInMemory",e),n}}))}},8939:(e,t,n)=>{n.d(t,{$N:()=>T,$V:()=>h,Ez:()=>k,JA:()=>C,Mb:()=>y,Nj:()=>f,PT:()=>w,RW:()=>m,XI:()=>g,ay:()=>u,hL:()=>d,kx:()=>v,re:()=>p,yz:()=>I,zN:()=>N});var o=n(7139),i=n(2),r=n(3026),s=n(8286),c=n(949),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e){return l(this,void 0,void 0,(function*(){let t={connectionList:[],compositionList:[]};try{if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionById",{id:e})).data}catch(e){console.error("GetCompositionById error sw: ",e),(0,c.handleServiceWorkerException)(e)}let n=yield(0,i.s)(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 console.error("GetCompositionById error: ",e),t}}))}function u(e,t,n){return l(this,void 0,void 0,(function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield N(e,t,n);return c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l,c}))}function h(e,t,n){return l(this,void 0,void 0,(function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield N(e,t,n);c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l;let d={};return d.created_at=a.entryTimeStamp,d.data=c,d.id=e,d}))}function p(e,t,n){return l(this,void 0,void 0,(function*(){var i,s;let c={},a=yield r.I.GetConcept(e);0==a.id&&null!=e&&null!=e&&(a=yield(0,o.r)(e));let l=yield A(a,t,n);return c[null!==(s=null===(i=null==a?void 0:a.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=l,c}))}function f(e){return l(this,void 0,void 0,(function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetComposition",{id:e})).data}catch(e){console.error("GetComposition error sw: ",e),(0,c.handleServiceWorkerException)(e)}let s=[],a={};s=yield(0,i.s)(e);let l=[];for(let e=0;e<s.length;e++)l.includes(s[e].ofTheConceptId)||l.push(s[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield N(e,s,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a}))}function y(e){return l(this,void 0,void 0,(function*(){var t,n;let s=[],c={};s=yield(0,i.s)(e);let a=[];for(let e=0;e<s.length;e++)a.includes(s[e].ofTheConceptId)||a.push(s[e].ofTheConceptId);let l=yield r.I.GetConcept(e);0==l.id&&null!=e&&null!=e&&(l=yield(0,o.r)(e));let d=yield L(e,s,a);return c[null!==(n=null===(t=null==l?void 0:l.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=d,c}))}function v(e){return l(this,void 0,void 0,(function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionFromMemory",{id:e})).data}catch(e){console.error("GetCompositionFromMemory error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield S(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a}))}function g(e){return l(this,void 0,void 0,(function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionFromMemoryNormal",{id:e})).data}catch(e){console.error("GetCompositionFromMemoryNormal error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield A(d,i,l);return a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u,a}))}function m(e){var t=arguments;return l(this,void 0,void 0,(function*(){var n,i;const l=c.Logger.logfunction("GetCompositionWithIdFromMemory",t)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return c.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",e),(0,c.handleServiceWorkerException)(e)}}let d={},u=[],h={};try{u=yield s.d.GetConnectionsOfCompositionLocal(e);let t=[];for(let e=0;e<u.length;e++)t.includes(u[e].ofTheConceptId)||t.push(u[e].ofTheConceptId);let c=yield r.I.GetConcept(e);0==c.id&&null!=e&&null!=e&&(c=yield(0,o.r)(e));let a=yield S(c,u,t);h[null!==(i=null===(n=null==c?void 0:c.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=a,d.created_at=c.entryTimeStamp,d.data=h,d.id=e}catch(t){console.log("this is the exception in GetCompositionWithIdFromMemory",e),(0,a.ey)(l,"GetCompositionWithIdFromMemory",t)}return c.Logger.logUpdate(l),d}))}function C(e,t){var n=arguments;return l(this,void 0,void 0,(function*(){var i,s;const l=c.Logger.logfunction("GetCompositionFromMemoryWithConnections",n)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const n=yield(0,c.sendMessage)("GetCompositionFromMemoryWithConnections",{id:e,connectionList:t});return c.Logger.logUpdate(l),n.data}catch(e){console.error("GetCompositionFromMemoryWithConnections error sw: ",e),(0,a.ey)(l,"GetCompositionFromMemoryWithConnections",e),(0,c.handleServiceWorkerException)(e)}}let d={},u=[];for(let e=0;e<t.length;e++)u.includes(t[e].ofTheConceptId)||u.push(t[e].ofTheConceptId);let h=yield r.I.GetConcept(e);0==h.id&&null!=e&&null!=e&&(h=yield(0,o.r)(e));let p=yield S(h,t,u);d[null!==(s=null===(i=null==h?void 0:h.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:""]=p;let f={};return f.created_at=h.entryTimeStamp,f.data=d,f.id=e,c.Logger.logUpdate(l),f}))}function w(e,t){return l(this,void 0,void 0,(function*(){var n,i;const s=c.Logger.logfunction("GetCompositionWithIdFromMemoryFromConnection",[e])||{};if(c.serviceWorker){s.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithIdFromMemory",{id:e});return c.Logger.logUpdate(s),t.data}catch(e){console.error("GetCompositionWithIdFromMemory error sw: ",e),(0,a.ey)(s,"GetCompositionWithIdFromMemoryFromConnection",e),(0,c.handleServiceWorkerException)(e)}}let l={},d=[];for(let e=0;e<t.length;e++)d.includes(t[e].ofTheConceptId)||d.push(t[e].ofTheConceptId);let u=yield r.I.GetConcept(e);0==u.id&&null!=e&&null!=e&&(u=yield(0,o.r)(e));let h=yield S(u,t,d);l[null!==(i=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==i?i:""]=h;let p={};return p.created_at=u.entryTimeStamp,p.data=l,p.id=e,c.Logger.logUpdate(s),p}))}function T(e){return l(this,void 0,void 0,(function*(){var t;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionWithIdFromMemoryNew",{id:e})).data}catch(e){console.error("GetCompositionWithIdFromMemoryNew error sw: ",e),(0,c.handleServiceWorkerException)(e)}let n=[],i={};n=yield s.d.GetConnectionsOfCompositionLocal(e);let a=[];for(let e=0;e<n.length;e++)a.includes(n[e].ofTheConceptId)||a.push(n[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(console.log("this concept you cannot find ",e),d=yield(0,o.r)(e)),(new Date).getTime();let u=yield function(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){var i,r,s,a,l,d,u,h;let p={},f=e.id,y=((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(f)){let t=y;return{[t]:null==e?void 0:e.characterValue}}if(o.includes(f))return"";o.push(f);for(let e=0;e<t.length;e++){let n=yield(0,c.GetTheConcept)(t[e].ofTheConceptId),o=yield(0,c.GetTheConcept)(t[e].toTheConceptId);t[e].ofConcept=n,t[e].toConcept=o;let i=n.id,r="the_",l=(null!==(a=null===(s=null==o?void 0:o.type)||void 0===s?void 0:s.characterValue)&&void 0!==a?a:"").replace(r,"");null!=p[i]&&null!=p[i]||(p[i]={}),p[i][l]=o.characterValue}let v={};for(let e=0;e<t.length;e++){let n=t[e].ofConcept,o=t[e].toConcept,i=null!==(d=null===(l=null==n?void 0:n.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"",r="the_",s=(null!==(h=null===(u=null==o?void 0:o.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"").replace(r,"");null!=v[n.id]&&null!=v[n.id]||(v[n.id]={});let c=v[n.id];null!=c[i]&&null!=c[i]||(c[i]={}),null!=p[t[e].ofTheConceptId]&&null!=p[t[e].toTheConceptId]?c[i][s]=p[o.id]:c[i][s]=o.characterValue}return v[e.id]}))}(d,n,a);null===(t=null==d?void 0:d.type)||void 0===t||t.characterValue,i=u;let h={};return h.created_at=d.entryTimeStamp,h.data=i,h.id=e,h}))}function k(e){return l(this,void 0,void 0,(function*(){var t,n;if(c.serviceWorker)try{return(yield(0,c.sendMessage)("GetCompositionWithIdAndDateFromMemory",{id:e})).data}catch(e){console.error("GetCompositionWithIdAndDateFromMemory error sw: ",e),(0,c.handleServiceWorkerException)(e)}let i=[],a={};i=yield s.d.GetConnectionsOfCompositionLocal(e);let l=[];for(let e=0;e<i.length;e++)l.includes(i[e].ofTheConceptId)||l.push(i[e].ofTheConceptId);let d=yield r.I.GetConcept(e);0==d.id&&null!=e&&null!=e&&(d=yield(0,o.r)(e));let u=yield N(e,i,l);a[null!==(n=null===(t=null==d?void 0:d.type)||void 0===t?void 0:t.characterValue)&&void 0!==n?n:""]=u;let h={};return h.data=a,h.id=e,h.created_at=d.entryTimeStamp,h}))}function I(e){var t=arguments;return l(this,void 0,void 0,(function*(){var n,s;const l=c.Logger.logfunction("GetCompositionWithId",t)||{};if(c.serviceWorker){l.serviceWorker=!0;try{const t=yield(0,c.sendMessage)("GetCompositionWithId",{id:e});return c.Logger.logUpdate(l),t.data}catch(e){console.error("GetCompositionWithId error sw: ",e),(0,a.ey)(l,"GetCompositionWithId",e),(0,c.handleServiceWorkerException)(e)}}let d=[],u={};d=yield(0,i.s)(e);let h=[];for(let e=0;e<d.length;e++)h.includes(d[e].ofTheConceptId)||h.push(d[e].ofTheConceptId);let p=yield r.I.GetConcept(e);0==p.id&&null!=e&&null!=e&&(p=yield(0,o.r)(e));let f=yield N(e,d,h);u[null!==(s=null===(n=null==p?void 0:p.type)||void 0===n?void 0:n.characterValue)&&void 0!==s?s:""]=f;let y={};return y.data=u,y.id=e,c.Logger.logUpdate(l),y}))}function S(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var s,c,a;let l={},d=[],u=e.id;if(null===(s=null==e?void 0:e.type)||void 0===s?void 0:s.characterValue,!n.includes(u))return null==e?void 0:e.characterValue;if(i.includes(u))return"";i.push(u);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==u)if(u!=t[e].toTheConceptId){let s=t[e].toTheConceptId,u=yield r.I.GetConcept(s);if(null!=u&&0!=u.id||null==s||null==s||(u=yield(0,o.r)(s)),0!=u.id&&null==(null==u?void 0:u.type)){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}let h="the_",p=(null!==(a=null===(c=null==u?void 0:u.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(h,"");if(isNaN(Number(p))){if(p){const e=yield S(u,t,n,i);l[p]=e}}else{const e=yield S(u,t,n,i);d[p]=e,l=d}}else console.log("this is the faulty connection ",t[e]);return l}))}function A(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var s,a,l;const d=c.Logger.logfunction("recursiveFetchConceptNormal",[e]);(new Date).getTime();let u={},h=[],p=e.id;if(u.id=p,null===(s=null==e?void 0:e.type)||void 0===s?void 0:s.characterValue,!n.includes(p))return null==e?void 0:e.characterValue;if(i.includes(p))return"";i.push(p);for(let e=0;e<t.length;e++)if(t[e].ofTheConceptId==p)if(p!=t[e].toTheConceptId){let s=t[e].toTheConceptId,c=yield r.I.GetConcept(s);if(null!=c&&0!=c.id||null==s||null==s||(c=yield(0,o.r)(s)),0!=c.id&&null==(null==c?void 0:c.type)){let e=c.typeId,t=yield r.I.GetConcept(e);c.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),c.type=t)}let d="the_",p=(null!==(l=null===(a=null==c?void 0:c.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"").replace(d,"");if(isNaN(Number(p))){if(p){const e=yield S(c,t,n,i);u[p]=e}}else{const e=yield S(c,t,n,i);h[p]=e,u=h}}else console.log("this is the faulty connection ",t[e]);return c.Logger.logUpdate(d),u}))}function N(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var s,c,a;let l={},d=[];if(0==e)return null;let u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==u.type){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}if(null===(s=null==u?void 0:u.type)||void 0===s?void 0:s.characterValue,!n.includes(e))return null==u?void 0:u.characterValue;if(i.includes(e))return"";i.push(e);for(let s=0;s<t.length;s++)if((new Date).getTime(),t[s].ofTheConceptId==e)if(e!=t[s].toTheConceptId){let e=t[s].toTheConceptId,u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==(null==u?void 0:u.type)){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}let h="the_",p=(null!==(a=null===(c=null==u?void 0:u.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(h,"");if(isNaN(Number(p))){if(p){const o=yield N(e,t,n,i);l[p]=o}}else{const o=yield N(e,t,n,i);d[p]=o,l=d}}else console.log("this is the faulty connection ",t[s]);return l}))}function L(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,i=[]){var s,c,a;let l={},d=[];if(0==e)return null;let u=yield r.I.GetConcept(e);if(null!=u&&0!=u.id||null==e||null==e||(u=yield(0,o.r)(e)),0!=u.id&&null==u.type){let e=u.typeId,t=yield r.I.GetConcept(e);u.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),u.type=t)}if(null===(s=null==u?void 0:u.type)||void 0===s?void 0:s.characterValue,!n.includes(e))return null==u?void 0:u.characterValue;if(i.includes(e))return"";i.push(e),l.id=e;for(let i=0;i<t.length;i++)if(t[i].ofTheConceptId==e){let e=t[i].toTheConceptId,s=yield r.I.GetConcept(e);if(null!=s&&0!=s.id||null==e||null==e||(s=yield(0,o.r)(e)),s&&null==(null==s?void 0:s.type)){let e=s.typeId,t=yield r.I.GetConcept(e);s.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,o.r)(e),s.type=t)}let u="the_",h=(null!==(a=null===(c=null==s?void 0:s.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"").replace(u,"");if(isNaN(Number(h))){if(h){const o=yield L(e,t,n);l[h]=o}}else{const o=yield L(e,t,n);d[h]=o,l=d}}return l}))}},6687:(e,t,n)=>{n.d(t,{D:()=>T,MT:()=>w,Nt:()=>f,QL:()=>g,as:()=>y,cw:()=>u,dF:()=>d,hG:()=>v,km:()=>p,nr:()=>C,p8:()=>h,rv:()=>m});var o=n(8642),i=n(7467),r=n(949),s=n(1863),c=n(5284),a=n(8939),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(){return l(this,arguments,void 0,(function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.kx)(e[n]);t.push(o)}return t}))}function u(){return l(this,arguments,void 0,(function*(e=[]){yield(0,o.Y)(e);let t=[];for(let n=0;n<e.length;n++){let o=yield(0,a.RW)(e[n]);t.push(o)}return t}))}function h(){return l(this,arguments,void 0,(function*(e=[],t=[]){const n=r.Logger.logfunction("GetCompositionFromConnectionsWithDataId",[e])||{};if(r.serviceWorker){n.serviceWorker=!0;try{const o=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataId",{conceptIds:e,connectionIds:t});return r.Logger.logUpdate(n),o.data}catch(e){console.error("GetCompositionFromConnectionsWithDataId error sw: ",e),(0,s.ey)(n,"GetCompositionFromConnectionsWithDataId",e),(0,r.handleServiceWorkerException)(e)}}let o=[];for(let t=0;t<e.length;t++){let n=yield(0,a.RW)(e[t]);o.push(n)}return r.Logger.logUpdate(n),o}))}function p(){var e=arguments;return l(this,arguments,void 0,(function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdFromConnections",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdFromConnections",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdFromConnections error sw: ",e),(0,s.ey)(o,"GetCompositionFromConnectionsWithDataIdFromConnections",e),(0,r.handleServiceWorkerException)(e)}}let c=yield(0,i.j)(n),l=[];for(let e=0;e<t.length;e++){let n=yield(0,a.PT)(t[e],c);l.push(n)}return r.Logger.logUpdate(o),l}))}function f(){var e=arguments;return l(this,arguments,void 0,(function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdIndex",e)||{};if(r.serviceWorker){o.serviceWorker=!0;try{const e=yield(0,r.sendMessage)("GetCompositionFromConnectionsWithDataIdIndex",{conceptIds:t,connectionIds:n});return r.Logger.logUpdate(o),e.data}catch(e){console.error("GetCompositionFromConnectionsWithDataIdIndex error sw: ",e),(0,s.ey)(o,"GetCompositionFromConnectionsWithDataIdIndex",e),(0,r.handleServiceWorkerException)(e)}}yield(0,i.j)(n),yield(0,c.B)(t);let l={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);l[t[e]]=n}return r.Logger.logUpdate(o),l}))}function y(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t),yield(0,c.B)(e);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n}))}function v(){return l(this,arguments,void 0,(function*(e=[],t=[]){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetCompositionFromConnectionsWithIndexFromConnections",{conceptIds:e,connectionIds:t})).data}catch(e){console.error("GetCompositionFromConnectionsWithIndexFromConnections error sw: ",e),(0,r.handleServiceWorkerException)(e)}let n=yield(0,i.j)(t),o=[];for(let t=0;t<e.length;t++){let i=yield(0,a.JA)(e[t],n);o[e[t]]=i}return o}))}function g(e){var t=arguments;return l(this,void 0,void 0,(function*(){const n=r.Logger.logfunction("GetConnectionDataPrefetch",t)||{};if(r.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,r.sendMessage)("GetConnectionDataPrefetch",{connectionIds:e});return r.Logger.logUpdate(n),t.data}catch(e){console.error("GetConnectionDataPrefetch error sw: ",e),(0,s.ey)(n,"GetConnectionDataPrefetch",e),(0,r.handleServiceWorkerException)(e)}}let o=[],c=[],a={};for(let t=0;t<e.length;t++){let n=yield r.ConnectionData.GetConnection(e[t]);0==n.id?o.push(e[t]):c.push(n)}for(let t=0;t<o.length;t++)a[e[t]]=!1;let l=[],d=yield(0,i.j)(o);c=[...c,...d];for(let e=0;e<c.length;e++)l.push(c[e].ofTheConceptId),l.push(c[e].toTheConceptId),l.push(c[e].typeId);return yield(0,r.GetConceptBulk)(l),r.Logger.logUpdate(n),c}))}function m(){var e=arguments;return l(this,arguments,void 0,(function*(t=[],n=[]){const o=r.Logger.logfunction("GetCompositionFromConnectionsWithDataIdInObject",e);yield(0,i.j)(n);let s={};for(let e=0;e<t.length;e++){let n=yield(0,a.RW)(t[e]);s[t[e]]=n}return r.Logger.logUpdate(o),s}))}function C(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.$N)(e[t]);n[e[t]]=o}return n}))}function w(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.kx)(e[t]);n[e[t]]=o}return n}))}function T(){return l(this,arguments,void 0,(function*(e=[],t=[]){yield(0,i.j)(t);let n={};for(let t=0;t<e.length;t++){let o=yield(0,a.XI)(e[t]);n[e[t]]=o,console.log("this is the normal data",e[t],o)}return n}))}},2013:(e,t,n)=>{n.d(t,{A:()=>a,w:()=>l});var o=n(8146),i=n(949),r=n(3026),s=n(1863),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function a(e){var t=arguments;return c(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("GetConceptByCharacter",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacter",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacter sw error: ",e),(0,s.ey)(n,"GetConceptByCharacter",e),(0,i.handleServiceWorkerException)(e)}}let c=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=c&&0!=(null==c?void 0:c.id)||!a||(yield(0,o.Y)(e),c=yield r.I.GetConceptByCharacterAndTypeLocal(e,51),0==c.id&&(c=yield r.I.GetConceptByCharacter(e))),i.Logger.logUpdate(n),c}))}function l(e){var t=arguments;return c(this,void 0,void 0,(function*(){const n=i.Logger.logfunction("GetConceptByCharacterUpdated",t)||{};if(i.serviceWorker){n.serviceWorker=!0;try{const t=yield(0,i.sendMessage)("GetConceptByCharacterUpdated",{characterValue:e});return i.Logger.logUpdate(n),t.data}catch(e){console.error("GetConceptByCharacterUpdated error sw: ",e),(0,s.ey)(n,"GetConceptByCharacterUpdated",e),(0,i.handleServiceWorkerException)(e)}}let c=yield r.I.GetConceptByCharacter(e),a=`${e}`;return null!=c&&0!=(null==c?void 0:c.id)||!a||(yield(0,o.Y)(e),c=yield r.I.GetConceptByCharacter(e)),i.Logger.logUpdate(n),c}))}},7887:(e,t,n)=>{n.d(t,{a:()=>s,p:()=>c});var o=n(8286),i=n(4864),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function s(){return r(this,void 0,void 0,(function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)o.d.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Connection Binary Tree Concept",ok:!1,status:400,data:e}}}))}function c(){return r(this,void 0,void 0,(function*(){try{let e=[];if(Array.isArray(e))for(let t=0;t<e.length;t++)i.G.AddConnectionToMemory(e[t])}catch(e){throw{message:"Cannot create Local Connection Binary Tree Concept",ok:!1,status:400,data:e}}}))}},7876:(e,t,n)=>{n.d(t,{A:()=>d,K:()=>u});var o=n(1735),i=n(7139),r=n(949),s=n(3026),c=n(7282),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};const l=new Map;function d(e){return a(this,arguments,void 0,(function*(e,t=999){let n=performance.now();if(o.J.activateStatus)try{o.J.incrementConcept(e)}catch(e){console.error("Error adding connection in access tracker"),r.Logger.log("ERROR","Error Adding Connection")}if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConcept",{id:e,userId:t})).data}catch(e){console.error("GetTheConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}let d=(0,c.o)();if(l.has(e))return l.get(e)||d;const u=(()=>a(this,void 0,void 0,(function*(){try{if(e<0)return yield r.LocalConceptsData.GetConceptByGhostId(e);if(d=yield s.I.GetConcept(e),(null==d||0==d.id)&&null!=e&&null!=e){let t=yield(0,i.r)(e);d=t}if(0!=d.id&&null==d.type&&null==(yield s.I.GetConcept(d.typeId))&&null!=d.typeId&&null!=d.typeId){let e=yield(0,i.r)(d.typeId);d.type=e}return d}catch(o){throw console.error("this is the error in the getting concept",o),r.Logger.logError(n,t,"read","unknown",void 0,500,o,"GetTheConcept",[e,t],"unknown",void 0),o}finally{l.delete(e)}})))();return l.set(e,u),u}))}function u(e){return a(this,void 0,void 0,(function*(){if(r.serviceWorker)try{return(yield(0,r.sendMessage)("AddTypeConcept",{concept:e})).data}catch(e){console.error("AddTypeConcept sw error: ",e),(0,r.handleServiceWorkerException)(e)}if(null==e.type){let t=yield s.I.GetConcept(e.typeId);if(0==t.id&&0!=e.typeId&&999!=e.typeId){let t=yield(0,i.r)(e.typeId);e.type=t}else e.type=t}}))}},7869:(e,t,n)=>{n.d(t,{_:()=>y,A:()=>f});var o=n(9581),i=n(3026),r=n(1863),s=n(3518),c=n(949),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},l=n(2299);class d{}d.isUpdated=!1,d.isOnlineSync=!1;var u=n(3655),h=n(9003),p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function f(){return p(this,arguments,void 0,(function*(e=!0){try{if(yield(0,u.qI)("concepts"),yield(0,h.qI)("concepts"),e){if((yield(0,u.b8)()).isOnlineSync)return!0;yield function(){return a(this,void 0,void 0,(function*(){const e=c.Logger.logfunction("GetAiData");try{const a=(new Date).getTime();var t=(0,s.ab)("application/x-www-form-urlencoded");const l=yield fetch(o.B.GetAllAiData(),{method:"GET",headers:t});l.ok||(console.log("Ai Error Message: ","Cannot get response"),(0,r.ry)(l));const d=yield l.json();for(var n=0;n<d.length;n++)i.I.AddConcept(d[n]);y();let u=(new Date).getTime()-a;console.log("The time taken is ",u),c.Logger.logUpdate(e)}catch(e){e instanceof Error?console.log("Ai Error Message: ",e.message):console.log("Ai Error Message: ",e),(0,r.Mb)(e,o.B.GetAllAiData())}}))}()}return!0}catch(e){let t={message:"cannot initlize the AI system",ok:!1,status:400,data:e};return console.log(t),!0}}))}function y(){return p(this,void 0,void 0,(function*(){d.isOnlineSync=!0;var e=new l.B(d.isOnlineSync);(0,u.El)(e)}))}},8095:(e,t,n)=>{n.d(t,{h:()=>c});var o=n(949),i=n(9700),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(e,t,n){var c=arguments;return s(this,arguments,void 0,(function*(e,t,n,s=!1,a={concepts:[],connections:[]}){var l,d,u,h,p,f;const y=i.V.logfunction("CreateConnectionBetweenTwoConceptsLocal",c)||{};let v=performance.now();try{if(o.serviceWorker){y.serviceWorker=!0;try{const r=yield(0,o.sendMessage)("CreateConnectionBetweenTwoConceptsLocal",{ofTheConcept:e,toTheConcept:t,linker:n,both:s,actions:a});return(null===(d=null===(l=null==r?void 0:r.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(r.actions.concepts))),(null===(h=null===(u=null==r?void 0:r.actions)||void 0===u?void 0:u.connections)||void 0===h?void 0:h.length)&&(a.connections=JSON.parse(JSON.stringify(r.actions.connections))),i.V.logUpdate(y),r.data}catch(e){console.error("CreateConnectionBetweenTwoConceptsLocal sw error: ",e),(0,r.ey)(y,"CreateConnectionBetweenTwoConceptsLocal",e),(0,o.handleServiceWorkerException)(e)}}if(e.userId,s){let i=(null===(p=t.type)||void 0===p?void 0:p.characterValue)+"_s_"+n+"_by";var g=yield(0,o.MakeTheInstanceConceptLocal)("connection",i,!1,999,999,999,0,a);yield(0,o.CreateTheConnectionLocal)(t.id,e.id,g.id,1e3,void 0,void 0,a)}let c=(null===(f=e.type)||void 0===f?void 0:f.characterValue)+"_s_"+n+"_s";var m=yield(0,o.MakeTheInstanceConceptLocal)("connection",c,!1,999,999,999,void 0,a);let v=yield(0,o.CreateTheConnectionLocal)(e.id,t.id,m.id,1e3,void 0,void 0,a);return i.V.logUpdate(y),v}catch(o){throw i.V.logError(v,e.userId,"create",void 0,void 0,500,o,"CreateConnectionBetweenTwoConceptsLocal",[e,t,n,s],void 0,void 0),(0,r.ey)(y,"CreateConnectionBetweenTwoConceptsLocal",o),o}}))}},6416:(e,t,n)=>{n.d(t,{u:()=>i});var o=n(2615);function i(){let e=new Date,t=new Date;return new o.j(0,0,0,0,0,"0",0,!1,e,t,"0")}},3075:(e,t,n)=>{n.d(t,{Ay:()=>d,EO:()=>u,xd:()=>h});var o=n(205),i=n(9736),r=n(5257),s=n(9003),c=n(949),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(){return l(this,void 0,void 0,(function*(){const e=c.Logger.logfunction("CreateLocalBinaryTreeFromIndexDb");try{let t=[];if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];i.v.AddConceptToMemory(n)}o.B.isLocalDataLoaded=!0,o.B.isLocalTypeLoaded=!0,o.B.isLocalCharacterLoaded=!0,c.Logger.logUpdate(e)}catch(t){yield(0,c.DelayFunctionExecution)(2e3,d());let n={message:"Cannot create local binary tree from index db",data:t,ok:!1,status:400};throw(0,a.ey)(e,"CreateLocalBinaryTreeFromIndexDb",t),n}}))}function u(){return l(this,void 0,void 0,(function*(){var e;const t=c.Logger.logfunction("PopulateTheLocalConceptsToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",(e=>l(this,void 0,void 0,(function*(){let e=yield(0,s.S5)("localid");if(Array.isArray(e)){if(e[0]){let t=e[0].value;if(t)r.R.AddConceptId(e[0]),yield(0,s.kH)("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};r.R.AddConceptId(e),yield(0,s.kH)("localid",n)}}e[2]}})))),c.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConceptsToMemory",e),n}}))}function h(){return l(this,void 0,void 0,(function*(){var e;const t=c.Logger.logfunction("PopulateTheLocalConnectionToMemory");try{yield null===(e=navigator.locks)||void 0===e?void 0:e.request("dblock",(e=>l(this,void 0,void 0,(function*(){let e=yield(0,s.S5)("localid");if(Array.isArray(e)){if(e[1]){let t=e[1].value;if(t)r.R.AddConnectionId(e[1]),yield(0,s.kH)("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};r.R.AddConnectionId(e),yield(0,s.kH)("localid",n)}}e[2]}})))),c.Logger.logUpdate(t)}catch(e){let n={message:"Cannot populate Local Ids from the Index Db",data:e,ok:!1,status:400};throw(0,a.ey)(t,"PopulateTheLocalConnectionToMemory",e),n}}))}},999:(e,t,n)=>{n.d(t,{R:()=>l});var o=n(949),i=n(1863),r=n(6416),s=n(4711),c=n(5868),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function l(e){return a(this,arguments,void 0,(function*(e,t=null,n=null,a=null,d=null,u=null,h=null,p=!1,f={concepts:[],connections:[]}){var y,v,g,m;const C=o.Logger.logfunction("CreateTheCompositionLocal")||{};if(o.serviceWorker){C.serviceWorker=!0;try{const i=yield(0,o.sendMessage)("CreateTheCompositionLocal",{json:e,ofTheConceptId:t,ofTheConceptUserId:n,mainKey:a,userId:d,accessId:u,sessionInformationId:h,actions:f});return(null===(v=null===(y=null==i?void 0:i.actions)||void 0===y?void 0:y.concepts)||void 0===v?void 0:v.length)&&(f.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(m=null===(g=null==i?void 0:i.actions)||void 0===g?void 0:g.connections)||void 0===m?void 0:m.length)&&(f.connections=JSON.parse(JSON.stringify(i.actions.connections))),o.Logger.logUpdate(C),i.data}catch(e){console.error("CreateTheCompositionLocal error sw: ",e),(0,i.ey)(C,"CreateTheCompositionLocal",e),(0,o.handleServiceWorkerException)(e)}}let w=null!=d?d:999,T=null!=u?u:999,k=null!=h?h:999,I=null!=a?a:0,S=(0,r.u)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=I,n=yield(0,c.k)(o,"",!0,w,T,k,void 0,f);S=n,t=n.id,I=n.id,yield l(e[o],n.id,n.userId,t,d,u,h,void 0,f)}else{let n=null!=t?t:999,i=I,r=yield(0,c.k)(o,"",!0,w,T,k,void 0,f);yield(0,s.F)(n,r.id,i,void 0,void 0,void 0,f),yield l(e[o],r.id,r.userId,i,d,u,h,void 0,f)}else{let n=null!=t?t:999,i=I,r=yield(0,c.k)(o,e[o].toString(),!1,w,T,k,void 0,f);yield(0,s.F)(n,r.id,i,void 0,void 0,void 0,f)}return o.Logger.logUpdate(C),S}))}},3077:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(949),i=n(2615),r=n(9736),s=n(5257),c=n(9700),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function l(e,t,n,l,d,u){return a(this,arguments,void 0,(function*(e,t,n,a,l,d,u=!1,h=0,p={concepts:[],connections:[]}){var f,y,v,g;let m=performance.now();try{if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("CreateTheConceptLocal",{referent:e,typecharacter:t,userId:n,categoryId:a,typeId:l,accessId:d,isComposition:u,referentId:h});return(null===(y=null===(f=null==i?void 0:i.actions)||void 0===f?void 0:f.concepts)||void 0===y?void 0:y.length)&&(p.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(g=null===(v=null==i?void 0:i.actions)||void 0===v?void 0:v.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("CreateTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let c=yield s.R.getConceptId(),m=!0,C=new Date,w=new Date;if("the"==e)return new i.j(1,999,5,5,h,e,d,m,C,w,t);let T=new i.j(c,n,l,a,h,e,d,m,C,w,t);return T.isTemp=!0,T.isComposition=u,r.v.AddConcept(T),p.concepts.push(T),T}catch(o){throw c.V.logError(m,n,"create","unknown","unknown",500,void 0,"createTheConceptLocal",[e,t,n,a,l,d,u],void 0),o}}))}},4711:(e,t,n)=>{n.d(t,{F:()=>l,d:()=>d});var o=n(2155),i=n(4864),r=n(5257),s=n(9700),c=n(949),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function l(e,t,n){return a(this,arguments,void 0,(function*(e,t,n,a=1,l="",d=999,u={concepts:[],connections:[]}){var h,p,f,y;let v=performance.now();if(c.serviceWorker)try{const o=yield(0,c.sendMessage)("CreateTheConnectionLocal",{ofTheConceptId:e,toTheConceptId:t,typeId:n,orderId:a,typeString:l,userId:d,actions:u});return(null===(p=null===(h=null==o?void 0:o.actions)||void 0===h?void 0:h.concepts)||void 0===p?void 0:p.length)&&(u.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(y=null===(f=null==o?void 0:o.actions)||void 0===f?void 0:f.connections)||void 0===y?void 0:y.length)&&(u.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.log("CreateTheConnectionLocal error sw: ",e),(0,c.handleServiceWorkerException)(e)}try{let s=4,h=yield r.R.getConnectionId(),p=0,f=0,y=0;p=e,f=t,y=n;let v=new o.N(0,0,0,0,0,0,0);return e!=t&&(v=new o.N(h,p,f,d,n,a,s),v.isTemp=!0,v.typeCharacter=l,c.LocalSyncData.AddConnection(v),i.G.AddConnection(v),u.connections.push(v)),v}catch(o){throw s.V.logError(v,d,"create","Unknown","Unknown",500,void 0,"CreateTheConnectionLocal",[e,t,n,a,l,d],"UnknownUserAgent",[]),o}}))}function d(e,t,n){return a(this,arguments,void 0,(function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,a;if(c.serviceWorker)try{const l=yield(0,c.sendMessage)("CreateConnection",{ofTheConcept:e,toTheConcept:t,connectionTypeString:n,actions:o});return(null===(r=null===(i=null==l?void 0:l.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(l.actions.concepts))),(null===(a=null===(s=null==l?void 0:l.actions)||void 0===s?void 0:s.connections)||void 0===a?void 0:a.length)&&(o.connections=JSON.parse(JSON.stringify(l.actions.connections))),l.data}catch(e){console.log("CreateConnection error sw: ",e),(0,c.handleServiceWorkerException)(e)}let d=yield(0,c.MakeTheTypeConceptLocal)(n,999,999,999),u=e.userId;return yield l(e.id,t.id,d.id,1e3,n,u,o)}))}},8064:(e,t,n)=>{n.d(t,{$I:()=>c,Ay:()=>s});var o=n(9736),i=(n(9581),n(3518),n(949));n(1863);var r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function s(e){return r(this,void 0,void 0,(function*(){return yield o.v.GetConceptByCharacterAndTypeLocal(e,51)}))}function c(e){return r(this,void 0,void 0,(function*(){if(i.serviceWorker)try{return(yield(0,i.sendMessage)("GetConceptByCharacterAndCategoryLocal",{character:e})).data}catch(e){console.error("GetConceptByCharacterAndCategoryLocal error sw: ",e),(0,i.handleServiceWorkerException)(e)}let t=(0,i.CreateDefaultLConcept)();if("the"==e)return t.id=1,t.typeId=5,t.characterValue="the",t;let n=(0,i.SplitStrings)(e);if(n.length>1){let i=1,s=yield c(n[0]);0!=s.id&&(i=s.id),t=yield function(e,t){return r(this,void 0,void 0,(function*(){return o.v.GetConceptByCharacterAndCategoryLocal(e,t)}))}(e,i)}else n[0]==e&&(t=yield s(e));return t}))}},1213:(e,t,n)=>{n.d(t,{f:()=>a});var o=n(9736),i=n(7820),r=n(949),s=n(176),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function a(e){return c(this,void 0,void 0,(function*(){let t=performance.now();try{if(r.serviceWorker)try{return(yield(0,r.sendMessage)("GetTheConceptLocal",{id:e})).data}catch(e){console.error("GetTheConceptLocal error sw: ",e),(0,r.handleServiceWorkerException)(e)}let t=(0,r.CreateDefaultLConcept)();if(e<0){if(t=yield o.v.GetConcept(e),0==t.id){let n=yield i.G.getNodeFromTree(e);if(null==n?void 0:n.value){let e=n.value;e&&(t=e)}}}else{let n=yield(0,r.GetTheConcept)(e);t=(0,s.F4)(n)}return t}catch(n){throw r.Logger.logError(t,"unknown","read","unknown",void 0,200,void 0,"GetTheConceptLocal",[e],"unknown",void 0),n}}))}},9975:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(949),i=n(9736),r=n(3077),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(e,t,n,c,a){return s(this,arguments,void 0,(function*(e,t,n,s,c,a={concepts:[],connections:[]}){var l,d,u,h;if(o.serviceWorker)try{const i=yield(0,o.sendMessage)("MakeTheConceptLocal",{referent:e,typeCharacter:t,userId:n,categoryId:s,typeId:c,actions:a});return(null===(d=null===(l=null==i?void 0:i.actions)||void 0===l?void 0:l.concepts)||void 0===d?void 0:d.length)&&(a.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(h=null===(u=null==i?void 0:i.actions)||void 0===u?void 0:u.connections)||void 0===h?void 0:h.length)&&(a.connections=JSON.parse(JSON.stringify(i.actions.connections))),i.data}catch(e){console.error("MakeTheConceptLocal error sw: ",e),(0,o.handleServiceWorkerException)(e)}let p=yield i.v.GetConceptByCharacterAndTypeLocal(e,c),f=p;return"the"==t&&(s=1),0==f.id&&(p=yield(0,r.A)(e,t,n,s,c,4,void 0,null,a),f=p),f}))}},5868:(e,t,n)=>{n.d(t,{k:()=>l});var o=n(3077),i=n(8357),r=n(9736),s=n(949),c=n(1863),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function l(e,t){var n=arguments;return a(this,arguments,void 0,(function*(e,t,a=!1,l,d,u=999,h=0,p={concepts:[],connections:[]}){var f,y,v,g;const m=s.Logger.logfunction("MakeTheInstanceConceptLocal",n)||{};if(s.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,s.sendMessage)("MakeTheInstanceConceptLocal",{type:e,referent:t,composition:a,userId:l,accessId:d,sessionInformationId:u,referentId:h,actions:p});return(null===(y=null===(f=null==n?void 0:n.actions)||void 0===f?void 0:f.concepts)||void 0===y?void 0:y.length)&&(p.concepts=JSON.parse(JSON.stringify(n.actions.concepts))),(null===(g=null===(v=null==n?void 0:n.actions)||void 0===v?void 0:v.connections)||void 0===g?void 0:g.length)&&(p.connections=JSON.parse(JSON.stringify(n.actions.connections))),s.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConceptLocal error sw: ",e),(0,c.ey)(m,"MakeTheInstanceConceptLocal",e),(0,s.handleServiceWorkerException)(e)}}try{let n,c,d=999,u=4,f=l,y=4,v="",g=t.length;if(v=e.startsWith("the_")?e:"the_"+e,a)n=yield(0,i.$)(e,d,l,l,p),c=yield(0,o.A)(t,e,l,u,n.id,y,!0,h,p);else if(g>255)n=yield(0,i.$)(v,d,f,l,p),c=yield(0,o.A)(t,v,l,u,n.id,y,void 0,void 0,p);else{n=yield(0,i.$)(v,d,f,l,p);let e=yield r.v.GetConceptByCharacterAndTypeLocal(t,n.id);c=e,0==e.id&&0==e.userId&&(c=yield(0,o.A)(t,v,l,u,n.id,y,void 0,void 0,p))}return c.type=n,s.LocalSyncData.AddConcept(c),p.concepts.push(c),s.Logger.logUpdate(m),c}catch(e){throw(0,c.ey)(m,"MakeTheInstanceConceptLocal",e),e}}))}},8357:(e,t,n)=>{n.d(t,{$:()=>d});var o=n(3077),i=n(8064),r=n(6467),s=n(9975),c=n(949),a=n(1863),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e,t,n,u){var h=arguments;return l(this,arguments,void 0,(function*(e,t,n,l,u={concepts:[],connections:[]}){var p,f,y,v;const g=c.Logger.logfunction("MakeTheTypeConceptLocal",h)||{};if(c.serviceWorker){g.serviceWorker=!0;try{const o=yield(0,c.sendMessage)("MakeTheTypeConceptLocal",{typeString:e,sessionId:t,sessionUserId:n,userId:l,actions:u});return(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.concepts)||void 0===f?void 0:f.length)&&(u.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(v=null===(y=null==o?void 0:o.actions)||void 0===y?void 0:y.connections)||void 0===v?void 0:v.length)&&(u.connections=JSON.parse(JSON.stringify(o.actions.connections))),c.Logger.logUpdate(g),o.data}catch(e){console.error("MakeTheTypeConceptLocal error sw: ",e),(0,a.ey)(g,"MakeTheTypeConceptLocal",e),(0,c.handleServiceWorkerException)(e)}}let m=yield(0,i.$I)(e);if(m&&(0==m.id||0==m.userId)){let i=(0,r.f)(e);if(i[0]==e)m=yield(0,s.A)(e,"the",l,1,51,u);else{let r=yield d(i[0],t,n,l,u),s=yield d(i[1],t,n,l,u);m=yield(0,o.A)(e,i[1],l,r.id,s.id,4,void 0,null,u)}}return c.Logger.logUpdate(g),m}))}},3729:(e,t,n)=>{n.d(t,{D:()=>p});var o=n(9934),i=n(4485),r=n(2),s=n(7876),c=n(4818),a=n(999),l=n(5868),d=n(949),u=n(176),h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function p(e){return h(this,arguments,void 0,(function*(e,t={concepts:[],connections:[]}){var n,h,p,f;if(performance.now(),d.serviceWorker)try{const o=yield(0,d.sendMessage)("UpdateCompositionLocal",{patcherStructure:e,actions:t});return(null===(h=null===(n=null==o?void 0:o.actions)||void 0===n?void 0:n.concepts)||void 0===h?void 0:h.length)&&(t.concepts=JSON.parse(JSON.stringify(o.actions.concepts))),(null===(f=null===(p=null==o?void 0:o.actions)||void 0===p?void 0:p.connections)||void 0===f?void 0:f.length)&&(t.connections=JSON.parse(JSON.stringify(o.actions.connections))),o.data}catch(e){console.error("UpdateCompositionLocal error sw: ",e),(0,d.handleServiceWorkerException)(e)}const y=e.userId,v=e.sessionId,g=e.accessId;let m=[];const C=[];let w=(0,d.CreateDefaultLConcept)(),T=(0,d.CreateDefaultLConcept)();const k=[],I=e.compositionId,S=e.ofTheCompositionId;let A=[],N=yield(0,r.s)(I);for(let e=0;e<N.length;e++)m.push((0,u.P6)(N[e]));const L=[],b=[];let _=[];for(let e=0;e<m.length;e++)(0,o.A)(b,m[e].ofTheConceptId),(0,o.A)(L,m[e].ofTheConceptId),(0,o.A)(L,m[e].toTheConceptId),_.push(m[e].ofTheConceptId);for(let e=0;e<L.length;e++){const t=yield(0,s.A)(L[e]);I==L[e]&&(w=(0,u.F4)(t)),S==L[e]&&(T=(0,u.F4)(t)),C.push((0,u.F4)(t))}const x=e.patchObject;for(const e in x){let n=(0,d.CreateDefaultLConcept)();const o=x[e];let r=w;T.id>0&&(r=T),Array.isArray(o)||"object"==typeof o?(n=yield(0,l.k)(e,"",!0,w.userId,4,999,void 0,t),yield(0,a.R)(x[e],n.id,n.userId,w.id,w.userId,4,999,void 0,t)):n=yield(0,l.k)(e,o,!1,y,g,v,void 0,t);const s=(0,i.nm)(C,n);for(let e=0;e<s.length;e++)if(s[e].id>0){const t=(0,i.gt)(m,s[e].id);A=A.concat(t),k.push(s[e])}yield(0,d.CreateTheConnectionLocal)(r.id,n.id,w.id,2,void 0,void 0,t),C.push(n)}for(let e=0;e<A.length;e++)yield(0,c.m)(A[e].id);yield d.LocalSyncData.SyncDataOnline(void 0,t)}))}},8407:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(9581),i=n(3518),r=n(1863),s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},c=n(4402),a=n(949),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class d{constructor(e,t,n,o,i,r,s,c,a,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=c,this.entryTimestamp=a,this.isNew=l}}var u=n(7282),h=n(2212),p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function f(e,t){var n=arguments;return p(this,arguments,void 0,(function*(e,t,p=!1,f,y=4,v=999,g=0){const m=a.Logger.logfunction("MakeTheInstanceConcept",n)||{};if(a.serviceWorker){m.serviceWorker=!0;try{const n=yield(0,a.sendMessage)("MakeTheInstanceConcept",{type:e,referent:t,composition:p,userId:f,passedAccessId:y,passedSessionId:v,referentId:g});return a.Logger.logUpdate(m),n.data}catch(e){console.error("MakeTheInstanceConcept sw error: ",e),(0,r.ey)(m,"MakeTheInstanceConcept",e),(0,a.handleServiceWorkerException)(e)}}let C,w=v,T=f,k=f,I=y,S=f,A="",N=t.length,L=(0,u.o)();if(A=e.startsWith("the_")?e:"the_"+e,p)L=yield(0,a.MakeTheTypeConceptApi)(e,f),C=yield(0,h.Ay)(t,f,4,L.id,g,I,e);else if(N>255)L=yield(0,a.MakeTheTypeConceptApi)(A,f),C=yield(0,h.Ay)(t,f,4,L.id,g,I,A),function(e){s(this,void 0,void 0,(function*(){try{var t=(0,i.Xr)();const n=yield fetch(o.B.CreateTheTextDataUrl(),{method:"POST",headers:t,body:JSON.stringify(e)});if(!n.ok)throw(0,r.ry)(n),new Error(`Error! status: ${n.status}`);return yield n.json()}catch(e){throw e instanceof Error?console.log("Create the text error message: ",e.message):console.log("Create the text unexpected error: ",e),e}}))}(new d(f,t,999,T,I,S,w,k,Date.now().toString(),!0));else{L=yield(0,a.MakeTheTypeConceptApi)(A,f);let e=yield(0,c.A)(t,L.id);C=e,0==e.id&&0==e.userId&&(C=yield(0,h.N)(t,f,4,L.id,12,I,A),function(e,t,n,s){var c=arguments;l(this,void 0,void 0,(function*(){const l=a.Logger.logfunction("MakeTheNameInBackend",c);try{let c={newConceptId:e,referent:t,typeId:n,typeUserId:s},d=(0,i.Xr)(),u=JSON.stringify(c);const h=yield fetch(o.B.MakeTheNameInBackendUrl(),{method:"POST",headers:d,body:u});a.Logger.logUpdate(l),h.ok||(0,r.ry)(h)}catch(e){e instanceof Error?console.log("make the name in backend error message: ",e.message):console.log("make the name in backend unexpected error: ",e),(0,r.Mb)(e,o.B.MakeTheNameInBackendUrl()),(0,r.ey)(l,"MakeTheNameInBackend",e)}}))}(C.id,`${t}`,L.id,f))}return C.type=L,a.Logger.logUpdate(m),C}))}},5312:(e,t,n)=>{n.d(t,{NK:()=>h,Ve:()=>p,cf:()=>d,vw:()=>f,y8:()=>u});var o=n(2832),i=n(3130),r=n(949),s=n(1863),c=n(6687),a=n(1320),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function d(e){var t=arguments;return l(this,arguments,void 0,(function*(e,n="",d=null,h=i.y0){var p,y,v,g,m,C,w,T;const k=r.Logger.logfunction("SearchLinkMultipleAll",t)||{};try{try{if(r.serviceWorker){k.serviceWorker=!0;const t=yield(0,r.sendMessage)("SearchLinkMultipleAll",{searchQuery:e,token:n,caller:d,format:h});return r.Logger.logUpdate(k),t.data}}catch(e){console.error("SearchLinkMultipleAll error sw: ",e),(0,s.ey)(k,"SearchLinkMultipleAll",e),(0,r.handleServiceWorkerException)(e)}let t=[],I=[],S=[],A=[],N=e[0].composition,L={},b={};(null==d?void 0:d.isDataLoaded)?(L.compositionIds=null===(p=d.conceptIds)||void 0===p?void 0:p.slice(),L.internalConnections=null===(y=d.internalConnections)||void 0===y?void 0:y.slice(),L.linkers=null===(v=d.linkers)||void 0===v?void 0:v.slice(),L.reverse=null===(g=d.reverse)||void 0===g?void 0:g.slice(),b=L,t=b.compositionIds,S=b.internalConnections,I=b.linkers,A=b.reverse):(L=yield(0,o.j)(e,n),d&&(d.conceptIds=null===(m=L.compositionIds)||void 0===m?void 0:m.slice(),d.internalConnections=null===(C=L.internalConnections)||void 0===C?void 0:C.slice(),d.linkers=null===(w=L.linkers)||void 0===w?void 0:w.slice(),d.reverse=null===(T=L.reverse)||void 0===T?void 0:T.slice(),d.isDataLoaded=!0),b=L,t=b.compositionIds,S=b.internalConnections,I=b.linkers,A=b.reverse);let _=yield function(e,t,n,o,r,s){return l(this,arguments,void 0,(function*(e,t,n,o,r,s,l=i.y0){try{let d,h,p=yield(0,c.QL)(e);return l==i.ZJ?(d=yield(0,c.MT)(t,n),h=yield f(e,d,r,o)):l==i.yv?(d=yield(0,c.D)(t,n),h=yield f(e,d,r,o)):100==l?(d=yield(0,c.nr)(t,n),h=yield u(p,d,r,o)):l==i.SL?h=yield(0,a._W)(e,t,n,s.ofCompositions,o):(d=yield(0,c.rv)(t,n),h=yield u(p,d,r,o)),h}catch(e){return void console.log("Error Occured in build layer",e)}}))}(I,t,S,A,N,e[0],h);return r.Logger.logUpdate(k),_}catch(e){throw console.log("this is the error in the search link multiple",e),(0,s.ey)(k,"SearchLinkMultipleAll",e),e}}))}function u(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){(new Date).getTime();let i={},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 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(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{let o=i.characterValue+"_reverse";"string"==typeof s&&(s={}),Array.isArray(s[c][o])||("string"==typeof s[c]&&(s[c]={}),s[c][o]=[]),s[c][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{"string"==typeof s&&(s={}),Array.isArray(s[c][i.characterValue])||("string"==typeof s[c]&&(s[c]={}),s[c][i.characterValue]=[]),s[c][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i}))}function h(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){let i=[],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 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(0,r.GetTheConcept)(e[n].typeId),s=Object.keys(o)[0];try{let r=i.characterValue+"_reverse";"string"==typeof o&&(o={}),Array.isArray(o[s][r])||("string"==typeof o[s]&&(o[s]={}),o[s][r]=[]),o[s][r].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=Object.keys(o)[0];try{"string"==typeof o&&(o={}),Array.isArray(o[s][i.characterValue])||("string"==typeof o[s]&&(o[s]={}),o[s][i.characterValue]=[]),o[s][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let o=t[n[e]];o&&i.push(o)}return i}))}function p(e,t,n,o){return l(this,arguments,void 0,(function*(e,t,n,o,i=[]){(new Date).getTime();let s=[],c=[];for(let t=0;t<e.length;t++)c.push(e[t].toTheConceptId),c.push(e[t].ofTheConceptId),c.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(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{let o=i.characterValue+"_reverse";"string"==typeof s&&(s={}),Array.isArray(s[c][o])||("string"==typeof s[c]&&(s[c]={}),s[c][o]=[]),s[c][o].push(t[e[n].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[e[n].ofTheConceptId]&&t[e[n].toTheConceptId]){let o=t[e[n].ofTheConceptId],i=yield(0,r.GetTheConcept)(e[n].typeId),s=null==o?void 0:o.data,c=Object.keys(s)[0];try{"string"==typeof s&&(s={}),Array.isArray(s[c][i.characterValue])||("string"==typeof s[c]&&(s[c]={}),s[c][i.characterValue]=[]),s[c][i.characterValue].push(t[e[n].toTheConceptId])}catch(e){console.log("this is error",e)}}}for(let e=0;e<o.length;e++){let n=t[o[e]];n&&s.push(n)}return s}))}function f(e,t,n){return l(this,arguments,void 0,(function*(e,t,n,o=[]){let i={},s=yield(0,r.GetConnectionBulk)(e),c=[];for(let e=0;e<s.length;e++)c.push(s[e].toTheConceptId),c.push(s[e].ofTheConceptId),c.push(s[e].typeId);yield(0,r.GetConceptBulk)(c),s.sort((function(e,t){return t.id-e.id}));for(let e=0;e<s.length;e++){let n=!1;if(o.includes(s[e].id)&&(n=!0),1==n){if(t[s[e].ofTheConceptId]&&t[s[e].toTheConceptId]){let n=t[s[e].toTheConceptId],o=yield(0,r.GetTheConcept)(s[e].typeId),i=n,c=Object.keys(i)[0];try{let n=o.characterValue+"_reverse";"string"==typeof i&&(i={}),Array.isArray(i[c][n])||("string"==typeof i[c]&&(i[c]={}),i[c][n]=[]),i[c][n].push(t[s[e].ofTheConceptId])}catch(e){console.log("this is error",e)}}}else if(t[s[e].ofTheConceptId]&&t[s[e].toTheConceptId]){let n=t[s[e].ofTheConceptId],o=yield(0,r.GetTheConcept)(s[e].typeId),i=n,c=Object.keys(i)[0];try{"string"==typeof i&&(i={}),Array.isArray(i[c][o.characterValue])||("string"==typeof i[c]&&(i[c]={}),i[c][o.characterValue]=[]),i[c][o.characterValue].push(t[s[e].toTheConceptId])}catch(e){console.log("this is error",e)}}}return i=t[n],i}))}},1320:(e,t,n)=>{n.d(t,{zl:()=>g,b6:()=>w,e$:()=>k,y6:()=>T,rq:()=>I,yV:()=>m,_W:()=>C});var o=n(949),i=n(6687);function r(e){return e.startsWith("the_")?e.slice(4):e}var s=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function c(e,t,n){return s(this,void 0,void 0,(function*(){var i,r,s,c,a,l,d,u;let h=[];for(let t=0;t<e.length;t++)h.push(e[t].toTheConceptId),h.push(e[t].ofTheConceptId),h.push(e[t].typeId);for(let h=0;h<e.length;h++){let p=!1;n.includes(e[h].id)&&(p=!0);let f=yield(0,o.GetTheConcept)(e[h].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[h].toTheConceptId);if(1==p&&0!=f.id&&0!=y.id){let n,a=null!==(r=null===(i=y.type)||void 0===i?void 0:i.characterValue)&&void 0!==r?r:"self";e[h].toTheConceptId in t?n=t[e[h].toTheConceptId]:(n={},n[a]={},t[e[h].toTheConceptId]=n);let l=yield(0,o.GetTheConcept)(e[h].typeId);try{let e=null!==(c=null===(s=null==f?void 0:f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"none",n=f.characterValue;l.characterValue,l.characterValue.includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[y.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=y.id){let n,i=null!==(l=null===(a=f.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[h].ofTheConceptId in t?n=t[e[h].ofTheConceptId]:(n={},n[i]={},t[e[h].ofTheConceptId]=n);let r=yield(0,o.GetTheConcept)(e[h].typeId);try{let e=null!==(u=null===(d=null==y?void 0:y.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"none",n=y.characterValue;r.characterValue.includes("_s_")&&(y.id in t||(t[y.id]={}),t[y.id][e]=n),t[f.id]={}}catch(e){console.log("this is error",e)}}}return t}))}var a=n(5312),l=n(7876),d=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function u(e,t,n){if(e in t){let o=t[e];o&&(n[o.connectionType+"_count"]=o.count)}}var h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},p=n(4698),f=n(6915),y=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},v=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function g(e,t){return v(this,arguments,void 0,(function*(e,t,n=""){let r=yield(0,o.SearchWithTypeAndLinkerApi)(e,t,n),s=r.compositionIds,c=r.internalConnections,l=r.linkers,d=r.reverse,u=r.mainCompositionIds,h=yield(0,i.QL)(l),p=yield(0,i.MT)(s,c);return yield(0,a.NK)(h,p,u,d)}))}function m(e,t,n,o,r){return v(this,void 0,void 0,(function*(){let s=yield(0,i.QL)(e),c=yield(0,i.rv)(t,n);return yield(0,a.Ve)(s,c,t,o,r)}))}function C(e,t,n,o,r){return v(this,void 0,void 0,(function*(){let s=yield(0,i.QL)(e),c=yield(0,i.D)(t,n);return yield(0,a.NK)(s,c,o,r)}))}function w(e,t,n,a,l){return v(this,void 0,void 0,(function*(){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnections",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:a,countInfos:l})).data}catch(e){console.error("formatConnections error sw: ",e),(0,o.handleServiceWorkerException)(e)}let d=yield(0,i.QL)(e);d=(0,f.X)(d);let u=[];u=yield c(d,u,a),u=yield function(e,t,n){return s(this,void 0,void 0,(function*(){var i,s,c,a,l,d,u,h;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);e.sort((function(e,t){return t.id-e.id}));for(let p=0;p<e.length;p++){let f=!1;n.includes(e[p].id)&&(f=!0);let y=yield(0,o.GetTheConcept)(e[p].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[p].toTheConceptId);if(1==f&&0!=y.id&&0!=v.id){let n,l=null!==(s=null===(i=v.type)||void 0===i?void 0:i.characterValue)&&void 0!==s?s:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],l in n||(n[l]={})):(n={},n[l]={},t[e[p].toTheConceptId]=n);let d=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(a=null===(c=null==y?void 0:y.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",t=y.characterValue,o=d.characterValue;""==o&&(o=e,o=r(o));let i={[e]:t},s=o+"_reverse";d.characterValue.includes("_s_")||("string"==typeof n[l]&&(n[l]={}),n[l][s]=i)}catch(e){console.log("this is error",e)}}if(0!=y.id&&0!=v.id){let n,i=null!==(d=null===(l=y.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);let s=yield(0,o.GetTheConcept)(e[p].typeId);try{let e=null!==(h=null===(u=null==v?void 0:v.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",t=v.characterValue,o=s.characterValue,c=(s.characterValue,!1);""==o&&(o=e,o=r(o),c=!0);let a={[e]:t};isNaN(Number(o))?s.characterValue.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][o]=c?t:a):(Array.isArray(n[i])||(n[i]=[]),n[i].push(t))}catch(e){console.log("this is error",e)}}}return t}))}(d,u,a);let h=yield function(e,t,n,i){return s(this,arguments,void 0,(function*(e,t,n,i,r=[]){var s,c,a,l,d,u;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);e.sort((function(e,t){return t.id-e.id}));for(let n=0;n<e.length;n++){let i=!1;r.includes(e[n].id)&&(i=!0);let h=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),p=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(1==i&&0!=h.id&&0!=p.id&&p.id in t){let i,r=null!==(c=null===(s=p.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self";e[n].toTheConceptId in t?i=t[e[n].toTheConceptId]:(i={},i[r]={},t[e[n].toTheConceptId]=i);let a=yield(0,o.GetTheConcept)(e[n].typeId);try{let o=a.characterValue+"_reverse",s=t[e[n].ofTheConceptId];s&&(Array.isArray(i[r][o])?i[r][o].push(s):a.characterValue.includes("_s_")?(i[r][o]=[],i[r][o].push(s)):i[r][o]=s)}catch(e){console.log("this is error",e)}}if(0!=h.id&&0!=p.id&&h.id in t){let i,r=null!==(l=null===(a=h.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],"string"==typeof i[r]&&(i[r]={})):(i={},i[r]={},t[e[n].ofTheConceptId]=i);let s=!1,c=(yield(0,o.GetTheConcept)(e[n].typeId)).characterValue;""==c&&(c=p.characterValue,s=!0),""==c&&(c=null!==(u=null===(d=null==p?void 0:p.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"");try{let o=t[e[n].toTheConceptId];o&&(Array.isArray(i[r])?s?i[r].push(o[c]):i[r].push(o):Array.isArray(i[r][c])?i[r][c].push(o):c.includes("_s_")?(i[r][c]=[],s?i[r][c].push(o[c]):i[r][c].push(o)):i[r][c]=s?o[c]:o)}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i=t[n[e]];i?(i.id=n[e],h.push(i)):0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e],h.push(i))}return h}))}(d,u,n,[],a);return h}))}function T(e,t,n,s,a){return v(this,arguments,void 0,(function*(e,t,n,s,a,h="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsJustId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:a,order:h})).data}catch(e){console.error("formatConnectionsJustId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let y=yield(0,i.QL)(e),v=yield(0,p.V)(a);y=(0,f.X)(y,h);let g=[];g=yield c(y,g,s),g=yield function(e,t){return d(this,arguments,void 0,(function*(e,t,n=[]){var o,i,s,c,a,d,u,h;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 p=0;p<e.length;p++){let f=!1,y=yield(0,l.A)(e[p].ofTheConceptId),v=yield(0,l.A)(e[p].toTheConceptId);if(n.includes(e[p].id)&&(f=!0),1==f&&0!=y.id&&0!=v.id){let n,a=yield(0,l.A)(e[p].typeId),d=null!==(i=null===(o=v.type)||void 0===o?void 0:o.characterValue)&&void 0!==i?i:"self";e[p].toTheConceptId in t?(n=t[e[p].toTheConceptId],d in n||(n[d]={})):(n={},n[d]={},t[e[p].toTheConceptId]=n);try{let t=null!==(c=null===(s=null==y?void 0:y.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"none",o=y.characterValue,i=a.characterValue;""==i&&(i=t,i=r(i));let l={id:y.id,[t]:o,created_on:e[p].entryTimeStamp},u=i+"_reverse";u.includes("_s_")||("string"==typeof n[d]&&(n[d]={}),n[d][u]=l)}catch(e){console.log("this is error",e)}}if(0!=y.id&&0!=v.id){let n,o=yield(0,l.A)(e[p].typeId),i=null!==(d=null===(a=y.type)||void 0===a?void 0:a.characterValue)&&void 0!==d?d:"self";e[p].ofTheConceptId in t?(n=t[e[p].ofTheConceptId],i in n||(n[i]={})):(n={},n[i]={},t[e[p].ofTheConceptId]=n);try{let t=null!==(h=null===(u=null==v?void 0:v.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",s=v.characterValue,c=o.characterValue,a=!1;""==c&&(c=t,c=r(c),a=!0);let l={};l[t]={id:v.id,data:s,created_on:e[p].entryTimeStamp},isNaN(Number(c))?c.includes("_s_")||("string"==typeof n[i]&&(n[i]={}),n[i][c]=a?l[t]:l):(Array.isArray(n[i])||(n[i]=[]),n[i].push(l[t]))}catch(e){console.log("this is error",e)}}}return t}))}(y,g,s);let m=yield function(e,t,n){return d(this,arguments,void 0,(function*(e,t,n,i=[],r){var s,c,a,d,h,p,f;(new Date).getTime();let y=[],v=[];for(let t=0;t<e.length;t++)v.push(e[t].toTheConceptId),v.push(e[t].ofTheConceptId),v.push(e[t].typeId);for(let n=0;n<e.length;n++){let o=!1,y=yield(0,l.A)(e[n].ofTheConceptId),v=yield(0,l.A)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(o=!0),1==o&&0!=y.id&&0!=v.id&&v.id in t){let o,i=yield(0,l.A)(e[n].typeId),r=null!==(c=null===(s=v.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self",a=!1;e[n].toTheConceptId in t&&(a=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[r]&&(o[r]={})):(o={},o[r]={},t[e[n].toTheConceptId]=o);try{if(t[e[n].ofTheConceptId]){let s=t[e[n].ofTheConceptId];s&&(s.id=y.id,s.created_on=y.entryTimeStamp);let c=i.characterValue+"_reverse";Array.isArray(o[r][c])?o[r][c].push(s):c.includes("_s_")?(o[r][c]=[],o[r][c].push(s)):o[r][c]=s}}catch(e){console.log("this is error",e)}}if(0!=y.id&&0!=v.id&&y.id in t){let o,i=yield(0,l.A)(e[n].typeId),s=null!==(d=null===(a=y.type)||void 0===a?void 0:a.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[s]&&(o[s]={})):(o={},o[s]={},t[e[n].ofTheConceptId]=o),u(y.id,r,o);let g=!1,m=i.characterValue;""==m&&(m=v.characterValue,g=!0),""==m&&(m=(null===(h=null==v?void 0:v.type)||void 0===h?void 0:h.characterValue)||"");try{let i=null!==(f=null===(p=null==v?void 0:v.type)||void 0===p?void 0:p.characterValue)&&void 0!==f?f:"none",c=t[e[n].toTheConceptId];if(c){let t={};t[i]={data:c[i],id:v.id,created_on:e[n].entryTimeStamp},Array.isArray(o[s])?g?o[s].push(c[m]):o[s].push(c):Array.isArray(o[s][m])?o[s][m].push(t):m.includes("_s_")?(o[s][m]=[],g?o[s][m].push(t[i]):o[s][m].push(t)):o[s][m]=g?t[i]:t,u(v.id,r,t)}}catch(e){console.log("this is error",e)}}}for(let e=0;e<n.length;e++){let i={};i=t[n[e]],i?i.id=n[e]:0!=(yield o.ConceptsData.GetConcept(n[e])).id&&(i={},i.id=n[e]),y.push(i)}return y}))}(y,g,n,s,v);return m}))}function k(e,t,n,s,c){return v(this,arguments,void 0,(function*(e,t,n,s,c,a="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsDataId",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:c,order:a})).data}catch(e){console.error("GetConnectionDataPrefetch error sw: ",e),(0,o.handleServiceWorkerException)(e)}let l=yield(0,i.QL)(e),d=yield(0,p.V)(c);l=(0,f.X)(l,a);let y=[];y=yield function(e,t){var n=arguments;return h(this,arguments,void 0,(function*(e,t,i=[]){var r,s,c,a,l,d,u,h;const p=o.Logger.logfunction("FormatFunctionData",n);let 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++){let p=!1,f=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(p=!0),1==p&&0!=f.id&&0!=y.id){let i,l=yield(0,o.GetTheConcept)(e[n].typeId),d=null!==(s=null===(r=y.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self";e[n].toTheConceptId in t?i=t[e[n].toTheConceptId]:(i={},i[d]={},t[e[n].toTheConceptId]=i);try{let e=null!==(a=null===(c=null==f?void 0:f.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",n=f.characterValue;(l.characterValue+"_reverse").includes("_s_")&&(f.id in t||(t[f.id]={}),t[f.id][e]=n),t[y.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=y.id){let i,r=yield(0,o.GetTheConcept)(e[n].typeId),s=null!==(d=null===(l=f.type)||void 0===l?void 0:l.characterValue)&&void 0!==d?d:"self";e[n].ofTheConceptId in t?i=t[e[n].ofTheConceptId]:(i={},i[s]={},t[e[n].ofTheConceptId]=i);try{let e=null!==(h=null===(u=null==y?void 0:y.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",n=y.characterValue;r.characterValue.includes("_s_")&&(y.id in t||(t[y.id]={}),t[y.id][e]=n),t[f.id]={}}catch(e){console.log("this is error",e)}}}return o.Logger.logUpdate(p),t}))}(l,y,s),y=yield function(e,t){var n=arguments;return h(this,arguments,void 0,(function*(e,t,i=[]){var s,c,a,l,d,u,h,p;const f=o.Logger.logfunction("FormatFunctionDataForData",n);let y=[];for(let t=0;t<e.length;t++)y.push(e[t].toTheConceptId),y.push(e[t].ofTheConceptId),y.push(e[t].typeId);for(let n=0;n<e.length;n++){let f=!1,y=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),v=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(f=!0),1==f&&0!=y.id&&0!=v.id){let i,d=yield(0,o.GetTheConcept)(e[n].typeId),u=null!==(c=null===(s=v.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self";e[n].toTheConceptId in t?(i=t[e[n].toTheConceptId],u in i||(i[u]={})):(i={},i[u]={},t[e[n].toTheConceptId]=i);try{let e=null!==(l=null===(a=null==y?void 0:y.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",t=y.characterValue,n=d.characterValue;""==n&&(n=e,n=r(n));let o={id:y.id,data:{[e]:t}},s=n+"_reverse";s.includes("_s_")||("string"==typeof i[u]&&(i[u]={}),i[u][s]=o)}catch(e){console.log("this is error",e)}}if(0!=y.id&&0!=v.id){let i,s=yield(0,o.GetTheConcept)(e[n].typeId),c=null!==(u=null===(d=y.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"self";e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],c in i||(i[c]={})):(i={},i[c]={},t[e[n].ofTheConceptId]=i);try{let e=null!==(p=null===(h=null==v?void 0:v.type)||void 0===h?void 0:h.characterValue)&&void 0!==p?p:"none",t=v.characterValue,n=s.characterValue,o=!1;""==n&&(n=e,n=r(n),o=!0);let a={id:v.id,data:{[e]:t}};isNaN(Number(n))?n.includes("_s_")||("string"==typeof i[c]&&(i[c]={}),i[c][n]=a):(Array.isArray(i[c])||(i[c]=[]),i[c].push(a))}catch(e){console.log("this is error",e)}}}return o.Logger.logUpdate(f),t}))}(l,y,s);let v=yield function(e,t,n,i){var r=arguments;return h(this,arguments,void 0,(function*(e,t,n,i,s=[],c){var a,l,d,h,p,f;const y=o.Logger.logfunction("FormatFromConnectionsAlteredArrayExternal",r);let v=[],g=[];for(let t=0;t<e.length;t++)g.push(e[t].toTheConceptId),g.push(e[t].ofTheConceptId),g.push(e[t].typeId);for(let n=0;n<e.length;n++){let i=!1,r=yield(0,o.GetTheConcept)(e[n].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[n].toTheConceptId);if(s.includes(e[n].id)&&(i=!0),1==i&&0!=r.id&&0!=y.id&&y.id in t){let i,s=yield(0,o.GetTheConcept)(e[n].typeId),d=null!==(l=null===(a=y.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self",h=!1;e[n].toTheConceptId in t&&(h=!0),e[n].toTheConceptId in t?(i=t[e[n].toTheConceptId],"string"==typeof i[d]&&(i[d]={})):(i={},i[d]={},t[e[n].toTheConceptId]=i),u(y.id,c,i);try{if(t[e[n].ofTheConceptId]){let o={id:r.id,data:t[e[n].ofTheConceptId],created_on:e[n].entryTimeStamp},c=s.characterValue+"_reverse";Array.isArray(i[d][c])?i[d][c].push(o):c.includes("_s_")?(i[d][c]=[],i[d][c].push(o)):i[d][c]=o}}catch(e){console.log("this is error",e)}}if(0!=r.id&&0!=y.id&&r.id in t){let i,s=yield(0,o.GetTheConcept)(e[n].typeId),a=null!==(h=null===(d=r.type)||void 0===d?void 0:d.characterValue)&&void 0!==h?h:"self",l=!1;e[n].toTheConceptId in t&&(l=!0),e[n].ofTheConceptId in t?(i=t[e[n].ofTheConceptId],"string"==typeof i[a]&&(i[a]={})):(i={},i[a]={},t[e[n].ofTheConceptId]=i),u(r.id,c,i);let v=!0,g=s.characterValue;""==g&&(g=y.characterValue,v=!0),""==g&&(g=(null===(p=null==y?void 0:y.type)||void 0===p?void 0:p.characterValue)||"");try{null===(f=null==y?void 0:y.type)||void 0===f||f.characterValue;let o=t[e[n].toTheConceptId];if(o){let r={id:y.id,data:t[e[n].toTheConceptId],created_on:e[n].entryTimeStamp};Array.isArray(i[a])?i[a].push(o):Array.isArray(i[a][g])?i[a][s.characterValue].push(r):g.includes("_s_")?(i[a][g]=[],i[a][g].push(r)):i[a][g]=r,u(y.id,c,r)}}catch(e){console.log("this is error",e)}}}for(let e=0;e<i.length;e++){let n={};n.id=i[e];let r=yield(0,o.GetTheConcept)(n.id);n.data=t[i[e]],n.created_on=r.entryTimeStamp,v.push(n)}return o.Logger.logUpdate(y),v}))}(l,y,[],n,s,d);return v}))}function I(e,t,n,s,c){return v(this,arguments,void 0,(function*(e,t,n,s,c,a="DESC"){if(o.serviceWorker)try{return(yield(0,o.sendMessage)("formatConnectionsV2",{linkers:e,conceptIds:t,mainCompositionIds:n,reverse:s,countInfos:c,order:a})).data}catch(e){console.error("formatConnectionsV2 error sw: ",e),(0,o.handleServiceWorkerException)(e)}let l=yield(0,i.QL)(e),d=yield(0,p.V)(c);l=(0,f.X)(l,a);let h={};h=yield function(e){var t=arguments;return y(this,arguments,void 0,(function*(e,n={},i=[]){var r,s,c,a,l;const d=o.Logger.logfunction("FormatFunctionDataV2",t);for(const t of e){const e=i.includes(t.id),d=yield(0,o.GetTheConcept)(t.ofTheConceptId),u=yield(0,o.GetTheConcept)(t.toTheConceptId),h=yield(0,o.GetTheConcept)(t.typeId);if(0===d.id||0===u.id)continue;const p=e?u:d,f=e?d:u,y=null!==(s=null===(r=p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self",v=null!==(a=null===(c=f.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",g=f.characterValue;null===(l=h.characterValue)||void 0===l||l.includes("_s_"),n[p.id]||(n[p.id]={}),n[p.id][y]||(n[p.id][y]={}),n[f.id]||(n[f.id]={}),n[f.id][v]=g}return o.Logger.logUpdate(d),n}))}(l,h,s),h=yield function(e){var t=arguments;return y(this,arguments,void 0,(function*(e,n={},i=[]){var s,c,a,l,d;const u=o.Logger.logfunction("FormatFunctionDataForDataV2",t);for(const t of e){const e=i.includes(t.id),u=yield(0,o.GetTheConcept)(t.ofTheConceptId),h=yield(0,o.GetTheConcept)(t.toTheConceptId),p=yield(0,o.GetTheConcept)(t.typeId);if(0===u.id||0===h.id)continue;const f=e?h:u,y=e?u:h,v=null!==(c=null===(s=f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self",g=null!==(l=null===(a=y.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",m=y.characterValue,C=null!==(d=p.characterValue)&&void 0!==d?d:"";let w=""===C?r(g):C;const T=w.includes("_s_"),k=!isNaN(Number(w)),I={id:y.id,data:{[g]:m}};n[f.id]||(n[f.id]={}),v in n[f.id]&&"string"!=typeof n[f.id][v]||(n[f.id][v]=k?[]:{});try{if(T)continue;k?n[f.id][v].push(I):n[f.id][v][e?`${w}_reverse`:w]=I}catch(e){console.error("Error formatting concept data:",e)}}return o.Logger.logUpdate(u),n}))}(l,h,s);let v=yield function(e,t,n){var i=arguments;return y(this,arguments,void 0,(function*(e,t,n,r=[],s){var c,a,l;const d=o.Logger.logfunction("FormatFromConnectionsAlteredArrayExternal",i),h=[];for(const n of e){const e=r.includes(n.id),i=yield(0,o.GetTheConcept)(n.ofTheConceptId),d=yield(0,o.GetTheConcept)(n.toTheConceptId),h=yield(0,o.GetTheConcept)(n.typeId);if(0===i.id||0===d.id)continue;const p=e?d:i,f=e?i:d,y=p.id,v=f.id,g=null!==(a=null===(c=p.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"self",m=h.characterValue+"_reverse",C=h.characterValue||f.characterValue||(null===(l=f.type)||void 0===l?void 0:l.characterValue)||"";if(t[y]){const o=t[y][g],i=t[v],r={id:f.id,data:i,created_on:n.entryTimeStamp};u(y,s,t[y]);try{e?Array.isArray(o[m])?o[m].push(r):o[m]=[r]:Array.isArray(o)?o.push(i):Array.isArray(o[C])?o[C].push(r):C.includes("_s_")?(o[C]=[],o[C].push(r)):o[C]=[r],u(v,s,r)}catch(e){console.error("Error processing connection:",e)}}else console.log("This is the error in the source")}for(const e of n){const n=yield(0,o.GetTheConcept)(e);h.push({id:e,data:t[e],created_on:n.entryTimeStamp})}return o.Logger.logUpdate(d),h}))}(l,h,n,s,d);return v}))}},6915:(e,t,n)=>{function o(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}n.d(t,{X:()=>o})},3518:(e,t,n)=>{n.d(t,{BZ:()=>c,Xr:()=>r,ab:()=>s});var o=n(3278),i=n(490);function r(e="application/json",t="application/json"){var n;let i={},r=null===(n=o.b.sessionId)||void 0===n?void 0:n.toString();return i=""!=o.b.BearerAccessToken?{"Content-Type":e,Authorization:"Bearer "+o.b.BearerAccessToken,Accept:t,"X-Session-id":r}:{"Content-Type":e,Accept:t,"X-Session-id":r},i}function s(e="application/json",t="",n="application/json"){var i;""==t&&(t=o.b.BearerAccessToken);let r={},s=null===(i=o.b.sessionId)||void 0===i?void 0:i.toString();return r=""!=t?{"Content-Type":e,Authorization:"Bearer "+t,Accept:n,"X-Session-id":s}:{"Content-Type":e,Accept:n,"X-Session-id":s},r}function c(){var e;let t=o.b.BearerAccessToken,n=null===(e=o.b.sessionId)||void 0===e?void 0:e.toString();if(""==t){let e=(0,i.s)();""!=e.token&&(o.b.BearerAccessToken=e.token,t=e.token)}let r=new Headers;return r.append("Authorization","Bearer "+t),r.append("X-Session-Id",n),r}},6467:(e,t,n)=>{function o(e){const t=e.lastIndexOf("_");let n=[];return n=t>0?[e.substring(0,t),e.substring(t+1,e.length)]:[e],n}n.d(t,{f:()=>o})},490:(e,t,n)=>{function o(){var e,t,n,o;let i={entity:0,userConcept:0,userId:0,token:""};try{let r=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";if(r){const s=JSON.parse(r);i.entity=null!==(e=null==s?void 0:s.entityId)&&void 0!==e?e:0,i.userConcept=null!==(t=null==s?void 0:s.userConcept)&&void 0!==t?t:0,i.userId=null!==(n=null==s?void 0:s.userId)&&void 0!==n?n:0,i.token=null!==(o=null==s?void 0:s.token)&&void 0!==o?o:""}}catch(e){console.log("This is the exception in getting user details from local storage")}return i}n.d(t,{s:()=>o})},1596:(e,t,n)=>{n.d(t,{g:()=>s});var o=n(949),i=n(3278),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function s(e,t){return r(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{!function(){const e=o.BaseUrl.NODE_CACHE_URL;if(e===o.BaseUrl.BASE_URL)throw new Error("Base Server Down");let t=sessionStorage.getItem("cacheServers");t=JSON.parse(t);const n=t.indexOf(e);if(o.BaseUrl.isNearestCache=!1,t.includes(e)&&-1!==n&&t.splice(n,1),sessionStorage.setItem("cacheServers",JSON.stringify(t)),t.length){const e=t[0];o.BaseUrl.NODE_CACHE_URL=e}else o.BaseUrl.NODE_CACHE_URL=o.BaseUrl.BASE_URL;console.log("before the payload",i.b.sessionId),navigator.serviceWorker&&navigator.serviceWorker.controller&&(0,o.sendMessage)("SESSION_DATA",{type:"SESSION_DATA",data:o.BaseUrl.NODE_CACHE_URL,session:i.b.sessionId})}();try{return yield fetch(`${o.BaseUrl.NODE_CACHE_URL}${t}`,e)}catch(n){return yield s(e,t)}}catch(e){throw e}}))}},4310:(e,t,n)=>{n.d(t,{Cp:()=>h,ix:()=>f,qj:()=>p});var o=n(949),i=n(1596),r=n(4698),s=n(1863),c=n(1320),a=n(3518),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};const d=new Map,u=new Map;function h(e){var t=arguments;return l(this,void 0,void 0,(function*(){o.Logger.logfunction("BuildWidgetFromId",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromId",{id:e})).data}catch(e){console.error("BuildWidgetFromId error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(d.has(e))return d.get(e)||n;const i=(()=>l(this,void 0,void 0,(function*(){try{let t=[],i=[],l=[],d=[],u="DESC",h=[],p={},f=(0,a.Xr)("application/json"),y=o.BaseUrl.getWidgetData()+"?id="+e;const v=yield fetch(y,{method:"GET",headers:f});if(!v.ok)return(0,s.ry)(v),console.log("This is the BuildWidgetFromId error",v.status),[];p=yield v.json(),t=p.conceptIds,i=p.linkers,l=p.reverse,d=p.mainCompositionIds,h=p.countinfo;let g=(0,r.w)(h);return n=yield(0,c.e$)(i,t,d,l,g,u),n}catch(e){throw console.log("this is the error in the build widget",e),e}finally{d.delete(e)}})))();return d.set(e,i),i}))}function p(e){var t=arguments;return l(this,void 0,void 0,(function*(){o.Logger.logfunction("BuildWidgetFromIdForLatest",t);try{if(o.serviceWorker)return(yield(0,o.sendMessage)("BuildWidgetFromIdForLatest",{id:e})).data}catch(e){console.error("BuildWidgetFromIdForLatest error sw: ",e),(0,o.handleServiceWorkerException)(e)}let n={};if(u.has(e))return u.get(e)||n;const d=(()=>l(this,void 0,void 0,(function*(){try{let t,l=[],d=[],u=[],h=[],p="DESC",f=[],y={},v=(0,a.Xr)("application/json");try{let n=o.BaseUrl.getLatestWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:v})}catch(n){t=yield(0,i.g)({method:"GET",headers:v},"?id="+e)}if(!t.ok)return(0,s.ry)(t),console.log("This is the BuildWidgetFromId error",t.status),[];y=yield t.json(),l=y.conceptIds,d=y.linkers,u=y.reverse,h=y.mainCompositionIds,f=y.countinfo;let g=(0,r.w)(f);return n=yield(0,c.e$)(d,l,h,u,g,p),{data:n,mainId:y.mainId}}catch(e){throw console.log("this is the error in the build widget",e),e}finally{u.delete(e)}})))();return u.set(e,d),d}))}function f(e,t){for(let n=0;n<e.length;n++)if(e[n].id==t)return e[n]}},4287:(e,t,n)=>{n.d(t,{w:()=>s});var o=n(949),i=n(3130),r=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class s{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=i.yv,this.eventHandlers={}}listenToEventType(e){if(this.eventHandlers[e])return;const t=e=>r(this,void 0,void 0,(function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout((function(){return r(this,void 0,void 0,(function*(){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,i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<i.length;e++)yield o.ConnectionData.GetConnection(i[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()}))}),200)}}));this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}listenToEvent(e){if(this.eventHandlers[e])return;const t=t=>r(this,void 0,void 0,(function*(){if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout((function(){return r(this,void 0,void 0,(function*(){let n=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield o.ConnectionData.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()}))}),200)}}));this.eventHandlers[e]=t,window.addEventListener(`${e}`,t)}removeListenToEvent(e){const t=this.eventHandlers[e];t&&(window.removeEventListener(`${e}`,t),delete this.eventHandlers[e])}listenToEventConnectionType(e,t){window.addEventListener(`${e}`,(n=>{if(!this.isUpdating){this.isUpdating=!0;let n=this;setTimeout((function(){return r(this,void 0,void 0,(function*(){let i=yield o.ConnectionData.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<i.length;e++)i.typeId==t&&(yield o.ConnectionData.GetConnection(i[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()}))}),200)}}))}bind(){return r(this,void 0,void 0,(function*(){console.log("this is the old execute data")}))}run(){return r(this,void 0,void 0,(function*(){console.log("this is non subscriber data")}))}update(){return r(this,void 0,void 0,(function*(){this.isDataLoaded=!1,yield this.bind(),this.notify()}))}subscribe(e){return r(this,void 0,void 0,(function*(){return this.subscribers.push(e),yield this.bind(),e(this.data,this)}))}execute(){return r(this,void 0,void 0,(function*(){return yield this.run()}))}unsubscribe(e){return this.subscribers.filter((t=>t!=e)),this.subscribers.length}notify(){this.subscribers.map((e=>{e(this.data,this)}))}}},5328:(e,t,n)=>{n.d(t,{d:()=>l});var o=n(949),i=n(3130),r=n(8939),s=n(4287),c=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class a extends s.w{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 c(this,void 0,void 0,(function*(){var e;if(!this.isDataLoaded){let i=yield(0,o.GetTheConcept)(this.mainConcept),r=(null===(e=i.type)||void 0===e?void 0:e.characterValue)+"_s_"+this.linker,s=yield(0,o.GetConceptByCharacterAndType)(r,16);if(s.id>0){let e=yield(0,o.GetConnectionOfTheConcept)(s.id,i.id,i.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(0,o.GetAllConnectionsOfCompositionBulk)(t)}this.isDataLoaded=!0,this.listenToEvent(this.mainConcept)}return yield this.build()}))}build(){return c(this,void 0,void 0,(function*(){this.data=[],this.connections=yield(0,o.GetConnectionBulk)(this.linkers);for(var e=0;e<this.connections.length;e++){let t=this.connections[e].toTheConceptId,n=yield(0,o.GetTheConcept)(t);if(console.log("this is the format",this.format),this.format==i.yv){let e=yield(0,r.RW)(n.id);this.data.push(e)}else if(this.format==i.ZJ){let e=yield(0,r.kx)(n.id);this.data.push(e)}else if(this.format==i.iw){let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}else{let e=yield(0,o.GetCompositionWithIdAndDateFromMemory)(n.id);this.data.push(e)}}return this.data}))}}function l(e,t,n,o,r=i.yv){return new a(e,t,n,o,r)}},949:(e,t,n)=>{n.r(t),n.d(t,{ADMIN:()=>Sn,ALLID:()=>In.BG,AccessTracker:()=>xe.J,AddGhostConcept:()=>Kt,Anomaly:()=>To,BaseUrl:()=>l.B,BinaryTree:()=>ke.W,BuildWidgetFromId:()=>Do.Cp,BuilderStatefulWidget:()=>yo,Composition:()=>Tt,CompositionBinaryTree:()=>gt,CompositionNode:()=>yt,Concept:()=>Jn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>Ee.d,CountInfo:()=>Uo.y,CreateComposition:()=>G.A,CreateConnection:()=>zt.d,CreateConnectionBetweenEntityLocal:()=>Go,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>vn.h,CreateData:()=>yi,CreateDefaultConcept:()=>M.o,CreateDefaultLConcept:()=>qt.u,CreateSession:()=>Pt,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>D.R,CreateTheCompositionWithCache:()=>It,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>zt.F,DATAID:()=>In.y0,DATAIDDATE:()=>In.iw,DATAV2:()=>In.pU,DelayFunctionExecution:()=>kn,DeleteConceptById:()=>Ne,DeleteConceptLocal:()=>mn,DeleteConnectionById:()=>q.m,DeleteConnectionByIdBulk:()=>q.E,DeleteConnectionByType:()=>Ao.$S,DeleteConnectionByTypeBulk:()=>Ao.L0,DeleteUser:()=>Le,DependencyObserver:()=>_n.w,FilterSearch:()=>eo,FormatFromConnections:()=>en.vw,FormatFromConnectionsAltered:()=>en.y8,FreeschemaQuery:()=>No,FreeschemaQueryApi:()=>bo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllTheConnectionsByTypeAndOfTheConcept:()=>Ao.WC,GetComposition:()=>v.Nj,GetCompositionBulk:()=>Ve.dF,GetCompositionBulkWithDataId:()=>Ve.cw,GetCompositionFromConnectionsWithDataId:()=>Ve.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>Ve.km,GetCompositionFromConnectionsWithDataIdInObject:()=>Ve.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>Ve.Nt,GetCompositionFromConnectionsWithIndex:()=>Ve.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>Ve.hG,GetCompositionFromMemoryWithConnections:()=>v.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>T,GetCompositionListAllWithId:()=>k,GetCompositionListListener:()=>Fn,GetCompositionListLocal:()=>O,GetCompositionListLocalWithId:()=>B,GetCompositionListWithId:()=>I,GetCompositionListWithIdUpdated:()=>S,GetCompositionListener:()=>Rn,GetCompositionLocal:()=>b,GetCompositionLocalWithId:()=>_,GetCompositionWithAllIds:()=>v.Mb,GetCompositionWithCache:()=>Ot,GetCompositionWithDataIdBulk:()=>Gt,GetCompositionWithDataIdWithCache:()=>Rt,GetCompositionWithId:()=>v.yz,GetCompositionWithIdAndDateFromMemory:()=>v.Ez,GetConceptBulk:()=>nt.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>ot.j,GetConnectionById:()=>De,GetConnectionDataPrefetch:()=>Ve.QL,GetConnectionOfTheConcept:()=>P,GetConnectionTypeForCount:()=>qn.V,GetFreeschemaImage:()=>xi,GetFreeschemaImageUrl:()=>Ei,GetImageApi:()=>bi,GetLink:()=>ce,GetLinkListListener:()=>Hn,GetLinkListener:()=>Un.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>$t,GetRelationLocal:()=>sn,GetRelationRaw:()=>Ht,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>tn.f,GetUserGhostId:()=>Zt,JUSTDATA:()=>In.ZJ,LConcept:()=>Qn,LConnection:()=>Yn,LISTNORMAL:()=>In.SL,LocalConceptsData:()=>y.v,LocalSyncData:()=>Kn.H,LocalTransaction:()=>mo,Logger:()=>so.V,LoginToBackend:()=>rt,MakeTheInstanceConcept:()=>J.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>We,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>In.yv,PRIVATE:()=>An,PUBLIC:()=>Nn,PatcherStructure:()=>Xn,Prototype:()=>Ti,RAW:()=>In.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>Vn,SchemaQuery:()=>Oo,SchemaQueryListener:()=>Eo,SearchAllConcepts:()=>Lt,SearchLinkInternal:()=>fn,SearchLinkInternalAll:()=>yn,SearchLinkMultipleAll:()=>en.cf,SearchLinkMultipleAllObservable:()=>xn,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>Me,SearchStructure:()=>to,SearchWithLinker:()=>_t,SearchWithTypeAndLinker:()=>Pn.zl,SearchWithTypeAndLinkerApi:()=>bn,Selector:()=>Wo,SessionData:()=>Zn,Signin:()=>dt,Signup:()=>ct,SignupEntity:()=>at,SplitStrings:()=>c.f,StatefulWidget:()=>po,SyncData:()=>W.Y,TrashTheConcept:()=>_e,UpdateComposition:()=>At,UpdateCompositionLocal:()=>nn.D,UserBinaryTree:()=>Yt,Validator:()=>Io,ViewInternalData:()=>dn,ViewInternalDataApi:()=>an,WidgetTree:()=>Bo,convertFromConceptToLConcept:()=>un.F4,convertFromLConceptToConcept:()=>un.dp,convertWidgetTreeToWidget:()=>ai,convertWidgetTreeToWidgetWithWrapper:()=>di,createFormFieldData:()=>So,createPrototypeLocal:()=>Si,dispatchIdEvent:()=>$i,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUserDetails:()=>Po.s,getWidgetBulkFromId:()=>ci,getWidgetFromId:()=>si,handleServiceWorkerException:()=>qi,hasActivatedSW:()=>Fi,init:()=>Wi,orderTheConnections:()=>zn.X,recursiveFetch:()=>v.zN,recursiveFetchNew:()=>Ct,removeAllChildren:()=>Fo,renderLatestWidget:()=>ti,renderPage:()=>ei,renderWidget:()=>ni,searchLinkMultipleListener:()=>En,sendEmail:()=>lo,sendMessage:()=>Mi,serviceWorker:()=>Oi,setHasActivatedSW:()=>Pi,storeToDatabase:()=>te,subscribedListeners:()=>Gi,unwrapContainers:()=>pi,updateAccessToken:()=>Ui,uploadAttachment:()=>Ze,uploadFile:()=>tt,uploadImage:()=>Ke,uploadImageV2:()=>et,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye});var o={};n.r(o),n.d(o,{ADMIN:()=>Sn,ALLID:()=>In.BG,AccessTracker:()=>xe.J,AddGhostConcept:()=>Kt,Anomaly:()=>To,BaseUrl:()=>l.B,BinaryTree:()=>ke.W,BuildWidgetFromId:()=>Do.Cp,BuilderStatefulWidget:()=>yo,Composition:()=>Tt,CompositionBinaryTree:()=>gt,CompositionNode:()=>yt,Concept:()=>Jn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>Ee.d,CountInfo:()=>Uo.y,CreateComposition:()=>G.A,CreateConnection:()=>zt.d,CreateConnectionBetweenEntityLocal:()=>Go,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>vn.h,CreateData:()=>yi,CreateDefaultConcept:()=>M.o,CreateDefaultLConcept:()=>qt.u,CreateSession:()=>Pt,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>D.R,CreateTheCompositionWithCache:()=>It,CreateTheConnection:()=>ie.q,CreateTheConnectionGeneral:()=>H,CreateTheConnectionLocal:()=>zt.F,DATAID:()=>In.y0,DATAIDDATE:()=>In.iw,DATAV2:()=>In.pU,DelayFunctionExecution:()=>kn,DeleteConceptById:()=>Ne,DeleteConceptLocal:()=>mn,DeleteConnectionById:()=>q.m,DeleteConnectionByIdBulk:()=>q.E,DeleteConnectionByType:()=>Ao.$S,DeleteConnectionByTypeBulk:()=>Ao.L0,DeleteUser:()=>Le,DependencyObserver:()=>_n.w,FilterSearch:()=>eo,FormatFromConnections:()=>en.vw,FormatFromConnectionsAltered:()=>en.y8,FreeschemaQuery:()=>No,FreeschemaQueryApi:()=>bo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllTheConnectionsByTypeAndOfTheConcept:()=>Ao.WC,GetComposition:()=>v.Nj,GetCompositionBulk:()=>Ve.dF,GetCompositionBulkWithDataId:()=>Ve.cw,GetCompositionFromConnectionsWithDataId:()=>Ve.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>Ve.km,GetCompositionFromConnectionsWithDataIdInObject:()=>Ve.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>Ve.Nt,GetCompositionFromConnectionsWithIndex:()=>Ve.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>Ve.hG,GetCompositionFromMemoryWithConnections:()=>v.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>T,GetCompositionListAllWithId:()=>k,GetCompositionListListener:()=>Fn,GetCompositionListLocal:()=>O,GetCompositionListLocalWithId:()=>B,GetCompositionListWithId:()=>I,GetCompositionListWithIdUpdated:()=>S,GetCompositionListener:()=>Rn,GetCompositionLocal:()=>b,GetCompositionLocalWithId:()=>_,GetCompositionWithAllIds:()=>v.Mb,GetCompositionWithCache:()=>Ot,GetCompositionWithDataIdBulk:()=>Gt,GetCompositionWithDataIdWithCache:()=>Rt,GetCompositionWithId:()=>v.yz,GetCompositionWithIdAndDateFromMemory:()=>v.Ez,GetConceptBulk:()=>nt.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>ot.j,GetConnectionById:()=>De,GetConnectionDataPrefetch:()=>Ve.QL,GetConnectionOfTheConcept:()=>P,GetConnectionTypeForCount:()=>qn.V,GetFreeschemaImage:()=>xi,GetFreeschemaImageUrl:()=>Ei,GetImageApi:()=>bi,GetLink:()=>ce,GetLinkListListener:()=>Hn,GetLinkListener:()=>Un.d,GetLinkRaw:()=>ae,GetLinkerConnectionFromConcepts:()=>ge,GetLinkerConnectionToConcepts:()=>me,GetRelation:()=>$t,GetRelationLocal:()=>sn,GetRelationRaw:()=>Ht,GetTheConcept:()=>z.A,GetTheConceptLocal:()=>tn.f,GetUserGhostId:()=>Zt,JUSTDATA:()=>In.ZJ,LConcept:()=>Qn,LConnection:()=>Yn,LISTNORMAL:()=>In.SL,LocalConceptsData:()=>y.v,LocalSyncData:()=>Kn.H,LocalTransaction:()=>mo,Logger:()=>so.V,LoginToBackend:()=>rt,MakeTheInstanceConcept:()=>J.A,MakeTheInstanceConceptLocal:()=>K.k,MakeTheTimestamp:()=>We,MakeTheTypeConceptApi:()=>pe,MakeTheTypeConceptLocal:()=>le.$,NORMAL:()=>In.yv,PRIVATE:()=>An,PUBLIC:()=>Nn,PatcherStructure:()=>Xn,Prototype:()=>Ti,RAW:()=>In.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>Vn,SchemaQuery:()=>Oo,SchemaQueryListener:()=>Eo,SearchAllConcepts:()=>Lt,SearchLinkInternal:()=>fn,SearchLinkInternalAll:()=>yn,SearchLinkMultipleAll:()=>en.cf,SearchLinkMultipleAllObservable:()=>xn,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>Me,SearchStructure:()=>to,SearchWithLinker:()=>_t,SearchWithTypeAndLinker:()=>Pn.zl,SearchWithTypeAndLinkerApi:()=>bn,Selector:()=>Wo,SessionData:()=>Zn,Signin:()=>dt,Signup:()=>ct,SignupEntity:()=>at,SplitStrings:()=>c.f,StatefulWidget:()=>po,SyncData:()=>W.Y,TrashTheConcept:()=>_e,UpdateComposition:()=>At,UpdateCompositionLocal:()=>nn.D,UserBinaryTree:()=>Yt,Validator:()=>Io,ViewInternalData:()=>dn,ViewInternalDataApi:()=>an,WidgetTree:()=>Bo,convertFromConceptToLConcept:()=>un.F4,convertFromLConceptToConcept:()=>un.dp,convertWidgetTreeToWidget:()=>ai,convertWidgetTreeToWidgetWithWrapper:()=>di,createFormFieldData:()=>So,createPrototypeLocal:()=>Si,dispatchIdEvent:()=>$i,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUserDetails:()=>Po.s,getWidgetBulkFromId:()=>ci,getWidgetFromId:()=>si,handleServiceWorkerException:()=>qi,hasActivatedSW:()=>Fi,init:()=>Wi,orderTheConnections:()=>zn.X,recursiveFetch:()=>v.zN,recursiveFetchNew:()=>Ct,removeAllChildren:()=>Fo,renderLatestWidget:()=>ti,renderPage:()=>ei,renderWidget:()=>ni,searchLinkMultipleListener:()=>En,sendEmail:()=>lo,sendMessage:()=>Mi,serviceWorker:()=>Oi,setHasActivatedSW:()=>Pi,storeToDatabase:()=>te,subscribedListeners:()=>Gi,unwrapContainers:()=>pi,updateAccessToken:()=>Ui,uploadAttachment:()=>Ze,uploadFile:()=>tt,uploadImage:()=>Ke,uploadImageV2:()=>et,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye});var i=n(5020),r=n(205),s=n(2832),c=n(6467),a=n(3026),l=n(9581),d=n(3518),u=n(1863),h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function p(e,t){var n=arguments;return h(this,void 0,void 0,(function*(){const o=so.V.logfunction("GetAllConceptsByType",n);try{var i=new URLSearchParams;i.append("type",e),i.append("user_id",t.toString());var r=(0,d.Xr)("application/x-www-form-urlencoded");const n=yield fetch(l.B.GetAllConceptsByTypeUrl(),{method:"POST",headers:r,body:i});if(n.ok){const e=yield n.json();for(var s=0;s<e.length;s++)a.I.AddConcept(e[s])}else console.log("GetAllConceptsByType error",n.status),(0,u.ry)(n)}catch(e){e instanceof Error?console.log("GetAllConceptsByType error message: ",e.message):console.log("GetAllConceptsByType unexpected error: ",e),(0,u.Mb)(e,l.B.GetAllConceptsByTypeUrl()),(0,u.ey)(o,"GetAllConceptsByType",e)}}))}var f=n(8642),y=n(9736),v=n(8939),g=n(2013),m=n(8064),C=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function w(e,t){var n=arguments;return C(this,arguments,void 0,(function*(e,t,o=10,i=1){const r=so.V.logfunction("GetCompositionList",n)||{};if(Oi){r.serviceWorker=!0;try{const n=yield Mi("GetCompositionList",{compositionName:e,userId:t,inpage:o,page:i});return so.V.logUpdate(r),n.data}catch(e){console.error("GetCompositionList sw error: ",e),(0,u.ey)(r,"GetCompositionList",e),qi(e)}}let s=yield(0,g.A)(e),c=[];if(s){yield p(e,t);let n=yield a.I.GetConceptsByTypeIdAndUser(s.id,t),r=o*(i-1),l=[];for(let e=r;e<r+o;e++)n[e]&&l.push(n[e].id);yield(0,f.Y)(l);for(let e=r;e<r+o;e++)if(n[e]){let t=yield(0,v.kx)(n[e].id);c.push(t)}}return so.V.logUpdate(r),c}))}function T(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){let i=O(e,t),r=w(e,t),s=[];return Promise.race([i,r]).then((e=>{console.log("Promise result",e),s.push(...e)})).catch((e=>{console.log("error in handling",e)})),r.then((e=>{console.log("This is the second promise result",e),s.push(...e)})),s}))}function k(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){if(Oi)try{return(yield Mi("GetCompositionListAllWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListAllWithId sw error: ",e),qi(e)}let i=yield(0,m.Ay)(e),r=yield(0,g.A)(e),s=[],c=[],l=[],d=[];0!=i.id&&(c=yield y.v.GetConceptsByTypeIdAndUser(i.id,t)),0!=r.id&&(yield p(e,t),d=yield a.I.GetConceptsByTypeIdAndUser(r.id,t),s=d);for(let e=0;e<c.length;e++){let t=!1;for(let n=0;n<d.length;n++)c[e].ghostId==d[n].ghostId&&(t=!0);t||l.push(c[e])}console.log("This is the all list",l);let u=[];return u=yield function(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){let i=[],r=n*(o-1),s=[],c=t.length;for(let t=r;t<r+n-c;t++)e[t]&&s.push(e[t].id);for(let e=0;e<t.length;e++){let n=yield _(t[e].id);i.push(n)}yield(0,f.Y)(s);for(let t=r;t<r+n-c;t++)if(e[t]){let n=yield(0,v.RW)(e[t].id);i.push(n)}return i}))}(s,l,n,o),u}))}function I(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){if(Oi)try{return(yield Mi("GetCompositionListWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListWithId sw error: ",e),qi(e)}let i=yield(0,g.A)(e),r=[];if(i){yield p(e,t);let s=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),c=n*(o-1),l=[];for(let e=c;e<c+n;e++)s[e]&&l.push(s[e].id);yield(0,f.Y)(l);for(let e=c;e<c+n;e++)if(s[e]){let t=yield(0,v.RW)(s[e].id);r.push(t)}}return r}))}function S(e,t){return C(this,arguments,void 0,(function*(e,t,n=10,o=1){let i=yield(0,g.w)(e),r=[];if(i){yield p(e,t);let s=yield a.I.GetConceptsByTypeIdAndUser(i.id,t),c=n*(o-1),l=[];for(let e=c;e<c+n;e++)s[e]&&l.push(s[e].id);yield(0,f.Y)(l);for(let e=c;e<c+n;e++)if(s[e]){let t=yield(0,v.RW)(s[e].id);r.push(t)}}return r}))}var A=n(4864),N=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},L=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function b(e){return L(this,void 0,void 0,(function*(){var t,n;try{if(Oi)try{return(yield Mi("GetCompositionLocal",{id:e})).data}catch(e){console.error("GetCompositionLocal error sw: ",e),qi(e)}let o=[],i={};o=yield A.G.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 y.v.GetConcept(e);if(0==s.id){let t=yield function(e){var t=arguments;return N(this,void 0,void 0,(function*(){const n=so.V.logfunction("TranslateLocalToReal",t);let o=(0,M.o)();try{var i=(0,d.ab)("application/x-www-form-urlencoded");const t=yield fetch(l.B.GetRealConceptById(),{method:"POST",headers:i,body:`id=${e}`});if(t.ok)return o=yield t.json(),o.id>0&&a.I.AddConcept(o),o;console.log("Error in Getting Translating concept Error",t.status),(0,u.ry)(t),so.V.logUpdate(n)}catch(e){e instanceof Error?console.log("Error in Getting Translating concept error message: ",e):console.log("Error in Getting Translating concept unexpected error: ",e),(0,u.Mb)(e,l.B.GetRealConceptById()),(0,u.ey)(n,"TranslateLocalToReal",e)}return o}))}(e);if(t.id>0)return yield(0,v.Nj)(t.id)}let c=yield x(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:"top"]=c,i}catch(e){throw e}}))}function _(e){return L(this,void 0,void 0,(function*(){var t,n;try{if(Oi)try{return(yield Mi("GetCompositionLocalWithId",{id:e})).data}catch(e){console.error("GetCompositionLocalWithId error sw: ",e),qi(e)}let o=[],i={},r={};o=yield A.G.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 y.v.GetConcept(e);if(0!=c.id){let r=yield x(e,o,s);i[null!==(n=null===(t=null==c?void 0:c.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 x(e,t,n){return L(this,arguments,void 0,(function*(e,t,n,o=[]){var i,r,s;let c={},a=[],l=yield y.v.GetConcept(e);if(0!=l.id&&null==l.type){let e=l.typeId,t=yield y.v.GetConcept(e);l.type=t}if(null===(i=null==l?void 0:l.type)||void 0===i?void 0:i.characterValue,!n.includes(e))return null==l?void 0:l.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 y.v.GetConcept(e);if(0!=i.id&&null==(null==i?void 0:i.type)){let e=i.typeId,t=yield y.v.GetConcept(e);i.type=t}let l="the_",d=(null!==(s=null===(r=null==i?void 0:i.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"top").replace(l,"");if(isNaN(Number(d))){if(d){const o=yield x(e,t,n);c[d]=o}}else{const o=yield x(e,t,n);a[d]=o,c=a}}return c}))}var E=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function O(e,t){return E(this,void 0,void 0,(function*(){if(Oi)try{return(yield Mi("GetCompositionListLocal",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocal error sw: ",e),qi(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield y.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield b(e[t].id);o.push(n)}}return o}catch(e){throw e}}))}function B(e,t){return E(this,void 0,void 0,(function*(){if(Oi)try{return(yield Mi("GetCompositionListLocalWithId",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocalWithId error sw: ",e),qi(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield y.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield _(e[t].id);o.push(n)}}return o}catch(e){throw e}}))}var R=n(2),G=n(1218),D=n(999),F=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function P(e,t,n){var o=arguments;return F(this,arguments,void 0,(function*(e,t,n,i=10,r=1){const s=so.V.logfunction("GetConnectionOfTheConcept",o)||{};let c=[];try{if(Oi){s.serviceWorker=!0;try{const o=yield Mi("GetConnectionOfTheConcept",{typeId:e,ofTheConceptId:t,userId:n,inpage:i,page:r});return so.V.logUpdate(s),o.data}catch(e){console.error("GetConnectionOfTheConcept sw error: ",e),(0,u.ey)(s,"GetConnectionOfTheConcept",e),qi(e)}}let o=new URLSearchParams;o.append("typeId",`${e}`),o.append("ofTheConceptId",`${t}`),o.append("userId",`${n}`),o.append("inpage",`${i}`),o.append("page",`${r}`);let a=(0,d.Xr)("application/x-www-form-urlencoded");const h=yield fetch(l.B.GetAllConnectionsOfConceptUrl(),{method:"POST",headers:a,body:o});return h.ok?c=yield h.json():((0,u.ey)(s,"GetConnectionOfTheConcept",h.status),(0,u.ry)(h),console.log("Get connection of concept error",h.status)),so.V.logUpdate(s),c}catch(e){e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),(0,u.Mb)(e,l.B.GetAllConnectionsOfConceptUrl()),(0,u.ey)(s,"GetConnectionOfTheConcept",e)}}))}var U=n(2155),W=n(442),M=n(7282),V=n(5976),j=n(7273),$=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function H(e,t,n,o){return $(this,arguments,void 0,(function*(e,t,n,o,i=1,r=4){if(e>0&&n>0){var s=t,c=yield V.p.getId(),a=new U.N(c,e,n,s,o,i,r);return e==n?(a.ofTheConceptId=0,a.toTheConceptId=1,a):(a.toUpdate=!0,a.isTemp=!1,W.Y.AddConnection(a),a)}throw new j.z("cannot create connection because id are negative ",!1,400,"")}))}var q=n(4818),z=n(7876),J=n(8407),Q=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Y(e,t,n){return Q(this,arguments,void 0,(function*(e,t,n,o=!1,i=!1){var r,s;if(Oi)try{return(yield Mi("CreateConnectionBetweenTwoConcepts",{ofTheConcept:e,toTheConcept:t,linker:n,both:o,count:i})).data}catch(e){console.error("CreateConnectionBetweenTwoConcepts sw error: ",e),qi(e)}let c=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,c));let a=yield(0,J.A)("connection",s,!1,999,999,999),l=new U.N(0,t.id,e.id,c,a.id,1e3,4);W.Y.AddConnection(l)}let a=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s_"+a;i&&(yield X(a,e,c));let d=yield(0,J.A)("connection",l,!1,999,999,999),u=new U.N(0,e.id,t.id,c,d.id,1e3,4);return W.Y.AddConnection(u),u}))}function X(e,t){return Q(this,arguments,void 0,(function*(e,t,n=null){var o;let i=t,r=null!=n?n:t.userId,s=e+"_count",c=(null===(o=t.type)||void 0===o?void 0:o.characterValue)+"_s_"+s,a=yield(0,J.A)("connection",c,!1,r,4,999),l=yield P(a.id,t.id,r,10,1),d=[],u=(0,M.o)();for(let e=0;e<l.length;e++){let t=yield(0,z.A)(l[e].toTheConceptId);d.push(t)}if(d.length<1)u=yield(0,J.A)("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(0,J.A)("count",t.toString(),!1,r,4,999);for(let e=0;e<l.length;e++)(0,q.m)(l[e].id)}let h=new U.N(0,i.id,u.id,i.userId,a.id,1e3,4);yield W.Y.AddConnection(h)}))}function Z(e,t,n){return Q(this,arguments,void 0,(function*(e,t,n,o=!1,i=!1){var r,s;let c=e.userId;if(o){let o=n+"_by",s=(null===(r=t.type)||void 0===r?void 0:r.characterValue)+"_s_"+o;i&&(yield X(o,t,c));let a=yield(0,J.A)("connection",s,!1,999,999,999),l=new U.N(0,t.id,e.id,c,a.id,1e3,4);W.Y.AddConnection(l)}let a=n+"_s",l=(null===(s=e.type)||void 0===s?void 0:s.characterValue)+"_s_"+a;i&&(yield X(a,e,c));let d=yield(0,J.A)("connection",l,!1,999,999,999);return yield H(e.id,e.userId,t.id,d.id,1e3,4)}))}var K=n(5868),ee=(n(3655),function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))});function te(e,t){const n=so.V.logfunction("storeToDatabase",[e,"noindexdb"]);so.V.logUpdate(n)}function ne(e,t,n){return ee(this,void 0,void 0,(function*(){const t=so.V.logfunction("getFromDatabaseWithType",[e,"noindexdb"]);so.V.logUpdate(t)}))}function oe(e){return ee(this,void 0,void 0,(function*(){const t=so.V.logfunction("getObjectsFromIndexDb",[e,"noindexdb"]);so.V.logUpdate(t)}))}var ie=n(1666),re=n(4402),se=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function ce(e,t){var n=arguments;return se(this,arguments,void 0,(function*(e,t,o=10,i=1){var r;const s=so.V.logfunction("GetLink",n)||{};if(Oi){s.serviceWorker=!0;try{const n=yield Mi("GetLink",{id:e,linker:t,inpage:o,page:i});return so.V.logUpdate(s),n.data}catch(e){console.error("GetLink sw error: ",e),(0,u.ey)(s,"GetLink",e),qi(e)}}let c=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield P(d.id,a.id,a.userId,o,i),t=[];for(let n=0;n<e.length;n++)t.push(e[n].toTheConceptId);yield(0,f.Y)(t);for(let t=0;t<e.length;t++){let n=e[t].toTheConceptId,o=yield(0,z.A)(n),i=yield(0,v.Ez)(o.id);c.push(i)}}return so.V.logUpdate(s),c}))}function ae(e,t){var n=arguments;return se(this,arguments,void 0,(function*(e,t,o=10,i=1){var r;const s=so.V.logfunction("GetLinkRaw",n);let c=[],a=yield(0,z.A)(e),l=(null===(r=a.type)||void 0===r?void 0:r.characterValue)+"_s_"+t,d=yield(0,re.A)(l,16);if(d.id>0){let e=yield P(d.id,a.id,a.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(0,z.A)(n);c.push(o)}}return so.V.logUpdate(s),c}))}var le=n(8357),de=n(1708),ue=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};const he=new Map;function pe(e,t){var n=arguments;return ue(this,void 0,void 0,(function*(){const t=so.V.logfunction("MakeTheTypeConceptApi",n);let o=(0,M.o)();if(he.has(e))return he.get(e)||o;const i=(()=>ue(this,void 0,void 0,(function*(){try{if(o=yield(0,de.Az)(e),0==o.id||4==o.typeId){let n=(0,d.Xr)("application/x-www-form-urlencoded");const i=yield fetch(l.B.MakeTheTypeConceptUrl(),{method:"POST",headers:n,body:`type=${e}`});if(!i.ok)throw(0,u.ry)(i),new Error(`Error! status: ${i.status}`);let r=yield i.json();o=r,so.V.logUpdate(t)}}catch(e){e instanceof Error?console.log("Make The Type Concept Api error : ",e.message):console.log("Make The Type Concept Api error : ",e),(0,u.Mb)(e,l.B.MakeTheTypeConceptUrl()),(0,u.ey)(t,"MakeTheTypeConceptApi",e)}finally{he.delete(e)}return o})))();return he.set(e,i),i}))}var fe=n(8675),ye=n(6058),ve=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function ge(e){var t=arguments;return ve(this,void 0,void 0,(function*(){const n=so.V.logfunction("GetLinkerConnectionFromConcepts",t);let o=yield(0,fe.l)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return so.V.logUpdate(n),o}))}function me(e){var t=arguments;return ve(this,void 0,void 0,(function*(){const n=so.V.logfunction("GetLinkerConnectionToConcepts",t);let o=yield(0,ye.W)(e);for(let e=0;e<o.length;e++){let t=o[e],n=t.typeId,i=yield(0,z.A)(n);t.type=i}return so.V.logUpdate(n),o}))}var Ce=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},we=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},Te=n(6963),ke=n(2202),Ie=n(5457),Se=n(991),Ae=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Ne(e){var t=arguments;return Ae(this,void 0,void 0,(function*(){const n=so.V.logfunction("DeleteConceptById",t);if(Oi)try{return(yield Mi("DeleteConceptById",{id:e})).data}catch(e){console.error("DeleteConceptById sw error: ",e),qi(e)}if(e>0){var o=yield a.I.GetConcept(e);if(o.id>0){var i=o.typeId,r=o.characterValue;yield Ie.c.removeTypeConcept(i,e),yield Te.f.removeNodeByCharacter(r,e),yield function(e){var t=arguments;return we(this,void 0,void 0,(function*(){let n=!1;const o=so.V.logfunction("DeleteTheConcept",t);try{const t=new FormData;t.append("id",e.toString());let i=(0,d.BZ)();const r=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",headers:i,body:t});r.ok?n=(yield r.json()).success:(console.log("Delete concept error",r.status),(0,u.ry)(r)),n&&a.I.AddNpc(e),so.V.logUpdate(o)}catch(e){e instanceof Error?console.log("Delete concept error message: ",e.message):console.log("Delete concept unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl()),(0,u.ey)(o,"DeleteTheConcept",e)}return n}))}(e),yield ke.W.removeNodeFromTree(e),yield Se.H.removeNodeFromTree(e)}}else y.v.RemoveConceptById(e);so.V.logUpdate(n)}))}function Le(e){return Ae(this,void 0,void 0,(function*(){if(Oi)try{return(yield Mi("DeleteUser",{id:e})).data}catch(e){console.error("DeleteUser sw error: ",e),qi(e)}e>0?function(e){var t=arguments;Ce(this,void 0,void 0,(function*(){const n=so.V.logfunction("DeleteUserInBackend",t);try{var o=(0,d.ab)("application/json","");let t=l.B.DeleteUserUrl();t=t+"?conceptId="+e+"&apiKey=freeschema";const i=yield fetch(t,{method:"POST",headers:o});if(i.ok){let e=yield i.json(),t=Number(e.data);return console.log("this is the delete email concept",t),Ne(t),so.V.logUpdate(n),t}throw(0,u.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl()),(0,u.ey)(n,"DeleteUserInBackend",e)}}))}(e):y.v.RemoveConceptById(e)}))}var be=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function _e(e,t){return be(this,void 0,void 0,(function*(){try{const n=new Headers;n.append("Authorization","Bearer "+t);const o=new FormData;o.append("id",e.toString());const i=yield fetch(l.B.DeleteConceptUrl(),{method:"POST",body:o,headers:n});if(!i.ok)throw(0,u.ry)(i),new Error(`Delete composition Error! status: ${i.status}`)}catch(e){e instanceof Error?console.log("Delete composition error message: ",e.message):console.log("Delete composition unexpected error: ",e),(0,u.Mb)(e,l.B.DeleteConceptUrl())}}))}var xe=n(1735),Ee=n(8286),Oe=n(1596),Be=n(3278),Re=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};var Ge=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function De(e){var t=arguments;return Ge(this,void 0,void 0,(function*(){const n=so.V.logfunction("GetConnectionById",t);if(console.log("AccessTracker activation status from GetConnectionById"),!0===xe.J.activateStatus)try{xe.J.incrementConnection(e)}catch(e){console.error("Error adding connection in access tracker"),so.V.log("ERROR","Error Adding Connection")}if(Oi)try{return(yield Mi("GetConnectionById",{id:e})).data}catch(e){console.error("GetConnectionById sw error: ",e),qi(e)}let o=yield Ee.d.GetConnection(e);return null!=o&&0!=o.id||null==e||null==e||(o=yield function(e){var t=arguments;return Re(this,void 0,void 0,(function*(){const n=so.V.logfunction("GetConnection",t);let o=yield Ee.d.GetConnection(e);try{if(0!=o.id)return o;{const t=new FormData;t.append("id",e.toString());const i={method:"POST",headers:{Authorization:"Bearer "+Be.b.BearerAccessToken},body:t};let r;try{r=yield fetch(l.B.GetConnectionUrl(),i)}catch(e){r=yield(0,Oe.g)(i,"/api/get-connection-by-id")}return yield function(e,t){return Re(this,void 0,void 0,(function*(){e.ok?(t=yield e.json(),Ee.d.AddConnection(t)):((0,u.ry)(e),console.log("Get Connection Error",e.status))}))}(r,o),so.V.logUpdate(n),o}}catch(e){e instanceof Error?console.log("Get Connection error message: ",e.message):console.log("Get Connection unexpected error: ",e),(0,u.Mb)(e,l.B.GetConnectionUrl()),(0,u.ey)(n,"GetConnection",e)}}))}(e)),so.V.logUpdate(n),o}))}var Fe=n(2212),Pe=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},Ue=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function We(e,t,n){return Ue(this,arguments,void 0,(function*(e,t,n,o=4,i=999){const r=so.V.logfunction("MakeTheTimestamp")||{};if(Oi){r.serviceWorker=!0;try{const s=yield Mi("MakeTheTimestamp",{type:e,referent:t,userId:n,accessId:o,sessionInformationId:i});return so.V.logUpdate(r),s.data}catch(e){console.error("MakeTheTimestamp sw error: ",e),(0,u.ey)(r,"MakeTheTimestamp",e),qi(e)}}let s,c="",a=e.startsWith("the_"),l=(0,M.o)();c=a?e:"the_"+e,l=yield pe(c,n);let d=yield function(e,t,n,o,i,r,s){return Pe(this,void 0,void 0,(function*(){let n=yield(0,re.A)(e,o),i=n;return 0==i.id&&(n=yield(0,Fe.Ay)(e,t,4,o,0,r,s),i=n),i}))}(t,n,0,l.id,0,o,c);return s=d,so.V.logUpdate(r),s}))}class Me{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 Ve=n(6687),je=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function $e(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o="",i=[]){const r=so.V.logfunction("RecursiveSearchApi",e)||{};let s=[];try{if(Oi){r.serviceWorker=!0;try{const e=yield Mi("RecursiveSearchApi",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return so.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApi sw error: ",e),(0,u.ey)(r,"RecursiveSearchApi",e),qi(e)}}let e=new Me;e.composition=t,e.listLinkers=n,e.fullLinkers=i,e.textSearch=o;let c=JSON.stringify(e),a=(0,d.Xr)();const h=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:a,body:c});if(h.ok){const e=yield h.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,s=yield(0,Ve.p8)(t,n)}else console.log("recursive search error ",h.status),(0,u.ey)(r,"RecursiveSearchApi",h.status),(0,u.ry)(h);so.V.logUpdate(r)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(r,"RecursiveSearchApi",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}return s}))}function He(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o=""){const i=so.V.logfunction("RecursiveSearchApiWithInternalConnections",e)||{};let r=[];try{if(Oi){i.serviceWorker=!0;try{const e=yield Mi("RecursiveSearchApiWithInternalConnections",{composition:t,listLinkers:n,textSearch:o});return so.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiWithInternalConnections sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiWithInternalConnections",e),qi(e)}}let e=new Me;e.composition=t,e.listLinkers=n,e.textSearch=o;let s=JSON.stringify(e),c=(0,d.Xr)();const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(a.ok){const e=yield a.json();let t=e.compositionIds,n=e.internalConnections;e.externalConnections,r=yield(0,Ve.km)(t,n),so.V.logUpdate(i)}else console.log("recursive search error ",a.status),(0,u.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",a.status),(0,u.ry)(a)}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(i,"GetCompositionConnectionsBetweenTwoConcepts",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}return r}))}function qe(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o="",i=[]){const r=so.V.logfunction("RecursiveSearchApiRaw",e)||{};try{if(Oi){r.serviceWorker=!0;try{const e=yield Mi("RecursiveSearchApiRaw",{composition:t,listLinkers:n,textSearch:o,fullLinkers:i});return so.V.logUpdate(r),e.data}catch(e){console.error("RecursiveSearchApiRaw sw error: ",e),(0,u.ey)(r,"RecursiveSearchApiRaw",e),qi(e)}}let e=new Me;e.composition=t,e.listLinkers=n,e.textSearch=o,e.fullLinkers=i;let s=JSON.stringify(e),c=(0,d.Xr)();const a=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:c,body:s});if(a.ok){const e=yield a.json();return e.compositionIds,e.internalConnections,e.externalConnections,so.V.logUpdate(r),e}return console.log("recursive search error ",a.status),(0,u.ey)(r,"RecursiveSearchApiRaw",a.status),(0,u.ry)(a),so.V.logUpdate(r),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.ey)(r,"RecursiveSearchApiRaw",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl())}}))}function ze(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o=""){const i=so.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Oi){i.serviceWorker=!0;try{const e=yield Mi("RecursiveSearchApiRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return so.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiRawFullLinker sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",e),qi(e)}}let e=new Me;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)();const c=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:r});if(c.ok){const e=yield c.json();return e.compositionIds,e.internalConnections,e.externalConnections,so.V.logUpdate(i),e}return console.log("recursive search error ",c.status),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",c.status),(0,u.ry)(c),so.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl()),(0,u.ey)(i,"RecursiveSearchApiRawFullLinker",e)}}))}function Je(){var e=arguments;return je(this,arguments,void 0,(function*(t=0,n=[],o=""){const i=so.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Oi)try{i.serviceWorker=!0;const e=yield Mi("RecursiveSearchApiNewRawFullLinker",{composition:t,fullLinkers:n,textSearch:o});return so.V.logUpdate(i),e.data}catch(e){console.error("RecursiveSearchApiNewRawFullLinker sw error: ",e),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",e),qi(e)}let e=new Me;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)();const c=yield fetch(l.B.RecursiveSearchUrl(),{method:"POST",headers:s,body:r});if(c.ok){const e=yield c.json();return e.compositionIds,e.internalConnections,e.externalConnections,so.V.logUpdate(i),e}return console.log("recursive search error ",c.status),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",c.status),(0,u.ry)(c),so.V.logUpdate(i),[]}catch(e){e instanceof Error?console.log("recursive search error message: ",e.message):console.log("recursive search unexpected error: ",e),(0,u.Mb)(e,l.B.RecursiveSearchUrl()),(0,u.ey)(i,"RecursiveSearchApiNewRawFullLinker",e)}}))}var Qe=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};const Ye=["image/jpeg","image/jpg","image/png","image/webp"],Xe=["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","text/plain","application/pdf"];function Ze(e,t){return Qe(this,void 0,void 0,(function*(){const n=so.V.logfunction("uploadAttachment");try{console.log("File Type",e.type);const o=new FormData;let i;if(Xe.includes(e.type))o.append("file",e,e.name),i=yield tt(o,t);else{if(!Ye.includes(e.type))return{message:"Invalid File Format",success:!1};o.append("image",e,e.name),i=yield Ke(o,t)}return(null==i?void 0:i.data)?(so.V.logUpdate(n),{message:"Upload Success",success:!0,url:i.data}):{message:"File Upload Failed",success:!1}}catch(e){throw console.error(e),(0,u.ey)(n,"uploadAttachment",e),e}}))}function Ke(e){return Qe(this,arguments,void 0,(function*(e,t=""){const n=so.V.logfunction("uploadImage");try{const o=yield fetch(l.B.uploadImageUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(null==o?void 0:o.text());const t=yield null==o?void 0:o.text();return console.error(`${o.status} ${t}`),so.V.logUpdate(n),null}return yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadImage",e),null}}))}function et(e){return Qe(this,arguments,void 0,(function*(e,t=""){const n=so.V.logfunction("uploadImageV2");try{const o=yield fetch(l.B.uploadImageUrlWithSmall(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(null==o?void 0:o.text());const t=yield null==o?void 0:o.text();return console.error(`${o.status} ${t}`),so.V.logUpdate(n),null}return yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadImageV2",e),null}}))}function tt(e){return Qe(this,arguments,void 0,(function*(e,t=""){const n=so.V.logfunction("uploadFile");try{const o=yield fetch(l.B.uploadFileUrl(),{method:"POST",body:e,headers:{Authorization:`Bearer ${t}`}});if(!o.ok){const e=o.headers.get("content-type");e&&e.includes("text/plain")&&console.info(o.text());const t=yield o.text();return console.error(`${o.status} ${t}`),null}return so.V.logUpdate(n),yield o.json()}catch(e){return console.error(e),(0,u.ey)(n,"uploadFile",e),null}}))}var nt=n(1239),ot=n(7467),it=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function rt(e,t){var n=arguments;return it(this,arguments,void 0,(function*(e,t,o="boomconsole.com"){const i=so.V.logfunction("LoginToBackend",n);try{let n={email:e,password:t,application:o},r=new Headers;r.append("Content-Type","application/json");let s=JSON.stringify(n);const c=yield fetch(l.B.LoginUrl(),{method:"POST",headers:r,body:s}),a=yield c.json();if(c.ok)return Be.b.BearerAccessToken=a.data.token,so.V.logUpdate(i),a;console.log("Login tsccs error message: ",c.status),(0,u.ER)(c,a)}catch(e){e instanceof Error?console.log("Login tsccs error message: ",e.message):console.log(" Login tsccs unexpected error: ",e),(0,u.Mb)(e,l.B.LoginUrl()),(0,u.ey)(i,"LoginToBackend",e)}}))}var st=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function ct(e){return st(this,void 0,void 0,(function*(){const t=yield function(){return st(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}:(0,u.ER)(o,i),n}catch(t){console.log("Signup Error: ",t),(0,u.Mb)(t,e)}}))}(l.B.SignupUrl(),e);return t}))}function at(e){return st(this,void 0,void 0,(function*(){const t=l.B.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");throw new Error(n.status)}))}var lt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function dt(e){return lt(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=l.B.LoginUrl();try{const e=yield fetch(i,{method:"POST",headers:o,body:t,redirect:"follow"}),r=yield e.json();return e.ok?n={message:"success",status:!0,statusCode:200,data:null==r?void 0:r.data}:(0,u.ER)(e,r),n}catch(e){console.log("Sign in api error",e),(0,u.Mb)(e,i)}}))}var ut=n(9934),ht=n(4485);function pt(e=[],t){Array.isArray(e)&&e.splice(e.findIndex((function(e){return e.id===t.id})),1)}function ft(e=[],t){Array.isArray(e)&&e.splice(e.findIndex((function(e){return e.id===t.id})),1)}class yt{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&&(gt.removeNodeFromTree(this.key),1))}saveToCache(e){this.value.cached=e}addNode(e,t,n){if(null==t)return 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(),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 vt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class gt{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 yt(e.id,e,null,null);this.addNodeToTree(t)}static getNodeFromTree(e){return vt(this,void 0,void 0,(function*(){return this.root?this.root.getFromNode(e,this.root):null}))}static removeNodeFromTree(e){return vt(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}}gt.root=null;var mt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Ct(e,t,n,o){return mt(this,arguments,void 0,(function*(e,t,n,o,i=[]){var r,s;let c={};const l=[];if(0==e)return"";let d=wt(n,e);if(null!=d&&0!=d.id||null==e||null==e||(d=yield(0,z.A)(e)),0!=d.id&&null==d.type){const e=d.typeId;let t=wt(n,e);d.type=t,null==t&&null!=e&&null!=e&&(t=yield(0,z.A)(e),d.type=t)}if(!o.includes(e))return null==d?void 0:d.characterValue;if(i.includes(e))return"";i.push(e);for(let d=0;d<t.length;d++)if(t[d].ofTheConceptId==e){const u=t[d].toTheConceptId;if(o.includes(e)){let e=wt(n,u);if(null!=e&&0!=e.id||null==u||null==u||(e=yield(0,z.A)(u)),0!=e.id&&null==(null==e?void 0:e.type)){const t=e.typeId;let n=yield a.I.GetConcept(t);e.type=n,null==n&&null!=t&&null!=t&&(n=yield(0,z.A)(t),e.type=n)}const d="the_",h=(null!==(s=null===(r=null==e?void 0:e.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"").replace(d,"");if(isNaN(Number(h))){if(h){const e=yield Ct(u,t,n,o,i);c[h]=e}}else{const e=yield Ct(u,t,n,o,i);l[h]=e,c=l}}}return c}))}function wt(e,t){let n=(0,M.o)();for(let o=0;o<e.length;o++)if(t==e[o].id)return n=e[o],n;return n}class Tt{constructor(){this.id=0,this.mainConcept=(0,M.o)(),this.connections=[],this.concepts=[],this.subcompositions=[],this.cached={}}updateCache(){return e=this,t=void 0,o=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 Ct(this.id,this.connections,this.concepts,this.subcompositions,[])},new((n=void 0)||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}));var e,t,n,o}UpdateAcrossDistributedSystem(){var e,t;try{0!=this.id&&(t=null===(e=this.id)||void 0===e?void 0:e.toString(),l.B.MQTT_CONNECTION&&l.B.MQTT_CONNECTION.publish("compositionUpdate",t))}catch(e){console.log("Error while publishing message",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 kt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function It(e){return kt(this,arguments,void 0,(function*(e,t=null,n=null,o=null,i=null,r=null,s=null,c=null){const a=null!=i?i:999,l=null!=r?r:4,d=null!=s?s:999;let u=null!=o?o:0,h=(0,M.o)();null==c&&(c=new Tt);for(const o in e)if("object"==typeof e[o]||Array.isArray(e[o])){const p=yield(0,J.A)(o,"",!0,a,l,d);if(null==t&&null==n){let t=u;h=p,t=p.id,u=p.id,c.concepts.push(p),c.id=p.id,yield It(e[o],p.id,p.userId,t,i,r,s,c)}else{const a=null!=t?t:999,l=null!=n?n:999,d=u;h=p,c.concepts.push(p);const f=yield(0,ie.q)(a,l,p.id,d);c.connections.push(f),yield It(e[o],p.id,p.userId,d,i,r,s,c)}null!=e[o]&&null!=e[o]&&c.subcompositions.push(p.id)}else{const i=null!=t?t:999,r=null!=n?n:999,s=u,h=yield(0,J.A)(o,e[o],!1,a,l,d);c.concepts.push(h);const p=yield(0,ie.q)(i,r,h.id,s);c.connections.push(p)}return h}))}var St=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function At(e){return St(this,void 0,void 0,(function*(){const t=so.V.logfunction("UpdateComposition")||{};if(Oi){t.serviceWorker=!0;try{const n=yield Mi("UpdateComposition",{patcherStructure:e});return so.V.logUpdate(t),n.data}catch(e){console.error("UpdateComposition sw error: ",e),(0,u.ey)(t,"UpdateComposition",e),qi(e)}}const n=e.userId,o=e.sessionId,i=e.accessId;let r=[];const s=[];let c=(0,M.o)(),a=(0,M.o)();const l=[];let d=e.compositionId;const h=e.ofTheCompositionId;let p=[];if(d<0){let e=yield(0,z.A)(d,n);if(!(e.id>0))return null;d=e.id}r=yield(0,R.s)(d);const f=[],y=new Tt,v=[];y.id=d,y.isUpdating();let g=[];for(let e=0;e<r.length;e++)(0,ut.A)(v,r[e].ofTheConceptId),(0,ut.A)(f,r[e].ofTheConceptId),(0,ut.A)(f,r[e].toTheConceptId),g.push(r[e].ofTheConceptId);y.subcompositions=v,y.connections=r;for(let e=0;e<f.length;e++){const t=yield(0,z.A)(f[e]);d==f[e]&&(c=t),h==f[e]&&(a=t),s.push(t)}const m=e.patchObject;for(const e in m){let t=(0,M.o)();const r=m[e];let d=c;if(a.id>0&&(d=a),Array.isArray(r)||"object"==typeof r){t=yield(0,J.A)(e,"",!0,c.userId,4,999),y.subcompositions.push(t.id);const n=(0,ht.vo)(s,t);for(let e=0;e<n.length;e++)if(n[e].id>0){const t=(0,ht.wS)(y.connections,n[e].id);p=p.concat(t),l.push(n[e])}yield It(m[e],t.id,t.userId,c.id,c.userId,4,999,y)}else{t=yield(0,J.A)(e,r,!1,n,i,o);const c=(0,ht.vo)(s,t);for(let e=0;e<c.length;e++)if(c[e].id>0){const t=(0,ht.wS)(y.connections,c[e].id);p=p.concat(t),l.push(c[e])}}const u=(0,ie.q)(d.id,d.userId,t.id,c.id);s.push(t),y.connections.push(u)}for(let e=0;e<p.length;e++)ft(y.connections,p[e]),(0,q.m)(p[e].id);for(let e=0;e<l.length;e++)pt(s,l[e]);y.concepts=y.concepts.concat(s),y.mainConcept=c,y.id=c.id,yield y.updateCache(),gt.addCompositionToTree(y),W.Y.SyncDataOnline();let C=y.GetDataCache();return so.V.logUpdate(t),C}))}var Nt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Lt(e,t,n,o){return Nt(this,arguments,void 0,(function*(e,t,n,o,i=10,r=1){var s=(0,d.ab)("application/x-www-form-urlencoded",o),c=new URLSearchParams;c.append("type",e),c.append("search",t),c.append("composition",n),c.append("inpage",i.toString()),c.append("page",r.toString());const a=l.B.SearchCompositionsUrl()+"?"+c.toString();try{const e=yield fetch(a,{method:"GET",headers:s});return e.ok?yield e.json():((0,u.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,u.Mb)(e,a)}}))}var bt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function _t(e){return bt(this,arguments,void 0,(function*(e,t=""){var n=(0,d.ab)("application/json",t);const o=l.B.SearchLinkMultipleAll(),i=JSON.stringify(e);try{const e=yield fetch(o,{method:"POST",headers:n,body:i});return e.ok?yield e.json():(console.log("This is the searching error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching error",e),(0,u.Mb)(e,o)}}))}var xt=n(7139),Et=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Ot(e){return Et(this,arguments,void 0,(function*(e,t=[]){var n,o;let i=[];const r=[];let s={},c={};const l=yield gt.getNodeFromTree(e),d=[];let u=yield a.I.GetConcept(e);if(0==u.id&&null!=e&&null!=e&&(u=yield(0,xt.r)(e)),null==l){let a=[];a=t.length>0?Bt(e,t):yield(0,R.s)(e),i=a;for(let e=0;e<i.length;e++)d.includes(i[e].ofTheConceptId)||(d.push(i[e].ofTheConceptId),r.push(i[e].ofTheConceptId)),r.includes(i[e].toTheConceptId)||r.push(i[e].toTheConceptId);Dt(u,i,r,d);let l=[];c=yield(0,v.zN)(e,i,d,l),s[null!==(o=null===(n=null==u?void 0:u.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c}else c=l.value.GetDataCache(),s=c;return 0==u.id?"":s}))}function Bt(e,t){const n=[];for(let o=0;o<t.length;o++)t[o].typeId==e&&n.push(t[o]);return n}function Rt(e){return Et(this,arguments,void 0,(function*(e,t=[]){var n,o;let i={},r=[];const s=[];let c;const l={},d=yield gt.getNodeFromTree(e),u=[];let h=yield a.I.GetConcept(e);if(0==h.id&&null!=e&&null!=e&&(h=yield(0,xt.r)(e)),null==d){let a=[];a=t.length>0?Bt(e,t):yield(0,R.s)(e),r=a;for(let e=0;e<r.length;e++)u.includes(r[e].ofTheConceptId)||(u.push(r[e].ofTheConceptId),s.push(r[e].ofTheConceptId)),s.includes(r[e].toTheConceptId)||s.push(r[e].toTheConceptId);Dt(h,r,s,u),c=yield(0,v.zN)(e,r,u),l[null!==(o=null===(n=null==h?void 0:h.type)||void 0===n?void 0:n.characterValue)&&void 0!==o?o:""]=c,i.created_at=h.entryTimeStamp,i.data=l,i.id=e}else c=d.value.GetDataCache(),i=c;return 0==h.id?"":i}))}function Gt(e,t){return Et(this,void 0,void 0,(function*(){let n=[];const o=[];n=yield(0,ot.j)(t);for(let t=0;t<e.length;t++){const i=yield Rt(e[t],n);i&&o.push(i)}return o}))}function Dt(e,t,n,o){return Et(this,void 0,void 0,(function*(){const i=new Tt,r=yield function(e){return Et(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 a.I.GetConcept(e[o]);0==i.id?n.push(e[o]):t.push(i)}return 0==(null==n?void 0:n.length)||(t=yield(0,nt.I)(n)),t}))}(n);i.connections=t,i.concepts=r,i.id=e.id,i.subcompositions=o,i.mainConcept=e;const s=yield Ct(e.id,t,r,o,[]);i.cached=s,gt.addCompositionToTree(i)}))}var Ft=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Pt(e){return Ft(this,void 0,void 0,(function*(){try{var t=(0,d.Xr)();const n=JSON.stringify(e),o=yield fetch(l.B.CreateSessionId(),{method:"POST",headers:t,body:n});return o.ok?o.json():(console.log("Creating session failed",yield o.json()),(0,u.ry)(o),null)}catch(e){console.log("Creating session failed",e),(0,u.Mb)(e,l.B.CreateSessionId())}}))}var Ut=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Wt(e,t){return Ut(this,void 0,void 0,(function*(){try{var n=(0,d.Xr)("application/x-www-form-urlencoded");const o=new URLSearchParams;o.append("sessionId",e.toString()),o.append("url",t);const i=yield fetch(l.B.CreateSessionVisitUrl(),{method:"POST",headers:n,body:o});return i.ok?i.json():(console.log("Creating session url failed",yield i.json()),(0,u.ry)(i),null)}catch(e){console.log("Creating session url failed",e),(0,u.Mb)(e,l.B.CreateSessionVisitUrl())}}))}var Mt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Vt(e,t,n){return Mt(this,arguments,void 0,(function*(e,t,n,o=10,i=1){let r=[];try{var s=new URLSearchParams;s.append("typeId",`${e}`),s.append("toTheConceptId",`${t}`),s.append("userId",`${n}`),s.append("inpage",`${o}`),s.append("page",`${i}`);var c=(0,d.Xr)("application/x-www-form-urlencoded");const a=yield fetch(l.B.GetAllConnectionsToConceptUrl(),{method:"POST",headers:c,body:s});return a.ok?r=yield a.json():(console.log("Get connection of concept error",a.status),(0,u.ry)(a)),r}catch(e){throw e instanceof Error?console.log("Get connection of concept error message: ",e.message):console.log("Get connection of concept unexpected error: ",e),e}}))}var jt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function $t(e,t){var n=arguments;return jt(this,arguments,void 0,(function*(e,t,o=10,i=1,r=!1){const s=so.V.logfunction("GetRelation",n)||{};if(Oi){s.serviceWorker=!0;try{const n=yield Mi("GetRelation",{id:e,relation:t,inpage:o,page:i,reverse:r});return so.V.logUpdate(s),n.data}catch(e){console.error("GetRelation error sw: ",e),(0,u.ey)(s,"GetRelation",e),qi(e)}}let c=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[];if(l.id>0)if(r){d=yield Vt(l.id,a.id,a.userId,o,i);let e=[];for(var h=0;h<d.length;h++)e.push(d[h].ofTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].ofTheConceptId,n=yield(0,z.A)(t),o=yield(0,v.Ez)(n.id);c.push(o)}}else{d=yield P(l.id,a.id,a.userId,o,i);let e=[];for(let t=0;t<d.length;t++)e.push(d[t].toTheConceptId);yield(0,f.Y)(e);for(let e=0;e<d.length;e++){let t=d[e].toTheConceptId,n=yield(0,z.A)(t),o=yield(0,v.Ez)(n.id);c.push(o)}}return so.V.logUpdate(s),c}))}function Ht(e,t){var n=arguments;return jt(this,arguments,void 0,(function*(e,t,o=10,i=1,r=!1){const s=so.V.logfunction("GetRelationRaw",n)||{};if(Oi){s.serviceWorker=!0;try{const n=yield Mi("GetRelationRaw",{id:e,relation:t,inpage:o,page:i,reverse:r});return so.V.logUpdate(s),n.data}catch(e){console.error("GetRelationRaw error sw: ",e),(0,u.ey)(s,"GetRelationRaw",e),qi(e)}}let c=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[],h=[];if(l.id>0){if(r){d=yield Vt(l.id,a.id,a.userId,o,i);for(var p=0;p<d.length;p++)h.push(d[p].ofTheConceptId)}else{d=yield P(l.id,a.id,a.userId,o,i);for(let e=0;e<d.length;e++)h.push(d[e].toTheConceptId)}c=yield(0,nt.r)(h)}return so.V.logUpdate(s),c}))}var qt=n(6416),zt=n(4711);class Jt{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 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 Qt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class Yt{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 Qt(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.checkFlag(e),setTimeout((()=>{t("not")}),25e3)}))}))}static checkFlag(e){if(r.B.isDataLoaded)return e("done");setTimeout(Yt.checkFlag,1e3,e)}static addConceptToTree(e,t,n=999){let o=this.compositeKey(t,n);var i=new Jt(o,e,null,null);this.addNodeToTree(i)}static getNodeFromTree(e,t){return Qt(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 Qt(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}}Yt.root=null;var Xt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Zt(e,t){return Xt(this,arguments,void 0,(function*(e,t,n=999){let o=yield Yt.getNodeFromTree(e,n),i=(0,qt.u)();if(o)for(let e=0;e<o.value.length;e++){let n=o.value[e];n.ghostId==t&&(i=n)}return i}))}function Kt(e,t){return Xt(this,arguments,void 0,(function*(e,t,n=999){Yt.addConceptToTree(e,t,n)}))}var en=n(5312),tn=n(1213),nn=n(3729),on=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},rn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function sn(e,t,n){return rn(this,void 0,void 0,(function*(){try{if(Oi)try{return(yield Mi("GetRelationLocal",{id:e,relation:t,userId:n})).data}catch(e){console.error("GetRelationLocal error sw: ",e),qi(e)}let o=yield(0,m.$I)(t),i=[];0!=o.id&&(i=yield function(e,t){return on(this,void 0,void 0,(function*(){try{return yield A.G.GetConnectionOfCompositionAndTypeLocal(t,e)}catch(e){throw e}}))}(e,o.id));let r=[];for(let e=0;e<i.length;e++){let t=yield b(i[e].toTheConceptId);r.push(t)}return r}catch(e){throw e}}))}var cn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function an(e){return cn(this,void 0,void 0,(function*(){let t=[];try{var n=(0,d.Xr)();const o=yield fetch(l.B.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;(0,nt.r)(i),n[r]=t}return n}return console.log("View Internal Data error",o.status),(0,u.ry)(o),t}catch(e){throw e instanceof Error?console.log(" This is the view internal data error message: ",e.message):console.log(" This is the view internal data unexpected error: ",e),e}}))}var ln=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function dn(e){return ln(this,void 0,void 0,(function*(){var t;try{let n=yield an(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(0,v.zN)(r,s,e);t.data=n,t.id=r,o.push(t)}else{let e={};e.id=r;let n=yield(0,z.A)(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 un=n(176),hn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},pn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function fn(e){return pn(this,arguments,void 0,(function*(e,t=""){try{let n=yield function(e){return hn(this,arguments,void 0,(function*(e,t=""){var n=(0,d.ab)("application/json",t);let o=l.B.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 fetch(o,{method:"GET",headers:n});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,u.Mb)(e,o)}}))}(e,t);return yield dn(n)}catch(e){throw e}}))}function yn(e){return pn(this,arguments,void 0,(function*(e,t=""){try{return yield function(e){return hn(this,void 0,void 0,(function*(){var t=(0,d.ab)("application/json","");let n=l.B.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 fetch(n,{method:"GET",headers:t});return e.ok?yield e.json():(console.log("This is the searching internal error",e.status),(0,u.ry)(e),[])}catch(e){console.log("This is the searching internal error",e),(0,u.Mb)(e,n)}}))}(e)}catch(e){throw e}}))}var vn=n(8095),gn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function mn(e){return gn(this,void 0,void 0,(function*(){if(Oi)try{return(yield Mi("DeleteConceptLocal",{id:e})).data}catch(e){console.error("DeleteConceptLocal error sw: ",e),qi(e)}let t=yield(0,tn.f)(e);y.v.RemoveConcept(t)}))}var Cn=n(2803),wn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Tn(e,t,n,o){return wn(this,arguments,void 0,(function*(e,t,n,o,i=!0){var r,s;const c=so.V.logfunction("GetConnectionBetweenTwoConceptsLinker")||{};if(Oi){c.serviceWorker=!0;try{const r=yield Mi("GetConnectionBetweenTwoConceptsLinker",{ofTheConcept:e,toTheConcept:t,linker:n,fullLinker:o,forward:i});return so.V.logUpdate(c),r.data}catch(e){console.error("GetConnectionBetweenTwoConceptsLinker sw error: ",e),(0,u.ey)(c,"GetConnectionBetweenTwoConceptsLinker",e),qi(e)}}let a=(0,M.o)();if(""!=n){let o="";o=i?(null===(r=e.type)||void 0===r?void 0:r.characterValue)+"_s_"+n+"_s":(null===(s=t.type)||void 0===s?void 0:s.characterValue)+"_s_"+n+"_by",a=yield(0,J.A)("connection",o,!1,999)}""!=o&&(a=yield pe(o,999));let l=[];return l=i?yield(0,Cn.x)(e.id,t.id,a.id):yield(0,Cn.x)(t.id,e.id,a.id),so.V.logUpdate(c),l}))}function kn(e,t){return new Promise(((n,o)=>{setTimeout((()=>{n(t)}),e)}))}var In=n(3130);const Sn=3,An=4,Nn=5;var Ln=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function bn(e,t){return Ln(this,arguments,void 0,(function*(e,t,n=""){let o=l.B.SearchAllTypeWithLinker(e.auth);var i=(0,d.ab)("application/json",n);o=o+"?search="+e.search+"&type="+e.type+"&inpage="+e.inpage+"&page="+e.page;const r=JSON.stringify(t);try{const e=yield fetch(o,{method:"POST",headers:i,body:r});return e.ok?yield e.json():((0,u.ry)(e),console.log("This is the searching multiple error",e.status),[])}catch(e){console.log("This is the searching SearchWithTypeAndLinker error",e),(0,u.Mb)(e,o)}}))}var _n=n(4287);class xn extends _n.w{constructor(e,t,n=In.y0){super(),this.searchQuery=[],this.format=In.y0,this.searchQuery=e,this.format=n}bind(){return e=this,t=void 0,o=function*(){return this.data=yield(0,en.cf)(this.searchQuery,"",this,this.format),this.mainConcept=this.searchQuery[0].composition,this.listenToEvent(this.mainConcept),console.log("this is the data",this.data),this.data},new((n=void 0)||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}));var e,t,n,o}}function En(e,t,n=In.y0){return new xn(e,null!=t?t:"",n)}var On=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class Bn extends _n.w{constructor(e,t=In.ZJ){super(),this.id=e,this.format=t}bind(){return On(this,void 0,void 0,(function*(){if(!this.isDataLoaded){let e=yield(0,v.hL)(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 On(this,void 0,void 0,(function*(){let e=[],t=this.internalConnections;for(let n=0;n<t.length;n++)e.push(yield Ee.d.GetConnection(t[n]));return this.format==In.ZJ?this.data=yield(0,v.ay)(this.mainConcept,e,this.compositionIds):this.format==In.y0?this.data=yield(0,v.$V)(this.mainConcept,e,this.compositionIds):this.format==In.yv?this.data=yield(0,v.re)(this.mainConcept,e,this.compositionIds):this.data=yield(0,v.ay)(this.mainConcept,e,this.compositionIds),this.data}))}}function Rn(e,t=In.ZJ){return new Bn(e,t)}var Gn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class Dn extends _n.w{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 Gn(this,void 0,void 0,(function*(){if(!this.isDataLoaded){var e=yield(0,g.A)(this.compositionName);if(e){yield p(this.compositionName,this.userId);let o=yield a.I.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(0,f.Y)(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 Gn(this,void 0,void 0,(function*(){if(this.data=[],this.format==In.ZJ){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,v.kx)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==In.y0){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,v.RW)(this.compositionIds[e]);this.data.push(t)}}else if(this.format==In.yv){for(let e=this.startPage;e<this.startPage+this.inpage;e++)if(this.compositionIds[e]){let t=yield(0,v.XI)(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(0,v.kx)(this.compositionIds[e]);this.data.push(t)}return this.data}))}}function Fn(e,t,n,o,i=In.ZJ){return new Dn(e,t,n,o,i)}var Pn=n(1320),Un=n(5328),Wn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class Mn extends _n.w{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){window.addEventListener(`${e}`,(t=>{if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout((function(){return Wn(this,void 0,void 0,(function*(){let n=yield Ee.d.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield Ee.d.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()}))}),200)}}))}bind(){return Wn(this,void 0,void 0,(function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;const e=yield qe(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(0,ot.j)(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 Wn(this,void 0,void 0,(function*(){return this.externalConnectionIds=this.linkers,this.format&&this.format==In.XZ?this.data={compositionIds:this.compositionIds,internalConnections:this.internalConnections,externalConnections:this.externalConnectionIds}:this.data=yield(0,Ve.p8)(this.compositionIds,this.internalConnections),this.data}))}}function Vn(e,t,n="",o){return new Mn(e,t,n,o)}var jn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class $n extends _n.w{constructor(e,t,n,o=In.y0){super(),this.searchQuery=[],this.format=In.y0,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=Be.b.BearerAccessToken}listenToEventType(e){window.addEventListener(`${e}`,(e=>{if(!this.isUpdating){this.isUpdating=!0;let t=this;setTimeout((function(){return jn(this,void 0,void 0,(function*(){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),Ee.d.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()}))}),200)}}))}bind(){return jn(this,void 0,void 0,(function*(){if(!this.isDataLoaded){this.isDataLoaded=!0;var e=yield(0,g.A)(this.searchCharacter);let t=yield bn(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 jn(this,void 0,void 0,(function*(){return yield(0,nt.r)(this.conceptIds),this.format==In.y0?this.data=yield(0,Pn.yV)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse):this.data=yield(0,Pn._W)(this.linkers,this.conceptIds,this.internalConnections,this.mainCompositionIds,this.reverse),this.data}))}}function Hn(e,t,n,o=In.y0){return new $n(e,t,n,o)}var qn=n(4698),zn=n(6915),Jn=n(2615);class Qn{constructor(e,t,n,o,i,r,s,c=!1,a,d,u){this.structureType="lconcept",this.isComposition=!1,this.isTemp=!1,this.isSynced=!1,this.applicationId=l.B.getRandomizer(),this.id=e,this.userId=t,this.typeId=n,this.ghostId=e,this.categoryId=o,this.characterValue=r,this.accessId=i,this.type=null,this.isNew=c,this.typeCharacter=s,this.entryTimeStamp=a,this.updatedTimeStamp=d,this.isSynced=!1,this.referentId=u}getType(){console.log(this.typeId)}}class Yn{constructor(e,t,n,o,i,r){this.isTemp=!1,this.applicationId=l.B.getRandomizer(),this.type=(0,M.o)(),this.id=e,this.ofTheConceptId=t,this.toTheConceptId=n,this.typeId=o,this.ghostId=e,this.orderId=i,this.typeCharacter="",this.accessId=r,this.typeCharacter="",this.entryTimeStamp=(0,M.Y)(new Date),this.terminationDateTime=new Date,this.localSyncTime=new Date}}class Xn{constructor(){this.compositionId=0,this.userId=999,this.sessionId=999,this.accessId=4,this.ofTheCompositionId=0,this.patchObject={}}}class Zn{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=""}}var Kn=n(628);class eo{constructor(){this.type="",this.search="",this.logicoperator="=",this.index=0,this.composition=!0,this.name="",this.operateon=""}}class to{constructor(){this.type="",this.search="",this.composition="",this.internalComposition="",this.userId=999,this.inpage=10,this.page=1,this.auth=!0}}var no=n(7887),oo=n(3075),io=n(7869),ro=n(9635),so=n(9700);class co{static initialize(){try{console.warn("Initialized Application Monitoring for tracking errors..."),this.initGlobalErrorHandlers(),this.logCatchError(),this.logErrorEvent(),this.logUnhandledError(),this.logUserInteractions(),this.logNetworkRequests(),this.logRouteChanges()}catch(e){console.error("Error during Application Monitoring initialization:",e)}}static initGlobalErrorHandlers(){try{if(console.log("this is the window",window),void 0===typeof window)return;window.onerror=(e,t,n,o,i)=>{const r=Be.b.sessionId||"unknown",s={message:e,source:t,lineno:n,colno:o,stack:(null==i?void 0:i.stack)||"undefined",requestFrom:l.B.BASE_APPLICATION,sessionId:r};so.V.logApplication("ERROR","Runtime Error",s),so.V.log("ERROR","Runtime Error",s)},window.onunhandledrejection=e=>{const t=Be.b.sessionId||"unknown";so.V.logApplication("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:t}),so.V.log("ERROR","Unhandled Promise Rejection",{message:e.reason?e.reason.message:e.reason,stack:e.reason?e.reason.stack:null,requestFrom:l.B.BASE_APPLICATION,sessionId:t})}}catch(e){console.warn("Failed to initialize global error handlers:",e)}}static logCatchError(){try{const e=console.error;console.log("Inside originalConsoleError..."),console.error=function(...t){if("Intercepted Fetch Error:"==(null==t?void 0:t[0]))return;const n="Console Error",o=Be.b.sessionId||"unknown",i={arguments:t.map((e=>ao(e))),requestFrom:l.B.BASE_APPLICATION,sessionId:o};so.V.logApplication("ERROR",n,i),so.V.log("ERROR",n,i),e.apply(console,t)}}catch(e){console.warn("Failed to override console.error:",e)}}static logErrorEvent(){try{window.addEventListener("error",(e=>{var t;console.log("Inside error event...");const n=Be.b.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?ao(e.error.stack):void 0,requestFrom:l.B.BASE_APPLICATION,sessionId:n},i="Unhandled Error";so.V.logApplication("ERROR",i,o),so.V.log("ERROR",i,o)}))}catch(e){console.warn("Failed to add error event listener:",e)}}static logUnhandledError(){try{window.addEventListener("unhandledrejection",(e=>{var t,n;console.log("Inside unhandledrejection...");const o=Be.b.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:l.B.BASE_APPLICATION,sessionId:o};so.V.logApplication("ERROR","Unhandled Promise Rejection",i),so.V.log("ERROR","Unhandled Promise Rejection",i)}))}catch(e){console.warn("Failed to add unhandled rejection event listener:",e)}}static logUserInteractions(){document.addEventListener("click",(e=>{var t;const n=Be.b.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:l.B.BASE_APPLICATION,sessionId:n};so.V.logApplication("INFO","User Click",i)})),document.addEventListener("input",(e=>{const t=e.target;Be.b.sessionId,t.tagName,t.id,t.value,l.B.BASE_APPLICATION})),document.addEventListener("scroll",(()=>{Be.b.sessionId,window.scrollY,l.B.BASE_APPLICATION}))}static logNetworkRequests(){try{if(void 0===typeof window)return;Be.b.sessionId;const e=null===window||void 0===window?void 0:window.fetch;if(!e)throw new Error("Original fetch is not available.");const t=[l.B.PostLogger(),l.B.PostPrefetchConceptConnections()];window.fetch=(...n)=>{return o=this,i=void 0,s=function*(){const o=Be.b.sessionId||"unknown",[i,r]=n,s=i instanceof Request?i.url:i instanceof URL?i.toString():i;if(t.includes(s))return console.log("Ignored URLs detected : ",s),e(...n);let c={request:{type:"REQUEST",message:"Network Request",method:(null==r?void 0:r.method)||"GET",url:s,body:null==r?void 0:r.body,requestFrom:l.B.BASE_APPLICATION,sessionId:o}};try{const t=yield e(...n);return c.response={type:"RESPONSE",message:"Network Response",url:s,status:t.status,requestFrom:l.B.BASE_APPLICATION,sessionId:o},t}catch(e){throw c.response={type:"ERROR",message:"Network Request Failed",url:s,error:e instanceof Error?e.message:String(e),requestFrom:l.B.BASE_APPLICATION,sessionId:o},so.V.logApplication("ERROR","Failed Network Request",c),new Error(`Network request failed for ${s}: ${e.message}`)}},new((r=void 0)||(r=Promise))((function(e,t){function n(e){try{a(s.next(e))}catch(e){t(e)}}function c(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r((function(e){e(o)}))).then(n,c)}a((s=s.apply(o,i||[])).next())}));var o,i,r,s}}catch(e){console.warn("Failed to override network requests:",e)}}static logPerformanceMetrics(){void 0!==typeof window&&(null===window||void 0===window||window.addEventListener("load",(()=>{const e=performance.timing;Be.b.sessionId,e.loadEventEnd,e.navigationStart,e.domContentLoadedEventEnd,e.navigationStart,l.B.BASE_APPLICATION})))}static logRouteChanges(){const e=history.pushState;history.pushState=function(...t){var n;const o=Be.b.sessionId||"unknown",i={url:null===(n=t[2])||void 0===n?void 0:n.toString(),requestFrom:l.B.BASE_APPLICATION,sessionId:o};return so.V.logApplication("ROUTE","Route Change",i),e.apply(this,t)},null===window||void 0===window||window.addEventListener("popstate",(()=>{const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};so.V.logApplication("ROUTE","Route Changed (Back/Forward)",t)}))}static logWebSocketEvents(){if(void 0===typeof window)return;const e=Be.b.sessionId||"unknown",t=WebSocket;window.WebSocket=class extends t{constructor(t,n){super(t,n);const o={url:t.toString(),requestFrom:l.B.BASE_APPLICATION,sessionId:e};so.V.logApplication("INFO","WebSocket Open",o),this.addEventListener("message",(e=>{const n=Be.b.sessionId||"unknown",o={url:t,data:e.data,requestFrom:l.B.BASE_APPLICATION,sessionId:n};so.V.logApplication("INFO","WebSocket Message",o)})),this.addEventListener("error",(e=>{const n=Be.b.sessionId||"unknown",o={url:t,error:e instanceof Error?e.message:String(e),requestFrom:l.B.BASE_APPLICATION,sessionId:n};so.V.logApplication("ERROR","WebSocket Error",o)})),this.addEventListener("close",(()=>{const e=Be.b.sessionId||"unknown",n={url:t,requestFrom:l.B.BASE_APPLICATION,sessionId:e};so.V.logApplication("INFO","WebSocket Closed",n)}))}}}}function ao(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"}}const lo=(e,t,...n)=>{return o=void 0,i=[e,t,...n],s=function*(e,t,n=!1){try{let o=l.B.sendMail();n&&(o=l.B.sendBulkMail());const i=yield fetch(o,{method:"POST",body:e instanceof FormData?e:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}),r=i.headers.get("content-type");if(!i.ok){const e=yield i.json();return console.info(`${i.status} ${e}`),null}const s=yield i.json();return r&&r.includes("text/plain")?yield i.text():s}catch(e){return console.error(e),null}},new((r=void 0)||(r=Promise))((function(e,t){function n(e){try{a(s.next(e))}catch(e){t(e)}}function c(e){try{a(s.throw(e))}catch(e){t(e)}}function a(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r((function(e){e(o)}))).then(n,c)}a((s=s.apply(o,i||[])).next())}));var o,i,r,s};class uo{constructor(){this.inDevelopment=!1,this.subscribers=[]}notify(e=null){this.subscribers.map((t=>{t(e||this.data)}))}dataChange(e){this.subscribers.push(e)}}class ho extends uo{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()}}class po extends ho{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&&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();return t?null==t?void 0:t.querySelectorAll("."+e):[]}mount_child(){}mount(e){return t=this,n=void 0,i=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)},new((o=void 0)||(o=Promise))((function(e,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,c)}a((i=i.apply(t,n||[])).next())}));var t,n,o,i}before_render(){this.render()}after_render(){console.log("this is calling the after render",this)}renderChildWidgets(){function e(t){var n;t&&(null===(n=t.childWidgets)||void 0===n||n.forEach((t=>{e(t)})),t.render())}console.log("this is the render child widget",this),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 fo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class yo extends po{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=[]}getUserId(){return fo(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{let t=(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("profile"))||"";t?e(JSON.parse(t)):e()}));return null==e?void 0:e.userId}))}getTypeValueList(){return fo(this,arguments,void 0,(function*(e=""){return new Promise((t=>fo(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=[],c=new eo;c.type=r,c.search="1",c.logicoperator=">",c.name="emailfilter",c.operateon="entityEmail",c.composition=!1,s.push(c);let a=new No;a.typeConnection=e,a.name="entityEmail";let l=new No;l.type=o,l.filterLogic="( emailfilter )",l.filters=s,l.name="top",l.inpage=100,l.freeschemaQueries=[a],l.outputFormat=In.y0,Eo(l,"").subscribe((n=>{if(null==n?void 0:n.length){const i=null==n?void 0:n.map((t=>{var n,i,s,c,a,l,d;const u=null===(c=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===c?void 0:c[r];return{id:null===(d=null===(l=null===(a=t.data)||void 0===a?void 0:a[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 fo(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 console.log("This is the error in the mount child",e),e}}))}setProperty(e){return fo(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 c=document.createElement("input");c.setAttribute("type","text"),c.setAttribute("name","input-widgetTypeValue"),c.setAttribute("of",t.elementIdentifier.toString()),c.setAttribute("class","form-control"),c.setAttribute("id","widgetType"),c.setAttribute("onchange","updateWidgetTypeValue(event)"),t.widgetType?c.value=t.widgetType:c.setAttribute("placeholder","e.g. the_entity");let a=t;c.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;a.widgetType=i,a.before_render(),a.loadChildWidgets(),null===(o=null===(n=a.element)||void 0===n?void 0:n.parentElement)||void 0===o||o.setAttribute("data-type-value",a.widgetType)})),null==n||n.appendChild(c)}}(e,this)}mount(e){return fo(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.before_render(),this.mount_child(),this.widgetMounted=!0,this.componentMounted=!0):this.render(),this.childWidgetElement=this.getElementByClassName("added-widget-container")}}))}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 console.error("This is the error in the render_custom_functions",e),e}}before_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.componentDidMountFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the before render",e),e}}after_render(){try{new Function("tsccs",`\n return (async function() {\n ${this.addEventFunction}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the after render",e),e}}CreateConnectionBetweenEntityLocal(e,t,n){return fo(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(0,le.$)(r,999,999,i);return yield(0,zt.F)(e.id,t.id,s.id,1e3),"connection created"}))}}var vo=n(3077),go=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class mo{constructor(){this.actions={concepts:[],connections:[]},this.success=!0,this.transactionId=Math.random().toString().substring(5)}initialize(){return go(this,void 0,void 0,(function*(){yield Kn.H.initializeTransaction(this.transactionId)}))}commitTransaction(){return go(this,void 0,void 0,(function*(){if(!this.success)throw Error("Query Transaction Expired");yield Kn.H.SyncDataOnline(this.transactionId),this.actions={concepts:[],connections:[]},this.success=!1}))}commitTransactionWithoutAuth(){return go(this,void 0,void 0,(function*(){if(!this.success)throw Error("Query Transaction Expired");yield Kn.H.SyncDataOnlineWithoutAuth(this.transactionId),this.actions={concepts:[],connections:[]},this.success=!1}))}rollbackTransaction(){return go(this,void 0,void 0,(function*(){this.success=!1,this.actions={concepts:[],connections:[]},yield Kn.H.rollbackTransaction(this.transactionId,this.actions)}))}markAction(){return go(this,void 0,void 0,(function*(){yield Kn.H.markTransactionActions(this.transactionId,this.actions)}))}MakeTheInstanceConceptLocal(e,t){return go(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 c=yield(0,K.k)(e,t,n,o,i,r,s,this.actions);return yield this.markAction(),c}catch(e){throw console.log(e),this.success=!1,e}}))}MakeTheTypeConceptLocal(e,t,n,o){return go(this,void 0,void 0,(function*(){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,le.$)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}}))}CreateTheConceptLocal(e,t,n,o,i,r){return go(this,arguments,void 0,(function*(e,t,n,o,i,r,s=!1,c=0,a={concepts:[],connections:[]}){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,vo.A)(e,t,n,o,i,r,s,c,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}}))}CreateConnectionBetweenTwoConceptsLocal(e,t,n){return go(this,arguments,void 0,(function*(e,t,n,o=!1){try{if(!this.success)throw Error("Query Transaction Expired");const i=yield(0,vn.h)(e,t,n,o,this.actions);return yield this.markAction(),i}catch(e){throw console.log(e),this.success=!1,e}}))}CreateTheConnectionLocal(e,t,n){return go(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(0,zt.F)(e,t,n,o,i,r,this.actions);return yield this.markAction(),s}catch(e){throw console.log(e),this.success=!1,e}}))}CreateConnection(e,t,n){return go(this,void 0,void 0,(function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield(0,zt.d)(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}}))}CreateConnectionBetweenEntityLocal(e,t,n){return go(this,void 0,void 0,(function*(){try{if(!this.success)throw Error("Query Transaction Expired");const o=yield Go(e,t,n,this.actions);return yield this.markAction(),o}catch(e){throw console.log(e),this.success=!1,e}}))}CreateTheCompositionLocal(e){return go(this,arguments,void 0,(function*(e,t=null,n=null,o=null,i=null,r=null,s=null,c=!1){try{if(!this.success)throw Error("Query Transaction Expired");const a=yield(0,D.R)(e,t,n,o,i,r,s,c,this.actions);return yield this.markAction(),a}catch(e){throw console.log(e),this.success=!1,e}}))}}const Co={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 wo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class To{constructor(){To.cacheInitialized||To.initializeAnomalyParameters()}static initializeAnomalyParameters(){return wo(this,void 0,void 0,(function*(){try{yield To.getAnomalyParameters(),To.refreshCache(),To.cacheInitialized=!0}catch(e){console.error("Error during anomaly parameter initialization:",e)}}))}static getAnomalyParameters(){return wo(this,void 0,void 0,(function*(){const e=Date.now();if(To.anomalyParamsCache&&e-To.lastFetchedTime<To.cacheExpiryThreshold)return console.log("Returning cached anomaly parameters"),To.anomalyParamsCache;try{return yield To.fetchAnomalyParameters()}catch(e){throw console.error("Error fetching anomaly parameters:",e),e}}))}static fetchAnomalyParameters(){return wo(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 To.anomalyParamsCache=t.data,To.lastFetchedTime=Date.now(),t.data}catch(e){throw console.error("API Fetch Error:",e),e}}))}static refreshCache(){return wo(this,void 0,void 0,(function*(){try{Date.now()-To.lastFetchedTime>To.cacheExpiryThreshold&&(yield To.getAnomalyParameters())}catch(e){console.error("Error refreshing anomaly parameters cache:",e)}}))}detectDataType(e){for(const[t,n]of Object.entries(Co))if(n.test(e))return t;return null}checkConceptAnomaly(e,t){return wo(this,void 0,void 0,(function*(){const n=[];try{if(!t)return n.push("Null value"),{valid:!1,warnings:n};const o=To.anomalyParamsCache;e.startsWith("the_")||(e=`the_${e}`);const i=o[e];if(console.log("Concept Details : ",i),!i)return console.warn(`No concept details found for type: ${e}`),n.push(`No concept details found for type: ${e}`),{valid:!1,warnings:n};const r=t.length,{min_length:s,max_length:c,data_types:a}=i,l=r>=s&&r<=c,d=this.detectDataType(t),u=a.includes(d);return l||n.push(`Length of '${t}' is outside the allowed range (min: ${s}, max: ${c}). Current length: ${r}.`),u||n.push(`Type mismatch for '${t}'. Expected types: ${a.join(", ")}, detected type: ${d}.`),l&&u&&n.push(`Concept ${e} is valid. Length: ${r}, Type: ${d}`),{valid:l&&u,warnings:n}}catch(o){return console.error(`Error checking anomaly for ${e} with value ${t}:`,o),{valid:!1,warnings:n}}}))}static checkAnomalyInBulk(e){return wo(this,void 0,void 0,(function*(){To.cacheInitialized||(yield To.initializeAnomalyParameters());try{const t={};for(const[n,o]of Object.entries(e)){const e=o.value,{valid:i,warnings:r}=yield(new To).checkConceptAnomaly(n,e);t[n]={valid:i,warnings:r}}return t}catch(e){throw console.error("Bulk Anomaly Check Error:",e),e}}))}static getExportedFunction(){console.log("Main : ",o);const e=Object.keys(o);return console.log("The exported List : ",e),e}static getFunctionaAnomalyParameters(){}}To.anomalyParamsCache=null,To.cacheInitialized=!1,To.lastFetchedTime=0,To.cacheExpiryThreshold=6e5;var ko=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class Io{checkUniqueness(e,t){return ko(this,void 0,void 0,(function*(){const n=so.V.logfunction("checkUniqueness");e.startsWith("the_")||(e="the_"+e);let o=(yield pe(e,999)).id,i=yield(0,re.A)(t,o);return console.log("This is the concept for validator",i),!(i.id>0||(so.V.logUpdate(n),0))}))}validateField(e){return ko(this,void 0,void 0,(function*(){var t;const n=so.V.logfunction("validateField");try{performance.now();const o={},{name:i,value:r,type:s,dataType:c,pattern:a,conceptType:l,maxLength:d,minLength:u,minValue:h,maxValue:p,accept:f,file:y,required:v,isUnique:g}=e;if(console.log("Validation is happening on : \n",e),!v||null!==r&&""!==r||(o.required=`The field ${i} is required.`),c&&r){let e=Co[c];e&&""!==r&&!e.test(r)&&(o.dataType=`Invalid value for ${c}`)}if(a&&r){const e="string"==typeof a?new RegExp(a):a;""===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(", ")}`)}return l&&g&&r&&((yield this.checkUniqueness(l,r))||(o.unique="Value is not unique")),so.V.logUpdate(n),console.log("Before Validation Result : ",o),o}catch(e){throw(0,u.ey)(n,"Validator.validateField",e),e}}))}validateForm(e){return ko(this,void 0,void 0,(function*(){const t=so.V.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 so.V.logUpdate(t),n}catch(e){throw(0,u.ey)(t,"Validator.validateForm",e),e}}))}validate(e){const t=so.V.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})),console.error("Error on validate object"),so.V.logUpdate(t),n}catch(e){(0,u.ey)(t,"Validator.validate",e)}}}const So=e=>{var t;const n=document.getElementsByName(e)[0];if(!n)return console.warn(`Element with NAME "${e}" not found.`),{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 Ao=n(2289);class No{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=In.yv,this.name="",this.filterAncestor="",this.reverse=!1,this.limit=!1,this.isSecure=!1,this.includeInFilter=!1,this.isOldConnectionType=!1}}var Lo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function bo(e){var t=arguments;return Lo(this,arguments,void 0,(function*(e,n=""){const o=so.V.logfunction("FreeschemaQueryApi",t);var i=(0,d.ab)("application/json",n);const r=l.B.FreeschemaQueryUrl(),s=JSON.stringify(e);try{const e=yield fetch(r,{method:"POST",headers:i,body:s});return e.ok?yield e.json():((0,u.ry)(e),console.log("This is the freeschema query error",e.status),[])}catch(e){console.log("This is the freeschema query error others",e),(0,u.Mb)(e,r),(0,u.ey)(o,"FreeschemaQueryApi",e)}}))}var _o=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};class xo extends _n.w{constructor(e,t){super(),this.query=new No,this.countInfoStrings=[],this.order="DESC",this.totalCount=0,this.query=e,this.format=e.outputFormat,this.order=e.order}run(){return _o(this,void 0,void 0,(function*(){var e,t;this.query.outputFormat=In.BG,this.compositionIds=[];let n=yield bo(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()}))}bind(){return _o(this,void 0,void 0,(function*(){var e,t;if(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=In.BG,this.compositionIds=[];let n=yield bo(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 pe(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}))}build(){return _o(this,void 0,void 0,(function*(){so.V.logfunction("build",["schemaquery",this.compositionIds]);let e=(0,qn.w)(this.countInfoStrings);return this.format==In.y0?this.data=yield(0,Pn.e$)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==In.ZJ?this.data=yield(0,Pn.y6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==In.pU?this.data=yield(0,Pn.rq)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e,this.order):this.format==In.XZ?(console.log("this is the raw format"),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(0,Pn.b6)(this.linkers,this.conceptIds,this.compositionIds,this.reverse,e),this.data}))}}function Eo(e,t){return new xo(e,t)}function Oo(e,t){return new xo(e,t).execute()}class Bo{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 yo}}var Ro=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Go(e,t,n){return Ro(this,arguments,void 0,(function*(e,t,n,o={concepts:[],connections:[]}){var i,r,s,c,a;const l=so.V.logfunction("CreateConnectionBetweenEntityLocal",[e.id,t.id,n]);if(Oi)try{const a=yield Mi("CreateConnectionBetweenEntityLocal",{concept1Data:e,concept2Data:t,linker:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(c=null===(s=null==a?void 0:a.actions)||void 0===s?void 0:s.connections)||void 0===c?void 0:c.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.log("CreateConnectionBetweenEntityLocal error sw: ",e),qi(e)}const d=e.userId,u=(null===(a=e.type)||void 0===a?void 0:a.characterValue)+"_"+n,h=yield(0,le.$)(u,999,999,d,o);console.log(yield(0,zt.F)(e.id,t.id,h.id,1e3,void 0,void 0,o)),so.V.logUpdate(l)}))}var Do=n(4310);function Fo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var Po=n(490),Uo=n(276);class Wo extends po{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 eo;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="";console.log("this is the filters",this.query)}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 No;o.type=this.mainType,o.inpage=this.inpage;let i=new No;i.typeConnection=this.selector,i.name="selector",o.freeschemaQueries=[i],this.query=o,Eo(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(console.log("this is the selected data myItem",r,t[e],this.mainType,n),r){let e=r[this.selector];if(e){const t=Object.values(e)[0];o[i]=t}}}Fo(e);for(const[t,n]of Object.entries(o)){const o=document.createElement("option");o.value=t,o.textContent=n,e.appendChild(o)}console.log("this is the output from selector",t)}))}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}}const Mo='\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',Vo={PAGE_COMP_NAME:"page",WIDGET_COMP_NAME:"widget",PROJECT_COMP_NAME:"project"};var jo=n(2895);const $o=jo;jo.stringify,jo.fromJSON,jo.plugin,jo.parse,jo.list,jo.document,jo.comment,jo.atRule,jo.rule,jo.decl,jo.root,jo.CssSyntaxError,jo.Declaration,jo.Container,jo.Processor,jo.Document,jo.Comment,jo.Warning,jo.AtRule,jo.Result,jo.Input,jo.Rule,jo.Root,jo.Node;var Ho=n(2110),qo=n.n(Ho),zo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))},Jo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Qo(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 Yo(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 Xo=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Zo(e){return Xo(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 Xo(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)(null==e?void 0:e.url)?document.querySelector(`script[src="${e.url}"]`)?console.log("Library already loaded:",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=>{console.error("Failed to load script:",e.url,t),n(new Error(`Failed to load script: ${e.url}`))},document.head.appendChild(i)})):console.warn("Skipping library with invalid URL:",e);console.log("All JavaScript libraries loaded successfully")}}))}(e))}))}var Ko=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function ei(e,t,n,o){return Ko(this,void 0,void 0,(function*(){var i;const r=yield $t(e,"the_page_body"),s=new No;s.conceptIds=[e],s.inpage=100,s.outputFormat=In.y0,s.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"],Eo(s,"").subscribe((e=>Ko(this,void 0,void 0,(function*(){var t,n;yield function(e){return Jo(this,void 0,void 0,(function*(){var t,n,o,i,r,s,c,a,l,d,u,h,p,f;[{key:"meta_title",value:null===(n=null===(t=null==e?void 0:e[`the_${Vo.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_${Vo.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_${Vo.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===(a=null===(c=null==e?void 0:e[`the_${Vo.PAGE_COMP_NAME}_width`])||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_width},{key:"font_size",value:null===(d=null===(l=null==e?void 0:e[`the_${Vo.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_${Vo.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_${Vo.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){Jo(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":Qo(".fspage { width: [^;]+ !important; }"),o=t?`.fspage { width: ${t} !important; }`:"";break;case"font_size":Qo(".fspage { font-size: [^;]+; }"),o=t?`.fspage { font-size: ${t}px; }`:"";break;case"font_family":Qo(".fspage { font-family: [^;]+; }"),o=t?`.fspage { font-family: ${t}; }`:"";break;case"type":Qo(".fspage { width: 1200px; margin: 0 auto; }"),Qo(".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":Yo(e.replace("meta_",""),t);break;case"meta_description":return void Yo(e.replace("meta_",""),t)}n.textContent+=o}))}(e.key,e.value)}))}))}(null===(n=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.data)||void 0===n?void 0:n[`the_${Vo.PAGE_COMP_NAME}`])})))),document.getElementById("app").classList.add("fspage");const c=document.head.querySelectorAll("style#mystyleid");Array.from(c).forEach((e=>e.remove())),(null===(i=null==r?void 0:r[0])||void 0===i?void 0:i.id)?yield ti(r[0].id,t,n,o):t.innerHTML="<h4>Invalid or Page doesn't exist</h4>"}))}function ti(e,t,n,o){return Ko(this,void 0,void 0,(function*(){try{let i=yield(0,Do.qj)(e),r=i.mainId,s=i.data;const c=yield ri(s,r);return yield oi(r,c,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`),t.textContent=`Error: ${e.message}`}}))}function ni(e,t,n,o){return Ko(this,void 0,void 0,(function*(){try{const i=yield(0,Do.Cp)(e);return yield oi(e,i,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}}))}function oi(e,t,n,o){return Ko(this,arguments,void 0,(function*(e,t,n,o,i=!0){const r=yield ci(e,[],t);if(!r.name)return void(n.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const s=n;yield Zo(r);const c=yield ai(r,s,void 0,o),a=Array.from({length:32},(()=>"abcdef"[Math.floor(6*Math.random())])).join("");n.classList.add(`${a}`),n.style.position="relative";const d=document.createElement("style");d.id="mystyleid";const u=`\n .${a} {\n ${r.css+c.css+Mo} \n }\n `,h=(yield function(e){return zo(this,void 0,void 0,(function*(){try{return(yield $o([qo()()]).process(e,{from:void 0})).css}catch(e){return console.error("Error processing CSS:",e),null}}))}(u))||"";d.innerHTML=h,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))&&Zo(e)}))),document.head.appendChild(d);const p=document.createElement("script");if(p.innerHTML=r.js,s.appendChild(p),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;!function(e){Ko(this,void 0,void 0,(function*(){const t=new No;t.typeConnection="the_widget_documentation",t.name="documentationText",t.selectors=["the_documentation_text"];const n=new No;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 No;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 No;i.conceptIds=[e],i.freeschemaQueries=[t,n],i.inpage=100,i.outputFormat=In.y0,yield Eo(i,"").subscribe((t=>Ko(this,void 0,void 0,(function*(){var n,o,i,r,s,c,a,d,u,h,p;let f;const y=(null===(d=null===(a=null===(c=null===(s=null===(r=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===r?void 0:r.data)||void 0===s?void 0:s.the_documentation)||void 0===c?void 0:c.the_documentation_text)||void 0===a?void 0:a.data)||void 0===d?void 0:d.the_text)||"";y&&(f=y);const v=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==v?void 0:v.length){const e=null==v?void 0:v.map((e=>{var t,n,o,i,r,s,c,a,l,d,u,h,p,f,y,v,g,m,C,w,T,k,I,S,A,N,L,b,_,x,E;const O=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_documentation,B=null===(o=null===(n=null==O?void 0:O.the_documentation_type)||void 0===n?void 0:n.data)||void 0===o?void 0:o.the_type,R=null===(r=null===(i=null==O?void 0:O.the_documentation_content)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_content,G=null===(c=null===(s=null==O?void 0:O.the_documentation_creator_email)||void 0===s?void 0:s.data)||void 0===c?void 0:c.the_creator_email,D=null===(l=null===(a=null==O?void 0:O.the_documentation_doc_title)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_doc_title,F=null===(u=null===(d=null==O?void 0:O.the_documentation_method)||void 0===d?void 0:d.data)||void 0===u?void 0:u.the_method,P=null===(p=null===(h=null==O?void 0:O.the_documentation_method_url)||void 0===h?void 0:h.data)||void 0===p?void 0:p.the_method_url,U=null===(y=null===(f=null==O?void 0:O.the_documentation_bearer_token)||void 0===f?void 0:f.data)||void 0===y?void 0:y.the_bearer_token,W=null===(g=null===(v=null==O?void 0:O.the_documentation_username)||void 0===v?void 0:v.data)||void 0===g?void 0:g.the_username,M=null===(C=null===(m=null==O?void 0:O.the_documentation_password)||void 0===m?void 0:m.data)||void 0===C?void 0:C.the_password,V=null===(T=null===(w=null==O?void 0:O.the_documentation_auth_type)||void 0===w?void 0:w.data)||void 0===T?void 0:T.the_auth_type,j=null==O?void 0:O.the_documentation_s_json_list,$=null===(I=null===(k=null==O?void 0:O.the_documentation_api_script)||void 0===k?void 0:k.data)||void 0===I?void 0:I.the_api_script,H=null===(A=null===(S=null==O?void 0:O.the_documentation_api_body)||void 0===S?void 0:S.data)||void 0===A?void 0:A.the_api_body,q=null===(L=null===(N=null==O?void 0:O.the_documentation_language)||void 0===N?void 0:N.data)||void 0===L?void 0:L.the_language,z=null===(_=null===(b=null==O?void 0:O.the_documentation_return)||void 0===b?void 0:b.data)||void 0===_?void 0:_.the_return,J=null===(E=null===(x=null==O?void 0:O.the_documentation_code_editor)||void 0===x?void 0:x.data)||void 0===E?void 0:E.the_code_editor,Q=null==O?void 0:O.the_documentation_s_doc_url,Y=null==O?void 0:O.the_documentation_s_image_url,X=null==O?void 0:O.the_documentation_s_video_link;let Z={type:B,content:R,creatorEmail:G,title:D};if("blank"===B)Z=Object.assign({},Z);else if("api"===B){const e=[];(null==j?void 0:j.length)&&(null==j||j.forEach((t=>{var n,o,i,r,s,c,a,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===(a=null===(c=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.the_json_list)||void 0===c?void 0:c.the_json_list_value)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_value})}))),Z=Object.assign(Object.assign({},Z),{method:F,methodURL:P,authType:V,username:W,password:M,bearerToken:U,json:e,script:$,body:H})}else"function"===B&&(Z=Object.assign(Object.assign({},Z),{language:q,return:z,codeEditor:J}));const K=[],ee=[],te=[];return(null==Y?void 0:Y.length)&&(null==Y||Y.forEach((e=>{var t;K.push(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.the_image_url)}))),(null==X?void 0:X.length)&&(null==X||X.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:K,linkList:te,videoList:ee}),Z}));f=e}yield function(){return Ko(this,void 0,void 0,(function*(){document.getElementById("widget-documentation-preview-modal").showModal()}))}(),function(e,t){Ko(this,void 0,void 0,(function*(){const n=document.getElementById("documentation-view");if(0!=l.B.DOCUMENTATION_WIDGET)return void(yield ti(l.B.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 c="";switch(null==e?void 0:e.type){case"api":c="API";break;case"function":c="Functions and Classes";break;case"imgAndLink":c="Images and Links";break;default:c=""}s.innerHTML=`\n ${null==e?void 0:e.title} ${c?"("+c+")":""}\n `,null==o||o.appendChild(s);const a=document.createElement("div");a.classList.add("widget-doc-content"),(null==e?void 0:e.content)&&(a.innerHTML=e.content,null==o||o.appendChild(a));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 `:"",v=(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 ${v}\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)}))))}))}(null==t?void 0:t.getAttribute("widget-id"))}))}));const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach((e=>{e.addEventListener("click",(()=>{!function(){Ko(this,void 0,void 0,(function*(){const e=document.getElementById("widget-documentation-preview-modal"),t=null==e?void 0:e.querySelector("form");null==t||t.reset(),null==e||e.close()}))}()}))}))}return s.querySelectorAll(".wb-initial-empty").forEach((e=>{e.classList.remove("wb-initial-empty")})),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach((e=>{e.removeAttribute("onclick")})),c}))}function ii(e,t){return Ko(this,void 0,void 0,(function*(){var n,o,i,r,s,c,a,l,d,u,h,p;const f=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),f&&f.length)for(let e=0;e<f.length;e++){const n=f[e];let o=null===(l=null===(a=null===(c=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===c?void 0:c.the_widget_origin)||void 0===a?void 0:a.data)||void 0===l?void 0:l.the_origin;const y=!!(null===(h=null===(u=null===(d=null==n?void 0:n.data)||void 0===d?void 0:d.the_child_widget)||void 0===u?void 0:u.the_child_widget_use_latest)||void 0===h?void 0:h.data);o=Number(o)||!1;let v=null;if(y&&o){const e=yield(0,Do.qj)(o);v=(null===(p=null==e?void 0:e.data)||void 0===p?void 0:p[0])||[],v.useLatest=!0,n.data.the_child_widget.the_child_widget_info=v}n.data.the_child_widget.the_child_widget_info.sChildId=n.id,yield ii(n.data.the_child_widget.the_child_widget_info,t)}}))}function ri(e,t){return Ko(this,void 0,void 0,(function*(){const n=[],o=[...e];try{const e=o.find((e=>e.id===t));yield ii(e,n)}catch(e){console.error("convert to real bulk error",e)}return n}))}function si(e){return Ko(this,arguments,void 0,(function*(e,t=[],n=""){let o=yield(0,Do.Cp)(e);const i=yield ri(o,e);return yield ci(e,[],i)}))}function ci(e){return Ko(this,arguments,void 0,(function*(e,t=[],n,o=""){var i,r,s,c,a,l,d,u,h,p,f,y,v,g,m,C,w,T,k,I,S,A,N,L,b,_,x,E,O,B,R,G,D,F,P,U,W,M,V,j,$,H,q,z,J,Q,Y,X,Z,K,ee,te,ne,oe,ie,re,se;try{const ce=new Bo,ae=(0,Do.ix)(n,e);t.push(e);const le=null===(i=null==ae?void 0:ae.data)||void 0===i?void 0:i.the_widget;ce.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,ce.html=null===(a=null===(c=null==le?void 0:le.the_widget_html)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_html,ce.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,ce.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,ce.origin=Number((null===(f=null===(p=null==le?void 0:le.the_widget_origin)||void 0===p?void 0:p.data)||void 0===f?void 0:f.the_origin)||(null===(v=null===(y=null==le?void 0:le.the_widget_origin)||void 0===y?void 0:y.data)||void 0===v?void 0:v.the_originid)),ce.version=null===(m=null===(g=null==le?void 0:le.the_widget_version)||void 0===g?void 0:g.data)||void 0===m?void 0:m.the_version,ce.clean=null===(w=null===(C=null==le?void 0:le.the_widget_clean)||void 0===C?void 0:C.data)||void 0===w?void 0:w.the_clean,ce.timestamp=null===(k=null===(T=null==le?void 0:le.the_widget_timestamp)||void 0===T?void 0:T.data)||void 0===k?void 0:k.the_timestamp,ce.id=null==ae?void 0:ae.id;const de=null===(S=null===(I=null==le?void 0:le.the_widget_type)||void 0===I?void 0:I.data)||void 0===S?void 0:S.the_type;ce.type="null"==de||null==de?"the_element_name":de,ce.after_render=null===(N=null===(A=null==le?void 0:le.the_widget_after_render)||void 0===A?void 0:A.data)||void 0===N?void 0:N.the_after_render,ce.before_render=null===(b=null===(L=null==le?void 0:le.the_widget_before_render)||void 0===L?void 0:L.data)||void 0===b?void 0:b.the_before_render,ce.update=null===(x=null===(_=null==le?void 0:le.the_widget_update)||void 0===_?void 0:_.data)||void 0===x?void 0:x.the_update,ce.widgetId=e,ce.mount_child=null===(O=null===(E=null==le?void 0:le.the_widget_mount_child)||void 0===E?void 0:E.data)||void 0===O?void 0:O.the_mount_child;const ue=null==le?void 0:le.the_widget_s_child;ae.useLatest&&(ce.useLatest=!0),ae.sChildId&&(ce.sChildId=ae.sChildId);const he=null===(B=null==le?void 0:le.the_widget_s_css_library)||void 0===B?void 0:B.map((e=>{var t,n,o,i,r,s,c,a;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===(a=null===(c=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===c?void 0:c.data)||void 0===a?void 0:a.the_url}})),pe=null===(R=null==le?void 0:le.the_widget_s_js_library)||void 0===R?void 0:R.map((e=>{var t,n,o,i,r,s,c,a;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===(a=null===(c=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===c?void 0:c.data)||void 0===a?void 0:a.the_url}}));ce.library={css:he||[],js:pe||[]};const fe=null===(D=null===(G=null==le?void 0:le.the_widget_assistant)||void 0===G?void 0:G.data)||void 0===D?void 0:D.the_assistant;ce.assistant={id:null===(P=null===(F=null==fe?void 0:fe.the_assistant_id)||void 0===F?void 0:F.data)||void 0===P?void 0:P.the_id,input:null===(W=null===(U=null==fe?void 0:fe.the_assistant_input)||void 0===U?void 0:U.data)||void 0===W?void 0:W.the_input,type:null===(V=null===(M=null==fe?void 0:fe.the_assistant_type)||void 0===M?void 0:M.data)||void 0===V?void 0:V.the_type};const ye=null===(j=null==le?void 0:le.the_widget_s_custom_function)||void 0===j?void 0:j.map((e=>{var t,n,o,i,r,s,c;const a=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==a?void 0:a.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==a?void 0:a.the_custom_function_slug)||void 0===i?void 0:i.data)||void 0===r?void 0:r.the_slug,code:null===(c=null===(s=null==a?void 0:a.the_custom_function_code)||void 0===s?void 0:s.data)||void 0===c?void 0:c.the_code}}));if(ce.custom_functions=ye,null==ue?void 0:ue.length)for(let e=0;e<ue.length;e++){const i=(null===(q=null===(H=null===($=ue[e])||void 0===$?void 0:$.data.the_child_widget)||void 0===H?void 0:H.the_child_widget_info)||void 0===q?void 0:q.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 ci(i,t,n,o),s=null===(te=null===(ee=null===(K=null===(Z=null===(X=ue[e])||void 0===X?void 0:X.data)||void 0===Z?void 0:Z.the_child_widget)||void 0===K?void 0:K.the_child_widget_type)||void 0===ee?void 0:ee.data)||void 0===te?void 0:te.the_type,c=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=c,ce.children.push(r)}return ce}catch(e){throw e instanceof Error&&console.error("error converting bulkwidget to widget tree",e.message),e}}))}function ai(e,t){return Ko(this,arguments,void 0,(function*(e,t,n=!0,o,i,r=null){var s,c;const a=new yo;a.html=e.html,r&&(a.parentWidget=li(r)),a.widgetType=e.type,a.componentDidMountFunction=e.before_render,a.addEventFunction=e.after_render,a.mountChildWidgetsFunction=e.mount_child,a.widgetState=Object.assign({},i),a.customFunctions=e.custom_functions,o&&(a.data=o),t.innerHTML="";const l=t;if(l&&(yield a.mount(l),e.widget=a,e.children.length>0&&(null===(s=a.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){const n=e.children[t];for(let e=0;e<a.childWidgetElement.length;e++){const t=a.childWidgetElement[e];if(n.wrapper===t.id){const e=ui(n);n.html=`<div id="${n.wrapper}">${n.html}</div>`;const o=yield ai(e,t,!1,a.data,a.widgetState,a);a.childWidgets.push(o),a.css=a.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&&(a.childrenData[n]=e)}))}}}return console.log("newWidget ->",a,e),yield pi(t,".widget_container"),a}))}function li(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 di(e,t){return Ko(this,arguments,void 0,(function*(e,t,n=!0,o,i,r=null){var s,c;let a=new yo;a.html=e.html,r&&(a.parentWidget=li(r)),a.widgetState=Object.assign({},o),a.widgetType=e.type,a.componentDidMountFunction=e.before_render,a.addEventFunction=e.after_render,a.mountChildWidgetsFunction=e.mount_child,a.customFunctions=e.custom_functions,a.inDevelopment=!1!==i,t.innerHTML="";let l=t;if(l&&(yield a.mount(l),e.widget=a,e.children.length>0&&(null===(s=a.childWidgetElement)||void 0===s?void 0:s.length)>0))for(let t=0;t<(null===(c=e.children)||void 0===c?void 0:c.length);t++){let n=e.children[t];for(let e=0;e<a.childWidgetElement.length;e++){let t=a.childWidgetElement[e];if(n.wrapper===t.id){const e=ui(n),o=yield di(e,t,!1,a.widgetState,i,a);a.childWidgets.push(o),a.css=a.css+o.css+`#${t.id} { ${n.css} }`,o.dataChange((e=>{var t;console.log("This is the data change in child",e);let n=null===(t=null==e?void 0:e.type)||void 0===t?void 0:t.characterValue;n&&(a.childrenData[n]=e),console.log("new child data",a.childrenData)}))}}}return console.log("newWidget ->",a,e),a}))}function ui(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 hi(e,t){return Ko(this,void 0,void 0,(function*(){return e&&1===e.nodeType&&e.querySelectorAll(t).forEach((e=>{for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.remove()})),e}))}function pi(e,t){return Ko(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 hi(e.firstChild,t);n.insertBefore(o,e)}n.removeChild(e)}}}))}var fi=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function yi(e){return fi(this,arguments,void 0,(function*(e,t=null,n="",o={concepts:[],connections:[]}){var i,r,s,c;if(Oi)try{const a=yield Mi("CreateData",{json:e,ofConcept:t,typeConcept:n,actions:o});return(null===(r=null===(i=null==a?void 0:a.actions)||void 0===i?void 0:i.concepts)||void 0===r?void 0:r.length)&&(o.concepts=JSON.parse(JSON.stringify(a.actions.concepts))),(null===(c=null===(s=null==a?void 0:a.actions)||void 0===s?void 0:s.connections)||void 0===c?void 0:c.length)&&(o.connections=JSON.parse(JSON.stringify(a.actions.connections))),a.data}catch(e){console.error("CreateTheComposition sw error: ",e),qi(e)}let a=999,l=999,d=(0,M.o)();for(const i in e){let r=vi(i);if("string"!=typeof e[i]&&"number"!=typeof e[i])if(null==t||0==t.id)d=yield(0,K.k)(r,"",!0,a,4,l,void 0,o),Array.isArray(e[i])&&(r=gi(r)),yield yi(e[i],d,r,o);else{Array.isArray(e[i])&&(r=mi(r));let s=mi(i),c=yield(0,K.k)(r,"",!0,a,4,l,void 0,o);d=c;let u=wi(n,s),h=yield(0,le.$)(u,l,a,a,o);yield(0,zt.F)(t.id,c.id,h.id,1e3,h.characterValue,a,o),Array.isArray(e[i])&&(r=gi(r)),yield yi(e[i],c,r,o)}else{let r=wi(n,i),s=yield(0,le.$)(r,l,a,a,o),c=yield(0,K.k)(i,e[i].toString(),!1,a,4,l,void 0,o);console.log("this is the type concept in down",s,c),null!=t&&(yield(0,zt.F)(t.id,c.id,s.id,1e3,r,a,o))}}return d}))}function vi(e){return e.startsWith("the_")?e:"the_"+e}function gi(e){return e.endsWith("_s")?e:e+"_s"}function mi(e){return e.replace(/_s$/,"")}const Ci=e=>/^[+-]?\d+(\.\d+)?$/.test(e);function wi(e,t){return Ci(t)?e+"_":e+"_"+function(e){return e.startsWith("the_")?e.slice(4):e}(t)}class Ti{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 ki(e,t){if(Array.isArray(e)&&Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);return e}var Ii=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function Si(e){return Ii(this,arguments,void 0,(function*(e,t=null){let n=[],o=[],i=[],r=(0,M.o)();try{null==t&&(t=new mo,yield t.initialize());let s=[];if(e.isCompositional){if(r=yield function(e,t,n,o){return Ii(this,void 0,void 0,(function*(){let i=(0,M.o)(),r=yield o.MakeTheInstanceConceptLocal("the_composition","",!0,999,999,999),s=yield o.MakeTheTypeConceptLocal("the_composition_type",999,999,999),c=yield o.MakeTheTypeConceptLocal(e,999,999,999),a=yield o.CreateTheConnectionLocal(r.id,c.id,s.id,1e3,"the_composition_type");return i=r,t.push(s),t.push(c),n.push(a),i}))}(e.prototype,n,o,t),e.isQueryType){let o=yield function(e,t,n){return Ii(this,void 0,void 0,(function*(){let o=[],i=[],r="the_composition_filter_type",s="the_composition_selector",c=yield n.MakeTheTypeConceptLocal(r,999,999,999),a=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,a.id,1e3,s,999);i.push(u);let h=yield n.CreateTheConnectionLocal(t.id,d.id,c.id,1e3,r,999);i.push(h)}return{concepts:o,connections:i}}))}(e.querySelector,r,t),s=o.concepts;ki(i,o.connections),ki(n,s)}if(e.options.length>0){let o=yield function(e,t,n){return Ii(this,void 0,void 0,(function*(){let o=[],i=[],r="the_composition_s_option",s=yield n.MakeTheTypeConceptLocal(r,999,999,999);for(let c=0;c<e.length;c++){let a=e[c].type,l=e[c].value,d=yield n.MakeTheInstanceConceptLocal(a,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;ki(i,o.connections),ki(n,s)}}else r=yield function(e,t){return Ii(this,void 0,void 0,(function*(){let n=yield(0,z.A)(5124),o=yield t.MakeTheTypeConceptLocal(e,999,999,999),i=yield function(e,t,n,o){return Ii(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 Ni(e.required,r,n,t,!0),s=yield Ni(e.optional,r,n,t),n.push(r);let c=Ai(r,!0,!0),a=yield t.MakeTheTypeConceptLocal(c,999,999,999);if(n.push(a),e.childPrototypes.length>0)for(let o=0;o<e.childPrototypes.length;o++){let s=yield Si(e.childPrototypes[o]),l=s.mainConcept,d=s.connections,u=s.concepts,h=yield t.CreateTheConnectionLocal(r.id,l.id,a.id,1e3,c,999);i.push(h),ki(i,d),ki(n,u),n.push(l)}ki(i,s),ki(i,o),ki(n,e.addedConcepts),ki(i,e.addedConnections),e.concepts=n,e.connections=i,console.log("this is the connections",i)}catch(e){null==t||t.rollbackTransaction()}return{concepts:n,connections:i,mainConcept:r}}))}function Ai(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 Ni(e,t,n,o){return Ii(this,arguments,void 0,(function*(e,t,n,o,i=!1,r=!1){let s=[],c=[],a=Ai(t,i,r),l=yield o.MakeTheTypeConceptLocal(a,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,a,999);c.push(n)}for(let e=0;e<s.length;e++)n.push(s[e]);return c}))}var Li=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function bi(e){return Li(this,void 0,void 0,(function*(){let t;try{const n=yield fetch(l.B.GetCachedImage(e),{method:"GET"});return n.ok?t=n.body:(console.log("Error in Getting Image",n.status),(0,u.ry)(n)),t}catch(e){throw e instanceof Error?console.log("Error in Getting Local concept by character value error message: ",e):console.log("Error in Getting Local concept by character value unexpected error: ",e),t}}))}var _i=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};function xi(e){return _i(this,arguments,void 0,(function*(e,t="normal"){let n,o=e.split("/").pop();if("small"==t){let e=null==o?void 0:o.split(".");e&&(o=e[0]+"_small."+e[1])}return o&&(n=yield bi(o)),n}))}function Ei(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(".");e&&(o=e[0]+"_small."+e[1])}o&&(n=l.B.GetCachedImage(o))}}catch(t){console.log("This url has error",e)}return n}var Oi,Bi=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};const Ri=Date.now().toString(36)+Math.random().toString(36).substring(2);let Gi=[],Di=[],Fi=!1;function Pi(e){Fi=e}function Ui(e="",t){Be.b.BearerAccessToken=e,Oi&&Mi("updateAccessToken",{accessToken:e,session:Be.b.sessionId})}function Wi(){return Bi(this,arguments,void 0,(function*(e="",t="",n="",o="",i=!0,s="",c=void 0,a={},d={}){var h;try{l.B.BASE_URL=e,l.B.AI_URL=t,l.B.NODE_URL=o,l.B.BASE_APPLICATION=s,l.B.LOG_SERVER=null!==(h=d.logserver)&&void 0!==h?h:"https://logdev.freeschema.com",console.log("setting the logserver",l.B.LOG_SERVER,d.logserver),Ui(n);let i=Math.floor(1e8*Math.random());l.B.setRandomizer(i);const p={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1};if(l.B.FLAGS=p,l.B.FLAGS=Object.assign(Object.assign({},p),a),function(e){const t=so.V.logfunction("initializeFlags",arguments);try{return e.logApplication&&(co.initialize(),so.V.logApplicationActivationStatus=!0,console.warn("Application log started.")),e.logPackage&&(so.V.logPackageActivationStatus=!0,console.warn("Package log started.")),e.accessTracker&&(xe.J.activateStatus=!0,console.warn("Access Tracker Activated.")),e.isTest&&(r.B.isDataLoaded=!0,r.B.isCharacterLoaded=!0,r.B.isTypeLoaded=!0,r.B.isLocalDataLoaded=!0,r.B.isLocalTypeLoaded=!0,r.B.isLocalCharacterLoaded=!0,r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0,r.B.isLocalConnectionLoaded=!0),so.V.logUpdate(t),e}catch(e){throw(0,u.ey)(t,"initializeFlags",e),e}}(l.B.FLAGS),!("serviceWorker"in navigator))return yield ji(),void console.warn("Service Worker not supported in this browser.");if(yield function(){return Bi(this,void 0,void 0,(function*(){var e;let t=sessionStorage.getItem("cacheServers"),n=sessionStorage.getItem("config"),o=null!==(e=sessionStorage.getItem("session"))&&void 0!==e?e:"999",i=parseInt(o);void 0!==t&&"undefined"!==t||(l.B.NODE_CACHE_URL=l.B.BASE_URL),t=JSON.parse(t);const r=JSON.parse(n);t&&r&&r.documentationWidget&&999!=i?(Array.isArray(t)&&t.length?l.B.NODE_CACHE_URL=t[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,Be.b.setSession(i),l.B.DOCUMENTATION_WIDGET=r.documentationWidget):yield function(){return Bi(this,void 0,void 0,(function*(){var e,t;let n;try{let o=null!==(t=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.hostname)&&void 0!==t?t:"boomconsole";if(n=yield fetch(l.B.getAppConfig()+"?application="+o,{method:"POST"}),!n.ok)throw new Error("Failed to sync data to the server.");const i=yield n.json();i.success&&(sessionStorage.setItem("cacheServers",JSON.stringify(i.servers)),sessionStorage.setItem("config",JSON.stringify(i.config)),sessionStorage.setItem("session",i.session),Be.b.setSession(i.session),i.servers?l.B.NODE_CACHE_URL=i.servers[0]:l.B.NODE_CACHE_URL=l.B.BASE_URL,i.config&&(l.B.DOCUMENTATION_WIDGET=i.config.documentationWidget))}catch(e){console.error("error getting app config from server",e.message)}}))}(),console.log("before the payload in app",Be.b.sessionId),navigator.serviceWorker&&navigator.serviceWorker.controller&&Mi("SESSION_DATA",{type:"SESSION_DATA",data:l.B.NODE_CACHE_URL,session:Be.b.sessionId})}))}(),function(){navigator.serviceWorker.addEventListener("message",(e=>Bi(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){console.error("Error during listenPostMessage",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(){ro.x.addEventListener("message",(e=>Bi(this,void 0,void 0,(function*(){const{type:t,payload:n}=e.data;if(!t)return;let o={success:!1,data:void 0};Vi[t]?yield Vi[t](n):console.warn(`Unable to handle "${t}" case in BC service worker`)}))))}(),c&&c.activate&&c.manual)yield new Promise(((e,t)=>{navigator.serviceWorker.ready.then((t=>Bi(this,void 0,void 0,(function*(){console.log("registraions ready",t),Oi=t.active,yield zi(),e("done")})))).catch((e=>{console.error("Error: Ready service worker",e),t(e)})).finally((()=>console.log("Finally service worker ready done"))),setTimeout((()=>t("Timeout ready")),3e4)}));else if(c&&(null==c?void 0:c.activate))try{console.log("service worker initialiing"),yield function(e){var t=arguments;return Bi(this,void 0,void 0,(function*(){const n=so.V.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=>Bi(this,void 0,void 0,(function*(){console.log("Service Worker registered:",e),setInterval((()=>{Di.length&&Hi()}),2e3),console.log("update listen start"),e.onupdatefound=()=>{const n=e.installing;console.log("new worker",n),n&&(n.onstatechange=()=>Bi(this,void 0,void 0,(function*(){console.warn("on state change triggered",n.state,navigator.serviceWorker.controller),"installing"===n.state&&(console.log("Service Worker installing"),Oi=void 0),"activated"!==n.state&&"redundant"!==n.state||!navigator.serviceWorker.controller||(Oi=n,console.log("New Service Worker is active",e),setTimeout((()=>{console.log("Message Processed after some time"),Hi()}),5e3),yield zi(),s=!0,Hi(),t())})))},e.addEventListener("controllerchange",(()=>Bi(this,void 0,void 0,(function*(){console.warn("controller change triggered",navigator.serviceWorker.controller),navigator.serviceWorker.controller&&(Oi=navigator.serviceWorker.controller,console.warn("Service worker has been activated; controller change"),yield zi())})))),(e.installing||e.waiting||e.active)&&e.addEventListener("statechange",(e=>Bi(this,void 0,void 0,(function*(){var t;"activating"===(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.state)&&(Oi=navigator.serviceWorker.controller,console.warn("Service Worker is activating statechange"),yield zi())})))),e.active?(console.log("active sw"),Oi=e.active,yield zi(),Hi(),t()):setTimeout((()=>{s||o("Not Completed Initialization")}),1e4)})))).catch((e=>Bi(this,void 0,void 0,(function*(){yield ji(),o(e),console.error("Service Worker registration failed:",e),(0,u.ey)(n,"handleRegisterServiceWorker",e)}))))}))}))}(c)}catch(e){yield ji(),console.error("Unable to start service worker",e)}else yield ji(),console.warn("Service Worker not activated");return!0}catch(e){yield ji(),console.warn("Cannot initialize the system",e)}}))}function Mi(e,t){return Bi(this,arguments,void 0,(function*(e,t,n=0){let o=!1;const i=Math.random().toString(36).substring(2);t.messageId=i,t.TABID=Ri;const r=JSON.parse(JSON.stringify(t));let s;return"checkProcess"!=e&&0==n&&(s=setInterval((()=>Bi(this,void 0,void 0,(function*(){if(!o&&!(yield function(e,t){return Bi(this,void 0,void 0,(function*(){var n;try{const o=yield Mi("checkProcess",{checkMessageId:e});if(console.log("check interval data res for type ",t,e,o.data),null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.processing)return!0}catch(n){return console.error("error on checing executing process",t,e,n),!1}}))}(i,e))&&(clearInterval(s),!o)){if(console.log("Failed to handle type "+e+" message not found "+i,"retrying: ",0==n,e),0==n&&"checkProcess"!=e)return console.log("retrying ",e,i),yield Mi(e,t,n+1);console.log("Failed to handle type "+e+" "+i)}}))),2e3)),new Promise(((n,c)=>{if(navigator.serviceWorker.controller||Oi||console.log("",navigator.serviceWorker.controller,Oi,e),navigator.serviceWorker.controller||Oi){const a=r=>{var l,d,h,p,f,y;(null===(l=null==r?void 0:r.data)||void 0===l?void 0:l.messageId)==i&&(o=!0,clearInterval(s),r.data.success||(401==(null===(d=null==r?void 0:r.data)||void 0===d?void 0:d.status)?c((0,u.ry)(new Response("Unauthorized",{status:401,statusText:null===(h=null==r?void 0:r.data)||void 0===h?void 0:h.statusText}))):500==(null===(p=null==r?void 0:r.data)||void 0===p?void 0:p.status)?c((0,u.Mb)(new Response("Internal Server Error",{status:500,statusText:null===(f=null==r?void 0:r.data)||void 0===f?void 0:f.statusText}))):(console.error("Error in the response from worker:",r),c(`Failed to handle action ${e} ${JSON.stringify(t)}, Response: ${JSON.stringify(r.data)}`))),(null===(y=r.data)||void 0===y?void 0:y.actions)&&(t.actions=JSON.parse(JSON.stringify(r.data.actions))),n(r.data),navigator.serviceWorker.removeEventListener("message",a))};if(navigator.serviceWorker.addEventListener("message",a),navigator.serviceWorker.controller)"checkProcess"!=e&&console.log("sent to sw",e,i),navigator.serviceWorker.controller.postMessage({type:e,payload:r});else if(Oi){console.warn(`controller not found but serviceWorker is available. messageId: ${i}, type: ${e}`);try{Oi.postMessage({type:e,payload:r})}catch(t){console.log("Retrying again on catch service worker",t),Oi.postMessage({type:e,payload:r})}}else console.warn(`Service Worker hasn't loaded yet. messageId: ${i}, type: ${e}`),console.info("ready",navigator.serviceWorker.ready),setTimeout((()=>{console.warn(`Re-Trying after certain time. messageId: ${i}, type: ${e}`),Oi?(console.info("This is triggered "),null==Oi||Oi.postMessage({type:e,payload:t})):(console.log("not ready",e),clearInterval(s),c("Service worker not ready"))}),3e4);setTimeout((()=>{clearInterval(s),c(`No response from service worker after timeout: ${e}`),navigator.serviceWorker.removeEventListener("message",a)}),21e4)}else Di.push({message:{type:e,payload:r}}),"init"==e&&(clearInterval(s),n(null))}))}))}const Vi={GetLinkListener:e=>Bi(void 0,void 0,void 0,(function*(){const t=Gi.find((t=>t.listenerId==e.listenerId));return null==t||t.callback(e.data),{success:!0}})),dispatchEvent:e=>Bi(void 0,void 0,void 0,(function*(){if(Oi){let t=new CustomEvent(e.id||"",e.data);dispatchEvent(t)}return{success:!0}})),checkInit:e=>Bi(void 0,void 0,void 0,(function*(){return console.log("service worker init 0"),navigator.serviceWorker.controller&&(console.log("service worker init 1"),Oi=navigator.serviceWorker.controller),yield zi(),{success:!0}}))};function ji(){return Bi(this,void 0,void 0,(function*(){yield(0,io.A)();const e=(new Date).getTime();yield(0,i.A)().then((()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare concept data is ",t)})).catch((e=>{throw e})),yield(0,oo.Ay)().then((()=>{let t=(new Date).getTime()-e;console.log("The time taken to prepare local concept ",t)})).catch((e=>{throw e})),yield(0,no.p)().then((()=>{r.B.isLocalConnectionLoaded=!0})).catch((e=>{throw e})),yield(0,oo.xd)().catch((e=>{throw console.log("This is the error in populating binary tree"),e})),yield(0,no.a)().then((()=>{r.B.isConnectionLoaded=!0,r.B.isConnectionTypeLoaded=!0;let t=(new Date).getTime()-e;console.log("The time taken to prepare connections ",t)})).catch((e=>{throw e}))}))}function $i(e,t={}){if(Oi||"undefined"!=typeof window){let n=new CustomEvent(`${e}`,t);dispatchEvent(n)}else ro.x.postMessage({type:"dispatchEvent",payload:{id:e,data:t}})}function Hi(){return Bi(this,void 0,void 0,(function*(){console.log("message queue",Di);const e=Di.find((e=>{var t;return"init"==(null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.type)}));if(e){console.log("Processing Init Queue poped",null==e?void 0:e.type,e);const t=Di.indexOf(e);t>-1&&Di.splice(t,1),yield Mi(null==e?void 0:e.type,null==e?void 0:e.payload)}for(console.log("message queue while",Di);Di.length>0;){const{message:e,resolve:t,reject:n}=Di.shift();console.log("Queue poped",e.type,e),yield Mi(e.type,e.payload)}}))}const qi=e=>{if(e instanceof j.z)throw console.error("FreeSchemaResponse Error",e),e;console.error("Service Worker Error",e)};function zi(){return Bi(this,void 0,void 0,(function*(){yield Mi("init",{url:l.B.BASE_URL,aiurl:l.B.AI_URL,accessToken:Be.b.BearerAccessToken,nodeUrl:l.B.NODE_URL,enableAi:!1,applicationName:l.B.BASE_APPLICATION,flags:l.B.FLAGS})}))}},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")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},9746:()=>{},9977:()=>{},197:()=>{},1866:()=>{},2739:()=>{},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}}}},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(949),i=o.ADMIN,r=o.ALLID,s=o.AccessTracker,c=o.AddGhostConcept,a=o.Anomaly,l=o.BaseUrl,d=o.BinaryTree,u=o.BuildWidgetFromId,h=o.BuilderStatefulWidget,p=o.Composition,f=o.CompositionBinaryTree,y=o.CompositionNode,v=o.Concept,g=o.ConceptsData,m=o.Connection,C=o.ConnectionData,w=o.CountInfo,T=o.CreateComposition,k=o.CreateConnection,I=o.CreateConnectionBetweenEntityLocal,S=o.CreateConnectionBetweenTwoConcepts,A=o.CreateConnectionBetweenTwoConceptsGeneral,N=o.CreateConnectionBetweenTwoConceptsLocal,L=o.CreateData,b=o.CreateDefaultConcept,_=o.CreateDefaultLConcept,x=o.CreateSession,E=o.CreateSessionVisit,O=o.CreateTheCompositionLocal,B=o.CreateTheCompositionWithCache,R=o.CreateTheConnection,G=o.CreateTheConnectionGeneral,D=o.CreateTheConnectionLocal,F=o.DATAID,P=o.DATAIDDATE,U=o.DATAV2,W=o.DelayFunctionExecution,M=o.DeleteConceptById,V=o.DeleteConceptLocal,j=o.DeleteConnectionById,$=o.DeleteConnectionByIdBulk,H=o.DeleteConnectionByType,q=o.DeleteConnectionByTypeBulk,z=o.DeleteUser,J=o.DependencyObserver,Q=o.FilterSearch,Y=o.FormatFromConnections,X=o.FormatFromConnectionsAltered,Z=o.FreeschemaQuery,K=o.FreeschemaQueryApi,ee=o.GetAllConnectionsOfComposition,te=o.GetAllConnectionsOfCompositionBulk,ne=o.GetAllTheConnectionsByTypeAndOfTheConcept,oe=o.GetComposition,ie=o.GetCompositionBulk,re=o.GetCompositionBulkWithDataId,se=o.GetCompositionFromConnectionsWithDataId,ce=o.GetCompositionFromConnectionsWithDataIdFromConnections,ae=o.GetCompositionFromConnectionsWithDataIdInObject,le=o.GetCompositionFromConnectionsWithDataIdIndex,de=o.GetCompositionFromConnectionsWithIndex,ue=o.GetCompositionFromConnectionsWithIndexFromConnections,he=o.GetCompositionFromMemoryWithConnections,pe=o.GetCompositionList,fe=o.GetCompositionListAll,ye=o.GetCompositionListAllWithId,ve=o.GetCompositionListListener,ge=o.GetCompositionListLocal,me=o.GetCompositionListLocalWithId,Ce=o.GetCompositionListWithId,we=o.GetCompositionListWithIdUpdated,Te=o.GetCompositionListener,ke=o.GetCompositionLocal,Ie=o.GetCompositionLocalWithId,Se=o.GetCompositionWithAllIds,Ae=o.GetCompositionWithCache,Ne=o.GetCompositionWithDataIdBulk,Le=o.GetCompositionWithDataIdWithCache,be=o.GetCompositionWithId,_e=o.GetCompositionWithIdAndDateFromMemory,xe=o.GetConceptBulk,Ee=o.GetConceptByCharacter,Oe=o.GetConceptByCharacterAndCategoryLocal,Be=o.GetConceptByCharacterAndType,Re=o.GetConnectionBetweenTwoConceptsLinker,Ge=o.GetConnectionBulk,De=o.GetConnectionById,Fe=o.GetConnectionDataPrefetch,Pe=o.GetConnectionOfTheConcept,Ue=o.GetConnectionTypeForCount,We=o.GetFreeschemaImage,Me=o.GetFreeschemaImageUrl,Ve=o.GetImageApi,je=o.GetLink,$e=o.GetLinkListListener,He=o.GetLinkListener,qe=o.GetLinkRaw,ze=o.GetLinkerConnectionFromConcepts,Je=o.GetLinkerConnectionToConcepts,Qe=o.GetRelation,Ye=o.GetRelationLocal,Xe=o.GetRelationRaw,Ze=o.GetTheConcept,Ke=o.GetTheConceptLocal,et=o.GetUserGhostId,tt=o.JUSTDATA,nt=o.LConcept,ot=o.LConnection,it=o.LISTNORMAL,rt=o.LocalConceptsData,st=o.LocalSyncData,ct=o.LocalTransaction,at=o.Logger,lt=o.LoginToBackend,dt=o.MakeTheInstanceConcept,ut=o.MakeTheInstanceConceptLocal,ht=o.MakeTheTimestamp,pt=o.MakeTheTypeConceptApi,ft=o.MakeTheTypeConceptLocal,yt=o.NORMAL,vt=o.PRIVATE,gt=o.PUBLIC,mt=o.PatcherStructure,Ct=o.Prototype,wt=o.RAW,Tt=o.RecursiveSearchApi,kt=o.RecursiveSearchApiNewRawFullLinker,It=o.RecursiveSearchApiRaw,St=o.RecursiveSearchApiRawFullLinker,At=o.RecursiveSearchApiWithInternalConnections,Nt=o.RecursiveSearchListener,Lt=o.SchemaQuery,bt=o.SchemaQueryListener,_t=o.SearchAllConcepts,xt=o.SearchLinkInternal,Et=o.SearchLinkInternalAll,Ot=o.SearchLinkMultipleAll,Bt=o.SearchLinkMultipleAllObservable,Rt=o.SearchLinkMultipleApi,Gt=o.SearchQuery,Dt=o.SearchStructure,Ft=o.SearchWithLinker,Pt=o.SearchWithTypeAndLinker,Ut=o.SearchWithTypeAndLinkerApi,Wt=o.Selector,Mt=o.SessionData,Vt=o.Signin,jt=o.Signup,$t=o.SignupEntity,Ht=o.SplitStrings,qt=o.StatefulWidget,zt=o.SyncData,Jt=o.TrashTheConcept,Qt=o.UpdateComposition,Yt=o.UpdateCompositionLocal,Xt=o.UserBinaryTree,Zt=o.Validator,Kt=o.ViewInternalData,en=o.ViewInternalDataApi,tn=o.WidgetTree,nn=o.convertFromConceptToLConcept,on=o.convertFromLConceptToConcept,rn=o.convertWidgetTreeToWidget,sn=o.convertWidgetTreeToWidgetWithWrapper,cn=o.createFormFieldData,an=o.createPrototypeLocal,ln=o.dispatchIdEvent,dn=o.getFromDatabaseWithType,un=o.getObjectsFromIndexDb,hn=o.getUserDetails,pn=o.getWidgetBulkFromId,fn=o.getWidgetFromId,yn=o.handleServiceWorkerException,vn=o.hasActivatedSW,gn=o.init,mn=o.orderTheConnections,Cn=o.recursiveFetch,wn=o.recursiveFetchNew,Tn=o.removeAllChildren,kn=o.renderLatestWidget,In=o.renderPage,Sn=o.renderWidget,An=o.searchLinkMultipleListener,Nn=o.sendEmail,Ln=o.sendMessage,bn=o.serviceWorker,_n=o.setHasActivatedSW,xn=o.storeToDatabase,En=o.subscribedListeners,On=o.unwrapContainers,Bn=o.updateAccessToken,Rn=o.uploadAttachment,Gn=o.uploadFile,Dn=o.uploadImage,Fn=o.uploadImageV2,Pn=o.validDocumentFormats,Un=o.validImageFormats;export{i as ADMIN,r as ALLID,s as AccessTracker,c as AddGhostConcept,a as Anomaly,l as BaseUrl,d as BinaryTree,u as BuildWidgetFromId,h as BuilderStatefulWidget,p as Composition,f as CompositionBinaryTree,y as CompositionNode,v as Concept,g as ConceptsData,m as Connection,C as ConnectionData,w as CountInfo,T as CreateComposition,k as CreateConnection,I as CreateConnectionBetweenEntityLocal,S as CreateConnectionBetweenTwoConcepts,A as CreateConnectionBetweenTwoConceptsGeneral,N as CreateConnectionBetweenTwoConceptsLocal,L as CreateData,b as CreateDefaultConcept,_ as CreateDefaultLConcept,x as CreateSession,E as CreateSessionVisit,O as CreateTheCompositionLocal,B as CreateTheCompositionWithCache,R as CreateTheConnection,G as CreateTheConnectionGeneral,D as CreateTheConnectionLocal,F as DATAID,P as DATAIDDATE,U as DATAV2,W as DelayFunctionExecution,M as DeleteConceptById,V as DeleteConceptLocal,j as DeleteConnectionById,$ as DeleteConnectionByIdBulk,H as DeleteConnectionByType,q as DeleteConnectionByTypeBulk,z as DeleteUser,J as DependencyObserver,Q as FilterSearch,Y as FormatFromConnections,X as FormatFromConnectionsAltered,Z as FreeschemaQuery,K as FreeschemaQueryApi,ee as GetAllConnectionsOfComposition,te as GetAllConnectionsOfCompositionBulk,ne as GetAllTheConnectionsByTypeAndOfTheConcept,oe as GetComposition,ie as GetCompositionBulk,re as GetCompositionBulkWithDataId,se as GetCompositionFromConnectionsWithDataId,ce as GetCompositionFromConnectionsWithDataIdFromConnections,ae as GetCompositionFromConnectionsWithDataIdInObject,le as GetCompositionFromConnectionsWithDataIdIndex,de as GetCompositionFromConnectionsWithIndex,ue as GetCompositionFromConnectionsWithIndexFromConnections,he as GetCompositionFromMemoryWithConnections,pe as GetCompositionList,fe as GetCompositionListAll,ye as GetCompositionListAllWithId,ve as GetCompositionListListener,ge as GetCompositionListLocal,me as GetCompositionListLocalWithId,Ce as GetCompositionListWithId,we as GetCompositionListWithIdUpdated,Te as GetCompositionListener,ke as GetCompositionLocal,Ie as GetCompositionLocalWithId,Se as GetCompositionWithAllIds,Ae as GetCompositionWithCache,Ne as GetCompositionWithDataIdBulk,Le as GetCompositionWithDataIdWithCache,be as GetCompositionWithId,_e as GetCompositionWithIdAndDateFromMemory,xe as GetConceptBulk,Ee as GetConceptByCharacter,Oe as GetConceptByCharacterAndCategoryLocal,Be as GetConceptByCharacterAndType,Re as GetConnectionBetweenTwoConceptsLinker,Ge as GetConnectionBulk,De as GetConnectionById,Fe as GetConnectionDataPrefetch,Pe as GetConnectionOfTheConcept,Ue as GetConnectionTypeForCount,We as GetFreeschemaImage,Me as GetFreeschemaImageUrl,Ve as GetImageApi,je as GetLink,$e as GetLinkListListener,He as GetLinkListener,qe as GetLinkRaw,ze as GetLinkerConnectionFromConcepts,Je as GetLinkerConnectionToConcepts,Qe as GetRelation,Ye as GetRelationLocal,Xe as GetRelationRaw,Ze as GetTheConcept,Ke as GetTheConceptLocal,et as GetUserGhostId,tt as JUSTDATA,nt as LConcept,ot as LConnection,it as LISTNORMAL,rt as LocalConceptsData,st as LocalSyncData,ct as LocalTransaction,at as Logger,lt as LoginToBackend,dt as MakeTheInstanceConcept,ut as MakeTheInstanceConceptLocal,ht as MakeTheTimestamp,pt as MakeTheTypeConceptApi,ft as MakeTheTypeConceptLocal,yt as NORMAL,vt as PRIVATE,gt as PUBLIC,mt as PatcherStructure,Ct as Prototype,wt as RAW,Tt as RecursiveSearchApi,kt as RecursiveSearchApiNewRawFullLinker,It as RecursiveSearchApiRaw,St as RecursiveSearchApiRawFullLinker,At as RecursiveSearchApiWithInternalConnections,Nt as RecursiveSearchListener,Lt as SchemaQuery,bt as SchemaQueryListener,_t as SearchAllConcepts,xt as SearchLinkInternal,Et as SearchLinkInternalAll,Ot as SearchLinkMultipleAll,Bt as SearchLinkMultipleAllObservable,Rt as SearchLinkMultipleApi,Gt as SearchQuery,Dt as SearchStructure,Ft as SearchWithLinker,Pt as SearchWithTypeAndLinker,Ut as SearchWithTypeAndLinkerApi,Wt as Selector,Mt as SessionData,Vt as Signin,jt as Signup,$t as SignupEntity,Ht as SplitStrings,qt as StatefulWidget,zt as SyncData,Jt as TrashTheConcept,Qt as UpdateComposition,Yt as UpdateCompositionLocal,Xt as UserBinaryTree,Zt as Validator,Kt as ViewInternalData,en as ViewInternalDataApi,tn as WidgetTree,nn as convertFromConceptToLConcept,on as convertFromLConceptToConcept,rn as convertWidgetTreeToWidget,sn as convertWidgetTreeToWidgetWithWrapper,cn as createFormFieldData,an as createPrototypeLocal,ln as dispatchIdEvent,dn as getFromDatabaseWithType,un as getObjectsFromIndexDb,hn as getUserDetails,pn as getWidgetBulkFromId,fn as getWidgetFromId,yn as handleServiceWorkerException,vn as hasActivatedSW,gn as init,mn as orderTheConnections,Cn as recursiveFetch,wn as recursiveFetchNew,Tn as removeAllChildren,kn as renderLatestWidget,In as renderPage,Sn as renderWidget,An as searchLinkMultipleListener,Nn as sendEmail,Ln as sendMessage,bn as serviceWorker,_n as setHasActivatedSW,xn as storeToDatabase,En as subscribedListeners,On as unwrapContainers,Bn as updateAccessToken,Rn as uploadAttachment,Gn as uploadFile,Dn as uploadImage,Fn as uploadImageV2,Pn as validDocumentFormats,Un as validImageFormats};
|