mftsccs-node 0.2.3 → 0.2.4

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.
Files changed (218) hide show
  1. package/dist/main.bundle.js +2 -0
  2. package/dist/main.bundle.js.LICENSE.txt +1 -0
  3. package/dist/serviceWorker.bundle.js +2 -0
  4. package/dist/serviceWorker.bundle.js.LICENSE.txt +1 -0
  5. package/dist/types/AccessTracker/accessTracker.d.ts +67 -0
  6. package/dist/types/Anomaly/anomaly.d.ts +103 -0
  7. package/dist/types/Api/Create/CreateTheConceptApi.d.ts +1 -1
  8. package/dist/types/Api/Create/CreateTheGhostConceptApi.d.ts +3 -0
  9. package/dist/types/Api/Create/CreateTheGhostConnectionApi.d.ts +2 -0
  10. package/dist/types/Api/Delete/DeleteUserInBackend.d.ts +1 -0
  11. package/dist/types/Api/DeleteConnectionBulkApi.d.ts +1 -0
  12. package/dist/types/Api/DeleteTheConcept.d.ts +1 -1
  13. package/dist/types/Api/DeleteTheConnection.d.ts +1 -1
  14. package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +1 -1
  15. package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +2 -2
  16. package/dist/types/Api/GetCharacterDataByCharacter.d.ts +1 -1
  17. package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +1 -2
  18. package/dist/types/Api/GetConcept.d.ts +6 -2
  19. package/dist/types/Api/GetConceptBulk.d.ts +8 -1
  20. package/dist/types/Api/GetConceptByCharacterAndType.d.ts +1 -2
  21. package/dist/types/Api/GetConnection.d.ts +1 -1
  22. package/dist/types/Api/GetConnectionBulk.d.ts +5 -0
  23. package/dist/types/Api/GetConnectionOfTheConcept.d.ts +1 -2
  24. package/dist/types/Api/GetConnections/GetConnectionsByTypeApi.d.ts +3 -0
  25. package/dist/types/Api/Images/GetImages.d.ts +1 -0
  26. package/dist/types/Api/Local/GetLocalConceptByCharacterValue.d.ts +2 -0
  27. package/dist/types/Api/Login.d.ts +1 -1
  28. package/dist/types/Api/MakeTheTypeConceptApi.d.ts +7 -0
  29. package/dist/types/Api/Prototype/CreatePrototype.d.ts +2 -0
  30. package/dist/types/Api/Prototype/Selector.d.ts +15 -0
  31. package/dist/types/Api/RecursiveSearch.d.ts +6 -1
  32. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +1 -1
  33. package/dist/types/Api/Search/SearchInternalApi.d.ts +1 -0
  34. package/dist/types/Api/Search/SearchWithTypeAndLinker.d.ts +2 -0
  35. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +1 -1
  36. package/dist/types/Api/Signin.d.ts +1 -1
  37. package/dist/types/Api/Signup.d.ts +17 -1
  38. package/dist/types/Api/Translate/TranslateLocalToReal.d.ts +2 -0
  39. package/dist/types/Constants/AccessConstants.d.ts +3 -0
  40. package/dist/types/Constants/FormatConstants.d.ts +1 -0
  41. package/dist/types/Constants/ckeditorCSS.d.ts +1 -0
  42. package/dist/types/Constants/general.const.d.ts +6 -0
  43. package/dist/types/Constants/page.const.d.ts +5 -0
  44. package/dist/types/DataStructures/BaseUrl.d.ts +33 -0
  45. package/dist/types/DataStructures/BinaryTree.d.ts +1 -0
  46. package/dist/types/DataStructures/BinaryTypeTree.d.ts +7 -5
  47. package/dist/types/DataStructures/Concept.d.ts +11 -15
  48. package/dist/types/DataStructures/ConceptData.d.ts +7 -2
  49. package/dist/types/DataStructures/Connection.d.ts +6 -10
  50. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +3 -1
  51. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +3 -0
  52. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionOfNode.d.ts +10 -0
  53. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionOfTheTree.d.ts +24 -0
  54. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeNode.d.ts +10 -0
  55. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +16 -9
  56. package/dist/types/DataStructures/ConnectionBinaryTree/NodePrimitive.d.ts +15 -0
  57. package/dist/types/DataStructures/ConnectionByType/GetConnectionByType.d.ts +4 -0
  58. package/dist/types/DataStructures/ConnectionData.d.ts +11 -3
  59. package/dist/types/DataStructures/Local/LConcept.d.ts +5 -3
  60. package/dist/types/DataStructures/Local/LConnection.d.ts +3 -3
  61. package/dist/types/DataStructures/Local/LNode.d.ts +5 -3
  62. package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +3 -2
  63. package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +3 -2
  64. package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +4 -4
  65. package/dist/types/DataStructures/Local/LocalConceptData.d.ts +16 -9
  66. package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +13 -9
  67. package/dist/types/DataStructures/Local/LocalGhostIdTree.d.ts +11 -0
  68. package/dist/types/DataStructures/Local/LocalId.d.ts +19 -0
  69. package/dist/types/DataStructures/Local/LocalSyncData.d.ts +29 -10
  70. package/dist/types/DataStructures/Node.d.ts +1 -0
  71. package/dist/types/DataStructures/Prototype/Prototype.d.ts +19 -0
  72. package/dist/types/DataStructures/Prototype/PrototypeOption.d.ts +4 -0
  73. package/dist/types/DataStructures/Prototype/QuerySelector.d.ts +4 -0
  74. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +2 -1
  75. package/dist/types/DataStructures/Search/SearchStructure.d.ts +1 -0
  76. package/dist/types/DataStructures/SearchQuery.d.ts +1 -0
  77. package/dist/types/DataStructures/Security/TokenStorage.d.ts +2 -1
  78. package/dist/types/DataStructures/SyncData.d.ts +1 -13
  79. package/dist/types/DataStructures/TypeLibrary.d.ts +19 -0
  80. package/dist/types/DataStructures/TypeNode.d.ts +18 -0
  81. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +5 -7
  82. package/dist/types/DataStructures/User/UserNode.d.ts +3 -5
  83. package/dist/types/DataStructures/WidgetCache/WidgetCache.d.ts +10 -0
  84. package/dist/types/DataStructures/WidgetCache/WidgetDetails.d.ts +9 -0
  85. package/dist/types/DataStructures/WidgetCache/WidgetNode.d.ts +18 -0
  86. package/dist/types/Database/IndexUpdate.d.ts +47 -0
  87. package/dist/types/Database/NoIndexDb.d.ts +1 -1
  88. package/dist/types/Database/indexdblocal.d.ts +40 -0
  89. package/dist/types/Database/indexeddb.d.ts +50 -0
  90. package/dist/types/Helpers/CheckIfExists.d.ts +2 -3
  91. package/dist/types/Helpers/RemoveFromArray.d.ts +1 -2
  92. package/dist/types/Middleware/ApplicationMonitor.d.ts +14 -0
  93. package/dist/types/Middleware/logger.service.d.ts +144 -0
  94. package/dist/types/ServiceWorker/actions/connectionActions.d.ts +2 -0
  95. package/dist/types/ServiceWorker/actions/createActions.d.ts +2 -0
  96. package/dist/types/ServiceWorker/actions/deleteActions.d.ts +2 -0
  97. package/dist/types/ServiceWorker/actions/getActions.d.ts +2 -0
  98. package/dist/types/ServiceWorker/actions/index.d.ts +15 -0
  99. package/dist/types/ServiceWorker/actions/searchActions.d.ts +2 -0
  100. package/dist/types/ServiceWorker/actions/syncActions.d.ts +2 -0
  101. package/dist/types/ServiceWorker/actions/updateActions.d.ts +2 -0
  102. package/dist/types/ServiceWorker/index.d.ts +11 -0
  103. package/dist/types/Services/AccessControl/AccessControl.d.ts +218 -0
  104. package/dist/types/Services/Common/DelayFunction.d.ts +7 -0
  105. package/dist/types/Services/Common/ErrorPosting.d.ts +8 -0
  106. package/dist/types/Services/Common/MergeArrays.d.ts +7 -0
  107. package/dist/types/Services/Common/RemoveAllChild.d.ts +1 -0
  108. package/dist/types/Services/ConceptFinding/GetConceptByCharacterAndCategory.d.ts +0 -1
  109. package/dist/types/Services/Conversion/ConvertConcepts.d.ts +3 -5
  110. package/dist/types/Services/CreateBinaryTreeFromData.d.ts +4 -1
  111. package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +4 -0
  112. package/dist/types/Services/CreateConnection/CreateConnectionEntity.d.ts +2 -0
  113. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +1 -1
  114. package/dist/types/Services/CreateTheComposition.d.ts +1 -2
  115. package/dist/types/Services/CreateTheConcept.d.ts +3 -4
  116. package/dist/types/Services/CreateTheConnection.d.ts +9 -1
  117. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +1 -4
  118. package/dist/types/Services/DeleteConcept.d.ts +2 -1
  119. package/dist/types/Services/DeleteConnection.d.ts +2 -1
  120. package/dist/types/Services/DeleteConnectionByType.d.ts +22 -0
  121. package/dist/types/Services/FindConeceptsFromConnection.d.ts +4 -0
  122. package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +1 -2
  123. package/dist/types/Services/GetComposition.d.ts +139 -1
  124. package/dist/types/Services/GetCompositionBulk.d.ts +94 -5
  125. package/dist/types/Services/GetCompositionList.d.ts +5 -0
  126. package/dist/types/Services/GetConceptByCharacter.d.ts +2 -3
  127. package/dist/types/Services/GetConnectionBetweenTwoConceptsLinker.d.ts +11 -0
  128. package/dist/types/Services/GetConnections.d.ts +1 -2
  129. package/dist/types/Services/GetDataFromIndexDb.d.ts +2 -2
  130. package/dist/types/Services/GetLink.d.ts +1 -1
  131. package/dist/types/Services/GetRelation.d.ts +2 -5
  132. package/dist/types/Services/GetTheConcept.d.ts +7 -0
  133. package/dist/types/Services/InitializeSystem.d.ts +1 -1
  134. package/dist/types/Services/Local/ConvertFromLConceptToConcept.d.ts +2 -0
  135. package/dist/types/Services/Local/ConvertFromLConnectionToConnection.d.ts +2 -0
  136. package/dist/types/Services/Local/CreateConnectionBetweenTwoConceptsLocal.d.ts +3 -0
  137. package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +2 -2
  138. package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +29 -1
  139. package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +14 -2
  140. package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +22 -2
  141. package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +16 -2
  142. package/dist/types/Services/Local/DeleteConceptLocal.d.ts +1 -0
  143. package/dist/types/Services/Local/GetCompositionListLocal.d.ts +12 -0
  144. package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +10 -1
  145. package/dist/types/Services/Local/GetConnectionOfTheConceptLocal.d.ts +2 -0
  146. package/dist/types/Services/Local/GetRelationLocal.d.ts +1 -0
  147. package/dist/types/Services/Local/GetTheConceptLocal.d.ts +9 -0
  148. package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +2 -2
  149. package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +18 -2
  150. package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +16 -2
  151. package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +3 -2
  152. package/dist/types/Services/Mail.d.ts +18 -0
  153. package/dist/types/Services/MakeTheConcept.d.ts +1 -1
  154. package/dist/types/Services/MakeTheInstanceConcept.d.ts +15 -3
  155. package/dist/types/Services/MakeTheTimestamp.d.ts +1 -2
  156. package/dist/types/Services/MakeTheTypeConcept.d.ts +1 -3
  157. package/dist/types/Services/Search/DataIdFormat.d.ts +18 -18
  158. package/dist/types/Services/Search/FormatData.d.ts +20 -10
  159. package/dist/types/Services/Search/NewFormat.d.ts +4 -0
  160. package/dist/types/Services/Search/SearchLinkInternal.d.ts +1 -0
  161. package/dist/types/Services/Search/SearchLinkMultiple.d.ts +53 -1
  162. package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +53 -5
  163. package/dist/types/Services/Security/GetRequestHeader.d.ts +3 -10
  164. package/dist/types/Services/Transaction/LocalTransaction.d.ts +45 -0
  165. package/dist/types/Services/UpdateComposition.d.ts +1 -1
  166. package/dist/types/Services/Upload.d.ts +33 -0
  167. package/dist/types/Services/User/UserFromLocalStorage.d.ts +6 -0
  168. package/dist/types/Services/User/UserTranslation.d.ts +3 -6
  169. package/dist/types/Services/assets/GetImageService.d.ts +14 -0
  170. package/dist/types/Services/automated/automated-concept-connection.d.ts +7 -0
  171. package/dist/types/Services/cacheService.d.ts +1 -0
  172. package/dist/types/Validator/constant.d.ts +3 -0
  173. package/dist/types/Validator/interface.d.ts +19 -0
  174. package/dist/types/Validator/utils.d.ts +7 -0
  175. package/dist/types/Validator/validator.d.ts +37 -0
  176. package/dist/types/Visualize/ConceptCircle.d.ts +35 -0
  177. package/dist/types/Visualize/ConceptCircleList.d.ts +9 -0
  178. package/dist/types/Visualize/ConnectionLine.d.ts +21 -0
  179. package/dist/types/Visualize/ConnectionLineList.d.ts +6 -0
  180. package/dist/types/Visualize/drawExistingConcepts.d.ts +8 -0
  181. package/dist/types/Visualize/helper.d.ts +15 -0
  182. package/dist/types/Visualize/index.d.ts +0 -0
  183. package/dist/types/Widgets/BaseObserver.d.ts +22 -0
  184. package/dist/types/Widgets/BaseWidget.d.ts +24 -0
  185. package/dist/types/Widgets/BuilderSpeceficFunctions.d.ts +2 -0
  186. package/dist/types/Widgets/BuilderStatefulWidget.d.ts +42 -0
  187. package/dist/types/Widgets/CacheWidget.service.d.ts +17 -0
  188. package/dist/types/Widgets/NormalizeStyles.service.d.ts +1 -0
  189. package/dist/types/Widgets/RenderPage.service.d.ts +12 -0
  190. package/dist/types/Widgets/RenderWidgetLibrary.service.d.ts +14 -0
  191. package/dist/types/Widgets/RenderWidgetService.d.ts +50 -0
  192. package/dist/types/Widgets/StatefulWidget.d.ts +102 -0
  193. package/dist/types/Widgets/WidgetBuild.d.ts +4 -0
  194. package/dist/types/Widgets/WidgetTree.d.ts +29 -0
  195. package/dist/types/Widgets/mainView.class.d.ts +6 -0
  196. package/dist/types/WrapperFunctions/DepenedencyObserver.d.ts +73 -0
  197. package/dist/types/WrapperFunctions/GetCompositionListObservable.d.ts +19 -0
  198. package/dist/types/WrapperFunctions/GetCompositionObservable.d.ts +13 -0
  199. package/dist/types/WrapperFunctions/GetLinkListObservable.d.ts +28 -0
  200. package/dist/types/WrapperFunctions/GetLinkObservable.d.ts +32 -0
  201. package/dist/types/WrapperFunctions/RecursiveSearchObservable.d.ts +37 -0
  202. package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +9 -11
  203. package/dist/types/WrapperFunctions/SearchLinkMultipleAllObservable.d.ts +15 -0
  204. package/dist/types/app.d.ts +128 -24
  205. package/dist/types/prototype/getPrototype.service.d.ts +2 -0
  206. package/dist/types/prototype/prototype.service.d.ts +25 -0
  207. package/dist/types/service-worker.d.ts +1 -0
  208. package/package.json +1 -1
  209. package/dist/bundle.js +0 -2
  210. package/dist/bundle.js.LICENSE.txt +0 -1
  211. package/dist/types/DataStructures/Transaction/Transaction.d.ts +0 -30
  212. package/dist/types/Services/AccessControl/AccessControlCacheService.d.ts +0 -19
  213. package/dist/types/Services/AccessControl/AccessControlService.d.ts +0 -267
  214. package/dist/types/Services/AccessControl/PermissionSet.d.ts +0 -8
  215. package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +0 -16
  216. package/dist/types/Services/MakeTheName.d.ts +0 -2
  217. package/dist/types/Services/auth/AuthService.d.ts +0 -1
  218. /package/dist/types/{Services/MakeTheLocalConcept.d.ts → Middleware/ErrorHandling.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see main.bundle.js.LICENSE.txt */
2
+ var 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(3776),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)}})}},38:e=>{class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},71:(e,t)=>{t.__esModule=!0,t.word=t.tilde=t.tab=t.str=t.space=t.slash=t.singleQuote=t.semicolon=t.plus=t.pipe=t.openSquare=t.openParenthesis=t.newline=t.greaterThan=t.feed=t.equals=t.doubleQuote=t.dollar=t.cr=t.comment=t.comma=t.combinator=t.colon=t.closeSquare=t.closeParenthesis=t.caret=t.bang=t.backslash=t.at=t.asterisk=t.ampersand=void 0,t.ampersand=38,t.asterisk=42,t.at=64,t.comma=44,t.colon=58,t.semicolon=59,t.openParenthesis=40,t.closeParenthesis=41,t.openSquare=91,t.closeSquare=93,t.dollar=36,t.tilde=126,t.caret=94,t.plus=43,t.equals=61,t.pipe=124,t.greaterThan=62,t.space=32,t.singleQuote=39,t.doubleQuote=34,t.slash=47,t.bang=33,t.backslash=92,t.cr=13,t.feed=12,t.newline=10,t.tab=9,t.str=39,t.comment=-1,t.word=-2,t.combinator=-3},145:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s},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}},197:()=>{},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},263:(e,t)=>{t.__esModule=!0,t.default=function(e){return e.sort(function(e,t){return e-t})},e.exports=t.default},276:(e,t,n)=>{n.d(t,{y:()=>o});class o{constructor(){this.conceptId=0,this.connectionTypeId=0,this.connectionType="",this.count=0}}},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},396:(e,t,n)=>{let o=n(7793);class i extends o{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=i,i.default=i,o.registerAtRule(i)},425:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i=(o=n(4646))&&o.__esModule?o:{default:o},r=n(1581);function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}var 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},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(3776);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=[]},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})},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},628:(e,t,n)=>{n.d(t,{H:()=>v});var o=n(9581),i=n(3278),r=n(3776),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 v{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!=v.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 v.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=[],v=[];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 y=yield Promise.all(f);for(let e=0;e<y.length;e++){const t=y[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];v.push(a([],t,n))}const g=yield Promise.all(v);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 v=f.concepts,y=f.connections;for(let e=0;e<v.length;e++)h.v.AddPermanentConcept(v[e]);for(let e=0;e<y.length;e++)p.G.AddPermanentConnection(y[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=v.ghostIdMap.get(r))&&void 0!==t?t:r,l=null!==(n=v.ghostIdMap.get(s))&&void 0!==n?n:s,d=null!==(o=v.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)}})}}v.conceptsSyncArray=[],v.connectionSyncArray=[],v.ghostIdMap=new Map,v.transactionCollections=[]},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]))})},991:(e,t,n)=>{n.d(t,{H:()=>c});var o=n(3776),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},999:(e,t,n)=>{n.d(t,{R:()=>l});var o=n(3776),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 v,y,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===(y=null===(v=null==i?void 0:i.actions)||void 0===v?void 0:v.concepts)||void 0===y?void 0:y.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})}},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),v=Boolean(r&&i);function y(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&&(!v||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=r(t.from)),v&&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 y(this)[e-1]+t-1}fromOffset(e){let t=y(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)},1167:(e,t,n)=>{n.d(t,{Y:()=>a});var o=n(9581),i=n(3518),r=n(3776),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)}})}},1213:(e,t,n)=>{n.d(t,{f:()=>a});var o=n(9736),i=n(7820),r=n(3776),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}})}},1218:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(3776),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,v=null!=c?c:0,y=(0,i.o)();for(const o in e)if("string"!=typeof e[o]&&"number"!=typeof e[o])if(null==t&&null==n){let t=v,n=yield(0,s.A)(o,"",!0,h,p,f);y=n,t=n.id,v=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=v,m=yield(0,s.A)(o,"",!0,h,p,f);y=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=v,l=yield(0,s.A)(o,e[o].toString(),!1,h,p,f);yield(0,r.q)(i,c,l.id,a)}return y})}},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(3776),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)("application/json"),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=(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,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})}},1320:(e,t,n)=>{n.d(t,{zl:()=>g,b6:()=>w,e$:()=>k,y6:()=>T,rq:()=>I,yV:()=>m,_W:()=>C});var o=n(3776),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),v=yield(0,o.GetTheConcept)(e[h].toTheConceptId);if(1==p&&0!=f.id&&0!=v.id){let n,a=null!==(r=null===(i=v.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[v.id]={}}catch(e){console.log("this is error",e)}}if(0!=f.id&&0!=v.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==v?void 0:v.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"none",n=v.characterValue;r.characterValue.includes("_s_")&&(v.id in t||(t[v.id]={}),t[v.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),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())})},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())})};function g(e,t){return y(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 y(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 y(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 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=(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 v=yield(0,o.GetTheConcept)(e[p].ofTheConceptId),y=yield(0,o.GetTheConcept)(e[p].toTheConceptId);if(1==f&&0!=v.id&&0!=y.id){let n,l=null!==(s=null===(i=y.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==v?void 0:v.type)||void 0===c?void 0:c.characterValue)&&void 0!==a?a:"none",t=v.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!=v.id&&0!=y.id){let n,i=null!==(d=null===(l=v.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==y?void 0:y.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",t=y.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 y(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 v=yield(0,i.QL)(e),y=yield(0,p.V)(a);v=(0,f.X)(v,h);let g=[];g=yield c(v,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,v=yield(0,l.A)(e[p].ofTheConceptId),y=yield(0,l.A)(e[p].toTheConceptId);if(n.includes(e[p].id)&&(f=!0),1==f&&0!=v.id&&0!=y.id){let n,a=yield(0,l.A)(e[p].typeId),d=null!==(i=null===(o=y.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==v?void 0:v.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"none",o=v.characterValue,i=a.characterValue;""==i&&(i=t,i=r(i));let l={id:v.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!=v.id&&0!=y.id){let n,o=yield(0,l.A)(e[p].typeId),i=null!==(d=null===(a=v.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==y?void 0:y.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",s=y.characterValue,c=o.characterValue,a=!1;""==c&&(c=t,c=r(c),a=!0);let l={};l[t]={id:y.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})}(v,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 v=[],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 o=!1,v=yield(0,l.A)(e[n].ofTheConceptId),y=yield(0,l.A)(e[n].toTheConceptId);if(i.includes(e[n].id)&&(o=!0),1==o&&0!=v.id&&0!=y.id&&y.id in t){let o,i=yield(0,l.A)(e[n].typeId),r=null!==(c=null===(s=y.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=v.id,s.created_on=v.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!=v.id&&0!=y.id&&v.id in t){let o,i=yield(0,l.A)(e[n].typeId),s=null!==(d=null===(a=v.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(v.id,r,o);let g=!1,m=i.characterValue;""==m&&(m=y.characterValue,g=!0),""==m&&(m=(null===(h=null==y?void 0:y.type)||void 0===h?void 0:h.characterValue)||"");try{let i=null!==(f=null===(p=null==y?void 0:y.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:y.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(y.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]),v.push(i)}return v})}(v,g,n,s,y);return m})}function k(e,t,n,s,c){return y(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 v=[];v=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),f=new Set;for(const t of e)f.add(t.ofTheConceptId),f.add(t.toTheConceptId),f.add(t.typeId);const v=Array.from(f),y=yield(0,o.GetConceptBulk)(v),g=new Map;v.forEach((e,t)=>{g.set(e,y[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!==(s=null===(r=p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self",i=t[n.toTheConceptId]||{};i[e]=i[e]||{},t[n.toTheConceptId]=i;const l=null!==(a=null===(c=null==o?void 0:o.type)||void 0===c?void 0:c.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!==(h=null===(u=null==p?void 0:p.type)||void 0===u?void 0:u.characterValue)&&void 0!==h?h:"none",s=p.characterValue;f.characterValue.includes("_s_")&&(t[p.id]=t[p.id]||{},t[p.id][r]=s),t[o.id]={}}}catch(e){console.log("this is error",e)}}return o.Logger.logUpdate(p),t})}(l,v,s),v=yield function(e){var t=arguments;return h(this,arguments,void 0,function*(e,n=[],i=[]){var s,c,a,l,d,u,h,p;const f=o.Logger.logfunction("FormatFunctionDataForData",t),v=new Set;for(const t of e)v.add(t.ofTheConceptId),v.add(t.toTheConceptId),v.add(t.typeId);const y=Array.from(v),g=yield(0,o.GetConceptBulk)(y),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),v=m.get(t.typeId);if(o&&f&&0!==o.id&&0!==f.id)try{if(e){const e=null!==(c=null===(s=f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"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",u=o.characterValue;const h=(v.characterValue||r(d))+"_reverse";h.includes("_s_")||("string"==typeof i[e]&&(i[e]={}),i[e][h]={id:o.id,data:{[d]:u}})}else{const e=null!==(u=null===(d=o.type)||void 0===d?void 0:d.characterValue)&&void 0!==u?u:"self",i=C(n,t.ofTheConceptId,{});C(i,e,{});let s=null!==(p=null===(h=null==f?void 0:f.type)||void 0===h?void 0:h.characterValue)&&void 0!==p?p:"none",c=f.characterValue,a=v.characterValue||r(s);const l={id:f.id,data:{[s]:c}};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,v,s);let y=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,v;const y=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 w=[];for(let n=0;n<e.length;n++){let o=s.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 s=C.get(e[n].typeId),d=null!==(l=null===(a=r.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"self";let h=!1;e[n].toTheConceptId in t&&(h=!0),e[n].toTheConceptId in t?(o=t[e[n].toTheConceptId],"string"==typeof o[d]&&(o[d]={})):(o={},o[d]={},t[e[n].toTheConceptId]=o),u(r.id,c,o);try{if(t[e[n].ofTheConceptId]){const r={id:i.id,data:t[e[n].ofTheConceptId],created_on:e[n].entryTimeStamp},c=s.characterValue+"_reverse";Array.isArray(o[d][c])?o[d][c].push(r):c.includes("_s_")?(o[d][c]=[],o[d][c].push(r)):o[d][c]=r}}catch(e){console.log("this is error",e)}}if(0!==i.id&&0!==r.id&&i.id in t){let o;const s=C.get(e[n].typeId),a=null!==(h=null===(d=i.type)||void 0===d?void 0:d.characterValue)&&void 0!==h?h:"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),u(i.id,c,o);let v=!0,y=s.characterValue;""===y&&(y=r.characterValue,v=!0),""===y&&(y=(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][y])?o[a][s.characterValue].push(l):y.includes("_s_")?(o[a][y]=[],o[a][y].push(l)):o[a][y]=l,u(r.id,c,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!==(v=t[n])&&void 0!==v?v:{},created_on:null==o?void 0:o.entryTimeStamp};w.push(r)}return o.Logger.logUpdate(y),w})}(l,v,[],n,s,d);return y})}function I(e,t,n,s,c){return y(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 v(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,v=null!==(s=null===(r=p.type)||void 0===r?void 0:r.characterValue)&&void 0!==s?s:"self",y=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][v]||(n[p.id][v]={}),n[f.id]||(n[f.id]={}),n[f.id][y]=g}return o.Logger.logUpdate(d),n})}(l,h,s),h=yield function(e){var t=arguments;return v(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,v=e?u:h,y=null!==(c=null===(s=f.type)||void 0===s?void 0:s.characterValue)&&void 0!==c?c:"self",g=null!==(l=null===(a=v.type)||void 0===a?void 0:a.characterValue)&&void 0!==l?l:"none",m=v.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:v.id,data:{[g]:m}};n[f.id]||(n[f.id]={}),y in n[f.id]&&"string"!=typeof n[f.id][y]||(n[f.id][y]=k?[]:{});try{if(T)continue;k?n[f.id][y].push(I):n[f.id][y][e?`${w}_reverse`:w]=I}catch(e){console.error("Error formatting concept data:",e)}}return o.Logger.logUpdate(u),n})}(l,h,s);let y=yield function(e,t,n){var i=arguments;return v(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,v=p.id,y=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[v]){const o=t[v][g],i=t[y],r={id:f.id,data:i,created_on:n.entryTimeStamp};u(v,s,t[v]);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(y,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 y})}},1412:(e,t,n)=>{function o(e=[],t=[]){}n.d(t,{e:()=>o})},1534:(e,t,n)=>{let o=n(7793),i=n(1752);class r extends o{get selectors(){return i.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}e.exports=r,r.default=r,o.registerRule(r)},1557:(e,t)=>{t.__esModule=!0,t.default=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];for(;n.length>0;){var i=n.shift();e[i]||(e[i]={}),e=e[i]}},e.exports=t.default},1581:(e,t)=>{t.__esModule=!0,t.UNIVERSAL=t.TAG=t.STRING=t.SELECTOR=t.ROOT=t.PSEUDO=t.NESTING=t.ID=t.COMMENT=t.COMBINATOR=t.CLASS=t.ATTRIBUTE=void 0,t.TAG="tag",t.STRING="string",t.SELECTOR="selector",t.ROOT="root",t.PSEUDO="pseudo",t.NESTING="nesting",t.ID="id",t.COMMENT="comment",t.COMBINATOR="combinator",t.CLASS="class",t.ATTRIBUTE="attribute",t.UNIVERSAL="universal"},1596:(e,t,n)=>{n.d(t,{g:()=>s});var o=n(3776),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}})}},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}},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},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},1708:(e,t,n)=>{n.d(t,{Az:()=>h});var o=n(8146),i=n(3026),r=n(9581),s=n(3518),c=n(3776),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})}},1735:(e,t,n)=>{n.d(t,{J:()=>c});var o,i=n(3776),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()},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},1863:(e,t,n)=>{n.d(t,{ER:()=>s,Mb:()=>c,ey:()=>a,ry:()=>r});var o=n(3776),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)}}},1866:()=>{},2013:(e,t,n)=>{n.d(t,{A:()=>a,w:()=>l});var o=n(8146),i=n(3776),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})}},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 v=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[v]=!0})},postcssPlugin:"postcss-nested",RootExit(e){e[v]&&(e.walkAtRules(r,h),e[v]=!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},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=""}}},2202:(e,t,n)=>{n.d(t,{W:()=>a});var o=n(6963),i=n(6731),r=n(205),s=n(3776),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},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(3776),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})}},2289:(e,t,n)=>{n.d(t,{$S:()=>d,L0:()=>u,WC:()=>h});var o=n(8675),i=n(6058),r=n(3776),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})}},2299:(e,t,n)=>{n.d(t,{B:()=>o});class o{constructor(e){this.id=1,this.isOnlineSync=!1,this.isOnlineSync=e}}},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}}},2615:(e,t,n)=>{n.d(t,{j:()=>i});var o=n(3776);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)}}},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,v=[],y=e.css.valueOf(),g=y.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=(y+=n).length-1}for(;w<g;){switch((t=y.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=y.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=y.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=y.indexOf(p,l+1))&&k("quote",p),s=l;y.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&&y.charCodeAt(w+1)===r.asterisk?(0===(l=y.indexOf("*/",w+2)+1)&&k("comment","*/"),(c=(a=y.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(y,w),f=r.word,o=C,n=l-m),T=l+1}v.push([f,C,w-m,o,n,w,T]),h&&(m=h,h=null),w=T}return v};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}},2739:()=>{},2803:(e,t,n)=>{n.d(t,{x:()=>a});var o=n(8286),i=n(9581),r=n(1863),s=n(3776),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})}},2832:(e,t,n)=>{n.d(t,{j:()=>a});var o=n(3776),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)}})}},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),v=n(6846),y=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 v(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 v).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=v,T.Document=a,T.Comment=i,T.Warning=w,T.AtRule=o,T.Result=y,T.Input=d,T.Rule=m,T.Root=g,T.Node=p,u.registerPostcss(T),e.exports=T,T.default=T},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},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(3776);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=[]},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(3776),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}})}},3077:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(3776),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,v,y,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===(v=null===(f=null==i?void 0:i.actions)||void 0===f?void 0:f.concepts)||void 0===v?void 0:v.length)&&(p.concepts=JSON.parse(JSON.stringify(i.actions.concepts))),(null===(g=null===(y=null==i?void 0:i.actions)||void 0===y?void 0:y.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}})}},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},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},3278:(e,t,n)=>{n.d(t,{b:()=>o});class o{static setSession(e){e&&(o.sessionId=e)}}o.BearerAccessToken="",o.sessionId=998},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},3303:(e,t,n)=>{let o=n(7668);function i(e,t){new o(t).stringify(e)}e.exports=i,i.default=i},3438:(e,t,n)=>{let o=n(396),i=n(9371),r=n(5238),s=n(1106),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},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;const i={},r=o.b.BearerAccessToken,s=null===(n=o.b.sessionId)||void 0===n?void 0:n.toString();return console.log("this is the token",r),r&&(i.Authorization=`Bearer ${r}`),e&&(i["Content-Type"]=e),t&&(i.Accept=t),i["X-Session-id"]=s,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}},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}}},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},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},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(3776),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)})})}},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},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(3776),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 v=e.userId,y=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 b=[],L=[];let _=[];for(let e=0;e<m.length;e++)(0,o.A)(L,m[e].ofTheConceptId),(0,o.A)(b,m[e].ofTheConceptId),(0,o.A)(b,m[e].toTheConceptId),_.push(m[e].ofTheConceptId);for(let e=0;e<b.length;e++){const t=yield(0,s.A)(b[e]);I==b[e]&&(w=(0,u.F4)(t)),S==b[e]&&(T=(0,u.F4)(t)),C.push((0,u.F4)(t))}const E=e.patchObject;for(const e in E){let n=(0,d.CreateDefaultLConcept)();const o=E[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)(E[e],n.id,n.userId,w.id,w.userId,4,999,void 0,t)):n=yield(0,l.k)(e,o,!1,v,g,y,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)})}},3776:(e,t,n)=>{n.d(t,{ADMIN:()=>Sn,ALLID:()=>In.BG,AccessControlService:()=>jo,AccessTracker:()=>Ee.J,AddGhostConcept:()=>Kt,Anomaly:()=>To,BaseUrl:()=>l.B,BinaryTree:()=>ke.W,BuildWidgetFromId:()=>Go.Cp,BuilderStatefulWidget:()=>vo,Composition:()=>Tt,CompositionBinaryTree:()=>gt,CompositionNode:()=>vt,Concept:()=>Jn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>xe.d,CountInfo:()=>Uo.y,CreateComposition:()=>D.A,CreateConnection:()=>zt.d,CreateConnectionBetweenEntityLocal:()=>Do,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>yn.h,CreateData:()=>Si,CreateDefaultConcept:()=>M.o,CreateDefaultLConcept:()=>qt.u,CreateSession:()=>Pt,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>G.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:()=>be,DependencyObserver:()=>_n.w,FilterSearch:()=>eo,FormatFromConnections:()=>en.vw,FormatFromConnectionsAltered:()=>en.y8,FreeschemaQuery:()=>No,FreeschemaQueryApi:()=>Lo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllLinkerConnectionsFromTheConcept:()=>fe.l,GetAllTheConnectionsByTypeAndOfTheConcept:()=>Ao.WC,GetComposition:()=>y.Nj,GetCompositionBulk:()=>je.dF,GetCompositionBulkWithDataId:()=>je.cw,GetCompositionFromConnectionsWithDataId:()=>je.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>je.km,GetCompositionFromConnectionsWithDataIdInObject:()=>je.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>je.Nt,GetCompositionFromConnectionsWithIndex:()=>je.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>je.hG,GetCompositionFromMemoryWithConnections:()=>y.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>T,GetCompositionListAllWithId:()=>k,GetCompositionListListener:()=>Fn,GetCompositionListLocal:()=>O,GetCompositionListLocalWithId:()=>B,GetCompositionListWithId:()=>I,GetCompositionListWithIdUpdated:()=>S,GetCompositionListener:()=>Rn,GetCompositionLocal:()=>L,GetCompositionLocalWithId:()=>_,GetCompositionWithAllIds:()=>y.Mb,GetCompositionWithCache:()=>Ot,GetCompositionWithDataIdBulk:()=>Dt,GetCompositionWithDataIdWithCache:()=>Rt,GetCompositionWithId:()=>y.yz,GetCompositionWithIdAndDateFromMemory:()=>y.Ez,GetConceptBulk:()=>nt.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>ot.j,GetConnectionById:()=>Ge,GetConnectionDataPrefetch:()=>je.QL,GetConnectionOfTheConcept:()=>P,GetConnectionTypeForCount:()=>qn.V,GetFreeschemaImage:()=>Ui,GetFreeschemaImageUrl:()=>Wi,GetImageApi:()=>Fi,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:()=>v.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:()=>Ei,RAW:()=>In.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>jn,SchemaQuery:()=>Oo,SchemaQueryListener:()=>xo,SearchAllConcepts:()=>bt,SearchLinkInternal:()=>fn,SearchLinkInternalAll:()=>vn,SearchLinkMultipleAll:()=>en.cf,SearchLinkMultipleAllObservable:()=>En,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>Me,SearchStructure:()=>to,SearchWithLinker:()=>_t,SearchWithTypeAndLinker:()=>Pn.zl,SearchWithTypeAndLinkerApi:()=>Ln,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:()=>vi,convertWidgetTreeToWidgetWithWrapper:()=>gi,createFormFieldData:()=>So,createPrototypeLocal:()=>Bi,dispatchIdEvent:()=>Ki,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUserDetails:()=>Po.s,getWidgetBulkFromId:()=>fi,getWidgetFromId:()=>pi,handleServiceWorkerException:()=>tr,hasActivatedSW:()=>qi,importLatestWidget:()=>si,init:()=>Qi,orderTheConnections:()=>zn.X,recursiveFetch:()=>y.zN,recursiveFetchNew:()=>Ct,removeAllChildren:()=>Fo,renderImportedWidget:()=>ci,renderLatestWidget:()=>ai,renderPage:()=>ri,renderWidget:()=>li,searchLinkMultipleListener:()=>xn,sendEmail:()=>lo,sendMessage:()=>Yi,serviceWorker:()=>Mi,setHasActivatedSW:()=>zi,storeToDatabase:()=>te,subscribedListeners:()=>$i,unwrapContainers:()=>wi,updateAccessToken:()=>Ji,uploadAttachment:()=>Ze,uploadFile:()=>tt,uploadImage:()=>Ke,uploadImageV2:()=>et,validDocumentFormats:()=>Xe,validImageFormats:()=>Ye}),n.r(t);var o={};n.r(o),n.d(o,{ADMIN:()=>Sn,ALLID:()=>In.BG,AccessControlService:()=>jo,AccessTracker:()=>Ee.J,AddGhostConcept:()=>Kt,Anomaly:()=>To,BaseUrl:()=>l.B,BinaryTree:()=>ke.W,BuildWidgetFromId:()=>Go.Cp,BuilderStatefulWidget:()=>vo,Composition:()=>Tt,CompositionBinaryTree:()=>gt,CompositionNode:()=>vt,Concept:()=>Jn.j,ConceptsData:()=>a.I,Connection:()=>U.N,ConnectionData:()=>xe.d,CountInfo:()=>Uo.y,CreateComposition:()=>D.A,CreateConnection:()=>zt.d,CreateConnectionBetweenEntityLocal:()=>Do,CreateConnectionBetweenTwoConcepts:()=>Y,CreateConnectionBetweenTwoConceptsGeneral:()=>Z,CreateConnectionBetweenTwoConceptsLocal:()=>yn.h,CreateData:()=>Si,CreateDefaultConcept:()=>M.o,CreateDefaultLConcept:()=>qt.u,CreateSession:()=>Pt,CreateSessionVisit:()=>Wt,CreateTheCompositionLocal:()=>G.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:()=>be,DependencyObserver:()=>_n.w,FilterSearch:()=>eo,FormatFromConnections:()=>en.vw,FormatFromConnectionsAltered:()=>en.y8,FreeschemaQuery:()=>No,FreeschemaQueryApi:()=>Lo,GetAllConnectionsOfComposition:()=>R.s,GetAllConnectionsOfCompositionBulk:()=>f.Y,GetAllLinkerConnectionsFromTheConcept:()=>fe.l,GetAllTheConnectionsByTypeAndOfTheConcept:()=>Ao.WC,GetComposition:()=>y.Nj,GetCompositionBulk:()=>je.dF,GetCompositionBulkWithDataId:()=>je.cw,GetCompositionFromConnectionsWithDataId:()=>je.p8,GetCompositionFromConnectionsWithDataIdFromConnections:()=>je.km,GetCompositionFromConnectionsWithDataIdInObject:()=>je.rv,GetCompositionFromConnectionsWithDataIdIndex:()=>je.Nt,GetCompositionFromConnectionsWithIndex:()=>je.as,GetCompositionFromConnectionsWithIndexFromConnections:()=>je.hG,GetCompositionFromMemoryWithConnections:()=>y.JA,GetCompositionList:()=>w,GetCompositionListAll:()=>T,GetCompositionListAllWithId:()=>k,GetCompositionListListener:()=>Fn,GetCompositionListLocal:()=>O,GetCompositionListLocalWithId:()=>B,GetCompositionListWithId:()=>I,GetCompositionListWithIdUpdated:()=>S,GetCompositionListener:()=>Rn,GetCompositionLocal:()=>L,GetCompositionLocalWithId:()=>_,GetCompositionWithAllIds:()=>y.Mb,GetCompositionWithCache:()=>Ot,GetCompositionWithDataIdBulk:()=>Dt,GetCompositionWithDataIdWithCache:()=>Rt,GetCompositionWithId:()=>y.yz,GetCompositionWithIdAndDateFromMemory:()=>y.Ez,GetConceptBulk:()=>nt.r,GetConceptByCharacter:()=>g.A,GetConceptByCharacterAndCategoryLocal:()=>m.$I,GetConceptByCharacterAndType:()=>re.A,GetConnectionBetweenTwoConceptsLinker:()=>Tn,GetConnectionBulk:()=>ot.j,GetConnectionById:()=>Ge,GetConnectionDataPrefetch:()=>je.QL,GetConnectionOfTheConcept:()=>P,GetConnectionTypeForCount:()=>qn.V,GetFreeschemaImage:()=>Ui,GetFreeschemaImageUrl:()=>Wi,GetImageApi:()=>Fi,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:()=>v.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:()=>Ei,RAW:()=>In.XZ,RecursiveSearchApi:()=>$e,RecursiveSearchApiNewRawFullLinker:()=>Je,RecursiveSearchApiRaw:()=>qe,RecursiveSearchApiRawFullLinker:()=>ze,RecursiveSearchApiWithInternalConnections:()=>He,RecursiveSearchListener:()=>jn,SchemaQuery:()=>Oo,SchemaQueryListener:()=>xo,SearchAllConcepts:()=>bt,SearchLinkInternal:()=>fn,SearchLinkInternalAll:()=>vn,SearchLinkMultipleAll:()=>en.cf,SearchLinkMultipleAllObservable:()=>En,SearchLinkMultipleApi:()=>s.j,SearchQuery:()=>Me,SearchStructure:()=>to,SearchWithLinker:()=>_t,SearchWithTypeAndLinker:()=>Pn.zl,SearchWithTypeAndLinkerApi:()=>Ln,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:()=>vi,convertWidgetTreeToWidgetWithWrapper:()=>gi,createFormFieldData:()=>So,createPrototypeLocal:()=>Bi,dispatchIdEvent:()=>Ki,getFromDatabaseWithType:()=>ne,getObjectsFromIndexDb:()=>oe,getUserDetails:()=>Po.s,getWidgetBulkFromId:()=>fi,getWidgetFromId:()=>pi,handleServiceWorkerException:()=>tr,hasActivatedSW:()=>qi,importLatestWidget:()=>si,init:()=>Qi,orderTheConnections:()=>zn.X,recursiveFetch:()=>y.zN,recursiveFetchNew:()=>Ct,removeAllChildren:()=>Fo,renderImportedWidget:()=>ci,renderLatestWidget:()=>ai,renderPage:()=>ri,renderWidget:()=>li,searchLinkMultipleListener:()=>xn,sendEmail:()=>lo,sendMessage:()=>Yi,serviceWorker:()=>Mi,setHasActivatedSW:()=>zi,storeToDatabase:()=>te,subscribedListeners:()=>$i,unwrapContainers:()=>wi,updateAccessToken:()=>Ji,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),v=n(9736),y=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(Mi){r.serviceWorker=!0;try{const n=yield Yi("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),tr(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,y.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(Mi)try{return(yield Yi("GetCompositionListAllWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListAllWithId sw error: ",e),tr(e)}let i=yield(0,m.Ay)(e),r=yield(0,g.A)(e),s=[],c=[],l=[],d=[];0!=i.id&&(c=yield v.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,y.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(Mi)try{return(yield Yi("GetCompositionListWithId",{compositionName:e,userId:t,inpage:n,page:o})).data}catch(e){console.error("GetCompositionListWithId sw error: ",e),tr(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,y.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,y.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())})},b=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 b(this,void 0,void 0,function*(){var t,n;try{if(Mi)try{return(yield Yi("GetCompositionLocal",{id:e})).data}catch(e){console.error("GetCompositionLocal error sw: ",e),tr(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 v.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,y.Nj)(t.id)}let c=yield E(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 b(this,void 0,void 0,function*(){var t,n;try{if(Mi)try{return(yield Yi("GetCompositionLocalWithId",{id:e})).data}catch(e){console.error("GetCompositionLocalWithId error sw: ",e),tr(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 v.v.GetConcept(e);if(0!=c.id){let r=yield E(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 E(e,t,n){return b(this,arguments,void 0,function*(e,t,n,o=[]){var i,r,s;let c={},a=[],l=yield v.v.GetConcept(e);if(0!=l.id&&null==l.type){let e=l.typeId,t=yield v.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 v.v.GetConcept(e);if(0!=i.id&&null==(null==i?void 0:i.type)){let e=i.typeId,t=yield v.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 E(e,t,n);c[d]=o}}else{const o=yield E(e,t,n);a[d]=o,c=a}}return c})}var x=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 x(this,void 0,void 0,function*(){if(Mi)try{return(yield Yi("GetCompositionListLocal",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocal error sw: ",e),tr(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield v.v.GetConceptsByTypeIdAndUser(n.id,t);for(let t=0;t<e.length;t++){let n=yield L(e[t].id);o.push(n)}}return o}catch(e){throw e}})}function B(e,t){return x(this,void 0,void 0,function*(){if(Mi)try{return(yield Yi("GetCompositionListLocalWithId",{compositionName:e,userId:t})).data}catch(e){console.error("GetCompositionListLocalWithId error sw: ",e),tr(e)}try{let n=yield(0,m.Ay)(e),o=[];if(0!=n.id){let e=yield v.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),D=n(1218),G=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(Mi){s.serviceWorker=!0;try{const o=yield Yi("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),tr(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),j=n(5976),V=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 j.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 V.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(Mi)try{return(yield Yi("CreateConnectionBetweenTwoConcepts",{ofTheConcept:e,toTheConcept:t,linker:n,both:o,count:i})).data}catch(e){console.error("CreateConnectionBetweenTwoConcepts sw error: ",e),tr(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(Mi){s.serviceWorker=!0;try{const n=yield Yi("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),tr(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,y.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),ve=n(6058),ye=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 ye(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 ye(this,void 0,void 0,function*(){const n=so.V.logfunction("GetLinkerConnectionToConcepts",t);let o=yield(0,ve.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(Mi)try{return(yield Yi("DeleteConceptById",{id:e})).data}catch(e){console.error("DeleteConceptById sw error: ",e),tr(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 v.v.RemoveConceptById(e);so.V.logUpdate(n)})}function be(e){return Ae(this,void 0,void 0,function*(){if(Mi)try{return(yield Yi("DeleteUser",{id:e})).data}catch(e){console.error("DeleteUser sw error: ",e),tr(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):v.v.RemoveConceptById(e)})}var Le=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 Le(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 Ee=n(1735),xe=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 De=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 De(this,void 0,void 0,function*(){const n=so.V.logfunction("GetConnectionById",t);if(console.log("AccessTracker activation status from GetConnectionById"),!0===Ee.J.activateStatus)try{Ee.J.incrementConnection(e)}catch(e){console.error("Error adding connection in access tracker"),so.V.log("ERROR","Error Adding Connection")}if(Mi)try{return(yield Yi("GetConnectionById",{id:e})).data}catch(e){console.error("GetConnectionById sw error: ",e),tr(e)}let o=yield xe.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 xe.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(),xe.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(Mi){r.serviceWorker=!0;try{const s=yield Yi("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),tr(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 je=n(6687),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 $e(){var e=arguments;return Ve(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const r=so.V.logfunction("RecursiveSearchApi",e)||{};let s=[];try{if(Mi){r.serviceWorker=!0;try{const e=yield Yi("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),tr(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)("application/json");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,je.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 Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=so.V.logfunction("RecursiveSearchApiWithInternalConnections",e)||{};let r=[];try{if(Mi){i.serviceWorker=!0;try{const e=yield Yi("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),tr(e)}}let e=new Me;e.composition=t,e.listLinkers=n,e.textSearch=o;let s=JSON.stringify(e),c=(0,d.Xr)("application/json");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,je.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 Ve(this,arguments,void 0,function*(t=0,n=[],o="",i=[]){const r=so.V.logfunction("RecursiveSearchApiRaw",e)||{};try{if(Mi){r.serviceWorker=!0;try{const e=yield Yi("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),tr(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)("application/json");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 Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=so.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Mi){i.serviceWorker=!0;try{const e=yield Yi("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),tr(e)}}let e=new Me;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)("application/json");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 Ve(this,arguments,void 0,function*(t=0,n=[],o=""){const i=so.V.logfunction("RecursiveSearchApiRawFullLinker",e)||{};try{if(Mi)try{i.serviceWorker=!0;const e=yield Yi("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),tr(e)}let e=new Me;e.composition=t,e.fullLinkers=n,e.textSearch=o;let r=JSON.stringify(e),s=(0,d.Xr)("application/json");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();if(e.ok){const e=null==r?void 0:r.data;n={message:"success",status:!0,statusCode:200,data:e},Ji(e.token)}else(0,u.ER)(e,r);return 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 vt{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 yt=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 vt(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}}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(Mi){t.serviceWorker=!0;try{const n=yield Yi("UpdateComposition",{patcherStructure:e});return so.V.logUpdate(t),n.data}catch(e){console.error("UpdateComposition sw error: ",e),(0,u.ey)(t,"UpdateComposition",e),tr(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=[],v=new Tt,y=[];v.id=d,v.isUpdating();let g=[];for(let e=0;e<r.length;e++)(0,ut.A)(y,r[e].ofTheConceptId),(0,ut.A)(f,r[e].ofTheConceptId),(0,ut.A)(f,r[e].toTheConceptId),g.push(r[e].ofTheConceptId);v.subcompositions=y,v.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),v.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)(v.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,v)}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)(v.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),v.connections.push(u)}for(let e=0;e<p.length;e++)ft(v.connections,p[e]),(0,q.m)(p[e].id);for(let e=0;e<l.length;e++)pt(s,l[e]);v.concepts=v.concepts.concat(s),v.mainConcept=c,v.id=c.id,yield v.updateCache(),gt.addCompositionToTree(v),W.Y.SyncDataOnline();let C=v.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 bt(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 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 _t(e){return Lt(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 Et=n(7139),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 Ot(e){return xt(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,Et.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);Gt(u,i,r,d);let l=[];c=yield(0,y.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 xt(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,Et.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);Gt(h,r,s,u),c=yield(0,y.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 Dt(e,t){return xt(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 Gt(e,t,n,o){return xt(this,void 0,void 0,function*(){const i=new Tt,r=yield function(e){return xt(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 jt(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 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())})};function $t(e,t){var n=arguments;return Vt(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=so.V.logfunction("GetRelation",n)||{};if(Mi){s.serviceWorker=!0;try{const n=yield Yi("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),tr(e)}}let c=[],a=yield(0,z.A)(e),l=yield(0,de.Az)(t),d=[];if(l.id>0)if(r){d=yield jt(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,y.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,y.Ez)(n.id);c.push(o)}}return so.V.logUpdate(s),c})}function Ht(e,t){var n=arguments;return Vt(this,arguments,void 0,function*(e,t,o=10,i=1,r=!1){const s=so.V.logfunction("GetRelationRaw",n)||{};if(Mi){s.serviceWorker=!0;try{const n=yield Yi("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),tr(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 jt(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(Mi)try{return(yield Yi("GetRelationLocal",{id:e,relation:t,userId:n})).data}catch(e){console.error("GetRelationLocal error sw: ",e),tr(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 L(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,y.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 vn(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 yn=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(Mi)try{return(yield Yi("DeleteConceptLocal",{id:e})).data}catch(e){console.error("DeleteConceptLocal error sw: ",e),tr(e)}let t=yield(0,tn.f)(e);v.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(Mi){c.serviceWorker=!0;try{const r=yield Yi("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),tr(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 bn=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 Ln(e,t){return bn(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 En 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 xn(e,t,n=In.y0){return new En(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,y.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 xe.d.GetConnection(t[n]));return this.format==In.ZJ?this.data=yield(0,y.ay)(this.mainConcept,e,this.compositionIds):this.format==In.y0?this.data=yield(0,y.$V)(this.mainConcept,e,this.compositionIds):this.format==In.yv?this.data=yield(0,y.re)(this.mainConcept,e,this.compositionIds):this.data=yield(0,y.ay)(this.mainConcept,e,this.compositionIds),this.data})}}function Rn(e,t=In.ZJ){return new Bn(e,t)}var Dn=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 Gn 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 Dn(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 Dn(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,y.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,y.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,y.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,y.kx)(this.compositionIds[e]);this.data.push(t)}return this.data})}}function Fn(e,t,n,o,i=In.ZJ){return new Gn(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 xe.d.GetConnectionByOfTheConceptAndType(e,e);for(let e=0;e<n.length;e++)yield xe.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,je.p8)(this.compositionIds,this.internalConnections),this.data})}}function jn(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 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 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),xe.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 Ln(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,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;setTimeout(()=>{co.logOnWindowLoad()},3e3),history.pushState=function(...t){const n=Be.b.sessionId||"unknown",o={url:t[2]?new URL(t[2],location.origin).href:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:n};return so.V.logApplication("ROUTE","Route Change",o),e.apply(this,t)},null===window||void 0===window||window.addEventListener("beforeunload",()=>{const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};so.V.logApplication("ROUTE","Unload",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 logOnWindowLoad(){const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};so.V.logApplication("ROUTE","Initial Load",t)}static logSample(){const e=Be.b.sessionId||"unknown",t={url:location.href,requestFrom:l.B.BASE_APPLICATION,sessionId:e};so.V.logApplication("ROUTE","Sample",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 vo 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=[],this.widgetDependenciesData=""}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,xo(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.render_widgetDependencies(),this.before_render(),this.mount_child(),this.widgetMounted=!0,this.componentMounted=!0):this.render(),this.childWidgetElement=this.getElementByClassName("added-widget-container")}})}render_widgetDependencies(){try{new Function("tsccs",`\n return (async function() {\n ${this.widgetDependenciesData}\n }).call(this);\n `).bind(this)(o)}catch(e){throw console.log("This is the error in the before render",e),e}}render_custom_functions(){var e;const t=null===(e=this.customFunctions)||void 0===e?void 0:e.map(e=>null==e?void 0:e.code).join("");try{new Function("tsccs",`\n return (async function() {\n ${t}\n }).call(this);\n `).bind(this)(o)}catch(e){throw 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 yo=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,yo.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,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 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 Do(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,G.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:v,required:y,isUnique:g}=e;if(console.log("Validation is happening on : \n",e),!y||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}`),v&&s&&f){const e=f.split(",").map(e=>e.trim().toLowerCase()),n=null===(t=v.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=!0,this.isSecure=!0,this.includeInFilter=!1,this.isOldConnectionType=!1}}var bo=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 Lo(e){var t=arguments;return bo(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 Eo 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 Lo(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 Lo(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 xo(e,t){return new Eo(e,t)}function Oo(e,t){return new Eo(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 vo,this.dependency=""}}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 Do(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(Mi)try{const a=yield Yi("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),tr(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 Go=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,xo(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}}var Mo=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 jo{static assignAccessToEntity(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/access",e,"Failed to assign access to entity")})}static assignPublicAccess(e){return Mo(this,void 0,void 0,function*(){var t,n,o;return this._post("/api/access-control/public-access",Object.assign(Object.assign({},e),{conceptIdList:null!==(t=e.conceptIdList)&&void 0!==t?t:[],accessList:null!==(n=e.accessList)&&void 0!==n?n:[],nestedAccessLevel:null!==(o=e.nestedAccessLevel)&&void 0!==o?o:0}),"Failed to assign public access")})}static assignPublicAccessBlukConcept(e){return Mo(this,void 0,void 0,function*(){var t,n,o;return this._post("/api/access-control/public-access",Object.assign(Object.assign({},e),{conceptIdList:null!==(t=e.conceptIdList)&&void 0!==t?t:[],accessList:null!==(n=e.accessList)&&void 0!==n?n:[],nestedAccessLevel:null!==(o=e.nestedAccessLevel)&&void 0!==o?o:0}),"Failed to assign public access")})}static assignAccessToEntityBulk(e){return Mo(this,void 0,void 0,function*(){var t,n,o,i;return this._post("/api/access-control/access/bulk",Object.assign(Object.assign({},e),{conceptIdList:null!==(t=e.conceptIdList)&&void 0!==t?t:[],entityIdList:null!==(n=e.entityIdList)&&void 0!==n?n:[],accessList:null!==(o=e.accessList)&&void 0!==o?o:[],nestedAccessLevel:null!==(i=e.nestedAccessLevel)&&void 0!==i?i:0}),"Failed to assign access in bulk")})}static assignAccessByUser(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/user-access",e,"Failed to assign access by user")})}static revokeAccess(e){return Mo(this,void 0,void 0,function*(){const{conceptId:t,access:n,entityId:o}=e,i=`/api/access-control/access?conceptId=${t}&access=${encodeURIComponent(n)}&entityId=${o}`;return this._delete(i,void 0,"Failed to revoke access")})}static revokeAccessBulk(e){return Mo(this,void 0,void 0,function*(){var t,n,o,i;return this._delete("/api/access-control/access/bulk",Object.assign(Object.assign({},e),{conceptIdList:null!==(t=e.conceptIdList)&&void 0!==t?t:[],entityIdList:null!==(n=e.entityIdList)&&void 0!==n?n:[],accessList:null!==(o=e.accessList)&&void 0!==o?o:[],nestedAccessLevel:null!==(i=e.nestedAccessLevel)&&void 0!==i?i:0}),"Failed to revoke access in bulk")})}static getAccessList(e,t){return Mo(this,void 0,void 0,function*(){const n=`/api/access-control/access-list?conceptId=${e}&userId=${t}`;return this._get(n,"Failed to get access list")})}static getPublicAccessList(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/public-access/by-concept-ids",e,"Failed to get public access list")})}static revokePublicAccess(e){return Mo(this,void 0,void 0,function*(){var t,n,o;return this._delete("/api/access-control/public-access",Object.assign(Object.assign({},e),{conceptIdList:null!==(t=e.conceptIdList)&&void 0!==t?t:[],accessList:null!==(n=e.accessList)&&void 0!==n?n:[],nestedAccessLevel:null!==(o=e.nestedAccessLevel)&&void 0!==o?o:0}),"Failed to revoke public access")})}static checkAccess(e){return Mo(this,void 0,void 0,function*(){const t=`/api/access-control/access/check?conceptId=${e.conceptId}&permission=${encodeURIComponent(e.permission)}&entityId=${e.entityId}`;return this._get(t,"Failed to check access")})}static checkAccessByUser(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/user-access/check",e,"Failed to check access by user")})}static filterConceptsByAccess(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/concepts/filter-by-access",e,"Failed to filter concepts by access")})}static checkAccessOfConceptBulk(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/concepts/check-access-bulk",e,"Failed to check access of concept bulk")})}static getEntitiesByAccess(e,t){return Mo(this,void 0,void 0,function*(){const n=`/api/access-control/entities/by-access?conceptId=${e}&access=${encodeURIComponent(t)}`;return this._get(n,"Failed to get entities by access")})}static getEntitiesWithAccess(e){return Mo(this,void 0,void 0,function*(){const t=`/api/access-control/entities/with-access?conceptId=${e}`;return this._get(t,"Failed to get entities with access")})}static getAccessGroupByEntity(e){return Mo(this,void 0,void 0,function*(){const t="/api/access-control/access-group/by-entity"+(void 0!==e?`?entityId=${e}`:"");return this._get(t,"Failed to get access group by entity")})}static getAccessGroupByUser(e){return Mo(this,void 0,void 0,function*(){const t="/api/access-control/access-group/by-user"+(void 0!==e?`?userId=${e}`:"");return this._get(t,"Failed to get access group by user")})}static getPublicAccessByAccessIds(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/public-access/by-access-ids",e,"Failed to get public access by access ids")})}static getFullAccessMappingForPublic(){return Mo(this,void 0,void 0,function*(){return this._get("/api/access-control/concepts/by-public-access","Failed to get full access mapping for public")})}static assignPublicAccessForAllUser(){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/public-access/assign-for-all-users",void 0,"Failed to assign public access for all user")})}static assignAccessByConncetionTypeOfUser(){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/access/by-connection-type",void 0,"Failed to assign access by connection type of user")})}static setAccessInheritance(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/access-inheritance",e,"Failed to set access inheritance")})}static setAccessInheritanceBulk(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/access-inheritance/bulk",e,"Failed to set access inheritance in bulk")})}static getAccessInheritanceStatus(e){return Mo(this,arguments,void 0,function*(e,t=999){const n=`/api/access-control/access-inheritance/status?mainConceptId=${e}&connectionTypeId=${t}`;return this._get(n,"Failed to get access inheritance status")})}static getAccessMatrix(e){return Mo(this,void 0,void 0,function*(){const t=`/api/access-control/access-matrix?AccessId=${e}`;return this._get(t,"Failed to get access matrix")})}static assignSuperAdminAccess(e){return Mo(this,void 0,void 0,function*(){return this._post("/api/access-control/super-admin-access",e,"Failed to assign super admin access")})}static revokeSuperAdminAccess(e){return Mo(this,void 0,void 0,function*(){return this._delete("/api/access-control/super-admin-access",e,"Failed to revoke super admin access")})}static getSuperAdminAccess(e){return Mo(this,void 0,void 0,function*(){const t=`/api/access-control/super-admin-access?entityConceptId=${e}`;return this._get(t,"Failed to get super admin access")})}static isSuperAdmin(e){return Mo(this,void 0,void 0,function*(){var t;const n=yield this.getSuperAdminAccess(e);return null!==(t=null==n?void 0:n.data)&&void 0!==t&&t})}static get baseUrl(){return l.B.ACCESS_CONTROL_BASE_URL}static _get(e,t){return Mo(this,void 0,void 0,function*(){const n=yield fetch(`${this.baseUrl}${e}`,{method:"GET"});if(!n.ok)throw new Error(t);return n.json()})}static _post(e,t,n){return Mo(this,void 0,void 0,function*(){const o=yield fetch(`${this.baseUrl}${e}`,Object.assign({method:"POST",headers:{"Content-Type":"application/json"}},void 0!==t?{body:JSON.stringify(t)}:{}));if(!o.ok)throw new Error(n||"Request failed");return o.json()})}static _delete(e,t,n){return Mo(this,void 0,void 0,function*(){const o=yield fetch(`${this.baseUrl}${e}`,Object.assign({method:"DELETE",headers:t?{"Content-Type":"application/json"}:void 0},t?{body:JSON.stringify(t)}:{}));if(!o.ok)throw new Error(n||"Request failed");return o.json()})}}const Vo='\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',$o={PAGE_COMP_NAME:"page",WIDGET_COMP_NAME:"widget",PROJECT_COMP_NAME:"project"};var Ho=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 qo{static get(e,t){return Ho(this,void 0,void 0,function*(){if(qo.cache.has(e))return qo.cache.get(e);if(qo.promises.has(e))return qo.promises.get(e);const n=t().then(t=>(qo.cache.set(e,t),qo.promises.delete(e),t)).catch(t=>{throw qo.promises.delete(e),t});return qo.promises.set(e,n),n})}static has(e){return qo.cache.has(e)}static peek(e){return qo.cache.get(e)}static invalidate(e){qo.cache.delete(e),qo.promises.delete(e)}static clear(){qo.cache.clear(),qo.promises.clear()}static set(e,t){return Ho(this,void 0,void 0,function*(){return qo.promises.delete(e),qo.cache.set(e,t),t})}static stats(){return{cacheSize:qo.cache.size,pendingRequests:qo.promises.size,keys:Array.from(qo.cache.keys())}}}qo.cache=new Map,qo.promises=new Map;var zo=n(2895);const Jo=zo;zo.stringify,zo.fromJSON,zo.plugin,zo.parse,zo.list,zo.document,zo.comment,zo.atRule,zo.rule,zo.decl,zo.root,zo.CssSyntaxError,zo.Declaration,zo.Container,zo.Processor,zo.Document,zo.Comment,zo.Warning,zo.AtRule,zo.Result,zo.Input,zo.Rule,zo.Root,zo.Node;var Qo=n(2110),Yo=n.n(Qo),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*(){try{return(yield Jo([Yo()()]).process(e,{from:void 0})).css}catch(e){return console.error("Error processing CSS:",e),null}})}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){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 ti(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 ni=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 oi(e){return ni(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 ni(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 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 ri(e,t,n,o){return ii(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"],xo(s,"").subscribe(e=>ii(this,void 0,void 0,function*(){var t,n;yield function(e){return Ko(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_${$o.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_${$o.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_${$o.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_${$o.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_${$o.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_${$o.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_${$o.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){Ko(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":ei(".fspage { width: [^;]+ !important; }"),o=t?`.fspage { width: ${t} !important; }`:"";break;case"font_size":ei(".fspage { font-size: [^;]+; }"),o=t?`.fspage { font-size: ${t}px; }`:"";break;case"font_family":ei(".fspage { font-family: [^;]+; }"),o=t?`.fspage { font-family: ${t}; }`:"";break;case"type":ei(".fspage { width: 1200px; margin: 0 auto; }"),ei(".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":ti(e.replace("meta_",""),t);break;case"meta_description":return void ti(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_${$o.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 ai(r[0].id,t,n,o):t.innerHTML="<h4>Invalid or Page doesn't exist</h4>"})}function si(e,t,n,o){return ii(this,void 0,void 0,function*(){try{let t=yield(0,Go.qj)(e),n=t.mainId,o=t.data;const i=yield hi(o,n),r=yield fi(n,[],i);return qo.cache.set(`wdgt_${n}`,r),console.log("DataCache after, widgetTree --\x3e",qo.cache,r),r}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function ci(e,t,n,o){return ii(this,void 0,void 0,function*(){let i=(yield(0,Go.qj)(e)).mainId;console.log("renderImportedWidget latestWidgetId, DataCache.cache --\x3e",i,qo.cache);const r=qo.cache.get(`wdgt_${i}`);if(console.log("renderImportedWidget widgetTree --\x3e",r),!r.name)return void(t.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const s=t;yield oi(r);const c=yield vi(r,s,void 0,n),a=Array.from({length:32},()=>"abcdef"[Math.floor(6*Math.random())]).join("");t.classList.add(`${a}`),t.style.position="relative";const l=document.createElement("style");l.id="mystyleid";const d=`\n .${a} {\n ${r.css+c.css+Vo} \n }\n `,u=(yield Zo(d))||"";if(l.innerHTML=u,document.head.appendChild(l),r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&oi(e)})),o){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;Ti(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{ki("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),c})}function ai(e,t,n,o){return ii(this,void 0,void 0,function*(){try{let i=yield(0,Go.qj)(e),r=i.mainId,s=i.data;const c=yield hi(s,r);return yield di(r,c,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`),t.textContent=`Error: ${e.message}`}})}function li(e,t,n,o){return ii(this,void 0,void 0,function*(){try{const i=yield(0,Go.Cp)(e);return yield di(e,i,t,n,o)}catch(e){console.error(`Error Caught Rendering Widget: ${e}`)}})}function di(e,t,n,o){return ii(this,arguments,void 0,function*(e,t,n,o,i=!0){const r=yield fi(e,[],t);if(!r.name)return void(n.innerHTML="<h4>Invalid or Widget doesn't exist</h4>");const s=n;yield oi(r);const c=yield vi(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 l=document.createElement("style");l.id="mystyleid";const d=`\n .${a} {\n ${r.css+c.css+Vo} \n }\n `,u=(yield Zo(d))||"";l.innerHTML=u,r.children.length&&(null==r||r.children.forEach(e=>{var t;const n=null==e?void 0:e.library;((null===(t=null==n?void 0:n.css)||void 0===t?void 0:t.length)||(null==n?void 0:n.js.length))&&oi(e)})),document.head.appendChild(l);const h=document.createElement("script");if(h.innerHTML=r.js,s.appendChild(h),i){const e=document.createElement("div");e.id="widget-details",e.innerHTML="",e.innerHTML=`\n <button class="widget-documentation-btn" widget-id="${(null==r?void 0:r.origin)||(null==r?void 0:r.widgetId)}" class="d-flex align-items-center gap-1" title="Documentation">\n <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 441 512.02"><path d="M324.87 279.77c32.01 0 61.01 13.01 82.03 34.02 21.09 21 34.1 50.05 34.1 82.1 0 32.06-13.01 61.11-34.02 82.11l-1.32 1.22c-20.92 20.29-49.41 32.8-80.79 32.8-32.06 0-61.1-13.01-82.1-34.02-21.01-21-34.02-50.05-34.02-82.11s13.01-61.1 34.02-82.1c21-21.01 50.04-34.02 82.1-34.02zM243.11 38.08v54.18c.99 12.93 5.5 23.09 13.42 29.85 8.2 7.01 20.46 10.94 36.69 11.23l37.92-.04-88.03-95.22zm91.21 120.49-41.3-.04c-22.49-.35-40.21-6.4-52.9-17.24-13.23-11.31-20.68-27.35-22.19-47.23l-.11-1.74V25.29H62.87c-10.34 0-19.75 4.23-26.55 11.03-6.8 6.8-11.03 16.21-11.03 26.55v336.49c0 10.3 4.25 19.71 11.06 26.52 6.8 6.8 16.22 11.05 26.52 11.05h119.41c2.54 8.79 5.87 17.25 9.92 25.29H62.87c-17.28 0-33.02-7.08-44.41-18.46C7.08 432.37 0 416.64 0 399.36V62.87c0-17.26 7.08-32.98 18.45-44.36C29.89 7.08 45.61 0 62.87 0h173.88c4.11 0 7.76 1.96 10.07 5l109.39 118.34c2.24 2.43 3.34 5.49 3.34 8.55l.03 119.72c-8.18-1.97-16.62-3.25-25.26-3.79v-89.25zm-229.76 54.49c-6.98 0-12.64-5.66-12.64-12.64 0-6.99 5.66-12.65 12.64-12.65h150.49c6.98 0 12.65 5.66 12.65 12.65 0 6.98-5.67 12.64-12.65 12.64H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h142.52c3.71 0 7.05 1.6 9.37 4.15a149.03 149.03 0 0 0-30.54 21.14H104.56zm0 72.3c-6.98 0-12.64-5.66-12.64-12.65 0-6.98 5.66-12.64 12.64-12.64h86.2c-3.82 8.05-6.95 16.51-9.29 25.29h-76.91zm239.61-18.85c7.41 7.43 4.68 18.9-3.05 25.23-7.46 6.01-20.97 8.92-28.68 1.83-7.77-7.23-4.68-18.87 2.76-25.24 7.18-6.05 21.39-9.37 28.97-1.82zm-43.88 95h6.34v-41.33H294.6c0-16.37 30.05-5.74 52.18-11.32v52.65h8.37v17.58h-54.86v-17.58z"/></svg>\n </button>\n `,s.appendChild(e);const t=document.createElement("dialog");t.id="widget-documentation-preview-modal",t.className="col-md-8",t.innerHTML="",t.innerHTML='\n <div class="widget-documentation-heading">\n <h4>Documentation</h4>\n <button class="close-documentation-button document-preview-close-button" title="Close">\n <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>\n </button>\n </div>\n\n \x3c!-- <div id="documentation-preview" class="ck-content"></div> --\x3e\n <div id="documentation-view" class="ck-content"></div>\n\n <div class="widget-documentation-footer">\n <button class="document-preview-close-button">Close</button>\n </div>\n ',s.appendChild(t);const n=s.querySelectorAll(".widget-documentation-btn");null==n||n.forEach(e=>{e.addEventListener("click",e=>{const t=null==e?void 0:e.target;Ti(null==t?void 0:t.getAttribute("widget-id"))})});const o=s.querySelectorAll(".document-preview-close-button");null==o||o.forEach(e=>{e.addEventListener("click",()=>{ki("widget-documentation-preview-modal")})})}return s.querySelectorAll(".wb-initial-empty").forEach(e=>{e.classList.remove("wb-initial-empty")}),document.querySelectorAll('[onclick="widgetSelected(event)"]').forEach(e=>{e.removeAttribute("onclick")}),c})}function ui(e,t){return ii(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 v=!!(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 y=null;if(v&&o){const e=yield(0,Go.qj)(o);y=(null===(p=null==e?void 0:e.data)||void 0===p?void 0:p[0])||[],y.useLatest=!0,n.data.the_child_widget.the_child_widget_info=y}n.data.the_child_widget.the_child_widget_info.sChildId=n.id,yield ui(n.data.the_child_widget.the_child_widget_info,t)}})}function hi(e,t){return ii(this,void 0,void 0,function*(){const n=[],o=[...e];try{const e=o.find(e=>e.id===t);yield ui(e,n)}catch(e){console.error("convert to real bulk error",e)}return n})}function pi(e){return ii(this,arguments,void 0,function*(e,t=[],n=""){let o=yield(0,Go.Cp)(e);const i=yield hi(o,e);return yield fi(e,[],i)})}function fi(e){return ii(this,arguments,void 0,function*(e,t=[],n,o=""){var i,r,s,c,a,l,d,u,h,p,f,v,y,g,m,C,w,T,k,I,S,A,N,b,L,_,E,x,O,B,R,D,G,F,P,U,W,M,j,V,$,H,q,z,J,Q,Y,X,Z,K,ee,te,ne,oe,ie,re,se,ce,ae;try{const le=new Bo,de=(0,Go.ix)(n,e);t.push(e);const ue=null===(i=null==de?void 0:de.data)||void 0===i?void 0:i.the_widget;le.name=null===(s=null===(r=null==ue?void 0:ue.the_widget_name)||void 0===r?void 0:r.data)||void 0===s?void 0:s.the_name,le.html=null===(a=null===(c=null==ue?void 0:ue.the_widget_html)||void 0===c?void 0:c.data)||void 0===a?void 0:a.the_html,le.css=null===(d=null===(l=null==ue?void 0:ue.the_widget_css)||void 0===l?void 0:l.data)||void 0===d?void 0:d.the_css,le.js=null===(h=null===(u=null==ue?void 0:ue.the_widget_js)||void 0===u?void 0:u.data)||void 0===h?void 0:h.the_js,le.origin=Number((null===(f=null===(p=null==ue?void 0:ue.the_widget_origin)||void 0===p?void 0:p.data)||void 0===f?void 0:f.the_origin)||(null===(y=null===(v=null==ue?void 0:ue.the_widget_origin)||void 0===v?void 0:v.data)||void 0===y?void 0:y.the_originid)),le.version=null===(m=null===(g=null==ue?void 0:ue.the_widget_version)||void 0===g?void 0:g.data)||void 0===m?void 0:m.the_version,le.clean=null===(w=null===(C=null==ue?void 0:ue.the_widget_clean)||void 0===C?void 0:C.data)||void 0===w?void 0:w.the_clean,le.timestamp=null===(k=null===(T=null==ue?void 0:ue.the_widget_timestamp)||void 0===T?void 0:T.data)||void 0===k?void 0:k.the_timestamp,le.id=null==de?void 0:de.id;const he=null===(S=null===(I=null==ue?void 0:ue.the_widget_type)||void 0===I?void 0:I.data)||void 0===S?void 0:S.the_type;le.type="null"==he||null==he?"the_element_name":he,le.after_render=null===(N=null===(A=null==ue?void 0:ue.the_widget_after_render)||void 0===A?void 0:A.data)||void 0===N?void 0:N.the_after_render,le.before_render=null===(L=null===(b=null==ue?void 0:ue.the_widget_before_render)||void 0===b?void 0:b.data)||void 0===L?void 0:L.the_before_render,le.dependency=null===(E=null===(_=null==ue?void 0:ue.the_widget_dependency)||void 0===_?void 0:_.data)||void 0===E?void 0:E.the_dependency,le.update=null===(O=null===(x=null==ue?void 0:ue.the_widget_update)||void 0===x?void 0:x.data)||void 0===O?void 0:O.the_update,le.widgetId=e,le.mount_child=null===(R=null===(B=null==ue?void 0:ue.the_widget_mount_child)||void 0===B?void 0:B.data)||void 0===R?void 0:R.the_mount_child;const pe=null==ue?void 0:ue.the_widget_s_child;(null==de?void 0:de.useLatest)&&(le.useLatest=!0),(null==de?void 0:de.sChildId)&&(le.sChildId=de.sChildId);const fe=null===(D=null==ue?void 0:ue.the_widget_s_css_library)||void 0===D?void 0:D.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}}),ve=null===(G=null==ue?void 0:ue.the_widget_s_js_library)||void 0===G?void 0:G.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}});le.library={css:fe||[],js:ve||[]};const ye=null===(P=null===(F=null==ue?void 0:ue.the_widget_assistant)||void 0===F?void 0:F.data)||void 0===P?void 0:P.the_assistant;le.assistant={id:null===(W=null===(U=null==ye?void 0:ye.the_assistant_id)||void 0===U?void 0:U.data)||void 0===W?void 0:W.the_id,input:null===(j=null===(M=null==ye?void 0:ye.the_assistant_input)||void 0===M?void 0:M.data)||void 0===j?void 0:j.the_input,type:null===($=null===(V=null==ye?void 0:ye.the_assistant_type)||void 0===V?void 0:V.data)||void 0===$?void 0:$.the_type};const ge=null===(H=null==ue?void 0:ue.the_widget_s_custom_function)||void 0===H?void 0:H.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(le.custom_functions=ge,null==pe?void 0:pe.length)for(let e=0;e<pe.length;e++){const i=(null===(J=null===(z=null===(q=pe[e])||void 0===q?void 0:q.data.the_child_widget)||void 0===z?void 0:z.the_child_widget_info)||void 0===J?void 0:J.id)||(null===(Z=null===(X=null===(Y=null===(Q=pe[e])||void 0===Q?void 0:Q.data.the_child_widget)||void 0===Y?void 0:Y.the_child_widget_parent)||void 0===X?void 0:X.data)||void 0===Z?void 0:Z.the_parent),r=yield fi(i,t,n,o),s=null===(oe=null===(ne=null===(te=null===(ee=null===(K=pe[e])||void 0===K?void 0:K.data)||void 0===ee?void 0:ee.the_child_widget)||void 0===te?void 0:te.the_child_widget_type)||void 0===ne?void 0:ne.data)||void 0===oe?void 0:oe.the_type,c=null===(ae=null===(ce=null===(se=null===(re=null===(ie=pe[e])||void 0===ie?void 0:ie.data)||void 0===re?void 0:re.the_child_widget)||void 0===se?void 0:se.the_child_widget_wrapper)||void 0===ce?void 0:ce.data)||void 0===ae?void 0:ae.the_wrapper;r.type="null"==s||null==s?"the_element_name":s,r.wrapper=c,le.children.push(r)}return le}catch(e){throw e instanceof Error&&console.error("error converting bulkwidget to widget tree",e.message),e}})}function vi(e,t){return ii(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,c;const a=new vo;a.html=e.html,r&&(a.parentWidget=yi(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,a.widgetDependenciesData=e.dependency,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=mi(n);n.html=`<div id="${n.wrapper}">${n.html}</div>`;const o=yield vi(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 wi(t,".widget_container"),a})}function yi(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 gi(e,t){return ii(this,arguments,void 0,function*(e,t,n=!0,o,i,r=null){var s,c;let a=new vo;a.html=e.html,r&&(a.parentWidget=yi(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.widgetDependenciesData=e.dependency,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=mi(n),o=yield gi(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 mi(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 Ci(e,t){return ii(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 wi(e,t){return ii(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 Ci(e.firstChild,t);n.insertBefore(o,e)}n.removeChild(e)}}})}function Ti(e){return ii(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 xo(i,"").subscribe(t=>ii(this,void 0,void 0,function*(){var n,o,i,r,s,c,a,d,u,h,p;let f;const v=(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)||"";v&&(f=v);const y=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==y?void 0:y.length){const e=null==y?void 0:y.map(e=>{var t,n,o,i,r,s,c,a,l,d,u,h,p,f,v,y,g,m,C,w,T,k,I,S,A,N,b,L,_,E,x;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,D=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,G=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===(v=null===(f=null==O?void 0:O.the_documentation_bearer_token)||void 0===f?void 0:f.data)||void 0===v?void 0:v.the_bearer_token,W=null===(g=null===(y=null==O?void 0:O.the_documentation_username)||void 0===y?void 0:y.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,j=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,V=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===(b=null===(N=null==O?void 0:O.the_documentation_language)||void 0===N?void 0:N.data)||void 0===b?void 0:b.the_language,z=null===(_=null===(L=null==O?void 0:O.the_documentation_return)||void 0===L?void 0:L.data)||void 0===_?void 0:_.the_return,J=null===(x=null===(E=null==O?void 0:O.the_documentation_code_editor)||void 0===E?void 0:E.data)||void 0===x?void 0:x.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:D,title:G};if("blank"===B)Z=Object.assign({},Z);else if("api"===B){const e=[];(null==V?void 0:V.length)&&(null==V||V.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:j,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 ii(this,void 0,void 0,function*(){document.getElementById("widget-documentation-preview-modal").showModal()})}(),function(e,t){ii(this,void 0,void 0,function*(){const n=document.getElementById("documentation-view");if(0!=l.B.DOCUMENTATION_WIDGET)return void(yield ai(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 `:"",v=(null==h?void 0:h.length)?`\n <h6>Attachments</h6>\n <div class="documentation-attachments">\n ${h}\n </div>\n `:"",y=(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 ${v}\n ${y}\n </div>\n <p class="documentation-creator">- added by: <span>${null==e?void 0:e.creatorEmail}</span></p>\n `,null==l||l.appendChild(d),null==o||o.appendChild(l)}):void 0!==e&&(o.innerHTML=e)})}(f,e)}))})}function ki(e){return ii(this,void 0,void 0,function*(){const t=document.getElementById(e),n=null==t?void 0:t.querySelector("form");null==n||n.reset(),null==t||t.close()})}var 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,n="",o={concepts:[],connections:[]}){var i,r,s,c;if(Mi)try{const a=yield Yi("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),tr(e)}let a=999,l=999,d=(0,M.o)();for(const i in e){let r=Ai(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=Ni(r)),yield Si(e[i],d,r,o);else{Array.isArray(e[i])&&(r=bi(r));let s=bi(i),c=yield(0,K.k)(r,"",!0,a,4,l,void 0,o);d=c;let u=_i(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=Ni(r)),yield Si(e[i],c,r,o)}else{let r=_i(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 Ai(e){return e.startsWith("the_")?e:"the_"+e}function Ni(e){return e.endsWith("_s")?e:e+"_s"}function bi(e){return e.replace(/_s$/,"")}const Li=e=>/^[+-]?\d+(\.\d+)?$/.test(e);function _i(e,t){return Li(t)?e+"_":e+"_"+function(e){return e.startsWith("the_")?e.slice(4):e}(t)}class Ei{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 xi(e,t){if(Array.isArray(e)&&Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);return e}var Oi=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 Oi(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 Oi(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 Oi(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;xi(i,o.connections),xi(n,s)}if(e.options.length>0){let o=yield function(e,t,n){return Oi(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;xi(i,o.connections),xi(n,s)}}else r=yield function(e,t){return Oi(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 Oi(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 Di(e.required,r,n,t,!0),s=yield Di(e.optional,r,n,t),n.push(r);let c=Ri(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 Bi(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),xi(i,d),xi(n,u),n.push(l)}xi(i,s),xi(i,o),xi(n,e.addedConcepts),xi(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 Ri(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 Di(e,t,n,o){return Oi(this,arguments,void 0,function*(e,t,n,o,i=!1,r=!1){let s=[],c=[],a=Ri(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 Gi=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 Fi(e){return Gi(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 Pi=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 Ui(e){return Pi(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 Fi(o)),n})}function Wi(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 Mi,ji=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 Vi=Date.now().toString(36)+Math.random().toString(36).substring(2);let $i=[],Hi=[],qi=!1;function zi(e){qi=e}function Ji(e="",t){Be.b.BearerAccessToken=e,Mi&&Yi("updateAccessToken",{accessToken:e,session:Be.b.sessionId})}function Qi(){return ji(this,arguments,void 0,function*(e="",t="",n="",o="",i=!0,s="",c=void 0,a={},d={},h=""){var p;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!==(p=d.logserver)&&void 0!==p?p:"https://logdev.freeschema.com",l.B.ACCESS_CONTROL_BASE_URL=h,console.log("setting the logserver",l.B.LOG_SERVER,d.logserver),n&&Ji(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=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&&(Ee.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 Zi(),void console.warn("Service Worker not supported in this browser.");if(yield function(){return ji(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 ji(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&&Yi("SESSION_DATA",{type:"SESSION_DATA",data:l.B.NODE_CACHE_URL,session:Be.b.sessionId})})}(),function(){navigator.serviceWorker.addEventListener("message",e=>ji(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=>ji(this,void 0,void 0,function*(){const{type:t,payload:n}=e.data;if(!t)return;let o={success:!1,data:void 0};Xi[t]?yield Xi[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=>ji(this,void 0,void 0,function*(){console.log("registraions ready",t),Mi=t.active,yield nr(),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 ji(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=>ji(this,void 0,void 0,function*(){console.log("Service Worker registered:",e),setInterval(()=>{Hi.length&&er()},2e3),console.log("update listen start"),e.onupdatefound=()=>{const n=e.installing;console.log("new worker",n),n&&(n.onstatechange=()=>ji(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"),er()},5e3),yield nr(),s=!0,er(),t())}))},e.addEventListener("controllerchange",()=>ji(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 nr())})),(e.installing||e.waiting||e.active)&&e.addEventListener("statechange",e=>ji(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 nr())})),e.active?(console.log("active sw"),Mi=e.active,yield nr(),er(),t()):setTimeout(()=>{s||o("Not Completed Initialization")},1e4)})).catch(e=>ji(this,void 0,void 0,function*(){yield Zi(),o(e),console.error("Service Worker registration failed:",e),(0,u.ey)(n,"handleRegisterServiceWorker",e)}))})})}(c)}catch(e){yield Zi(),console.error("Unable to start service worker",e)}else yield Zi(),console.warn("Service Worker not activated");return!0}catch(e){yield Zi(),console.warn("Cannot initialize the system",e)}})}function Yi(e,t){return ji(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=Vi;const r=JSON.parse(JSON.stringify(t));let s;return"checkProcess"!=e&&0==n&&(s=setInterval(()=>ji(this,void 0,void 0,function*(){if(!o&&!(yield function(e,t){return ji(this,void 0,void 0,function*(){var n;try{const o=yield Yi("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 Yi(e,t,n+1);console.log("Failed to handle type "+e+" "+i)}}),2e3)),new Promise((n,c)=>{if(navigator.serviceWorker.controller||Mi||console.log("",navigator.serviceWorker.controller,Mi,e),navigator.serviceWorker.controller||Mi){const a=r=>{var l,d,h,p,f,v;(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===(v=r.data)||void 0===v?void 0:v.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(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 Hi.push({message:{type:e,payload:r}}),"init"==e&&(clearInterval(s),n(null))})})}const Xi={GetLinkListener:e=>ji(void 0,void 0,void 0,function*(){const t=$i.find(t=>t.listenerId==e.listenerId);return null==t||t.callback(e.data),{success:!0}}),dispatchEvent:e=>ji(void 0,void 0,void 0,function*(){if(Mi){let t=new CustomEvent(e.id||"",e.data);dispatchEvent(t)}return{success:!0}}),checkInit:e=>ji(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 nr(),{success:!0}})};function Zi(){return ji(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 Ki(e,t={}){if(Mi||"undefined"!=typeof window){let n=new CustomEvent(`${e}`,t);dispatchEvent(n)}else ro.x.postMessage({type:"dispatchEvent",payload:{id:e,data:t}})}function er(){return ji(this,void 0,void 0,function*(){console.log("message queue",Hi);const e=Hi.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=Hi.indexOf(e);t>-1&&Hi.splice(t,1),yield Yi(null==e?void 0:e.type,null==e?void 0:e.payload)}for(console.log("message queue while",Hi);Hi.length>0;){const{message:e,resolve:t,reject:n}=Hi.shift();console.log("Queue poped",e.type,e),yield Yi(e.type,e.payload)}})}const tr=e=>{if(e instanceof V.z)throw console.error("FreeSchemaResponse Error",e),e;console.error("Service Worker Error",e)};function nr(){return ji(this,void 0,void 0,function*(){yield Yi("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,accessControlUrl:l.B.ACCESS_CONTROL_BASE_URL})})}},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},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}}},4151:e=>{e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},4195:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o=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},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},4287:(e,t,n)=>{n.d(t,{w:()=>s});var o=n(3776),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)})}}},4310:(e,t,n)=>{n.d(t,{Cp:()=>h,ix:()=>f,qj:()=>p});var o=n(3776),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"),v=o.BaseUrl.getWidgetData()+"?id="+e;const y=yield fetch(v,{method:"GET",headers:f});if(!y.ok)return(0,s.ry)(y),console.log("This is the BuildWidgetFromId error",y.status),[];p=yield y.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=[],v={},y=(0,a.Xr)("application/json");try{let n=o.BaseUrl.getLatestWidgetData()+"?id="+e;t=yield fetch(n,{method:"GET",headers:y})}catch(n){t=yield(0,i.g)({method:"GET",headers:y},"?id="+e)}if(!t.ok)return(0,s.ry)(t),console.log("This is the BuildWidgetFromId error",t.status),[];v=yield t.json(),l=v.conceptIds,d=v.linkers,u=v.reverse,h=v.mainCompositionIds,f=v.countinfo;let g=(0,r.w)(f);return n=yield(0,c.e$)(d,l,h,u,g,p),{data:n,mainId:v.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]}},4364:(e,t,n)=>{n.d(t,{s:()=>s});var o=n(1239),i=n(3776),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)})}},4402:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(3026),i=n(9581),r=n(3518),s=n(1863),c=n(3776),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)("application/json");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)}})}},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=v(n(5588)),i=v(n(4195)),r=v(n(1704)),s=v(n(425)),c=v(n(7071)),a=v(n(2918)),l=v(n(7324)),d=v(n(518)),u=v(n(339)),h=v(n(5799)),p=v(n(9720)),f=v(n(1669));function v(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)}},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)},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)}}},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},4698:(e,t,n)=>{n.d(t,{V:()=>a,w:()=>c});var o=n(7139),i=n(3776),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.")}},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(3776),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,v;let y=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===(v=null===(f=null==o?void 0:o.actions)||void 0===f?void 0:f.connections)||void 0===v?void 0:v.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,v=0;p=e,f=t,v=n;let y=new o.N(0,0,0,0,0,0,0);return e!=t&&(y=new o.N(h,p,f,d,n,a,s),y.isTemp=!0,y.typeCharacter=l,c.LocalSyncData.AddConnection(y),i.G.AddConnection(y),u.connections.push(y)),y}catch(o){throw s.V.logError(y,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)})}},4818:(e,t,n)=>{n.d(t,{m:()=>h,E:()=>p});var o=n(3776),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})}},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=[]},5020:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(3776),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}}})}},5042:e=>{e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",i=0|n;for(;i--;)o+=e[Math.random()*e.length|0];return o}}},5170:(e,t,n)=>{t.__esModule=!0,t.default=void 0;var o,i,r=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)),v=S(n(1704)),y=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),b=Object.assign({},N,((i={})[C.comment]=!0,i));function L(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 E(e,t,n,o){return{start:{line:e,column:t},end:{line:n,column:o}}}function x(e){return E(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 E(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 D=function(){function e(e,t){void 0===t&&(t={}),this.rule=e,this.options=Object.assign({lossy:!1,safe:!1},t),this.position=0,this.css="string"==typeof this.rule?this.rule:this.rule.selector,this.tokens=(0,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:E(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 v=(0,T.getProp)(o,"raws","value");o.value+="$",v&&(o.raws.value=v+"$");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 y=(0,T.unesc)(d),g=(0,T.getProp)(o,"raws","value")||"",w=o.value||"";o.value=w+y,o.quoteMark=null,(y!==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")||"",b=(0,T.getProp)(o,"raws","spaces",c,"after")||N;(0,T.ensureObject)(o,"raws","spaces",c),o.raws.spaces[c].after=b+d}else{var L=o[c]||"",_=(0,T.getProp)(o,"raws",c)||L;(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:x(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:E(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 v.default({value:"/"+t+"/",source:E(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 v.default({value:this.content(),source:x(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 v.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 y=this.convertWhitespaceNodesToSpace(p),g=y.space,w=y.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:L(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:x(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 y.default({value:this.content(),source:x(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:L(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:E(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:x(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:x(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 v=n.currToken,y=v[m.FIELDS.START_POS]+p[r],g=E(v[1],v[2]+o,v[3],v[2]+(h-1));if(~a.indexOf(o)){var C={value:f.slice(1),source:g,sourceIndex:y};s=new c.default(B(C,"value"))}else if(~u.indexOf(o)){var w={value:f.slice(1),source:g,sourceIndex:y};s=new l.default(B(w,"value"))}else{var T={value:f,source:g,sourceIndex:y};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(!b[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=D,e.exports=t.default},5238:(e,t,n)=>{let o=n(3152);class i extends o{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}e.exports=i,i.default=i},5239:(e,t,n)=>{n.d(t,{O:()=>c});var o=n(205),i=n(3776);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},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=[]},5284:(e,t,n)=>{n.d(t,{B:()=>c});var o=n(3776),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}})}},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},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(3776),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,v,y,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,b={},L={};(null==d?void 0:d.isDataLoaded)?(b.compositionIds=null===(p=d.conceptIds)||void 0===p?void 0:p.slice(),b.internalConnections=null===(v=d.internalConnections)||void 0===v?void 0:v.slice(),b.linkers=null===(y=d.linkers)||void 0===y?void 0:y.slice(),b.reverse=null===(g=d.reverse)||void 0===g?void 0:g.slice(),L=b,t=L.compositionIds,S=L.internalConnections,I=L.linkers,A=L.reverse):(b=yield(0,o.j)(e,n),d&&(d.conceptIds=null===(m=b.compositionIds)||void 0===m?void 0:m.slice(),d.internalConnections=null===(C=b.internalConnections)||void 0===C?void 0:C.slice(),d.linkers=null===(w=b.linkers)||void 0===w?void 0:w.slice(),d.reverse=null===(T=b.reverse)||void 0===T?void 0:T.slice(),d.isDataLoaded=!0),L=b,t=L.compositionIds,S=L.internalConnections,I=L.linkers,A=L.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})}},5328:(e,t,n)=>{n.d(t,{d:()=>l});var o=n(3776),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)}},5457:(e,t,n)=>{n.d(t,{c:()=>a});var o=n(3776),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},5588:(e,t,n)=>{t.__esModule=!0,t.default=void 0,t.unescapeValue=y;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."),v=u(function(){},"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");function y(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;v();var t=y(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=y(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}},5644:(e,t,n)=>{let o,i,r=n(7793);class s extends r{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new o(new i,this,e).stringify()}}s.registerLazyResult=e=>{o=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s,r.registerRoot(s)},5781:e=>{const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),i="/".charCodeAt(0),r="\n".charCodeAt(0),s=" ".charCodeAt(0),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),v="}".charCodeAt(0),y=";".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,b,L,_,E,x,O,B,R,D=e.css.valueOf(),G=S.ignoreErrors,F=D.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=D.charCodeAt(P),A){case r:case s:case a:case l:case c:L=P;do{L+=1,A=D.charCodeAt(L)}while(A===s||A===r||A===a||A===l||A===c);E=["space",D.slice(P,L)],P=L-1;break;case d:case u:case f:case v:case m:case y:case p:{let e=String.fromCharCode(A);E=[e,e,P];break}case h:if(R=U.length?U.pop()[1]:"",B=D.charCodeAt(P+1),"url"===R&&B!==t&&B!==n&&B!==s&&B!==r&&B!==a&&B!==c&&B!==l){L=P;do{if(x=!1,L=D.indexOf(")",L+1),-1===L){if(G||S){L=P;break}M("bracket")}for(O=L;D.charCodeAt(O-1)===o;)O-=1,x=!x}while(x);E=["brackets",D.slice(P,L+1),P,L],P=L}else L=D.indexOf(")",P+1),N=D.slice(P,L+1),-1===L||k.test(N)?E=["(","(",P]:(E=["brackets",N,P,L],P=L);break;case t:case n:_=A===t?"'":'"',L=P;do{if(x=!1,L=D.indexOf(_,L+1),-1===L){if(G||S){L=P+1;break}M("string")}for(O=L;D.charCodeAt(O-1)===o;)O-=1,x=!x}while(x);E=["string",D.slice(P,L+1),P,L],P=L;break;case C:w.lastIndex=P+1,w.test(D),L=0===w.lastIndex?D.length-1:w.lastIndex-2,E=["at-word",D.slice(P,L+1),P,L],P=L;break;case o:for(L=P,b=!0;D.charCodeAt(L+1)===o;)L+=1,b=!b;if(A=D.charCodeAt(L+1),b&&A!==i&&A!==s&&A!==r&&A!==a&&A!==l&&A!==c&&(L+=1,I.test(D.charAt(L)))){for(;I.test(D.charAt(L+1));)L+=1;D.charCodeAt(L+1)===s&&(L+=1)}E=["word",D.slice(P,L+1),P,L],P=L;break;default:A===i&&D.charCodeAt(P+1)===g?(L=D.indexOf("*/",P+2)+1,0===L&&(G||S?L=D.length:M("comment")),E=["comment",D.slice(P,L+1),P,L],P=L):(T.lastIndex=P+1,T.test(D),L=0===T.lastIndex?D.length-1:T.lastIndex-2,E=["word",D.slice(P,L+1),P,L],U.push(E),P=L)}return P++,E},position:function(){return P}}}},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},5868:(e,t,n)=>{n.d(t,{k:()=>l});var o=n(3077),i=n(8357),r=n(9736),s=n(3776),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,v,y,g;0==a&&(l=999);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===(v=null===(f=null==n?void 0:n.actions)||void 0===f?void 0:f.concepts)||void 0===v?void 0:v.length)&&(p.concepts=JSON.parse(JSON.stringify(n.actions.concepts))),(null===(g=null===(y=null==n?void 0:n.actions)||void 0===y?void 0:y.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,v=4,y="",g=t.length;if(y=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,v,!0,h,p);else if(g>255)n=yield(0,i.$)(y,d,f,l,p),c=yield(0,o.A)(t,y,l,u,n.id,v,void 0,void 0,p);else{n=yield(0,i.$)(y,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,y,l,u,n.id,v,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}})}},5976:(e,t,n)=>{n.d(t,{p:()=>l,B:()=>a});var o=n(9581),i=n(3518),r=n(1863),s=n(3776),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=[]},6058:(e,t,n)=>{n.d(t,{W:()=>c});var o=n(1863),i=n(3518),r=n(3776),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})}},6156:e=>{let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},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},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")}},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})},6687:(e,t,n)=>{n.d(t,{D:()=>T,MT:()=>w,Nt:()=>f,QL:()=>g,as:()=>v,cw:()=>u,dF:()=>d,hG:()=>y,km:()=>p,nr:()=>C,p8:()=>h,rv:()=>m});var o=n(8642),i=n(7467),r=n(3776),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 v(){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 y(){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)}}const o=yield Promise.all(e.map(e=>r.ConnectionData.GetConnection(e))),c=[],a=[];for(let t=0;t<o.length;t++){const n=o[t];0===(null==n?void 0:n.id)?a.push(e[t]):c.push(n)}const l=yield(0,i.j)(a),d=[...c,...l],u=new Set;for(const e of d)u.add(e.ofTheConceptId),u.add(e.toTheConceptId),u.add(e.typeId);return yield(0,r.GetConceptBulk)([...u]),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 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})}},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}}},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)},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})},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},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 v(e){return"object"==typeof e&&"function"==typeof e.then}function y(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"]:y(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(v(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(v(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 v(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(v(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(v(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=y(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)},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},7139:(e,t,n)=>{n.d(t,{r:()=>d});var o=n(3026),i=n(9581),r=n(3776),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)}})}},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},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}}},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}`}},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},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(3776),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)("application/json"),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})}},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},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)})}},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},7869:(e,t,n)=>{n.d(t,{_:()=>v,A:()=>f});var o=n(9581),i=n(3026),r=n(1863),s=n(3518),c=n(3776),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]);v();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 v(){return p(this,void 0,void 0,function*(){d.isOnlineSync=!0;var e=new l.B(d.isOnlineSync);(0,u.El)(e)})}},7876:(e,t,n)=>{n.d(t,{A:()=>d,K:()=>u});var o=n(1735),i=n(7139),r=n(3776),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}})}},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}}})}},8064:(e,t,n)=>{n.d(t,{$I:()=>c,Ay:()=>s});var o=n(9736),i=(n(9581),n(3518),n(3776));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})}},8095:(e,t,n)=>{n.d(t,{h:()=>c});var o=n(3776),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 v=i.V.logfunction("CreateConnectionBetweenTwoConceptsLocal",c)||{};let y=performance.now();try{if(o.serviceWorker){v.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(v),r.data}catch(e){console.error("CreateConnectionBetweenTwoConceptsLocal sw error: ",e),(0,r.ey)(v,"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 y=yield(0,o.CreateTheConnectionLocal)(e.id,t.id,m.id,1e3,void 0,void 0,a);return i.V.logUpdate(v),y}catch(o){throw i.V.logError(y,e.userId,"create",void 0,void 0,500,o,"CreateConnectionBetweenTwoConceptsLocal",[e,t,n,s],void 0,void 0),(0,r.ey)(v,"CreateConnectionBetweenTwoConceptsLocal",o),o}})}},8146:(e,t,n)=>{n.d(t,{Y:()=>l});var o=n(3026),i=n(9581),r=n(3776),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})}},8286:(e,t,n)=>{n.d(t,{d:()=>f});var o=n(1735),i=n(3776),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=[]},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})}}},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},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},8357:(e,t,n)=>{n.d(t,{$:()=>d});var o=n(3077),i=n(8064),r=n(6467),s=n(9975),c=n(3776),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,v,y;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===(y=null===(v=null==o?void 0:o.actions)||void 0===v?void 0:v.connections)||void 0===y?void 0:y.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})}},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(3776),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,v=4,y=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:v,passedSessionId:y,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=y,T=f,k=f,I=v,S=f,A="",N=t.length,b=(0,u.o)();if(A=e.startsWith("the_")?e:"the_"+e,p)b=yield(0,a.MakeTheTypeConceptApi)(e,f),C=yield(0,h.Ay)(t,f,4,b.id,g,I,e);else if(N>255)b=yield(0,a.MakeTheTypeConceptApi)(A,f),C=yield(0,h.Ay)(t,f,4,b.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{b=yield(0,a.MakeTheTypeConceptApi)(A,f);let e=yield(0,c.A)(t,b.id);C=e,0==e.id&&0==e.userId&&(C=yield(0,h.N)(t,f,4,b.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}`,b.id,f))}return C.type=b,a.Logger.logUpdate(m),C})}},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 v=c.bind(null,i.ROOT);t.isRoot=v;var y=c.bind(null,i.SELECTOR);t.isSelector=y;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},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},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(3776),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)("application/json");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(3776),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})}},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(),v=void 0;if(f<32||f>126){if(f>=55296&&f<=56319&&u<h){var y=r.charCodeAt(u++);56320==(64512&y)?f=((1023&f)<<10)+(1023&y)+65536:u--}v="\\"+f.toString(16).toUpperCase()+" "}else v=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+=v}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},8939:(e,t,n)=>{n.d(t,{$N:()=>T,$V:()=>h,Ez:()=>k,JA:()=>C,Mb:()=>v,Nj:()=>f,PT:()=>w,RW:()=>m,XI:()=>g,ay:()=>u,hL:()=>d,kx:()=>y,re:()=>p,yz:()=>I,zN:()=>N});var o=n(7139),i=n(2),r=n(3026),s=n(8286),c=n(3776),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 v(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 b(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 y(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,v=((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=v;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 y={};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!=y[n.id]&&null!=y[n.id]||(y[n.id]={});let c=y[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 y[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 v={};return v.data=u,v.id=e,c.Logger.logUpdate(l),v})}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 b(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 b(e,t,n);l[h]=o}}else{const o=yield b(e,t,n);d[h]=o,l=d}}return l})}},9003:(e,t,n)=>{n.d(t,{S5:()=>l,kH:()=>u,qI:()=>a});var o=n(1863),i=n(3776),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)})})}},9371:(e,t,n)=>{let o=n(3152);class i extends o{constructor(e){super(e),this.type="comment"}}e.exports=i,i.default=i},9577:(e,t,n)=>{let o=n(7793),i=n(1106),r=n(8339);function s(e,t){let n=new i(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=s,s.default=s,o.registerParse(s)},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.ACCESS_CONTROL_BASE_URL="http://localhost:5001",o.FLAGS={logApplication:!1,logPackage:!1,accessTracker:!1,isTest:!1},o.BASE_RANDOMIZER=999},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},9635:(e,t,n)=>{n.d(t,{x:()=>o});const o=new BroadcastChannel("Freeschema_mftsccs_browser_channel")},9700:(e,t,n)=>{n.d(t,{V:()=>l});var o,i=n(3776),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()},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},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),v=n(628),y=n(3776),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,y.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),v.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=[]},9746:()=>{},9934:(e,t,n)=>{function o(e,t){return-1===e.indexOf(t)&&e.push(t),e}n.d(t,{A:()=>o})},9975:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(3776),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})}},9977:()=>{}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o=n(3776);const i=o.ADMIN,r=o.ALLID,s=o.AccessControlService,c=o.AccessTracker,a=o.AddGhostConcept,l=o.Anomaly,d=o.BaseUrl,u=o.BinaryTree,h=o.BuildWidgetFromId,p=o.BuilderStatefulWidget,f=o.Composition,v=o.CompositionBinaryTree,y=o.CompositionNode,g=o.Concept,m=o.ConceptsData,C=o.Connection,w=o.ConnectionData,T=o.CountInfo,k=o.CreateComposition,I=o.CreateConnection,S=o.CreateConnectionBetweenEntityLocal,A=o.CreateConnectionBetweenTwoConcepts,N=o.CreateConnectionBetweenTwoConceptsGeneral,b=o.CreateConnectionBetweenTwoConceptsLocal,L=o.CreateData,_=o.CreateDefaultConcept,E=o.CreateDefaultLConcept,x=o.CreateSession,O=o.CreateSessionVisit,B=o.CreateTheCompositionLocal,R=o.CreateTheCompositionWithCache,D=o.CreateTheConnection,G=o.CreateTheConnectionGeneral,F=o.CreateTheConnectionLocal,P=o.DATAID,U=o.DATAIDDATE,W=o.DATAV2,M=o.DelayFunctionExecution,j=o.DeleteConceptById,V=o.DeleteConceptLocal,$=o.DeleteConnectionById,H=o.DeleteConnectionByIdBulk,q=o.DeleteConnectionByType,z=o.DeleteConnectionByTypeBulk,J=o.DeleteUser,Q=o.DependencyObserver,Y=o.FilterSearch,X=o.FormatFromConnections,Z=o.FormatFromConnectionsAltered,K=o.FreeschemaQuery,ee=o.FreeschemaQueryApi,te=o.GetAllConnectionsOfComposition,ne=o.GetAllConnectionsOfCompositionBulk,oe=o.GetAllLinkerConnectionsFromTheConcept,ie=o.GetAllTheConnectionsByTypeAndOfTheConcept,re=o.GetComposition,se=o.GetCompositionBulk,ce=o.GetCompositionBulkWithDataId,ae=o.GetCompositionFromConnectionsWithDataId,le=o.GetCompositionFromConnectionsWithDataIdFromConnections,de=o.GetCompositionFromConnectionsWithDataIdInObject,ue=o.GetCompositionFromConnectionsWithDataIdIndex,he=o.GetCompositionFromConnectionsWithIndex,pe=o.GetCompositionFromConnectionsWithIndexFromConnections,fe=o.GetCompositionFromMemoryWithConnections,ve=o.GetCompositionList,ye=o.GetCompositionListAll,ge=o.GetCompositionListAllWithId,me=o.GetCompositionListListener,Ce=o.GetCompositionListLocal,we=o.GetCompositionListLocalWithId,Te=o.GetCompositionListWithId,ke=o.GetCompositionListWithIdUpdated,Ie=o.GetCompositionListener,Se=o.GetCompositionLocal,Ae=o.GetCompositionLocalWithId,Ne=o.GetCompositionWithAllIds,be=o.GetCompositionWithCache,Le=o.GetCompositionWithDataIdBulk,_e=o.GetCompositionWithDataIdWithCache,Ee=o.GetCompositionWithId,xe=o.GetCompositionWithIdAndDateFromMemory,Oe=o.GetConceptBulk,Be=o.GetConceptByCharacter,Re=o.GetConceptByCharacterAndCategoryLocal,De=o.GetConceptByCharacterAndType,Ge=o.GetConnectionBetweenTwoConceptsLinker,Fe=o.GetConnectionBulk,Pe=o.GetConnectionById,Ue=o.GetConnectionDataPrefetch,We=o.GetConnectionOfTheConcept,Me=o.GetConnectionTypeForCount,je=o.GetFreeschemaImage,Ve=o.GetFreeschemaImageUrl,$e=o.GetImageApi,He=o.GetLink,qe=o.GetLinkListListener,ze=o.GetLinkListener,Je=o.GetLinkRaw,Qe=o.GetLinkerConnectionFromConcepts,Ye=o.GetLinkerConnectionToConcepts,Xe=o.GetRelation,Ze=o.GetRelationLocal,Ke=o.GetRelationRaw,et=o.GetTheConcept,tt=o.GetTheConceptLocal,nt=o.GetUserGhostId,ot=o.JUSTDATA,it=o.LConcept,rt=o.LConnection,st=o.LISTNORMAL,ct=o.LocalConceptsData,at=o.LocalSyncData,lt=o.LocalTransaction,dt=o.Logger,ut=o.LoginToBackend,ht=o.MakeTheInstanceConcept,pt=o.MakeTheInstanceConceptLocal,ft=o.MakeTheTimestamp,vt=o.MakeTheTypeConceptApi,yt=o.MakeTheTypeConceptLocal,gt=o.NORMAL,mt=o.PRIVATE,Ct=o.PUBLIC,wt=o.PatcherStructure,Tt=o.Prototype,kt=o.RAW,It=o.RecursiveSearchApi,St=o.RecursiveSearchApiNewRawFullLinker,At=o.RecursiveSearchApiRaw,Nt=o.RecursiveSearchApiRawFullLinker,bt=o.RecursiveSearchApiWithInternalConnections,Lt=o.RecursiveSearchListener,_t=o.SchemaQuery,Et=o.SchemaQueryListener,xt=o.SearchAllConcepts,Ot=o.SearchLinkInternal,Bt=o.SearchLinkInternalAll,Rt=o.SearchLinkMultipleAll,Dt=o.SearchLinkMultipleAllObservable,Gt=o.SearchLinkMultipleApi,Ft=o.SearchQuery,Pt=o.SearchStructure,Ut=o.SearchWithLinker,Wt=o.SearchWithTypeAndLinker,Mt=o.SearchWithTypeAndLinkerApi,jt=o.Selector,Vt=o.SessionData,$t=o.Signin,Ht=o.Signup,qt=o.SignupEntity,zt=o.SplitStrings,Jt=o.StatefulWidget,Qt=o.SyncData,Yt=o.TrashTheConcept,Xt=o.UpdateComposition,Zt=o.UpdateCompositionLocal,Kt=o.UserBinaryTree,en=o.Validator,tn=o.ViewInternalData,nn=o.ViewInternalDataApi,on=o.WidgetTree,rn=o.convertFromConceptToLConcept,sn=o.convertFromLConceptToConcept,cn=o.convertWidgetTreeToWidget,an=o.convertWidgetTreeToWidgetWithWrapper,ln=o.createFormFieldData,dn=o.createPrototypeLocal,un=o.dispatchIdEvent,hn=o.getFromDatabaseWithType,pn=o.getObjectsFromIndexDb,fn=o.getUserDetails,vn=o.getWidgetBulkFromId,yn=o.getWidgetFromId,gn=o.handleServiceWorkerException,mn=o.hasActivatedSW,Cn=o.importLatestWidget,wn=o.init,Tn=o.orderTheConnections,kn=o.recursiveFetch,In=o.recursiveFetchNew,Sn=o.removeAllChildren,An=o.renderImportedWidget,Nn=o.renderLatestWidget,bn=o.renderPage,Ln=o.renderWidget,_n=o.searchLinkMultipleListener,En=o.sendEmail,xn=o.sendMessage,On=o.serviceWorker,Bn=o.setHasActivatedSW,Rn=o.storeToDatabase,Dn=o.subscribedListeners,Gn=o.unwrapContainers,Fn=o.updateAccessToken,Pn=o.uploadAttachment,Un=o.uploadFile,Wn=o.uploadImage,Mn=o.uploadImageV2,jn=o.validDocumentFormats,Vn=o.validImageFormats;export{i as ADMIN,r as ALLID,s as AccessControlService,c as AccessTracker,a as AddGhostConcept,l as Anomaly,d as BaseUrl,u as BinaryTree,h as BuildWidgetFromId,p as BuilderStatefulWidget,f as Composition,v as CompositionBinaryTree,y as CompositionNode,g as Concept,m as ConceptsData,C as Connection,w as ConnectionData,T as CountInfo,k as CreateComposition,I as CreateConnection,S as CreateConnectionBetweenEntityLocal,A as CreateConnectionBetweenTwoConcepts,N as CreateConnectionBetweenTwoConceptsGeneral,b as CreateConnectionBetweenTwoConceptsLocal,L as CreateData,_ as CreateDefaultConcept,E as CreateDefaultLConcept,x as CreateSession,O as CreateSessionVisit,B as CreateTheCompositionLocal,R as CreateTheCompositionWithCache,D as CreateTheConnection,G as CreateTheConnectionGeneral,F as CreateTheConnectionLocal,P as DATAID,U as DATAIDDATE,W as DATAV2,M as DelayFunctionExecution,j as DeleteConceptById,V as DeleteConceptLocal,$ as DeleteConnectionById,H as DeleteConnectionByIdBulk,q as DeleteConnectionByType,z as DeleteConnectionByTypeBulk,J as DeleteUser,Q as DependencyObserver,Y as FilterSearch,X as FormatFromConnections,Z as FormatFromConnectionsAltered,K as FreeschemaQuery,ee as FreeschemaQueryApi,te as GetAllConnectionsOfComposition,ne as GetAllConnectionsOfCompositionBulk,oe as GetAllLinkerConnectionsFromTheConcept,ie as GetAllTheConnectionsByTypeAndOfTheConcept,re as GetComposition,se as GetCompositionBulk,ce as GetCompositionBulkWithDataId,ae as GetCompositionFromConnectionsWithDataId,le as GetCompositionFromConnectionsWithDataIdFromConnections,de as GetCompositionFromConnectionsWithDataIdInObject,ue as GetCompositionFromConnectionsWithDataIdIndex,he as GetCompositionFromConnectionsWithIndex,pe as GetCompositionFromConnectionsWithIndexFromConnections,fe as GetCompositionFromMemoryWithConnections,ve as GetCompositionList,ye as GetCompositionListAll,ge as GetCompositionListAllWithId,me as GetCompositionListListener,Ce as GetCompositionListLocal,we as GetCompositionListLocalWithId,Te as GetCompositionListWithId,ke as GetCompositionListWithIdUpdated,Ie as GetCompositionListener,Se as GetCompositionLocal,Ae as GetCompositionLocalWithId,Ne as GetCompositionWithAllIds,be as GetCompositionWithCache,Le as GetCompositionWithDataIdBulk,_e as GetCompositionWithDataIdWithCache,Ee as GetCompositionWithId,xe as GetCompositionWithIdAndDateFromMemory,Oe as GetConceptBulk,Be as GetConceptByCharacter,Re as GetConceptByCharacterAndCategoryLocal,De as GetConceptByCharacterAndType,Ge as GetConnectionBetweenTwoConceptsLinker,Fe as GetConnectionBulk,Pe as GetConnectionById,Ue as GetConnectionDataPrefetch,We as GetConnectionOfTheConcept,Me as GetConnectionTypeForCount,je as GetFreeschemaImage,Ve as GetFreeschemaImageUrl,$e as GetImageApi,He as GetLink,qe as GetLinkListListener,ze as GetLinkListener,Je as GetLinkRaw,Qe as GetLinkerConnectionFromConcepts,Ye as GetLinkerConnectionToConcepts,Xe as GetRelation,Ze as GetRelationLocal,Ke as GetRelationRaw,et as GetTheConcept,tt as GetTheConceptLocal,nt as GetUserGhostId,ot as JUSTDATA,it as LConcept,rt as LConnection,st as LISTNORMAL,ct as LocalConceptsData,at as LocalSyncData,lt as LocalTransaction,dt as Logger,ut as LoginToBackend,ht as MakeTheInstanceConcept,pt as MakeTheInstanceConceptLocal,ft as MakeTheTimestamp,vt as MakeTheTypeConceptApi,yt as MakeTheTypeConceptLocal,gt as NORMAL,mt as PRIVATE,Ct as PUBLIC,wt as PatcherStructure,Tt as Prototype,kt as RAW,It as RecursiveSearchApi,St as RecursiveSearchApiNewRawFullLinker,At as RecursiveSearchApiRaw,Nt as RecursiveSearchApiRawFullLinker,bt as RecursiveSearchApiWithInternalConnections,Lt as RecursiveSearchListener,_t as SchemaQuery,Et as SchemaQueryListener,xt as SearchAllConcepts,Ot as SearchLinkInternal,Bt as SearchLinkInternalAll,Rt as SearchLinkMultipleAll,Dt as SearchLinkMultipleAllObservable,Gt as SearchLinkMultipleApi,Ft as SearchQuery,Pt as SearchStructure,Ut as SearchWithLinker,Wt as SearchWithTypeAndLinker,Mt as SearchWithTypeAndLinkerApi,jt as Selector,Vt as SessionData,$t as Signin,Ht as Signup,qt as SignupEntity,zt as SplitStrings,Jt as StatefulWidget,Qt as SyncData,Yt as TrashTheConcept,Xt as UpdateComposition,Zt as UpdateCompositionLocal,Kt as UserBinaryTree,en as Validator,tn as ViewInternalData,nn as ViewInternalDataApi,on as WidgetTree,rn as convertFromConceptToLConcept,sn as convertFromLConceptToConcept,cn as convertWidgetTreeToWidget,an as convertWidgetTreeToWidgetWithWrapper,ln as createFormFieldData,dn as createPrototypeLocal,un as dispatchIdEvent,hn as getFromDatabaseWithType,pn as getObjectsFromIndexDb,fn as getUserDetails,vn as getWidgetBulkFromId,yn as getWidgetFromId,gn as handleServiceWorkerException,mn as hasActivatedSW,Cn as importLatestWidget,wn as init,Tn as orderTheConnections,kn as recursiveFetch,In as recursiveFetchNew,Sn as removeAllChildren,An as renderImportedWidget,Nn as renderLatestWidget,bn as renderPage,Ln as renderWidget,_n as searchLinkMultipleListener,En as sendEmail,xn as sendMessage,On as serviceWorker,Bn as setHasActivatedSW,Rn as storeToDatabase,Dn as subscribedListeners,Gn as unwrapContainers,Fn as updateAccessToken,Pn as uploadAttachment,Un as uploadFile,Wn as uploadImage,Mn as uploadImageV2,jn as validDocumentFormats,Vn as validImageFormats};