@sankhyalabs/sankhyablocks 1.4.0-beta.7 → 1.4.0-beta.9

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 (194) hide show
  1. package/dist/cjs/{SnkMessageBuilder-b54dfb89.js → SnkMessageBuilder-6c2f7bcd.js} +87 -11
  2. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  3. package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
  4. package/dist/cjs/constants-9056ca9e.js +84 -0
  5. package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
  6. package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
  7. package/dist/cjs/{index-6fcf07f3.js → index-20e8b68a.js} +50 -2
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  10. package/dist/cjs/snk-application.cjs.entry.js +209 -6976
  11. package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
  12. package/dist/cjs/snk-config-options.cjs.entry.js +230 -0
  13. package/dist/cjs/{snk-filter-bar_5.cjs.entry.js → snk-configurator_6.cjs.entry.js} +194 -7
  14. package/dist/cjs/snk-crud.cjs.entry.js +13 -11
  15. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  16. package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
  17. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -2
  23. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  24. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
  26. package/dist/cjs/snk-form.cjs.entry.js +146 -0
  27. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  28. package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
  29. package/dist/cjs/{taskbar-elements-aedfeae6.js → taskbar-elements-9a4b1e19.js} +10 -6
  30. package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
  31. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  32. package/dist/collection/collection-manifest.json +27 -1
  33. package/dist/collection/components/snk-application/snk-application.js +144 -23
  34. package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
  35. package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
  36. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
  37. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
  38. package/dist/collection/components/snk-crud/snk-crud.js +15 -13
  39. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +35 -4
  40. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +3 -3
  41. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +2 -1
  42. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  43. package/dist/collection/components/snk-form/snk-form.css +4 -0
  44. package/dist/collection/components/snk-form/snk-form.js +108 -30
  45. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
  46. package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +315 -0
  47. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
  48. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
  49. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
  50. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
  51. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
  52. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
  53. package/dist/collection/components/snk-grid/snk-grid.js +92 -22
  54. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -5
  55. package/dist/collection/components/snk-taskbar/snk-taskbar.js +35 -3
  56. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
  57. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
  58. package/dist/collection/lib/message/SnkMessageBuilder.js +8 -1
  59. package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
  60. package/dist/collection/lib/message/resources/snk-form.msg.js +59 -2
  61. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -1
  62. package/dist/collection/lib/utils/constants.js +72 -0
  63. package/dist/components/SnkMessageBuilder.js +87 -11
  64. package/dist/components/_commonjsHelpers.js +17 -0
  65. package/dist/components/constants.js +74 -0
  66. package/dist/components/form-config-fetcher.js +6889 -0
  67. package/dist/components/index.d.ts +6 -0
  68. package/dist/components/index.js +6 -0
  69. package/dist/components/snk-application2.js +221 -6985
  70. package/dist/components/snk-config-modal.d.ts +11 -0
  71. package/dist/components/snk-config-modal.js +6 -0
  72. package/dist/components/snk-config-modal2.js +91 -0
  73. package/dist/components/snk-config-options.d.ts +11 -0
  74. package/dist/components/snk-config-options.js +6 -0
  75. package/dist/components/snk-config-options2.js +245 -0
  76. package/dist/components/snk-configurator.d.ts +11 -0
  77. package/dist/components/snk-configurator.js +6 -0
  78. package/dist/components/snk-configurator2.js +212 -0
  79. package/dist/components/snk-crud.js +62 -25
  80. package/dist/components/snk-field-config.d.ts +11 -0
  81. package/dist/components/snk-field-config.js +6 -0
  82. package/dist/components/snk-field-config2.js +70 -0
  83. package/dist/components/snk-filter-bar2.js +1 -1
  84. package/dist/components/snk-filter-modal2.js +2 -1
  85. package/dist/components/snk-filter-personalized.js +4 -1
  86. package/dist/components/snk-form-config.d.ts +11 -0
  87. package/dist/components/snk-form-config.js +6 -0
  88. package/dist/components/snk-form-config2.js +996 -0
  89. package/dist/components/snk-form2.js +79 -29
  90. package/dist/components/snk-grid2.js +43 -24
  91. package/dist/components/snk-tab-config.d.ts +11 -0
  92. package/dist/components/snk-tab-config.js +6 -0
  93. package/dist/components/snk-tab-config2.js +7220 -0
  94. package/dist/components/snk-taskbar2.js +27 -9
  95. package/dist/esm/{SnkMessageBuilder-d440381c.js → SnkMessageBuilder-5792c260.js} +87 -11
  96. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  97. package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
  98. package/dist/esm/constants-c6039d3d.js +74 -0
  99. package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
  100. package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
  101. package/dist/esm/{index-81dda3cf.js → index-e4121713.js} +50 -3
  102. package/dist/esm/loader.js +2 -2
  103. package/dist/esm/sankhyablocks.js +2 -2
  104. package/dist/esm/snk-application.entry.js +220 -6987
  105. package/dist/esm/snk-config-modal.entry.js +58 -0
  106. package/dist/esm/snk-config-options.entry.js +226 -0
  107. package/dist/esm/{snk-filter-bar_5.entry.js → snk-configurator_6.entry.js} +195 -9
  108. package/dist/esm/snk-crud.entry.js +13 -11
  109. package/dist/esm/snk-data-unit.entry.js +2 -2
  110. package/dist/esm/snk-field-config_2.entry.js +130 -0
  111. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  112. package/dist/esm/snk-filter-detail.entry.js +1 -1
  113. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  114. package/dist/esm/snk-filter-number.entry.js +1 -1
  115. package/dist/esm/snk-filter-period.entry.js +1 -1
  116. package/dist/esm/snk-filter-personalized.entry.js +3 -2
  117. package/dist/esm/snk-filter-search.entry.js +1 -1
  118. package/dist/esm/snk-filter-text.entry.js +1 -1
  119. package/dist/esm/snk-form-config.entry.js +953 -0
  120. package/dist/esm/snk-form.entry.js +142 -0
  121. package/dist/esm/snk-pesquisa.entry.js +1 -1
  122. package/dist/esm/snk-tab-config.entry.js +317 -0
  123. package/dist/esm/{taskbar-elements-38eb5d51.js → taskbar-elements-e2ed0536.js} +10 -6
  124. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  125. package/dist/esm/teste-pesquisa.entry.js +1 -1
  126. package/dist/sankhyablocks/{p-4574a955.entry.js → p-029ae4e4.entry.js} +1 -1
  127. package/dist/sankhyablocks/p-03f9c407.js +1 -0
  128. package/dist/sankhyablocks/p-112455b1.js +1 -0
  129. package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
  130. package/dist/sankhyablocks/p-1feabfc7.entry.js +1 -0
  131. package/dist/sankhyablocks/p-21c8929b.js +1 -0
  132. package/dist/sankhyablocks/p-2284c850.entry.js +1 -0
  133. package/dist/sankhyablocks/p-2b891c4a.entry.js +1 -0
  134. package/dist/sankhyablocks/{p-0ea25487.entry.js → p-2dc76d79.entry.js} +1 -1
  135. package/dist/sankhyablocks/p-361299e8.js +26 -0
  136. package/dist/sankhyablocks/p-366aa0f5.entry.js +1 -0
  137. package/dist/sankhyablocks/p-36d2d9cf.entry.js +75 -0
  138. package/dist/sankhyablocks/{p-6386d720.entry.js → p-3a276f3d.entry.js} +1 -1
  139. package/dist/sankhyablocks/{p-0352c0e2.entry.js → p-44ce5b90.entry.js} +1 -1
  140. package/dist/sankhyablocks/{p-aecf3e0a.entry.js → p-6988f4a6.entry.js} +1 -1
  141. package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
  142. package/dist/sankhyablocks/p-7b4a4a50.entry.js +1 -0
  143. package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
  144. package/dist/sankhyablocks/{p-40b27004.entry.js → p-9dc4426d.entry.js} +1 -1
  145. package/dist/sankhyablocks/p-a17a4fca.entry.js +1 -0
  146. package/dist/sankhyablocks/p-a5b26df2.js +1 -0
  147. package/dist/sankhyablocks/p-b6d6b172.js +1 -0
  148. package/dist/sankhyablocks/{p-5bdb8452.entry.js → p-cc4bef9f.entry.js} +1 -1
  149. package/dist/sankhyablocks/{p-2e49afef.entry.js → p-d1ac09c9.entry.js} +1 -1
  150. package/dist/sankhyablocks/p-d50651a3.js +1 -0
  151. package/dist/sankhyablocks/p-d9fbb26f.js +1 -0
  152. package/dist/sankhyablocks/{p-49580cdd.entry.js → p-deb1f523.entry.js} +1 -1
  153. package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
  154. package/dist/sankhyablocks/{p-ba426ea9.entry.js → p-e9beab79.entry.js} +1 -1
  155. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  156. package/dist/types/components/snk-application/snk-application.d.ts +29 -14
  157. package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
  158. package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
  159. package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
  160. package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
  161. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
  162. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +8 -6
  163. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +3 -3
  164. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
  165. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +65 -0
  166. package/dist/types/components/snk-form/snk-form.d.ts +71 -0
  167. package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +51 -0
  168. package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
  169. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
  170. package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
  171. package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
  172. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +6 -5
  173. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -3
  174. package/dist/types/components.d.ts +358 -13
  175. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
  176. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
  177. package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
  178. package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -2
  179. package/dist/types/lib/utils/constants.d.ts +76 -0
  180. package/dist/types/lib/utils/pesquisa.d.ts +2 -1
  181. package/package.json +4 -3
  182. package/react/components.d.ts +6 -0
  183. package/react/components.js +6 -0
  184. package/react/components.js.map +1 -1
  185. package/dist/cjs/snk-form_2.cjs.entry.js +0 -247
  186. package/dist/esm/snk-form_2.entry.js +0 -242
  187. package/dist/sankhyablocks/p-21e940aa.entry.js +0 -1
  188. package/dist/sankhyablocks/p-2eea7eea.js +0 -1
  189. package/dist/sankhyablocks/p-42036db1.entry.js +0 -84
  190. package/dist/sankhyablocks/p-77216252.entry.js +0 -1
  191. package/dist/sankhyablocks/p-86f15ffe.js +0 -1
  192. package/dist/sankhyablocks/p-97009a2c.entry.js +0 -1
  193. package/dist/sankhyablocks/p-a14c49db.entry.js +0 -1
  194. package/dist/sankhyablocks/p-fac2b6a9.js +0 -2
@@ -0,0 +1 @@
1
+ import{r as i,c as o,h as t,H as n}from"./p-9ba3df4c.js";import{d as l}from"./p-b6d6b172.js";import{ObjectUtils as e,ArrayUtils as s,ApplicationContext as a}from"@sankhyalabs/core";import{ApplicationUtils as r,DialogType as d}from"@sankhyalabs/ezui/dist/collection/utils";import{C as h,T as c,A as f}from"./p-a5b26df2.js";import{a as g}from"./p-361299e8.js";import"./p-112455b1.js";const u=class{constructor(t){i(this,t),this.configChange=o(this,"configChange",7),this._listEnabledFields=[],this._renderTimer=500,this._sortableTimer=100,this._tabSelected=1,this._labelNewGroup="Novo grupo",this._mouseOnFieldConfig=!1,this._mouseOnConfigOptions=!1,this._editingTitleGroup=!1,this._newGroupBoxes=[],this._currentGroupBoxes=[],this._formFieldsStyle="ez-col ez-col--sd-12 ez-col--tb-4 ez-padding-right--small ez-padding-bottom--medium sc-snk-form-config",this._fieldsAvailableStyle="ez-col ez-col--sd-12 ez-col--tb-12 ez-margin-bottom--medium ez-margin-right--medium sc-snk-form-config",this._fieldFloatingStyle="form-config__field-config--dragged",this._formConfigOptions=[],this._formConfig={},this._formConfigChanged=!1,this._optionFormConfigChanged=!1,this._tempGroups=[],this.formConfig={}}observeFormConfig(){this.loadConfig(this._sortableTimer)}loadFields(i=0){this._layoutFormConfig=[],i>0?setTimeout((()=>{this.buildFields()}),i):this.buildFields()}buildFields(){this.buildFormConfig(),this.buildAvailableFields()}loadFormConfig(i){var o;this._formConfig=e.copy(this.formConfig),this.loadFields(i),this.controlFieldConfig(),null!=(null===(o=this._filterFieldsAvailable)||void 0===o?void 0:o.value)&&(this._filterFieldsAvailable.value="")}cancelChangeConfig(){!0===this._formConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.cancel")).then((i=>{i&&(this._formConfigChanged=!1,this.resetChangeConfig())})):this.resetChangeConfig()}cancelChangeOptionConfig(){!0===this._optionFormConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.cancel")).then((i=>{i&&(this._optionFormConfigChanged=!1,this.resetChangeOptionConfig())})):this.resetChangeOptionConfig()}resetChangeConfig(){this.loadFormConfig(this._sortableTimer),this.clearTempGroups()}resetChangeOptionConfig(){this._formConfigChanged=!1,this.loadConfig(this._sortableTimer),this.clearTempGroups()}getTabsToSave(){return this._layoutFormConfig.map(((i,o)=>({label:i.tab,order:o,visible:i.visible})))}getFieldsToSave(){const i=[];return this._formContainer.querySelectorAll("snk-field-config").forEach((o=>{const t=o.fieldConfig;t&&i.push({cleanOnCopy:t.cleanOnCopy||!1,group:t.group,label:t.label,name:t.name,required:t.required,readOnly:t.readOnly,tab:t.tab,defaultValue:t.defaultValue})})),i}isDefaultConfiguration(){var i;return(null===(i=this._optionFormConfigSelected)||void 0===i?void 0:i.origin)===g.DEFAULT&&!0===this._optionFormConfigChanged&&!1===this._formConfigChanged}saveConfig(){var i;if((null===(i=this._tempGroups)||void 0===i?void 0:i.length)>0)return void r.alert(this.getMessage("snkFormConfig.confirm.title"),this.getMessage("snkFormConfig.confirm.group"));const o=this.isDefaultConfiguration();let t={};if(t=e.copy(o?this.formConfig:this._formConfig),!1===o){const i=this.getTabsToSave();(null==i?void 0:i.length)>0&&(t.tabs=i);const o=this.getFieldsToSave();(null==o?void 0:o.length)>0&&(t.fields=o)}t.defaultConfiguration=o,this.configChange.emit(t),this._formConfigChanged=!1,this._optionFormConfigChanged=!1}applyOptionConfig(){if(!0===this._optionFormConfigChanged&&null!=this._optionFormConfigSelected){const i=this._optionFormConfigSelected.name||"configuração selecionada",o=this._optionFormConfigSelected.origin===g.DEFAULT?"pessoal":"padrão",t=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",i).replace("{1}",o);this.openConfirmDialog(t).then((i=>{i&&this.saveConfig()}))}else this.saveConfig()}controlFieldConfig(i){var o;this._fieldConfigSelected=null!=i?(null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===(null==i?void 0:i.name)?void 0:i:void 0}getFieldConfigStyle(i){var o;return this._formFieldsStyle+((null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===i.name?" form-config__field-config--selected":"")}getFieldsByGroup(i){var o;return(null===(o=i.fields)||void 0===o?void 0:o.length)?i.fields.map((i=>{var o,n;return t("div",{key:i.name,class:this.getFieldConfigStyle(i),"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},t("snk-field-config",{onEzClickIcon:i=>{this.handleFieldConfigChange(i)},modeInsertion:!1,fieldConfig:i,isConfigActive:(null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===i.name}),(null===(n=this._fieldConfigSelected)||void 0===n?void 0:n.name)===i.name&&t("div",{class:"ez-flex form-config__config-options"},t("snk-config-options",{idConfig:i.name,dataUnit:this.dataUnit,fieldConfig:this._fieldConfigSelected,onConfigOptionsChanged:i=>this.handleconfigOptionsChanged(i.detail)})))})):t("div",{class:"form-config__add-group-container"},t("div",{class:"form-config__add-group-content"},t("div",{class:"form-config__add-group-label"},t("label",{class:"ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold"},this.getMessage("snkFormConfig.form.labelDropField")))))}handleconfigOptionsChanged(i){var o;null===(o=this._formConfig.fields)||void 0===o||o.forEach((()=>{})),this._formConfigChanged=!0}closeFormConfig(){!0===this._formConfigChanged||!0===this._optionFormConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.exit")).then((i=>{i&&(this._formConfigChanged=!1,this.setShowFormConfig(!1))})):this.setShowFormConfig(!1)}openConfirmDialog(i="",o=this.getMessage("snkFormConfig.confirm.title")){return r.confirm(o,i)}controlMoveField(i){const o=null==i?void 0:i.target;null!=(null==o?void 0:o.closest('[data-draggable-element="field"]'))&&(this._mouseOnFieldConfig=!0,null!=(null==o?void 0:o.closest(".form-config__config-options"))||null!=(null==o?void 0:o.closest(".field-config__options"))?this._mouseOnConfigOptions=!0:!1===["minus","settings-inverted","chevron-up"].includes(null==o?void 0:o.iconName)&&this.controlFieldConfig())}controlStartDraggingField(i){var o,t,n;if(this._mouseOnConfigOptions)null==i||i.cancel(),this._mouseOnConfigOptions=!1;else{const l=null===(n=null===(t=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.dragEvent)||void 0===t?void 0:t.data)||void 0===n?void 0:n.sourceContainer;null!=l&&l.classList.add(this._fieldFloatingStyle)}}controlSortedDraggingField(i){var o,t,n,l,e,s,a,r;const d=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.oldContainer,h=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.newContainer,c=null===(e=null===(l=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.dragEvent)||void 0===l?void 0:l.data)||void 0===e?void 0:e.source,f=null===(r=null===(a=null===(s=null==i?void 0:i.data)||void 0===s?void 0:s.dragEvent)||void 0===a?void 0:a.data)||void 0===r?void 0:r.originalSource;null!=d&&null!=h&&null!=c&&null!=f&&("EZ-COLLAPSIBLE-BOX"!==h.tagName&&"fieldsWithoutGroupContainer"!==h.id||"fieldsAvailableContainer"!==d.id?"EZ-COLLAPSIBLE-BOX"!==d.tagName&&"fieldsWithoutGroupContainer"!==d.id||"fieldsAvailableContainer"!==h.id||(c.className=this._fieldsAvailableStyle,c.querySelector("snk-field-config").modeInsertion=!0,f.className=this._fieldsAvailableStyle,f.querySelector("snk-field-config").modeInsertion=!0):(c.className=this._formFieldsStyle,c.querySelector("snk-field-config").modeInsertion=!1,f.className=this._formFieldsStyle,f.querySelector("snk-field-config").modeInsertion=!1))}isCancelDragAvailableField(i,o,t){var n,l;return null!=i&&null!=o&&null!=t&&(null===(n=t.data)||void 0===n?void 0:n.newIndex)!==(null===(l=t.data)||void 0===l?void 0:l.oldIndex)&&"fieldsAvailableContainer"===i.id&&o.id===i.id&&(t.cancel(),this._fieldsAvailable=[],setTimeout((()=>{this.buildAvailableFields()}),this._sortableTimer),!0)}isRemoveField(i,o,t){if(null==i||null==o||null==t)return!1;if(("EZ-COLLAPSIBLE-BOX"===o.tagName||"fieldsWithoutGroupContainer"===o.id)&&"fieldsAvailableContainer"===i.id){const i={detail:{field:t,type:f.remove}};return setTimeout((()=>{this.handleFieldConfigChange(i,this._sortableTimer)}),this._renderTimer),!0}return!1}isAddOrMoveField(i,o,t,n){var l;return null!=i&&null!=o&&null!=t&&null!=n&&(n.newIndex!==n.oldIndex||o.dataset.groupName!==i.dataset.groupName||"fieldsWithoutGroupContainer"===i.id&&"fieldsAvailableContainer"===o.id)&&(this.isFieldAvailable(i,o)&&(t.tab=null===(l=this._tabConfig)||void 0===l?void 0:l.selectedTab),t.group=i.dataset.groupName,setTimeout((()=>{i.id.includes("addNewGroupContainer")&&this.clearTempGroups(!0),this.updateFieldsToSave(o.dataset.groupName!==i.dataset.groupName||"fieldsWithoutGroupContainer"===i.id&&"fieldsAvailableContainer"===o.id?this._sortableTimer:0)}),this._renderTimer),!0)}isFieldAvailable(i,o){return null!=i&&null!=o&&("EZ-COLLAPSIBLE-BOX"===i.tagName||"fieldsWithoutGroupContainer"===i.id)&&"fieldsAvailableContainer"===o.id}controlStopDraggingField(i){var o,t,n,l,e,s;const a=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.oldContainer,r=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.newContainer;if(this.isCancelDragAvailableField(r,a,i))return;const d=null===(e=null===(l=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.dragEvent)||void 0===l?void 0:l.data)||void 0===e?void 0:e.originalSource,h=null===(s=null==d?void 0:d.querySelector("snk-field-config"))||void 0===s?void 0:s.fieldConfig;this.isRemoveField(r,a,h)||this.isAddOrMoveField(r,a,h,null==i?void 0:i.data)}updateFieldsToSave(i=0){const o=this.getFieldsToSave();(null==o?void 0:o.length)>0&&(this._formConfig.fields=o),this.loadFields(i),this._formConfigChanged=!0}controlSortableField(){null!=this._sortableContainer&&(this._sortableField&&this._sortableField.destroy(),this._sortableField=new l.Sortable(this._sortableContainer.querySelectorAll('[data-draggable-parent="field"]'),{draggable:'[data-draggable-element="field"]',mirror:{constrainDimensions:!0}}),this._sortableField.on(h.dragStart,(i=>this.controlStartDraggingField(i))),this._sortableField.on(h.dragSorted,(i=>this.controlSortedDraggingField(i))),this._sortableField.on(h.dragStop,(i=>this.controlStopDraggingField(i))))}controlStartDraggingGroup(i){(this._mouseOnFieldConfig||this._editingTitleGroup)&&(null==i||i.cancel(),this._mouseOnFieldConfig=!1)}controlStopDraggingGroup(i){i.data.newIndex!==i.data.oldIndex&&setTimeout((()=>{this.updateFieldsToSave(this._sortableTimer)}),this._renderTimer)}controlSortableGroup(){null!=this._sortableContainer&&(this._sortableGroup&&this._sortableGroup.destroy(),this._sortableGroup=new l.Sortable(this._sortableContainer.querySelectorAll('[data-draggable-parent="group"]'),{draggable:'[data-draggable-element="group"]',mirror:{constrainDimensions:!0}}),this._sortableGroup.on(h.dragStart,(i=>this.controlStartDraggingGroup(i))),this._sortableGroup.on(h.dragStop,(i=>this.controlStopDraggingGroup(i))))}loadUserConfig(){var i;null!=this._application&&this._application.fetchUserAvailableConfigs(null===(i=this.parentForm)||void 0===i?void 0:i.configName).then((i=>{this._formConfigOptions=i;let o=null==this._formConfig||this._formConfig.defaultConfiguration;const t=i.find((i=>i.origin===(o?g.DEFAULT:g.USER)));this.setFormConfig(t)}))}setFormConfig(i){this._optionFormConfigSelected=i}controlSelectFormConfig(i){const o=null==i?void 0:i.detail,t=this._formConfigOptions.find((i=>i.origin===(null==o?void 0:o.value)));this.setFormConfig(t),this._optionFormConfigChanged=!0,this.loadConfigByUser()}changeTabOrder(i){const o=[],t=this._tabConfig.querySelectorAll(".tab-config__tab");this._tabSelected=i,t.forEach(((i,t)=>{var n;if(t){const l=null===(n=i.querySelector(".tab-config__tab-label"))||void 0===n?void 0:n.getAttribute("title");o.push({label:l,order:t-1})}})),this._layoutFormConfig.map((i=>{o.forEach((o=>{o.label===i.tab&&(o.visible=i.visible)}))})),o.length>0&&(this._formConfig.tabs=o,this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0)}loadConfigByUser(){var i;if(null!=this._application){const o=this._optionFormConfigSelected,t=(null==o?void 0:o.origin)===g.DEFAULT?"fetchDefaultConfig":(null==o?void 0:o.origin)===g.USER?"fetchLegacyConfig":void 0;null!=t&&this._application[t](null===(i=this.parentForm)||void 0===i?void 0:i.configName).then((i=>{null!=i&&(this._formConfig=i,this._tabSelected=1,this.loadFields(this._sortableTimer),this.controlFieldConfig(),this.clearTempGroups())}))}}loadConfig(i=0){this.loadFormConfig(i),this.loadUserConfig()}addNewGroup(){var i,o;const t=null===(i=this._tabConfig)||void 0===i?void 0:i.selectedTab;null==(null===(o=this._tempGroups)||void 0===o?void 0:o.find((i=>i.tab===t&&i.group.includes(this._labelNewGroup))))&&(this._tempGroups.push({tab:t,group:this.handleDuplicateGroups(this._labelNewGroup,this._tabConfig.selectedTab)}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0)}clearTempGroups(i=!1){var o;(null===(o=this._tempGroups)||void 0===o?void 0:o.length)>0&&(this._tempGroups=i?this._tempGroups.filter((i=>i.tab!==this._tabConfig.selectedTab)):[])}removeGroup(i){null!=i?this._tempGroups=this._tempGroups.filter(((o,t)=>t!==i&&o.tab===this._tabConfig.selectedTab||o.tab!==this._tabConfig.selectedTab)):this.updateFieldsToSave(this._sortableTimer)}checkGroupExists(i,o,t=!1){var n,l,e;const s=null===(n=this._tabConfig)||void 0===n?void 0:n.selectedTab,a=null===(l=this._layoutFormConfig)||void 0===l?void 0:l.find((i=>i.tab===s)),d=null===(e=null==a?void 0:a.groups)||void 0===e?void 0:e.map((i=>{var o;return null===(o=i.group)||void 0===o?void 0:o.toLowerCase()}));if(null==d?void 0:d.includes(null==i?void 0:i.toLowerCase())){const n=this.getMessage("snkFormConfig.confirm.title"),l=`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")} \n <b>${i}</b> \n ${this.getMessage("snkFormConfig.alert.inTab")} \n <b>${s===c.main?this.getMessage("snkFormConfig.form.mainArea"):s}</b>. \n <br/><br/> \n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `;return r.alert(n,l).then((()=>{var i,n;t?null===(i=this._newGroupBoxes[o])||void 0===i||i.applyFocusTextEdit():null===(n=this._currentGroupBoxes[s][o])||void 0===n||n.applyFocusTextEdit()})),!1}return!0}saveEditLabelTempGroup(i,o){const{newValue:t}=i.detail;null!=this._newGroupBoxes&&null!=this._newGroupBoxes[o]&&(this._newGroupBoxes[o].dataset.groupName=t)}saveEditLabelGroup(i){var o;const{value:t,newValue:n}=i.detail;null===(o=this._formConfig.fields)||void 0===o||o.forEach((i=>{i.group===t&&(i.group=n)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}renderTempGroupByTab(i){return this._tempGroups.map(((o,n)=>{if(o.tab===i)return t("ez-collapsible-box",{ref:i=>this._newGroupBoxes[n]=i,id:`addNewGroupContainer-${n}`,editable:!0,removable:!0,"header-size":"large",label:o.group,"icon-placement":"left","data-group-name":o.group,"data-draggable-parent":"field",class:"form-config__add-group",onEzRemove:()=>this.removeGroup(n),onEzSaveEditLabel:i=>this.saveEditLabelTempGroup(i,n),onEzEditLabelMode:i=>this._editingTitleGroup=i.detail,conditionalSave:i=>this.checkGroupExists(i,n,!0)},this.getFieldsByGroup(o))}))}handleDuplicateGroups(i,o){var t;const n=this._layoutFormConfig[this._tabConfig.selectedIndex].groups.map((i=>i.group));return null!=n&&(null===(t=this._layoutFormConfig)||void 0===t||t.map((t=>{t.tab===o&&t.groups.some((o=>o.group===i))&&(i+=`${this.captureHighestValueTitle(n)}`)}))),i}captureHighestValueTitle(i){let o=[];return null==i||i.map((i=>{null!=i&&o.push(i.replace(/[^0-9]/g,""))})),Math.max.apply(null,o)>0?` (${Math.max.apply(null,o)+1})`:" (1)"}getLayoutFormConfig(){var i,o;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let t=[],n=[];for(const i of this._formConfig.fields)if(null==n.find((o=>i.name===o.name&&i.tab===o.tab))){n.push(i);const l=this.dataUnit.getField(i.name);if(null==l?void 0:l.visible){null!=i.label&&""!==i.label||(i.label=l.label);let n=t.find((o=>o.tab===i.tab));if(null==n){let l=null;if(null!=this._formConfig.tabs){const o=this._formConfig.tabs.filter((o=>o.label===i.tab));o.length>0&&(l=o[0].visible)}const e=(null===(o=i.tab)||void 0===o?void 0:o.label)||i.tab;n=null!==l?{tab:e,groups:[],visible:l}:{tab:e,groups:[],visible:!0},t.push(n)}const e=n.groups.find((o=>o.group===i.group));if(e)e.fields.push(i);else{const o={group:i.group,fields:[i]};void 0===i.group?n.groups.unshift(o):n.groups.push(o)}}}return t}configureTabs(i){var o;return null==(null===(o=this._formConfig)||void 0===o?void 0:o.tabs)?i:(null==i&&(i=[]),this._formConfig.tabs.map((o=>i.find((i=>{var t,n;return(null===(t=o.label)||void 0===t?void 0:t.toLowerCase())===(null===(n=i.tab)||void 0===n?void 0:n.toLowerCase())}))||{tab:o.label,groups:[],visible:o.visible})).filter((i=>null!=(null==i?void 0:i.tab))))}configureTabMain(i){return null==i&&(i=[]),null==i.find((i=>i.tab===c.main))&&i.unshift({tab:c.main,groups:[],visible:!0}),i}updateTabs(){const i=this.getTabsToSave();(null==i?void 0:i.length)>0&&(this._formConfig.tabs=i)}buildFormConfig(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let o=this.getLayoutFormConfig();o=this.configureTabs(o),o=this.configureTabMain(o),this._layoutFormConfig=o,this.updateTabs()}buildAvailableFields(){var i,o;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let t=[],n=this.dataUnit.metadata.fields;for(const i of this._formConfig.fields)t.push(i);const l=n.filter((({name:i,visible:o})=>!0===o&&!1===t.some((({name:o})=>o===i))));this._fieldsAvailable=l,this._listEnabledFields=l,null!=(null===(o=this._filterFieldsAvailable)||void 0===o?void 0:o.value)&&this.onFilterChange(this._filterFieldsAvailable.value)}setShowFormConfig(i){this.parentForm.setShowFormConfig(i)}changeTabSelected(i){this._tabSelected=i.index;const o=this._formContainer.querySelector("div#tab"+i.index);this._formContainer.querySelectorAll(".form-config__tab-content").forEach((i=>i.className="form-config__hide-content sc-snk-form-config")),o&&(o.className="form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium sc-snk-form-config")}onFilterChange(i){this._fieldsAvailable=s.applyStringFilter(i,this._listEnabledFields,!0,"label")}orderFieldsAvailable(i){return s.sortAlphabetically(i)}handleLabelCounter(i){const o=[this.getMessage("snkFormConfig.availableFields.labelNoFields"),this.getMessage("snkFormConfig.availableFields.labelOneField")];return i>1?`${i} ${this.getMessage("snkFormConfig.availableFields.labelAvailableFields")}`:o[i]}controlAddFieldConfig(i){var o;if(this._formConfigChanged=!1,null==i)return;null==this._formConfig.fields&&(this._formConfig.fields=[]);const t=this._formConfig.fields.filter((o=>o.name===i.name&&o.tab&&i.tab));t.length>0?t.forEach((o=>{o.name=i.name,o.label=i.label,o.required=i.required,o.readOnly=i.readOnly,o.group=i.group})):this._formConfig.fields.push({name:i.name,label:i.label,required:i.required,readOnly:i.readOnly,group:i.group,tab:null===(o=this._tabConfig)||void 0===o?void 0:o.selectedTab}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables()}controlRemoveFieldConfig(i,o){var t;this._formConfigChanged=!1,null!=i&&(this._formConfig.fields=null===(t=this._formConfig.fields)||void 0===t?void 0:t.filter((o=>o.name!==i.name)),this.loadFields(o),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables())}resetSortables(){this.controlSortableField(),this.controlSortableGroup()}handleFieldConfigChange(i,o=0){const{field:t,type:n}=i.detail;n!==f.configuration?n!==f.remove?n!==f.add||this.controlAddFieldConfig(t):this.controlRemoveFieldConfig(t,o):this.controlFieldConfig(t)}changeTabLabel(i){var o,t;const{value:n,newValue:l}=i.detail.detail;null===(o=this._formConfig.fields)||void 0===o||o.forEach((i=>{i.tab===n&&(i.tab=l)})),null===(t=this._formConfig.tabs)||void 0===t||t.forEach((i=>{i.label===n&&(i.label=l)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleDeleteTab(i){let o={canClose:!1,labelCancel:this.getMessage("snkFormConfig.confirm.labelNo"),labelConfirm:this.getMessage("snkFormConfig.confirm.labelYes"),btnConfirmDanger:!1};const t=this.getMessage("snkFormConfig.confirm.title"),n=this.getMessage("snkFormConfig.confirm.deleteTab");r.confirm(t,`${n} <b>${i.detail.label}</b>?`,"delete",d.WARN,o).then((o=>{var t;o&&(this._formConfig.tabs=null===(t=this._formConfig.tabs)||void 0===t?void 0:t.filter((o=>o.label!==i.detail.label)),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0)}))}changeHideTab(i){var o;null===(o=this._formConfig.tabs)||void 0===o||o.forEach((o=>{o.label===i.detail.label&&(o.visible=!o.visible)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleCanStartDragTab(){var i,o;const t=this._layoutFormConfig.map((i=>i.tab));for(const o of t)null===(i=this._currentGroupBoxes[o])||void 0===i||i.map((i=>null==i?void 0:i.cancelEdition()));null===(o=this._newGroupBoxes)||void 0===o||o.map((i=>null==i?void 0:i.cancelEdition()))}getMessage(i,o){return this._application.messagesBuilder.getMessage(i,o)}componentDidRender(){this.controlSortableField(),this.controlSortableGroup()}componentWillLoad(){this._application=a.getContextValue("__SNK__APPLICATION__"),this.loadConfig()}render(){var i,o,l,e;const s=this._formConfigOptions.map((i=>({value:i.origin,label:i.name})));return t(n,null,t("div",{class:"ez-row ez-padding--medium"},t("div",{class:"ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle"},t("ez-button",{mode:"icon",iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:()=>this.closeFormConfig()}),t("h1",{class:"ez-title ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),t("ez-actions-button",{class:"form-config__actions-button ez-margin-left--medium",value:null===(i=this._optionFormConfigSelected)||void 0===i?void 0:i.origin,showLabel:!0,iconName:"chevron-down",checkOption:!0,size:"small",actions:s,onEzAction:i=>this.controlSelectFormConfig(i)})),t("div",{class:"ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right"},!0===this._formConfigChanged&&!1===this._optionFormConfigChanged&&t("div",{class:"ez-row ez-align--middle ez-align--right"},t("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeConfig()}),t("ez-button",{label:"Salvar",class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.saveConfig()},t("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"save"}))),!0===this._optionFormConfigChanged&&t("div",{class:"ez-row ez-align--middle ez-align--right"},t("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeOptionConfig()}),t("ez-button",{label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.applyOptionConfig()})))),t("div",{class:"ez-row ez-padding--medium",ref:i=>this._sortableContainer=i},t("div",{class:"form-config__tab-container ez-col ez-col--sd-9 ez-col--tb-9 ez-padding-right--medium"},(null===(o=this._layoutFormConfig)||void 0===o?void 0:o.length)>0&&t("section",{class:"ez-box__container",ref:i=>this._formContainer=i},t("snk-tab-config",{ref:i=>this._tabConfig=i,selectedIndex:this._tabSelected,onEzTabChange:i=>this.changeTabSelected(i.detail),onEzOrderChange:i=>this.changeTabOrder(i.detail),onEditionTitleTab:i=>this.changeTabLabel(i),onDeleteTab:i=>this.handleDeleteTab(i),onHideTab:i=>this.changeHideTab(i),onCanStartDrag:()=>this.handleCanStartDragTab()},this._layoutFormConfig.map((i=>t("snk-tab",{tabKey:i.tab||"Geral",label:i.tab||this.getMessage("snkFormConfig.form.tabGeneral"),visible:i.visible})))),this._layoutFormConfig.map(((i,o)=>t("div",{id:"tab"+o,"data-draggable-parent":"group",class:this._tabSelected===o?"form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium":"form-config__hide-content"},i.groups.map(((o,n)=>o.group?(null==this._currentGroupBoxes[i.tab]&&(this._currentGroupBoxes[i.tab]=[]),t("ez-collapsible-box",{ref:o=>this._currentGroupBoxes[i.tab][n]=o,editable:!0,removable:!0,"header-size":"large",label:o.group,"icon-placement":"left","data-group-name":o.group,"data-draggable-parent":"field","data-draggable-element":"group",onEzRemove:()=>this.removeGroup(),onEzSaveEditLabel:i=>this.saveEditLabelGroup(i),onEzEditLabelMode:i=>this._editingTitleGroup=i.detail,conditionalSave:i=>this.checkGroupExists(i,n)},this.getFieldsByGroup(o))):t("div",{class:"ez-flex ez-flex--column ez-size-width--full"},t("label",{class:"ez-text ez-text--secondary ez-margin-vertical--small"},this.getMessage("snkFormConfig.form.subTitleInfo")),t("div",{id:"fieldsWithoutGroupContainer",class:"ez-row","data-draggable-parent":"field"},this.getFieldsByGroup(o)),t("hr",{class:"ez-divider-horizontal ez-margin-vertical--medium"})))),this.renderTempGroupByTab(i.tab)))),t("div",{class:"form-config__btn-add-group ez-row"},t("div",{class:"form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center"},t("ez-button",{label:this.getMessage("snkFormConfig.form.labelNewGroup"),class:"ez-padding-horizontal--small ez-button--primary",size:"small",onClick:()=>this.addNewGroup()},t("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"plus"})))))),t("div",{class:"form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3"},t("section",{class:"ez-box__container ez-col ez-col--pn-12"},t("h1",{class:"ez-title ez-title--large ez-title--primary ez-padding-bottom--medium"},this.getMessage("snkFormConfig.availableFields.title")),t("ez-filter-input",{ref:i=>this._filterFieldsAvailable=i,label:this.getMessage("snkFormConfig.availableFields.labelSearchField"),onEzChange:i=>this.onFilterChange(i.detail)}),t("span",{class:"ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium"},this.handleLabelCounter(null===(l=this._fieldsAvailable)||void 0===l?void 0:l.length)),(null===(e=this._layoutFormConfig)||void 0===e?void 0:e.length)>0&&t("div",{id:"fieldsAvailableContainer",class:"ez-row","data-draggable-parent":"field"},this.orderFieldsAvailable(this._fieldsAvailable).map((i=>t("div",{key:i.name,class:this._fieldsAvailableStyle,"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},t("snk-field-config",{onEzClickIcon:i=>{this.handleFieldConfigChange(i)},fieldConfig:i})))))))))}static get watchers(){return{formConfig:["observeFormConfig"]}}};u.style=".sc-snk-form-config-h{--snk-form-config__title--font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--snk-form-config__title--weight--large:var(--text-weight--large, 600);display:flex;flex-direction:column;position:absolute;top:0;left:0;width:100%;height:100%;z-index:var(--more-visible, 2);background-color:var(--background--xlight)}.form-config__title.sc-snk-form-config{display:flex;margin:0;line-height:1.3;font-family:var(--snk-form-config__title--font-pattern);font-weight:var(--snk-form-config__title--weight--large)}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--text--disable)}.ez-box__label-counter.sc-snk-form-config{font-weight:var(--text-weight--extra-small);margin-top:-7px}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:#FFFFFF}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--more-visible, 2)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:250px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #d2dce9);padding:var(--space--small, 6px)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:2px dashed var(--color-strokes, #DCE0E8);border-radius:var(--border--radius-small, 6px)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--space--large, 24px)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--space--large, 24px) var(--space--medium, 12px) 0}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--space--medium, 12px);border-radius:var(--border--radius-medium, 12px);border:2px solid var(--color-strokes, #DCE0E8);background-color:var(--background--body, #fafcff)}.form-config__left-icon--eye-off.sc-snk-form-config{padding-top:var(--space--medium, 8px)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:#FFFFFF}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -1))}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{transform:translate(calc(100% / 3 * -2))}}";export{u as snk_form_config}
@@ -0,0 +1 @@
1
+ const e={saveInfo:{clone:"Duplicação realizada!",insert:"Inclusão realizada!",update:"Aleração realizada!"},cancelInfo:{clone:"Duplicação descartada!",insert:"A inclusão descartada!",update:"A edição foi descartada!"},removeInfo:"Registro removido com sucesso!",cancelConfirmationTitle:"Aviso",cancelConfirmation:"As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",removeConfirmationTitle:"Excluir",removeConfirmation:"Deseja realmente excluir o registro atual?",forbidden:"Sem permissão",forbiddenUpdate:"Não é possível fazer alterações. Verifique as permissões de acesso.",forbiddenInsert:"Não é possível incluir. Verifique as permissões de acesso.",forbiddenClone:"Não é possível duplicar. Verifique as permissões de acesso.",forbiddenRemove:"Não é possível remover. Verifique as permissões de acesso."},a={addFilter:"Adicionar filtro",pinFilter:"Fixar filtro",unpinFilter:"Desfixar filtro",removeFilter:"Remover filtro",cleanFilter:"Limpar",applyFilter:"Aplicar",findFilter:"Buscar filtros...",findField:"Buscar filtros...",modalFindFilter:"Buscar filtro",emptyFiltersList:"Não há filtros disponíveis",emptyAppliedFiltersList:"Não há filtros aplicados",customFilter:"Filtro personalizado",defaultFilter:"Filtro padrão",failToLoadConfig:"Falha ao buscar configuração de filtros",clearAllFilters:"Limpar todos os filtros",successfullyCleaned:"Filtro limpo com sucesso!",activeFilter:"{{ACTIVE_FILTERS}} filtro aplicado",activeFilters:"{{ACTIVE_FILTERS}} filtros aplicados",noActiveFilters:"Nenhum filtro aplicado",modalDefaultFilterTitle:"Filtro padrão",modalInfoTextEditDefault:"Use o layout antigo para editar o seu filtro padrão, em breve traremos uma nova experiência.",modalInfoTextCreateDefault:"Use o layout antigo para criar o seu filtro padrão, em breve traremos uma nova experiência.",modalPersonalizedFilterTitle:"Filtro personalizado",modalPersonalizedFilterSubTitle:"Gerencie seus filtros",modalInfoTextCreateEditPersonalized:"Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",modalOkButtonLabel:"Aplicar",modalCancelButtonLabel:"Limpar"},o={titleUpdate:"Editar",titlePrevious:"Anterior",titleNext:"Próximo",titleRefresh:"Atualizar",titleClone:"Duplicar",titleRemove:"Excluir",titleMoreOptions:"Mais Opções",titleInsert:"Cadastrar",titleCancel:"Cancelar",titleSave:"Salvar",titleGridMode:"Modo Grade",titleFormMode:"Modo Formulário",titleConfigurator:"Configurações",forbidden:"Permissão não liberada"},r={errorArray:"CrudUtils.find deve receber um array de fields, ou uma lista separada por virgula."},i={title:{clone:"Duplicar registro",insert:"Cadastrar registro",update:"Alterar registro",clean:"{{ENTITY_NAME}}"},goBackTitle:"Voltar"},l={label:{nameField:"Nome do Campo *",typeValueDefault:"Tipo de valor padrão *",valueDefault:"Valor Padrão",clearDuplicate:"Limpar ao Duplicar",requiredField:"Campo Obrigatório",protectedField:"Campo Protegido"},options:{valueFixed:"Valor Fixo",variable:"Variável"}},s={title:"Configuração do formulário",applyConfig:"Aplicar configuração",availableFields:{title:"Campos disponíveis",labelNoFields:"Nenhum campo disponível",labelOneField:"1 campo disponível",labelAvailableFields:"Campos disponíveis",labelSearchField:"Procurar campo"},form:{subTitleInfo:"Inclua estes campos nos grupos ou deixe-os separados no topo do formulário!",labelDropField:"Arraste e solte um campo aqui",labelNewGroup:"Adicionar novo grupo",mainArea:"Área principal",tabGeneral:"Geral"},confirm:{title:"Aviso",deleteTab:"A aba selecionada será excluída.<br/><br/> Tem certeza que deseja excluir aba",cancel:"As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",exit:"Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",apply:"A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",group:"Não é possível salvar as configurações com um grupo vazio!",labelYes:"Sim",labelNo:"Não"},alert:{titleGroupExists:"Já existe um grupo com título",infoValidTitle:"Por favor, digite um título válido.",inTab:"na aba"}},t={titleRemove:"Remover",titleConfigurations:"Configurações",titleAdd:"Adicionar"},n={labelRename:"Renomear",labelHide:"Ocultar",labelShow:"Exibir",labelDelete:"Excluir"},d={msgSaveSuccessfully:"As configurações foram salvas com sucesso!"},u={titleConfigurations:"Configurações",subTitleModeConfig:"Modo de visualização",labelConfigGrid:"Configurar grade",labelConfigForm:"Configurar formulário",labelGrid:"Grade",labelForm:"Formulário"};class c{constructor(){this._defaults={snkDataUnit:e,snkForm:i,snkFormConfig:s,snkConfigOptions:l,snkTaskbar:o,snkConfigModal:u,snkFieldConfig:t,snkFilterBar:a,snkConfigurator:d,snkTabConfig:n,crudUtils:r},this._currentOperation=p.CLEAN,this.loadAppMessages().then((e=>{this._appMessages=e}),(e=>{console.info("O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages.js",e)}))}set currentOperation(e){this._currentOperation=e}getMessage(e,a){if(null==e)return;var o=e.split(".");let r=this.resolveMessage(o,this._appMessages);if(null==r&&(r=this.resolveMessage(o,this._defaults)),this.customMessageBuilder){const o=this.customMessageBuilder(e,r,a);r=o.message,a=o.params}return this.postProcess(r,a)}resolveMessage(e,a){if(null==a)return;const o=a[e[0]];return o?this.isOperationSensitive(o)?o[this._currentOperation]:1===e.length||null==o||"string"==typeof o?o:this.resolveMessage(e.slice(1),o):void 0}isOperationSensitive(e){return null!=e[p.CLONE]||null!=e[p.INSERT]||null!=e[p.UPDATE]||null!=e[p.CLEAN]}postProcess(e,a){if(e){const o=/(.*?)\{\{(.+?)\}\}/g;let r,i="",l=e;for(;null!==(r=o.exec(e));){const[o,s,t]=r,n=r.index+o.length;l=n<e.length?e.substring(n):"";let d=a?a[t]:void 0;null==d&&(d=""),i+=s+d}return i+l}return e}loadAppMessages(){return new Promise(((e,a)=>{const o="dev"!==window.applicationenv?`/${window.MGE_MODULE_NAME}/labsApps/${window.APPLICATION_NAME}/build/messages/appmessages.js`:"/messages/appmessages.js";import(o).then((a=>{e(a.default)})).catch((e=>{a(e)}))}))}}var p;!function(e){e.CLONE="clone",e.INSERT="insert",e.UPDATE="update",e.CLEAN="clean"}(p||(p={}));export{p as O,c as S}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as a,F as o,H as n,g as s}from"./p-9ba3df4c.js";import{d as e}from"./p-b6d6b172.js";import{ApplicationContext as c}from"@sankhyalabs/core";import{C as r,K as l,b,T as h}from"./p-a5b26df2.js";import"./p-112455b1.js";const g=class{constructor(a){t(this,a),this.ezTabChange=i(this,"ezTabChange",7),this.editionTitleTab=i(this,"editionTitleTab",7),this.deleteTab=i(this,"deleteTab",7),this.hideTab=i(this,"hideTab",7),this.ezOrderChange=i(this,"ezOrderChange",7),this.canStartDrag=i(this,"canStartDrag",7),this._refTabActions=[],this._actionsHide=[],this._actionsShow=[]}getMessage(t,i){return this._application.messagesBuilder.getMessage(t,i)}controlSortableTab(){this._sortableTab&&this._sortableTab.destroy(),this._sortableTab=new e.Sortable(this._hostElem.querySelectorAll('[data-draggable-parent="tab"]'),{draggable:'[data-draggable-element="tab"]',mirror:{constrainDimensions:!0}}),this._sortableTab.on(r.dragStart,(t=>this.controlStartDraggingTab(t))),this._sortableTab.on(r.dragStop,(t=>this.controlStopDraggingTab(t)))}controlStartDraggingTab(t){var i,a;const o=null===(i=null==t?void 0:t.dragEvent)||void 0===i?void 0:i.originalEvent,n=null==o?void 0:o.target,s=null===(a=null==n?void 0:n.tagName)||void 0===a?void 0:a.toUpperCase();!0===this._activeEditText||"EZ-ACTIONS-BUTTON"===s?null==t||t.cancel():this.canStartDrag.emit()}controlStopDraggingTab(t){t.data.newIndex!==t.data.oldIndex&&setTimeout((()=>{this.ezOrderChange.emit((t.data.newIndex||0)+1)}),500)}handleTabClick(t){this.selectedIndex=t.index,this._focusedIndex=t.index,this.selectedTab=t.tabKey,this.ezTabChange.emit(t),this.setFocusedBtn(!1,t.index),this.setFocusedTab(t.index)}handleSlotChange(t){const i=t.target.assignedElements()[0];i&&i.classList.add("tab-config__slot")}scrollBackward(){const t=this._scrollContainer;t&&(t.scrollLeft-=t.clientWidth)}scrollFoward(){const t=this._scrollContainer;if(t){let i=null;t.querySelectorAll(".tab-config__tab").forEach((a=>{a.getBoundingClientRect().right<t.clientWidth&&(i=a)})),t.scrollLeft=i.offsetLeft+i.offsetWidth}}updateScroll(){const t=this._scrollContainer;if(t){const{scrollWidth:i,clientWidth:a,scrollLeft:o}=t,n=i-a-Math.ceil(o);this._startHidden=t.scrollLeft>0,this._endHidden=n>0,this._startHidden?this._backwardButton.classList.remove("tab-config__hidden"):this._backwardButton.classList.add("tab-config__hidden"),this._endHidden?this._forwardButton.classList.remove("tab-config__hidden"):this._forwardButton.classList.add("tab-config__hidden")}}domScrollHandler(){window.clearTimeout(this._scrollCallBackScroll),this._scrollCallBackScroll=window.setTimeout((()=>{this.updateScroll()}),200)}setFocusedTab(t){window.clearTimeout(this._scrollCallBackFocus),this._scrollCallBackFocus=window.setTimeout((()=>{this._scrollContainer.querySelector(`#tab${t}`).scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}),200)}controlKeyEventEnter(t){t.preventDefault();const i=this._processedTabs[this._focusedIndex];this.handleTabClick(i),this.setFocusedTab(i.index)}controlKeyEventArrow(t){let i;if(t.key===l.arrowLeft)i=!1;else{if(t.key!==l.arrowRight)return;i=!0}this._focusedIndex=void 0===this._focusedIndex?!1===i?void 0!==this.selectedIndex?this.selectedIndex-1:void 0:void 0!==this.selectedIndex?this.selectedIndex+1:void 0:!1===i?this._focusedIndex-1:this._focusedIndex+1,this._focusedIndex<0?this._focusedIndex=0:this._focusedIndex>this._processedTabs.length-1&&(this._focusedIndex=this._processedTabs.length-1),this.setFocusedBtn(!0,this._focusedIndex),this.setFocusedTab(this._focusedIndex)}controlKeyEventEscape(t){t.preventDefault();const i=this._processedTabs[this.selectedIndex];this._focusedIndex=void 0,this.handleTabClick(i),this.setFocusedTab(this.selectedIndex)}setFocusedParam(t){!0!==this._activeEditText&&null!=t&&(t.key!==l.enter?t.key!==l.arrowLeft&&t.key!==l.arrowRight?t.key!==l.tab&&t.key!==l.escape||this.controlKeyEventEscape(t):this.controlKeyEventArrow(t):this.controlKeyEventEnter(t))}setFocusedBtn(t,i){this._scrollContainer.querySelectorAll(".tab-config__tab").forEach((a=>{a.classList.remove("tab-config__tab--is-focused"),a.id==="tab"+i&&t&&a.classList.add("tab-config__tab--is-focused")}))}getStyledLabel(t){const i=this._hostElem.querySelector(`#${t}`);if(null!=i)return{fontSize:window.getComputedStyle(i).getPropertyValue("font-size"),fontWeight:window.getComputedStyle(i).getPropertyValue("font-weight"),fontFamily:window.getComputedStyle(i).getPropertyValue("font-family")}}cancelEditText(){var t;this._activeEditText=!1,null!=this._scrollContainer&&(null===(t=this._scrollContainer.querySelector(".tab-config__tab--is-active"))||void 0===t||t.focus())}handleActions(t,i){const{value:a}=t.detail;a===b.rename?(this._activeEditText=!0,this._activeEditTextIndex=i.index):a===b.hide||a===b.show?this.hideTab.emit(i):a===b.delete&&this.deleteTab.emit(i)}handleSaveEditionText(t){const{value:i,newValue:a}=t.detail;this._processedTabs.forEach((o=>{o.label===i&&(o.label=a,this.cancelEditText(),this.editionTitleTab.emit(t))}))}onHideActions(t){const i=this._refTabActions[t];i&&i.isOpened().then((t=>{t&&(null==i||i.hideActions())}))}componentWillLoad(){this._application=c.getContextValue("__SNK__APPLICATION__"),null!=this._application&&(this._actionsHide=[{value:b.rename,label:this.getMessage("snkTabConfig.labelRename")},{value:b.hide,label:this.getMessage("snkTabConfig.labelHide")},{value:b.delete,label:this.getMessage("snkTabConfig.labelDelete")}],this._actionsShow=[{value:b.rename,label:this.getMessage("snkTabConfig.labelRename")},{value:b.show,label:this.getMessage("snkTabConfig.labelShow")},{value:b.delete,label:this.getMessage("snkTabConfig.labelDelete")}])}componentWillRender(){null==this._processedTabs&&(this._processedTabs=[],this.tabs&&this.tabs.split(",").forEach((t=>{t=t.trim(),this._processedTabs.push({label:t,tabKey:t,index:this._processedTabs.length})})),this._hostElem.querySelectorAll("snk-tab").forEach((t=>{const i=t.getAttribute("tabKey"),a=t.getAttribute("label")!==h.main?t.getAttribute("label"):this.getMessage("snkFormConfig.form.mainArea"),o=t.hasAttribute("visible"),n={label:a,tabKey:i,index:this._processedTabs.length,visible:o},s=t.firstChild;s&&(s.setAttribute("slot","tab"+n.index),this._hostElem.appendChild(s)),this._processedTabs.push(n)})))}componentDidRender(){this.updateScroll(),this.controlSortableTab()}render(){return a(n,null,a("button",{class:"tab-config__backward-button",ref:t=>this._backwardButton=t,onClick:()=>this.scrollBackward()}),a("div",{class:"tab-config__lower-bar"}),a("div",{class:"tab-config__scroll",ref:t=>this._scrollContainer=t,onScroll:()=>this.domScrollHandler(),onKeyDown:t=>this.setFocusedParam(t),"data-draggable-parent":"tab"},this._processedTabs.map(((t,i)=>{const n="tab"+i,s=i===this.selectedIndex||this.selectedTab&&t.tabKey===this.selectedTab;return s&&(this.selectedTab=t.tabKey,this.selectedIndex=i),a("button",{id:n,class:"tab-config__tab"+(s?" tab-config__tab--is-active":""),onClick:()=>this.handleTabClick(t),onDblClick:()=>{this._activeEditText=!0,this._activeEditTextIndex=i},"data-draggable-element":i>0?"tab":"",onMouseLeave:()=>this.onHideActions(i)},!0===this._activeEditText&&this._activeEditTextIndex===i&&i>0||a(o,null,i>0&&a("ez-icon",{iconName:t.leftIcon||"drag-indicator",class:"tab-config__left-icon"}),!1===t.visible&&i>0&&a("ez-icon",{iconName:t.leftIcon||"eye-off",class:"tab-config__left-icon tab-config__left-icon--eye-off"}),a("span",{class:"tab-config__tab-label"+(!1===t.visible&&i>0?" tab-config__tab-label-disabled":""),title:t.label},t.label),i>0&&a("ez-actions-button",{class:"tab-config__actions-button",size:"small",ref:t=>this._refTabActions[i]=t,actions:!1===t.visible?this._actionsShow:this._actionsHide,isTransparent:!0,arrowActive:!0,onEzAction:i=>this.handleActions(i,t)}),a("slot",{name:n,onSlotchange:t=>{this.handleSlotChange(t)}})),!0===this._activeEditText&&i>0&&this._activeEditTextIndex===i&&a("ez-text-edit",{value:t.label,styled:this.getStyledLabel(n),class:"tab-config__edit-text",onSaveEdition:t=>this.handleSaveEditionText(t),onCancelEdition:()=>this.cancelEditText()}))}))),a("button",{class:"tab-config__forward-button",ref:t=>this._forwardButton=t,onClick:()=>this.scrollFoward()}))}get _hostElem(){return s(this)}};g.style='@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>\');--snk-tab-config--forward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\');display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__scroll--start-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.tab-config__scroll--middle.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__scroll--end-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background:var(--color--disable-primary);border:2px solid var(--color--disable-primary)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--text--primary, #626e82);font-family:var(--font-pattern, "Sora, Algerian");font-size:var(--title--small, 14px);padding:var(--space--small, 6px) var(--space--medium, 12px)}.tab-config__tab.sc-snk-tab-config:focus,.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{outline:none}.tab-config__tab--is-active.sc-snk-tab-config{position:relative;color:var(--color--primary, #008561)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--color--secondary, #383c45)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--color--primary, #008561)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:"";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.tab-config__tab--is-focused.sc-snk-tab-config{border:1px dashed var(--color--primary, #000000c5)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config ez-icon.sc-snk-tab-config{--ez-icon--color:var(--color--secondary-700, #1C1D22)}.tab-config__backward-button.sc-snk-tab-config{left:0px;box-shadow:10px 10px 5px 5px white;background:white}.tab-config__forward-button.sc-snk-tab-config{box-shadow:10px 10px 5px 20px white;background:white}.tab-config__forward-button.sc-snk-tab-config::after,.tab-config__backward-button.sc-snk-tab-config::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.tab-config__forward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--forward-icon);mask-image:var(--snk-tab-config--forward-icon)}.tab-config__backward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--backward-icon);mask-image:var(--snk-tab-config--backward-icon)}.tab-config__forward-button.sc-snk-tab-config:hover::after,.tab-config__backward-button.sc-snk-tab-config:hover::after{background-color:var(--color--primary, #4e4e4e)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--color--primary, #4e4e4e)}.tab-config__hidden.sc-snk-tab-config{display:none}.tab-config__scroll.sc-snk-tab-config::-webkit-scrollbar{display:none}.tab-config__left-icon.sc-snk-tab-config{padding-right:var(--space--small);--ez-icon--color:var(--text--disable)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--text--disable, #AFB6C0)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--space--small)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{visibility:visible}.tab-config__tab--is-active.sc-snk-tab-config .tab-config__right-icon.sc-snk-tab-config{visibility:visible;--ez-icon--color:var(--color--primary)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--color--secondary, #383c45)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--color--primary)}.tab-config__actions-button.sc-snk-tab-config{--ez-actions-button__btn-action--min-width:100px;visibility:hidden;opacity:0;transition:visibility 1s linear,opacity 0.3s linear}.tab-config__tab.sc-snk-tab-config:hover .tab-config__actions-button.sc-snk-tab-config{visibility:visible;opacity:1;transition:visibility 0.2s linear, opacity 0.10s linear}[data-draggable-element].sc-snk-tab-config{cursor:grab}.tab-config__tab-label-disabled.sc-snk-tab-config{color:var(--text--disable, #AFB6C0)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--space--small, 6px)}';export{g as snk_tab_config}
@@ -0,0 +1 @@
1
+ import{r as i,c as s,h as t,g as e}from"./p-9ba3df4c.js";import{ObjectUtils as o,ApplicationContext as a}from"@sankhyalabs/core";import{C as r}from"./p-d50651a3.js";import{T as n}from"./p-03f9c407.js";const h=class{constructor(t){i(this,t),this.exit=s(this,"exit",7),this.actionClick=s(this,"actionClick",7),this.configChanged=s(this,"configChanged",7),this._renderTimer=500,this._taskbarProcessor=new n({"snkForm.regular":["PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","GRID_MODE","CONFIGURATOR","INSERT"],"snkForm.finish_edition":["CANCEL","SAVE"]}),this._editionFormConfig={},this._insertionFormConfig={},this._showFormConfig=!1}async setShowFormConfig(i){this._showFormConfig=i}async setConfig(i){this._editionFormConfig={},setTimeout((()=>{this._editionFormConfig=null!=i?i:{},this.loadInsertionConfig()}),this._renderTimer)}getFormConfig(){return this._dataState&&this._dataState.insertionMode?this._insertionFormConfig:this._editionFormConfig}exitForm(){this._dataUnit.isDirty()?this._dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}getDisabledButtons(){const i=[];return this._dataState.hasPrevious||i.push("PREVIOUS"),this._dataState.hasNext||i.push("NEXT"),i}loadInsertionConfig(){var i;if(this._dataUnit){const s=o.copy(this._editionFormConfig||{});s.fields=null===(i=s.fields)||void 0===i?void 0:i.filter((i=>{const s=this._dataUnit.getField(i.name);return!(null==s?void 0:s.readOnly)})),this._insertionFormConfig=s}}getMessage(i){return this._application.messagesBuilder.getMessage(i,this.getMessageParams())}getMessageParams(){var i;return(null===(i=this._dataState)||void 0===i?void 0:i.selectedRecords)?this._dataState.selectedRecords[0]:void 0}changeConfig(i){this.configChanged.emit(i)}componentDidRender(){r.setForm(this.configName,this._element)}componentWillLoad(){this._application=a.getContextValue("__SNK__APPLICATION__");let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.loadInsertionConfig():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail,this.loadInsertionConfig()})),this._snkDataUnit.addEventListener("dataStateChange",(i=>{this._dataState=i.detail}));break}i=i.parentElement}}componentWillRender(){var i;const s=(null===(i=this._dataState)||void 0===i?void 0:i.isDirty)?"snkForm.finish_edition":"snkForm.regular",t=[];this._dataState&&this._dataState.hasPrevious||t.push("PREVIOUS"),this._dataState&&this._dataState.hasNext||t.push("NEXT"),this._taskbarProcessor.process(s,this.taskbarManager,this._dataState,t)}render(){var i;if(this._dataUnit&&this._dataState)return t("section",{class:"snk-form"},t("div",{class:"snk-form__header snk-form__header--fixed ez-row"},t("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6",key:"formHeader"},t("ez-button",{title:this.getMessage("snkForm.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small",onClick:()=>this.exitForm()}),t("h1",{class:"ez-title ez-title--primary ez-title--xlarge ez-align--middle"},this.getMessage("snkForm.title"))),t("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right"},t("snk-taskbar",{key:"formTaskbar",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.actionsList,primaryButton:(null===(i=this._dataState)||void 0===i?void 0:i.isDirty)?"SAVE":"INSERT",dataUnit:this._dataUnit}))),t("section",null,t("div",{class:"ez-row"},t("div",{class:"ez-col ez-col--sd-12"},t("ez-form",{key:"ezForm"+this._snkDataUnit.entityName,dataUnit:this._dataUnit,config:this.getFormConfig(),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&t("snk-form-config",{dataUnit:this._dataUnit,formConfig:this.getFormConfig(),parentForm:this._element,onConfigChange:i=>{this.changeConfig(i.detail)}})))))}get _element(){return e(this)}};h.style=".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}.snk-form__form--hidden.sc-snk-form{display:none}";export{h as snk_form}
@@ -1 +1 @@
1
- import{r as s,h as r}from"./p-fac2b6a9.js";import{ApplicationContext as t}from"@sankhyalabs/core";import{F as e}from"./p-9dd2b8cb.js";const i=class{constructor(r){s(this,r)}ezChangeListener(s){this.value=this._searchInput.value}doSearch(s,r){const e=t.getContextValue("__SNK__APPLICATION__");return new Promise(((t,i)=>{e.executePreparedSearch(s,r,this.config.props.searchContext).then((s=>{t(s)})).catch((s=>{i(s)}))}))}async show(){this._searchInput.setFocus()}render(){if(this.config&&this.config.type===e.SEARCH)return r("ez-search",{suppressEmptyOption:!0,value:this.config.value,label:this.config.label,ref:s=>this._searchInput=s,optionLoader:({mode:s,argument:r})=>this.doSearch(s,r)})}};export{i as snk_filter_search}
1
+ import{r as s,h as r}from"./p-9ba3df4c.js";import{ApplicationContext as t}from"@sankhyalabs/core";import{F as e}from"./p-9dd2b8cb.js";const i=class{constructor(r){s(this,r)}ezChangeListener(s){this.value=this._searchInput.value}doSearch(s,r){const e=t.getContextValue("__SNK__APPLICATION__");return new Promise(((t,i)=>{e.executePreparedSearch(s,r,this.config.props.searchContext).then((s=>{t(s)})).catch((s=>{i(s)}))}))}async show(){this._searchInput.setFocus()}render(){if(this.config&&this.config.type===e.SEARCH)return r("ez-search",{suppressEmptyOption:!0,value:this.config.value,label:this.config.label,ref:s=>this._searchInput=s,optionLoader:({mode:s,argument:r})=>this.doSearch(s,r)})}};export{i as snk_filter_search}
@@ -0,0 +1,26 @@
1
+ import{c as e,a as t}from"./p-112455b1.js";import{ErrorException as n,WarningException as i,StringUtils as r,ObjectUtils as s}from"@sankhyalabs/core";var o,u=e((function(e,n){var i="undefined"!=typeof self?self:t,r=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();!function(e){!function(t){var n="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function p(e){var t=new FileReader,n=v(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&r&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=v(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i<t.length;i++)n[i]=String.fromCharCode(t[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){var n,i,r=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(i=(n=t.method||this.method||"GET").toUpperCase(),b.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}})),t}function O(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},y.call(w.prototype),y.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];O.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(i,s){var o=new w(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function a(){u.abort()}u.onload=function(){var e,t,n={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();t.append(i,r)}})),t)};n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL"),i(new O("response"in u?u.response:u.responseText,n))},u.onerror=function(){s(new TypeError("Network request failed"))},u.ontimeout=function(){s(new TypeError("Network request failed"))},u.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},u.open(o.method,o.url,!0),"include"===o.credentials?u.withCredentials=!0:"omit"===o.credentials&&(u.withCredentials=!1),"responseType"in u&&r&&(u.responseType="blob"),o.headers.forEach((function(e,t){u.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",a),u.onreadystatechange=function(){4===u.readyState&&o.signal.removeEventListener("abort",a)}),u.send(void 0===o._bodyInit?null:o._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=f,e.Request=w,e.Response=O),t.Headers=f,t.Request=w,t.Response=O,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var s=r;(n=s.fetch).default=s.fetch,n.fetch=s.fetch,n.Headers=s.Headers,n.Request=s.Request,n.Response=s.Response,e.exports=n})),a=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}})),c=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}})),l=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){let i=0,r=1;for(const s of e.body.matchAll(n)){if("number"==typeof s.index||(0,c.invariant)(!1),s.index>=t)break;i=s.index+s[0].length,r+=1}return{line:r,column:t+1-i}};const n=/\r\n|[\n\r]/g})),h=e((function(e,t){function n(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,s=t.line-1,o=t.line+(e.locationOffset.line-1),u=t.column+(1===t.line?n:0),a=`${e.name}:${o}:${u}\n`,c=r.split(/\r\n|[\n\r]/g),l=c[s];if(l.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e<l.length;e+=80)n.push(l.slice(e,e+80));return a+i([[`${o} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return a+i([[o-1+" |",c[s-1]],[`${o} |`,l],["|","^".padStart(u)],[`${o+1} |`,c[s+1]]])}function i(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return n(e.source,(0,l.getLocation)(e.source,e.start))},t.printSourceLocation=n})),f=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};class n extends Error{constructor(e,...t){var r,s,o;const{nodes:u,source:c,positions:h,path:f,originalError:d,extensions:v}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=f?f:void 0,this.originalError=null!=d?d:void 0,this.nodes=i(Array.isArray(u)?u:u?[u]:void 0);const p=i(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=c?c:null==p||null===(s=p[0])||void 0===s?void 0:s.source,this.positions=null!=h?h:null==p?void 0:p.map((e=>e.start)),this.locations=h&&c?h.map((e=>(0,l.getLocation)(c,e))):null==p?void 0:p.map((e=>(0,l.getLocation)(e.source,e.start)));const m=(0,a.isObjectLike)(null==d?void 0:d.extensions)?null==d?void 0:d.extensions:void 0;this.extensions=null!==(o=null!=v?v:m)&&void 0!==o?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=d&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,h.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,h.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function i(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=n})),d=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new f.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}})),v=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Token=t.QueryDocumentKeys=t.OperationTypeNode=t.Location=void 0,t.isNode=function(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&s.has(t)};class n{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}t.Location=n;class i{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}t.Token=i;const r={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=r;const s=new Set(Object.keys(r));var o;t.OperationTypeNode=o,function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(o||(t.OperationTypeNode=o={}))})),p=e((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))})),m=e((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))})),y=e((function(e,t){function n(e){return e>=48&&e<=57}function i(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=i,t.isNameContinue=function(e){return i(e)||n(e)||95===e},t.isNameStart=function(e){return i(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}})),b=e((function(e,t){function n(e){let t=0;for(;t<e.length&&(0,y.isWhiteSpace)(e.charCodeAt(t));)++t;return t}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringLines=function(e){var t;let i=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let t=0;t<e.length;++t){var o;const u=e[t],a=n(u);a!==u.length&&(r=null!==(o=r)&&void 0!==o?o:t,s=t,0!==t&&a<i&&(i=a))}return e.map(((e,t)=>0===t?e:e.slice(i))).slice(null!==(t=r)&&void 0!==t?t:0,s+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,i=!0,r=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:i&&(i=n),t=!1}return!t&&(!i||!r)},t.printBlockString=function(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every((e=>0===e.length||(0,y.isWhiteSpace)(e.charCodeAt(0)))),o=n.endsWith('\\"""'),u=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=u||a,l=!(null!=t&&t.minimize)&&(!r||e.length>70||c||s||o);let h="";const f=r&&(0,y.isWhiteSpace)(e.charCodeAt(0));return(l&&!f||s)&&(h+="\n"),h+=n,(l||c)&&(h+="\n"),'"""'+h+'"""'}})),w=e((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))})),g=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===w.TokenKind.BANG||e===w.TokenKind.DOLLAR||e===w.TokenKind.AMP||e===w.TokenKind.PAREN_L||e===w.TokenKind.PAREN_R||e===w.TokenKind.SPREAD||e===w.TokenKind.COLON||e===w.TokenKind.EQUALS||e===w.TokenKind.AT||e===w.TokenKind.BRACKET_L||e===w.TokenKind.BRACKET_R||e===w.TokenKind.BRACE_L||e===w.TokenKind.PIPE||e===w.TokenKind.BRACE_R};class n{constructor(e){const t=new v.Token(w.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==w.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=c(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===w.TokenKind.COMMENT);return e}}function i(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function r(e,t){return s(e.charCodeAt(t))&&o(e.charCodeAt(t+1))}function s(e){return e>=55296&&e<=56319}function o(e){return e>=56320&&e<=57343}function u(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return w.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function a(e,t,n,i,r){return new v.Token(t,n,i,e.line,1+n-e.lineStart,r)}function c(e,t){const n=e.source.body,s=n.length;let o=t;for(;o<s;){const t=n.charCodeAt(o);switch(t){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 35:return l(e,o);case 33:return a(e,w.TokenKind.BANG,o,o+1);case 36:return a(e,w.TokenKind.DOLLAR,o,o+1);case 38:return a(e,w.TokenKind.AMP,o,o+1);case 40:return a(e,w.TokenKind.PAREN_L,o,o+1);case 41:return a(e,w.TokenKind.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return a(e,w.TokenKind.SPREAD,o,o+3);break;case 58:return a(e,w.TokenKind.COLON,o,o+1);case 61:return a(e,w.TokenKind.EQUALS,o,o+1);case 64:return a(e,w.TokenKind.AT,o,o+1);case 91:return a(e,w.TokenKind.BRACKET_L,o,o+1);case 93:return a(e,w.TokenKind.BRACKET_R,o,o+1);case 123:return a(e,w.TokenKind.BRACE_L,o,o+1);case 124:return a(e,w.TokenKind.PIPE,o,o+1);case 125:return a(e,w.TokenKind.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?D(e,o):p(e,o)}if((0,y.isDigit)(t)||45===t)return h(e,o,t);if((0,y.isNameStart)(t))return S(e,o);throw(0,d.syntaxError)(e.source,o,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":i(t)||r(n,o)?`Unexpected character: ${u(e,o)}.`:`Invalid character: ${u(e,o)}.`)}return a(e,w.TokenKind.EOF,s,s)}function l(e,t){const n=e.source.body,s=n.length;let o=t+1;for(;o<s;){const e=n.charCodeAt(o);if(10===e||13===e)break;if(i(e))++o;else{if(!r(n,o))break;o+=2}}return a(e,w.TokenKind.COMMENT,t,o,n.slice(t+1,o))}function h(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),(0,y.isDigit)(s))throw(0,d.syntaxError)(e.source,r,`Invalid number, unexpected digit after 0: ${u(e,r)}.`)}else r=f(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=f(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=f(e,r,s),s=i.charCodeAt(r)),46===s||(0,y.isNameStart)(s))throw(0,d.syntaxError)(e.source,r,`Invalid number, expected digit but got: ${u(e,r)}.`);return a(e,o?w.TokenKind.FLOAT:w.TokenKind.INT,t,r,i.slice(t,r))}function f(e,t,n){if(!(0,y.isDigit)(n))throw(0,d.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${u(e,t)}.`);const i=e.source.body;let r=t+1;for(;(0,y.isDigit)(i.charCodeAt(r));)++r;return r}function p(e,t){const n=e.source.body,s=n.length;let o=t+1,c=o,l="";for(;o<s;){const s=n.charCodeAt(o);if(34===s)return l+=n.slice(c,o),a(e,w.TokenKind.STRING,t,o+1,l);if(92!==s){if(10===s||13===s)break;if(i(s))++o;else{if(!r(n,o))throw(0,d.syntaxError)(e.source,o,`Invalid character within String: ${u(e,o)}.`);o+=2}}else{l+=n.slice(c,o);const t=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?m(e,o):g(e,o):E(e,o);l+=t.value,o+=t.size,c=o}}throw(0,d.syntaxError)(e.source,o,"Unterminated string.")}function m(e,t){const n=e.source.body;let r=0,s=3;for(;s<12;){const e=n.charCodeAt(t+s++);if(125===e){if(s<5||!i(r))break;return{value:String.fromCodePoint(r),size:s}}if(r=r<<4|T(e),r<0)break}throw(0,d.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+s)}".`)}function g(e,t){const n=e.source.body,r=O(n,t+2);if(i(r))return{value:String.fromCodePoint(r),size:6};if(s(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=O(n,t+8);if(o(e))return{value:String.fromCodePoint(r,e),size:12}}throw(0,d.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function O(e,t){return T(e.charCodeAt(t))<<12|T(e.charCodeAt(t+1))<<8|T(e.charCodeAt(t+2))<<4|T(e.charCodeAt(t+3))}function T(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function E(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,d.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function D(e,t){const n=e.source.body,s=n.length;let o=e.lineStart,c=t+3,l=c,h="";const f=[];for(;c<s;){const s=n.charCodeAt(c);if(34===s&&34===n.charCodeAt(c+1)&&34===n.charCodeAt(c+2)){h+=n.slice(l,c),f.push(h);const i=a(e,w.TokenKind.BLOCK_STRING,t,c+3,(0,b.dedentBlockStringLines)(f).join("\n"));return e.line+=f.length-1,e.lineStart=o,i}if(92!==s||34!==n.charCodeAt(c+1)||34!==n.charCodeAt(c+2)||34!==n.charCodeAt(c+3))if(10!==s&&13!==s)if(i(s))++c;else{if(!r(n,c))throw(0,d.syntaxError)(e.source,c,`Invalid character within String: ${u(e,c)}.`);c+=2}else h+=n.slice(l,c),f.push(h),13===s&&10===n.charCodeAt(c+1)?c+=2:++c,h="",l=c,o=c;else h+=n.slice(l,c),l=c+1,c+=4}throw(0,d.syntaxError)(e.source,c,"Unterminated string.")}function S(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(!(0,y.isNameContinue)(e))break;++r}return a(e,w.TokenKind.NAME,t,r,n.slice(t,r))}t.Lexer=n})),O=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}})),T=e((function(e,t){function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const i=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,i)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const i=Math.min(10,e.length),r=e.length-i,s=[];for(let r=0;r<i;++r)s.push(n(e[r],t));return 1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`),"["+s.join(", ")+"]"}(e,i);return function(e,t){const i=Object.entries(e);return 0===i.length?"{}":t.length>2?"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+i.map((([e,i])=>e+": "+n(i,t))).join(", ")+" }"}(e,i)}(e,t);default:return String(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])}})),E=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0,t.instanceOf=function(e,t){return e instanceof t}})),D=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,E.instanceOf)(e,n)};class n{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,O.devAssert)(!1,`Body must be a string. Received: ${(0,T.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,O.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,O.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=n})),S=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new n(e,t).parseDocument()},t.parseConstValue=function(e,t){const i=new n(e,t);i.expectToken(w.TokenKind.SOF);const r=i.parseConstValueLiteral();return i.expectToken(w.TokenKind.EOF),r},t.parseType=function(e,t){const i=new n(e,t);i.expectToken(w.TokenKind.SOF);const r=i.parseTypeReference();return i.expectToken(w.TokenKind.EOF),r},t.parseValue=function(e,t){const i=new n(e,t);i.expectToken(w.TokenKind.SOF);const r=i.parseValueLiteral(!1);return i.expectToken(w.TokenKind.EOF),r};class n{constructor(e,t={}){const n=(0,D.isSource)(e)?e:new D.Source(e);this._lexer=new g.Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(w.TokenKind.NAME);return this.node(e,{kind:m.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m.Kind.DOCUMENT,definitions:this.many(w.TokenKind.SOF,this.parseDefinition,w.TokenKind.EOF)})}parseDefinition(){if(this.peek(w.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===w.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,d.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(w.TokenKind.BRACE_L))return this.node(e,{kind:m.Kind.OPERATION_DEFINITION,operation:v.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(w.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:m.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(w.TokenKind.NAME);switch(e.value){case"query":return v.OperationTypeNode.QUERY;case"mutation":return v.OperationTypeNode.MUTATION;case"subscription":return v.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(w.TokenKind.PAREN_L,this.parseVariableDefinition,w.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:m.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(w.TokenKind.DOLLAR),this.node(e,{kind:m.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:m.Kind.SELECTION_SET,selections:this.many(w.TokenKind.BRACE_L,this.parseSelection,w.TokenKind.BRACE_R)})}parseSelection(){return this.peek(w.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,i;return this.expectOptionalToken(w.TokenKind.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:m.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(w.TokenKind.PAREN_L,e?this.parseConstArgument:this.parseArgument,w.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(w.TokenKind.COLON),this.node(t,{kind:m.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(w.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(w.TokenKind.NAME)?this.node(e,{kind:m.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:m.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:m.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:m.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case w.TokenKind.BRACKET_L:return this.parseList(e);case w.TokenKind.BRACE_L:return this.parseObject(e);case w.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:m.Kind.INT,value:t.value});case w.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:m.Kind.FLOAT,value:t.value});case w.TokenKind.STRING:case w.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case w.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:m.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:m.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:m.Kind.NULL});default:return this.node(t,{kind:m.Kind.ENUM,value:t.value})}case w.TokenKind.DOLLAR:if(e){if(this.expectToken(w.TokenKind.DOLLAR),this._lexer.token.kind===w.TokenKind.NAME)throw(0,d.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:m.Kind.STRING,value:e.value,block:e.kind===w.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:m.Kind.LIST,values:this.any(w.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),w.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:m.Kind.OBJECT,fields:this.any(w.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),w.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(w.TokenKind.COLON),this.node(t,{kind:m.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(w.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(w.TokenKind.AT),this.node(t,{kind:m.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(w.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(w.TokenKind.BRACKET_R),t=this.node(e,{kind:m.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(w.TokenKind.BANG)?this.node(e,{kind:m.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:m.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(w.TokenKind.STRING)||this.peek(w.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(w.TokenKind.BRACE_L,this.parseOperationTypeDefinition,w.TokenKind.BRACE_R);return this.node(e,{kind:m.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(w.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:m.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:m.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:m.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(w.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(w.TokenKind.BRACE_L,this.parseFieldDefinition,w.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(w.TokenKind.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:m.Kind.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(w.TokenKind.PAREN_L,this.parseInputValueDef,w.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(w.TokenKind.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(w.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:m.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:m.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:m.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(w.TokenKind.EQUALS)?this.delimitedMany(w.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:m.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(w.TokenKind.BRACE_L,this.parseEnumValueDefinition,w.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:m.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,d.syntaxError)(this._lexer.source,this._lexer.token.start,`${i(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:m.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(w.TokenKind.BRACE_L,this.parseInputValueDef,w.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===w.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(w.TokenKind.BRACE_L,this.parseOperationTypeDefinition,w.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:m.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:m.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:m.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:m.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:m.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:m.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:m.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(w.TokenKind.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:m.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(w.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(p.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new v.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,d.syntaxError)(this._lexer.source,t.start,`Expected ${r(e)}, found ${i(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==w.TokenKind.NAME||t.value!==e)throw(0,d.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${i(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===w.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,d.syntaxError)(this._lexer.source,t.start,`Unexpected ${i(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==w.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,d.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function i(e){const t=e.value;return r(e.kind)+(null!=t?` "${t}"`:"")}function r(e){return(0,g.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=n})),j=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,i)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function i(e){return r[e.charCodeAt(0)]}const r=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]})),x=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=i,t.getVisitFn=function(e,t,n){const{enter:r,leave:s}=i(e,t);return n?s:r},t.visit=function(e,t,r=v.QueryDocumentKeys){const s=new Map;for(const e of Object.values(m.Kind))s.set(e,i(t,e));let o,u,a,c=Array.isArray(e),l=[e],h=-1,f=[],d=e;const p=[],y=[];do{h++;const e=h===l.length,i=e&&0!==f.length;if(e){if(u=0===y.length?void 0:p[p.length-1],d=a,a=y.pop(),i)if(c){d=d.slice();let e=0;for(const[t,n]of f){const i=t-e;null===n?(d.splice(i,1),e++):d[i]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[e,t]of f)d[e]=t}h=o.index,l=o.keys,f=o.edits,c=o.inArray,o=o.prev}else if(a){if(u=c?h:l[h],d=a[u],null==d)continue;p.push(u)}let m;if(!Array.isArray(d)){var b,w;(0,v.isNode)(d)||(0,O.devAssert)(!1,`Invalid AST Node: ${(0,T.inspect)(d)}.`);const i=e?null===(b=s.get(d.kind))||void 0===b?void 0:b.leave:null===(w=s.get(d.kind))||void 0===w?void 0:w.enter;if(m=null==i?void 0:i.call(t,d,u,a,p,y),m===n)break;if(!1===m){if(!e){p.pop();continue}}else if(void 0!==m&&(f.push([u,m]),!e)){if(!(0,v.isNode)(m)){p.pop();continue}d=m}}var g;void 0===m&&i&&f.push([u,d]),e?p.pop():(o={inArray:c,index:h,keys:l,edits:f,prev:o},c=Array.isArray(d),l=c?d:null!==(g=r[d.kind])&&void 0!==g?g:[],h=-1,f=[],a&&y.push(a),a=d)}while(void 0!==o);return 0!==f.length?f[f.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),r=Object.create(null);for(const s of Object.values(m.Kind)){let o=!1;const u=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:r}=i(e[t],s);o||(o=null!=n||null!=r),u[t]=n,a[t]=r}o&&(r[s]={enter(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const a=null===(s=u[o])||void 0===s?void 0:s.apply(e[o],i);if(!1===a)t[o]=r;else if(a===n)t[o]=n;else if(void 0!==a)return a}},leave(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const r=null===(s=a[o])||void 0===s?void 0:s.apply(e[o],i);if(r===n)t[o]=n;else if(void 0!==r&&!1!==r)return r}else t[o]===r&&(t[o]=null)}})}return r};const n=Object.freeze({});function i(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}t.BREAK=n})),k=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,x.visit)(e,n)};const n={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>i(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=s("(",i(e.variableDefinitions,", "),")"),n=i([e.operation,i([e.name,t]),i(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+s(" = ",n)+s(" ",i(r," "))},SelectionSet:{leave:({selections:e})=>r(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:u}){const a=s("",e,": ")+t;let c=a+s("(",i(n,", "),")");return c.length>80&&(c=a+s("(\n",o(i(n,"\n")),"\n)")),i([c,i(r," "),u]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+s(" ",i(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>i(["...",s("on ",e),i(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:o})=>`fragment ${e}${s("(",i(n,", "),")")} on ${t} ${s("",i(r," ")," ")}`+o},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,b.printBlockString)(e):(0,j.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+i(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+i(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+s("(",i(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>s("",e,"\n")+i(["schema",i(t," "),r(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i(["scalar",t,i(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:u})=>s("",e,"\n")+i(["type",t,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:a})=>s("",e,"\n")+t+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+": "+r+s(" ",i(a," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:o})=>s("",e,"\n")+i([t+": "+n,s("= ",r),i(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:u})=>s("",e,"\n")+i(["interface",t,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>s("",e,"\n")+i(["union",t,i(n," "),s("= ",i(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:o})=>s("",e,"\n")+i(["enum",t,i(n," "),r(o)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i([t,i(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:o})=>s("",e,"\n")+i(["input",t,i(n," "),r(o)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:a})=>s("",e,"\n")+"directive @"+t+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+(r?" repeatable":"")+" on "+i(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>i(["extend schema",i(e," "),r(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>i(["extend scalar",e,i(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend type",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend interface",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>i(["extend union",e,i(t," "),s("= ",i(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>i(["extend enum",e,i(t," "),r(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>i(["extend input",e,i(t," "),r(n)]," ")}};function i(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function r(e){return s("{\n",o(i(e,"\n")),"\n}")}function s(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function o(e){return s(" ",e.replace(/\n/g,"\n "))}function u(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}})),$=function(e){var t=e.name,n=e.type;this.uri=e.uri,this.name=t,this.type=n},I=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof $},N=function e(t,n,i){var r;void 0===n&&(n=""),void 0===i&&(i=I);var s=new Map;function o(e,t){var n=s.get(t);n?n.push.apply(n,e):s.set(t,e)}if(i(t))r=null,o([n],t);else{var u=n?n+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)r=Array.prototype.map.call(t,(function(e,t){return o([""+u+t],e),null}));else if(Array.isArray(t))r=t.map((function(t,n){var r=e(t,""+u+n,i);return r.files.forEach(o),r.clone}));else if(t&&t.constructor===Object)for(var a in r={},t){var c=e(t[a],""+u+a,i);c.files.forEach(o),r[a]=c.clone}else r=t}return{clone:r,files:s}},A=I,q="object"==typeof self?self.FormData:window.FormData,F=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultJsonSerializer=void 0,t.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}})),_=e((function(e,n){var i=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0});var r=i(q),s=function(e){return A(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};n.default=function(e,t,n,i){void 0===i&&(i=F.defaultJsonSerializer);var o=N({query:e,variables:t,operationName:n},"",s),u=o.clone,a=o.files;if(0===a.size){if(!Array.isArray(e))return i.stringify(u);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var c=e.reduce((function(e,n,i){return e.push({query:n,variables:t?t[i]:void 0}),e}),[]);return i.stringify(c)}var l=new("undefined"==typeof FormData?r.default:FormData);l.append("operations",i.stringify(u));var h={},f=0;return a.forEach((function(e){h[++f]=e})),l.append("map",i.stringify(h)),f=0,a.forEach((function(e,t){l.append(""+ ++f,t)})),l}})),U=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchRequestsExtendedArgs=t.parseRawRequestExtendedArgs=t.parseRequestExtendedArgs=t.parseBatchRequestArgs=t.parseRawRequestArgs=t.parseRequestArgs=void 0,t.parseRequestArgs=function(e,t,n){return e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0}},t.parseRawRequestArgs=function(e,t,n){return e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0}},t.parseBatchRequestArgs=function(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}},t.parseRequestExtendedArgs=function(e,t,n,i){return e.document?e:{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}},t.parseRawRequestExtendedArgs=function(e,t,n,i){return e.query?e:{url:e,query:t,variables:n,requestHeaders:i,signal:void 0}},t.parseBatchRequestsExtendedArgs=function(e,t,n){return e.documents?e:{url:e,documents:t,requestHeaders:n,signal:void 0}}})),C=e((function(e,n){var i,r=t&&t.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.ClientError=void 0;var s=function(e){function t(n,i){var r=this,s=t.extractMessage(n)+": "+JSON.stringify({response:n,request:i});return r=e.call(this,s)||this,Object.setPrototypeOf(r,t.prototype),r.response=n,r.request=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return r(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);n.ClientError=s})),R=e((function(e,n){var i=t&&t.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=t&&t.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{a(i.next(e))}catch(e){s(e)}}function u(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,u)}a((i=i.apply(e,t||[])).next())}))},s=t&&t.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLWebSocketClient=void 0;var o="ping",u="pong",a="complete",c=function(){function e(e,t,n){this._type=e,this._payload=t,this._id=n}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){var e={type:this.type};return null!=this.id&&null!=this.id&&(e.id=this.id),null!=this.payload&&null!=this.payload&&(e.payload=this.payload),JSON.stringify(e)},enumerable:!1,configurable:!0}),e.parse=function(t,n){var i=JSON.parse(t),r=i.id;return new e(i.type,n(i.payload),r)},e}(),l=function(){function e(e,t){var n=this,l=t.onInit,d=t.onAcknowledged,v=t.onPing,p=t.onPong;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.onopen=function(){return r(n,void 0,void 0,(function(){var t,n,i,r;return s(this,(function(s){switch(s.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},n=(t=e).send,i=h,l?[4,l()]:[3,2];case 1:return r=s.sent(),[3,3];case 2:r=null,s.label=3;case 3:return n.apply(t,[i.apply(void 0,[r]).text]),[2]}}))}))},e.onclose=function(){n.socketState.acknowledged=!1,n.socketState.subscriptions={}},e.onerror=function(e){console.error(e)},e.onmessage=function(t){try{var r=(void 0===y&&(y=function(e){return e}),c.parse(t.data,y));switch(r.type){case"connection_ack":return void(n.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(n.socketState.acknowledged=!0,d&&d(r.payload)));case o:return void(v?v(r.payload).then((function(t){return e.send(f(t).text)})):e.send(f(null).text));case u:return void(p&&p(r.payload))}if(!n.socketState.acknowledged)return;if(null==r.id||!n.socketState.subscriptions[r.id])return;var s=n.socketState.subscriptions[r.id],l=s.query,h=s.variables,m=s.subscriber;switch(r.type){case"next":return!r.payload.errors&&r.payload.data&&m.next&&m.next(r.payload.data),void(r.payload.errors&&m.error&&m.error(new C.ClientError(i(i({},r.payload),{status:200}),{query:l,variables:h})));case"error":return void(m.error&&m.error(new C.ClientError({errors:r.payload,status:200},{query:l,variables:h})));case a:return m.complete&&m.complete(),void delete n.socketState.subscriptions[r.id]}}catch(t){console.error(t),e.close(1006)}var y;e.close(4400,"Unknown graphql-ws message.")}}return e.prototype.makeSubscribe=function(e,t,n,i){var r,s,o=this,u=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[u]={query:e,variables:n,subscriber:i},this.socket.send((r=u,s={query:e,operationName:t,variables:n},new c("subscribe",s,r)).text),function(){o.socket.send(function(e){return new c(a,void 0,e)}(u).text),delete o.socketState.subscriptions[u]}},e.prototype.rawRequest=function(e,t){var n=this;return new Promise((function(i,r){var s;n.rawSubscribe(e,{next:function(e,t){return s={data:e,extensions:t}},error:r,complete:function(){return i(s)}},t)}))},e.prototype.request=function(e,t){var n=this;return new Promise((function(i,r){var s;n.subscribe(e,{next:function(e){return s=e},error:r,complete:function(){return i(s)}},t)}))},e.prototype.subscribe=function(e,t,n){var i=V.resolveRequestDocument(e);return this.makeSubscribe(i.query,i.operationName,n,t)},e.prototype.rawSubscribe=function(e,t,n){return this.makeSubscribe(e,void 0,n,t)},e.prototype.ping=function(e){this.socket.send(function(e){return new c(o,e,void 0)}(e).text)},e.prototype.close=function(){this.socket.close(1e3)},e.PROTOCOL="graphql-transport-ws",e}();function h(e){return new c("connection_init",e)}function f(e){return new c(u,e,void 0)}n.GraphQLWebSocketClient=l})),V=e((function(e,n){var i=t&&t.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=t&&t.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=t&&t.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=t&&t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return s(t,e),t},a=t&&t.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{a(i.next(e))}catch(e){s(e)}}function u(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,u)}a((i=i.apply(e,t||[])).next())}))},c=t&&t.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},l=t&&t.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},h=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLWebSocketClient=n.gql=n.resolveRequestDocument=n.batchRequests=n.request=n.rawRequest=n.GraphQLClient=n.ClientError=void 0;var f=o(u),d=f,v=h(_);Object.defineProperty(n,"ClientError",{enumerable:!0,get:function(){return C.ClientError}});var p=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof d.Headers?t=function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){t[e[0]]=e[1]})):t=e),t},m=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},y=function(e){var t=e.url,n=e.query,r=e.variables,s=e.operationName,o=e.headers,u=e.fetch,l=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=v.default(n,r,s,l.jsonSerializer),[4,u(t,i({method:"POST",headers:i(i({},"string"==typeof e?{"Content-Type":"application/json"}:{}),o),body:e},l))];case 1:return[2,a.sent()]}}))}))},b=function(e){var t=e.url,n=e.query,r=e.variables,s=e.operationName,o=e.headers,u=e.fetch,l=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=function(e){var t=e.query,n=e.variables,i=e.operationName,r=e.jsonSerializer;if(!Array.isArray(t)){var s=["query="+encodeURIComponent(m(t))];return n&&s.push("variables="+encodeURIComponent(r.stringify(n))),i&&s.push("operationName="+encodeURIComponent(i)),s.join("&")}if(void 0!==n&&!Array.isArray(n))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,i){return e.push({query:m(t),variables:n?r.stringify(n[i]):void 0}),e}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:n,variables:r,operationName:s,jsonSerializer:l.jsonSerializer}),[4,u(t+"?"+e,i({method:"GET",headers:o},l))];case 1:return[2,a.sent()]}}))}))},w=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,n){return a(this,void 0,void 0,(function(){var r,s,o,u,a,h,d,v,m,y;return c(this,(function(){return r=U.parseRawRequestArgs(e,t,n),o=(s=this.options).headers,a=void 0===(u=s.fetch)?f.default:u,d=void 0===(h=s.method)?"POST":h,v=l(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(v.signal=r.signal),y=D(r.query).operationName,[2,g({url:m,query:r.query,variables:r.variables,headers:i(i({},p(j(o))),p(r.requestHeaders)),operationName:y,fetch:a,method:d,fetchOptions:v})]}))}))},e.prototype.request=function(e,t,n){return a(this,void 0,void 0,(function(){var r,s,o,u,a,h,d,v,m,y,b;return c(this,(function(c){switch(c.label){case 0:return r=U.parseRequestArgs(e,t,n),o=(s=this.options).headers,a=void 0===(u=s.fetch)?f.default:u,d=void 0===(h=s.method)?"POST":h,v=l(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(v.signal=r.signal),y=D(r.document),b=y.operationName,[4,g({url:m,query:y.query,variables:r.variables,headers:i(i({},p(j(o))),p(r.requestHeaders)),operationName:b,fetch:a,method:d,fetchOptions:v})];case 1:return[2,c.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return a(this,void 0,void 0,(function(){var n,r,s,o,u,a,h,d,v,m,y;return c(this,(function(c){switch(c.label){case 0:return n=U.parseBatchRequestArgs(e,t),s=(r=this.options).headers,u=void 0===(o=r.fetch)?f.default:o,h=void 0===(a=r.method)?"POST":a,d=l(r,["headers","fetch","method"]),v=this.url,void 0!==n.signal&&(d.signal=n.signal),m=n.documents.map((function(e){return D(e.document).query})),y=n.documents.map((function(e){return e.variables})),[4,g({url:v,query:m,variables:y,headers:i(i({},p(j(s))),p(n.requestHeaders)),operationName:void 0,fetch:u,method:h,fetchOptions:d})];case 1:return[2,c.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var n,i=this.options.headers;return i?i[e]=t:this.options.headers=((n={})[e]=t,n),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function g(e){var t=e.url,n=e.query,r=e.variables,s=e.headers,o=e.operationName,u=e.fetch,h=e.method,f=void 0===h?"POST":h,d=e.fetchOptions;return a(this,void 0,void 0,(function(){var e,a,h,v,p,m,w,g,O,E;return c(this,(function(c){switch(c.label){case 0:return e="POST"===f.toUpperCase()?y:b,a=Array.isArray(n),[4,e({url:t,query:n,variables:r,operationName:o,headers:s,fetch:u,fetchOptions:d})];case 1:return[4,T(h=c.sent(),d.jsonSerializer)];case 2:if(v=c.sent(),p=a&&Array.isArray(v)?!v.some((function(e){return!e.data})):!!v.data,m=!v.errors||"all"===d.errorPolicy||"ignore"===d.errorPolicy,h.ok&&m&&p)return w=h.headers,g=h.status,O=l(v,["errors"]),E="ignore"===d.errorPolicy?O:v,[2,i(i({},a?{data:E}:E),{headers:w,status:g})];throw new C.ClientError(i(i({},"string"==typeof v?{error:v}:v),{status:h.status,headers:h.headers}),{query:n,variables:r})}}))}))}function O(e,t,n,r){return a(this,void 0,void 0,(function(){var s;return c(this,(function(){return s=U.parseRequestExtendedArgs(e,t,n,r),[2,new w(s.url).request(i({},s))]}))}))}function T(e,t){return void 0===t&&(t=F.defaultJsonSerializer),a(this,void 0,void 0,(function(){var n,i,r;return c(this,(function(s){switch(s.label){case 0:return e.headers.forEach((function(e,t){"content-type"===t.toLowerCase()&&(n=e)})),n&&n.toLowerCase().startsWith("application/json")?(r=(i=t).parse,[4,e.text()]):[3,2];case 1:return[2,r.apply(i,[s.sent()])];case 2:return[2,e.text()]}}))}))}function E(e){var t,n=void 0,i=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===i.length&&(n=null===(t=i[0].name)||void 0===t?void 0:t.value),n}function D(e){if("string"==typeof e){var t=void 0;try{t=E(S.parse(e))}catch(e){}return{query:e,operationName:t}}var n=E(e);return{query:k.print(e),operationName:n}}function j(e){return"function"==typeof e?e():e}n.GraphQLClient=w,n.rawRequest=function(e,t,n,r){return a(this,void 0,void 0,(function(){var s;return c(this,(function(){return s=U.parseRawRequestExtendedArgs(e,t,n,r),[2,new w(s.url).rawRequest(i({},s))]}))}))},n.request=O,n.batchRequests=function(e,t,n){return a(this,void 0,void 0,(function(){var r;return c(this,(function(){return r=U.parseBatchRequestsExtendedArgs(e,t,n),[2,new w(r.url).batchRequests(i({},r))]}))}))},n.default=O,n.resolveRequestDocument=D,n.gql=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.reduce((function(e,n,i){return""+e+n+(i in t?t[i]:"")}),"")},Object.defineProperty(n,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return R.GraphQLWebSocketClient}})}));class M{static getQueryParams(e){const t=new Map,n=/[?&]?([^=]+)=([^&]*)/g;let i;for(e=(e=window.unescape(e)).split("+").join(" ");i=n.exec(e);)t.set(window.decodeURIComponent(i[1]),i[2]);return t.set("urlBase",this.getUrlBase()),window.moduleID&&window.URIServiceBroker&&(t.set("moduleID",window.moduleID),t.set("URIServiceBroker",window.URIServiceBroker)),t}static getUrlBase(){return window.mock_url?window.mock_url:`${location.protocol}//${location.hostname}${location.port?":"+location.port:""}`}}class L{constructor(){this.GRAPHQL_PATH="/mge/graphql",this.watingRequestsById=new Map}static get(){if(!L.instance){L.instance=new L;const e=document.querySelector(this.appTagName);null===e?L.instance.resume():(e.addEventListener("applicationLoading",(()=>L.instance.pause())),e.addEventListener("applicationLoaded",(()=>L.instance.resume())))}return this.instance}static addRequestListener(e){L.requestListener.indexOf(e)<0&&L.requestListener.push(e)}static removeRequestListener(e){const t=L.requestListener.indexOf(e);t>-1&&L.requestListener.splice(t,1)}processErrorInfo(e){var t,r;const s="Falha detectada",o=e[0];if(!(o.length>0))return new n(s,"Não há informações sobre o erro");{const e=o[0],u=(null==e?void 0:e.message)?null==e?void 0:e.message:"Não há mensagem de erro",a=(null===(t=null==e?void 0:e.extensions)||void 0===t?void 0:t.level)?e.extensions.level:"ERROR",c=(null===(r=null==e?void 0:e.extensions)||void 0===r?void 0:r.code)?e.extensions.code:"";switch(a){case"WARNING":return new i(s,u,c);default:return new n(s,u,c)}}}async callGraphQL(e){var t;const n=this.getReqKey(e);return e.queryID=n,e.values.queryID=n,this.ready?new Promise((async(t,i)=>{let r=this.getQueryTemplate(e);const s=await this.fecthGrapql([{document:r,variables:e.values}]);s.errors.length>0?i(this.processErrorInfo(s.errors)):t(s.data[0][n])})):(this.watingRequestsById.has(n)||this.watingRequestsById.set(n,new P(e)),null===(t=this.getWatingRequest(n))||void 0===t?void 0:t.promise)}resolveURL(){return M.getUrlBase()}getContext(e){var t;const n=M.getQueryParams(location.search);return{baseUrl:`${this.resolveURL()}/${e}/service.sbr`,appName:"SankhyaBlocks",mgeSession:`${window.skw_session||n.get("mgeSession")}`,globalID:"85C0093DFA240EAB699B4E47A10215BD",resourceID:window.resourceID||(null===(t=window.workspace)||void 0===t?void 0:t.resourceID)}}async callServiceBroker(e,t){return new Promise(((n,i)=>{const r=e.split("@"),[s,o]=2===r.length?r:["mge",e],u=this.getContext(s),a=`${u.baseUrl}?serviceName=${o}&counter=21&application=${u.appName}&outputType=json&preventTransform=false&mgeSession=${u.mgeSession}&resourceID=${u.resourceID}&globalID=${u.globalID}&allowConcurrentCalls=true`;document.cookie=`JSESSIONID=${u.mgeSession};`;const c=new XMLHttpRequest;L.requestListener.forEach((e=>e.onRequestStart({url:a,requestBody:t}))),c.open("POST",a,!0),c.withCredentials=!0,c.send(t),c.onreadystatechange=function(){if(4==this.readyState&&200==this.status){try{const e=JSON.parse(this.responseText);1==e.status?n(e.responseBody):i(e)}catch(e){console.warn(`callServiceBroker error to parser response to JSON ${e}`),i(this.responseText)}L.requestListener.forEach((e=>e.onRequestEnd({url:a,requestBody:t})))}else 4==this.readyState&&200!=this.status&&(i(this.responseText),L.requestListener.forEach((e=>e.onRequestEnd({url:a,requestBody:t}))))}}))}getReqKey(e){return window.btoa(r.hashCode(`${e.query}${JSON.stringify(e.values||"")}`)).replace(/=/g,"")}getQueryTemplate(e){return(e.query||"").replaceAll("$queryAlias$",e.queryID)}getWatingRequest(e){return this.watingRequestsById.get(e)}pause(){this.ready=!1}async resume(){if(this.ready=!0,this.watingRequestsById.size>0){const e=[];let t;this.watingRequestsById.forEach((async t=>{let n=this.getQueryTemplate(t.request);e.push({document:n,variables:Object.assign({},t.request.values)})}));let i=[],r=[];t=await this.fecthGrapql(e),i=t.data,r=t.errors,r.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var i;((null===(i=this.getWatingRequest(t.request.variables[t.index].queryID))||void 0===i?void 0:i.reject)||Promise.reject)(new n("Falha detectada",t.message))}))})),i.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(e))||void 0===n?void 0:n.resolve)||Promise.resolve)(t)}))})),this.watingRequestsById.clear()}}async fecthGrapql(e){let t,i=[],r=[],s=`${this.resolveURL()+this.GRAPHQL_PATH}`;window.skw_session&&(s+=`?mgeSession=${window.skw_session}`),L.requestListener.forEach((t=>t.onRequestStart({url:s,requestBody:e})));try{t=await V.batchRequests(s,e,{"Content-Type":`application/json; charset=${window.SERVER_ENCODING||"UTF-8"}`}),t.forEach(((t,n)=>{var s;(null===(s=null==t?void 0:t.errors)||void 0===s?void 0:s.length)>0?r.push(t.errors.map((t=>this.normalizeErrorResponse(t,e,n)))):i.push(t.data)}))}catch(o){if(this.isHttpError(o))throw L.requestListener.forEach((t=>t.onRequestEnd({url:s,requestBody:e}))),new n("Falha de comunicação",o.message);{t=o.response;const e=o.request;Object.entries(t).forEach((([t,n])=>{n.errors?r.push(n.errors.map((n=>(n.request=e,n.index=Number(t),n)))):n.data&&i.push(n.data)}))}}return L.requestListener.forEach((t=>t.onRequestEnd({url:s,requestBody:e}))),{data:i,errors:r}}isHttpError(e){var t;return!e.response&&!e.request||(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)>=300}normalizeErrorResponse(e,t,n){const i=Object.assign({},t[n]),{variables:r}=i;return i.variables=[],i.variables[n]=r,e.request=i,e.index=Number(n),e}}L.appTagName="snk-application",L.requestListener=[];class P{constructor(e){this._resolve=()=>{},this._reject=()=>{},this._request=void 0,this._request=e,this._promisse=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promisse}get request(){return this._request}}class B{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",V.gql`query($name: String!) {
2
+ $queryAlias$: fetchResource(name: $name){
3
+ resource
4
+ }
5
+ }`),this.templateByQuery.set("saveResource",V.gql`mutation($resource: InputResource!) {
6
+ $queryAlias$: saveResource(resource: $resource){
7
+ name
8
+ resource
9
+ }
10
+ }`)}loadResource(e){if(B._loadingResource.has(e))return B._loadingResource.get(e);const t=new Promise(((t,n)=>{L.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchResource")}).then((n=>{t(null==n?void 0:n.resource),B._loadingResource.delete(e)})).catch((t=>{n(t),B._loadingResource.delete(e)}))}));return B._loadingResource.set(e,t),t}saveResource(e,t){return new Promise(((n,i)=>{L.get().callGraphQL({values:{resource:{name:t,resource:JSON.stringify(e)}},query:this.templateByQuery.get("saveResource")}).then((e=>{n(e)})).catch((e=>{i(e)}))}))}}B._loadingResource=new Map;class G extends B{constructor(){super(),this.queryConfig=new Map,this.buildTemplatesConfig()}buildTemplatesConfig(){this.queryConfig.set("fetchUserAvailableConfigs",V.gql`query($name: String!) {
11
+ $queryAlias$: fetchUserAvailableConfigs(name: $name){
12
+ name
13
+ origin
14
+ key
15
+ }
16
+ }`),this.queryConfig.set("fetchLegacyConfig",V.gql`query($name: String!) {
17
+ $queryAlias$: fetchLegacyConfig(name: $name){
18
+ name
19
+ resource
20
+ }
21
+ }`),this.queryConfig.set("fetchDefaultConfig",V.gql`query($name: String!) {
22
+ $queryAlias$: fetchDefaultConfig(name: $name){
23
+ name
24
+ resource
25
+ }
26
+ }`)}loadFormConfig(e,t){return new Promise(((n,i)=>{this.loadResource(`cfg://form/${t}/${e}`).then((t=>{if(t){const e=JSON.parse(t),{tabs:i,fields:r}=e;if(i){const e=new Map(i.map((e=>[e.label,e])));null==r||r.forEach((t=>{var n;return t.tab=(null===(n=e.get(this.getTabName(t.tab)))||void 0===n?void 0:n.label)||e.get(this.getTabName(t.tab))}))}e.fields=null==r?void 0:r.map((e=>{if("readonly"in e){const t=e.readonly;delete e.readonly,e.readOnly=t}return e})),n(e)}else i(`Sem configuração pro formulário "${e}".`)})).catch((e=>{i(e)}))}))}getTabName(e){return"object"==typeof e?e.label:e}saveConfig(e,t,n){const i=`cfg://form/${n}/${t}`;return new Promise(((t,n)=>{this.saveResource(e,i).then((e=>{t(e)})).catch((e=>{n(e)}))}))}fetchUserAvailableConfigs(e,t){const n=`cfg://form/${t}/${e}`;return new Promise(((e,t)=>{L.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchUserAvailableConfigs")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}fetchLegacyConfig(e,t){const n=`cfg://form/${t}/${e}`;return new Promise(((e,t)=>{L.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchLegacyConfig")}).then((t=>{e(s.stringToObject((null==t?void 0:t.resource)||""))})).catch((e=>{t(e)}))}))}fetchDefaultConfig(e,t){const n=`cfg://form/${t}/${e}`;return new Promise(((e,t)=>{L.get().callGraphQL({values:{name:n},query:this.queryConfig.get("fetchDefaultConfig")}).then((t=>{e(s.stringToObject((null==t?void 0:t.resource)||""))})).catch((e=>{t(e)}))}))}}!function(e){e.USER="USER",e.DEFAULT="DEFAULT",e.SHARED="SHARED"}(o||(o={}));export{L as D,G as F,B as R,M as U,o as a,V as d}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as e,g as s,H as r}from"./p-9ba3df4c.js";import{ObjectUtils as l,ApplicationContext as n,DataType as a,StringUtils as o,ErrorException as h,FloatingManager as c,ArrayUtils as d}from"@sankhyalabs/core";import{ApplicationUtils as u,CheckMode as m}from"@sankhyalabs/ezui/dist/collection/utils";import{C as f,c as b}from"./p-a5b26df2.js";import{C as k}from"./p-d50651a3.js";import{F as p}from"./p-9dd2b8cb.js";import{ModalAction as _,ModalButtonStatus as v}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{toString as g}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{T as F,V as z,A as x,b as y,a as T}from"./p-d9fbb26f.js";const C=b.grid,L=b.form,I=class{constructor(e){t(this,e),this.changeViewMode=i(this,"changeViewMode",7),this.name="snkConfigurator",this.enabled=!0}getMessage(t){return this._application.messagesBuilder.getMessage(t,{})}controlConfigModal(t){var i;null!=this._modal&&(this._modal.opened=t,null!=this._configModal&&(this._configModal.gridMode=null!=(null===(i=this._grid)||void 0===i?void 0:i.offsetParent)))}changeConfigModal(t){const i=null==t?void 0:t.detail;(null==i?void 0:i.openConfig)?(this.controlConfigModal(!1),this.callShowConfig(null==i?void 0:i.viewMode)):(null==i?void 0:i.viewMode)===C.index?this.changeViewMode.emit(C.name):(null==i?void 0:i.viewMode)===L.index&&this.changeViewMode.emit(L.name)}callShowConfig(t){t===C.index?(null==this._grid&&this.findGrid(),null!=this._grid&&this._grid.setShowGridConfig(!0)):t===L.index&&(null==this._form&&this.findForm(),null!=this._form&&this._form.setShowFormConfig(!0))}getConfigModal(){const t=document.createElement("ez-modal");t.modalSize="small",t.opened=!1,t.closeEsc=!1,t.closeOutsideClick=!1,t.dataset.configuratorModal=this.name,t.addEventListener(f.closeModal,(()=>{this.controlConfigModal(!1)}));const i=document.createElement("snk-config-modal");return i.addEventListener(f.cancelConfig,(()=>{this.controlConfigModal(!1)})),i.addEventListener(f.changeConfig,(t=>{this.changeConfigModal(t)})),i.configName=this.configName,t.append(i),t}findConfigModal(){let t=document.body.querySelector(`[data-configurator-modal="${this.name}"]`);null==t&&(t=this.getConfigModal(),document.body.appendChild(t)),this._modal=t,this._configModal=t.querySelector("snk-config-modal")}findGrid(){null==this._grid&&(this._grid=k.getGrid(this.configName),null!=this._grid&&null==this._grid.dataset.eventConfigChanged&&(this._grid.dataset.eventConfigChanged="true",this._grid.addEventListener(f.configChanged,(t=>{this.saveConfig(t)}))))}findForm(){null==this._form&&(this._form=k.getForm(this.configName),null!=this._form&&null==this._form.dataset.eventConfigChanged&&(this._form.dataset.eventConfigChanged="true",this._form.addEventListener(f.configChanged,(t=>{this.saveConfig(t)}))))}saveConfig(t){const i=null==t?void 0:t.detail;null!=this._application&&null!=i&&(null!=(null==i?void 0:i.fields)?this._application.saveFormConfig(i,this.configName).then((t=>{null!=(null==t?void 0:t.resource)&&this.loadFormConfig(!0)})):null!=(null==i?void 0:i.columns)&&this._application.saveGridConfig(i).then((t=>{null!=(null==t?void 0:t.resource)&&this.setGridConfig(t.resource)})))}setGridConfig(t){if(null!=this._grid){const i=l.stringToObject(t);this._grid.setConfig(i).then((()=>{u.info(this.getMessage("snkConfigurator.msgSaveSuccessfully"),{iconName:"check"})}))}}loadGridConfig(){null!=this._application&&null!=this.configName&&null!=this._grid&&this._application.loadGridConfig(this.configName).then((t=>{this._grid.setConfig(t)}))}loadFormConfig(t=!1){null!=this._application&&null!=this.configName&&null!=this._form&&this._application.loadFormConfig(this.configName).then((i=>{this._form.setConfig(i).then((()=>{t&&u.info(this.getMessage("snkConfigurator.msgSaveSuccessfully"),{iconName:"check"})}))}))}loadConfig(){this._application=n.getContextValue("__SNK__APPLICATION__"),this.loadGridConfig(),this.loadFormConfig()}componentDidLoad(){this.findConfigModal(),this.findGrid(),this.findForm(),this.loadConfig()}render(){return e("ez-button",{mode:"icon",iconName:"settings-inverted",size:"small",enabled:this.enabled,onClick:()=>this.controlConfigModal(!0)})}get _element(){return s(this)}},w=class{constructor(i){t(this,i),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._pendingFilters=[],this._calculateSortIndex=t=>{let i=t.hardFixed?1e6:0;return t.hardFixed||(i+=t.fixed?1e5:0,i+=null==t.value?0:1e4,i+=this._updateSequence.lastIndexOf(t.id)+1),i},this._filtersComparator=(t,i)=>this._calculateSortIndex(i)-this._calculateSortIndex(t)}observeFilterConfig(t,i){if(null!=i&&null==t)this._loadingPending=!0,this._configUpdated=!0;else{const e=new Map(i?i.map((t=>[t.id,t])):void 0);t.forEach((t=>{const i=e.get(t.id);null!=i?(this._configUpdated=this._configUpdated||l.objectToString(i)!=l.objectToString(t),this._loadingPending=this._loadingPending||l.objectToString(i.value)!==l.objectToString(t.value)):(this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value)}))}this.processAfterUpdateConfig()}processPendingFilter(){this._pendingFilters.length>0&&null==this._currentPendingFilter&&(this._currentPendingFilter=this._element.querySelector("#filter-"+this._pendingFilters.pop()),this._currentPendingFilter&&this._currentPendingFilter.showUp(!0).then((()=>{this._currentPendingFilter=void 0,this.processPendingFilter()}))),null==this._currentPendingFilter&&this.processAfterUpdateConfig()}processAfterUpdateConfig(){this._pendingFilters.length>0||(this._loadingPending&&(this._loadingPending=!1,this.dataUnit.loadData()),this._configUpdated&&(this._configUpdated=!1,this._application.saveFilterBarConfig(this.filterConfig,this.configName)))}getMessage(t,i){return this._application.messagesBuilder.getMessage(t,i)}getFilter(t){var i;const e=[];return null===(i=this.filterConfig)||void 0===i||i.filter((t=>this.isActiveFilter(t))).forEach((t=>{const i=(t=>{switch(t.type){case p.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case p.BINARY_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.options.find((t=>t.name===e)).expression,params:[]}}(t);case p.MULTI_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:e}]}}(t);case p.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:l}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof l&&(l=new Date(l));const n=[];let o;return r&&l?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:a.DATE,value:g(a.DATE,l)},{name:`${i}.END`,dataType:a.DATE,value:g(a.DATE,r)})):l?(o=s.expression.onlystart,n.push({name:i,dataType:a.DATE,value:g(a.DATE,l)})):(o=s.expression.onlyend,n.push({name:i,dataType:a.DATE,value:g(a.DATE,r)})),{name:i,expression:o,params:n}}(t);case p.SEARCH:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:g(a.TEXT,e.value)}]}}(t);case p.TEXT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:g(a.TEXT,e)}]}}(t);case p.NUMBER:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.NUMBER,value:g(a.NUMBER,e)}]}}(t);case p.PERSONALIZED:return function(t){var i;const{id:e,value:s,props:r}=t;return{name:e,expression:r.expression,params:((null===(i=r.personalizedFilter)||void 0===i?void 0:i.parameters)||[]).map(((t,i)=>{const e=Array.from(s),r=t.dataType;let l=i>=0&&i<e.length?e[i]:null;return null!=l&&"object"==typeof l&&"value"in l&&(l=l.value),null==l&&r===a.BOOLEAN&&(l=!1),{name:t.name,dataType:r,value:"string"==typeof l?l:g(r,l)}}))}}(t);default:return}})(t);i&&e.push(i)})),e}isActiveFilter(t){return t.visible&&null!=t.value||t.type===p.DEFAULT_FILTER}registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&this.dataUnit.loadData()}itemFocused(t){this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach((i=>{i.id===t?"snk-filter-item"===i.tagName.toLowerCase()&&i.getClientRects()[0].x<0&&i.scrollIntoView({behavior:"auto",inline:"nearest"}):i.hideDetail()}))}getFilterItems(){const t=[],i=[];this.filterConfig.filter((t=>t.visible)).forEach(((s,r)=>{const l=`filter-${s.id}`,n=e("snk-filter-item",{onFocusin:()=>this.itemFocused(l),id:l,config:s,class:r>0?"ez-padding-left--medium":"",getMessage:(t,i)=>this.getMessage(t,i),key:s.id});return s.fixed||s.hardFixed?t.push(n):i.push(n),n}));const s=[];return s.push(...t),t.length>0&&i.length>0&&s.push(e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider"})),s.push(...i),s}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((i=>t.id!==i)),this._updateSequence.push(t.id))}normalizeItem(t){const i=Object.assign({},t);return["props","value","hardFixed","fixed"].forEach((t=>{null==i[t]&&delete i[t]})),""===t.value&&delete t.value,i}updateFilter(t){this.filterConfig=this.filterConfig.map((i=>(t=this.normalizeItem(t),i.id===t.id?(l.objectToString(i)!=l.objectToString(t)&&this.calculateUpdateSequence(t),t):i))).sort(((t,i)=>this._filtersComparator(t,i)))}getAddListItems(){const t=this.filterConfig.filter((t=>!t.visible&&this.isListable(t))),i=[{name:"PERSONALIZED_FILTER",label:this.getMessage("snkFilterBar.customFilter"),iconName:"tune",kind:"FOOTER"}];return this.allowDefault&&i.push({name:"DEFAULT_FILTER",label:this.getMessage("snkFilterBar.defaultFilter"),iconName:"configuration",kind:"FOOTER"}),t.map((t=>({name:t.id,label:t.label,kind:"FILTER",iconName:null}))).concat(i)}getActiveClass(){return this.filterConfig.filter((t=>null!=t.value)).length>0?"sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active":""}isListable(t,i=!1){return t.type!==p.DEFAULT_FILTER&&(i||t.type!==p.PERSONALIZED)}getAppliedListItems(){return this.filterConfig.filter((t=>this.isActiveFilter(t)&&this.isListable(t,!0))).map((t=>({name:t.id,label:t.label,kind:"FILTER",iconName:null}))).concat([{name:"CLEAR_ALL_FILTERS",label:this.getMessage("snkFilterBar.clearAllFilters"),iconName:"cleaning",kind:"FOOTER"}])}addPersonalizedFilters(t){const i={};t.forEach((t=>{t.active&&(i[t.id]=!0)})),this.filterConfig=this.filterConfig.map((t=>{var e,s;if(t.type===p.PERSONALIZED){const r=i[t.id];return!t.visible&&r&&(this.calculateUpdateSequence(t),null!=(null===(s=null===(e=t.props)||void 0===e?void 0:e.personalizedFilter)||void 0===s?void 0:s.parameters)&&this._pendingFilters.push(t.id)),this.normalizeItem(Object.assign(Object.assign({},t),r?{visible:r}:{visible:r,value:void 0,fixed:void 0}))}return t})).sort(((t,i)=>this._filtersComparator(t,i)))}openDefaultFilterModal(){const t=document.createElement("snk-filter-modal"),i=this.filterConfig.filter((t=>t.type===p.DEFAULT_FILTER));t.getMessage=(t,i)=>this.getMessage(t,i),t.modalTitle=this.getMessage("snkFilterBar.modalDefaultFilterTitle"),t.infoText=this.getMessage(0==i.length?"snkFilterBar.modalInfoTextCreateDefault":"snkFilterBar.modalInfoTextEditDefault"),t.items=i.map((t=>({id:t.id,active:!0,enabled:!1,label:t.label}))),t.processModalAction=()=>{this._application.closeModal()},this._application.showModal(t)}openPersonalizedModal(){const t=document.createElement("snk-filter-modal"),i=this.filterConfig.filter((t=>t.type===p.PERSONALIZED)).sort(((t,i)=>o.compare(t.label,i.label)));t.getMessage=(t,i)=>this.getMessage(t,i),t.modalTitle=this.getMessage("snkFilterBar.modalPersonalizedFilterTitle"),t.modalSubTitle=this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle"),t.okButtonLabel=this.getMessage("snkFilterBar.modalOkButtonLabel"),t.cancelButtonLabel=this.getMessage("snkFilterBar.modalCancelButtonLabel"),t.infoText=this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized"),t.useSearch=!0,t.items=i.map((t=>({id:t.id,active:t.visible,enabled:!0,label:t.label}))),t.processModalAction=i=>{i===_.CANCEL?t.items=t.items.map((t=>Object.assign(Object.assign({},t),{active:!1}))):(i===_.OK&&this.addPersonalizedFilters(t.items),this._application.closeModal())},this._application.showModal(t)}clearFilters(){let t=!1;return this.filterConfig=this.filterConfig.map((i=>(null!=i.value&&(t=!0),Object.assign(Object.assign({},i),{value:void 0})))).sort(((t,i)=>this._filtersComparator(t,i))),t}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}loadConfigFromApplication(){this._application.getFilterBarConfig(this.configName).then((t=>{this.filterConfig=t.map((t=>this.normalizeItem(t))),this.dataUnit&&this.dataUnit.loadData()})).catch((t=>{throw new h(this.getMessage("snkFilterBar.failToLoadConfig"),t)}))}attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const i=t;this.dataUnit=i.dataUnit,this.dataUnit?this.registryFilterProvider():i.addEventListener("dataUnitReady",(t=>{this.dataUnit=t.detail,this.registryFilterProvider()}));break}t=t.parentElement}else this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}addFilterHandler(t){const i=this.filterConfig.find((i=>i.id===t));"PERSONALIZED_FILTER"===t?this.openPersonalizedModal():"DEFAULT_FILTER"===t?this.openDefaultFilterModal():i&&(this._pendingFilters.push(t),this.updateFilter(Object.assign(Object.assign({},i),{visible:!0})))}appliedFilterHandler(t){if("CLEAR_ALL_FILTERS"===t)this.clearFilters()&&this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"),{iconName:"check"});else{const i=this._element.querySelector("#filter-"+t);i&&i.showUp(!0)}}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__"),this._application&&(this.loadPermitions(),this.loadConfigFromApplication()),this.attachDataUnit()}componentDidRender(){this.processPendingFilter()}render(){if(this.dataUnit&&this.filterConfig&&0!==this.filterConfig.length)return e(r,null,e("ez-scroller",{direction:"horizontal"},this.getFilterItems()),e("snk-filter-list",{id:"APPLIED_FILTERS",onFocusin:()=>this.itemFocused("APPLIED_FILTERS"),items:this.getAppliedListItems(),getMessage:(t,i)=>this.getMessage(t,i),emptyText:this.getMessage("snkFilterBar.emptyAppliedFiltersList"),findFilterText:this.getMessage("snkFilterBar.findFilter"),iconName:"filter",class:"ez-padding-left--medium",buttonClass:this.getActiveClass(),onSnkItemSelected:t=>this.appliedFilterHandler(t.detail)}),e("snk-filter-list",{id:"ADD_FILTER",onFocusin:()=>this.itemFocused("ADD_FILTER"),items:this.getAddListItems(),label:this.getMessage("snkFilterBar.addFilter"),getMessage:(t,i)=>this.getMessage(t,i),emptyText:this.getMessage("snkFilterBar.emptyFiltersList"),findFilterText:this.getMessage("snkFilterBar.findField"),class:"ez-padding-left--medium",onSnkItemSelected:t=>this.addFilterHandler(t.detail)},e("ez-icon",{slot:"leftIcon",class:"ez-padding-right--small",iconName:"plus"})))}get _element(){return s(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};w.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 2);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:"";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:100%;height:100%}';const E=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.innerClickCheck=(t,i)=>i.id!=c.MODAL_ELEMENT_ID||(this.detailIsVisible=!1,!1)}async showUp(t=!1){return new Promise((i=>{this._filterItemElement.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t&&(this._closeCallback=i,window.requestAnimationFrame((()=>{this._floatingID=c.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onDetailCloseCallback(),left:this.getScrollOffset(),useOverlay:!0}),this._popover.show(),this.detailIsVisible=!0})))}))}getScrollOffset(){const t=getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");return`calc(${this._filterItemElement.getBoundingClientRect().left}px + ${t})`}async hideDetail(){this.detailIsVisible&&null!=this._floatingID&&c.close(this._floatingID)}onDetailCloseCallback(){this._floatingID=void 0,this.detailIsVisible=!1,this._closeCallback&&(this._closeCallback(),this._closeCallback=void 0)}clickListener(t){[this._chipElement,this._leftIconElement,this._rightIconElement].includes(t.target)&&(t.target===this._rightIconElement&&null!=this.config.value?this.filterChange.emit(Object.assign(Object.assign({},this.config),{value:void 0})):this.detailIsVisible?this.hideDetail():this.showUp(!0),t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}mouseDownListener(t){this.detailIsVisible&&[this._chipElement,this._leftIconElement,this._rightIconElement].includes(t.target)&&(t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}getLabel(){const{type:t,value:i,label:e,props:s}=this.config;if(i){if(t===p.BINARY_SELECT){const[t,e]=s.options;if(t.name===i)return t.label;if(e.name===i)return e.label}if(t===p.MULTI_SELECT)return`${e}: ${s.options.find((t=>t.value===i)).label}`;if(t===p.PERIOD){let{end:t,start:s}=i;"string"==typeof t&&(t=new Date(t),t.setMinutes(t.getMinutes()+t.getTimezoneOffset())),"string"==typeof s&&(s=new Date(s),s.setMinutes(s.getMinutes()+s.getTimezoneOffset()));const r=new Intl.DateTimeFormat("pt-BR");return t&&s?`${e}: ${r.format(s)} a ${r.format(t)}`:s?`${e}: A partir de ${r.format(s)}`:t?`${e}: Até ${r.format(t)}`:e}return t===p.SEARCH?`${e}: ${i.value} - ${i.label}`:t===p.PERSONALIZED?e:`${e}: ${i}`}return e}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}filterChangeListener(){this.hideDetail()}getRightIconName(){return null!=this.config.value?"close":this.detailIsVisible?"chevron-up":"chevron-down"}getLeftIconName(){switch(this.config.type){case p.PERIOD:return"calendar";case p.PERSONALIZED:return"tune"}}render(){const t=this.getLeftIconName();return e(r,null,e("ez-chip",{ref:t=>this._chipElement=t,label:this.getLabel(),value:null!=this.config.value},t?e("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,class:"ez-padding-right--small",slot:"leftIcon"}):void 0,e("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),class:"ez-padding-left--small",slot:"rightIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("snk-filter-detail",{config:this.config,getMessage:this.getMessage,class:"sc-snk-filter-bar snk-filter__popover ez-padding--small",ref:t=>this._popover=t,key:this.config.id})))}get _filterItemElement(){return s(this)}},A=class{constructor(e){t(this,e),this.snkItemSelected=i(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=c.MODAL_ELEMENT_ID||(this._detailIsVisible=!1,!1)}showDetail(){this._preselection=-1,this._floatingID=c.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onListCloseCallback(),useOverlay:!0}),this._detailIsVisible=!0,this._showAll=!1,this._filterArgument="",this._filterInput.setFocus()}async hideDetail(){null!=this._floatingID&&c.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildItemElement(t){const i=++this._selectableItemsCount;return e("button",{id:`filter-item${i}`,onFocusin:()=>this._preselection=i,class:"ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item",onClick:()=>this.itemSelected(t.name)},t.iconName?e("ez-icon",{iconName:t.iconName,size:"small",class:`ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${t.iconClass||""}`}):void 0,e("div",{class:`ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${t.labelClass||""}`},t.label))}itemSelected(t){"__SHOWMORE__"===t?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?d.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?e("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty"},this.emptyText):(!this._filterArgument&&!this._showAll&&t.length>6&&(t.splice(5),t.push({kind:"INTERNAL",label:"Mostrar mais",iconName:"dots-horizontal",name:"__SHOWMORE__",iconClass:"snk-filter-bar__filter-list-item__icon--secondary",labelClass:"snk-filter-bar__filter-list-item__label--secondary"})),this._selectableItemsCount=0,e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-list-items-container"},t.map((t=>this.buildItemElement(t)))))}getFooterItems(){return this.items.filter((t=>"FOOTER"===t.kind))}keyDownHandler(t){switch(t.key){case"ArrowDown":this.changePreselection(this._preselection+1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();break;case"ArrowUp":this.changePreselection(this._preselection-1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()}}changePreselection(t){if(t<0&&(t=this._selectableItemsCount),this._preselection=t>this._selectableItemsCount?0:t,0===this._preselection)this._filterInput.setFocus();else{const t=this._element.querySelector(`#filter-item${this._preselection}`);t&&t.focus()}}render(){return e(r,{class:"ez-flex ez-flex--column"},e("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},e("slot",{name:"leftIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small",ref:t=>this._popover=t},e("ez-filter-input",{ref:t=>this._filterInput=t,mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail,onFocus:()=>this._preselection=0}),this.getFilterItems(),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),this.items?this.getFooterItems().map((t=>this.buildItemElement(t))):void 0)))}get _element(){return s(this)}},O=class{constructor(i){t(this,i)}updateValue(t,i){this.items=this.items.map((e=>e.id===t?(null==i&&(i=!e.active),Object.assign(Object.assign({},e),{active:i})):e))}getActiveFiltersMsg(){const t=this.items.filter((t=>t.active)).length;return 0===t?this.getMessage("snkFilterBar.noActiveFilters"):this.getMessage(t>1?"snkFilterBar.activeFilters":"snkFilterBar.activeFilter",{ACTIVE_FILTERS:t})}buildItems(t){return t.map((t=>e("button",{onClick:()=>this.updateValue(t.id),class:"ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small"},e("ez-check",{id:`checkbox_${t.id}`,tabIndex:"-1",class:"sc-snk-filter-bar snk-filter-bar__filter-modal-item__check",onEzChange:i=>this.updateValue(t.id,i.detail),enabled:t.enabled,value:t.active,mode:m.SWITCH}),e("div",{class:"ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label"},t.label))))}itemKeyBoardSelect(t,i){"Enter"!==t.key&&" "!==t.key||this.updateValue(i.id)}modalActionListener(t){const i=t.detail;i===_.LOAD?this._filterInput&&this._filterInput.setFocus():this.processModalAction(i)}render(){const t=this.items.filter((t=>t.active)).length>0,i=this.items?d.applyStringFilter(this._filterArgument,this.items):[];return e("ez-modal-container",{modalTitle:this.modalTitle,modalSubTitle:this.modalSubTitle,cancelButtonLabel:this.cancelButtonLabel,okButtonLabel:this.okButtonLabel,onEzModalAction:t=>this.modalActionListener(t),cancelButtonStatus:t?v.ENABLED:v.DISABLED},e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-modal-content"},e("div",null,this.useSearch?e("ez-filter-input",{ref:t=>this._filterInput=t,label:this.getMessage("snkFilterBar.modalFindFilter"),onEzChange:t=>this._filterArgument=t.detail}):void 0),i.length>0?e("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding-bottom--small"},this.getActiveFiltersMsg()):void 0,e("div",null,this.buildItems(i)),e("div",{class:"ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large"},this.infoText)))}},R=class{constructor(e){t(this,e),this.actionClick=i(this,"actionClick",7),this.actionChange=i(this,"actionChange",7),this._titleKeyByElement={[F.UPDATE]:"snkTaskbar.titleUpdate",[F.PREVIOUS]:"snkTaskbar.titlePrevious",[F.NEXT]:"snkTaskbar.titleNext",[F.REFRESH]:"snkTaskbar.titleRefresh",[F.CLONE]:"snkTaskbar.titleClone",[F.REMOVE]:"snkTaskbar.titleRemove",[F.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[F.INSERT]:"snkTaskbar.titleInsert",[F.CANCEL]:"snkTaskbar.titleCancel",[F.SAVE]:"snkTaskbar.titleSave",[F.GRID_MODE]:"snkTaskbar.titleGridMode",[F.FORM_MODE]:"snkTaskbar.titleFormMode",[F.CONFIGURATOR]:"snkTaskbar.titleConfigurator"}}observeButtons(){this._definitions=void 0}elementsFromString(t){const i=[];return t&&t.split(",").forEach((t=>{t=t.trim(),(z[t]||this.isAllowed(t))&&i.push(t.trim())})),i}isAllowed(t){return!x[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){let i;return i=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",i?this._application.messagesBuilder.getMessage(i,{}):""}elementClick(t){if(this.dataUnit)switch(t){case F.PREVIOUS:this.dataUnit.previousRecord();break;case F.NEXT:this.dataUnit.nextRecord();break;case F.REFRESH:this.dataUnit.loadData();break;case F.CLONE:this.dataUnit.copySelected();break;case F.REMOVE:this.dataUnit.removeSelectedRecords();break;case F.INSERT:this.dataUnit.addRecord();break;case F.CANCEL:this.dataUnit.cancelEdition();break;case F.SAVE:this.dataUnit.saveData()}this.actionClick.emit(t)}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}getElement(t,i){let e=i===this.primaryButton?"ez-button--primary ":"";return t>1&&(e+="ez-padding-left--medium"),F[i.toString()]?y(i,e,(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),this.actionsList,this.configName):T(i,e,(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess().then((t=>this._permissions=t)):this._permissions={}}componentWillRender(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons))}render(){if(void 0===this._definitions)return;let t=0;return e(r,null,this._definitions.map((i=>(i===F.DIVIDER?t=0:t++,F[i]?this.getElement(t,F[i]):this.customButtons.has(i)?this.getElement(t,this.customButtons.get(i)):e("slot",{name:i})))))}static get watchers(){return{buttons:["observeButtons"]}}};R.style=".sc-snk-taskbar-h{display:flex}";export{I as snk_configurator,w as snk_filter_bar,E as snk_filter_item,A as snk_filter_list,O as snk_filter_modal,R as snk_taskbar}