@sankhyalabs/sankhyablocks 1.3.31-beta.16 → 1.3.31-beta.17

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 (170) hide show
  1. package/dist/cjs/{SnkMessageBuilder-79cf15c5.js → SnkMessageBuilder-cb132e6d.js} +133 -1
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/css-shim-b8158822.js +6 -0
  4. package/dist/cjs/dom-36862b77.js +75 -0
  5. package/dist/cjs/filter-item-type.enum-e2e1bc5b.js +14 -0
  6. package/dist/cjs/index-02201bc9.js +2397 -0
  7. package/dist/cjs/{index-5575fe3d.js → index-b0b676c5.js} +1598 -145
  8. package/dist/cjs/loader.cjs.js +18 -2
  9. package/dist/cjs/sankhyablocks.cjs.js +116 -4
  10. package/dist/cjs/shadow-css-346c0795.js +389 -0
  11. package/dist/cjs/snk-application.cjs.entry.js +542 -66
  12. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +23 -24
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +199 -0
  15. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
  16. package/dist/cjs/snk-filter-detail.cjs.entry.js +44 -0
  17. package/dist/cjs/snk-filter-item.cjs.entry.js +131 -0
  18. package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
  19. package/dist/cjs/snk-filter-number.cjs.entry.js +23 -0
  20. package/dist/cjs/snk-filter-period.cjs.entry.js +26 -0
  21. package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
  22. package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
  23. package/dist/cjs/{snk-form_2.cjs.entry.js → snk-form.cjs.entry.js} +3 -65
  24. package/dist/cjs/snk-grid.cjs.entry.js +69 -0
  25. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  26. package/dist/cjs/snk-taskbar.cjs.entry.js +5 -4
  27. package/dist/cjs/{taskbar-elements-2ae0d005.js → taskbar-elements-efa44ff1.js} +1 -1
  28. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  29. package/dist/collection/collection-manifest.json +9 -0
  30. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +7 -0
  31. package/dist/collection/components/snk-application/snk-application.js +89 -17
  32. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
  33. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +64 -0
  34. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +69 -0
  35. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
  36. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
  37. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +10 -0
  38. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +113 -0
  39. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +209 -0
  40. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +182 -0
  41. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +99 -0
  42. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +257 -0
  43. package/dist/collection/components/snk-grid/snk-grid.css +14 -1
  44. package/dist/collection/components/snk-grid/snk-grid.js +1 -1
  45. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +24 -2
  46. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +1 -1
  47. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +268 -0
  48. package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
  49. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -0
  50. package/dist/components/SnkMessageBuilder.js +133 -2
  51. package/dist/components/filter-item-type.enum.js +12 -0
  52. package/dist/components/index.d.ts +9 -0
  53. package/dist/components/index.js +13 -0
  54. package/dist/components/index2.js +2384 -0
  55. package/dist/components/snk-application2.js +508 -30
  56. package/dist/components/snk-crud.js +25 -1
  57. package/dist/components/snk-data-unit.js +2 -3
  58. package/dist/components/snk-filter-bar.d.ts +11 -0
  59. package/dist/components/snk-filter-bar.js +6 -0
  60. package/dist/components/snk-filter-bar2.js +230 -0
  61. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  62. package/dist/components/snk-filter-binary-select.js +63 -0
  63. package/dist/components/snk-filter-detail.d.ts +11 -0
  64. package/dist/components/snk-filter-detail.js +6 -0
  65. package/dist/components/snk-filter-detail2.js +58 -0
  66. package/dist/components/snk-filter-item.d.ts +11 -0
  67. package/dist/components/snk-filter-item.js +6 -0
  68. package/dist/components/snk-filter-item2.js +151 -0
  69. package/dist/components/snk-filter-list.d.ts +11 -0
  70. package/dist/components/snk-filter-list.js +6 -0
  71. package/dist/components/snk-filter-list2.js +108 -0
  72. package/dist/components/snk-filter-number.d.ts +11 -0
  73. package/dist/components/snk-filter-number.js +39 -0
  74. package/dist/components/snk-filter-period.d.ts +11 -0
  75. package/dist/components/snk-filter-period.js +42 -0
  76. package/dist/components/snk-filter-search.d.ts +11 -0
  77. package/dist/components/snk-filter-search.js +62 -0
  78. package/dist/components/snk-filter-text.d.ts +11 -0
  79. package/dist/components/snk-filter-text.js +38 -0
  80. package/dist/components/snk-form2.js +1 -1
  81. package/dist/components/snk-grid2.js +28 -4
  82. package/dist/components/snk-pesquisa2.js +1 -1
  83. package/dist/components/snk-taskbar2.js +2 -1
  84. package/dist/components/teste-pesquisa.js +1 -1
  85. package/dist/esm/{SnkMessageBuilder-3cdde541.js → SnkMessageBuilder-cff80920.js} +133 -2
  86. package/dist/esm/app-globals-0f993ce5.js +3 -0
  87. package/dist/esm/css-shim-b3f2ee8d.js +4 -0
  88. package/dist/esm/dom-665d6011.js +73 -0
  89. package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
  90. package/dist/esm/index-2b4d2d14.js +3262 -0
  91. package/dist/esm/index-e5b61043.js +2384 -0
  92. package/dist/esm/loader.js +18 -2
  93. package/dist/esm/sankhyablocks.js +116 -4
  94. package/dist/esm/shadow-css-b18e99d7.js +387 -0
  95. package/dist/esm/snk-application.entry.js +507 -31
  96. package/dist/esm/snk-crud.entry.js +1 -1
  97. package/dist/esm/snk-data-unit.entry.js +3 -4
  98. package/dist/esm/snk-filter-bar.entry.js +195 -0
  99. package/dist/esm/snk-filter-binary-select.entry.js +43 -0
  100. package/dist/esm/snk-filter-detail.entry.js +40 -0
  101. package/dist/esm/snk-filter-item.entry.js +127 -0
  102. package/dist/esm/snk-filter-list.entry.js +87 -0
  103. package/dist/esm/snk-filter-number.entry.js +19 -0
  104. package/dist/esm/snk-filter-period.entry.js +22 -0
  105. package/dist/esm/snk-filter-search.entry.js +40 -0
  106. package/dist/esm/snk-filter-text.entry.js +18 -0
  107. package/dist/esm/{snk-form_2.entry.js → snk-form.entry.js} +3 -64
  108. package/dist/esm/snk-grid.entry.js +65 -0
  109. package/dist/esm/snk-pesquisa.entry.js +2 -2
  110. package/dist/esm/snk-taskbar.entry.js +4 -3
  111. package/dist/esm/{taskbar-elements-bcccc0ff.js → taskbar-elements-c119510a.js} +1 -1
  112. package/dist/esm/teste-pesquisa.entry.js +2 -2
  113. package/dist/sankhyablocks/SnkMessageBuilder-cff80920.js +299 -0
  114. package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
  115. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
  116. package/dist/sankhyablocks/dom-665d6011.js +73 -0
  117. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
  118. package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
  119. package/dist/sankhyablocks/index-e5b61043.js +2384 -0
  120. package/dist/sankhyablocks/index.esm.js +1 -0
  121. package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
  122. package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
  123. package/dist/sankhyablocks/snk-application.entry.js +8306 -0
  124. package/dist/sankhyablocks/snk-crud.entry.js +60 -0
  125. package/dist/sankhyablocks/snk-data-unit.entry.js +272 -0
  126. package/dist/sankhyablocks/snk-filter-bar.entry.js +195 -0
  127. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
  128. package/dist/sankhyablocks/snk-filter-detail.entry.js +40 -0
  129. package/dist/sankhyablocks/snk-filter-item.entry.js +127 -0
  130. package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
  131. package/dist/sankhyablocks/snk-filter-number.entry.js +19 -0
  132. package/dist/sankhyablocks/snk-filter-period.entry.js +22 -0
  133. package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
  134. package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
  135. package/dist/sankhyablocks/snk-form.entry.js +111 -0
  136. package/dist/sankhyablocks/snk-grid.entry.js +65 -0
  137. package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
  138. package/dist/sankhyablocks/snk-taskbar.entry.js +153 -0
  139. package/dist/sankhyablocks/taskbar-elements-c119510a.js +72 -0
  140. package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
  141. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  142. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  143. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  144. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
  145. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +13 -0
  146. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
  147. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
  148. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
  149. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +13 -0
  150. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +37 -0
  151. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +43 -0
  152. package/dist/types/components.d.ts +199 -0
  153. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  154. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +5 -0
  155. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  156. package/package.json +2 -2
  157. package/react/components.d.ts +0 -7
  158. package/react/components.js +0 -7
  159. package/react/components.js.map +1 -1
  160. package/dist/esm/index-cf91f542.js +0 -1817
  161. package/dist/sankhyablocks/p-1ba29824.entry.js +0 -74
  162. package/dist/sankhyablocks/p-2266555e.entry.js +0 -1
  163. package/dist/sankhyablocks/p-23c4c94f.js +0 -2
  164. package/dist/sankhyablocks/p-2454be94.js +0 -1
  165. package/dist/sankhyablocks/p-49743bc5.js +0 -1
  166. package/dist/sankhyablocks/p-4fa389bd.entry.js +0 -1
  167. package/dist/sankhyablocks/p-5327ba05.entry.js +0 -1
  168. package/dist/sankhyablocks/p-7a922fb4.entry.js +0 -1
  169. package/dist/sankhyablocks/p-92d6f826.entry.js +0 -1
  170. package/dist/sankhyablocks/p-bdeef7f2.entry.js +0 -1
@@ -2,19 +2,35 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-5575fe3d.js');
5
+ const index = require('./index-b0b676c5.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
6
7
 
7
8
  /*
8
9
  Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
9
10
  */
10
11
  const patchEsm = () => {
12
+ // NOTE!! This fn cannot use async/await!
13
+ // @ts-ignore
14
+ if (index.BUILD.cssVarShim && !(index.CSS && index.CSS.supports && index.CSS.supports('color', 'var(--c)'))) {
15
+ // @ts-ignore
16
+ return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-css-shim" */ './css-shim-b8158822.js'); }).then(() => {
17
+ if ((index.plt.$cssShim$ = index.win.__cssshim)) {
18
+ return index.plt.$cssShim$.i();
19
+ }
20
+ else {
21
+ // for better minification
22
+ return 0;
23
+ }
24
+ });
25
+ }
11
26
  return index.promiseResolve();
12
27
  };
13
28
 
14
29
  const defineCustomElements = (win, options) => {
15
30
  if (typeof window === 'undefined') return Promise.resolve();
16
31
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
32
+ appGlobals.globalScripts();
33
+ return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[16]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"fix":[16],"unfix":[16]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"keepOpened":[1028,"keep-opened"],"getMessage":[16]}]]],["snk-filter-bar.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"filterConfig":[1040]},[[0,"filterChange","filterChangeListener"]]]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]],["snk-grid.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64]}]]],["snk-form.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-filter-item.cjs",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["snk-filter-list.cjs",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"_filterArgument":[32],"_showAll":[32]}]]]], options);
18
34
  });
19
35
  };
20
36
 
@@ -1,19 +1,131 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-5575fe3d.js');
3
+ const index = require('./index-b0b676c5.js');
4
+ const appGlobals = require('./app-globals-3a1e7e63.js');
4
5
 
5
6
  /*
6
7
  Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
7
8
  */
9
+ const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
8
10
  const patchBrowser = () => {
11
+ // NOTE!! This fn cannot use async/await!
12
+ if (index.BUILD.isDev && !index.BUILD.isTesting) {
13
+ index.consoleDevInfo('Running in development mode.');
14
+ }
15
+ if (index.BUILD.cssVarShim) {
16
+ // shim css vars
17
+ index.plt.$cssShim$ = index.win.__cssshim;
18
+ }
19
+ if (index.BUILD.cloneNodeFix) {
20
+ // opted-in to polyfill cloneNode() for slot polyfilled components
21
+ patchCloneNodeFix(index.H.prototype);
22
+ }
23
+ if (index.BUILD.profile && !performance.mark) {
24
+ // not all browsers support performance.mark/measure (Safari 10)
25
+ // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,
26
+ // simply stub the implementations out.
27
+ // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)
28
+ // @ts-ignore
29
+ performance.mark = performance.measure = () => {
30
+ /*noop*/
31
+ };
32
+ performance.getEntriesByName = () => [];
33
+ }
34
+ // @ts-ignore
35
+ const scriptElm = index.BUILD.scriptDataOpts || index.BUILD.safari10 || index.BUILD.dynamicImportShim
36
+ ? Array.from(index.doc.querySelectorAll('script')).find((s) => new RegExp(`\/${index.NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
37
+ s.getAttribute('data-stencil-namespace') === index.NAMESPACE)
38
+ : null;
9
39
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('sankhyablocks.cjs.js', document.baseURI).href));
10
- const opts = {};
11
- if (importMeta !== '') {
40
+ const opts = index.BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};
41
+ if (index.BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
42
+ // Safari < v11 support: This IF is true if it's Safari below v11.
43
+ // This fn cannot use async/await since Safari didn't support it until v11,
44
+ // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
45
+ // so both the ESM file and nomodule file would get downloaded. Only Safari
46
+ // has 'onbeforeload' in the script, and "history.scrollRestoration" was added
47
+ // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
48
+ // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
49
+ return {
50
+ then() {
51
+ /* promise noop */
52
+ },
53
+ };
54
+ }
55
+ if (!index.BUILD.safari10 && importMeta !== '') {
12
56
  opts.resourcesUrl = new URL('.', importMeta).href;
13
57
  }
58
+ else if (index.BUILD.dynamicImportShim || index.BUILD.safari10) {
59
+ opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, index.win.location.href)).href;
60
+ if (index.BUILD.dynamicImportShim) {
61
+ patchDynamicImport(opts.resourcesUrl, scriptElm);
62
+ }
63
+ if (index.BUILD.dynamicImportShim && !index.win.customElements) {
64
+ // module support, but no custom elements support (Old Edge)
65
+ // @ts-ignore
66
+ return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-dom" */ './dom-36862b77.js'); }).then(() => opts);
67
+ }
68
+ }
14
69
  return index.promiseResolve(opts);
15
70
  };
71
+ const patchDynamicImport = (base, orgScriptElm) => {
72
+ const importFunctionName = getDynamicImportFunction(index.NAMESPACE);
73
+ try {
74
+ // test if this browser supports dynamic imports
75
+ // There is a caching issue in V8, that breaks using import() in Function
76
+ // By generating a random string, we can workaround it
77
+ // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
78
+ index.win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
79
+ }
80
+ catch (e) {
81
+ // this shim is specifically for browsers that do support "esm" imports
82
+ // however, they do NOT support "dynamic" imports
83
+ // basically this code is for old Edge, v18 and below
84
+ const moduleMap = new Map();
85
+ index.win[importFunctionName] = (src) => {
86
+ const url = new URL(src, base).href;
87
+ let mod = moduleMap.get(url);
88
+ if (!mod) {
89
+ const script = index.doc.createElement('script');
90
+ script.type = 'module';
91
+ script.crossOrigin = orgScriptElm.crossOrigin;
92
+ script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
93
+ type: 'application/javascript',
94
+ }));
95
+ mod = new Promise((resolve) => {
96
+ script.onload = () => {
97
+ resolve(index.win[importFunctionName].m);
98
+ script.remove();
99
+ };
100
+ });
101
+ moduleMap.set(url, mod);
102
+ index.doc.head.appendChild(script);
103
+ }
104
+ return mod;
105
+ };
106
+ }
107
+ };
108
+ const patchCloneNodeFix = (HTMLElementPrototype) => {
109
+ const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
110
+ HTMLElementPrototype.cloneNode = function (deep) {
111
+ if (this.nodeName === 'TEMPLATE') {
112
+ return nativeCloneNodeFn.call(this, deep);
113
+ }
114
+ const clonedNode = nativeCloneNodeFn.call(this, false);
115
+ const srcChildNodes = this.childNodes;
116
+ if (deep) {
117
+ for (let i = 0; i < srcChildNodes.length; i++) {
118
+ // Node.ATTRIBUTE_NODE === 2, and checking because IE11
119
+ if (srcChildNodes[i].nodeType !== 2) {
120
+ clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
121
+ }
122
+ }
123
+ }
124
+ return clonedNode;
125
+ };
126
+ };
16
127
 
17
128
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
129
+ appGlobals.globalScripts();
130
+ return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-filter-binary-select.cjs",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number.cjs",[[0,"snk-filter-number",{"config":[16],"value":[2]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period.cjs",[[0,"snk-filter-period",{"config":[16],"value":[16]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-search.cjs",[[0,"snk-filter-search",{"config":[16],"value":[16],"fix":[16],"unfix":[16]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text.cjs",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-detail.cjs",[[0,"snk-filter-detail",{"config":[1040],"keepOpened":[1028,"keep-opened"],"getMessage":[16]}]]],["snk-filter-bar.cjs",[[2,"snk-filter-bar",{"dataUnit":[1040],"filterConfig":[1040]},[[0,"filterChange","filterChangeListener"]]]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]],["snk-grid.cjs",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64]}]]],["snk-form.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-filter-item.cjs",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["snk-filter-list.cjs",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"_filterArgument":[32],"_showAll":[32]}]]]], options);
19
131
  });
@@ -0,0 +1,389 @@
1
+ 'use strict';
2
+
3
+ /*
4
+ Stencil Client Platform v2.18.1 | MIT Licensed | https://stenciljs.com
5
+ */
6
+ /**
7
+ * @license
8
+ * Copyright Google Inc. All Rights Reserved.
9
+ *
10
+ * Use of this source code is governed by an MIT-style license that can be
11
+ * found in the LICENSE file at https://angular.io/license
12
+ *
13
+ * This file is a port of shadowCSS from webcomponents.js to TypeScript.
14
+ * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
15
+ * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
16
+ */
17
+ const safeSelector = (selector) => {
18
+ const placeholders = [];
19
+ let index = 0;
20
+ // Replaces attribute selectors with placeholders.
21
+ // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
22
+ selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
23
+ const replaceBy = `__ph-${index}__`;
24
+ placeholders.push(keep);
25
+ index++;
26
+ return replaceBy;
27
+ });
28
+ // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
29
+ // WS and "+" would otherwise be interpreted as selector separators.
30
+ const content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
31
+ const replaceBy = `__ph-${index}__`;
32
+ placeholders.push(exp);
33
+ index++;
34
+ return pseudo + replaceBy;
35
+ });
36
+ const ss = {
37
+ content,
38
+ placeholders,
39
+ };
40
+ return ss;
41
+ };
42
+ const restoreSafeSelector = (placeholders, content) => {
43
+ return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
44
+ };
45
+ const _polyfillHost = '-shadowcsshost';
46
+ const _polyfillSlotted = '-shadowcssslotted';
47
+ // note: :host-context pre-processed to -shadowcsshostcontext.
48
+ const _polyfillHostContext = '-shadowcsscontext';
49
+ const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
50
+ const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
51
+ const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
52
+ const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
53
+ const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
54
+ const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
55
+ const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
56
+ const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
57
+ const _polyfillHostRe = /-shadowcsshost/gim;
58
+ const _colonHostRe = /:host/gim;
59
+ const _colonSlottedRe = /::slotted/gim;
60
+ const _colonHostContextRe = /:host-context/gim;
61
+ const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
62
+ const stripComments = (input) => {
63
+ return input.replace(_commentRe, '');
64
+ };
65
+ const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
66
+ const extractCommentsWithHash = (input) => {
67
+ return input.match(_commentWithHashRe) || [];
68
+ };
69
+ const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
70
+ const _curlyRe = /([{}])/g;
71
+ const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
72
+ const OPEN_CURLY = '{';
73
+ const CLOSE_CURLY = '}';
74
+ const BLOCK_PLACEHOLDER = '%BLOCK%';
75
+ const processRules = (input, ruleCallback) => {
76
+ const inputWithEscapedBlocks = escapeBlocks(input);
77
+ let nextBlockIndex = 0;
78
+ return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
79
+ const selector = m[2];
80
+ let content = '';
81
+ let suffix = m[4];
82
+ let contentPrefix = '';
83
+ if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
84
+ content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
85
+ suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
86
+ contentPrefix = '{';
87
+ }
88
+ const cssRule = {
89
+ selector,
90
+ content,
91
+ };
92
+ const rule = ruleCallback(cssRule);
93
+ return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
94
+ });
95
+ };
96
+ const escapeBlocks = (input) => {
97
+ const inputParts = input.split(_curlyRe);
98
+ const resultParts = [];
99
+ const escapedBlocks = [];
100
+ let bracketCount = 0;
101
+ let currentBlockParts = [];
102
+ for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
103
+ const part = inputParts[partIndex];
104
+ if (part === CLOSE_CURLY) {
105
+ bracketCount--;
106
+ }
107
+ if (bracketCount > 0) {
108
+ currentBlockParts.push(part);
109
+ }
110
+ else {
111
+ if (currentBlockParts.length > 0) {
112
+ escapedBlocks.push(currentBlockParts.join(''));
113
+ resultParts.push(BLOCK_PLACEHOLDER);
114
+ currentBlockParts = [];
115
+ }
116
+ resultParts.push(part);
117
+ }
118
+ if (part === OPEN_CURLY) {
119
+ bracketCount++;
120
+ }
121
+ }
122
+ if (currentBlockParts.length > 0) {
123
+ escapedBlocks.push(currentBlockParts.join(''));
124
+ resultParts.push(BLOCK_PLACEHOLDER);
125
+ }
126
+ const strEscapedBlocks = {
127
+ escapedString: resultParts.join(''),
128
+ blocks: escapedBlocks,
129
+ };
130
+ return strEscapedBlocks;
131
+ };
132
+ const insertPolyfillHostInCssText = (selector) => {
133
+ selector = selector
134
+ .replace(_colonHostContextRe, _polyfillHostContext)
135
+ .replace(_colonHostRe, _polyfillHost)
136
+ .replace(_colonSlottedRe, _polyfillSlotted);
137
+ return selector;
138
+ };
139
+ const convertColonRule = (cssText, regExp, partReplacer) => {
140
+ // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
141
+ return cssText.replace(regExp, (...m) => {
142
+ if (m[2]) {
143
+ const parts = m[2].split(',');
144
+ const r = [];
145
+ for (let i = 0; i < parts.length; i++) {
146
+ const p = parts[i].trim();
147
+ if (!p)
148
+ break;
149
+ r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
150
+ }
151
+ return r.join(',');
152
+ }
153
+ else {
154
+ return _polyfillHostNoCombinator + m[3];
155
+ }
156
+ });
157
+ };
158
+ const colonHostPartReplacer = (host, part, suffix) => {
159
+ return host + part.replace(_polyfillHost, '') + suffix;
160
+ };
161
+ const convertColonHost = (cssText) => {
162
+ return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
163
+ };
164
+ const colonHostContextPartReplacer = (host, part, suffix) => {
165
+ if (part.indexOf(_polyfillHost) > -1) {
166
+ return colonHostPartReplacer(host, part, suffix);
167
+ }
168
+ else {
169
+ return host + part + suffix + ', ' + part + ' ' + host + suffix;
170
+ }
171
+ };
172
+ const convertColonSlotted = (cssText, slotScopeId) => {
173
+ const slotClass = '.' + slotScopeId + ' > ';
174
+ const selectors = [];
175
+ cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
176
+ if (m[2]) {
177
+ const compound = m[2].trim();
178
+ const suffix = m[3];
179
+ const slottedSelector = slotClass + compound + suffix;
180
+ let prefixSelector = '';
181
+ for (let i = m[4] - 1; i >= 0; i--) {
182
+ const char = m[5][i];
183
+ if (char === '}' || char === ',') {
184
+ break;
185
+ }
186
+ prefixSelector = char + prefixSelector;
187
+ }
188
+ const orgSelector = prefixSelector + slottedSelector;
189
+ const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
190
+ if (orgSelector.trim() !== addedSelector.trim()) {
191
+ const updatedSelector = `${addedSelector}, ${orgSelector}`;
192
+ selectors.push({
193
+ orgSelector,
194
+ updatedSelector,
195
+ });
196
+ }
197
+ return slottedSelector;
198
+ }
199
+ else {
200
+ return _polyfillHostNoCombinator + m[3];
201
+ }
202
+ });
203
+ return {
204
+ selectors,
205
+ cssText,
206
+ };
207
+ };
208
+ const convertColonHostContext = (cssText) => {
209
+ return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
210
+ };
211
+ const convertShadowDOMSelectors = (cssText) => {
212
+ return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
213
+ };
214
+ const makeScopeMatcher = (scopeSelector) => {
215
+ const lre = /\[/g;
216
+ const rre = /\]/g;
217
+ scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
218
+ return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
219
+ };
220
+ const selectorNeedsScoping = (selector, scopeSelector) => {
221
+ const re = makeScopeMatcher(scopeSelector);
222
+ return !re.test(selector);
223
+ };
224
+ const injectScopingSelector = (selector, scopingSelector) => {
225
+ return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
226
+ return before + scopingSelector + colon + after;
227
+ });
228
+ };
229
+ const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
230
+ // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
231
+ _polyfillHostRe.lastIndex = 0;
232
+ if (_polyfillHostRe.test(selector)) {
233
+ const replaceBy = `.${hostSelector}`;
234
+ return selector
235
+ .replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
236
+ .replace(_polyfillHostRe, replaceBy + ' ');
237
+ }
238
+ return scopeSelector + ' ' + selector;
239
+ };
240
+ const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
241
+ const isRe = /\[is=([^\]]*)\]/g;
242
+ scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
243
+ const className = '.' + scopeSelector;
244
+ const _scopeSelectorPart = (p) => {
245
+ let scopedP = p.trim();
246
+ if (!scopedP) {
247
+ return '';
248
+ }
249
+ if (p.indexOf(_polyfillHostNoCombinator) > -1) {
250
+ scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
251
+ }
252
+ else {
253
+ // remove :host since it should be unnecessary
254
+ const t = p.replace(_polyfillHostRe, '');
255
+ if (t.length > 0) {
256
+ scopedP = injectScopingSelector(t, className);
257
+ }
258
+ }
259
+ return scopedP;
260
+ };
261
+ const safeContent = safeSelector(selector);
262
+ selector = safeContent.content;
263
+ let scopedSelector = '';
264
+ let startIndex = 0;
265
+ let res;
266
+ const sep = /( |>|\+|~(?!=))\s*/g;
267
+ // If a selector appears before :host it should not be shimmed as it
268
+ // matches on ancestor elements and not on elements in the host's shadow
269
+ // `:host-context(div)` is transformed to
270
+ // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
271
+ // the `div` is not part of the component in the 2nd selectors and should not be scoped.
272
+ // Historically `component-tag:host` was matching the component so we also want to preserve
273
+ // this behavior to avoid breaking legacy apps (it should not match).
274
+ // The behavior should be:
275
+ // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
276
+ // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
277
+ // `:host-context(tag)`)
278
+ const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
279
+ // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
280
+ let shouldScope = !hasHost;
281
+ while ((res = sep.exec(selector)) !== null) {
282
+ const separator = res[1];
283
+ const part = selector.slice(startIndex, res.index).trim();
284
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
285
+ const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
286
+ scopedSelector += `${scopedPart} ${separator} `;
287
+ startIndex = sep.lastIndex;
288
+ }
289
+ const part = selector.substring(startIndex);
290
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
291
+ scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
292
+ // replace the placeholders with their original values
293
+ return restoreSafeSelector(safeContent.placeholders, scopedSelector);
294
+ };
295
+ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
296
+ return selector
297
+ .split(',')
298
+ .map((shallowPart) => {
299
+ if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
300
+ return shallowPart.trim();
301
+ }
302
+ if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
303
+ return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
304
+ }
305
+ else {
306
+ return shallowPart.trim();
307
+ }
308
+ })
309
+ .join(', ');
310
+ };
311
+ const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
312
+ return processRules(cssText, (rule) => {
313
+ let selector = rule.selector;
314
+ let content = rule.content;
315
+ if (rule.selector[0] !== '@') {
316
+ selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
317
+ }
318
+ else if (rule.selector.startsWith('@media') ||
319
+ rule.selector.startsWith('@supports') ||
320
+ rule.selector.startsWith('@page') ||
321
+ rule.selector.startsWith('@document')) {
322
+ content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
323
+ }
324
+ const cssRule = {
325
+ selector: selector.replace(/\s{2,}/g, ' ').trim(),
326
+ content,
327
+ };
328
+ return cssRule;
329
+ });
330
+ };
331
+ const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
332
+ cssText = insertPolyfillHostInCssText(cssText);
333
+ cssText = convertColonHost(cssText);
334
+ cssText = convertColonHostContext(cssText);
335
+ const slotted = convertColonSlotted(cssText, slotScopeId);
336
+ cssText = slotted.cssText;
337
+ cssText = convertShadowDOMSelectors(cssText);
338
+ if (scopeId) {
339
+ cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
340
+ }
341
+ cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
342
+ cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
343
+ return {
344
+ cssText: cssText.trim(),
345
+ slottedSelectors: slotted.selectors,
346
+ };
347
+ };
348
+ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
349
+ const hostScopeId = scopeId + '-h';
350
+ const slotScopeId = scopeId + '-s';
351
+ const commentsWithHash = extractCommentsWithHash(cssText);
352
+ cssText = stripComments(cssText);
353
+ const orgSelectors = [];
354
+ if (commentOriginalSelector) {
355
+ const processCommentedSelector = (rule) => {
356
+ const placeholder = `/*!@___${orgSelectors.length}___*/`;
357
+ const comment = `/*!@${rule.selector}*/`;
358
+ orgSelectors.push({ placeholder, comment });
359
+ rule.selector = placeholder + rule.selector;
360
+ return rule;
361
+ };
362
+ cssText = processRules(cssText, (rule) => {
363
+ if (rule.selector[0] !== '@') {
364
+ return processCommentedSelector(rule);
365
+ }
366
+ else if (rule.selector.startsWith('@media') ||
367
+ rule.selector.startsWith('@supports') ||
368
+ rule.selector.startsWith('@page') ||
369
+ rule.selector.startsWith('@document')) {
370
+ rule.content = processRules(rule.content, processCommentedSelector);
371
+ return rule;
372
+ }
373
+ return rule;
374
+ });
375
+ }
376
+ const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
377
+ cssText = [scoped.cssText, ...commentsWithHash].join('\n');
378
+ if (commentOriginalSelector) {
379
+ orgSelectors.forEach(({ placeholder, comment }) => {
380
+ cssText = cssText.replace(placeholder, comment);
381
+ });
382
+ }
383
+ scoped.slottedSelectors.forEach((slottedSelector) => {
384
+ cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
385
+ });
386
+ return cssText;
387
+ };
388
+
389
+ exports.scopeCss = scopeCss;