@jxsuite/studio 8.1.0 → 9.0.0

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 (247) hide show
  1. package/dist/chunks/{2020-dg097k3e.js → 2020-89fz3pfy.js} +3 -3
  2. package/dist/chunks/adapter-ay13gema.js +4 -0
  3. package/dist/chunks/add-new-flow-nmkqpjym.js +4 -0
  4. package/dist/chunks/cf-account-picker-2e06qxey.js +4 -0
  5. package/dist/chunks/cf-settings-5y04810c.js +4 -0
  6. package/dist/chunks/color-04361ttk.js +4 -0
  7. package/dist/chunks/{color-area-vh9cew51.js → color-area-h8dbasp1.js} +2 -2
  8. package/dist/chunks/{color-field-e78f16bs.js → color-field-qv5r2b16.js} +3 -3
  9. package/dist/chunks/{color-slider-fg4yhvk6.js → color-slider-nz2mrzky.js} +2 -2
  10. package/dist/chunks/components-3vf75n83.js +4 -0
  11. package/dist/chunks/content-source-4f2raf4a.js +4 -0
  12. package/dist/chunks/{convert-to-repeater-grnmea6c.js → convert-to-repeater-j9hfcj4f.js} +3 -3
  13. package/dist/chunks/editor-645krvtz.js +4 -0
  14. package/dist/chunks/entry-commands-3qmv8wkr.js +4 -0
  15. package/dist/chunks/{extension-sections-rp7fkega.js → extension-sections-thfke054.js} +3 -3
  16. package/dist/chunks/file-ops-kkhp9ma7.js +4 -0
  17. package/dist/chunks/files-yswdhxrf.js +4 -0
  18. package/dist/chunks/format-host-4g8ex6bz.js +4 -0
  19. package/dist/chunks/fs-events-z9gpvc6t.js +4 -0
  20. package/dist/chunks/grid-open-fm4j183c.js +4 -0
  21. package/dist/chunks/{grid-view-x26rfpz1.js → grid-view-7d2nx83y.js} +10 -10
  22. package/dist/chunks/{iframe-entry-pkgmcgp0.js → iframe-entry-2x9bn5ng.js} +4 -4
  23. package/dist/chunks/{iframe-entry-02wzcyvy.js → iframe-entry-btck0e9s.js} +4 -4
  24. package/dist/chunks/iframe-host-q7fedsmr.js +4 -0
  25. package/dist/chunks/{index-203h71wy.js → index-jxmt7vh8.js} +3 -3
  26. package/dist/chunks/index-pt4wh98x.js +4 -0
  27. package/dist/chunks/{javascript-ww5pv5ae.js → javascript-vmqp56ke.js} +2 -2
  28. package/dist/chunks/{jsonMode-vwbdwwq3.js → jsonMode-n3wmpant.js} +6 -6
  29. package/dist/chunks/jx-validate-19y62knt.js +4 -0
  30. package/dist/chunks/layers-panel-1qvc83y9.js +4 -0
  31. package/dist/chunks/layers-qf0bc7ze.js +4 -0
  32. package/dist/chunks/lit-html-wyqw04y2.js +4 -0
  33. package/dist/chunks/media-library-f9d5qcjb.js +4 -0
  34. package/dist/chunks/media-picker-rsb1fmk2.js +4 -0
  35. package/dist/chunks/{monaco-binding-63tqze27.js → monaco-binding-wfhmz89d.js} +3 -3
  36. package/dist/chunks/monaco-buffer-ak0raadw.js +4 -0
  37. package/dist/chunks/{monaco-setup-zyyynnj8.js → monaco-setup-fty7a8vg.js} +3 -3
  38. package/dist/chunks/notify-4qj70q0x.js +4 -0
  39. package/dist/chunks/parse-n8dfxnqf.js +4 -0
  40. package/dist/chunks/platform-ehg6t9vd.js +4 -0
  41. package/dist/chunks/publish-panel-yhmda3cd.js +4 -0
  42. package/dist/chunks/{publish-quick-ajzdhhs6.js → publish-quick-12hh8926.js} +3 -3
  43. package/dist/chunks/publish-workspace-hx8qdv9p.js +4 -0
  44. package/dist/chunks/quick-search-r955m3q1.js +4 -0
  45. package/dist/chunks/references-8gxv0x7t.js +4 -0
  46. package/dist/chunks/right-panel-jarwqjpy.js +4 -0
  47. package/dist/chunks/source-control-84qt25m9.js +4 -0
  48. package/dist/chunks/studio-0nefxhar.js +7 -0
  49. package/dist/chunks/studio-0rg30pvs.js +5 -0
  50. package/dist/chunks/{studio-3q6n9qvq.js → studio-14hh60j8.js} +4 -4
  51. package/dist/chunks/studio-1cfyd1ys.js +5 -0
  52. package/dist/chunks/studio-2bq7hheq.js +5 -0
  53. package/dist/chunks/{studio-mmqr9awv.js → studio-32d8wyxq.js} +33 -33
  54. package/dist/chunks/studio-3hpcawh8.js +4 -0
  55. package/dist/chunks/{studio-zm7dnr9g.js → studio-4j35hgsw.js} +4 -4
  56. package/dist/chunks/{studio-bqgs90r8.js → studio-4qg61g9j.js} +4 -4
  57. package/dist/chunks/studio-4rgem12q.js +5 -0
  58. package/dist/chunks/studio-6k9djnxw.js +5 -0
  59. package/dist/chunks/studio-6rbaedw2.js +9 -0
  60. package/dist/chunks/studio-732mw0g8.js +5 -0
  61. package/dist/chunks/studio-79r8msnr.js +7 -0
  62. package/dist/chunks/studio-7q6jdd4h.js +5 -0
  63. package/dist/chunks/{studio-jqrg9xxg.js → studio-881z1xrx.js} +4 -4
  64. package/dist/chunks/{studio-9wyqyfqy.js → studio-8hf8qcm1.js} +4 -4
  65. package/dist/chunks/{studio-6vrxzkba.js → studio-8pne0rx4.js} +4 -4
  66. package/dist/chunks/{studio-wcakp5bt.js → studio-9179bsm7.js} +7 -7
  67. package/dist/chunks/{studio-xddgbwhe.js → studio-9ff0vqff.js} +3 -3
  68. package/dist/chunks/{studio-25a5by3h.js → studio-9gzvypw4.js} +4 -4
  69. package/dist/chunks/studio-9ndgd55w.js +5 -0
  70. package/dist/chunks/studio-9ra9e7m4.js +5 -0
  71. package/dist/chunks/studio-a6e5fzve.js +5 -0
  72. package/dist/chunks/studio-a9k86nq6.js +5 -0
  73. package/dist/chunks/studio-ae7a69jc.js +6 -0
  74. package/dist/chunks/studio-aghsg0ds.js +7 -0
  75. package/dist/chunks/{studio-2b8443ms.js → studio-ajw4k8hp.js} +3 -3
  76. package/dist/chunks/{studio-957jg8g3.js → studio-apapy17g.js} +4 -4
  77. package/dist/chunks/{studio-hnx1h1pr.js → studio-by8x0jvc.js} +4 -4
  78. package/dist/chunks/{studio-hxq1ebp0.js → studio-c88gq88j.js} +6 -6
  79. package/dist/chunks/{studio-a6x058ew.js → studio-cg54vtet.js} +4 -4
  80. package/dist/chunks/studio-dvhxxxbd.js +5 -0
  81. package/dist/chunks/{studio-1meqbxns.js → studio-e4rq6x0q.js} +4 -4
  82. package/dist/chunks/{studio-v2ek69cb.js → studio-ekzbgnjp.js} +4 -4
  83. package/dist/chunks/{studio-2dtc90zs.js → studio-fg4fj9ec.js} +6 -6
  84. package/dist/chunks/studio-fj6jzgxw.js +5 -0
  85. package/dist/chunks/{studio-txkx6586.js → studio-g45r5vm8.js} +7 -7
  86. package/dist/chunks/{studio-v0gsjav0.js → studio-gczve8zf.js} +4 -4
  87. package/dist/chunks/studio-ge08zwpv.js +5 -0
  88. package/dist/chunks/{studio-1gdfsr49.js → studio-gk9yk8dj.js} +7 -7
  89. package/dist/chunks/{studio-cpdzrdgp.js → studio-gskkgfe3.js} +4 -4
  90. package/dist/chunks/{studio-94ppxeqy.js → studio-h4jbgne2.js} +8 -8
  91. package/dist/chunks/{studio-kdseew9m.js → studio-hcy9zeac.js} +4 -4
  92. package/dist/chunks/studio-ht81xjkr.js +5 -0
  93. package/dist/chunks/{studio-73wz63nn.js → studio-jr30g4ae.js} +4 -4
  94. package/dist/chunks/{studio-fqs1a22a.js → studio-k5n4es74.js} +4 -4
  95. package/dist/chunks/{studio-j5jqvyn3.js → studio-k6hbx2fc.js} +4 -4
  96. package/dist/chunks/{studio-332hesdk.js → studio-kqh7fxn6.js} +4 -4
  97. package/dist/chunks/{studio-8nyw10dp.js → studio-kyw47pet.js} +4 -4
  98. package/dist/chunks/studio-mkw17ngg.js +5 -0
  99. package/dist/chunks/{studio-02phtmqn.js → studio-myb4mf0h.js} +4 -4
  100. package/dist/chunks/{studio-d140sy8e.js → studio-n4qq1n57.js} +4 -4
  101. package/dist/chunks/{studio-bf0rgyf7.js → studio-nfmpmkqb.js} +4 -4
  102. package/dist/chunks/studio-nfwacw31.js +5 -0
  103. package/dist/chunks/{studio-z42kysg7.js → studio-nm86874b.js} +136 -136
  104. package/dist/chunks/studio-nqexty8x.js +16 -0
  105. package/dist/chunks/studio-nr0kcqc6.js +5 -0
  106. package/dist/chunks/{studio-dmn7gpba.js → studio-nvfa137z.js} +5 -5
  107. package/dist/chunks/studio-psh8mwnw.js +4 -0
  108. package/dist/chunks/{studio-4dsdnan2.js → studio-qd0cycm4.js} +5 -5
  109. package/dist/chunks/{studio-zht0x0v3.js → studio-qevf5z9d.js} +4 -4
  110. package/dist/chunks/studio-qs5fmhtj.js +14 -0
  111. package/dist/chunks/studio-ry4789ng.js +7 -0
  112. package/dist/chunks/studio-s4fq9jht.js +5 -0
  113. package/dist/chunks/studio-sc35ttdk.js +5 -0
  114. package/dist/chunks/studio-sm2f0sc6.js +6 -0
  115. package/dist/chunks/{studio-rdnezzkd.js → studio-spza69tb.js} +5 -5
  116. package/dist/chunks/studio-t6dqnnft.js +5 -0
  117. package/dist/chunks/{studio-hw60n5dh.js → studio-tfmhnwyr.js} +3 -3
  118. package/dist/chunks/studio-tn7v8gey.js +6 -0
  119. package/dist/chunks/{studio-nsv7g1qn.js → studio-trcfer2b.js} +4 -4
  120. package/dist/chunks/studio-tyw7tk0x.js +5 -0
  121. package/dist/chunks/{studio-533py3yy.js → studio-tyzgte21.js} +4 -4
  122. package/dist/chunks/studio-vtey9w98.js +5 -0
  123. package/dist/chunks/studio-ws2r1d7e.js +5 -0
  124. package/dist/chunks/studio-x2trkhk5.js +5 -0
  125. package/dist/chunks/{studio-c5dj3dzk.js → studio-xzgp0cp7.js} +4 -4
  126. package/dist/chunks/studio-y47090vq.js +5 -0
  127. package/dist/chunks/{studio-nm9qev4p.js → studio-yjh9gddd.js} +5 -5
  128. package/dist/chunks/studio-ywf9y1e2.js +5 -0
  129. package/dist/chunks/{studio-x3ge4rts.js → studio-z1p91z5a.js} +4 -4
  130. package/dist/chunks/studio-ztppbam0.js +5 -0
  131. package/dist/chunks/{toast-host-1yg5ar8d.js → toast-host-g3r2s0kn.js} +2 -2
  132. package/dist/chunks/toast-w11qpkyz.js +4 -0
  133. package/dist/chunks/{tsMode-vra2hh7y.js → tsMode-byje4a01.js} +5 -5
  134. package/dist/chunks/workspace-7q4arnt3.js +4 -0
  135. package/dist/chunks/workspace-home-ge027kr6.js +4 -0
  136. package/dist/chunks/{ws-client-72x5n99j.js → ws-client-h09h6sqg.js} +3 -3
  137. package/dist/iframe-entry.js +13 -13
  138. package/dist/manifest.json +77 -77
  139. package/dist/studio.js +89 -89
  140. package/package.json +11 -12
  141. package/src/collab/collab-session.ts +6 -2
  142. package/src/commands/context.ts +4 -0
  143. package/src/commands/defaults.ts +2 -0
  144. package/src/commands/live-context.ts +2 -0
  145. package/src/files/files.ts +6 -3
  146. package/src/new-project/new-project-modal.ts +1 -4
  147. package/src/panels/ai-panel.ts +27 -34
  148. package/src/platform.ts +20 -0
  149. package/src/platforms/devserver.ts +2 -120
  150. package/src/services/ai-ask.ts +29 -171
  151. package/src/services/ai-command-tools.ts +40 -50
  152. package/src/services/ai-import-tools.ts +4 -5
  153. package/src/services/ai-project-tools.ts +13 -3
  154. package/src/services/ai-tools.ts +26 -564
  155. package/src/services/ai-writes.ts +84 -2
  156. package/src/services/document-assistant.ts +29 -58
  157. package/src/services/harness/assistant-tools.ts +68 -0
  158. package/src/services/harness/interaction-store.ts +118 -0
  159. package/src/services/harness/studio-documents.ts +105 -0
  160. package/src/services/harness/turn-hooks.ts +1 -6
  161. package/src/services/project-adoption.ts +8 -16
  162. package/src/services/tool-executor.ts +25 -22
  163. package/src/state.ts +3 -13
  164. package/src/surfaces/files-panel.json +12 -0
  165. package/src/surfaces/files-panel.ts +5 -2
  166. package/src/surfaces/welcome.ts +4 -1
  167. package/src/tabs/selection.ts +14 -109
  168. package/src/tabs/tab.ts +10 -1
  169. package/src/tabs/transact.ts +316 -124
  170. package/src/types.ts +13 -8
  171. package/dist/chunks/adapter-tck81zft.js +0 -4
  172. package/dist/chunks/add-new-flow-a1w0bnm6.js +0 -4
  173. package/dist/chunks/cf-account-picker-ce3kp3x1.js +0 -4
  174. package/dist/chunks/cf-settings-7ye6x7g2.js +0 -4
  175. package/dist/chunks/color-4gj49xq6.js +0 -4
  176. package/dist/chunks/components-qce0v93f.js +0 -4
  177. package/dist/chunks/content-source-jjx8kgzr.js +0 -4
  178. package/dist/chunks/editor-bkja5dbv.js +0 -4
  179. package/dist/chunks/entry-commands-1wh0btvg.js +0 -4
  180. package/dist/chunks/file-ops-6pe4z7an.js +0 -4
  181. package/dist/chunks/files-ybpp3j38.js +0 -4
  182. package/dist/chunks/format-host-3mtbhxk1.js +0 -4
  183. package/dist/chunks/fs-events-xfanfxds.js +0 -4
  184. package/dist/chunks/grid-open-dg5qmnaj.js +0 -4
  185. package/dist/chunks/iframe-host-j2bk2xkc.js +0 -4
  186. package/dist/chunks/index-fkrm7pdk.js +0 -4
  187. package/dist/chunks/jx-validate-w7v32f6a.js +0 -4
  188. package/dist/chunks/layers-g7j732cm.js +0 -4
  189. package/dist/chunks/layers-panel-gjrsxcck.js +0 -4
  190. package/dist/chunks/lit-html-jdfz9rhc.js +0 -4
  191. package/dist/chunks/media-library-9j0v4wmk.js +0 -4
  192. package/dist/chunks/media-picker-cpyyt2m0.js +0 -4
  193. package/dist/chunks/monaco-buffer-9wcme176.js +0 -4
  194. package/dist/chunks/notify-rahnnnv4.js +0 -4
  195. package/dist/chunks/parse-v77xtwv7.js +0 -4
  196. package/dist/chunks/platform-b2aqv7v5.js +0 -4
  197. package/dist/chunks/publish-panel-4yk2461b.js +0 -4
  198. package/dist/chunks/publish-workspace-mxestzcf.js +0 -4
  199. package/dist/chunks/quick-search-9g6z65b0.js +0 -4
  200. package/dist/chunks/references-c26enpxs.js +0 -4
  201. package/dist/chunks/right-panel-9d0e0yg7.js +0 -4
  202. package/dist/chunks/source-control-xyn3a8ds.js +0 -4
  203. package/dist/chunks/studio-0khd0xdw.js +0 -5
  204. package/dist/chunks/studio-1fvzq9vs.js +0 -5
  205. package/dist/chunks/studio-1yhz0s8p.js +0 -5
  206. package/dist/chunks/studio-2c2mjyzj.js +0 -6
  207. package/dist/chunks/studio-3pndhat0.js +0 -9
  208. package/dist/chunks/studio-4fjqdzrb.js +0 -6
  209. package/dist/chunks/studio-5abge3wy.js +0 -5
  210. package/dist/chunks/studio-74nzv280.js +0 -5
  211. package/dist/chunks/studio-7cg75gtj.js +0 -14
  212. package/dist/chunks/studio-89cwmnae.js +0 -5
  213. package/dist/chunks/studio-8m1t83kn.js +0 -7
  214. package/dist/chunks/studio-a3evp7f6.js +0 -6
  215. package/dist/chunks/studio-ana67wax.js +0 -5
  216. package/dist/chunks/studio-b4xhpcwy.js +0 -4
  217. package/dist/chunks/studio-c4rcaftm.js +0 -5
  218. package/dist/chunks/studio-cgjt1zce.js +0 -5
  219. package/dist/chunks/studio-cq87hree.js +0 -5
  220. package/dist/chunks/studio-e1g64q43.js +0 -5
  221. package/dist/chunks/studio-e8pzjjhf.js +0 -5
  222. package/dist/chunks/studio-f8kz3krj.js +0 -7
  223. package/dist/chunks/studio-fw3jp9m7.js +0 -5
  224. package/dist/chunks/studio-g6ysm05p.js +0 -7
  225. package/dist/chunks/studio-gmhd0j3f.js +0 -5
  226. package/dist/chunks/studio-gqpty626.js +0 -5
  227. package/dist/chunks/studio-grp684wx.js +0 -5
  228. package/dist/chunks/studio-h98520qr.js +0 -5
  229. package/dist/chunks/studio-hvxt8z79.js +0 -5
  230. package/dist/chunks/studio-j4e627w1.js +0 -5
  231. package/dist/chunks/studio-kt2j51sa.js +0 -5
  232. package/dist/chunks/studio-m4w6sygj.js +0 -16
  233. package/dist/chunks/studio-nqxqf8p2.js +0 -4
  234. package/dist/chunks/studio-p89w12s2.js +0 -7
  235. package/dist/chunks/studio-pbagym4j.js +0 -5
  236. package/dist/chunks/studio-pr23qhrw.js +0 -5
  237. package/dist/chunks/studio-r4ya3sb2.js +0 -5
  238. package/dist/chunks/studio-rm9m3z60.js +0 -5
  239. package/dist/chunks/studio-tpmnbgmt.js +0 -5
  240. package/dist/chunks/studio-ttxhq5yt.js +0 -5
  241. package/dist/chunks/studio-y1x65h5r.js +0 -5
  242. package/dist/chunks/studio-zf188hnd.js +0 -5
  243. package/dist/chunks/toast-1gv0h53h.js +0 -4
  244. package/dist/chunks/workspace-3nt93k48.js +0 -4
  245. package/dist/chunks/workspace-home-zbgyqqws.js +0 -4
  246. package/src/services/directory-picker.ts +0 -187
  247. package/src/services/gated-registry.ts +0 -77
@@ -1,4 +1,4 @@
1
- import"./studio-pr23qhrw.js";import"./studio-tpmnbgmt.js";import"./studio-6vrxzkba.js";import{Ur,qc,mt,m$,no}from"./studio-2b8443ms.js";import"./studio-7cg75gtj.js";import{T}from"./studio-02phtmqn.js";import{g}from"./studio-hw60n5dh.js";import"./studio-nqxqf8p2.js";import{Wu,jl}from"./studio-a6x058ew.js";import"./studio-hnx1h1pr.js";import"./studio-y1x65h5r.js";import"./studio-grp684wx.js";import"./studio-cq87hree.js";import{He}from"./studio-gmhd0j3f.js";import"./studio-hvxt8z79.js";import{mb}from"./studio-2dtc90zs.js";import"./studio-9wyqyfqy.js";import"./studio-0khd0xdw.js";import"./studio-3q6n9qvq.js";import"./studio-m4w6sygj.js";import"./studio-p89w12s2.js";import"./studio-wcakp5bt.js";import"./studio-nm9qev4p.js";import"./studio-5abge3wy.js";import"./studio-v2ek69cb.js";import"./studio-txkx6586.js";import{kw,xp,nr,bS}from"./studio-1yhz0s8p.js";import{Cd,em,HR}from"./studio-zm7dnr9g.js";import{zD}from"./studio-zf188hnd.js";import"./studio-332hesdk.js";import"./studio-rdnezzkd.js";import{n}from"./studio-kt2j51sa.js";class H{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){if(typeof t<"u")this.table.options[e]=t;return this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class L{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],r=s.length,o;for(let a=0;a<r;a++)if(i=i[s[a]],o=i,!i)break;return o}static deepClone(e,t,i=[]){var s={}.__proto__,r=[].__proto__;if(!t)t=Object.assign(Array.isArray(e)?[]:{},e);for(var o in e){let a=e[o],l,h;if(a!=null&&typeof a==="object"&&(a.__proto__===s||a.__proto__===r))if(l=i.findIndex((d)=>d.subject===a),l>-1)t[o]=i[l].copy;else h=Object.assign(Array.isArray(a)?[]:{},a),i.unshift({subject:a,copy:h}),t[o]=this.deepClone(a,h,i)}return t}}var et=class e extends H{constructor(t,i,s){super(t);this.element=i,this.container=this._lookupContainer(),this.parent=s,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.offset={top:null,right:null,bottom:null,left:null},this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var t=this.table.options.popupContainer;if(typeof t==="string"){if(t=document.querySelector(t),!t)console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")}else if(t===!0)t=this.table.element;if(t&&!this._checkContainerIsParent(t))t=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)");if(!t)t=document.body;return t}_checkContainerIsParent(t,i=this.table.element){if(t===i)return!0;else return i.parentNode?this._checkContainerIsParent(t,i.parentNode):!1}renderCallback(t){this.renderedCallback=t}containerEventCoords(t){var i=!(t instanceof MouseEvent),s=i?t.touches[0].pageX:t.pageX,r=i?t.touches[0].pageY:t.pageY;if(this.container!==document.body){let o=L.elOffset(this.container);s-=o.left,r-=o.top}return{x:s,y:r}}elementPositionCoords(t,i="right"){var s=L.elOffset(t),r,o,a;if(this.container!==document.body)r=L.elOffset(this.container),s.left-=r.left,s.top-=r.top;switch(i){case"right":o=s.left+t.offsetWidth,a=s.top-1;break;case"bottom":o=s.left,a=s.top+t.offsetHeight;break;case"left":o=s.left,a=s.top-1;break;case"top":o=s.left,a=s.top;break;case"center":o=s.left+t.offsetWidth/2,a=s.top+t.offsetHeight/2;break}return{x:o,y:a,offset:s}}show(t,i){var s,r;if(this.destroyed||this.table.destroyed)return this;if(!this.parent)this.reversedX=!1;if(t instanceof HTMLElement)s=t,r=this.elementPositionCoords(t,i).offset;else if(typeof t==="number")r={top:0,left:0};let o=this.resolveCoordsByOrigin(t,i);if(this.offset.top=o.y,this.offset.left=o.x,this.offset.right=null,this.applyOffset(),this.container.appendChild(this.element),typeof this.renderedCallback==="function")this.renderedCallback();return this._fitToScreen(o.x,o.y,s,r,i),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(a)=>{a.stopPropagation()}),this}resolveCoordsByOrigin(t,i){if(t instanceof HTMLElement){let s=this.elementPositionCoords(t,i);return{x:s.x,y:s.y}}if(typeof t==="number")return{x:t,y:i};return this.containerEventCoords(t)}_elementWidth(){return this.element.getBoundingClientRect().width||this.element.offsetWidth}_elementHeight(){return this.element.getBoundingClientRect().height||this.element.offsetHeight}_fitToScreen(t,i,s,r,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop,l=this.container===document.body?document.documentElement.scrollLeft:this.container.scrollLeft,h=this.container===document.body?l:0,d=this.container===document.body?l+document.documentElement.clientWidth:this.container.offsetWidth,u=this.container===document.body?a:0,c=this.container===document.body?a+document.documentElement.clientHeight:Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0),f=this._elementWidth(),p=t;if(p+f>d||this.reversedX){if(s&&o==="right")p=r.left-f;else if(s&&o==="left")p=r.left+s.offsetWidth;else if(s)p=r.left-f;else p=d-f;this.reversedX=!0}if(p+f>d)p=d-f;if(p<h)p=h;if(this.offset.left=p,this.offset.right=null,i+this._elementHeight()>c)if(s)switch(o){case"bottom":this.offset.top=this.offset.top-this._elementHeight()-s.offsetHeight-1;break;default:this.offset.top=this.offset.top-this._elementHeight()+s.offsetHeight+1}else{let m=this._elementHeight();if(m>c-u)this.offset.top=u,this.element.style.height=c-u+"px";else{let b=i-m;if(b<u)b=c-m;this.offset.top=b}}if(this.offset.top+this._elementHeight()>c)this.offset.top=c-this._elementHeight();if(this.offset.top<u)this.offset.top=u;this.applyOffset()}applyOffset(){this.element.style.top=this.offset.top==null?"":this.offset.top+"px",this.element.style.right=this.offset.right==null?"":this.offset.right+"px",this.element.style.bottom=this.offset.bottom==null?"":this.offset.bottom+"px",this.element.style.left=this.offset.left==null?"":this.offset.left+"px"}isVisible(){return this.visible}hideOnBlur(t){if(this.blurable=!0,this.visible)setTimeout(()=>{if(this.visible)this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0},100),this.blurCallback=t;return this}_escapeCheck(t){if(t.key==27)this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(t=!1){if(this.visible&&this.hideable){if(this.blurable&&this.blurEventsBound)document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1;if(this.childPopup)this.childPopup.hide();if(this.parent)this.parent.childPopup=null;if(this.element.parentNode)this.element.parentNode.removeChild(this.element);if(this.visible=!1,this.blurCallback&&!t)this.blurCallback();this.unsubscribe("table-destroy",this.destroyBinding)}return this}child(t){if(this.childPopup)this.childPopup.hide();return this.childPopup=new e(this.table,t,this),this.childPopup}};class F extends H{constructor(e,t){super(e);this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){if(typeof this.table[e]>"u")this.table[e]=(...i)=>(this.table.initGuard(e),t(...i));else console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler){if(i=this.table.rowManager.displayPipeline.findIndex((s)=>s.handler===this._handler),i>-1)t=i}if(e)t=t+e;if(this._handler)if(t>-1)return this.table.rowManager.getDisplayRows(t);else return this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){if(!t)t=this._handler;if(t)this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new et(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}function ne(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach((r,o)=>{i=i.concat(ne(r,t?t+"["+o+"]":o))});else if(typeof e==="object")for(var s in e)i=i.concat(ne(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function tt(e){var t=ne(e),i=[];return t.forEach(function(s){i.push(encodeURIComponent(s.key)+"="+encodeURIComponent(s.value))}),i.join("&")}function it(e,t,i){if(e){if(i&&Object.keys(i).length){if(!t.method||t.method.toLowerCase()=="get")t.method="get",e+=(e.includes("?")?"&":"?")+tt(i)}}return e}var st={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},nt={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,r=[],o=[];if(e=e.split(`
1
+ import"./studio-9ndgd55w.js";import"./studio-a6e5fzve.js";import"./studio-8pne0rx4.js";import{Vr,Uc,mt,b$,io}from"./studio-ajw4k8hp.js";import"./studio-qs5fmhtj.js";import{T}from"./studio-myb4mf0h.js";import{g}from"./studio-tfmhnwyr.js";import"./studio-psh8mwnw.js";import{zu,Hl}from"./studio-cg54vtet.js";import"./studio-by8x0jvc.js";import"./studio-ztppbam0.js";import"./studio-4rgem12q.js";import"./studio-7q6jdd4h.js";import{He}from"./studio-t6dqnnft.js";import"./studio-vtey9w98.js";import{mb}from"./studio-fg4fj9ec.js";import"./studio-8hf8qcm1.js";import"./studio-y47090vq.js";import"./studio-14hh60j8.js";import"./studio-nqexty8x.js";import"./studio-0nefxhar.js";import"./studio-9179bsm7.js";import"./studio-yjh9gddd.js";import"./studio-0rg30pvs.js";import"./studio-ekzbgnjp.js";import"./studio-g45r5vm8.js";import{Ew,vp,Qo,wS}from"./studio-x2trkhk5.js";import{_d,im,WR}from"./studio-4j35hgsw.js";import{qD}from"./studio-tyw7tk0x.js";import"./studio-spza69tb.js";import"./studio-kqh7fxn6.js";import{n}from"./studio-ywf9y1e2.js";class H{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){if(typeof t<"u")this.table.options[e]=t;return this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class L{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],r=s.length,o;for(let a=0;a<r;a++)if(i=i[s[a]],o=i,!i)break;return o}static deepClone(e,t,i=[]){var s={}.__proto__,r=[].__proto__;if(!t)t=Object.assign(Array.isArray(e)?[]:{},e);for(var o in e){let a=e[o],l,h;if(a!=null&&typeof a==="object"&&(a.__proto__===s||a.__proto__===r))if(l=i.findIndex((d)=>d.subject===a),l>-1)t[o]=i[l].copy;else h=Object.assign(Array.isArray(a)?[]:{},a),i.unshift({subject:a,copy:h}),t[o]=this.deepClone(a,h,i)}return t}}var et=class e extends H{constructor(t,i,s){super(t);this.element=i,this.container=this._lookupContainer(),this.parent=s,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.offset={top:null,right:null,bottom:null,left:null},this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var t=this.table.options.popupContainer;if(typeof t==="string"){if(t=document.querySelector(t),!t)console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")}else if(t===!0)t=this.table.element;if(t&&!this._checkContainerIsParent(t))t=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)");if(!t)t=document.body;return t}_checkContainerIsParent(t,i=this.table.element){if(t===i)return!0;else return i.parentNode?this._checkContainerIsParent(t,i.parentNode):!1}renderCallback(t){this.renderedCallback=t}containerEventCoords(t){var i=!(t instanceof MouseEvent),s=i?t.touches[0].pageX:t.pageX,r=i?t.touches[0].pageY:t.pageY;if(this.container!==document.body){let o=L.elOffset(this.container);s-=o.left,r-=o.top}return{x:s,y:r}}elementPositionCoords(t,i="right"){var s=L.elOffset(t),r,o,a;if(this.container!==document.body)r=L.elOffset(this.container),s.left-=r.left,s.top-=r.top;switch(i){case"right":o=s.left+t.offsetWidth,a=s.top-1;break;case"bottom":o=s.left,a=s.top+t.offsetHeight;break;case"left":o=s.left,a=s.top-1;break;case"top":o=s.left,a=s.top;break;case"center":o=s.left+t.offsetWidth/2,a=s.top+t.offsetHeight/2;break}return{x:o,y:a,offset:s}}show(t,i){var s,r;if(this.destroyed||this.table.destroyed)return this;if(!this.parent)this.reversedX=!1;if(t instanceof HTMLElement)s=t,r=this.elementPositionCoords(t,i).offset;else if(typeof t==="number")r={top:0,left:0};let o=this.resolveCoordsByOrigin(t,i);if(this.offset.top=o.y,this.offset.left=o.x,this.offset.right=null,this.applyOffset(),this.container.appendChild(this.element),typeof this.renderedCallback==="function")this.renderedCallback();return this._fitToScreen(o.x,o.y,s,r,i),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(a)=>{a.stopPropagation()}),this}resolveCoordsByOrigin(t,i){if(t instanceof HTMLElement){let s=this.elementPositionCoords(t,i);return{x:s.x,y:s.y}}if(typeof t==="number")return{x:t,y:i};return this.containerEventCoords(t)}_elementWidth(){return this.element.getBoundingClientRect().width||this.element.offsetWidth}_elementHeight(){return this.element.getBoundingClientRect().height||this.element.offsetHeight}_fitToScreen(t,i,s,r,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop,l=this.container===document.body?document.documentElement.scrollLeft:this.container.scrollLeft,h=this.container===document.body?l:0,d=this.container===document.body?l+document.documentElement.clientWidth:this.container.offsetWidth,u=this.container===document.body?a:0,c=this.container===document.body?a+document.documentElement.clientHeight:Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0),f=this._elementWidth(),p=t;if(p+f>d||this.reversedX){if(s&&o==="right")p=r.left-f;else if(s&&o==="left")p=r.left+s.offsetWidth;else if(s)p=r.left-f;else p=d-f;this.reversedX=!0}if(p+f>d)p=d-f;if(p<h)p=h;if(this.offset.left=p,this.offset.right=null,i+this._elementHeight()>c)if(s)switch(o){case"bottom":this.offset.top=this.offset.top-this._elementHeight()-s.offsetHeight-1;break;default:this.offset.top=this.offset.top-this._elementHeight()+s.offsetHeight+1}else{let m=this._elementHeight();if(m>c-u)this.offset.top=u,this.element.style.height=c-u+"px";else{let b=i-m;if(b<u)b=c-m;this.offset.top=b}}if(this.offset.top+this._elementHeight()>c)this.offset.top=c-this._elementHeight();if(this.offset.top<u)this.offset.top=u;this.applyOffset()}applyOffset(){this.element.style.top=this.offset.top==null?"":this.offset.top+"px",this.element.style.right=this.offset.right==null?"":this.offset.right+"px",this.element.style.bottom=this.offset.bottom==null?"":this.offset.bottom+"px",this.element.style.left=this.offset.left==null?"":this.offset.left+"px"}isVisible(){return this.visible}hideOnBlur(t){if(this.blurable=!0,this.visible)setTimeout(()=>{if(this.visible)this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0},100),this.blurCallback=t;return this}_escapeCheck(t){if(t.key==27)this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(t=!1){if(this.visible&&this.hideable){if(this.blurable&&this.blurEventsBound)document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1;if(this.childPopup)this.childPopup.hide();if(this.parent)this.parent.childPopup=null;if(this.element.parentNode)this.element.parentNode.removeChild(this.element);if(this.visible=!1,this.blurCallback&&!t)this.blurCallback();this.unsubscribe("table-destroy",this.destroyBinding)}return this}child(t){if(this.childPopup)this.childPopup.hide();return this.childPopup=new e(this.table,t,this),this.childPopup}};class F extends H{constructor(e,t){super(e);this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){if(typeof this.table[e]>"u")this.table[e]=(...i)=>(this.table.initGuard(e),t(...i));else console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler){if(i=this.table.rowManager.displayPipeline.findIndex((s)=>s.handler===this._handler),i>-1)t=i}if(e)t=t+e;if(this._handler)if(t>-1)return this.table.rowManager.getDisplayRows(t);else return this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){if(!t)t=this._handler;if(t)this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new et(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}function ne(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach((r,o)=>{i=i.concat(ne(r,t?t+"["+o+"]":o))});else if(typeof e==="object")for(var s in e)i=i.concat(ne(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function tt(e){var t=ne(e),i=[];return t.forEach(function(s){i.push(encodeURIComponent(s.key)+"="+encodeURIComponent(s.value))}),i.join("&")}function it(e,t,i){if(e){if(i&&Object.keys(i).length){if(!t.method||t.method.toLowerCase()=="get")t.method="get",e+=(e.includes("?")?"&":"?")+tt(i)}}return e}var st={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},nt={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,r=[],o=[];if(e=e.split(`
2
2
  `),e.forEach(function(a){t.push(a.split("\t"))}),t.length&&!(t.length===1&&t[0].length<2)){if(t[0].forEach(function(a){var l=s.find(function(h){return a&&h.definition.title&&a.trim()&&h.definition.title.trim()===a.trim()});if(l)r.push(l);else i=!1}),!i){if(i=!0,r=[],t[0].forEach(function(a){var l=s.find(function(h){return a&&h.field&&a.trim()&&h.field.trim()===a.trim()});if(l)r.push(l);else i=!1}),!i)r=this.table.columnManager.columnsByIndex}if(i)t.shift();return t.forEach(function(a){var l={};a.forEach(function(h,d){if(r[d])l[r[d].field]=h}),o.push(l)}),o}else return!1}},rt={copyToClipboard:["ctrl + 67","meta + 67"]},ot={copyToClipboard:function(e){if(!this.table.modules.edit.currentCell){if(this.table.modExists("clipboard",!0))this.table.modules.clipboard.copy(!1,!0)}}},at={keybindings:{bindings:rt,actions:ot}};class X extends F{static moduleName="clipboard";static moduleExtensions=at;static pasteActions=st;static pasteParsers=nt;constructor(e){super(e);this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){if(this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,this.mode===!0||this.mode==="copy")this.table.element.addEventListener("copy",(e)=>{var t,i,s;if(!this.blocked){if(e.preventDefault(),this.customSelection){if(t=this.customSelection,this.table.options.clipboardCopyFormatter)t=this.table.options.clipboardCopyFormatter("plain",t)}else if(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),i=this.table.modules.export.generateHTMLTable(s),t=i?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter)t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i);if(window.clipboardData&&window.clipboardData.setData)window.clipboardData.setData("Text",t);else if(e.clipboardData&&e.clipboardData.setData){if(e.clipboardData.setData("text/plain",t),i)e.clipboardData.setData("text/html",i)}else if(e.originalEvent&&e.originalEvent.clipboardData.setData){if(e.originalEvent.clipboardData.setData("text/plain",t),i)e.originalEvent.clipboardData.setData("text/html",i)}this.dispatchExternal("clipboardCopied",t,i),this.reset()}});if(this.mode===!0||this.mode==="paste")this.table.element.addEventListener("paste",(e)=>{this.paste(e)});this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach((i)=>{var s=[];i.columns.forEach((r)=>{var o="";if(r){if(i.type==="group")r.value=r.component.getKey();if(r.value===null)o="";else switch(typeof r.value){case"object":o=JSON.stringify(r.value);break;case"undefined":o="";break;default:o=r.value}}s.push(o)}),t.push(s.join("\t"))}),t.join(`
3
3
  `)}copy(e,t){var i,s;if(this.blocked=!1,this.customSelection=!1,this.mode===!0||this.mode==="copy"){if(this.rowRange=e||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"){if(e=document.createRange(),e.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&t)this.customSelection=i.toString();i.removeAllRanges(),i.addRange(e)}else if(typeof document.selection<"u"&&typeof document.body.createTextRange<"u")s=document.body.createTextRange(),s.moveToElementText(this.table.element),s.select();if(document.execCommand("copy"),i)i.removeAllRanges()}}setPasteAction(e){switch(typeof e){case"string":if(this.pasteAction=X.pasteActions[e],!this.pasteAction)console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e;break}}setPasteParser(e){switch(typeof e){case"string":if(this.pasteParser=X.pasteParsers[e],!this.pasteParser)console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e;break}}paste(e){var t,i,s;if(this.checkPasteOrigin(e))if(t=this.getPasteData(e),i=this.pasteParser.call(this,t),i){if(e.preventDefault(),this.table.modExists("mutator"))i=this.mutateData(i);s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)}else this.dispatchExternal("clipboardPasteError",t)}mutateData(e){var t=[];if(Array.isArray(e))e.forEach((i)=>{t.push(this.table.modules.mutator.transformRow(i,"clipboard"))});else t=e;return t}checkPasteOrigin(e){var t=!0,i=this.confirm("clipboard-paste",[e]);if(i||!["DIV","SPAN"].includes(e.target.tagName))t=!1;return t}getPasteData(e){var t;if(window.clipboardData&&window.clipboardData.getData)t=window.clipboardData.getData("Text");else if(e.clipboardData&&e.clipboardData.getData)t=e.clipboardData.getData("text/plain");else if(e.originalEvent&&e.originalEvent.clipboardData.getData)t=e.originalEvent.clipboardData.getData("text/plain");return t}}class oe{constructor(e){return this._cell=e,new Proxy(this,{get:function(t,i,s){if(typeof t[i]<"u")return t[i];else return t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){if(typeof t>"u")t=!0;this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class ee extends H{constructor(e,t){super(e.table);this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){if(this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader)this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField(),i={top:"flex-start",bottom:"flex-end",middle:"center"},s={left:"flex-start",right:"flex-end",center:"center"};if(e.style.textAlign=this.column.hozAlign,this.column.vertAlign){if(e.style.display="inline-flex",e.style.alignItems=i[this.column.vertAlign]||"",this.column.hozAlign)e.style.justifyContent=s[this.column.hozAlign]||""}if(t)e.setAttribute("tabulator-field",t);if(this.column.definition.cssClass){var r=this.column.definition.cssClass.split(" ");r.forEach((o)=>{e.classList.add(o)})}if(this.dispatch("cell-init",this),!this.column.visible)this.hide()}_generateContents(){var e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value);switch(typeof e){case"object":if(e instanceof Node){while(this.element.firstChild)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else if(this.element.innerHTML="",e!=null)console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){if(!this.loaded){if(this.loaded=!0,!e)this.layoutElement()}return this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){var s=this.setValueProcessData(e,t,i);if(s){if(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited)this.column.definition.cellEdited.call(this.table,this.getComponent());if(this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged"))this.dispatchExternal("dataChanged",this.table.rowManager.getData())}}setValueProcessData(e,t,i){var s=!1;if(this.value!==e||i){if(s=!0,t)e=this.chain("cell-value-changing",[this,e],null,e)}if(this.setValueActual(e),s)this.dispatch("cell-value-changed",this);return s}setValueActual(e){if(this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded)this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){if(this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode)this.element.parentNode.removeChild(this.element);this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){if(!this.component)this.component=new oe(this);return this.component}}class ae{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(t,i,s){if(typeof t[i]<"u")return t[i];else return t._column.table.componentFunctionBinder.handle("column",t._column,i)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){if(this._column.isGroup)this._column.columns.forEach(function(e){e.show()});else this._column.show()}hide(){if(this._column.isGroup)this._column.columns.forEach(function(e){e.hide()});else this._column.hide()}toggle(){if(this._column.visible)this.hide();else this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];if(this._column.columns.length)this._column.columns.forEach(function(t){e.push(t.getComponent())});return e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);if(i)this._column.table.columnManager.moveColumn(this._column,i,t);else console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return e?e.getComponent():!1}getPrevColumn(){var e=this._column.prevColumn();return e?e.getComponent():!1}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;if(e===!0)t=this._column.reinitializeWidth(!0);else t=this._column.setWidth(e);return this._column.table.columnManager.rerenderColumns(!0),t}}var Te={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};class V extends H{static defaultOptionList=Te;constructor(e,t,i){super(t.table);if(this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns)this.isGroup=!0,this.definition.columns.forEach((s,r)=>{var o=new V(s,this);this.attachColumn(o)}),this.checkColumnVisibility();else t.registerColumnField(this);this._initialize()}createElement(){var e=document.createElement("div");if(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader)e.classList.add("tabulator-row-header");switch(this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end";break}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e){for(let t in e)if(typeof this.definition[t]>"u")this.definition[t]=e[t]}this.definition=this.table.columnManager.optionsList.generate(V.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((e)=>{if(V.defaultOptionList.indexOf(e)===-1)console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){if(this.isGroup)this.columns.forEach(function(e){e.reRegisterPosition()});else this.registerColumnPosition(this)}_initialize(){var e=this.definition;while(this.element.firstChild)this.element.removeChild(this.element.firstChild);if(e.headerVertical){if(this.element.classList.add("tabulator-col-vertical"),e.headerVertical==="flip")this.element.classList.add("tabulator-col-vertical-flip")}if(this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup)this._buildGroupHeader();else this._buildColumnHeader();this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;if(this.dispatch("column-layout",this),typeof e.visible<"u")if(e.visible)this.show(!0);else this.hide(!0);if(e.cssClass){var t=e.cssClass.split(" ");t.forEach((i)=>{this.element.classList.add(i)})}if(e.field)this.element.setAttribute("tabulator-field",e.field);if(this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth)this.maxInitialWidth=parseInt(e.maxInitialWidth);if(e.maxWidth)this.setMaxWidth(parseInt(e.maxWidth));this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap)t.classList.add("tabulator-col-title-wrap");if(e.editableTitle){var i=document.createElement("input");if(i.classList.add("tabulator-title-editor"),i.addEventListener("click",(s)=>{s.stopPropagation(),i.focus()}),i.addEventListener("mousedown",(s)=>{s.stopPropagation()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field)this.langBind("columns|"+e.field,(s)=>{i.value=s||(e.title||"&nbsp;")});else i.value=e.title||"&nbsp;"}else if(e.field)this.langBind("columns|"+e.field,(s)=>{this._formatColumnHeaderTitle(t,s||(e.title||"&nbsp;"))});else this._formatColumnHeaderTitle(t,e.title||"&nbsp;");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":if(i instanceof Node)e.appendChild(i);else e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i);break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var e=this.definition.cssClass.split(" ");e.forEach((t)=>{this.element.classList.add(t)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t=e,i=this.fieldStructure,s=i.length,r;for(let o=0;o<s;o++)if(t=t[i[o]],r=t,!t)break;return r}_setFlatData(e,t){if(this.field)e[this.field]=t}_setNestedData(e,t){var i=e,s=this.fieldStructure,r=s.length;for(let o=0;o<r;o++)if(o==r-1)i[s[o]]=t;else{if(!i[s[o]])if(typeof t<"u")i[s[o]]={};else break;i=i[s[o]]}}attachColumn(e){if(this.groupElement)this.columns.push(e),this.groupElement.appendChild(e.getElement()),e.columnRendered();else console.warn("Column Warning - Column being attached to another column instead of column group")}verticalAlign(e,t){var i=this.parent.isGroup?this.parent.getGroupElement().clientHeight:t||this.parent.getHeadersElement().clientHeight;if(this.element.style.height=i+"px",this.dispatch("column-height",this,this.element.style.height),this.isGroup)this.groupElement.style.minHeight=i-this.contentElement.offsetHeight+"px";this.columns.forEach(function(s){s.verticalAlign(e)})}clearVerticalAlign(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(e){e.clearVerticalAlign()}),this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){if(!this.isGroup)return this;else if(this.columns.length)return this.columns[0].getFirstColumn();else return!1}getLastColumn(){if(!this.isGroup)return this;else if(this.columns.length)return this.columns[this.columns.length-1].getLastColumn();else return!1}getColumns(e){var t=[];if(e)this.columns.forEach((i)=>{t.push(i),t=t.concat(i.getColumns(!0))});else t=this.columns;return t}getCells(){return this.cells}getTopColumn(){if(this.parent.isGroup)return this.parent.getTopColumn();else return this}getDefinition(e){var t=[];if(this.isGroup&&e)this.columns.forEach(function(i){t.push(i.getDefinition(!0))}),this.definition.columns=t;return this.definition}checkColumnVisibility(){var e=!1;if(this.columns.forEach(function(t){if(t.visible)e=!0}),e)this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1);else this.hide()}show(e,t){if(!this.visible){if(this.visible=!0,this.element.style.display="",this.parent.isGroup)this.parent.checkColumnVisibility();if(this.cells.forEach(function(i){i.show()}),!this.isGroup&&this.width===null)this.reinitializeWidth();if(this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),!e)this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0);if(this.parent.isGroup)this.parent.matchChildWidths();if(!this.silent)this.table.columnManager.rerenderColumns()}}hide(e,t){if(this.visible){if(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup)this.parent.checkColumnVisibility();if(this.cells.forEach(function(i){i.hide()}),this.dispatch("column-hide",this,t),!e)this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1);if(this.parent.isGroup)this.parent.matchChildWidths();if(!this.silent)this.table.columnManager.rerenderColumns()}}matchChildWidths(){var e=0;if(this.contentElement&&this.columns.length){if(this.columns.forEach(function(t){if(t.visible)e+=t.getWidth()}),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized)this.element.style.width=e+"px";if(this.parent.isGroup)this.parent.matchChildWidths()}}removeChild(e){var t=this.columns.indexOf(e);if(t>-1)this.columns.splice(t,1);if(!this.columns.length)this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){if(isNaN(e))e=Math.floor(this.table.element.clientWidth/100*parseInt(e));if(e=Math.max(this.minWidth,e),this.maxWidth)e=Math.min(this.maxWidth,e);if(this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,!this.isGroup)this.cells.forEach(function(t){t.setWidth()});if(this.parent.isGroup)this.parent.matchChildWidths();if(this.dispatch("column-width",this),this.subscribedExternal("columnWidth"))this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach(function(t){if(t.row.heightInitialized)if(t.row.getElement().offsetParent!==null)e.push(t.row),t.row.clearCellHeight();else t.row.heightInitialized=!1}),e.forEach(function(t){t.calcHeight()}),e.forEach(function(t){t.setCellHeight()})}getWidth(){var e=0;if(this.isGroup)this.columns.forEach(function(t){if(t.visible)e+=t.getWidth()});else e=this.width;return e}getLeftOffset(){var e=this.element.offsetLeft;if(this.parent.isGroup)e+=this.parent.getLeftOffset();return e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){if(this.maxWidth&&e>this.maxWidth)e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")");this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(e){if(this.minWidth&&e<this.minWidth)e=this.minWidth,console.warn("the maxWidth ("+e+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")");this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(t){t.setMaxWidth()})}delete(){return new Promise((e,t)=>{if(this.isGroup)this.columns.forEach(function(s){s.delete()});this.dispatch("column-delete",this);var i=this.cells.length;for(let s=0;s<i;s++)this.cells[0].delete();if(this.element.parentNode)this.element.parentNode.removeChild(this.element);if(this.element=!1,this.contentElement=!1,this.titleElement=!1,this.groupElement=!1,this.parent.isGroup)this.parent.removeChild(this);this.table.columnManager.deregisterColumn(this),this.table.columnManager.rerenderColumns(!0),this.dispatch("column-deleted",this),e()})}columnRendered(){if(this.titleFormatterRendered)this.titleFormatterRendered();this.dispatch("column-rendered",this)}generateCell(e){var t=new ee(this,e);return this.cells.push(t),t}nextColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._nextVisibleColumn(e+1):!1}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._prevVisibleColumn(e-1):!1}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){if(this.widthFixed=!1,typeof this.definition.width<"u"&&!e)this.setWidth(this.definition.width);this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(this.isGroup)return;if(!this.widthFixed)this.element.style.width="",this.cells.forEach((s)=>{s.clearWidth()});var t=this.element.offsetWidth;if(!this.width||!this.widthFixed){if(this.cells.forEach((s)=>{var r=s.getWidth();if(r>t)t=r}),t){var i=t+1;if(e)this.setWidth(i);else{if(this.maxInitialWidth&&!e)i=Math.min(i,this.maxInitialWidth);this.setWidthActual(i)}}}}updateDefinition(e){var t;if(!this.isGroup)if(!this.parent.isGroup)return t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((i)=>{if(t.field==this.field)this.field=!1;return this.delete().then(()=>i.getComponent())});else return console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups");else return console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")}deleteCell(e){var t=this.cells.indexOf(e);if(t>-1)this.cells.splice(t,1)}getComponent(){if(!this.component)this.component=new ae(this);return this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof V?this.parent.getComponent():!1}}class le{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){if(typeof t[i]<"u")return t[i];else return t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class O extends H{static rowTemplate=O.createRowTemplate();constructor(e,t,i="row"){super(t.table);this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){if(!this.created)this.created=!0,this.generateElement()}createElement(){this.element=O.rowTemplate.cloneNode(!1)}getElement(){return this.create(),this.element}detachElement(){if(this.element&&this.element.parentNode)this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){this.deleteCells();while(this.element.firstChild)this.element.removeChild(this.element.firstChild);if(this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e)this.normalizeHeight();if(this.dispatch("row-layout",this),this.table.options.rowFormatter)this.table.options.rowFormatter(this.getComponent());this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach((e)=>{e.cellRendered()})}reinitializeHeight(){if(this.heightInitialized=!1,this.element&&this.element.offsetParent!==null)this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){if(this.initialized=!1,this.heightInitialized=!1,!this.manualHeight)this.height=0,this.heightStyled="";if(this.element&&this.element.offsetParent!==null)this.initialize(!0);this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;if(this.table.options.rowHeight)this.height=this.table.options.rowHeight;else if(i=this.calcMinHeight(),t=this.calcMaxHeight(),e)this.height=Math.max(t,i);else this.height=this.manualHeight?this.height:Math.max(t,i);this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach(function(t){var i=t.getHeight();if(i>e)e=i}),e}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){if(e&&!this.table.options.rowHeight)this.clearCellHeight();this.calcHeight(e),this.setCellHeight()}setHeight(e,t){if(this.height!=e||t){if(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight"))this.dispatchExternal("rowHeight",this.getComponent())}}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);if(t>-1)this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t=this.element&&L.elVisible(this.element),i={},s;return new Promise((r,o)=>{if(typeof e==="string")e=JSON.parse(e);if(this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing"))i=Object.assign(i,this.data),i=Object.assign(i,e);s=this.chain("row-data-changing",[this,i,e],null,e);let a=[];for(let l in e)this.table.columnManager.getColumnsByFieldRoot(l).forEach((d)=>{let u=this.getCell(d.getField());if(u){let c=d.getFieldValue(s);if(u.getValue()!==c)a.push([u,c])}});for(let l in s)this.data[l]=s[l];if(this.dispatch("row-data-save-after",this),a.forEach(([l,h])=>{if(l.setValueProcessData(h),t)l.cellRendered()}),t){if(this.normalizeHeight(!0),this.table.options.rowFormatter)this.table.options.rowFormatter(this.getComponent())}else this.initialized=!1,this.height=0,this.heightStyled="";if(this.dispatch("row-data-changed",this,t,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged"))this.dispatchExternal("dataChanged",this.table.rowManager.getData());r()})}getData(e){if(e)return this.chain("row-data-retrieve",[this,e],null,this.data);return this.data}getCell(e){var t=!1;if(e=this.table.columnManager.findColumn(e),!this.initialized&&this.cells.length===0)this.generateCells();return t=this.cells.find(function(i){return i.column===e}),t}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find((t)=>t.element===e)}getCells(){if(!this.initialized&&this.cells.length===0)this.generateCells();return this.cells}nextRow(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1}prevRow(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);if(i)this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0);else console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t<e;t++)this.cells[0].delete()}wipe(){if(this.detachModules(),this.deleteCells(),this.element){while(this.element.firstChild)this.element.removeChild(this.element.firstChild);if(this.element.parentNode)this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return this.isDisplayed()?this.position:!1}setPosition(e){if(e!=this.position)this.position=e,this.positionWatchers.forEach((t)=>{t(this.position)})}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){if(!this.component)this.component=new le(this);return this.component}static createRowTemplate(){let e=document.createElement("div");return e.classList.add("tabulator-row"),e.setAttribute("role","row"),e}}function te(e,t){var i=t.mask,s=typeof t.maskLetterChar<"u"?t.maskLetterChar:"A",r=typeof t.maskNumberChar<"u"?t.maskNumberChar:"9",o=typeof t.maskWildcardChar<"u"?t.maskWildcardChar:"*";function a(l){var h=i[l];if(typeof h<"u"&&h!==o&&h!==s&&h!==r)e.value=e.value+""+h,a(l+1)}if(e.addEventListener("keydown",(l)=>{var h=e.value.length,d=l.key;if(l.key.length===1&&!l.ctrlKey&&!l.metaKey)if(h>=i.length)return l.preventDefault(),l.stopPropagation(),!1;else switch(i[h]){case s:if(d.toUpperCase()==d.toLowerCase())return l.preventDefault(),l.stopPropagation(),!1;break;case r:if(isNaN(d))return l.preventDefault(),l.stopPropagation(),!1;break;case o:break;default:if(d!==i[h])return l.preventDefault(),l.stopPropagation(),!1}return}),e.addEventListener("keyup",(l)=>{if(l.key.length===1){if(t.maskAutoFill)a(e.value.length)}}),!e.placeholder)e.placeholder=i;if(t.maskAutoFill)a(e.value.length)}function lt(e,t,i,s,r){var o=e.getValue(),a=document.createElement("input");if(a.setAttribute("type",r.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",r.elementAttributes&&typeof r.elementAttributes=="object")for(let h in r.elementAttributes)if(h.charAt(0)=="+")h=h.slice(1),a.setAttribute(h,a.getAttribute(h)+r.elementAttributes["+"+h]);else a.setAttribute(h,r.elementAttributes[h]);a.value=r.initialValue??(typeof o<"u"?o:""),t(function(){if(e.getType()==="cell"){if(a.focus({preventScroll:!0}),a.style.height="100%",r.selectContents)a.select()}});function l(h){if((o===null||typeof o>"u")&&a.value!==""||a.value!==o){if(i(a.value,h))o=a.value}else s(h)}if(a.addEventListener("change",l),a.addEventListener("blur",l),a.addEventListener("keydown",function(h){switch(h.key){case"Enter":l(h);break;case"Escape":s(h);break;case"End":case"Home":h.stopPropagation();break}}),r.mask)te(a,r);return a}function ht(e,t,i,s,r){var o=e.getValue(),a=r.verticalNavigation||"hybrid",l=String(o!==null&&typeof o<"u"?o:""),h=document.createElement("textarea"),d=0;if(h.style.display="block",h.style.padding="2px",h.style.height="100%",h.style.width="100%",h.style.boxSizing="border-box",h.style.whiteSpace="pre-wrap",h.style.resize="none",r.elementAttributes&&typeof r.elementAttributes=="object")for(let c in r.elementAttributes)if(c.charAt(0)=="+")c=c.slice(1),h.setAttribute(c,h.getAttribute(c)+r.elementAttributes["+"+c]);else h.setAttribute(c,r.elementAttributes[c]);h.value=r.initialValue??l,t(function(){if(e.getType()==="cell"){if(h.focus({preventScroll:!0}),h.style.height="100%",h.scrollHeight,h.style.height=h.scrollHeight+"px",e.getRow().normalizeHeight(),r.selectContents)h.select()}});function u(c){if((o===null||typeof o>"u")&&h.value!==""||h.value!==o){if(i(h.value,c))o=h.value;setTimeout(function(){e.getRow().normalizeHeight()},300)}else s(c)}if(h.addEventListener("change",u),h.addEventListener("blur",u),h.addEventListener("keyup",function(){h.style.height="";var c=h.scrollHeight;if(h.style.height=c+"px",c!=d)d=c,e.getRow().normalizeHeight()}),h.addEventListener("keydown",function(c){switch(c.key){case"Enter":if(c.shiftKey&&r.shiftEnterSubmit)u(c);else if(c.shiftKey&&r.shiftEnterNewLine||c.altKey&&r.altEnterNewLine||c.ctrlKey&&r.ctrlEnterNewLine||c.metaKey&&r.metaEnterNewLine)c.preventDefault(),h.setRangeText(`
4
4
  `,h.selectionStart,h.selectionEnd,"end");else if(r.enterSubmit)c.preventDefault(),u(c);break;case"Escape":s(c);break;case"ArrowUp":if(a=="editor"||a=="hybrid"&&h.selectionStart)c.stopImmediatePropagation(),c.stopPropagation();break;case"ArrowDown":if(a=="editor"||a=="hybrid"&&h.selectionStart!==h.value.length)c.stopImmediatePropagation(),c.stopPropagation();break;case"End":case"Home":c.stopPropagation();break}}),r.mask)te(h,r);return h}function dt(e,t,i,s,r){var o=e.getValue(),a=r.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),typeof r.max<"u")l.setAttribute("max",r.max);if(typeof r.min<"u")l.setAttribute("min",r.min);if(typeof r.step<"u")l.setAttribute("step",r.step);if(l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",r.elementAttributes&&typeof r.elementAttributes=="object")for(let u in r.elementAttributes)if(u.charAt(0)=="+")u=u.slice(1),l.setAttribute(u,l.getAttribute(u)+r.elementAttributes["+"+u]);else l.setAttribute(u,r.elementAttributes[u]);l.value=o;var h=function(u){d(u)};t(function(){if(e.getType()==="cell"){if(l.removeEventListener("blur",h),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",h),r.selectContents)l.select()}});function d(u){var c=l.value;if(!isNaN(c)&&c!=="")c=Number(c);if(c!==o){if(i(c,u))o=c}else s(u)}if(l.addEventListener("keydown",function(u){switch(u.key){case"Enter":d(u);break;case"Escape":s(u);break;case"ArrowUp":case"ArrowDown":if(a=="editor")u.stopImmediatePropagation(),u.stopPropagation();break;case"End":case"Home":u.stopPropagation();break}}),r.mask)te(l,r);return l}function ut(e,t,i,s,r){var o=e.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),typeof r.max<"u")a.setAttribute("max",r.max);if(typeof r.min<"u")a.setAttribute("min",r.min);if(typeof r.step<"u")a.setAttribute("step",r.step);if(a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",r.elementAttributes&&typeof r.elementAttributes=="object")for(let h in r.elementAttributes)if(h.charAt(0)=="+")h=h.slice(1),a.setAttribute(h,a.getAttribute(h)+r.elementAttributes["+"+h]);else a.setAttribute(h,r.elementAttributes[h]);a.value=o,t(function(){if(e.getType()==="cell")a.focus({preventScroll:!0}),a.style.height="100%"});function l(h){var d=a.value;if(!isNaN(d)&&d!=="")d=Number(d);if(d!=o){if(i(d,h))o=d}else s(h)}return a.addEventListener("blur",function(h){l(h)}),a.addEventListener("keydown",function(h){switch(h.key){case"Enter":l(h);break;case"Escape":s(h);break}}),a}function ct(e,t,i,s,r){var o=r.format,a=r.verticalNavigation||"editor",l=o?window.DateTime||luxon.DateTime:null,h=e.getValue(),d=document.createElement("input");function u(f){var p;if(l.isDateTime(f))p=f;else if(o==="x")p=l.fromMillis(f);else if(o==="iso")p=l.fromISO(String(f));else p=l.fromFormat(String(f),o);return p.toFormat("yyyy-MM-dd")}if(d.type="date",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",r.max)d.setAttribute("max",o?u(r.max):r.max);if(r.min)d.setAttribute("min",o?u(r.min):r.min);if(r.elementAttributes&&typeof r.elementAttributes=="object")for(let f in r.elementAttributes)if(f.charAt(0)=="+")f=f.slice(1),d.setAttribute(f,d.getAttribute(f)+r.elementAttributes["+"+f]);else d.setAttribute(f,r.elementAttributes[f]);if(h=typeof h<"u"?h:"",o)if(l)h=u(h);else console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");d.value=h,t(function(){if(e.getType()==="cell"){if(d.focus({preventScroll:!0}),d.style.height="100%",r.selectContents)d.select()}});function c(f){var p=d.value,m;if((h===null||typeof h>"u")&&p!==""||p!==h){if(p&&o)switch(m=l.fromFormat(String(p),"yyyy-MM-dd"),o){case!0:p=m;break;case"x":p=m.toMillis();break;case"iso":p=m.toISO();break;default:p=m.toFormat(o)}if(i(p,f))h=d.value}else s(f)}return d.addEventListener("blur",function(f){if(f.relatedTarget||f.rangeParent||f.explicitOriginalTarget!==d)c(f)}),d.addEventListener("keydown",function(f){switch(f.key){case"Enter":c(f);break;case"Escape":s(f);break;case"End":case"Home":f.stopPropagation();break;case"ArrowUp":case"ArrowDown":if(a=="editor")f.stopImmediatePropagation(),f.stopPropagation();break}}),d}function ft(e,t,i,s,r){var o=r.format,a=r.verticalNavigation||"editor",l=o?window.DateTime||luxon.DateTime:null,h,d=e.getValue(),u=document.createElement("input");if(u.type="time",u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",r.elementAttributes&&typeof r.elementAttributes=="object")for(let f in r.elementAttributes)if(f.charAt(0)=="+")f=f.slice(1),u.setAttribute(f,u.getAttribute(f)+r.elementAttributes["+"+f]);else u.setAttribute(f,r.elementAttributes[f]);if(d=typeof d<"u"?d:"",o)if(l){if(l.isDateTime(d))h=d;else if(o==="x")h=l.fromMillis(d);else if(o==="iso")h=l.fromISO(String(d));else h=l.fromFormat(String(d),o);d=h.toFormat("HH:mm")}else console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");u.value=d,t(function(){if(e.getType()=="cell"){if(u.focus({preventScroll:!0}),u.style.height="100%",r.selectContents)u.select()}});function c(f){var p=u.value,m;if((d===null||typeof d>"u")&&p!==""||p!==d){if(p&&o)switch(m=l.fromFormat(String(p),"hh:mm"),o){case!0:p=m;break;case"x":p=m.toMillis();break;case"iso":p=m.toISO();break;default:p=m.toFormat(o)}if(i(p,f))d=u.value}else s(f)}return u.addEventListener("blur",function(f){if(f.relatedTarget||f.rangeParent||f.explicitOriginalTarget!==u)c(f)}),u.addEventListener("keydown",function(f){switch(f.key){case"Enter":c(f);break;case"Escape":s(f);break;case"End":case"Home":f.stopPropagation();break;case"ArrowUp":case"ArrowDown":if(a=="editor")f.stopImmediatePropagation(),f.stopPropagation();break}}),u}function pt(e,t,i,s,r){var o=r.format,a=r.verticalNavigation||"editor",l=o?this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"):null,h,d=e.getValue(),u=document.createElement("input");if(u.type="datetime-local",u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",r.elementAttributes&&typeof r.elementAttributes=="object")for(let f in r.elementAttributes)if(f.charAt(0)=="+")f=f.slice(1),u.setAttribute(f,u.getAttribute(f)+r.elementAttributes["+"+f]);else u.setAttribute(f,r.elementAttributes[f]);if(d=typeof d<"u"?d:"",o)if(l){if(l.isDateTime(d))h=d;else if(o==="x")h=l.fromMillis(d);else if(o==="iso")h=l.fromISO(String(d));else h=l.fromFormat(String(d),o);d=h.toFormat("yyyy-MM-dd")+"T"+h.toFormat("HH:mm")}else console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");u.value=d,t(function(){if(e.getType()==="cell"){if(u.focus({preventScroll:!0}),u.style.height="100%",r.selectContents)u.select()}});function c(f){var p=u.value,m;if((d===null||typeof d>"u")&&p!==""||p!==d){if(p&&o)switch(m=l.fromISO(String(p)),o){case!0:p=m;break;case"x":p=m.toMillis();break;case"iso":p=m.toISO();break;default:p=m.toFormat(o)}if(i(p,f))d=u.value}else s(f)}return u.addEventListener("blur",function(f){if(f.relatedTarget||f.rangeParent||f.explicitOriginalTarget!==u)c(f)}),u.addEventListener("keydown",function(f){switch(f.key){case"Enter":c(f);break;case"Escape":s(f);break;case"End":case"Home":f.stopPropagation();break;case"ArrowUp":case"ArrowDown":if(a=="editor")f.stopImmediatePropagation(),f.stopPropagation();break}}),u}var gt=class e{constructor(t,i,s,r,o,a){this.edit=t,this.table=t.table,this.cell=i,this.params=this._initializeParams(a),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=i.getType()==="header",this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:r,cancel:o},this._deprecatedOptionsCheck(),this._initializeValue(),s(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var t=this.cell.getValue();if(typeof t>"u"&&typeof this.params.defaultValue<"u")t=this.params.defaultValue;if(this.initialValues=this.params.multiselect?t:[t],this.isFilter)this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen()}_onRendered(){var t=this.cell.getElement();function i(s){s.stopPropagation()}if(!this.isFilter)this.input.style.height="100%",this.input.focus({preventScroll:!0});t.addEventListener("click",i),setTimeout(()=>{t.removeEventListener("click",i)},1000),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var t=document.createElement("div");return t.classList.add("tabulator-edit-list"),t.addEventListener("mousedown",this._preventBlur.bind(this)),t.addEventListener("keydown",this._inputKeyDown.bind(this)),t}_setListWidth(){var t=this.isFilter?this.input:this.cell.getElement();if(this.listEl.style.minWidth=t.offsetWidth+"px",this.params.maxWidth)if(this.params.maxWidth===!0)this.listEl.style.maxWidth=t.offsetWidth+"px";else if(typeof this.params.maxWidth==="number")this.listEl.style.maxWidth=this.params.maxWidth+"px";else this.listEl.style.maxWidth=this.params.maxWidth}_createInputElement(){var t=this.params.elementAttributes,i=document.createElement("input");if(i.setAttribute("type",this.params.clearable?"search":"text"),i.style.padding="4px",i.style.width="100%",i.style.boxSizing="border-box",!this.params.autocomplete)i.style.cursor="default",i.style.caretColor="transparent";if(t&&typeof t=="object")for(let s in t)if(s.charAt(0)=="+")s=s.slice(1),i.setAttribute(s,i.getAttribute(s)+t["+"+s]);else i.setAttribute(s,t[s]);if(this.params.mask)te(i,this.params);return this._bindInputEvents(i),i}_initializeParams(t){var i=["values","valuesURL","valuesLookup"],s;if(t=Object.assign({},t),t.verticalNavigation=t.verticalNavigation||"editor",t.placeholderLoading=typeof t.placeholderLoading>"u"?"Searching ...":t.placeholderLoading,t.placeholderEmpty=typeof t.placeholderEmpty>"u"?"No Results Found":t.placeholderEmpty,t.filterDelay=typeof t.filterDelay>"u"?300:t.filterDelay,t.emptyValue=Object.keys(t).includes("emptyValue")?t.emptyValue:"",s=Object.keys(t).filter((r)=>i.includes(r)).length,!s)console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set");else if(s>1)console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor");if(t.autocomplete){if(t.multiselect)t.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")}else{if(t.freetext)t.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled");if(t.filterFunc)t.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled");if(t.filterRemote)t.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled");if(t.mask)t.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled");if(t.allowEmpty)t.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled");if(t.listOnEmpty)t.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled")}if(t.filterRemote&&!(typeof t.valuesLookup==="function"||t.valuesURL))t.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source");return t}_bindInputEvents(t){if(t.addEventListener("focus",this._inputFocus.bind(this)),t.addEventListener("click",this._inputClick.bind(this)),t.addEventListener("blur",this._inputBlur.bind(this)),t.addEventListener("keydown",this._inputKeyDown.bind(this)),t.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete)t.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(t){this.rebuildOptionsList()}_filter(){if(this.params.filterRemote)clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{this.rebuildOptionsList()},this.params.filterDelay);else this._filterList()}_inputClick(t){t.stopPropagation()}_inputBlur(t){if(this.blurable)if(this.popup)this.popup.hide();else this._resolveValue(!0,t)}_inputSearch(){this._clearChoices()}_inputKeyDown(t){switch(t.key){case"ArrowUp":this._keyUp(t);break;case"ArrowDown":this._keyDown(t);break;case"ArrowLeft":case"ArrowRight":this._keySide(t);break;case"Enter":this._keyEnter(t);break;case"Escape":this._keyEsc(t);break;case"Home":case"End":this._keyHomeEnd(t);break;case"Tab":this._keyTab(t);break;default:this._keySelectLetter(t)}}_inputKeyUp(t){switch(t.key){case"ArrowUp":case"ArrowLeft":case"ArrowRight":case"ArrowDown":case"Enter":case"Escape":break;default:this._keyAutoCompLetter(t)}}_preventPopupBlur(){if(this.popup)this.popup.blockHide();setTimeout(()=>{if(this.popup)this.popup.restoreHide()},10)}_preventBlur(){this.blurable=!1,setTimeout(()=>{this.blurable=!0},10)}_keyTab(t){if(this.params.autocomplete&&this.lastAction==="typing")this._resolveValue(!0,t);else if(this.focusedItem)this._chooseItem(this.focusedItem,!0)}_keyUp(t){var i=this.displayItems.indexOf(this.focusedItem);if(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&i){if(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault(),i>0)this._focusItem(this.displayItems[i-1])}}_keyDown(t){var i=this.displayItems.indexOf(this.focusedItem);if(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&i<this.displayItems.length-1){if(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault(),i<this.displayItems.length-1)if(i==-1)this._focusItem(this.displayItems[0]);else this._focusItem(this.displayItems[i+1])}}_keySide(t){if(!this.params.autocomplete)t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()}_keyEnter(t){if(this.params.autocomplete&&this.lastAction==="typing")this._resolveValue(!0,t);else if(this.focusedItem)if(this.isFilter&&!this.params.multiselect&&this.focusedItem.selected)this._resolveValue(!1,t);else this._chooseItem(this.focusedItem,!1,t)}_keyEsc(t){this._cancel(t)}_keyHomeEnd(t){if(this.params.autocomplete)t.stopImmediatePropagation()}_keySelectLetter(t){if(!this.params.autocomplete){if(t.preventDefault(),t.key.length===1)this._scrollToValue(t.key.toUpperCase().charCodeAt(0))}}_keyAutoCompLetter(t){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(t){clearTimeout(this.filterTimeout);var i=String.fromCharCode(t).toLowerCase();this.filterTerm+=i.toLowerCase();var s=this.displayItems.find((r)=>typeof r.label<"u"&&r.label.toLowerCase().startsWith(this.filterTerm));if(s)this._focusItem(s);this.filterTimeout=setTimeout(()=>{this.filterTerm=""},800)}_focusItem(t){if(this.lastAction="focus",this.focusedItem&&this.focusedItem.element)this.focusedItem.element.classList.remove("focused");if(this.focusedItem=t,t&&t.element)t.element.classList.add("focused"),t.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((t)=>{if(!Number.isInteger(t))console.error("List generation error",t)})}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(t){var i=[],s=++this.listIteration;if(this.filtered=!1,this.params.values)i=this.params.values;else if(this.params.valuesURL)i=this._ajaxRequest(this.params.valuesURL,this.input.value);else if(typeof this.params.valuesLookup==="function")i=this.params.valuesLookup(this.cell,this.input.value);else if(this.params.valuesLookup)i=this._uniqueColumnValues(this.params.valuesLookupField);if(i instanceof Promise){if(!t)this._addPlaceholder(this.params.placeholderLoading);return i.then().then((r)=>{if(this.listIteration===s)return this._parseList(r);else return Promise.reject(s)})}else return Promise.resolve(this._parseList(i))}_addPlaceholder(t){var i=document.createElement("div");if(typeof t==="function")t=t(this.cell.getComponent(),this.listEl);if(t){if(this._clearList(),t instanceof HTMLElement)i=t;else i.classList.add("tabulator-edit-list-placeholder"),i.innerHTML=t;this.listEl.appendChild(i),this._showList()}}_ajaxRequest(t,i){var s=this.params.filterRemote?{term:i}:{};return t=it(t,{},s),fetch(t).then((r)=>{if(r.ok)return r.json().catch((o)=>(console.warn("List Ajax Load Error - Invalid JSON returned",o),Promise.reject(o)));else return console.error("List Ajax Load Error - Connection Error: "+r.status,r.statusText),Promise.reject(r)}).catch((r)=>(console.error("List Ajax Load Error - Connection Error: ",r),Promise.reject(r)))}_uniqueColumnValues(t){var i={},s=this.table.getData(this.params.valuesLookup),r;if(t)r=this.table.columnManager.getColumnByField(t);else r=this.cell.getColumn()._getSelf();if(r)s.forEach((o)=>{var a=r.getFieldValue(o);if(!this._emptyValueCheck(a))if(this.params.multiselect&&Array.isArray(a))a.forEach((l)=>{if(!this._emptyValueCheck(l))i[l]=!0});else i[a]=!0});else console.warn("unable to find matching column to create select lookup list:",t),i=[];return Object.keys(i)}_emptyValueCheck(t){return t===null||typeof t>"u"||t===""}_parseList(t){var i=[];if(!Array.isArray(t))t=Object.entries(t).map(([s,r])=>({label:r,value:s}));if(t.forEach((s)=>{if(typeof s!=="object")s={label:s,value:s};this._parseListItem(s,i,0)}),!this.currentItems.length&&this.params.freetext)this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing";if(this.params.multiselect)this.initialValues=null;return this.data=i,i}_parseListItem(t,i,s){var r={};if(t.options)r=this._parseListGroup(t,s+1);else if(r={label:t.label,value:t.value,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1,selected:!1,visible:!0,level:s,original:t},this.params.multiselect){var o=this.currentItems.findIndex((a)=>a.value===t.value);if(o>-1){if(this.focusedItem===this.currentItems[o])this.focusedItem=r;this.currentItems[o]=r,r.selected=!0}else if(this.initialValues&&this.initialValues.indexOf(t.value)>-1)this._chooseItem(r,!0)}else if(this.initialValues&&this.initialValues.indexOf(t.value)>-1)this._chooseItem(r,!0);i.push(r)}_parseListGroup(t,i){var s={label:t.label,group:!0,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1,visible:!0,level:i,options:[],original:t};return t.options.forEach((r)=>{this._parseListItem(r,s.options,i)}),s}_sortOptions(t){var i;if(this.params.sort)i=typeof this.params.sort==="function"?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(i,t);return t}_sortGroup(t,i){i.sort((s,r)=>t(s.label,r.label,s.value,r.value,s.original,r.original)),i.forEach((s)=>{if(s.group)this._sortGroup(t,s.options)})}_defaultSortFunction(t,i){var s,r,o,a,l=0,h,d=/(\d+)|(\D+)/g,u=/\d/,c=0;if(this.params.sort==="desc")[t,i]=[i,t];if(!t&&t!==0)c=!i&&i!==0?0:-1;else if(!i&&i!==0)c=1;else{if(isFinite(t)&&isFinite(i))return t-i;if(s=String(t).toLowerCase(),r=String(i).toLowerCase(),s===r)return 0;if(!(u.test(s)&&u.test(r)))return s>r?1:-1;s=s.match(d),r=r.match(d),h=s.length>r.length?r.length:s.length;while(l<h)if(o=s[l],a=r[l++],o!==a)if(isFinite(o)&&isFinite(a)){if(o.charAt(0)==="0")o="."+o;if(a.charAt(0)==="0")a="."+a;return o-a}else return o>a?1:-1;return s.length>r.length}return c}_filterOptions(){var t=this.params.filterFunc||this._defaultFilterFunc,i=this.input.value;if(i)this.filtered=!0,this.data.forEach((s)=>{this._filterItem(t,i,s)});else this.filtered=!1;return this.data}_filterItem(t,i,s){var r=!1;if(!s.group)s.visible=t(i,s.label,s.value,s.original);else s.options.forEach((o)=>{if(this._filterItem(t,i,o))r=!0}),s.visible=r;return s.visible}_defaultFilterFunc(t,i,s,r){if(t=String(t).toLowerCase(),i!==null&&typeof i<"u"){if(String(i).toLowerCase().indexOf(t)>-1||String(s).toLowerCase().indexOf(t)>-1)return!0}return!1}_clearList(){while(this.listEl.firstChild)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(t){if(this._clearList(),t.forEach((i)=>{this._buildItem(i)}),!this.displayItems.length)this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(t){var i=t.element,s;if(!this.filtered||t.visible){if(!i){if(i=document.createElement("div"),i.tabIndex=0,s=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,i):t.label,s instanceof HTMLElement)i.appendChild(s);else i.innerHTML=s;if(t.group)i.classList.add("tabulator-edit-list-group");else i.classList.add("tabulator-edit-list-item");if(i.classList.add("tabulator-edit-list-group-level-"+t.level),t.elementAttributes&&typeof t.elementAttributes=="object")for(let r in t.elementAttributes)if(r.charAt(0)=="+")r=r.slice(1),i.setAttribute(r,this.input.getAttribute(r)+t.elementAttributes["+"+r]);else i.setAttribute(r,t.elementAttributes[r]);if(t.group)i.addEventListener("click",this._groupClick.bind(this,t));else i.addEventListener("click",this._itemClick.bind(this,t));i.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=i}if(this._styleItem(t),this.listEl.appendChild(i),t.group)t.options.forEach((r)=>{this._buildItem(r)});else this.displayItems.push(t)}}_showList(){var t=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&this.input.value===""&&!this.params.listOnEmpty){if(this.popup)this.popup.hide(!0);return}if(this._setListWidth(),!this.popup)this.popup=this.edit.popup(this.listEl);if(this.popup.show(this.cell.getElement(),"bottom"),!t)setTimeout(()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))},10)}}_styleItem(t){if(t&&t.element)if(t.selected)t.element.classList.add("active");else t.element.classList.remove("active")}_itemClick(t,i){i.stopPropagation(),this._chooseItem(t,!1,i)}_groupClick(t,i){i.stopPropagation()}_cancel(t){this.popup.hide(!0),this.actions.cancel(t)}_clearChoices(){this.typing=!0,this.currentItems.forEach((t)=>{t.selected=!1,this._styleItem(t)}),this.currentItems=[],this.focusedItem=null}_chooseItem(t,i,s){var r;if(this.typing=!1,this.params.multiselect){if(r=this.currentItems.indexOf(t),r>-1)this.currentItems.splice(r,1),t.selected=!1;else this.currentItems.push(t),t.selected=!0;this.input.value=this.currentItems.map((o)=>o.label).join(","),this._styleItem(t)}else{if(this.isFilter&&!i&&t.selected){this._clearChoices(),this.input.value="",this._resolveValue(!1,s);return}if(this.currentItems=[t],t.selected=!0,this.input.value=t.label,this._styleItem(t),!i)this._resolveValue(!1,s)}this._focusItem(t)}_resolveValue(t,i){var s,r;if(this.popup)this.popup.hide(!0);if(this.params.multiselect)s=this.currentItems.map((o)=>o.value);else if(t&&this.params.autocomplete&&this.typing)if(this.params.freetext||this.params.allowEmpty&&this.input.value==="")s=this.input.value;else{this.actions.cancel(i);return}else if(this.currentItems[0])s=this.currentItems[0].value;else if(this.isFilter&&this.focusedItem&&this.focusedItem.selected)s=this.focusedItem.value;else if(r=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues,r===null||typeof r>"u"||r==="")s=r;else s=this.params.emptyValue;if(s==="")s=this.params.emptyValue;if(this.actions.success(s,i),this.isFilter)this.initialValues=s&&!Array.isArray(s)?[s]:s,this.currentItems=[]}};function bt(e,t,i,s,r){var o=new gt(this,e,t,i,s,r);return o.input}function vt(e,t,i,s,r){var o=this,a=e.getElement(),l=e.getValue(),h=a.getElementsByTagName("svg").length||5,d=a.getElementsByTagName("svg")[0]?a.getElementsByTagName("svg")[0].getAttribute("width"):14,u=[],c=document.createElement("div"),f=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(w){u.forEach(function(R,S){if(S<w){if(o.table.browser=="ie")R.setAttribute("class","tabulator-star-active");else R.classList.replace("tabulator-star-inactive","tabulator-star-active");R.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'}else{if(o.table.browser=="ie")R.setAttribute("class","tabulator-star-inactive");else R.classList.replace("tabulator-star-active","tabulator-star-inactive");R.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'}})}function m(w){var R=document.createElement("span"),S=f.cloneNode(!0);u.push(S),R.addEventListener("mouseenter",function(k){k.stopPropagation(),k.stopImmediatePropagation(),p(w)}),R.addEventListener("mousemove",function(k){k.stopPropagation(),k.stopImmediatePropagation()}),R.addEventListener("click",function(k){k.stopPropagation(),k.stopImmediatePropagation(),i(w,k),a.blur()}),R.appendChild(S),c.appendChild(R)}function b(w){l=w,p(w)}if(a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",c.style.verticalAlign="middle",c.style.display="inline-block",c.style.padding="4px",f.setAttribute("width",d),f.setAttribute("height",d),f.setAttribute("viewBox","0 0 512 512"),f.setAttribute("xml:space","preserve"),f.style.padding="0 1px",r.elementAttributes&&typeof r.elementAttributes=="object")for(let w in r.elementAttributes)if(w.charAt(0)=="+")w=w.slice(1),c.setAttribute(w,c.getAttribute(w)+r.elementAttributes["+"+w]);else c.setAttribute(w,r.elementAttributes[w]);for(var v=1;v<=h;v++)m(v);return l=Math.min(parseInt(l),h),p(l),c.addEventListener("mousemove",function(w){p(0)}),c.addEventListener("click",function(w){i(0,w)}),a.addEventListener("blur",function(w){s(w)}),a.addEventListener("keydown",function(w){switch(w.key){case"ArrowRight":b(l+1);break;case"ArrowLeft":b(l-1);break;case"Enter":i(l,w);break;case"Escape":s(w);break}}),c}function wt(e,t,i,s,r){var o=e.getElement(),a=typeof r.max>"u"?o.getElementsByTagName("div")[0]&&o.getElementsByTagName("div")[0].getAttribute("max")||100:r.max,l=typeof r.min>"u"?o.getElementsByTagName("div")[0]&&o.getElementsByTagName("div")[0].getAttribute("min")||0:r.min,h=(a-l)/100,d=e.getValue()||0,u=document.createElement("div"),c=document.createElement("div"),f,p;function m(b){var v=window.getComputedStyle(o,null),w=h*Math.round(c.offsetWidth/((o.clientWidth-parseInt(v.getPropertyValue("padding-left"))-parseInt(v.getPropertyValue("padding-right")))/100))+l;i(w,b),o.setAttribute("aria-valuenow",w),o.setAttribute("aria-label",d)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),c.style.display="inline-block",c.style.position="relative",c.style.height="100%",c.style.backgroundColor="#488CE9",c.style.maxWidth="100%",c.style.minWidth="0%",r.elementAttributes&&typeof r.elementAttributes=="object")for(let b in r.elementAttributes)if(b.charAt(0)=="+")b=b.slice(1),c.setAttribute(b,c.getAttribute(b)+r.elementAttributes["+"+b]);else c.setAttribute(b,r.elementAttributes[b]);return o.style.padding="4px 4px",d=Math.min(parseFloat(d),a),d=Math.max(parseFloat(d),l),d=Math.round((d-l)/h),c.style.width=d+"%",o.setAttribute("aria-valuemin",l),o.setAttribute("aria-valuemax",a),c.appendChild(u),u.addEventListener("mousedown",function(b){f=b.screenX,p=c.offsetWidth}),u.addEventListener("mouseover",function(){u.style.cursor="ew-resize"}),o.addEventListener("mousemove",function(b){if(f)c.style.width=p+b.screenX-f+"px"}),o.addEventListener("mouseup",function(b){if(f)b.stopPropagation(),b.stopImmediatePropagation(),f=!1,p=!1,m(b)}),o.addEventListener("keydown",function(b){switch(b.key){case"ArrowRight":b.preventDefault(),c.style.width=c.clientWidth+o.clientWidth/100+"px";break;case"ArrowLeft":b.preventDefault(),c.style.width=c.clientWidth-o.clientWidth/100+"px";break;case"Tab":case"Enter":m(b);break;case"Escape":s(b);break}}),o.addEventListener("blur",function(b){s(b)}),c}function Ct(e,t,i,s,r){var o=e.getValue(),a=document.createElement("input"),l=r.tristate,h=typeof r.indeterminateValue>"u"?null:r.indeterminateValue,d=!1,u=Object.keys(r).includes("trueValue"),c=Object.keys(r).includes("falseValue");if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",r.elementAttributes&&typeof r.elementAttributes=="object")for(let p in r.elementAttributes)if(p.charAt(0)=="+")p=p.slice(1),a.setAttribute(p,a.getAttribute(p)+r.elementAttributes["+"+p]);else a.setAttribute(p,r.elementAttributes[p]);if(a.value=o,l&&(typeof o>"u"||o===h||o===""))d=!0,a.indeterminate=!0;if(this.table.browser!="firefox"&&this.table.browser!="safari")t(function(){if(e.getType()==="cell")a.focus({preventScroll:!0})});a.checked=u?o===r.trueValue:o===!0||o==="true"||o==="True"||o===1;function f(p){var m=a.checked;if(u&&m)m=r.trueValue;else if(c&&!m)m=r.falseValue;if(l)if(!p)if(a.checked&&!d)return a.checked=!1,a.indeterminate=!0,d=!0,h;else return d=!1,m;else if(d)return h;else return m;else return m}return a.addEventListener("change",function(p){i(f(),p)}),a.addEventListener("blur",function(p){i(f(!0),p)}),a.addEventListener("keydown",function(p){if(p.key=="Enter")i(f(),p);if(p.key=="Escape")s(p)}),a}function Et(e,t,i,s,r){var o=e._getSelf().column,a,l,h;function d(u){var c=u.getValue(),f="input";switch(typeof c){case"number":f="number";break;case"boolean":f="tickCross";break;case"string":if(c.includes(`
@@ -8,29 +8,29 @@ import"./studio-pr23qhrw.js";import"./studio-tpmnbgmt.js";import"./studio-6vrxzk
8
8
  Expecting: array
9
9
  Received: `,typeof e,`
10
10
  Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach((e)=>{e.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);if(s>-1)this.activeRows.splice(s,1);if(i>-1)this.rows.splice(i,1);if(this.setActiveRows(this.activeRows),this.displayRowIterator((r)=>{var o=r.indexOf(e);if(o>-1)r.splice(o,1)}),!t)this.reRenderInPosition();if(this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),!this.displayRowsCount)this.tableEmpty();if(this.subscribedExternal("dataChanged"))this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){var r=this.addRowActual(e,t,i,s);return r}addRows(e,t,i,s){var r=[];return new Promise((o,a)=>{if(t=this.findAddRowPos(t),!Array.isArray(e))e=[e];if(typeof i>"u"&&t||typeof i<"u"&&!t)e.reverse();if(e.forEach((l,h)=>{var d=this.addRow(l,t,i,!0);r.push(d),this.dispatch("row-added",d,l,t,i)}),this.refreshActiveData(s?"displayPipeline":!1,!1,!0),this.regenerateRowPositions(),this.displayRowsCount)this._clearPlaceholder();o(r)})}findAddRowPos(e){if(typeof e>"u")e=this.table.options.addRowPos;if(e==="pos")e=!0;if(e==="bottom")e=!1;return e}addRowActual(e,t,i,s){var r=e instanceof O?e:new O(e||{},this),o=this.findAddRowPos(t),a=-1,l,h;if(!i)h=this.chain("row-adding-position",[r,o],null,{index:i,top:o}),i=h.index,o=h.top;if(typeof i<"u")i=this.findRow(i);if(i=this.chain("row-adding-index",[r,i,o],null,i),i)a=this.rows.indexOf(i);if(i&&a>-1){if(l=this.activeRows.indexOf(i),this.displayRowIterator(function(d){var u=d.indexOf(i);if(u>-1)d.splice(o?u:u+1,0,r)}),l>-1)this.activeRows.splice(o?l:l+1,0,r);this.rows.splice(o?a:a+1,0,r)}else if(o)this.displayRowIterator(function(d){d.unshift(r)}),this.activeRows.unshift(r),this.rows.unshift(r);else this.displayRowIterator(function(d){d.push(r)}),this.activeRows.push(r),this.rows.push(r);if(this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged"))this.dispatchExternal("dataChanged",this.table.rowManager.getData());if(!s)this.reRenderInPosition();return r}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((s)=>{this.moveRowInArray(s,e,t,i)}),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var r,o,a,l;if(t!==i){if(r=e.indexOf(t),r>-1)if(e.splice(r,1),o=e.indexOf(i),o>-1)if(s)e.splice(o+1,0,t);else e.splice(o,0,t);else e.splice(r,0,t);if(e===this.getDisplayRows()){a=r<o?r:o,l=o>r?o:r+1;for(let h=a;h<=l;h++)if(e[h])this.styleRow(e[h],h)}}}clearData(){this.setData([])}getRowIndex(e){return this.findRowIndex(e,this.rows)}getDisplayRowIndex(e){var t=this.getDisplayRows().indexOf(e);return t>-1?t:!1}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;if(i!==!1&&i<this.displayRowsCount-1)s=this.getDisplayRows()[i+1];if(s&&(!(s instanceof O)||s.type!="row"))return this.nextDisplayRow(s,t);return s}prevDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;if(i)s=this.getDisplayRows()[i-1];if(t&&s&&(!(s instanceof O)||s.type!="row"))return this.prevDisplayRow(s,t);return s}findRowIndex(e,t){var i;if(e=this.findRow(e),e){if(i=t.indexOf(e),i>-1)return i}return!1}getData(e,t){var i=[],s=this.getRows(e);return s.forEach(function(r){if(r.type=="row")i.push(r.getData(t||"data"))}),i}getComponents(e){var t=[],i=this.getRows(e);return i.forEach(function(s){t.push(s.getComponent())}),t}getDataCount(e){var t=this.getRows(e);return t.length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){if(typeof t<"u")this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((i,s)=>i.priority-s.priority);else console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){if(typeof t<"u")this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((i,s)=>i.priority-s.priority);else console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,t,i){var s=this.table,r="",o=0,a=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if(typeof e==="function")if(o=this.dataPipeline.findIndex((l)=>l.handler===e),o>-1){if(r="dataPipeline",t)if(o==this.dataPipeline.length-1)r="display";else o++}else if(o=this.displayPipeline.findIndex((l)=>l.handler===e),o>-1){if(r="displayPipeline",t)if(o==this.displayPipeline.length-1)r="end";else o++}else{console.error("Unable to refresh data, invalid handler provided",e);return}else r=e||"all",o=0;if(this.redrawBlock){if(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===r&&o<this.redrawBlockRestoreConfig.index||a.indexOf(r)<a.indexOf(this.redrawBlockRestoreConfig.stage)))this.redrawBlockRestoreConfig={handler:e,skipStage:t,renderInPosition:i,stage:r,index:o};return}else{if(L.elVisible(this.element))if(i)this.reRenderInPosition(this.refreshPipelines.bind(this,e,r,o,i));else{if(this.refreshPipelines(e,r,o,i),!e)this.table.columnManager.renderer.renderColumns();if(this.renderTable(),s.options.layoutColumnsOnNewData)this.table.columnManager.redraw(!0)}else this.refreshPipelines(e,r,o,i);this.dispatch("data-refreshed")}}}refreshPipelines(e,t,i,s){if(this.dispatch("data-refreshing"),!e||!this.activeRowsPipeline[0])this.activeRowsPipeline[0]=this.rows.slice(0);switch(t){case"all":case"dataPipeline":for(let r=i;r<this.dataPipeline.length;r++){let o=this.dataPipeline[r].handler(this.activeRowsPipeline[r].slice(0));this.activeRowsPipeline[r+1]=o||this.activeRowsPipeline[r].slice(0)}this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);case"display":i=0,this.resetDisplayRows();case"displayPipeline":for(let r=i;r<this.displayPipeline.length;r++){let o=this.displayPipeline[r].handler((r?this.getDisplayRows(r-1):this.activeRows).slice(0),s);this.setDisplayRows(o||this.getDisplayRows(r-1).slice(0),r)}case"end":this.regenerateRowPositions()}if(this.getDisplayRows().length)this._clearPlaceholder()}regenerateRowPositions(){var e=this.getDisplayRows(),t=1;e.forEach((i)=>{if(i.type==="row")i.setPosition(t),t++})}setActiveRows(e){this.activeRows=e.slice(),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){if(this.displayRows[t]=e,t==this.displayRows.length-1)this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getDisplayRows(e){if(typeof e>"u")return this.displayRows.length?this.displayRows[this.displayRows.length-1]:[];else return this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));if(e)i=this.chain("rows-visible",[t],i,i);return i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){if(this.redrawBlock)if(e)e();else this.redrawBlockRenderInPosition=!0;else{if(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),!this.fixedHeight)this.adjustTableSize();this.scrollBarCheck(),this.dispatchExternal("renderComplete")}}scrollBarCheck(){var e=0;if(this.element.scrollHeight>this.element.clientHeight)e=this.element.offsetWidth-this.element.clientWidth;if(e!==this.scrollbarWidth)this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e)}initializeRenderer(){var e,t={virtual:ze,basic:De};if(typeof this.table.options.renderVertical==="string")e=t[this.table.options.renderVertical];else e=this.table.options.renderVertical;if(e)if(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),(this.table.element.clientHeight||this.table.options.height)&&!(this.table.options.minHeight&&this.table.options.maxHeight))this.fixedHeight=!0;else this.fixedHeight=!1;else console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){if(this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount){if(this.renderer.renderRows(),this.firstRender){if(this.firstRender=!1,!this.fixedHeight)this.adjustTableSize();this.layoutRefresh(!0)}}else this.renderEmptyScroll();if(!this.fixedHeight)this.adjustTableSize();if(this.dispatch("table-layout"),!this.displayRowsCount)this._showPlaceholder();this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){if(this.placeholder)this.tableElement.style.display="none";else this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){if(this.displayRowsCount)this._clearPlaceholder();else this.tableEmpty()}_showPlaceholder(){if(this.placeholder){if(this.placeholder&&this.placeholder.parentNode)this.placeholder.parentNode.removeChild(this.placeholder);this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize()}}_clearPlaceholder(){if(this.placeholder&&this.placeholder.parentNode)this.placeholder.parentNode.removeChild(this.placeholder);this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){if(this.placeholder&&this.placeholder.parentNode)this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px"}styleRow(e,t){var i=e.getElement();if(t%2)i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd");else i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even")}normalizeHeight(e){this.activeRows.forEach(function(t){t.normalizeHeight(e)})}adjustTableSize(e){let t=this.element.clientHeight,i,s=!1;if(this.renderer.verticalFillMode==="fill"){let r=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){i=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";let o="calc(100% - "+r+"px)";this.element.style.minHeight=i||"calc(100% - "+r+"px)",this.element.style.height=o,this.element.style.maxHeight=o}else this.element.style.height="",this.element.style.height=Math.max(this.table.element.clientHeight-r,0)+"px",this.element.scrollTop=this.scrollTop;if(this.renderer.resize(),!this.fixedHeight&&t!=this.element.clientHeight){if(s=!0,!e&&!this.redrawing){if(this.redrawing=!0,this.subscribed("table-resize"))this.dispatch("table-resize");else this.redraw();this.redrawing=!1}}this.scrollBarCheck()}return this._positionPlaceholder(),s}reinitialize(){this.rows.forEach(function(e){e.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){if(this.redrawBlock=!1,this.redrawBlockRestoreConfig)this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1;else if(this.redrawBlockRenderInPosition)this.reRenderInPosition();this.redrawBlockRenderInPosition=!1}redraw(e){if(this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,!e)this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft);else this.renderTable()}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,this.table.browser==="ie"){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class Ae extends H{constructor(e){super(e);this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":if(this.table.options.footerElement[0]==="<")this.containerElement.innerHTML=this.table.options.footerElement;else this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement);break;default:this.element=this.table.options.footerElement;break}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){if(!this.element.firstChild||e){if(!this.external)this.element.parentNode.removeChild(this.element);this.active=!1}}activate(){if(!this.active){if(this.active=!0,!this.external)this.table.element.appendChild(this.getElement()),this.table.element.style.display=""}}redraw(){this.dispatch("footer-redraw")}}class _e extends H{constructor(e){super(e);this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach((t)=>{e[t]={handler:null,components:[]}}),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((e)=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){if(this.pseudoTrackers[e].target!==i){if(this.pseudoTrackers[e].target)this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target);this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i)}}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};i=i.filter((r)=>{var o=s[e];return r!==e&&(!o||o&&!o.includes(r))}),i.forEach((r)=>{var o=this.pseudoTrackers[r].target;if(this.pseudoTrackers[r].target)this.dispatch(r+"-mouseleave",t,o),this.pseudoTrackers[r].target=null})}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let s of e){let r=i+"-"+s;this.subscriptionChange(r,this.subscriptionChanged.bind(this,i,s))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,r=s.indexOf(e),o=!1;if(i){if(r===-1)s.push(e),o=!0}else if(!this.subscribed(e+"-"+t)){if(r>-1)s.splice(r,1),o=!0}if((t==="mouseenter"||t==="mouseleave")&&!this.pseudoTracking)this.bindPseudoEvents();if(o)this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];if(t.components.length){if(!t.handler)t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)}else if(t.handler)this.el.removeEventListener(e,t.handler),t.handler=null}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);if(s=this.bindComponents(e,s),this.triggerEvents(e,t,s),this.pseudoTracking&&(e=="mouseover"||e=="mouseleave")&&!Object.keys(s).length)this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let r=s.classList?[...s.classList]:[];if(r.filter((l)=>this.abortClasses.includes(l)).length)break;let a=r.filter((l)=>i.includes(l));for(let l of a)if(!t[this.componentMap[l]])t[this.componentMap[l]]=s}if(t.group&&t.group===t.row)delete t.row;return t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],r={},o={},a={};for(let l of i){let h,d=t[l],u=this.previousTargets[l];if(u&&u.target===d)h=u.component;else switch(l){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){if(h=this.table.rowManager.getVisibleRows(!0).find((f)=>f.getElement()===d),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row"))t[l]=!1}break;case"column":if(s.components.includes("column"))h=this.table.columnManager.findColumn(d);break;case"cell":if(s.components.includes("cell")){if(r.row instanceof O)h=r.row.findCell(d);else if(t.row)console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?")}break}if(h)r[l]=h,a[l]={target:d,component:h}}return this.previousTargets=a,Object.keys(t).forEach((l)=>{let h=r[l];o[l]=h}),o}triggerEvents(e,t,i){var s=this.listeners[e];for(let r in i)if(i[r]&&s.components.includes(r))this.dispatch(r+"-"+e,t,i[r])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];if(t.handler)this.el.removeEventListener(e,t.handler),t.handler=null}}}class Oe{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){if(!this.bindings[e])this.bindings[e]={};if(this.bindings[e][t])console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i);else this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&typeof this.bindings[e][i].bind==="function")return this.bindings[e][i].bind(null,t);else if(i!=="then"&&typeof i==="string"&&!i.startsWith("_")){if(this.table.options.debugInvalidComponentFuncs)console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}}class Pe extends H{constructor(e){super(e);this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,r,o){var a=++this.requestOrder;if(this.table.destroyed)return Promise.resolve();if(this.dispatchExternal("dataLoading",e),e&&(e.indexOf("{")==0||e.indexOf("[")==0))e=JSON.parse(e);if(this.confirm("data-loading",[e,t,i,r])){if(this.loading=!0,!r)this.alertLoader();t=this.chain("data-params",[e,i,r],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams);var l=this.chain("data-load",[e,t,i,r],!1,Promise.resolve([]));return l.then((h)=>{if(!this.table.destroyed){if(!Array.isArray(h)&&typeof h=="object")h=this.mapParams(h,this.objectInvert(this.table.options.dataReceiveParams));var d=this.chain("data-loaded",[h],null,h);if(a==this.requestOrder){if(this.clearAlert(),d!==!1)this.dispatchExternal("dataLoaded",d),this.table.rowManager.setData(d,s,typeof o>"u"?!s:o)}else console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}else console.warn("Data Load Response Blocked - Table has been destroyed")}).catch((h)=>{if(console.error("Data Load Error: ",h),this.dispatchExternal("dataLoadError",h),!r)this.alertError();setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})}else{if(this.dispatchExternal("dataLoaded",e),!e)e=[];return this.table.rowManager.setData(e,s,typeof o>"u"?!s:o),Promise.resolve()}}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){var e=typeof this.table.options.dataLoader==="function"?this.table.options.dataLoader():this.table.options.dataLoader;if(e)this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Be{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){if(!this.subscriptionNotifiers[e])this.subscriptionNotifiers[e]=[];if(this.subscriptionNotifiers[e].push(t),this.subscribed(e))this._notifySubscriptionChange(e,!0)}subscribe(e,t){if(!this.events[e])this.events[e]=[];this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e])if(t)if(i=this.events[e].findIndex((s)=>s===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}else delete this.events[e];else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];if(i)i.forEach((s)=>{s(t)})}_dispatch(e,...t){let i=this.events[e],s=i?.length;if(s){let r=i[0].apply(this.table,t);for(let o=1;o<s;o++)i[o].apply(this.table,t);return r}}_debugDispatch(e,...t){if(this.debug===!0||this.debug.includes(e)){let i=["ExternalEvent:"+e,...t];console.log(...i)}return this._dispatch(e,...t)}}class Ve{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){if(!this.subscriptionNotifiers[e])this.subscriptionNotifiers[e]=[];if(this.subscriptionNotifiers[e].push(t),this.subscribed(e))this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){if(!this.events[e])this.events[e]=[];this.events[e].push({callback:t,priority:i}),this.events[e].sort((s,r)=>s.priority-r.priority),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t)if(i=this.events[e].findIndex((s)=>s.callback===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}}else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){let r=this.events[e];if(r&&r.length){if(!Array.isArray(t))t=[t];let o=t.slice(),a=o.length,l=i;for(let h=0;h<r.length;h++)o[a]=l,l=r[h].callback.apply(this,o);return l}return typeof s==="function"?s():s}_confirm(e,t){var i=!1;if(!Array.isArray(t))t=[t];if(this.subscribed(e))this.events[e].forEach((s,r)=>{if(s.callback.apply(this,t))i=!0});return i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];if(i)i.forEach((s)=>{s(t)})}_dispatch(e,...t){let i=this.events[e];if(i)for(let s of i)s.callback.apply(this,t)}_debugDispatch(e,...t){if(this.debug===!0||this.debug.includes(e)){let i=["InternalEvent:"+e,...t];console.log(...i)}return this._dispatch(e,...t)}_debugChain(e,t,i,s){if(this.debug===!0||this.debug.includes(e)){let r=["InternalEvent:"+e,t,i,s];console.log(...r)}return this._chain(e,t,i,s)}_debugConfirm(e,t){if(this.debug===!0||this.debug.includes(e)){let i=["InternalEvent:"+e,t];console.log(...i)}return this._confirm(e,t)}}class Ne extends H{constructor(e){super(e)}_warnUser(){if(this.options("debugDeprecation"))console.warn(...arguments)}check(e,t,i){var s="";if(typeof this.options(e)<"u"){if(s="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t){if(s=s+", Please use the %c"+t+"%c option instead",this._warnUser(s,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i)this.table.options[t]=this.table.options[e]}else this._warnUser(s,"font-weight: bold;","font-weight: normal;");return!1}else return!0}checkMsg(e,t){if(typeof this.options(e)<"u")return this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1;else return!0}msg(e){this._warnUser(e)}}class Ie extends H{constructor(e){super(e);this.deps={},this.props={}}initialize(){this.deps=Object.assign({},this.options("dependencies"))}lookup(e,t,i){if(Array.isArray(e)){for(let r of e){var s=this.lookup(r,t,!0);if(s)break}if(s)return s;else this.error(e)}else if(t)return this.lookupProp(e,t,i);else return this.lookupKey(e,i)}lookupProp(e,t,i){var s;if(this.props[e]&&this.props[e][t])return this.props[e][t];else if(s=this.lookupKey(e,i),s){if(!this.props[e])this.props[e]={};return this.props[e][t]=s[t]||s,this.props[e][t]}}lookupKey(e,t){var i;if(this.deps[e])i=this.deps[e];else if(window[e])this.deps[e]=window[e],i=this.deps[e];else if(!t)this.error(e);return i}error(e){console.error("Unable to find dependency",e,"Please check documentation and ensure you have imported the required library into your project")}}function gi(e,t){if(t)this.table.columnManager.renderer.reinitializeColumnWidths(e);if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0))this.table.modules.responsiveLayout.update()}function xe(e,t){if(e.forEach(function(i){i.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0))this.table.modules.responsiveLayout.update()}function bi(e,t){var i=0,s=this.table.rowManager.element.clientWidth,r=0,o=!1;if(e.forEach((a,l)=>{if(!a.widthFixed)a.reinitializeWidth();if(this.table.options.responsiveLayout?a.modules.responsive.visible:a.visible)o=a;if(a.visible)i+=a.getWidth()}),o){if(r=s-i+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0))o.setWidth(0),this.table.modules.responsiveLayout.update();if(r>0)o.setWidth(r);else o.reinitializeWidth()}else if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0))this.table.modules.responsiveLayout.update()}function vi(e,t){var i=this.table.rowManager.element.getBoundingClientRect().width,s=0,r=0,o=0,a=0,l=[],h=[],d=0,u=0,c=0;function f(m){var b;if(typeof m=="string")if(m.indexOf("%")>-1)b=i/100*parseInt(m);else b=parseInt(m);else b=m;return b}function p(m,b,v,w){var R=[],S=0,k=0,A=0,B=o,C=0,E=0,y=[];function D(x){return v*(x.column.definition.widthGrow||1)}function z(x){return f(x.width)-v*(x.column.definition.widthShrink||0)}if(m.forEach(function(x,se){var Re=w?z(x):D(x);if(x.column.minWidth>=Re)R.push(x);else if(x.column.maxWidth&&x.column.maxWidth<Re){if(x.width=x.column.maxWidth,b-=x.column.maxWidth,B-=w?x.column.definition.widthShrink||1:x.column.definition.widthGrow||1,B)v=Math.floor(b/B)}else y.push(x),E+=w?x.column.definition.widthShrink||1:x.column.definition.widthGrow||1}),R.length)R.forEach(function(x){S+=w?x.width-x.column.minWidth:x.column.minWidth,x.width=x.column.minWidth}),k=b-S,A=E?Math.floor(k/E):k,C=p(y,k,A,w);else C=E?b-Math.floor(b/E)*E:b,y.forEach(function(x){x.width=w?z(x):D(x)});return C}if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0))this.table.modules.responsiveLayout.update();if(this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight)i-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth;if(e.forEach(function(m){var b,v,w;if(m.visible)if(b=m.definition.width,v=parseInt(m.minWidth),b){if(w=f(b),s+=w>v?w:v,m.definition.widthShrink)h.push({column:m,width:w>v?w:v}),d+=m.definition.widthShrink}else l.push({column:m,width:0}),o+=m.definition.widthGrow||1}),r=i-s,a=Math.floor(r/o),c=p(l,r,a,!1),l.length&&c>0)l[l.length-1].width+=c;if(l.forEach(function(m){r-=m.width}),u=Math.abs(c)+r,u>0&&d)c=p(h,u,Math.floor(u/d),!0);if(c&&h.length)h[h.length-1].width-=c;l.forEach(function(m){m.column.setWidth(m.width)}),h.forEach(function(m){m.column.setWidth(m.width)})}var wi={fitData:gi,fitDataFill:xe,fitDataTable:xe,fitDataStretch:bi,fitColumns:vi};class Z extends F{static moduleName="layout";static modes=wi;constructor(e){super(e,"layout");this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;if(Z.modes[e])this.mode=e;else console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData";this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){if(e.definition.widthGrow)e.definition.widthGrow=Number(e.definition.widthGrow);if(e.definition.widthShrink)e.definition.widthShrink=Number(e.definition.widthShrink)}getMode(){return this.mode}layout(e){var t=this.table.columnManager.columnsByIndex.find((i)=>i.definition.variableHeight||i.definition.formatter==="textarea");if(this.dispatch("layout-refreshing"),Z.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),t)this.table.rowManager.normalizeHeight(!0);this.dispatch("layout-refreshed")}}var Ci={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class ve extends F{static moduleName="localize";static langs=Ci;constructor(e){super(e);this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){if(this.langList=L.deepClone(ve.langs),this.table.options.columnDefaults.headerFilterPlaceholder!==!1)this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){if(this.langList[e])this._setLangProp(this.langList[e],t);else this.langList[e]=t}_setLangProp(e,t){for(let i in t)if(e[i]&&typeof e[i]=="object")this._setLangProp(e[i],t[i]);else e[i]=t[i]}setLocale(e){e=e||"default";function t(i,s){for(var r in i)if(typeof i[r]=="object"){if(!s[r])s[r]={};t(i[r],s[r])}else s[r]=i[r]}if(e===!0&&navigator.language)e=navigator.language.toLowerCase();if(e){if(!this.langList[e]){let i=e.split("-")[0];if(this.langList[i])console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i;else console.warn("Localization Error - Matching locale not found, using default: ",e),e="default"}}if(this.locale=e,this.lang=L.deepClone(this.langList.default||{}),e!="default")t(this.langList[e],this.lang);this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=t?e+"|"+t:e,s=i.split("|"),r=this._getLangElement(s,this.locale);return r||""}_getLangElement(e,t){var i=this.lang;return e.forEach(function(s){var r;if(i)if(r=i[s],typeof r<"u")i=r;else i=!1}),i}bind(e,t){if(!this.bindings[e])this.bindings[e]=[];this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach((t)=>{t(this.getText(e),this.lang)})}}class We extends F{static moduleName="comms";constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[],i;return i=this.table.constructor.registry.lookupTable(e),i.forEach((s)=>{if(this.table!==s)t.push(s)}),t}send(e,t,i,s){var r=this.getConnections(e);if(r.forEach((o)=>{o.tableComms(this.table.element,t,i,s)}),!r.length&&e)console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);else console.warn("Inter-table Comms Error - no such module:",t)}}var Ei=Object.freeze({__proto__:null,CommsModule:We,LayoutModule:Z,LocalizeModule:ve});class _{static registry={tables:[],register(e){_.registry.tables.push(e)},deregister(e){var t=_.registry.tables.indexOf(e);if(t>-1)_.registry.tables.splice(t,1)},lookupTable(e,t){var i=[],s,r;if(typeof e==="string"){if(s=document.querySelectorAll(e),s.length){for(var o=0;o<s.length;o++)if(r=_.registry.matchElement(s[o]),r)i.push(r)}}else if(typeof HTMLElement<"u"&&e instanceof HTMLElement||e instanceof _){if(r=_.registry.matchElement(e),r)i.push(r)}else if(Array.isArray(e))e.forEach(function(a){i=i.concat(_.registry.lookupTable(a))});else if(!t)console.warn("Table Connection Error - Invalid Selector",e);return i},matchElement(e){return _.registry.tables.find(function(t){return e instanceof _?t===e:t.element===e})}};static findTable(e){var t=_.registry.lookupTable(e,!0);return Array.isArray(t)&&!t.length?!1:t}}class M extends _{static moduleBindings={};static moduleExtensions={};static modulesRegistered=!1;static defaultModules=!1;constructor(){super()}static initializeModuleBinder(e){if(!M.modulesRegistered){if(M.modulesRegistered=!0,M._registerModules(Ei,!0),e)M._registerModules(e)}}static _extendModule(e,t,i){if(M.moduleBindings[e]){var s=M.moduleBindings[e][t];if(s)if(typeof i=="object")for(let r in i)s[r]=i[r];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",t)}else console.warn("Module Error - module does not exist:",e)}static _registerModules(e,t){var i=Object.values(e);if(t)i.forEach((s)=>{s.prototype.moduleCore=!0});M._registerModule(i)}static _registerModule(e){if(!Array.isArray(e))e=[e];e.forEach((t)=>{M._registerModuleBinding(t),M._registerModuleExtensions(t)})}static _registerModuleBinding(e){if(e.moduleName)M.moduleBindings[e.moduleName]=e;else console.error("Unable to bind module, no moduleName defined",e.moduleName)}static _registerModuleExtensions(e){var t=e.moduleExtensions;if(e.moduleExtensions)for(let i in t){let s=t[i];if(M.moduleBindings[i])for(let r in s)M._extendModule(i,r,s[r]);else{if(!M.moduleExtensions[i])M.moduleExtensions[i]={};for(let r in s){if(!M.moduleExtensions[i][r])M.moduleExtensions[i][r]={};Object.assign(M.moduleExtensions[i][r],s[r])}}}M._extendModuleFromQueue(e)}static _extendModuleFromQueue(e){var t=M.moduleExtensions[e.moduleName];if(t)for(let i in t)M._extendModule(e.moduleName,i,t[i])}_bindModules(){var e=[],t=[],i=[];this.modules={};for(var s in M.moduleBindings){let r=M.moduleBindings[s],o=new r(this);if(this.modules[s]=o,r.prototype.moduleCore)this.modulesCore.push(o);else if(r.moduleInitOrder)if(r.moduleInitOrder<0)e.push(o);else t.push(o);else i.push(o)}e.sort((r,o)=>r.moduleInitOrder>o.moduleInitOrder?1:-1),t.sort((r,o)=>r.moduleInitOrder>o.moduleInitOrder?1:-1),this.modulesRegular=e.concat(i.concat(t))}}class Ge extends H{constructor(e){super(e);this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){this.clear(),this.dispatch("alert-show",t),this.type=t;while(this.msgElement.firstChild)this.msgElement.removeChild(this.msgElement.firstChild);if(this.msgElement.classList.add(this._typeClass()),typeof e==="function")e=e();if(e instanceof HTMLElement)this.msgElement.appendChild(e);else this.msgElement.innerHTML=e;this.table.element.appendChild(this.element)}}clear(){if(this.dispatch("alert-hide",this.type),this.element.parentNode)this.element.parentNode.removeChild(this.element);this.msgElement.classList.remove(this._typeClass())}}class P extends M{static defaultOptions=mi;static extendModule(){P.initializeModuleBinder(),P._extendModule(...arguments)}static registerModule(){P.initializeModuleBinder(),P._registerModule(...arguments)}constructor(e,t,i){super();if(P.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new Oe(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Ne(this),this.optionsList=new be(this,"table constructor"),this.dependencyRegistry=new Ie(this),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)){if(this.element.id)this.instanceId=this.element.id;else this.instanceId=Math.random().toString(36).slice(2,7);this.initializeCoreSystems(t),setTimeout(()=>{this._create()})}this.constructor.registry.register(this)}initializeElement(e){if(typeof HTMLElement<"u"&&e instanceof HTMLElement)return this.element=e,!0;else if(typeof e==="string")if(this.element=document.querySelector(e),this.element)return!0;else return console.error("Tabulator Creation Error - no element found matching selector: ",e),!1;else return console.error("Tabulator Creation Error - Invalid element provided:",e),!1}initializeCoreSystems(e){this.columnManager=new Se(this),this.rowManager=new Fe(this),this.footerManager=new Ae(this),this.dataLoader=new Pe(this),this.alertManager=new Ge(this),this._bindModules(),this.options=this.optionsList.generate(P.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Be(this,this.options,this.options.debugEventsExternal),this.eventBus=new Ve(this.options.debugEventsInternal),this.interactionMonitor=new _e(this),this.dataLoader.initialize(),this.footerManager.initialize(),this.dependencyRegistry.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){if(this.element.classList.add("tabulator-block-select"),window.getSelection){if(window.getSelection().empty)window.getSelection().empty();else if(window.getSelection().removeAllRanges)window.getSelection().removeAllRanges()}else if(document.selection)document.selection.empty();this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally(()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")})}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(e.direction!=="rtl")break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){if(this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData)this.options.data=this.options.data.slice(0)}_buildElement(){var e=this.element,t=this.options,i;if(e.tagName==="TABLE"){this.originalElement=this.element,i=document.createElement("div");var s=e.attributes;for(var r in s)if(typeof s[r]=="object")i.setAttribute(s[r].name,s[r].value);e.parentNode.replaceChild(i,e),this.element=e=i}e.classList.add("tabulator"),e.setAttribute("role","grid"),e.setAttribute("aria-owns","tabulator-table-body-"+this.instanceId);while(e.firstChild)e.removeChild(e.firstChild);if(t.height)t.height=isNaN(t.height)?t.height:t.height+"px",e.style.height=t.height;if(t.minHeight!==!1)t.minHeight=isNaN(t.minHeight)?t.minHeight:t.minHeight+"px",e.style.minHeight=t.minHeight;if(t.maxHeight!==!1)t.maxHeight=isNaN(t.maxHeight)?t.maxHeight:t.maxHeight+"px",e.style.maxHeight=t.maxHeight}_initializeTable(){var e=this.element,t=this.options;if(this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((i)=>{i.initialize()}),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement)this.footerManager.activate();if(t.autoColumns&&t.data)this.columnManager.generateColumnsFromRowData(this.options.data);this.modulesRegular.forEach((i)=>{i.initialize()}),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally(()=>{this.columnManager.verticalAlignHeaders()})}destroy(){var e=this.element;this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();while(e.firstChild)e.removeChild(e.firstChild);e.classList.remove("tabulator"),e.removeAttribute("tabulator-layout"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;if(e.indexOf("Trident")>-1)this.browser="ie",this.browserSlow=!0;else if(e.indexOf("Edge")>-1)this.browser="edge",this.browserSlow=!0;else if(e.indexOf("Firefox")>-1)this.browser="firefox",this.browserSlow=!1;else if(e.indexOf("Mac OS")>-1)this.browser="safari",this.browserSlow=!1;else this.browser="other",this.browserSlow=!1;this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;if(this.options.debugInitialization&&!this.initialized){if(!e)if(i=Error().stack.split(`
11
- `),s=i[0]=="Error"?i[2]:i[1],s[0]==" ")e=s.trim().split(" ")[1].split(".")[1];else e=s.trim().split("@")[0];console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))}return this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}getRedrawBlock(){return this.rowManager.redrawBlock||this.columnManager.redrawBlock}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,s)=>{if(this.dataLoader.blockActiveLoad(),typeof e==="string")e=JSON.parse(e);if(e&&e.length>0)e.forEach((r)=>{var o=this.rowManager.findRow(r[this.options.index]);if(o)t++,o.updateData(r).then(()=>{if(t--,!t)i()}).catch((a)=>{s("Update Error - Unable to update row",r,a)});else s("Update Error - Unable to find row",r)});else console.warn("Update Error - No data provided"),s("Update Error - No data provided")})}addData(e,t,i){return this.initGuard(),new Promise((s,r)=>{if(this.dataLoader.blockActiveLoad(),typeof e==="string")e=JSON.parse(e);if(e)this.rowManager.addRows(e,t,i).then((o)=>{var a=[];o.forEach(function(l){a.push(l.getComponent())}),s(a)});else console.warn("Update Error - No data provided"),r("Update Error - No data provided")})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((s,r)=>{if(this.dataLoader.blockActiveLoad(),typeof e==="string")e=JSON.parse(e);if(e&&e.length>0)e.forEach((o)=>{var a=this.rowManager.findRow(o[this.options.index]);if(i++,a)a.updateData(o).then(()=>{if(i--,t.push(a.getComponent()),!i)s(t)});else this.rowManager.addRows(o).then((l)=>{if(i--,t.push(l[0].getComponent()),!i)s(t)})});else console.warn("Update Error - No data provided"),r("Update Error - No data provided")})}getRow(e){var t=this.rowManager.findRow(e);if(t)return t.getComponent();else return console.warn("Find Error - No matching row found:",e),!1}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);if(t)return t.getComponent();else return console.warn("Find Error - No matching row found:",e),!1}deleteRow(e){var t=[];if(this.initGuard(),!Array.isArray(e))e=[e];for(let i of e){let s=this.rowManager.findRow(i,!0);if(s)t.push(s);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,s)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(s)?1:-1),t.forEach((i)=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){if(this.initGuard(),typeof e==="string")e=JSON.parse(e);return this.rowManager.addRows(e,t,i,!0).then((s)=>s[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);if(this.initGuard(),typeof t==="string")t=JSON.parse(t);if(i)return i.updateData(t).then(()=>i.getComponent());else return this.rowManager.addRows(t).then((s)=>s[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);if(this.initGuard(),typeof t==="string")t=JSON.parse(t);if(i)return i.updateData(t).then(()=>Promise.resolve(i.getComponent()));else return console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found")}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);if(s)return this.rowManager.scrollToRow(s,t,i);else return console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found")}moveRow(e,t,i){var s=this.rowManager.findRow(e);if(this.initGuard(),s)s.moveToRow(t,i);else console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);if(t)return t.getPosition();else return console.warn("Position Error - No matching row found:",e),!1}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);if(t)return t.getComponent();else return console.warn("Find Error - No matching column found:",e),!1}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)if(t.visible)t.hide();else t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((r)=>r.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)return t.delete();else return console.warn("Column Delete Error - No matching column found:",e),Promise.reject()}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);if(this.initGuard(),i)return i.updateDefinition(t);else return console.warn("Column Update Error - No matching column found:",e),Promise.reject()}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),r=this.columnManager.findColumn(t);if(this.initGuard(),s)if(r)this.columnManager.moveColumn(s,r,i);else console.warn("Move Error - No matching column found:",r);else console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((s,r)=>{var o=this.columnManager.findColumn(e);if(o)return this.columnManager.scrollToColumn(o,t,i);else return console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found")})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMaxHeight(e){this.options.maxHeight=isNaN(e)?e:e+"px",this.element.style.maxHeight=this.options.maxHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMinHeight(e){this.options.minHeight=isNaN(e)?e:e+"px",this.element.style.minHeight=this.options.minHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){if(this.modules[e])return!0;else{if(t)console.error("Tabulator Module Not Installed: "+e);return!1}}module(e){var t=this.modules[e];if(!t)console.error("Tabulator module not installed: "+e);return t}}var W={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},je=(e)=>(...t)=>({_$litDirective$:e,values:t});class we{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}var{I:Oi}=m$;var Ue=(e)=>e.strings===void 0;var yi={},$e=(e,t=yi)=>e._$AH=t;var Ce=je(class extends we{constructor(e){if(super(e),e.type!==W.PROPERTY&&e.type!==W.ATTRIBUTE&&e.type!==W.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ue(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===qc||t===mt)return t;let{element:i,name:s}=e;if(e.type===W.PROPERTY){if(t===i[s])return qc}else if(e.type===W.BOOLEAN_ATTRIBUTE){if(!!t===i.hasAttribute(s))return qc}else if(e.type===W.ATTRIBUTE&&i.getAttribute(s)===t+"")return qc;return $e(e),t}});function G(e){return e.target}function Ke(e,t,i){return(s,r,o,a)=>{let l=e("jx-grid-editor"),h=!1,d=(f)=>{if(!h)h=!0,o(xp(f,t))},u=()=>{if(!h)h=!0,a()},c=t.kind==="date"?nr(s.getValue()).slice(0,10):nr(s.getValue());return no(Ur`<input
11
+ `),s=i[0]=="Error"?i[2]:i[1],s[0]==" ")e=s.trim().split(" ")[1].split(".")[1];else e=s.trim().split("@")[0];console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))}return this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}getRedrawBlock(){return this.rowManager.redrawBlock||this.columnManager.redrawBlock}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,s)=>{if(this.dataLoader.blockActiveLoad(),typeof e==="string")e=JSON.parse(e);if(e&&e.length>0)e.forEach((r)=>{var o=this.rowManager.findRow(r[this.options.index]);if(o)t++,o.updateData(r).then(()=>{if(t--,!t)i()}).catch((a)=>{s("Update Error - Unable to update row",r,a)});else s("Update Error - Unable to find row",r)});else console.warn("Update Error - No data provided"),s("Update Error - No data provided")})}addData(e,t,i){return this.initGuard(),new Promise((s,r)=>{if(this.dataLoader.blockActiveLoad(),typeof e==="string")e=JSON.parse(e);if(e)this.rowManager.addRows(e,t,i).then((o)=>{var a=[];o.forEach(function(l){a.push(l.getComponent())}),s(a)});else console.warn("Update Error - No data provided"),r("Update Error - No data provided")})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((s,r)=>{if(this.dataLoader.blockActiveLoad(),typeof e==="string")e=JSON.parse(e);if(e&&e.length>0)e.forEach((o)=>{var a=this.rowManager.findRow(o[this.options.index]);if(i++,a)a.updateData(o).then(()=>{if(i--,t.push(a.getComponent()),!i)s(t)});else this.rowManager.addRows(o).then((l)=>{if(i--,t.push(l[0].getComponent()),!i)s(t)})});else console.warn("Update Error - No data provided"),r("Update Error - No data provided")})}getRow(e){var t=this.rowManager.findRow(e);if(t)return t.getComponent();else return console.warn("Find Error - No matching row found:",e),!1}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);if(t)return t.getComponent();else return console.warn("Find Error - No matching row found:",e),!1}deleteRow(e){var t=[];if(this.initGuard(),!Array.isArray(e))e=[e];for(let i of e){let s=this.rowManager.findRow(i,!0);if(s)t.push(s);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,s)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(s)?1:-1),t.forEach((i)=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){if(this.initGuard(),typeof e==="string")e=JSON.parse(e);return this.rowManager.addRows(e,t,i,!0).then((s)=>s[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);if(this.initGuard(),typeof t==="string")t=JSON.parse(t);if(i)return i.updateData(t).then(()=>i.getComponent());else return this.rowManager.addRows(t).then((s)=>s[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);if(this.initGuard(),typeof t==="string")t=JSON.parse(t);if(i)return i.updateData(t).then(()=>Promise.resolve(i.getComponent()));else return console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found")}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);if(s)return this.rowManager.scrollToRow(s,t,i);else return console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found")}moveRow(e,t,i){var s=this.rowManager.findRow(e);if(this.initGuard(),s)s.moveToRow(t,i);else console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);if(t)return t.getPosition();else return console.warn("Position Error - No matching row found:",e),!1}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);if(t)return t.getComponent();else return console.warn("Find Error - No matching column found:",e),!1}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)if(t.visible)t.hide();else t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((r)=>r.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)return t.delete();else return console.warn("Column Delete Error - No matching column found:",e),Promise.reject()}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);if(this.initGuard(),i)return i.updateDefinition(t);else return console.warn("Column Update Error - No matching column found:",e),Promise.reject()}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),r=this.columnManager.findColumn(t);if(this.initGuard(),s)if(r)this.columnManager.moveColumn(s,r,i);else console.warn("Move Error - No matching column found:",r);else console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((s,r)=>{var o=this.columnManager.findColumn(e);if(o)return this.columnManager.scrollToColumn(o,t,i);else return console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found")})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMaxHeight(e){this.options.maxHeight=isNaN(e)?e:e+"px",this.element.style.maxHeight=this.options.maxHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}setMinHeight(e){this.options.minHeight=isNaN(e)?e:e+"px",this.element.style.minHeight=this.options.minHeight,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){if(this.modules[e])return!0;else{if(t)console.error("Tabulator Module Not Installed: "+e);return!1}}module(e){var t=this.modules[e];if(!t)console.error("Tabulator module not installed: "+e);return t}}var W={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},je=(e)=>(...t)=>({_$litDirective$:e,values:t});class we{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}var{I:Oi}=b$;var Ue=(e)=>e.strings===void 0;var yi={},$e=(e,t=yi)=>e._$AH=t;var Ce=je(class extends we{constructor(e){if(super(e),e.type!==W.PROPERTY&&e.type!==W.ATTRIBUTE&&e.type!==W.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ue(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Uc||t===mt)return t;let{element:i,name:s}=e;if(e.type===W.PROPERTY){if(t===i[s])return Uc}else if(e.type===W.BOOLEAN_ATTRIBUTE){if(!!t===i.hasAttribute(s))return Uc}else if(e.type===W.ATTRIBUTE&&i.getAttribute(s)===t+"")return Uc;return $e(e),t}});function G(e){return e.target}function Ke(e,t,i){return(s,r,o,a)=>{let l=e("jx-grid-editor"),h=!1,d=(f)=>{if(!h)h=!0,o(vp(f,t))},u=()=>{if(!h)h=!0,a()},c=t.kind==="date"?Qo(s.getValue()).slice(0,10):Qo(s.getValue());return io(Vr`<input
12
12
  class="jx-grid-input"
13
13
  type=${i}
14
14
  .value=${Ce(c)}
15
15
  @keydown=${(f)=>{if(f.key==="Enter")d(G(f).value);else if(f.key==="Escape")u()}}
16
16
  @blur=${(f)=>d(G(f).value)}
17
- />`,l),r(()=>{let f=l.querySelector("input");f?.focus(),f?.select()}),l}}function Ri(e){return(t,i,s,r)=>{let o=e("jx-grid-editor"),a=!1;return no(Ur`<input
17
+ />`,l),r(()=>{let f=l.querySelector("input");f?.focus(),f?.select()}),l}}function Ri(e){return(t,i,s,r)=>{let o=e("jx-grid-editor"),a=!1;return io(Vr`<input
18
18
  class="jx-grid-checkbox"
19
19
  type="checkbox"
20
20
  .checked=${Ce(t.getValue()===!0)}
21
21
  @change=${(l)=>{if(!a)a=!0,s(G(l).checked)}}
22
22
  @keydown=${(l)=>{if(l.key==="Escape"&&!a)a=!0,r();else if(l.key==="Enter"&&!a)a=!0,s(G(l).checked)}}
23
23
  @blur=${(l)=>{if(!a)a=!0,s(G(l).checked)}}
24
- />`,o),i(()=>o.querySelector("input")?.focus()),o}}function xi(e,t){let i=Array.isArray(t.schema?.enum)?t.schema.enum.map(String):[];return(s,r,o,a)=>{let l=e("jx-grid-editor"),h=!1,d=nr(s.getValue());return no(Ur`<select
24
+ />`,o),i(()=>o.querySelector("input")?.focus()),o}}function xi(e,t){let i=Array.isArray(t.schema?.enum)?t.schema.enum.map(String):[];return(s,r,o,a)=>{let l=e("jx-grid-editor"),h=!1,d=Qo(s.getValue());return io(Vr`<select
25
25
  class="jx-grid-select"
26
26
  @change=${(u)=>{if(!h){h=!0;let{value:c}=u.target;o(c===""?null:c)}}}
27
27
  @keydown=${(u)=>{if(u.key==="Escape"&&!h)h=!0,a()}}
28
28
  @blur=${()=>{if(!h)h=!0,a()}}
29
29
  >
30
30
  <option value="" ?selected=${d===""}>—</option>
31
- ${i.map((u)=>Ur`<option value=${u} ?selected=${u===d}>${u}</option>`)}
32
- </select>`,l),r(()=>l.querySelector("select")?.focus()),l}}function Ti(e,t){return(i,s,r,o)=>{let a=e("jx-grid-editor jx-grid-pill-editor"),l=xp(i.getValue(),t),h=Array.isArray(l)?[...l]:[],d=!1,u=(m)=>{if(d)return;if(d=!0,m)r(m);else o()},c=()=>a.querySelector("input"),f=(m)=>{let b=m.value.trim();if(b==="")return!1;return h.push(b),m.value="",!0},p=()=>{no(Ur`<span class="jx-grid-pills">
33
- ${h.map((m,b)=>Ur`<span class="jx-grid-chip"
31
+ ${i.map((u)=>Vr`<option value=${u} ?selected=${u===d}>${u}</option>`)}
32
+ </select>`,l),r(()=>l.querySelector("select")?.focus()),l}}function Ti(e,t){return(i,s,r,o)=>{let a=e("jx-grid-editor jx-grid-pill-editor"),l=vp(i.getValue(),t),h=Array.isArray(l)?[...l]:[],d=!1,u=(m)=>{if(d)return;if(d=!0,m)r(m);else o()},c=()=>a.querySelector("input"),f=(m)=>{let b=m.value.trim();if(b==="")return!1;return h.push(b),m.value="",!0},p=()=>{io(Vr`<span class="jx-grid-pills">
33
+ ${h.map((m,b)=>Vr`<span class="jx-grid-chip"
34
34
  >${m}<button
35
35
  class="jx-grid-chip-x"
36
36
  title="Remove"
@@ -46,7 +46,7 @@ Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.ad
46
46
  @keydown=${(m)=>{let b=G(m);if(m.key==="Enter"||m.key===","){if(m.preventDefault(),f(b))p(),c()?.focus();else if(m.key==="Enter")u([...h])}else if(m.key==="Backspace"&&b.value===""&&h.length>0)h.pop(),p(),c()?.focus();else if(m.key==="Escape")u(null)}}
47
47
  @blur=${(m)=>{f(G(m)),u([...h])}}
48
48
  />
49
- </span>`,a)};return p(),s(()=>c()?.focus()),a}}function Xe(e,t){if(e.kind==="readonly"||!e.editable&&!e.insertOnly)return;switch(e.kind){case"boolean":return Ri(t);case"enum":return xi(t,e);case"date":return Ke(t,e,"date");case"array":return Ti(t,e);default:return Ke(t,e,"text")}}function Je(e,t){return(i)=>{let s=i.getValue(),r=t(`jx-grid-cell-content jx-grid-kind-${e.kind}`);if(e.kind==="boolean")no(Ur`${s===!0?"✓":""}`,r);else if(e.kind==="array"&&Array.isArray(s))no(Ur`${s.map((o)=>Ur`<span class="jx-grid-chip">${o}</span>`)}`,r);else no(Ur`${nr(s)}`,r);return r}}var qe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridCell",$description:"The value picker for a grid cell that cannot be edited in place. An image and a relationship both pick from a list that is bigger than a cell, and their pickers render OUTSIDE it — which Tabulator's range module reads as an outside interaction and blur-cancels. So these two kinds skip the in-cell editor session entirely: a double click opens this panel, anchored on the cell, and every pick writes straight through the edit buffer. The media picker is an ISLAND (§9.4): `[part=\"picker-host\"]` is drawn empty and `ui/media-picker.ts` mounts `media-field.json` into it. It stays an island now that it is a document too, because what goes in the box is the caller's decision rather than this panel's.",tagName:"jx-popover",attributes:{part:"cell-panel"},$props:{label:"${state.title}",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-3)",minWidth:"260px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="title"]':{fontWeight:"600",fontSize:"var(--jx-text-sm)",margin:"0"},'& [part="hint"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="actions"]':{display:"flex",justifyContent:"flex-end"},'& [part="picker-host"]':{display:"block",minWidth:"0"}},children:[{tagName:"p",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"kind-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{reference:{tagName:"div",attributes:{part:"reference"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},children:[{tagName:"div",attributes:{part:"hint-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hintState"},cases:{shown:{tagName:"p",attributes:{part:"hint"},textContent:"${state.hint}"}}},{tagName:"jx-select",attributes:{part:"entry"},$props:{size:"sm",label:"${state.title}",options:{$ref:"#/state/options"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}},{$description:"An id the target collection does not hold is still a legal reference — a draft entry, or one another repository owns — so the list is a shortcut rather than the whole of what may be written.",tagName:"jx-textfield",attributes:{part:"custom"},$props:{size:"sm",label:"Custom id",placeholder:"Custom id…",value:{$ref:"#/state/custom"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]},image:{tagName:"div",attributes:{part:"picker-host"}}}},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",attributes:{part:"done"},$props:{variant:"secondary",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/done"},value:[]}]},children:[{tagName:"span",textContent:"Done"}]}]}]}]};T("grid-cell",qe);var Mi="grid/cell";function Li(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Ee(e){let{view:t}=e,s={anchor:null,name:"grid-cell",scope:g({custom:t.custom,done:()=>{r.close(),e.dismissed?.()},hint:t.hint,hintState:t.hintState,kind:t.kind,options:t.options,pick:e.pick,title:t.title,value:t.value,x:t.x,y:t.y}),slot:Mi};if(e.dismissed)s.onDismissed=e.dismissed;if(e.island)s.onNodeCreated=(o,a,l)=>{if(Li(l)==="picker-host"&&o instanceof HTMLElement)e.island?.(o)};let r=Wu(s);return r}function ye(e){return e.kind==="image"||e.kind==="reference"}function Si(e){let t=e.schema?.$ref;if(!n(t)||!t.startsWith("#/content/"))return null;return t.slice(10)}function Di(e){return{x:Math.max(4,Math.min(e.left,window.innerWidth-340)),y:Math.max(4,Math.min(e.bottom+2,window.innerHeight-200))}}async function Ye(e){let{anchor:t,column:i,commit:s,value:r}=e,o=nr(r),a=Di(t),l=(h)=>{let d=h.trim();s(d===""?null:d)};if(i.kind==="reference"){let h=Si(i),d=h?await mb(h):[],u=d.includes(o);Ee({pick:l,view:{custom:u?"":o,hint:h?`Entries of “${h}”`:"",hintState:h?"shown":"hidden",kind:"reference",options:[{label:"—",value:""},...d.map((c)=>({label:c,value:c}))],title:i.title,value:u?o:"",...a}});return}Ee({island:(h)=>{jl(h,i.field,o,l)},pick:l,view:{custom:"",hint:"",hintState:"hidden",kind:"image",options:[],title:i.title,value:o,...a}})}var Qe=!1;function zi(){if(Qe)return;P.registerModule([X,ie,j,N,I,he,de,U,ue,ce,pe,K,ge]),Qe=!0}function Ze(e){let t=document.createElement("div");return t.className=e,t}function Hi(e){switch(e.kind){case"number":return"number";case"boolean":return"boolean";case"array":return(t,i)=>nr(t).localeCompare(nr(i));default:return"string"}}function ms(e,t){zi();let{buffer:i}=t,{columns:s}=t.state,r=new Map(s.map((C)=>[C.field,C])),o=!t.source.capabilities.remotePaging,a=!1,l=!1,h=!1,d=(C)=>String(C.getData()[bS]??""),u=(C)=>{let E=i.rowState(d(C)),y=C.getElement();y.classList.toggle("jx-grid-row--pending-delete",E==="pending-delete"),y.classList.toggle("jx-grid-row--pending-insert",E==="pending-insert"),y.classList.toggle("jx-grid-row--stale",E==="stale")},c=(C)=>{let E=i.cellState(d(C.getRow()),C.getField()),y=C.getElement();y.classList.toggle("jx-grid-cell--dirty",E==="dirty"),y.classList.toggle("jx-grid-cell--error",E==="error"),y.classList.toggle("jx-grid-cell--stale",E==="stale");let D=i.cellError(d(C.getRow()),C.getField());if(D)y.title=D;else y.removeAttribute("title")},f=(C,E)=>(C.editable||C.insertOnly===!0&&i.isInsertKey(E))&&i.rowState(E)!=="pending-delete",p=s.map((C)=>{let E=Je(C,Ze);return{editable:(y)=>f(C,d(y.getRow())),editor:ye(C)?void 0:Xe(C,Ze),field:C.field,formatter:(y,D,z)=>(z(()=>c(y)),E(y)),frozen:C.pk===!0?!0:void 0,headerFilter:o&&C.kind!=="boolean"?"input":void 0,headerSort:!t.source.capabilities.remoteSort,sorter:Hi(C),title:C.title,width:C.widthHint}}),m=t.source.id,b=Cd(m),v=new P(e,{clipboard:!0,clipboardCopyConfig:{columnHeaders:!1,rowHeaders:!1},clipboardCopyRowRange:"range",clipboardCopyStyled:!1,clipboardPasteAction:"range",clipboardPasteParser:"range",columnDefaults:{headerSortTristate:!0,resizable:"header"},columns:HR(p,b),data:t.effectiveRows(),editTriggerEvent:"dblclick",headerSortClickElement:"icon",height:"100%",history:!1,index:bS,layout:"fitDataFill",movableColumns:!0,placeholder:"No rows",reactiveData:!1,renderHorizontal:"virtual",renderVertical:"virtual",rowFormatter:u,selectableRange:1,selectableRangeClearCells:!0,selectableRangeClearCellsValue:null,selectableRangeColumns:!0,selectableRangeRows:!0}),w=()=>{if(!l){h=!0;return}a=!0,v.replaceData(t.effectiveRows()).catch(()=>{}).finally(()=>{a=!1})};t.bindView({refreshData:w});let R=new Promise((C)=>{v.on("tableBuilt",()=>{if(l=!0,h)h=!1,w();C()})}),k=zD(()=>{if(!l)return`grid[${m}]: building`;if(t.effectiveRows().length>0){if(v.getRanges().length===0)return`grid[${m}]: selection range not laid out`;let C=e.querySelector(".tabulator-range-overlay .tabulator-range");if(!C||He(C).width===0)return`grid[${m}]: selection range outline not painted`}return null});v.on("cellEdited",(C)=>{if(a)return;let E=C.getField(),y=r.get(E);if(!y)return;let D=d(C.getRow()),z=xp(C.getValue(),y);if(i.setCell(D,E,z),!kw(z,C.getValue())){a=!0;try{C.setValue(z,!0)}finally{a=!1}}c(C),u(C.getRow())}),v.on("columnResized",(C)=>{em(m,{widths:{[C.getField()]:C.getWidth()}})}),v.on("columnMoved",(C,E)=>{em(m,{order:E.map((y)=>y.getField())})}),v.on("cellDblClick",(C,E)=>{let y=r.get(E.getField()),D=d(E.getRow());if(!y||!ye(y)||!f(y,D))return;let z=He(E.getElement());Ye({anchor:{bottom:z.bottom,left:z.left},column:y,commit:(x)=>{i.setCell(D,y.field,x),a=!0;try{E.setValue(x,!0)}finally{a=!1}c(E),u(E.getRow())},value:i.effectiveValue(D,y.field)})});let A=!1,B=()=>{if(A)return;A=!0,i.beginGroup(),queueMicrotask(()=>{A=!1,i.endGroup()})};return e.addEventListener("paste",B,!0),e.addEventListener("keydown",(C)=>{if(C.key==="Delete"||C.key==="Backspace")B()},!0),{destroy(){k(),t.bindView(null),v.destroy()},fillDown(){let[C]=v.getRanges();if(!C)return;let E=C.getCells();if(E.length<2)return;let[y]=E;if(!y)return;i.group(()=>{for(let D of E.slice(1))for(let[z,x]of D.entries()){let se=y[z];if(se)x.setValue(se.getValue(),!0)}})},getSelectedRowKeys(){let C=new Set;for(let E of v.getRanges())for(let y of E.getRows())C.add(d(y));return[...C]},refreshData:w,async revealRow(C){await R;let E=v.getRow(C),y=E?E.getCells():[],[D]=y,z=y.at(-1);if(!D||!z)return!1;return v.addRange(D,z),await v.scrollToRow(C,"center",!1).catch(()=>{}),!0},setSearch(C){let E=C.trim().toLowerCase();if(E===""){v.clearFilter(!1);return}let y=s.map((D)=>D.field);v.setFilter((D)=>y.some((z)=>nr(D[z]).toLowerCase().includes(E)))}}}export{ms as createGridView};
49
+ </span>`,a)};return p(),s(()=>c()?.focus()),a}}function Xe(e,t){if(e.kind==="readonly"||!e.editable&&!e.insertOnly)return;switch(e.kind){case"boolean":return Ri(t);case"enum":return xi(t,e);case"date":return Ke(t,e,"date");case"array":return Ti(t,e);default:return Ke(t,e,"text")}}function Je(e,t){return(i)=>{let s=i.getValue(),r=t(`jx-grid-cell-content jx-grid-kind-${e.kind}`);if(e.kind==="boolean")io(Vr`${s===!0?"✓":""}`,r);else if(e.kind==="array"&&Array.isArray(s))io(Vr`${s.map((o)=>Vr`<span class="jx-grid-chip">${o}</span>`)}`,r);else io(Vr`${Qo(s)}`,r);return r}}var qe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridCell",$description:"The value picker for a grid cell that cannot be edited in place. An image and a relationship both pick from a list that is bigger than a cell, and their pickers render OUTSIDE it — which Tabulator's range module reads as an outside interaction and blur-cancels. So these two kinds skip the in-cell editor session entirely: a double click opens this panel, anchored on the cell, and every pick writes straight through the edit buffer. The media picker is an ISLAND (§9.4): `[part=\"picker-host\"]` is drawn empty and `ui/media-picker.ts` mounts `media-field.json` into it. It stays an island now that it is a document too, because what goes in the box is the caller's decision rather than this panel's.",tagName:"jx-popover",attributes:{part:"cell-panel"},$props:{label:"${state.title}",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-3)",minWidth:"260px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="title"]':{fontWeight:"600",fontSize:"var(--jx-text-sm)",margin:"0"},'& [part="hint"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="actions"]':{display:"flex",justifyContent:"flex-end"},'& [part="picker-host"]':{display:"block",minWidth:"0"}},children:[{tagName:"p",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"kind-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{reference:{tagName:"div",attributes:{part:"reference"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},children:[{tagName:"div",attributes:{part:"hint-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hintState"},cases:{shown:{tagName:"p",attributes:{part:"hint"},textContent:"${state.hint}"}}},{tagName:"jx-select",attributes:{part:"entry"},$props:{size:"sm",label:"${state.title}",options:{$ref:"#/state/options"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}},{$description:"An id the target collection does not hold is still a legal reference — a draft entry, or one another repository owns — so the list is a shortcut rather than the whole of what may be written.",tagName:"jx-textfield",attributes:{part:"custom"},$props:{size:"sm",label:"Custom id",placeholder:"Custom id…",value:{$ref:"#/state/custom"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]},image:{tagName:"div",attributes:{part:"picker-host"}}}},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",attributes:{part:"done"},$props:{variant:"secondary",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/done"},value:[]}]},children:[{tagName:"span",textContent:"Done"}]}]}]}]};T("grid-cell",qe);var Mi="grid/cell";function Li(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Ee(e){let{view:t}=e,s={anchor:null,name:"grid-cell",scope:g({custom:t.custom,done:()=>{r.close(),e.dismissed?.()},hint:t.hint,hintState:t.hintState,kind:t.kind,options:t.options,pick:e.pick,title:t.title,value:t.value,x:t.x,y:t.y}),slot:Mi};if(e.dismissed)s.onDismissed=e.dismissed;if(e.island)s.onNodeCreated=(o,a,l)=>{if(Li(l)==="picker-host"&&o instanceof HTMLElement)e.island?.(o)};let r=zu(s);return r}function ye(e){return e.kind==="image"||e.kind==="reference"}function Si(e){let t=e.schema?.$ref;if(!n(t)||!t.startsWith("#/content/"))return null;return t.slice(10)}function Di(e){return{x:Math.max(4,Math.min(e.left,window.innerWidth-340)),y:Math.max(4,Math.min(e.bottom+2,window.innerHeight-200))}}async function Ye(e){let{anchor:t,column:i,commit:s,value:r}=e,o=Qo(r),a=Di(t),l=(h)=>{let d=h.trim();s(d===""?null:d)};if(i.kind==="reference"){let h=Si(i),d=h?await mb(h):[],u=d.includes(o);Ee({pick:l,view:{custom:u?"":o,hint:h?`Entries of “${h}”`:"",hintState:h?"shown":"hidden",kind:"reference",options:[{label:"—",value:""},...d.map((c)=>({label:c,value:c}))],title:i.title,value:u?o:"",...a}});return}Ee({island:(h)=>{Hl(h,i.field,o,l)},pick:l,view:{custom:"",hint:"",hintState:"hidden",kind:"image",options:[],title:i.title,value:o,...a}})}var Qe=!1;function zi(){if(Qe)return;P.registerModule([X,ie,j,N,I,he,de,U,ue,ce,pe,K,ge]),Qe=!0}function Ze(e){let t=document.createElement("div");return t.className=e,t}function Hi(e){switch(e.kind){case"number":return"number";case"boolean":return"boolean";case"array":return(t,i)=>Qo(t).localeCompare(Qo(i));default:return"string"}}function ms(e,t){zi();let{buffer:i}=t,{columns:s}=t.state,r=new Map(s.map((C)=>[C.field,C])),o=!t.source.capabilities.remotePaging,a=!1,l=!1,h=!1,d=(C)=>String(C.getData()[wS]??""),u=(C)=>{let E=i.rowState(d(C)),y=C.getElement();y.classList.toggle("jx-grid-row--pending-delete",E==="pending-delete"),y.classList.toggle("jx-grid-row--pending-insert",E==="pending-insert"),y.classList.toggle("jx-grid-row--stale",E==="stale")},c=(C)=>{let E=i.cellState(d(C.getRow()),C.getField()),y=C.getElement();y.classList.toggle("jx-grid-cell--dirty",E==="dirty"),y.classList.toggle("jx-grid-cell--error",E==="error"),y.classList.toggle("jx-grid-cell--stale",E==="stale");let D=i.cellError(d(C.getRow()),C.getField());if(D)y.title=D;else y.removeAttribute("title")},f=(C,E)=>(C.editable||C.insertOnly===!0&&i.isInsertKey(E))&&i.rowState(E)!=="pending-delete",p=s.map((C)=>{let E=Je(C,Ze);return{editable:(y)=>f(C,d(y.getRow())),editor:ye(C)?void 0:Xe(C,Ze),field:C.field,formatter:(y,D,z)=>(z(()=>c(y)),E(y)),frozen:C.pk===!0?!0:void 0,headerFilter:o&&C.kind!=="boolean"?"input":void 0,headerSort:!t.source.capabilities.remoteSort,sorter:Hi(C),title:C.title,width:C.widthHint}}),m=t.source.id,b=_d(m),v=new P(e,{clipboard:!0,clipboardCopyConfig:{columnHeaders:!1,rowHeaders:!1},clipboardCopyRowRange:"range",clipboardCopyStyled:!1,clipboardPasteAction:"range",clipboardPasteParser:"range",columnDefaults:{headerSortTristate:!0,resizable:"header"},columns:WR(p,b),data:t.effectiveRows(),editTriggerEvent:"dblclick",headerSortClickElement:"icon",height:"100%",history:!1,index:wS,layout:"fitDataFill",movableColumns:!0,placeholder:"No rows",reactiveData:!1,renderHorizontal:"virtual",renderVertical:"virtual",rowFormatter:u,selectableRange:1,selectableRangeClearCells:!0,selectableRangeClearCellsValue:null,selectableRangeColumns:!0,selectableRangeRows:!0}),w=()=>{if(!l){h=!0;return}a=!0,v.replaceData(t.effectiveRows()).catch(()=>{}).finally(()=>{a=!1})};t.bindView({refreshData:w});let R=new Promise((C)=>{v.on("tableBuilt",()=>{if(l=!0,h)h=!1,w();C()})}),k=qD(()=>{if(!l)return`grid[${m}]: building`;if(t.effectiveRows().length>0){if(v.getRanges().length===0)return`grid[${m}]: selection range not laid out`;let C=e.querySelector(".tabulator-range-overlay .tabulator-range");if(!C||He(C).width===0)return`grid[${m}]: selection range outline not painted`}return null});v.on("cellEdited",(C)=>{if(a)return;let E=C.getField(),y=r.get(E);if(!y)return;let D=d(C.getRow()),z=vp(C.getValue(),y);if(i.setCell(D,E,z),!Ew(z,C.getValue())){a=!0;try{C.setValue(z,!0)}finally{a=!1}}c(C),u(C.getRow())}),v.on("columnResized",(C)=>{im(m,{widths:{[C.getField()]:C.getWidth()}})}),v.on("columnMoved",(C,E)=>{im(m,{order:E.map((y)=>y.getField())})}),v.on("cellDblClick",(C,E)=>{let y=r.get(E.getField()),D=d(E.getRow());if(!y||!ye(y)||!f(y,D))return;let z=He(E.getElement());Ye({anchor:{bottom:z.bottom,left:z.left},column:y,commit:(x)=>{i.setCell(D,y.field,x),a=!0;try{E.setValue(x,!0)}finally{a=!1}c(E),u(E.getRow())},value:i.effectiveValue(D,y.field)})});let A=!1,B=()=>{if(A)return;A=!0,i.beginGroup(),queueMicrotask(()=>{A=!1,i.endGroup()})};return e.addEventListener("paste",B,!0),e.addEventListener("keydown",(C)=>{if(C.key==="Delete"||C.key==="Backspace")B()},!0),{destroy(){k(),t.bindView(null),v.destroy()},fillDown(){let[C]=v.getRanges();if(!C)return;let E=C.getCells();if(E.length<2)return;let[y]=E;if(!y)return;i.group(()=>{for(let D of E.slice(1))for(let[z,x]of D.entries()){let se=y[z];if(se)x.setValue(se.getValue(),!0)}})},getSelectedRowKeys(){let C=new Set;for(let E of v.getRanges())for(let y of E.getRows())C.add(d(y));return[...C]},refreshData:w,async revealRow(C){await R;let E=v.getRow(C),y=E?E.getCells():[],[D]=y,z=y.at(-1);if(!D||!z)return!1;return v.addRange(D,z),await v.scrollToRow(C,"center",!1).catch(()=>{}),!0},setSearch(C){let E=C.trim().toLowerCase();if(E===""){v.clearFilter(!1);return}let y=s.map((D)=>D.field);v.setFilter((D)=>y.some((z)=>Qo(D[z]).toLowerCase().includes(E)))}}}export{ms as createGridView};
50
50
 
51
- //# debugId=B260C454C899A62364756E2164756E21
52
- //# sourceMappingURL=grid-view-x26rfpz1.js.map
51
+ //# debugId=B03A2BF543294FB964756E2164756E21
52
+ //# sourceMappingURL=grid-view-7d2nx83y.js.map
@@ -1,5 +1,5 @@
1
- var L="jx-toast-pause",C="jx-toast-resume",u=new Map([["focusin","focus"],["focusout","focus"],["jx-toast-pause","stack"],["jx-toast-resume","stack"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerout","pointer"],["pointerover","pointer"]]),a=new WeakMap,c=new WeakMap;function n(t){let e=a.get(t);if(e)return e;let o={holds:new Set,remaining:0,startedAt:0,timer:null};return a.set(t,o),o}function l(t){let e=t.currentTarget??t.target;return e instanceof Element?e.closest("jx-toast"):null}function A(t){let e="relatedTarget"in t?t.relatedTarget:null,o=t.currentTarget;return e instanceof Node&&o instanceof Node&&o.contains(e)}function r(t){if(t.timer!==null)clearTimeout(t.timer),t.timer=null}function s(t){let e=n(t);if(r(e),t.open!==!0||e.holds.size>0||e.remaining<=0)return;e.startedAt=Date.now(),e.timer=setTimeout(()=>{e.timer=null;let o=c.get(t);if(o)H(o,"timeout")},e.remaining)}function H(t,e){if(t.open!==!0)return;t.open=!1,t.dispatchEvent(new CustomEvent("close",{bubbles:!0,detail:{reason:e}}))}function q(t,e){c.set(t,e);let o=n(t);o.remaining=Number(t.timeout)||0,s(t),new MutationObserver(()=>{if(t.open===!0){o.remaining=Number(t.timeout)||0,s(t);return}r(o)}).observe(e,{attributeFilter:["data-open"],attributes:!0})}function z(t){r(n(t))}function G(t,e){let o=n(t),i=u.get(e.type)??e.type;if(o.timer!==null)o.remaining=Math.max(1,o.remaining-(Date.now()-o.startedAt));o.holds.add(i),r(o)}function Y(t,e){if(A(e))return;n(t).holds.delete(u.get(e.type)??e.type),s(t)}function X(t,e){let o=l(e);if(o)H(o,"dismissed")}function Q(t,e){let o=l(e);if(o)H(o,"action")}
2
- export{L,C,A,H,q,z,G,Y,X,Q};
1
+ var L="jx-toast-pause",C="jx-toast-resume",u=new Map([["focusin","focus"],["focusout","focus"],["jx-toast-pause","stack"],["jx-toast-resume","stack"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerout","pointer"],["pointerover","pointer"]]),a=new WeakMap,c=new WeakMap;function n(t){let e=a.get(t);if(e)return e;let o={holds:new Set,remaining:0,startedAt:0,timer:null};return a.set(t,o),o}function l(t){let e=t.currentTarget??t.target;return e instanceof Element?e.closest("jx-toast"):null}function A(t){let e="relatedTarget"in t?t.relatedTarget:null,o=t.currentTarget;return e instanceof Node&&o instanceof Node&&o.contains(e)}function r(t){if(t.timer!==null)clearTimeout(t.timer),t.timer=null}function s(t){let e=n(t);if(r(e),t.open!==!0||e.holds.size>0||e.remaining<=0)return;e.startedAt=Date.now(),e.timer=setTimeout(()=>{e.timer=null;let o=c.get(t);if(o)P(o,"timeout")},e.remaining)}function P(t,e){if(t.open!==!0)return;t.open=!1,t.dispatchEvent(new CustomEvent("close",{bubbles:!0,detail:{reason:e}}))}function q(t,e){c.set(t,e);let o=n(t);o.remaining=Number(t.timeout)||0,s(t),new MutationObserver(()=>{if(t.open===!0){o.remaining=Number(t.timeout)||0,s(t);return}r(o)}).observe(e,{attributeFilter:["data-open"],attributes:!0})}function z(t){r(n(t))}function G(t,e){let o=n(t),i=u.get(e.type)??e.type;if(o.timer!==null)o.remaining=Math.max(1,o.remaining-(Date.now()-o.startedAt));o.holds.add(i),r(o)}function Y(t,e){if(A(e))return;n(t).holds.delete(u.get(e.type)??e.type),s(t)}function X(t,e){let o=l(e);if(o)P(o,"dismissed")}function Q(t,e){let o=l(e);if(o)P(o,"action")}
2
+ export{L,C,A,P,q,z,G,Y,X,Q};
3
3
 
4
- //# debugId=17D8AE4F4FC88F9B64756E2164756E21
5
- //# sourceMappingURL=iframe-entry-pkgmcgp0.js.map
4
+ //# debugId=46FF49EADF1353E864756E2164756E21
5
+ //# sourceMappingURL=iframe-entry-2x9bn5ng.js.map
@@ -1,5 +1,5 @@
1
- import{e}from"./iframe-entry-42hpmwz5.js";function o(n,t,r){if(!Number.isFinite(n))return t;return n<t?t:n>r?r:n}var m=new Map([["ArrowDown",-1],["ArrowLeft",-1],["ArrowRight",1],["ArrowUp",1]]);function h(n,t,r,u){let s=o(n,r,u);if(!Number.isFinite(t)||t<=0)return s;let c=r+Math.round((s-r)/t)*t;if(c>u)c-=t;return o(Number(c.toFixed(6)),r,u)}function R(n){return Math.round(o(n,0,255)).toString(16).padStart(2,"0")}function K(n){let t=n.trim().replace(/^#/,"");if(!/^[0-9a-f]+$/i.test(t))return null;let r=t.length===6||t.length===8,u=t.length===3||t.length===4;if(!r&&!u)return null;let s=r?2:1,c=(a)=>{let b=t.slice(a*s,a*s+s);return Number.parseInt(s===1?b+b:b,16)};return{a:t.length===4||t.length===8?c(3)/255:1,b:c(2),g:c(1),r:c(0)}}function l(n,t){if(n.endsWith("%"))return Number(n.slice(0,-1))/100*t;return Number(n)}function w(n,t){let r=new RegExp(`^${t}a?\\(([^)]*)\\)$`,"i").exec(n.trim());if(!r)return null;return r[1].trim().split(/[\s,/]+/).filter(Boolean)}function d(n){let t=n.trim(),r=w(t,"rgb");if(r&&r.length>=3){let s=[l(r[0],255),l(r[1],255),l(r[2],255)],c=r.length>3?l(r[3],1):1;if(s.some((i)=>Number.isNaN(i))||Number.isNaN(c))return null;return{a:o(c,0,1),b:o(s[2],0,255),g:o(s[1],0,255),r:o(s[0],0,255)}}let u=w(t,"oklch");if(u&&u.length>=3){let s=l(u[0],1),c=l(u[1],0.4),i=Number(u[2].replace(/deg$/i,"")),a=u.length>3?l(u[3],1):1;if([s,c,i,a].some((b)=>Number.isNaN(b)))return null;return B({a:o(a,0,1),c,h:i,l:s})}return K(t)}function g(n){let t=`#${R(n.r)}${R(n.g)}${R(n.b)}`;return n.a>=1?t:`${t}${R(o(n.a,0,1)*255)}`}function T(n){let t=o(n.r,0,255)/255,r=o(n.g,0,255)/255,u=o(n.b,0,255)/255,s=Math.max(t,r,u),c=Math.min(t,r,u),i=s-c,a=0;if(i!==0)if(s===t)a=60*((r-u)/i%6);else if(s===r)a=60*((u-t)/i+2);else a=60*((t-r)/i+4);return{a:o(n.a,0,1),h:(a+360)%360,s:s===0?0:i/s*100,v:s*100}}function P(n){let t=(n.h%360+360)%360,r=o(n.s,0,100)/100,u=o(n.v,0,100)/100,s=u*r,c=s*(1-Math.abs(t/60%2-1)),i=u-s,a=Math.floor(t/60)%6,b=[[s,c,0],[c,s,0],[0,s,c],[0,c,s],[c,0,s],[s,0,c]],[f,x,A]=b[a];return{a:o(n.a,0,1),b:(A+i)*255,g:(x+i)*255,r:(f+i)*255}}function p(n){return n<=0.04045?n/12.92:((n+0.055)/1.055)**2.4}function k(n){return n<=0.0031308?n*12.92:1.055*n**0.4166666666666667-0.055}function N(n){let t=p(o(n.r,0,255)/255),r=p(o(n.g,0,255)/255),u=p(o(n.b,0,255)/255),s=Math.cbrt(0.4122214708*t+0.5363325363*r+0.0514459929*u),c=Math.cbrt(0.2119034982*t+0.6806995451*r+0.1073969566*u),i=Math.cbrt(0.0883024619*t+0.2817188376*r+0.6299787005*u),a=0.2104542553*s+0.793617785*c-0.0040720468*i,b=1.9779984951*s-2.428592205*c+0.4505937099*i,f=0.0259040371*s+0.7827717662*c-0.808675766*i,x=Math.hypot(b,f);return{a:o(n.a,0,1),c:x,h:x<0.000001?0:(Math.atan2(f,b)*180/Math.PI+360)%360,l:a}}function B(n){let t=(n.h%360+360)%360*(Math.PI/180),r=n.c*Math.cos(t),u=n.c*Math.sin(t),s=(n.l+0.3963377774*r+0.2158037573*u)**3,c=(n.l-0.1055613458*r-0.0638541728*u)**3,i=(n.l-0.0894841775*r-1.291485548*u)**3,a=4.0767416621*s-3.3077115913*c+0.2309699292*i,b=-1.2684380046*s+2.6097574011*c-0.3413193965*i,f=-0.0041960863*s-0.7034186147*c+1.707614701*i;return{a:o(n.a,0,1),b:o(k(f)*255,0,255),g:o(k(b)*255,0,255),r:o(k(a)*255,0,255)}}function O(n){let t=`${(n.l*100).toFixed(1)}% ${n.c.toFixed(3)} ${n.h.toFixed(1)}`;return n.a>=1?`oklch(${t})`:`oklch(${t} / ${Number(n.a.toFixed(3))})`}function _(n){let t=p(o(n.r,0,255)/255),r=p(o(n.g,0,255)/255),u=p(o(n.b,0,255)/255);return 0.2126*t+0.7152*r+0.0722*u}function V(n,t){let r=_(n),u=_(t);return(Math.max(r,u)+0.05)/(Math.min(r,u)+0.05)}var C={a:1,b:0,g:0,r:0},F={a:1,b:255,g:255,r:255};function M(n){return V(n,C)>=V(n,F)?"black":"white"}function ee(n){let t=e(n)?d(n):null;return t?M({...t,a:1}):""}
2
- export{o,m,h,K,d,g,T,P,N,B,O,_,V,M,ee};
1
+ import{e}from"./iframe-entry-42hpmwz5.js";function o(n,t,r){if(!Number.isFinite(n))return t;return n<t?t:n>r?r:n}var m=new Map([["ArrowDown",-1],["ArrowLeft",-1],["ArrowRight",1],["ArrowUp",1]]);function h(n,t,r,u){let s=o(n,r,u);if(!Number.isFinite(t)||t<=0)return s;let c=r+Math.round((s-r)/t)*t;if(c>u)c-=t;return o(Number(c.toFixed(6)),r,u)}function R(n){return Math.round(o(n,0,255)).toString(16).padStart(2,"0")}function K(n){let t=n.trim().replace(/^#/,"");if(!/^[0-9a-f]+$/i.test(t))return null;let r=t.length===6||t.length===8,u=t.length===3||t.length===4;if(!r&&!u)return null;let s=r?2:1,c=(a)=>{let b=t.slice(a*s,a*s+s);return Number.parseInt(s===1?b+b:b,16)};return{a:t.length===4||t.length===8?c(3)/255:1,b:c(2),g:c(1),r:c(0)}}function l(n,t){if(n.endsWith("%"))return Number(n.slice(0,-1))/100*t;return Number(n)}function w(n,t){let r=new RegExp(`^${t}a?\\(([^)]*)\\)$`,"i").exec(n.trim());if(!r)return null;return r[1].trim().split(/[\s,/]+/).filter(Boolean)}function d(n){let t=n.trim(),r=w(t,"rgb");if(r&&r.length>=3){let s=[l(r[0],255),l(r[1],255),l(r[2],255)],c=r.length>3?l(r[3],1):1;if(s.some((i)=>Number.isNaN(i))||Number.isNaN(c))return null;return{a:o(c,0,1),b:o(s[2],0,255),g:o(s[1],0,255),r:o(s[0],0,255)}}let u=w(t,"oklch");if(u&&u.length>=3){let s=l(u[0],1),c=l(u[1],0.4),i=Number(u[2].replace(/deg$/i,"")),a=u.length>3?l(u[3],1):1;if([s,c,i,a].some((b)=>Number.isNaN(b)))return null;return B({a:o(a,0,1),c,h:i,l:s})}return K(t)}function g(n){let t=`#${R(n.r)}${R(n.g)}${R(n.b)}`;return n.a>=1?t:`${t}${R(o(n.a,0,1)*255)}`}function T(n){let t=o(n.r,0,255)/255,r=o(n.g,0,255)/255,u=o(n.b,0,255)/255,s=Math.max(t,r,u),c=Math.min(t,r,u),i=s-c,a=0;if(i!==0)if(s===t)a=60*((r-u)/i%6);else if(s===r)a=60*((u-t)/i+2);else a=60*((t-r)/i+4);return{a:o(n.a,0,1),h:(a+360)%360,s:s===0?0:i/s*100,v:s*100}}function H(n){let t=(n.h%360+360)%360,r=o(n.s,0,100)/100,u=o(n.v,0,100)/100,s=u*r,c=s*(1-Math.abs(t/60%2-1)),i=u-s,a=Math.floor(t/60)%6,b=[[s,c,0],[c,s,0],[0,s,c],[0,c,s],[c,0,s],[s,0,c]],[f,x,A]=b[a];return{a:o(n.a,0,1),b:(A+i)*255,g:(x+i)*255,r:(f+i)*255}}function p(n){return n<=0.04045?n/12.92:((n+0.055)/1.055)**2.4}function k(n){return n<=0.0031308?n*12.92:1.055*n**0.4166666666666667-0.055}function N(n){let t=p(o(n.r,0,255)/255),r=p(o(n.g,0,255)/255),u=p(o(n.b,0,255)/255),s=Math.cbrt(0.4122214708*t+0.5363325363*r+0.0514459929*u),c=Math.cbrt(0.2119034982*t+0.6806995451*r+0.1073969566*u),i=Math.cbrt(0.0883024619*t+0.2817188376*r+0.6299787005*u),a=0.2104542553*s+0.793617785*c-0.0040720468*i,b=1.9779984951*s-2.428592205*c+0.4505937099*i,f=0.0259040371*s+0.7827717662*c-0.808675766*i,x=Math.hypot(b,f);return{a:o(n.a,0,1),c:x,h:x<0.000001?0:(Math.atan2(f,b)*180/Math.PI+360)%360,l:a}}function B(n){let t=(n.h%360+360)%360*(Math.PI/180),r=n.c*Math.cos(t),u=n.c*Math.sin(t),s=(n.l+0.3963377774*r+0.2158037573*u)**3,c=(n.l-0.1055613458*r-0.0638541728*u)**3,i=(n.l-0.0894841775*r-1.291485548*u)**3,a=4.0767416621*s-3.3077115913*c+0.2309699292*i,b=-1.2684380046*s+2.6097574011*c-0.3413193965*i,f=-0.0041960863*s-0.7034186147*c+1.707614701*i;return{a:o(n.a,0,1),b:o(k(f)*255,0,255),g:o(k(b)*255,0,255),r:o(k(a)*255,0,255)}}function O(n){let t=`${(n.l*100).toFixed(1)}% ${n.c.toFixed(3)} ${n.h.toFixed(1)}`;return n.a>=1?`oklch(${t})`:`oklch(${t} / ${Number(n.a.toFixed(3))})`}function _(n){let t=p(o(n.r,0,255)/255),r=p(o(n.g,0,255)/255),u=p(o(n.b,0,255)/255);return 0.2126*t+0.7152*r+0.0722*u}function V(n,t){let r=_(n),u=_(t);return(Math.max(r,u)+0.05)/(Math.min(r,u)+0.05)}var C={a:1,b:0,g:0,r:0},F={a:1,b:255,g:255,r:255};function M(n){return V(n,C)>=V(n,F)?"black":"white"}function ee(n){let t=e(n)?d(n):null;return t?M({...t,a:1}):""}
2
+ export{o,m,h,K,d,g,T,H,N,B,O,_,V,M,ee};
3
3
 
4
- //# debugId=00C5D5E49296350164756E2164756E21
5
- //# sourceMappingURL=iframe-entry-02wzcyvy.js.map
4
+ //# debugId=1B86877C63048AD464756E2164756E21
5
+ //# sourceMappingURL=iframe-entry-btck0e9s.js.map
@@ -0,0 +1,4 @@
1
+ import{cL,dL,uL,hL,qS,Rb,Db,GS,Ul,pL,fL,mL,Nb,j2,sP,gL,Pc,Gw,Kw,bL,vL,yL,wL,xL,_L,SL,CL,kL,EL,TL,LL,KS,$L,Ab,IL,RL,DL,NL,AL,OL,Jw,ML,ql,PL,ih,FL,Yw,JS}from"./studio-0rg30pvs.js";import"./studio-ekzbgnjp.js";import"./studio-nqexty8x.js";import"./studio-g45r5vm8.js";import"./studio-t6dqnnft.js";import"./studio-14hh60j8.js";import"./studio-qs5fmhtj.js";import"./studio-by8x0jvc.js";import"./studio-ztppbam0.js";import"./studio-4rgem12q.js";import"./studio-8pne0rx4.js";import"./studio-tfmhnwyr.js";import"./studio-psh8mwnw.js";import"./studio-a6e5fzve.js";import"./studio-9ndgd55w.js";export{gL as adoptCanvasPreviewMode,dL as allowAutoRequestsOnNextRender,Db as beginDragSession,pL as canvasIdleBlockers,mL as canvasPointAt,Kw as clearDropIndicator,Yw as commitActiveEditSession,GS as currentDragSession,$L as dragHostTab,Gw as endDragSession,hL as flushCanvasEdits,JS as getEditBarAnchorRect,ql as getEditSnapshot,Ul as hostDragGeometry,qS as hostForCanvas,SL as isCaretActive,Rb as liveDragHostAt,sP as measureInCanvas,IL as mountIframeCanvas,RL as mountStylebookCanvas,ML as panToStylebookTag,fL as pointerAnchor,ih as postApplyFormat,DL as postColorSchemeToLiveHosts,LL as postDialogOpen,Pc as postDragMessage,NL as postLocaleToLiveHosts,FL as postOpenSlash,KS as postPatchToHosts,TL as postPopoverOpen,AL as postRedefineElementToLiveHosts,OL as postSiteStyleToLiveHosts,Jw as postStyleUpdateToStylebookHosts,Ab as releaseCanvasHosts,uL as requestCanvasEval,Nb as revealCanvasPath,j2 as revealCanvasPathIn,cL as sawIframeDragOver,xL as setCanvasContextMenuHandler,kL as setCanvasPointerDownHandler,wL as setCanvasSlashHandler,yL as setFileDropHandler,EL as setIframePatchEscalation,vL as setInsertZoneClickHandler,PL as setKeymapSource,bL as setNativeDragEnterHandler,_L as setStylebookHitHandler,CL as setToolbarRefresh};
2
+
3
+ //# debugId=9F3DF202CEAD816064756E2164756E21
4
+ //# sourceMappingURL=iframe-host-q7fedsmr.js.map