@compill/admin 1.0.25

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 (66) hide show
  1. package/index.d.ts +44 -0
  2. package/index.js +248 -0
  3. package/index.mjs +42211 -0
  4. package/index.umd.js +248 -0
  5. package/lib/SectionTitle.d.ts +3 -0
  6. package/lib/breadcrumbs/BreadCrumbs.d.ts +9 -0
  7. package/lib/buttons/DialogButton.d.ts +7 -0
  8. package/lib/buttons/IconButton.d.ts +5 -0
  9. package/lib/buttons/InvalidateButton.d.ts +7 -0
  10. package/lib/buttons/NavigateButton.d.ts +5 -0
  11. package/lib/buttons/PublishButton.d.ts +10 -0
  12. package/lib/buttons/UpdateButton.d.ts +3 -0
  13. package/lib/buttons/ViewButton.d.ts +6 -0
  14. package/lib/cells/OrderCell.d.ts +12 -0
  15. package/lib/json/DetailsView.d.ts +6 -0
  16. package/lib/json/EditItemView.d.ts +3 -0
  17. package/lib/json/MultiQueryWrapper.d.ts +6 -0
  18. package/lib/json/QueryWrapper.d.ts +7 -0
  19. package/lib/json/ScreenRenderer.d.ts +7 -0
  20. package/lib/json/ScreenTopBar.d.ts +15 -0
  21. package/lib/json/TabbedView.d.ts +4 -0
  22. package/lib/json/dialog/DialogRenderer.d.ts +12 -0
  23. package/lib/json/dialog/ItemDeleteDialog.d.ts +11 -0
  24. package/lib/json/dialog/ItemEditDialog.d.ts +32 -0
  25. package/lib/json/dialog/MultiQueryWrapperDialog.d.ts +8 -0
  26. package/lib/json/dialog/QueryWrapperDialog.d.ts +14 -0
  27. package/lib/json/table/TableRowActionsView.d.ts +12 -0
  28. package/lib/json/table/TableRowPublishPostButton.d.ts +9 -0
  29. package/lib/json/table/TableView.d.ts +4 -0
  30. package/lib/json/table/TableViewContext.d.ts +16 -0
  31. package/lib/json/table/useTableProps.d.ts +3 -0
  32. package/lib/json/types/DetailsView.d.ts +51 -0
  33. package/lib/json/types/EditItemDialog.d.ts +4 -0
  34. package/lib/json/types/MultiQueryWrapper.d.ts +18 -0
  35. package/lib/json/types/MultiQueryWrapperDialog.d.ts +13 -0
  36. package/lib/json/types/QueryWrapper.d.ts +27 -0
  37. package/lib/json/types/QueryWrapperDialog.d.ts +22 -0
  38. package/lib/json/types/ScreenConfig.d.ts +8 -0
  39. package/lib/json/types/TabbedView.d.ts +23 -0
  40. package/lib/json/types/TableView.d.ts +77 -0
  41. package/lib/modal/AttachDialog.d.ts +31 -0
  42. package/lib/modal/FormActionDialog.d.ts +23 -0
  43. package/lib/modal/ItemEditDialog.d.ts +33 -0
  44. package/lib/page/PageContainer.d.ts +3 -0
  45. package/lib/page/PageContentEditor.d.ts +5 -0
  46. package/lib/page/PageMain.d.ts +3 -0
  47. package/lib/page/PageQueryStateContainer.d.ts +12 -0
  48. package/lib/page/PageSectionTitle.d.ts +3 -0
  49. package/lib/page/PageSidebar.d.ts +3 -0
  50. package/lib/page/PageSidebarSection.d.ts +5 -0
  51. package/lib/page/PageStateContainer.d.ts +7 -0
  52. package/lib/page/PageSubSectionTitle.d.ts +3 -0
  53. package/lib/page/PageTitle.d.ts +3 -0
  54. package/lib/page/PageTopBar.d.ts +13 -0
  55. package/lib/status/StatusBadge.d.ts +5 -0
  56. package/lib/table/TableContainer.d.ts +3 -0
  57. package/lib/table/TableCreateButton.d.ts +3 -0
  58. package/lib/table/TableFilterButton.d.ts +3 -0
  59. package/lib/table/TableRowActionBar.d.ts +11 -0
  60. package/lib/table/TableRowDeleteButton.d.ts +3 -0
  61. package/lib/table/TableRowEditButton.d.ts +3 -0
  62. package/lib/table/TableRowNavigateButton.d.ts +5 -0
  63. package/lib/table/TableRowPublishPostButton.d.ts +9 -0
  64. package/lib/table/TableRowViewButton.d.ts +5 -0
  65. package/lib/table/TableTopBar.d.ts +8 -0
  66. package/package.json +13 -0
package/index.js ADDED
@@ -0,0 +1,248 @@
1
+ "use strict";var GE=Object.defineProperty;var JE=(t,e,n)=>e in t?GE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var zn=(t,e,n)=>(JE(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@soperio/jsx-runtime"),N=require("@valerya/ui"),Ps=require("react/jsx-runtime"),O=require("react"),Fr=require("@tanstack/react-query"),Fn=require("react-router-dom"),$e=require("@soperio/react"),Je=require("formik"),ho=require("react-dom");function XE(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const pi=XE(O);function YE({children:t,...e}){return b.jsx("h2",{textSize:"xl",fontWeight:"600",textColor:"slate-800",...e,children:t})}var QE="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M12,17L17,12H14V8H10V12H7L12,17Z",ZE="M19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21M12,7L7,12H10V16H14V12H17L12,7Z",Zh="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",e_="M18.41,7.41L17,6L11,12L17,18L18.41,16.59L13.83,12L18.41,7.41M12.41,7.41L11,6L5,12L11,18L12.41,16.59L7.83,12L12.41,7.41Z",t_="M5.59,7.41L7,6L13,12L7,18L5.59,16.59L10.17,12L5.59,7.41M11.59,7.41L13,6L19,12L13,18L11.59,16.59L16.17,12L11.59,7.41Z",n_="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",r_="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",i_="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",Yv="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",o_="M12,10A2,2 0 0,0 10,12C10,13.11 10.9,14 12,14C13.11,14 14,13.11 14,12A2,2 0 0,0 12,10Z",Qv="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",Zv="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",s_="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z",a_="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",l_="M6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.03C18.17 12 18.33 12 18.5 12C19 12 19.5 12.07 20 12.18V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.17 21 12.33 21 12.5 21C12.24 20.37 12.09 19.7 12.03 19L12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.17 16 12.34 16 12.5 16C12.85 15.18 13.34 14.46 13.95 13.86C13.32 13.95 12.67 14 12 14C9.58 14 7.3 13.4 6 12.45M12 5C15.87 5 18 6.5 18 7S15.87 9 12 9 6 7.5 6 7 8.13 5 12 5M18 18.5L19.77 16.73C19.32 16.28 18.69 16 18 16C16.62 16 15.5 17.12 15.5 18.5S16.62 21 18 21C18.82 21 19.54 20.61 20 20H21.71C21.12 21.47 19.68 22.5 18 22.5C15.79 22.5 14 20.71 14 18.5S15.79 14.5 18 14.5C19.11 14.5 20.11 14.95 20.83 15.67L22 14.5V18.5H18Z",Mf="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",ep="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",c_="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",u_="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",d_="M16.5,12C19,12 21,14 21,16.5C21,17.38 20.75,18.21 20.31,18.9L23.39,22L22,23.39L18.88,20.32C18.19,20.75 17.37,21 16.5,21C14,21 12,19 12,16.5C12,14 14,12 16.5,12M16.5,14A2.5,2.5 0 0,0 14,16.5A2.5,2.5 0 0,0 16.5,19A2.5,2.5 0 0,0 19,16.5A2.5,2.5 0 0,0 16.5,14M9,4L11,6H19A2,2 0 0,1 21,8V11.81C19.83,10.69 18.25,10 16.5,10A6.5,6.5 0 0,0 10,16.5C10,17.79 10.37,19 11,20H3C1.89,20 1,19.1 1,18V6C1,4.89 1.89,4 3,4H9Z",f_="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z",h_="M4,17L6.75,14.25L6.72,14.23C6.14,13.64 6.14,12.69 6.72,12.11L11.46,7.37L15.7,11.61L10.96,16.35C10.39,16.93 9.46,16.93 8.87,16.37L8.24,17H4M15.91,2.91C16.5,2.33 17.45,2.33 18.03,2.91L20.16,5.03C20.74,5.62 20.74,6.57 20.16,7.16L16.86,10.45L12.62,6.21L15.91,2.91Z",p_="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z",eb="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6Z",tb="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6M22,20V22H14.5V20H22Z",nb="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6M2,20H13V22H2V20Z",rb="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z",ib="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z",ob="M10,7L8,11H11V17H5V11L7,7H10M18,7L16,11H19V17H13V11L15,7H18Z",g_="M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z",m_="M9.6,14L12,7.7L14.4,14M11,5L5.5,19H7.7L8.8,16H15L16.1,19H18.3L13,5H11Z",y_="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z",v_="M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z",b_="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",w_="M21 17.2L6.8 3H19C20.1 3 21 3.9 21 5V17.2M20.7 22L19.7 21H5C3.9 21 3 20.1 3 19V4.3L2 3.3L3.3 2L22 20.7L20.7 22M16.8 18L12.9 14.1L11 16.5L8.5 13.5L5 18H16.8Z",S_="M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z",x_="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",tp="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",sb="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",C_="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",E_="M3 3V21H21V3H3M18 18H6V17H18V18M18 16H6V15H18V16M18 12H6V6H18V12Z",ab="M5,4V6H19V4H5M5,14H9V20H15V14H19L12,7L5,14Z",lb="M20.8 22.7L15 16.9V20H9V14H5L8.6 10.4L1.1 3L2.4 1.7L22.1 21.4L20.8 22.7M19 6V4H7.2L9.2 6H19M17.2 14H19L12 7L11.1 7.9L17.2 14Z",cb="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",__="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z",R_="M12,15.4V6.1L13.71,10.13L18.09,10.5L14.77,13.39L15.76,17.67M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",A_="M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",ub="M21,6V8H3V6H21M3,18H12V16H3V18M3,13H21V11H3V13Z",O_="M16,15H9V13H16V15M19,11H9V9H19V11M19,7H9V5H19V7M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3M21,1A2,2 0 0,1 23,3V17C23,18.11 22.11,19 21,19H7A2,2 0 0,1 5,17V3C5,1.89 5.89,1 7,1H21M7,3V17H21V3H7Z",db="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",T_="M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z";function fb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function k_(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Pf={exports:{}},Nt={};Nt._=Nt._interop_require_default=M_;function M_(t){return t&&t.__esModule?t:{default:t}}var Ks={exports:{}},iu={},qg;function uc(){return qg||(qg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{assign:function(){return o},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return i}});function n(s){const a={};return s.forEach((l,c)=>{typeof a[c]>"u"?a[c]=l:Array.isArray(a[c])?a[c].push(l):a[c]=[a[c],l]}),a}function r(s){return typeof s=="string"||typeof s=="number"&&!isNaN(s)||typeof s=="boolean"?String(s):""}function i(s){const a=new URLSearchParams;return Object.entries(s).forEach(l=>{let[c,u]=l;Array.isArray(u)?u.forEach(d=>a.append(c,r(d))):a.set(c,r(u))}),a}function o(s){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return l.forEach(u=>{Array.from(u.keys()).forEach(d=>s.delete(d)),u.forEach((d,h)=>s.append(h,d))}),s}}(iu)),iu}var ou={},Gs={},Wg;function Is(){if(Wg)return Gs;Wg=1;function t(n){if(typeof WeakMap!="function")return null;var r=new WeakMap,i=new WeakMap;return(t=function(o){return o?i:r})(n)}Gs._=Gs._interop_require_wildcard=e;function e(n,r){if(!r&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var i=t(r);if(i&&i.has(n))return i.get(n);var o={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in n)if(a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)){var l=s?Object.getOwnPropertyDescriptor(n,a):null;l&&(l.get||l.set)?Object.defineProperty(o,a,l):o[a]=n[a]}return o.default=n,i&&i.set(n,o),o}return Gs}var Kg;function np(){return Kg||(Kg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}e(t,{formatUrl:function(){return o},formatWithValidation:function(){return a},urlObjectKeys:function(){return s}});const r=Is()._(uc()),i=/https?|ftp|gopher|file/;function o(l){let{auth:c,hostname:u}=l,d=l.protocol||"",h=l.pathname||"",f=l.hash||"",p=l.query||"",g=!1;c=c?encodeURIComponent(c).replace(/%3A/i,":")+"@":"",l.host?g=c+l.host:u&&(g=c+(~u.indexOf(":")?"["+u+"]":u),l.port&&(g+=":"+l.port)),p&&typeof p=="object"&&(p=String(r.urlQueryToSearchParams(p)));let m=l.search||p&&"?"+p||"";return d&&!d.endsWith(":")&&(d+=":"),l.slashes||(!d||i.test(d))&&g!==!1?(g="//"+(g||""),h&&h[0]!=="/"&&(h="/"+h)):g||(g=""),f&&f[0]!=="#"&&(f="#"+f),m&&m[0]!=="?"&&(m="?"+m),h=h.replace(/[?#]/g,encodeURIComponent),m=m.replace("#","%23"),""+d+g+h+m+f}const s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function a(l){return process.env.NODE_ENV==="development"&&l!==null&&typeof l=="object"&&Object.keys(l).forEach(c=>{s.includes(c)||console.warn("Unknown key passed via urlObject into url.format: "+c)}),o(l)}}(ou)),ou}var su={},Gg;function hb(){return Gg||(Gg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return e}});function e(n,r){const i={};return Object.keys(n).forEach(o=>{r.includes(o)||(i[o]=n[o])}),i}}(su)),su}var au={},Jg;function po(){return Jg||(Jg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(v,S){for(var C in S)Object.defineProperty(v,C,{enumerable:!0,get:S[C]})}e(t,{DecodeError:function(){return p},MiddlewareNotFoundError:function(){return x},MissingStaticPage:function(){return y},NormalizeError:function(){return g},PageNotFoundError:function(){return m},SP:function(){return h},ST:function(){return f},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return l},getLocationOrigin:function(){return s},getURL:function(){return a},isAbsoluteUrl:function(){return o},isResSent:function(){return c},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return u},stringifyError:function(){return w}});const n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(v){let S=!1,C;return function(){for(var _=arguments.length,E=new Array(_),R=0;R<_;R++)E[R]=arguments[R];return S||(S=!0,C=v(...E)),C}}const i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=v=>i.test(v);function s(){const{protocol:v,hostname:S,port:C}=window.location;return v+"//"+S+(C?":"+C:"")}function a(){const{href:v}=window.location,S=s();return v.substring(S.length)}function l(v){return typeof v=="string"?v:v.displayName||v.name||"Unknown"}function c(v){return v.finished||v.headersSent}function u(v){const S=v.split("?");return S[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(S[1]?"?"+S.slice(1).join("?"):"")}async function d(v,S){if(process.env.NODE_ENV!=="production"){var C;if((C=v.prototype)!=null&&C.getInitialProps){const R='"'+l(v)+'.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';throw new Error(R)}}const _=S.res||S.ctx&&S.ctx.res;if(!v.getInitialProps)return S.ctx&&S.Component?{pageProps:await d(S.Component,S.ctx)}:{};const E=await v.getInitialProps(S);if(_&&c(_))return E;if(!E){const R='"'+l(v)+'.getInitialProps()" should resolve to an object. But found "'+E+'" instead.';throw new Error(R)}return process.env.NODE_ENV!=="production"&&Object.keys(E).length===0&&!S.ctx&&console.warn(""+l(v)+" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps"),E}const h=typeof performance<"u",f=h&&["mark","measure","getEntriesByName"].every(v=>typeof performance[v]=="function");class p extends Error{}class g extends Error{}class m extends Error{constructor(S){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+S}}class y extends Error{constructor(S,C){super(),this.message="Failed to load static file for page: "+S+" "+C}}class x extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(v){return JSON.stringify({message:v.message,stack:v.stack})}}(au)),au}var Js={exports:{}},lu={},Xg;function Ls(){return Xg||(Xg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(n){return n.replace(/\/$/,"")||"/"}}(lu)),lu}var cu={},Yg;function go(){return Yg||(Yg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return e}});function e(n){const r=n.indexOf("#"),i=n.indexOf("?"),o=i>-1&&(r<0||i<r);return o||r>-1?{pathname:n.substring(0,o?i:r),query:o?n.substring(i,r>-1?r:void 0):"",hash:r>-1?n.slice(r):""}:{pathname:n,query:"",hash:""}}}(cu)),cu}var Qg;function dc(){return Qg||(Qg=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return i}});const n=Ls(),r=go(),i=o=>{if(!o.startsWith("/")||process.env.__NEXT_MANUAL_TRAILING_SLASH)return o;const{pathname:s,query:a,hash:l}=(0,r.parsePath)(o);return process.env.__NEXT_TRAILING_SLASH?/\.[^/]+\/?$/.test(s)?""+(0,n.removeTrailingSlash)(s)+a+l:s.endsWith("/")?""+s+a+l:s+"/"+a+l:""+(0,n.removeTrailingSlash)(s)+a+l};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Js,Js.exports)),Js.exports}var uu={},Xs={exports:{}},du={},Zg;function fc(){return Zg||(Zg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return n}});const e=go();function n(r,i){if(typeof r!="string")return!1;const{pathname:o}=(0,e.parsePath)(r);return o===i||o.startsWith(i+"/")}}(du)),du}var em;function rp(){return em||(em=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"hasBasePath",{enumerable:!0,get:function(){return i}});const n=fc(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function i(o){return(0,n.pathHasPrefix)(o,r)}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Xs,Xs.exports)),Xs.exports}var tm;function ip(){return tm||(tm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return r}});const e=po(),n=rp();function r(i){if(!(0,e.isAbsoluteUrl)(i))return!0;try{const o=(0,e.getLocationOrigin)(),s=new URL(i,o);return s.origin===o&&(0,n.hasBasePath)(s.pathname)}catch{return!1}}}(uu)),uu}var fu={},hu={},nm;function P_(){return nm||(nm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n}});class e{insert(i){this._insert(i.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(i){i===void 0&&(i="/");const o=[...this.children.keys()].sort();this.slugName!==null&&o.splice(o.indexOf("[]"),1),this.restSlugName!==null&&o.splice(o.indexOf("[...]"),1),this.optionalRestSlugName!==null&&o.splice(o.indexOf("[[...]]"),1);const s=o.map(a=>this.children.get(a)._smoosh(""+i+a+"/")).reduce((a,l)=>[...a,...l],[]);if(this.slugName!==null&&s.push(...this.children.get("[]")._smoosh(i+"["+this.slugName+"]/")),!this.placeholder){const a=i==="/"?"/":i.slice(0,-1);if(this.optionalRestSlugName!=null)throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("'+a+'" and "'+a+"[[..."+this.optionalRestSlugName+']]").');s.unshift(a)}return this.restSlugName!==null&&s.push(...this.children.get("[...]")._smoosh(i+"[..."+this.restSlugName+"]/")),this.optionalRestSlugName!==null&&s.push(...this.children.get("[[...]]")._smoosh(i+"[[..."+this.optionalRestSlugName+"]]/")),s}_insert(i,o,s){if(i.length===0){this.placeholder=!1;return}if(s)throw new Error("Catch-all must be the last part of the URL.");let a=i[0];if(a.startsWith("[")&&a.endsWith("]")){let u=function(d,h){if(d!==null&&d!==h)throw new Error("You cannot use different slug names for the same dynamic path ('"+d+"' !== '"+h+"').");o.forEach(f=>{if(f===h)throw new Error('You cannot have the same slug name "'+h+'" repeat within a single dynamic path');if(f.replace(/\W/g,"")===a.replace(/\W/g,""))throw new Error('You cannot have the slug names "'+f+'" and "'+h+'" differ only by non-word symbols within a single dynamic path')}),o.push(h)},l=a.slice(1,-1),c=!1;if(l.startsWith("[")&&l.endsWith("]")&&(l=l.slice(1,-1),c=!0),l.startsWith("...")&&(l=l.substring(3),s=!0),l.startsWith("[")||l.endsWith("]"))throw new Error("Segment names may not start or end with extra brackets ('"+l+"').");if(l.startsWith("."))throw new Error("Segment names may not start with erroneous periods ('"+l+"').");if(s)if(c){if(this.restSlugName!=null)throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+i[0]+'" ).');u(this.optionalRestSlugName,l),this.optionalRestSlugName=l,a="[[...]]"}else{if(this.optionalRestSlugName!=null)throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+i[0]+'").');u(this.restSlugName,l),this.restSlugName=l,a="[...]"}else{if(c)throw new Error('Optional route parameters are not yet supported ("'+i[0]+'").');u(this.slugName,l),this.slugName=l,a="[]"}}this.children.has(a)||this.children.set(a,new e),this.children.get(a)._insert(i.slice(1),o,s)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function n(r){const i=new e;return r.forEach(o=>i.insert(o)),i.smoosh()}}(hu)),hu}var pu={},gu={},mu={},yu={},rm;function I_(){return rm||(rm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return e}});function e(n){return n.startsWith("/")?n:"/"+n}}(yu)),yu}var vu={},im;function L_(){return im||(im=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,s){for(var a in s)Object.defineProperty(o,a,{enumerable:!0,get:s[a]})}e(t,{DEFAULT_SEGMENT_KEY:function(){return i},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});function n(o){return o[0]==="("&&o.endsWith(")")}const r="__PAGE__",i="__DEFAULT__"}(vu)),vu}var om;function D_(){return om||(om=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{normalizeAppPath:function(){return i},normalizeRscURL:function(){return o}});const n=I_(),r=L_();function i(s){return(0,n.ensureLeadingSlash)(s.split("/").reduce((a,l,c,u)=>!l||(0,r.isGroupSegment)(l)||l[0]==="@"||(l==="page"||l==="route")&&c===u.length-1?a:a+"/"+l,""))}function o(s){return s.replace(/\.rsc($|\?)/,"$1")}}(mu)),mu}var sm;function op(){return sm||(sm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{INTERCEPTION_ROUTE_MARKERS:function(){return r},extractInterceptionRouteInformation:function(){return o},isInterceptionRouteAppPath:function(){return i}});const n=D_(),r=["(..)(..)","(.)","(..)","(...)"];function i(s){return s.split("/").find(a=>r.find(l=>a.startsWith(l)))!==void 0}function o(s){let a,l,c;for(const u of s.split("/"))if(l=r.find(d=>u.startsWith(d)),l){[a,c]=s.split(l,2);break}if(!a||!l||!c)throw new Error(`Invalid interception route: ${s}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(a=(0,n.normalizeAppPath)(a),l){case"(.)":a==="/"?c=`/${c}`:c=a+"/"+c;break;case"(..)":if(a==="/")throw new Error(`Invalid interception route: ${s}. Cannot use (..) marker at the root level, use (.) instead.`);c=a.split("/").slice(0,-1).concat(c).join("/");break;case"(...)":c="/"+c;break;case"(..)(..)":const u=a.split("/");if(u.length<=2)throw new Error(`Invalid interception route: ${s}. Cannot use (..)(..) marker at the root level or one level up.`);c=u.slice(0,-2).concat(c).join("/");break;default:throw new Error("Invariant: unexpected marker")}return{interceptingRoute:a,interceptedRoute:c}}}(gu)),gu}var am;function pb(){return am||(am=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return r}});const e=op(),n=/\/\[[^/]+?\](?=\/|$)/;function r(i){return(0,e.isInterceptionRouteAppPath)(i)&&(i=(0,e.extractInterceptionRouteInformation)(i).interceptedRoute),n.test(i)}}(pu)),pu}var lm;function gb(){return lm||(lm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,o){for(var s in o)Object.defineProperty(i,s,{enumerable:!0,get:o[s]})}e(t,{getSortedRoutes:function(){return n.getSortedRoutes},isDynamicRoute:function(){return r.isDynamicRoute}});const n=P_(),r=pb()}(fu)),fu}var bu={},wu={},cm;function mb(){return cm||(cm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return n}});const e=po();function n(r){let{re:i,groups:o}=r;return s=>{const a=i.exec(s);if(!a)return!1;const l=u=>{try{return decodeURIComponent(u)}catch{throw new e.DecodeError("failed to decode param")}},c={};return Object.keys(o).forEach(u=>{const d=o[u],h=a[d.pos];h!==void 0&&(c[u]=~h.indexOf("/")?h.split("/").map(f=>l(f)):d.repeat?[l(h)]:l(h))}),c}}}(wu)),wu}var Su={},xu={},um;function yb(){return um||(um=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return r}});const e=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function r(i){return e.test(i)?i.replace(n,"\\$&"):i}}(xu)),xu}var dm;function vb(){return dm||(dm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(g,m){for(var y in m)Object.defineProperty(g,y,{enumerable:!0,get:m[y]})}e(t,{getNamedMiddlewareRegex:function(){return p},getNamedRouteRegex:function(){return f},getRouteRegex:function(){return c},parseParameter:function(){return a}});const n=op(),r=yb(),i=Ls(),o="nxtP",s="nxtI";function a(g){const m=g.startsWith("[")&&g.endsWith("]");m&&(g=g.slice(1,-1));const y=g.startsWith("...");return y&&(g=g.slice(3)),{key:g,repeat:y,optional:m}}function l(g){const m=(0,i.removeTrailingSlash)(g).slice(1).split("/"),y={};let x=1;return{parameterizedRoute:m.map(w=>{const v=n.INTERCEPTION_ROUTE_MARKERS.find(C=>w.startsWith(C)),S=w.match(/\[((?:\[.*\])|.+)\]/);if(v&&S){const{key:C,optional:_,repeat:E}=a(S[1]);return y[C]={pos:x++,repeat:E,optional:_},"/"+(0,r.escapeStringRegexp)(v)+"([^/]+?)"}else if(S){const{key:C,repeat:_,optional:E}=a(S[1]);return y[C]={pos:x++,repeat:_,optional:E},_?E?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}else return"/"+(0,r.escapeStringRegexp)(w)}).join(""),groups:y}}function c(g){const{parameterizedRoute:m,groups:y}=l(g);return{re:new RegExp("^"+m+"(?:/)?$"),groups:y}}function u(){let g=0;return()=>{let m="",y=++g;for(;y>0;)m+=String.fromCharCode(97+(y-1)%26),y=Math.floor((y-1)/26);return m}}function d(g){let{interceptionMarker:m,getSafeRouteKey:y,segment:x,routeKeys:w,keyPrefix:v}=g;const{key:S,optional:C,repeat:_}=a(x);let E=S.replace(/\W/g,"");v&&(E=""+v+E);let R=!1;(E.length===0||E.length>30)&&(R=!0),isNaN(parseInt(E.slice(0,1)))||(R=!0),R&&(E=y()),v?w[E]=""+v+S:w[E]=S;const A=m?(0,r.escapeStringRegexp)(m):"";return _?C?"(?:/"+A+"(?<"+E+">.+?))?":"/"+A+"(?<"+E+">.+?)":"/"+A+"(?<"+E+">[^/]+?)"}function h(g,m){const y=(0,i.removeTrailingSlash)(g).slice(1).split("/"),x=u(),w={};return{namedParameterizedRoute:y.map(v=>{const S=n.INTERCEPTION_ROUTE_MARKERS.some(_=>v.startsWith(_)),C=v.match(/\[((?:\[.*\])|.+)\]/);if(S&&C){const[_]=v.split(C[0]);return d({getSafeRouteKey:x,interceptionMarker:_,segment:C[1],routeKeys:w,keyPrefix:m?s:void 0})}else return C?d({getSafeRouteKey:x,segment:C[1],routeKeys:w,keyPrefix:m?o:void 0}):"/"+(0,r.escapeStringRegexp)(v)}).join(""),routeKeys:w}}function f(g,m){const y=h(g,m);return{...c(g),namedRegex:"^"+y.namedParameterizedRoute+"(?:/)?$",routeKeys:y.routeKeys}}function p(g,m){const{parameterizedRoute:y}=l(g),{catchAll:x=!0}=m;if(y==="/")return{namedRegex:"^/"+(x?".*":"")+"$"};const{namedParameterizedRoute:w}=h(g,!1);let v=x?"(?:(/.*)?)":"";return{namedRegex:"^"+w+v+"$"}}}(Su)),Su}var fm;function bb(){return fm||(fm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return r}});const e=mb(),n=vb();function r(i,o,s){let a="";const l=(0,n.getRouteRegex)(i),c=l.groups,u=(o!==i?(0,e.getRouteMatcher)(l)(o):"")||s;a=i;const d=Object.keys(c);return d.every(h=>{let f=u[h]||"";const{repeat:p,optional:g}=c[h];let m="["+(p?"...":"")+h+"]";return g&&(m=(f?"":"/")+"["+m+"]"),p&&!Array.isArray(f)&&(f=[f]),(g||h in u)&&(a=a.replace(m,p?f.map(y=>encodeURIComponent(y)).join("/"):encodeURIComponent(f))||"/")})||(a=""),{params:d,result:a}}}(bu)),bu}var hm;function wb(){return hm||(hm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"resolveHref",{enumerable:!0,get:function(){return u}});const n=uc(),r=np(),i=hb(),o=po(),s=dc(),a=ip(),l=gb(),c=bb();function u(d,h,f){let p,g=typeof h=="string"?h:(0,r.formatWithValidation)(h);const m=g.match(/^[a-zA-Z]{1,}:\/\//),y=m?g.slice(m[0].length):g;if((y.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+g+"' passed to next/router in page: '"+d.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");const w=(0,o.normalizeRepeatedSlashes)(y);g=(m?m[0]:"")+w}if(!(0,a.isLocalURL)(g))return f?[g]:g;try{p=new URL(g.startsWith("#")?d.asPath:d.pathname,"http://n")}catch{p=new URL("/","http://n")}try{const w=new URL(g,p);w.pathname=(0,s.normalizePathTrailingSlash)(w.pathname);let v="";if((0,l.isDynamicRoute)(w.pathname)&&w.searchParams&&f){const C=(0,n.searchParamsToUrlQuery)(w.searchParams),{result:_,params:E}=(0,c.interpolateAs)(w.pathname,w.pathname,C);_&&(v=(0,r.formatWithValidation)({pathname:_,hash:w.hash,query:(0,i.omit)(C,E)}))}const S=w.origin===p.origin?w.href.slice(w.origin.length):w.href;return f?[S,v||S]:S}catch{return f?[g]:g}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ks,Ks.exports)),Ks.exports}var Ys={exports:{}},Cu={},Eu={},pm;function sp(){return pm||(pm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return n}});const e=go();function n(r,i){if(!r.startsWith("/")||!i)return r;const{pathname:o,query:s,hash:a}=(0,e.parsePath)(r);return""+i+o+s+a}}(Eu)),Eu}var gm;function Sb(){return gm||(gm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return r}});const e=sp(),n=fc();function r(i,o,s,a){if(!o||o===s)return i;const l=i.toLowerCase();return!a&&((0,n.pathHasPrefix)(l,"/api")||(0,n.pathHasPrefix)(l,"/"+o.toLowerCase()))?i:(0,e.addPathPrefix)(i,"/"+o)}}(Cu)),Cu}var mm;function xb(){return mm||(mm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return r}});const n=dc(),r=function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];return process.env.__NEXT_I18N_SUPPORT?(0,n.normalizePathTrailingSlash)(Sb().addLocale(i,...s)):i};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ys,Ys.exports)),Ys.exports}var _u={},ym;function ap(){return ym||(ym=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});const r=Nt._(O).default.createContext(null);process.env.NODE_ENV!=="production"&&(r.displayName="RouterContext")}(_u)),_u}var Ru={},vm;function N_(){return vm||(vm=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0});function e(c,u){for(var d in u)Object.defineProperty(c,d,{enumerable:!0,get:u[d]})}e(t,{AppRouterContext:function(){return i},GlobalLayoutRouterContext:function(){return s},LayoutRouterContext:function(){return o},MissingSlotContext:function(){return l},TemplateContext:function(){return a}});const r=Nt._(O),i=r.default.createContext(null),o=r.default.createContext(null),s=r.default.createContext(null),a=r.default.createContext(null);process.env.NODE_ENV!=="production"&&(i.displayName="AppRouterContext",o.displayName="LayoutRouterContext",s.displayName="GlobalLayoutRouterContext",a.displayName="TemplateContext");const l=r.default.createContext(new Set)}(Ru)),Ru}var Qs={exports:{}},Zs={exports:{}},bm;function lp(){return bm||(bm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(o,s){for(var a in s)Object.defineProperty(o,a,{enumerable:!0,get:s[a]})}n(e,{cancelIdleCallback:function(){return i},requestIdleCallback:function(){return r}});const r=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(o){let s=Date.now();return self.setTimeout(function(){o({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-s))}})},1)},i=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(o){return clearTimeout(o)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Zs,Zs.exports)),Zs.exports}var wm;function j_(){return wm||(wm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"useIntersection",{enumerable:!0,get:function(){return c}});const n=O,r=lp(),i=typeof IntersectionObserver=="function",o=new Map,s=[];function a(u){const d={root:u.root||null,margin:u.rootMargin||""},h=s.find(m=>m.root===d.root&&m.margin===d.margin);let f;if(h&&(f=o.get(h),f))return f;const p=new Map,g=new IntersectionObserver(m=>{m.forEach(y=>{const x=p.get(y.target),w=y.isIntersecting||y.intersectionRatio>0;x&&w&&x(w)})},u);return f={id:d,observer:g,elements:p},s.push(d),o.set(d,f),f}function l(u,d,h){const{id:f,observer:p,elements:g}=a(h);return g.set(u,d),p.observe(u),function(){if(g.delete(u),p.unobserve(u),g.size===0){p.disconnect(),o.delete(f);const y=s.findIndex(x=>x.root===f.root&&x.margin===f.margin);y>-1&&s.splice(y,1)}}}function c(u){let{rootRef:d,rootMargin:h,disabled:f}=u;const p=f||!i,[g,m]=(0,n.useState)(!1),y=(0,n.useRef)(null),x=(0,n.useCallback)(v=>{y.current=v},[]);(0,n.useEffect)(()=>{if(i){if(p||g)return;const v=y.current;if(v&&v.tagName)return l(v,C=>C&&m(C),{root:d==null?void 0:d.current,rootMargin:h})}else if(!g){const v=(0,r.requestIdleCallback)(()=>m(!0));return()=>(0,r.cancelIdleCallback)(v)}},[p,h,d,g,y.current]);const w=(0,n.useCallback)(()=>{m(!1)},[]);return[x,g,w]}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Qs,Qs.exports)),Qs.exports}var ea={exports:{}},ta={exports:{}},Au={},Sm;function hc(){return Sm||(Sm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(n,r){let i;const o=n.split("/");return(r||[]).some(s=>o[1]&&o[1].toLowerCase()===s.toLowerCase()?(i=s,o.splice(1,1),n=o.join("/")||"/",!0):!1),{pathname:n,detectedLocale:i}}}(Au)),Au}var xm;function F_(){return xm||(xm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});const n=(r,i)=>process.env.__NEXT_I18N_SUPPORT?hc().normalizeLocalePath(r,i):{pathname:r,detectedLocale:void 0};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ta,ta.exports)),ta.exports}var na={exports:{}},Ou={},Cm;function H_(){return Cm||(Cm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(n,r,i){if(n){i&&(i=i.toLowerCase());for(const a of n){var o,s;const l=(o=a.domain)==null?void 0:o.split(":",1)[0].toLowerCase();if(r===l||i===a.defaultLocale.toLowerCase()||(s=a.locales)!=null&&s.some(c=>c.toLowerCase()===i))return a}}}}(Ou)),Ou}var Em;function Cb(){return Em||(Em=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return n}});const n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];if(process.env.__NEXT_I18N_SUPPORT)return H_().detectDomainLocale(...i)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(na,na.exports)),na.exports}var _m;function $_(){return _m||(_m=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getDomainLocale",{enumerable:!0,get:function(){return i}});const n=dc(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function i(o,s,a,l){if(process.env.__NEXT_I18N_SUPPORT){const c=F_().normalizeLocalePath,u=Cb().detectDomainLocale,d=s||c(o,a).detectedLocale,h=u(l,void 0,d);if(h){const f="http"+(h.http?"":"s")+"://",p=d===h.defaultLocale?"":"/"+d;return""+f+h.domain+(0,n.normalizePathTrailingSlash)(""+r+p+o)}return!1}else return!1}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ea,ea.exports)),ea.exports}var ra={exports:{}},Rm;function Eb(){return Rm||(Rm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addBasePath",{enumerable:!0,get:function(){return o}});const n=sp(),r=dc(),i=process.env.__NEXT_ROUTER_BASEPATH||"";function o(s,a){return(0,r.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!a?s:(0,n.addPathPrefix)(s,i))}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ra,ra.exports)),ra.exports}var ia={exports:{}},Am;function B_(){return Am||(Am=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(f,p){for(var g in p)Object.defineProperty(f,g,{enumerable:!0,get:p[g]})}n(e,{ACTION_FAST_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return i},ACTION_PREFETCH:function(){return a},ACTION_REFRESH:function(){return r},ACTION_RESTORE:function(){return o},ACTION_SERVER_ACTION:function(){return c},ACTION_SERVER_PATCH:function(){return s},PrefetchCacheEntryStatus:function(){return d},PrefetchKind:function(){return u},isThenable:function(){return h}});const r="refresh",i="navigate",o="restore",s="server-patch",a="prefetch",l="fast-refresh",c="server-action";var u;(function(f){f.AUTO="auto",f.FULL="full",f.TEMPORARY="temporary"})(u||(u={}));var d;(function(f){f.fresh="fresh",f.reusable="reusable",f.expired="expired",f.stale="stale"})(d||(d={}));function h(f){return f&&(typeof f=="object"||typeof f=="function")&&typeof f.then=="function"}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ia,ia.exports)),ia.exports}(function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return C}});const n=Nt,r=Ps,i=n._(O),o=wb(),s=ip(),a=np(),l=po(),c=xb(),u=ap(),d=N_(),h=j_(),f=$_(),p=Eb(),g=B_(),m=new Set;function y(_,E,R,A,T,k){if(typeof window>"u"||!k&&!(0,s.isLocalURL)(E))return;if(!A.bypassPrefetchedCheck){const M=typeof A.locale<"u"?A.locale:"locale"in _?_.locale:void 0,j=E+"%"+R+"%"+M;if(m.has(j))return;m.add(j)}(async()=>k?_.prefetch(E,T):_.prefetch(E,R,A))().catch(M=>{if(process.env.NODE_ENV!=="production")throw M})}function x(_){const R=_.currentTarget.getAttribute("target");return R&&R!=="_self"||_.metaKey||_.ctrlKey||_.shiftKey||_.altKey||_.nativeEvent&&_.nativeEvent.which===2}function w(_,E,R,A,T,k,P,M,j){const{nodeName:z}=_.currentTarget;if(z.toUpperCase()==="A"&&(x(_)||!j&&!(0,s.isLocalURL)(R)))return;_.preventDefault();const J=()=>{const K=P??!0;"beforePopState"in E?E[T?"replace":"push"](R,A,{shallow:k,locale:M,scroll:K}):E[T?"replace":"push"](A||R,{scroll:K})};j?i.default.startTransition(J):J()}function v(_){return typeof _=="string"?_:(0,a.formatUrl)(_)}const C=i.default.forwardRef(function(E,R){let A;const{href:T,as:k,children:P,prefetch:M=null,passHref:j,replace:z,shallow:$,scroll:J,locale:K,onClick:D,onMouseEnter:Q,onTouchStart:se,legacyBehavior:oe=!1,...de}=E;A=P,oe&&(typeof A=="string"||typeof A=="number")&&(A=(0,r.jsx)("a",{children:A}));const ue=i.default.useContext(u.RouterContext),pe=i.default.useContext(d.AppRouterContext),L=ue??pe,ce=!ue,me=M!==!1,be=M===null?g.PrefetchKind.AUTO:g.PrefetchKind.FULL;if(process.env.NODE_ENV!=="production"){let Z=function(te){return new Error("Failed prop type: The prop `"+te.key+"` expects a "+te.expected+" in `<Link>`, but got `"+te.actual+"` instead."+(typeof window<"u"?`
2
+ Open your browser's console to view the Component stack trace.`:""))};Object.keys({href:!0}).forEach(te=>{if(te==="href"&&(E[te]==null||typeof E[te]!="string"&&typeof E[te]!="object"))throw Z({key:te,expected:"`string` or `object`",actual:E[te]===null?"null":typeof E[te]})}),Object.keys({as:!0,replace:!0,scroll:!0,shallow:!0,passHref:!0,prefetch:!0,locale:!0,onClick:!0,onMouseEnter:!0,onTouchStart:!0,legacyBehavior:!0}).forEach(te=>{const fe=typeof E[te];if(te==="as"){if(E[te]&&fe!=="string"&&fe!=="object")throw Z({key:te,expected:"`string` or `object`",actual:fe})}else if(te==="locale"){if(E[te]&&fe!=="string")throw Z({key:te,expected:"`string`",actual:fe})}else if(te==="onClick"||te==="onMouseEnter"||te==="onTouchStart"){if(E[te]&&fe!=="function")throw Z({key:te,expected:"`function`",actual:fe})}else if((te==="replace"||te==="scroll"||te==="shallow"||te==="passHref"||te==="prefetch"||te==="legacyBehavior")&&E[te]!=null&&fe!=="boolean")throw Z({key:te,expected:"`boolean`",actual:fe})});const V=i.default.useRef(!1);E.prefetch&&!V.current&&!ce&&(V.current=!0,console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated"))}if(process.env.NODE_ENV!=="production"&&ce&&!k){let Z;if(typeof T=="string"?Z=T:typeof T=="object"&&typeof T.pathname=="string"&&(Z=T.pathname),Z&&Z.split("/").some(U=>U.startsWith("[")&&U.endsWith("]")))throw new Error("Dynamic href `"+Z+"` found in <Link> while using the `/app` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href")}const{href:F,as:I}=i.default.useMemo(()=>{if(!ue){const U=v(T);return{href:U,as:k?v(k):U}}const[Z,Se]=(0,o.resolveHref)(ue,T,!0);return{href:Z,as:k?(0,o.resolveHref)(ue,k):Se||Z}},[ue,T,k]),je=i.default.useRef(F),G=i.default.useRef(I);let ne;if(oe)if(process.env.NODE_ENV==="development"){D&&console.warn('"onClick" was passed to <Link> with `href` of `'+T+'` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link'),Q&&console.warn('"onMouseEnter" was passed to <Link> with `href` of `'+T+'` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link');try{ne=i.default.Children.only(A)}catch{throw A?new Error("Multiple children were passed to <Link> with `href` of `"+T+"` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children"+(typeof window<"u"?`
3
+ Open your browser's console to view the Component stack trace.`:"")):new Error("No children were passed to <Link> with `href` of `"+T+"` but one child is required https://nextjs.org/docs/messages/link-no-children")}}else ne=i.default.Children.only(A);else if(process.env.NODE_ENV==="development"&&(A==null?void 0:A.type)==="a")throw new Error(`Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.
4
+ Learn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor`);const X=oe?ne&&typeof ne=="object"&&ne.ref:R,[W,B,ee]=(0,h.useIntersection)({rootMargin:"200px"}),xe=i.default.useCallback(Z=>{(G.current!==I||je.current!==F)&&(ee(),G.current=I,je.current=F),W(Z),X&&(typeof X=="function"?X(Z):typeof X=="object"&&(X.current=Z))},[I,X,F,ee,W]);i.default.useEffect(()=>{process.env.NODE_ENV==="production"&&L&&(!B||!me||y(L,F,I,{locale:K},{kind:be},ce))},[I,F,B,K,me,ue==null?void 0:ue.locale,L,ce,be]);const we={ref:xe,onClick(Z){if(process.env.NODE_ENV!=="production"&&!Z)throw new Error('Component rendered inside next/link has to pass click event to "onClick" prop.');!oe&&typeof D=="function"&&D(Z),oe&&ne.props&&typeof ne.props.onClick=="function"&&ne.props.onClick(Z),L&&(Z.defaultPrevented||w(Z,L,F,I,z,$,J,K,ce))},onMouseEnter(Z){!oe&&typeof Q=="function"&&Q(Z),oe&&ne.props&&typeof ne.props.onMouseEnter=="function"&&ne.props.onMouseEnter(Z),L&&((!me||process.env.NODE_ENV==="development")&&ce||y(L,F,I,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:be},ce))},onTouchStart:process.env.__NEXT_LINK_NO_TOUCH_START?void 0:function(Se){!oe&&typeof se=="function"&&se(Se),oe&&ne.props&&typeof ne.props.onTouchStart=="function"&&ne.props.onTouchStart(Se),L&&(!me&&ce||y(L,F,I,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:be},ce))}};if((0,l.isAbsoluteUrl)(I))we.href=I;else if(!oe||j||ne.type==="a"&&!("href"in ne.props)){const Z=typeof K<"u"?K:ue==null?void 0:ue.locale,Se=(ue==null?void 0:ue.isLocaleDomain)&&(0,f.getDomainLocale)(I,Z,ue==null?void 0:ue.locales,ue==null?void 0:ue.domainLocales);we.href=Se||(0,p.addBasePath)((0,c.addLocale)(I,Z,ue==null?void 0:ue.defaultLocale))}return oe?i.default.cloneElement(ne,we):(0,r.jsx)("a",{...de,...we,children:A})});(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})(Pf,Pf.exports);var V_=Pf.exports,z_=V_;const U_=fb(z_);function cp({breadcrumbs:t,...e}){return b.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",trait:"typo.h5",...e,children:t.map((n,r)=>b.jsx(q_,{breadcrumb:n,showSeparator:r>0},r))})}function q_({breadcrumb:t,showSeparator:e}){return b.jsxs(b.Fragment,{children:[e&&b.jsx(N.Icon,{path:o_,mx:"1"}),b.jsx(U_,{href:`/${t.path??"#"}`,children:b.jsx("span",{hover_textDecoration:t.path?"underline":void 0,cursor:t.path?"pointer":void 0,children:t.label})})]})}function pc({buildDialog:t,...e}){const[n,r]=O.useState(!1),i=O.useCallback(s=>{s==null||s.preventDefault(),s==null||s.stopPropagation(),r(!0)},[r]),o=O.useCallback(()=>{r(!1)},[r]);return b.jsxs(b.Fragment,{children:[b.jsx(N.Button,{onClick:i,...e}),n&&t(o)]})}function W_({icon:t,...e}){return b.jsx(N.Button,{variant:"glass",w:"10",h:"10",rounded:"full",...e,children:b.jsx(N.Icon,{path:t})})}class K_{constructor(e,n,...r){zn(this,"path");zn(this,"queryKey");zn(this,"axios");zn(this,"getRequest",(e,n)=>this.axios.get(`${this.path?"/"+this.path:""}${e?"/"+e:""}`,n).then(r=>r.data.data));zn(this,"postRequest",(e,n)=>this.axios.post(`${this.path?"/"+this.path:""}${e?"/"+e:""}`,n).then(r=>r.data.data));zn(this,"putRequest",(e,n)=>this.axios.put(`${this.path?"/"+this.path:""}${e?"/"+e:""}`,n).then(r=>r.data.data));zn(this,"deleteRequest",e=>this.axios.delete(`${this.path?"/"+this.path:""}${e?"/"+e:""}`).then(n=>n.data.data));if(this.axios=e,this.path=n,this.queryKey=[n],r&&r.length>0){const i=n.split(".");this.queryKey=[i[0]],r&&r.length>0&&r[0]&&this.queryKey.push(`${r[0]}`);for(let o=1;o<i.length;o++)this.queryKey.push(i[o]),r.length>o&&r[o]&&this.queryKey.push(`${r[o]}`);this.path=this.queryKey.join("/")}}}function mo(t,e){const n=Fr.useQueryClient(),r=e?t.concat([`${e}`]):t;return O.useCallback(()=>r?n.invalidateQueries(r):null,[r,n])}function yo(t,e,n,r){const i=(e??[]).concat([n?typeof n=="number"?`${n}`:n:void 0]);return Fr.useMutation(i,t,r)}function If(t,e,n,r){const i=mo(e,n),o=n?e.concat(`${n}`):e;return Fr.useMutation(o,t,{onSuccess:()=>i(),...r})}function Ei(t,e,n){const r=mo(e);return Fr.useMutation(e,t,{onSuccess:()=>r(),...n})}function _b(t,e){return function(n){return e?t(e):t()}}function Pn(t,e,n,r){const i=n?t.concat([typeof n=="number"?`${n}`:n]):t;return Fr.useQuery(i,_b(e,n),{retry:0,networkMode:"always",retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,...r})}function Rb(t){const e=Fr.useQueries({queries:t.map(o=>({queryKey:o.queryParam?o.queryKey.concat([typeof o.queryParam=="number"?`${o.queryParam}`:o.queryParam]):o.queryKey,queryFn:_b(o.queryFn,o.queryParam),retry:0,retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,...o.queryOptions}))}),n=e.findIndex(o=>o.isFetching===!0)!=-1,r=e.findIndex(o=>o.isError===!0)!=-1;return{data:e.map(o=>o.data),isFetching:n,isError:r}}function Ab(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Ab(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function wr(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Ab(t))&&(r&&(r+=" "),r+=e);return r}const Bo=t=>typeof t=="number"&&!isNaN(t),gi=t=>typeof t=="string",Ut=t=>typeof t=="function",Va=t=>gi(t)||Ut(t)?t:null,Tu=t=>O.isValidElement(t)||gi(t)||Ut(t)||Bo(t);function G_(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=t;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,n)})})}function gc(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:o=300}=t;return function(s){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:d,isIn:h}=s;const f=r?`${e}--${l}`:e,p=r?`${n}--${l}`:n,g=O.useRef(0);return O.useLayoutEffect(()=>{const m=d.current,y=f.split(" "),x=w=>{w.target===d.current&&(m.dispatchEvent(new Event("d")),m.removeEventListener("animationend",x),m.removeEventListener("animationcancel",x),g.current===0&&w.type!=="animationcancel"&&m.classList.remove(...y))};m.classList.add(...y),m.addEventListener("animationend",x),m.addEventListener("animationcancel",x)},[]),O.useEffect(()=>{const m=d.current,y=()=>{m.removeEventListener("animationend",y),i?G_(m,u,o):u()};h||(c?y():(g.current=1,m.className+=` ${p}`,m.addEventListener("animationend",y)))},[h]),O.createElement(O.Fragment,null,a)}}function Om(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const on={list:new Map,emitQueue:new Map,on(t,e){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(e),this},off(t,e){if(e){const n=this.list.get(t).filter(r=>r!==e);return this.list.set(t,n),this}return this.list.delete(t),this},cancelEmit(t){const e=this.emitQueue.get(t);return e&&(e.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(e=>{const n=setTimeout(()=>{e(...[].slice.call(arguments,1))},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(n)})}},oa=t=>{let{theme:e,type:n,...r}=t;return O.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},ku={info:function(t){return O.createElement(oa,{...t},O.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return O.createElement(oa,{...t},O.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return O.createElement(oa,{...t},O.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return O.createElement(oa,{...t},O.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return O.createElement("div",{className:"Toastify__spinner"})}};function J_(t){const[,e]=O.useReducer(f=>f+1,0),[n,r]=O.useState([]),i=O.useRef(null),o=O.useRef(new Map).current,s=f=>n.indexOf(f)!==-1,a=O.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:s,getToast:f=>o.get(f)}).current;function l(f){let{containerId:p}=f;const{limit:g}=a.props;!g||p&&a.containerId!==p||(a.count-=a.queue.length,a.queue=[])}function c(f){r(p=>f==null?[]:p.filter(g=>g!==f))}function u(){const{toastContent:f,toastProps:p,staleId:g}=a.queue.shift();h(f,p,g)}function d(f,p){let{delay:g,staleId:m,...y}=p;if(!Tu(f)||function(k){return!i.current||a.props.enableMultiContainer&&k.containerId!==a.props.containerId||o.has(k.toastId)&&k.updateId==null}(y))return;const{toastId:x,updateId:w,data:v}=y,{props:S}=a,C=()=>c(x),_=w==null;_&&a.count++;const E={...S,style:S.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(y).filter(k=>{let[P,M]=k;return M!=null})),toastId:x,updateId:w,data:v,closeToast:C,isIn:!1,className:Va(y.className||S.toastClassName),bodyClassName:Va(y.bodyClassName||S.bodyClassName),progressClassName:Va(y.progressClassName||S.progressClassName),autoClose:!y.isLoading&&(R=y.autoClose,A=S.autoClose,R===!1||Bo(R)&&R>0?R:A),deleteToast(){const k=Om(o.get(x),"removed");o.delete(x),on.emit(4,k);const P=a.queue.length;if(a.count=x==null?a.count-a.displayedToast:a.count-1,a.count<0&&(a.count=0),P>0){const M=x==null?a.props.limit:1;if(P===1||M===1)a.displayedToast++,u();else{const j=M>P?P:M;a.displayedToast=j;for(let z=0;z<j;z++)u()}}else e()}};var R,A;E.iconOut=function(k){let{theme:P,type:M,isLoading:j,icon:z}=k,$=null;const J={theme:P,type:M};return z===!1||(Ut(z)?$=z(J):O.isValidElement(z)?$=O.cloneElement(z,J):gi(z)||Bo(z)?$=z:j?$=ku.spinner():(K=>K in ku)(M)&&($=ku[M](J))),$}(E),Ut(y.onOpen)&&(E.onOpen=y.onOpen),Ut(y.onClose)&&(E.onClose=y.onClose),E.closeButton=S.closeButton,y.closeButton===!1||Tu(y.closeButton)?E.closeButton=y.closeButton:y.closeButton===!0&&(E.closeButton=!Tu(S.closeButton)||S.closeButton);let T=f;O.isValidElement(f)&&!gi(f.type)?T=O.cloneElement(f,{closeToast:C,toastProps:E,data:v}):Ut(f)&&(T=f({closeToast:C,toastProps:E,data:v})),S.limit&&S.limit>0&&a.count>S.limit&&_?a.queue.push({toastContent:T,toastProps:E,staleId:m}):Bo(g)?setTimeout(()=>{h(T,E,m)},g):h(T,E,m)}function h(f,p,g){const{toastId:m}=p;g&&o.delete(g);const y={content:f,props:p};o.set(m,y),r(x=>[...x,m].filter(w=>w!==g)),on.emit(4,Om(y,y.props.updateId==null?"added":"updated"))}return O.useEffect(()=>(a.containerId=t.containerId,on.cancelEmit(3).on(0,d).on(1,f=>i.current&&c(f)).on(5,l).emit(2,a),()=>{o.clear(),on.emit(3,a)}),[]),O.useEffect(()=>{a.props=t,a.isToastActive=s,a.displayedToast=n.length}),{getToastToRender:function(f){const p=new Map,g=Array.from(o.values());return t.newestOnTop&&g.reverse(),g.forEach(m=>{const{position:y}=m.props;p.has(y)||p.set(y,[]),p.get(y).push(m)}),Array.from(p,m=>f(m[0],m[1]))},containerRef:i,isToastActive:s}}function Tm(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function km(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function X_(t){const[e,n]=O.useState(!1),[r,i]=O.useState(!1),o=O.useRef(null),s=O.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,a=O.useRef(t),{autoClose:l,pauseOnHover:c,closeToast:u,onClick:d,closeOnClick:h}=t;function f(v){if(t.draggable){v.nativeEvent.type==="touchstart"&&v.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),document.addEventListener("touchmove",y),document.addEventListener("touchend",x);const S=o.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=S.getBoundingClientRect(),S.style.transition="",s.x=Tm(v.nativeEvent),s.y=km(v.nativeEvent),t.draggableDirection==="x"?(s.start=s.x,s.removalDistance=S.offsetWidth*(t.draggablePercent/100)):(s.start=s.y,s.removalDistance=S.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent/100))}}function p(v){if(s.boundingRect){const{top:S,bottom:C,left:_,right:E}=s.boundingRect;v.nativeEvent.type!=="touchend"&&t.pauseOnHover&&s.x>=_&&s.x<=E&&s.y>=S&&s.y<=C?m():g()}}function g(){n(!0)}function m(){n(!1)}function y(v){const S=o.current;s.canDrag&&S&&(s.didMove=!0,e&&m(),s.x=Tm(v),s.y=km(v),s.delta=t.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),S.style.transform=`translate${t.draggableDirection}(${s.delta}px)`,S.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function x(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",y),document.removeEventListener("touchend",x);const v=o.current;if(s.canDrag&&s.didMove&&v){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return i(!0),void t.closeToast();v.style.transition="transform 0.2s, opacity 0.2s",v.style.transform=`translate${t.draggableDirection}(0)`,v.style.opacity="1"}}O.useEffect(()=>{a.current=t}),O.useEffect(()=>(o.current&&o.current.addEventListener("d",g,{once:!0}),Ut(t.onOpen)&&t.onOpen(O.isValidElement(t.children)&&t.children.props),()=>{const v=a.current;Ut(v.onClose)&&v.onClose(O.isValidElement(v.children)&&v.children.props)}),[]),O.useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||m(),window.addEventListener("focus",g),window.addEventListener("blur",m)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",g),window.removeEventListener("blur",m))}),[t.pauseOnFocusLoss]);const w={onMouseDown:f,onTouchStart:f,onMouseUp:p,onTouchEnd:p};return l&&c&&(w.onMouseEnter=m,w.onMouseLeave=g),h&&(w.onClick=v=>{d&&d(v),s.canCloseOnClick&&u()}),{playToast:g,pauseToast:m,isRunning:e,preventExitTransition:r,toastRef:o,eventHandlers:w}}function Ob(t){let{closeToast:e,theme:n,ariaLabel:r="close"}=t;return O.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:i=>{i.stopPropagation(),e(i)},"aria-label":r},O.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},O.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function Y_(t){let{delay:e,isRunning:n,closeToast:r,type:i="default",hide:o,className:s,style:a,controlledProgress:l,progress:c,rtl:u,isIn:d,theme:h}=t;const f=o||l&&c===0,p={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused",opacity:f?0:1};l&&(p.transform=`scaleX(${c})`);const g=wr("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":u}),m=Ut(s)?s({rtl:u,type:i,defaultClassName:g}):wr(g,s);return O.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:m,style:p,[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{d&&r()}})}const Q_=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:i}=X_(t),{closeButton:o,children:s,autoClose:a,onClick:l,type:c,hideProgressBar:u,closeToast:d,transition:h,position:f,className:p,style:g,bodyClassName:m,bodyStyle:y,progressClassName:x,progressStyle:w,updateId:v,role:S,progress:C,rtl:_,toastId:E,deleteToast:R,isIn:A,isLoading:T,iconOut:k,closeOnClick:P,theme:M}=t,j=wr("Toastify__toast",`Toastify__toast-theme--${M}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":_},{"Toastify__toast--close-on-click":P}),z=Ut(p)?p({rtl:_,position:f,type:c,defaultClassName:j}):wr(j,p),$=!!C||!a,J={closeToast:d,type:c,theme:M};let K=null;return o===!1||(K=Ut(o)?o(J):O.isValidElement(o)?O.cloneElement(o,J):Ob(J)),O.createElement(h,{isIn:A,done:R,position:f,preventExitTransition:n,nodeRef:r},O.createElement("div",{id:E,onClick:l,className:z,...i,style:g,ref:r},O.createElement("div",{...A&&{role:S},className:Ut(m)?m({type:c}):wr("Toastify__toast-body",m),style:y},k!=null&&O.createElement("div",{className:wr("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},k),O.createElement("div",null,s)),K,O.createElement(Y_,{...v&&!$?{key:`pb-${v}`}:{},rtl:_,theme:M,delay:a,isRunning:e,isIn:A,closeToast:d,hide:u,type:c,style:w,className:x,controlledProgress:$,progress:C||0})))},mc=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},Z_=gc(mc("bounce",!0));gc(mc("slide",!0));gc(mc("zoom"));gc(mc("flip"));const Mm=O.forwardRef((t,e)=>{const{getToastToRender:n,containerRef:r,isToastActive:i}=J_(t),{className:o,style:s,rtl:a,containerId:l}=t;function c(u){const d=wr("Toastify__toast-container",`Toastify__toast-container--${u}`,{"Toastify__toast-container--rtl":a});return Ut(o)?o({position:u,rtl:a,defaultClassName:d}):wr(d,Va(o))}return O.useEffect(()=>{e&&(e.current=r.current)},[]),O.createElement("div",{ref:r,className:"Toastify",id:l},n((u,d)=>{const h=d.length?{...s}:{...s,pointerEvents:"none"};return O.createElement("div",{className:c(u),style:h,key:`container-${u}`},d.map((f,p)=>{let{content:g,props:m}=f;return O.createElement(Q_,{...m,isIn:i(m.toastId),style:{...m.style,"--nth":p+1,"--len":d.length},key:`toast-${m.key}`},g)}))}))});Mm.displayName="ToastContainer",Mm.defaultProps={position:"top-right",transition:Z_,autoClose:5e3,closeButton:Ob,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Mu,Yr=new Map,Lo=[],eR=1;function Tb(){return""+eR++}function tR(t){return t&&(gi(t.toastId)||Bo(t.toastId))?t.toastId:Tb()}function Vo(t,e){return Yr.size>0?on.emit(0,t,e):Lo.push({content:t,options:e}),e.toastId}function rl(t,e){return{...e,type:e&&e.type||t,toastId:tR(e)}}function sa(t){return(e,n)=>Vo(e,rl(t,n))}function Ie(t,e){return Vo(t,rl("default",e))}Ie.loading=(t,e)=>Vo(t,rl("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Ie.promise=function(t,e,n){let r,{pending:i,error:o,success:s}=e;i&&(r=gi(i)?Ie.loading(i,n):Ie.loading(i.render,{...n,...i}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,d,h)=>{if(d==null)return void Ie.dismiss(r);const f={type:u,...a,...n,data:h},p=gi(d)?{render:d}:d;return r?Ie.update(r,{...f,...p}):Ie(p.render,{...f,...p}),h},c=Ut(t)?t():t;return c.then(u=>l("success",s,u)).catch(u=>l("error",o,u)),c},Ie.success=sa("success"),Ie.info=sa("info"),Ie.error=sa("error"),Ie.warning=sa("warning"),Ie.warn=Ie.warning,Ie.dark=(t,e)=>Vo(t,rl("default",{theme:"dark",...e})),Ie.dismiss=t=>{Yr.size>0?on.emit(1,t):Lo=Lo.filter(e=>t!=null&&e.options.toastId!==t)},Ie.clearWaitingQueue=function(t){return t===void 0&&(t={}),on.emit(5,t)},Ie.isActive=t=>{let e=!1;return Yr.forEach(n=>{n.isToastActive&&n.isToastActive(t)&&(e=!0)}),e},Ie.update=function(t,e){e===void 0&&(e={}),setTimeout(()=>{const n=function(r,i){let{containerId:o}=i;const s=Yr.get(o||Mu);return s&&s.getToast(r)}(t,e);if(n){const{props:r,content:i}=n,o={delay:100,...r,...e,toastId:e.toastId||t,updateId:Tb()};o.toastId!==t&&(o.staleId=t);const s=o.render||i;delete o.render,Vo(s,o)}},0)},Ie.done=t=>{Ie.update(t,{progress:1})},Ie.onChange=t=>(on.on(4,t),()=>{on.off(4,t)}),Ie.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Ie.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},on.on(2,t=>{Mu=t.containerId||t,Yr.set(Mu,t),Lo.forEach(e=>{on.emit(0,e.content,e.options)}),Lo=[]}).on(3,t=>{Yr.delete(t.containerId||t),Yr.size===0&&on.off(0).off(1).off(5)});const nR={showSuccessMsg:!0,showErrorMsg:!0,successMsg:void 0,errorMsg:void 0,onSuccess:void 0,onError:void 0,processInput:void 0};function yc(t,e){const n={...nR,...e??{}};return O.useCallback(i=>(t.reset(),t.mutateAsync(Pu(n.processInput,i)??i).then(o=>{var s;return n.showSuccessMsg&&n.successMsg&&Ie.success(Pu(n.successMsg,o,i)),(s=n.onSuccess)==null||s.call(n,o),o}).catch(o=>{var s;n.showErrorMsg&&Ie.error(Pu(n.errorMsg,o,i)??"Oops, something went wrong :("),(s=n.onError)==null||s.call(n,o)})),[t,e])}function rR(t){return typeof t=="function"}function Pu(t,...e){return rR(t)?t(...e):t}function kb(t,e){return function(){return t.apply(e,arguments)}}const{toString:iR}=Object.prototype,{getPrototypeOf:up}=Object,vc=(t=>e=>{const n=iR.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Hn=t=>(t=t.toLowerCase(),e=>vc(e)===t),bc=t=>e=>typeof e===t,{isArray:vo}=Array,ss=bc("undefined");function oR(t){return t!==null&&!ss(t)&&t.constructor!==null&&!ss(t.constructor)&&ln(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Mb=Hn("ArrayBuffer");function sR(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Mb(t.buffer),e}const aR=bc("string"),ln=bc("function"),Pb=bc("number"),wc=t=>t!==null&&typeof t=="object",lR=t=>t===!0||t===!1,za=t=>{if(vc(t)!=="object")return!1;const e=up(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},cR=Hn("Date"),uR=Hn("File"),dR=Hn("Blob"),fR=Hn("FileList"),hR=t=>wc(t)&&ln(t.pipe),pR=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ln(t.append)&&((e=vc(t))==="formdata"||e==="object"&&ln(t.toString)&&t.toString()==="[object FormData]"))},gR=Hn("URLSearchParams"),mR=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ds(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),vo(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function Ib(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Lb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Db=t=>!ss(t)&&t!==Lb;function Lf(){const{caseless:t}=Db(this)&&this||{},e={},n=(r,i)=>{const o=t&&Ib(e,i)||i;za(e[o])&&za(r)?e[o]=Lf(e[o],r):za(r)?e[o]=Lf({},r):vo(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ds(arguments[r],n);return e}const yR=(t,e,n,{allOwnKeys:r}={})=>(Ds(e,(i,o)=>{n&&ln(i)?t[o]=kb(i,n):t[o]=i},{allOwnKeys:r}),t),vR=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),bR=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},wR=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&up(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},SR=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},xR=t=>{if(!t)return null;if(vo(t))return t;let e=t.length;if(!Pb(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},CR=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&up(Uint8Array)),ER=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},_R=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},RR=Hn("HTMLFormElement"),AR=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pm=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),OR=Hn("RegExp"),Nb=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Ds(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},TR=t=>{Nb(t,(e,n)=>{if(ln(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ln(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},kR=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return vo(t)?r(t):r(String(t).split(e)),n},MR=()=>{},PR=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Iu="abcdefghijklmnopqrstuvwxyz",Im="0123456789",jb={DIGIT:Im,ALPHA:Iu,ALPHA_DIGIT:Iu+Iu.toUpperCase()+Im},IR=(t=16,e=jb.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function LR(t){return!!(t&&ln(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const DR=t=>{const e=new Array(10),n=(r,i)=>{if(wc(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=vo(r)?[]:{};return Ds(r,(s,a)=>{const l=n(s,i+1);!ss(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},NR=Hn("AsyncFunction"),jR=t=>t&&(wc(t)||ln(t))&&ln(t.then)&&ln(t.catch),ie={isArray:vo,isArrayBuffer:Mb,isBuffer:oR,isFormData:pR,isArrayBufferView:sR,isString:aR,isNumber:Pb,isBoolean:lR,isObject:wc,isPlainObject:za,isUndefined:ss,isDate:cR,isFile:uR,isBlob:dR,isRegExp:OR,isFunction:ln,isStream:hR,isURLSearchParams:gR,isTypedArray:CR,isFileList:fR,forEach:Ds,merge:Lf,extend:yR,trim:mR,stripBOM:vR,inherits:bR,toFlatObject:wR,kindOf:vc,kindOfTest:Hn,endsWith:SR,toArray:xR,forEachEntry:ER,matchAll:_R,isHTMLForm:RR,hasOwnProperty:Pm,hasOwnProp:Pm,reduceDescriptors:Nb,freezeMethods:TR,toObjectSet:kR,toCamelCase:AR,noop:MR,toFiniteNumber:PR,findKey:Ib,global:Lb,isContextDefined:Db,ALPHABET:jb,generateString:IR,isSpecCompliantForm:LR,toJSONObject:DR,isAsyncFn:NR,isThenable:jR};function He(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}ie.inherits(He,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ie.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Fb=He.prototype,Hb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Hb[t]={value:t}});Object.defineProperties(He,Hb);Object.defineProperty(Fb,"isAxiosError",{value:!0});He.from=(t,e,n,r,i,o)=>{const s=Object.create(Fb);return ie.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),He.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const FR=null;function Df(t){return ie.isPlainObject(t)||ie.isArray(t)}function $b(t){return ie.endsWith(t,"[]")?t.slice(0,-2):t}function Lm(t,e,n){return t?t.concat(e).map(function(i,o){return i=$b(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function HR(t){return ie.isArray(t)&&!t.some(Df)}const $R=ie.toFlatObject(ie,{},null,function(e){return/^is[A-Z]/.test(e)});function Sc(t,e,n){if(!ie.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ie.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!ie.isUndefined(m[g])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&ie.isSpecCompliantForm(e);if(!ie.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(ie.isDate(p))return p.toISOString();if(!l&&ie.isBlob(p))throw new He("Blob is not supported. Use a Buffer instead.");return ie.isArrayBuffer(p)||ie.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,m){let y=p;if(p&&!m&&typeof p=="object"){if(ie.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(ie.isArray(p)&&HR(p)||(ie.isFileList(p)||ie.endsWith(g,"[]"))&&(y=ie.toArray(p)))return g=$b(g),y.forEach(function(w,v){!(ie.isUndefined(w)||w===null)&&e.append(s===!0?Lm([g],v,o):s===null?g:g+"[]",c(w))}),!1}return Df(p)?!0:(e.append(Lm(m,g,o),c(p)),!1)}const d=[],h=Object.assign($R,{defaultVisitor:u,convertValue:c,isVisitable:Df});function f(p,g){if(!ie.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),ie.forEach(p,function(y,x){(!(ie.isUndefined(y)||y===null)&&i.call(e,y,ie.isString(x)?x.trim():x,g,h))===!0&&f(y,g?g.concat(x):[x])}),d.pop()}}if(!ie.isObject(t))throw new TypeError("data must be an object");return f(t),e}function Dm(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function dp(t,e){this._pairs=[],t&&Sc(t,this,e)}const Bb=dp.prototype;Bb.append=function(e,n){this._pairs.push([e,n])};Bb.toString=function(e){const n=e?function(r){return e.call(this,r,Dm)}:Dm;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function BR(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vb(t,e,n){if(!e)return t;const r=n&&n.encode||BR,i=n&&n.serialize;let o;if(i?o=i(e,n):o=ie.isURLSearchParams(e)?e.toString():new dp(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Nm{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ie.forEach(this.handlers,function(r){r!==null&&e(r)})}}const zb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},VR=typeof URLSearchParams<"u"?URLSearchParams:dp,zR=typeof FormData<"u"?FormData:null,UR=typeof Blob<"u"?Blob:null,qR={isBrowser:!0,classes:{URLSearchParams:VR,FormData:zR,Blob:UR},protocols:["http","https","file","blob","url","data"]},Ub=typeof window<"u"&&typeof document<"u",WR=(t=>Ub&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),KR=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",GR=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ub,hasStandardBrowserEnv:WR,hasStandardBrowserWebWorkerEnv:KR},Symbol.toStringTag,{value:"Module"})),An={...GR,...qR};function JR(t,e){return Sc(t,new An.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return An.isNode&&ie.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function XR(t){return ie.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function YR(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function qb(t){function e(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&ie.isArray(i)?i.length:s,l?(ie.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!ie.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&ie.isArray(i[s])&&(i[s]=YR(i[s])),!a)}if(ie.isFormData(t)&&ie.isFunction(t.entries)){const n={};return ie.forEachEntry(t,(r,i)=>{e(XR(r),i,n,0)}),n}return null}function QR(t,e,n){if(ie.isString(t))try{return(e||JSON.parse)(t),ie.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const fp={transitional:zb,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=ie.isObject(e);if(o&&ie.isHTMLForm(e)&&(e=new FormData(e)),ie.isFormData(e))return i?JSON.stringify(qb(e)):e;if(ie.isArrayBuffer(e)||ie.isBuffer(e)||ie.isStream(e)||ie.isFile(e)||ie.isBlob(e))return e;if(ie.isArrayBufferView(e))return e.buffer;if(ie.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return JR(e,this.formSerializer).toString();if((a=ie.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Sc(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),QR(e)):e}],transformResponse:[function(e){const n=this.transitional||fp.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(e&&ie.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?He.from(a,He.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:An.classes.FormData,Blob:An.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ie.forEach(["delete","get","head","post","put","patch"],t=>{fp.headers[t]={}});const hp=fp,ZR=ie.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),eA=t=>{const e={};let n,r,i;return t&&t.split(`
5
+ `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&ZR[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},jm=Symbol("internals");function Ao(t){return t&&String(t).trim().toLowerCase()}function Ua(t){return t===!1||t==null?t:ie.isArray(t)?t.map(Ua):String(t)}function tA(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const nA=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Lu(t,e,n,r,i){if(ie.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!ie.isString(e)){if(ie.isString(r))return e.indexOf(r)!==-1;if(ie.isRegExp(r))return r.test(e)}}function rA(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function iA(t,e){const n=ie.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}class xc{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const u=Ao(l);if(!u)throw new Error("header name must be a non-empty string");const d=ie.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Ua(a))}const s=(a,l)=>ie.forEach(a,(c,u)=>o(c,u,l));return ie.isPlainObject(e)||e instanceof this.constructor?s(e,n):ie.isString(e)&&(e=e.trim())&&!nA(e)?s(eA(e),n):e!=null&&o(n,e,r),this}get(e,n){if(e=Ao(e),e){const r=ie.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return tA(i);if(ie.isFunction(n))return n.call(this,i,r);if(ie.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ao(e),e){const r=ie.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Lu(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=Ao(s),s){const a=ie.findKey(r,s);a&&(!n||Lu(r,r[a],a,n))&&(delete r[a],i=!0)}}return ie.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||Lu(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return ie.forEach(this,(i,o)=>{const s=ie.findKey(r,o);if(s){n[s]=Ua(i),delete n[o];return}const a=e?rA(o):String(o).trim();a!==o&&delete n[o],n[a]=Ua(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ie.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&ie.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
6
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[jm]=this[jm]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Ao(s);r[a]||(iA(i,s),r[a]=!0)}return ie.isArray(e)?e.forEach(o):o(e),this}}xc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ie.reduceDescriptors(xc.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});ie.freezeMethods(xc);const tr=xc;function Du(t,e){const n=this||hp,r=e||n,i=tr.from(r.headers);let o=r.data;return ie.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function Wb(t){return!!(t&&t.__CANCEL__)}function Ns(t,e,n){He.call(this,t??"canceled",He.ERR_CANCELED,e,n),this.name="CanceledError"}ie.inherits(Ns,He,{__CANCEL__:!0});function oA(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new He("Request failed with status code "+n.status,[He.ERR_BAD_REQUEST,He.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const sA=An.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];ie.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ie.isString(r)&&s.push("path="+r),ie.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function aA(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function lA(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Kb(t,e){return t&&!aA(e)?lA(t,e):e}const cA=An.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=ie.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function uA(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function dA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let d=o,h=0;for(;d!==i;)h+=n[d++],d=d%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s<e)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Fm(t,e){let n=0;const r=dA(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,l=r(a),c=o<=s;n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const fA=typeof XMLHttpRequest<"u",hA=fA&&function(t){return new Promise(function(n,r){let i=t.data;const o=tr.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,l;function c(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}let u;if(ie.isFormData(i)){if(An.hasStandardBrowserEnv||An.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((u=o.getContentType())!==!1){const[g,...m]=u?u.split(";").map(y=>y.trim()).filter(Boolean):[];o.setContentType([g||"multipart/form-data",...m].join("; "))}}let d=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(g+":"+m))}const h=Kb(t.baseURL,t.url);d.open(t.method.toUpperCase(),Vb(h,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function f(){if(!d)return;const g=tr.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:t,request:d};oA(function(w){n(w),c()},function(w){r(w),c()},y),d=null}if("onloadend"in d?d.onloadend=f:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(f)},d.onabort=function(){d&&(r(new He("Request aborted",He.ECONNABORTED,t,d)),d=null)},d.onerror=function(){r(new He("Network Error",He.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||zb;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),r(new He(m,y.clarifyTimeoutError?He.ETIMEDOUT:He.ECONNABORTED,t,d)),d=null},An.hasStandardBrowserEnv&&(a&&ie.isFunction(a)&&(a=a(t)),a||a!==!1&&cA(h))){const g=t.xsrfHeaderName&&t.xsrfCookieName&&sA.read(t.xsrfCookieName);g&&o.set(t.xsrfHeaderName,g)}i===void 0&&o.setContentType(null),"setRequestHeader"in d&&ie.forEach(o.toJSON(),function(m,y){d.setRequestHeader(y,m)}),ie.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),s&&s!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",Fm(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Fm(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=g=>{d&&(r(!g||g.type?new Ns(null,t,d):g),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));const p=uA(h);if(p&&An.protocols.indexOf(p)===-1){r(new He("Unsupported protocol "+p+":",He.ERR_BAD_REQUEST,t));return}d.send(i||null)})},Nf={http:FR,xhr:hA};ie.forEach(Nf,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Hm=t=>`- ${t}`,pA=t=>ie.isFunction(t)||t===null||t===!1,Gb={getAdapter:t=>{t=ie.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o<e;o++){n=t[o];let s;if(r=n,!pA(n)&&(r=Nf[(s=String(n)).toLowerCase()],r===void 0))throw new He(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since :
7
+ `+o.map(Hm).join(`
8
+ `):" "+Hm(o[0]):"as no adapter specified";throw new He("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Nf};function Nu(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ns(null,t)}function $m(t){return Nu(t),t.headers=tr.from(t.headers),t.data=Du.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Gb.getAdapter(t.adapter||hp.adapter)(t).then(function(r){return Nu(t),r.data=Du.call(t,t.transformResponse,r),r.headers=tr.from(r.headers),r},function(r){return Wb(r)||(Nu(t),r&&r.response&&(r.response.data=Du.call(t,t.transformResponse,r.response),r.response.headers=tr.from(r.response.headers))),Promise.reject(r)})}const Bm=t=>t instanceof tr?t.toJSON():t;function Yi(t,e){e=e||{};const n={};function r(c,u,d){return ie.isPlainObject(c)&&ie.isPlainObject(u)?ie.merge.call({caseless:d},c,u):ie.isPlainObject(u)?ie.merge({},u):ie.isArray(u)?u.slice():u}function i(c,u,d){if(ie.isUndefined(u)){if(!ie.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function o(c,u){if(!ie.isUndefined(u))return r(void 0,u)}function s(c,u){if(ie.isUndefined(u)){if(!ie.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in e)return r(c,u);if(d in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i(Bm(c),Bm(u),!0)};return ie.forEach(Object.keys(Object.assign({},t,e)),function(u){const d=l[u]||i,h=d(t[u],e[u],u);ie.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Jb="1.6.7",pp={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pp[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Vm={};pp.transitional=function(e,n,r){function i(o,s){return"[Axios v"+Jb+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new He(i(s," has been removed"+(n?" in "+n:"")),He.ERR_DEPRECATED);return n&&!Vm[s]&&(Vm[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function gA(t,e,n){if(typeof t!="object")throw new He("options must be an object",He.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new He("option "+o+" must be "+l,He.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new He("Unknown option "+o,He.ERR_BAD_OPTION)}}const jf={assertOptions:gA,validators:pp},ur=jf.validators;class il{constructor(e){this.defaults=e,this.interceptors={request:new Nm,response:new Nm}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
9
+ `+o):r.stack=o}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Yi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&jf.assertOptions(r,{silentJSONParsing:ur.transitional(ur.boolean),forcedJSONParsing:ur.transitional(ur.boolean),clarifyTimeoutError:ur.transitional(ur.boolean)},!1),i!=null&&(ie.isFunction(i)?n.paramsSerializer={serialize:i}:jf.assertOptions(i,{encode:ur.function,serialize:ur.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&ie.merge(o.common,o[n.method]);o&&ie.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=tr.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[$m.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(m){g.call(this,m);break}}try{u=$m.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Yi(this.defaults,e);const n=Kb(e.baseURL,e.url);return Vb(n,e.params,e.paramsSerializer)}}ie.forEach(["delete","get","head","options"],function(e){il.prototype[e]=function(n,r){return this.request(Yi(r||{},{method:e,url:n,data:(r||{}).data}))}});ie.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(Yi(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}il.prototype[e]=n(),il.prototype[e+"Form"]=n(!0)});const qa=il;class gp{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new Ns(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new gp(function(i){e=i}),cancel:e}}}const mA=gp;function yA(t){return function(n){return t.apply(null,n)}}function vA(t){return ie.isObject(t)&&t.isAxiosError===!0}const Ff={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ff).forEach(([t,e])=>{Ff[e]=t});const bA=Ff;function Xb(t){const e=new qa(t),n=kb(qa.prototype.request,e);return ie.extend(n,qa.prototype,e,{allOwnKeys:!0}),ie.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Xb(Yi(t,i))},n}const ft=Xb(hp);ft.Axios=qa;ft.CanceledError=Ns;ft.CancelToken=mA;ft.isCancel=Wb;ft.VERSION=Jb;ft.toFormData=Sc;ft.AxiosError=He;ft.Cancel=ft.CanceledError;ft.all=function(e){return Promise.all(e)};ft.spread=yA;ft.isAxiosError=vA;ft.mergeConfig=Yi;ft.AxiosHeaders=tr;ft.formToJSON=t=>qb(ie.isHTMLForm(t)?new FormData(t):t);ft.getAdapter=Gb.getAdapter;ft.HttpStatusCode=bA;ft.default=ft;const zm={adminApiURL:"",nextAPIURL:"",invalidateToken:""};class Um extends K_{constructor(n){console.warn("AdminAPI: nextAPIURL is not set. Please set it in the AdminApiProvider."),console.warn("AdminAPI: invalidateToken is not set. Please set it in the AdminApiProvider.");const r=ft.create({baseURL:zm.nextAPIURL,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","Invalidate-Token":zm.invalidateToken},withCredentials:!0});super(r,"api/invalidate");zn(this,"pathOrPermalink");this.pathOrPermalink=n,this.invalidate=this.invalidate.bind(this)}invalidate(){let n=this.pathOrPermalink;if(n.startsWith("https://")){const r=n.substring(8);n=r.substring(r.indexOf("/"))}if(n.startsWith("http://")){const r=n.substring(7);n=r.substring(r.indexOf("/"))}return n.startsWith("/")||console.warn("Invalidate: string does not start with /: ",n,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{path:n})}invalidateCustomPath(n){let r=n;if(n.startsWith("https://")){const i=n.substring(8);r=i.substring(i.indexOf("/"))}if(n.startsWith("http://")){const i=n.substring(7);r=i.substring(i.indexOf("/"))}return r.startsWith("/")||console.warn("Invalidate: string does not start with /: ",n,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{_path:r})}}const wA={new:t=>new Um(t),custom:()=>new Um("")};function mp({pathOrPermalink:t,...e}){const n=wA.new(t),r=yo(n.invalidate,n.queryKey),i=yc(r,{successMsg:"Page successfully invalidated"});return b.jsx(N.Button,{scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",title:"Regenerate",disabled:r.isLoading,onClick:i,...e,children:b.jsx(N.Icon,{path:l_})})}function SA({path:t,...e}){const n=Fn.useNavigate(),r=O.useCallback(()=>{n(t)},[n,t]);return b.jsx(N.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...e,children:b.jsx(N.Icon,{path:E_})})}function Yb({status:t,queryId:e,api:n,...r}){const i=t=="draft",o=If(i?n.publish:n.unpublish,n.queryKey,e,{networkMode:"always"}),s=O.useCallback(()=>{o.reset(),o.mutateAsync(e).then(()=>Ie.success(i?"Published!":"Unpublished!")).catch(a=>Ie.error(`Error: ${a}`))},[o,e]);return b.jsxs(N.Button,{scheme:"secondary",variant:"glass",corners:"pill",px:"4",disabled:o.isLoading,onClick:s,dflex:!0,alignItems:"center",gap:"3",...r,children:[b.jsx(N.Icon,{path:i?ep:c_}),i?"Publish":"Switch to draft"]})}function xA({children:t,...e}){return b.jsx("div",{dflex:!0,flexCol:!0,gap:"3",w:"full",...e,children:t})}function Hr({label:t,touched:e,error:n,customFeedbackLabel:r,showCorrectFeedback:i}){const o=e&&n!=null&&n!=="",s=i&&e&&!n&&i&&t!=null&&t!=="",a=N.usePrevious(n);return b.jsxs(b.Fragment,{children:[o&&b.jsxs("div",{mt:"2",children:[b.jsx("div",{className:"is-invalid"})," ",b.jsxs("div",{textColor:"#ff0000",textSize:"sm",fontWeight:"500",children:[n,!n&&`${a}`]})]}),i&&t&&b.jsx(b.Fragment,{children:s&&b.jsxs("div",{mt:"2",children:[b.jsx("div",{className:"is-valid"})," ",b.jsxs("div",{className:"valid-feedback m-0",textSize:"sm",fontWeight:"500",children:[t," was entered correct"]})]})}),r&&b.jsx(b.Fragment,{children:!o&&!s&&b.jsx("div",{mt:"2",textSize:"sm",fontWeight:"500",children:r})})]})}function CA(){}function ol(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function qm(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Wm(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const EA="[object RegExp]",_A="[object String]",RA="[object Number]",AA="[object Boolean]",Km="[object Arguments]",OA="[object Symbol]",TA="[object Date]",kA="[object Map]",MA="[object Set]",PA="[object Array]",IA="[object Function]",LA="[object ArrayBuffer]",ju="[object Object]",DA="[object Error]",NA="[object DataView]",jA="[object Uint8Array]",FA="[object Uint8ClampedArray]",HA="[object Uint16Array]",$A="[object Uint32Array]",BA="[object BigUint64Array]",VA="[object Int8Array]",zA="[object Int16Array]",UA="[object Int32Array]",qA="[object BigInt64Array]",WA="[object Float32Array]",KA="[object Float64Array]";function Do(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const i=n[r],o=e[i],s=t[i];Array.isArray(o)?Array.isArray(s)?t[i]=Do(s,o):t[i]=Do([],o):ol(o)?ol(s)?t[i]=Do(s,o):t[i]=Do({},o):(s===void 0||o!==void 0)&&(t[i]=o)}return t}function GA(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function JA(t,e,n){return No(t,e,void 0,void 0,void 0,void 0,n)}function No(t,e,n,r,i,o,s){const a=s(t,e,n,r,i,o);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return zo(t,e,o,s)}return zo(t,e,o,s)}function zo(t,e,n,r){if(Object.is(t,e))return!0;let i=Wm(t),o=Wm(e);if(i===Km&&(i=ju),o===Km&&(o=ju),i!==o)return!1;switch(i){case _A:return t.toString()===e.toString();case RA:{const l=t.valueOf(),c=e.valueOf();return GA(l,c)}case AA:case TA:case OA:return Object.is(t.valueOf(),e.valueOf());case EA:return t.source===e.source&&t.flags===e.flags;case IA:return t===e}n=n??new Map;const s=n.get(t),a=n.get(e);if(s!=null&&a!=null)return s===e;n.set(t,e),n.set(e,t);try{switch(i){case kA:{if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!No(c,e.get(l),l,t,e,n,r))return!1;return!0}case MA:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let u=0;u<l.length;u++){const d=l[u],h=c.findIndex(f=>No(d,f,void 0,t,e,n,r));if(h===-1)return!1;c.splice(h,1)}return!0}case PA:case jA:case FA:case HA:case $A:case BA:case VA:case zA:case UA:case qA:case WA:case KA:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!No(t[l],e[l],l,t,e,n,r))return!1;return!0}case LA:return t.byteLength!==e.byteLength?!1:zo(new Uint8Array(t),new Uint8Array(e),n,r);case NA:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:zo(new Uint8Array(t),new Uint8Array(e),n,r);case DA:return t.name===e.name&&t.message===e.message;case ju:{if(!(zo(t.constructor,e.constructor,n,r)||ol(t)&&ol(e)))return!1;const c=[...Object.keys(t),...qm(t)],u=[...Object.keys(e),...qm(e)];if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++){const h=c[d],f=t[h];if(!Object.hasOwn(e,h))return!1;const p=e[h];if(!No(f,p,h,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function XA(t,e){return JA(t,e,CA)}function YA(t){return typeof t=="function"}function QA(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function ZA(t){return Object.is(t,-0)?"-0":t.toString()}function eO(t){const e=[],n=t.length;if(n===0)return e;let r=0,i="",o="",s=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<n;){const a=t[r];o?a==="\\"&&r+1<n?(r++,i+=t[r]):a===o?o="":i+=a:s?a==='"'||a==="'"?o=a:a==="]"?(s=!1,e.push(i),i=""):i+=a:a==="["?(s=!0,i&&(e.push(i),i="")):a==="."?i&&(e.push(i),i=""):i+=a,r++}return i&&e.push(i),e}function Ui(t,e,n){if(t==null)return n;switch(typeof e){case"string":{const r=t[e];return r===void 0?QA(e)?Ui(t,eO(e),n):n:r}case"number":case"symbol":{typeof e=="number"&&(e=ZA(e));const r=t[e];return r===void 0?n:r}default:{if(Array.isArray(e))return tO(t,e,n);Object.is(e==null?void 0:e.valueOf(),-0)?e="-0":e=String(e);const r=t[e];return r===void 0?n:r}}}function tO(t,e,n){if(e.length===0)return n;let r=t;for(let i=0;i<e.length;i++){if(r==null)return n;r=r[e[i]]}return r===void 0?n:r}function Qb(t){return Array.isArray(t)}function $r(t,e,n){const r=t!=null?Ui(e,t):!1,i=t!=null?Ui(n,t):!1,o=t!=null?Ui(e,t):void 0;return{isError:r,isTouched:i,error:o}}function Zb({withFeedbackLabel:t=!0,showCorrectFeedback:e=!1,customFeedbackLabel:n,children:r,...i}){const o=i.name??"";return b.jsx(Je.Field,{name:o,type:"checkbox",children:({field:s,form:a})=>{s.value==null&&console.warn(`Checkbox: Value for field ${s.name} is null`);const{errors:l,touched:c}=a,{isError:u,isTouched:d,error:h}=$r(o,l,c);return b.jsxs("div",{children:[b.jsx("input",{type:"checkbox",style:{display:"none"}}),b.jsx(N.Checkbox,{scheme:s.value?"default":"neutral",disabled:a.isSubmitting,borderColor:d&&u?"red":!1,...s,...i}),r,t&&b.jsx(Hr,{error:h,touched:d,label:i.label,customFeedbackLabel:n,showCorrectFeedback:e})]})}})}function ar({name:t,label:e,required:n,...r}){if(e)return b.jsxs("label",{htmlFor:t,textSize:"xs",mb:"1",fontWeight:"500",letterSpacing:"wide",textColor:"gray-600",...r,children:[e,n&&b.jsx("span",{textSize:"xs",ms:"1",textColor:"red",verticalAlign:"top",children:"* "})]})}function nO(t){const[e,n,r]=Je.useField(t),{error:i,touched:o}=n;return{isError:i!==void 0,isTouched:o,error:i}}function rO({name:t,options:e,label:n,withFeedbackLabel:r=!0,showCorrectFeedback:i=!1,customFeedbackLabel:o,required:s=!1}){const{isError:a,isTouched:l,error:c}=nO(t);return b.jsxs("div",{w:"full",dflex:!0,flexCol:!0,children:[n&&b.jsx(ar,{name:t,label:n,required:s}),e.length>0&&b.jsx("div",{rounded:!0,overflow:"hidden",border:"0.5",borderColor:l&&a?"red":"#F4F4F4",role:"group",children:e.map((u,d)=>b.jsx(iO,{name:t,label:u.label,value:u.id},d))}),e.length===0&&b.jsx("div",{rounded:!0,border:"0.5",bgColor:"#f4F4F4",borderColor:l&&a?"red":"#F4F4F4",py:"5",textAlign:"center",textSize:"md",fontWeight:"500",textColor:"slate-500",children:"No data"}),r&&b.jsx(Hr,{error:c,touched:l,label:n,customFeedbackLabel:o,showCorrectFeedback:i})]})}function iO({name:t,label:e,value:n}){return b.jsx("label",{id:"parent_label",px:"4",py:"3",display:"block",hover_bgColor:"slate-50",cursor:"pointer",children:b.jsx(Je.Field,{name:t,type:"checkbox",value:n,children:({field:r,form:i})=>b.jsx(Zb,{scheme:"neutral",disabled:i.isSubmitting,label:b.jsx("span",{flex:"1",w:"full",children:e}),labelPosition:"start",withFeedbackLabel:!1,...r})})})}function oO({name:t,value:e}){const{setFieldValue:n}=Je.useFormikContext();return O.useEffect(()=>{n(t,e)},[e,n]),null}function yp({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:i=!1,required:o=!1,fullWidth:s,...a}){const l=a.name??"";return b.jsxs("div",{dflex:!0,flexCol:!0,...a,children:[t&&b.jsx(ar,{name:l,label:t,required:o}),b.jsx(Je.FastField,{name:l,children:({field:c,form:u})=>{c.value==null&&console.warn(`Input: Value for field ${c.name} is null`);const{errors:d,touched:h}=u,{isError:f,isTouched:p,error:g}=$r(l,d,h),m={...a,...p&&f?{borderColor:"red"}:{}};return b.jsxs(b.Fragment,{children:[b.jsx(N.Input,{w:s?"full":void 0,disabled:u.isSubmitting,scheme:"default",lineHeight:"normal",transition:"all",...c,...m}),e&&b.jsx(Hr,{error:g,touched:p,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})]})}function sO(t){return Array.isArray(t)}process.env.NODE_ENV;process.env.NODE_ENV;process.env.NODE_ENV;function aO(t,e,n){return t<e?n==="asc"?-1:1:t>e?n==="asc"?1:-1:0}function lO(t,e,n){return t.slice().sort((r,i)=>{const o=n.length;for(let s=0;s<e.length;s++){const a=o>s?n[s]:n[o-1],l=e[s],c=typeof l=="function",u=c?l(r):r[l],d=c?l(i):i[l],h=aO(u,d,a);if(h!==0)return h}return 0})}function cO(t,e){return lO(t,e,["asc"])}function uO({field:t,onChangeField:e,resetValue:n}){const{setFieldValue:r,values:i}=Je.useFormikContext(),o=N.usePrevious(Ui(i,e)),s=N.useFirstRender();return O.useEffect(()=>{!s&&!XA(Ui(i,e),o)&&(sO(t)?t.forEach(a=>r(a,n)):r(t,n))},[s,i,e,r,t,n]),null}function dO({label:t}){return b.jsx("div",{mt:"5",fontWeight:"500",textSize:"lg",children:t})}function fO({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:i=!1,required:o=!1,placeholder:s,fullWidth:a,children:l,...c}){const u=c.name??"";return b.jsx(Je.Field,{name:c.name,children:({field:d,form:h})=>{d.value==null&&console.warn(`Select: Value for field ${d.name} is null`);const{errors:f,touched:p}=h,{isError:g,isTouched:m,error:y}=$r(u,f,p),x={...m&&g?{borderColor:"red"}:{}};return b.jsxs("div",{dflex:!0,flexCol:!0,alignItems:"baseline",...c,children:[t&&b.jsx(ar,{name:u,label:t,required:o,flex:"1"}),b.jsxs(N.Select,{disabled:h.isSubmitting||c.disabled,w:a?"full":void 0,...d,...x,children:[b.jsx("option",{value:"",children:s??"Select an option"}),l]}),e&&b.jsx(Hr,{error:y,touched:m,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function hO({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,children:i,onClick:o,...s}){const a=s.name??"";return b.jsx(Je.Field,{name:a,type:"checkbox",children:({field:l,form:c})=>{l.value==null&&console.warn(`Switch: Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=$r(a,u,d);return b.jsxs("label",{children:[b.jsx("input",{type:"checkbox",style:{display:"none"}}),b.jsx("div",{dflex:!0,alignItems:"center",w:"full",children:b.jsx(N.Switch,{scheme:l.value?"default":"neutral",disabled:c.isSubmitting,label:t,borderColor:f&&h?"red":!1,...l})}),i,e&&b.jsx(Hr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function vp({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:i=!1,required:o=!1,...s}){const a=s.name??"";return b.jsx(Je.Field,{name:a,children:({field:l,form:c})=>{l.value==null&&console.warn(`TextArea : Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=$r(a,u,d),g={...s,...f&&h?{borderColor:"red"}:{}};return b.jsxs("div",{dflex:!0,flexCol:!0,w:"full",children:[t&&b.jsx(ar,{name:a,label:t,required:o}),b.jsx(N.TextArea,{disabled:c.isSubmitting,scheme:"default",...l,...g}),e&&b.jsx(Hr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function pO({children:t}){return b.jsx("div",{grid:!0,gridCols:"1",md_gridCols:"2",gap:"5",children:t})}function gO(t){const[{value:e}]=Je.useField(t);return O.useMemo(()=>e,[e])}const mO=O.memo(function({field:t,condition:e,form:n,extensions:r}){const[i,o]=O.useState(),s=gO(t),a=O.useMemo(()=>YA(e)?e(s):s==e,[e,s]);return O.useEffect(()=>{a&&o(s)},[a,s,o]),O.useMemo(()=>b.jsx(N.Collapse,{in:a,children:b.jsx("div",{dflex:!0,flexCol:!0,gap:"5",children:b.jsx(wp,{form:$e.runIfFn(n,a?s:i),extensions:r})})}),[a,n,r,s,i])});function yO({field:t,form:e}){const[n]=Je.useField(t),r=n.value;return b.jsx(wp,{form:e(r)})}function vO({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:i=!1,required:o=!1,...s}){const a=s.name??"";return b.jsx(Je.FastField,{name:a,children:({field:l,form:c})=>{l.value==null&&console.warn(`Rating: Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=$r(a,u,d);return b.jsxs("div",{...s,children:[t&&b.jsx(ar,{name:a,label:t,required:o}),b.jsx(bO,{name:a,rating:l.value,setFieldValue:c.setFieldValue}),e&&b.jsx(Hr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function bO({name:t,rating:e,setFieldValue:n}){const r=O.useRef(null),i=O.useRef(null),o=O.useRef(null),s=O.useRef(null),a=O.useRef(null),l=N.useHover(r),c=N.useHover(i),u=N.useHover(o),d=N.useHover(s),h=N.useHover(a);return b.jsxs("div",{dflex:!0,children:[b.jsx(Oo,{ref:r,index:0,rating:e,hover:l||c||u||d||h,onClick:()=>n(t,"1")}),b.jsx(Oo,{ref:i,index:1,rating:e,hover:c||u||d||h,onClick:()=>n(t,"2")}),b.jsx(Oo,{ref:o,index:2,rating:e,hover:u||d||h,onClick:()=>n(t,"3")}),b.jsx(Oo,{ref:s,index:3,rating:e,hover:d||h,onClick:()=>n(t,"4")}),b.jsx(Oo,{ref:a,index:4,rating:e,hover:h,onClick:()=>n(t,"5")})]})}const Oo=O.forwardRef(function({index:t,rating:e,hover:n,onClick:r},i){const o=e-t;let s=A_;return o>=.5&&(s=R_),(o>=1||n)&&(s=__),b.jsx("div",{ref:i,onClick:r,children:b.jsx(N.Icon,{path:s,size:"x2",textColor:"brand"})})});function wO({title:t,divider:e}){return b.jsxs("div",{mt:"3",children:[e&&b.jsx("div",{h:"px",bgColor:"slate-100",w:"full",mb:e?"5":"8"}),b.jsx("div",{textTransform:"uppercase",textSize:"sm",fontWeight:"600",textColor:"slate-700",children:t})]})}function SO({children:t}){return b.jsx("div",{dflex:!0,alignItems:"end",gap:"5",children:t})}function xO({name:t,addItemLabel:e,...n}){const{values:r}=Je.useFormikContext(),i=r;return b.jsx(Je.FieldArray,{name:t,render:o=>b.jsxs("div",{dflex:!0,flexCol:!0,gap:"5",children:[i[t]&&i[t].length>0&&i[t].map((s,a)=>b.jsxs("div",{dflex:!0,alignItems:"start",gap:"2",children:[b.jsx(yp,{flexGrow:"1",name:`${t}.${a}`,...n}),b.jsx(N.Button,{variant:"borderless",mt:"0.5",onClick:()=>o.remove(a),children:b.jsx(N.Icon,{path:Zv})})]},a)),b.jsxs(N.Button,{variant:"glass",onClick:()=>o.push(""),children:[" ",e??"Add item"]})]})})}function CO({name:t,label:e,addItemLabel:n,required:r,...i}){const{values:o,isSubmitting:s}=Je.useFormikContext(),a=o;return b.jsx(Je.FieldArray,{name:t,render:l=>b.jsxs("div",{children:[e&&b.jsx(ar,{name:t,label:e,required:r}),b.jsxs("div",{dflex:!0,flexCol:!0,gap:"5",w:"full","data-class":"container",children:[a[t]&&a[t].length>0&&a[t].map((c,u)=>b.jsxs("div",{"data-class":"item",dflex:!0,alignItems:"center",gap:"1",flexGrow:!0,children:[b.jsx(vp,{name:`${t}.${u}`,disabled:s,scheme:"default",flexGrow:"1",...i}),b.jsx(N.IconButton,{variant:"borderless",corners:"pill",icon:Zv,size:"xl",onClick:()=>l.remove(u)})]},u)),b.jsxs(N.Button,{onClick:()=>l.push(""),children:[" ",n??"Add item"]})]})]})})}function EO({icon:t,label:e,subtitle:n,...r}){const[i,o]=$e.splitComponentProps(r);return b.jsx(Je.Field,{name:r.name,type:"radio",value:r.value,children:({field:s,form:a})=>{s.value==null&&console.warn(`Checkbox: Value for field ${s.name} is null`);const{errors:l,touched:c,values:u}=a,{isError:d,isTouched:h,error:f}=$r(r.name??"",l,c),p={...h&&d?{borderColor:"red"}:{}};return b.jsxs("label",{htmlFor:r.name,...i,children:[b.jsx("input",{type:"radio",display:"none",...s,...o}),b.jsxs(N.Button,{w:"full",scheme:s.checked?"secondary":"neutral",disabled:o.disabled,easing:s.checked?"out":"linear",dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",px:"3",py:"5",rounded:"lg",onClick:()=>a.setFieldValue(r.name??"",r.value),...p,children:[b.jsx(N.Icon,{path:t,size:"x3",mb:"3"}),b.jsx("span",{children:e}),n&&b.jsx("span",{textSize:"sm",textColor:"white",textOpacity:"80",children:n})]})]})}})}function _O({name:t,label:e,provider:n,required:r}){return b.jsxs("div",{dflex:!0,flexCol:!0,children:[b.jsx(ar,{name:t,label:e,required:r,mb:"1"}),b.jsx("div",{grid:!0,gridCols:"2",gap:"3",children:n.map(i=>b.jsx(EO,{value:i.id,name:t,icon:i.icon,label:i.label,subtitle:i.subtitle,disabled:i.disabled},i.id))})]})}function RO(t,e){const[n,r]=O.useState(t);return O.useEffect(()=>{const i=setTimeout(()=>r(t),e||500);return()=>{clearTimeout(i)}},[t,e]),n}function ew(t){return O.useCallback(e=>{(t||e)&&window.open(t??e,"_blank")},[t])}var aa={exports:{}},Fu={},la={exports:{}},Hu={},Gm;function AO(){return Gm||(Gm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e}});function e(n,r){return r===void 0&&(r=""),(n==="/"?"/index":/^\/index(\/|$)/.test(n)?"/index"+n:n)+r}}(Hu)),Hu}var ca={exports:{}},Jm;function OO(){return Jm||(Jm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"__unsafeCreateTrustedScriptURL",{enumerable:!0,get:function(){return i}});let n;function r(){if(typeof n>"u"&&typeof window<"u"){var o;n=((o=window.trustedTypes)==null?void 0:o.createPolicy("nextjs",{createHTML:s=>s,createScript:s=>s,createScriptURL:s=>s}))||null}return n}function i(o){var s;return((s=r())==null?void 0:s.createScriptURL(o))||o}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ca,ca.exports)),ca.exports}var $u={},Xm;function TO(){return Xm||(Xm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return e}});function e(){return process.env.NEXT_DEPLOYMENT_ID?`?dpl=${process.env.NEXT_DEPLOYMENT_ID}`:""}}($u)),$u}var Ym;function kO(){return Ym||(Ym=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(_,E){for(var R in E)Object.defineProperty(_,R,{enumerable:!0,get:E[R]})}n(e,{createRouteLoader:function(){return C},getClientBuildManifest:function(){return v},isAssetError:function(){return h},markAssetError:function(){return d}});const i=Nt._(AO()),o=OO(),s=lp(),a=TO(),l=3800;function c(_,E,R){let A=E.get(_);if(A)return"future"in A?A.future:Promise.resolve(A);let T;const k=new Promise(P=>{T=P});return E.set(_,A={resolve:T,future:k}),R?R().then(P=>(T(P),P)).catch(P=>{throw E.delete(_),P}):k}const u=Symbol("ASSET_LOAD_ERROR");function d(_){return Object.defineProperty(_,u,{})}function h(_){return _&&u in _}function f(_){try{return _=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||_.relList.supports("prefetch")}catch{return!1}}const p=f(),g=()=>(0,a.getDeploymentIdQueryOrEmptyString)();function m(_,E,R){return new Promise((A,T)=>{const k=`
10
+ link[rel="prefetch"][href^="`+_+`"],
11
+ link[rel="preload"][href^="`+_+`"],
12
+ script[src^="`+_+'"]';if(document.querySelector(k))return A();R=document.createElement("link"),E&&(R.as=E),R.rel="prefetch",R.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,R.onload=A,R.onerror=()=>T(d(new Error("Failed to prefetch: "+_))),R.href=_,document.head.appendChild(R)})}function y(_,E){return new Promise((R,A)=>{E=document.createElement("script"),E.onload=R,E.onerror=()=>A(d(new Error("Failed to load script: "+_))),E.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,E.src=_,document.body.appendChild(E)})}let x;function w(_,E,R){return new Promise((A,T)=>{let k=!1;_.then(P=>{k=!0,A(P)}).catch(T),process.env.NODE_ENV==="development"&&(x||Promise.resolve()).then(()=>{(0,s.requestIdleCallback)(()=>setTimeout(()=>{k||T(R)},E))}),process.env.NODE_ENV!=="development"&&(0,s.requestIdleCallback)(()=>setTimeout(()=>{k||T(R)},E))})}function v(){if(self.__BUILD_MANIFEST)return Promise.resolve(self.__BUILD_MANIFEST);const _=new Promise(E=>{const R=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{E(self.__BUILD_MANIFEST),R&&R()}});return w(_,l,d(new Error("Failed to load client build manifest")))}function S(_,E){if(process.env.NODE_ENV==="development"){const R=_+"/_next/static/chunks/pages"+encodeURI((0,i.default)(E,".js"))+g();return Promise.resolve({scripts:[(0,o.__unsafeCreateTrustedScriptURL)(R)],css:[]})}return v().then(R=>{if(!(E in R))throw d(new Error("Failed to lookup route: "+E));const A=R[E].map(T=>_+"/_next/"+encodeURI(T));return{scripts:A.filter(T=>T.endsWith(".js")).map(T=>(0,o.__unsafeCreateTrustedScriptURL)(T)+g()),css:A.filter(T=>T.endsWith(".css")).map(T=>T+g())}})}function C(_){const E=new Map,R=new Map,A=new Map,T=new Map;function k(M){if(process.env.NODE_ENV!=="development"){let j=R.get(M.toString());return j||(document.querySelector('script[src^="'+M+'"]')?Promise.resolve():(R.set(M.toString(),j=y(M)),j))}else return y(M)}function P(M){let j=A.get(M);return j||(A.set(M,j=fetch(M,{credentials:"same-origin"}).then(z=>{if(!z.ok)throw new Error("Failed to load stylesheet: "+M);return z.text().then($=>({href:M,content:$}))}).catch(z=>{throw d(z)})),j)}return{whenEntrypoint(M){return c(M,E)},onEntrypoint(M,j){(j?Promise.resolve().then(()=>j()).then(z=>({component:z&&z.default||z,exports:z}),z=>({error:z})):Promise.resolve(void 0)).then(z=>{const $=E.get(M);$&&"resolve"in $?z&&(E.set(M,z),$.resolve(z)):(z?E.set(M,z):E.delete(M),T.delete(M))})},loadRoute(M,j){return c(M,T,()=>{let z;return process.env.NODE_ENV==="development"&&(x=new Promise($=>{z=$})),w(S(_,M).then($=>{let{scripts:J,css:K}=$;return Promise.all([E.has(M)?[]:Promise.all(J.map(k)),Promise.all(K.map(P))])}).then($=>this.whenEntrypoint(M).then(J=>({entrypoint:J,styles:$[1]}))),l,d(new Error("Route did not complete loading: "+M))).then($=>{let{entrypoint:J,styles:K}=$;const D=Object.assign({styles:K},J);return"error"in J?J:D}).catch($=>{if(j)throw $;return{error:$}}).finally(()=>z==null?void 0:z())})},prefetch(M){let j;return(j=navigator.connection)&&(j.saveData||/2g/.test(j.effectiveType))?Promise.resolve():S(_,M).then(z=>Promise.all(p?z.scripts.map($=>m($.toString(),"script")):[])).then(()=>{(0,s.requestIdleCallback)(()=>this.loadRoute(M,!0).catch(()=>{}))}).catch(()=>{})}}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(la,la.exports)),la.exports}var ua={exports:{}},Bu={},Qm;function tw(){return Qm||(Qm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});const r=Nt._(O).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="HeadManagerContext")}(Bu)),Bu}var da={exports:{}},Zm;function MO(){return Zm||(Zm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}n(e,{DOMAttributeNames:function(){return r},default:function(){return a},isEqualNode:function(){return o}});const r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function i(l){let{type:c,props:u}=l;const d=document.createElement(c);for(const p in u){if(!u.hasOwnProperty(p)||p==="children"||p==="dangerouslySetInnerHTML"||u[p]===void 0)continue;const g=r[p]||p.toLowerCase();c==="script"&&(g==="async"||g==="defer"||g==="noModule")?d[g]=!!u[p]:d.setAttribute(g,u[p])}const{children:h,dangerouslySetInnerHTML:f}=u;return f?d.innerHTML=f.__html||"":h&&(d.textContent=typeof h=="string"?h:Array.isArray(h)?h.join(""):""),d}function o(l,c){if(l instanceof HTMLElement&&c instanceof HTMLElement){const u=c.getAttribute("nonce");if(u&&!l.getAttribute("nonce")){const d=c.cloneNode(!0);return d.setAttribute("nonce",""),d.nonce=u,u===l.nonce&&l.isEqualNode(d)}}return l.isEqualNode(c)}let s;process.env.__NEXT_STRICT_NEXT_HEAD?s=(l,c)=>{const u=document.querySelector("head");if(!u)return;const d=u.querySelectorAll('meta[name="next-head"]')||[],h=[];if(l==="meta"){const g=u.querySelector("meta[charset]");g&&h.push(g)}for(let g=0;g<d.length;g++){var f;const y=d[g].nextSibling;(y==null||(f=y.tagName)==null?void 0:f.toLowerCase())===l&&h.push(y)}const p=c.map(i).filter(g=>{for(let m=0,y=h.length;m<y;m++){const x=h[m];if(o(x,g))return h.splice(m,1),!1}return!0});h.forEach(g=>{var m;const y=g.previousSibling;if(y&&y.getAttribute("name")==="next-head"){var x;(x=g.parentNode)==null||x.removeChild(y)}(m=g.parentNode)==null||m.removeChild(g)}),p.forEach(g=>{var m;const y=document.createElement("meta");y.name="next-head",y.content="1",((m=g.tagName)==null?void 0:m.toLowerCase())==="meta"&&g.getAttribute("charset")||u.appendChild(y),u.appendChild(g)})}:s=(l,c)=>{const u=document.getElementsByTagName("head")[0],d=u.querySelector("meta[name=next-head-count]");if(process.env.NODE_ENV!=="production"&&!d){console.error("Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing");return}const h=Number(d.content),f=[];for(let m=0,y=d.previousElementSibling;m<h;m++,y=(y==null?void 0:y.previousElementSibling)||null){var p;(y==null||(p=y.tagName)==null?void 0:p.toLowerCase())===l&&f.push(y)}const g=c.map(i).filter(m=>{for(let y=0,x=f.length;y<x;y++){const w=f[y];if(o(w,m))return f.splice(y,1),!1}return!0});f.forEach(m=>{var y;return(y=m.parentNode)==null?void 0:y.removeChild(m)}),g.forEach(m=>u.insertBefore(m,d)),d.content=(h-f.length+g.length).toString()};function a(){return{mountedInstances:new Set,updateHead:l=>{const c={};l.forEach(h=>{if(h.type==="link"&&h.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'+h.props["data-href"]+'"]'))return;h.props.href=h.props["data-href"],h.props["data-href"]=void 0}const f=c[h.type]||[];f.push(h),c[h.type]=f});const u=c.title?c.title[0]:null;let d="";if(u){const{children:h}=u.props;d=typeof h=="string"?h:Array.isArray(h)?h.join(""):""}d!==document.title&&(document.title=d),["meta","base","link","style","script"].forEach(h=>{s(h,c[h]||[])})}}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(da,da.exports)),da.exports}var ey;function PO(){return ey||(ey=1,function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function n(C,_){for(var E in _)Object.defineProperty(C,E,{enumerable:!0,get:_[E]})}n(e,{default:function(){return S},handleClientScriptLoad:function(){return m},initScriptLoader:function(){return w}});const r=Nt,i=Is(),o=Ps,s=r._(ho),a=i._(O),l=tw(),c=MO(),u=lp(),d=new Map,h=new Set,f=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"],p=C=>{if(s.default.preinit){C.forEach(_=>{s.default.preinit(_,{as:"style"})});return}if(typeof window<"u"){let _=document.head;C.forEach(E=>{let R=document.createElement("link");R.type="text/css",R.rel="stylesheet",R.href=E,_.appendChild(R)})}},g=C=>{const{src:_,id:E,onLoad:R=()=>{},onReady:A=null,dangerouslySetInnerHTML:T,children:k="",strategy:P="afterInteractive",onError:M,stylesheets:j}=C,z=E||_;if(z&&h.has(z))return;if(d.has(_)){h.add(z),d.get(_).then(R,M);return}const $=()=>{A&&A(),h.add(z)},J=document.createElement("script"),K=new Promise((D,Q)=>{J.addEventListener("load",function(se){D(),R&&R.call(this,se),$()}),J.addEventListener("error",function(se){Q(se)})}).catch(function(D){M&&M(D)});T?(J.innerHTML=T.__html||"",$()):k?(J.textContent=typeof k=="string"?k:Array.isArray(k)?k.join(""):"",$()):_&&(J.src=_,d.set(_,K));for(const[D,Q]of Object.entries(C)){if(Q===void 0||f.includes(D))continue;const se=c.DOMAttributeNames[D]||D.toLowerCase();J.setAttribute(se,Q)}P==="worker"&&J.setAttribute("type","text/partytown"),J.setAttribute("data-nscript",P),j&&p(j),document.body.appendChild(J)};function m(C){const{strategy:_="afterInteractive"}=C;_==="lazyOnload"?window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>g(C))}):g(C)}function y(C){document.readyState==="complete"?(0,u.requestIdleCallback)(()=>g(C)):window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>g(C))})}function x(){[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(_=>{const E=_.id||_.getAttribute("src");h.add(E)})}function w(C){C.forEach(m),x()}function v(C){const{id:_,src:E="",onLoad:R=()=>{},onReady:A=null,strategy:T="afterInteractive",onError:k,stylesheets:P,...M}=C,{updateScripts:j,scripts:z,getIsSsr:$,appDir:J,nonce:K}=(0,a.useContext)(l.HeadManagerContext),D=(0,a.useRef)(!1);(0,a.useEffect)(()=>{const se=_||E;D.current||(A&&se&&h.has(se)&&A(),D.current=!0)},[A,_,E]);const Q=(0,a.useRef)(!1);if((0,a.useEffect)(()=>{Q.current||(T==="afterInteractive"?g(C):T==="lazyOnload"&&y(C),Q.current=!0)},[C,T]),(T==="beforeInteractive"||T==="worker")&&(j?(z[T]=(z[T]||[]).concat([{id:_,src:E,onLoad:R,onReady:A,onError:k,...M}]),j(z)):$&&$()?h.add(_||E):$&&!$()&&g(C)),J){if(P&&P.forEach(se=>{s.default.preinit(se,{as:"style"})}),T==="beforeInteractive")return E?(s.default.preload(E,M.integrity?{as:"script",integrity:M.integrity,nonce:K,crossOrigin:M.crossOrigin}:{as:"script",nonce:K,crossOrigin:M.crossOrigin}),(0,o.jsx)("script",{nonce:K,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([E,{...M,id:_}])+")"}})):(M.dangerouslySetInnerHTML&&(M.children=M.dangerouslySetInnerHTML.__html,delete M.dangerouslySetInnerHTML),(0,o.jsx)("script",{nonce:K,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...M,id:_}])+")"}}));T==="afterInteractive"&&E&&s.default.preload(E,M.integrity?{as:"script",integrity:M.integrity,nonce:K,crossOrigin:M.crossOrigin}:{as:"script",nonce:K,crossOrigin:M.crossOrigin})}return null}Object.defineProperty(v,"__nextScript",{value:!0});const S=v;(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ua,ua.exports)),ua.exports}var Vu={},zu={},ty;function IO(){return ty||(ty=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,o){for(var s in o)Object.defineProperty(i,s,{enumerable:!0,get:o[s]})}e(t,{getObjectClassLabel:function(){return n},isPlainObject:function(){return r}});function n(i){return Object.prototype.toString.call(i)}function r(i){if(n(i)!=="[object Object]")return!1;const o=Object.getPrototypeOf(i);return o===null||o.hasOwnProperty("isPrototypeOf")}}(zu)),zu}var ny;function nw(){return ny||(ny=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,s){for(var a in s)Object.defineProperty(o,a,{enumerable:!0,get:s[a]})}e(t,{default:function(){return r},getProperError:function(){return i}});const n=IO();function r(o){return typeof o=="object"&&o!==null&&"name"in o&&"message"in o}function i(o){if(r(o))return o;if(process.env.NODE_ENV==="development"){if(typeof o>"u")return new Error("An undefined error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined");if(o===null)return new Error("A null error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined")}return new Error((0,n.isPlainObject)(o)?JSON.stringify(o):o+"")}}(Vu)),Vu}var Uu={},qu={},ry;function LO(){return ry||(ry=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return e}});function e(n){return n.replace(/\\/g,"/")}}(qu)),qu}var iy;function DO(){return iy||(iy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"denormalizePagePath",{enumerable:!0,get:function(){return r}});const e=gb(),n=LO();function r(i){let o=(0,n.normalizePathSep)(i);return o.startsWith("/index/")&&!(0,e.isDynamicRoute)(o)?o.slice(6):o!=="/index"?o:"/"}}(Uu)),Uu}var Wu={},oy;function NO(){return oy||(oy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e}});function e(){const n=Object.create(null);return{on(r,i){(n[r]||(n[r]=[])).push(i)},off(r,i){n[r]&&n[r].splice(n[r].indexOf(i)>>>0,1)},emit(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];(n[r]||[]).slice().map(a=>{a(...o)})}}}}(Wu)),Wu}var Ku={},sy;function bp(){return sy||(sy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return r}});const e=po(),n=uc();function r(i,o){const s=new URL(typeof window>"u"?"http://n":(0,e.getLocationOrigin)()),a=o?new URL(o,s):i.startsWith(".")?new URL(typeof window>"u"?"http://n":window.location.href):s,{pathname:l,searchParams:c,search:u,hash:d,href:h,origin:f}=new URL(i,a);if(f!==s.origin)throw new Error("invariant: invalid relative URL, router received "+i);return{pathname:l,query:(0,n.searchParamsToUrlQuery)(c),search:u,hash:d,href:h.slice(s.origin.length)}}}(Ku)),Ku}var Gu={},Ju={},Sn={},ay;function rw(){if(ay)return Sn;ay=1,Object.defineProperty(Sn,"__esModule",{value:!0});function t(f){for(var p=[],g=0;g<f.length;){var m=f[g];if(m==="*"||m==="+"||m==="?"){p.push({type:"MODIFIER",index:g,value:f[g++]});continue}if(m==="\\"){p.push({type:"ESCAPED_CHAR",index:g++,value:f[g++]});continue}if(m==="{"){p.push({type:"OPEN",index:g,value:f[g++]});continue}if(m==="}"){p.push({type:"CLOSE",index:g,value:f[g++]});continue}if(m===":"){for(var y="",x=g+1;x<f.length;){var w=f.charCodeAt(x);if(w>=48&&w<=57||w>=65&&w<=90||w>=97&&w<=122||w===95){y+=f[x++];continue}break}if(!y)throw new TypeError("Missing parameter name at "+g);p.push({type:"NAME",index:g,value:y}),g=x;continue}if(m==="("){var v=1,S="",x=g+1;if(f[x]==="?")throw new TypeError('Pattern cannot start with "?" at '+x);for(;x<f.length;){if(f[x]==="\\"){S+=f[x++]+f[x++];continue}if(f[x]===")"){if(v--,v===0){x++;break}}else if(f[x]==="("&&(v++,f[x+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+x);S+=f[x++]}if(v)throw new TypeError("Unbalanced pattern at "+g);if(!S)throw new TypeError("Missing pattern at "+g);p.push({type:"PATTERN",index:g,value:S}),g=x;continue}p.push({type:"CHAR",index:g,value:f[g++]})}return p.push({type:"END",index:g,value:""}),p}function e(f,p){p===void 0&&(p={});for(var g=t(f),m=p.prefixes,y=m===void 0?"./":m,x="[^"+s(p.delimiter||"/#?")+"]+?",w=[],v=0,S=0,C="",_=function(K){if(S<g.length&&g[S].type===K)return g[S++].value},E=function(K){var D=_(K);if(D!==void 0)return D;var Q=g[S],se=Q.type,oe=Q.index;throw new TypeError("Unexpected "+se+" at "+oe+", expected "+K)},R=function(){for(var K="",D;D=_("CHAR")||_("ESCAPED_CHAR");)K+=D;return K};S<g.length;){var A=_("CHAR"),T=_("NAME"),k=_("PATTERN");if(T||k){var P=A||"";y.indexOf(P)===-1&&(C+=P,P=""),C&&(w.push(C),C=""),w.push({name:T||v++,prefix:P,suffix:"",pattern:k||x,modifier:_("MODIFIER")||""});continue}var M=A||_("ESCAPED_CHAR");if(M){C+=M;continue}C&&(w.push(C),C="");var j=_("OPEN");if(j){var P=R(),z=_("NAME")||"",$=_("PATTERN")||"",J=R();E("CLOSE"),w.push({name:z||($?v++:""),pattern:z&&!$?x:$,prefix:P,suffix:J,modifier:_("MODIFIER")||""});continue}E("END")}return w}Sn.parse=e;function n(f,p){return r(e(f,p),p)}Sn.compile=n;function r(f,p){p===void 0&&(p={});var g=a(p),m=p.encode,y=m===void 0?function(S){return S}:m,x=p.validate,w=x===void 0?!0:x,v=f.map(function(S){if(typeof S=="object")return new RegExp("^(?:"+S.pattern+")$",g)});return function(S){for(var C="",_=0;_<f.length;_++){var E=f[_];if(typeof E=="string"){C+=E;continue}var R=S?S[E.name]:void 0,A=E.modifier==="?"||E.modifier==="*",T=E.modifier==="*"||E.modifier==="+";if(Array.isArray(R)){if(!T)throw new TypeError('Expected "'+E.name+'" to not repeat, but got an array');if(R.length===0){if(A)continue;throw new TypeError('Expected "'+E.name+'" to not be empty')}for(var k=0;k<R.length;k++){var P=y(R[k],E);if(w&&!v[_].test(P))throw new TypeError('Expected all "'+E.name+'" to match "'+E.pattern+'", but got "'+P+'"');C+=E.prefix+P+E.suffix}continue}if(typeof R=="string"||typeof R=="number"){var P=y(String(R),E);if(w&&!v[_].test(P))throw new TypeError('Expected "'+E.name+'" to match "'+E.pattern+'", but got "'+P+'"');C+=E.prefix+P+E.suffix;continue}if(!A){var M=T?"an array":"a string";throw new TypeError('Expected "'+E.name+'" to be '+M)}}return C}}Sn.tokensToFunction=r;function i(f,p){var g=[],m=h(f,g,p);return o(m,g,p)}Sn.match=i;function o(f,p,g){g===void 0&&(g={});var m=g.decode,y=m===void 0?function(x){return x}:m;return function(x){var w=f.exec(x);if(!w)return!1;for(var v=w[0],S=w.index,C=Object.create(null),_=function(R){if(w[R]===void 0)return"continue";var A=p[R-1];A.modifier==="*"||A.modifier==="+"?C[A.name]=w[R].split(A.prefix+A.suffix).map(function(T){return y(T,A)}):C[A.name]=y(w[R],A)},E=1;E<w.length;E++)_(E);return{path:v,index:S,params:C}}}Sn.regexpToFunction=o;function s(f){return f.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function a(f){return f&&f.sensitive?"":"i"}function l(f,p){if(!p)return f;var g=f.source.match(/\((?!\?)/g);if(g)for(var m=0;m<g.length;m++)p.push({name:m,prefix:"",suffix:"",modifier:"",pattern:""});return f}function c(f,p,g){var m=f.map(function(y){return h(y,p,g).source});return new RegExp("(?:"+m.join("|")+")",a(g))}function u(f,p,g){return d(e(f,g),p,g)}function d(f,p,g){g===void 0&&(g={});for(var m=g.strict,y=m===void 0?!1:m,x=g.start,w=x===void 0?!0:x,v=g.end,S=v===void 0?!0:v,C=g.encode,_=C===void 0?function(K){return K}:C,E="["+s(g.endsWith||"")+"]|$",R="["+s(g.delimiter||"/#?")+"]",A=w?"^":"",T=0,k=f;T<k.length;T++){var P=k[T];if(typeof P=="string")A+=s(_(P));else{var M=s(_(P.prefix)),j=s(_(P.suffix));if(P.pattern)if(p&&p.push(P),M||j)if(P.modifier==="+"||P.modifier==="*"){var z=P.modifier==="*"?"?":"";A+="(?:"+M+"((?:"+P.pattern+")(?:"+j+M+"(?:"+P.pattern+"))*)"+j+")"+z}else A+="(?:"+M+"("+P.pattern+")"+j+")"+P.modifier;else A+="("+P.pattern+")"+P.modifier;else A+="(?:"+M+j+")"+P.modifier}}if(S)y||(A+=R+"?"),A+=g.endsWith?"(?="+E+")":"$";else{var $=f[f.length-1],J=typeof $=="string"?R.indexOf($[$.length-1])>-1:$===void 0;y||(A+="(?:"+R+"(?="+E+"))?"),J||(A+="(?="+R+"|"+E+")")}return new RegExp(A,a(g))}Sn.tokensToRegexp=d;function h(f,p,g){return f instanceof RegExp?l(f,p):Array.isArray(f)?c(f,p,g):u(f,p,g)}return Sn.pathToRegexp=h,Sn}var ly;function jO(){return ly||(ly=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getPathMatch",{enumerable:!0,get:function(){return n}});const e=rw();function n(r,i){const o=[],s=(0,e.pathToRegexp)(r,o,{delimiter:"/",sensitive:typeof(i==null?void 0:i.sensitive)=="boolean"?i.sensitive:!1,strict:i==null?void 0:i.strict}),a=(0,e.regexpToFunction)(i!=null&&i.regexModifier?new RegExp(i.regexModifier(s.source),s.flags):s,o);return(l,c)=>{if(typeof l!="string")return!1;const u=a(l);if(!u)return!1;if(i!=null&&i.removeUnnamedParams)for(const d of o)typeof d.name=="number"&&delete u.params[d.name];return{...c,...u.params}}}}(Ju)),Ju}var Xu={},Yu={},cy;function FO(){return cy||(cy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseUrl",{enumerable:!0,get:function(){return r}});const e=uc(),n=bp();function r(i){if(i.startsWith("/"))return(0,n.parseRelativeUrl)(i);const o=new URL(i);return{hash:o.hash,hostname:o.hostname,href:o.href,pathname:o.pathname,port:o.port,protocol:o.protocol,query:(0,e.searchParamsToUrlQuery)(o.searchParams),search:o.search}}}(Yu)),Yu}var fa={exports:{}},uy;function HO(){return uy||(uy=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(h,f){for(var p in f)Object.defineProperty(h,p,{enumerable:!0,get:f[p]})}n(e,{ACTION:function(){return i},FLIGHT_PARAMETERS:function(){return c},NEXT_DID_POSTPONE_HEADER:function(){return d},NEXT_ROUTER_PREFETCH_HEADER:function(){return s},NEXT_ROUTER_STATE_TREE:function(){return o},NEXT_RSC_UNION_QUERY:function(){return u},NEXT_URL:function(){return a},RSC_CONTENT_TYPE_HEADER:function(){return l},RSC_HEADER:function(){return r}});const r="RSC",i="Next-Action",o="Next-Router-State-Tree",s="Next-Router-Prefetch",a="Next-Url",l="text/x-component",c=[[r],[o],[s]],u="_rsc",d="x-nextjs-postponed";(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(fa,fa.exports)),fa.exports}var Qu={},Zu={exports:{}},dy;function $O(){return dy||(dy=1,(()=>{typeof __nccwpck_require__<"u"&&(__nccwpck_require__.ab=__dirname+"/");var t={};(()=>{var e=t;/*!
13
+ * cookie
14
+ * Copyright(c) 2012-2014 Roman Shtylman
15
+ * Copyright(c) 2015 Douglas Christopher Wilson
16
+ * MIT Licensed
17
+ */e.parse=s,e.serialize=a;var n=decodeURIComponent,r=encodeURIComponent,i=/; */,o=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(c,u){if(typeof c!="string")throw new TypeError("argument str must be a string");for(var d={},h=u||{},f=c.split(i),p=h.decode||n,g=0;g<f.length;g++){var m=f[g],y=m.indexOf("=");if(!(y<0)){var x=m.substr(0,y).trim(),w=m.substr(++y,m.length).trim();w[0]=='"'&&(w=w.slice(1,-1)),d[x]==null&&(d[x]=l(w,p))}}return d}function a(c,u,d){var h=d||{},f=h.encode||r;if(typeof f!="function")throw new TypeError("option encode is invalid");if(!o.test(c))throw new TypeError("argument name is invalid");var p=f(u);if(p&&!o.test(p))throw new TypeError("argument val is invalid");var g=c+"="+p;if(h.maxAge!=null){var m=h.maxAge-0;if(isNaN(m)||!isFinite(m))throw new TypeError("option maxAge is invalid");g+="; Max-Age="+Math.floor(m)}if(h.domain){if(!o.test(h.domain))throw new TypeError("option domain is invalid");g+="; Domain="+h.domain}if(h.path){if(!o.test(h.path))throw new TypeError("option path is invalid");g+="; Path="+h.path}if(h.expires){if(typeof h.expires.toUTCString!="function")throw new TypeError("option expires is invalid");g+="; Expires="+h.expires.toUTCString()}if(h.httpOnly&&(g+="; HttpOnly"),h.secure&&(g+="; Secure"),h.sameSite){var y=typeof h.sameSite=="string"?h.sameSite.toLowerCase():h.sameSite;switch(y){case!0:g+="; SameSite=Strict";break;case"lax":g+="; SameSite=Lax";break;case"strict":g+="; SameSite=Strict";break;case"none":g+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return g}function l(c,u){try{return u(c)}catch{return c}}})(),Zu.exports=t})()),Zu.exports}var fy;function BO(){return fy||(fy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getCookieParser",{enumerable:!0,get:function(){return e}});function e(n){return function(){const{cookie:i}=n;if(!i)return{};const{parse:o}=$O();return o(Array.isArray(i)?i.join("; "):i)}}}(Qu)),Qu}var hy;function VO(){return hy||(hy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(p,g){for(var m in g)Object.defineProperty(p,m,{enumerable:!0,get:g[m]})}e(t,{compileNonPath:function(){return h},matchHas:function(){return d},prepareDestination:function(){return f}});const n=rw(),r=yb(),i=FO(),o=op(),s=HO(),a=BO();function l(p){let g="";for(let m=0;m<p.length;m++){const y=p.charCodeAt(m);(y>64&&y<91||y>96&&y<123)&&(g+=p[m])}return g}function c(p,g){return p.replace(new RegExp(":"+(0,r.escapeStringRegexp)(g),"g"),"__ESC_COLON_"+g)}function u(p){return p.replace(/__ESC_COLON_/gi,":")}function d(p,g,m,y){m===void 0&&(m=[]),y===void 0&&(y=[]);const x={},w=S=>{let C,_=S.key;switch(S.type){case"header":{_=_.toLowerCase(),C=p.headers[_];break}case"cookie":{"cookies"in p?C=p.cookies[S.key]:C=(0,a.getCookieParser)(p.headers)()[S.key];break}case"query":{C=g[_];break}case"host":{const{host:E}=(p==null?void 0:p.headers)||{};C=E==null?void 0:E.split(":",1)[0].toLowerCase();break}}if(!S.value&&C)return x[l(_)]=C,!0;if(C){const E=new RegExp("^"+S.value+"$"),R=Array.isArray(C)?C.slice(-1)[0].match(E):C.match(E);if(R)return Array.isArray(R)&&(R.groups?Object.keys(R.groups).forEach(A=>{x[A]=R.groups[A]}):S.type==="host"&&R[0]&&(x.host=R[0])),!0}return!1};return m.every(S=>w(S))&&!y.some(S=>w(S))?x:!1}function h(p,g){if(!p.includes(":"))return p;for(const m of Object.keys(g))p.includes(":"+m)&&(p=p.replace(new RegExp(":"+m+"\\*","g"),":"+m+"--ESCAPED_PARAM_ASTERISKS").replace(new RegExp(":"+m+"\\?","g"),":"+m+"--ESCAPED_PARAM_QUESTION").replace(new RegExp(":"+m+"\\+","g"),":"+m+"--ESCAPED_PARAM_PLUS").replace(new RegExp(":"+m+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+m));return p=p.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,n.compile)("/"+p,{validate:!1})(g).slice(1)}function f(p){const g=Object.assign({},p.query);delete g.__nextLocale,delete g.__nextDefaultLocale,delete g.__nextDataReq,delete g.__nextInferredLocaleFromDefault,delete g[s.NEXT_RSC_UNION_QUERY];let m=p.destination;for(const k of Object.keys({...p.params,...g}))m=c(m,k);const y=(0,i.parseUrl)(m),x=y.query,w=u(""+y.pathname+(y.hash||"")),v=u(y.hostname||""),S=[],C=[];(0,n.pathToRegexp)(w,S),(0,n.pathToRegexp)(v,C);const _=[];S.forEach(k=>_.push(k.name)),C.forEach(k=>_.push(k.name));const E=(0,n.compile)(w,{validate:!1}),R=(0,n.compile)(v,{validate:!1});for(const[k,P]of Object.entries(x))Array.isArray(P)?x[k]=P.map(M=>h(u(M),p.params)):typeof P=="string"&&(x[k]=h(u(P),p.params));let A=Object.keys(p.params).filter(k=>k!=="nextInternalLocale");if(p.appendParamsToQuery&&!A.some(k=>_.includes(k)))for(const k of A)k in x||(x[k]=p.params[k]);let T;if((0,o.isInterceptionRouteAppPath)(w))for(const k of w.split("/")){const P=o.INTERCEPTION_ROUTE_MARKERS.find(M=>k.startsWith(M));if(P){p.params[0]=P;break}}try{T=E(p.params);const[k,P]=T.split("#",2);y.hostname=R(p.params),y.pathname=k,y.hash=(P?"#":"")+(P||""),delete y.search}catch(k){throw k.message.match(/Expected .*? to not repeat, but got an array/)?new Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"):k}return y.query={...g,...y.query},{newUrl:T,destQuery:x,parsedDestination:y}}}(Xu)),Xu}var ha={exports:{}},py;function iw(){return py||(py=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeBasePath",{enumerable:!0,get:function(){return i}});const n=rp(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function i(o){return process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!(0,n.hasBasePath)(o)||r.length===0||(o=o.slice(r.length),o.startsWith("/")||(o="/"+o)),o}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ha,ha.exports)),ha.exports}var gy;function zO(){return gy||(gy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const e=jO(),n=VO(),r=Ls(),i=hc(),o=iw(),s=bp();function a(l,c,u,d,h,f){let p=!1,g=!1,m=(0,s.parseRelativeUrl)(l),y=(0,r.removeTrailingSlash)((0,i.normalizeLocalePath)((0,o.removeBasePath)(m.pathname),f).pathname),x;const w=S=>{let _=(0,e.getPathMatch)(S.source+(process.env.__NEXT_TRAILING_SLASH?"(/)?":""),{removeUnnamedParams:!0,strict:!0})(m.pathname);if((S.has||S.missing)&&_){const E=(0,n.matchHas)({headers:{host:document.location.hostname,"user-agent":navigator.userAgent},cookies:document.cookie.split("; ").reduce((R,A)=>{const[T,...k]=A.split("=");return R[T]=k.join("="),R},{})},m.query,S.has,S.missing);E?Object.assign(_,E):_=!1}if(_){if(!S.destination)return g=!0,!0;const E=(0,n.prepareDestination)({appendParamsToQuery:!0,destination:S.destination,params:_,query:d});if(m=E.parsedDestination,l=E.newUrl,Object.assign(d,E.parsedDestination.query),y=(0,r.removeTrailingSlash)((0,i.normalizeLocalePath)((0,o.removeBasePath)(l),f).pathname),c.includes(y))return p=!0,x=y,!0;if(x=h(y),x!==l&&c.includes(x))return p=!0,!0}};let v=!1;for(let S=0;S<u.beforeFiles.length;S++)w(u.beforeFiles[S]);if(p=c.includes(y),!p){if(!v){for(let S=0;S<u.afterFiles.length;S++)if(w(u.afterFiles[S])){v=!0;break}}if(v||(x=h(y),p=c.includes(x),v=p),!v){for(let S=0;S<u.fallback.length;S++)if(w(u.fallback[S])){v=!0;break}}}return{asPath:l,parsedAs:m,matchedPage:p,resolvedHref:x,externalDest:g}}}(Gu)),Gu}var pa={exports:{}},my;function UO(){return my||(my=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeLocale",{enumerable:!0,get:function(){return r}});const n=go();function r(i,o){if(process.env.__NEXT_I18N_SUPPORT){const{pathname:s}=(0,n.parsePath)(i),a=s.toLowerCase(),l=o==null?void 0:o.toLowerCase();return o&&(a.startsWith("/"+l+"/")||a==="/"+l)?(s.length===o.length+1?"/":"")+i.slice(o.length+1):i}return i}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(pa,pa.exports)),pa.exports}var ed={},yy;function qO(){return yy||(yy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isAPIRoute",{enumerable:!0,get:function(){return e}});function e(n){return n==="/api"||!!(n!=null&&n.startsWith("/api/"))}}(ed)),ed}var td={},nd={},vy;function WO(){return vy||(vy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return n}});const e=fc();function n(r,i){if(!(0,e.pathHasPrefix)(r,i))return r;const o=r.slice(i.length);return o.startsWith("/")?o:"/"+o}}(nd)),nd}var by;function KO(){return by||(by=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return i}});const e=hc(),n=WO(),r=fc();function i(o,s){var a;const{basePath:l,i18n:c,trailingSlash:u}=(a=s.nextConfig)!=null?a:{},d={pathname:o,trailingSlash:o!=="/"?o.endsWith("/"):u};l&&(0,r.pathHasPrefix)(d.pathname,l)&&(d.pathname=(0,n.removePathPrefix)(d.pathname,l),d.basePath=l);let h=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){const p=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),g=p[0];d.buildId=g,h=p[1]!=="index"?"/"+p.slice(1).join("/"):"/",s.parseData===!0&&(d.pathname=h)}if(c){let p=s.i18nProvider?s.i18nProvider.analyze(d.pathname):(0,e.normalizeLocalePath)(d.pathname,c.locales);d.locale=p.detectedLocale;var f;d.pathname=(f=p.pathname)!=null?f:d.pathname,!p.detectedLocale&&d.buildId&&(p=s.i18nProvider?s.i18nProvider.analyze(h):(0,e.normalizeLocalePath)(h,c.locales),p.detectedLocale&&(d.locale=p.detectedLocale))}return d}}(td)),td}var rd={},id={},wy;function GO(){return wy||(wy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return n}});const e=go();function n(r,i){if(!r.startsWith("/")||!i)return r;const{pathname:o,query:s,hash:a}=(0,e.parsePath)(r);return""+o+i+s+a}}(id)),id}var Sy;function JO(){return Sy||(Sy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return o}});const e=Ls(),n=sp(),r=GO(),i=Sb();function o(s){let a=(0,i.addLocale)(s.pathname,s.locale,s.buildId?void 0:s.defaultLocale,s.ignorePrefix);return(s.buildId||!s.trailingSlash)&&(a=(0,e.removeTrailingSlash)(a)),s.buildId&&(a=(0,r.addPathSuffix)((0,n.addPathPrefix)(a,"/_next/data/"+s.buildId),s.pathname==="/"?"index.json":".json")),a=(0,n.addPathPrefix)(a,s.basePath),!s.buildId&&s.trailingSlash?a.endsWith("/")?a:(0,r.addPathSuffix)(a,"/"):(0,e.removeTrailingSlash)(a)}}(rd)),rd}var od={},xy;function XO(){return xy||(xy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"compareRouterStates",{enumerable:!0,get:function(){return e}});function e(n,r){const i=Object.keys(n);if(i.length!==Object.keys(r).length)return!1;for(let o=i.length;o--;){const s=i[o];if(s==="query"){const a=Object.keys(n.query);if(a.length!==Object.keys(r.query).length)return!1;for(let l=a.length;l--;){const c=a[l];if(!r.query.hasOwnProperty(c)||n.query[c]!==r.query[c])return!1}}else if(!r.hasOwnProperty(s)||n[s]!==r[s])return!1}return!0}}(od)),od}var sd={},Cy;function YO(){return Cy||(Cy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return e}});function e(n){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(n)}}(sd)),sd}var ad={},Ey;function QO(){return Ey||(Ey=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return e}});function e(n,r){if(r===void 0&&(r={}),r.onlyHashChange){n();return}const i=document.documentElement,o=i.style.scrollBehavior;i.style.scrollBehavior="auto",r.dontForceLayout||i.getClientRects(),n(),i.style.scrollBehavior=o}}(ad)),ad}var ga={exports:{}},ze={};/**
18
+ * @license React
19
+ * react-is.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var _y;function ZO(){if(_y)return ze;_y=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function g(m){if(typeof m=="object"&&m!==null){var y=m.$$typeof;switch(y){case t:switch(m=m.type,m){case n:case i:case r:case c:case u:return m;default:switch(m=m&&m.$$typeof,m){case a:case s:case l:case h:case d:case o:return m;default:return y}}case e:return y}}}return ze.ContextConsumer=s,ze.ContextProvider=o,ze.Element=t,ze.ForwardRef=l,ze.Fragment=n,ze.Lazy=h,ze.Memo=d,ze.Portal=e,ze.Profiler=i,ze.StrictMode=r,ze.Suspense=c,ze.SuspenseList=u,ze.isAsyncMode=function(){return!1},ze.isConcurrentMode=function(){return!1},ze.isContextConsumer=function(m){return g(m)===s},ze.isContextProvider=function(m){return g(m)===o},ze.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},ze.isForwardRef=function(m){return g(m)===l},ze.isFragment=function(m){return g(m)===n},ze.isLazy=function(m){return g(m)===h},ze.isMemo=function(m){return g(m)===d},ze.isPortal=function(m){return g(m)===e},ze.isProfiler=function(m){return g(m)===i},ze.isStrictMode=function(m){return g(m)===r},ze.isSuspense=function(m){return g(m)===c},ze.isSuspenseList=function(m){return g(m)===u},ze.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===i||m===r||m===c||m===u||m===f||typeof m=="object"&&m!==null&&(m.$$typeof===h||m.$$typeof===d||m.$$typeof===o||m.$$typeof===s||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},ze.typeOf=g,ze}var Ue={};/**
26
+ * @license React
27
+ * react-is.development.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Ry;function eT(){return Ry||(Ry=1,process.env.NODE_ENV!=="production"&&function(){var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=!1,g=!1,m=!1,y=!1,x=!1,w;w=Symbol.for("react.module.reference");function v(G){return!!(typeof G=="string"||typeof G=="function"||G===n||G===i||x||G===r||G===c||G===u||y||G===f||p||g||m||typeof G=="object"&&G!==null&&(G.$$typeof===h||G.$$typeof===d||G.$$typeof===o||G.$$typeof===s||G.$$typeof===l||G.$$typeof===w||G.getModuleId!==void 0))}function S(G){if(typeof G=="object"&&G!==null){var ne=G.$$typeof;switch(ne){case t:var X=G.type;switch(X){case n:case i:case r:case c:case u:return X;default:var W=X&&X.$$typeof;switch(W){case a:case s:case l:case h:case d:case o:return W;default:return ne}}case e:return ne}}}var C=s,_=o,E=t,R=l,A=n,T=h,k=d,P=e,M=i,j=r,z=c,$=u,J=!1,K=!1;function D(G){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Q(G){return K||(K=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function se(G){return S(G)===s}function oe(G){return S(G)===o}function de(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function ue(G){return S(G)===l}function pe(G){return S(G)===n}function L(G){return S(G)===h}function ce(G){return S(G)===d}function me(G){return S(G)===e}function be(G){return S(G)===i}function F(G){return S(G)===r}function I(G){return S(G)===c}function je(G){return S(G)===u}Ue.ContextConsumer=C,Ue.ContextProvider=_,Ue.Element=E,Ue.ForwardRef=R,Ue.Fragment=A,Ue.Lazy=T,Ue.Memo=k,Ue.Portal=P,Ue.Profiler=M,Ue.StrictMode=j,Ue.Suspense=z,Ue.SuspenseList=$,Ue.isAsyncMode=D,Ue.isConcurrentMode=Q,Ue.isContextConsumer=se,Ue.isContextProvider=oe,Ue.isElement=de,Ue.isForwardRef=ue,Ue.isFragment=pe,Ue.isLazy=L,Ue.isMemo=ce,Ue.isPortal=me,Ue.isProfiler=be,Ue.isStrictMode=F,Ue.isSuspense=I,Ue.isSuspenseList=je,Ue.isValidElementType=v,Ue.typeOf=S}()),Ue}var Ay;function tT(){return Ay||(Ay=1,process.env.NODE_ENV==="production"?ga.exports=ZO():ga.exports=eT()),ga.exports}var ld={},cd={exports:{}};const nT={},rT=Object.freeze(Object.defineProperty({__proto__:null,default:nT},Symbol.toStringTag,{value:"Module"})),ud=k_(rT);var Oy;function iT(){return Oy||(Oy=1,(()=>{var t={154:(i,o,s)=>{var a=s(781),l=["write","end","destroy"],c=["resume","pause"],u=["data","close"],d=Array.prototype.slice;i.exports=f;function h(p,g){if(p.forEach)return p.forEach(g);for(var m=0;m<p.length;m++)g(p[m],m)}function f(p,g){var m=new a,y=!1;return h(l,x),h(c,w),h(u,v),g.on("end",S),p.on("drain",function(){m.emit("drain")}),p.on("error",C),g.on("error",C),m.writable=p.writable,m.readable=g.readable,m;function x(_){m[_]=E;function E(){return p[_].apply(p,arguments)}}function w(_){m[_]=E;function E(){m.emit(_);var R=g[_];if(R)return R.apply(g,arguments);g.emit(_)}}function v(_){g.on(_,E);function E(){var R=d.call(arguments);R.unshift(_),m.emit.apply(m,R)}}function S(){if(!y){y=!0;var _=d.call(arguments);_.unshift("end"),m.emit.apply(m,_)}}function C(_){m.emit("error",_)}}},349:(i,o,s)=>{const a=s(147),l=s(781),c=s(796),u=s(154),d=s(530),h=f=>Object.assign({level:9},f);i.exports=(f,p)=>f?d(c.gzip)(f,h(p)).then(g=>g.length).catch(g=>0):Promise.resolve(0),i.exports.sync=(f,p)=>c.gzipSync(f,h(p)).length,i.exports.stream=f=>{const p=new l.PassThrough,g=new l.PassThrough,m=u(p,g);let y=0;const x=c.createGzip(h(f)).on("data",w=>{y+=w.length}).on("error",()=>{m.gzipSize=0}).on("end",()=>{m.gzipSize=y,m.emit("gzip-size",y),g.end()});return p.pipe(x),p.pipe(g,{end:!1}),m},i.exports.file=(f,p)=>new Promise((g,m)=>{const y=a.createReadStream(f);y.on("error",m);const x=y.pipe(i.exports.stream(p));x.on("error",m),x.on("gzip-size",g)}),i.exports.fileSync=(f,p)=>i.exports.sync(a.readFileSync(f),p)},530:i=>{const o=(s,a)=>function(...l){const c=a.promiseModule;return new c((u,d)=>{a.multiArgs?l.push((...h)=>{a.errorFirst?h[0]?d(h):(h.shift(),u(h)):u(h)}):a.errorFirst?l.push((h,f)=>{h?d(h):u(f)}):l.push(u),s.apply(this,l)})};i.exports=(s,a)=>{a=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},a);const l=typeof s;if(!(s!==null&&(l==="object"||l==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${s===null?"null":l}\``);const c=d=>{const h=f=>typeof f=="string"?d===f:f.test(d);return a.include?a.include.some(h):!a.exclude.some(h)};let u;l==="function"?u=function(...d){return a.excludeMain?s(...d):o(s,a).apply(this,d)}:u=Object.create(Object.getPrototypeOf(s));for(const d in s){const h=s[d];u[d]=typeof h=="function"&&c(d)?o(h,a):h}return u}},147:i=>{i.exports=ud},781:i=>{i.exports=ud},796:i=>{i.exports=ud}},e={};function n(i){var o=e[i];if(o!==void 0)return o.exports;var s=e[i]={exports:{}},a=!0;try{t[i](s,s.exports,n),a=!1}finally{a&&delete e[i]}return s.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(349);cd.exports=r})()),cd.exports}var Ty;function oT(){return Ty||(Ty=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BloomFilter",{enumerable:!0,get:function(){return r}});function e(i){let o=0;for(let s=0;s<i.length;s++){const a=i.charCodeAt(s);o=Math.imul(o^a,1540483477),o^=o>>>13,o=Math.imul(o,1540483477)}return o>>>0}const n=1e-4;class r{static from(o,s){s===void 0&&(s=n);const a=new r(o.length,s);for(const l of o)a.add(l);return a}export(){const o={numItems:this.numItems,errorRate:this.errorRate,numBits:this.numBits,numHashes:this.numHashes,bitArray:this.bitArray};if(process.env.NEXT_RUNTIME==="nodejs"&&this.errorRate<n){const s=JSON.stringify(o),a=iT().sync(s);a>1024&&console.warn("Creating filter with error rate less than 0.1% (0.001) can increase the size dramatically proceed with caution. Received error rate "+this.errorRate+" resulted in size "+s.length+" bytes, "+a+" bytes (gzip)")}return o}import(o){this.numItems=o.numItems,this.errorRate=o.errorRate,this.numBits=o.numBits,this.numHashes=o.numHashes,this.bitArray=o.bitArray}add(o){this.getHashValues(o).forEach(a=>{this.bitArray[a]=1})}contains(o){return this.getHashValues(o).every(a=>this.bitArray[a])}getHashValues(o){const s=[];for(let a=1;a<=this.numHashes;a++){const l=e(""+o+a)%this.numBits;s.push(l)}return s}constructor(o,s=n){this.numItems=o,this.errorRate=s,this.numBits=Math.ceil(-(o*Math.log(s))/(Math.log(2)*Math.log(2))),this.numHashes=Math.ceil(this.numBits/o*Math.log(2)),this.bitArray=new Array(this.numBits).fill(0)}}}(ld)),ld}var ky;function sT(){return ky||(ky=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(ne,X){for(var W in X)Object.defineProperty(ne,W,{enumerable:!0,get:X[W]})}e(t,{createKey:function(){return F},default:function(){return G},matchesMiddleware:function(){return D}});const n=Nt,r=Is(),i=Ls(),o=kO(),s=PO(),a=r._(nw()),l=DO(),c=hc(),u=n._(NO()),d=po(),h=pb(),f=bp(),p=n._(zO()),g=mb(),m=vb(),y=np(),x=Cb(),w=go(),v=xb(),S=UO(),C=iw(),_=Eb(),E=rp(),R=wb(),A=qO(),T=KO(),k=JO(),P=XO(),M=ip(),j=YO(),z=hb(),$=bb(),J=QO();function K(){return Object.assign(new Error("Route Cancelled"),{cancelled:!0})}async function D(ne){const X=await Promise.resolve(ne.router.pageLoader.getMiddleware());if(!X)return!1;const{pathname:W}=(0,w.parsePath)(ne.asPath),B=(0,E.hasBasePath)(W)?(0,C.removeBasePath)(W):W,ee=(0,_.addBasePath)((0,v.addLocale)(B,ne.locale));return X.some(xe=>new RegExp(xe.regexp).test(ee))}function Q(ne){const X=(0,d.getLocationOrigin)();return ne.startsWith(X)?ne.substring(X.length):ne}function se(ne,X,W){let[B,ee]=(0,R.resolveHref)(ne,X,!0);const xe=(0,d.getLocationOrigin)(),we=B.startsWith(xe),Z=ee&&ee.startsWith(xe);B=Q(B),ee=ee&&Q(ee);const Se=we?B:(0,_.addBasePath)(B),U=W?Q((0,R.resolveHref)(ne,W)):ee||B;return{url:Se,as:Z?U:(0,_.addBasePath)(U)}}function oe(ne,X){const W=(0,i.removeTrailingSlash)((0,l.denormalizePagePath)(ne));return W==="/404"||W==="/_error"?ne:(X.includes(W)||X.some(B=>{if((0,h.isDynamicRoute)(B)&&(0,m.getRouteRegex)(B).re.test(W))return ne=B,!0}),(0,i.removeTrailingSlash)(ne))}function de(ne,X,W){const B={basePath:W.router.basePath,i18n:{locales:W.router.locales},trailingSlash:!!process.env.__NEXT_TRAILING_SLASH},ee=X.headers.get("x-nextjs-rewrite");let xe=ee||X.headers.get("x-nextjs-matched-path");const we=X.headers.get("x-matched-path");if(we&&!xe&&!we.includes("__next_data_catchall")&&!we.includes("/_error")&&!we.includes("/404")&&(xe=we),xe){if(xe.startsWith("/")||process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE){const H=(0,f.parseRelativeUrl)(xe),re=(0,T.getNextPathnameInfo)(H.pathname,{nextConfig:B,parseData:!0});let V=(0,i.removeTrailingSlash)(re.pathname);return Promise.all([W.router.pageLoader.getPageList(),(0,o.getClientBuildManifest)()]).then(te=>{let[fe,{__rewrites:ye}]=te,Ce=(0,v.addLocale)(re.pathname,re.locale);if((0,h.isDynamicRoute)(Ce)||!ee&&fe.includes((0,c.normalizeLocalePath)((0,C.removeBasePath)(Ce),W.router.locales).pathname)){const Ve=(0,T.getNextPathnameInfo)((0,f.parseRelativeUrl)(ne).pathname,{nextConfig:process.env.__NEXT_HAS_REWRITES?void 0:B,parseData:!0});Ce=(0,_.addBasePath)(Ve.pathname),H.pathname=Ce}if(process.env.__NEXT_HAS_REWRITES){const Ve=(0,p.default)(Ce,fe,ye,H.query,q=>oe(q,fe),W.router.locales);Ve.matchedPage&&(H.pathname=Ve.parsedAs.pathname,Ce=H.pathname,Object.assign(H.query,Ve.parsedAs.query))}else if(!fe.includes(V)){const Ve=oe(V,fe);Ve!==V&&(V=Ve)}const Fe=fe.includes(V)?V:oe((0,c.normalizeLocalePath)((0,C.removeBasePath)(H.pathname),W.router.locales).pathname,fe);if((0,h.isDynamicRoute)(Fe)){const Ve=(0,g.getRouteMatcher)((0,m.getRouteRegex)(Fe))(Ce);Object.assign(H.query,Ve||{})}return{type:"rewrite",parsedAs:H,resolvedHref:Fe}})}const Se=(0,w.parsePath)(ne),U=(0,k.formatNextPathnameInfo)({...(0,T.getNextPathnameInfo)(Se.pathname,{nextConfig:B,parseData:!0}),defaultLocale:W.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-external",destination:""+U+Se.query+Se.hash})}const Z=X.headers.get("x-nextjs-redirect");if(Z){if(Z.startsWith("/")){const Se=(0,w.parsePath)(Z),U=(0,k.formatNextPathnameInfo)({...(0,T.getNextPathnameInfo)(Se.pathname,{nextConfig:B,parseData:!0}),defaultLocale:W.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-internal",newAs:""+U+Se.query+Se.hash,newUrl:""+U+Se.query+Se.hash})}return Promise.resolve({type:"redirect-external",destination:Z})}return Promise.resolve({type:"next"})}async function ue(ne){if(!await D(ne)||!ne.fetchData)return null;const W=await ne.fetchData(),B=await de(W.dataHref,W.response,ne);return{dataHref:W.dataHref,json:W.json,response:W.response,text:W.text,cacheKey:W.cacheKey,effect:B}}const pe=process.env.__NEXT_SCROLL_RESTORATION&&typeof window<"u"&&"scrollRestoration"in window.history&&!!function(){try{let ne="__next";return sessionStorage.setItem(ne,ne),sessionStorage.removeItem(ne),!0}catch{}}(),L=Symbol("SSG_DATA_NOT_FOUND");function ce(ne,X,W){return fetch(ne,{credentials:"same-origin",method:W.method||"GET",headers:Object.assign({},W.headers,{"x-nextjs-data":"1"})}).then(B=>!B.ok&&X>1&&B.status>=500?ce(ne,X-1,W):B)}function me(ne){try{return JSON.parse(ne)}catch{return null}}function be(ne){let{dataHref:X,inflightCache:W,isPrefetch:B,hasMiddleware:ee,isServerRender:xe,parseJSON:we,persistCache:Z,isBackground:Se,unstable_skipClientCache:U}=ne;const{href:H}=new URL(X,window.location.href),re=V=>{var te;return ce(X,xe?3:1,{headers:Object.assign({},B?{purpose:"prefetch"}:{},B&&ee?{"x-middleware-prefetch":"1"}:{}),method:(te=V==null?void 0:V.method)!=null?te:"GET"}).then(fe=>fe.ok&&(V==null?void 0:V.method)==="HEAD"?{dataHref:X,response:fe,text:"",json:{},cacheKey:H}:fe.text().then(ye=>{if(!fe.ok){if(ee&&[301,302,307,308].includes(fe.status))return{dataHref:X,response:fe,text:ye,json:{},cacheKey:H};if(fe.status===404){var Ce;if((Ce=me(ye))!=null&&Ce.notFound)return{dataHref:X,json:{notFound:L},response:fe,text:ye,cacheKey:H}}const Fe=new Error("Failed to load static props");throw xe||(0,o.markAssetError)(Fe),Fe}return{dataHref:X,json:we?me(ye):null,response:fe,text:ye,cacheKey:H}})).then(fe=>((!Z||process.env.NODE_ENV!=="production"||fe.response.headers.get("x-middleware-cache")==="no-cache")&&delete W[H],fe)).catch(fe=>{throw U||delete W[H],(fe.message==="Failed to fetch"||fe.message==="NetworkError when attempting to fetch resource."||fe.message==="Load failed")&&(0,o.markAssetError)(fe),fe})};return U&&Z?re({}).then(V=>(V.response.headers.get("x-middleware-cache")!=="no-cache"&&(W[H]=Promise.resolve(V)),V)):W[H]!==void 0?W[H]:W[H]=re(Se?{method:"HEAD"}:{})}function F(){return Math.random().toString(36).slice(2,10)}function I(ne){let{url:X,router:W}=ne;if(X===(0,_.addBasePath)((0,v.addLocale)(W.asPath,W.locale)))throw new Error("Invariant: attempted to hard navigate to the same URL "+X+" "+location.href);window.location.href=X}const je=ne=>{let{route:X,router:W}=ne,B=!1;const ee=W.clc=()=>{B=!0};return()=>{if(B){const we=new Error('Abort fetching component for route: "'+X+'"');throw we.cancelled=!0,we}ee===W.clc&&(W.clc=null)}};class G{reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(X,W,B){if(B===void 0&&(B={}),process.env.__NEXT_SCROLL_RESTORATION&&pe)try{sessionStorage.setItem("__next_scroll_"+this._key,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}return{url:X,as:W}=se(this,X,W),this.change("pushState",X,W,B)}replace(X,W,B){return B===void 0&&(B={}),{url:X,as:W}=se(this,X,W),this.change("replaceState",X,W,B)}async _bfl(X,W,B,ee){if(process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED){let Se=!1,U=!1;for(const H of[X,W])if(H){const re=(0,i.removeTrailingSlash)(new URL(H,"http://n").pathname),V=(0,_.addBasePath)((0,v.addLocale)(re,B||this.locale));if(re!==(0,i.removeTrailingSlash)(new URL(this.asPath,"http://n").pathname)){var xe,we;Se=Se||!!((xe=this._bfl_s)!=null&&xe.contains(re))||!!((we=this._bfl_s)!=null&&we.contains(V));for(const te of[re,V]){const fe=te.split("/");for(let ye=0;!U&&ye<fe.length+1;ye++){var Z;const Ce=fe.slice(0,ye).join("/");if(Ce&&((Z=this._bfl_d)!=null&&Z.contains(Ce))){U=!0;break}}}if(Se||U)return ee?!0:(I({url:(0,_.addBasePath)((0,v.addLocale)(X,B||this.locale,this.defaultLocale)),router:this}),new Promise(()=>{}))}}}return!1}async change(X,W,B,ee,xe){var we;if(!(0,M.isLocalURL)(W))return I({url:W,router:this}),!1;const Z=ee._h===1;!Z&&!ee.shallow&&await this._bfl(B,void 0,ee.locale);let Se=Z||ee._shouldResolveHref||(0,w.parsePath)(W).pathname===(0,w.parsePath)(B).pathname;const U={...this.state},H=this.isReady!==!0;this.isReady=!0;const re=this.isSsr;if(Z||(this.isSsr=!1),Z&&this.clc)return!1;const V=U.locale;if(process.env.__NEXT_I18N_SUPPORT){U.locale=ee.locale===!1?this.defaultLocale:ee.locale||U.locale,typeof ee.locale>"u"&&(ee.locale=U.locale);const Ee=(0,f.parseRelativeUrl)((0,E.hasBasePath)(B)?(0,C.removeBasePath)(B):B),Xt=(0,c.normalizeLocalePath)(Ee.pathname,this.locales);Xt.detectedLocale&&(U.locale=Xt.detectedLocale,Ee.pathname=(0,_.addBasePath)(Ee.pathname),B=(0,y.formatWithValidation)(Ee),W=(0,_.addBasePath)((0,c.normalizeLocalePath)((0,E.hasBasePath)(W)?(0,C.removeBasePath)(W):W,this.locales).pathname));let wn=!1;if(process.env.__NEXT_I18N_SUPPORT){var te;(te=this.locales)!=null&&te.includes(U.locale)||(Ee.pathname=(0,v.addLocale)(Ee.pathname,U.locale),I({url:(0,y.formatWithValidation)(Ee),router:this}),wn=!0)}const Dt=(0,x.detectDomainLocale)(this.domainLocales,void 0,U.locale);if(process.env.__NEXT_I18N_SUPPORT&&!wn&&Dt&&this.isLocaleDomain&&self.location.hostname!==Dt.domain){const Kr=(0,C.removeBasePath)(B);I({url:"http"+(Dt.http?"":"s")+"://"+Dt.domain+(0,_.addBasePath)((U.locale===Dt.defaultLocale?"":"/"+U.locale)+(Kr==="/"?"":Kr)||"/"),router:this}),wn=!0}if(wn)return new Promise(()=>{})}d.ST&&performance.mark("routeChange");const{shallow:fe=!1,scroll:ye=!0}=ee,Ce={shallow:fe};this._inFlightRoute&&this.clc&&(re||G.events.emit("routeChangeError",K(),this._inFlightRoute,Ce),this.clc(),this.clc=null),B=(0,_.addBasePath)((0,v.addLocale)((0,E.hasBasePath)(B)?(0,C.removeBasePath)(B):B,ee.locale,this.defaultLocale));const Fe=(0,S.removeLocale)((0,E.hasBasePath)(B)?(0,C.removeBasePath)(B):B,U.locale);this._inFlightRoute=B;const Ve=V!==U.locale;if(!Z&&this.onlyAHashChange(Fe)&&!Ve){U.asPath=Fe,G.events.emit("hashChangeStart",B,Ce),this.changeState(X,W,B,{...ee,scroll:!1}),ye&&this.scrollToHash(Fe);try{await this.set(U,this.components[U.route],null)}catch(Ee){throw(0,a.default)(Ee)&&Ee.cancelled&&G.events.emit("routeChangeError",Ee,Fe,Ce),Ee}return G.events.emit("hashChangeComplete",B,Ce),!0}let q=(0,f.parseRelativeUrl)(W),{pathname:ae,query:ge}=q,Te,Oe;try{[Te,{__rewrites:Oe}]=await Promise.all([this.pageLoader.getPageList(),(0,o.getClientBuildManifest)(),this.pageLoader.getMiddleware()])}catch{return I({url:B,router:this}),!1}!this.urlIsNew(Fe)&&!Ve&&(X="replaceState");let Be=B;ae=ae&&(0,i.removeTrailingSlash)((0,C.removeBasePath)(ae));let Re=(0,i.removeTrailingSlash)(ae);const Xe=B.startsWith("/")&&(0,f.parseRelativeUrl)(B).pathname;if((we=this.components[ae])!=null&&we.__appRouter)return I({url:B,router:this}),new Promise(()=>{});const bn=!!(Xe&&Re!==Xe&&(!(0,h.isDynamicRoute)(Re)||!(0,g.getRouteMatcher)((0,m.getRouteRegex)(Re))(Xe))),rt=!ee.shallow&&await D({asPath:B,locale:U.locale,router:this});if(Z&&rt&&(Se=!1),Se&&ae!=="/_error")if(ee._shouldResolveHref=!0,process.env.__NEXT_HAS_REWRITES&&B.startsWith("/")){const Ee=(0,p.default)((0,_.addBasePath)((0,v.addLocale)(Fe,U.locale),!0),Te,Oe,ge,Xt=>oe(Xt,Te),this.locales);if(Ee.externalDest)return I({url:B,router:this}),!0;rt||(Be=Ee.asPath),Ee.matchedPage&&Ee.resolvedHref&&(ae=Ee.resolvedHref,q.pathname=(0,_.addBasePath)(ae),rt||(W=(0,y.formatWithValidation)(q)))}else q.pathname=oe(ae,Te),q.pathname!==ae&&(ae=q.pathname,q.pathname=(0,_.addBasePath)(ae),rt||(W=(0,y.formatWithValidation)(q)));if(!(0,M.isLocalURL)(B)){if(process.env.NODE_ENV!=="production")throw new Error('Invalid href: "'+W+'" and as: "'+B+`", received relative href and external as
34
+ See more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);return I({url:B,router:this}),!1}Be=(0,S.removeLocale)((0,C.removeBasePath)(Be),U.locale),Re=(0,i.removeTrailingSlash)(ae);let Ct=!1;if((0,h.isDynamicRoute)(Re)){const Ee=(0,f.parseRelativeUrl)(Be),Xt=Ee.pathname,wn=(0,m.getRouteRegex)(Re);Ct=(0,g.getRouteMatcher)(wn)(Xt);const Dt=Re===Xt,Kr=Dt?(0,$.interpolateAs)(Re,Xt,ge):{};if(!Ct||Dt&&!Kr.result){const Gr=Object.keys(wn.groups).filter(Pi=>!ge[Pi]&&!wn.groups[Pi].optional);if(Gr.length>0&&!rt)throw process.env.NODE_ENV!=="production"&&console.warn((Dt?"Interpolating href":"Mismatching `as` and `href`")+" failed to manually provide "+("the params: "+Gr.join(", ")+" in the `href`'s `query`")),new Error((Dt?"The provided `href` ("+W+") value is missing query values ("+Gr.join(", ")+") to be interpolated properly. ":"The provided `as` value ("+Xt+") is incompatible with the `href` value ("+Re+"). ")+("Read more: https://nextjs.org/docs/messages/"+(Dt?"href-interpolation-failed":"incompatible-href-as")))}else Dt?B=(0,y.formatWithValidation)(Object.assign({},Ee,{pathname:Kr.result,query:(0,z.omit)(ge,Kr.params)})):Object.assign(ge,Ct)}Z||G.events.emit("routeChangeStart",B,Ce);const Bn=this.pathname==="/404"||this.pathname==="/_error";try{var it,Vn,Mi;let Ee=await this.getRouteInfo({route:Re,pathname:ae,query:ge,as:B,resolvedAs:Be,routeProps:Ce,locale:U.locale,isPreview:U.isPreview,hasMiddleware:rt,unstable_skipClientCache:ee.unstable_skipClientCache,isQueryUpdating:Z&&!this.isFallback,isMiddlewareRewrite:bn});if(!Z&&!ee.shallow&&await this._bfl(B,"resolvedAs"in Ee?Ee.resolvedAs:void 0,U.locale),"route"in Ee&&rt){ae=Ee.route||Re,Re=ae,Ce.shallow||(ge=Object.assign({},Ee.query||{},ge));const pt=(0,E.hasBasePath)(q.pathname)?(0,C.removeBasePath)(q.pathname):q.pathname;if(Ct&&ae!==pt&&Object.keys(Ct).forEach(Bt=>{Ct&&ge[Bt]===Ct[Bt]&&delete ge[Bt]}),(0,h.isDynamicRoute)(ae)){let cr=!Ce.shallow&&Ee.resolvedAs?Ee.resolvedAs:(0,_.addBasePath)((0,v.addLocale)(new URL(B,location.href).pathname,U.locale),!0);if((0,E.hasBasePath)(cr)&&(cr=(0,C.removeBasePath)(cr)),process.env.__NEXT_I18N_SUPPORT){const Ug=(0,c.normalizeLocalePath)(cr,this.locales);U.locale=Ug.detectedLocale||U.locale,cr=Ug.pathname}const ru=(0,m.getRouteRegex)(ae),zg=(0,g.getRouteMatcher)(ru)(new URL(cr,location.href).pathname);zg&&Object.assign(ge,zg)}}if("type"in Ee)return Ee.type==="redirect-internal"?this.change(X,Ee.newUrl,Ee.newAs,ee):(I({url:Ee.destination,router:this}),new Promise(()=>{}));const Xt=Ee.Component;if(Xt&&Xt.unstable_scriptLoader&&[].concat(Xt.unstable_scriptLoader()).forEach(Bt=>{(0,s.handleClientScriptLoad)(Bt.props)}),(Ee.__N_SSG||Ee.__N_SSP)&&Ee.props){if(Ee.props.pageProps&&Ee.props.pageProps.__N_REDIRECT){ee.locale=!1;const pt=Ee.props.pageProps.__N_REDIRECT;if(pt.startsWith("/")&&Ee.props.pageProps.__N_REDIRECT_BASE_PATH!==!1){const Bt=(0,f.parseRelativeUrl)(pt);Bt.pathname=oe(Bt.pathname,Te);const{url:cr,as:ru}=se(this,pt,pt);return this.change(X,cr,ru,ee)}return I({url:pt,router:this}),new Promise(()=>{})}if(U.isPreview=!!Ee.props.__N_PREVIEW,Ee.props.notFound===L){let pt;try{await this.fetchComponent("/404"),pt="/404"}catch{pt="/_error"}if(Ee=await this.getRouteInfo({route:pt,pathname:pt,query:ge,as:B,resolvedAs:Be,routeProps:{shallow:!1},locale:U.locale,isPreview:U.isPreview,isNotFound:!0}),"type"in Ee)throw new Error("Unexpected middleware effect on /404")}}Z&&this.pathname==="/_error"&&((Vn=self.__NEXT_DATA__.props)==null||(it=Vn.pageProps)==null?void 0:it.statusCode)===500&&((Mi=Ee.props)!=null&&Mi.pageProps)&&(Ee.props.pageProps.statusCode=500);var Wr;const wn=ee.shallow&&U.route===((Wr=Ee.route)!=null?Wr:Re);var Hg;const Dt=(Hg=ee.scroll)!=null?Hg:!Z&&!wn,Gr=xe??(Dt?{x:0,y:0}:null),Pi={...U,route:Re,pathname:ae,query:ge,asPath:Fe,isFallback:!1};if(Z&&Bn){var $g,Bg,Vg;if(Ee=await this.getRouteInfo({route:this.pathname,pathname:this.pathname,query:ge,as:B,resolvedAs:Be,routeProps:{shallow:!1},locale:U.locale,isPreview:U.isPreview,isQueryUpdating:Z&&!this.isFallback}),"type"in Ee)throw new Error("Unexpected middleware effect on "+this.pathname);this.pathname==="/_error"&&((Bg=self.__NEXT_DATA__.props)==null||($g=Bg.pageProps)==null?void 0:$g.statusCode)===500&&((Vg=Ee.props)!=null&&Vg.pageProps)&&(Ee.props.pageProps.statusCode=500);try{await this.set(Pi,Ee,Gr)}catch(pt){throw(0,a.default)(pt)&&pt.cancelled&&G.events.emit("routeChangeError",pt,Fe,Ce),pt}return!0}if(G.events.emit("beforeHistoryChange",B,Ce),this.changeState(X,W,B,ee),!(Z&&!Gr&&!H&&!Ve&&(0,P.compareRouterStates)(Pi,this.state))){try{await this.set(Pi,Ee,Gr)}catch(Bt){if(Bt.cancelled)Ee.error=Ee.error||Bt;else throw Bt}if(Ee.error)throw Z||G.events.emit("routeChangeError",Ee.error,Fe,Ce),Ee.error;process.env.__NEXT_I18N_SUPPORT&&U.locale&&(document.documentElement.lang=U.locale),Z||G.events.emit("routeChangeComplete",B,Ce),Dt&&/#.+$/.test(B)&&this.scrollToHash(B)}return!0}catch(Ee){if((0,a.default)(Ee)&&Ee.cancelled)return!1;throw Ee}}changeState(X,W,B,ee){if(ee===void 0&&(ee={}),process.env.NODE_ENV!=="production"){if(typeof window.history>"u"){console.error("Warning: window.history is not available.");return}if(typeof window.history[X]>"u"){console.error("Warning: window.history."+X+" is not available");return}}(X!=="pushState"||(0,d.getURL)()!==B)&&(this._shallow=ee.shallow,window.history[X]({url:W,as:B,options:ee,__N:!0,key:this._key=X!=="pushState"?this._key:F()},"",B))}async handleRouteInfoError(X,W,B,ee,xe,we){if(console.error(X),X.cancelled)throw X;if((0,o.isAssetError)(X)||we)throw G.events.emit("routeChangeError",X,ee,xe),I({url:ee,router:this}),K();try{let Z;const{page:Se,styleSheets:U}=await this.fetchComponent("/_error"),H={props:Z,Component:Se,styleSheets:U,err:X,error:X};if(!H.props)try{H.props=await this.getInitialProps(Se,{err:X,pathname:W,query:B})}catch(re){console.error("Error in error page `getInitialProps`: ",re),H.props={}}return H}catch(Z){return this.handleRouteInfoError((0,a.default)(Z)?Z:new Error(Z+""),W,B,ee,xe,!0)}}async getRouteInfo(X){let{route:W,pathname:B,query:ee,as:xe,resolvedAs:we,routeProps:Z,locale:Se,hasMiddleware:U,isPreview:H,unstable_skipClientCache:re,isQueryUpdating:V,isMiddlewareRewrite:te,isNotFound:fe}=X,ye=W;try{var Ce,Fe,Ve,q;let ae=this.components[ye];if(Z.shallow&&ae&&this.route===ye)return ae;const ge=je({route:ye,router:this});U&&(ae=void 0);let Te=ae&&!("initial"in ae)&&process.env.NODE_ENV!=="development"?ae:void 0;const Oe=V,Be={dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:B,query:ee}),skipInterpolation:!0,asPath:fe?"/404":we,locale:Se}),hasMiddleware:!0,isServerRender:this.isSsr,parseJSON:!0,inflightCache:Oe?this.sbc:this.sdc,persistCache:!H,isPrefetch:!1,unstable_skipClientCache:re,isBackground:Oe};let Re=V&&!te?null:await ue({fetchData:()=>be(Be),asPath:fe?"/404":we,locale:Se,router:this}).catch(it=>{if(V)return null;throw it});if(Re&&(B==="/_error"||B==="/404")&&(Re.effect=void 0),V&&(Re?Re.json=self.__NEXT_DATA__.props:Re={json:self.__NEXT_DATA__.props}),ge(),(Re==null||(Ce=Re.effect)==null?void 0:Ce.type)==="redirect-internal"||(Re==null||(Fe=Re.effect)==null?void 0:Fe.type)==="redirect-external")return Re.effect;if((Re==null||(Ve=Re.effect)==null?void 0:Ve.type)==="rewrite"){const it=(0,i.removeTrailingSlash)(Re.effect.resolvedHref),Vn=await this.pageLoader.getPageList();if((!V||Vn.includes(it))&&(ye=it,B=Re.effect.resolvedHref,ee={...ee,...Re.effect.parsedAs.query},we=(0,C.removeBasePath)((0,c.normalizeLocalePath)(Re.effect.parsedAs.pathname,this.locales).pathname),ae=this.components[ye],Z.shallow&&ae&&this.route===ye&&!U))return{...ae,route:ye}}if((0,A.isAPIRoute)(ye))return I({url:xe,router:this}),new Promise(()=>{});const Xe=Te||await this.fetchComponent(ye).then(it=>({Component:it.page,styleSheets:it.styleSheets,__N_SSG:it.mod.__N_SSG,__N_SSP:it.mod.__N_SSP}));if(process.env.NODE_ENV!=="production"){const{isValidElementType:it}=tT();if(!it(Xe.Component))throw new Error('The default export is not a React Component in page: "'+B+'"')}const bn=Re==null||(q=Re.response)==null?void 0:q.headers.get("x-middleware-skip"),rt=Xe.__N_SSG||Xe.__N_SSP;bn&&(Re!=null&&Re.dataHref)&&delete this.sdc[Re.dataHref];const{props:Ct,cacheKey:Bn}=await this._getData(async()=>{if(rt){if(Re!=null&&Re.json&&!bn)return{cacheKey:Re.cacheKey,props:Re.json};const it=Re!=null&&Re.dataHref?Re.dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:B,query:ee}),asPath:we,locale:Se}),Vn=await be({dataHref:it,isServerRender:this.isSsr,parseJSON:!0,inflightCache:bn?{}:this.sdc,persistCache:!H,isPrefetch:!1,unstable_skipClientCache:re});return{cacheKey:Vn.cacheKey,props:Vn.json||{}}}return{headers:{},props:await this.getInitialProps(Xe.Component,{pathname:B,query:ee,asPath:xe,locale:Se,locales:this.locales,defaultLocale:this.defaultLocale})}});return Xe.__N_SSP&&Be.dataHref&&Bn&&delete this.sdc[Bn],!this.isPreview&&Xe.__N_SSG&&process.env.NODE_ENV!=="development"&&!V&&be(Object.assign({},Be,{isBackground:!0,persistCache:!1,inflightCache:this.sbc})).catch(()=>{}),Ct.pageProps=Object.assign({},Ct.pageProps),Xe.props=Ct,Xe.route=ye,Xe.query=ee,Xe.resolvedAs=we,this.components[ye]=Xe,Xe}catch(ae){return this.handleRouteInfoError((0,a.getProperError)(ae),B,ee,xe,Z)}}set(X,W,B){return this.state=X,this.sub(W,this.components["/_app"].Component,B)}beforePopState(X){this._bps=X}onlyAHashChange(X){if(!this.asPath)return!1;const[W,B]=this.asPath.split("#",2),[ee,xe]=X.split("#",2);return xe&&W===ee&&B===xe?!0:W!==ee?!1:B!==xe}scrollToHash(X){const[,W=""]=X.split("#",2);(0,J.handleSmoothScroll)(()=>{if(W===""||W==="top"){window.scrollTo(0,0);return}const B=decodeURIComponent(W),ee=document.getElementById(B);if(ee){ee.scrollIntoView();return}const xe=document.getElementsByName(B)[0];xe&&xe.scrollIntoView()},{onlyHashChange:this.onlyAHashChange(X)})}urlIsNew(X){return this.asPath!==X}async prefetch(X,W,B){if(W===void 0&&(W=X),B===void 0&&(B={}),process.env.NODE_ENV!=="production"||typeof window<"u"&&(0,j.isBot)(window.navigator.userAgent))return;let ee=(0,f.parseRelativeUrl)(X);const xe=ee.pathname;let{pathname:we,query:Z}=ee;const Se=we;if(process.env.__NEXT_I18N_SUPPORT&&B.locale===!1){we=(0,c.normalizeLocalePath)(we,this.locales).pathname,ee.pathname=we,X=(0,y.formatWithValidation)(ee);let ye=(0,f.parseRelativeUrl)(W);const Ce=(0,c.normalizeLocalePath)(ye.pathname,this.locales);ye.pathname=Ce.pathname,B.locale=Ce.detectedLocale||this.defaultLocale,W=(0,y.formatWithValidation)(ye)}const U=await this.pageLoader.getPageList();let H=W;const re=typeof B.locale<"u"?B.locale||void 0:this.locale,V=await D({asPath:W,locale:re,router:this});if(process.env.__NEXT_HAS_REWRITES&&W.startsWith("/")){let ye;({__rewrites:ye}=await(0,o.getClientBuildManifest)());const Ce=(0,p.default)((0,_.addBasePath)((0,v.addLocale)(W,this.locale),!0),U,ye,ee.query,Fe=>oe(Fe,U),this.locales);if(Ce.externalDest)return;V||(H=(0,S.removeLocale)((0,C.removeBasePath)(Ce.asPath),this.locale)),Ce.matchedPage&&Ce.resolvedHref&&(we=Ce.resolvedHref,ee.pathname=we,V||(X=(0,y.formatWithValidation)(ee)))}ee.pathname=oe(ee.pathname,U),(0,h.isDynamicRoute)(ee.pathname)&&(we=ee.pathname,ee.pathname=we,Object.assign(Z,(0,g.getRouteMatcher)((0,m.getRouteRegex)(ee.pathname))((0,w.parsePath)(W).pathname)||{}),V||(X=(0,y.formatWithValidation)(ee)));const te=process.env.__NEXT_MIDDLEWARE_PREFETCH==="strict"?null:await ue({fetchData:()=>be({dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:Se,query:Z}),skipInterpolation:!0,asPath:H,locale:re}),hasMiddleware:!0,isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0}),asPath:W,locale:re,router:this});if((te==null?void 0:te.effect.type)==="rewrite"&&(ee.pathname=te.effect.resolvedHref,we=te.effect.resolvedHref,Z={...Z,...te.effect.parsedAs.query},H=te.effect.parsedAs.pathname,X=(0,y.formatWithValidation)(ee)),(te==null?void 0:te.effect.type)==="redirect-external")return;const fe=(0,i.removeTrailingSlash)(we);await this._bfl(W,H,B.locale,!0)&&(this.components[xe]={__appRouter:!0}),await Promise.all([this.pageLoader._isSsg(fe).then(ye=>ye?be({dataHref:te!=null&&te.json?te==null?void 0:te.dataHref:this.pageLoader.getDataHref({href:X,asPath:H,locale:re}),isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0,unstable_skipClientCache:B.unstable_skipClientCache||B.priority&&!!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE}).then(()=>!1).catch(()=>!1):!1),this.pageLoader[B.priority?"loadPage":"prefetch"](fe)])}async fetchComponent(X){const W=je({route:X,router:this});try{const B=await this.pageLoader.loadPage(X);return W(),B}catch(B){throw W(),B}}_getData(X){let W=!1;const B=()=>{W=!0};return this.clc=B,X().then(ee=>{if(B===this.clc&&(this.clc=null),W){const xe=new Error("Loading initial props cancelled");throw xe.cancelled=!0,xe}return ee})}_getFlightData(X){return be({dataHref:X,isServerRender:!0,parseJSON:!1,inflightCache:this.sdc,persistCache:!1,isPrefetch:!1}).then(W=>{let{text:B}=W;return{data:B}})}getInitialProps(X,W){const{Component:B}=this.components["/_app"],ee=this._wrapApp(B);return W.AppTree=ee,(0,d.loadGetInitialProps)(B,{AppTree:ee,Component:X,router:this,ctx:W})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}constructor(X,W,B,{initialProps:ee,pageLoader:xe,App:we,wrapApp:Z,Component:Se,err:U,subscription:H,isFallback:re,locale:V,locales:te,defaultLocale:fe,domainLocales:ye,isPreview:Ce}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=F(),this.onPopState=q=>{const{isFirstPopStateEvent:ae}=this;this.isFirstPopStateEvent=!1;const ge=q.state;if(!ge){const{pathname:rt,query:Ct}=this;this.changeState("replaceState",(0,y.formatWithValidation)({pathname:(0,_.addBasePath)(rt),query:Ct}),(0,d.getURL)());return}if(ge.__NA){window.location.reload();return}if(!ge.__N||ae&&this.locale===ge.options.locale&&ge.as===this.asPath)return;let Te;const{url:Oe,as:Be,options:Re,key:Xe}=ge;if(process.env.__NEXT_SCROLL_RESTORATION&&pe&&this._key!==Xe){try{sessionStorage.setItem("__next_scroll_"+this._key,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}try{const rt=sessionStorage.getItem("__next_scroll_"+Xe);Te=JSON.parse(rt)}catch{Te={x:0,y:0}}}this._key=Xe;const{pathname:bn}=(0,f.parseRelativeUrl)(Oe);this.isSsr&&Be===(0,_.addBasePath)(this.asPath)&&bn===(0,_.addBasePath)(this.pathname)||this._bps&&!this._bps(ge)||this.change("replaceState",Oe,Be,Object.assign({},Re,{shallow:Re.shallow&&this._shallow,locale:Re.locale||this.defaultLocale,_h:0}),Te)};const Fe=(0,i.removeTrailingSlash)(X);if(this.components={},X!=="/_error"&&(this.components[Fe]={Component:Se,initial:!0,props:ee,err:U,__N_SSG:ee&&ee.__N_SSG,__N_SSP:ee&&ee.__N_SSP}),this.components["/_app"]={Component:we,styleSheets:[]},process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED){const{BloomFilter:q}=oT(),ae=process.env.__NEXT_CLIENT_ROUTER_S_FILTER,ge=ae||void 0,Te=process.env.__NEXT_CLIENT_ROUTER_D_FILTER,Oe=Te||void 0;ge!=null&&ge.numHashes&&(this._bfl_s=new q(ge.numItems,ge.errorRate),this._bfl_s.import(ge)),Oe!=null&&Oe.numHashes&&(this._bfl_d=new q(Oe.numItems,Oe.errorRate),this._bfl_d.import(Oe))}this.events=G.events,this.pageLoader=xe;const Ve=(0,h.isDynamicRoute)(X)&&self.__NEXT_DATA__.autoExport;if(this.basePath=process.env.__NEXT_ROUTER_BASEPATH||"",this.sub=H,this.clc=null,this._wrapApp=Z,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.isExperimentalCompile||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||!Ve&&!self.location.search&&!process.env.__NEXT_HAS_REWRITES),process.env.__NEXT_I18N_SUPPORT&&(this.locales=te,this.defaultLocale=fe,this.domainLocales=ye,this.isLocaleDomain=!!(0,x.detectDomainLocale)(ye,self.location.hostname)),this.state={route:Fe,pathname:X,query:W,asPath:Ve?X:B,isPreview:!!Ce,locale:process.env.__NEXT_I18N_SUPPORT?V:void 0,isFallback:re},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),typeof window<"u"){if(!B.startsWith("//")){const q={locale:V},ae=(0,d.getURL)();this._initialMatchesMiddlewarePromise=D({router:this,locale:V,asPath:ae}).then(ge=>(q._shouldResolveHref=B!==X,this.changeState("replaceState",ge?ae:(0,y.formatWithValidation)({pathname:(0,_.addBasePath)(X),query:W}),ae,q),ge))}window.addEventListener("popstate",this.onPopState),process.env.__NEXT_SCROLL_RESTORATION&&pe&&(window.history.scrollRestoration="manual")}}}G.events=(0,u.default)()}(Fu)),Fu}var ma={exports:{}},My;function aT(){return My||(My=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const n=Ps,r=ow();function i(o){function s(a){return(0,n.jsx)(o,{router:(0,r.useRouter)(),...a})}if(s.getInitialProps=o.getInitialProps,s.origGetInitialProps=o.origGetInitialProps,process.env.NODE_ENV!=="production"){const a=o.displayName||o.name||"Unknown";s.displayName="withRouter("+a+")"}return s}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ma,ma.exports)),ma.exports}var Py;function ow(){return Py||(Py=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(x,w){for(var v in w)Object.defineProperty(x,v,{enumerable:!0,get:w[v]})}n(e,{Router:function(){return o.default},createRouter:function(){return m},default:function(){return p},makePublicRouterInstance:function(){return y},useRouter:function(){return g},withRouter:function(){return l.default}});const r=Nt,i=r._(O),o=r._(sT()),s=ap(),a=r._(nw()),l=r._(aT()),c={router:null,readyCallbacks:[],ready(x){if(this.router)return x();typeof window<"u"&&this.readyCallbacks.push(x)}},u=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales"],d=["routeChangeStart","beforeHistoryChange","routeChangeComplete","routeChangeError","hashChangeStart","hashChangeComplete"],h=["push","replace","reload","back","prefetch","beforePopState"];Object.defineProperty(c,"events",{get(){return o.default.events}});function f(){if(!c.router){const x=`No router instance found.
35
+ You should only use "next/router" on the client side of your app.
36
+ `;throw new Error(x)}return c.router}u.forEach(x=>{Object.defineProperty(c,x,{get(){return f()[x]}})}),h.forEach(x=>{c[x]=function(){for(var w=arguments.length,v=new Array(w),S=0;S<w;S++)v[S]=arguments[S];return f()[x](...v)}}),d.forEach(x=>{c.ready(()=>{o.default.events.on(x,function(){for(var w=arguments.length,v=new Array(w),S=0;S<w;S++)v[S]=arguments[S];const C="on"+x.charAt(0).toUpperCase()+x.substring(1),_=c;if(_[C])try{_[C](...v)}catch(E){console.error("Error when running the Router event: "+C),console.error((0,a.default)(E)?E.message+`
37
+ `+E.stack:E+"")}})})});const p=c;function g(){const x=i.default.useContext(s.RouterContext);if(!x)throw new Error("NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted");return x}function m(){for(var x=arguments.length,w=new Array(x),v=0;v<x;v++)w[v]=arguments[v];return c.router=new o.default(...w),c.readyCallbacks.forEach(S=>S()),c.readyCallbacks=[],c.router}function y(x){const w=x,v={};for(const S of u){if(typeof w[S]=="object"){v[S]=Object.assign(Array.isArray(w[S])?[]:{},w[S]);continue}v[S]=w[S]}return v.events=o.default.events,h.forEach(S=>{v[S]=function(){for(var C=arguments.length,_=new Array(C),E=0;E<C;E++)_[E]=arguments[E];return w[S](..._)}}),v}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(aa,aa.exports)),aa.exports}ow();function lT({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:i=!1,required:o=!1,fullWidth:s,...a}){const l=a.name??"";return b.jsxs("div",{dflex:!0,flexCol:!0,...a,children:[t&&b.jsx(ar,{name:l,label:t,required:o}),b.jsx(Je.FastField,{name:l,children:({field:c,form:u})=>b.jsx(cT,{name:l,field:c,form:u,label:t,withFeedbackLabel:e,showCorrectFeedback:n,customFeedbackLabel:r,fullWidth:s,...a})})]})}function cT({name:t,field:e,form:n,label:r,withFeedbackLabel:i,showCorrectFeedback:o=!1,customFeedbackLabel:s,fullWidth:a,...l}){e.value==null&&console.warn(`Input: Value for field ${e.name} is null`);const[c,u]=O.useState(e.value),d=RO(c,300),{errors:h,touched:f}=n,{isError:p,isTouched:g,error:m}=$r(t,h,f),y={...l,...g&&p?{borderColor:"red"}:{}};return O.useEffect(()=>{n.setFieldValue(t,d)},[t,d,n]),b.jsxs(b.Fragment,{children:[b.jsx(N.Input,{w:a?"full":void 0,scheme:"default",lineHeight:"normal",transition:"all",...e,...y,value:c,onChange:x=>u(x.target.value)}),i&&b.jsx(Hr,{error:m,touched:g,label:r,customFeedbackLabel:s,showCorrectFeedback:o})]})}function Cc({children:t,...e}){return b.jsx("div",{dflex:!0,placeContent:"center",alignItems:"center",...e,children:t})}function Br({...t}){const e=O.useCallback(n=>{n.preventDefault(),n.stopPropagation()},[]);return b.jsx("div",{dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",py:"16",cursor:"not-allowed",onClick:e,...t,children:b.jsx(N.Spinner,{size:"x2"})})}function js(){return b.jsx(Br,{bgColor:"black",bgOpacity:"30",position:"absolute",top:"0",start:"0",bottom:"0",w:"100%",h:"100%"})}const uT="Oops, something went wrong!";function _i({label:t,onClick:e,...n}){const r=O.useCallback(i=>{i.preventDefault(),i.stopPropagation()},[]);return b.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",w:"full",h:"full",onClick:r,children:b.jsxs(N.Tile,{scheme:"danger",variant:"light",p:"10",textAlign:"center",children:[b.jsx("div",{textSize:"lg",fontWeight:"600",children:t??uT}),b.jsx(N.Button,{mt:"5",onClick:e,scheme:"danger",children:"Retry"})]})})}var gt={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let dT=0;function Iy(t,e){const n=`atom${++dT}`,r={toString:()=>n};return typeof t=="function"?r.read=t:(r.init=t,r.read=i=>i(r),r.write=(i,o,s)=>o(r,typeof s=="function"?s(i(r)):s)),e&&(r.write=e),r}const dd=t=>"init"in t,fd=t=>!!t.write,sl=new WeakMap,fT=(t,e)=>{sl.set(t,e),t.catch(()=>{}).finally(()=>sl.delete(t))},Ly=(t,e)=>{const n=sl.get(t);n&&(sl.delete(t),n(e))},Dy=(t,e)=>{t.status="fulfilled",t.value=e},Ny=(t,e)=>{t.status="rejected",t.reason=e},hT=t=>typeof(t==null?void 0:t.then)=="function",ya=(t,e)=>"v"in t&&"v"in e&&Object.is(t.v,e.v),jy=(t,e)=>"e"in t&&"e"in e&&Object.is(t.e,e.e),To=t=>"v"in t&&t.v instanceof Promise,pT=(t,e)=>"v"in t&&"v"in e&&t.v.orig&&t.v.orig===e.v.orig,va=t=>{if("e"in t)throw t.e;return t.v},gT=()=>{const t=new WeakMap,e=new WeakMap,n=new Map;let r,i;(gt?"production":void 0)!=="production"&&(r=new Set,i=new Set);const o=E=>t.get(E),s=(E,R)=>{(gt?"production":void 0)!=="production"&&Object.freeze(R);const A=t.get(E);if(t.set(E,R),n.has(E)||n.set(E,A),A&&To(A)){const T="v"in R?R.v instanceof Promise?R.v:Promise.resolve(R.v):Promise.reject(R.e);Ly(A.v,T)}},a=(E,R,A)=>{const T=new Map;let k=!1;A.forEach((P,M)=>{!P&&M===E&&(P=R),P?(T.set(M,P),R.d.get(M)!==P&&(k=!0)):(gt?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(k||R.d.size!==T.size)&&(R.d=T)},l=(E,R,A)=>{const T=o(E),k={d:(T==null?void 0:T.d)||new Map,v:R};if(A&&a(E,k,A),T&&ya(T,k)&&T.d===k.d)return T;if(T&&To(T)&&To(k)&&pT(T,k)){if(T.d===k.d)return T;k.v=T.v}return s(E,k),k},c=(E,R,A,T)=>{if(hT(R)){let k;const P=new Promise((M,j)=>{let z=!1;R.then($=>{if(!z){z=!0;const J=o(E),K=l(E,P,A);Dy(P,$),M($),(J==null?void 0:J.d)!==K.d&&S(E,K,J==null?void 0:J.d)}},$=>{if(!z){z=!0;const J=o(E),K=l(E,P,A);Ny(P,$),j($),(J==null?void 0:J.d)!==K.d&&S(E,K,J==null?void 0:J.d)}}),k=$=>{z||(z=!0,$.then(J=>Dy(P,J),J=>Ny(P,J)),M($))}});return P.orig=R,P.status="pending",fT(P,M=>{M&&k(M),T==null||T()}),l(E,P,A)}return l(E,R,A)},u=(E,R,A)=>{const T=o(E),k={d:(T==null?void 0:T.d)||new Map,e:R};return A&&a(E,k,A),T&&jy(T,k)&&T.d===k.d?T:(s(E,k),k)},d=(E,R)=>{const A=o(E);if(!R&&A&&(e.has(E)||Array.from(A.d).every(([$,J])=>$===E||d($)===J)))return A;const T=new Map;let k=!0;const P=$=>{if($===E){const K=o($);if(K)return T.set($,K),va(K);if(dd($))return T.set($,void 0),$.init;throw new Error("no atom init")}const J=d($);return T.set($,J),va(J)};let M,j;const z={get signal(){return M||(M=new AbortController),M.signal},get setSelf(){return(gt?"production":void 0)!=="production"&&!fd(E)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&fd(E)&&(j=(...$)=>{if((gt?"production":void 0)!=="production"&&k&&console.warn("setSelf function cannot be called in sync"),!k)return x(E,...$)}),j}};try{const $=E.read(P,z);return c(E,$,T,()=>M==null?void 0:M.abort())}catch($){return u(E,$,T)}finally{k=!1}},h=E=>va(d(E)),f=E=>{let R=e.get(E);return R||(R=w(E)),R},p=(E,R)=>!R.l.size&&(!R.t.size||R.t.size===1&&R.t.has(E)),g=E=>{const R=e.get(E);R&&p(E,R)&&v(E)},m=E=>{const R=new Map,A=new WeakMap,T=P=>{const M=e.get(P);M==null||M.t.forEach(j=>{j!==P&&(R.set(j,(R.get(j)||new Set).add(P)),A.set(j,(A.get(j)||0)+1),T(j))})};T(E);const k=P=>{const M=e.get(P);M==null||M.t.forEach(j=>{var z;if(j!==P){let $=A.get(j);if($&&A.set(j,--$),!$){let J=!!((z=R.get(j))!=null&&z.size);if(J){const K=o(j),D=d(j,!0);J=!K||!ya(K,D)}J||R.forEach(K=>K.delete(j))}k(j)}})};k(E)},y=(E,...R)=>{let A=!0;const T=M=>va(d(M)),k=(M,...j)=>{let z;if(M===E){if(!dd(M))throw new Error("atom not writable");const $=o(M),J=c(M,j[0]);(!$||!ya($,J))&&m(M)}else z=y(M,...j);if(!A){const $=C();(gt?"production":void 0)!=="production"&&r.forEach(J=>J({type:"async-write",flushed:$}))}return z},P=E.write(T,k,...R);return A=!1,P},x=(E,...R)=>{const A=y(E,...R),T=C();return(gt?"production":void 0)!=="production"&&r.forEach(k=>k({type:"write",flushed:T})),A},w=(E,R)=>{var A;(A=o(E))==null||A.d.forEach((k,P)=>{const M=e.get(P);M?M.t.add(E):P!==E&&w(P,E)}),d(E);const T={t:new Set(R&&[R]),l:new Set};if(e.set(E,T),(gt?"production":void 0)!=="production"&&i.add(E),fd(E)&&E.onMount){const k=E.onMount((...P)=>x(E,...P));k&&(T.u=k)}return T},v=E=>{var R;const A=(R=e.get(E))==null?void 0:R.u;A&&A(),e.delete(E),(gt?"production":void 0)!=="production"&&i.delete(E);const T=o(E);T?(To(T)&&Ly(T.v),T.d.forEach((k,P)=>{if(P!==E){const M=e.get(P);M&&(M.t.delete(E),p(P,M)&&v(P))}})):(gt?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",E)},S=(E,R,A)=>{const T=new Set(R.d.keys());A==null||A.forEach((k,P)=>{if(T.has(P)){T.delete(P);return}const M=e.get(P);M&&(M.t.delete(E),p(P,M)&&v(P))}),T.forEach(k=>{const P=e.get(k);P?P.t.add(E):e.has(E)&&w(k,E)})},C=()=>{let E;for((gt?"production":void 0)!=="production"&&(E=new Set);n.size;){const R=Array.from(n);n.clear(),R.forEach(([A,T])=>{const k=o(A);if(k){k.d!==(T==null?void 0:T.d)&&S(A,k,T==null?void 0:T.d);const P=e.get(A);P&&!(T&&!To(T)&&(ya(T,k)||jy(T,k)))&&(P.l.forEach(M=>M()),(gt?"production":void 0)!=="production"&&E.add(A))}else(gt?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((gt?"production":void 0)!=="production")return E},_=(E,R)=>{const A=f(E),T=C(),k=A.l;return k.add(R),(gt?"production":void 0)!=="production"&&r.forEach(P=>P({type:"sub",flushed:T})),()=>{k.delete(R),g(E),(gt?"production":void 0)!=="production"&&r.forEach(P=>P({type:"unsub"}))}};return(gt?"production":void 0)!=="production"?{get:h,set:x,sub:_,dev_subscribe_store:(E,R)=>{if(R!==2)throw new Error("The current StoreListener revision is 2.");return r.add(E),()=>{r.delete(E)}},dev_get_mounted_atoms:()=>i.values(),dev_get_atom_state:E=>t.get(E),dev_get_mounted:E=>e.get(E),dev_restore_atoms:E=>{for(const[A,T]of E)dd(A)&&(c(A,T),m(A));const R=C();r.forEach(A=>A({type:"restore",flushed:R}))}}:{get:h,set:x,sub:_}};let hd;(gt?"production":void 0)!=="production"&&(typeof globalThis.__NUMBER_OF_JOTAI_INSTANCES__=="number"?++globalThis.__NUMBER_OF_JOTAI_INSTANCES__:globalThis.__NUMBER_OF_JOTAI_INSTANCES__=1);const mT=()=>(hd||((gt?"production":void 0)!=="production"&&globalThis.__NUMBER_OF_JOTAI_INSTANCES__!==1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"),hd=gT()),hd);var yT={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const vT=O.createContext(void 0),sw=t=>{const e=O.useContext(vT);return(t==null?void 0:t.store)||e||mT()},bT=t=>typeof(t==null?void 0:t.then)=="function",wT=O.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)});function ST(t,e){const n=sw(e),[[r,i,o],s]=O.useReducer(c=>{const u=n.get(t);return Object.is(c[0],u)&&c[1]===n&&c[2]===t?c:[u,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;(i!==n||o!==t)&&(s(),a=n.get(t));const l=e==null?void 0:e.delay;return O.useEffect(()=>{const c=n.sub(t,()=>{if(typeof l=="number"){setTimeout(s,l);return}s()});return s(),c},[n,t,l]),O.useDebugValue(a),bT(a)?wT(a):a}function xT(t,e){const n=sw(e);return O.useCallback((...i)=>{if((yT?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...i)},[n,t])}function CT(t,e){return[ST(t,e),xT(t,e)]}var ET={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const _T=Symbol(),RT=t=>typeof(t==null?void 0:t.then)=="function";function AT(t){let e,n;const r={getItem:(i,o)=>{var s,a;const l=u=>{if(u=u||"",e!==u){try{n=JSON.parse(u)}catch{return o}e=u}return n},c=(a=(s=t())==null?void 0:s.getItem(i))!=null?a:null;return RT(c)?c.then(l):l(c)},setItem:(i,o)=>{var s;return(s=t())==null?void 0:s.setItem(i,JSON.stringify(o))},removeItem:i=>{var o;return(o=t())==null?void 0:o.removeItem(i)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(r.subscribe=(i,o,s)=>{if(!(t()instanceof window.Storage))return()=>{};const a=l=>{if(l.storageArea===t()&&l.key===i){let c;try{c=JSON.parse(l.newValue||"")}catch{c=s}o(c)}};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}}),r}const OT=AT(()=>typeof window<"u"?window.localStorage:void 0);function TT(t,e,n=OT,r){const i=r==null?void 0:r.unstable_getOnInit,o=Iy(i?n.getItem(t,e):e);return(ET?"production":void 0)!=="production"&&(o.debugPrivate=!0),o.onMount=a=>{i||a(n.getItem(t,e));let l;return n.subscribe&&(l=n.subscribe(t,a,e)),l},Iy(a=>a(o),(a,l,c)=>{const u=typeof c=="function"?c(a(o)):c;return u===_T?(l(o,e),n.removeItem(t)):u instanceof Promise?u.then(d=>(l(o,d),n.setItem(t,d))):(l(o,u),n.setItem(t,u))})}function kT({tabs:t,initialTabIndex:e=0,saveKey:n,onChange:r,children:i,lazy:o=!1,tabStyle:s="buttons",...a}){const l=O.useMemo(()=>TT(n??"",e),[n]),[c,u]=CT(l),d=O.useCallback(h=>{u(h),r==null||r(h)},[u,r]);return b.jsxs("div",{children:[s==="google"&&b.jsx("div",{borderColor:"brand",borderB:"px",px:"5",children:t.map((h,f)=>b.jsxs(N.Button,{size:"md",rounded:"0",roundedT:"lg",flex:"1",px:"5",variant:"borderless",position:"relative",transition:"none",onClick:()=>d(f),children:[h,b.jsx("div",{bgColor:"brand",position:"absolute",bottom:"0",start:"0",end:"0",h:"1",opacity:c===f?"100 ":"0",transition:"opacity",duration:"300",easing:"in"})]},h))}),s==="buttons"&&b.jsx(N.Tile,{dflex:!0,flexRow:!0,gap:"2",mb:"5",scheme:"light",p:"1.5",w:"auto",children:t.map((h,f)=>b.jsx(N.Button,{size:"lg",scheme:c==f?"default":"neutral",hover_scheme:"default",flex:"1",variant:c==f?"default":"borderless",onClick:()=>d(f),children:h},h))}),!o&&i.map((h,f)=>b.jsx("div",{hidden:c!=f,children:h},f)),o&&i&&i.length>=c+1&&i[c]]})}function MT(t,e,n){var r=this,i=O.useRef(null),o=O.useRef(0),s=O.useRef(null),a=O.useRef([]),l=O.useRef(),c=O.useRef(),u=O.useRef(t),d=O.useRef(!0);O.useEffect(function(){u.current=t},[t]);var h=!e&&e!==0&&typeof window<"u";if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var f=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,g="maxWait"in n,m=g?Math.max(+n.maxWait||0,e):null;O.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var y=O.useMemo(function(){var x=function(E){var R=a.current,A=l.current;return a.current=l.current=null,o.current=E,c.current=u.current.apply(A,R)},w=function(E,R){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(E):setTimeout(E,R)},v=function(E){if(!d.current)return!1;var R=E-i.current;return!i.current||R>=e||R<0||g&&E-o.current>=m},S=function(E){return s.current=null,p&&a.current?x(E):(a.current=l.current=null,c.current)},C=function E(){var R=Date.now();if(v(R))return S(R);if(d.current){var A=e-(R-i.current),T=g?Math.min(A,m-(R-o.current)):A;w(E,T)}},_=function(){var E=Date.now(),R=v(E);if(a.current=[].slice.call(arguments),l.current=r,i.current=E,R){if(!s.current&&d.current)return o.current=i.current,w(C,e),f?x(i.current):c.current;if(g)return w(C,e),x(i.current)}return s.current||w(C,e),c.current};return _.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),o.current=0,a.current=i.current=l.current=s.current=null},_.isPending=function(){return!!s.current},_.flush=function(){return s.current?S(Date.now()):c.current},_},[f,g,e,m,p,h]);return y}function PT({api:t,name:e,apiResultIdProp:n,apiResultLabelProp:r,searchKey:i,...o}){const{values:s,setFieldValue:a}=Je.useFormikContext(),[l,c]=O.useState(!1),[u,d]=O.useState(""),[h,f]=O.useState(!1),p=N.useFirstRender(),g=s[e],{data:m,isError:y}=Pn(t.queryKey,t.get,g,{enabled:p}),{data:x,isFetching:w,isError:v}=Pn(t.queryKey,t.getAll,{[i??"title"]:u},{enabled:u!=""}),S=mo(t.queryKey),C=MT(k=>d(k),300),_=O.useCallback(k=>{C(k.target.value),a(`${e}-label`,k.target.value),f(!1),c(!0)},[C,f]),E=O.useCallback(k=>{a(e,k[n??"id"]),a(`${e}-label`,k[r??"title"]),f(!0),c(!1)},[a]),R=O.useCallback(()=>c(!1),[c]);O.useEffect(()=>{m&&(a(`${e}-label`,m[r??"title"]),f(!0)),y&&(a(`${e}-label`,"Couldn't find object"),f(!0))},[m,y]);const A=l&&!h&&(w||v||x!=null),T=r??"title";return b.jsxs(N.Popup,{show:A,position:"relative",side:"bottom-start",modal:!0,onHide:R,children:[b.jsx("div",{children:b.jsx(yp,{name:`${e}-label`,onChange:_,...o,autoComplete:"off"})}),b.jsxs("div",{maxH:"64",minW:"48",bgColor:"white",overflowY:"auto",z:"9999",border:"0.5",borderColor:"slate-100",rounded:!0,children:[w&&b.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",w:"full",py:"2",children:b.jsx(N.Spinner,{})}),v&&b.jsx(_i,{w:"full",onClick:()=>S()}),x==null?void 0:x.sort((k,P)=>k[T].localeCompare(P[T])).map((k,P)=>b.jsx("div",{px:"5",py:"2",cursor:"pointer",hover_bgColor:"slate-100",onClick:()=>E(k),children:k[r??"title"]},P)),!w&&!v&&x!=null&&x.length===0&&b.jsx("div",{px:"5",py:"2",children:"No result"})]})]})}const wp=O.memo(function({form:e,extensions:n}){return e.map((r,i)=>{if(!r){console.warn("Form Renderer: you have an undefined item",r);return}const o=pd(r,i);if(o)return o;switch(r.type){case"twoColSection":return b.jsx(pO,{children:r.children.map((s,a)=>pd(s,a))},i);case"row":return b.jsx(SO,{children:r.children.map((s,a)=>pd(s,a,!1))},i);case"hidden":return b.jsx(oO,{name:r.name,value:r.value},i);case"resetField":return b.jsx(uO,{field:r.resetKey,onChangeField:r.onChangeKey,resetValue:r.resetValue},i);case"sectionHeader":return b.jsx(dO,{label:r.label},i);case"condition":return b.jsx(mO,{field:r.field,condition:r.condition,form:r.form,extensions:n},i);case"dependsOnValue":return b.jsx(yO,{field:r.field,form:r.form},i);case"rating":return b.jsx(vO,{name:r.name,label:r.label,required:r.required},i);case"groupHeader":return b.jsx(wO,{title:r.title,divider:r.divider},i);case"inputArray":return b.jsx(xO,{...r},i??r.name);case"textArray":return b.jsx(CO,{...r},i??r.name);case"cardRadio":return b.jsx(_O,{...r},i??r.name);case"divider":return b.jsx("div",{my:"3",h:"px",bgColor:"slate-200",w:"full"},i);case"autocomplete":return b.jsx(PT,{...r},i??r.name)}return n&&n[r.type]?n[r.type](r,i):(console.warn("FormRenderer element not found: ",r.type),null)}).filter(r=>r!=null)});function pd(t,e,n=!0){var r;switch(t.type){case"input":{const i={...t};return delete i.type,delete i.inputType,b.jsx(yp,{type:t.inputType??"text",fullWidth:n,...i},e??t.name)}case"debouncedInput":{const i={...t};return delete i.type,delete i.inputType,b.jsx(lT,{type:t.inputType??"text",fullWidth:n,...i},e??t.name)}case"text":return b.jsx(vp,{...t},e??t.name);case"select":{const{provider:i,idField:o,keyField:s,valueField:a,...l}=t;return b.jsx(fO,{fullWidth:n,...l,children:i==null?void 0:i.map(c=>b.jsx("option",{value:c[o??"id"],children:c[a??"label"]},c[s??o??"id"]))},e??t.name)}case"checklist":return b.jsx(rO,{name:t.name,label:t.label,required:t.required,options:((r=t.provider)==null?void 0:r.map(i=>({id:i[t.valueField??"id"],label:i[t.labelField??"label"]})))??[]},e??t.name);case"checkbox":return b.jsx(Zb,{...t},e??t.name);case"switch":return b.jsx(hO,{...t,type:"checkbox"},e??t.name);case"custom":return b.jsxs("div",{dflex:!0,flexCol:!0,children:[t.label&&b.jsx(ar,{name:t.name,label:t.label}),$e.isFunction(t.render)?t.render(t.name):t.render]},e);case"hFillSpace":return b.jsx("div",{flexGrow:!0},e)}return null}function mi({form:t,extensions:e,...n}){return b.jsx(xA,{...n,children:b.jsx(wp,{form:t,extensions:e})})}const Fy={array:IT,cardRadio:LT,checkbox:KT,checklist:QT,color:DT,condition:NT,custom:ZT,date:qT,datetime:WT,debouncedInput:BT,dependsOnValue:jT,groupHeader:ok,hFillSpace:ek,hidden:tk,input:$T,inputArray:VT,row:HT,number:UT,rating:ik,reset:nk,select:YT,sectionHeader:rk,switch:GT,text:JT,textArray:XT,twoColSection:FT,url:zT};function IT(...t){return t}function LT(t,e,n,r){return{type:"cardRadio",name:t,label:e,provider:n,required:r}}function DT(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r,inputType:"color"}}function NT(t,e,n){return{type:"condition",field:t,condition:e,form:n}}function jT(t,e){return{type:"dependsOnValue",field:t,form:e}}function FT(t,e){return{type:"twoColSection",children:[t,e]}}function HT(...t){return{type:"row",children:t}}function $T(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r}}function BT(t,e,n,r){return{type:"debouncedInput",name:t,label:e,required:n,placeholder:r}}function VT(t,e,n,r,i){return{type:"inputArray",name:t,label:e,required:n,placeholder:r,addItemLabel:i}}function zT(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r,inputType:"url"}}function UT(t,e,n,r,i,o){return{type:"input",name:t,label:e,required:i,placeholder:o,min:n,max:r,inputType:"number"}}function qT(t,e,n,r,i,o){return{type:"input",name:t,label:e,required:i,placeholder:o,min:n,max:r,inputType:"date"}}function WT(t,e,n,r,i,o){return typeof n=="string"?{type:"input",inputType:"datetime-local",name:t,label:e,min:n,max:r,required:i,placeholder:o}:{type:"input",inputType:"datetime-local",name:t,label:e,...n}}function KT(t,e,n){return typeof n=="boolean"?{type:"checkbox",name:t,label:e,required:n}:{type:"checkbox",name:t,label:e,...n}}function GT(t,e,n){return{type:"switch",name:t,label:e,required:n}}function JT(t,e,n,r){return{type:"text",name:t,label:e,rows:n,required:r}}function XT(t,e,n,r,i){return{type:"textArray",name:t,label:e,rows:n,required:r,addItemLabel:i}}function YT(t,e,n,r,i,o,s,a){return typeof s=="boolean"?{type:"select",name:t,label:e,provider:n,keyField:o,idField:r,valueField:i,required:s,placeholder:a}:{type:"select",name:t,label:e,provider:n,keyField:o,idField:r,valueField:i,...s}}function QT(t,e,n,r,i,o){return{type:"checklist",name:t,label:e,provider:n,labelField:r,valueField:i,required:o}}function ZT(t,e,n){return{type:"custom",name:t,label:e,render:n}}function ek(){return{type:"hFillSpace"}}function tk(t,e){return{type:"hidden",name:t,value:e}}function nk(t,e,n){return{type:"resetField",resetKey:t,onChangeKey:e,resetValue:n}}function rk(t){return{type:"sectionHeader",label:t}}function ik(t,e,n){return{type:"rating",name:t,label:e,required:n}}function ok(t,e){return{type:"groupHeader",title:t,divider:e}}function sk(){const{isValid:t,values:e,dirty:n,submitForm:r}=Je.useFormikContext();return O.useEffect(()=>{t&&n&&r()},[t,e,n,r]),null}function ak(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function Sp({initialValues:t,autoSubmitOnChange:e,children:n,...r}){return b.jsx(Je.Formik,{initialValues:ak(t),...r,children:b.jsxs(b.Fragment,{children:[e&&b.jsx(sk,{}),Qb(n)?b.jsx(b.Fragment,{children:n}):n]})})}function aw({useDirty:t,disabled:e,...n}){const{dirty:r,handleSubmit:i}=Je.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}},o=O.useCallback(()=>i(),[i]);return b.jsx(N.Button,{disabled:t&&!r||e,onClick:o,...n})}function Hf(){return Hf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hf.apply(this,arguments)}var lw=["shift","alt","meta","mod","ctrl"],lk={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Sr(t){return(lk[t]||t).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function ck(t){return lw.includes(t)}function gd(t,e){return e===void 0&&(e=","),t.split(e)}function md(t,e,n){e===void 0&&(e="+");var r=t.toLocaleLowerCase().split(e).map(function(s){return Sr(s)}),i={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},o=r.filter(function(s){return!lw.includes(s)});return Hf({},i,{keys:o,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(t){t.key!==void 0&&cw([Sr(t.key),Sr(t.code)])}),document.addEventListener("keyup",function(t){t.key!==void 0&&uw([Sr(t.key),Sr(t.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){xr.clear()})})();var xr=new Set;function xp(t){return Array.isArray(t)}function uk(t,e){e===void 0&&(e=",");var n=xp(t)?t:t.split(e);return n.every(function(r){return xr.has(r.trim().toLowerCase())})}function cw(t){var e=Array.isArray(t)?t:[t];xr.has("meta")&&xr.forEach(function(n){return!ck(n)&&xr.delete(n.toLowerCase())}),e.forEach(function(n){return xr.add(n.toLowerCase())})}function uw(t){var e=Array.isArray(t)?t:[t];t==="meta"?xr.clear():e.forEach(function(n){return xr.delete(n.toLowerCase())})}function dk(t,e,n){(typeof n=="function"&&n(t,e)||n===!0)&&t.preventDefault()}function fk(t,e,n){return typeof n=="function"?n(t,e):n===!0||n===void 0}function hk(t){return dw(t,["input","textarea","select"])}function dw(t,e){var n=t.target;e===void 0&&(e=!1);var r=n&&n.tagName;return xp(e)?!!(r&&e&&e.some(function(i){return i.toLowerCase()===r.toLowerCase()})):!!(r&&e&&e===!0)}function pk(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):e?t.some(function(n){return e.includes(n)})||t.includes("*"):!0}var gk=function(e,n,r){r===void 0&&(r=!1);var i=n.alt,o=n.meta,s=n.mod,a=n.shift,l=n.ctrl,c=n.keys,u=e.key,d=e.code,h=e.ctrlKey,f=e.metaKey,p=e.shiftKey,g=e.altKey,m=Sr(d),y=u.toLowerCase();if(!(c!=null&&c.includes(m))&&!(c!=null&&c.includes(y))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(m))return!1;if(!r){if(i===!g&&y!=="alt"||a===!p&&y!=="shift")return!1;if(s){if(!f&&!h)return!1}else if(o===!f&&y!=="meta"&&y!=="os"||l===!h&&y!=="ctrl"&&y!=="control")return!1}return c&&c.length===1&&(c.includes(y)||c.includes(m))?!0:c?uk(c):!c},mk=O.createContext(void 0),yk=function(){return O.useContext(mk)};function fw(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce(function(n,r){return n&&fw(t[r],e[r])},!0):t===e}var vk=O.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),bk=function(){return O.useContext(vk)};function wk(t){var e=O.useRef(void 0);return fw(e.current,t)||(e.current=t),e.current}var Hy=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Sk=typeof window<"u"?O.useLayoutEffect:O.useEffect;function hw(t,e,n,r){var i=O.useRef(null),o=O.useRef(!1),s=n instanceof Array?r instanceof Array?void 0:r:n,a=xp(t)?t.join(s==null?void 0:s.splitKey):t,l=n instanceof Array?n:r instanceof Array?r:void 0,c=O.useCallback(e,l??[]),u=O.useRef(c);l?u.current=c:u.current=e;var d=wk(s),h=bk(),f=h.enabledScopes,p=yk();return Sk(function(){if(!((d==null?void 0:d.enabled)===!1||!pk(f,d==null?void 0:d.scopes))){var g=function(v,S){var C;if(S===void 0&&(S=!1),!(hk(v)&&!dw(v,d==null?void 0:d.enableOnFormTags))){if(i.current!==null){var _=i.current.getRootNode();if((_ instanceof Document||_ instanceof ShadowRoot)&&_.activeElement!==i.current&&!i.current.contains(_.activeElement)){Hy(v);return}}(C=v.target)!=null&&C.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||gd(a,d==null?void 0:d.splitKey).forEach(function(E){var R,A=md(E,d==null?void 0:d.combinationKey);if(gk(v,A,d==null?void 0:d.ignoreModifiers)||(R=A.keys)!=null&&R.includes("*")){if(d!=null&&d.ignoreEventWhen!=null&&d.ignoreEventWhen(v)||S&&o.current)return;if(dk(v,A,d==null?void 0:d.preventDefault),!fk(v,A,d==null?void 0:d.enabled)){Hy(v);return}u.current(v,A),S||(o.current=!0)}})}},m=function(v){v.key!==void 0&&(cw(Sr(v.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&g(v))},y=function(v){v.key!==void 0&&(uw(Sr(v.code)),o.current=!1,d!=null&&d.keyup&&g(v,!0))},x=i.current||(s==null?void 0:s.document)||document;return x.addEventListener("keyup",y),x.addEventListener("keydown",m),p&&gd(a,d==null?void 0:d.splitKey).forEach(function(w){return p.addHotkey(md(w,d==null?void 0:d.combinationKey,d==null?void 0:d.description))}),function(){x.removeEventListener("keyup",y),x.removeEventListener("keydown",m),p&&gd(a,d==null?void 0:d.splitKey).forEach(function(w){return p.removeHotkey(md(w,d==null?void 0:d.combinationKey,d==null?void 0:d.description))})}}},[a,d,f]),i}function pw({...t}){const{dirty:e,handleSubmit:n}=Je.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}};return hw("ctrl+s",()=>{e&&!t.disabled&&n()},{preventDefault:!0},[e,t,n]),b.jsxs(aw,{type:"submit",corners:"pill",px:"4",dflex:!0,alignItems:"center",gap:"3",...t,children:[b.jsx(N.Icon,{path:s_}),"Update"]})}function gw({path:t,icon:e,...n}){const r=O.useCallback(()=>{window.open(t,"_blank")},[t]);return b.jsx(N.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...n,children:b.jsx(N.Icon,{path:e??tp})})}function xk({api:t,postId:e,order:n}){const r=If(t.moveDown,t.queryKey),i=If(t.moveUp,t.queryKey),o=O.useCallback(a=>{a.stopPropagation(),r.mutateAsync(e).catch(l=>{Ie.error(`Error: ${l}`)})},[r,e]),s=O.useCallback(a=>{a.stopPropagation(),i.mutateAsync(e).catch(l=>{Ie.error(`Error: ${l}`)})},[i,e]);return b.jsxs(Cc,{placeContent:"start",numericFontVariant:"tabular-nums",children:[n,b.jsx(N.Button,{ms:"3",variant:"borderless",scheme:"dark",onClick:s,children:b.jsx(N.Icon,{path:ZE})}),b.jsx(N.Button,{variant:"borderless",scheme:"dark",onClick:o,children:b.jsx(N.Icon,{path:QE})})]})}function Ec({children:t,...e}){return b.jsx(N.Container,{center:!0,dflex:!0,flexCol:!0,gap:"8",...e,children:t})}function Et(t){this.content=t}Et.prototype={constructor:Et,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new Et(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Et(n)},addToStart:function(t,e){return new Et([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Et(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new Et(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Et.from(t),t.size?new Et(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Et.from(t),t.size?new Et(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Et.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Et.from=function(t){if(t instanceof Et)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Et(e)};function mw(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=mw(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function yw(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=yw(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class le{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new le(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new le(r,i)}cutByIndex(e,n){return e==n?le.empty:e==0&&n==this.content.length?this:new le(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new le(i,o)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return mw(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return yw(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ba(0,e);if(e==this.size)return ba(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ba(r+1,s):ba(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return le.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new le(n||e,r)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const yd={index:0,offset:0};function ba(t,e){return yd.index=t,yd.offset=e,yd}function al(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!al(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!al(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Qe=class $f{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&al(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $f.none;if(e instanceof $f)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Qe.none=[];class ll extends Error{}class ve{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=bw(this.content,e+this.openStart,n);return r&&new ve(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ve(vw(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return ve.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ve(le.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ve(e,r,i)}}ve.empty=new ve(le.empty,0,0);function vw(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(vw(o.content,e-i-1,n-i-1)))}function bw(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=bw(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function Ck(t,e,n){if(n.openStart>t.depth)throw new ll("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ll("Inconsistent open depths");return ww(t,e,n,0)}function ww(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=ww(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return li(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Ek(n,t);return li(o,xw(t,s,a,e,r))}else return li(o,cl(t,e,r))}function Sw(t,e){if(!e.type.compatibleContent(t.type))throw new ll("Cannot join "+e.type.name+" onto "+t.type.name)}function Bf(t,e,n){let r=t.node(n);return Sw(r,e.node(n)),r}function ai(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Uo(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(ai(t.nodeAfter,r),o++));for(let a=o;a<s;a++)ai(i.child(a),r);e&&e.depth==n&&e.textOffset&&ai(e.nodeBefore,r)}function li(t,e){return t.type.checkContent(e),t.copy(e)}function xw(t,e,n,r,i){let o=t.depth>i&&Bf(t,e,i+1),s=r.depth>i&&Bf(n,r,i+1),a=[];return Uo(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Sw(o,s),ai(li(o,xw(t,e,n,r,i+1)),a)):(o&&ai(li(o,cl(t,e,i+1)),a),Uo(e,n,i,a),s&&ai(li(s,cl(n,r,i+1)),a)),Uo(r,null,i,a),new le(a)}function cl(t,e,n){let r=[];if(Uo(null,t,n,r),t.depth>n){let i=Bf(t,e,n+1);ai(li(i,cl(t,e,n+1)),r)}return Uo(e,null,n,r),new le(r)}function Ek(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(le.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class as{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Qe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ul(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new as(n,r,o)}static resolveCached(e,n){let r=$y.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else $y.set(e,r=new _k);let i=r.elts[r.i]=as.resolve(e,n);return r.i=(r.i+1)%Rk,i}}class _k{constructor(){this.elts=[],this.i=0}}const Rk=12,$y=new WeakMap;class ul{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ak=Object.create(null);let Or=class Vf{constructor(e,n,r,i=Qe.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||le.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&al(this.attrs,n||e.defaultAttrs||Ak)&&Qe.sameSet(this.marks,r||Qe.none)}copy(e=null){return e==this.content?this:new Vf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Vf(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ve.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new ve(c,i.depth-s,o.depth-s)}replace(e,n,r){return Ck(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return as.resolveCached(this,e)}resolveNoCache(e){return as.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Cw(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=le.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Qe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Qe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=le.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Or.prototype.text=void 0;class dl extends Or{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cw(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new dl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new dl(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Cw(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class yi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Ok(e,n);if(r.next==null)return yi.empty;let i=Ew(r);r.next&&r.err("Unexpected trailing text");let o=Dk(Lk(i));return Nk(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return le.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
38
+ `)}}yi.empty=new yi(!0);class Ok{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ew(t){let e=[];do e.push(Tk(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Tk(t){let e=[];do e.push(kk(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function kk(t){let e=Ik(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Mk(t,e);else break;return e}function By(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Mk(t,e){let n=By(t),r=n;return t.eat(",")&&(t.next!="}"?r=By(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Pk(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Ik(t){if(t.eat("(")){let e=Ew(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Pk(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Lk(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function _w(t,e){return e-t}function Vy(t,e){let n=[];return r(e),n.sort(_w);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function Dk(t){let e=Object.create(null);return n(Vy(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);Vy(t,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new yi(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(_w);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function Nk(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Rw(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Aw(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Ow(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function Tw(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Fk(t,r,e[r]);return n}let zy=class kw{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Tw(e,r.attrs),this.defaultAttrs=Rw(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==yi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Aw(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Or(this,this.computeAttrs(e),le.from(n),Qe.setFrom(r))}createChecked(e=null,n,r){return n=le.from(n),this.checkContent(n),new Or(this,this.computeAttrs(e),n,Qe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=le.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(le.empty,!0);return o?new Or(this,e,n.append(o),Qe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ow(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Qe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new kw(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function jk(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class Fk{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?jk(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class _c{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Tw(e,i.attrs),this.excluded=null;let o=Rw(this.attrs);this.instance=o?new Qe(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Qe(this,Aw(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new _c(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Ow(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Mw{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Et.from(e.nodes),n.marks=Et.from(e.marks||{}),this.nodes=zy.compile(this.spec.nodes,this),this.marks=_c.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=yi.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?Uy(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Uy(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof zy){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new dl(r,r.defaultAttrs,e,Qe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Or.fromJSON(this,e)}markFromJSON(e){return Qe.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Uy(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Hk(t){return t.tag!=null}function $k(t){return t.style!=null}let qo=class zf{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Hk(i))this.tags.push(i);else if($k(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Wy(this,n,!1);return r.addAll(e,Qe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Wy(this,n,!0);return r.addAll(e,Qe.none,n.from,n.to),ve.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(zk(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Ky(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Ky(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new zf(e,zf.schemaRules(e)))}};const Pw={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Bk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Iw={ol:!0,ul:!0},ls=1,Uf=2,Wo=4;function qy(t,e,n){return e!=null?(e?ls:0)|(e==="full"?Uf:0):t&&t.whitespace=="pre"?ls|Uf:n&~Wo}class wa{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Qe.none,this.match=o||(s&Wo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(le.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ls)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=le.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Pw.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Wy{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=qy(null,n.preserveWhitespace,0)|(r?Wo:0);i?o=new wa(i.type,i.attrs,Qe.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new wa(null,null,Qe.none,!0,null,s):o=new wa(e.schema.topNodeType,null,Qe.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&Uf?"full":this.localPreserveWS||(i.options&ls)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
39
+ `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Iw.hasOwnProperty(s)&&this.parser.normalizeLists&&Vk(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Bk.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(Pw.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
40
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=Qe.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Gy(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=qy(e,o,s.options);s.options&Wo&&s.content.length==0&&(a|=Wo);let l=Qe.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Gy(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new wa(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ls)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Vk(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Iw.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function zk(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ky(t){let e={};for(let n in t)e[n]=t[n];return e}function Gy(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Ri{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=vd(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Wa(vd(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Wa(vd(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Wa(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ri(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Jy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Jy(e.marks)}}function Jy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function vd(t){return t.document||window.document}const Xy=new WeakMap;function Uk(t){let e=Xy.get(t);return e===void 0&&Xy.set(t,e=qk(t)),e}function qk(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Wa(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Uk(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Wa(t,h,n,r);if(l.appendChild(f),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const Lw=65535,Dw=Math.pow(2,16);function Wk(t,e){return t+e*Dw}function Yy(t){return t&Lw}function Kk(t){return(t-(t&Lw))/Dw}const Nw=1,jw=2,Ka=4,Fw=8;class qf{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Fw)>0}get deletedBefore(){return(this.delInfo&(Nw|Ka))>0}get deletedAfter(){return(this.delInfo&(jw|Ka))>0}get deletedAcross(){return(this.delInfo&Ka)>0}}class Qt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Qt.empty)return Qt.empty}recover(e){let n=0,r=Yy(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Kk(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],u=this.ranges[a+s],d=l+c;if(e<=d){let h=c?e==l?-1:e==d?1:n:n,f=l+i+(h<0?0:u);if(r)return f;let p=e==(n<0?l:d)?null:Wk(a/3,e-l),g=e==l?jw:e==d?Nw:Ka;return(n<0?e!=l:e!=d)&&(g|=Fw),new qf(f,g,p)}i+=u-c}return r?e+i:new qf(e+i,0,null)}touches(e,n){let r=0,i=Yy(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];e(a,a+c,l,l+u),o+=u-c}}invert(){return new Qt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Qt.empty:new Qt(e<0?[0,-e,0]:[0,0,e])}}Qt.empty=new Qt([]);class cs{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new cs(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new cs;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new qf(e,i,null)}}const bd=Object.create(null);class Lt{getMap(){return Qt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=bd[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in bd)throw new RangeError("Duplicate use of step JSON ID "+e);return bd[e]=n,n.prototype.jsonID=e,n}}class dt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new dt(e,null)}static fail(e){return new dt(null,e)}static fromReplace(e,n,r,i){try{return dt.ok(e.replace(n,r,i))}catch(o){if(o instanceof ll)return dt.fail(o.message);throw o}}}function Cp(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Cp(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return le.fromArray(r)}class Cr extends Lt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ve(Cp(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return dt.fromReplace(e,this.from,this.to,o)}invert(){return new On(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Cr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Cr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Cr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Cr(n.from,n.to,e.markFromJSON(n.mark))}}Lt.jsonID("addMark",Cr);class On extends Lt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ve(Cp(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return dt.fromReplace(e,this.from,this.to,r)}invert(){return new Cr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new On(n.pos,r.pos,this.mark)}merge(e){return e instanceof On&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new On(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new On(n.from,n.to,e.markFromJSON(n.mark))}}Lt.jsonID("removeMark",On);class Er extends Lt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return dt.fromReplace(e,this.pos,this.pos+1,new ve(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Er(this.pos,n.marks[i]);return new Er(this.pos,this.mark)}}return new Qi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Er(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Er(n.pos,e.markFromJSON(n.mark))}}Lt.jsonID("addNodeMark",Er);class Qi extends Lt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return dt.fromReplace(e,this.pos,this.pos+1,new ve(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Er(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Qi(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Qi(n.pos,e.markFromJSON(n.mark))}}Lt.jsonID("removeNodeMark",Qi);class bt extends Lt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Wf(e,this.from,this.to)?dt.fail("Structure replace would overwrite content"):dt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Qt([this.from,this.to-this.from,this.slice.size])}invert(e){return new bt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new bt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof bt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ve.empty:new ve(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new bt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ve.empty:new ve(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new bt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new bt(n.from,n.to,ve.fromJSON(e,n.slice),!!n.structure)}}Lt.jsonID("replace",bt);class wt extends Lt{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Wf(e,this.from,this.gapFrom)||Wf(e,this.gapTo,this.to)))return dt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return dt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?dt.fromReplace(e,this.from,this.to,r):dt.fail("Content does not fit in gap")}getMap(){return new Qt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new wt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new wt(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new wt(n.from,n.to,n.gapFrom,n.gapTo,ve.fromJSON(e,n.slice),n.insert,!!n.structure)}}Lt.jsonID("replaceAround",wt);function Wf(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Gk(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(s&&s.to==h&&s.mark.eq(d[g])?s.to=f:i.push(s=new On(h,f,d[g])));a&&a.to==h?a.to=f:o.push(a=new Cr(h,f,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function Jk(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof _c){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],h;for(let f=0;f<i.length;f++){let p=i[f];p.step==o-1&&d.eq(i[f].style)&&(h=p)}h?(h.to=c,h.step=o):i.push({style:d,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>t.step(new On(s.from,s.to,s.style)))}function Ep(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new bt(a,u,ve.empty));else{r=d;for(let h=0;h<c.marks.length;h++)n.allowsMarkType(c.marks[h].type)||t.step(new On(a,u,c.marks[h]));if(i&&c.isText&&n.whitespace!="pre"){let h,f=/\r?\n|\r/g,p;for(;h=f.exec(c.text);)p||(p=new ve(le.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new bt(a+h.index,a+h.index+h[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(le.empty,!0);t.replace(a,a,new ve(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function Xk(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function bo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!Xk(i,o,s))break}return null}function Yk(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=le.empty,d=0;for(let p=o,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=le.from(r.node(p).copy(u)),d++):l--;let h=le.empty,f=0;for(let p=o,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,h=le.from(i.node(p).copy(h)),f++):c++;t.step(new wt(l,c,s,a,new ve(u.append(h),d,f),u.size-d,!0))}function _p(t,e,n=null,r=t){let i=Qk(t,e),o=i&&Zk(r,e);return o?i.map(Qy).concat({type:e,attrs:n}).concat(o.map(Qy)):null}function Qy(t){return{type:t,attrs:null}}function Qk(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function Zk(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function eM(t,e,n){let r=le.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new wt(i,o,i,o,new ve(r,0,0),n.length,!0))}function tM(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&nM(t.doc,t.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&$w(t,s,a,o),Ep(t,t.mapping.slice(o).map(a,1),r,void 0,c===null);let u=t.mapping.slice(o),d=u.map(a,1),h=u.map(a+s.nodeSize,1);return t.step(new wt(d,h,d+1,h-1,new ve(le.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Hw(t,s,a,o),!1}})}function Hw(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function $w(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
41
+ `))}})}function nM(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function rM(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new wt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ve(le.from(s),0,0),1,!0))}function qi(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let d=i.node(c),h=i.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),p=r&&r[u+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[u]||d;if(!d.canReplace(h+1,d.childCount)||!g.type.validContent(f))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function iM(t,e,n=1,r){let i=t.doc.resolve(e),o=le.empty,s=le.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=le.from(i.node(a).copy(o));let u=r&&r[c];s=le.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new bt(e,e,new ve(o.append(s),n,n),!0))}function Vr(t,e){let n=t.resolve(e),r=n.index();return Bw(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function oM(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function Bw(t,e){return!!(t&&e&&!t.isLeaf&&oM(t,e))}function Rc(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Bw(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function sM(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(i);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);$w(t,u.node(),u.before(),a)}s.inlineContent&&Ep(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new bt(c,l.map(e+n,-1),ve.empty,!0)),r===!0){let u=t.doc.resolve(c);Hw(t,u.node(),u.before(),t.steps.length)}return t}function aM(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Vw(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ac(t,e,n=e,r=ve.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return zw(i,o,r)?new bt(e,n,r):new lM(i,o,r).fit()}function zw(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class lM{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=le.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=le.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new ve(o,s,a);return e>-1?new wt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new bt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=wd(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(le.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=wd(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ve(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=wd(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new ve(jo(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ve(jo(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));d=d.matchFragment(i)}let f=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),m=d.matchType(g.type);if(!m)break;c++,(c>1||l==0||g.content.size)&&(d=m,u.push(Uw(g.mark(h.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let p=c==a.childCount;p||(f=-1),this.placed=Fo(this.placed,n,le.from(u)),this.frontier[n].match=d,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=a;g<f;g++){let y=m.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),m=y.content}this.unplaced=p?e==0?ve.empty:new ve(jo(s.content,e-1,1),e-1,f<0?s.openEnd:e-1):new ve(jo(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Sd(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Sd(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Sd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Fo(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Fo(this.placed,this.depth,le.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(le.empty,!0);n.childCount&&(this.placed=Fo(this.placed,this.frontier.length,n))}}function jo(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(jo(t.firstChild.content,e-1,n)))}function Fo(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Fo(t.lastChild.content,e-1,n)))}function wd(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Uw(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Uw(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),t.copy(r)}function Sd(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!cM(n,o.content,s)?a:null}function cM(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function uM(t){return t.spec.defining||t.spec.definingForContent}function dM(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(zw(i,o,r))return t.step(new bt(e,n,r));let s=Ww(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let p=i.node(h).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==f&&s.splice(1,0,-h)}let l=s.indexOf(a),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let p=h.firstChild;if(c.push(p),f==r.openStart)break;h=p.content}for(let h=u-1;h>=0;h--){let f=c[h],p=uM(f.type);if(p&&!f.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(p||!f.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let f=(h+u+1)%(r.openStart+1),p=c[f];if(p)for(let g=0;g<s.length;g++){let m=s[(g+l)%s.length],y=!0;m<0&&(y=!1,m=-m);let x=i.node(m-1),w=i.index(m-1);if(x.canReplaceWith(w,w,p.type,p.marks))return t.replace(i.before(m),y?o.after(m):n,new ve(qw(r.content,0,r.openStart,f),f,r.openEnd))}}let d=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>d));h--){let f=s[h];f<0||(e=i.before(f),n=o.after(f))}}function qw(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(qw(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(le.empty,!0))}return t}function fM(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=aM(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new ve(le.from(r),0,0))}function hM(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Ww(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Ww(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class Wi extends Lt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return dt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return dt.fromReplace(e,this.pos,this.pos+1,new ve(le.from(i),0,n.isLeaf?0:1))}getMap(){return Qt.empty}invert(e){return new Wi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Wi(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Wi(n.pos,n.attr,n.value)}}Lt.jsonID("attr",Wi);class us extends Lt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return dt.ok(r)}getMap(){return Qt.empty}invert(e){return new us(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new us(n.attr,n.value)}}Lt.jsonID("docAttr",us);let Zi=class extends Error{};Zi=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Zi.prototype=Object.create(Error.prototype);Zi.prototype.constructor=Zi;Zi.prototype.name="TransformError";class Kw{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new cs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Zi(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ve.empty){let i=Ac(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new ve(le.from(r),0,0))}delete(e,n){return this.replace(e,n,ve.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return dM(this,e,n,r),this}replaceRangeWith(e,n,r){return fM(this,e,n,r),this}deleteRange(e,n){return hM(this,e,n),this}lift(e,n){return Yk(this,e,n),this}join(e,n=1){return sM(this,e,n),this}wrap(e,n){return eM(this,e,n),this}setBlockType(e,n=e,r,i=null){return tM(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return rM(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Wi(e,n,r)),this}setDocAttribute(e,n){return this.step(new us(e,n)),this}addNodeMark(e,n){return this.step(new Er(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Qe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Qi(e,n)),this}split(e,n=1,r){return iM(this,e,n,r),this}addMark(e,n,r){return Gk(this,e,n,r),this}removeMark(e,n,r){return Jk(this,e,n,r),this}clearIncompatible(e,n,r){return Ep(this,e,n,r),this}}const xd=Object.create(null);class De{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new pM(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ve.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(c.pos),a?ve.empty:n),a==0&&t1(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),t1(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new Pe(e):Fi(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Fi(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Fi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new cn(e.node(0))}static atStart(e){return Fi(e,e,0,0,1)||new cn(e)}static atEnd(e){return Fi(e,e,e.content.size,e.childCount,-1)||new cn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=xd[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in xd)throw new RangeError("Duplicate use of selection JSON ID "+e);return xd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Pe.between(this.$anchor,this.$head).getBookmark()}}De.prototype.visible=!0;class pM{constructor(e,n){this.$from=e,this.$to=n}}let Zy=!1;function e1(t){!Zy&&!t.parent.inlineContent&&(Zy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Pe extends De{constructor(e,n=e){e1(e),e1(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return De.near(r);let i=e.resolve(n.map(this.anchor));return new Pe(i.parent.inlineContent?i:r,r)}replace(e,n=ve.empty){if(super.replace(e,n),n==ve.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Oc(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Pe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=De.findFrom(n,r,!0)||De.findFrom(n,-r,!0);if(o)n=o.$head;else return De.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(De.findFrom(e,-r,!0)||De.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Pe(e,n)}}De.jsonID("text",Pe);class Oc{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Oc(e.map(this.anchor),e.map(this.head))}resolve(e){return Pe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ae extends De{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?De.near(o):new Ae(o)}content(){return new ve(le.from(this.node),0,0)}eq(e){return e instanceof Ae&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Rp(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ae(e.resolve(n.anchor))}static create(e,n){return new Ae(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ae.prototype.visible=!1;De.jsonID("node",Ae);class Rp{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Oc(r,r):new Rp(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ae.isSelectable(r)?new Ae(n):De.near(n)}}class cn extends De{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ve.empty){if(n==ve.empty){e.delete(0,e.doc.content.size);let r=De.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new cn(e)}map(e){return new cn(e)}eq(e){return e instanceof cn}getBookmark(){return gM}}De.jsonID("all",cn);const gM={map(){return this},resolve(t){return new cn(t)}};function Fi(t,e,n,r,i,o=!1){if(e.inlineContent)return Pe.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&Ae.isSelectable(a))return Ae.create(t,n-(i<0?a.nodeSize:0))}else{let l=Fi(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function t1(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof bt||i instanceof wt))return;let o=t.mapping.maps[r],s;o.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(De.near(t.doc.resolve(s),n))}const n1=1,Sa=2,r1=4;let mM=class extends Kw{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|n1)&~Sa,this.storedMarks=null,this}get selectionSet(){return(this.updated&n1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Sa,this}ensureMarks(e){return Qe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Sa)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Sa,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Qe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(De.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=r1,this}get scrolledIntoView(){return(this.updated&r1)>0}};function i1(t,e){return!e||!t?t:t.bind(e)}class Ho{constructor(e,n,r){this.name=e,this.init=i1(n.init,r),this.apply=i1(n.apply,r)}}const yM=[new Ho("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ho("selection",{init(t,e){return t.selection||De.atStart(e.doc)},apply(t){return t.selection}}),new Ho("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ho("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Cd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yM.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ho(r.key,r.spec.state,r))})}}class Vi{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Vi(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new mM(this)}static create(e){let n=new Cd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Vi(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Cd(this.schema,e.plugins),r=n.fields,i=new Vi(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Cd(e.schema,e.plugins),o=new Vi(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Or.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=De.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function Gw(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Gw(i,e,{})),n[r]=i}return n}class lt{constructor(e){this.spec=e,this.props={},e.props&&Gw(e.props,this,this.props),this.key=e.key?e.key.key:Jw("plugin")}getState(e){return e[this.key]}}const Ed=Object.create(null);function Jw(t){return t in Ed?t+"$"+ ++Ed[t]:(Ed[t]=0,t+"$")}class yt{constructor(e="key"){this.key=Jw(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const _t=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},eo=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Kf=null;const Jn=function(t,e,n){let r=Kf||(Kf=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},vM=function(){Kf=null},vi=function(t,e,n,r){return n&&(o1(t,e,n,r,-1)||o1(t,e,n,r,1))},bM=/^(img|br|input|textarea|hr)$/i;function o1(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:an(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Fs(t)||bM.test(t.nodeName)||t.contentEditable=="false")return!1;e=_t(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?an(t):0}else return!1}}function an(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function wM(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=an(t)}else if(t.parentNode&&!Fs(t))e=_t(t),t=t.parentNode;else return null}}function SM(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Fs(t))e=_t(t)+1,t=t.parentNode;else return null}}function xM(t,e,n){for(let r=e==0,i=e==an(t);r||i;){if(t==n)return!0;let o=_t(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==an(t)}}function Fs(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Tc=function(t){return t.focusNode&&vi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Zr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function CM(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function EM(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(an(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(an(r.startContainer),r.startOffset)}}}const In=typeof navigator<"u"?navigator:null,s1=typeof document<"u"?document:null,zr=In&&In.userAgent||"",Gf=/Edge\/(\d+)/.exec(zr),Xw=/MSIE \d/.exec(zr),Jf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zr),Kt=!!(Xw||Jf||Gf),Tr=Xw?document.documentMode:Jf?+Jf[1]:Gf?+Gf[1]:0,vn=!Kt&&/gecko\/(\d+)/i.test(zr);vn&&+(/Firefox\/(\d+)/.exec(zr)||[0,0])[1];const Xf=!Kt&&/Chrome\/(\d+)/.exec(zr),Pt=!!Xf,Yw=Xf?+Xf[1]:0,jt=!Kt&&!!In&&/Apple Computer/.test(In.vendor),to=jt&&(/Mobile\/\w+/.test(zr)||!!In&&In.maxTouchPoints>2),sn=to||(In?/Mac/.test(In.platform):!1),_M=In?/Win/.test(In.platform):!1,Qn=/Android \d/.test(zr),Hs=!!s1&&"webkitFontSmoothing"in s1.documentElement.style,RM=Hs?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function AM(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Un(t,e){return typeof t=="number"?t:t[e]}function OM(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function a1(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=eo(s);continue}let a=s,l=a==o.body,c=l?AM(o):OM(a),u=0,d=0;if(e.top<c.top+Un(r,"top")?d=-(c.top-e.top+Un(i,"top")):e.bottom>c.bottom-Un(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Un(i,"top")-c.top:e.bottom-c.bottom+Un(i,"bottom")),e.left<c.left+Un(r,"left")?u=-(c.left-e.left+Un(i,"left")):e.right>c.right-Un(r,"right")&&(u=e.right-c.right+Un(i,"right")),u||d)if(l)o.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let g=a.scrollLeft-f,m=a.scrollTop-p;e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m}}let h=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s=h=="absolute"?s.offsetParent:eo(s)}}function TM(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:Qw(t.dom)}}function Qw(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=eo(r));return e}function kM({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Zw(n,r==0?0:r-e)}function Zw(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Ii=null;function MM(t){if(t.setActive)return t.setActive();if(Ii)return t.focus(Ii);let e=Qw(t);t.focus(Ii==null?{get preventScroll(){return Ii={preventScroll:!0},!0}}:void 0),Ii||(Ii=!1,Zw(e,0))}function eS(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=Jn(u).getClientRects();else continue;for(let f=0;f<h.length;f++){let p=h[f];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&g&&(o=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=d+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?PM(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:eS(n,i)}function PM(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=hr(r,1);if(o.top!=o.bottom&&Ap(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Ap(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function IM(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function LM(t,e,n){let{node:r,offset:i}=eS(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function DM(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function tS(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Ap(e,c))return tS(s,e,c)}}if((o=(o+1)%r)==i)break}return t}function NM(t,e){let n=t.dom.ownerDocument,r,i=0,o=EM(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!Ap(e,c)||(s=tS(t.dom,e,c),!s))return null}if(jt)for(let c=s;r&&c;c=eo(c))c.draggable&&(r=void 0);if(s=IM(s,e),r){if(vn&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let c;Hs&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=DM(t,r,i,e))}a==null&&(a=LM(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function l1(t){return t.top<t.bottom||t.left<t.right}function hr(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(l1(r))return r}return Array.prototype.find.call(n,l1)||t.getBoundingClientRect()}const jM=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nS(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Hs||vn;if(r.nodeType==3)if(s&&(jM.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=hr(Jn(r,i,i),n);if(vn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=hr(Jn(r,i-1,i-1),-1);if(c.top==l.top){let u=hr(Jn(r,i,i+1),-1);if(u.top!=l.top)return ko(u,u.left<c.left)}}return l}else{let l=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,ko(hr(Jn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==an(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return _d(l.getBoundingClientRect(),!1)}if(o==null&&i<an(r)){let l=r.childNodes[i];if(l.nodeType==1)return _d(l.getBoundingClientRect(),!0)}return _d(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==an(r))){let l=r.childNodes[i-1],c=l.nodeType==3?Jn(l,an(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return ko(hr(c,1),!1)}if(o==null&&i<an(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Jn(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return ko(hr(c,-1),!0)}return ko(hr(r.nodeType==3?Jn(r):r,-n),n>=0)}function ko(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function _d(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function rS(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function FM(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return rS(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=nS(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Jn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const HM=/[\u0590-\u08ac]/;function $M(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!HM.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:rS(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),m=p&&!f.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return h!=null&&(a.caretBidiLevel=h),m}):r.pos==r.start()||r.pos==r.end()}let c1=null,u1=null,d1=!1;function BM(t,e,n){return c1==e&&u1==n?d1:(c1=e,u1=n,d1=n=="up"||n=="down"?FM(t,e,n):$M(t,e,n))}const un=0,f1=1,ri=2,Ln=3;class $s{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=un,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>_t(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof oS){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof iS&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?_t(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?_t(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=_t(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=_t(d.dom);break}n+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let f=0,p=0;f<this.children.length;f++){let g=this.children[f],m=p+g.size;if(o>p&&s<m)return g.setSelection(e-p-g.border,n-p-g.border,r,i);p=m}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((vn||jt)&&e==n){let{node:f,offset:p}=a;if(f.nodeType==3){if(d=!!(p&&f.nodeValue[p-1]==`
42
+ `),d&&p==f.nodeValue.length)for(let g=f,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(a=l={node:m.parentNode,offset:_t(m)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=f.childNodes[p-1];d=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(vn&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||d&&jt)&&vi(a.node,a.offset,u.anchorNode,u.anchorOffset)&&vi(l.node,l.offset,u.focusNode,u.focusOffset))return;let h=!1;if((c.extend||e==n)&&!d){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?ri:f1,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Ln:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?ri:Ln}r=s}this.dirty=ri}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?ri:f1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class iS extends $s{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==un&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class VM extends $s{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class bi extends $s{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ri.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new bi(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Ln||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ln&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=un){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=un}}slice(e,n,r){let i=bi.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Qf(o,n,s,r)),e>0&&(o=Qf(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class kr extends $s{constructor(e,n,r,i,o,s,a,l,c){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,c=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Ri.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=lS(u,r,n),c?l=new zM(e,n,r,i,u,d||null,h,c,o,s+1):n.isText?new kc(e,n,r,i,u,h,o):new kr(e,n,r,i,u,d||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}return e}matchesNode(e,n,r){return this.dirty==un&&e.eq(this.node)&&fl(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new qM(this,s&&s.node,e);GM(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Qe.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,d,h)=>{l.syncToMarks(c.marks,r,e);let f;l.findNodeMatch(c,u,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(f=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,u,d,f,e)||l.updateNextNode(c,u,d,e,h,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ri)&&(s&&this.protectLocalComposition(e,s),sS(this.contentDOM,this.children,e),to&&JM(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Pe)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=XM(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new VM(this,o,n,i);e.input.compositionNodes.push(s),this.children=Qf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Ln||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=un}updateOuterDeco(e){if(fl(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=aS(this.dom,this.nodeDOM,Yf(this.outerDeco,this.node,n),Yf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function h1(t,e,n,r,i){lS(r,e,t);let o=new kr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class kc extends kr{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Ln||this.dirty!=un&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=un||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=un,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new kc(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ln)}get domAtom(){return!1}isText(e){return this.node.text==e}}class oS extends $s{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==un&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class zM extends kr{constructor(e,n,r,i,o,s,a,l,c,u){super(e,n,r,i,o,s,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==Ln)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function sS(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=p1(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof bi){let l=r?r.previousSibling:t.lastChild;sS(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=p1(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ko=function(t){t&&(this.nodeName=t)};Ko.prototype=Object.create(null);const ii=[new Ko];function Yf(t,e,n){if(t.length==0)return ii;let r=n?ii[0]:new Ko,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Ko(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Ko(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function aS(t,e,n,r){if(n==ii&&r==ii)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=ii[0]),i=l}UM(i,a||ii[0],s)}return i}function UM(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function lS(t,e,n){return aS(t,t,ii,Yf(e,n,t.nodeType!=1))}function fl(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function p1(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class qM{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=WM(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=un,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=bi.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Ln&&s.dom==s.contentDOM&&(s.dirty=ri),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof kr){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let u=l.dom,d,h=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Ln&&fl(n,l.outerDeco));if(!h&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=ri,d.updateChildren(i,s+1),d.dirty=un),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!fl(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=kr.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=kr.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new iS(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof bi;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof kc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((jt||Pt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new oS(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function WM(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof bi)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function KM(t,e){return t.type.side-e.type.side}function GM(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,i,e.forChild(o,u),c),o+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<i.length&&i[s].to==o;){let m=i[s++];m.widget&&(u?(d||(d=[u])).push(m):u=m)}if(u)if(d){d.sort(KM);for(let m=0;m<d.length;m++)n(d[m],c,!!l)}else n(u,c,!!l);let h,f;if(l)f=-1,h=l,l=null;else if(c<t.childCount)f=c,h=t.child(c++);else break;for(let m=0;m<a.length;m++)a[m].to<=o&&a.splice(m--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+h.nodeSize;if(h.isText){let m=p;s<i.length&&i[s].from<m&&(m=i[s].from);for(let y=0;y<a.length;y++)a[y].to<m&&(m=a[y].to);m<p&&(l=h.cut(m-o),h=h.cut(0,m-o),p=m,f=-1)}else for(;s<i.length&&i[s].to<p;)s++;let g=h.isInline&&!h.isLeaf?a.filter(m=>!m.inline):a.slice();r(h,g,e.forChild(o,h),f),o=p}}function JM(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function XM(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Qf(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Op(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Tc(n)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&Ae.isSelectable(d)&&i.parent&&!(d.isInline&&xM(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new Ae(s==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,h=s;for(let f=0;f<n.rangeCount;f++){let p=n.getRangeAt(f);d=Math.min(d,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[l,s]=h==t.state.selection.anchor?[h,d]:[d,h],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=Tp(t,u,a,d)}return c}function cS(t){return t.editable?t.hasFocus():dS(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function nr(t,e=!1){let n=t.state.selection;if(uS(t,n),!!cS(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Pt){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&vi(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)QM(t);else{let{anchor:r,head:i}=n,o,s;g1&&!(n instanceof Pe)&&(n.$from.parent.inlineContent||(o=m1(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=m1(t,n.to))),t.docView.setSelection(r,i,t,e),g1&&(o&&y1(o),s&&y1(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&YM(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const g1=jt||Pt&&Yw<63;function m1(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(jt&&i&&i.contentEditable=="false")return Rd(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Rd(i);if(o)return Rd(o)}}function Rd(t){return t.contentEditable="true",jt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function y1(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function YM(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!cS(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function QM(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,_t(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Kt&&Tr<=11&&(r.disabled=!0,r.disabled=!1)}function uS(t,e){if(e instanceof Ae){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(v1(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else v1(t)}function v1(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Tp(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||Pe.between(e,n,r)}function b1(t){return t.editable&&!t.hasFocus()?!1:dS(t)}function dS(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function ZM(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return vi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Zf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&De.findFrom(o,e)}function pr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function w1(t,e,n){let r=t.state.selection;if(r instanceof Pe)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return pr(t,new Pe(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Zf(t.state,e);return i&&i instanceof Ae?pr(t,i):!1}else if(!(sn&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Ae.isSelectable(o)?pr(t,new Ae(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Hs?pr(t,new Pe(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ae&&r.node.isInline)return pr(t,new Pe(e>0?r.$to:r.$from));{let i=Zf(t.state,e);return i?pr(t,i):!1}}}function hl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Go(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Li(t,e){return e<0?eP(t):tP(t)}function eP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(vn&&n.nodeType==1&&r<hl(n)&&Go(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Go(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(fS(n))break;{let a=n.previousSibling;for(;a&&Go(a,-1);)i=n.parentNode,o=_t(a),a=a.previousSibling;if(a)n=a,r=hl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?eh(t,n,r):i&&eh(t,i,o)}function tP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=hl(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Go(a,1))o=n,s=++r;else break}else{if(fS(n))break;{let a=n.nextSibling;for(;a&&Go(a,1);)o=a.parentNode,s=_t(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=hl(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&eh(t,o,s)}function fS(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function nP(t,e){for(;t&&e==t.childNodes.length&&!Fs(t);)e=_t(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function rP(t,e){for(;t&&!e&&!Fs(t);)e=_t(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function eh(t,e,n){if(e.nodeType!=3){let o,s;(s=nP(e,n))?(e=s,n=0):(o=rP(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Tc(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&nr(t)},50)}function S1(t,e){let n=t.state.doc.resolve(e);if(!(Pt||_M)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function x1(t,e,n){let r=t.state.selection;if(r instanceof Pe&&!r.empty||n.indexOf("s")>-1||sn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Zf(t.state,e);if(s&&s instanceof Ae)return pr(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof cn?De.near(s,e):De.findFrom(s,e);return a?pr(t,a):!1}return!1}function C1(t,e){if(!(t.state.selection instanceof Pe))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function E1(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function iP(t){if(!jt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;E1(t,r,"true"),setTimeout(()=>E1(t,r,"false"),20)}return!1}function oP(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function sP(t,e){let n=e.keyCode,r=oP(e);if(n==8||sn&&n==72&&r=="c")return C1(t,-1)||Li(t,-1);if(n==46&&!e.shiftKey||sn&&n==68&&r=="c")return C1(t,1)||Li(t,1);if(n==13||n==27)return!0;if(n==37||sn&&n==66&&r=="c"){let i=n==37?S1(t,t.state.selection.from)=="ltr"?-1:1:-1;return w1(t,i,r)||Li(t,i)}else if(n==39||sn&&n==70&&r=="c"){let i=n==39?S1(t,t.state.selection.from)=="ltr"?1:-1:1;return w1(t,i,r)||Li(t,i)}else{if(n==38||sn&&n==80&&r=="c")return x1(t,-1,r)||Li(t,-1);if(n==40||sn&&n==78&&r=="c")return iP(t)||x1(t,1,r)||Li(t,1);if(r==(sn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function kp(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=t.someProp("clipboardSerializer")||Ri.fromSchema(t.state.schema),a=vS(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=yS[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let p=a.createElement(u[f]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
43
+
44
+ `);return{dom:l,text:h,slice:e}}function hS(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new ve(le.from(t.state.schema.text(e.replace(/\r\n?/g,`
45
+ `))),0,0):ve.empty;let d=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(d)a=d;else{let h=i.marks(),{schema:f}=t.state,p=Ri.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(f.text(g,h)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=uP(n),Hs&&dP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||qo.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!aP.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=fP(_1(a,+u[1],+u[2]),u[4]);else if(a=ve.maxOpen(lP(a.content,i),!0),a.openStart||a.openEnd){let d=0,h=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=_1(a,d,h)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const aP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function lP(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&gS(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=mS(s[s.length-1],o.length));let u=pS(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return le.from(s)}return t}function pS(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,le.from(t));return t}function gS(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=gS(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(le.from(pS(n,t,i+1))))}}function mS(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,mS(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(le.empty,!0);return t.copy(n.append(r))}function th(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=th(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function _1(t,e,n){return e<t.openStart&&(t=new ve(th(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ve(th(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const yS={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let R1=null;function vS(){return R1||(R1=document.implementation.createHTMLDocument("title"))}let Ad=null;function cP(t){let e=window.trustedTypes;return e?(Ad||(Ad=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Ad.createHTML(t)):t}function uP(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=vS().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&yS[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=cP(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function dP(t){let e=t.querySelectorAll(Pt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function fP(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=le.from(l.create(r[a+1],i)),o++,s++}return new ve(i,o,s)}const Ft={},Ht={},hP={touchstart:!0,touchmove:!0};class pP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function gP(t){for(let e in Ft){let n=Ft[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{yP(t,r)&&!Mp(t,r)&&(t.editable||!(r.type in Ht))&&n(t,r)},hP[e]?{passive:!0}:void 0)}jt&&t.dom.addEventListener("input",()=>null),nh(t)}function _r(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function mP(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function nh(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Mp(t,r))})}function Mp(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function yP(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function vP(t,e){!Mp(t,e)&&Ft[e.type]&&(t.editable||!(e.type in Ht))&&Ft[e.type](t,e)}Ht.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!wS(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qn&&Pt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),to&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Zr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||sP(t,n)?n.preventDefault():_r(t,"key")};Ht.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ht.keypress=(t,e)=>{let n=e;if(wS(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||sn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Pe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Mc(t){return{left:t.clientX,top:t.clientY}}function bP(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Pp(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ki(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function wP(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ae.isSelectable(r)?(Ki(t,new Ae(n),"pointer"),!0):!1}function SP(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof Ae&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(Ae.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Ki(t,Ae.create(t.state.doc,i),"pointer"),!0):!1}function xP(t,e,n,r,i){return Pp(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?SP(t,n):wP(t,n))}function CP(t,e,n,r){return Pp(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function EP(t,e,n,r){return Pp(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||_P(t,n,r)}function _P(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ki(t,Pe.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Ki(t,Pe.create(r,a+1,a+1+s.content.size),"pointer");else if(Ae.isSelectable(s))Ki(t,Ae.create(r,a),"pointer");else continue;return!0}}function Ip(t){return pl(t)}const bS=sn?"metaKey":"ctrlKey";Ft.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ip(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&bP(n,t.input.lastClick)&&!n[bS]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Mc(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new RP(t,s,n,!!r)):(o=="doubleClick"?CP:EP)(t,s.pos,s.inside,n)?n.preventDefault():_r(t,"pointer"))};class RP{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[bS],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Ae&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&vn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),_r(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>nr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Mc(e))),this.updateAllowDefault(e),this.allowDefault||!n?_r(this.view,"pointer"):xP(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||jt&&this.mightDrag&&!this.mightDrag.node.isAtom||Pt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ki(this.view,De.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):_r(this.view,"pointer")}move(e){this.updateAllowDefault(e),_r(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ft.touchstart=t=>{t.input.lastTouch=Date.now(),Ip(t),_r(t,"pointer")};Ft.touchmove=t=>{t.input.lastTouch=Date.now(),_r(t,"pointer")};Ft.contextmenu=t=>Ip(t);function wS(t,e){return t.composing?!0:jt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const AP=Qn?5e3:-1;Ht.compositionstart=Ht.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Pe&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),pl(t,!0),t.markCursor=null;else if(pl(t,!e.selection.empty),vn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}SS(t,AP)};Ht.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,SS(t,20))};function SS(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>pl(t),e))}function xS(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=TP());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function OP(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=wM(e.focusNode,e.focusOffset),r=SM(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function TP(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function pl(t,e=!1){if(!(Qn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),xS(t),e||t.docView&&t.docView.dirty){let n=Op(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function kP(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ds=Kt&&Tr<15||to&&RM<604;Ft.copy=Ht.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ds?null:n.clipboardData,s=r.content(),{dom:a,text:l}=kp(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):kP(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function MP(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function PP(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?fs(t,r.value,null,i,e):fs(t,r.textContent,r.innerHTML,i,e)},50)}function fs(t,e,n,r,i){let o=hS(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||ve.empty)))return!0;if(!o)return!1;let s=MP(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function CS(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ht.paste=(t,e)=>{let n=e;if(t.composing&&!Qn)return;let r=ds?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&fs(t,CS(r),r.getData("text/html"),i,n)?n.preventDefault():PP(t,n)};class ES{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const _S=sn?"altKey":"ctrlKey";Ft.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Mc(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Ae?i.to-1:i.to))){if(r&&r.mightDrag)s=Ae.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Ae.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=kp(t,a);(!n.dataTransfer.files.length||!Pt||Yw>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ds?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ds||n.dataTransfer.setData("text/plain",c),t.dragging=new ES(u,!n[_S],s)};Ft.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Ht.dragover=Ht.dragenter=(t,e)=>e.preventDefault();Ht.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Mc(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=hS(t,CS(n.dataTransfer),ds?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[_S]);if(t.someProp("handleDrop",p=>p(t,n,s||ve.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Vw(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(a){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let f=c.doc.resolve(u);if(d&&Ae.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ae(f));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,m,y,x)=>p=x),c.setSelection(Tp(t,f,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};Ft.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&nr(t)},20))};Ft.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Ft.beforeinput=(t,e)=>{if(Pt&&Qn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Zr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Ht)Ft[t]=Ht[t];function hs(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class gl{constructor(e,n){this.toDOM=e,this.spec=n||ci,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new qt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof gl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&hs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Mr{constructor(e,n){this.attrs=e,this.spec=n||ci}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new qt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Mr&&hs(this.attrs,e.attrs)&&hs(this.spec,e.spec)}static is(e){return e.type instanceof Mr}destroy(){}}class Lp{constructor(e,n){this.attrs=e,this.spec=n||ci}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new qt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Lp&&hs(this.attrs,e.attrs)&&hs(this.spec,e.spec)}destroy(){}}class qt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new qt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new qt(e,e,new gl(n,r))}static inline(e,n,r,i){return new qt(e,n,new Mr(r,i))}static node(e,n,r,i){return new qt(e,n,new Lp(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Mr}get widget(){return this.type instanceof gl}}const Hi=[],ci={};class ut{constructor(e,n){this.local=e.length?e:Hi,this.children=n.length?n:Hi}static create(e,n){return n.length?ml(n,e,0,ci):kt}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==kt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ci)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?IP(this.children,s||[],e,n,r,i,o):s?new ut(s.sort(ui),Hi):kt}add(e,n){return n.length?this==kt?ut.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let c=l+r,u;if(u=AS(n,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,ml(u,a,c+1,ci)),o+=3}});let s=RS(o?OS(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new ut(s.length?this.local.concat(s).sort(ui):this.local,i||this.children)}remove(e){return e.length==0||this==kt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c!=kt?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ut(i,r):kt}forChild(e,n){if(this==kt)return this;if(n.isLeaf)return ut.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Mr){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new ut(i.sort(ui),Hi);return r?new yr([a,r]):a}return r||kt}eq(e){if(this==e)return!0;if(!(e instanceof ut)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Dp(this.localsInner(e))}localsInner(e){if(this==kt)return Hi;if(e.inlineContent||!this.local.some(Mr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Mr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}ut.empty=new ut([],[]);ut.removeOverlap=Dp;const kt=ut.empty;class yr{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,ci));return yr.from(r)}forChild(e,n){if(n.isLeaf)return ut.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=kt&&(o instanceof yr?r=r.concat(o.members):r.push(o))}return yr.from(r)}eq(e){if(!(e instanceof yr)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Dp(r?n:n.sort(ui)):Hi}static from(e){switch(e.length){case 0:return kt;case 1:return e[0];default:return new yr(e.every(n=>n instanceof ut)?e:e.reduce((n,r)=>n.concat(r instanceof ut?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function IP(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,u=o;c<n.maps.length;c++){let d=0;n.maps[c].forEach((h,f,p,g)=>{let m=g-p-(f-h);for(let y=0;y<a.length;y+=3){let x=a[y+1];if(x<0||h>x+u-d)continue;let w=a[y]+u-d;f>=w?a[y+1]=h<=w?-2:-1:h>=u&&m&&(a[y]+=m,a[y+1]+=m)}d+=m}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+o),d=u-i;if(d<0||d>=r.content.size){l=!0;continue}let h=n.map(t[c+1]+o,-1),f=h-i,{index:p,offset:g}=r.content.findIndex(d),m=r.maybeChild(p);if(m&&g==d&&g+m.nodeSize==f){let y=a[c+2].mapInner(n,m,u+1,t[c]+o+1,s);y!=kt?(a[c]=d,a[c+1]=f,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=LP(a,t,e,n,i,o,s),u=ml(c,r,0,s);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<u.children.length;d+=3){let f=u.children[d];for(;h<a.length&&a[h]<f;)h+=3;a.splice(h,0,u.children[d],u.children[d+1],u.children[d+2])}}return new ut(e.sort(ui),a)}function RS(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new qt(i.from+e,i.to+e,i.type))}return n}function LP(t,e,n,r,i,o,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,i,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function AS(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function OS(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ml(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let c=AS(t,a,l+n);if(c){o=!0;let u=ml(c,a,n+l+1,r);u!=kt&&i.push(l,l+a.nodeSize,u)}});let s=RS(o?OS(t):t,-n).sort(ui);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new ut(s,i):kt}function ui(t,e){return t.from-e.from||t.to-e.to}function Dp(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),A1(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),A1(e,i,r.copy(o.from,r.to)));break}}}return e}function A1(t,e,n){for(;e<t.length&&ui(n,t[e])>0;)e++;t.splice(e,0,n)}function Od(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=kt&&e.push(r)}),t.cursorWrapper&&e.push(ut.create(t.state.doc,[t.cursorWrapper.deco])),yr.from(e)}const DP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},NP=Kt&&Tr<=11;class jP{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class FP{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new jP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Kt&&Tr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),NP&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,DP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(b1(this.view)){if(this.suppressingSelectionUpdates)return nr(this.view);if(Kt&&Tr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=eo(o))n.add(o);for(let o=e.anchorNode;o;o=eo(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&b1(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(vn&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,h]=u;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of u){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||BP(e,d)!=f)&&h.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tc(r)&&(c=Op(e))&&c.eq(De.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,nr(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),HP(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||nr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Kt&&Tr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:h}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?_t(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?_t(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let O1=new WeakMap,T1=!1;function HP(t){if(!O1.has(t)&&(O1.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=vn,T1)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),T1=!0}}function k1(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return vi(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function $P(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return k1(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?k1(t,n):null}function BP(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function VP(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Tc(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Pt&&t.input.lastKeyCode===8)for(let m=o;m>i;m--){let y=r.childNodes[m-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){o=m;break}if(!x||x.size)break}let d=t.state.doc,h=t.someProp("domParser")||qo.fromSchema(t.state.schema),f=d.resolve(s),p=null,g=h.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:o,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:zP,context:f});if(c&&c[0].pos!=null){let m=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=m),p={anchor:m+s,head:y+s}}return{doc:g,sel:p,from:s,to:a}}function zP(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(jt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||jt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const UP=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function qP(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let R=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,A=Op(t,R);if(A&&!t.state.selection.eq(A)){if(Pt&&Qn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",k=>k(t,Zr(13,"Enter"))))return;let T=t.state.tr.setSelection(A);R=="pointer"?T.setMeta("pointer",!0):R=="key"&&T.scrollIntoView(),o&&T.setMeta("composition",o),t.dispatch(T)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=VP(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),h,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,f="end"):(h=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let p=GP(d.content,c.doc.content,c.from,h,f);if(p&&t.input.domChangeCount++,(to&&t.input.lastIOSEnter>Date.now()-225||Qn)&&i.some(R=>R.nodeType==1&&!UP.test(R.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",R=>R(t,Zr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof Pe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let R=M1(t,t.state.doc,c.sel);if(R&&!R.eq(t.state.selection)){let A=t.state.tr.setSelection(R);o&&A.setMeta("composition",o),t.dispatch(A)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof Pe&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),Kt&&Tr<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=c.doc.resolveNoCache(p.start-c.from),m=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),x=g.sameParent(m)&&g.parent.inlineContent&&y.end()>=p.endA,w;if((to&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!x&&g.pos<c.doc.content.size&&!g.sameParent(m)&&(w=De.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==m.pos)&&t.someProp("handleKeyDown",R=>R(t,Zr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&KP(u,p.start,p.endA,g,m)&&t.someProp("handleKeyDown",R=>R(t,Zr(8,"Backspace")))){Qn&&Pt&&t.domObserver.suppressSelectionUpdates();return}Pt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),Qn&&!x&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,m=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(R){return R(t,Zr(13,"Enter"))})},20));let v=p.start,S=p.endA,C,_,E;if(x){if(g.pos==m.pos)Kt&&Tr<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>nr(t),20)),C=t.state.tr.delete(v,S),_=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(E=WP(g.parent.content.cut(g.parentOffset,m.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))C=t.state.tr,E.type=="add"?C.addMark(v,S,E.mark):C.removeMark(v,S,E.mark);else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let R=g.parent.textBetween(g.parentOffset,m.parentOffset);if(t.someProp("handleTextInput",A=>A(t,v,S,R)))return;C=t.state.tr.insertText(R,v,S)}}if(C||(C=t.state.tr.replace(v,S,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let R=M1(t,C.doc,c.sel);R&&!(Pt&&t.composing&&R.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(R.head==v||R.head==C.mapping.map(S)-1)||Kt&&R.empty&&R.head==v)&&C.setSelection(R)}_&&C.ensureMarks(_),o&&C.setMeta("composition",o),t.dispatch(C.scrollIntoView())}function M1(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Tp(t,e.resolve(n.anchor),e.resolve(n.head))}function WP(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(le.from(c).eq(t))return{mark:a,type:s}}function KP(t,e,n,r,i){if(n-e<=i.pos-r.pos||Td(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Td(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Td(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Td(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function GP(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&P1(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,o&&o<t.size&&P1(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function P1(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class JP{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new pP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(j1),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=D1(this),L1(this),this.nodeViews=N1(this),this.docView=h1(this.state.doc,I1(this),Od(this),this.dom,this),this.domObserver=new FP(this,(r,i,o,s)=>qP(this,r,i,o,s)),this.domObserver.start(),gP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&nh(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(j1),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(xS(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=N1(this);YP(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&nh(this),this.editable=D1(this),L1(this);let l=Od(this),c=I1(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&TM(this);if(s){this.domObserver.stop();let f=d&&(Kt||Pt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&XP(i.selection,e.selection);if(d){let p=Pt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=OP(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=h1(e.doc,c,l,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ZM(this))?nr(this,f):(uS(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&kM(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ae){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&a1(this,n.getBoundingClientRect(),e)}else a1(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new ES(e.slice,e.move,i<0?void 0:Ae.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Kt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&MM(this.dom),nr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return NM(this,e)}coordsAtPos(e,n=1){return nS(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return BM(this,n||this.state,e)}pasteHTML(e,n){return fs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return fs(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return kp(this,e)}destroy(){this.docView&&(mP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Od(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,vM())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return vP(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?jt&&this.root.nodeType===11&&CM(this.dom.ownerDocument)==this.dom&&$P(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function I1(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[qt.node(0,t.state.doc.content.size,e)]}function L1(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:qt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function D1(t){return!t.someProp("editable",e=>e(t.state)===!1)}function XP(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function N1(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function YP(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function j1(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Pr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},yl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},QP=typeof navigator<"u"&&/Mac/.test(navigator.platform),ZP=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Rt=0;Rt<10;Rt++)Pr[48+Rt]=Pr[96+Rt]=String(Rt);for(var Rt=1;Rt<=24;Rt++)Pr[Rt+111]="F"+Rt;for(var Rt=65;Rt<=90;Rt++)Pr[Rt]=String.fromCharCode(Rt+32),yl[Rt]=String.fromCharCode(Rt);for(var kd in Pr)yl.hasOwnProperty(kd)||(yl[kd]=Pr[kd]);function e2(t){var e=QP&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ZP&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?yl:Pr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const t2=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function n2(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))t2?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function r2(t){let e=Object.create(null);for(let n in t)e[n2(n)]=t[n];return e}function Md(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function i2(t){return new lt({props:{handleKeyDown:TS(t)}})}function TS(t){let e=r2(t);return function(n,r){let i=e2(r),o,s=e[Md(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Md(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Pr[r.keyCode])&&o!=i){let a=e[Md(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const o2=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function kS(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const s2=(t,e,n)=>{let r=kS(t,n);if(!r)return!1;let i=Np(r);if(!i){let s=r.blockRange(),a=s&&bo(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(LS(t,i,e,-1))return!0;if(r.parent.content.size==0&&(no(o,"end")||Ae.isSelectable(o)))for(let s=r.depth;;s--){let a=Ac(t.doc,r.before(s),r.after(s),ve.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(no(o,"end")?De.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):Ae.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},a2=(t,e,n)=>{let r=kS(t,n);if(!r)return!1;let i=Np(r);return i?MS(t,i,e):!1},l2=(t,e,n)=>{let r=PS(t,n);if(!r)return!1;let i=jp(r);return i?MS(t,i,e):!1};function MS(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=Ac(t.doc,o,l,ve.empty);if(!c||c.from!=o||c instanceof bt&&c.slice.size>=l-o)return!1;if(n){let u=t.tr.step(c);u.setSelection(Pe.create(u.doc,o)),n(u.scrollIntoView())}return!0}function no(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const c2=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Np(r)}let s=o&&o.nodeBefore;return!s||!Ae.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ae.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Np(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function PS(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const u2=(t,e,n)=>{let r=PS(t,n);if(!r)return!1;let i=jp(r);if(!i)return!1;let o=i.nodeAfter;if(LS(t,i,e,1))return!0;if(r.parent.content.size==0&&(no(o,"start")||Ae.isSelectable(o))){let s=Ac(t.doc,r.before(),r.after(),ve.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(no(o,"start")?De.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):Ae.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},d2=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=jp(r)}let s=o&&o.nodeAfter;return!s||!Ae.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ae.create(t.doc,o.pos)).scrollIntoView()),!0)};function jp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const f2=(t,e)=>{let n=t.selection,r=n instanceof Ae,i;if(r){if(n.node.isTextblock||!Vr(t.doc,n.from))return!1;i=n.from}else if(i=Rc(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(Ae.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},h2=(t,e)=>{let n=t.selection,r;if(n instanceof Ae){if(n.node.isTextblock||!Vr(t.doc,n.to))return!1;r=n.to}else if(r=Rc(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},p2=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&bo(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},g2=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
46
+ `).scrollIntoView()),!0)};function IS(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const m2=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=IS(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(De.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},y2=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof cn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=IS(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(Pe.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},v2=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(qi(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&bo(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},b2=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(Ae.create(t.doc,i))),!0)};function w2(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Vr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function LS(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&w2(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let f=e.pos+o.nodeSize,p=le.empty;for(let y=s.length-1;y>=0;y--)p=le.from(s[y].create(null,p));p=le.from(i.copy(p));let g=t.tr.step(new wt(e.pos-1,f,e.pos,f,new ve(p,1,0),s.length,!0)),m=g.doc.resolve(f+2*s.length);m.nodeAfter&&m.nodeAfter.type==i.type&&Vr(g.doc,m.pos)&&g.join(m.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:De.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),h=d&&bo(d);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(d,h).scrollIntoView()),!0;if(c&&no(o,"start",!0)&&no(i,"end")){let f=i,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let g=o,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let y=le.empty;for(let w=p.length-1;w>=0;w--)y=le.from(p[w].copy(y));let x=t.tr.step(new wt(e.pos-p.length,e.pos+o.nodeSize,e.pos+m,e.pos+o.nodeSize-m,new ve(y,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function DS(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(Pe.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const S2=DS(-1),x2=DS(1);function C2(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&_p(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function F1(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function E2(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return _2(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function _2(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);o=new ul(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new ul(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=_p(o,n,r,e);return a?(t&&R2(t,e,a,i,n),!0):!1}function R2(t,e,n,r,i){let o=le.empty;for(let u=n.length-1;u>=0;u--)o=le.from(n[u].type.create(n[u].attrs,o));t.step(new wt(e.start-(r?2:0),e.end,e.start,e.end,new ve(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,h=!0;u<d;u++,h=!1)!h&&qi(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function A2(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?O2(e,n,t,o):T2(e,n,o):!0:!1}}function O2(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new wt(o-1,s,o,s,new ve(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ul(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=bo(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return Vr(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function T2(t,e,n){let r=t.tr,i=n.parent;for(let f=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?le.empty:le.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new wt(d-(a?1:0),h+(l?1:0),d+1,h-1,new ve((a?le.empty:le.from(i.copy(le.empty))).append(l?le.empty:le.from(i.copy(le.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function k2(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=le.from(c?t.create():null),d=new ve(le.from(t.create(null,le.from(a.type.create(null,u)))),c?3:1,0),h=o.start,f=o.end;n(e.tr.step(new wt(h-(c?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}function Pc(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Ic{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const d=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,c=e||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(r).map(([h,f])=>[h,(...g)=>{const m=this.buildProps(c,n),y=f(...g)(m);return a.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:Pc({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class M2{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function _e(t,e,n){return t.config[e]===void 0&&t.parent?_e(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?_e(t.parent,e,n):null}):t.config[e]}function Lc(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function NS(t){const e=[],{nodeExtensions:n,markExtensions:r}=Lc(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=_e(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([h,f])=>{e.push({type:d,name:h,attribute:{...o,...f}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=_e(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const h={...o,...d};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function xt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function nt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(u=>!l.includes(u));r[i]=[...l,...c].join(" ")}else if(i==="style"){const a=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[d,h]=u.split(":").map(f=>f.trim());c.set(d,h)}),a.forEach(u=>{const[d,h]=u.split(":").map(f=>f.trim());c.set(d,h)}),r[i]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[i]=o}),r},{})}function vl(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>nt(n,r),{})}function jS(t){return typeof t=="function"}function Le(t,e=void 0,...n){return jS(t)?e?t.bind(e)(...n):t(...n):t}function P2(t={}){return Object.keys(t).length===0&&t.constructor===Object}function I2(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function H1(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):I2(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function $1(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&P2(n)?!1:n!=null))}function L2(t,e){var n;const r=NS(t),{nodeExtensions:i,markExtensions:o}=Lc(t),s=(n=i.find(c=>_e(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((y,x)=>{const w=_e(x,"extendNodeSchema",d);return{...y,...w?w(c):{}}},{}),f=$1({...h,content:Le(_e(c,"content",d)),marks:Le(_e(c,"marks",d)),group:Le(_e(c,"group",d)),inline:Le(_e(c,"inline",d)),atom:Le(_e(c,"atom",d)),selectable:Le(_e(c,"selectable",d)),draggable:Le(_e(c,"draggable",d)),code:Le(_e(c,"code",d)),whitespace:Le(_e(c,"whitespace",d)),linebreakReplacement:Le(_e(c,"linebreakReplacement",d)),defining:Le(_e(c,"defining",d)),isolating:Le(_e(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var x;return[y.name,{default:(x=y==null?void 0:y.attribute)===null||x===void 0?void 0:x.default}]}))}),p=Le(_e(c,"parseHTML",d));p&&(f.parseDOM=p.map(y=>H1(y,u)));const g=_e(c,"renderHTML",d);g&&(f.toDOM=y=>g({node:y,HTMLAttributes:vl(y,u)}));const m=_e(c,"renderText",d);return m&&(f.toText=m),[c.name,f]})),l=Object.fromEntries(o.map(c=>{const u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((m,y)=>{const x=_e(y,"extendMarkSchema",d);return{...m,...x?x(c):{}}},{}),f=$1({...h,inclusive:Le(_e(c,"inclusive",d)),excludes:Le(_e(c,"excludes",d)),group:Le(_e(c,"group",d)),spanning:Le(_e(c,"spanning",d)),code:Le(_e(c,"code",d)),attrs:Object.fromEntries(u.map(m=>{var y;return[m.name,{default:(y=m==null?void 0:m.attribute)===null||y===void 0?void 0:y.default}]}))}),p=Le(_e(c,"parseHTML",d));p&&(f.parseDOM=p.map(m=>H1(m,u)));const g=_e(c,"renderHTML",d);return g&&(f.toDOM=m=>g({mark:m,HTMLAttributes:vl(m,u)})),[c.name,f]}));return new Mw({topNode:s,nodes:a,marks:l})}function Pd(t,e){return e.nodes[t]||e.marks[t]||null}function B1(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Fp(t,e){const n=Ri.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const D2=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function Hp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Dc{constructor(e){this.find=e.find,this.handler=e.handler}}const N2=(t,e)=>{if(Hp(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function xa(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const d=D2(c)+o;return s.forEach(h=>{if(u)return;const f=N2(d,h.find);if(!f)return;const p=l.state.tr,g=Pc({state:l.state,transaction:p}),m={from:r-(f[0].length-o.length),to:i},{commands:y,chain:x,can:w}=new Ic({editor:n,state:g});h.handler({state:g,range:m,match:f,commands:y,chain:x,can:w})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:i,text:o}),l.dispatch(p),u=!0)}),u}function j2(t){const{editor:e,rules:n}=t,r=new lt({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=Fp(le.from(u),s.schema);const{from:d}=l,h=d+u.length;xa({editor:e,from:d,to:h,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return xa({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&xa({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?xa({editor:e,from:s.pos,to:s.pos,text:`
47
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function F2(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ca(t){return F2(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Nc(t,e){const n={...t};return Ca(t)&&Ca(e)&&Object.keys(e).forEach(r=>{Ca(e[r])&&Ca(t[r])?n[r]=Nc(t[r],e[r]):n[r]=e[r]}),n}class It{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Le(_e(this,"addOptions",{name:this.name}))),this.storage=Le(_e(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new It(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new It(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Le(_e(n,"addOptions",{name:n.name})),n.storage=Le(_e(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function H2(t){return typeof t=="number"}class FS{constructor(e){this.find=e.find,this.handler=e.handler}}const $2=(t,e,n)=>{if(Hp(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function B2(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Ic({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,i,(f,p)=>{if(!f.isTextblock||f.type.spec.code)return;const g=Math.max(r,p),m=Math.min(i,p+f.content.size),y=f.textBetween(g-p,m-p,void 0,"");$2(y,o.find,s).forEach(w=>{if(w.index===void 0)return;const v=g+w.index+1,S=v+w[0].length,C={from:n.tr.mapping.map(v),to:n.tr.mapping.map(S)},_=o.handler({state:n,range:C,match:w,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(_)})}),d.every(f=>f!==null)}let Ea=null;const V2=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function z2(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:d,to:h,rule:f,pasteEvt:p})=>{const g=u.tr,m=Pc({state:u,transaction:g});if(!(!B2({editor:e,state:m,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new lt({view(d){const h=p=>{var g;r=!((g=d.dom.parentElement)===null||g===void 0)&&g.contains(p.target)?d.dom.parentElement:null,r&&(Ea=e)},f=()=>{Ea&&(Ea=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(o=r===d.dom.parentElement,a=h,!o){const f=Ea;f&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=h,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],g=p.getMeta("uiEvent")==="paste"&&!i,m=p.getMeta("uiEvent")==="drop"&&!o,y=p.getMeta("applyPasteRules"),x=!!y;if(!g&&!m&&!x)return;if(x){let{text:S}=y;typeof S=="string"?S=S:S=Fp(le.from(S),f.schema);const{from:C}=y,_=C+S.length,E=V2(S);return l({rule:u,state:f,from:C,to:{b:_},pasteEvt:E})}const w=h.doc.content.findDiffStart(f.doc.content),v=h.doc.content.findDiffEnd(f.doc.content);if(!(!H2(w)||!v||w===v.b))return l({rule:u,state:f,from:w,to:v,pasteEvt:s})}}))}function U2(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class zi{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=zi.resolve(e),this.schema=L2(this.extensions,n),this.setupExtensions()}static resolve(e){const n=zi.sort(zi.flatten(e)),r=U2(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=_e(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=_e(r,"priority")||100,s=_e(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Pd(n.name,this.schema)},i=_e(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=zi.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Pd(s.name,this.schema)},l=[],c=_e(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&_e(s,"exitable",a)&&(u.ArrowRight=()=>It.handleExit({editor:e,mark:s})),c){const g=Object.fromEntries(Object.entries(c()).map(([m,y])=>[m,()=>y({editor:e})]));u={...u,...g}}const d=i2(u);l.push(d);const h=_e(s,"addInputRules",a);B1(s,e.options.enableInputRules)&&h&&r.push(...h());const f=_e(s,"addPasteRules",a);B1(s,e.options.enablePasteRules)&&f&&i.push(...f());const p=_e(s,"addProseMirrorPlugins",a);if(p){const g=p();l.push(...g)}return l}).flat();return[j2({editor:e,rules:r}),...z2({editor:e,rules:i}),...o]}get attributes(){return NS(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Lc(this.extensions);return Object.fromEntries(n.filter(r=>!!_e(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:xt(r.name,this.schema)},s=_e(r,"addNodeView",o);if(!s)return[];const a=(l,c,u,d,h)=>{const f=vl(l,i);return s()({node:l,view:c,getPos:u,decorations:d,innerDecorations:h,editor:e,extension:r,HTMLAttributes:f})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Pd(e.name,this.schema)};e.type==="mark"&&(!((n=Le(_e(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=_e(e,"onBeforeCreate",r),o=_e(e,"onCreate",r),s=_e(e,"onUpdate",r),a=_e(e,"onSelectionUpdate",r),l=_e(e,"onTransaction",r),c=_e(e,"onFocus",r),u=_e(e,"onBlur",r),d=_e(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class ht{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Le(_e(this,"addOptions",{name:this.name}))),this.storage=Le(_e(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ht(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ht({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Le(_e(n,"addOptions",{name:n.name})),n.storage=Le(_e(n,"addStorage",{name:n.name,options:n.options})),n}}function HS(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
48
+
49
+ `,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,c,u,d)=>{var h;l.isBlock&&c>r&&(a+=o);const f=s==null?void 0:s[l.type.name];if(f)return u&&(a+=f({node:l,pos:c,parent:u,index:d,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,i-c))}),a}function $S(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const q2=ht.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new lt({key:new yt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=$S(n);return HS(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),W2=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),K2=(t=!1)=>({commands:e})=>e.setContent("",t),G2=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),h=c.resolve(u.map(l+a.nodeSize)),f=d.blockRange(h);if(!f)return;const p=bo(f);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,g)}(p||p===0)&&e.lift(f,p)})}),!0},J2=t=>e=>t(e),X2=()=>({state:t,dispatch:e})=>y2(t,e),Y2=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new Pe(r.doc.resolve(s-1))),!0},Q2=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},Z2=t=>({tr:e,state:n,dispatch:r})=>{const i=xt(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},eI=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},tI=()=>({state:t,dispatch:e})=>o2(t,e),nI=()=>({commands:t})=>t.keyboardShortcut("Enter"),rI=()=>({state:t,dispatch:e})=>m2(t,e);function bl(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Hp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function BS(t,e,n={}){return t.find(r=>r.type===e&&bl(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function V1(t,e,n={}){return!!BS(t,e,n)}function $p(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!BS([...i.node.marks],e,n)))return;let s=i.index,a=t.start()+i.offset,l=s+1,c=a+i.node.nodeSize;for(;s>0&&V1([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&V1([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Ur(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const iI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Ur(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const d=$p(l,o,e);if(d&&d.from<=c&&d.to>=u){const h=Pe.create(s,d.from,d.to);n.setSelection(h)}}return!0},oI=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Bp(t){return t instanceof Pe}function Zn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function VS(t,e=null){if(!e)return null;const n=De.atStart(t),r=De.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?Pe.create(t,Zn(0,i,o),Zn(t.content.size,i,o)):Pe.create(t,Zn(e,i,o),Zn(e,i,o))}function zS(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function jc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const sI=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(jc()||zS())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Bp(n.state.selection))return s(),!0;const a=VS(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},aI=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),lI=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),US=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&US(r)}return t};function _a(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return US(n)}function wl(t,e,n){if(t instanceof Or||t instanceof le)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return le.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),wl("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const l=new Mw({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?qo.fromSchema(l).parseSlice(_a(t),n.parseOptions):qo.fromSchema(l).parse(_a(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=qo.fromSchema(e);return n.slice?o.parseSlice(_a(t),n.parseOptions).content:o.parse(_a(t),n.parseOptions)}return wl("",e,n)}function cI(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof bt||i instanceof wt))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(De.near(t.doc.resolve(s),n))}const uI=t=>!("type"in t),dI=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=wl(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(p){return o.emit("contentError",{editor:o,error:p,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((uI(a)?a:[a]).forEach(p=>{p.check(),u=u?p.isText&&p.marks.length===0:!1,d=d?p.isBlock:!1}),l===c&&d){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}let f;if(u){if(Array.isArray(e))f=e.map(p=>p.text||"").join("");else if(e instanceof le){let p="";e.forEach(g=>{g.text&&(p+=g.text)}),f=p}else typeof e=="object"&&e&&e.text?f=e.text:f=e;r.insertText(f,l,c)}else f=a,r.replaceWith(l,c,f);n.updateSelection&&cI(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:f})}return!0},fI=()=>({state:t,dispatch:e})=>f2(t,e),hI=()=>({state:t,dispatch:e})=>h2(t,e),pI=()=>({state:t,dispatch:e})=>s2(t,e),gI=()=>({state:t,dispatch:e})=>u2(t,e),mI=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Rc(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},yI=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Rc(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},vI=()=>({state:t,dispatch:e})=>a2(t,e),bI=()=>({state:t,dispatch:e})=>l2(t,e);function qS(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function wI(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))jc()||qS()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const SI=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=wI(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ps(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?xt(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(i,h+d.nodeSize);a.push({node:d,from:f,to:p})});const l=i-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>bl(d.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((d,h)=>d+h.to-h.from,0)>=l}const xI=(t,e={})=>({state:n,dispatch:r})=>{const i=xt(t,n.schema);return ps(n,i,e)?p2(n,r):!1},CI=()=>({state:t,dispatch:e})=>v2(t,e),EI=t=>({state:e,dispatch:n})=>{const r=xt(t,e.schema);return A2(r)(e,n)},_I=()=>({state:t,dispatch:e})=>g2(t,e);function Fc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function z1(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const RI=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Fc(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=xt(t,r.schema)),a==="mark"&&(s=Ur(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{o&&o===c.type&&n.setNodeMarkup(u,void 0,z1(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(z1(d.attrs,e)))})})}),!0):!1},AI=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),OI=()=>({tr:t,dispatch:e})=>{if(e){const n=new cn(t.doc);t.setSelection(n)}return!0},TI=()=>({state:t,dispatch:e})=>c2(t,e),kI=()=>({state:t,dispatch:e})=>d2(t,e),MI=()=>({state:t,dispatch:e})=>b2(t,e),PI=()=>({state:t,dispatch:e})=>x2(t,e),II=()=>({state:t,dispatch:e})=>S2(t,e);function rh(t,e,n={},r={}){return wl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const LI=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,c;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const d=rh(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function WS(t,e){const n=Ur(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function DI(t,e){const n=new Kw(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function NI(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function jI(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function FI(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Vp(t){return e=>FI(e.$from,t)}function HI(t,e){const n={from:0,to:t.content.size};return HS(t,n,e)}function $I(t,e){const n=xt(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function KS(t,e){const n=Fc(typeof e=="string"?e:e.name,t.schema);return n==="node"?$I(t,e):n==="mark"?WS(t,e):{}}function BI(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function VI(t){const e=BI(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function zI(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(o).map(a,-1),u=e.slice(o).map(l),d=e.invert().map(c,-1),h=e.invert().map(u);r.push({oldRange:{from:d,to:h},newRange:{from:c,to:u}})})}),VI(r)}function zp(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=$p(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ga(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function ih(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Ur(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>bl(d.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;t.doc.nodesBetween(f,p,(g,m)=>{if(!g.isText&&!g.marks.length)return;const y=Math.max(f,m),x=Math.min(p,m+g.nodeSize),w=x-y;s+=w,a.push(...g.marks.map(v=>({mark:v,from:y,to:x})))})}),s===0)return!1;const l=a.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>bl(d.mark.attrs,n,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),c=a.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+c:l)>=s}function UI(t,e,n={}){if(!e)return ps(t,null,n)||ih(t,null,n);const r=Fc(e,t.schema);return r==="node"?ps(t,e,n):r==="mark"?ih(t,e,n):!1}function U1(t,e){const{nodeExtensions:n}=Lc(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Le(_e(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Up(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(Up(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function GS(t){return t instanceof Ae}function qI(t,e,n){const i=t.state.doc.content.size,o=Zn(e,0,i),s=Zn(n,0,i),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),h=Math.max(a.right,l.right),f=h-d,p=u-c,y={top:c,bottom:u,left:d,right:h,width:f,height:p,x:d,y:c};return{...y,toJSON:()=>y}}function WI(t,e,n){var r;const{selection:i}=e;let o=null;if(Bp(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,h)=>{if(c)return!1;if(u.isInline){const f=!h||h.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=f&&p}return!c}),c})}const KI=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Ur(t,r.schema);if(i)if(s){const c=WS(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(h,f)=>{const p=Math.max(f,u),g=Math.min(f+h.nodeSize,d);h.marks.find(y=>y.type===l)?h.marks.forEach(y=>{l===y.type&&n.addMark(p,g,l.create({...y.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return WI(r,n,l)},GI=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),JI=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=xt(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>F1(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>F1(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},XI=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Zn(t,0,r.content.size),o=Ae.create(r,i);e.setSelection(o)}return!0},YI=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=Pe.atStart(r).from,a=Pe.atEnd(r).to,l=Zn(i,s,a),c=Zn(o,s,a),u=Pe.create(r,l,c);e.setSelection(u)}return!0},QI=t=>({state:e,dispatch:n})=>{const r=xt(t,e.schema);return k2(r)(e,n)};function q1(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const ZI=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,u=Ga(c,a.node().type.name,a.node().attrs);if(o instanceof Ae&&o.node.isBlock)return!a.parentOffset||!qi(s,a.pos)?!1:(r&&(t&&q1(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:NI(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&h?[{type:h,attrs:u}]:void 0,p=qi(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!p&&qi(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(p=!0,f=h?[{type:h,attrs:u}]:void 0),r){if(p&&(o instanceof Pe&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),m=e.doc.resolve(g);a.node(-1).canReplaceWith(m.index(),m.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&q1(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},eL=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=xt(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==a)return!1;const h=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=le.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-x;E>=l.depth-3;E-=1)y=le.from(l.node(E).copy(y));const w=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...Ga(h,l.node().type.name,l.node().attrs),...e},S=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(v))||void 0;y=y.append(le.from(a.createAndFill(null,S)||void 0));const C=l.before(l.depth-(x-1));n.replace(C,l.after(-w),new ve(y,4-x,0));let _=-1;n.doc.nodesBetween(C,n.doc.content.size,(E,R)=>{if(_>-1)return!1;E.isTextblock&&E.content.size===0&&(_=R+1)}),_>-1&&n.setSelection(Pe.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,p={...Ga(h,d.type.name,d.attrs),...e},g={...Ga(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const m=f?[{type:a,attrs:p},{type:f,attrs:g}]:[{type:a,attrs:p}];if(!qi(n.doc,l.pos,2))return!1;if(i){const{selection:y,storedMarks:x}=r,{splittableMarks:w}=o.extensionManager,v=x||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,m).scrollIntoView(),!v||!i)return!0;const S=v.filter(C=>w.includes(C.type.name));n.ensureMarks(S)}return!0},Id=(t,e)=>{const n=Vp(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Vr(t.doc,n.pos)&&t.join(n.pos),!0},Ld=(t,e)=>{const n=Vp(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Vr(t.doc,r)&&t.join(r),!0},tL=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:h}=i.extensionManager,f=xt(t,s.schema),p=xt(e,s.schema),{selection:g,storedMarks:m}=s,{$from:y,$to:x}=g,w=y.blockRange(x),v=m||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const S=Vp(C=>U1(C.type.name,d))(g);if(w.depth>=1&&S&&w.depth-S.depth<=1){if(S.node.type===f)return c.liftListItem(p);if(U1(S.node.type.name,d)&&f.validContent(S.node.content)&&a)return l().command(()=>(o.setNodeMarkup(S.pos,f),!0)).command(()=>Id(o,f)).command(()=>Ld(o,f)).run()}return!n||!v||!a?l().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Id(o,f)).command(()=>Ld(o,f)).run():l().command(()=>{const C=u().wrapInList(f,r),_=v.filter(E=>h.includes(E.type.name));return o.ensureMarks(_),C?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Id(o,f)).command(()=>Ld(o,f)).run()},nL=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Ur(t,r.schema);return ih(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},rL=(t,e,n={})=>({state:r,commands:i})=>{const o=xt(t,r.schema),s=xt(e,r.schema),a=ps(r,o,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...n})},iL=(t,e={})=>({state:n,commands:r})=>{const i=xt(t,n.schema);return ps(n,i,e)?r.lift(i):r.wrapIn(i,e)},oL=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},sL=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},aL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Ur(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!i)return!0;if(u&&s){let{from:h,to:f}=a;const p=(o=c.marks().find(m=>m.type===l))===null||o===void 0?void 0:o.attrs,g=$p(c,l,p);g&&(h=g.from,f=g.to),n.removeMark(h,f,l)}else d.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},lL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Fc(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=xt(t,r.schema)),a==="mark"&&(s=Ur(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let d,h,f,p;n.selection.empty?r.doc.nodesBetween(c,u,(g,m)=>{o&&o===g.type&&(f=Math.max(m,c),p=Math.min(m+g.nodeSize,u),d=m,h=g)}):r.doc.nodesBetween(c,u,(g,m)=>{m<c&&o&&o===g.type&&(f=Math.max(m,c),p=Math.min(m+g.nodeSize,u),d=m,h=g),m>=c&&m<=u&&(o&&o===g.type&&n.setNodeMarkup(m,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(y=>{if(s===y.type){const x=Math.max(m,c),w=Math.min(m+g.nodeSize,u);n.addMark(x,w,s.create({...y.attrs,...e}))}}))}),h&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&n.addMark(f,p,s.create({...g.attrs,...e}))}))}),!0):!1},cL=(t,e={})=>({state:n,dispatch:r})=>{const i=xt(t,n.schema);return C2(i,e)(n,r)},uL=(t,e={})=>({state:n,dispatch:r})=>{const i=xt(t,n.schema);return E2(i,e)(n,r)};var dL=Object.freeze({__proto__:null,blur:W2,clearContent:K2,clearNodes:G2,command:J2,createParagraphNear:X2,cut:Y2,deleteCurrentNode:Q2,deleteNode:Z2,deleteRange:eI,deleteSelection:tI,enter:nI,exitCode:rI,extendMarkRange:iI,first:oI,focus:sI,forEach:aI,insertContent:lI,insertContentAt:dI,joinBackward:pI,joinDown:hI,joinForward:gI,joinItemBackward:mI,joinItemForward:yI,joinTextblockBackward:vI,joinTextblockForward:bI,joinUp:fI,keyboardShortcut:SI,lift:xI,liftEmptyBlock:CI,liftListItem:EI,newlineInCode:_I,resetAttributes:RI,scrollIntoView:AI,selectAll:OI,selectNodeBackward:TI,selectNodeForward:kI,selectParentNode:MI,selectTextblockEnd:PI,selectTextblockStart:II,setContent:LI,setMark:KI,setMeta:GI,setNode:JI,setNodeSelection:XI,setTextSelection:YI,sinkListItem:QI,splitBlock:ZI,splitListItem:eL,toggleList:tL,toggleMark:nL,toggleNode:rL,toggleWrap:iL,undoInputRule:oL,unsetAllMarks:sL,unsetMark:aL,updateAttributes:lL,wrapIn:cL,wrapInList:uL});const fL=ht.create({name:"commands",addCommands(){return{...dL}}}),hL=ht.create({name:"drop",addProseMirrorPlugins(){return[new lt({key:new yt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),pL=ht.create({name:"editable",addProseMirrorPlugins(){return[new lt({key:new yt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),gL=ht.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new lt({key:new yt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),mL=ht.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:h,parent:f}=d,p=d.parent.isTextblock&&h>0?a.doc.resolve(h-1):d,g=p.parent.type.spec.isolating,m=d.pos-d.parentOffset,y=g&&p.parent.childCount===1?m===d.pos:De.atStart(c).from===h;return!u||!f.type.isTextblock||f.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return jc()||qS()?o:i},addProseMirrorPlugins(){return[new lt({key:new yt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:a}=e.selection,l=De.atStart(e.doc).from,c=De.atEnd(e.doc).to;if(o||!(s===l&&a===c)||!Up(n.doc))return;const h=n.tr,f=Pc({state:n,transaction:h}),{commands:p}=new Ic({editor:this.editor,state:f});if(p.clearNodes(),!!h.steps.length)return h}})]}}),yL=ht.create({name:"paste",addProseMirrorPlugins(){return[new lt({key:new yt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),vL=ht.create({name:"tabindex",addProseMirrorPlugins(){return[new lt({key:new yt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class ei{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new ei(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new ei(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new ei(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;const l=new ei(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new ei(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const bL=`.ProseMirror {
50
+ position: relative;
51
+ }
52
+
53
+ .ProseMirror {
54
+ word-wrap: break-word;
55
+ white-space: pre-wrap;
56
+ white-space: break-spaces;
57
+ -webkit-font-variant-ligatures: none;
58
+ font-variant-ligatures: none;
59
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
60
+ }
61
+
62
+ .ProseMirror [contenteditable="false"] {
63
+ white-space: normal;
64
+ }
65
+
66
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
67
+ white-space: pre-wrap;
68
+ }
69
+
70
+ .ProseMirror pre {
71
+ white-space: pre-wrap;
72
+ }
73
+
74
+ img.ProseMirror-separator {
75
+ display: inline !important;
76
+ border: none !important;
77
+ margin: 0 !important;
78
+ width: 0 !important;
79
+ height: 0 !important;
80
+ }
81
+
82
+ .ProseMirror-gapcursor {
83
+ display: none;
84
+ pointer-events: none;
85
+ position: absolute;
86
+ margin: 0;
87
+ }
88
+
89
+ .ProseMirror-gapcursor:after {
90
+ content: "";
91
+ display: block;
92
+ position: absolute;
93
+ top: -2px;
94
+ width: 20px;
95
+ border-top: 1px solid black;
96
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
97
+ }
98
+
99
+ @keyframes ProseMirror-cursor-blink {
100
+ to {
101
+ visibility: hidden;
102
+ }
103
+ }
104
+
105
+ .ProseMirror-hideselection *::selection {
106
+ background: transparent;
107
+ }
108
+
109
+ .ProseMirror-hideselection *::-moz-selection {
110
+ background: transparent;
111
+ }
112
+
113
+ .ProseMirror-hideselection * {
114
+ caret-color: transparent;
115
+ }
116
+
117
+ .ProseMirror-focused .ProseMirror-gapcursor {
118
+ display: block;
119
+ }
120
+
121
+ .tippy-box[data-animation=fade][data-state=hidden] {
122
+ opacity: 0
123
+ }`;function wL(t,e,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let SL=class extends M2{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=wL(bL,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=jS(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=n.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[pL,q2.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),fL,gL,mL,vL,hL,yL].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new zi(i,this)}createCommandManager(){this.commandManager=new Ic({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=rh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=rh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=VS(n,this.options.autofocus);this.view=new JP(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Vi.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return KS(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return UI(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Fp(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
124
+
125
+ `,textSerializers:r={}}=e||{};return HI(this.state.doc,{blockSeparator:n,textSerializers:{...$S(this.schema),...r}})}get isEmpty(){return Up(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new ei(n,this)}get $doc(){return this.$pos(0)}};function wi(t){return new Dc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Le(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(zp(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;u<n.to&&o.delete(u,n.to),c>n.from&&o.delete(n.from+l,c);const h=n.from+l+s.length;o.addMark(n.from+l,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function xL(t){return new Dc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Le(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;o.insert(c,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function oh(t){return new Dc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=Le(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function gs(t){return new Dc({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=Le(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&_p(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=t.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const g=p.filter(m=>f.includes(m.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Vr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class $t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Le(_e(this,"addOptions",{name:this.name}))),this.storage=Le(_e(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new $t(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Nc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new $t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Le(_e(n,"addOptions",{name:n.name})),n.storage=Le(_e(n,"addStorage",{name:n.name,options:n.options})),n}}class CL{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,o,s,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let h=0,f=0;if(this.dom!==d){const y=this.dom.getBoundingClientRect(),x=d.getBoundingClientRect(),w=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,v=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;h=x.x-y.x+w,f=x.y-y.y+v}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,h,f);const p=this.getPos();if(typeof p!="number")return;const g=Ae.create(c.state.doc,p),m=c.state.tr.setSelection(g);c.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=Ae.isSelectable(this.node),h=e.type==="copy",f=e.type==="paste",p=e.type==="cut",g=e.type==="mousedown";if(!u&&d&&o&&e.target===this.dom&&e.preventDefault(),u&&o&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(u&&l&&!c&&g){const m=r.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||h||f||p||g&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(jc()||zS())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Ir(t){return new FS({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=Le(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),h=d+a.length;if(zp(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+u,d),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function EL(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function _L(t){return new FS({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:i}){const o=Le(t.getAttributes,void 0,e,i),s=Le(t.getContent,void 0,o);if(o===!1||o===null)return null;const a={type:t.type.name,attrs:o};s&&(a.content=s),e.input&&n().deleteRange(r).insertContentAt(r.from,a)}})}var Gt="top",hn="bottom",pn="right",Jt="left",qp="auto",Bs=[Gt,hn,pn,Jt],ro="start",ms="end",RL="clippingParents",JS="viewport",Mo="popper",AL="reference",W1=Bs.reduce(function(t,e){return t.concat([e+"-"+ro,e+"-"+ms])},[]),XS=[].concat(Bs,[qp]).reduce(function(t,e){return t.concat([e,e+"-"+ro,e+"-"+ms])},[]),OL="beforeRead",TL="read",kL="afterRead",ML="beforeMain",PL="main",IL="afterMain",LL="beforeWrite",DL="write",NL="afterWrite",jL=[OL,TL,kL,ML,PL,IL,LL,DL,NL];function Dn(t){return t?(t.nodeName||"").toLowerCase():null}function en(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Si(t){var e=en(t).Element;return t instanceof e||t instanceof Element}function dn(t){var e=en(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Wp(t){if(typeof ShadowRoot>"u")return!1;var e=en(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function FL(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!dn(o)||!Dn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function HL(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!dn(i)||!Dn(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const YS={name:"applyStyles",enabled:!0,phase:"write",fn:FL,effect:HL,requires:["computeStyles"]};function Tn(t){return t.split("-")[0]}var di=Math.max,Sl=Math.min,io=Math.round;function sh(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function QS(){return!/^((?!chrome|android).)*safari/i.test(sh())}function oo(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&dn(t)&&(i=t.offsetWidth>0&&io(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&io(r.height)/t.offsetHeight||1);var s=Si(t)?en(t):window,a=s.visualViewport,l=!QS()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,d=r.width/i,h=r.height/o;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function Kp(t){var e=oo(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ZS(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Wp(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ir(t){return en(t).getComputedStyle(t)}function $L(t){return["table","td","th"].indexOf(Dn(t))>=0}function qr(t){return((Si(t)?t.ownerDocument:t.document)||window.document).documentElement}function Hc(t){return Dn(t)==="html"?t:t.assignedSlot||t.parentNode||(Wp(t)?t.host:null)||qr(t)}function K1(t){return!dn(t)||ir(t).position==="fixed"?null:t.offsetParent}function BL(t){var e=/firefox/i.test(sh()),n=/Trident/i.test(sh());if(n&&dn(t)){var r=ir(t);if(r.position==="fixed")return null}var i=Hc(t);for(Wp(i)&&(i=i.host);dn(i)&&["html","body"].indexOf(Dn(i))<0;){var o=ir(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Vs(t){for(var e=en(t),n=K1(t);n&&$L(n)&&ir(n).position==="static";)n=K1(n);return n&&(Dn(n)==="html"||Dn(n)==="body"&&ir(n).position==="static")?e:n||BL(t)||e}function Gp(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Jo(t,e,n){return di(t,Sl(e,n))}function VL(t,e,n){var r=Jo(t,e,n);return r>n?n:r}function ex(){return{top:0,right:0,bottom:0,left:0}}function tx(t){return Object.assign({},ex(),t)}function nx(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var zL=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,tx(typeof e!="number"?e:nx(e,Bs))};function UL(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Tn(n.placement),l=Gp(a),c=[Jt,pn].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=zL(i.padding,n),h=Kp(o),f=l==="y"?Gt:Jt,p=l==="y"?hn:pn,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],y=Vs(o),x=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,w=g/2-m/2,v=d[f],S=x-h[u]-d[p],C=x/2-h[u]/2+w,_=Jo(v,C,S),E=l;n.modifiersData[r]=(e={},e[E]=_,e.centerOffset=_-C,e)}}function qL(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ZS(e.elements.popper,i)&&(e.elements.arrow=i))}const WL={name:"arrow",enabled:!0,phase:"main",fn:UL,effect:qL,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function so(t){return t.split("-")[1]}var KL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function GL(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:io(n*i)/i||0,y:io(r*i)/i||0}}function G1(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,h=s.x,f=h===void 0?0:h,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var y=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),w=Jt,v=Gt,S=window;if(c){var C=Vs(n),_="clientHeight",E="clientWidth";if(C===en(n)&&(C=qr(n),ir(C).position!=="static"&&a==="absolute"&&(_="scrollHeight",E="scrollWidth")),C=C,i===Gt||(i===Jt||i===pn)&&o===ms){v=hn;var R=d&&C===S&&S.visualViewport?S.visualViewport.height:C[_];g-=R-r.height,g*=l?1:-1}if(i===Jt||(i===Gt||i===hn)&&o===ms){w=pn;var A=d&&C===S&&S.visualViewport?S.visualViewport.width:C[E];f-=A-r.width,f*=l?1:-1}}var T=Object.assign({position:a},c&&KL),k=u===!0?GL({x:f,y:g},en(n)):{x:f,y:g};if(f=k.x,g=k.y,l){var P;return Object.assign({},T,(P={},P[v]=x?"0":"",P[w]=y?"0":"",P.transform=(S.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",P))}return Object.assign({},T,(e={},e[v]=x?g+"px":"",e[w]=y?f+"px":"",e.transform="",e))}function JL(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Tn(e.placement),variation:so(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,G1(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,G1(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const XL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JL,data:{}};var Ra={passive:!0};function YL(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=en(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,Ra)}),a&&l.addEventListener("resize",n.update,Ra),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Ra)}),a&&l.removeEventListener("resize",n.update,Ra)}}const QL={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:YL,data:{}};var ZL={left:"right",right:"left",bottom:"top",top:"bottom"};function Ja(t){return t.replace(/left|right|bottom|top/g,function(e){return ZL[e]})}var eD={start:"end",end:"start"};function J1(t){return t.replace(/start|end/g,function(e){return eD[e]})}function Jp(t){var e=en(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Xp(t){return oo(qr(t)).left+Jp(t).scrollLeft}function tD(t,e){var n=en(t),r=qr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=QS();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Xp(t),y:l}}function nD(t){var e,n=qr(t),r=Jp(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=di(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=di(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Xp(t),l=-r.scrollTop;return ir(i||n).direction==="rtl"&&(a+=di(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Yp(t){var e=ir(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function rx(t){return["html","body","#document"].indexOf(Dn(t))>=0?t.ownerDocument.body:dn(t)&&Yp(t)?t:rx(Hc(t))}function Xo(t,e){var n;e===void 0&&(e=[]);var r=rx(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=en(r),s=i?[o].concat(o.visualViewport||[],Yp(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Xo(Hc(s)))}function ah(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function rD(t,e){var n=oo(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function X1(t,e,n){return e===JS?ah(tD(t,n)):Si(e)?rD(e,n):ah(nD(qr(t)))}function iD(t){var e=Xo(Hc(t)),n=["absolute","fixed"].indexOf(ir(t).position)>=0,r=n&&dn(t)?Vs(t):t;return Si(r)?e.filter(function(i){return Si(i)&&ZS(i,r)&&Dn(i)!=="body"}):[]}function oD(t,e,n,r){var i=e==="clippingParents"?iD(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=X1(t,c,r);return l.top=di(u.top,l.top),l.right=Sl(u.right,l.right),l.bottom=Sl(u.bottom,l.bottom),l.left=di(u.left,l.left),l},X1(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ix(t){var e=t.reference,n=t.element,r=t.placement,i=r?Tn(r):null,o=r?so(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Gt:l={x:s,y:e.y-n.height};break;case hn:l={x:s,y:e.y+e.height};break;case pn:l={x:e.x+e.width,y:a};break;case Jt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?Gp(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case ro:l[c]=l[c]-(e[u]/2-n[u]/2);break;case ms:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function ys(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?RL:a,c=n.rootBoundary,u=c===void 0?JS:c,d=n.elementContext,h=d===void 0?Mo:d,f=n.altBoundary,p=f===void 0?!1:f,g=n.padding,m=g===void 0?0:g,y=tx(typeof m!="number"?m:nx(m,Bs)),x=h===Mo?AL:Mo,w=t.rects.popper,v=t.elements[p?x:h],S=oD(Si(v)?v:v.contextElement||qr(t.elements.popper),l,u,s),C=oo(t.elements.reference),_=ix({reference:C,element:w,strategy:"absolute",placement:i}),E=ah(Object.assign({},w,_)),R=h===Mo?E:C,A={top:S.top-R.top+y.top,bottom:R.bottom-S.bottom+y.bottom,left:S.left-R.left+y.left,right:R.right-S.right+y.right},T=t.modifiersData.offset;if(h===Mo&&T){var k=T[i];Object.keys(A).forEach(function(P){var M=[pn,hn].indexOf(P)>=0?1:-1,j=[Gt,hn].indexOf(P)>=0?"y":"x";A[P]+=k[j]*M})}return A}function sD(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?XS:l,u=so(r),d=u?a?W1:W1.filter(function(p){return so(p)===u}):Bs,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,g){return p[g]=ys(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[Tn(g)],p},{});return Object.keys(f).sort(function(p,g){return f[p]-f[g]})}function aD(t){if(Tn(t)===qp)return[];var e=Ja(t);return[J1(t),e,J1(e)]}function lD(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,g=n.allowedAutoPlacements,m=e.options.placement,y=Tn(m),x=y===m,w=l||(x||!p?[Ja(m)]:aD(m)),v=[m].concat(w).reduce(function(de,ue){return de.concat(Tn(ue)===qp?sD(e,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):ue)},[]),S=e.rects.reference,C=e.rects.popper,_=new Map,E=!0,R=v[0],A=0;A<v.length;A++){var T=v[A],k=Tn(T),P=so(T)===ro,M=[Gt,hn].indexOf(k)>=0,j=M?"width":"height",z=ys(e,{placement:T,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),$=M?P?pn:Jt:P?hn:Gt;S[j]>C[j]&&($=Ja($));var J=Ja($),K=[];if(o&&K.push(z[k]<=0),a&&K.push(z[$]<=0,z[J]<=0),K.every(function(de){return de})){R=T,E=!1;break}_.set(T,K)}if(E)for(var D=p?3:1,Q=function(ue){var pe=v.find(function(L){var ce=_.get(L);if(ce)return ce.slice(0,ue).every(function(me){return me})});if(pe)return R=pe,"break"},se=D;se>0;se--){var oe=Q(se);if(oe==="break")break}e.placement!==R&&(e.modifiersData[r]._skip=!0,e.placement=R,e.reset=!0)}}const cD={name:"flip",enabled:!0,phase:"main",fn:lD,requiresIfExists:["offset"],data:{_skip:!1}};function Y1(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Q1(t){return[Gt,pn,hn,Jt].some(function(e){return t[e]>=0})}function uD(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ys(e,{elementContext:"reference"}),a=ys(e,{altBoundary:!0}),l=Y1(s,r),c=Y1(a,i,o),u=Q1(l),d=Q1(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const dD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:uD};function fD(t,e,n){var r=Tn(t),i=[Jt,Gt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Jt,pn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function hD(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=XS.reduce(function(u,d){return u[d]=fD(d,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const pD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:hD};function gD(t){var e=t.state,n=t.name;e.modifiersData[n]=ix({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const mD={name:"popperOffsets",enabled:!0,phase:"read",fn:gD,data:{}};function yD(t){return t==="x"?"y":"x"}function vD(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,g=p===void 0?0:p,m=ys(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=Tn(e.placement),x=so(e.placement),w=!x,v=Gp(y),S=yD(v),C=e.modifiersData.popperOffsets,_=e.rects.reference,E=e.rects.popper,R=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,A=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(C){if(o){var P,M=v==="y"?Gt:Jt,j=v==="y"?hn:pn,z=v==="y"?"height":"width",$=C[v],J=$+m[M],K=$-m[j],D=f?-E[z]/2:0,Q=x===ro?_[z]:E[z],se=x===ro?-E[z]:-_[z],oe=e.elements.arrow,de=f&&oe?Kp(oe):{width:0,height:0},ue=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ex(),pe=ue[M],L=ue[j],ce=Jo(0,_[z],de[z]),me=w?_[z]/2-D-ce-pe-A.mainAxis:Q-ce-pe-A.mainAxis,be=w?-_[z]/2+D+ce+L+A.mainAxis:se+ce+L+A.mainAxis,F=e.elements.arrow&&Vs(e.elements.arrow),I=F?v==="y"?F.clientTop||0:F.clientLeft||0:0,je=(P=T==null?void 0:T[v])!=null?P:0,G=$+me-je-I,ne=$+be-je,X=Jo(f?Sl(J,G):J,$,f?di(K,ne):K);C[v]=X,k[v]=X-$}if(a){var W,B=v==="x"?Gt:Jt,ee=v==="x"?hn:pn,xe=C[S],we=S==="y"?"height":"width",Z=xe+m[B],Se=xe-m[ee],U=[Gt,Jt].indexOf(y)!==-1,H=(W=T==null?void 0:T[S])!=null?W:0,re=U?Z:xe-_[we]-E[we]-H+A.altAxis,V=U?xe+_[we]+E[we]-H-A.altAxis:Se,te=f&&U?VL(re,xe,V):Jo(f?re:Z,xe,f?V:Se);C[S]=te,k[S]=te-xe}e.modifiersData[r]=k}}const bD={name:"preventOverflow",enabled:!0,phase:"main",fn:vD,requiresIfExists:["offset"]};function wD(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function SD(t){return t===en(t)||!dn(t)?Jp(t):wD(t)}function xD(t){var e=t.getBoundingClientRect(),n=io(e.width)/t.offsetWidth||1,r=io(e.height)/t.offsetHeight||1;return n!==1||r!==1}function CD(t,e,n){n===void 0&&(n=!1);var r=dn(e),i=dn(e)&&xD(e),o=qr(e),s=oo(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Dn(e)!=="body"||Yp(o))&&(a=SD(e)),dn(e)?(l=oo(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Xp(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function ED(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function _D(t){var e=ED(t);return jL.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function RD(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function AD(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Z1={placement:"bottom",modifiers:[],strategy:"absolute"};function e0(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function OD(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Z1:i;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Z1,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],h=!1,f={state:u,setOptions:function(y){var x=typeof y=="function"?y(u.options):y;g(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:Si(a)?Xo(a):a.contextElement?Xo(a.contextElement):[],popper:Xo(l)};var w=_D(AD([].concat(r,u.options.modifiers)));return u.orderedModifiers=w.filter(function(v){return v.enabled}),p(),f.update()},forceUpdate:function(){if(!h){var y=u.elements,x=y.reference,w=y.popper;if(e0(x,w)){u.rects={reference:CD(x,Vs(w),u.options.strategy==="fixed"),popper:Kp(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(A){return u.modifiersData[A.name]=Object.assign({},A.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var S=u.orderedModifiers[v],C=S.fn,_=S.options,E=_===void 0?{}:_,R=S.name;typeof C=="function"&&(u=C({state:u,options:E,name:R,instance:f})||u)}}}},update:RD(function(){return new Promise(function(m){f.forceUpdate(),m(u)})}),destroy:function(){g(),h=!0}};if(!e0(a,l))return f;f.setOptions(c).then(function(m){!h&&c.onFirstUpdate&&c.onFirstUpdate(m)});function p(){u.orderedModifiers.forEach(function(m){var y=m.name,x=m.options,w=x===void 0?{}:x,v=m.effect;if(typeof v=="function"){var S=v({state:u,name:y,instance:f,options:w}),C=function(){};d.push(S||C)}})}function g(){d.forEach(function(m){return m()}),d=[]}return f}}var TD=[QL,mD,XL,YS,pD,cD,bD,WL,dD],kD=OD({defaultModifiers:TD}),MD="tippy-box",ox="tippy-content",PD="tippy-backdrop",sx="tippy-arrow",ax="tippy-svg-arrow",Qr={passive:!0,capture:!0},lx=function(){return document.body};function ID(t,e){return{}.hasOwnProperty.call(t,e)}function Dd(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Qp(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function cx(t,e){return typeof t=="function"?t.apply(void 0,e):t}function t0(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function LD(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function DD(t){return t.split(/\s+/).filter(Boolean)}function $i(t){return[].concat(t)}function n0(t,e){t.indexOf(e)===-1&&t.push(e)}function ND(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function jD(t){return t.split("-")[0]}function xl(t){return[].slice.call(t)}function r0(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Yo(){return document.createElement("div")}function vs(t){return["Element","Fragment"].some(function(e){return Qp(t,e)})}function FD(t){return Qp(t,"NodeList")}function HD(t){return Qp(t,"MouseEvent")}function $D(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function BD(t){return vs(t)?[t]:FD(t)?xl(t):Array.isArray(t)?t:xl(document.querySelectorAll(t))}function Nd(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function i0(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function VD(t){var e,n=$i(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function zD(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,c=jD(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,g=o.top-r+d>l,m=r-o.bottom-h>l,y=o.left-n+f>l,x=n-o.right-p>l;return g||m||y||x})}function jd(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function o0(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Rn={isTouch:!1},s0=0;function UD(){Rn.isTouch||(Rn.isTouch=!0,window.performance&&document.addEventListener("mousemove",ux))}function ux(){var t=performance.now();t-s0<20&&(Rn.isTouch=!1,document.removeEventListener("mousemove",ux)),s0=t}function qD(){var t=document.activeElement;if($D(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function WD(){document.addEventListener("touchstart",UD,Qr),window.addEventListener("blur",qD)}var KD=typeof window<"u"&&typeof document<"u",GD=KD?!!window.msCrypto:!1;function Di(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function a0(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function JD(t){return a0(`
126
+ %ctippy.js
127
+
128
+ %c`+a0(t)+`
129
+
130
+ %c👷‍ This is a development-only message. It will be removed in production.
131
+ `)}function dx(t){return[JD(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var bs;process.env.NODE_ENV!=="production"&&XD();function XD(){bs=new Set}function Xn(t,e){if(t&&!bs.has(e)){var n;bs.add(e),(n=console).warn.apply(n,dx(e))}}function lh(t,e){if(t&&!bs.has(e)){var n;bs.add(e),(n=console).error.apply(n,dx(e))}}function YD(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;lh(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),lh(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var fx={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},QD={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Zt=Object.assign({appendTo:lx,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},fx,QD),ZD=Object.keys(Zt),eN=function(e){process.env.NODE_ENV!=="production"&&px(e,[]);var n=Object.keys(e);n.forEach(function(r){Zt[r]=e[r]})};function hx(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=Zt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function tN(t,e){var n=e?Object.keys(hx(Object.assign({},Zt,{plugins:e}))):ZD,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function l0(t,e){var n=Object.assign({},e,{content:cx(e.content,[t])},e.ignoreAttributes?{}:tN(t,e.plugins));return n.aria=Object.assign({},Zt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function px(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=LD(Zt,Object.keys(fx)),o=!ID(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),Xn(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
132
+
133
+ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
134
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var nN=function(){return"innerHTML"};function ch(t,e){t[nN()]=e}function c0(t){var e=Yo();return t===!0?e.className=sx:(e.className=ax,vs(t)?e.appendChild(t):ch(e,t)),e}function u0(t,e){vs(e.content)?(ch(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ch(t,e.content):t.textContent=e.content)}function uh(t){var e=t.firstElementChild,n=xl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(ox)}),arrow:n.find(function(r){return r.classList.contains(sx)||r.classList.contains(ax)}),backdrop:n.find(function(r){return r.classList.contains(PD)})}}function gx(t){var e=Yo(),n=Yo();n.className=MD,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Yo();r.className=ox,r.setAttribute("data-state","hidden"),u0(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=uh(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&u0(c,t.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(c0(s.arrow))):l.appendChild(c0(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:i}}gx.$$tippy=!0;var rN=1,Aa=[],Fd=[];function iN(t,e){var n=l0(t,Object.assign({},Zt,hx(r0(e)))),r,i,o,s=!1,a=!1,l=!1,c=!1,u,d,h,f=[],p=t0(G,n.interactiveDebounce),g,m=rN++,y=null,x=ND(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:m,reference:t,popper:Yo(),popperInstance:y,props:n,state:w,plugins:x,clearDelayTimeouts:re,setProps:V,setContent:te,show:fe,hide:ye,hideWithInteractivity:Ce,enable:U,disable:H,unmount:Fe,destroy:Ve};if(!n.render)return process.env.NODE_ENV!=="production"&&lh(!0,"render() function has not been supplied."),v;var S=n.render(v),C=S.popper,_=S.onUpdate;C.setAttribute("data-tippy-root",""),C.id="tippy-"+v.id,v.popper=C,t._tippy=v,C._tippy=v;var E=x.map(function(q){return q.fn(v)}),R=t.hasAttribute("aria-expanded");return F(),D(),$(),J("onCreate",[v]),n.showOnCreate&&Z(),C.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),C.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&M().addEventListener("mousemove",p)}),v;function A(){var q=v.props.touch;return Array.isArray(q)?q:[q,0]}function T(){return A()[0]==="hold"}function k(){var q;return!!((q=v.props.render)!=null&&q.$$tippy)}function P(){return g||t}function M(){var q=P().parentNode;return q?VD(q):document}function j(){return uh(C)}function z(q){return v.state.isMounted&&!v.state.isVisible||Rn.isTouch||u&&u.type==="focus"?0:Dd(v.props.delay,q?0:1,Zt.delay)}function $(q){q===void 0&&(q=!1),C.style.pointerEvents=v.props.interactive&&!q?"":"none",C.style.zIndex=""+v.props.zIndex}function J(q,ae,ge){if(ge===void 0&&(ge=!0),E.forEach(function(Oe){Oe[q]&&Oe[q].apply(Oe,ae)}),ge){var Te;(Te=v.props)[q].apply(Te,ae)}}function K(){var q=v.props.aria;if(q.content){var ae="aria-"+q.content,ge=C.id,Te=$i(v.props.triggerTarget||t);Te.forEach(function(Oe){var Be=Oe.getAttribute(ae);if(v.state.isVisible)Oe.setAttribute(ae,Be?Be+" "+ge:ge);else{var Re=Be&&Be.replace(ge,"").trim();Re?Oe.setAttribute(ae,Re):Oe.removeAttribute(ae)}})}}function D(){if(!(R||!v.props.aria.expanded)){var q=$i(v.props.triggerTarget||t);q.forEach(function(ae){v.props.interactive?ae.setAttribute("aria-expanded",v.state.isVisible&&ae===P()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function Q(){M().removeEventListener("mousemove",p),Aa=Aa.filter(function(q){return q!==p})}function se(q){if(!(Rn.isTouch&&(l||q.type==="mousedown"))){var ae=q.composedPath&&q.composedPath()[0]||q.target;if(!(v.props.interactive&&o0(C,ae))){if($i(v.props.triggerTarget||t).some(function(ge){return o0(ge,ae)})){if(Rn.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else J("onClickOutside",[v,q]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||pe())}}}function oe(){l=!0}function de(){l=!1}function ue(){var q=M();q.addEventListener("mousedown",se,!0),q.addEventListener("touchend",se,Qr),q.addEventListener("touchstart",de,Qr),q.addEventListener("touchmove",oe,Qr)}function pe(){var q=M();q.removeEventListener("mousedown",se,!0),q.removeEventListener("touchend",se,Qr),q.removeEventListener("touchstart",de,Qr),q.removeEventListener("touchmove",oe,Qr)}function L(q,ae){me(q,function(){!v.state.isVisible&&C.parentNode&&C.parentNode.contains(C)&&ae()})}function ce(q,ae){me(q,ae)}function me(q,ae){var ge=j().box;function Te(Oe){Oe.target===ge&&(jd(ge,"remove",Te),ae())}if(q===0)return ae();jd(ge,"remove",d),jd(ge,"add",Te),d=Te}function be(q,ae,ge){ge===void 0&&(ge=!1);var Te=$i(v.props.triggerTarget||t);Te.forEach(function(Oe){Oe.addEventListener(q,ae,ge),f.push({node:Oe,eventType:q,handler:ae,options:ge})})}function F(){T()&&(be("touchstart",je,{passive:!0}),be("touchend",ne,{passive:!0})),DD(v.props.trigger).forEach(function(q){if(q!=="manual")switch(be(q,je),q){case"mouseenter":be("mouseleave",ne);break;case"focus":be(GD?"focusout":"blur",X);break;case"focusin":be("focusout",X);break}})}function I(){f.forEach(function(q){var ae=q.node,ge=q.eventType,Te=q.handler,Oe=q.options;ae.removeEventListener(ge,Te,Oe)}),f=[]}function je(q){var ae,ge=!1;if(!(!v.state.isEnabled||W(q)||a)){var Te=((ae=u)==null?void 0:ae.type)==="focus";u=q,g=q.currentTarget,D(),!v.state.isVisible&&HD(q)&&Aa.forEach(function(Oe){return Oe(q)}),q.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||s)&&v.props.hideOnClick!==!1&&v.state.isVisible?ge=!0:Z(q),q.type==="click"&&(s=!ge),ge&&!Te&&Se(q)}}function G(q){var ae=q.target,ge=P().contains(ae)||C.contains(ae);if(!(q.type==="mousemove"&&ge)){var Te=we().concat(C).map(function(Oe){var Be,Re=Oe._tippy,Xe=(Be=Re.popperInstance)==null?void 0:Be.state;return Xe?{popperRect:Oe.getBoundingClientRect(),popperState:Xe,props:n}:null}).filter(Boolean);zD(Te,q)&&(Q(),Se(q))}}function ne(q){var ae=W(q)||v.props.trigger.indexOf("click")>=0&&s;if(!ae){if(v.props.interactive){v.hideWithInteractivity(q);return}Se(q)}}function X(q){v.props.trigger.indexOf("focusin")<0&&q.target!==P()||v.props.interactive&&q.relatedTarget&&C.contains(q.relatedTarget)||Se(q)}function W(q){return Rn.isTouch?T()!==q.type.indexOf("touch")>=0:!1}function B(){ee();var q=v.props,ae=q.popperOptions,ge=q.placement,Te=q.offset,Oe=q.getReferenceClientRect,Be=q.moveTransition,Re=k()?uh(C).arrow:null,Xe=Oe?{getBoundingClientRect:Oe,contextElement:Oe.contextElement||P()}:t,bn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Bn){var it=Bn.state;if(k()){var Vn=j(),Mi=Vn.box;["placement","reference-hidden","escaped"].forEach(function(Wr){Wr==="placement"?Mi.setAttribute("data-placement",it.placement):it.attributes.popper["data-popper-"+Wr]?Mi.setAttribute("data-"+Wr,""):Mi.removeAttribute("data-"+Wr)}),it.attributes.popper={}}}},rt=[{name:"offset",options:{offset:Te}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Be}},bn];k()&&Re&&rt.push({name:"arrow",options:{element:Re,padding:3}}),rt.push.apply(rt,(ae==null?void 0:ae.modifiers)||[]),v.popperInstance=kD(Xe,C,Object.assign({},ae,{placement:ge,onFirstUpdate:h,modifiers:rt}))}function ee(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function xe(){var q=v.props.appendTo,ae,ge=P();v.props.interactive&&q===lx||q==="parent"?ae=ge.parentNode:ae=cx(q,[ge]),ae.contains(C)||ae.appendChild(C),v.state.isMounted=!0,B(),process.env.NODE_ENV!=="production"&&Xn(v.props.interactive&&q===Zt.appendTo&&ge.nextElementSibling!==C,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
135
+
136
+ `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
137
+
138
+ `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
139
+
140
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function we(){return xl(C.querySelectorAll("[data-tippy-root]"))}function Z(q){v.clearDelayTimeouts(),q&&J("onTrigger",[v,q]),ue();var ae=z(!0),ge=A(),Te=ge[0],Oe=ge[1];Rn.isTouch&&Te==="hold"&&Oe&&(ae=Oe),ae?r=setTimeout(function(){v.show()},ae):v.show()}function Se(q){if(v.clearDelayTimeouts(),J("onUntrigger",[v,q]),!v.state.isVisible){pe();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(q.type)>=0&&s)){var ae=z(!1);ae?i=setTimeout(function(){v.state.isVisible&&v.hide()},ae):o=requestAnimationFrame(function(){v.hide()})}}function U(){v.state.isEnabled=!0}function H(){v.hide(),v.state.isEnabled=!1}function re(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function V(q){if(process.env.NODE_ENV!=="production"&&Xn(v.state.isDestroyed,Di("setProps")),!v.state.isDestroyed){J("onBeforeUpdate",[v,q]),I();var ae=v.props,ge=l0(t,Object.assign({},ae,r0(q),{ignoreAttributes:!0}));v.props=ge,F(),ae.interactiveDebounce!==ge.interactiveDebounce&&(Q(),p=t0(G,ge.interactiveDebounce)),ae.triggerTarget&&!ge.triggerTarget?$i(ae.triggerTarget).forEach(function(Te){Te.removeAttribute("aria-expanded")}):ge.triggerTarget&&t.removeAttribute("aria-expanded"),D(),$(),_&&_(ae,ge),v.popperInstance&&(B(),we().forEach(function(Te){requestAnimationFrame(Te._tippy.popperInstance.forceUpdate)})),J("onAfterUpdate",[v,q])}}function te(q){v.setProps({content:q})}function fe(){process.env.NODE_ENV!=="production"&&Xn(v.state.isDestroyed,Di("show"));var q=v.state.isVisible,ae=v.state.isDestroyed,ge=!v.state.isEnabled,Te=Rn.isTouch&&!v.props.touch,Oe=Dd(v.props.duration,0,Zt.duration);if(!(q||ae||ge||Te)&&!P().hasAttribute("disabled")&&(J("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,k()&&(C.style.visibility="visible"),$(),ue(),v.state.isMounted||(C.style.transition="none"),k()){var Be=j(),Re=Be.box,Xe=Be.content;Nd([Re,Xe],0)}h=function(){var rt;if(!(!v.state.isVisible||c)){if(c=!0,C.offsetHeight,C.style.transition=v.props.moveTransition,k()&&v.props.animation){var Ct=j(),Bn=Ct.box,it=Ct.content;Nd([Bn,it],Oe),i0([Bn,it],"visible")}K(),D(),n0(Fd,v),(rt=v.popperInstance)==null||rt.forceUpdate(),J("onMount",[v]),v.props.animation&&k()&&ce(Oe,function(){v.state.isShown=!0,J("onShown",[v])})}},xe()}}function ye(){process.env.NODE_ENV!=="production"&&Xn(v.state.isDestroyed,Di("hide"));var q=!v.state.isVisible,ae=v.state.isDestroyed,ge=!v.state.isEnabled,Te=Dd(v.props.duration,1,Zt.duration);if(!(q||ae||ge)&&(J("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,c=!1,s=!1,k()&&(C.style.visibility="hidden"),Q(),pe(),$(!0),k()){var Oe=j(),Be=Oe.box,Re=Oe.content;v.props.animation&&(Nd([Be,Re],Te),i0([Be,Re],"hidden"))}K(),D(),v.props.animation?k()&&L(Te,v.unmount):v.unmount()}}function Ce(q){process.env.NODE_ENV!=="production"&&Xn(v.state.isDestroyed,Di("hideWithInteractivity")),M().addEventListener("mousemove",p),n0(Aa,p),p(q)}function Fe(){process.env.NODE_ENV!=="production"&&Xn(v.state.isDestroyed,Di("unmount")),v.state.isVisible&&v.hide(),v.state.isMounted&&(ee(),we().forEach(function(q){q._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),Fd=Fd.filter(function(q){return q!==v}),v.state.isMounted=!1,J("onHidden",[v]))}function Ve(){process.env.NODE_ENV!=="production"&&Xn(v.state.isDestroyed,Di("destroy")),!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),I(),delete t._tippy,v.state.isDestroyed=!0,J("onDestroy",[v]))}}function wo(t,e){e===void 0&&(e={});var n=Zt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(YD(t),px(e,n)),WD();var r=Object.assign({},e,{plugins:n}),i=BD(t);if(process.env.NODE_ENV!=="production"){var o=vs(r.content),s=i.length>1;Xn(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
141
+
142
+ `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
143
+
144
+ `,`1) content: element.innerHTML
145
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,c){var u=c&&iN(c,r);return u&&l.push(u),l},[]);return vs(t)?a[0]:a}wo.defaultProps=Zt;wo.setDefaultProps=eN;wo.currentInput=Rn;Object.assign({},YS,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});wo.setDefaultProps({render:gx});class oN{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:d,selection:h}=l,{empty:f}=h,p=!d.textBetween(c,u).length&&Bp(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||f||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var d,h,f;const{state:p,composing:g}=a,{selection:m}=p;if(g||!l&&!c)return;this.createTooltip();const{ranges:x}=m,w=Math.min(...x.map(C=>C.$from.pos)),v=Math.max(...x.map(C=>C.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:a,state:p,oldState:u,from:w,to:v}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(GS(p.selection)){let C=a.nodeDOM(w);if(C){const _=C.dataset.nodeViewWrapper?C:C.querySelector("[data-node-view-wrapper]");if(_&&(C=_.firstChild),C)return C.getBoundingClientRect()}}return qI(a,w,v)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=wo(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const mx=t=>new lt({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new oN({view:e,...t})});ht.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function sN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dh={exports:{}},Hd={};/**
146
+ * @license React
147
+ * use-sync-external-store-shim.production.min.js
148
+ *
149
+ * Copyright (c) Facebook, Inc. and its affiliates.
150
+ *
151
+ * This source code is licensed under the MIT license found in the
152
+ * LICENSE file in the root directory of this source tree.
153
+ */var d0;function aN(){if(d0)return Hd;d0=1;var t=O;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function a(d,h){var f=h(),p=r({inst:{value:f,getSnapshot:h}}),g=p[0].inst,m=p[1];return o(function(){g.value=f,g.getSnapshot=h,l(g)&&m({inst:g})},[d,f,h]),i(function(){return l(g)&&m({inst:g}),d(function(){l(g)&&m({inst:g})})},[d]),s(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Hd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Hd}var $d={};/**
154
+ * @license React
155
+ * use-sync-external-store-shim.development.js
156
+ *
157
+ * Copyright (c) Facebook, Inc. and its affiliates.
158
+ *
159
+ * This source code is licensed under the MIT license found in the
160
+ * LICENSE file in the root directory of this source tree.
161
+ */var f0;function lN(){return f0||(f0=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=O,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var v=arguments.length,S=new Array(v>1?v-1:0),C=1;C<v;C++)S[C-1]=arguments[C];r("error",w,S)}}function r(w,v,S){{var C=e.ReactDebugCurrentFrame,_=C.getStackAddendum();_!==""&&(v+="%s",S=S.concat([_]));var E=S.map(function(R){return String(R)});E.unshift("Warning: "+v),Function.prototype.apply.call(console[w],console,E)}}function i(w,v){return w===v&&(w!==0||1/w===1/v)||w!==w&&v!==v}var o=typeof Object.is=="function"?Object.is:i,s=t.useState,a=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue,u=!1,d=!1;function h(w,v,S){u||t.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var C=v();if(!d){var _=v();o(C,_)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var E=s({inst:{value:C,getSnapshot:v}}),R=E[0].inst,A=E[1];return l(function(){R.value=C,R.getSnapshot=v,f(R)&&A({inst:R})},[w,C,v]),a(function(){f(R)&&A({inst:R});var T=function(){f(R)&&A({inst:R})};return w(T)},[w]),c(C),C}function f(w){var v=w.getSnapshot,S=w.value;try{var C=v();return!o(S,C)}catch{return!0}}function p(w,v,S){return v()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",m=!g,y=m?p:h,x=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y;$d.useSyncExternalStore=x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),$d}process.env.NODE_ENV==="production"?dh.exports=aN():dh.exports=lN();var $c=dh.exports;const cN=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},uN=({contentComponent:t})=>{const e=$c.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return O.createElement(O.Fragment,null,Object.values(e))};function dN(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:ho.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class fN extends O.Component{constructor(e){var n;super(e),this.editorContentRef=O.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=dN(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return O.createElement(O.Fragment,null,O.createElement("div",{ref:cN(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&O.createElement(uN,{contentComponent:e.contentComponent}))}}const hN=O.forwardRef((t,e)=>{const n=O.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return O.createElement(fN,{key:n,innerRef:e,...t})}),pN=O.memo(hN);var gN=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},mN=sN(gN),fh={exports:{}},Bd={};/**
162
+ * @license React
163
+ * use-sync-external-store-shim/with-selector.production.min.js
164
+ *
165
+ * Copyright (c) Facebook, Inc. and its affiliates.
166
+ *
167
+ * This source code is licensed under the MIT license found in the
168
+ * LICENSE file in the root directory of this source tree.
169
+ */var h0;function yN(){if(h0)return Bd;h0=1;var t=O,e=$c;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Bd.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=o(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function y(C){if(!x){if(x=!0,w=C,C=h(C),f!==void 0&&g.hasValue){var _=g.value;if(f(_,C))return v=_}return v=C}if(_=v,r(w,C))return _;var E=h(C);return f!==void 0&&f(_,E)?_:(w=C,v=E)}var x=!1,w,v,S=d===void 0?null:d;return[function(){return y(u())},S===null?void 0:function(){return y(S())}]},[u,d,h,f]);var m=i(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=m},[m]),l(m),m},Bd}var Vd={};/**
170
+ * @license React
171
+ * use-sync-external-store-shim/with-selector.development.js
172
+ *
173
+ * Copyright (c) Facebook, Inc. and its affiliates.
174
+ *
175
+ * This source code is licensed under the MIT license found in the
176
+ * LICENSE file in the root directory of this source tree.
177
+ */var p0;function vN(){return p0||(p0=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=O,e=$c;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;function c(u,d,h,f,p){var g=o(null),m;g.current===null?(m={hasValue:!1,value:null},g.current=m):m=g.current;var y=a(function(){var S=!1,C,_,E=function(k){if(!S){S=!0,C=k;var P=f(k);if(p!==void 0&&m.hasValue){var M=m.value;if(p(M,P))return _=M,M}return _=P,P}var j=C,z=_;if(r(j,k))return z;var $=f(k);return p!==void 0&&p(z,$)?z:(C=k,_=$,$)},R=h===void 0?null:h,A=function(){return E(d())},T=R===null?void 0:function(){return E(R())};return[A,T]},[d,h,f,p]),x=y[0],w=y[1],v=i(u,x,w);return s(function(){m.hasValue=!0,m.value=v},[v]),l(v),v}Vd.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Vd}process.env.NODE_ENV==="production"?fh.exports=yN():fh.exports=vN();var bN=fh.exports;const wN=typeof window<"u"?O.useLayoutEffect:O.useEffect;class SN{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function xN(t){var e;const[n]=O.useState(()=>new SN(t.editor)),r=bN.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:mN);return wN(()=>n.watch(t.editor),[t.editor,n]),O.useDebugValue(r),r}const g0=process.env.NODE_ENV!=="production",hh=typeof window>"u",CN=hh||!!(typeof window<"u"&&window.next);class Zp{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return hh||CN?(g0&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&hh&&g0)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...r)}};return new SL(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,o)=>{var s;return i===((s=n.extensions)===null||s===void 0?void 0:s[o])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Zp.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function EN(t={},e=[]){const n=O.useRef(t);n.current=t;const[r]=O.useState(()=>new Zp(n)),i=$c.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return O.useDebugValue(i),O.useEffect(r.onRender(e)),xN({editor:i,selector:({transactionNumber:o})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&o===0?0:o+1}),i}const yx=O.createContext({editor:null});yx.Consumer;const _N=()=>O.useContext(yx),RN=t=>{const[e,n]=O.useState(null),{editor:r}=_N();return O.useEffect(()=>{var i;if(!e||!((i=t.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:s,tippyOptions:a={},updateDelay:l,shouldShow:c=null}=t,u=s||r;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=mx({updateDelay:l,editor:u,element:e,pluginKey:o,shouldShow:c,tippyOptions:a});return u.registerPlugin(d),()=>{u.unregisterPlugin(o)}},[t.editor,r,e]),O.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},vx=O.createContext({onDragStart:void 0}),bx=()=>O.useContext(vx),zs=t=>{const e=t.as||"div",{nodeViewContentRef:n}=bx();return O.createElement(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})};O.forwardRef((t,e)=>{const{onDragStart:n}=bx(),r=t.as||"div";return O.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function AN(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function ON(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class wx{constructor(e,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?ho.flushSync(()=>{this.render()}):this.render()}render(){var e;const n=this.component,r=this.props,i=this.editor;(AN(n)||ON(n))&&(r.ref=o=>{this.ref=o}),this.reactElement=O.createElement(n,{...r}),(e=i==null?void 0:i.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}}class TN extends CL{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},o=this.component,s=O.memo(c=>O.createElement(vx.Provider,{value:i},O.createElement(o,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new wx(s,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const i=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>i({node:e,decorations:n,innerDecorations:r})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,i({node:e,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=vl(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function Jr(t,e){return n=>n.editor.contentComponent?new TN(t,n,e):{}}function m0({...t}){return b.jsx(N.Button,{scheme:"light",variant:"borderless",corners:"square",size:"sm",...t})}function kN({children:t,...e}){return b.jsxs(N.Button,{scheme:"light",variant:"borderless",size:"sm",dflex:!0,alignItems:"center",whiteSpace:"nowrap",fontWeight:"500",corners:"square",...e,children:[t,b.jsx(N.Icon,{path:n_})]})}function MN({children:t,...e}){return b.jsx(N.Tile,{scheme:"light",position:"fixed",top:"100%",dflex:!0,flexCol:!0,z:"99999",mt:"1",p:"1.5",overflow:"hidden",rounded:!0,border:!0,borderColor:"stone-200",shadow:"xl",...e,children:t})}function oi({icon:t,name:e,isActive:n,...r}){return b.jsxs(N.Tile,{scheme:"light",hoverable:!0,dflex:!0,alignItems:"center",justifyContent:"between",spaceX:"2",rounded:"sm",px:"2",py:"2",w:"48",textSize:"sm",textColor:"stone-600",...r,children:[t,b.jsx("span",{flex:"1",children:e}),n&&b.jsx(N.Icon,{path:Zh})]})}const Sx=[{name:"Default",color:"var(--novel-black)"},{name:"Purple",color:"#9333EA"},{name:"Red",color:"#E00000"},{name:"Yellow",color:"#EAB308"},{name:"Blue",color:"#2563EB"},{name:"Green",color:"#008A00"},{name:"Orange",color:"#FFA500"},{name:"Pink",color:"#BA4081"},{name:"Gray",color:"#A8A29E"}];function PN(t){const e=Sx.find(({color:n})=>t.isActive("highlight",{color:n}));return{textColor:e==null?void 0:e.color}}function IN({editor:t,onHide:e}){return Sx.map(({name:n,color:r},i)=>b.jsx(oi,{icon:b.jsx(N.Icon,{path:Yv,textColor:r}),name:n,isActive:t.isActive("highlight",{color:r}),onClick:()=>{t.commands.unsetHighlight(),n!=="Default"&&t.chain().focus().setHighlight({color:r}).run(),e()}},i))}const xx=[{name:"Default",color:"var(--novel-black)"},{name:"Purple",color:"#9333EA"},{name:"Red",color:"#E00000"},{name:"Yellow",color:"#EAB308"},{name:"Blue",color:"#2563EB"},{name:"Green",color:"#008A00"},{name:"Orange",color:"#FFA500"},{name:"Pink",color:"#BA4081"},{name:"Gray",color:"#A8A29E"}];function LN(t){const e=xx.find(({color:n})=>t.isActive("textStyle",{color:n}));return{textColor:e==null?void 0:e.color}}function DN({editor:t,onHide:e}){return xx.map(({name:n,color:r},i)=>b.jsx(oi,{icon:b.jsx(N.Icon,{path:Yv,textColor:r}),name:n,isActive:t.isActive("textStyle",{color:r}),onClick:()=>{t.commands.unsetColor(),n!=="Default"&&t.chain().focus().setColor(r).run(),e()}},i))}function NN({editor:t,onHide:e}){const n=O.useRef(null);O.useEffect(()=>{var i;n.current&&((i=n.current)==null||i.focus())});const r=O.useCallback(i=>{var o,s;i.preventDefault(),(o=n.current)!=null&&o.checkValidity()&&(t.commands.setLink({href:(s=n.current)==null?void 0:s.value}),e())},[n,e,t]);return b.jsxs("div",{dflex:!0,alignItems:"center",w:"full",children:[b.jsx(N.Input,{ref:n,type:"url",size:"sm",variant:"default",minW:"64",placeholder:"Paste a link",textColor:"slate-700",flexGrow:!0,defaultValue:t.getAttributes("link").href||"",border:"0"}),b.jsx(N.Button,{variant:"borderless",size:"sm",scheme:"light",type:"submit",onClick:r,children:b.jsx(N.Icon,{path:Zh})}),t.getAttributes("link").href&&b.jsx(N.Button,{variant:"borderless",size:"sm",scheme:"light",onClick:()=>{t.chain().focus().unsetLink().run(),e()},children:b.jsx(N.Icon,{path:db})})]})}const Cx="M11 7h2v10h-2v-4H7v4H5V7h2v4h4V7zm6.57 0c-.594.95-1.504 1.658-2.57 2v1h2v7h2V7h-1.43z",Ex="M9 7h2v10H9v-4H5v4H3V7h2v4h4V7zm8 8c.51-.41.6-.62 1.06-1.05.437-.4.848-.828 1.23-1.28.334-.39.62-.82.85-1.28.2-.39.305-.822.31-1.26.005-.44-.087-.878-.27-1.28-.177-.385-.437-.726-.76-1-.346-.283-.743-.497-1.17-.63-.485-.153-.99-.227-1.5-.22-.36 0-.717.033-1.07.1-.343.06-.678.158-1 .29-.304.13-.593.295-.86.49-.287.21-.56.437-.82.68l1.24 1.22c.308-.268.643-.502 1-.7.35-.2.747-.304 1.15-.3.455-.03.906.106 1.27.38.31.278.477.684.45 1.1-.014.396-.14.78-.36 1.11-.285.453-.62.872-1 1.25-.44.43-.98.92-1.59 1.43-.61.51-1.41 1.06-2.16 1.65V17h8v-2h-4z",_x="M14.11 14.218c.355.287.75.523 1.17.7.434.18.9.273 1.37.27.484.017.965-.086 1.4-.3.333-.146.55-.476.55-.84.003-.203-.05-.403-.15-.58-.123-.19-.3-.34-.51-.43-.32-.137-.655-.228-1-.27-.503-.073-1.012-.106-1.52-.1v-1.57c.742.052 1.485-.07 2.17-.36.37-.164.615-.525.63-.93.026-.318-.12-.627-.38-.81-.34-.203-.734-.3-1.13-.28-.395.013-.784.108-1.14.28-.375.167-.73.375-1.06.62l-1.22-1.39c.5-.377 1.053-.68 1.64-.9.608-.224 1.252-.336 1.9-.33.525-.007 1.05.05 1.56.17.43.1.84.277 1.21.52.325.21.595.495.79.83.19.342.287.73.28 1.12.01.48-.177.943-.52 1.28-.417.39-.916.685-1.46.86v.06c.61.14 1.175.425 1.65.83.437.382.68.94.66 1.52.005.42-.113.835-.34 1.19-.23.357-.538.657-.9.88-.408.253-.853.44-1.32.55-.514.128-1.04.192-1.57.19-.786.02-1.57-.106-2.31-.37-.59-.214-1.126-.556-1.57-1l1.12-1.41zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z",Rx="M11 17H9v-4H5v4H3V7h2v4h4V7h2v10zm10-2h-1v2h-2v-2h-5v-2l4.05-6H20v6h1v2zm-3-2V9l-2.79 4H18z";function jN(t){const n=Ax(t).filter(r=>{var i;return(i=r.isActive)==null?void 0:i.call(r,t)});return n.length>1?O_:n.length==0?v_:n[0].icon}function Ax(t){return[{type:"basic",name:"Text",icon:ub,command:()=>t.chain().focus().toggleNode("paragraph","paragraph").run(),isActive:()=>t.isActive("paragraph")&&!t.isActive("bulletList")&&!t.isActive("orderedList")},{type:"basic",name:"Heading 1",icon:Cx,command:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:()=>t.isActive("heading",{level:1})},{type:"basic",name:"Heading 2",icon:Ex,command:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:()=>t.isActive("heading",{level:2})},{type:"basic",name:"Heading 3",icon:_x,command:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:()=>t.isActive("heading",{level:3})},{type:"basic",name:"Heading 4",icon:Rx,command:()=>t.chain().focus().toggleHeading({level:4}).run(),isActive:()=>t.isActive("heading",{level:4})},{type:"basic",name:"Bullet List",icon:rb,command:()=>t.chain().focus().toggleBulletList().run(),isActive:()=>t.isActive("bulletList")},{type:"basic",name:"Numbered List",icon:ib,command:()=>t.chain().focus().toggleOrderedList().run(),isActive:()=>t.isActive("orderedList")},{type:"basic",name:"Quote",icon:ob,command:()=>t.chain().focus().toggleNode("paragraph","paragraph").toggleBlockquote().run(),isActive:()=>t.isActive("blockquote")}]}function FN({editor:t,onHide:e}){const{items:n,activeItems:r}=O.useMemo(()=>{const i=Ax(t),o=i.filter(s=>{var a;return(a=s.isActive)==null?void 0:a.call(s,t)}).map(s=>s.name);return{items:i,activeItems:o}},[t]);return n.map((i,o)=>i.type=="basic"&&b.jsx(oi,{icon:b.jsx(N.Icon,{path:i.icon}),name:i.name,isActive:r.includes(i.name),onClick:()=>{var s;(s=i.command)==null||s.call(i,t),e()}},o))}function HN(t){return t.isActive("uppercase")?nb:t.isActive("lowercase")?tb:eb}function $N({editor:t,onHide:e}){return b.jsxs(b.Fragment,{children:[b.jsx(oi,{icon:b.jsx(N.Icon,{path:eb}),name:"Capitalize",isActive:!1,onClick:()=>{t.chain().focus().unsetUppercase().run(),t.chain().focus().unsetLowercase().run(),t.chain().focus().toggleCapitalize().run(),e()}}),b.jsx(oi,{icon:b.jsx(N.Icon,{path:nb}),name:"Uppercase",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetLowercase().run(),t.chain().focus().toggleUppercase().run(),e()}}),b.jsx(oi,{icon:b.jsx(N.Icon,{path:tb}),name:"Lowercase",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetUppercase().run(),t.chain().focus().toggleLowercase().run(),e()}}),b.jsx(oi,{icon:b.jsx(N.Icon,{path:Qv}),name:"None",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetUppercase().run(),t.chain().focus().unsetLowercase().run()}})]})}function BN(){return[{type:"popupMenu",icon:t=>jN(t),name:"nodeSelector",excludeFromNodeType:["link"],renderPopupMenu:(t,e)=>b.jsx(FN,{editor:t,onHide:e})},{type:"basic",name:"bold",isActive:t=>t.isActive("bold"),command:t=>t.chain().focus().toggleBold().run(),icon:f_,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"italic",isActive:t=>t.isActive("italic"),command:t=>t.chain().focus().toggleItalic().run(),icon:p_,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"underline",isActive:t=>t.isActive("underline"),command:t=>t.chain().focus().toggleUnderline().run(),icon:y_,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"strike",isActive:t=>t.isActive("strike"),command:t=>t.chain().focus().toggleStrike().run(),icon:g_,excludeFromNodeType:["heading","blockquote","link"]},{type:"popupMenu",icon:t=>HN(t),isActive:t=>t.isActive("capitalize")||t.isActive("uppercase")||t.isActive("lowercase"),name:"caseSelector",renderPopupMenu:(t,e)=>b.jsx($N,{editor:t,onHide:e})},{type:"popupMenu",icon:m_,iconProps:t=>LN(t),name:"colorSelector",excludeFromNodeType:["heading","blockquote","link"],renderPopupMenu:(t,e)=>b.jsx(DN,{editor:t,onHide:e})},{type:"popupMenu",icon:h_,iconProps:t=>PN(t),name:"bgColorSelector",excludeFromNodeType:["heading","blockquote","link"],renderPopupMenu:(t,e)=>b.jsx(IN,{editor:t,onHide:e})},{type:"popupMenu",icon:x_,name:"linkSelector",isActive:t=>t.isActive("link"),renderPopupMenu:(t,e)=>b.jsx(NN,{editor:t,onHide:e}),popupMenuPosition:"end",popupMenuWidth:"full"}]}function VN({editor:t,menuItems:e,...n}){var u;const[r,i]=O.useState(""),[o,s]=O.useState(""),a=O.useCallback(()=>s(""),[s]),l=O.useMemo(()=>BN().concat(e??[]),[e]),c={editor:t,...n,shouldShow:({editor:d})=>{var h,f;return d.isActive("image")||(f=(h=d.state.selection.node)==null?void 0:h.type)!=null&&f.isAtom?!1:d.view.state.selection.content().size>0},tippyOptions:{moveTransition:"transform 0.15s ease-out",maxWidth:600,zIndex:1e3,onHidden:()=>{s("")}}};return b.jsxs(b.Fragment,{children:[b.jsx(RN,{...c,children:b.jsx("div",{dflex:!0,w:"fit",divideX:!0,divideColor:"stone-200",rounded:!0,border:!0,borderColor:"stone-200",bgColor:"white",shadow:"xl",children:l.map((d,h)=>{var f,p,g,m,y,x,w,v,S;return b.jsx(O.Fragment,{children:!((f=d.excludeFromNodeType)!=null&&f.find(C=>t.isActive(C)))&&b.jsxs(b.Fragment,{children:[d.type=="basic"&&b.jsx(m0,{disabled:(p=d.isDisabled)==null?void 0:p.call(d,t),onClick:()=>{var C;return(C=d.command)==null?void 0:C.call(d,t)},children:b.jsx("span",{textColor:(g=d.isActive)!=null&&g.call(d,t)?"sky-500":void 0,children:b.jsx(N.Icon,{path:$e.runIfFn(d.icon,t)})})}),d.type=="dialog"&&b.jsx(m0,{disabled:(m=d.isDisabled)==null?void 0:m.call(d,t),onClick:()=>i(d.name),children:b.jsx("span",{textColor:(y=d.isActive)!=null&&y.call(d,t)?"sky-500":void 0,children:b.jsx(N.Icon,{path:$e.runIfFn(d.icon,t)})})}),d.type=="popupMenu"&&b.jsxs("div",{position:"relative",children:[b.jsx(kN,{disabled:(x=d.isDisabled)==null?void 0:x.call(d,t),onClick:()=>s(d.name),h:"full",children:b.jsx(N.Icon,{mt:"0.5",path:$e.runIfFn(d.icon,t),textColor:(w=d.isActive)!=null&&w.call(d,t)?"sky-500":void 0,...((v=d.iconProps)==null?void 0:v.call(d,t))??{}})}),o===d.name&&b.jsx(MN,{start:d.popupMenuPosition==="start"?0:void 0,end:d.popupMenuPosition==="end"?0:void 0,w:d.popupMenuWidth==="full"?"full":void 0,minW:d.popupMenuWidth==="full"?"96":void 0,children:(S=d.renderPopupMenu)==null?void 0:S.call(d,t,a)})]})]})},h)})})}),r&&((u=l.find(d=>d.type=="dialog"&&d.name==r))==null?void 0:u.renderDialog(t,()=>i("")))]})}const zN=/^\s*>\s$/,Ox=$t.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[gs({find:zN,type:this.type})]}}),UN="listItem",y0="textStyle",v0=/^\s*([-+*])\s$/,Tx=$t.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(UN,this.editor.getAttributes(y0)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=gs({find:v0,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gs({find:v0,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(y0),editor:this.editor})),[t]}}),qN=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},WN=It.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&qN(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),KN=ht.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),kx=$t.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,nt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>oh({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),GN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,JN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,XN=It.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[wi({find:GN,type:this.type})]},addPasteRules(){return[Ir({find:JN,type:this.type})]}}),YN="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",QN="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",ao=(t,e)=>{for(const n in e)t[n]=e[n];return t},ph="numeric",gh="ascii",mh="alpha",Qo="asciinumeric",$o="alphanumeric",yh="domain",Mx="emoji",ZN="scheme",ej="slashscheme",zd="whitespace";function tj(t,e){return t in e||(e[t]=[]),e[t]}function si(t,e,n){e[ph]&&(e[Qo]=!0,e[$o]=!0),e[gh]&&(e[Qo]=!0,e[mh]=!0),e[Qo]&&(e[$o]=!0),e[mh]&&(e[$o]=!0),e[$o]&&(e[yh]=!0),e[Mx]&&(e[yh]=!0);for(const r in e){const i=tj(r,n);i.indexOf(t)<0&&i.push(t)}}function nj(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Vt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Vt.groups={};Vt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||Vt.groups;let i;return e&&e.j?i=e:(i=new Vt(e),n&&r&&si(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||Vt.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,a=i.go(t);if(a?(s=new Vt,ao(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Vt,o){if(r)if(s.t&&typeof s.t=="string"){const l=ao(nj(s.t,r),n);si(o,l,r)}else n&&si(o,n,r);s.t=o}return i.j[t]=s,s}};const Ne=(t,e,n,r,i)=>t.ta(e,n,r,i),st=(t,e,n,r,i)=>t.tr(e,n,r,i),b0=(t,e,n,r,i)=>t.ts(e,n,r,i),he=(t,e,n,r,i)=>t.tt(e,n,r,i),Gn="WORD",vh="UWORD",Px="ASCIINUMERICAL",Ix="ALPHANUMERICAL",ws="LOCALHOST",bh="TLD",wh="UTLD",Xa="SCHEME",Bi="SLASH_SCHEME",eg="NUM",Sh="WS",tg="NL",Zo="OPENBRACE",es="CLOSEBRACE",Cl="OPENBRACKET",El="CLOSEBRACKET",_l="OPENPAREN",Rl="CLOSEPAREN",Al="OPENANGLEBRACKET",Ol="CLOSEANGLEBRACKET",Tl="FULLWIDTHLEFTPAREN",kl="FULLWIDTHRIGHTPAREN",Ml="LEFTCORNERBRACKET",Pl="RIGHTCORNERBRACKET",Il="LEFTWHITECORNERBRACKET",Ll="RIGHTWHITECORNERBRACKET",Dl="FULLWIDTHLESSTHAN",Nl="FULLWIDTHGREATERTHAN",jl="AMPERSAND",ng="APOSTROPHE",Fl="ASTERISK",gr="AT",Hl="BACKSLASH",$l="BACKTICK",Bl="CARET",vr="COLON",rg="COMMA",Vl="DOLLAR",En="DOT",zl="EQUALS",ig="EXCLAMATION",rn="HYPHEN",ts="PERCENT",Ul="PIPE",ql="PLUS",Wl="POUND",ns="QUERY",og="QUOTE",Lx="FULLWIDTHMIDDLEDOT",sg="SEMI",_n="SLASH",rs="TILDE",Kl="UNDERSCORE",Dx="EMOJI",Gl="SYM";var Nx=Object.freeze({__proto__:null,WORD:Gn,UWORD:vh,ASCIINUMERICAL:Px,ALPHANUMERICAL:Ix,LOCALHOST:ws,TLD:bh,UTLD:wh,SCHEME:Xa,SLASH_SCHEME:Bi,NUM:eg,WS:Sh,NL:tg,OPENBRACE:Zo,CLOSEBRACE:es,OPENBRACKET:Cl,CLOSEBRACKET:El,OPENPAREN:_l,CLOSEPAREN:Rl,OPENANGLEBRACKET:Al,CLOSEANGLEBRACKET:Ol,FULLWIDTHLEFTPAREN:Tl,FULLWIDTHRIGHTPAREN:kl,LEFTCORNERBRACKET:Ml,RIGHTCORNERBRACKET:Pl,LEFTWHITECORNERBRACKET:Il,RIGHTWHITECORNERBRACKET:Ll,FULLWIDTHLESSTHAN:Dl,FULLWIDTHGREATERTHAN:Nl,AMPERSAND:jl,APOSTROPHE:ng,ASTERISK:Fl,AT:gr,BACKSLASH:Hl,BACKTICK:$l,CARET:Bl,COLON:vr,COMMA:rg,DOLLAR:Vl,DOT:En,EQUALS:zl,EXCLAMATION:ig,HYPHEN:rn,PERCENT:ts,PIPE:Ul,PLUS:ql,POUND:Wl,QUERY:ns,QUOTE:og,FULLWIDTHMIDDLEDOT:Lx,SEMI:sg,SLASH:_n,TILDE:rs,UNDERSCORE:Kl,EMOJI:Dx,SYM:Gl});const qn=/[a-z]/,Po=new RegExp("\\p{L}","u"),Ud=new RegExp("\\p{Emoji}","u"),Wn=/\d/,qd=/\s/,w0="\r",Wd=`
178
+ `,rj="️",ij="‍",Kd="";let Oa=null,Ta=null;function oj(t=[]){const e={};Vt.groups=e;const n=new Vt;Oa==null&&(Oa=S0(YN)),Ta==null&&(Ta=S0(QN)),he(n,"'",ng),he(n,"{",Zo),he(n,"}",es),he(n,"[",Cl),he(n,"]",El),he(n,"(",_l),he(n,")",Rl),he(n,"<",Al),he(n,">",Ol),he(n,"(",Tl),he(n,")",kl),he(n,"「",Ml),he(n,"」",Pl),he(n,"『",Il),he(n,"』",Ll),he(n,"<",Dl),he(n,">",Nl),he(n,"&",jl),he(n,"*",Fl),he(n,"@",gr),he(n,"`",$l),he(n,"^",Bl),he(n,":",vr),he(n,",",rg),he(n,"$",Vl),he(n,".",En),he(n,"=",zl),he(n,"!",ig),he(n,"-",rn),he(n,"%",ts),he(n,"|",Ul),he(n,"+",ql),he(n,"#",Wl),he(n,"?",ns),he(n,'"',og),he(n,"/",_n),he(n,";",sg),he(n,"~",rs),he(n,"_",Kl),he(n,"\\",Hl),he(n,"・",Lx);const r=st(n,Wn,eg,{[ph]:!0});st(r,Wn,r);const i=st(r,qn,Px,{[Qo]:!0}),o=st(r,Po,Ix,{[$o]:!0}),s=st(n,qn,Gn,{[gh]:!0});st(s,Wn,i),st(s,qn,s),st(i,Wn,i),st(i,qn,i);const a=st(n,Po,vh,{[mh]:!0});st(a,qn),st(a,Wn,o),st(a,Po,a),st(o,Wn,o),st(o,qn),st(o,Po,o);const l=he(n,Wd,tg,{[zd]:!0}),c=he(n,w0,Sh,{[zd]:!0}),u=st(n,qd,Sh,{[zd]:!0});he(n,Kd,u),he(c,Wd,l),he(c,Kd,u),st(c,qd,u),he(u,w0),he(u,Wd),st(u,qd,u),he(u,Kd,u);const d=st(n,Ud,Dx,{[Mx]:!0});he(d,"#"),st(d,Ud,d),he(d,rj,d);const h=he(d,ij);he(h,"#"),st(h,Ud,d);const f=[[qn,s],[Wn,i]],p=[[qn,null],[Po,a],[Wn,o]];for(let g=0;g<Oa.length;g++)dr(n,Oa[g],bh,Gn,f);for(let g=0;g<Ta.length;g++)dr(n,Ta[g],wh,vh,p);si(bh,{tld:!0,ascii:!0},e),si(wh,{utld:!0,alpha:!0},e),dr(n,"file",Xa,Gn,f),dr(n,"mailto",Xa,Gn,f),dr(n,"http",Bi,Gn,f),dr(n,"https",Bi,Gn,f),dr(n,"ftp",Bi,Gn,f),dr(n,"ftps",Bi,Gn,f),si(Xa,{scheme:!0,ascii:!0},e),si(Bi,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){const m=t[g][0],x=t[g][1]?{[ZN]:!0}:{[ej]:!0};m.indexOf("-")>=0?x[yh]=!0:qn.test(m)?Wn.test(m)?x[Qo]=!0:x[gh]=!0:x[ph]=!0,b0(n,m,m,x)}return b0(n,"localhost",ws,{ascii:!0}),n.jd=new Vt(Gl),{start:n,tokens:ao({groups:e},Nx)}}function jx(t,e){const n=sj(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,d=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,h=0,u=a):d>=0&&(d+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=d,s-=h,c-=d,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function sj(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function dr(t,e,n,r,i){let o;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new Vt(r),o.jr=i.slice(),t.j[l]=o),t=o}return o=new Vt(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function S0(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let o=0;for(;i.indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Ss={defaultProtocol:"http",events:null,format:x0,formatHref:x0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ag(t,e=null){let n=ao({},Ss);t&&(n=ao(n,t instanceof ag?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}ag.prototype={o:Ss,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Ss[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function x0(t){return t}function Fx(t,e){this.t="token",this.v=t,this.tk=e}Fx.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ss.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&ao(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Bc(t,e){class n extends Fx{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const C0=Bc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),E0=Bc("text"),aj=Bc("nl"),ka=Bc("url",{isLink:!0,toHref(t=Ss.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ws&&t[1].t===vr}}),nn=t=>new Vt(t);function lj({groups:t}){const e=t.domain.concat([jl,Fl,gr,Hl,$l,Bl,Vl,zl,rn,eg,ts,Ul,ql,Wl,_n,Gl,rs,Kl]),n=[vr,rg,En,ig,ts,ns,og,sg,Al,Ol,Zo,es,El,Cl,_l,Rl,Tl,kl,Ml,Pl,Il,Ll,Dl,Nl],r=[jl,ng,Fl,Hl,$l,Bl,Vl,zl,rn,Zo,es,ts,Ul,ql,Wl,ns,_n,Gl,rs,Kl],i=nn(),o=he(i,rs);Ne(o,r,o),Ne(o,t.domain,o);const s=nn(),a=nn(),l=nn();Ne(i,t.domain,s),Ne(i,t.scheme,a),Ne(i,t.slashscheme,l),Ne(s,r,o),Ne(s,t.domain,s);const c=he(s,gr);he(o,gr,c),he(a,gr,c),he(l,gr,c);const u=he(o,En);Ne(u,r,o),Ne(u,t.domain,o);const d=nn();Ne(c,t.domain,d),Ne(d,t.domain,d);const h=he(d,En);Ne(h,t.domain,d);const f=nn(C0);Ne(h,t.tld,f),Ne(h,t.utld,f),he(c,ws,f);const p=he(d,rn);he(p,rn,p),Ne(p,t.domain,d),Ne(f,t.domain,d),he(f,En,h),he(f,rn,p);const g=he(f,vr);Ne(g,t.numeric,C0);const m=he(s,rn),y=he(s,En);he(m,rn,m),Ne(m,t.domain,s),Ne(y,r,o),Ne(y,t.domain,s);const x=nn(ka);Ne(y,t.tld,x),Ne(y,t.utld,x),Ne(x,t.domain,s),Ne(x,r,o),he(x,En,y),he(x,rn,m),he(x,gr,c);const w=he(x,vr),v=nn(ka);Ne(w,t.numeric,v);const S=nn(ka),C=nn();Ne(S,e,S),Ne(S,n,C),Ne(C,e,S),Ne(C,n,C),he(x,_n,S),he(v,_n,S);const _=he(a,vr),E=he(l,vr),R=he(E,_n),A=he(R,_n);Ne(a,t.domain,s),he(a,En,y),he(a,rn,m),Ne(l,t.domain,s),he(l,En,y),he(l,rn,m),Ne(_,t.domain,S),he(_,_n,S),he(_,ns,S),Ne(A,t.domain,S),Ne(A,e,S),he(A,_n,S);const T=[[Zo,es],[Cl,El],[_l,Rl],[Al,Ol],[Tl,kl],[Ml,Pl],[Il,Ll],[Dl,Nl]];for(let k=0;k<T.length;k++){const[P,M]=T[k],j=he(S,P);he(C,P,j),he(j,M,S);const z=nn(ka);Ne(j,e,z);const $=nn();Ne(j,n),Ne(z,e,z),Ne(z,n,$),Ne($,e,z),Ne($,n,$),he(z,M,S),he($,M,S)}return he(i,ws,x),he(i,tg,aj),{start:i,tokens:Nx}}function cj(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=t,l=null,c=null,u=0,d=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(h=0,d=a):h>=0&&h++,i++,u++;if(h<0)i-=u,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(Gd(E0,e,s)),s=[]),i-=h,u-=h;const f=d.t,p=n.slice(i-u,i);o.push(Gd(f,e,p))}}return s.length>0&&o.push(Gd(E0,e,s)),o}function Gd(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const uj=typeof console<"u"&&console&&console.warn||(()=>{}),dj="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",tt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function fj(){return Vt.groups={},tt.scanner=null,tt.parser=null,tt.tokenQueue=[],tt.pluginQueue=[],tt.customSchemes=[],tt.initialized=!1,tt}function _0(t,e=!1){if(tt.initialized&&uj(`linkifyjs: already initialized - will not register custom scheme "${t}" ${dj}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
179
+ 1. Must only contain digits, lowercase ASCII letters or "-"
180
+ 2. Cannot start or end with "-"
181
+ 3. "-" cannot repeat`);tt.customSchemes.push([t,e])}function hj(){tt.scanner=oj(tt.customSchemes);for(let t=0;t<tt.tokenQueue.length;t++)tt.tokenQueue[t][1]({scanner:tt.scanner});tt.parser=lj(tt.scanner.tokens);for(let t=0;t<tt.pluginQueue.length;t++)tt.pluginQueue[t][1]({scanner:tt.scanner,parser:tt.parser});return tt.initialized=!0,tt}function lg(t){return tt.initialized||hj(),cj(tt.parser.start,t,jx(tt.scanner.start,t))}lg.scan=jx;function Hx(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new ag(n),i=lg(t),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}function pj(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function gj(t){return new lt({key:new yt("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=DI(n.doc,[...e]);if(zI(a).forEach(({newRange:c})=>{const u=jI(r.doc,c,f=>f.isTextblock);let d,h;if(u.length>1?(d=u[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],h=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&h){const f=h.split(" ").filter(y=>y!=="");if(f.length<=0)return!1;const p=f[f.length-1],g=d.pos+h.lastIndexOf(p);if(!p)return!1;const m=lg(p).map(y=>y.toObject(t.defaultProtocol));if(!pj(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{zp(y.from,y.to,r.doc).some(x=>x.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function mj(t){return new lt({key:new yt("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(h=>h.nodeName==="A"))return!1;const l=KS(e.state,t.type.name),c=r.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,d=(o=c==null?void 0:c.target)!==null&&o!==void 0?o:l.target;return c&&u?(window.open(u,d),!0):!1}}})}function yj(t){return new lt({key:new yt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=Hx(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}const vj=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Xr(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(vj,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const bj=It.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){_0(t);return}_0(t.scheme,t.optionalSlashes)})},onDestroy(){fj()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Xr(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Xr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Xr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",nt(this.options.HTMLAttributes,t),0]:["a",nt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ir({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=Hx(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Xr(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(gj({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Xr(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(mj({type:this.type})),this.options.linkOnPaste&&t.push(yj({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),$x=$t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",nt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),wj="listItem",R0="textStyle",A0=/^(\d+)\.\s$/,Bx=$t.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",nt(this.options.HTMLAttributes,n),0]:["ol",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wj,this.editor.getAttributes(R0)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=gs({find:A0,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gs({find:A0,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(R0)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),Vx=$t.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Sj=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,xj=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,zx=t=>t.match(Sj),O0=t=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",Cj=t=>{const{url:e,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:o,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:u,ivLoadPolicy:d,loop:h,modestBranding:f,nocookie:p,origin:g,playlist:m,progressBarColor:y,startAt:x}=t;if(!zx(e))return null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){const _=e.split("/").pop();return _?`${O0(p)}${_}`:null}const v=/(?:v=|shorts\/)([-\w]+)/gm.exec(e);if(!v||!v[1])return null;let S=`${O0(p)}${v[1]}`;const C=[];return n===!1&&C.push("fs=0"),r&&C.push("autoplay=1"),i&&C.push(`cc_lang_pref=${i}`),o&&C.push("cc_load_policy=1"),s||C.push("controls=0"),a&&C.push("disablekb=1"),l&&C.push("enablejsapi=1"),c&&C.push(`end=${c}`),u&&C.push(`hl=${u}`),d&&C.push(`iv_load_policy=${d}`),h&&C.push("loop=1"),f&&C.push("modestbranding=1"),g&&C.push(`origin=${g}`),m&&C.push(`playlist=${m}`),x&&C.push(`start=${x}`),y&&C.push(`color=${y}`),C.length&&(S+=`?${C.join("&")}`),S},Ej=$t.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>zx(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},addPasteRules(){return this.options.addPasteHandler?[_L({find:xj,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML({HTMLAttributes:t}){const e=Cj({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0});return t.src=e,["div",{"data-youtube-video":""},["iframe",nt(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor},t)]]}}),_j=It.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Rj=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Aj=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Oj=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Tj=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,kj=It.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[wi({find:Rj,type:this.type}),wi({find:Oj,type:this.type})]},addPasteRules(){return[Ir({find:Aj,type:this.type}),Ir({find:Tj,type:this.type})]}}),Mj=/(^|[^`])`([^`]+)`(?!`)/,Pj=/(^|[^`])`([^`]+)`(?!`)/g,Ij=It.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[wi({find:Mj,type:this.type})]},addPasteRules(){return[Ir({find:Pj,type:this.type})]}}),Lj=/^```([a-z]+)?[\s\n]$/,Dj=/^~~~([a-z]+)?[\s\n]$/,Nj=$t.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",nt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
182
+
183
+ `);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(De.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[oh({find:Lj,type:this.type,getAttributes:t=>({language:t[1]})}),oh({find:Dj,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new lt({key:new yt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
184
+ `));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Pe.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),jj=$t.create({name:"doc",topNode:!0,content:"block+"});function Fj(t={}){return new lt({view(e){return new Hj(e,t)}})}class Hj{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Vw(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const $j=ht.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Fj(this.options)]}});class at extends De{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return at.valid(r)?new at(r):De.near(r)}content(){return ve.empty}eq(e){return e instanceof at&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new at(e.resolve(n.pos))}getBookmark(){return new cg(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Bj(e)||!Vj(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&at.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(at.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!Ae.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(at.valid(a))return a}return null}}}at.prototype.visible=!1;at.findFrom=at.findGapCursorFrom;De.jsonID("gapcursor",at);class cg{constructor(e){this.pos=e}map(e){return new cg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return at.valid(n)?new at(n):De.near(n)}}function Bj(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Vj(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function zj(){return new lt({props:{decorations:Kj,createSelectionBetween(t,e,n){return e.pos==n.pos&&at.valid(n)?new at(n):null},handleClick:qj,handleKeyDown:Uj,handleDOMEvents:{beforeinput:Wj}}})}const Uj=TS({ArrowLeft:Ma("horiz",-1),ArrowRight:Ma("horiz",1),ArrowUp:Ma("vert",-1),ArrowDown:Ma("vert",1)});function Ma(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Pe){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=at.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new at(c))),!0):!1}}function qj(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!at.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new at(r))),!0)}function Wj(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof at))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=le.empty;for(let s=r.length-1;s>=0;s--)i=le.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new ve(i,0,0));return o.setSelection(Pe.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Kj(t){if(!(t.selection instanceof at))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ut.create(t.doc,[qt.widget(t.selection.head,e,{key:"gapcursor"})])}const Gj=ht.create({name:"gapCursor",addProseMirrorPlugins(){return[zj()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Le(_e(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),Jj=$t.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",nt(this.options.HTMLAttributes,t)]},renderText(){return`
185
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const d=l.filter(h=>a.includes(h.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Jl=200,St=function(){};St.prototype.append=function(e){return e.length?(e=St.from(e),!this.length&&e||e.length<Jl&&this.leafAppend(e)||this.length<Jl&&e.leafPrepend(this)||this.appendInner(e)):this};St.prototype.prepend=function(e){return e.length?St.from(e).append(this):this};St.prototype.appendInner=function(e){return new Xj(this,e)};St.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?St.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};St.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};St.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};St.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};St.from=function(e){return e instanceof St?e:e&&e.length?new Ux(e):St.empty};var Ux=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Jl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Jl)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(St);St.empty=new Ux([]);var Xj=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(St);const Yj=500;class gn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new fr(d.map));let f=d.step.map(i.slice(o)),p;f&&s.maybeStep(f).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new fr(p,void 0,void 0,c.length+u.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(o)):d.selection,l=new gn(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),h=new fr(e.mapping.maps[u],d,n),f;(f=l&&l.merge(h))&&(h=f,u?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&(s++,n=void 0),i||(l=h)}let c=s-r.depth;return c>Zj&&(a=Qj(a,c),s-=c),new gn(a.append(o),s)}remapping(e,n){let r=new cs;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new gn(this.items.append(e.map(n=>new fr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=n;this.items.forEach(h=>{let f=o.getMirror(--l);if(f==null)return;s=Math.min(s,f);let p=o.maps[f];if(h.step){let g=e.steps[f].invert(e.docs[f]),m=h.selection&&h.selection.map(o.slice(l+1,f));m&&a++,r.push(new fr(p,g,m))}else r.push(new fr(p))},i);let c=[];for(let h=n;h<s;h++)c.push(new fr(o.maps[h]));let u=this.items.slice(0,i).append(c).append(r),d=new gn(u,a);return d.emptyItemCount()>Yj&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let d=new fr(c.invert(),l,u),h,f=i.length-1;(h=i.length&&i[f].merge(d))?i[f]=h:i.push(d)}}else s.map&&r--},this.items.length,0),new gn(St.from(i.reverse()),o)}}gn.empty=new gn(St.empty,0);function Qj(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}let fr=class qx{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new qx(n.getMap().invert(),n,this.selection)}}};class mr{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const Zj=20;function eF(t,e,n,r){let i=n.getMeta(fi),o;if(i)return i.historyState;n.getMeta(rF)&&(t=new mr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(fi))return s.getMeta(fi).redo?new mr(t.done.addTransform(n,void 0,r,Ya(e)),t.undone,T0(n.mapping.maps),t.prevTime,t.prevComposition):new mr(t.done,t.undone.addTransform(n,void 0,r,Ya(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!tF(n,t.prevRanges)),c=s?Jd(t.prevRanges,n.mapping):T0(n.mapping.maps);return new mr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Ya(e)),gn.empty,c,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new mr(t.done.rebased(n,o),t.undone.rebased(n,o),Jd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Jd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function tF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function T0(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Jd(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function nF(t,e,n){let r=Ya(e),i=fi.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new mr(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(fi,{redo:n,historyState:l})}let Xd=!1,k0=null;function Ya(t){let e=t.plugins;if(k0!=e){Xd=!1,k0=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Xd=!0;break}}return Xd}const fi=new yt("history"),rF=new yt("closeHistory");function iF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new lt({key:fi,state:{init(){return new mr(gn.empty,gn.empty,null,0,-1)},apply(e,n,r){return eF(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Kx:r=="historyRedo"?Gx:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Wx(t,e){return(n,r)=>{let i=fi.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=nF(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Kx=Wx(!1,!0),Gx=Wx(!0,!0),Jx=ht.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Kx(t,e),redo:()=>({state:t,dispatch:e})=>Gx(t,e)}},addProseMirrorPlugins(){return[iF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),oF=$t.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",nt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):GS(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(Pe.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(Ae.create(s.doc,c.pos)):s.setSelection(Pe.create(s.doc,c.pos));else{const d=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(s.insert(u,d),s.setSelection(Pe.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[xL({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),sF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,aF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,lF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,cF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,uF=It.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[wi({find:sF,type:this.type}),wi({find:lF,type:this.type})]},addPasteRules(){return[Ir({find:aF,type:this.type}),Ir({find:cF,type:this.type})]}}),dF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,fF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,hF=It.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[wi({find:dF,type:this.type})]},addPasteRules(){return[Ir({find:fF,type:this.type})]}}),pF=$t.create({name:"text",group:"inline"}),gF=ht.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,l,c,u,d,h,f,p,g,m,y;const x=[];return this.options.bold!==!1&&x.push(kj.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&x.push(Ox.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&x.push(Tx.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(Ij.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(Nj.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(jj.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push($j.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(Gj.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(Jj.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&x.push(kx.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&x.push(Jx.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(oF.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&x.push(uF.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push($x.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&x.push(Bx.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&x.push(Vx.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(hF.configure((m=this.options)===null||m===void 0?void 0:m.strike)),this.options.text!==!1&&x.push(pF.configure((y=this.options)===null||y===void 0?void 0:y.text)),x}});function mF(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:a}=t,l=r&&!i,c=EL(n),u=new RegExp(`\\s${c}$`),d=s?"^":"",h=i?"":c,f=l?new RegExp(`${d}${c}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${d}(?:^)?${c}[^\\s${h}]*`,"gm"),p=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!p)return null;const g=a.pos-p.length,m=Array.from(p.matchAll(f)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const y=m.input.slice(Math.max(0,m.index-1),m.index),x=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(y);if(o!==null&&!x)return null;const w=g+m.index;let v=w+m[0].length;return l&&u.test(p.slice(v-1,v+1))&&(m[0]+=" ",v+=1),w<a.pos&&v>=a.pos?{range:{from:w,to:v},query:m[0].slice(n.length),text:m[0]}:null}const yF=new yt("suggestion");function vF({pluginKey:t=yF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",command:c=()=>null,items:u=()=>[],render:d=()=>({}),allow:h=()=>!0,findSuggestionMatch:f=mF}){let p;const g=d==null?void 0:d(),m=new lt({key:t,view(){return{update:async(y,x)=>{var w,v,S,C,_,E,R;const A=(w=this.key)===null||w===void 0?void 0:w.getState(x),T=(v=this.key)===null||v===void 0?void 0:v.getState(y.state),k=A.active&&T.active&&A.range.from!==T.range.from,P=!A.active&&T.active,M=A.active&&!T.active,j=!P&&!M&&A.query!==T.query,z=P||k&&j,$=j||k,J=M||k&&j;if(!z&&!$&&!J)return;const K=J&&!z?A:T,D=y.dom.querySelector(`[data-decoration-id="${K.decorationId}"]`);p={editor:e,range:K.range,query:K.query,text:K.text,items:[],command:Q=>c({editor:e,range:K.range,props:Q}),decorationNode:D,clientRect:D?()=>{var Q;const{decorationId:se}=(Q=this.key)===null||Q===void 0?void 0:Q.getState(e.state),oe=y.dom.querySelector(`[data-decoration-id="${se}"]`);return(oe==null?void 0:oe.getBoundingClientRect())||null}:null},z&&((S=g==null?void 0:g.onBeforeStart)===null||S===void 0||S.call(g,p)),$&&((C=g==null?void 0:g.onBeforeUpdate)===null||C===void 0||C.call(g,p)),($||z)&&(p.items=await u({editor:e,query:K.query})),J&&((_=g==null?void 0:g.onExit)===null||_===void 0||_.call(g,p)),$&&((E=g==null?void 0:g.onUpdate)===null||E===void 0||E.call(g,p)),z&&((R=g==null?void 0:g.onStart)===null||R===void 0||R.call(g,p))},destroy:()=>{var y;p&&((y=g==null?void 0:g.onExit)===null||y===void 0||y.call(g,p))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,x,w,v){const{isEditable:S}=e,{composing:C}=e.view,{selection:_}=y,{empty:E,from:R}=_,A={...x};if(A.composing=C,S&&(E||e.view.composing)){(R<x.range.from||R>x.range.to)&&!C&&!x.composing&&(A.active=!1);const T=f({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:_.$from}),k=`id_${Math.floor(Math.random()*4294967295)}`;T&&h({editor:e,state:v,range:T.range,isActive:x.active})?(A.active=!0,A.decorationId=x.decorationId?x.decorationId:k,A.range=T.range,A.query=T.query,A.text=T.text):A.active=!1}else A.active=!1;return A.active||(A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null),A}},props:{handleKeyDown(y,x){var w;const{active:v,range:S}=m.getState(y.state);return v&&((w=g==null?void 0:g.onKeyDown)===null||w===void 0?void 0:w.call(g,{view:y,event:x,range:S}))||!1},decorations(y){const{active:x,range:w,decorationId:v}=m.getState(y);return x?ut.create(y.doc,[qt.inline(w.from,w.to,{nodeName:a,class:l,"data-decoration-id":v})]):null}}});return m}function bF({icon:t,title:e,description:n,...r}){return b.jsxs(N.Tile,{scheme:"light",hoverable:!0,dflex:!0,alignItems:"center",spaceX:"3",p:"2",...r,children:[b.jsx("div",{dflex:!0,alignItems:"center",justifyContent:"center",h:"10",w:"10",rounded:!0,border:!0,borderColor:"stone-200",textColor:"stone-500",bgColor:"white",children:b.jsx(N.Icon,{path:t})}),b.jsxs("div",{children:[b.jsx("p",{fontWeight:"600",userSelect:"none",children:e}),b.jsx("p",{textSize:"xs",textColor:"stone-500",userSelect:"none",children:n})]})]})}function wF(t,e,...n){const[r,i]=O.useState(0),o=O.useCallback(s=>{const a=t[s];a&&e(a)},[t,e,...n]);return O.useEffect(()=>{const s=["ArrowUp","ArrowDown","Enter"],a=l=>{if(s.includes(l.key)){switch(l.preventDefault(),l.key){case"ArrowUp":return i((r+t.length-1)%t.length),!0;case"ArrowDown":return i((r+1)%t.length),!0;case"Enter":return o(r),!0}return!1}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,r,i,o]),O.useEffect(()=>i(0),[t]),r}function SF({items:t,command:e,editor:n,...r}){const i=O.useRef(null),o=O.useCallback(a=>e(a),[e]),s=wF(t,o,n);return O.useLayoutEffect(()=>{const a=i==null?void 0:i.current,l=a==null?void 0:a.children[s];l&&a&&xF(a,l)},[s]),t.length>0?b.jsx(N.Tile,{scheme:"light",id:"slash-command",ref:i,z:"50",h:"auto",maxH:"96",w:"80",p:"2",overflowY:"auto",border:"px",borderColor:"stone-200",shadow:"md",transition:"all",children:t.map((a,l)=>b.jsx(bF,{onClick:c=>{c.preventDefault(),e(t[l])},active:l==s,icon:a.icon,title:a.title,description:a.description},l))}):null}function xF(t,e){const n=t.offsetHeight,r=e?e.offsetHeight:0,i=e.offsetTop,o=i+r;i<t.scrollTop?t.scrollTop-=t.scrollTop-i+5:o>n+t.scrollTop&&(t.scrollTop+=o-n-t.scrollTop+5)}const CF=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","text","paragraph"],icon:ub,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Image",description:"Upload an image from your computer.",searchTerms:["image","img","photo","picture","media"],icon:b_,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setImage({src:""}).setNode("paragraph").run()}},{title:"Youtube",description:"Insert a Youtube video",searchTerms:["youtube","yt","video"],icon:T_,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setYoutubeVideo({src:"https://www.youtube.com/embed/5vheNbQlsyU?si=g_Max_pgn7AgEZVc"}).setNode("paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["heading","h1","title","big","large"],icon:Cx,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["h2","subtitle","medium"],icon:Ex,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["h3","subtitle","small"],icon:_x,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Heading 4",description:"X-Small section heading.",searchTerms:["h4","subtitle","small"],icon:Rx,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:4}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["ul","unordered","point"],icon:rb,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ol","ordered"],icon:ib,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Quote",description:"Capture a quote.",searchTerms:["quote","blockquote"],icon:ob,command:({editor:t,range:e})=>t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").toggleBlockquote().run()}],EF=t=>({query:e})=>CF.concat(t??[]).filter(n=>{if(typeof e=="string"&&e.length>0){const r=e.toLowerCase();return n.title.toLowerCase().includes(r)||n.description.toLowerCase().includes(r)||n.searchTerms&&n.searchTerms.some(i=>i.includes(r))}return!0}),_F=ht.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>n.command({editor:t,range:e})}}},addProseMirrorPlugins(){return[vF({editor:this.editor,...this.options.suggestion})]}}),RF=t=>_F.configure({suggestion:{items:EF(t),render:()=>{let e=null,n=null;return{onStart:r=>{e=new wx(SF,{props:r,editor:r.editor}),n=wo("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:r=>{e==null||e.updateProps(r),n&&n[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var i;return r.event.key==="Escape"?(n==null||n[0].hide(),!0):(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(r)},onExit:()=>{n==null||n[0].destroy(),e==null||e.destroy()}}}}});function Mt(t){return t.toFixed(7).replace(/(\.[0-9]+?)0+$/,"$1").replace(/\.0$/,"")}function Y(t,e){return`${Mt(t/e)}em`}const Xx={defaultProps:{fontWeight:"500",italic:!0,textColor:"var(--tw-prose-quotes)",borderS:"0.25rem",borderSColor:"var(--tw-prose-quote-borders)",style:{quotes:'"\\201C""\\201D""\\2018""\\2019"'},css:{"& p:first-of-type::before":{content:"open-quote"},"& p:last-of-type::after":{content:"close-quote"}},mt:Y(32,20),mb:Y(32,20),ps:Y(20,20),sm_mt:Y(24,18),sm_mb:Y(24,18),sm_ps:Y(20,18),lg_mt:Y(40,24),lg_mb:Y(40,24),lg_ps:Y(24,24),xl_mt:Y(48,30),xl_mb:Y(48,30),xl_ps:Y(32,30),x2_mt:Y(64,36),x2_mb:Y(64,36),x2_ps:Y(40,36)}},AF=O.createContext({onDragStart:void 0}),Yx=()=>O.useContext(AF),Ai=O.forwardRef((t,e)=>{const{onDragStart:n}=Yx(),r=t.as||"div";return b.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function Vc(t,e){var r,i,o,s;const n=((r=t.decorations)==null?void 0:r.length)>0?(s=(o=(i=t.decorations[0])==null?void 0:i.type)==null?void 0:o.attrs)==null?void 0:s["data-placeholder"]:null;return{css:{"&:before":{content:`"${n?e??n:""}"`,float:"left",color:"gray",pointerEvents:"none",height:0}}}}N.ComponentManager.registerComponent("Editor.BlockQuote",Xx);function OF({...t}){const e=N.useComponentConfig("Editor.BlockQuote",void 0,{},{});return b.jsx(Ai,{as:"blockquote",...e,...Vc(t,"Quote"),children:b.jsx(zs,{})})}const Qx={defaultProps:{listStyle:"disc",mt:Y(20,16),mb:Y(20,16),ps:Y(26,16),css:{"& li":{paddingLeft:Y(6,16)},"& li:marker":{color:"var(--tw-prose-bullets)"},"& li p":{marginTop:Y(12,16),marginBottom:Y(12,16)},"& li > *:first-of-type":{marginTop:Y(20,16)},"& li > *:last-of-type":{marginBottom:Y(20,16)},"& ul, & ol":{marginTop:Y(12,16),marginBottom:Y(12,16)}},sm_mt:Y(16,14),sm_mb:Y(16,14),sm_ps:Y(22,14),lg_mt:Y(24,18),lg_mb:Y(24,18),lg_ps:Y(28,18),xl_mt:Y(24,20),xl_mb:Y(24,20),xl_ps:Y(32,20),x2_mt:Y(32,24),x2_mb:Y(32,24),x2_ps:Y(38,24)}};N.ComponentManager.registerComponent("Editor.BulletList",Qx);function TF(){const t=N.useComponentConfig("Editor.BulletList",void 0,{},{});return b.jsx(Ai,{as:"ul",...t,children:b.jsx(zs,{})})}const Zx={defaultProps:{fontWeight:"700",textColor:"slate-800",textSize:Y(20,16),mt:Y(48,24),mb:Y(24,24),lineHeight:Mt(32/24),sm_textSize:Y(20,14),sm_mt:Y(32,20),sm_mb:Y(16,20),sm_lineHeight:Mt(28/20),lg_textSize:Y(30,18),lg_mt:Y(56,30),lg_mb:Y(32,30),lg_lineHeight:Mt(40/30),xl_textSize:Y(36,20),xl_mt:Y(56,36),xl_mb:Y(32,36),xl_lineHeight:Mt(40/36),x2_textSize:Y(48,24),x2_mt:Y(72,48),x2_mb:Y(40,48),x2_lineHeight:Mt(52/48)}},eC={defaultProps:{fontWeight:"600",textColor:"slate-800",textSize:Y(18,16),mt:Y(32,20),mb:Y(12,20),lineHeight:Mt(32/20),sm_textSize:Y(18,14),sm_mt:Y(28,18),sm_mb:Y(8,18),sm_lineHeight:Mt(28/18),lg_textSize:Y(24,18),lg_mt:Y(40,24),lg_mb:Y(16,24),lg_lineHeight:Mt(36/24),xl_textSize:Y(30,20),xl_mt:Y(48,30),xl_mb:Y(20,30),xl_lineHeight:Mt(40/30),x2_textSize:Y(36,24),x2_mt:Y(56,36),x2_mb:Y(24,36),x2_lineHeight:Mt(44/36)}},tC={defaultProps:{fontWeight:"600",textColor:"slate-800",mt:Y(24,16),mb:Y(8,16),lineHeight:Mt(24/16),sm_mt:Y(20,14),sm_mb:Y(8,14),sm_lineHeight:Mt(20/14),lg_mt:Y(32,18),lg_mb:Y(8,18),lg_lineHeight:Mt(28/18),xl_mt:Y(36,20),xl_mb:Y(12,20),xl_lineHeight:Mt(32/20),x2_mt:Y(40,24),x2_mb:Y(16,24),x2_lineHeight:Mt(36/24)}};N.ComponentManager.registerComponent("Editor.H1",Zx);N.ComponentManager.registerComponent("Editor.H2",eC);N.ComponentManager.registerComponent("Editor.H3",tC);function kF({...t}){const e=t.node.attrs.level,n=N.useComponentConfig(`Editor.H${e}`,void 0,{},{}),r=`h${e}`;return b.jsx(Ai,{as:r,...n,...Vc(t),children:b.jsx(zs,{})})}var xh={exports:{}},Pa={exports:{}},qe={};/** @license React v16.13.1
186
+ * react-is.production.min.js
187
+ *
188
+ * Copyright (c) Facebook, Inc. and its affiliates.
189
+ *
190
+ * This source code is licensed under the MIT license found in the
191
+ * LICENSE file in the root directory of this source tree.
192
+ */var M0;function MF(){if(M0)return qe;M0=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,x=t?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var C=S.$$typeof;switch(C){case e:switch(S=S.type,S){case l:case c:case r:case o:case i:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case p:case f:case s:return S;default:return C}}case n:return C}}}function v(S){return w(S)===c}return qe.AsyncMode=l,qe.ConcurrentMode=c,qe.ContextConsumer=a,qe.ContextProvider=s,qe.Element=e,qe.ForwardRef=u,qe.Fragment=r,qe.Lazy=p,qe.Memo=f,qe.Portal=n,qe.Profiler=o,qe.StrictMode=i,qe.Suspense=d,qe.isAsyncMode=function(S){return v(S)||w(S)===l},qe.isConcurrentMode=v,qe.isContextConsumer=function(S){return w(S)===a},qe.isContextProvider=function(S){return w(S)===s},qe.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},qe.isForwardRef=function(S){return w(S)===u},qe.isFragment=function(S){return w(S)===r},qe.isLazy=function(S){return w(S)===p},qe.isMemo=function(S){return w(S)===f},qe.isPortal=function(S){return w(S)===n},qe.isProfiler=function(S){return w(S)===o},qe.isStrictMode=function(S){return w(S)===i},qe.isSuspense=function(S){return w(S)===d},qe.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===o||S===i||S===d||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===p||S.$$typeof===f||S.$$typeof===s||S.$$typeof===a||S.$$typeof===u||S.$$typeof===m||S.$$typeof===y||S.$$typeof===x||S.$$typeof===g)},qe.typeOf=w,qe}var We={};/** @license React v16.13.1
193
+ * react-is.development.js
194
+ *
195
+ * Copyright (c) Facebook, Inc. and its affiliates.
196
+ *
197
+ * This source code is licensed under the MIT license found in the
198
+ * LICENSE file in the root directory of this source tree.
199
+ */var P0;function PF(){return P0||(P0=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,x=t?Symbol.for("react.scope"):60119;function w(I){return typeof I=="string"||typeof I=="function"||I===r||I===c||I===o||I===i||I===d||I===h||typeof I=="object"&&I!==null&&(I.$$typeof===p||I.$$typeof===f||I.$$typeof===s||I.$$typeof===a||I.$$typeof===u||I.$$typeof===m||I.$$typeof===y||I.$$typeof===x||I.$$typeof===g)}function v(I){if(typeof I=="object"&&I!==null){var je=I.$$typeof;switch(je){case e:var G=I.type;switch(G){case l:case c:case r:case o:case i:case d:return G;default:var ne=G&&G.$$typeof;switch(ne){case a:case u:case p:case f:case s:return ne;default:return je}}case n:return je}}}var S=l,C=c,_=a,E=s,R=e,A=u,T=r,k=p,P=f,M=n,j=o,z=i,$=d,J=!1;function K(I){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(I)||v(I)===l}function D(I){return v(I)===c}function Q(I){return v(I)===a}function se(I){return v(I)===s}function oe(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function de(I){return v(I)===u}function ue(I){return v(I)===r}function pe(I){return v(I)===p}function L(I){return v(I)===f}function ce(I){return v(I)===n}function me(I){return v(I)===o}function be(I){return v(I)===i}function F(I){return v(I)===d}We.AsyncMode=S,We.ConcurrentMode=C,We.ContextConsumer=_,We.ContextProvider=E,We.Element=R,We.ForwardRef=A,We.Fragment=T,We.Lazy=k,We.Memo=P,We.Portal=M,We.Profiler=j,We.StrictMode=z,We.Suspense=$,We.isAsyncMode=K,We.isConcurrentMode=D,We.isContextConsumer=Q,We.isContextProvider=se,We.isElement=oe,We.isForwardRef=de,We.isFragment=ue,We.isLazy=pe,We.isMemo=L,We.isPortal=ce,We.isProfiler=me,We.isStrictMode=be,We.isSuspense=F,We.isValidElementType=w,We.typeOf=v}()),We}var I0;function nC(){return I0||(I0=1,process.env.NODE_ENV==="production"?Pa.exports=MF():Pa.exports=PF()),Pa.exports}/*
200
+ object-assign
201
+ (c) Sindre Sorhus
202
+ @license MIT
203
+ */var Yd,L0;function IF(){if(L0)return Yd;L0=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yd=i()?Object.assign:function(o,s){for(var a,l=r(o),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)e.call(a,d)&&(l[d]=a[d]);if(t){c=t(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Yd}var Qd,D0;function ug(){if(D0)return Qd;D0=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qd=t,Qd}var Zd,N0;function rC(){return N0||(N0=1,Zd=Function.call.bind(Object.prototype.hasOwnProperty)),Zd}var ef,j0;function LF(){if(j0)return ef;j0=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=ug(),n={},r=rC();t=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var d;try{if(typeof o[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=o[u](s,u,l,a,null,e)}catch(p){d=p}if(d&&!(d instanceof Error)&&t((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=c?c():"";t("Failed "+a+" type: "+d.message+(f??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ef=i,ef}var tf,F0;function DF(){if(F0)return tf;F0=1;var t=nC(),e=IF(),n=ug(),r=rC(),i=LF(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return tf=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(D){var Q=D&&(c&&D[c]||D[u]);if(typeof Q=="function")return Q}var h="<<anonymous>>",f={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:x(),arrayOf:w,element:v(),elementType:S(),instanceOf:C,node:A(),objectOf:E,oneOf:_,oneOfType:R,shape:k,exact:P};function p(D,Q){return D===Q?D!==0||1/D===1/Q:D!==D&&Q!==Q}function g(D,Q){this.message=D,this.data=Q&&typeof Q=="object"?Q:{},this.stack=""}g.prototype=Error.prototype;function m(D){if(process.env.NODE_ENV!=="production")var Q={},se=0;function oe(ue,pe,L,ce,me,be,F){if(ce=ce||h,be=be||L,F!==n){if(l){var I=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var je=ce+":"+L;!Q[je]&&se<3&&(o("You are manually calling a React.PropTypes validation function for the `"+be+"` prop on `"+ce+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Q[je]=!0,se++)}}return pe[L]==null?ue?pe[L]===null?new g("The "+me+" `"+be+"` is marked as required "+("in `"+ce+"`, but its value is `null`.")):new g("The "+me+" `"+be+"` is marked as required in "+("`"+ce+"`, but its value is `undefined`.")):null:D(pe,L,ce,me,be)}var de=oe.bind(null,!1);return de.isRequired=oe.bind(null,!0),de}function y(D){function Q(se,oe,de,ue,pe,L){var ce=se[oe],me=z(ce);if(me!==D){var be=$(ce);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+be+"` supplied to `"+de+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return m(Q)}function x(){return m(s)}function w(D){function Q(se,oe,de,ue,pe){if(typeof D!="function")return new g("Property `"+pe+"` of component `"+de+"` has invalid PropType notation inside arrayOf.");var L=se[oe];if(!Array.isArray(L)){var ce=z(L);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected an array."))}for(var me=0;me<L.length;me++){var be=D(L,me,de,ue,pe+"["+me+"]",n);if(be instanceof Error)return be}return null}return m(Q)}function v(){function D(Q,se,oe,de,ue){var pe=Q[se];if(!a(pe)){var L=z(pe);return new g("Invalid "+de+" `"+ue+"` of type "+("`"+L+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return m(D)}function S(){function D(Q,se,oe,de,ue){var pe=Q[se];if(!t.isValidElementType(pe)){var L=z(pe);return new g("Invalid "+de+" `"+ue+"` of type "+("`"+L+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return m(D)}function C(D){function Q(se,oe,de,ue,pe){if(!(se[oe]instanceof D)){var L=D.name||h,ce=K(se[oe]);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected ")+("instance of `"+L+"`."))}return null}return m(Q)}function _(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function Q(se,oe,de,ue,pe){for(var L=se[oe],ce=0;ce<D.length;ce++)if(p(L,D[ce]))return null;var me=JSON.stringify(D,function(F,I){var je=$(I);return je==="symbol"?String(I):I});return new g("Invalid "+ue+" `"+pe+"` of value `"+String(L)+"` "+("supplied to `"+de+"`, expected one of "+me+"."))}return m(Q)}function E(D){function Q(se,oe,de,ue,pe){if(typeof D!="function")return new g("Property `"+pe+"` of component `"+de+"` has invalid PropType notation inside objectOf.");var L=se[oe],ce=z(L);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected an object."));for(var me in L)if(r(L,me)){var be=D(L,me,de,ue,pe+"."+me,n);if(be instanceof Error)return be}return null}return m(Q)}function R(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var Q=0;Q<D.length;Q++){var se=D[Q];if(typeof se!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(se)+" at index "+Q+"."),s}function oe(de,ue,pe,L,ce){for(var me=[],be=0;be<D.length;be++){var F=D[be],I=F(de,ue,pe,L,ce,n);if(I==null)return null;I.data&&r(I.data,"expectedType")&&me.push(I.data.expectedType)}var je=me.length>0?", expected one of type ["+me.join(", ")+"]":"";return new g("Invalid "+L+" `"+ce+"` supplied to "+("`"+pe+"`"+je+"."))}return m(oe)}function A(){function D(Q,se,oe,de,ue){return M(Q[se])?null:new g("Invalid "+de+" `"+ue+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return m(D)}function T(D,Q,se,oe,de){return new g((D||"React class")+": "+Q+" type `"+se+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+de+"`.")}function k(D){function Q(se,oe,de,ue,pe){var L=se[oe],ce=z(L);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type `"+ce+"` "+("supplied to `"+de+"`, expected `object`."));for(var me in D){var be=D[me];if(typeof be!="function")return T(de,ue,pe,me,$(be));var F=be(L,me,de,ue,pe+"."+me,n);if(F)return F}return null}return m(Q)}function P(D){function Q(se,oe,de,ue,pe){var L=se[oe],ce=z(L);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type `"+ce+"` "+("supplied to `"+de+"`, expected `object`."));var me=e({},se[oe],D);for(var be in me){var F=D[be];if(r(D,be)&&typeof F!="function")return T(de,ue,pe,be,$(F));if(!F)return new g("Invalid "+ue+" `"+pe+"` key `"+be+"` supplied to `"+de+"`.\nBad object: "+JSON.stringify(se[oe],null," ")+`
204
+ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var I=F(L,be,de,ue,pe+"."+be,n);if(I)return I}return null}return m(Q)}function M(D){switch(typeof D){case"number":case"string":case"undefined":return!0;case"boolean":return!D;case"object":if(Array.isArray(D))return D.every(M);if(D===null||a(D))return!0;var Q=d(D);if(Q){var se=Q.call(D),oe;if(Q!==D.entries){for(;!(oe=se.next()).done;)if(!M(oe.value))return!1}else for(;!(oe=se.next()).done;){var de=oe.value;if(de&&!M(de[1]))return!1}}else return!1;return!0;default:return!1}}function j(D,Q){return D==="symbol"?!0:Q?Q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Q instanceof Symbol:!1}function z(D){var Q=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":j(Q,D)?"symbol":Q}function $(D){if(typeof D>"u"||D===null)return""+D;var Q=z(D);if(Q==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return Q}function J(D){var Q=$(D);switch(Q){case"array":case"object":return"an "+Q;case"boolean":case"date":case"regexp":return"a "+Q;default:return Q}}function K(D){return!D.constructor||!D.constructor.name?h:D.constructor.name}return f.checkPropTypes=i,f.resetWarningCache=i.resetWarningCache,f.PropTypes=f,f},tf}var nf,H0;function NF(){if(H0)return nf;H0=1;var t=ug();function e(){}function n(){}return n.resetWarningCache=e,nf=function(){function r(s,a,l,c,u,d){if(d!==t){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},nf}if(process.env.NODE_ENV!=="production"){var jF=nC(),FF=!0;xh.exports=DF()(jF.isElement,FF)}else xh.exports=NF()();var HF=xh.exports;const Ye=fb(HF);function So(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function xo(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function $0(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function B0(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var $F=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Us(t,e){var n=BF(t);if(typeof n.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function BF(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var r=e.split(".").pop().toLowerCase(),i=$F.get(r);i&&Object.defineProperty(t,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return t}var VF=[".DS_Store","Thumbs.db"];function zF(t){return So(this,void 0,void 0,function(){return xo(this,function(e){return Xl(t)&&UF(t.dataTransfer)?[2,GF(t.dataTransfer,t.type)]:qF(t)?[2,WF(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,KF(t)]:[2,[]]})})}function UF(t){return Xl(t)}function qF(t){return Xl(t)&&Xl(t.target)}function Xl(t){return typeof t=="object"&&t!==null}function WF(t){return Ch(t.target.files).map(function(e){return Us(e)})}function KF(t){return So(this,void 0,void 0,function(){var e;return xo(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(r){return Us(r)})]}})})}function GF(t,e){return So(this,void 0,void 0,function(){var n,r;return xo(this,function(i){switch(i.label){case 0:return t.items?(n=Ch(t.items).filter(function(o){return o.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(JF))]):[3,2];case 1:return r=i.sent(),[2,V0(iC(r))];case 2:return[2,V0(Ch(t.files).map(function(o){return Us(o)}))]}})})}function V0(t){return t.filter(function(e){return VF.indexOf(e.name)===-1})}function Ch(t){if(t===null)return[];for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(r)}return e}function JF(t){if(typeof t.webkitGetAsEntry!="function")return z0(t);var e=t.webkitGetAsEntry();return e&&e.isDirectory?oC(e):z0(t)}function iC(t){return t.reduce(function(e,n){return B0(B0([],$0(e),!1),$0(Array.isArray(n)?iC(n):[n]),!1)},[])}function z0(t){var e=t.getAsFile();if(!e)return Promise.reject("".concat(t," is not a File"));var n=Us(e);return Promise.resolve(n)}function XF(t){return So(this,void 0,void 0,function(){return xo(this,function(e){return[2,t.isDirectory?oC(t):YF(t)]})})}function oC(t){var e=t.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;e.readEntries(function(a){return So(s,void 0,void 0,function(){var l,c,u;return xo(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(XF)),i.push(u),o(),d.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function YF(t){return So(this,void 0,void 0,function(){return xo(this,function(e){return[2,new Promise(function(n,r){t.file(function(i){var o=Us(i,t.fullPath);n(o)},function(i){r(i)})})]})})}var QF=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),r=t.name||"",i=(t.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function U0(t){return t3(t)||e3(t)||aC(t)||ZF()}function ZF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
205
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function t3(t){if(Array.isArray(t))return Eh(t)}function q0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function W0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?q0(Object(n),!0).forEach(function(r){sC(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):q0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sC(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xs(t,e){return i3(t)||r3(t,e)||aC(t,e)||n3()}function n3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
206
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aC(t,e){if(t){if(typeof t=="string")return Eh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Eh(t,e)}}function Eh(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function r3(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function i3(t){if(Array.isArray(t))return t}var o3="file-invalid-type",s3="file-too-large",a3="file-too-small",l3="too-many-files",c3=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:o3,message:"File type must be ".concat(n)}},K0=function(e){return{code:s3,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},G0=function(e){return{code:a3,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},u3={code:l3,message:"Too many files"};function lC(t,e){var n=t.type==="application/x-moz-file"||QF(t,e);return[n,n?null:c3(e)]}function cC(t,e,n){if(ti(t.size))if(ti(e)&&ti(n)){if(t.size>n)return[!1,K0(n)];if(t.size<e)return[!1,G0(e)]}else{if(ti(e)&&t.size<e)return[!1,G0(e)];if(ti(n)&&t.size>n)return[!1,K0(n)]}return[!0,null]}function ti(t){return t!=null}function d3(t){var e=t.files,n=t.accept,r=t.minSize,i=t.maxSize,o=t.multiple,s=t.maxFiles,a=t.validator;return!o&&e.length>1||o&&s>=1&&e.length>s?!1:e.every(function(l){var c=lC(l,n),u=xs(c,1),d=u[0],h=cC(l,r,i),f=xs(h,1),p=f[0],g=a?a(l):null;return d&&p&&!g})}function Yl(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function Ia(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function J0(t){t.preventDefault()}function f3(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function h3(t){return t.indexOf("Edge/")!==-1}function p3(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return f3(t)||h3(t)}function xn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return e.some(function(a){return!Yl(r)&&a&&a.apply(void 0,[r].concat(o)),Yl(r)})}}function g3(){return"showOpenFilePicker"in window}function m3(t){if(ti(t)){var e=Object.entries(t).filter(function(n){var r=xs(n,2),i=r[0],o=r[1],s=!0;return uC(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(dC))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=xs(r,2),o=i[0],s=i[1];return W0(W0({},n),{},sC({},o,s))},{});return[{description:"Files",accept:e}]}return t}function y3(t){if(ti(t))return Object.entries(t).reduce(function(e,n){var r=xs(n,2),i=r[0],o=r[1];return[].concat(U0(e),[i],U0(o))},[]).filter(function(e){return uC(e)||dC(e)}).join(",")}function v3(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function b3(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function uC(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}function dC(t){return/^.*\.[\w]+$/.test(t)}var w3=["children"],S3=["open"],x3=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],C3=["refKey","onChange","onClick"];function E3(t){return A3(t)||R3(t)||fC(t)||_3()}function _3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
207
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function A3(t){if(Array.isArray(t))return _h(t)}function rf(t,e){return k3(t)||T3(t,e)||fC(t,e)||O3()}function O3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
208
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fC(t,e){if(t){if(typeof t=="string")return _h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _h(t,e)}}function _h(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function T3(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function k3(t){if(Array.isArray(t))return t}function X0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?X0(Object(n),!0).forEach(function(r){Rh(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Rh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ql(t,e){if(t==null)return{};var n=M3(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function M3(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var dg=O.forwardRef(function(t,e){var n=t.children,r=Ql(t,w3),i=pC(r),o=i.open,s=Ql(i,S3);return O.useImperativeHandle(e,function(){return{open:o}},[o]),O.createElement(O.Fragment,null,n(ot(ot({},s),{},{open:o})))});dg.displayName="Dropzone";var hC={disabled:!1,getFilesFromEvent:zF,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};dg.defaultProps=hC;dg.propTypes={children:Ye.func,accept:Ye.objectOf(Ye.arrayOf(Ye.string)),multiple:Ye.bool,preventDropOnDocument:Ye.bool,noClick:Ye.bool,noKeyboard:Ye.bool,noDrag:Ye.bool,noDragEventsBubbling:Ye.bool,minSize:Ye.number,maxSize:Ye.number,maxFiles:Ye.number,disabled:Ye.bool,getFilesFromEvent:Ye.func,onFileDialogCancel:Ye.func,onFileDialogOpen:Ye.func,useFsAccessApi:Ye.bool,autoFocus:Ye.bool,onDragEnter:Ye.func,onDragLeave:Ye.func,onDragOver:Ye.func,onDrop:Ye.func,onDropAccepted:Ye.func,onDropRejected:Ye.func,onError:Ye.func,validator:Ye.func};var Ah={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function pC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=ot(ot({},hC),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,o=e.maxSize,s=e.minSize,a=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,h=e.onDrop,f=e.onDropAccepted,p=e.onDropRejected,g=e.onFileDialogCancel,m=e.onFileDialogOpen,y=e.useFsAccessApi,x=e.autoFocus,w=e.preventDropOnDocument,v=e.noClick,S=e.noKeyboard,C=e.noDrag,_=e.noDragEventsBubbling,E=e.onError,R=e.validator,A=O.useMemo(function(){return y3(n)},[n]),T=O.useMemo(function(){return m3(n)},[n]),k=O.useMemo(function(){return typeof m=="function"?m:Y0},[m]),P=O.useMemo(function(){return typeof g=="function"?g:Y0},[g]),M=O.useRef(null),j=O.useRef(null),z=O.useReducer(P3,Ah),$=rf(z,2),J=$[0],K=$[1],D=J.isFocused,Q=J.isFileDialogActive,se=O.useRef(typeof window<"u"&&window.isSecureContext&&y&&g3()),oe=function(){!se.current&&Q&&setTimeout(function(){if(j.current){var H=j.current.files;H.length||(K({type:"closeDialog"}),P())}},300)};O.useEffect(function(){return window.addEventListener("focus",oe,!1),function(){window.removeEventListener("focus",oe,!1)}},[j,Q,P,se]);var de=O.useRef([]),ue=function(H){M.current&&M.current.contains(H.target)||(H.preventDefault(),de.current=[])};O.useEffect(function(){return w&&(document.addEventListener("dragover",J0,!1),document.addEventListener("drop",ue,!1)),function(){w&&(document.removeEventListener("dragover",J0),document.removeEventListener("drop",ue))}},[M,w]),O.useEffect(function(){return!r&&x&&M.current&&M.current.focus(),function(){}},[M,x,r]);var pe=O.useCallback(function(U){E?E(U):console.error(U)},[E]),L=O.useCallback(function(U){U.preventDefault(),U.persist(),xe(U),de.current=[].concat(E3(de.current),[U.target]),Ia(U)&&Promise.resolve(i(U)).then(function(H){if(!(Yl(U)&&!_)){var re=H.length,V=re>0&&d3({files:H,accept:A,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:R}),te=re>0&&!V;K({isDragAccept:V,isDragReject:te,isDragActive:!0,type:"setDraggedFiles"}),c&&c(U)}}).catch(function(H){return pe(H)})},[i,c,pe,_,A,s,o,a,l,R]),ce=O.useCallback(function(U){U.preventDefault(),U.persist(),xe(U);var H=Ia(U);if(H&&U.dataTransfer)try{U.dataTransfer.dropEffect="copy"}catch{}return H&&d&&d(U),!1},[d,_]),me=O.useCallback(function(U){U.preventDefault(),U.persist(),xe(U);var H=de.current.filter(function(V){return M.current&&M.current.contains(V)}),re=H.indexOf(U.target);re!==-1&&H.splice(re,1),de.current=H,!(H.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ia(U)&&u&&u(U))},[M,u,_]),be=O.useCallback(function(U,H){var re=[],V=[];U.forEach(function(te){var fe=lC(te,A),ye=rf(fe,2),Ce=ye[0],Fe=ye[1],Ve=cC(te,s,o),q=rf(Ve,2),ae=q[0],ge=q[1],Te=R?R(te):null;if(Ce&&ae&&!Te)re.push(te);else{var Oe=[Fe,ge];Te&&(Oe=Oe.concat(Te)),V.push({file:te,errors:Oe.filter(function(Be){return Be})})}}),(!a&&re.length>1||a&&l>=1&&re.length>l)&&(re.forEach(function(te){V.push({file:te,errors:[u3]})}),re.splice(0)),K({acceptedFiles:re,fileRejections:V,type:"setFiles"}),h&&h(re,V,H),V.length>0&&p&&p(V,H),re.length>0&&f&&f(re,H)},[K,a,A,s,o,l,h,f,p,R]),F=O.useCallback(function(U){U.preventDefault(),U.persist(),xe(U),de.current=[],Ia(U)&&Promise.resolve(i(U)).then(function(H){Yl(U)&&!_||be(H,U)}).catch(function(H){return pe(H)}),K({type:"reset"})},[i,be,pe,_]),I=O.useCallback(function(){if(se.current){K({type:"openDialog"}),k();var U={multiple:a,types:T};window.showOpenFilePicker(U).then(function(H){return i(H)}).then(function(H){be(H,null),K({type:"closeDialog"})}).catch(function(H){v3(H)?(P(H),K({type:"closeDialog"})):b3(H)?(se.current=!1,j.current?(j.current.value=null,j.current.click()):pe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):pe(H)});return}j.current&&(K({type:"openDialog"}),k(),j.current.value=null,j.current.click())},[K,k,P,y,be,pe,T,a]),je=O.useCallback(function(U){!M.current||!M.current.isEqualNode(U.target)||(U.key===" "||U.key==="Enter"||U.keyCode===32||U.keyCode===13)&&(U.preventDefault(),I())},[M,I]),G=O.useCallback(function(){K({type:"focus"})},[]),ne=O.useCallback(function(){K({type:"blur"})},[]),X=O.useCallback(function(){v||(p3()?setTimeout(I,0):I())},[v,I]),W=function(H){return r?null:H},B=function(H){return S?null:W(H)},ee=function(H){return C?null:W(H)},xe=function(H){_&&H.stopPropagation()},we=O.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=U.refKey,re=H===void 0?"ref":H,V=U.role,te=U.onKeyDown,fe=U.onFocus,ye=U.onBlur,Ce=U.onClick,Fe=U.onDragEnter,Ve=U.onDragOver,q=U.onDragLeave,ae=U.onDrop,ge=Ql(U,x3);return ot(ot(Rh({onKeyDown:B(xn(te,je)),onFocus:B(xn(fe,G)),onBlur:B(xn(ye,ne)),onClick:W(xn(Ce,X)),onDragEnter:ee(xn(Fe,L)),onDragOver:ee(xn(Ve,ce)),onDragLeave:ee(xn(q,me)),onDrop:ee(xn(ae,F)),role:typeof V=="string"&&V!==""?V:"presentation"},re,M),!r&&!S?{tabIndex:0}:{}),ge)}},[M,je,G,ne,X,L,ce,me,F,S,C,r]),Z=O.useCallback(function(U){U.stopPropagation()},[]),Se=O.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=U.refKey,re=H===void 0?"ref":H,V=U.onChange,te=U.onClick,fe=Ql(U,C3),ye=Rh({accept:A,multiple:a,type:"file",style:{display:"none"},onChange:W(xn(V,F)),onClick:W(xn(te,Z)),tabIndex:-1},re,j);return ot(ot({},ye),fe)}},[j,n,a,F,r]);return ot(ot({},J),{},{isFocused:D&&!r,getRootProps:we,getInputProps:Se,rootRef:M,inputRef:j,open:W(I)})}function P3(t,e){switch(e.type){case"focus":return ot(ot({},t),{},{isFocused:!0});case"blur":return ot(ot({},t),{},{isFocused:!1});case"openDialog":return ot(ot({},Ah),{},{isFileDialogActive:!0});case"closeDialog":return ot(ot({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return ot(ot({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return ot(ot({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return ot({},Ah);default:return t}}function Y0(){}function fg({children:t}){return b.jsx("div",{position:"absolute",top:"3",end:"3",dflex:!0,spaceX:"3",children:t})}function Zl({...t}){return b.jsx(N.Button,{variant:"glass",corners:"pill",scheme:"secondary",w:"10",h:"10",...t})}function gC({...t}){return b.jsx(Zl,{title:"Reset Image",...t,children:b.jsx(N.Icon,{path:w_})})}function mC({cancelable:t,onCancel:e,progress:n}){return b.jsxs("div",{dflex:!0,alignItems:"center",placeContent:"center",position:"absolute",top:"0",start:"0",w:"full",h:"full",bgColor:"black",bgOpacity:"50",flexCol:!0,spaceY:"5",children:[b.jsx(N.Spinner,{size:"x2",thickness:"1"}),t&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{textSize:"lg",fontWeight:"600",textColor:"white",children:[Math.round(n??0)," %"]}),b.jsxs(N.Button,{scheme:"danger",variant:"glass",corners:"pill",size:"sm",pe:"3",onClick:e,gap:"2",dflex:!0,alignItems:"center",children:[b.jsx(N.Icon,{path:Qv}),"Abort"]})]})]})}function yC({onRetry:t,msg:e,...n}){return b.jsxs("div",{dflex:!0,alignItems:"center",placeContent:"center",position:"absolute",top:"0",start:"0",w:"full",h:"full",bgColor:"#ff0000",bgOpacity:"50",flexCol:!0,spaceY:"5",...n,children:[b.jsx("div",{textColor:"white",children:e}),b.jsxs(N.Button,{onClick:t,shadow:!0,dflex:!0,alignItems:"center",gap:"3",children:[b.jsx(N.Icon,{path:cb}),"Retry"]})]})}function I3({src:t,srcWidth:e,srcHeight:n,onReset:r,imgAspectRatio:i,children:o}){const[s,a]=O.useState(!0),[l,c]=O.useState(!1),u=O.useCallback(()=>{a(!1),c(!1)},[a,c]),d=O.useCallback(()=>{c(!0),a(!1)},[c,a]),h=O.useCallback(()=>{const f=new Image;f.onload=u,f.onerror=d,c(!1),a(!0),f.src=t},[u,d,c,a]);return b.jsxs("div",{position:"relative",aspectRatio:i,children:[!l&&b.jsx("img",{onLoad:u,onError:d,src:t,width:e,height:n,objectFit:"cover",aspectRatio:i}),s&&b.jsx(mC,{}),l&&b.jsx(yC,{msg:"Oops, couldn't load the image.",onRetry:h}),b.jsxs(fg,{children:[b.jsx(gC,{onClick:r}),o]})]})}const L3=O.memo(function({src:t,state:e,onReset:n,onCancel:r,onRetry:i,imgAspectRatio:o,children:s,...a}){return b.jsxs("div",{position:"relative",aspectRatio:o,...a,children:[b.jsx("img",{src:t,objectFit:"cover",alt:"",aspectRatio:o}),e.state=="loading"&&b.jsx(mC,{cancelable:!0,onCancel:r,progress:e.progress}),e.state=="error"&&b.jsx(yC,{onRetry:i,msg:"Oops, there was an error uploading your image, please retry."}),e.state=="error"&&b.jsxs(fg,{children:[b.jsx(gC,{onClick:n}),s]})]})});function D3(t){if(t.type.includes("image/")){if(t.size/1024/1024>7)return Ie.error("File size too big, max image size allowed is 7 Mb"),!1}else return Ie.error("Only image files are allowed"),!1;return!0}O.memo(function({type:t="image",state:e,onFileSelected:n,onResetImage:r,onCancel:i,onRetry:o,emptyStateProps:s,showMediaLibraryButton:a,onMediaLibraryButtonClick:l,children:c,...u}){const d=O.useCallback(x=>{const w=x[0];D3(w)&&n(w)},[n]),{getRootProps:h,getInputProps:f,isDragActive:p,open:g}=pC({onDrop:d,multiple:!1,accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/webp":[".webp"]}}),m=O.useCallback(x=>{x.preventDefault(),x.stopPropagation(),g()},[g]),y=O.useCallback(x=>{x.preventDefault(),x.stopPropagation(),l==null||l()},[l]);return b.jsxs("div",{bgColor:"slate-500",...u,children:[e.state=="complete"&&b.jsx(I3,{src:e.src,srcWidth:e.srcWidth,srcHeight:e.srcHeight,onReset:r,imgAspectRatio:u.aspectRatio,children:c}),(e.state=="loading"||e.state=="error")&&b.jsx(L3,{src:e.src,state:e,onReset:r,onCancel:i,onRetry:o,imgAspectRatio:u.aspectRatio,children:c}),e.state=="empty"&&b.jsxs("div",{h:"100%",bgColor:p?"slate-500":void 0,w:"full",dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",id:"kqhdfbq",position:"relative",textColor:"white",...s,...h(),children:[b.jsx("input",{...f()}),b.jsxs("div",{dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",spaceY:"3",children:[b.jsx(N.Icon,{size:"x5",path:S_}),b.jsxs("p",{textTransform:"capitalize",children:["Drag and drop your ",t," here"]}),b.jsx("p",{opacity:"80",children:"— or select from —"}),b.jsx(N.Button,{variant:"light",size:"sm",px:"5",rounded:"full",fontWeight:"500",onClick:m,children:"Local file"}),a&&b.jsx(N.Button,{variant:"light",size:"sm",px:"5",rounded:"full",fontWeight:"500",onClick:y,children:"Media Library"})]}),c&&b.jsx(fg,{children:c})]})]})});const N3={defaultProps:{mt:Y(32,16),mb:Y(32,16),sm_mt:Y(24,14),sm_mb:Y(24,14),lg_mt:Y(32,18),lg_mb:Y(32,18),xl_mt:Y(40,20),xl_mb:Y(40,20),x2_mt:Y(48,24),x2_mb:Y(48,24)}};N.ComponentManager.registerComponent("Editor.Image",N3);function j3({...t}){var p,g;const e=t.editor,r=t.node.attrs,i=t.deleteNode,o=t.getPos,s=r.ychange,[a,l]=O.useState(!1),c=Fv(e,o);O.useCallback(m=>{c({...r,...m})},[Fv]);const u=N.useComponentConfig("Editor.Youtube",void 0,{},{}),d=O.useCallback(()=>{i()},[i]);let h=r.aspectRatio;h&&(h=="default"&&(h=void 0),h=="custom"&&(h=r.customAspectRatio));const f={};return s&&(s.type=="added"||s.type=="removed")&&(f.border="1",f.rounded="lg",f.borderColor=s.type=="added"?(p=s.color)==null?void 0:p.light:(g=s.color)==null?void 0:g.dark),b.jsx(Ai,{as:"div","data-drag-handle":!0,...f,...u,children:b.jsxs("div",{bgColor:"slate-700",outline:t.selected?"1":!1,outlineColor:"sky-500",position:"relative",rounded:"lg",overflow:"hidden",border:r.showBorder?"0.5":void 0,borderColor:r.showBorder?r.borderColor:void 0,aspectRatio:"16/9",children:[r.src&&b.jsx("iframe",{src:r.src,aspectRatio:"16/9",w:"full",allow:"*"}),(!r.src||a)&&b.jsx(F3,{src:r.src}),b.jsx("div",{position:"absolute",bgColor:"black",bgOpacity:"30",top:"0",bottom:"0",start:"0",end:"0"}),e.view.editable&&!a&&b.jsxs("div",{position:"absolute",dflex:!0,gap:"3",top:"3",end:"3",children:[b.jsx(Zl,{title:"Settings",onClick:()=>l(!0),children:b.jsx(N.Icon,{path:a_})}),b.jsx(Zl,{title:"Delete Youtube Block",onClick:m=>{m.preventDefault(),m.stopPropagation(),d()},children:b.jsx(N.Icon,{path:db})})]})]},r.src)})}function F3({src:t}){const e=O.useCallback(n=>{},[]);return b.jsx("div",{position:"absolute",top:"0",start:"0",end:"0",bottom:"0",p:"3",bgColor:"slate-100",children:b.jsxs(Cc,{position:"relative",w:"full",h:"full",children:[b.jsx(Sp,{initialValues:{src:t??""},onSubmit:e,children:b.jsx(mi,{form:Fy.array(Fy.url("src","Youtube URL",!1,"https://www.youtube.com/watch?v=dQw4w9WgXcQ"))})}),b.jsx(Zl,{type:"submit",title:"Save",position:"absolute",variant:"default",top:"3",end:"3",children:b.jsx(N.Icon,{path:Zh})})]})})}const vC={defaultProps:{mt:Y(8,16),mb:Y(8,16),sm_mt:Y(4,14),sm_mb:Y(4,14),lg_mt:Y(12,18),lg_mb:Y(12,18),xl_mt:Y(12,20),xl_mb:Y(12,20),x2_mt:Y(12,24),x2_mb:Y(12,24)}};N.ComponentManager.registerComponent("Editor.ListItem",vC);function H3({...t}){const e=N.useComponentConfig("Editor.ListItem",void 0,{},{});return b.jsx(Ai,{as:"li",...e,...Vc(t,"List item"),children:b.jsx(zs,{})})}const bC={defaultProps:{listStyle:"decimal",mt:Y(20,16),mb:Y(20,16),ps:Y(26,16),css:{"& li":{paddingLeft:Y(6,16)},"& li:marker":{color:"var(--tw-prose-bullets)"},"& li p":{marginTop:Y(12,16),marginBottom:Y(12,16)},"& li > *:first-of-type":{marginTop:Y(20,16)},"& li > *:last-of-type":{marginBottom:Y(20,16)},"& ul, & ol":{marginTop:Y(12,16),marginBottom:Y(12,16)}},sm_mt:Y(16,14),sm_mb:Y(16,14),sm_ps:Y(22,14),lg_mt:Y(24,18),lg_mb:Y(24,18),lg_ps:Y(28,18),xl_mt:Y(24,20),xl_mb:Y(24,20),xl_ps:Y(32,20),x2_mt:Y(32,24),x2_mb:Y(32,24),x2_ps:Y(38,24)}},$3=t=>{const e=t.as||"div",{nodeViewContentRef:n}=Yx();return b.jsx(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})};N.ComponentManager.registerComponent("Editor.OrderedList",bC);function B3(){const t=N.useComponentConfig("Editor.OrderedList",void 0,{},{});return b.jsx(Ai,{as:"ol",...t,children:b.jsx($3,{})})}const wC={defaultProps:{mt:Y(20,16),mb:Y(20,16),sm_mt:Y(16,14),sm_mb:Y(16,14),lg_mt:Y(24,18),lg_mb:Y(24,18),xl_mt:Y(24,20),xl_mb:Y(24,20),x2_mt:Y(32,24),x2_mb:Y(32,24),textSize:"md",textColor:"#242424",css:{"& a":{color:"#0ea5e9",textDecoration:"underline",wordBreak:"break-all"},insert:{color:"#33FF33"},"& delete":{color:"#FF3333",textDecoration:"strike-through"}}}};N.ComponentManager.registerComponent("Editor.Paragraph",wC);function V3({...t}){const e=N.useComponentConfig("Editor.Paragraph",void 0,{},{});return b.jsx(Ai,{as:"p",...e,...Vc(t),children:b.jsx(zs,{as:"span"})})}const z3=["bulletList","orderedList","taskList","image"],U3=ht.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new lt({key:new yt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const o=t.type.createAndFill(),s=(o==null?void 0:o.sameMarkup(t))&&o.content.findDiffStart(t.content)===null;return t.descendants((a,l)=>{const c=z3.includes(a.type.name),u=r>=l&&r<=l+a.nodeSize,d=!c&&SC(a);//!node.isLeaf && !node.childCount;
209
+ if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);const f=qt.node(l,l+a.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(f)}return c||this.options.includeChildren}),ut.create(t,i)}}})]}});function SC(t){if(t.text)return!1;const e=t.content;let n=!0;return Qb(e.content)&&e.content.forEach(i=>n=n&&SC(i)),n}const q3=It.create({name:"capitalize",addOptions(){return{HTMLAttributes:{style:"text-transform: capitalize"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCapitalize:()=>({commands:t})=>t.setMark(this.name),toggleCapitalize:()=>({commands:t})=>t.toggleMark(this.name),unsetCapitalize:()=>({commands:t})=>t.unsetMark(this.name)}}}),W3=It.create({name:"lowercase",addOptions(){return{HTMLAttributes:{style:"text-transform: lowercase"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setLowercase:()=>({commands:t})=>t.setMark(this.name),toggleLowercase:()=>({commands:t})=>t.toggleMark(this.name),unsetLowercase:()=>({commands:t})=>t.unsetMark(this.name)}}}),K3=It.create({name:"uppercase",addOptions(){return{HTMLAttributes:{style:"text-transform: uppercase"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",nt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUppercase:()=>({commands:t})=>t.setMark(this.name),toggleUppercase:()=>({commands:t})=>t.toggleMark(this.name),unsetUppercase:()=>({commands:t})=>t.unsetMark(this.name)}}}),G3=It.create({name:"ychange",inclusive:!1,addAttributes(){return{user:{default:null},type:{default:null},color:{default:null}}},parseHTML(){return[{tag:"ychange"}]},renderHTML({mark:t}){return["ychange",{ychange_user:t.attrs.user,ychange_type:t.attrs.type,style:J3(t.attrs),ychange_color:t.attrs.color.light}]}}),J3=t=>{switch(t.type){case"removed":return`color:${t.color.dark}; text-decoration: line-through`;case"added":return"background-color:#bef264";case null:return""}},X3=(t,e)=>[gF.configure({heading:!1,paragraph:!1,blockquote:!1,bulletList:!1,orderedList:!1,listItem:!1,codeBlock:{HTMLAttributes:{class:"rounded-sm bg-stone-100 p-5 font-mono font-medium text-stone-800"}},code:{HTMLAttributes:{class:"rounded-md bg-stone-200 px-1.5 py-1 font-mono font-medium text-stone-900",spellcheck:"false"}},horizontalRule:!1,dropcursor:{color:"#DBEAFE",width:4},gapcursor:!1,hardBreak:{keepMarks:!0},history:!1}),kx.extend({addNodeView(){return Jr(kF)},draggable:!0}),Vx.extend({addAttributes(){return{ychange:{default:null}}},addNodeView(){return Jr(V3)},draggable:!0}),Ox.extend({addNodeView(){return Jr(OF)}}),$x.extend({addNodeView(){return Jr(H3)}}),Tx.extend({addNodeView(){return Jr(TF)}}),Bx.extend({addNodeView(){return Jr(B3)}}),bj.configure({openOnClick:!1,autolink:!0,linkOnPaste:!0}),U3.configure({placeholder:({node:n})=>{switch(n.type.name){case"heading":return`Heading ${n.attrs.level}`;case"quote":return"Quote";case"listItem":return"List item";case"taskItem":return"Task item"}return(e==null?void 0:e.placeHolderText)??"Press '/' for commands"},includeChildren:!1,emptyEditorClass:"my-class"}),RF(t),Jx,_j,WN,K3,W3,q3,KN,XN.configure({multicolor:!0}),Ej.extend({addNodeView(){return Jr(j3)},draggable:!0}),G3],Nn=typeof navigator<"u"?navigator:null,Q0=typeof document<"u"?document:null,Oi=Nn&&Nn.userAgent||"",Oh=/Edge\/(\d+)/.exec(Oi),xC=/MSIE \d/.exec(Oi),Th=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Oi),hg=!!(xC||Th||Oh);xC?document.documentMode:Th?+Th[1]:Oh&&+Oh[1];const Y3=!hg&&/gecko\/(\d+)/i.test(Oi);Y3&&+(/Firefox\/(\d+)/.exec(Oi)||[0,0])[1];const Z0=!hg&&/Chrome\/(\d+)/.exec(Oi);Z0&&+Z0[1];const Q3=!hg&&!!Nn&&/Apple Computer/.test(Nn.vendor),Z3=Q3&&(/Mobile\/\w+/.test(Oi)||!!Nn&&Nn.maxTouchPoints>2);Z3||Nn&&/Mac/.test(Nn.platform);Nn&&/Win/.test(Nn.platform);const e5=!!Q0&&"webkitFontSmoothing"in Q0.documentElement.style;e5&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];const t5={handleDOMEvents:{keydown:(t,e,...n)=>{if(["ArrowUp","ArrowDown","Enter"].includes(e.key)&&document.querySelector("#slash-command"))return!0}},handlePaste:(t,e)=>{if(e.clipboardData&&e.clipboardData.files&&e.clipboardData.files[0]){e.preventDefault();const n=e.clipboardData.files[0],r=t.state.selection.from,{schema:i}=t.state,o=i.nodes.image.create({file:n}),s=t.state.tr;return s.insert(r,o),t.dispatch(s)}return!1},handleDrop:(t,e,n,r)=>{if(!r&&e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files[0]){e.preventDefault();const i=e.dataTransfer.files[0],o=t.posAtCoords({left:e.clientX,top:e.clientY})??{pos:0,inside:0},{schema:s}=t.state,a=s.nodes.image.create({file:i}),l=t.state.tr;return l.selection.empty||l.deleteSelection(),l.insert(o.pos,a),t.dispatch(l)}return!1}},kn=()=>new Map,kh=t=>{const e=kn();return t.forEach((n,r)=>{e.set(r,n)}),e},Ti=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},n5=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},r5=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},xi=()=>new Set,of=t=>t[t.length-1],i5=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},Ci=Array.from,o5=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},Mh=Array.isArray;class CC{constructor(){this._observers=kn()}on(e,n){return Ti(this._observers,e,xi).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Ci((this._observers.get(e)||kn()).values()).forEach(r=>r(...n))}destroy(){this._observers=kn()}}const Lr=Math.floor,Qa=Math.abs,zc=(t,e)=>t<e?t:e,Co=(t,e)=>t>e?t:e,s5=t=>t!==0?t<0:1/t<0,ev=1,tv=2,sf=4,af=8,a5=32,EC=64,Cs=128,l5=31,nv=63,Gi=127,c5=2147483647,u5=Number.MAX_SAFE_INTEGER,d5=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Lr(t)===t),f5=t=>t.toLowerCase(),h5=/^\s*/g,p5=t=>t.replace(h5,""),g5=/([A-Z])/g,rv=(t,e)=>p5(t.replace(g5,n=>`${e}${f5(n)}`)),m5=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.codePointAt(i);return r},Es=typeof TextEncoder<"u"?new TextEncoder:null,y5=t=>Es.encode(t),v5=Es?y5:m5;let lf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});lf&&lf.decode(new Uint8Array).length===1&&(lf=null);class qs{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const pg=()=>new qs,b5=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},er=t=>{const e=new Uint8Array(b5(t));let n=0;for(let r=0;r<t.bufs.length;r++){const i=t.bufs[r];e.set(i,n),n+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},w5=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(Co(n,e)*2),t.cpos=0)},vt=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},Ph=vt,Ke=(t,e)=>{for(;e>Gi;)vt(t,Cs|Gi&e),e=Lr(e/128);vt(t,Gi&e)},gg=(t,e)=>{const n=s5(e);for(n&&(e=-e),vt(t,(e>nv?Cs:0)|(n?EC:0)|nv&e),e=Lr(e/64);e>0;)vt(t,(e>Gi?Cs:0)|Gi&e),e=Lr(e/128)},Ih=new Uint8Array(3e4),S5=Ih.length/3,x5=(t,e)=>{if(e.length<S5){const n=Es.encodeInto(e,Ih).written||0;Ke(t,n);for(let r=0;r<n;r++)vt(t,Ih[r])}else Yt(t,v5(e))},C5=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;Ke(t,r);for(let i=0;i<r;i++)vt(t,n.codePointAt(i))},Ji=Es&&Es.encodeInto?x5:C5,mg=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=zc(n-r,e.length),o=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,o>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Co(n*2,o)),t.cbuf.set(e.subarray(i)),t.cpos=o)},Yt=(t,e)=>{Ke(t,e.byteLength),mg(t,e)},yg=(t,e)=>{w5(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},E5=(t,e)=>yg(t,4).setFloat32(0,e,!1),_5=(t,e)=>yg(t,8).setFloat64(0,e,!1),R5=(t,e)=>yg(t,8).setBigInt64(0,e,!1),iv=new DataView(new ArrayBuffer(4)),A5=t=>(iv.setFloat32(0,t),iv.getFloat32(0)===t),_s=(t,e)=>{switch(typeof e){case"string":vt(t,119),Ji(t,e);break;case"number":d5(e)&&Qa(e)<=c5?(vt(t,125),gg(t,e)):A5(e)?(vt(t,124),E5(t,e)):(vt(t,123),_5(t,e));break;case"bigint":vt(t,122),R5(t,e);break;case"object":if(e===null)vt(t,126);else if(Mh(e)){vt(t,117),Ke(t,e.length);for(let n=0;n<e.length;n++)_s(t,e[n])}else if(e instanceof Uint8Array)vt(t,116),Yt(t,e);else{vt(t,118);const n=Object.keys(e);Ke(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];Ji(t,i),_s(t,e[i])}}break;case"boolean":vt(t,e?120:121);break;default:vt(t,127)}};class ov extends qs{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Ke(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const sv=t=>{t.count>0&&(gg(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Ke(t.encoder,t.count-2))};class Za{constructor(){this.encoder=new qs,this.s=0,this.count=0}write(e){this.s===e?this.count++:(sv(this),this.count=1,this.s=e)}toUint8Array(){return sv(this),er(this.encoder)}}const av=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);gg(t.encoder,e),t.count>1&&Ke(t.encoder,t.count-2)}};class cf{constructor(){this.encoder=new qs,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(av(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return av(this),er(this.encoder)}}class O5{constructor(){this.sarr=[],this.s="",this.lensE=new Za}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new qs;return this.sarr.push(this.s),this.s="",Ji(e,this.sarr.join("")),mg(e,this.lensE.toUint8Array()),er(e)}}const Dr=t=>new Error(t),mn=()=>{throw Dr("Method unimplemented")},or=()=>{throw Dr("Unexpected case")},T5=Dr("Unexpected end of array"),k5=Dr("Integer out of Range");class M5{constructor(e){this.arr=e,this.pos=0}}const ec=t=>new M5(t),Mn=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const i=t.arr[t.pos++];if(e=e+(i&Gi)*n,n*=128,i<Cs)return e;if(e>u5)throw k5}throw T5},P5=crypto.getRandomValues.bind(crypto),I5=Math.random,_C=()=>P5(new Uint32Array(1))[0],L5=t=>t[Lr(I5()*t.length)],D5="10000000-1000-4000-8000"+-1e11,N5=()=>D5.replace(/[018]/g,t=>(t^_C()&15>>t/4).toString(16)),j5=Date.now,lv=t=>new Promise(t);Promise.all.bind(Promise);const cv=t=>t===void 0?null:t;class F5{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let RC=new F5,H5=!0;try{typeof localStorage<"u"&&localStorage&&(RC=localStorage,H5=!1)}catch{}const $5=RC,B5=Object.assign,AC=Object.keys,V5=(t,e)=>{for(const n in t)e(t[n],n)},uv=t=>AC(t).length,z5=t=>{for(const e in t)return!1;return!0},U5=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},q5=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),W5=(t,e)=>t===e||uv(t)===uv(e)&&U5(t,(n,r)=>(n!==void 0||q5(e,r))&&e[r]===n),vg=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&vg(t,e,n+1)}},K5=(t,e)=>e.includes(t),lo=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",G5=typeof window<"u"&&typeof document<"u"&&!lo;let Cn;const J5=()=>{if(Cn===void 0)if(lo){Cn=kn();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&Cn.set(e,""),e=r):e!==null&&(Cn.set(e,r),e=null)}e!==null&&Cn.set(e,"")}else typeof location=="object"?(Cn=kn(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");Cn.set(`--${rv(e,"-")}`,n),Cn.set(`-${rv(e,"-")}`,n)}})):Cn=kn();return Cn},Lh=t=>J5().has(t),Dh=t=>cv(lo?process.env[t.toUpperCase().replaceAll("-","_")]:$5.getItem(t)),X5=t=>Lh("--"+t)||Dh(t)!==null;X5("production");const dv=lo&&K5(process.env.FORCE_COLOR,["true","1","2"]),Y5=!Lh("no-colors")&&(!lo||process.stdout.isTTY||dv)&&(!lo||Lh("color")||dv||Dh("COLORTERM")!==null||(Dh("TERM")||"").includes("color"));class Q5{constructor(e,n){this.left=e,this.right=n}}const Kn=(t,e)=>new Q5(t,e),Z5=typeof document<"u"?document:{};typeof DOMParser<"u"&&new DOMParser;const eH=t=>n5(t,(e,n)=>`${n}:${e};`).join(""),tH=t=>class{constructor(n){this._=n}destroy(){t(this._)}},nH=tH(clearTimeout),Nh=(t,e)=>new nH(setTimeout(e,t)),lr=Symbol,OC=lr(),TC=lr(),rH=lr(),iH=lr(),oH=lr(),kC=lr(),sH=lr(),bg=lr(),aH=lr(),lH=t=>{var r;t.length===1&&((r=t[0])==null?void 0:r.constructor)===Function&&(t=t[0]());const e=[];let n=0;for(;n<t.length;n++){const i=t[n];i===void 0||i.constructor===String||i.constructor===Number||i.constructor===Object&&e.push(JSON.stringify(i))}return e},cH={[OC]:Kn("font-weight","bold"),[TC]:Kn("font-weight","normal"),[rH]:Kn("color","blue"),[oH]:Kn("color","green"),[iH]:Kn("color","grey"),[kC]:Kn("color","red"),[sH]:Kn("color","purple"),[bg]:Kn("color","orange"),[aH]:Kn("color","black")},uH=t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],n=[],r=kn();let i=[],o=0;for(;o<t.length;o++){const a=t[o],l=cH[a];if(l!==void 0)r.set(l.left,l.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const c=eH(r);o>0||c.length>0?(e.push("%c"+a),n.push(c)):e.push(a)}else break}}for(o>0&&(i=n,i.unshift(e.join("")));o<t.length;o++){const a=t[o];a instanceof Symbol||i.push(a)}return i},MC=Y5?uH:lH,dH=(...t)=>{console.log(...MC(t)),PC.forEach(e=>e.print(t))},fH=(...t)=>{console.warn(...MC(t)),t.unshift(bg),PC.forEach(e=>e.print(t))},PC=xi(),IC=t=>({[Symbol.iterator](){return this},next:t}),hH=(t,e)=>IC(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),uf=(t,e)=>IC(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class wg{constructor(e,n){this.clock=e,this.len=n}}class Ws{constructor(){this.clients=new Map}}const Nr=(t,e,n)=>e.clients.forEach((r,i)=>{const o=t.doc.store.clients.get(i);for(let s=0;s<r.length;s++){const a=r[s];HC(t,o,a.clock,a.len,n)}}),pH=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const i=Lr((n+r)/2),o=t[i],s=o.clock;if(s<=e){if(e<s+o.len)return i;n=i+1}else r=i-1}return null},ki=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&pH(n,e.clock)!==null},Sg=t=>{t.clients.forEach(e=>{e.sort((i,o)=>i.clock-o.clock);let n,r;for(n=1,r=1;n<e.length;n++){const i=e[r-1],o=e[n];i.clock+i.len>=o.clock?i.len=Co(i.len,o.clock+o.len-i.clock):(r<n&&(e[r]=o),r++)}e.length=r})},tc=t=>{const e=new Ws;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,i)=>{if(!e.clients.has(i)){const o=r.slice();for(let s=n+1;s<t.length;s++)i5(o,t[s].clients.get(i)||[]);e.clients.set(i,o)}});return Sg(e),e},xg=(t,e,n,r)=>{Ti(t.clients,e,()=>[]).push(new wg(n,r))},Uc=()=>new Ws,gH=t=>{const e=Uc();return t.clients.forEach((n,r)=>{const i=[];for(let o=0;o<n.length;o++){const s=n[o];if(s.deleted){const a=s.id.clock;let l=s.length;if(o+1<n.length)for(let c=n[o+1];o+1<n.length&&c.deleted;c=n[++o+1])l+=c.length;i.push(new wg(a,l))}}i.length>0&&e.clients.set(r,i)}),e},nc=(t,e)=>{Ke(t.restEncoder,e.clients.size),Ci(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),Ke(t.restEncoder,n);const i=r.length;Ke(t.restEncoder,i);for(let o=0;o<i;o++){const s=r[o];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},jh=t=>{const e=new Ws,n=Mn(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const i=Mn(t.restDecoder),o=Mn(t.restDecoder);if(o>0){const s=Ti(e.clients,i,()=>[]);for(let a=0;a<o;a++)s.push(new wg(t.readDsClock(),t.readDsLen()))}}return e},LC=_C;class Eo extends CC{constructor({guid:e=N5(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:o=null,autoLoad:s=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=LC(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new LH,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=s,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=lv(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>lv(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Ze(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Ci(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Ze(this,e,n)}get(e,n=Ot){const r=Ti(this.share,e,()=>{const o=new n;return o._integrate(this,null),o}),i=r.constructor;if(n!==Ot&&i!==n)if(i===Ot){const o=new n;o._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=o}),o._start=r._start;for(let s=o._start;s!==null;s=s.right)s.parent=o;return o._length=r._length,this.share.set(e,o),o._integrate(this,null),o}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,hi)}getText(e=""){return this.get(e,co)}getMap(e=""){return this.get(e,ks)}getXmlElement(e=""){return this.get(e,Wt)}getXmlFragment(e=""){return this.get(e,uo)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){Ci(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new Eo({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Ze(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Fh{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Mn(this.restDecoder)}readDsLen(){return Mn(this.restDecoder)}}class mH{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Mn(this.restDecoder),this.dsCurrVal}readDsLen(){const e=Mn(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class rc{constructor(){this.restEncoder=pg()}toUint8Array(){return er(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Ke(this.restEncoder,e)}writeDsLen(e){Ke(this.restEncoder,e)}}class yH extends rc{writeLeftID(e){Ke(this.restEncoder,e.client),Ke(this.restEncoder,e.clock)}writeRightID(e){Ke(this.restEncoder,e.client),Ke(this.restEncoder,e.clock)}writeClient(e){Ke(this.restEncoder,e)}writeInfo(e){Ph(this.restEncoder,e)}writeString(e){Ji(this.restEncoder,e)}writeParentInfo(e){Ke(this.restEncoder,e?1:0)}writeTypeRef(e){Ke(this.restEncoder,e)}writeLen(e){Ke(this.restEncoder,e)}writeAny(e){_s(this.restEncoder,e)}writeBuf(e){Yt(this.restEncoder,e)}writeJSON(e){Ji(this.restEncoder,JSON.stringify(e))}writeKey(e){Ji(this.restEncoder,e)}}class DC{constructor(){this.restEncoder=pg(),this.dsCurrVal=0}toUint8Array(){return er(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,Ke(this.restEncoder,n)}writeDsLen(e){e===0&&or(),Ke(this.restEncoder,e-1),this.dsCurrVal+=e}}class vH extends DC{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new cf,this.clientEncoder=new Za,this.leftClockEncoder=new cf,this.rightClockEncoder=new cf,this.infoEncoder=new ov(Ph),this.stringEncoder=new O5,this.parentInfoEncoder=new ov(Ph),this.typeRefEncoder=new Za,this.lenEncoder=new Za}toUint8Array(){const e=pg();return Ke(e,0),Yt(e,this.keyClockEncoder.toUint8Array()),Yt(e,this.clientEncoder.toUint8Array()),Yt(e,this.leftClockEncoder.toUint8Array()),Yt(e,this.rightClockEncoder.toUint8Array()),Yt(e,er(this.infoEncoder)),Yt(e,this.stringEncoder.toUint8Array()),Yt(e,er(this.parentInfoEncoder)),Yt(e,this.typeRefEncoder.toUint8Array()),Yt(e,this.lenEncoder.toUint8Array()),mg(e,er(this.restEncoder)),er(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){_s(this.restEncoder,e)}writeBuf(e){Yt(this.restEncoder,e)}writeJSON(e){_s(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const bH=(t,e,n,r)=>{r=Co(r,e[0].id.clock);const i=sr(e,r);Ke(t.restEncoder,e.length-i),t.writeClient(n),Ke(t.restEncoder,r);const o=e[i];o.write(t,r-o.id.clock);for(let s=i+1;s<e.length;s++)e[s].write(t,0)},wH=(t,e,n)=>{const r=new Map;n.forEach((i,o)=>{At(e,o)>i&&r.set(o,i)}),Wc(e).forEach((i,o)=>{n.has(o)||r.set(o,0)}),Ke(t.restEncoder,r.size),Ci(r.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{bH(t,e.clients.get(i),i,o)})},SH=(t,e)=>wH(t,e.doc.store,e.beforeState),xH=t=>{const e=new Map,n=Mn(t.restDecoder);for(let r=0;r<n;r++){const i=Mn(t.restDecoder),o=Mn(t.restDecoder);e.set(i,o)}return e},CH=(t,e)=>(Ke(t.restEncoder,e.size),Ci(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{Ke(t.restEncoder,n),Ke(t.restEncoder,r)}),t);class EH{constructor(){this.l=[]}}const fv=()=>new EH,hv=(t,e)=>t.l.push(e),pv=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},NC=(t,e,n)=>vg(t.l,[e,n]);class el{constructor(e,n){this.client=e,this.clock=n}}const La=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ge=(t,e)=>new el(t,e),Rs=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw or()},As=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class _H{constructor(e,n=e.getMap("users")){const r=new Map;this.yusers=n,this.doc=e,this.clients=new Map,this.dss=r;const i=(o,s)=>{const a=o.get("ds"),l=o.get("ids"),c=u=>this.clients.set(u,s);a.observe(u=>{u.changes.added.forEach(d=>{d.content.getContent().forEach(h=>{h instanceof Uint8Array&&this.dss.set(s,tc([this.dss.get(s)||Uc(),jh(new Fh(ec(h)))]))})})}),this.dss.set(s,tc(a.map(u=>jh(new Fh(ec(u)))))),l.observe(u=>u.changes.added.forEach(d=>d.content.getContent().forEach(c))),l.forEach(c)};n.observe(o=>{o.keysChanged.forEach(s=>i(n.get(s),s))}),n.forEach(i)}setUserMapping(e,n,r,{filter:i=()=>!0}={}){const o=this.yusers;let s=o.get(r);s||(s=new ks,s.set("ids",new hi),s.set("ds",new hi),o.set(r,s)),s.get("ids").push([n]),o.observe(a=>{setTimeout(()=>{const l=o.get(r);if(l!==s){s=l,this.clients.forEach((d,h)=>{r===d&&s.get("ids").push([h])});const c=new rc,u=this.dss.get(r);u&&(nc(c,u),s.get("ds").push([c.toUint8Array()]))}},0)}),e.on("afterTransaction",a=>{setTimeout(()=>{const l=s.get("ds"),c=a.deleteSet;if(a.local&&c.clients.size>0&&i(a,c)){const u=new rc;nc(u,c),l.push([u.toUint8Array()])}})})}getUserByClientId(e){return this.clients.get(e)||null}getUserByDeletedId(e){for(const[n,r]of this.dss.entries())if(ki(r,e))return n;return null}}class ic{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}class RH{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const AH=(t,e,n=0)=>new RH(t,e,n),Da=(t,e,n)=>{let r=null,i=null;return t._item===null?i=Rs(t):r=Ge(t._item.id.client,t._item.id.clock),new ic(r,i,e,n)},df=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Da(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return Da(t,Ge(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Da(t,r.lastId,n);r=r.right}return Da(t,null,n)},OH=(t,e,n=!0)=>{const r=e.store,i=t.item,o=t.type,s=t.tname,a=t.assoc;let l=null,c=0;if(i!==null){if(At(r,i.client)<=i.clock)return null;const u=n?Vh(r,i):{item:Xi(r,i),diff:0},d=u.item;if(!(d instanceof et))return null;if(l=d.parent,l._item===null||!l._item.deleted){c=d.deleted||!d.countable?0:u.diff+(a>=0?0:1);let h=d.left;for(;h!==null;)!h.deleted&&h.countable&&(c+=h.length),h=h.left}}else{if(s!==null)l=e.get(s);else if(o!==null){if(At(r,o.client)<=o.clock)return null;const{item:u}=n?Vh(r,o):{item:Xi(r,o)};if(u instanceof et&&u.content instanceof $n)l=u.content.type;else return null}else throw or();a>=0?c=l._length:c=0}return AH(l,c,t.assoc)};class qc{constructor(e,n){this.ds=e,this.sv=n}}const TH=(t,e)=>{const n=t.ds.clients,r=e.ds.clients,i=t.sv,o=e.sv;if(i.size!==o.size||n.size!==r.size)return!1;for(const[s,a]of i.entries())if(o.get(s)!==a)return!1;for(const[s,a]of n.entries()){const l=r.get(s)||[];if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++){const u=a[c],d=l[c];if(u.clock!==d.clock||u.len!==d.len)return!1}}return!0},kH=(t,e=new DC)=>(nc(e,t.ds),CH(e,t.sv),e.toUint8Array()),MH=t=>kH(t,new rc),PH=(t,e=new mH(ec(t)))=>new qc(jh(e),xH(e)),ff=t=>PH(t,new Fh(ec(t))),Cg=(t,e)=>new qc(t,e),IH=Cg(Uc(),new Map),jC=t=>Cg(gH(t.store),Wc(t.store)),ni=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!ki(e.ds,t.id),Hh=(t,e)=>{const n=Ti(t.meta,Hh,xi),r=t.doc.store;n.has(e)||(e.sv.forEach((i,o)=>{i<At(r,o)&&zt(t,Ge(o,i))}),Nr(t,e.ds,i=>{}),n.add(e))};class LH{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Wc=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},At=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},FC=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw or()}n.push(e)},sr=(t,e)=>{let n=0,r=t.length-1,i=t[r],o=i.id.clock;if(o===e)return r;let s=Lr(e/(o+i.length-1)*r);for(;n<=r;){if(i=t[s],o=i.id.clock,o<=e){if(e<o+i.length)return s;n=s+1}else r=s-1;s=Lr((n+r)/2)}throw or()},DH=(t,e)=>{const n=t.clients.get(e.client);return n[sr(n,e.clock)]},Xi=DH,$h=(t,e,n)=>{const r=sr(e,n),i=e[r];return i.id.clock<n&&i instanceof et?(e.splice(r+1,0,oE(t,i,n-i.id.clock)),r+1):r},zt=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[$h(t,n,e.clock)]},gv=(t,e,n)=>{const r=e.clients.get(n.client),i=sr(r,n.clock),o=r[i];return n.clock!==o.id.clock+o.length-1&&o.constructor!==br&&r.splice(i+1,0,oE(t,o,n.clock-o.id.clock+1)),o},NH=(t,e,n)=>{const r=t.clients.get(e.id.client);r[sr(r,e.id.clock)]=n},HC=(t,e,n,r,i)=>{if(r===0)return;const o=n+r;let s=$h(t,e,n),a;do a=e[s++],o<a.id.clock+a.length&&$h(t,e,o),i(a);while(s<e.length&&e[s].id.clock<o)};class jH{constructor(e,n,r){this.doc=e,this.deleteSet=new Ws,this.beforeState=Wc(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const mv=(t,e)=>e.deleteSet.clients.size===0&&!r5(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Sg(e.deleteSet),SH(t,e),nc(t,e.deleteSet),!0),yv=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&Ti(t.changed,e,xi).add(n)},tl=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof et&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const o=e-i;return o&&t.splice(e+1-o,o),o},FH=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const o=e.clients.get(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=a.clock+a.len;for(let c=sr(o,a.clock),u=o[c];c<o.length&&u.id.clock<l;u=o[++c]){const d=o[c];if(a.clock+a.len<=d.id.clock)break;d instanceof et&&d.deleted&&!d.keep&&n(d)&&d.gc(e,!1)}}}},HH=(t,e)=>{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let o=n.length-1;o>=0;o--){const s=n[o],a=zc(i.length-1,1+sr(i,s.clock+s.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=s.clock;c=i[l])l-=1+tl(i,l)}})},$C=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,i=r.store,o=n.deleteSet,s=n._mergeStructs;try{Sg(o),n.afterState=Wc(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const a=[];n.changed.forEach((l,c)=>a.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(u=>u.target._item===null||!u.target._item.deleted),l.forEach(u=>{u.currentTarget=c,u._path=null}),l.sort((u,d)=>u.path.length-d.path.length),NC(c._dEH,l,n))})}),a.push(()=>r.emit("afterTransaction",[n,r])),vg(a,[]),n._needFormattingCleanup&&QH(n)}finally{r.gc&&FH(o,i,r.gcFilter),HH(o,i),n.afterState.forEach((u,d)=>{const h=n.beforeState.get(d)||0;if(h!==u){const f=i.clients.get(d),p=Co(sr(f,h),1);for(let g=f.length-1;g>=p;)g-=1+tl(f,g)}});for(let u=s.length-1;u>=0;u--){const{client:d,clock:h}=s[u].id,f=i.clients.get(d),p=sr(f,h);p+1<f.length&&tl(f,p+1)>1||p>0&&tl(f,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(dH(bg,OC,"[yjs] ",TC,kC,"Changed the client-id because another client seems to be using it."),r.clientID=LC()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const u=new yH;mv(u,n)&&r.emit("update",[u.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const u=new vH;mv(u,n)&&r.emit("updateV2",[u.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(u=>u.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):$C(t,e+1)}}},Ze=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let o=!1,s=null;t._transaction===null&&(o=!0,t._transaction=new jH(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(o){const a=t._transaction===i[0];t._transaction=null,a&&$C(i,0)}}return s};class $H{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const vv=(t,e,n)=>{Nr(t,n.deletions,r=>{r instanceof et&&e.scope.some(i=>As(i,r))&&Ag(r,!1)})},bv=(t,e,n)=>{let r=null;const i=t.doc,o=t.scope;if(Ze(i,s=>{for(;e.length>0&&t.currStackItem===null;){const a=i.store,l=e.pop(),c=new Set,u=[];let d=!1;Nr(s,l.insertions,h=>{if(h instanceof et){if(h.redone!==null){let{item:f,diff:p}=Vh(a,h.id);p>0&&(f=zt(s,Ge(f.id.client,f.id.clock+p))),h=f}!h.deleted&&o.some(f=>As(f,h))&&u.push(h)}}),Nr(s,l.deletions,h=>{h instanceof et&&o.some(f=>As(f,h))&&!ki(l.insertions,h.id)&&c.add(h)}),c.forEach(h=>{d=sE(s,h,c,l.insertions,t.ignoreRemoteMapChanges,t)!==null||d});for(let h=u.length-1;h>=0;h--){const f=u[h];t.deleteFilter(f)&&(f.delete(s),d=!0)}t.currStackItem=d?l:null}s.changed.forEach((a,l)=>{a.has(null)&&l._searchMarker&&(l._searchMarker.length=0)}),r=s},t),t.currStackItem!=null){const s=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:t.currStackItem,type:n,changedParentTypes:s,origin:t},t]),t.currStackItem=null}return t.currStackItem};class BC extends CC{constructor(e,{captureTimeout:n=500,captureTransaction:r=l=>!0,deleteFilter:i=()=>!0,trackedOrigins:o=new Set([null]),ignoreRemoteMapChanges:s=!1,doc:a=Mh(e)?e[0].doc:e.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(e),this.deleteFilter=i,o.add(this),this.trackedOrigins=o,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=s,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(m=>l.changedParentTypes.has(m))||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const c=this.undoing,u=this.redoing,d=c?this.redoStack:this.undoStack;c?this.stopCapturing():u||this.clear(!1,!0);const h=new Ws;l.afterState.forEach((m,y)=>{const x=l.beforeState.get(y)||0,w=m-x;w>0&&xg(h,y,x,w)});const f=j5();let p=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&d.length>0&&!c&&!u){const m=d[d.length-1];m.deletions=tc([m.deletions,l.deleteSet]),m.insertions=tc([m.insertions,h])}else d.push(new $H(l.deleteSet,h)),p=!0;!c&&!u&&(this.lastChange=f),Nr(l,l.deleteSet,m=>{m instanceof et&&this.scope.some(y=>As(y,m))&&Ag(m,!0)});const g=[{stackItem:d[d.length-1],origin:l.origin,type:c?"redo":"undo",changedParentTypes:l.changedParentTypes},this];p?this.emit("stack-item-added",g):this.emit("stack-item-updated",g)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){e=Mh(e)?e:[e],e.forEach(n=>{this.scope.every(r=>r!==n)&&(n.doc!==this.doc&&fH("[yjs#509] Not same Y.Doc"),this.scope.push(n))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(i=>vv(r,this,i)),this.undoStack=[]),n&&(this.redoStack.forEach(i=>vv(r,this,i)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=bv(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=bv(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}const wv="You must not compute changes after the event-handler fired.";class Kc{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=BH(this.currentTarget,this.target))}deletes(e){return ki(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Dr(wv);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const o=n._map.get(i);let s,a;if(this.adds(o)){let l=o.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(o))if(l!==null&&this.deletes(l))s="delete",a=of(l.content.getContent());else return;else l!==null&&this.deletes(l)?(s="update",a=of(l.content.getContent())):(s="add",a=void 0)}else if(this.deletes(o))s="delete",a=of(o.content.getContent());else return;e.set(i,{action:s,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Dr(wv);const n=this.target,r=xi(),i=xi(),o=[];if(e={added:r,deleted:i,delta:o,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&o.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const BH=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)i.deleted||r++,i=i.right;n.unshift(r)}e=e._item.parent}return n},VC=80;let Eg=0;class VH{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=Eg++}}const zH=t=>{t.timestamp=Eg++},zC=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Eg++},UH=(t,e,n)=>{if(t.length>=VC){const r=t.reduce((i,o)=>i.timestamp<o.timestamp?i:o);return zC(r,e,n),r}else{const r=new VH(e,n);return t.push(r),r}},Gc=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((o,s)=>Qa(e-o.index)<Qa(e-s.index)?o:s);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,zH(n));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Qa(n.index-i)<r.parent.length/VC?(zC(n,r,i),n):UH(t._searchMarker,r,i)},Os=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let o=i.p;for(o.marker=!1;o&&(o.deleted||!o.countable);)o=o.left,o&&!o.deleted&&o.countable&&(i.index-=o.length);if(o===null||o.marker===!0){t.splice(r,1);continue}i.p=o,o.marker=!0}(e<i.index||n>0&&e===i.index)&&(i.index=Co(e,i.index+n))}},Jc=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;Ti(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;NC(r._eH,n,e)};class Ot{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=fv(),this._dEH=fv(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw mn()}clone(){throw mn()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){hv(this._eH,e)}observeDeep(e){hv(this._dEH,e)}unobserve(e){pv(this._eH,e)}unobserveDeep(e){pv(this._dEH,e)}toJSON(){}}const UC=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let o=t._start;for(;o!==null&&r>0;){if(o.countable&&!o.deleted){const s=o.content.getContent();if(s.length<=e)e-=s.length;else{for(let a=e;a<s.length&&r>0;a++)i.push(s[a]),r--;e=0}}o=o.right}return i},qC=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}n=n.right}return e},WC=(t,e)=>{const n=[];let r=t._start;for(;r!==null;){if(r.countable&&ni(r,e)){const i=r.content.getContent();for(let o=0;o<i.length;o++)n.push(i[o])}r=r.right}return n},Ts=(t,e)=>{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let o=0;o<i.length;o++)e(i[o],n++,t)}r=r.right}},KC=(t,e)=>{const n=[];return Ts(t,(r,i)=>{n.push(e(r,i,t))}),n},qH=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},GC=(t,e)=>{const n=Gc(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},oc=(t,e,n,r)=>{let i=n;const o=t.doc,s=o.clientID,a=o.store,l=n===null?e._start:n.right;let c=[];const u=()=>{c.length>0&&(i=new et(Ge(s,At(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new fo(c)),i.integrate(t,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:i=new et(Ge(s,At(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new Xc(new Uint8Array(d))),i.integrate(t,0);break;case Eo:i=new et(Ge(s,At(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new Yc(d)),i.integrate(t,0);break;default:if(d instanceof Ot)i=new et(Ge(s,At(a,s)),i,i&&i.lastId,l,l&&l.id,e,null,new $n(d)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},JC=()=>Dr("Length exceeded!"),XC=(t,e,n,r)=>{if(n>e._length)throw JC();if(n===0)return e._searchMarker&&Os(e._searchMarker,n,r.length),oc(t,e,null,r);const i=n,o=Gc(e,n);let s=e._start;for(o!==null&&(s=o.p,n-=o.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&zt(t,Ge(s.id.client,s.id.clock+n));break}n-=s.length}return e._searchMarker&&Os(e._searchMarker,i,r.length),oc(t,e,s,r)},WH=(t,e,n)=>{let i=(e._searchMarker||[]).reduce((o,s)=>s.index>o.index?s:o,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return oc(t,e,i,n)},YC=(t,e,n,r)=>{if(r===0)return;const i=n,o=r,s=Gc(e,n);let a=e._start;for(s!==null&&(a=s.p,n-=s.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&zt(t,Ge(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&a!==null;)a.deleted||(r<a.length&&zt(t,Ge(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)throw JC();e._searchMarker&&Os(e._searchMarker,i,-o+r)},sc=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},_g=(t,e,n,r)=>{const i=e._map.get(n)||null,o=t.doc,s=o.clientID;let a;if(r==null)a=new fo([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new fo([r]);break;case Uint8Array:a=new Xc(r);break;case Eo:a=new Yc(r);break;default:if(r instanceof Ot)a=new $n(r);else throw new Error("Unexpected content type")}new et(Ge(s,At(o.store,s)),i,i&&i.lastId,null,null,e,n,a).integrate(t,0)},Rg=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},QC=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},ZC=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},KH=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let o=r;for(;o!==null&&(!e.sv.has(o.id.client)||o.id.clock>=(e.sv.get(o.id.client)||0));)o=o.left;o!==null&&ni(o,e)&&(n[i]=o.content.getContent()[o.length-1])}),n},Na=t=>hH(t.entries(),e=>!e[1].deleted);class GH extends Kc{constructor(e,n){super(e,n),this._transaction=n}}class hi extends Ot{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new hi;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new hi}clone(){const e=new hi;return e.insert(0,this.toArray().map(n=>n instanceof Ot?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),Jc(this,e,new GH(this,e))}insert(e,n){this.doc!==null?Ze(this.doc,r=>{XC(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Ze(this.doc,n=>{WH(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Ze(this.doc,r=>{YC(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return GC(this,e)}toArray(){return qC(this)}slice(e=0,n=this.length){return UC(this,e,n)}toJSON(){return this.map(e=>e instanceof Ot?e.toJSON():e)}map(e){return KC(this,e)}forEach(e){Ts(this,e)}[Symbol.iterator](){return qH(this)}_write(e){e.writeTypeRef(r4)}}class JH extends Kc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class ks extends Ot{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new ks}clone(){const e=new ks;return this.forEach((n,r)=>{e.set(r,n instanceof Ot?n.clone():n)}),e}_callObserver(e,n){Jc(this,e,new JH(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof Ot?i.toJSON():i}}),e}get size(){return[...Na(this._map)].length}keys(){return uf(Na(this._map),e=>e[0])}values(){return uf(Na(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return uf(Na(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Ze(this.doc,n=>{sc(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Ze(this.doc,r=>{_g(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return Rg(this,e)}has(e){return ZC(this,e)}clear(){this.doc!==null?Ze(this.doc,e=>{this.forEach(function(n,r,i){sc(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(i4)}}const Rr=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&W5(t,e);class Bh{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&or(),this.right.content.constructor){case mt:this.right.deleted||_o(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const Sv=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case mt:e.right.deleted||_o(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&zt(t,Ge(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},ja=(t,e,n,r)=>{const i=new Map,o=r?Gc(e,n):null;if(o){const s=new Bh(o.p.left,o.p,o.index,i);return Sv(t,s,n-o.index)}else{const s=new Bh(null,e._start,0,i);return Sv(t,s,n)}},eE=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===mt&&Rr(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,o=i.clientID;r.forEach((s,a)=>{const l=n.left,c=n.right,u=new et(Ge(o,At(i.store,o)),l,l&&l.lastId,c,c&&c.id,e,null,new mt(a,s));u.integrate(t,0),n.right=u,n.forward()})},_o=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},tE=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===mt&&Rr(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},nE=(t,e,n,r)=>{const i=t.doc,o=i.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!Rr(c,l)){s.set(a,c);const{left:u,right:d}=n;n.right=new et(Ge(o,At(i.store,o)),u,u&&u.lastId,d,d&&d.id,e,null,new mt(a,l)),n.right.integrate(t,0),n.forward()}}return s},hf=(t,e,n,r,i)=>{n.currentAttributes.forEach((h,f)=>{i[f]===void 0&&(i[f]=null)});const o=t.doc,s=o.clientID;tE(n,i);const a=nE(t,e,n,i),l=r.constructor===String?new jn(r):r instanceof Ot?new $n(r):new Ro(r);let{left:c,right:u,index:d}=n;e._searchMarker&&Os(e._searchMarker,n.index,l.getLength()),u=new et(Ge(s,At(o.store,s)),c,c&&c.lastId,u,u&&u.id,e,null,l),u.integrate(t,0),n.right=u,n.index=d,n.forward(),eE(t,e,n,a)},xv=(t,e,n,r,i)=>{const o=t.doc,s=o.clientID;tE(n,i);const a=nE(t,e,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===mt));){if(!n.right.deleted)switch(n.right.content.constructor){case mt:{const{key:l,value:c}=n.right.content,u=i[l];if(u!==void 0){if(Rr(u,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(t)}else n.currentAttributes.set(l,c);break}default:r<n.right.length&&zt(t,Ge(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let l="";for(;r>0;r--)l+=`
210
+ `;n.right=new et(Ge(s,At(o.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new jn(l)),n.right.integrate(t,0),n.forward()}eE(t,e,n,a)},rE=(t,e,n,r,i)=>{let o=e;const s=kn();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===mt){const c=o.content;s.set(c.key,c)}o=o.right}let a=0,l=!1;for(;e!==o;){if(n===e&&(l=!0),!e.deleted){const c=e.content;switch(c.constructor){case mt:{const{key:u,value:d}=c,h=r.get(u)??null;(s.get(u)!==c||h===d)&&(e.delete(t),a++,!l&&(i.get(u)??null)===d&&h!==d&&(h===null?i.delete(u):i.set(u,h))),!l&&!e.deleted&&_o(i,c);break}}}e=e.right}return a},XH=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===mt){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},YH=t=>{let e=0;return Ze(t.doc,n=>{let r=t._start,i=t._start,o=kn();const s=kh(o);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case mt:_o(s,i.content);break;default:e+=rE(n,r,i,o,s),o=kh(s),r=i;break}i=i.right}}),e},QH=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const o=t.beforeState.get(r)||0;i!==o&&HC(t,n.store.clients.get(r),o,i,s=>{!s.deleted&&s.content.constructor===mt&&s.constructor!==br&&e.add(s.parent)})}Ze(n,r=>{Nr(t,t.deleteSet,i=>{if(i instanceof br||!i.parent._hasFormatting||e.has(i.parent))return;const o=i.parent;i.content.constructor===mt?e.add(o):XH(r,i)});for(const i of e)YH(i)})},Cv=(t,e,n)=>{const r=n,i=kh(e.currentAttributes),o=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case $n:case Ro:case jn:n<e.right.length&&zt(t,Ge(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}o&&rE(t,o,e.right,i,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&Os(s._searchMarker,e.index,-r+n),e};class ZH extends Kc{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];Ze(e,r=>{const i=new Map,o=new Map;let s=this.target._start,a=null;const l={};let c="",u=0,d=0;const h=()=>{if(a!==null){let f=null;switch(a){case"delete":d>0&&(f={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(f={insert:c},i.size>0&&(f.attributes={},i.forEach((p,g)=>{p!==null&&(f.attributes[g]=p)}))),c="";break;case"retain":u>0&&(f={retain:u},z5(l)||(f.attributes=B5({},l))),u=0;break}f&&n.push(f),a=null}};for(;s!==null;){switch(s.content.constructor){case $n:case Ro:this.adds(s)?this.deletes(s)||(h(),a="insert",c=s.content.getContent()[0],h()):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),d+=1):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=1);break;case jn:this.adds(s)?this.deletes(s)||(a!=="insert"&&(h(),a="insert"),c+=s.content.str):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),d+=s.length):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=s.length);break;case mt:{const{key:f,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const g=i.get(f)??null;Rr(g,p)?p!==null&&s.delete(r):(a==="retain"&&h(),Rr(p,o.get(f)??null)?delete l[f]:l[f]=p)}}else if(this.deletes(s)){o.set(f,p);const g=i.get(f)??null;Rr(g,p)||(a==="retain"&&h(),l[f]=g)}else if(!s.deleted){o.set(f,p);const g=l[f];g!==void 0&&(Rr(g,p)?g!==null&&s.delete(r):(a==="retain"&&h(),p===null?delete l[f]:l[f]=p))}s.deleted||(a==="insert"&&h(),_o(i,s.content));break}}s=s.right}for(h();n.length>0;){const f=n[n.length-1];if(f.retain!==void 0&&f.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class co extends Ot{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new co}clone(){const e=new co;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new ZH(this,e,n);Jc(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===jn&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Ze(this.doc,r=>{const i=new Bh(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const s=e[o];if(s.insert!==void 0){const a=!n&&typeof s.insert=="string"&&o===e.length-1&&i.right===null&&s.insert.slice(-1)===`
211
+ `?s.insert.slice(0,-1):s.insert;(typeof a!="string"||a.length>0)&&hf(r,this,i,a,s.attributes||{})}else s.retain!==void 0?xv(r,this,i,s.retain,s.attributes||{}):s.delete!==void 0&&Cv(r,i,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){const i=[],o=new Map,s=this.doc;let a="",l=this._start;function c(){if(a.length>0){const d={};let h=!1;o.forEach((p,g)=>{h=!0,d[g]=p});const f={insert:a};h&&(f.attributes=d),i.push(f),a=""}}const u=()=>{for(;l!==null;){if(ni(l,e)||n!==void 0&&ni(l,n))switch(l.content.constructor){case jn:{const d=o.get("ychange");e!==void 0&&!ni(l,e)?(d===void 0||d.user!==l.id.client||d.type!=="removed")&&(c(),o.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!ni(l,n)?(d===void 0||d.user!==l.id.client||d.type!=="added")&&(c(),o.set("ychange",r?r("added",l.id):{type:"added"})):d!==void 0&&(c(),o.delete("ychange")),a+=l.content.str;break}case $n:case Ro:{c();const d={insert:l.content.getContent()[0]};if(o.size>0){const h={};d.attributes=h,o.forEach((f,p)=>{h[p]=f})}i.push(d);break}case mt:ni(l,e)&&(c(),_o(o,l.content));break}l=l.right}c()};return e||n?Ze(s,d=>{e&&Hh(d,e),n&&Hh(d,n),u()},"cleanup"):u(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?Ze(i,o=>{const s=ja(o,this,e,!r);r||(r={},s.currentAttributes.forEach((a,l)=>{r[l]=a})),hf(o,this,s,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?Ze(i,o=>{const s=ja(o,this,e,!r);hf(o,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?Ze(r,i=>{Cv(i,ja(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?Ze(i,o=>{const s=ja(o,this,e,!1);s.right!==null&&xv(o,this,s,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?Ze(this.doc,n=>{sc(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Ze(this.doc,r=>{_g(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return Rg(this,e)}getAttributes(){return QC(this)}_write(e){e.writeTypeRef(o4)}}class pf{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Wt||n.constructor===uo)&&n._start!==null)e=n._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class uo extends Ot{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new uo}clone(){const e=new uo;return e.insert(0,this.toArray().map(n=>n instanceof Ot?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new pf(this,e)}querySelector(e){e=e.toUpperCase();const r=new pf(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Ci(new pf(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Jc(this,e,new e4(this,n,e))}toString(){return KC(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),Ts(this,o=>{i.insertBefore(o.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?Ze(this.doc,r=>{XC(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Ze(this.doc,r=>{const i=e&&e instanceof Ot?e._item:e;oc(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(o=>o===e)+1;if(i===0&&e!==null)throw Dr("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?Ze(this.doc,r=>{YC(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return qC(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return GC(this,e)}slice(e=0,n=this.length){return UC(this,e,n)}forEach(e){Ts(this,e)}_write(e){e.writeTypeRef(a4)}}class Wt extends uo{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new Wt(this.nodeName)}clone(){const e=new Wt(this.nodeName),n=this.getAttributes();return V5(n,(r,i)=>{typeof r=="string"&&e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof Ot?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const i=r.length;for(let a=0;a<i;a++){const l=r[a];n.push(l+'="'+e[l]+'"')}const o=this.nodeName.toLocaleLowerCase(),s=n.length>0?" "+n.join(" "):"";return`<${o}${s}>${super.toString()}</${o}>`}removeAttribute(e){this.doc!==null?Ze(this.doc,n=>{sc(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Ze(this.doc,r=>{_g(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return Rg(this,e)}hasAttribute(e){return ZC(this,e)}getAttributes(e){return e?KH(this,e):QC(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),o=this.getAttributes();for(const s in o){const a=o[s];typeof a=="string"&&i.setAttribute(s,a)}return Ts(this,s=>{i.appendChild(s.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(s4),e.writeKey(this.nodeName)}}class e4 extends Kc{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class fn extends co{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new fn}clone(){const e=new fn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const o=[];for(const s in e.attributes[i])o.push({key:s,value:e.attributes[i][s]});o.sort((s,a)=>s.key<a.key?-1:1),n.push({nodeName:i,attrs:o})}n.sort((i,o)=>i.nodeName<o.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const o=n[i];r+=`<${o.nodeName}`;for(let s=0;s<o.attrs.length;s++){const a=o.attrs[s];r+=` ${a.key}="${a.value}"`}r+=">"}r+=e.insert;for(let i=n.length-1;i>=0;i--)r+=`</${n[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(l4)}}class iE{constructor(e,n){this.id=e,this.length=n}get deleted(){throw mn()}mergeWith(e){return!1}write(e,n,r){throw mn()}integrate(e,n){throw mn()}}const t4=0;class br extends iE{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),FC(e.doc.store,this)}write(e,n){e.writeInfo(t4),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Xc{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Xc(this.content)}splice(e){throw mn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}class ac{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new ac(this.len)}splice(e){const n=new ac(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){xg(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const n4=(t,e)=>new Eo({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Yc{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Yc(n4(this.doc.guid,this.opts))}splice(e){throw mn()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class Ro{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Ro(this.embed)}splice(e){throw mn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}class mt{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new mt(this.key,this.value)}splice(e){throw mn()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class fo{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new fo(this.arr)}splice(e){const n=new fo(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const o=this.arr[i];e.writeAny(o)}}getRef(){return 8}}class jn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new jn(this.str)}splice(e){const n=new jn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const r4=0,i4=1,o4=2,s4=3,a4=4,l4=6;class $n{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new $n(this.type._copy())}splice(e){throw mn()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const Vh=(t,e)=>{let n=e,r=0,i;do r>0&&(n=Ge(n.client,n.clock+r)),i=Xi(t,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof et);return{item:i,diff:r}},Ag=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},oE=(t,e,n)=>{const{client:r,clock:i}=e.id,o=new et(Ge(r,i+n),e,Ge(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&o.markDeleted(),e.keep&&(o.keep=!0),e.redone!==null&&(o.redone=Ge(e.redone.client,e.redone.clock+n)),e.right=o,o.right!==null&&(o.right.left=o),t._mergeStructs.push(o),o.parentSub!==null&&o.right===null&&o.parent._map.set(o.parentSub,o),e.length=n,o},Ev=(t,e)=>o5(t,n=>ki(n.deletions,e)),sE=(t,e,n,r,i,o)=>{const s=t.doc,a=s.store,l=s.clientID,c=e.redone;if(c!==null)return zt(t,c);let u=e.parent._item,d=null,h;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||sE(t,u,n,r,i,o)===null))return null;for(;u.redone!==null;)u=zt(t,u.redone)}const f=u===null?e.parent:u.content.type;if(e.parentSub===null){for(d=e.left,h=e;d!==null;){let y=d;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:zt(t,y.redone);if(y!==null&&y.parent._item===u){d=y;break}d=d.left}for(;h!==null;){let y=h;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:zt(t,y.redone);if(y!==null&&y.parent._item===u){h=y;break}h=h.right}}else if(h=null,e.right&&!i){for(d=e;d!==null&&d.right!==null&&(d.right.redone||ki(r,d.right.id)||Ev(o.undoStack,d.right.id)||Ev(o.redoStack,d.right.id));)for(d=d.right;d.redone;)d=zt(t,d.redone);if(d&&d.right!==null)return null}else d=f._map.get(e.parentSub)||null;const p=At(a,l),g=Ge(l,p),m=new et(g,d,d&&d.lastId,h,h&&h.id,f,e.parentSub,e.content.copy());return e.redone=g,Ag(m,!0),m.integrate(t,0),m};class et extends iE{constructor(e,n,r,i,o,s,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=o,this.parent=s,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?tv:0}set marker(e){(this.info&af)>0!==e&&(this.info^=af)}get marker(){return(this.info&af)>0}get keep(){return(this.info&ev)>0}set keep(e){this.keep!==e&&(this.info^=ev)}get countable(){return(this.info&tv)>0}get deleted(){return(this.info&sf)>0}set deleted(e){this.deleted!==e&&(this.info^=sf)}markDeleted(){this.info|=sf}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=At(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=At(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===el&&this.id.client!==this.parent.client&&this.parent.clock>=At(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=gv(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=zt(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===br||this.right&&this.right.constructor===br)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===et&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===et&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===el){const r=Xi(n,this.parent);r.constructor===br?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=gv(e,e.doc.store,Ge(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const o=new Set,s=new Set;for(;i!==null&&i!==this.right;){if(s.add(i),o.add(i),La(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,o.clear();else if(La(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&s.has(Xi(e.doc.store,i.origin)))o.has(Xi(e.doc.store,i.origin))||(r=i,o.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),FC(e.doc.store,this),this.content.integrate(e,this),yv(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new br(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Ge(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&La(e.origin,this.lastId)&&this.right===e&&La(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),xg(e.deleteSet,this.id.client,this.id.clock,this.length),yv(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw or();this.content.gc(e),n?NH(e,this,new br(this.id,this.length)):this.content=new ac(this.length)}write(e,n){const r=n>0?Ge(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,o=this.parentSub,s=this.content.getRef()&l5|(r===null?0:Cs)|(i===null?0:EC)|(o===null?0:a5);if(e.writeInfo(s),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=Rs(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===el?(e.writeParentInfo(!1),e.writeLeftID(a)):or();o!==null&&e.writeString(o)}this.content.write(e,n)}}const aE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},lE="__ $YJS$ __";aE[lE]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");aE[lE]=!0;const c4=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},u4=/[\uD800-\uDBFF]/,d4=/[\uDC00-\uDFFF]/,f4=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&u4.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&d4.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},h4=f4,ct=new yt("y-sync"),rr=new yt("y-undo");new yt("yjs-cursor");const lc=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!ki(e.ds,t.id),p4=[{light:"#ecd44433",dark:"#ecd444"}],g4=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=xi();t.forEach(i=>r.add(i)),e=e.filter(i=>!r.has(i))}t.set(n,L5(e))}return t.get(n)},m4=(t,{colors:e=p4,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{}}={})=>{let o=!1,s;const a=new lt({props:{editable:l=>{const c=ct.getState(l);return c.snapshot==null&&c.prevSnapshot==null}},key:ct,state:{init:(l,c)=>({type:t,doc:t.doc,binding:null,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(l,c)=>{const u=l.getMeta(ct);if(u!==void 0){c=Object.assign({},c);for(const d in u)c[d]=u[d]}return c.addToHistory=l.getMeta("addToHistory")!==!1,c.isChangeOrigin=u!==void 0&&!!u.isChangeOrigin,c.isUndoRedoOperation=u!==void 0&&!!u.isChangeOrigin&&!!u.isUndoRedoOperation,c.binding!==null&&u!==void 0&&(u.snapshot!=null||u.prevSnapshot!=null)&&Nh(0,()=>{c.binding==null||c.binding.isDestroyed||(u.restore==null?c.binding._renderSnapshot(u.snapshot,u.prevSnapshot,c):(c.binding._renderSnapshot(u.snapshot,u.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,c.binding.mux(()=>{c.binding._prosemirrorChanged(c.binding.prosemirrorView.state.doc)})))}),c}},view:l=>{const c=new v4(t,l);return s!=null&&s.destroy(),s=Nh(0,()=>{c._forceRerender(),l.dispatch(l.state.tr.setMeta(ct,{binding:c})),i()}),{update:()=>{const u=a.getState(l.state);if(u.snapshot==null&&u.prevSnapshot==null&&(o||l.state.doc.content.findDiffStart(l.state.doc.type.createAndFill().content)!==null)){if(o=!0,u.addToHistory===!1&&!u.isChangeOrigin){const d=rr.getState(l.state),h=d&&d.undoManager;h&&h.stopCapturing()}c.mux(()=>{u.doc.transact(d=>{d.meta.set("addToHistory",u.addToHistory),c._prosemirrorChanged(l.state.doc)},ct)})}},destroy:()=>{s.destroy(),c.destroy()}}}});return a},y4=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null){const r=Ov(n.doc,n.type,e.anchor,n.mapping),i=Ov(n.doc,n.type,e.head,n.mapping);r!==null&&i!==null&&(t=t.setSelection(Pe.create(t.doc,r,i)))}},zh=(t,e)=>({anchor:Av(e.selection.anchor,t.type,t.mapping),head:Av(e.selection.head,t.type,t.mapping)});class v4{constructor(e,n){this.type=e,this.prosemirrorView=n,this.mux=c4(),this.isDestroyed=!1,this.mapping=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&(this.beforeTransactionSelection=zh(this,n.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),e.observeDeep(this._observeFunction),this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(G5&&this._domSelectionInView===null&&(Nh(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection(),n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const i=n.getBoundingClientRect(),o=Z5.documentElement;return i.bottom>=0&&i.right>=0&&i.left<=(window.innerWidth||o.clientWidth||0)&&i.top<=(window.innerHeight||o.clientHeight||0)}renderSnapshot(e,n){n||(n=Cg(Uc(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(ct,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>nl(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(le.from(e),0,0));n.setMeta(ct,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>nl(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(le.from(e),0,0));this.prosemirrorView.dispatch(n.setMeta(ct,{isChangeOrigin:!0}))})}_renderSnapshot(e,n,r){e||(e=jC(this.doc)),this.mapping=new Map,this.mux(()=>{this.doc.transact(i=>{const o=r.permanentUserData;o&&o.dss.forEach(c=>{Nr(i,c,u=>{})});const s=(c,u)=>{const d=c==="added"?o.getUserByClientId(u.client):o.getUserByDeletedId(u);return{user:d,type:c,color:g4(r.colorMapping,r.colors,d)}},a=WC(this.type,new qc(n.ds,e.sv)).map(c=>!c._item.deleted||lc(c._item,e)||lc(c._item,n)?nl(c,this.prosemirrorView.state.schema,new Map,e,n,s):null).filter(c=>c!==null),l=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(le.from(a),0,0));this.prosemirrorView.dispatch(l.setMeta(ct,{isChangeOrigin:!0}))},ct)})}_typeChanged(e,n){const r=ct.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const i=(a,l)=>this.mapping.delete(l);Nr(n,n.deleteSet,a=>{if(a.constructor===et){const l=a.content.type;l&&this.mapping.delete(l)}}),n.changed.forEach(i),n.changedParentTypes.forEach(i);const o=this.type.toArray().map(a=>cE(a,this.prosemirrorView.state.schema,this.mapping)).filter(a=>a!==null);let s=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(le.from(o),0,0));y4(s,this.beforeTransactionSelection,this),s=s.setMeta(ct,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof BC}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&s.scrollIntoView(),this.prosemirrorView.dispatch(s)})}_prosemirrorChanged(e){this.doc.transact(()=>{qh(this.doc,this.type,e,this.mapping),this.beforeTransactionSelection=zh(this,this.prosemirrorView.state)},ct)}destroy(){this.isDestroyed=!0,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions)}}const cE=(t,e,n,r,i,o)=>{const s=n.get(t);if(s===void 0){if(t instanceof Wt)return nl(t,e,n,r,i,o);throw mn()}return s},nl=(t,e,n,r,i,o)=>{const s=[],a=l=>{if(l.constructor===Wt){const c=cE(l,e,n,r,i,o);c!==null&&s.push(c)}else{const c=b4(l,e,n,r,i,o);c!==null&&c.forEach(u=>{u!==null&&s.push(u)})}};r===void 0||i===void 0?t.toArray().forEach(a):WC(t,new qc(i.ds,r.sv)).forEach(a);try{const l=t.getAttributes(r);r!==void 0&&(lc(t._item,r)?lc(t._item,i)||(l.ychange=o?o("added",t._item.id):{type:"added"}):l.ychange=o?o("removed",t._item.id):{type:"removed"});const c=e.node(t.nodeName,l,s);return n.set(t,c),c}catch{return t.doc.transact(c=>{t._item.delete(c)},ct),n.delete(t),null}},b4=(t,e,n,r,i,o)=>{const s=[],a=t.toDelta(r,i,o);try{for(let l=0;l<a.length;l++){const c=a[l],u=[];for(const d in c.attributes)u.push(e.mark(d,c.attributes[d]));s.push(e.text(c.insert,u))}}catch{return t.doc.transact(c=>{t._item.delete(c)},ct),null}return s},w4=(t,e)=>{const n=new fn,r=t.map(i=>({insert:i.text,attributes:dE(i.marks)}));return n.applyDelta(r),e.set(n,t),n},S4=(t,e)=>{const n=new Wt(t.type.name);for(const r in t.attrs){const i=t.attrs[r];i!==null&&r!=="ychange"&&n.setAttribute(r,i)}return n.insert(0,Qc(t).map(r=>Uh(r,e))),e.set(n,t),n},Uh=(t,e)=>t instanceof Array?w4(t,e):S4(t,e),_v=t=>typeof t=="object"&&t!==null,Og=(t,e)=>{const n=Object.keys(t).filter(i=>t[i]!==null);let r=n.length===Object.keys(e).filter(i=>e[i]!==null).length;for(let i=0;i<n.length&&r;i++){const o=n[i],s=t[o],a=e[o];r=o==="ychange"||s===a||_v(s)&&_v(a)&&Og(s,a)}return r},Qc=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const i=e[r];if(i.isText){const o=[];for(let s=e[r];r<e.length&&s.isText;s=e[++r])o.push(s);r--,n.push(o)}else n.push(i)}return n},uE=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,i)=>r.insert===e[i].text&&AC(r.attributes||{}).length===e[i].marks.length&&e[i].marks.every(o=>Og(r.attributes[o.type.name]||{},o.attrs)))},Ms=(t,e)=>{if(t instanceof Wt&&!(e instanceof Array)&&Wh(t,e)){const n=Qc(e);return t._length===n.length&&Og(t.getAttributes(),e.attrs)&&t.toArray().every((r,i)=>Ms(r,n[i]))}return t instanceof fn&&e instanceof Array&&uE(t,e)},cc=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),Rv=(t,e,n)=>{const r=t.toArray(),i=Qc(e),o=i.length,s=r.length,a=zc(s,o);let l=0,c=0,u=!1;for(;l<a;l++){const d=r[l],h=i[l];if(cc(n.get(d),h))u=!0;else if(!Ms(d,h))break}for(;l+c<a;c++){const d=r[s-c-1],h=i[o-c-1];if(cc(n.get(d),h))u=!0;else if(!Ms(d,h))break}return{equalityFactor:l+c,foundMappedChild:u}},x4=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof jn?e+=n.content.str:n.content instanceof mt&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},C4=(t,e,n)=>{n.set(t,e);const{nAttrs:r,str:i}=x4(t),o=e.map(c=>({insert:c.text,attributes:Object.assign({},r,dE(c.marks))})),{insert:s,remove:a,index:l}=h4(i,o.map(c=>c.insert).join(""));t.delete(l,a),t.insert(l,s),t.applyDelta(o.map(c=>({retain:c.insert.length,attributes:c.attributes})))},dE=t=>{const e={};return t.forEach(n=>{n.type.name!=="ychange"&&(e[n.type.name]=n.attrs)}),e},qh=(t,e,n,r)=>{if(e instanceof Wt&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.set(e,n),e instanceof Wt){const d=e.getAttributes(),h=n.attrs;for(const f in h)h[f]!==null?d[f]!==h[f]&&f!=="ychange"&&e.setAttribute(f,h[f]):e.removeAttribute(f);for(const f in d)h[f]===void 0&&e.removeAttribute(f)}const i=Qc(n),o=i.length,s=e.toArray(),a=s.length,l=zc(o,a);let c=0,u=0;for(;c<l;c++){const d=s[c],h=i[c];if(!cc(r.get(d),h))if(Ms(d,h))r.set(d,h);else break}for(;u+c+1<l;u++){const d=s[a-u-1],h=i[o-u-1];if(!cc(r.get(d),h))if(Ms(d,h))r.set(d,h);else break}t.transact(()=>{for(;a-c-u>0&&o-c-u>0;){const h=s[c],f=i[c],p=s[a-u-1],g=i[o-u-1];if(h instanceof fn&&f instanceof Array)uE(h,f)||C4(h,f,r),c+=1;else{let m=h instanceof Wt&&Wh(h,f),y=p instanceof Wt&&Wh(p,g);if(m&&y){const x=Rv(h,f,r),w=Rv(p,g,r);x.foundMappedChild&&!w.foundMappedChild?y=!1:!x.foundMappedChild&&w.foundMappedChild||x.equalityFactor<w.equalityFactor?m=!1:y=!1}m?(qh(t,h,f,r),c+=1):y?(qh(t,p,g,r),u+=1):(r.delete(e.get(c)),e.delete(c,1),e.insert(c,[Uh(f,r)]),c+=1)}}const d=a-c-u;if(a===1&&o===0&&s[0]instanceof fn?(r.delete(s[0]),s[0].delete(0,s[0].length)):d>0&&(e.slice(c,c+d).forEach(h=>r.delete(h)),e.delete(c,d)),c+u<o){const h=[];for(let f=c;f<o-u;f++)h.push(Uh(i[f],r));e.insert(c,h)}},ct)},Wh=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name,Av=(t,e,n)=>{if(t===0)return df(e,0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof fn){if(r._length>=t)return df(r,t);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<i)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&i>1)return new ic(r._item===null?null:r._item.id,r._item===null?Rs(r):null,null);if(t-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new ic(r._item===null?null:r._item.id,r._item===null?Rs(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw or();if(t===0&&r.constructor!==fn&&r!==e)return E4(r._item.parent,r._item)}return df(e,e._length)},E4=(t,e)=>{let n=null,r=null;return t._item===null?r=Rs(t):n=Ge(t._item.id.client,t._item.id.clock),new ic(n,r,e.id)},Ov=(t,e,n,r)=>{const i=OH(n,t);if(i===null||i.type!==e&&!As(e,i.type._item))return null;let o=i.type,s=0;if(o.constructor===fn)s=i.index;else if(o._item===null||!o._item.deleted){let a=o._first,l=0;for(;l<o._length&&l<i.index&&a!==null;){if(!a.deleted){const c=a.content.type;l++,c instanceof fn?s+=c._length:s+=r.get(c).nodeSize}a=a.right}s+=1}for(;o!==e&&o._item!==null;){const a=o._item.parent;if(a._item===null||!a._item.deleted){s+=1;let l=a._first;for(;l!==null;){const c=l.content.type;if(c===o)break;l.deleted||(c instanceof fn?s+=c._length:s+=r.get(c).nodeSize),l=l.right}}o=a}return s-1},_4=t=>{const e=rr.getState(t).undoManager;if(e!=null)return e.undo(),!0},R4=t=>{const e=rr.getState(t).undoManager;if(e!=null)return e.redo(),!0},A4=new Set(["paragraph"]),O4=(t,e)=>!(t instanceof et)||!(t.content instanceof $n)||!(t.content.type instanceof co||t.content.type instanceof Wt&&e.has(t.content.type.nodeName))||t.content.type._length===0,T4=({protectedNodes:t=A4,trackedOrigins:e=[],undoManager:n=null}={})=>new lt({key:rr,state:{init:(r,i)=>{const o=ct.getState(i),s=n||new BC(o.type,{trackedOrigins:new Set([ct].concat(e)),deleteFilter:a=>O4(a,t),captureTransaction:a=>a.meta.get("addToHistory")!==!1});return{undoManager:s,prevSel:null,hasUndoOps:s.undoStack.length>0,hasRedoOps:s.redoStack.length>0}},apply:(r,i,o,s)=>{const a=ct.getState(s).binding,l=i.undoManager,c=l.undoStack.length>0,u=l.redoStack.length>0;return a?{undoManager:l,prevSel:zh(a,o),hasUndoOps:c,hasRedoOps:u}:c!==i.hasUndoOps||u!==i.hasRedoOps?Object.assign({},i,{hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}):i}},view:r=>{const i=ct.getState(r.state),o=rr.getState(r.state).undoManager;return o.on("stack-item-added",({stackItem:s})=>{const a=i.binding;a&&s.meta.set(a,rr.getState(r.state).prevSel)}),o.on("stack-item-popped",({stackItem:s})=>{const a=i.binding;a&&(a.beforeTransactionSelection=s.meta.get(a)||a.beforeTransactionSelection)}),{destroy:()=>{o.destroy()}}}}),k4=ht.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},onCreate(){this.editor.extensionManager.extensions.find(t=>t.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),rr.getState(e).undoManager.undoStack.length===0?!1:n?_4(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),rr.getState(e).undoManager.redoStack.length===0?!1:n?R4(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){const t=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=T4(),n=e.spec.view;e.spec.view=a=>{const{undoManager:l}=rr.getState(a.state);l.restore&&(l.restore(),l.restore=()=>{});const c=n?n(a):void 0;return{destroy:()=>{const u=l.trackedOrigins.has(l),d=l._observers;l.restore=()=>{u&&l.trackedOrigins.add(l),l.doc.on("afterTransaction",l.afterTransactionHandler),l._observers=d},c!=null&&c.destroy&&c.destroy()}}};const r=this.options.ySyncOptions,i=this.options.onFirstRender,o={...r?{...r}:{},...i?{onFirstRender:i}:{}};return[m4(t,o),e]}});function M4(t){const e=new _H(t);return e.setUserMapping(t,t.clientID,"Nathan"),e}function P4({defaultValue:t,readOnly:e,onChange:n,placeHolder:r,extensions:i=[],menuItems:o,commands:s,invalidateOnChange:a=!1,ydoc:l,useYjs:c,showDiff:u,extraProps:d,autoFocus:h=!0,...f}){const[p,g]=O.useState(!1),m=O.useCallback(v=>{n==null||n(v.editor.getJSON())},[n]),y=a?[t]:[],x=c?l??new Eo:null,w=EN({extensions:X3(s,{placeHolderText:r}).concat(i??[]).concat(c?[k4.configure({document:x,ySyncOptions:{permanentUserData:M4(x),colors:[{light:"#bef264",dark:"#dc2626"}]}})]:[]),editorProps:t5,autofocus:h?"start":!1,editable:!e,onUpdate:m,content:t},y);return w&&(w.extras=d??{}),w==null||w.setOptions,O.useEffect(()=>{!u&&!p&&l&&(setTimeout(function(){const v=l.getArray("versions"),S=v.length===0?null:v.get(v.length-1),C=S===null?IH:ff(S==null?void 0:S.snapshot),_=jC(l);S!=null&&C.sv.set(S.clientID,(C.sv.get(S.clientID)??0)+1),TH(C,_)||v.push([{date:new Date().getTime(),snapshot:MH(_),clientID:l.clientID}])},20),g(!0))},[p,g,l]),O.useEffect(()=>{if(u&&l&&w){const v=l.getArray("versions");v.length>1&&setTimeout(function(){const S=v.get(v.length-2),C=v.get(v.length-1);w==null||w.view.dispatch(w==null?void 0:w.state.tr.setMeta(ct,{snapshot:ff(C.snapshot),prevSnapshot:ff(S.snapshot)}))},20)}},[u,w,l]),w?b.jsxs("div",{id:"editor",onClick:()=>w.chain().focus().run(),css:{"& .ProseMirror:focus, .ProseMirror:focus-visible":{outline:"none"},"& .ProseMirror p a":{color:"#0ea5e9",textDecoration:"underline",wordBreak:"break-all",fontWeight:700},"& .ProseMirror p:first-of-type":{marginTop:0},"& .ProseMirror > :first-child":{marginTop:0},"& .ProseMirror > :last-child":{marginBottom:0}},...f,children:[w&&b.jsx(VN,{editor:w,menuItems:o}),b.jsx(pN,{editor:w,style:{outline:0}})]}):null}N.ComponentManager.registerComponent("Editor.Paragraph",wC);N.ComponentManager.registerComponent("Editor.H1",Zx);N.ComponentManager.registerComponent("Editor.H2",eC);N.ComponentManager.registerComponent("Editor.H3",tC);N.ComponentManager.registerComponent("Editor.BlockQuote",Xx);N.ComponentManager.registerComponent("Editor.BulletList",Qx);N.ComponentManager.registerComponent("Editor.OrderedList",bC);N.ComponentManager.registerComponent("Editor.ListItem",vC);const I4={defaultProps:{mt:Y(32,16),mb:Y(32,16),sm_mt:Y(24,14),sm_mb:Y(24,14),lg_mt:Y(32,18),lg_mb:Y(32,18),xl_mt:Y(40,20),xl_mb:Y(40,20),x2_mt:Y(48,24),x2_mb:Y(48,24)}};var L4={},Tg={},Zc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return e}});let e=n=>{};if(process.env.NODE_ENV!=="production"){const n=new Set;e=r=>{n.has(r)||console.warn(r),n.add(r)}}})(Zc);var fE={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return e}});function e(n){let{widthInt:r,heightInt:i,blurWidth:o,blurHeight:s,blurDataURL:a,objectFit:l}=n;const c=20,u=o?o*40:r,d=s?s*40:i,h=u&&d?"viewBox='0 0 "+u+" "+d+"'":"",f=h?"none":l==="contain"?"xMidYMid":l==="cover"?"xMidYMid slice":"none";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+h+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+c+"'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='"+c+"'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+f+"' style='filter: url(%23b);' href='"+a+"'/%3E%3C/svg%3E"}})(fE);var eu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,o){for(var s in o)Object.defineProperty(i,s,{enumerable:!0,get:o[s]})}e(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});const n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}})(eu);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return f}});const e=Zc,n=fE,r=eu,i=["lazy","eager",void 0];function o(p){return p.default!==void 0}function s(p){return p.src!==void 0}function a(p){return typeof p=="object"&&(o(p)||s(p))}const l=new Map;let c;function u(p){return typeof p>"u"?p:typeof p=="number"?Number.isFinite(p)?p:NaN:typeof p=="string"&&/^[0-9]+$/.test(p)?parseInt(p,10):NaN}function d(p,g,m){let{deviceSizes:y,allSizes:x}=p;if(m){const v=/(^|\s)(1?\d?\d)vw/g,S=[];for(let C;C=v.exec(m);C)S.push(parseInt(C[2]));if(S.length){const C=Math.min(...S)*.01;return{widths:x.filter(_=>_>=y[0]*C),kind:"w"}}return{widths:x,kind:"w"}}return typeof g!="number"?{widths:y,kind:"w"}:{widths:[...new Set([g,g*2].map(v=>x.find(S=>S>=v)||x[x.length-1]))],kind:"x"}}function h(p){let{config:g,src:m,unoptimized:y,width:x,quality:w,sizes:v,loader:S}=p;if(y)return{src:m,srcSet:void 0,sizes:void 0};const{widths:C,kind:_}=d(g,x,v),E=C.length-1;return{sizes:!v&&_==="w"?"100vw":v,srcSet:C.map((R,A)=>S({config:g,src:m,quality:w,width:R})+" "+(_==="w"?R:A+1)+_).join(", "),src:S({config:g,src:m,quality:w,width:C[E]})}}function f(p,g){let{src:m,sizes:y,unoptimized:x=!1,priority:w=!1,loading:v,className:S,quality:C,width:_,height:E,fill:R=!1,style:A,overrideSrc:T,onLoad:k,onLoadingComplete:P,placeholder:M="empty",blurDataURL:j,fetchPriority:z,decoding:$="async",layout:J,objectFit:K,objectPosition:D,lazyBoundary:Q,lazyRoot:se,...oe}=p;const{imgConf:de,showAltText:ue,blurComplete:pe,defaultLoader:L}=g;let ce,me=de||r.imageConfigDefault;if("allSizes"in me)ce=me;else{var be;const re=[...me.deviceSizes,...me.imageSizes].sort((fe,ye)=>fe-ye),V=me.deviceSizes.sort((fe,ye)=>fe-ye),te=(be=me.qualities)==null?void 0:be.sort((fe,ye)=>fe-ye);ce={...me,allSizes:re,deviceSizes:V,qualities:te}}if(typeof L>"u")throw new Error(`images.loaderFile detected but the file is missing default export.
212
+ Read more: https://nextjs.org/docs/messages/invalid-images-config`);let F=oe.loader||L;delete oe.loader,delete oe.srcSet;const I="__next_img_default"in F;if(I){if(ce.loader==="custom")throw new Error('Image with src "'+m+`" is missing "loader" prop.
213
+ Read more: https://nextjs.org/docs/messages/next-image-missing-loader`)}else{const re=F;F=V=>{const{config:te,...fe}=V;return re(fe)}}if(J){J==="fill"&&(R=!0);const re={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}},V={responsive:"100vw",fill:"100vw"},te=re[J];te&&(A={...A,...te});const fe=V[J];fe&&!y&&(y=fe)}let je="",G=u(_),ne=u(E),X,W;if(a(m)){const re=o(m)?m.default:m;if(!re.src)throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(re));if(!re.height||!re.width)throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(re));if(X=re.blurWidth,W=re.blurHeight,j=j||re.blurDataURL,je=re.src,!R){if(!G&&!ne)G=re.width,ne=re.height;else if(G&&!ne){const V=G/re.width;ne=Math.round(re.height*V)}else if(!G&&ne){const V=ne/re.height;G=Math.round(re.width*V)}}}m=typeof m=="string"?m:je;let B=!w&&(v==="lazy"||typeof v>"u");(!m||m.startsWith("data:")||m.startsWith("blob:"))&&(x=!0,B=!1),ce.unoptimized&&(x=!0),I&&m.endsWith(".svg")&&!ce.dangerouslyAllowSVG&&(x=!0),w&&(z="high");const ee=u(C);if(process.env.NODE_ENV!=="production"){if(ce.output==="export"&&I&&!x)throw new Error("Image Optimization using the default loader is not compatible with `{ output: 'export' }`.\n Possible solutions:\n - Remove `{ output: 'export' }` and run \"next start\" to run server mode including the Image Optimization API.\n - Configure `{ images: { unoptimized: true } }` in `next.config.js` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api");if(!m)x=!0;else if(R){if(_)throw new Error('Image with src "'+m+'" has both "width" and "fill" properties. Only one should be used.');if(E)throw new Error('Image with src "'+m+'" has both "height" and "fill" properties. Only one should be used.');if(A!=null&&A.position&&A.position!=="absolute")throw new Error('Image with src "'+m+'" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.');if(A!=null&&A.width&&A.width!=="100%")throw new Error('Image with src "'+m+'" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.');if(A!=null&&A.height&&A.height!=="100%")throw new Error('Image with src "'+m+'" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.')}else{if(typeof G>"u")throw new Error('Image with src "'+m+'" is missing required "width" property.');if(isNaN(G))throw new Error('Image with src "'+m+'" has invalid "width" property. Expected a numeric value in pixels but received "'+_+'".');if(typeof ne>"u")throw new Error('Image with src "'+m+'" is missing required "height" property.');if(isNaN(ne))throw new Error('Image with src "'+m+'" has invalid "height" property. Expected a numeric value in pixels but received "'+E+'".')}if(!i.includes(v))throw new Error('Image with src "'+m+'" has invalid "loading" property. Provided "'+v+'" should be one of '+i.map(String).join(",")+".");if(w&&v==="lazy")throw new Error('Image with src "'+m+`" has both "priority" and "loading='lazy'" properties. Only one should be used.`);if(M!=="empty"&&M!=="blur"&&!M.startsWith("data:image/"))throw new Error('Image with src "'+m+'" has invalid "placeholder" property "'+M+'".');if(M!=="empty"&&G&&ne&&G*ne<1600&&(0,e.warnOnce)('Image with src "'+m+'" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.'),M==="blur"&&!j){const re=["jpeg","png","webp","avif"];throw new Error('Image with src "'+m+`" has "placeholder='blur'" property but is missing the "blurDataURL" property.
214
+ Possible solutions:
215
+ - Add a "blurDataURL" property, the contents should be a small Data URL to represent the image
216
+ - Change the "src" property to a static import with one of the supported file types: `+re.join(",")+` (animated images not supported)
217
+ - Remove the "placeholder" property, effectively no blur effect
218
+ Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url`)}if("ref"in oe&&(0,e.warnOnce)('Image with src "'+m+'" is using unsupported "ref" property. Consider using the "onLoad" property instead.'),!x&&!I){const re=F({config:ce,src:m,width:G||400,quality:ee||75});let V;try{V=new URL(re)}catch{}(re===m||V&&V.pathname===m&&!V.search)&&(0,e.warnOnce)('Image with src "'+m+`" has a "loader" property that does not implement width. Please implement it or use the "unoptimized" property instead.
219
+ Read more: https://nextjs.org/docs/messages/next-image-missing-loader-width`)}P&&(0,e.warnOnce)('Image with src "'+m+'" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.');for(const[re,V]of Object.entries({layout:J,objectFit:K,objectPosition:D,lazyBoundary:Q,lazyRoot:se}))V&&(0,e.warnOnce)('Image with src "'+m+'" has legacy prop "'+re+`". Did you forget to run the codemod?
220
+ Read more: https://nextjs.org/docs/messages/next-image-upgrade-to-13`);if(typeof window<"u"&&!c&&window.PerformanceObserver){c=new PerformanceObserver(re=>{for(const te of re.getEntries()){var V;const fe=(te==null||(V=te.element)==null?void 0:V.src)||"",ye=l.get(fe);ye&&!ye.priority&&ye.placeholder==="empty"&&!ye.src.startsWith("data:")&&!ye.src.startsWith("blob:")&&(0,e.warnOnce)('Image with src "'+ye.src+`" was detected as the Largest Contentful Paint (LCP). Please add the "priority" property if this image is above the fold.
221
+ Read more: https://nextjs.org/docs/api-reference/next/image#priority`)}});try{c.observe({type:"largest-contentful-paint",buffered:!0})}catch(re){console.error(re)}}}const xe=Object.assign(R?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:K,objectPosition:D}:{},ue?{}:{color:"transparent"},A),we=!pe&&M!=="empty"?M==="blur"?'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:G,heightInt:ne,blurWidth:X,blurHeight:W,blurDataURL:j||"",objectFit:xe.objectFit})+'")':'url("'+M+'")':null;let Z=we?{backgroundSize:xe.objectFit||"cover",backgroundPosition:xe.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:we}:{};process.env.NODE_ENV==="development"&&Z.backgroundImage&&M==="blur"&&j!=null&&j.startsWith("/")&&(Z.backgroundImage='url("'+j+'")');const Se=h({config:ce,src:m,unoptimized:x,width:G,quality:ee,sizes:y,loader:F});if(process.env.NODE_ENV!=="production"&&typeof window<"u"){let re;try{re=new URL(Se.src)}catch{re=new URL(Se.src,window.location.href)}l.set(re.href,{src:m,priority:w,placeholder:M})}return{props:{...oe,loading:B?"lazy":v,fetchPriority:z,width:G,height:ne,decoding:$,className:S,style:{...xe,...Z},sizes:Se.sizes,srcSet:Se.srcSet,src:T||Se.src},meta:{unoptimized:x,priority:w,placeholder:M,fill:R}}}})(Tg);var Kh={exports:{}},Fa={exports:{}},gf={},Tv;function D4(){return Tv||(Tv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});const e=O,n=typeof window>"u",r=n?()=>{}:e.useLayoutEffect,i=n?()=>{}:e.useEffect;function o(s){const{headManager:a,reduceComponentsToState:l}=s;function c(){if(a&&a.mountedInstances){const d=e.Children.toArray(Array.from(a.mountedInstances).filter(Boolean));a.updateHead(l(d,s))}}if(n){var u;a==null||(u=a.mountedInstances)==null||u.add(s.children),c()}return r(()=>{var d;return a==null||(d=a.mountedInstances)==null||d.add(s.children),()=>{var h;a==null||(h=a.mountedInstances)==null||h.delete(s.children)}}),r(()=>(a&&(a._pendingUpdate=c),()=>{a&&(a._pendingUpdate=c)})),i(()=>(a&&a._pendingUpdate&&(a._pendingUpdate(),a._pendingUpdate=null),()=>{a&&a._pendingUpdate&&(a._pendingUpdate(),a._pendingUpdate=null)})),null}}(gf)),gf}var mf={},kv;function N4(){return kv||(kv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});const r=Nt._(O).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="AmpStateContext")}(mf)),mf}var yf={},Mv;function j4(){return Mv||(Mv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return e}});function e(n){let{ampFirst:r=!1,hybrid:i=!1,hasQuery:o=!1}=n===void 0?{}:n;return r||i&&o}}(yf)),yf}var Pv;function F4(){return Pv||(Pv=1,function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function n(w,v){for(var S in v)Object.defineProperty(w,S,{enumerable:!0,get:v[S]})}n(e,{default:function(){return x},defaultHead:function(){return h}});const r=Nt,i=Is(),o=Ps,s=i._(O),a=r._(D4()),l=N4(),c=tw(),u=j4(),d=Zc;function h(w){w===void 0&&(w=!1);const v=[(0,o.jsx)("meta",{charSet:"utf-8"})];return w||v.push((0,o.jsx)("meta",{name:"viewport",content:"width=device-width"})),v}function f(w,v){return typeof v=="string"||typeof v=="number"?w:v.type===s.default.Fragment?w.concat(s.default.Children.toArray(v.props.children).reduce((S,C)=>typeof C=="string"||typeof C=="number"?S:S.concat(C),[])):w.concat(v)}const p=["name","httpEquiv","charSet","itemProp"];function g(){const w=new Set,v=new Set,S=new Set,C={};return _=>{let E=!0,R=!1;if(_.key&&typeof _.key!="number"&&_.key.indexOf("$")>0){R=!0;const A=_.key.slice(_.key.indexOf("$")+1);w.has(A)?E=!1:w.add(A)}switch(_.type){case"title":case"base":v.has(_.type)?E=!1:v.add(_.type);break;case"meta":for(let A=0,T=p.length;A<T;A++){const k=p[A];if(_.props.hasOwnProperty(k))if(k==="charSet")S.has(k)?E=!1:S.add(k);else{const P=_.props[k],M=C[k]||new Set;(k!=="name"||!R)&&M.has(P)?E=!1:(M.add(P),C[k]=M)}}break}return E}}function m(w,v){const{inAmpMode:S}=v;return w.reduce(f,[]).reverse().concat(h(S).reverse()).filter(g()).reverse().map((C,_)=>{const E=C.key||_;if(process.env.NODE_ENV!=="development"&&process.env.__NEXT_OPTIMIZE_FONTS&&!S&&C.type==="link"&&C.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(R=>C.props.href.startsWith(R))){const R={...C.props||{}};return R["data-href"]=R.href,R.href=void 0,R["data-optimized-fonts"]=!0,s.default.cloneElement(C,R)}if(process.env.NODE_ENV==="development")if(C.type==="script"&&C.props.type!=="application/ld+json"){const R=C.props.src?'<script> tag with src="'+C.props.src+'"':"inline <script>";(0,d.warnOnce)("Do not add <script> tags using next/head (see "+R+`). Use next/script instead.
222
+ See more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component`)}else C.type==="link"&&C.props.rel==="stylesheet"&&(0,d.warnOnce)('Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="'+C.props.href+`"). Use Document instead.
223
+ See more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component`);return s.default.cloneElement(C,{key:E})})}function y(w){let{children:v}=w;const S=(0,s.useContext)(l.AmpStateContext),C=(0,s.useContext)(c.HeadManagerContext);return(0,o.jsx)(a.default,{reduceComponentsToState:m,headManager:C,inAmpMode:(0,u.isInAmpMode)(S),children:v})}const x=y;(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Fa,Fa.exports)),Fa.exports}var vf={},Iv;function H4(){return Iv||(Iv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return i}});const n=Nt._(O),r=eu,i=n.default.createContext(r.imageConfigDefault);process.env.NODE_ENV!=="production"&&(i.displayName="ImageConfigContext")}(vf)),vf}var bf={},wf={},Sf={exports:{}},Lv;function hE(){return Lv||(Lv=1,(()=>{var t={170:(i,o,s)=>{const a=s(510),l=()=>{if(typeof navigator<"u"&&navigator.platform){const u=navigator.platform.toLowerCase();return u==="win32"||u==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};function c(u,d,h=!1){return d&&(d.windows===null||d.windows===void 0)&&(d={...d,windows:l()}),a(u,d,h)}Object.assign(c,a),i.exports=c},154:i=>{const o="\\\\/",s=`[^${o}]`,a="\\.",l="\\+",c="\\?",u="\\/",d="(?=.)",h="[^/]",f=`(?:${u}|$)`,p=`(?:^|${u})`,g=`${a}{1,2}${f}`,m=`(?!${a})`,y=`(?!${p}${g})`,x=`(?!${a}{0,1}${f})`,w=`(?!${g})`,v=`[^.${u}]`,S=`${h}*?`,_={DOT_LITERAL:a,PLUS_LITERAL:l,QMARK_LITERAL:c,SLASH_LITERAL:u,ONE_CHAR:d,QMARK:h,END_ANCHOR:f,DOTS_SLASH:g,NO_DOT:m,NO_DOTS:y,NO_DOT_SLASH:x,NO_DOTS_SLASH:w,QMARK_NO_DOT:v,STAR:S,START_ANCHOR:p,SEP:"/"},E={..._,SLASH_LITERAL:`[${o}]`,QMARK:s,STAR:`${s}*?`,DOTS_SLASH:`${a}{1,2}(?:[${o}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${o}])${a}{1,2}(?:[${o}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${o}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${o}]|$))`,QMARK_NO_DOT:`[^.${o}]`,START_ANCHOR:`(?:^|[${o}])`,END_ANCHOR:`(?:[${o}]|$)`,SEP:"\\"},R={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};i.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:R,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?E:_}}},697:(i,o,s)=>{const a=s(154),l=s(96),{MAX_LENGTH:c,POSIX_REGEX_SOURCE:u,REGEX_NON_SPECIAL_CHARS:d,REGEX_SPECIAL_CHARS_BACKREF:h,REPLACEMENTS:f}=a,p=(y,x)=>{if(typeof x.expandRange=="function")return x.expandRange(...y,x);y.sort();const w=`[${y.join("-")}]`;try{new RegExp(w)}catch{return y.map(S=>l.escapeRegex(S)).join("..")}return w},g=(y,x)=>`Missing ${y}: "${x}" - use "\\\\${x}" to match literal characters`,m=(y,x)=>{if(typeof y!="string")throw new TypeError("Expected a string");y=f[y]||y;const w={...x},v=typeof w.maxLength=="number"?Math.min(c,w.maxLength):c;let S=y.length;if(S>v)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${v}`);const C={type:"bos",value:"",output:w.prepend||""},_=[C],E=w.capture?"":"?:",R=a.globChars(w.windows),A=a.extglobChars(R),{DOT_LITERAL:T,PLUS_LITERAL:k,SLASH_LITERAL:P,ONE_CHAR:M,DOTS_SLASH:j,NO_DOT:z,NO_DOT_SLASH:$,NO_DOTS_SLASH:J,QMARK:K,QMARK_NO_DOT:D,STAR:Q,START_ANCHOR:se}=R,oe=H=>`(${E}(?:(?!${se}${H.dot?j:T}).)*?)`,de=w.dot?"":z,ue=w.dot?K:D;let pe=w.bash===!0?oe(w):Q;w.capture&&(pe=`(${pe})`),typeof w.noext=="boolean"&&(w.noextglob=w.noext);const L={input:y,index:-1,start:0,dot:w.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};y=l.removePrefix(y,L),S=y.length;const ce=[],me=[],be=[];let F=C,I;const je=()=>L.index===S-1,G=L.peek=(H=1)=>y[L.index+H],ne=L.advance=()=>y[++L.index]||"",X=()=>y.slice(L.index+1),W=(H="",re=0)=>{L.consumed+=H,L.index+=re},B=H=>{L.output+=H.output!=null?H.output:H.value,W(H.value)},ee=()=>{let H=1;for(;G()==="!"&&(G(2)!=="("||G(3)==="?");)ne(),L.start++,H++;return H%2===0?!1:(L.negated=!0,L.start++,!0)},xe=H=>{L[H]++,be.push(H)},we=H=>{L[H]--,be.pop()},Z=H=>{if(F.type==="globstar"){const re=L.braces>0&&(H.type==="comma"||H.type==="brace"),V=H.extglob===!0||ce.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!re&&!V&&(L.output=L.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=pe,L.output+=F.output)}if(ce.length&&H.type!=="paren"&&(ce[ce.length-1].inner+=H.value),(H.value||H.output)&&B(H),F&&F.type==="text"&&H.type==="text"){F.output=(F.output||F.value)+H.value,F.value+=H.value;return}H.prev=F,_.push(H),F=H},Se=(H,re)=>{const V={...A[re],conditions:1,inner:""};V.prev=F,V.parens=L.parens,V.output=L.output;const te=(w.capture?"(":"")+V.open;xe("parens"),Z({type:H,value:re,output:L.output?"":M}),Z({type:"paren",extglob:!0,value:ne(),output:te}),ce.push(V)},U=H=>{let re=H.close+(w.capture?")":""),V;if(H.type==="negate"){let te=pe;if(H.inner&&H.inner.length>1&&H.inner.includes("/")&&(te=oe(w)),(te!==pe||je()||/^\)+$/.test(X()))&&(re=H.close=`)$))${te}`),H.inner.includes("*")&&(V=X())&&/^\.[^\\/.]+$/.test(V)){const fe=m(V,{...x,fastpaths:!1}).output;re=H.close=`)${fe})${te})`}H.prev.type==="bos"&&(L.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:I,output:re}),we("parens")};if(w.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(y)){let H=!1,re=y.replace(h,(V,te,fe,ye,Ce,Fe)=>ye==="\\"?(H=!0,V):ye==="?"?te?te+ye+(Ce?K.repeat(Ce.length):""):Fe===0?ue+(Ce?K.repeat(Ce.length):""):K.repeat(fe.length):ye==="."?T.repeat(fe.length):ye==="*"?te?te+ye+(Ce?pe:""):pe:te?V:`\\${V}`);return H===!0&&(w.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,V=>V.length%2===0?"\\\\":V?"\\":"")),re===y&&w.contains===!0?(L.output=y,L):(L.output=l.wrapOutput(re,L,x),L)}for(;!je();){if(I=ne(),I==="\0")continue;if(I==="\\"){const V=G();if(V==="/"&&w.bash!==!0||V==="."||V===";")continue;if(!V){I+="\\",Z({type:"text",value:I});continue}const te=/^\\+/.exec(X());let fe=0;if(te&&te[0].length>2&&(fe=te[0].length,L.index+=fe,fe%2!==0&&(I+="\\")),w.unescape===!0?I=ne():I+=ne(),L.brackets===0){Z({type:"text",value:I});continue}}if(L.brackets>0&&(I!=="]"||F.value==="["||F.value==="[^")){if(w.posix!==!1&&I===":"){const V=F.value.slice(1);if(V.includes("[")&&(F.posix=!0,V.includes(":"))){const te=F.value.lastIndexOf("["),fe=F.value.slice(0,te),ye=F.value.slice(te+2),Ce=u[ye];if(Ce){F.value=fe+Ce,L.backtrack=!0,ne(),!C.output&&_.indexOf(F)===1&&(C.output=M);continue}}}(I==="["&&G()!==":"||I==="-"&&G()==="]")&&(I=`\\${I}`),I==="]"&&(F.value==="["||F.value==="[^")&&(I=`\\${I}`),w.posix===!0&&I==="!"&&F.value==="["&&(I="^"),F.value+=I,B({value:I});continue}if(L.quotes===1&&I!=='"'){I=l.escapeRegex(I),F.value+=I,B({value:I});continue}if(I==='"'){L.quotes=L.quotes===1?0:1,w.keepQuotes===!0&&Z({type:"text",value:I});continue}if(I==="("){xe("parens"),Z({type:"paren",value:I});continue}if(I===")"){if(L.parens===0&&w.strictBrackets===!0)throw new SyntaxError(g("opening","("));const V=ce[ce.length-1];if(V&&L.parens===V.parens+1){U(ce.pop());continue}Z({type:"paren",value:I,output:L.parens?")":"\\)"}),we("parens");continue}if(I==="["){if(w.nobracket===!0||!X().includes("]")){if(w.nobracket!==!0&&w.strictBrackets===!0)throw new SyntaxError(g("closing","]"));I=`\\${I}`}else xe("brackets");Z({type:"bracket",value:I});continue}if(I==="]"){if(w.nobracket===!0||F&&F.type==="bracket"&&F.value.length===1){Z({type:"text",value:I,output:`\\${I}`});continue}if(L.brackets===0){if(w.strictBrackets===!0)throw new SyntaxError(g("opening","["));Z({type:"text",value:I,output:`\\${I}`});continue}we("brackets");const V=F.value.slice(1);if(F.posix!==!0&&V[0]==="^"&&!V.includes("/")&&(I=`/${I}`),F.value+=I,B({value:I}),w.literalBrackets===!1||l.hasRegexChars(V))continue;const te=l.escapeRegex(F.value);if(L.output=L.output.slice(0,-F.value.length),w.literalBrackets===!0){L.output+=te,F.value=te;continue}F.value=`(${E}${te}|${F.value})`,L.output+=F.value;continue}if(I==="{"&&w.nobrace!==!0){xe("braces");const V={type:"brace",value:I,output:"(",outputIndex:L.output.length,tokensIndex:L.tokens.length};me.push(V),Z(V);continue}if(I==="}"){const V=me[me.length-1];if(w.nobrace===!0||!V){Z({type:"text",value:I,output:I});continue}let te=")";if(V.dots===!0){const fe=_.slice(),ye=[];for(let Ce=fe.length-1;Ce>=0&&(_.pop(),fe[Ce].type!=="brace");Ce--)fe[Ce].type!=="dots"&&ye.unshift(fe[Ce].value);te=p(ye,w),L.backtrack=!0}if(V.comma!==!0&&V.dots!==!0){const fe=L.output.slice(0,V.outputIndex),ye=L.tokens.slice(V.tokensIndex);V.value=V.output="\\{",I=te="\\}",L.output=fe;for(const Ce of ye)L.output+=Ce.output||Ce.value}Z({type:"brace",value:I,output:te}),we("braces"),me.pop();continue}if(I==="|"){ce.length>0&&ce[ce.length-1].conditions++,Z({type:"text",value:I});continue}if(I===","){let V=I;const te=me[me.length-1];te&&be[be.length-1]==="braces"&&(te.comma=!0,V="|"),Z({type:"comma",value:I,output:V});continue}if(I==="/"){if(F.type==="dot"&&L.index===L.start+1){L.start=L.index+1,L.consumed="",L.output="",_.pop(),F=C;continue}Z({type:"slash",value:I,output:P});continue}if(I==="."){if(L.braces>0&&F.type==="dot"){F.value==="."&&(F.output=T);const V=me[me.length-1];F.type="dots",F.output+=I,F.value+=I,V.dots=!0;continue}if(L.braces+L.parens===0&&F.type!=="bos"&&F.type!=="slash"){Z({type:"text",value:I,output:T});continue}Z({type:"dot",value:I,output:T});continue}if(I==="?"){if(!(F&&F.value==="(")&&w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Se("qmark",I);continue}if(F&&F.type==="paren"){const te=G();let fe=I;(F.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(X()))&&(fe=`\\${I}`),Z({type:"text",value:I,output:fe});continue}if(w.dot!==!0&&(F.type==="slash"||F.type==="bos")){Z({type:"qmark",value:I,output:D});continue}Z({type:"qmark",value:I,output:K});continue}if(I==="!"){if(w.noextglob!==!0&&G()==="("&&(G(2)!=="?"||!/[!=<:]/.test(G(3)))){Se("negate",I);continue}if(w.nonegate!==!0&&L.index===0){ee();continue}}if(I==="+"){if(w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Se("plus",I);continue}if(F&&F.value==="("||w.regex===!1){Z({type:"plus",value:I,output:k});continue}if(F&&(F.type==="bracket"||F.type==="paren"||F.type==="brace")||L.parens>0){Z({type:"plus",value:I});continue}Z({type:"plus",value:k});continue}if(I==="@"){if(w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Z({type:"at",extglob:!0,value:I,output:""});continue}Z({type:"text",value:I});continue}if(I!=="*"){(I==="$"||I==="^")&&(I=`\\${I}`);const V=d.exec(X());V&&(I+=V[0],L.index+=V[0].length),Z({type:"text",value:I});continue}if(F&&(F.type==="globstar"||F.star===!0)){F.type="star",F.star=!0,F.value+=I,F.output=pe,L.backtrack=!0,L.globstar=!0,W(I);continue}let H=X();if(w.noextglob!==!0&&/^\([^?]/.test(H)){Se("star",I);continue}if(F.type==="star"){if(w.noglobstar===!0){W(I);continue}const V=F.prev,te=V.prev,fe=V.type==="slash"||V.type==="bos",ye=te&&(te.type==="star"||te.type==="globstar");if(w.bash===!0&&(!fe||H[0]&&H[0]!=="/")){Z({type:"star",value:I,output:""});continue}const Ce=L.braces>0&&(V.type==="comma"||V.type==="brace"),Fe=ce.length&&(V.type==="pipe"||V.type==="paren");if(!fe&&V.type!=="paren"&&!Ce&&!Fe){Z({type:"star",value:I,output:""});continue}for(;H.slice(0,3)==="/**";){const Ve=y[L.index+4];if(Ve&&Ve!=="/")break;H=H.slice(3),W("/**",3)}if(V.type==="bos"&&je()){F.type="globstar",F.value+=I,F.output=oe(w),L.output=F.output,L.globstar=!0,W(I);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&!ye&&je()){L.output=L.output.slice(0,-(V.output+F.output).length),V.output=`(?:${V.output}`,F.type="globstar",F.output=oe(w)+(w.strictSlashes?")":"|$)"),F.value+=I,L.globstar=!0,L.output+=V.output+F.output,W(I);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&H[0]==="/"){const Ve=H[1]!==void 0?"|$":"";L.output=L.output.slice(0,-(V.output+F.output).length),V.output=`(?:${V.output}`,F.type="globstar",F.output=`${oe(w)}${P}|${P}${Ve})`,F.value+=I,L.output+=V.output+F.output,L.globstar=!0,W(I+ne()),Z({type:"slash",value:"/",output:""});continue}if(V.type==="bos"&&H[0]==="/"){F.type="globstar",F.value+=I,F.output=`(?:^|${P}|${oe(w)}${P})`,L.output=F.output,L.globstar=!0,W(I+ne()),Z({type:"slash",value:"/",output:""});continue}L.output=L.output.slice(0,-F.output.length),F.type="globstar",F.output=oe(w),F.value+=I,L.output+=F.output,L.globstar=!0,W(I);continue}const re={type:"star",value:I,output:pe};if(w.bash===!0){re.output=".*?",(F.type==="bos"||F.type==="slash")&&(re.output=de+re.output),Z(re);continue}if(F&&(F.type==="bracket"||F.type==="paren")&&w.regex===!0){re.output=I,Z(re);continue}(L.index===L.start||F.type==="slash"||F.type==="dot")&&(F.type==="dot"?(L.output+=$,F.output+=$):w.dot===!0?(L.output+=J,F.output+=J):(L.output+=de,F.output+=de),G()!=="*"&&(L.output+=M,F.output+=M)),Z(re)}for(;L.brackets>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing","]"));L.output=l.escapeLast(L.output,"["),we("brackets")}for(;L.parens>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing",")"));L.output=l.escapeLast(L.output,"("),we("parens")}for(;L.braces>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing","}"));L.output=l.escapeLast(L.output,"{"),we("braces")}if(w.strictSlashes!==!0&&(F.type==="star"||F.type==="bracket")&&Z({type:"maybe_slash",value:"",output:`${P}?`}),L.backtrack===!0){L.output="";for(const H of L.tokens)L.output+=H.output!=null?H.output:H.value,H.suffix&&(L.output+=H.suffix)}return L};m.fastpaths=(y,x)=>{const w={...x},v=typeof w.maxLength=="number"?Math.min(c,w.maxLength):c,S=y.length;if(S>v)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${v}`);y=f[y]||y;const{DOT_LITERAL:C,SLASH_LITERAL:_,ONE_CHAR:E,DOTS_SLASH:R,NO_DOT:A,NO_DOTS:T,NO_DOTS_SLASH:k,STAR:P,START_ANCHOR:M}=a.globChars(w.windows),j=w.dot?T:A,z=w.dot?k:A,$=w.capture?"":"?:",J={negated:!1,prefix:""};let K=w.bash===!0?".*?":P;w.capture&&(K=`(${K})`);const D=de=>de.noglobstar===!0?K:`(${$}(?:(?!${M}${de.dot?R:C}).)*?)`,Q=de=>{switch(de){case"*":return`${j}${E}${K}`;case".*":return`${C}${E}${K}`;case"*.*":return`${j}${K}${C}${E}${K}`;case"*/*":return`${j}${K}${_}${E}${z}${K}`;case"**":return j+D(w);case"**/*":return`(?:${j}${D(w)}${_})?${z}${E}${K}`;case"**/*.*":return`(?:${j}${D(w)}${_})?${z}${K}${C}${E}${K}`;case"**/.*":return`(?:${j}${D(w)}${_})?${C}${E}${K}`;default:{const ue=/^(.*?)\.(\w+)$/.exec(de);if(!ue)return;const pe=Q(ue[1]);return pe?pe+C+ue[2]:void 0}}},se=l.removePrefix(y,J);let oe=Q(se);return oe&&w.strictSlashes!==!0&&(oe+=`${_}?`),oe},i.exports=m},510:(i,o,s)=>{const a=s(716),l=s(697),c=s(96),u=s(154),d=f=>f&&typeof f=="object"&&!Array.isArray(f),h=(f,p,g=!1)=>{if(Array.isArray(f)){const _=f.map(R=>h(R,p,g));return R=>{for(const A of _){const T=A(R);if(T)return T}return!1}}const m=d(f)&&f.tokens&&f.input;if(f===""||typeof f!="string"&&!m)throw new TypeError("Expected pattern to be a non-empty string");const y=p||{},x=y.windows,w=m?h.compileRe(f,p):h.makeRe(f,p,!1,!0),v=w.state;delete w.state;let S=()=>!1;if(y.ignore){const _={...p,ignore:null,onMatch:null,onResult:null};S=h(y.ignore,_,g)}const C=(_,E=!1)=>{const{isMatch:R,match:A,output:T}=h.test(_,w,p,{glob:f,posix:x}),k={glob:f,state:v,regex:w,posix:x,input:_,output:T,match:A,isMatch:R};return typeof y.onResult=="function"&&y.onResult(k),R===!1?(k.isMatch=!1,E?k:!1):S(_)?(typeof y.onIgnore=="function"&&y.onIgnore(k),k.isMatch=!1,E?k:!1):(typeof y.onMatch=="function"&&y.onMatch(k),E?k:!0)};return g&&(C.state=v),C};h.test=(f,p,g,{glob:m,posix:y}={})=>{if(typeof f!="string")throw new TypeError("Expected input to be a string");if(f==="")return{isMatch:!1,output:""};const x=g||{},w=x.format||(y?c.toPosixSlashes:null);let v=f===m,S=v&&w?w(f):f;return v===!1&&(S=w?w(f):f,v=S===m),(v===!1||x.capture===!0)&&(x.matchBase===!0||x.basename===!0?v=h.matchBase(f,p,g,y):v=p.exec(S)),{isMatch:!!v,match:v,output:S}},h.matchBase=(f,p,g)=>(p instanceof RegExp?p:h.makeRe(p,g)).test(c.basename(f)),h.isMatch=(f,p,g)=>h(p,g)(f),h.parse=(f,p)=>Array.isArray(f)?f.map(g=>h.parse(g,p)):l(f,{...p,fastpaths:!1}),h.scan=(f,p)=>a(f,p),h.compileRe=(f,p,g=!1,m=!1)=>{if(g===!0)return f.output;const y=p||{},x=y.contains?"":"^",w=y.contains?"":"$";let v=`${x}(?:${f.output})${w}`;f&&f.negated===!0&&(v=`^(?!${v}).*$`);const S=h.toRegex(v,p);return m===!0&&(S.state=f),S},h.makeRe=(f,p={},g=!1,m=!1)=>{if(!f||typeof f!="string")throw new TypeError("Expected a non-empty string");let y={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(f[0]==="."||f[0]==="*")&&(y.output=l.fastpaths(f,p)),y.output||(y=l(f,p)),h.compileRe(y,p,g,m)},h.toRegex=(f,p)=>{try{const g=p||{};return new RegExp(f,g.flags||(g.nocase?"i":""))}catch(g){if(p&&p.debug===!0)throw g;return/$^/}},h.constants=u,i.exports=h},716:(i,o,s)=>{const a=s(96),{CHAR_ASTERISK:l,CHAR_AT:c,CHAR_BACKWARD_SLASH:u,CHAR_COMMA:d,CHAR_DOT:h,CHAR_EXCLAMATION_MARK:f,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:g,CHAR_LEFT_PARENTHESES:m,CHAR_LEFT_SQUARE_BRACKET:y,CHAR_PLUS:x,CHAR_QUESTION_MARK:w,CHAR_RIGHT_CURLY_BRACE:v,CHAR_RIGHT_PARENTHESES:S,CHAR_RIGHT_SQUARE_BRACKET:C}=s(154),_=A=>A===p||A===u,E=A=>{A.isPrefix!==!0&&(A.depth=A.isGlobstar?1/0:1)},R=(A,T)=>{const k=T||{},P=A.length-1,M=k.parts===!0||k.scanToEnd===!0,j=[],z=[],$=[];let J=A,K=-1,D=0,Q=0,se=!1,oe=!1,de=!1,ue=!1,pe=!1,L=!1,ce=!1,me=!1,be=!1,F=!1,I=0,je,G,ne={value:"",depth:0,isGlob:!1};const X=()=>K>=P,W=()=>J.charCodeAt(K+1),B=()=>(je=G,J.charCodeAt(++K));for(;K<P;){G=B();let Se;if(G===u){ce=ne.backslashes=!0,G=B(),G===g&&(L=!0);continue}if(L===!0||G===g){for(I++;X()!==!0&&(G=B());){if(G===u){ce=ne.backslashes=!0,B();continue}if(G===g){I++;continue}if(L!==!0&&G===h&&(G=B())===h){if(se=ne.isBrace=!0,de=ne.isGlob=!0,F=!0,M===!0)continue;break}if(L!==!0&&G===d){if(se=ne.isBrace=!0,de=ne.isGlob=!0,F=!0,M===!0)continue;break}if(G===v&&(I--,I===0)){L=!1,se=ne.isBrace=!0,F=!0;break}}if(M===!0)continue;break}if(G===p){if(j.push(K),z.push(ne),ne={value:"",depth:0,isGlob:!1},F===!0)continue;if(je===h&&K===D+1){D+=2;continue}Q=K+1;continue}if(k.noext!==!0&&(G===x||G===c||G===l||G===w||G===f)===!0&&W()===m){if(de=ne.isGlob=!0,ue=ne.isExtglob=!0,F=!0,G===f&&K===D&&(be=!0),M===!0){for(;X()!==!0&&(G=B());){if(G===u){ce=ne.backslashes=!0,G=B();continue}if(G===S){de=ne.isGlob=!0,F=!0;break}}continue}break}if(G===l){if(je===l&&(pe=ne.isGlobstar=!0),de=ne.isGlob=!0,F=!0,M===!0)continue;break}if(G===w){if(de=ne.isGlob=!0,F=!0,M===!0)continue;break}if(G===y){for(;X()!==!0&&(Se=B());){if(Se===u){ce=ne.backslashes=!0,B();continue}if(Se===C){oe=ne.isBracket=!0,de=ne.isGlob=!0,F=!0;break}}if(M===!0)continue;break}if(k.nonegate!==!0&&G===f&&K===D){me=ne.negated=!0,D++;continue}if(k.noparen!==!0&&G===m){if(de=ne.isGlob=!0,M===!0){for(;X()!==!0&&(G=B());){if(G===m){ce=ne.backslashes=!0,G=B();continue}if(G===S){F=!0;break}}continue}break}if(de===!0){if(F=!0,M===!0)continue;break}}k.noext===!0&&(ue=!1,de=!1);let ee=J,xe="",we="";D>0&&(xe=J.slice(0,D),J=J.slice(D),Q-=D),ee&&de===!0&&Q>0?(ee=J.slice(0,Q),we=J.slice(Q)):de===!0?(ee="",we=J):ee=J,ee&&ee!==""&&ee!=="/"&&ee!==J&&_(ee.charCodeAt(ee.length-1))&&(ee=ee.slice(0,-1)),k.unescape===!0&&(we&&(we=a.removeBackslashes(we)),ee&&ce===!0&&(ee=a.removeBackslashes(ee)));const Z={prefix:xe,input:A,start:D,base:ee,glob:we,isBrace:se,isBracket:oe,isGlob:de,isExtglob:ue,isGlobstar:pe,negated:me,negatedExtglob:be};if(k.tokens===!0&&(Z.maxDepth=0,_(G)||z.push(ne),Z.tokens=z),k.parts===!0||k.tokens===!0){let Se;for(let U=0;U<j.length;U++){const H=Se?Se+1:D,re=j[U],V=A.slice(H,re);k.tokens&&(U===0&&D!==0?(z[U].isPrefix=!0,z[U].value=xe):z[U].value=V,E(z[U]),Z.maxDepth+=z[U].depth),(U!==0||V!=="")&&$.push(V),Se=re}if(Se&&Se+1<A.length){const U=A.slice(Se+1);$.push(U),k.tokens&&(z[z.length-1].value=U,E(z[z.length-1]),Z.maxDepth+=z[z.length-1].depth)}Z.slashes=j,Z.parts=$}return Z};i.exports=R},96:(i,o,s)=>{const{REGEX_BACKSLASH:a,REGEX_REMOVE_BACKSLASH:l,REGEX_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_GLOBAL:u}=s(154);o.isObject=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),o.hasRegexChars=d=>c.test(d),o.isRegexChar=d=>d.length===1&&o.hasRegexChars(d),o.escapeRegex=d=>d.replace(u,"\\$1"),o.toPosixSlashes=d=>d.replace(a,"/"),o.removeBackslashes=d=>d.replace(l,h=>h==="\\"?"":h),o.escapeLast=(d,h,f)=>{const p=d.lastIndexOf(h,f);return p===-1?d:d[p-1]==="\\"?o.escapeLast(d,h,p-1):`${d.slice(0,p)}\\${d.slice(p)}`},o.removePrefix=(d,h={})=>{let f=d;return f.startsWith("./")&&(f=f.slice(2),h.prefix="./"),f},o.wrapOutput=(d,h={},f={})=>{const p=f.contains?"":"^",g=f.contains?"":"$";let m=`${p}(?:${d})${g}`;return h.negated===!0&&(m=`(?:^(?!${m}).*$)`),m},o.basename=(d,{windows:h}={})=>{const f=d.split(h?/[\\/]/:"/"),p=f[f.length-1];return p===""?f[f.length-2]:p}}},e={};function n(i){var o=e[i];if(o!==void 0)return o.exports;var s=e[i]={exports:{}},a=!0;try{t[i](s,s.exports,n),a=!1}finally{a&&delete e[i]}return s.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(170);Sf.exports=r})()),Sf.exports}var Dv;function $4(){return Dv||(Dv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,s){for(var a in s)Object.defineProperty(o,a,{enumerable:!0,get:s[a]})}e(t,{hasLocalMatch:function(){return i},matchLocalPattern:function(){return r}});const n=hE();function r(o,s){if(o.search!==void 0&&o.search!==s.search)return!1;var a;return!!(0,n.makeRe)((a=o.pathname)!=null?a:"**",{dot:!0}).test(s.pathname)}function i(o,s){if(!o)return!0;const a=new URL(s,"http://n");return o.some(l=>r(l,a))}}(wf)),wf}var xf={},Nv;function B4(){return Nv||(Nv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,s){for(var a in s)Object.defineProperty(o,a,{enumerable:!0,get:s[a]})}e(t,{hasRemoteMatch:function(){return i},matchRemotePattern:function(){return r}});const n=hE();function r(o,s){if(o.protocol!==void 0){const l=s.protocol.slice(0,-1);if(o.protocol!==l)return!1}if(o.port!==void 0&&o.port!==s.port)return!1;if(o.hostname===void 0)throw new Error(`Pattern should define hostname but found
224
+ `+JSON.stringify(o));if(!(0,n.makeRe)(o.hostname).test(s.hostname)||o.search!==void 0&&o.search!==s.search)return!1;var a;return!!(0,n.makeRe)((a=o.pathname)!=null?a:"**",{dot:!0}).test(s.pathname)}function i(o,s,a){return o.some(l=>a.hostname===l)||s.some(l=>r(l,a))}}(xf)),xf}var jv;function pE(){return jv||(jv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});const e=75;function n(i){let{config:o,src:s,width:a,quality:l}=i;var c;if(process.env.NODE_ENV!=="production"){const d=[];if(s||d.push("src"),a||d.push("width"),d.length>0)throw new Error("Next Image Optimization requires "+d.join(", ")+" to be provided. Make sure you pass them as props to the `next/image` component. Received: "+JSON.stringify({src:s,width:a,quality:l}));if(s.startsWith("//"))throw new Error('Failed to parse src "'+s+'" on `next/image`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)');if(s.startsWith("/")&&o.localPatterns&&process.env.NODE_ENV!=="test"&&process.env.NEXT_RUNTIME!=="edge"){const{hasLocalMatch:h}=$4();if(!h(o.localPatterns,s))throw new Error("Invalid src prop ("+s+") on `next/image` does not match `images.localPatterns` configured in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns")}if(!s.startsWith("/")&&(o.domains||o.remotePatterns)){let h;try{h=new URL(s)}catch(f){throw console.error(f),new Error('Failed to parse src "'+s+'" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)')}if(process.env.NODE_ENV!=="test"&&process.env.NEXT_RUNTIME!=="edge"){const{hasRemoteMatch:f}=B4();if(!f(o.domains,o.remotePatterns,h))throw new Error("Invalid src prop ("+s+') on `next/image`, hostname "'+h.hostname+'" is not configured under images in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-host')}}if(l&&o.qualities&&!o.qualities.includes(l))throw new Error("Invalid quality prop ("+l+") on `next/image` does not match `images.qualities` configured in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-qualities")}const u=l||((c=o.qualities)==null?void 0:c.reduce((d,h)=>Math.abs(h-e)<Math.abs(d-e)?h:d))||e;return o.path+"?url="+encodeURIComponent(s)+"&w="+a+"&q="+u+(process.env.NEXT_DEPLOYMENT_ID?"&dpl="+process.env.NEXT_DEPLOYMENT_ID:"")}n.__next_img_default=!0;const r=n}(bf)),bf}(function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return w}});const n=Nt,r=Is(),i=Ps,o=r._(O),s=n._(ho),a=n._(F4()),l=Tg,c=eu,u=H4(),d=Zc,h=ap(),f=n._(pE()),p=process.env.__NEXT_IMAGE_OPTS;typeof window>"u"&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);function g(v,S,C,_,E,R,A){const T=v==null?void 0:v.src;if(!v||v["data-loaded-src"]===T)return;v["data-loaded-src"]=T,("decode"in v?v.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(!(!v.parentElement||!v.isConnected)){if(S!=="empty"&&E(!0),C!=null&&C.current){const P=new Event("load");Object.defineProperty(P,"target",{writable:!1,value:v});let M=!1,j=!1;C.current({...P,nativeEvent:P,currentTarget:v,target:v,isDefaultPrevented:()=>M,isPropagationStopped:()=>j,persist:()=>{},preventDefault:()=>{M=!0,P.preventDefault()},stopPropagation:()=>{j=!0,P.stopPropagation()}})}if(_!=null&&_.current&&_.current(v),process.env.NODE_ENV!=="production"){const P=new URL(T,"http://n").searchParams.get("url")||T;if(v.getAttribute("data-nimg")==="fill"){if(!R&&(!A||A==="100vw")&&v.getBoundingClientRect().width/window.innerWidth<.6&&(A==="100vw"?(0,d.warnOnce)('Image with src "'+P+'" has "fill" prop and "sizes" prop of "100vw", but image is not rendered at full viewport width. Please adjust "sizes" to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes'):(0,d.warnOnce)('Image with src "'+P+'" has "fill" but is missing "sizes" prop. Please add it to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes')),v.parentElement){const{position:z}=window.getComputedStyle(v.parentElement),$=["absolute","fixed","relative"];$.includes(z)||(0,d.warnOnce)('Image with src "'+P+'" has "fill" and parent element with invalid "position". Provided "'+z+'" should be one of '+$.map(String).join(",")+".")}v.height===0&&(0,d.warnOnce)('Image with src "'+P+'" has "fill" and a height value of 0. This is likely because the parent element of the image has not been styled to have a set height.')}const M=v.height.toString()!==v.getAttribute("height"),j=v.width.toString()!==v.getAttribute("width");(M&&!j||!M&&j)&&(0,d.warnOnce)('Image with src "'+P+`" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.`)}}})}function m(v){return o.use?{fetchPriority:v}:{fetchpriority:v}}const y=(0,o.forwardRef)((v,S)=>{let{src:C,srcSet:_,sizes:E,height:R,width:A,decoding:T,className:k,style:P,fetchPriority:M,placeholder:j,loading:z,unoptimized:$,fill:J,onLoadRef:K,onLoadingCompleteRef:D,setBlurComplete:Q,setShowAltText:se,sizesInput:oe,onLoad:de,onError:ue,...pe}=v;return(0,i.jsx)("img",{...pe,...m(M),loading:z,width:A,height:R,decoding:T,"data-nimg":J?"fill":"1",className:k,style:P,sizes:E,srcSet:_,src:C,ref:(0,o.useCallback)(L=>{S&&(typeof S=="function"?S(L):typeof S=="object"&&(S.current=L)),L&&(ue&&(L.src=L.src),process.env.NODE_ENV!=="production"&&(C||console.error('Image is missing required "src" property:',L),L.getAttribute("alt")===null&&console.error('Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.')),L.complete&&g(L,j,K,D,Q,$,oe))},[C,j,K,D,Q,ue,$,oe,S]),onLoad:L=>{const ce=L.currentTarget;g(ce,j,K,D,Q,$,oe)},onError:L=>{se(!0),j!=="empty"&&Q(!0),ue&&ue(L)}})});function x(v){let{isAppRouter:S,imgAttributes:C}=v;const _={as:"image",imageSrcSet:C.srcSet,imageSizes:C.sizes,crossOrigin:C.crossOrigin,referrerPolicy:C.referrerPolicy,...m(C.fetchPriority)};return S&&s.default.preload?(s.default.preload(C.src,_),null):(0,i.jsx)(a.default,{children:(0,i.jsx)("link",{rel:"preload",href:C.srcSet?void 0:C.src,..._},"__nimg-"+C.src+C.srcSet+C.sizes)})}const w=(0,o.forwardRef)((v,S)=>{const _=!(0,o.useContext)(h.RouterContext),E=(0,o.useContext)(u.ImageConfigContext),R=(0,o.useMemo)(()=>{var D;const Q=p||E||c.imageConfigDefault,se=[...Q.deviceSizes,...Q.imageSizes].sort((ue,pe)=>ue-pe),oe=Q.deviceSizes.sort((ue,pe)=>ue-pe),de=(D=Q.qualities)==null?void 0:D.sort((ue,pe)=>ue-pe);return{...Q,allSizes:se,deviceSizes:oe,qualities:de}},[E]),{onLoad:A,onLoadingComplete:T}=v,k=(0,o.useRef)(A);(0,o.useEffect)(()=>{k.current=A},[A]);const P=(0,o.useRef)(T);(0,o.useEffect)(()=>{P.current=T},[T]);const[M,j]=(0,o.useState)(!1),[z,$]=(0,o.useState)(!1),{props:J,meta:K}=(0,l.getImgProps)(v,{defaultLoader:f.default,imgConf:R,blurComplete:M,showAltText:z});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{...J,unoptimized:K.unoptimized,placeholder:K.placeholder,fill:K.fill,onLoadRef:k,onLoadingCompleteRef:P,setBlurComplete:j,setShowAltText:$,sizesInput:v.sizes,ref:S}),K.priority?(0,i.jsx)(x,{isAppRouter:_,imgAttributes:J}):null]})});(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})(Kh,Kh.exports);var V4=Kh.exports;(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}e(t,{default:function(){return a},getImageProps:function(){return s}});const n=Nt,r=Tg,i=V4,o=n._(pE());function s(l){const{props:c}=(0,r.getImgProps)(l,{defaultLoader:o.default,imgConf:process.env.__NEXT_IMAGE_OPTS});for(const[u,d]of Object.entries(c))d===void 0&&delete c[u];return{props:c}}const a=i.Image})(L4);N.ComponentManager.registerComponent("Editor.Image",I4);function Fv(t,e){return O.useCallback(r=>{const i=t.view;i.dispatch(i.state.tr.setNodeMarkup(e(),void 0,{...r})),t.commands.focus()},[t,e])}function z4({name:t,placeholder:e,...n}){return b.jsx(Je.Field,{name:t,children:({field:r,meta:i})=>b.jsx(P4,{...n,defaultValue:i.initialValue,onChange:o=>r.onChange({target:{name:t,value:o}})})})}function gE({children:t,...e}){return b.jsx(N.Tile,{scheme:"light",p:"5",...e,children:t})}function mE({name:t,...e}){return b.jsx(gE,{h:"min",...e,children:b.jsx(z4,{minH:"128",minW:"144",name:t,placeHolder:"Write here..."})})}function U4({queryId:t,api:e,children:n,...r}){const{data:i,isLoading:o,isError:s}=Pn(e.queryKey,e.get,t),a=mo(e.queryKey,t);return o?b.jsx(Br,{w:"full",h:"100%"}):s?b.jsx(_i,{p:"0",onClick:a}):b.jsx(Ec,{...r,children:n(i)})}const kg=O.forwardRef(U4);function yE({children:t,...e}){return b.jsx("div",{w:"112",minW:"112",minH:"100%",gap:"8",dflex:!0,flexCol:!0,...e,children:t})}function vE({title:t,children:e,...n}){return b.jsxs("div",{w:"full",bgColor:"white",rounded:!0,p:"5",textSize:"sm",...n,children:[t&&b.jsx(zE,{children:t}),e]})}function Mg({children:t,...e}){return b.jsx("div",{trait:"typo.h5",children:t})}function Pg({title:t,breadcrumbs:e,children:n,...r}){return b.jsxs(Cc,{gap:"3",minH:"9",...r,children:[t&&b.jsx(Mg,{children:t}),e&&b.jsx(cp,{breadcrumbs:e}),b.jsx("div",{flexGrow:!0}),n]})}const[q4,bE]=$e.createContext();function wE({children:t}){const[e,n]=O.useState(null);return O.createRef(),b.jsx(q4,{value:{containerEl:e,setContainerEl:n},children:t})}function SE({title:t,breadcrumbs:e,children:n,...r}){const i=O.createRef(),{setContainerEl:o}=bE(),[s,a]=O.useState(!1);return O.useEffect(()=>(!s&&i.current&&(o(i.current),a(!0)),()=>o(null)),[]),b.jsx(Cc,{gap:"3",minH:"9",...r,children:b.jsxs(b.Fragment,{children:[t&&b.jsx(Mg,{children:t}),e&&b.jsx(cp,{breadcrumbs:e}),b.jsx("div",{flexGrow:!0}),b.jsx("div",{ref:i,dflex:!0,flexRow:!0,gap:"3"}),n]})})}function xE({trackingRef:t,children:e}){const{containerEl:n}=bE(),[r,i]=O.useState(!1),o=O.useMemo(()=>n,[n]),s=n??(typeof window<"u"?document.body:void 0);O.useLayoutEffect(()=>{if(!(!o||!s)){try{r?s.appendChild(o):s.removeChild(o)}catch{}return()=>{try{s.removeChild(o)}catch{}}}},[r,o,s]);const a=O.useCallback(l=>{i(l[0].isVisible)},[e]);return O.useEffect(()=>{const l={root:null,rootMargin:"0px",threshold:0,trackVisibility:!0,delay:100},c=new IntersectionObserver(a,l);return t&&c.observe(t),()=>c.disconnect()},[t,a,e]),s&&o?ho.createPortal(e,o):null}function W4({tabbed:t,breadcrumbs:e,api:n,item:r,isLoading:i,buttonBar:o,trackingRef:s}){return b.jsxs(b.Fragment,{children:[t&&b.jsx(xE,{trackingRef:s,children:b.jsx(Hv,{api:n,item:r,isLoading:i,buttonBar:o})}),!t&&b.jsx(Pg,{breadcrumbs:e,children:b.jsx(Hv,{api:n,item:r,isLoading:i,buttonBar:o})})]})}function Hv({api:t,item:e,isLoading:n,buttonBar:r}){return b.jsxs(b.Fragment,{children:[r==null?void 0:r.map((i,o)=>b.jsxs(O.Fragment,{children:[i.type==="link"&&b.jsx(gw,{path:i.path,icon:i.icon}),i.type==="invalidate"&&b.jsx(mp,{pathOrPermalink:i.pathOrPermalink}),i.type=="custom"&&i.render(e)]},o)),b.jsx(Yb,{api:t,queryId:e.id,status:e.status,disabled:n}),b.jsx(pw,{disabled:n})]})}function K4({queryField:t,api:e,processInput:n,screen:r,tabbed:i,...o}){const{[t]:s}=Fn.useParams(),a=O.useRef(null);return b.jsx(kg,{api:e,queryId:s,ref:a,p:"5",...o,children:l=>b.jsx(G4,{item:l,screen:r,api:e,tabbed:i,processInput:n,containerRef:a})})}function G4({item:t,screen:e,api:n,processInput:r,tabbed:i,containerRef:o}){const{breadcrumbs:s,schema:a,initialValues:l,header:c,editorFooter:u,sections:d,buttonBar:h,editor:f,type:p,invalidateParentQueryKey:g}=$e.runIfFn(e,t),m=Ei(n.update,g??n.queryKey,{networkMode:"always"}),y=yc(m,{processInput:r,successMsg:w=>`${w.title} updated.`,errorMsg:(w,v)=>`Error updating ${v.title}: ${w}`});let x;return p=="post"?x="calc(1280px - 30rem)":p=="section"&&(x="calc(1280px - 22rem)"),b.jsxs(Sp,{initialValues:$e.runIfFn(l,t),validationSchema:a,onSubmit:y,enableReinitialize:!0,children:[b.jsx(W4,{tabbed:i,api:n,breadcrumbs:s,buttonBar:h,item:t,isLoading:m.isLoading,trackingRef:o==null?void 0:o.current}),b.jsxs(Ec,{w:x?"auto":"full",size:"x2",id:"pagecontainer",children:[c,b.jsxs("div",{dflex:!0,gap:"8",children:[b.jsxs("div",{dflex:!0,flexCol:!0,gap:"8",flexGrow:!0,children:[(f==null?void 0:f.type)!="textarea"&&b.jsx(mE,{name:"content",maxW:x,minW:"144"}),(f==null?void 0:f.type)=="textarea"&&b.jsx(vp,{name:f==null?void 0:f.name,maxW:x,minW:x,minH:"128",rows:25,bgColor:"white",border:"0",p:"5",textColor:"slate-800"}),u]}),b.jsx(yE,{children:d==null?void 0:d.map((w,v)=>b.jsx(J4,{section:w,item:t},v))})]})]})]})}function J4({section:t,item:e}){return t.type==="section"?b.jsx(vE,{title:t.title,children:b.jsx(mi,{form:$e.runIfFn(t.form,e)})}):t.type==="custom"?$e.runIfFn(t.component,e):null}function X4(t,e){const n=Fn.useParams();if(e===void 0)return{id:void 0,api:t};const{[e]:r}=n;return{id:r,api:$e.runIfFn(t,r)}}function Y4({api:t,queryField:e,fn:n,transformFn:r,config:i,tabbed:o,...s}){const{id:a,api:l}=X4(t,e),{data:c}=Pn(l.queryKey,n==="get"||n==="getTransformed"?l.get:l.getAll,$e.isFunction(t)?void 0:a),u=O.useMemo(()=>c&&(n==="getTransformed"||n==="getAllTransformed")?(r||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${n}`),r==null?void 0:r(c)):c,[c]);return c?b.jsx(nu,{config:i(u),tabbed:o,...s}):null}function Q4({queryField:t,api:e,screen:n,...r}){const{[t]:i}=Fn.useParams();return b.jsx(kg,{queryId:i,api:e,p:"5",children:o=>{const{breadcrumbs:s,tabs:a}=$e.runIfFn(n,o);return b.jsxs(wE,{children:[b.jsx(SE,{breadcrumbs:s,mb:"-3"}),b.jsx(kT,{tabs:a.map(l=>l.label),saveKey:`tab-${i}`,mt:"-3",mb:"3",id:"fff",children:a.map((l,c)=>b.jsx(Z4,{tab:l},c))})]})}})}function Z4({tab:t}){if(!t.component&&!t.config)throw new Error(`Screen config for tabbed view: one of your tabs does not have a component or config declared: ${t.label}`);return t.component?t.component():b.jsx(nu,{config:t.config,tabbed:!0,p:"0"})}/**
225
+ * table-core
226
+ *
227
+ * Copyright (c) TanStack
228
+ *
229
+ * This source code is licensed under the MIT license found in the
230
+ * LICENSE.md file in the root directory of this source tree.
231
+ *
232
+ * @license MIT
233
+ */function e$(){return{accessor:(t,e)=>typeof t=="function"?{...e,accessorFn:t}:{...e,accessorKey:t},display:t=>t,group:t=>t}}function Ar(t,e){return typeof t=="function"?t(e):t}function tn(t,e){return n=>{e.setState(r=>({...r,[t]:Ar(n,r[t])}))}}function tu(t){return t instanceof Function}function t$(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function n$(t,e){const n=[],r=i=>{i.forEach(o=>{n.push(o);const s=e(o);s!=null&&s.length&&r(s)})};return r(t),n}function ke(t,e,n){let r=[],i;return o=>{let s;n.key&&n.debug&&(s=Date.now());const a=t(o);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return i;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),i=e(...a),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,h=d/16,f=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${f(d,5)} /${f(u,5)} ms`,`
234
+ font-size: .6rem;
235
+ font-weight: bold;
236
+ color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Me(t,e,n,r){return{debug:()=>{var i;return(i=t==null?void 0:t.debugAll)!=null?i:t[e]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function r$(t,e,n,r){const i=()=>{var s;return(s=o.getValue())!=null?s:t.options.renderFallbackValue},o={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:i,getContext:ke(()=>[t,n,e,o],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Me(t.options,"debugCells","cell.getContext"))};return t._features.forEach(s=>{s.createCell==null||s.createCell(o,n,e,t)},{}),o}function i$(t,e,n,r){var i,o;const a={...t._getDefaultColumnDef(),...e},l=a.accessorKey;let c=(i=(o=a.id)!=null?o:l?l.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=h=>{let f=h;for(const g of l.split(".")){var p;f=(p=f)==null?void 0:p[g],process.env.NODE_ENV!=="production"&&f===void 0&&console.warn(`"${g}" in deeply nested key "${l}" returned undefined.`)}return f}:u=h=>h[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ke(()=>[!0],()=>{var h;return[d,...(h=d.columns)==null?void 0:h.flatMap(f=>f.getFlatColumns())]},Me(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ke(()=>[t._getOrderColumnsFn()],h=>{var f;if((f=d.columns)!=null&&f.length){let p=d.columns.flatMap(g=>g.getLeafColumns());return h(p)}return[d]},Me(t.options,"debugColumns","column.getLeafColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(d,t);return d}const Tt="debugHeaders";function $v(t,e,n){var r;let o={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(o),s},getContext:()=>({table:t,header:o,column:e})};return t._features.forEach(s=>{s.createHeader==null||s.createHeader(o,t)}),o}const o$={createTable:t=>{t.getHeaderGroups=ke(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>{var o,s;const a=(o=r==null?void 0:r.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?o:[],l=(s=i==null?void 0:i.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(i!=null&&i.includes(d.id)));return Ha(e,[...a,...c,...l],t)},Me(t.options,Tt,"getHeaderGroups")),t.getCenterHeaderGroups=ke(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Ha(e,n,t,"center")),Me(t.options,Tt,"getCenterHeaderGroups")),t.getLeftHeaderGroups=ke(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return Ha(e,o,t,"left")},Me(t.options,Tt,"getLeftHeaderGroups")),t.getRightHeaderGroups=ke(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return Ha(e,o,t,"right")},Me(t.options,Tt,"getRightHeaderGroups")),t.getFooterGroups=ke(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Me(t.options,Tt,"getFooterGroups")),t.getLeftFooterGroups=ke(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Me(t.options,Tt,"getLeftFooterGroups")),t.getCenterFooterGroups=ke(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Me(t.options,Tt,"getCenterFooterGroups")),t.getRightFooterGroups=ke(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Me(t.options,Tt,"getRightFooterGroups")),t.getFlatHeaders=ke(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Me(t.options,Tt,"getFlatHeaders")),t.getLeftFlatHeaders=ke(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Me(t.options,Tt,"getLeftFlatHeaders")),t.getCenterFlatHeaders=ke(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Me(t.options,Tt,"getCenterFlatHeaders")),t.getRightFlatHeaders=ke(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Me(t.options,Tt,"getRightFlatHeaders")),t.getCenterLeafHeaders=ke(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Me(t.options,Tt,"getCenterLeafHeaders")),t.getLeftLeafHeaders=ke(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Me(t.options,Tt,"getLeftLeafHeaders")),t.getRightLeafHeaders=ke(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Me(t.options,Tt,"getRightLeafHeaders")),t.getLeafHeaders=ke(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var i,o,s,a,l,c;return[...(i=(o=e[0])==null?void 0:o.headers)!=null?i:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Me(t.options,Tt,"getLeafHeaders"))}};function Ha(t,e,n,r){var i,o;let s=0;const a=function(h,f){f===void 0&&(f=1),s=Math.max(s,f),h.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,f+1)},0)};a(t);let l=[];const c=(h,f)=>{const p={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},g=[];h.forEach(m=>{const y=[...g].reverse()[0],x=m.column.depth===p.depth;let w,v=!1;if(x&&m.column.parent?w=m.column.parent:(w=m.column,v=!0),y&&(y==null?void 0:y.column)===w)y.subHeaders.push(m);else{const S=$v(n,w,{id:[r,f,w.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:v,placeholderId:v?`${g.filter(C=>C.column===w).length}`:void 0,depth:f,index:g.length});S.subHeaders.push(m),g.push(S)}p.headers.push(m),m.headerGroup=p}),l.push(p),f>0&&c(g,f-1)},u=e.map((h,f)=>$v(n,h,{depth:s,index:f}));c(u,s-1),l.reverse();const d=h=>h.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,m=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],d(p.subHeaders).forEach(w=>{let{colSpan:v,rowSpan:S}=w;g+=v,y.push(S)})):g=1;const x=Math.min(...y);return m=m+x,p.colSpan=g,p.rowSpan=m,{colSpan:g,rowSpan:m}});return d((i=(o=l[0])==null?void 0:o.headers)!=null?i:[]),l}const Ig=(t,e,n,r,i,o,s)=>{let a={id:e,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:t.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>n$(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ke(()=>[t.getAllLeafColumns()],l=>l.map(c=>r$(t,a,c,c.id)),Me(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ke(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Me(t.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<t._features.length;l++){const c=t._features[l];c==null||c.createRow==null||c.createRow(a,t)}return a},s$={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},CE=(t,e,n)=>{var r;const i=n.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};CE.autoRemove=t=>yn(t);const EE=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};EE.autoRemove=t=>yn(t);const _E=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};_E.autoRemove=t=>yn(t);const RE=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};RE.autoRemove=t=>yn(t)||!(t!=null&&t.length);const AE=(t,e,n)=>!n.some(r=>{var i;return!((i=t.getValue(e))!=null&&i.includes(r))});AE.autoRemove=t=>yn(t)||!(t!=null&&t.length);const OE=(t,e,n)=>n.some(r=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(r)});OE.autoRemove=t=>yn(t)||!(t!=null&&t.length);const TE=(t,e,n)=>t.getValue(e)===n;TE.autoRemove=t=>yn(t);const kE=(t,e,n)=>t.getValue(e)==n;kE.autoRemove=t=>yn(t);const Lg=(t,e,n)=>{let[r,i]=n;const o=t.getValue(e);return o>=r&&o<=i};Lg.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,o=e===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(i)?1/0:i;if(o>s){const a=o;o=s,s=a}return[o,s]};Lg.autoRemove=t=>yn(t)||yn(t[0])&&yn(t[1]);const Yn={includesString:CE,includesStringSensitive:EE,equalsString:_E,arrIncludes:RE,arrIncludesAll:AE,arrIncludesSome:OE,equals:TE,weakEquals:kE,inNumberRange:Lg};function yn(t){return t==null||t===""}const a$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:tn("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);return typeof r=="string"?Yn.includesString:typeof r=="number"?Yn.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Yn.equals:Array.isArray(r)?Yn.arrIncludes:Yn.weakEquals},t.getFilterFn=()=>{var n,r;return tu(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:Yn[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const i=t.getFilterFn(),o=r==null?void 0:r.find(u=>u.id===t.id),s=Ar(n,o?o.value:void 0);if(Bv(i,s,t)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==t.id))!=null?a:[]}const l={id:t.id,value:s};if(o){var c;return(c=r==null?void 0:r.map(u=>u.id===t.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=i=>{var o;return(o=Ar(e,i))==null?void 0:o.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(Bv(l,s.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function Bv(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const l$=(t,e,n)=>n.reduce((r,i)=>{const o=i.getValue(t);return r+(typeof o=="number"?o:0)},0),c$=(t,e,n)=>{let r;return n.forEach(i=>{const o=i.getValue(t);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},u$=(t,e,n)=>{let r;return n.forEach(i=>{const o=i.getValue(t);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},d$=(t,e,n)=>{let r,i;return n.forEach(o=>{const s=o.getValue(t);s!=null&&(r===void 0?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}),[r,i]},f$=(t,e)=>{let n=0,r=0;if(e.forEach(i=>{let o=i.getValue(t);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},h$=(t,e)=>{if(!e.length)return;const n=e.map(o=>o.getValue(t));if(!t$(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,s)=>o-s);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},p$=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),g$=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,m$=(t,e)=>e.length,Cf={sum:l$,min:c$,max:u$,extent:d$,mean:f$,median:h$,unique:p$,uniqueCount:g$,count:m$},y$={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:tn("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);if(typeof r=="number")return Cf.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Cf.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return tu(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:Cf[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function v$(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(o=>!e.includes(o.id));return n==="remove"?r:[...e.map(o=>t.find(s=>s.id===o)).filter(Boolean),...r]}const b$={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:tn("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=ke(n=>[is(e,n)],n=>n.findIndex(r=>r.id===t.id),Me(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var r;return((r=is(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const i=is(e,n);return((r=i[i.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=ke(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>i=>{let o=[];if(!(e!=null&&e.length))o=i;else{const s=[...e],a=[...i];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return v$(o,n,r)},Me(t.options,"debugTable","_getOrderColumnsFn"))}},Ef=()=>({left:[],right:[]}),w$={getInitialState:t=>({columnPinning:Ef(),...t}),getDefaultOptions:t=>({onColumnPinningChange:tn("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var o,s;if(n==="right"){var a,l;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=i==null?void 0:i.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=i==null?void 0:i.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=i==null?void 0:i.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var i,o,s;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(s=e.options.enableColumnPinning)!=null?s:e.options.enablePinning)!=null?o:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:r,right:i}=e.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"left":s?"right":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();return i?(n=(r=e.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=ke(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(s=>!o.includes(s.column.id))},Me(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=ke(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Me(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=ke(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Me(e.options,"debugRows","getRightVisibleCells"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Ef():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Ef())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=ke(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),Me(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=ke(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),Me(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=ke(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const i=[...n??[],...r??[]];return e.filter(o=>!i.includes(o.id))},Me(t.options,"debugColumns","getCenterLeafColumns"))}},$a={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},_f=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),S$={getDefaultColumnDef:()=>$a,getInitialState:t=>({columnSizing:{},columnSizingInfo:_f(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:tn("columnSizing",t),onColumnSizingInfoChange:tn("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,i;const o=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:$a.minSize,(r=o??t.columnDef.size)!=null?r:$a.size),(i=t.columnDef.maxSize)!=null?i:$a.maxSize)},t.getStart=ke(n=>[n,is(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Me(e.options,"debugColumns","getStart")),t.getAfter=ke(n=>[n,is(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Me(e.options,"debugColumns","getAfter")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...i}=n;return i})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),i=r==null?void 0:r.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),Rf(o)&&o.touches&&o.touches.length>1))return;const s=t.getSize(),a=t?t.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],l=Rf(o)?Math.round(o.touches[0].clientX):o.clientX,c={},u=(y,x)=>{typeof x=="number"&&(e.setColumnSizingInfo(w=>{var v,S;const C=e.options.columnResizeDirection==="rtl"?-1:1,_=(x-((v=w==null?void 0:w.startOffset)!=null?v:0))*C,E=Math.max(_/((S=w==null?void 0:w.startSize)!=null?S:0),-.999999);return w.columnSizingStart.forEach(R=>{let[A,T]=R;c[A]=Math.round(Math.max(T+T*E,0)*100)/100}),{...w,deltaOffset:_,deltaPercentage:E}}),(e.options.columnResizeMode==="onChange"||y==="end")&&e.setColumnSizing(w=>({...w,...c})))},d=y=>u("move",y),h=y=>{u("end",y),e.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=n||typeof document<"u"?document:null,p={moveHandler:y=>d(y.clientX),upHandler:y=>{f==null||f.removeEventListener("mousemove",p.moveHandler),f==null||f.removeEventListener("mouseup",p.upHandler),h(y.clientX)}},g={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var x;f==null||f.removeEventListener("touchmove",g.moveHandler),f==null||f.removeEventListener("touchend",g.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),h((x=y.touches[0])==null?void 0:x.clientX)}},m=x$()?{passive:!1}:!1;Rf(o)?(f==null||f.addEventListener("touchmove",g.moveHandler,m),f==null||f.addEventListener("touchend",g.upHandler,m)):(f==null||f.addEventListener("mousemove",p.moveHandler,m),f==null||f.addEventListener("mouseup",p.upHandler,m)),e.setColumnSizingInfo(y=>({...y,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?_f():(n=t.initialState.columnSizingInfo)!=null?n:_f())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0}}};let Ba=null;function x$(){if(typeof Ba=="boolean")return Ba;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Ba=t,Ba}function Rf(t){return t.type==="touchstart"}const C$={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:tn("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const i=t.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=ke(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Me(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=ke(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Me(e.options,"debugRows","getVisibleCells"))},createTable:t=>{const e=(n,r)=>ke(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Me(t.options,"debugColumns",n));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function is(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const E$={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},_$={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:tn("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,i,o;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((o=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?o:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Yn.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return tu(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:Yn[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},R$={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:tn("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var i,o;t.setExpanded(r?{}:(i=(o=t.initialState)==null?void 0:o.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[t.id]);let s={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(i=n)!=null?i:!o,!o&&n)return{...s,[t.id]:!0};if(o&&!n){const{[t.id]:a,...l}=s;return l}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r!=null&&r[t.id])},t.getCanExpand=()=>{var n,r,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Gh=0,Jh=10,Af=()=>({pageIndex:Gh,pageSize:Jh}),A$={getInitialState:t=>({...t,pagination:{...Af(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:tn("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const i=o=>Ar(r,o);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=r=>{var i;t.setPagination(r?Af():(i=t.initialState.pagination)!=null?i:Af())},t.setPageIndex=r=>{t.setPagination(i=>{let o=Ar(r,i.pageIndex);const s=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...i,pageIndex:o}})},t.resetPageIndex=r=>{var i,o;t.setPageIndex(r?Gh:(i=(o=t.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:Gh)},t.resetPageSize=r=>{var i,o;t.setPageSize(r?Jh:(i=(o=t.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:Jh)},t.setPageSize=r=>{t.setPagination(i=>{const o=Math.max(1,Ar(r,i.pageSize)),s=i.pageSize*i.pageIndex,a=Math.floor(s/o);return{...i,pageIndex:a,pageSize:o}})},t.setPageCount=r=>t.setPagination(i=>{var o;let s=Ar(r,(o=t.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),t.getPageOptions=ke(()=>[t.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},Me(t.options,"debugTable","getPageOptions")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:r<i-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},Of=()=>({top:[],bottom:[]}),O$={getInitialState:t=>({rowPinning:Of(),...t}),getDefaultOptions:t=>({onRowPinningChange:tn("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,i)=>{const o=r?t.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=i?t.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,t.id,...o]);e.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,h;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var f,p;return{top:[...((f=l==null?void 0:l.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=e.options;return typeof r=="function"?r(t):(n=r??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:i}=e.getState().rowPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"top":s?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();if(!i)return-1;const o=(n=e._getPinnedRows(i))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=o==null?void 0:o.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?Of():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Of())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=ke(e=>[t.getRowModel().rows,t.getState().rowPinning[e],e],(e,n,r)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(s=>{const a=t.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>e.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},Me(t.options,"debugRows","_getPinnedRows")),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=ke(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const i=new Set([...n??[],...r??[]]);return e.filter(o=>!i.has(o.id))},Me(t.options,"debugRows","getCenterRows"))}},T$={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:tn("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(o=>{Xh(i,o.id,r,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=ke(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Tf(t,n):{rows:[],flatRows:[],rowsById:{}},Me(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=ke(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Tf(t,n):{rows:[],flatRows:[],rowsById:{}},Me(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=ke(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Tf(t,n):{rows:[],flatRows:[],rowsById:{}},Me(t.options,"debugTable","getGroupedSelectedRowModel")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(i=>!n[i.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const i=t.getIsSelected();e.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return o;const a={...o};return Xh(a,t.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Dg(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Yh(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Yh(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var i;n&&t.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},Xh=(t,e,n,r,i)=>{var o;const s=i.getRow(e,!0);n?(s.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),s.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Xh(t,a.id,n,r,i))};function Tf(t,e){const n=t.getState().rowSelection,r=[],i={},o=function(s,a){return s.map(l=>{var c;const u=Dg(l,n);if(u&&(r.push(l),i[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),u)return l}).filter(Boolean)};return{rows:o(e.rows),flatRows:r,rowsById:i}}function Dg(t,e){var n;return(n=e[t.id])!=null?n:!1}function Yh(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return t.subRows.forEach(s=>{if(!(o&&!i)&&(s.getCanSelect()&&(Dg(s,e)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=Yh(s,e);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const Qh=/([0-9]+)/gm,k$=(t,e,n)=>ME(jr(t.getValue(n)).toLowerCase(),jr(e.getValue(n)).toLowerCase()),M$=(t,e,n)=>ME(jr(t.getValue(n)),jr(e.getValue(n))),P$=(t,e,n)=>Ng(jr(t.getValue(n)).toLowerCase(),jr(e.getValue(n)).toLowerCase()),I$=(t,e,n)=>Ng(jr(t.getValue(n)),jr(e.getValue(n))),L$=(t,e,n)=>{const r=t.getValue(n),i=e.getValue(n);return r>i?1:r<i?-1:0},D$=(t,e,n)=>Ng(t.getValue(n),e.getValue(n));function Ng(t,e){return t===e?0:t>e?1:-1}function jr(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function ME(t,e){const n=t.split(Qh).filter(Boolean),r=e.split(Qh).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),s=parseInt(i,10),a=parseInt(o,10),l=[s,a].sort();if(isNaN(l[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Io={alphanumeric:k$,alphanumericCaseSensitive:M$,text:P$,textCaseSensitive:I$,datetime:L$,basic:D$},N$={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:tn("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(t.id);if(Object.prototype.toString.call(o)==="[object Date]")return Io.datetime;if(typeof o=="string"&&(r=!0,o.split(Qh).length>1))return Io.alphanumeric}return r?Io.text:Io.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return tu(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Io[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const i=t.getNextSortingOrder(),o=typeof n<"u"&&n!==null;e.setSorting(s=>{const a=s==null?void 0:s.find(f=>f.id===t.id),l=s==null?void 0:s.findIndex(f=>f.id===t.id);let c=[],u,d=o?n:i==="desc";if(s!=null&&s.length&&t.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(o||i||(u="remove")),u==="add"){var h;c=[...s,{id:t.id,desc:d}],c.splice(0,c.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(f=>f.id===t.id?{...f,desc:d}:f):u==="remove"?c=s.filter(f=>f.id!==t.id):c=[{id:t.id,desc:d}];return c})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,i;const o=t.getFirstSortDir(),s=t.getIsSorted();return s?s!==o&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":o},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},j$=[o$,C$,b$,w$,s$,a$,E$,_$,N$,y$,R$,A$,O$,T$,S$];function F$(t){var e,n;process.env.NODE_ENV!=="production"&&(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");const r=[...j$,...(e=t._features)!=null?e:[]];let i={_features:r};const o=i._features.reduce((h,f)=>Object.assign(h,f.getDefaultOptions==null?void 0:f.getDefaultOptions(i)),{}),s=h=>i.options.mergeOptions?i.options.mergeOptions(o,h):{...o,...h};let l={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(h=>{var f;l=(f=h.getInitialState==null?void 0:h.getInitialState(l))!=null?f:l});const c=[];let u=!1;const d={_features:r,options:{...o,...t},initialState:l,_queue:h=>{c.push(h),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const f=Ar(h,i.options);i.options=s(f)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,f,p)=>{var g;return(g=i.options.getRowId==null?void 0:i.options.getRowId(h,f,p))!=null?g:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,f)=>{let p=(f?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!p&&(p=i.getCoreRowModel().rowsById[h],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return p},_getDefaultColumnDef:ke(()=>[i.options.defaultColumn],h=>{var f;return h=(f=h)!=null?f:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,m;return(g=(m=p.renderValue())==null||m.toString==null?void 0:m.toString())!=null?g:null},...i._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...h}},Me(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:ke(()=>[i._getColumnDefs()],h=>{const f=function(p,g,m){return m===void 0&&(m=0),p.map(y=>{const x=i$(i,y,m,g),w=y;return x.columns=w.columns?f(w.columns,x,m+1):[],x})};return f(h)},Me(t,"debugColumns","getAllColumns")),getAllFlatColumns:ke(()=>[i.getAllColumns()],h=>h.flatMap(f=>f.getFlatColumns()),Me(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ke(()=>[i.getAllFlatColumns()],h=>h.reduce((f,p)=>(f[p.id]=p,f),{}),Me(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ke(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,f)=>{let p=h.flatMap(g=>g.getLeafColumns());return f(p)},Me(t,"debugColumns","getAllLeafColumns")),getColumn:h=>{const f=i._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${h}' does not exist.`),f}};Object.assign(i,d);for(let h=0;h<i._features.length;h++){const f=i._features[h];f==null||f.createTable==null||f.createTable(i)}return i}function H$(){return t=>ke(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,s){o===void 0&&(o=0);const a=[];for(let c=0;c<i.length;c++){const u=Ig(t,t._getRowId(i[c],c,s),i[c],c,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var l;u.originalSubRows=t.options.getSubRows(i[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,o+1,u))}}return a};return n.rows=r(e),n},Me(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function $$(t,e,n){return n.options.filterFromLeafRows?B$(t,e,n):V$(t,e,n)}function B$(t,e,n){var r;const i=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let h=0;h<l.length;h++){var d;let f=l[h];const p=Ig(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(p.columnFilters=f.columnFilters,(d=f.subRows)!=null&&d.length&&c<s){if(p.subRows=a(f.subRows,c+1),f=p,e(f)&&!p.subRows.length){u.push(f),o[f.id]=f,i.push(f);continue}if(e(f)||p.subRows.length){u.push(f),o[f.id]=f,i.push(f);continue}}else f=p,e(f)&&(u.push(f),o[f.id]=f,i.push(f))}return u};return{rows:a(t),flatRows:i,rowsById:o}}function V$(t,e,n){var r;const i=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let h=0;h<l.length;h++){let f=l[h];if(e(f)){var d;if((d=f.subRows)!=null&&d.length&&c<s){const g=Ig(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);g.subRows=a(f.subRows,c+1),f=g}u.push(f),i.push(f),o[f.id]=f}}return u};return{rows:a(t),flatRows:i,rowsById:o}}function z$(){return t=>ke(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h<e.flatRows.length;h++)e.flatRows[h].columnFilters={},e.flatRows[h].columnFiltersMeta={};return e}const i=[],o=[];(n??[]).forEach(h=>{var f;const p=t.getColumn(h.id);if(!p)return;const g=p.getFilterFn();if(!g){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}i.push({id:h.id,filterFn:g,resolvedValue:(f=g.resolveFilterValue==null?void 0:g.resolveFilterValue(h.value))!=null?f:h.value})});const s=(n??[]).map(h=>h.id),a=t.getGlobalFilterFn(),l=t.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.forEach(h=>{var f;o.push({id:h.id,filterFn:a,resolvedValue:(f=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?f:r})}));let c,u;for(let h=0;h<e.flatRows.length;h++){const f=e.flatRows[h];if(f.columnFilters={},i.length)for(let p=0;p<i.length;p++){c=i[p];const g=c.id;f.columnFilters[g]=c.filterFn(f,g,c.resolvedValue,m=>{f.columnFiltersMeta[g]=m})}if(o.length){for(let p=0;p<o.length;p++){u=o[p];const g=u.id;if(u.filterFn(f,g,u.resolvedValue,m=>{f.columnFiltersMeta[g]=m})){f.columnFilters.__global__=!0;break}}f.columnFilters.__global__!==!0&&(f.columnFilters.__global__=!1)}}const d=h=>{for(let f=0;f<s.length;f++)if(h.columnFilters[s[f]]===!1)return!1;return!0};return $$(e.rows,d,t)},Me(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}/**
237
+ * react-table
238
+ *
239
+ * Copyright (c) TanStack
240
+ *
241
+ * This source code is licensed under the MIT license found in the
242
+ * LICENSE.md file in the root directory of this source tree.
243
+ *
244
+ * @license MIT
245
+ */function PE(t,e){return t?U$(t)?pi.createElement(t,e):t:null}function U$(t){return q$(t)||typeof t=="function"||W$(t)}function q$(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function W$(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function K$(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=pi.useState(()=>({current:F$(e)})),[r,i]=pi.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...t,state:{...r,...t.state},onStateChange:s=>{i(s),t.onStateChange==null||t.onStateChange(s)}})),n.current}function Ni(t,e,n){let r=n.initialDeps??[],i;function o(){var s,a,l,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const d=t();if(!(d.length!==r.length||d.some((p,g)=>r[g]!==p)))return i;r=d;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),i=e(...d),n.key&&((l=n.debug)!=null&&l.call(n))){const p=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-f)*100)/100,m=g/16,y=(x,w)=>{for(x=String(x);x.length<w;)x=" "+x;return x};console.info(`%c⏱ ${y(g,5)} /${y(p,5)} ms`,`
246
+ font-size: .6rem;
247
+ font-weight: bold;
248
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,i),i}return o.updateDeps=s=>{r=s},o}function kf(t,e){if(t===void 0)throw new Error(`Unexpected undefined${e?`: ${e}`:""}`);return t}const G$=(t,e)=>Math.abs(t-e)<1,J$=(t,e,n)=>{let r;return function(...i){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,i),n)}},X$=t=>t,Y$=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let i=e;i<=n;i++)r.push(i);return r},Q$=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const i=s=>{const{width:a,height:l}=s;e({width:Math.round(a),height:Math.round(l)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){i({width:c.inlineSize,height:c.blockSize});return}}i(n.getBoundingClientRect())};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Vv={passive:!0},zv=typeof window>"u"?!0:"onscrollend"in window,Z$=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let i=0;const o=t.options.useScrollendEvent&&zv?()=>{}:J$(r,()=>{e(i,!1)},t.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:d,isRtl:h}=t.options;i=d?n.scrollLeft*(h&&-1||1):n.scrollTop,o(),e(i,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,Vv);const c=t.options.useScrollendEvent&&zv;return c&&n.addEventListener("scrollend",l,Vv),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},eB=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},tB=(t,{adjustments:e=0,behavior:n},r)=>{var i,o;const s=t+e;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class nB{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{const s=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:X$,rangeExtractor:Y$,onChange:()=>{},measureElement:eB,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Ni(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,o=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(i.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Ni(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=Ni(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=o(u),h=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),f=h?h.end+this.options.gap:r+i,p=a.get(d),g=typeof p=="number"?p:this.options.estimateSize(u),m=f+g,y=h?h.lane:u%this.options.lanes;c[u]={index:u,start:f,size:g,end:m,key:d,lane:y}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ni(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,o)=>this.range=n.length>0&&r>0?rB({measurements:n,outerSize:r,scrollOffset:i,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Ni(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,o,s)=>o===null||s===null?[]:n({startIndex:o,endIndex:s,overscan:r,count:i}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),o=this.measurementsCache[i];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const o=this.itemSizeCache.get(i.key)??i.size,s=r-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,s,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=Ni(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let o=0,s=n.length;o<s;o++){const a=n[o],l=r[a];i.push(l)}return i},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return kf(r[IE(0,r.length-1,i=>kf(r[i]).start,n)])},this.getOffsetForAlignment=(n,r,i=0)=>{const o=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+o?"end":"start"),r==="center"?n+=(i-o)/2:r==="end"&&(n-=o);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-o;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const o=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)r="end";else if(i.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,i.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(n,r);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=kf(this.getOffsetForIndex(n,a));G$(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:i})}else this.scrollToIndex(n,{align:a,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((n=r[r.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>0&&o.some(a=>a===null);){const a=r[s];o[a.lane]===null&&(o[a.lane]=a.end),s--}i=Math.max(...o.filter(a=>a!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const IE=(t,e,n,r)=>{for(;t<=e;){const i=(t+e)/2|0,o=n(i);if(o<r)t=i+1;else if(o>r)e=i-1;else return i}return t>0?t-1:0};function rB({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const i=t.length-1;let s=IE(0,i,l=>t[l].start,n),a=s;if(r===1)for(;a<i&&t[a].end<n+e;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<i&&l.some(u=>u<n+e);){const u=t[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+e);for(;s>0&&c.some(u=>u>=n);){const u=t[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(i,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const Uv=typeof document<"u"?pi.useLayoutEffect:pi.useEffect;function iB(t){const e=pi.useReducer(()=>({}),{})[1],n={...t,onChange:(i,o)=>{var s;o?ho.flushSync(e):e(),(s=t.onChange)==null||s.call(t,i,o)}},[r]=pi.useState(()=>new nB(n));return r.setOptions(n),Uv(()=>r._didMount(),[]),Uv(()=>r._willUpdate()),r}function oB(t){return iB({observeElementRect:Q$,observeElementOffset:Z$,scrollToFn:tB,...t})}function sB(t,e){const{rows:n}=t.getRowModel(),r=oB({getScrollElement:()=>e,count:n.length,estimateSize:()=>35,overscan:10});return{rows:n,virtualRows:r.getVirtualItems(),totalSize:r.getTotalSize(),virtualizer:r}}function aB(t,e){const n=t.getIsPinned(),r=n==="left"&&t.getIsLastColumn("left"),i=n==="right"&&t.getIsFirstColumn("right");return{shadow:r?"-2px 0 2px -2px gray inset":i?"2px 0 2px -2px gray inset":void 0,start:n==="left"?`${t.getStart("left")}px`:void 0,end:n==="right"?`${t.getAfter("right")}px`:void 0,position:n?"sticky":"relative",w:t.getSize(),z:n?1:0,bgColor:n?e?"gray.50":"white":e?"gray.50":void 0}}function lB({table:t,containerRef:e,onRowClick:n,disabledRow:r}){var u,d;const{rows:i,virtualRows:o,totalSize:s,virtualizer:a}=sB(t,e),l=o.length>0&&((u=o==null?void 0:o[0])==null?void 0:u.start)||0,c=o.length>0?s-(((d=o==null?void 0:o[o.length-1])==null?void 0:d.end)||0):0;return b.jsxs("tbody",{children:[l>0&&b.jsx("tr",{children:b.jsx("td",{h:`${l}px`})}),o.map(h=>{const f=i[h.index],p=cB(f.original,r);return b.jsx("tr",{borderB:"px",borderBColor:"#F4F4F4",borderStyle:"dashed",hover_bgColor:"slate-50",cursor:n?"pointer":"default",onClick:n?()=>n(f.original):void 0,w:"fit-content",group:!0,children:f.getVisibleCells().map((g,m)=>b.jsx("td",{px:"3",py:"2",textSize:"sm",textColor:p?"gray.400":"gray.700",fontWeight:"500",borderTColor:"--bg-3",borderT:"0.5",cursor:n&&!p?"pointer":"default",w:`${g.column.getSize()}px`,groupHover_bgColor:p?void 0:"gray.100",...aB(g.column,p),children:PE(g.column.columnDef.cell,g.getContext())},g.id))},f.id)}),c>0&&b.jsx("tr",{children:b.jsx("td",{h:`${c}px`})})]})}function cB(t,e){return e?typeof e=="string"?t[e]:e(t):!1}function uB({headers:t}){const e=$e.useThemeAwareColor("slate-500","slate-700");return b.jsx("thead",{children:t.map(n=>b.jsx("tr",{w:"fit",children:n.headers.map(r=>b.jsx("th",{position:"relative",colSpan:r.colSpan,textAlign:"start",fontWeight:"600",textColor:e,px:"3",py:"2",textSize:"sm",w:`${r.getSize()}px`,children:b.jsxs("div",{dflex:!0,flexRow:!0,children:[r.isPlaceholder?null:b.jsxs(b.Fragment,{children:[PE(r.column.columnDef.header,r.getContext()),b.jsx("span",{cursor:r.column.getCanSort()?"pointer":"default",onClick:r.column.getToggleSortingHandler(),opacity:"0",hover_opacity:"100",flexGrow:!0,textAlign:"end",children:{asc:b.jsx(b.Fragment,{children:" ▲"}),desc:b.jsx(b.Fragment,{children:" ▼"})}[r.column.getIsSorted()]??b.jsx(b.Fragment,{children:" ▲"})})]}),b.jsx("div",{onMouseDown:r.getResizeHandler(),onTouchStart:r.getResizeHandler(),onClick:i=>{i.preventDefault(),i.stopPropagation()},position:"absolute",end:"0",top:"0",h:"full",w:"2",bgColor:r.column.getIsResizing()?"primary-500":"slate-900",bgOpacity:r.column.getIsResizing()?"70":"30",cursor:"col-resize",userSelect:"none",style:{touchAction:"none"},opacity:r.column.getIsResizing()?"100":"0",hover_opacity:"100"})]})},r.id))},n.id))})}const[iV,jg]=$e.createContext();function LE({page:t,...e}){const{pageSize:n,pageIndex:r,setPagination:i}=jg(),o=O.useCallback(()=>i({pageIndex:1,pageSize:n}),[n,i]);return b.jsxs("div",{dflex:!0,flexCol:!0,gap:"10",w:"full",h:"full",alignItems:"center",placeContent:"center",py:"16",...e,children:[b.jsx(N.Icon,{path:d_,w:"24",h:"24",textColor:"gray.400"}),b.jsx("div",{textSize:"xl",textColor:"gray.600",children:"No Data"}),t>1&&b.jsx(N.Button,{onClick:o,children:"Back To First Page"})]})}function dB({table:t,isLoading:e}){const n=t.getPageCount(),r=t.getState().pagination.pageIndex+1,i=fB(r,n,5);return b.jsxs(b.Fragment,{children:[n<2&&b.jsx(b.Fragment,{}),n>1&&b.jsx(b.Fragment,{children:b.jsxs("div",{dflex:!0,flexRow:!0,spaceX:"2",py:"2",children:[b.jsx(ji,{onClick:()=>t.setPageIndex(0),disabled:e||r==1,children:b.jsx(N.Icon,{path:e_})}),b.jsx(ji,{onClick:()=>t.previousPage(),disabled:e||r==1,children:b.jsx(N.Icon,{path:r_})}),i.length>0&&i[0]>1&&b.jsx("a",{children:"..."}),i.map(o=>b.jsx(ji,{onClick:()=>t.setPageIndex(o-1),disabled:e,variant:r==o?"default":"glass",scheme:"secondary",children:o},o)),i.length>0&&i[i.length-1]<n&&b.jsx(ji,{disabled:e,children:"..."}),b.jsx(ji,{onClick:()=>t.nextPage(),disabled:e||!t.getCanNextPage(),children:b.jsx(N.Icon,{path:i_})}),b.jsx(ji,{onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:e||!t.getCanNextPage(),children:b.jsx(N.Icon,{path:t_})})]})})]})}function ji({...t}){return b.jsx(N.Button,{scheme:"secondary",variant:"glass",corners:"pill",w:"8",h:"8",p:"0",dflex:!0,alignItems:"center",placeContent:"center",...t})}function fB(t,e,n){const r=[];if(!t)return r;if(e===1)return r.push(1),r;if(e<t)return r;if(e<n+1){for(let o=1;o<e+1;o++)r.push(o);return r}if(t===1){for(let o=1;o<n+1;o++)o<e&&r.push(o);return r}if(t===e){for(let o=e-n+1;o<=e;o++)o<=e&&r.push(o);return r}const i=Math.floor(n/2);if(i<1)return r.push(t),r;if(t<i+2){for(let o=1;o<n+1;o++)r.push(o);return r}if(e-t<i+2){for(let o=e-n;o<e+1;o++)r.push(o);return r}for(let o=t-i;o<t;o++)o>0&&r.push(o);r.push(t);for(let o=t+1;o<t+i+1;o++)o<=e&&r.push(o);return r}const hB=[{label:"25",value:25},{label:"50",value:50},{label:"100",value:100}];function pB({table:t,total:e,isLoading:n,reverseOrder:r,sizePerPageList:i}){const o=t.getState().pagination.pageIndex,s=t.getState().pagination.pageSize;return b.jsxs("div",{dflex:!0,flexDirection:r?"row-reverse":"row",alignItems:"center",py:"3",spaceX:"3",children:[b.jsx(N.Select,{disabled:e===0||n,onChange:a=>t.setPageSize(Number(a.target.value)),value:s,w:"20",children:(i??hB).map(a=>{const l=s===a.value;return b.jsx("option",{value:a.value,className:`btn ${l?"active":""}`,children:a.label},a.label)})}),b.jsxs("div",{children:["Showing rows ",1+o*s," to ",Math.min((o+1)*s,e)," of ",e]}),n&&b.jsx(N.Spinner,{size:"sm"})]})}function DE({isLoading:t,table:e,total:n,show:r,toolbarPosition:i="both",reverseOrder:o=!1,sizePerPageList:s,children:a,...l}){return b.jsxs("div",{...l,children:[r&&["top","both"].includes(i)&&b.jsx(qv,{isLoading:t,table:e,total:n,reverseOrder:o,sizePerPageList:s}),a,r&&["bottom","both"].includes(i)&&b.jsx(qv,{isLoading:t,table:e,total:n,reverseOrder:o,sizePerPageList:s})]})}function qv({isLoading:t,table:e,total:n,reverseOrder:r,sizePerPageList:i}){return b.jsxs("div",{dflex:!0,justifyContent:"between",alignItems:"center",flexWrap:!0,flexDirection:r?"row-reverse":"row",children:[b.jsx(pB,{isLoading:t,table:e,total:n,reverseOrder:r,sizePerPageList:i}),b.jsx("div",{className:"d-flex flex-wrap"}),b.jsx(dB,{isLoading:t,table:e})]})}const[oV,NE]=$e.createContext();function gB(t,e,n){const{setPagination:r}=jg(),{sortBy:i,sortDir:o,setSorting:s}=NE(),[a,l]=O.useState((n==null?void 0:n.rowSelection)??{}),c=O.useCallback(h=>{var f;l(h),(f=n==null?void 0:n.onSelectionChange)==null||f.call(n,$e.runIfFn(h,a))},[l,a]),u=O.useCallback(h=>{var f;if(n!=null&&n.enableSelection&&(n!=null&&n.enableSelectOnRowClick)){h.toggleSelected();return}(f=n==null?void 0:n.onRowClick)==null||f.call(n,h.original)},[]);return{table:K$(Do({data:t??[],getRowId:h=>h.id,columns:e,columnResizeMode:"onChange",enableColumnResizing:!0,enableSortingRemoval:!1,defaultColumn:{size:150,minSize:40,maxSize:1e3},state:{sorting:[{id:i,desc:o==="desc"}],rowSelection:a},filterFns:{},enableRowSelection:n==null?void 0:n.enableSelection,onRowSelectionChange:c,onSortingChange:s,getCoreRowModel:H$(),getFilteredRowModel:z$(),onPaginationChange:r},n==null?void 0:n.tableOptions)),onRowClick:u}}const mB=O.createContext({});function yB(){return O.useContext(mB)}function vB(t,e,n){const r=mo(t),i=O.useMemo(()=>({onError:()=>Ie.error((n==null?void 0:n.errorMessage)??"Oops, something went wrong :("),refetchOnWindowFocus:!1,keepPreviousData:!0,retry:!1,staleTime:1e8}),[n]),{pageIndex:o,pageSize:s,setPagination:a}=jg(),{sortBy:l,sortDir:c}=NE(),{getFilters:u}=yB(),d={pageSize:s,pageNumber:o,sortBy:l,sortDir:c,...n!=null&&n.transformFilters?n.transformFilters(u()):u()},h=O.useMemo(()=>({...i,...n==null?void 0:n.queryOptions}),[n]),{data:f,isError:p,isFetching:g,isLoading:m}=Pn(t,e,d,h),y=O.useCallback(r,[r]),{data:x}=f??{data:{data:void 0,meta:void 0}},{data:w,meta:v}=x;return{data:w&&(n!=null&&n.transformResponse)?n.transformResponse(w):w,response:x,retry:y,isError:p,isLoading:m,isFetching:g,page:(v==null?void 0:v.current_page)??1??o,pageSize:(v==null?void 0:v.per_page)??s,total:(v==null?void 0:v.total)??0,onPaginationChange:a}}function bB({columns:t,keyField:e="id",queryKey:n,queryFn:r,queryOptions:i,errorMessage:o,transformFilters:s,transformResponse:a,defaultSorted:l="name",defaultSortOrder:c="desc",nonSelectable:u,enableFilters:d=!1,enableSelection:h,enableSelectOnRowClick:f,selectMode:p,onRowClick:g,onSelectionChange:m,sizePerPageList:y,paginationPosition:x,reversePaginationTools:w,containerEl:v,emptyMessage:S,title:C,disabledRow:_,pinnedColumnsLeft:E,pinnedColumnsRight:R,...A}){const T=O.useRef(null),{data:k,response:P,retry:M,isError:j,isLoading:z,isFetching:$,page:J,pageSize:K,total:D,onPaginationChange:Q}=vB(n,r,{errorMessage:o,queryOptions:i,transformResponse:a,transformFilters:s}),oe=gB(k??[],xB(t,h),{defaultSorted:l,defaultSortOrder:c,enableSelection:h,enableSelectOnRowClick:f,selectMode:p,nonSelectable:u,onRowClick:g,onSelectionChange:m,tableOptions:{enableColumnFilters:d,initialState:{columnPinning:{left:E??[],right:R??[]}},state:{pagination:{pageIndex:J,pageSize:K}},autoResetPageIndex:!1,pageCount:Math.ceil(D/K),onPaginationChange:Q}}).table;return b.jsxs("div",{px:"8",pt:"8",ref:T,h:"100%",children:[j&&b.jsx(_i,{onClick:M,label:o}),(z||$&&(!k||(k==null?void 0:k.length)==0))&&b.jsx(Br,{}),!j&&!z&&k&&b.jsxs("div",{children:[C&&($e.isFunction(C)?C(P):C),A.mode=="table"&&b.jsx(wB,{table:oe,total:D??0,data:k,isLoading:$,containerEl:v??T.current,onRowClick:g,sizePerPageList:y,disabledRow:_}),A.mode=="grid"&&b.jsx(SB,{table:oe,total:D??0,data:k,isLoading:$,onRowClick:g,sizePerPageList:y,gridCols:A.gridCols,renderGridItem:A.renderGridItem})]})]})}function wB({table:t,total:e,data:n,isLoading:r,onRowClick:i,containerEl:o,sizePerPageList:s,disabledRow:a}){return b.jsxs(DE,{table:t,total:e??0,show:n&&n.length>0,isLoading:r,sizePerPageList:s,children:[n.length==0&&b.jsx(LE,{page:t.getState().pagination.pageIndex}),n.length>0&&b.jsx("div",{w:"full",border:"2px",borderColor:"#F4F4F4",rounded:"base",my:"3",overflowX:"auto",children:b.jsxs("table",{style:{width:"max(1400px, 100%)",tableLayout:"fixed"},children:[b.jsx(uB,{headers:t.getHeaderGroups()}),b.jsx(lB,{table:t,containerRef:o,onRowClick:i,disabledRow:a})]})})]})}function SB({table:t,total:e,data:n,isLoading:r,onRowClick:i,sizePerPageList:o,gridCols:s,renderGridItem:a}){return b.jsxs(DE,{table:t,total:e??0,show:n&&n.length>0,isLoading:r,sizePerPageList:o,children:[n.length==0&&b.jsx(LE,{page:t.getState().pagination.pageIndex}),n.length>0&&b.jsx("div",{w:"full",children:b.jsx("div",{grid:!0,gridCols:`${s??3}`,gap:"5",w:"full",children:n.map(l=>a==null?void 0:a(l,i))})})]})}function xB(t,e){return e?[{id:"select-col",header:({table:n})=>b.jsx(N.Checkbox,{checked:n.getIsAllRowsSelected(),onChange:n.getToggleAllRowsSelectedHandler()}),cell:({row:n})=>b.jsx(N.Checkbox,{checked:n.getIsSelected(),disabled:!n.getCanSelect(),onChange:n.getToggleSelectedHandler()}),size:10,maxSize:1,enableResizing:!1}].concat(t):t}function jE({children:t,...e}){return b.jsx(N.Tile,{scheme:"light",px:"0",py:"4",h:"100%",...e,children:t})}function FE({children:t,...e}){return b.jsx(pc,{scheme:"default",corners:"pill",h:"10",variant:"glass",...e,children:t??b.jsx(N.Icon,{path:C_})})}function HE({...t}){return b.jsxs(N.Popover,{side:"bottom-end",modal:!0,children:[b.jsx(N.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",...t,children:b.jsx(N.Icon,{path:u_})}),b.jsxs("div",{bgColor:"white",rounded:!0,shadow:!0,children:[b.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"First Item"}),b.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Second Item"}),b.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Third Item"})]})]})}function $E({title:t,queryKey:e,children:n,...r}){const i=mo(e);return hw("ctrl+r",()=>i(),{preventDefault:!0},[i]),b.jsxs("div",{dflex:!0,flexRow:!0,pb:"4",alignItems:"center",gap:"3",px:"8",borderB:"0.5",borderBColor:"--bg-2",...r,children:[t&&b.jsx("h2",{textSize:"x3",fontWeight:"600",textColor:"#3f4254",textTransform:"capitalize",children:t}),b.jsx("div",{flexGrow:!0,children:" "}),b.jsxs("div",{spaceX:"2",dflex:!0,alignItems:"center",children:[b.jsx(N.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",onClick:i,children:b.jsx(N.Icon,{path:cb})}),n]})]})}const Wv="Oops, something went wrong...";function Kv(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function Fg({initialValues:t,itemLabel:e,queryId:n="",api:r,queryFetchOptions:i,querySaveOptions:o,onSuccess:s,onFetchError:a,fetchErrorMsg:l=Wv,onSaveError:c,saveErrorMsg:u=Wv,fetchToFormData:d,formToQueryData:h,invalidateQueriesOnSuccess:f=!0,invalidateQueryKey:p,retryText:g="Retry",cancelLabel:m="Cancel",saveLabel:y,size:x="lg",title:w,form:v,show:S,onClose:C,formikProps:_,...E}){const{isInitialLoading:R,isFetching:A,data:T,isError:k,error:P,refetch:M}=Pn(r.queryKey,r.get,n,{enabled:!(n==""||n==null||n==null),onError:a,...i}),j=f?Ei(r.upsert,p??r.queryKey,o):yo(r.upsert,r.queryKey,n,o),z=O.useCallback(()=>M(),[M]),$=O.useCallback((J,K)=>{j.reset();const D=h?h(J):{...J};j.mutateAsync(D).then(Q=>{s?s(D,Q):Ie.success(`${w?w(D):D.name??D.title} ${n?"saved":"created"}`),C==null||C()}).catch(Q=>{console.error("on error",Q),c?c(J):Ie.error(`Couldn't save ${w?w(D):D.name??D.title}`),K.setSubmitting(!1)})},[j,h,s,c,C]);return b.jsxs(N.Modal,{size:x,show:S,onClose:C,scheme:"light",transition:!0,...E,children:[b.jsxs(N.Modal.Header,{children:[!R&&n&&`Edit ${w?w(T):(T==null?void 0:T.name)??(T==null?void 0:T.title)??""}`,!n&&`Create new ${e??"item"}`,Array.isArray(v)&&b.jsx(b.Fragment,{})]}),R&&b.jsx(N.Modal.Body,{children:b.jsx(Br,{minW:"72"})}),k&&b.jsx(N.Modal.Body,{children:b.jsx(_i,{label:`${l} ${P}`,onClick:z})}),!R&&!k&&b.jsx(b.Fragment,{children:b.jsx(Je.Formik,{initialValues:d&&n&&T?d(Kv(T)):Kv(t(T))??{},onSubmit:$,..._,children:({setFieldValue:J,dirty:K,handleSubmit:D,isValid:Q,values:se})=>b.jsxs(b.Fragment,{children:[b.jsx(N.Modal.Body,{pb:"6",children:b.jsxs(Je.Form,{children:[O.isValidElement(v)&&v,Array.isArray(v)&&b.jsx(mi,{form:v}),$e.isFunction(v)&&b.jsx(mi,{form:v(T??se)})]})}),b.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[b.jsx(N.Button,{disabled:j.isLoading,onClick:C,variant:"borderless",me:"2",children:m}),b.jsx(N.Button,{type:"submit",disabled:!K||j.isLoading,onClick:()=>D(),children:y||(n?"Update":"Create")})]})]})})}),j.isLoading&&b.jsx(js,{})]})}function CB({api:t,fn:e,transformFn:n,config:r,onClose:i,queryId:o,invalidateQueryKey:s}){const{data:a,isFetching:l}=Pn(t.queryKey,e==="get"||e==="getTransformed"?t.get:t.getAll,void 0,{retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1}),c=O.useMemo(()=>a&&(e==="getTransformed"||e==="getAllTransformed")?(n||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${e}`),n==null?void 0:n(a)):a,[a,e,n]);return l?null:b.jsx(Fg,{...r(c),queryId:o,invalidateQueryKey:s,show:!0,onClose:i})}function EB({queries:t,config:e,onClose:n,queryId:r,invalidateQueryKey:i}){const{data:o,isFetching:s,isError:a}=Rb(t.map(c=>({queryKey:c.api.queryKey,queryFn:c.fn=="get"?c.api.get:c.api.getAll,queryOptions:{cacheTime:c.cache===!1?0:void 0,staleTime:c.cache===!1?0:void 0}}))),l=O.useMemo(()=>o==null?void 0:o.map((c,u)=>{var d,h;return t[u].transformFn?(h=(d=t[u])==null?void 0:d.transformFn)==null?void 0:h.call(d,c):c}),[o,t]);return b.jsx(Fg,{isPreloading:s,...e(...l),queryId:r,invalidateQueryKey:i,show:!0,onClose:n})}function BE({config:t,onClose:e,invalidateQueryKey:n,queryId:r}){const{type:i,...o}=t;return t.type==="dialog"?b.jsx(Fg,{...o,queryId:r,invalidateQueryKey:n,show:!0,onClose:e}):t.type==="query"?b.jsx(CB,{...o,queryId:r,invalidateQueryKey:n,onClose:e}):t.type==="multiQuery"?b.jsx(EB,{...o,queryId:r,invalidateQueryKey:n,onClose:e}):null}function _B({itemLabel:t,queryId:e="",api:n,invalidateQueriesOnSuccess:r=!0,invalidateQueryKey:i,size:o="lg",show:s,onClose:a,...l}){const c=r?Ei(n.delete,i??n.queryKey):yo(n.upsert,n.queryKey),u=yc(c,{onSuccess:()=>a==null?void 0:a()}),d=O.useCallback(()=>u(e),[u,e]);return b.jsxs(N.Modal,{size:o,show:s,onClose:a,scheme:"danger",variant:"glass",transition:!0,...l,children:[b.jsx(N.Modal.Header,{children:`Delete ${t}`}),b.jsxs(N.Modal.Body,{pb:"6",children:["Do you really want to delete ",t,"?"]}),b.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[b.jsx(N.Button,{disabled:c.isLoading,onClick:a,variant:"borderless",scheme:"secondary",me:"2",children:"Cancel"}),b.jsx(N.Button,{scheme:"danger",disabled:c.isLoading,onClick:d,children:"Delete"})]}),c.isLoading&&b.jsx(js,{})]})}const[RB,VE]=$e.createContext();function AB({editView:t,deleteItem:e,queryKey:n,children:r}){const i=ew(),o=Fn.useNavigate(),[s,a]=O.useState(null),l=O.useCallback(()=>a(null),[a]),c=O.useCallback((h,f)=>{switch(h.type){case"view":{o($e.runIfFn(h.path,f));break}case"link":{i(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${$e.runIfFn(h.path,f)}`);break}case"edit":{t.type=="customDialog"?a(t.render({show:!0,onClose:l})):a(b.jsx(BE,{onClose:l,config:t,queryId:f.id,invalidateQueryKey:n}));break}case"delete":{a(b.jsx(_B,{show:!0,onClose:l,queryId:f.id,invalidateQueryKey:n,...e,itemLabel:$e.runIfFn(e.itemLabel,f)}));break}}},[o,t,e]),u=RB,d={dialog:s,onAction:c};return b.jsx(u,{value:d,children:r})}function OB({id:t,api:e,status:n,invalidateQueryKey:r,...i}){const o=n=="draft",s=Ei(o?e.publish:e.unpublish,r??e.queryKey,{networkMode:"always"}),a=O.useCallback(l=>{l==null||l.preventDefault(),l==null||l.stopPropagation(),s.reset(),s.mutateAsync(t).then(()=>Ie.success(o?"Published!":"Unpublished!")).catch(c=>Ie.error(`Error: ${c}`))},[s,t]);return b.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...i,children:b.jsx(N.Icon,{path:o?ab:lb})})}function TB({row:t,onAction:e,rowActions:n,api:r,queryKey:i}){const o=t.original;return b.jsx("div",{dflex:!0,spaceX:"1",placeContent:"end",children:n==null?void 0:n.map((s,a)=>b.jsxs(O.Fragment,{children:[s.type==="publish"&&b.jsx(OB,{id:o.id,api:r,status:o.status,invalidateQueryKey:i}),s.type=="custom"&&b.jsx(b.Fragment,{children:s.component(o,i,s.icon,s.label)}),!["publish","custom"].includes(s.type)&&b.jsx(kB,{onClick:()=>e(s,o),scheme:PB[s.type],children:b.jsx(N.Icon,{path:MB[s.type]})})]},a))})}function kB({onClick:t,...e}){const n=O.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),t==null||t(r)},[t]);return b.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",onClick:n,...e})}const MB={link:tp,view:ep,edit:sb,delete:Mf,publish:Mf,custom:""},PB={link:"dark",view:"secondary",edit:"warning",delete:"danger",publish:"warning",custom:"default"};function IB(t,e,n){const r=Fn.useNavigate(),i=ew(),{onAction:o}=VE(),{onRowClick:s,columns:a,...l}=e,c=O.useCallback(h=>{(s==null?void 0:s.type)==="navigate"?r($e.runIfFn(s.path,h)):(s==null?void 0:s.type)=="link"&&i(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${$e.runIfFn(s.path,h)}`)},[r,s]),u=O.useMemo(()=>{const h=e.columns.concat([]);return n&&h.push(e$().display({id:"actions",header:"Actions",cell:f=>b.jsx(TB,{row:f.row,onAction:o,rowActions:n,api:t,queryKey:t.queryKey})})),h},[e]),d={...l};return d.columns=u,d.onRowClick=c,d.queryKey=t.queryKey,d.queryFn=t.search,d}function LB(t){const e=Fn.useParams();if(t===void 0)return;const{[t]:n}=e;return n}function DB({title:t,queryField:e,screen:n,...r}){const i=LB(e),{api:o,table:s,filters:a,buttonBar:l,rowActions:c,editView:u,deleteItem:d,breadcrumbs:h}=$e.runIfFn(n,i),f=$e.runIfFn(o,i);return b.jsxs(Ec,{p:"5",...r,children:[h&&b.jsx(Pg,{breadcrumbs:h}),b.jsxs(jE,{children:[b.jsxs($E,{title:t,queryKey:f.queryKey,children:[a&&b.jsx(HE,{}),b.jsx(NB,{buttonBar:l,editView:u,api:f})]}),b.jsxs(AB,{queryKey:f.queryKey,editView:u,deleteItem:d,children:[b.jsx(jB,{table:s,rowActions:c,api:f}),b.jsx(FB,{})]})]})]})}function NB({buttonBar:t,editView:e,api:n}){const r=O.useCallback(i=>e.type=="customDialog"?e.render({show:!0,onClose:i}):b.jsx(BE,{config:e,onClose:i,invalidateQueryKey:n.queryKey}),[e,n]);return b.jsx(b.Fragment,{children:t&&t.map((i,o)=>b.jsxs("div",{children:[i.type==="create"&&e&&b.jsx(FE,{buildDialog:r}),i.type==="invalidate"&&b.jsx(mp,{pathOrPermalink:i.pathOrPermalink}),i.type==="custom"&&i.render()]},o))})}function jB({table:t,rowActions:e,api:n}){const r=IB(n,t,e);return b.jsx(bB,{...r})}function FB(){const{dialog:t}=VE();return t}function HB(t){const e=Fn.useParams(),{data:n,isFetching:r,isError:i}=Rb(t.map(s=>{if(!s.queryField||!$e.isFunction(s.api)){const c=s.api;return{queryKey:c.queryKey,queryFn:s.fn=="get"?c.get:c.getAll,queryParam:s.params}}const a=e[s.queryField],l=$e.runIfFn(s.api,a);return{queryKey:l.queryKey,queryFn:s.fn=="get"?l.get:l.getAll,queryParam:s.fn=="getAll"?s.params:$e.isFunction(s.api)?void 0:a}}));let o;return!r&&!i&&(o=n==null?void 0:n.map((s,a)=>{var l,c;return t[a].transformFn?(c=(l=t[a]).transformFn)==null?void 0:c.call(l,s):s})),{data:o,isFetching:r,isError:i}}function $B(t){const e=Fr.useQueryClient(),n=Fn.useParams();return O.useCallback(()=>{const i=[];t.forEach(o=>{if(!o.queryField||!$e.isFunction(o.api))i.push(o.api.queryKey);else{const s=n[o.queryField],a=$e.runIfFn(o.api,s);i.push(a.queryKey)}}),e.invalidateQueries({predicate:o=>i.includes(o.queryKey)})},[t,e,n])}function BB({queries:t,config:e,tabbed:n,...r}){const{data:i,isFetching:o,isError:s}=HB(t),a=$B(t);return o?b.jsx(Br,{w:"full",h:"100vh"}):s||!i?b.jsx(_i,{p:"0",w:"full",h:"100vh",onClick:a}):b.jsx(nu,{config:e(...i),tabbed:n,...r})}function nu({config:t,tabbed:e,...n}){return t.type==="table"?b.jsx(DB,{...t,...n}):t.type==="tabbed"?b.jsx(Q4,{...t,...n}):t.type==="details"?b.jsx(K4,{...t,tabbed:e,...n}):t.type==="query"?b.jsx(Y4,{...t,tabbed:e,...n}):t.type==="multiQuery"?b.jsx(BB,{...t,tabbed:e,...n}):b.jsx(b.Fragment,{})}const Gv="Oops, something went wrong...";function VB({queryId:t,queryKey:e,queryFetchFn:n,queryFetchAllKey:r,queryFetchAllFn:i,querySaveFn:o,matchKey:s,size:a="lg",show:l,onClose:c,itemLabel:u,onSuccess:d,onFetchError:h,fetchErrorMsg:f=Gv,onSaveError:p,saveErrorMsg:g=Gv,invalidateQueriesOnSuccess:m=!0,retryText:y="Retry",cancelLabel:x="Cancel",saveLabel:w,formikProps:v,getItemName:S,...C}){const _=Fr.useQueryClient(),{data:E,isInitialLoading:R,isError:A,refetch:T,error:k}=Pn(e,n),{data:P,isInitialLoading:M,isError:j,refetch:z,error:$}=Pn(r,i),[J,K]=O.useState([]),D=R||M,Q=A||j,se=yo(o,e,t),oe=O.useCallback(L=>{const ce=(L==null?void 0:L.currentTarget.dataset.id)??"",me=J.concat([]),be=J.indexOf(ce);be!=-1?me.splice(be,1):me.push(ce),K(me)},[J,K]),de=O.useCallback(()=>{A&&T(),j&&z()},[T,z,A,j]),ue=O.useCallback(()=>{se.reset(),se.mutateAsync({resources:J}).then(L=>{d?d(L):Ie.success(`${u} saved`),m&&_.invalidateQueries({queryKey:e}),c==null||c()}).catch(L=>{console.error("on error",L),p?p():Ie.error(`Error adding ${u}`)})},[se,t,d,_,p,c]),pe=O.useMemo(()=>{let L=[];return E&&P&&(L=[].concat(P),E.forEach(ce=>L.splice(L.findIndex(me=>me.id==ce[s]),1)),S&&(L=L.map(ce=>({...ce,name:S(ce)}))),L=cO(L,["name"])),L},[E,P]);return b.jsxs(N.Modal,{size:a,show:l,onClose:c,scheme:"light",transition:!0,...C,children:[b.jsx(N.Modal.Header,{children:`Add ${u}`}),D&&b.jsx(N.Modal.Body,{children:b.jsx(Br,{minW:"72"})}),Q&&b.jsx(N.Modal.Body,{children:b.jsx(_i,{label:`${f} ${k}`,onClick:de})}),!D&&!Q&&b.jsxs(b.Fragment,{children:[b.jsx(N.Modal.Body,{px:"0",pb:"6",maxH:"750px",overflow:"auto",children:b.jsx("div",{dflex:!0,flexCol:!0,overflow:"auto",children:pe.map(L=>b.jsx(zB,{label:L.name,value:L.id,"data-id":L.id,checked:J.includes(`${L.id}`),onClick:oe},L.id))})}),b.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[b.jsx(N.Button,{disabled:se.isLoading,onClick:c,variant:"borderless",me:"2",children:x}),b.jsx(N.Button,{type:"submit",disabled:J.length==0||se.isLoading,onClick:ue,children:w||(t?"Update":"Create")})]})]}),se.isLoading&&b.jsx(js,{})]})}function zB({label:t,value:e,checked:n,...r}){return b.jsxs("div",{dflex:!0,alignItems:"center",hover_bgColor:"slate-100",px:"5",py:"2",cursor:"pointer",...r,children:[b.jsx("span",{flexGrow:!0,children:t}),b.jsx(N.Checkbox,{name:`resources.${e}`,value:e,checked:n})]})}function UB({initialValues:t,itemLabel:e,queryId:n="",queryKey:r,queryFn:i,queryOptions:o,onSuccess:s,successMsg:a,showSuccessMsg:l,onError:c,errorMsg:u,showErrorMsg:d,processInput:h,invalidateQueriesOnSuccess:f=!0,cancelLabel:p="Cancel",saveLabel:g="Send",size:m="lg",title:y,form:x,show:w,onClose:v,formikProps:S,...C}){const _=f?Ei(i,r,o):yo(i,r,n,o),E=yc(_,{onSuccess:s,successMsg:a,showSuccessMsg:l,onError:c,errorMsg:u,showErrorMsg:d,processInput:h});return b.jsxs(N.Modal,{size:m,show:w,onClose:v,scheme:"light",transition:!0,...C,children:[b.jsx(N.Modal.Header,{children:y}),b.jsxs(Sp,{initialValues:t??{},onSubmit:E,...S,children:[b.jsxs(N.Modal.Body,{pb:"6",children:[O.isValidElement(x)&&x,Array.isArray(x)&&b.jsx(mi,{form:x})]}),b.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[b.jsx(N.Button,{disabled:_.isLoading,onClick:v,variant:"borderless",me:"2",children:p}),b.jsx(aw,{disabled:_.isLoading,children:g})]})]}),_.isLoading&&b.jsx(js,{})]})}const Jv="Oops, something went wrong...";function Xv(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function qB({initialValues:t,itemLabel:e,queryId:n="",queryKey:r,queryFetchFn:i,queryFetchOptions:o,querySaveFn:s,querySaveOptions:a,onSuccess:l,onFetchError:c,fetchErrorMsg:u=Jv,onSaveError:d,saveErrorMsg:h=Jv,fetchToFormData:f,formToQueryData:p,invalidateQueriesOnSuccess:g=!0,invalidateQueryKey:m,retryText:y="Retry",cancelLabel:x="Cancel",saveLabel:w,size:v="lg",title:S,form:C,show:_,onClose:E,formikProps:R,...A}){const{isInitialLoading:T,isFetching:k,data:P,isError:M,error:j,refetch:z}=Pn(r,i,n,{enabled:!(n==""||n==null||n==null),onError:c,...o}),$=g?Ei(s,m??r,a):yo(s,r,n,a),J=O.useCallback(()=>z(),[z]),K=O.useCallback((D,Q)=>{$.reset();const se=p?p(D):{...D};$.mutateAsync(se).then(oe=>{l?l(se,oe):Ie.success(`${S?S(se):se.name??se.title} ${n?"saved":"created"}`),E==null||E()}).catch(oe=>{console.error("on error",oe),d?d(D):Ie.error(`Couldn't save ${S?S(se):se.name??se.title}`),Q.setSubmitting(!1)})},[$,p,l,d,E]);return b.jsxs(N.Modal,{size:v,show:_,onClose:E,scheme:"light",transition:!0,...A,children:[b.jsxs(N.Modal.Header,{children:[!T&&n&&`Edit ${S?S(P):(P==null?void 0:P.name)??(P==null?void 0:P.title)??""}`,!n&&`Create new ${e??"item"}`,Array.isArray(C)&&b.jsx(b.Fragment,{})]}),T&&b.jsx(N.Modal.Body,{children:b.jsx(Br,{minW:"72"})}),M&&b.jsx(N.Modal.Body,{children:b.jsx(_i,{label:`${u} ${j}`,onClick:J})}),!T&&!M&&b.jsx(b.Fragment,{children:b.jsx(Je.Formik,{initialValues:f&&n&&P?f(Xv(P)):Xv(P)??t??{},onSubmit:K,...R,children:({setFieldValue:D,dirty:Q,handleSubmit:se,isValid:oe,values:de})=>b.jsxs(b.Fragment,{children:[b.jsx(N.Modal.Body,{pb:"6",children:b.jsxs(Je.Form,{children:[O.isValidElement(C)&&C,Array.isArray(C)&&b.jsx(mi,{form:C}),$e.isFunction(C)&&b.jsx(mi,{form:C(P??de)})]})}),b.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[b.jsx(N.Button,{disabled:$.isLoading,onClick:E,variant:"borderless",me:"2",children:x}),b.jsx(N.Button,{type:"submit",disabled:!Q||$.isLoading,onClick:()=>se(),children:w||(n?"Update":"Create")})]})]})})}),$.isLoading&&b.jsx(js,{})]})}function zE({children:t,...e}){return b.jsx("div",{trait:"typo.h6",mb:"5",...e,children:t})}const WB=O.forwardRef(({loading:t=!1,children:e,...n},r)=>b.jsxs(b.Fragment,{children:[t&&b.jsx(Br,{w:"full",h:"100%"}),!t&&b.jsx(N.Container,{ref:r,center:!0,size:"x2",dflex:!0,flexCol:!0,gap:"8",...n,children:e})]}));function KB({children:t,...e}){return b.jsx("div",{trait:"typo.h6",mb:"3",...e,children:t})}const GB={draft:"Draft",published:"Published",pending:"Pending",approved:"Approved",partially_approved:"Partially Approved",rejected:"Rejected"},JB={draft:"warning",published:"success",pending:"secondary",approved:"success",partially_approved:"warning",rejected:"danger"};function XB({status:t,...e}){return b.jsx(N.Badge,{size:"sm",variant:"glass",whiteSpace:"nowrap",rounded:"full",px:"3",scheme:JB[t],...e,children:GB[t]})}function UE({path:t,...e}){const n=O.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),window.open(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${t}`,"_blank")},[t]);return b.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"dark",onClick:n,...e,children:b.jsx(N.Icon,{path:tp})})}function qE({path:t,...e}){const n=Fn.useNavigate(),r=O.useCallback(i=>{i==null||i.preventDefault(),i==null||i.stopPropagation(),n(`${t}`)},[n,t]);return b.jsx(N.Button,{scheme:"secondary",w:"10",h:"10",variant:"borderless",corners:"pill",onClick:r,...e,children:b.jsx(N.Icon,{path:ep})})}function WE({children:t,...e}){return b.jsx(pc,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"warning",...e,children:t??b.jsx(N.Icon,{path:sb})})}function KE({children:t,...e}){return b.jsx(pc,{w:"10",h:"10",scheme:"danger",variant:"borderless",corners:"pill",...e,children:t??b.jsx(N.Icon,{path:Mf})})}function YB({publishId:t,viewPath:e,navigatePath:n,editDialog:r,deleteDialog:i,children:o,...s}){return b.jsxs("div",{dflex:!0,spaceX:"1",placeContent:"end",...s,children:[e&&b.jsx(UE,{path:e}),n&&b.jsx(qE,{path:n}),r&&b.jsx(WE,{buildDialog:r}),i&&b.jsx(KE,{buildDialog:i}),o]})}function QB({id:t,api:e,status:n,invalidateQueryKey:r,...i}){const o=n=="draft",s=Ei(o?e.publish:e.unpublish,r??e.queryKey,{networkMode:"always"}),a=O.useCallback(l=>{l==null||l.preventDefault(),l==null||l.stopPropagation(),s.reset(),s.mutateAsync(t).then(()=>Ie.success(o?"Published!":"Unpublished!")).catch(c=>Ie.error(`Error: ${c}`))},[s,t]);return b.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...i,children:b.jsx(N.Icon,{path:o?ab:lb})})}exports.AttachDialog=VB;exports.Breadcrumbs=cp;exports.DialogButton=pc;exports.FormActionDialog=UB;exports.IconButton=W_;exports.InvalidateButton=mp;exports.ItemEditDialog=qB;exports.NavigateButton=SA;exports.OrderCell=xk;exports.PageContainer=Ec;exports.PageContentEditor=mE;exports.PageMain=gE;exports.PageQueryStateContainer=kg;exports.PageSectionTitle=zE;exports.PageSidebar=yE;exports.PageSidebarSection=vE;exports.PageStateContainer=WB;exports.PageSubSectionTitle=KB;exports.PageTabbedTopBar=SE;exports.PageTabbedTopBarProvider=wE;exports.PageTitle=Mg;exports.PageTopBar=Pg;exports.PageTopBarToolbar=xE;exports.PublishButton=Yb;exports.ScreenRenderer=nu;exports.SectionTitle=YE;exports.StatusBadge=XB;exports.TableContainer=jE;exports.TableCreateButton=FE;exports.TableFilterButton=HE;exports.TableRowActionBar=YB;exports.TableRowDeleteButton=KE;exports.TableRowEditButton=WE;exports.TableRowNavigateButton=qE;exports.TableRowPublishPostButton=QB;exports.TableRowViewButton=UE;exports.TableTopBar=$E;exports.UpdateButton=pw;exports.ViewButton=gw;