@startinblox/core 0.17.21-beta.7 → 0.17.22

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 (258) hide show
  1. package/package.json +2 -2
  2. package/dist/_snowpack/env.js +0 -3
  3. package/dist/_snowpack/pkg/autolinker.js +0 -4281
  4. package/dist/_snowpack/pkg/autolinker.js.map +0 -1
  5. package/dist/_snowpack/pkg/autolinker.js.map.proxy.js +0 -1
  6. package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js +0 -377
  7. package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js.map +0 -1
  8. package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js.map.proxy.js +0 -1
  9. package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js +0 -22
  10. package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map +0 -1
  11. package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map.proxy.js +0 -1
  12. package/dist/_snowpack/pkg/common/decode-a4c334cf.js +0 -216
  13. package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map +0 -1
  14. package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map.proxy.js +0 -1
  15. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js +0 -1119
  16. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map +0 -1
  17. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map.proxy.js +0 -1
  18. package/dist/_snowpack/pkg/delta-markdown-for-quill.js +0 -25677
  19. package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +0 -1
  20. package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map.proxy.js +0 -1
  21. package/dist/_snowpack/pkg/dialog-polyfill.js +0 -859
  22. package/dist/_snowpack/pkg/dialog-polyfill.js.map +0 -1
  23. package/dist/_snowpack/pkg/dialog-polyfill.js.map.proxy.js +0 -1
  24. package/dist/_snowpack/pkg/fusejs.js +0 -1783
  25. package/dist/_snowpack/pkg/fusejs.js.map +0 -1
  26. package/dist/_snowpack/pkg/fusejs.js.map.proxy.js +0 -1
  27. package/dist/_snowpack/pkg/import-map.json +0 -23
  28. package/dist/_snowpack/pkg/jsonld-context-parser.js +0 -804
  29. package/dist/_snowpack/pkg/jsonld-context-parser.js.map +0 -1
  30. package/dist/_snowpack/pkg/jsonld-context-parser.js.map.proxy.js +0 -1
  31. package/dist/_snowpack/pkg/leaflet/dist/leaflet.css +0 -640
  32. package/dist/_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js +0 -10
  33. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css +0 -60
  34. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +0 -10
  35. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css +0 -14
  36. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +0 -10
  37. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +0 -40
  38. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +0 -1
  39. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map.proxy.js +0 -1
  40. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +0 -46
  41. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +0 -1
  42. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map.proxy.js +0 -1
  43. package/dist/_snowpack/pkg/lit-html/directives/until.js +0 -88
  44. package/dist/_snowpack/pkg/lit-html/directives/until.js.map +0 -1
  45. package/dist/_snowpack/pkg/lit-html/directives/until.js.map.proxy.js +0 -1
  46. package/dist/_snowpack/pkg/lit-html.js +0 -92
  47. package/dist/_snowpack/pkg/lit-html.js.map +0 -1
  48. package/dist/_snowpack/pkg/lit-html.js.map.proxy.js +0 -1
  49. package/dist/_snowpack/pkg/markdown-it.js +0 -11860
  50. package/dist/_snowpack/pkg/markdown-it.js.map +0 -1
  51. package/dist/_snowpack/pkg/markdown-it.js.map.proxy.js +0 -1
  52. package/dist/_snowpack/pkg/quill/dist/quill.snow.css +0 -945
  53. package/dist/_snowpack/pkg/quill/dist/quill.snow.css.proxy.js +0 -10
  54. package/dist/_snowpack/pkg/quill-delta-to-markdown.js +0 -1029
  55. package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +0 -1
  56. package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map.proxy.js +0 -1
  57. package/dist/_snowpack/pkg/quill.js +0 -13382
  58. package/dist/_snowpack/pkg/quill.js.map +0 -1
  59. package/dist/_snowpack/pkg/quill.js.map.proxy.js +0 -1
  60. package/dist/_snowpack/pkg/slim-select.js +0 -4
  61. package/dist/_snowpack/pkg/slim-select.js.map +0 -1
  62. package/dist/_snowpack/pkg/slim-select.js.map.proxy.js +0 -1
  63. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +0 -1164
  64. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +0 -10
  65. package/dist/_snowpack/pkg/tui-calendar.js +0 -42285
  66. package/dist/_snowpack/pkg/tui-calendar.js.map +0 -1
  67. package/dist/_snowpack/pkg/tui-calendar.js.map.proxy.js +0 -1
  68. package/dist/components/solid-ac-checker.js +0 -51
  69. package/dist/components/solid-ac-checker.js.map +0 -1
  70. package/dist/components/solid-calendar.js +0 -87
  71. package/dist/components/solid-calendar.js.map +0 -1
  72. package/dist/components/solid-delete.js +0 -111
  73. package/dist/components/solid-delete.js.map +0 -1
  74. package/dist/components/solid-display.js +0 -194
  75. package/dist/components/solid-display.js.map +0 -1
  76. package/dist/components/solid-form-search.js +0 -226
  77. package/dist/components/solid-form-search.js.map +0 -1
  78. package/dist/components/solid-form.js +0 -354
  79. package/dist/components/solid-form.js.map +0 -1
  80. package/dist/components/solid-lang.js +0 -46
  81. package/dist/components/solid-lang.js.map +0 -1
  82. package/dist/components/solid-map.js +0 -242
  83. package/dist/components/solid-map.js.map +0 -1
  84. package/dist/components/solid-table.js +0 -263
  85. package/dist/components/solid-table.js.map +0 -1
  86. package/dist/components/solid-widget.js +0 -94
  87. package/dist/components/solid-widget.js.map +0 -1
  88. package/dist/import.css +0 -4
  89. package/dist/index.js +0 -43
  90. package/dist/index.js.map +0 -1
  91. package/dist/libs/Component.js +0 -19
  92. package/dist/libs/Component.js.map +0 -1
  93. package/dist/libs/ComponentFactory.js +0 -196
  94. package/dist/libs/ComponentFactory.js.map +0 -1
  95. package/dist/libs/Compositor.js +0 -103
  96. package/dist/libs/Compositor.js.map +0 -1
  97. package/dist/libs/Sib.js +0 -58
  98. package/dist/libs/Sib.js.map +0 -1
  99. package/dist/libs/helpers.js +0 -219
  100. package/dist/libs/helpers.js.map +0 -1
  101. package/dist/libs/interfaces.js +0 -6
  102. package/dist/libs/interfaces.js.map +0 -1
  103. package/dist/libs/lit-helpers.js +0 -169
  104. package/dist/libs/lit-helpers.js.map +0 -1
  105. package/dist/libs/polyfills.js +0 -40
  106. package/dist/libs/polyfills.js.map +0 -1
  107. package/dist/libs/store/store.js +0 -862
  108. package/dist/libs/store/store.js.map +0 -1
  109. package/dist/locales/en.json +0 -10
  110. package/dist/locales/en.json.proxy.js +0 -2
  111. package/dist/locales/fr.json +0 -10
  112. package/dist/locales/fr.json.proxy.js +0 -2
  113. package/dist/mixins/attributeBinderMixin.js +0 -124
  114. package/dist/mixins/attributeBinderMixin.js.map +0 -1
  115. package/dist/mixins/contextMixin.js +0 -28
  116. package/dist/mixins/contextMixin.js.map +0 -1
  117. package/dist/mixins/counterMixin.js +0 -75
  118. package/dist/mixins/counterMixin.js.map +0 -1
  119. package/dist/mixins/federationMixin.js +0 -63
  120. package/dist/mixins/federationMixin.js.map +0 -1
  121. package/dist/mixins/filterMixin.js +0 -195
  122. package/dist/mixins/filterMixin.js.map +0 -1
  123. package/dist/mixins/grouperMixin.js +0 -80
  124. package/dist/mixins/grouperMixin.js.map +0 -1
  125. package/dist/mixins/highlighterMixin.js +0 -42
  126. package/dist/mixins/highlighterMixin.js.map +0 -1
  127. package/dist/mixins/interfaces.js +0 -8
  128. package/dist/mixins/interfaces.js.map +0 -1
  129. package/dist/mixins/listMixin.js +0 -136
  130. package/dist/mixins/listMixin.js.map +0 -1
  131. package/dist/mixins/nextMixin.js +0 -26
  132. package/dist/mixins/nextMixin.js.map +0 -1
  133. package/dist/mixins/paginateMixin.js +0 -110
  134. package/dist/mixins/paginateMixin.js.map +0 -1
  135. package/dist/mixins/requiredMixin.js +0 -34
  136. package/dist/mixins/requiredMixin.js.map +0 -1
  137. package/dist/mixins/sorterMixin.js +0 -149
  138. package/dist/mixins/sorterMixin.js.map +0 -1
  139. package/dist/mixins/storeMixin.js +0 -102
  140. package/dist/mixins/storeMixin.js.map +0 -1
  141. package/dist/mixins/translationMixin.js +0 -68
  142. package/dist/mixins/translationMixin.js.map +0 -1
  143. package/dist/mixins/validationMixin.js +0 -113
  144. package/dist/mixins/validationMixin.js.map +0 -1
  145. package/dist/mixins/widgetMixin.js +0 -447
  146. package/dist/mixins/widgetMixin.js.map +0 -1
  147. package/dist/new-widgets/attributeMixins/actionMixin.js +0 -14
  148. package/dist/new-widgets/attributeMixins/actionMixin.js.map +0 -1
  149. package/dist/new-widgets/attributeMixins/blankMixin.js +0 -10
  150. package/dist/new-widgets/attributeMixins/blankMixin.js.map +0 -1
  151. package/dist/new-widgets/attributeMixins/booleanMixin.js +0 -10
  152. package/dist/new-widgets/attributeMixins/booleanMixin.js.map +0 -1
  153. package/dist/new-widgets/attributeMixins/index.js +0 -20
  154. package/dist/new-widgets/attributeMixins/index.js.map +0 -1
  155. package/dist/new-widgets/attributeMixins/mailtoMixin.js +0 -10
  156. package/dist/new-widgets/attributeMixins/mailtoMixin.js.map +0 -1
  157. package/dist/new-widgets/attributeMixins/multipleMixin.js +0 -28
  158. package/dist/new-widgets/attributeMixins/multipleMixin.js.map +0 -1
  159. package/dist/new-widgets/attributeMixins/numberMixin.js +0 -10
  160. package/dist/new-widgets/attributeMixins/numberMixin.js.map +0 -1
  161. package/dist/new-widgets/attributeMixins/placeholderMixin.js +0 -19
  162. package/dist/new-widgets/attributeMixins/placeholderMixin.js.map +0 -1
  163. package/dist/new-widgets/attributeMixins/telMixin.js +0 -10
  164. package/dist/new-widgets/attributeMixins/telMixin.js.map +0 -1
  165. package/dist/new-widgets/baseWidgetMixin.js +0 -122
  166. package/dist/new-widgets/baseWidgetMixin.js.map +0 -1
  167. package/dist/new-widgets/callbackMixins/autocompletionMixin.js +0 -104
  168. package/dist/new-widgets/callbackMixins/autocompletionMixin.js.map +0 -1
  169. package/dist/new-widgets/callbackMixins/index.js +0 -8
  170. package/dist/new-widgets/callbackMixins/index.js.map +0 -1
  171. package/dist/new-widgets/callbackMixins/richtextMixin.js +0 -42
  172. package/dist/new-widgets/callbackMixins/richtextMixin.js.map +0 -1
  173. package/dist/new-widgets/callbackMixins/slimselect.css +0 -2
  174. package/dist/new-widgets/callbackMixins/slimselect.css.proxy.js +0 -10
  175. package/dist/new-widgets/new-widget-factory.js +0 -96
  176. package/dist/new-widgets/new-widget-factory.js.map +0 -1
  177. package/dist/new-widgets/templateAdditionMixins/addableMixin.js +0 -41
  178. package/dist/new-widgets/templateAdditionMixins/addableMixin.js.map +0 -1
  179. package/dist/new-widgets/templateAdditionMixins/index.js +0 -14
  180. package/dist/new-widgets/templateAdditionMixins/index.js.map +0 -1
  181. package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +0 -29
  182. package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js.map +0 -1
  183. package/dist/new-widgets/templateAdditionMixins/labelMixin.js +0 -31
  184. package/dist/new-widgets/templateAdditionMixins/labelMixin.js.map +0 -1
  185. package/dist/new-widgets/templates/defaultTemplatesDirectory.js +0 -36
  186. package/dist/new-widgets/templates/defaultTemplatesDirectory.js.map +0 -1
  187. package/dist/new-widgets/templates/displayTemplatesDirectory.js +0 -90
  188. package/dist/new-widgets/templates/displayTemplatesDirectory.js.map +0 -1
  189. package/dist/new-widgets/templates/formTemplatesDirectory.js +0 -397
  190. package/dist/new-widgets/templates/formTemplatesDirectory.js.map +0 -1
  191. package/dist/new-widgets/templates/groupTemplatesDirectory.js +0 -21
  192. package/dist/new-widgets/templates/groupTemplatesDirectory.js.map +0 -1
  193. package/dist/new-widgets/templates/index.js +0 -7
  194. package/dist/new-widgets/templates/index.js.map +0 -1
  195. package/dist/new-widgets/templates/setTemplatesDirectory.js +0 -49
  196. package/dist/new-widgets/templates/setTemplatesDirectory.js.map +0 -1
  197. package/dist/new-widgets/templatesDependencies/altMixin.js +0 -13
  198. package/dist/new-widgets/templatesDependencies/altMixin.js.map +0 -1
  199. package/dist/new-widgets/templatesDependencies/editableMixin.js +0 -77
  200. package/dist/new-widgets/templatesDependencies/editableMixin.js.map +0 -1
  201. package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +0 -38
  202. package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js.map +0 -1
  203. package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +0 -14
  204. package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js.map +0 -1
  205. package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +0 -51
  206. package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js.map +0 -1
  207. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +0 -66
  208. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js.map +0 -1
  209. package/dist/new-widgets/templatesDependencies/formFileMixin.js +0 -81
  210. package/dist/new-widgets/templatesDependencies/formFileMixin.js.map +0 -1
  211. package/dist/new-widgets/templatesDependencies/formLengthMixin.js +0 -19
  212. package/dist/new-widgets/templatesDependencies/formLengthMixin.js.map +0 -1
  213. package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +0 -19
  214. package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js.map +0 -1
  215. package/dist/new-widgets/templatesDependencies/formMixin.js +0 -66
  216. package/dist/new-widgets/templatesDependencies/formMixin.js.map +0 -1
  217. package/dist/new-widgets/templatesDependencies/formNumberMixin.js +0 -14
  218. package/dist/new-widgets/templatesDependencies/formNumberMixin.js.map +0 -1
  219. package/dist/new-widgets/templatesDependencies/formRadioMixin.js +0 -16
  220. package/dist/new-widgets/templatesDependencies/formRadioMixin.js.map +0 -1
  221. package/dist/new-widgets/templatesDependencies/formStepMixin.js +0 -13
  222. package/dist/new-widgets/templatesDependencies/formStepMixin.js.map +0 -1
  223. package/dist/new-widgets/templatesDependencies/linkTextMixin.js +0 -14
  224. package/dist/new-widgets/templatesDependencies/linkTextMixin.js.map +0 -1
  225. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +0 -125
  226. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js.map +0 -1
  227. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +0 -74
  228. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js.map +0 -1
  229. package/dist/new-widgets/templatesDependencies/patternMixin.js +0 -19
  230. package/dist/new-widgets/templatesDependencies/patternMixin.js.map +0 -1
  231. package/dist/new-widgets/templatesDependencies/rangeMixin.js +0 -110
  232. package/dist/new-widgets/templatesDependencies/rangeMixin.js.map +0 -1
  233. package/dist/new-widgets/templatesDependencies/setMixin.js +0 -12
  234. package/dist/new-widgets/templatesDependencies/setMixin.js.map +0 -1
  235. package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +0 -12
  236. package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js.map +0 -1
  237. package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +0 -18
  238. package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js.map +0 -1
  239. package/dist/new-widgets/valueTransformationMixins/dateMixin.js +0 -35
  240. package/dist/new-widgets/valueTransformationMixins/dateMixin.js.map +0 -1
  241. package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +0 -16
  242. package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js.map +0 -1
  243. package/dist/new-widgets/valueTransformationMixins/index.js +0 -16
  244. package/dist/new-widgets/valueTransformationMixins/index.js.map +0 -1
  245. package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +0 -25
  246. package/dist/new-widgets/valueTransformationMixins/markdownMixin.js.map +0 -1
  247. package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +0 -17
  248. package/dist/new-widgets/valueTransformationMixins/multilineMixin.js.map +0 -1
  249. package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +0 -27
  250. package/dist/new-widgets/valueTransformationMixins/oembedMixin.js.map +0 -1
  251. package/dist/solid-template-element.js +0 -164
  252. package/dist/solid-template-element.js.map +0 -1
  253. package/dist/style/default-theme.css +0 -24
  254. package/dist/style/default-theme.css.proxy.js +0 -10
  255. package/dist/widgets/baseWidget.js +0 -332
  256. package/dist/widgets/baseWidget.js.map +0 -1
  257. package/dist/widgets/widget-factory.js +0 -24
  258. package/dist/widgets/widget-factory.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["store.ts"],"names":["JSONLDContextParser","PubSub","ContextParser","myParser","base_context","rdf","rdfs","ldp","foaf","name","acl","permissions","mode","geo","lat","lng","Store","constructor","storeOptions","id","resolve","handler","event","detail","resource","document","removeEventListener","cache","Map","subscriptionIndex","subscriptionVirtualContainersIndex","loadingList","Set","headers","fetch","fetchMethod","session","getData","context","idParent","localData","forceFetch","has","get","isFullResource","Promise","addEventListener","resolveResource","add","clientContext","parse","_isLocalId","fetchData","error","console","delete","serverContext","resourceProxy","CustomGetter","getProxy","cacheGraph","dispatchEvent","CustomEvent","fetchAuthn","iri","options","authenticated","then","fn","_convertHeaders","response","method","ok","status","err","Error","_getAbsoluteIri","_getLanguage","log","credentials","json","key","parentContext","parentId","properties","merge","set","getSubObjects","res","newParentContext","getChildren","cacheChildrenPromises","subscribeResourceTo","push","all","match","_fetch","body","JSON","stringify","store","clearCache","_updateResource","includes","expandedId","_getExpandedId","purge","nestedResources","getNestedResources","resourcesToRefresh","resourcesToNotify","refreshResources","resourceIds","notifyResources","filter","resourceWithContexts","map","resourceId","publish","cachedResource","isContainer","nestedProperties","excludeKeys","p","Object","keys","forEach","child","setLocalData","post","put","patch","catch","warn","fullURL","URL","pathArray","pathname","split","containerUrl","origin","deleted","headersObject","Headers","value","entries","expandTerm","startsWith","nestedResourceId","existingSubscriptions","subscribeVirtualContainerTo","virtualContainerId","parentIri","location","href","_resourceIsComplete","length","localStorage","getItem","window","navigator","language","slice","selectLanguage","selectedLanguageCode","setItem","sibStore","sibAuth","querySelector","sibAuthDefined","customElements","whenDefined","localName","getFetch","Symbol","toPrimitive","expandProperties","prop","objectReplaceProperty","object","oldProp","newProp","defineProperty","getOwnPropertyDescriptor","path","path1","path2","getResource","getExpandedPredicate","e","lastPath1El","pop","unshift","undefined","join","iriParent","getProperties","getCompactedPredicate","getLdpContains","children","subObjects","property","isFullNestedResource","getResourceData","getPermissions","permissionPredicate","perm","compactIri","getCompactedIri","toString","Proxy","bind"],"mappings":";;;;AAAA,OAAOA,mBAAP,MAAgC,uBAAhC,C,CACA;;AACA,OAAOC,MAAP,MAAmB,mCAAnB;AAGA,MAAMC,aAAa,GAAGF,mBAAmB,CAACE,aAA1C;AACA,MAAMC,QAAQ,GAAG,IAAID,aAAJ,EAAjB;AAEA,OAAO,MAAME,YAAY,GAAG;AAC1B,YAAU,2BADgB;AAE1BC,EAAAA,GAAG,EAAE,6CAFqB;AAG1BC,EAAAA,IAAI,EAAE,uCAHoB;AAI1BC,EAAAA,GAAG,EAAE,2BAJqB;AAK1BC,EAAAA,IAAI,EAAE,4BALoB;AAM1BC,EAAAA,IAAI,EAAE,YANoB;AAO1BC,EAAAA,GAAG,EAAE,gCAPqB;AAQ1BC,EAAAA,WAAW,EAAE,mBARa;AAS1BC,EAAAA,IAAI,EAAE,UAToB;AAU1BC,EAAAA,GAAG,EAAE,0CAVqB;AAW1BC,EAAAA,GAAG,EAAE,SAXqB;AAY1BC,EAAAA,GAAG,EAAE;AAZqB,CAArB;;AAeP,MA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,cAAL,EAAP;AAA8B;;AAChC,eAAK,aAAL;AACE,mBAAO,KAAKM,cAAL,EAAP;AAA8B;;AAChC,eAAK,eAAL;AACE,mBAAO,KAAK3J,aAAZ;AAA2B;;AAC7B,eAAK,MAAL;AACE;;AACF;AACE,mBAAOzB,QAAQ,CAACmB,GAAT,CAAa8J,QAAb,CAAP;AAhBJ;AAkBD;AAvBoB,KAAhB,CAAP;AAyBD;;AAnNgB","sourcesContent":["import JSONLDContextParser from 'jsonld-context-parser';\n//@ts-ignore\nimport PubSub from 'https://cdn.skypack.dev/pubsub-js';\nimport type { Resource } from '../../mixins/interfaces';\n\nconst ContextParser = JSONLDContextParser.ContextParser;\nconst myParser = new ContextParser();\n\nexport const base_context = {\n '@vocab': 'http://happy-dev.fr/owl/#',\n rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n rdfs: 'http://www.w3.org/2000/01/rdf-schema#',\n ldp: 'http://www.w3.org/ns/ldp#',\n foaf: 'http://xmlns.com/foaf/0.1/',\n name: 'rdfs:label',\n acl: 'http://www.w3.org/ns/auth/acl#',\n permissions: 'acl:accessControl',\n mode: 'acl:mode',\n geo: \"http://www.w3.org/2003/01/geo/wgs84_pos#\",\n lat: \"geo:lat\",\n lng: \"geo:long\"\n};\n\nclass Store {\n cache: Map<string, any>;\n subscriptionIndex: Map<string, any>; // index of all the containers per resource\n subscriptionVirtualContainersIndex: Map<string, any>; // index of all the containers per resource\n loadingList: Set<String>;\n headers: object;\n fetch: Promise<any> | undefined;\n session: Promise<any> | undefined;\n\n constructor(private storeOptions: StoreOptions) {\n this.cache = new Map();\n this.subscriptionIndex = new Map();\n this.subscriptionVirtualContainersIndex = new Map();\n this.loadingList = new Set();\n this.headers = {'Content-Type': 'application/ld+json', 'Cache-Control': 'must-revalidate'};\n this.fetch = this.storeOptions.fetchMethod;\n this.session = this.storeOptions.session;\n }\n\n /**\n * Fetch data and cache it\n * @param id - uri of the resource to fetch\n * @param context - context used to expand id and predicates when accessing the resource\n * @param idParent - uri of the parent caller used to expand uri for local files\n * @param localData - data to put in cache\n * @param forceFetch - force the fetch of data\n *\n * @returns The fetched resource\n *\n * @async\n */\n\n async getData(id: string, context:any = {}, idParent = \"\", localData?: object, forceFetch: boolean = false): Promise<Resource|null> {\n if (localData == null && this.cache.has(id) && !this.loadingList.has(id)) {\n const resource = this.get(id);\n if (resource && resource.isFullResource() && !forceFetch) return resource; // if resource is not complete, re-fetch it\n }\n\n return new Promise(async (resolve) => {\n document.addEventListener('resourceReady', this.resolveResource(id, resolve));\n\n if (this.loadingList.has(id)) return;\n this.loadingList.add(id);\n\n // Generate proxy\n const clientContext = await myParser.parse(context);\n let resource: any = null;\n if(this._isLocalId(id)) {\n if(localData == null) localData = {};\n localData[\"@id\"] = id;\n resource = localData;\n } else try {\n resource = localData || await this.fetchData(id, clientContext, idParent);\n } catch (error) { console.error(error) }\n if (!resource) {\n this.loadingList.delete(id);\n resolve(null);\n return;\n }\n const serverContext = await myParser.parse([resource['@context'] || {}]);\n const resourceProxy = new CustomGetter(id, resource, clientContext, serverContext, idParent).getProxy();\n\n // Cache proxy\n await this.cacheGraph(id, resourceProxy, clientContext, serverContext, idParent || id);\n this.loadingList.delete(id);\n document.dispatchEvent(new CustomEvent('resourceReady', { detail: { id: id, resource: this.get(id) } }));\n });\n }\n\n async fetchAuthn(iri: string, options: any) {\n let authenticated = false;\n if (this.session) authenticated = await this.session;\n\n if (this.fetch && authenticated) { // authenticated\n return this.fetch.then(fn => fn(iri, options))\n } else { // anonymous\n if (options.headers) options.headers = this._convertHeaders(options.headers);\n return fetch(iri, options).then(function(response) {\n if (options.method === \"PURGE\" && !response.ok && response.status === 404) {\n const err = new Error(\"PURGE call is returning 404\");\n throw err;\n }\n return response;\n });\n }\n }\n\n async fetchData(id: string, context = {}, idParent = \"\") {\n const iri = this._getAbsoluteIri(id, context, idParent);\n const headers = { ...this.headers, 'accept-language': this._getLanguage() };\n console.log(\"Request Headers:\", headers);\n return this.fetchAuthn(iri, {\n method: 'GET',\n headers: headers,\n credentials: 'include'\n }).then(response => {\n if (!response.ok) return;\n return response.json()\n })\n }\n\n async cacheGraph(key: string, resource: any, clientContext: object, parentContext: object, parentId: string) {\n if (resource.properties) { // if proxy, cache it\n if (this.get(key)) { // if already cached, merge data\n this.cache.get(key).merge(resource);\n } else { // else, put in cache\n this.cache.set(key, resource);\n }\n }\n\n // Cache nested resources\n if (resource.getSubObjects) {\n for (let res of resource.getSubObjects()) {\n let newParentContext = parentContext;\n // If additional context in resource, use it to expand properties\n if (res['@context']) newParentContext = await myParser.parse({ ...parentContext, ...res['@context'] });\n const resourceProxy = new CustomGetter(res['@id'], res, clientContext, newParentContext, parentId).getProxy();\n // this.subscribeResourceTo(resource['@id'], res['@id']); // removed to prevent useless updates\n await this.cacheGraph(res['@id'], resourceProxy, clientContext, parentContext, parentId);\n }\n }\n\n // Cache children of container\n if (resource['@type'] == \"ldp:Container\" && resource.getChildren) {\n const cacheChildrenPromises: Promise<void>[] = [];\n for (let res of resource.getChildren()) {\n this.subscribeResourceTo(resource['@id'], res['@id']);\n cacheChildrenPromises.push(this.cacheGraph(res['@id'], res, clientContext, parentContext, parentId))\n }\n await Promise.all(cacheChildrenPromises);\n return;\n }\n\n // Create proxy, (fetch data) and cache resource\n if (resource['@id'] && !resource.properties) {\n if (resource['@id'].match(/^b\\d+$/)) return; // not anonymous node\n // Fetch data if\n if (resource['@type'] === \"sib:federatedContainer\" && resource['@cache'] !== 'false') { // if object is federated container\n await this.getData(resource['@id'], clientContext, parentId); // then init graph\n return;\n }\n const resourceProxy = new CustomGetter(resource['@id'], resource, clientContext, parentContext, parentId).getProxy();\n await this.cacheGraph(key, resourceProxy, clientContext, parentContext, parentId);\n }\n }\n\n /**\n * Update fetch\n * @param method - 'POST', 'PATCH', 'PUT', '_LOCAL'\n * @param resource - resource to send\n * @param id - uri to update\n * @returns - object\n */\n async _fetch(method: string, resource: object, id: string): Promise<any> {\n if (method !== '_LOCAL')\n return this.fetchAuthn(id, {\n method: method,\n headers: this.headers,\n body: JSON.stringify(resource),\n credentials: 'include'\n });\n\n const resourceProxy = store.get(id);\n const clientContext = resourceProxy ? resourceProxy.clientContext : resource['@context']\n this.clearCache(id);\n await this.getData(id, clientContext, '', resource);\n return {ok: true}\n }\n\n async _updateResource(method: string, resource: object, id: string) {\n if (!['POST', 'PUT', 'PATCH', '_LOCAL'].includes(method)) throw new Error('Error: method not allowed');\n\n const context = await myParser.parse([resource['@context'] || {}]); // parse context before expandTerm\n const expandedId = this._getExpandedId(id, context);\n return this._fetch(method, resource, id).then(async(response) => {\n if (response.ok) {\n if(method !== '_LOCAL') {\n await this.purge(id);\n this.clearCache(expandedId);\n } // clear cache\n this.getData(expandedId, resource['@context']).then(async () => { // re-fetch data\n const nestedResources = await this.getNestedResources(resource, id);\n const resourcesToRefresh = this.subscriptionVirtualContainersIndex.get(expandedId) || [];\n const resourcesToNotify = this.subscriptionIndex.get(expandedId) || [];\n\n return this.refreshResources([...nestedResources, ...resourcesToRefresh]) // refresh related resources\n .then(resourceIds => this.notifyResources([expandedId, ...resourceIds, ...resourcesToNotify])); // notify components\n });\n return response.headers?.get('Location') || null;\n } else {\n throw response;\n }\n });\n }\n\n /**\n * Clear cache and refetch data for a list of ids\n * @param resourceIds -\n * @returns - all the resource ids\n */\n async refreshResources(resourceIds: string[]) {\n resourceIds = [...new Set(resourceIds.filter(id => this.cache.has(id)))]; // remove duplicates and not cached resources\n const resourceWithContexts = resourceIds.map(resourceId => ({ \"id\": resourceId, \"context\": store.get(resourceId)?.clientContext }));\n for (const resource of resourceWithContexts) {\n if (!this._isLocalId(resource.id)) this.clearCache(resource.id);\n }\n await Promise.all(resourceWithContexts.map(({ id, context }) => this.getData(id, context || base_context)))\n return resourceIds;\n }\n /**\n * Notifies all components for a list of ids\n * @param resourceIds -\n */\n async notifyResources(resourceIds: string[]) {\n resourceIds = [...new Set(resourceIds)]; // remove duplicates\n for (const id of resourceIds) PubSub.publish(id);\n }\n\n /**\n * Return id of nested properties of a resource\n * @param resource - object\n * @param id - string\n */\n async getNestedResources(resource: object, id: string) {\n const cachedResource = store.get(id);\n if (!cachedResource || cachedResource.isContainer()) return [];\n let nestedProperties:any[] = [];\n const excludeKeys = ['@context'];\n for (let p of Object.keys(resource)) {\n if (resource[p]\n && typeof resource[p] === 'object'\n && !excludeKeys.includes(p)\n && resource[p]['@id']) {\n nestedProperties.push(resource[p]['@id']);\n }\n }\n return nestedProperties;\n }\n\n /**\n * Returns the resource with id from the cache\n * @param id - id of the resource to retrieve\n *\n * @returns Resource (Proxy) if in the cache, null otherwise\n */\n get(id: string): Resource | null {\n return this.cache.get(id) || null;\n }\n\n\n /**\n * Removes a resource from the cache\n * @param id - id of the resource to remove from the cache\n */\n clearCache(id: string): void {\n if (this.cache.has(id)) {\n // For federation, clear each source\n const resource = this.cache.get(id);\n if (resource['@type'] === 'ldp:Container') {\n resource['ldp:contains'].forEach((child: object) => {\n if (child && child['@type'] === 'ldp:Container') this.cache.delete(child['@id'])\n })\n }\n\n this.cache.delete(id);\n }\n }\n\n /**\n * Send data to create a local resource in a container\n * @param resource - resource to create\n * @param id - uri of the container to add resource. should start with ``\n *\n * @returns id of the posted resource\n */\n async setLocalData(resource: object, id: string): Promise<string | null> {\n return this._updateResource('_LOCAL', resource, id);\n }\n\n /**\n * Send a POST request to create a resource in a container\n * @param resource - resource to create\n * @param id - uri of the container to add resource\n *\n * @returns id of the posted resource\n */\n async post(resource: object, id: string): Promise<string | null> {\n return this._updateResource('POST', resource, id);\n }\n\n /**\n * Send a PUT request to edit a resource\n * @param resource - resource data to send\n * @param id - uri of the resource to edit\n *\n * @returns id of the edited resource\n */\n async put(resource: object, id: string): Promise<string | null> {\n return this._updateResource('PUT', resource, id);\n }\n\n /**\n * Send a PATCH request to edit a resource\n * @param resource - resource data to send\n * @param id - uri of the resource to patch\n *\n * @returns id of the edited resource\n */\n async patch(resource: object, id: string): Promise<string | null> {\n return this._updateResource('PATCH', resource, id);\n }\n\n /**\n * Send a PURGE request to remove a resource from REDIS AD cache\n * @param id - uri of the resource to patch\n *\n * @returns id of the edited resource\n */\n async purge(id: string) {\n console.log('Purging resource ' + id);\n await this.fetchAuthn(id, {\n method: \"PURGE\",\n headers: this.headers\n }).catch(function(error) {\n console.warn('No purge method allowed: ' + error)\n });\n\n try {\n const fullURL = new URL(id);\n var pathArray = fullURL.pathname.split('/');\n var containerUrl = fullURL.origin + '/' + pathArray[1] + '/';\n const headers = { ...this.headers, 'X-Cache-Purge-Match': 'startswith' };\n await this.fetchAuthn(containerUrl, {\n method: \"PURGE\",\n headers: headers\n }).catch(function(error) {\n console.warn('No purge method allowed: ' + error)\n });\n } catch (error) {\n console.warn('The resource ID is not a complete URL: ' + error);\n return;\n }\n }\n\n /**\n * Send a DELETE request to delete a resource\n * @param id - uri of the resource to delete\n * @param context - can be used to expand id\n *\n * @returns id of the deleted resource\n */\n async delete(id: string, context: object = {}) {\n const expandedId = this._getExpandedId(id, context);\n const deleted = await this.fetchAuthn(expandedId, {\n method: 'DELETE',\n headers: this.headers,\n credentials: 'include'\n });\n await this.purge(id);\n\n const resourcesToNotify = this.subscriptionIndex.get(expandedId) || [];\n const resourcesToRefresh = this.subscriptionVirtualContainersIndex.get(expandedId) || [];\n\n this.refreshResources([...resourcesToNotify, ...resourcesToRefresh])\n .then(resourceIds => this.notifyResources(resourceIds));\n\n return deleted;\n }\n\n /**\n * Convert headers object to Headers\n * @param headersObject - object\n * @returns {Headers}\n */\n _convertHeaders(headersObject: object): Headers {\n const headers = new Headers();\n for (const [key, value] of Object.entries(headersObject)){\n headers.set(key, value as string);\n }\n return headers;\n }\n\n _getExpandedId(id: string, context: object) {\n return (context && Object.keys(context)) ? ContextParser.expandTerm(id, context) : id;\n }\n\n _isLocalId(id: string) {\n return id.startsWith('store://local.');\n }\n\n /**\n * Make a resource listen changes of another one\n * @param resourceId - id of the resource which needs to be updated\n * @param nestedResourceId - id of the resource which will change\n */\n subscribeResourceTo(resourceId: string, nestedResourceId: string) {\n const existingSubscriptions = this.subscriptionIndex.get(nestedResourceId) || [];\n this.subscriptionIndex.set(nestedResourceId, [...new Set([...existingSubscriptions, resourceId])])\n }\n\n /**\n * Make a virtual container listen for changes of a resource\n * @param virtualContainerId - id of the container which needs to be updated\n * @param nestedResourceId - id of the resource which will change\n */\n subscribeVirtualContainerTo(virtualContainerId: string, nestedResourceId: string) {\n const existingSubscriptions = this.subscriptionVirtualContainersIndex.get(nestedResourceId) || [];\n this.subscriptionVirtualContainersIndex.set(nestedResourceId, [...new Set([...existingSubscriptions, virtualContainerId])])\n }\n\n /**\n * Return absolute IRI of the resource\n * @param id\n * @param context\n * @param parentId\n */\n _getAbsoluteIri(id: string, context: object, parentId: string): string {\n let iri = ContextParser.expandTerm(id, context); // expand if reduced ids\n if (parentId) { // and get full URL from parent caller for local files\n let parentIri = new URL(parentId, document.location.href).href;\n iri = new URL(iri, parentIri).href;\n } else {\n iri = new URL(iri, document.location.href).href;\n }\n return iri;\n }\n\n /**\n * Check if object is a full resource\n * @param resource\n */\n _resourceIsComplete(resource: object) {\n return !!(Object.keys(resource).filter(p => !p.startsWith('@')).length > 0 && resource['@id'])\n }\n\n /**\n * Return language of the users\n */\n _getLanguage() {\n return localStorage.getItem('language') || window.navigator.language.slice(0,2);\n }\n\n /**\n * Save the preferred language of the user\n * @param selectedLanguageCode\n */\n selectLanguage(selectedLanguageCode: string) {\n localStorage.setItem('language', selectedLanguageCode);\n }\n\n resolveResource = function(id: string, resolve) {\n const handler = function(event) {\n if (event.detail.id === id) {\n resolve(event.detail.resource);\n // TODO : callback\n document.removeEventListener('resourceReady', handler);\n }\n };\n return handler;\n };\n}\n\nlet store: Store;\nif (window.sibStore) {\n store = window.sibStore;\n} else {\n const sibAuth = document.querySelector('sib-auth');\n const storeOptions: StoreOptions = {}\n\n if (sibAuth) {\n const sibAuthDefined = customElements.whenDefined(sibAuth.localName);\n storeOptions.session = sibAuthDefined.then(() => (sibAuth as any).session)\n storeOptions.fetchMethod = sibAuthDefined.then(() => (sibAuth as any).getFetch())\n }\n\n store = new Store(storeOptions);\n window.sibStore = store;\n}\n\nexport {\n store\n};\n\n\nclass CustomGetter {\n resource: any; // content of the requested resource\n resourceId: string;\n clientContext: object; // context given by the app\n serverContext: object; // context given by the server\n parentId: string; // id of the parent resource, used to get the absolute url of the current resource\n\n constructor(resourceId: string, resource: object, clientContext: object, serverContext: object = {}, parentId: string = \"\") {\n this.clientContext = clientContext;\n this.serverContext = serverContext;\n this.parentId = parentId;\n this.resource = this.expandProperties({ ...resource }, serverContext);\n this.resourceId = resourceId;\n }\n\n /**\n * Expand all predicates of a resource with a given context\n * @param resource: object\n * @param context: object\n */\n expandProperties(resource: object, context: object | string) {\n for (let prop of Object.keys(resource)) {\n if (!prop) continue;\n this.objectReplaceProperty(resource, prop, ContextParser.expandTerm(prop, context as JSONLDContextParser.IJsonLdContextNormalized, true));\n }\n return resource\n }\n\n /**\n * Change the key of an object\n * @param object: object\n * @param oldProp: string - current key\n * @param newProp: string - new key to set\n */\n objectReplaceProperty(object: object, oldProp: string, newProp: string) {\n if (newProp !== oldProp) {\n Object.defineProperty(\n object,\n newProp,\n Object.getOwnPropertyDescriptor(object, oldProp) || ''\n );\n delete object[oldProp];\n }\n }\n\n /**\n * Get the property of a resource for a given path\n * @param path: string\n */\n async get(path: any) {\n if (!path) return;\n const path1: string[] = path.split('.');\n const path2: string[] = [];\n let value: any;\n if (!this.isFullResource()) { // if resource is not complete, fetch it first\n await this.getResource(this.resourceId, this.clientContext, this.parentId);\n }\n while (true) {\n try {\n value = this.resource[this.getExpandedPredicate(path1[0])];\n } catch (e) { break }\n\n if (path1.length <= 1) break; // no dot path\n const lastPath1El = path1.pop();\n if(lastPath1El) path2.unshift(lastPath1El);\n }\n if (path2.length === 0) { // end of the path\n if (!value || !value['@id']) return value; // no value or not a resource\n return await this.getResource(value['@id'], this.clientContext, this.parentId || this.resourceId); // return complete resource\n }\n if (!value) return undefined;\n let resource = await this.getResource(value['@id'], this.clientContext, this.parentId || this.resourceId);\n\n store.subscribeResourceTo(this.resourceId, value['@id']);\n return resource ? await resource[path2.join('.')] : undefined; // return value\n }\n\n /**\n * Cache resource in the store, and return the created proxy\n * @param id\n * @param context\n * @param iriParent\n * @param forceFetch\n */\n async getResource(id: string, context: object, iriParent: string, forceFetch: boolean = false): Promise<Resource | null> {\n return store.getData(id, context, iriParent, undefined, forceFetch);\n }\n\n /**\n * Return true if the resource is a container\n */\n isContainer(): boolean {\n return this.resource[\"@type\"] == \"ldp:Container\" || this.resource[\"@type\"] == \"sib:federatedContainer\";\n }\n\n /**\n * Get all properties of a resource\n */\n getProperties(): string[] {\n return Object.keys(this.resource).map(prop => this.getCompactedPredicate(prop));\n }\n\n /**\n * Get children of container as objects\n */\n getChildren(): object[] {\n return this.resource[this.getExpandedPredicate(\"ldp:contains\")] || [];\n }\n\n /**\n * Get children of container as Proxys\n */\n getLdpContains(): CustomGetter[] {\n const children = this.resource[this.getExpandedPredicate(\"ldp:contains\")];\n return children ? children.map((res: object) => store.get(res['@id'])) : [];\n }\n\n /**\n * Get all nested resource or containers which contains datas\n */\n getSubObjects() {\n let subObjects: any = [];\n for (let p of Object.keys(this.resource)) {\n let property = this.resource[p];\n if (!this.isFullNestedResource(property)) continue; // if not a resource, stop\n if (property['@type'] == \"ldp:Container\" &&\n (property['ldp:contains'] == undefined ||\n (property['ldp:contains'].length >= 1 && !this.isFullNestedResource(property['ldp:contains'][0])))\n ) continue; // if not a full container\n subObjects.push(property)\n }\n return subObjects;\n }\n\n merge(resource: CustomGetter) {\n this.resource = {...this.getResourceData(), ...resource.getResourceData()}\n }\n\n getResourceData(): object { return this.resource }\n\n /**\n * return true if prop is a resource with an @id and some properties\n * @param prop\n */\n isFullNestedResource(prop: any): boolean {\n return prop &&\n typeof prop == \"object\" &&\n prop['@id'] != undefined &&\n Object.keys(prop).filter(p => !p.startsWith('@')).length > 0;\n }\n /**\n * return true resource seems complete\n * @param prop\n */\n isFullResource(): boolean {\n return Object.keys(this.resource).filter(p => !p.startsWith('@')).length > 0;\n }\n\n async getPermissions(): Promise<string[]> {\n const permissionPredicate = this.getExpandedPredicate(\"permissions\");\n let permissions = this.resource[permissionPredicate];\n if (!permissions) { // if no permission, re-fetch data\n await this.getResource(this.resourceId, this.clientContext, this.parentId, true);\n permissions = this.resource[permissionPredicate];\n }\n return permissions ? permissions.map(perm => ContextParser.expandTerm(perm.mode['@type'], this.serverContext, true)) : [];\n }\n\n /**\n * Remove the resource from the cache\n */\n clearCache(): void {\n store.clearCache(this.resourceId);\n }\n\n getExpandedPredicate(property: string) { return ContextParser.expandTerm(property, this.clientContext, true) }\n getCompactedPredicate(property: string) { return ContextParser.compactIri(property, this.clientContext, true) }\n getCompactedIri(id: string) { return ContextParser.compactIri(id, this.clientContext) }\n toString() { return this.getCompactedIri(this.resource['@id']) }\n [Symbol.toPrimitive]() { return this.getCompactedIri(this.resource['@id']) }\n\n\n /**\n * Returns a Proxy which handles the different get requests\n */\n getProxy() {\n return new Proxy(this, {\n get: (resource, property) => {\n if (!this.resource) return undefined;\n if (typeof resource[property] === 'function') return resource[property].bind(resource)\n\n switch (property) {\n case '@id':\n return this.getCompactedIri(this.resource['@id']); // Compact @id if possible\n case '@type':\n return this.resource['@type']; // return synchronously\n case 'properties':\n return this.getProperties();\n case 'ldp:contains':\n return this.getLdpContains(); // returns standard arrays synchronously\n case 'permissions':\n return this.getPermissions(); // get expanded permissions\n case 'clientContext':\n return this.clientContext; // get saved client context to re-fetch easily a resource\n case 'then':\n return;\n default:\n return resource.get(property);\n }\n }\n })\n }\n}"]}
@@ -1,10 +0,0 @@
1
- {
2
- "autocompletion.placeholder": "Select a value",
3
- "autocompletion.searchPlaceholder": "Search",
4
- "autocompletion.searchText": "No result",
5
- "solid-delete.button": "Delete",
6
- "solid-form.submit-button": "Submit",
7
- "validation.message": "Please, confirm your choice",
8
- "validation.submit-text": "Yes",
9
- "validation.cancel-text": "Cancel"
10
- }
@@ -1,2 +0,0 @@
1
- let json = {"autocompletion.placeholder":"Select a value","autocompletion.searchPlaceholder":"Search","autocompletion.searchText":"No result","solid-delete.button":"Delete","solid-form.submit-button":"Submit","validation.message":"Please, confirm your choice","validation.submit-text":"Yes","validation.cancel-text":"Cancel"};
2
- export default json;
@@ -1,10 +0,0 @@
1
- {
2
- "autocompletion.placeholder": "Sélectionner une valeur",
3
- "autocompletion.searchPlaceholder": "Rechercher",
4
- "autocompletion.searchText": "Aucun résultat",
5
- "solid-delete.button": "Supprimer",
6
- "solid-form.submit-button": "Envoyer",
7
- "validation.message": "Merci de confirmer votre choix",
8
- "validation.submit-text": "Oui",
9
- "validation.cancel-text": "Annuler"
10
- }
@@ -1,2 +0,0 @@
1
- let json = {"autocompletion.placeholder":"Sélectionner une valeur","autocompletion.searchPlaceholder":"Rechercher","autocompletion.searchText":"Aucun résultat","solid-delete.button":"Supprimer","solid-form.submit-button":"Envoyer","validation.message":"Merci de confirmer votre choix","validation.submit-text":"Oui","validation.cancel-text":"Annuler"};
2
- export default json;
@@ -1,124 +0,0 @@
1
- import { base_context, store } from '../libs/store/store.js';
2
- const AttributeBinderMixin = {
3
- name: 'attribute-binder-mixin',
4
- use: [],
5
- initialState: {
6
- bindedAttributes: null
7
- },
8
-
9
- created() {
10
- this.bindedAttributes = {};
11
- },
12
-
13
- /**
14
- * Reset attributes values
15
- */
16
- resetAttributesData() {
17
- for (let attr of Object.keys(this.bindedAttributes)) {
18
- this.element.setAttribute(attr, this.bindedAttributes[attr]);
19
- }
20
- },
21
-
22
- /**
23
- * Replace store://XXX attributes by corresponding data
24
- * @param reset - set to false if no need to reset data
25
- */
26
- async replaceAttributesData(reset = true) {
27
- if (reset) this.resetAttributesData();
28
- const oldAttributes = Array.from(this.element.attributes) // transform NamedNodeMap in object
29
- .reduce((obj, attr) => {
30
- // Keep only attributes starting with `store://...`
31
- if (!attr.value.match(/^store:\/\/(resource|container|user)/)) return { ...obj
32
- }; // Save attr for reset later
33
-
34
- if (!this.bindedAttributes[attr.name]) this.bindedAttributes[attr.name] = attr.value;
35
- return { ...obj,
36
- [attr.name]: attr.value // add "key: value"
37
-
38
- };
39
- }, {});
40
- const newAttributes = await this.transformAttributes({ ...oldAttributes
41
- }, this.resource); // generate new attributes
42
-
43
- for (let attr of Object.keys(newAttributes)) {
44
- // set attributes on element
45
- if (oldAttributes[attr] == newAttributes[attr]) continue; // only if it changed
46
-
47
- this.element.setAttribute(attr, newAttributes[attr]);
48
- }
49
- },
50
-
51
- /**
52
- * Transform attributes from `store://...` to their actual value
53
- * @param attributes - object representing attributes of an element
54
- * @param resource - resource to use to resolve attributes
55
- * @returns - object representing attributes of an element with resolved values
56
- */
57
- async transformAttributes(attributes, resource) {
58
- const isContainer = resource && resource.isContainer();
59
-
60
- for (let attr of Object.keys(attributes)) {
61
- const value = attributes[attr]; // Avoid error if value is a number
62
-
63
- if (typeof value === 'string') {
64
- // Replace attribute value
65
- if (!isContainer && resource && value.startsWith('store://resource')) {
66
- // RESOURCE
67
- let path = value.replace('store://resource.', '');
68
- attributes[attr] = resource ? await resource[path] : '';
69
- } else if (isContainer && resource && value.startsWith('store://container')) {
70
- // CONTAINER
71
- let path = value.replace('store://container.', '');
72
- attributes[attr] = resource ? await resource[path] : '';
73
- } else if (value.startsWith('store://user')) {
74
- // USER
75
- const userId = await this.retry(this.getUser.bind(this)); // retry until sibAuth is defined
76
-
77
- const user = userId && userId['@id'] ? await store.getData(userId['@id'], this.context || base_context) : null;
78
-
79
- if (!user) {
80
- attributes[attr] = '';
81
- continue;
82
- }
83
-
84
- let path = value.replace('store://user.', '');
85
- attributes[attr] = user ? await user[path] : '';
86
- }
87
- }
88
- }
89
-
90
- return attributes;
91
- },
92
-
93
- /**
94
- * Returns logged in user from sib-auth
95
- * @returns userId
96
- */
97
- async getUser() {
98
- const sibAuth = document.querySelector('sib-auth');
99
- return sibAuth.getUser();
100
- },
101
-
102
- /**
103
- * Retry [fn] for [maxRetries] times every [ms]
104
- * @param fn
105
- * @param ms
106
- * @param maxRetries
107
- * @returns
108
- */
109
- async retry(fn, ms = 200, maxRetries = 5) {
110
- return new Promise((resolve, reject) => {
111
- let retries = 0;
112
- fn().then(resolve).catch(() => {
113
- setTimeout(() => {
114
- ++retries;
115
- if (retries == maxRetries) return reject();
116
- this.retry(fn, ms).then(resolve);
117
- }, ms);
118
- });
119
- });
120
- }
121
-
122
- };
123
- export { AttributeBinderMixin };
124
- //# sourceMappingURL=attributeBinderMixin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["attributeBinderMixin.ts"],"names":["base_context","store","AttributeBinderMixin","name","use","initialState","bindedAttributes","created","resetAttributesData","attr","Object","keys","element","setAttribute","replaceAttributesData","reset","oldAttributes","Array","from","attributes","reduce","obj","value","match","newAttributes","transformAttributes","resource","isContainer","startsWith","path","replace","userId","retry","getUser","bind","user","getData","context","sibAuth","document","querySelector","fn","ms","maxRetries","Promise","resolve","reject","retries","then","catch","setTimeout"],"mappings":"AAAA,SAASA,YAAT,EAAuBC,KAAvB,QAAoC,qBAApC;AAGA,MAAMC,oBAAoB,GAAG;AAC3BC,EAAAA,IAAI,EAAE,wBADqB;AAE3BC,EAAAA,GAAG,EAAE,EAFsB;AAG3BC,EAAAA,YAAY,EAAE;AACZC,IAAAA,gBAAgB,EAAE;AADN,GAHa;;AAM3BC,EAAAA,OAAO,GAAG;AACR,SAAKD,gBAAL,GAAwB,EAAxB;AACD,GAR0B;;AAS3B;AACF;AACA;AACEE,EAAAA,mBAAmB,GAAG;AACpB,SAAK,IAAIC,IAAT,IAAiBC,MAAM,CAACC,IAAP,CAAY,KAAKL,gBAAjB,CAAjB,EAAqD;AACnD,WAAKM,OAAL,CAAaC,YAAb,CAA0BJ,IAA1B,EAAgC,KAAKH,gBAAL,CAAsBG,IAAtB,CAAhC;AACD;AACF,GAhB0B;;AAiB3B;AACF;AACA;AACA;AACE,QAAMK,qBAAN,CAA4BC,KAAK,GAAG,IAApC,EAA0C;AACxC,QAAIA,KAAJ,EAAW,KAAKP,mBAAL;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,CAAX;AACAX,UAAAA,UAAU,CAACV,IAAD,CAAV,GAAmB0B,IAAI,GAAG,MAAMA,IAAI,CAACN,IAAD,CAAb,GAAsB,EAA7C;AACD;AACF;AACF;;AACD,WAAOV,UAAP;AACD,GA/E0B;;AAiF3B;AACF;AACA;AACA;AACE,QAAMc,OAAN,GAAgB;AACd,UAAMK,OAAY,GAAGC,QAAQ,CAACC,aAAT,CAAuB,UAAvB,CAArB;AACA,WAAOF,OAAO,CAACL,OAAR,EAAP;AACD,GAxF0B;;AA0F3B;AACF;AACA;AACA;AACA;AACA;AACA;AACE,QAAMD,KAAN,CAAYS,EAAZ,EAA0BC,EAAE,GAAG,GAA/B,EAAoCC,UAAU,GAAG,CAAjD,EAAoD;AAClD,WAAO,IAAIC,OAAJ,CAAY,CAACC,OAAD,EAAUC,MAAV,KAAqB;AACtC,UAAIC,OAAO,GAAG,CAAd;AACAN,MAAAA,EAAE,GAAGO,IAAL,CAAUH,OAAV,EAAmBI,KAAnB,CAAyB,MAAM;AAC7BC,QAAAA,UAAU,CAAC,MAAM;AACf,YAAEH,OAAF;AACA,cAAIA,OAAO,IAAIJ,UAAf,EAA2B,OAAOG,MAAM,EAAb;AAC3B,eAAKd,KAAL,CAAWS,EAAX,EAAeC,EAAf,EAAmBM,IAAnB,CAAwBH,OAAxB;AACD,SAJS,EAIPH,EAJO,CAAV;AAKD,OAND;AAOD,KATM,CAAP;AAUD;;AA5G0B,CAA7B;AA+GA,SACExC,oBADF","sourcesContent":["import { base_context, store } from '../libs/store/store';\nimport type { Resource } from './interfaces';\n\nconst AttributeBinderMixin = {\n name: 'attribute-binder-mixin',\n use: [],\n initialState: {\n bindedAttributes: null\n },\n created() {\n this.bindedAttributes = {};\n },\n /**\n * Reset attributes values\n */\n resetAttributesData() {\n for (let attr of Object.keys(this.bindedAttributes)) {\n this.element.setAttribute(attr, this.bindedAttributes[attr]);\n }\n },\n /**\n * Replace store://XXX attributes by corresponding data\n * @param reset - set to false if no need to reset data\n */\n async replaceAttributesData(reset = true) {\n if (reset) this.resetAttributesData();\n\n const oldAttributes: any = Array.from(this.element.attributes) // transform NamedNodeMap in object\n .reduce((obj: any, attr: any) => {\n // Keep only attributes starting with `store://...`\n if (!attr.value.match(/^store:\\/\\/(resource|container|user)/)) return { ...obj }\n\n // Save attr for reset later\n if (!this.bindedAttributes[attr.name]) this.bindedAttributes[attr.name] = attr.value;\n\n return {\n ...obj,\n [attr.name]: attr.value, // add \"key: value\"\n };\n }, {});\n\n const newAttributes = await this.transformAttributes({ ...oldAttributes }, this.resource); // generate new attributes\n\n for (let attr of Object.keys(newAttributes)) { // set attributes on element\n if (oldAttributes[attr] == newAttributes[attr]) continue; // only if it changed\n this.element.setAttribute(attr, newAttributes[attr]);\n }\n },\n\n /**\n * Transform attributes from `store://...` to their actual value\n * @param attributes - object representing attributes of an element\n * @param resource - resource to use to resolve attributes\n * @returns - object representing attributes of an element with resolved values\n */\n async transformAttributes(attributes: object, resource: Resource) {\n const isContainer = resource && resource.isContainer();\n\n for (let attr of Object.keys(attributes)) {\n const value = attributes[attr];\n // Avoid error if value is a number\n if (typeof value === 'string') {\n // Replace attribute value\n if (!isContainer && resource && value.startsWith('store://resource')) { // RESOURCE\n let path = value.replace('store://resource.', '');\n attributes[attr] = resource ? await resource[path] : '';\n } else if (isContainer && resource && value.startsWith('store://container')) { // CONTAINER\n let path = value.replace('store://container.', '');\n attributes[attr] = resource ? await resource[path] : '';\n } else if (value.startsWith('store://user')) { // USER\n const userId = await this.retry(this.getUser.bind(this)); // retry until sibAuth is defined\n const user = userId && userId['@id'] ? await store.getData(userId['@id'], this.context || base_context) : null;\n if (!user) {\n attributes[attr] = '';\n continue;\n }\n let path = value.replace('store://user.', '');\n attributes[attr] = user ? await user[path] : '';\n }\n }\n }\n return attributes;\n },\n\n /**\n * Returns logged in user from sib-auth\n * @returns userId\n */\n async getUser() {\n const sibAuth: any = document.querySelector('sib-auth');\n return sibAuth.getUser();\n },\n\n /**\n * Retry [fn] for [maxRetries] times every [ms]\n * @param fn\n * @param ms\n * @param maxRetries\n * @returns\n */\n async retry(fn: Function, ms = 200, maxRetries = 5) {\n return new Promise((resolve, reject) => {\n let retries = 0;\n fn().then(resolve).catch(() => {\n setTimeout(() => {\n ++retries;\n if (retries == maxRetries) return reject();\n this.retry(fn, ms).then(resolve);\n }, ms);\n });\n });\n }\n}\n\nexport {\n AttributeBinderMixin\n}"]}
@@ -1,28 +0,0 @@
1
- import { base_context } from '../libs/store/store.js';
2
- const ContextMixin = {
3
- name: 'store-mixin',
4
- use: [],
5
- attributes: {
6
- extraContext: {
7
- type: String,
8
- default: null
9
- }
10
- },
11
-
12
- get context() {
13
- return { ...base_context,
14
- ...this.extra_context
15
- };
16
- },
17
-
18
- get extra_context() {
19
- let extraContextElement = this.extraContext ? document.getElementById(this.extraContext) : // take element extra context first
20
- document.querySelector('[data-default-context]'); // ... or look for a default extra context
21
-
22
- if (extraContextElement) return JSON.parse(extraContextElement.textContent || "{}");
23
- return {};
24
- }
25
-
26
- };
27
- export { ContextMixin };
28
- //# sourceMappingURL=contextMixin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["contextMixin.ts"],"names":["base_context","ContextMixin","name","use","attributes","extraContext","type","String","default","context","extra_context","extraContextElement","document","getElementById","querySelector","JSON","parse","textContent"],"mappings":"AAAA,SAASA,YAAT,QAA6B,qBAA7B;AAEA,MAAMC,YAAY,GAAG;AACnBC,EAAAA,IAAI,EAAE,aADa;AAEnBC,EAAAA,GAAG,EAAE,EAFc;AAGnBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,YAAY,EAAE;AACZC,MAAAA,IAAI,EAAEC,MADM;AAEZC,MAAAA,OAAO,EAAE;AAFG;AADJ,GAHO;;AASnB,MAAIC,OAAJ,GAAsB;AACpB,WAAO,EAAE,GAAGT,YAAL;AAAmB,SAAG,KAAKU;AAA3B,KAAP;AACD,GAXkB;;AAYnB,MAAIA,aAAJ,GAA4B;AAC1B,QAAIC,mBAAmB,GAAG,KAAKN,YAAL,GAC1BO,QAAQ,CAACC,cAAT,CAAwB,KAAKR,YAA7B,CAD0B,GACmB;AAC7CO,IAAAA,QAAQ,CAACE,aAAT,CAAuB,wBAAvB,CAFA,CAD0B,CAGwB;;AAElD,QAAIH,mBAAJ,EAAyB,OAAOI,IAAI,CAACC,KAAL,CAAWL,mBAAmB,CAACM,WAApB,IAAmC,IAA9C,CAAP;AACzB,WAAO,EAAP;AACD;;AAnBkB,CAArB;AAsBA,SACEhB,YADF","sourcesContent":["import { base_context } from '../libs/store/store';\n\nconst ContextMixin = {\n name: 'store-mixin',\n use: [],\n attributes: {\n extraContext: {\n type: String,\n default: null\n },\n },\n get context(): object {\n return { ...base_context, ...this.extra_context };\n },\n get extra_context(): object {\n let extraContextElement = this.extraContext ?\n document.getElementById(this.extraContext) : // take element extra context first\n document.querySelector('[data-default-context]'); // ... or look for a default extra context\n\n if (extraContextElement) return JSON.parse(extraContextElement.textContent || \"{}\");\n return {};\n },\n};\n\nexport {\n ContextMixin\n}"]}
@@ -1,75 +0,0 @@
1
- function _templateObject() {
2
- const data = _taggedTemplateLiteral(["", ""]);
3
-
4
- _templateObject = function () {
5
- return data;
6
- };
7
-
8
- return data;
9
- }
10
-
11
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
-
13
- import { html } from '../_snowpack/pkg/lit-html.js';
14
- import { unsafeHTML } from '../_snowpack/pkg/lit-html/directives/unsafe-html.js';
15
- import { evalTemplateString } from '../libs/helpers.js';
16
- const CounterMixin = {
17
- name: 'counter-mixin',
18
- use: [],
19
- attributes: {
20
- counterTemplate: {
21
- type: String,
22
- default: null
23
- }
24
- },
25
- initialState: {
26
- counter: null,
27
- parentCounterDiv: null
28
- },
29
-
30
- attached() {
31
- this.listPostProcessors.push(this.countResources.bind(this));
32
- },
33
-
34
- async countResources(resources, listPostProcessors, div, context) {
35
- if (this.counterTemplate) {
36
- this.initParentCounterDiv(div);
37
- this.renderCallbacks.push({
38
- // add counter template to render callback
39
- template: await this.renderCounter(resources.length),
40
- parent: this.parentCounterDiv
41
- });
42
- }
43
-
44
- const nextProcessor = listPostProcessors.shift();
45
- if (nextProcessor) await nextProcessor(resources, listPostProcessors, div, context);
46
- },
47
-
48
- /**
49
- * Create the parent div of the counter in the component.
50
- * @param div: parent div where to insert the counter div
51
- */
52
- initParentCounterDiv(div) {
53
- if (this.parentCounterDiv) return;
54
- this.parentCounterDiv = document.createElement('div');
55
- this.element.insertBefore(this.parentCounterDiv, div);
56
- },
57
-
58
- async renderCounter(resourceNumber) {
59
- let htmlCounter;
60
-
61
- try {
62
- htmlCounter = await evalTemplateString(this.counterTemplate, {
63
- counter: resourceNumber
64
- });
65
- } catch (e) {
66
- console.error(new Error('error in counter-template'), e);
67
- throw e;
68
- }
69
-
70
- return html(_templateObject(), unsafeHTML(htmlCounter));
71
- }
72
-
73
- };
74
- export { CounterMixin };
75
- //# sourceMappingURL=counterMixin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["counterMixin.ts"],"names":["html","unsafeHTML","evalTemplateString","CounterMixin","name","use","attributes","counterTemplate","type","String","default","initialState","counter","parentCounterDiv","attached","listPostProcessors","push","countResources","bind","resources","div","context","initParentCounterDiv","renderCallbacks","template","renderCounter","length","parent","nextProcessor","shift","document","createElement","element","insertBefore","resourceNumber","htmlCounter","e","console","error","Error"],"mappings":";;;;;;;;;;;;AAAA,SAASA,IAAT,QAAqB,UAArB;AACA,SAASC,UAAT,QAA2B,iCAA3B;AACA,SAASC,kBAAT,QAAmC,iBAAnC;AAEA,MAAMC,YAAY,GAAG;AACnBC,EAAAA,IAAI,EAAE,eADa;AAEnBC,EAAAA,GAAG,EAAE,EAFc;AAGnBC,EAAAA,UAAU,EAAE;AACVC,IAAAA,eAAe,EAAE;AACfC,MAAAA,IAAI,EAAEC,MADS;AAEfC,MAAAA,OAAO,EAAE;AAFM;AADP,GAHO;AAS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;AACVC,MAAAA,OAAO,CAACC,KAAR,CAAc,IAAIC,KAAJ,CAAU,2BAAV,CAAd,EAAsDH,CAAtD;AACA,YAAMA,CAAN;AACD;;AACD,WAAOpC,IAAP,oBAAcC,UAAU,CAACkC,WAAD,CAAxB;AACD;;AAhDkB,CAArB;AAmDA,SACEhC,YADF","sourcesContent":["import { html } from 'lit-html';\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html';\nimport { evalTemplateString } from '../libs/helpers';\n\nconst CounterMixin = {\n name: 'counter-mixin',\n use: [],\n attributes: {\n counterTemplate: {\n type: String,\n default: null\n },\n },\n initialState: {\n counter: null,\n parentCounterDiv: null,\n },\n attached() {\n this.listPostProcessors.push(this.countResources.bind(this));\n },\n async countResources(resources: object[], listPostProcessors: Function[], div: HTMLElement, context: string) {\n if (this.counterTemplate) {\n this.initParentCounterDiv(div);\n this.renderCallbacks.push({ // add counter template to render callback\n template: await this.renderCounter(resources.length),\n parent: this.parentCounterDiv\n });\n }\n\n const nextProcessor = listPostProcessors.shift();\n if (nextProcessor) await nextProcessor(resources, listPostProcessors, div, context);\n },\n /**\n * Create the parent div of the counter in the component.\n * @param div: parent div where to insert the counter div\n */\n initParentCounterDiv(div: HTMLElement) {\n if (this.parentCounterDiv) return;\n this.parentCounterDiv = document.createElement('div');\n this.element.insertBefore(this.parentCounterDiv, div);\n },\n async renderCounter(resourceNumber: number) {\n let htmlCounter: string;\n try {\n htmlCounter = await evalTemplateString(this.counterTemplate, {\n counter: resourceNumber,\n });\n } catch (e) {\n console.error(new Error('error in counter-template'), e);\n throw e;\n }\n return html`${unsafeHTML(htmlCounter)}`;\n }\n}\n\nexport {\n CounterMixin\n}"]}
@@ -1,63 +0,0 @@
1
- import { store } from '../libs/store/store.js';
2
- const FederationMixin = {
3
- name: 'federation-mixin',
4
- use: [],
5
- initialState: {
6
- containerFetched: null
7
- },
8
-
9
- attached() {
10
- this.listPostProcessors.push(this.fetchSources.bind(this));
11
- },
12
-
13
- async fetchSources(resources, listPostProcessors, div, context) {
14
- this.containerFetched = [];
15
- let newResources = await this.getResources(resources);
16
- newResources = [...new Set(newResources)]; // remove possible duplicates
17
-
18
- const nextProcessor = listPostProcessors.shift();
19
- if (nextProcessor) await nextProcessor(newResources, listPostProcessors, div, context);
20
- },
21
-
22
- async getResources(resources) {
23
- const newResources = [];
24
-
25
- const getChildResources = async res => {
26
- if (!res) return;
27
-
28
- if (res.isContainer()) {
29
- // if this is a container
30
- const containerId = res['@id'];
31
-
32
- if (!this.containerFetched.includes(containerId)) {
33
- // prevent from including twice the same source
34
- this.containerFetched.push(containerId);
35
- const resourcesFetched = await this.fetchSource(containerId); // fetch the resources of this container
36
-
37
- if (resourcesFetched) newResources.push(...(await this.getResources(resourcesFetched))); // Add content of source to array...
38
- }
39
- } else {
40
- newResources.push(res); // Or resource directly if not a container
41
- }
42
- };
43
-
44
- await Promise.all(resources.map(res => getChildResources(res)));
45
- return newResources;
46
- },
47
-
48
- async fetchSource(containerId) {
49
- const cachedContainer = store.get(containerId); // find container in cache
50
-
51
- if (!cachedContainer || cachedContainer['ldp:contains'] === null) {
52
- // if container not fetched
53
- store.clearCache(containerId); // empty cache
54
- }
55
-
56
- const container = await store.getData(containerId, this.context); // and fetch it
57
-
58
- return container ? container['ldp:contains'] : null;
59
- }
60
-
61
- };
62
- export { FederationMixin };
63
- //# sourceMappingURL=federationMixin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["federationMixin.ts"],"names":["store","FederationMixin","name","use","initialState","containerFetched","attached","listPostProcessors","push","fetchSources","bind","resources","div","context","newResources","getResources","Set","nextProcessor","shift","getChildResources","res","isContainer","containerId","includes","resourcesFetched","fetchSource","Promise","all","map","cachedContainer","get","clearCache","container","getData"],"mappings":"AAAA,SAASA,KAAT,QAAsB,qBAAtB;AAGA,MAAMC,eAAe,GAAG;AACtBC,EAAAA,IAAI,EAAE,kBADgB;AAEtBC,EAAAA,GAAG,EAAE,EAFiB;AAGtBC,EAAAA,YAAY,EAAE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AAlB,EAJ0B,CAIyC;AAC1F;AACF,OARD,MAQO;AACLV,QAAAA,YAAY,CAACN,IAAb,CAAkBY,GAAlB,EADK,CACmB;AACzB;AACF,KAbD;;AAeA,UAAMM,OAAO,CAACC,GAAR,CAAYhB,SAAS,CAACiB,GAAV,CAAcR,GAAG,IAAID,iBAAiB,CAACC,GAAD,CAAtC,CAAZ,CAAN;AACA,WAAON,YAAP;AACD,GArCqB;;AAuCtB,QAAMW,WAAN,CAAkBH,WAAlB,EAAmE;AACjE,UAAMO,eAAe,GAAG7B,KAAK,CAAC8B,GAAN,CAAUR,WAAV,CAAxB,CADiE,CACjB;;AAChD,QAAI,CAACO,eAAD,IAAoBA,eAAe,CAAC,cAAD,CAAf,KAAoC,IAA5D,EAAkE;AAAE;AAClE7B,MAAAA,KAAK,CAAC+B,UAAN,CAAiBT,WAAjB,EADgE,CACjC;AAChC;;AACD,UAAMU,SAAS,GAAG,MAAMhC,KAAK,CAACiC,OAAN,CAAcX,WAAd,EAA2B,KAAKT,OAAhC,CAAxB,CALiE,CAKC;;AAClE,WAAOmB,SAAS,GAAGA,SAAS,CAAC,cAAD,CAAZ,GAA+B,IAA/C;AACD;;AA9CqB,CAAxB;AAiDA,SACE/B,eADF","sourcesContent":["import { store } from '../libs/store/store';\nimport type { Resource } from './interfaces';\n\nconst FederationMixin = {\n name: 'federation-mixin',\n use: [],\n initialState: {\n containerFetched: null\n },\n attached(): void {\n this.listPostProcessors.push(this.fetchSources.bind(this));\n },\n async fetchSources(resources: Resource[], listPostProcessors: Function[], div: HTMLElement, context: string) {\n this.containerFetched = [];\n let newResources: Resource[] = await this.getResources(resources);\n newResources = [...new Set(newResources)]; // remove possible duplicates\n\n const nextProcessor = listPostProcessors.shift();\n if(nextProcessor) await nextProcessor(newResources, listPostProcessors, div, context);\n },\n async getResources(resources: Resource[]): Promise<Resource[]> {\n const newResources: Resource[] = [];\n\n const getChildResources = async (res: Resource) => {\n if (!res) return;\n if (res.isContainer()) { // if this is a container\n const containerId = res['@id'];\n if (!this.containerFetched.includes(containerId)) { // prevent from including twice the same source\n this.containerFetched.push(containerId);\n\n const resourcesFetched = await this.fetchSource(containerId); // fetch the resources of this container\n if (resourcesFetched) newResources.push(...(await this.getResources(resourcesFetched))); // Add content of source to array...\n }\n } else {\n newResources.push(res); // Or resource directly if not a container\n }\n }\n\n await Promise.all(resources.map(res => getChildResources(res)));\n return newResources;\n },\n\n async fetchSource(containerId: string): Promise<Resource[] | null> {\n const cachedContainer = store.get(containerId); // find container in cache\n if (!cachedContainer || cachedContainer['ldp:contains'] === null) { // if container not fetched\n store.clearCache(containerId); // empty cache\n }\n const container = await store.getData(containerId, this.context); // and fetch it\n return container ? container['ldp:contains'] : null;\n },\n}\n\nexport {\n FederationMixin\n}"]}