@compill/admin 1.0.30 → 1.0.31

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 (81) hide show
  1. package/README.md +7 -0
  2. package/index.cjs.d.ts +1 -0
  3. package/index.cjs.js +11683 -0
  4. package/index.esm.d.ts +1 -0
  5. package/index.esm.js +11636 -0
  6. package/package.json +7 -3
  7. package/src/index.d.ts +44 -0
  8. package/{lib → src/lib}/SectionTitle.d.ts +2 -2
  9. package/{lib → src/lib}/breadcrumbs/BreadCrumbs.d.ts +2 -2
  10. package/{lib → src/lib}/buttons/DialogButton.d.ts +3 -4
  11. package/{lib → src/lib}/buttons/IconButton.d.ts +2 -2
  12. package/{lib → src/lib}/buttons/InvalidateButton.d.ts +2 -2
  13. package/{lib → src/lib}/buttons/NavigateButton.d.ts +2 -2
  14. package/{lib → src/lib}/buttons/PublishButton.d.ts +3 -3
  15. package/{lib → src/lib}/buttons/UpdateButton.d.ts +2 -2
  16. package/{lib → src/lib}/buttons/ViewButton.d.ts +2 -2
  17. package/{lib → src/lib}/json/DetailsView.d.ts +3 -3
  18. package/{lib → src/lib}/json/EditItemView.d.ts +2 -2
  19. package/{lib → src/lib}/json/MultiQueryWrapper.d.ts +3 -3
  20. package/{lib → src/lib}/json/QueryWrapper.d.ts +4 -4
  21. package/{lib → src/lib}/json/ScreenRenderer.d.ts +3 -3
  22. package/{lib → src/lib}/json/ScreenTopBar.d.ts +4 -4
  23. package/src/lib/json/TabbedView.d.ts +4 -0
  24. package/{lib → src/lib}/json/buttons/ActionButton.d.ts +3 -3
  25. package/{lib → src/lib}/json/buttons/ConfirmationActionButton.d.ts +3 -3
  26. package/{lib → src/lib}/json/dialog/DialogRenderer.d.ts +4 -4
  27. package/{lib → src/lib}/json/dialog/ItemDeleteDialog.d.ts +3 -3
  28. package/{lib → src/lib}/json/dialog/ItemEditDialog.d.ts +6 -7
  29. package/{lib → src/lib}/json/dialog/MultiQueryWrapperDialog.d.ts +2 -2
  30. package/{lib → src/lib}/json/dialog/QueryWrapperDialog.d.ts +4 -4
  31. package/{lib → src/lib}/json/table/TableRowActionsView.d.ts +3 -3
  32. package/{lib → src/lib/json}/table/TableRowPublishPostButton.d.ts +3 -3
  33. package/{lib → src/lib}/json/table/TableView.d.ts +3 -3
  34. package/{lib → src/lib}/json/table/TableViewContext.d.ts +4 -5
  35. package/src/lib/json/table/useTableProps.d.ts +3 -0
  36. package/{lib → src/lib}/json/types/DetailsView.d.ts +4 -4
  37. package/{lib → src/lib}/json/types/EditItemDialog.d.ts +1 -2
  38. package/{lib → src/lib}/json/types/MultiQueryWrapper.d.ts +4 -5
  39. package/{lib → src/lib}/json/types/MultiQueryWrapperDialog.d.ts +2 -3
  40. package/{lib → src/lib}/json/types/QueryWrapper.d.ts +4 -5
  41. package/{lib → src/lib}/json/types/QueryWrapperDialog.d.ts +2 -3
  42. package/src/lib/json/types/ScreenConfig.d.ts +8 -0
  43. package/{lib → src/lib}/json/types/TabbedView.d.ts +7 -7
  44. package/{lib → src/lib}/json/types/TableView.d.ts +10 -10
  45. package/{lib → src/lib}/modal/AttachDialog.d.ts +4 -4
  46. package/{lib → src/lib}/modal/FormActionDialog.d.ts +6 -7
  47. package/{lib → src/lib}/modal/ItemEditDialog.d.ts +5 -6
  48. package/{lib → src/lib}/page/PageContainer.d.ts +2 -2
  49. package/{lib → src/lib}/page/PageContentEditor.d.ts +2 -2
  50. package/{lib → src/lib}/page/PageMain.d.ts +2 -2
  51. package/{lib → src/lib}/page/PageQueryStateContainer.d.ts +3 -4
  52. package/{lib → src/lib}/page/PageSectionTitle.d.ts +2 -2
  53. package/{lib → src/lib}/page/PageSidebar.d.ts +2 -2
  54. package/{lib → src/lib}/page/PageSidebarSection.d.ts +2 -2
  55. package/{lib → src/lib}/page/PageStateContainer.d.ts +2 -3
  56. package/{lib → src/lib}/page/PageSubSectionTitle.d.ts +2 -2
  57. package/{lib → src/lib}/page/PageTitle.d.ts +2 -2
  58. package/{lib → src/lib}/page/PageTopBar.d.ts +3 -4
  59. package/{lib → src/lib}/status/StatusBadge.d.ts +2 -2
  60. package/{lib → src/lib}/table/TableContainer.d.ts +3 -3
  61. package/{lib → src/lib}/table/TableContainerContext.d.ts +2 -3
  62. package/{lib → src/lib}/table/TableCreateButton.d.ts +2 -2
  63. package/{lib → src/lib}/table/TableFilterButton.d.ts +2 -2
  64. package/{lib → src/lib}/table/TableFilters.d.ts +2 -2
  65. package/{lib → src/lib}/table/TableMassActions.d.ts +2 -2
  66. package/{lib → src/lib}/table/TableRowActionBar.d.ts +2 -2
  67. package/{lib → src/lib}/table/TableRowDeleteButton.d.ts +2 -2
  68. package/{lib → src/lib}/table/TableRowEditButton.d.ts +2 -2
  69. package/{lib → src/lib}/table/TableRowNavigateButton.d.ts +2 -2
  70. package/{lib/json → src/lib}/table/TableRowPublishPostButton.d.ts +3 -3
  71. package/{lib → src/lib}/table/TableRowViewButton.d.ts +2 -2
  72. package/{lib → src/lib}/table/TableTopBar.d.ts +2 -2
  73. package/index.d.ts +0 -44
  74. package/index.js +0 -18
  75. package/index.mjs +0 -5140
  76. package/index.umd.js +0 -18
  77. package/lib/json/TabbedView.d.ts +0 -4
  78. package/lib/json/table/useTableProps.d.ts +0 -4
  79. package/lib/json/types/ScreenConfig.d.ts +0 -9
  80. /package/{lib → src/lib}/cells/OrderCell.d.ts +0 -0
  81. /package/{lib → src/lib}/table/TableColumnButton.d.ts +0 -0
@@ -1,6 +1,5 @@
1
- import { default as React } from 'react';
2
- import { ContainerProps } from '@valerya/ui';
3
-
1
+ import { ContainerProps } from "@valerya/ui";
2
+ import React from "react";
4
3
  interface PageStateContainerProps extends ContainerProps {
5
4
  loading?: boolean;
6
5
  }
@@ -1,3 +1,3 @@
1
- import { ParentComponent, SoperioComponent } from '@soperio/react';
2
-
1
+ /// <reference types="react" />
2
+ import { ParentComponent, SoperioComponent } from "@soperio/react";
3
3
  export declare function PageSubSectionTitle({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
@@ -1,3 +1,3 @@
1
- import { ParentComponent, SoperioComponent } from '@soperio/react';
2
-
1
+ /// <reference types="react" />
2
+ import { ParentComponent, SoperioComponent } from "@soperio/react";
3
3
  export declare function PageTitle({ children, ...props }: SoperioComponent & ParentComponent): JSX.Element;
@@ -1,7 +1,6 @@
1
- import { Breadcrumb } from '../breadcrumbs/BreadCrumbs';
2
- import { default as React } from 'react';
3
- import { ParentComponent, SoperioComponent } from '@soperio/react';
4
-
1
+ import { ParentComponent, SoperioComponent } from "@soperio/react";
2
+ import React from "react";
3
+ import { Breadcrumb } from "../breadcrumbs/BreadCrumbs";
5
4
  export interface PageTopBarProps extends SoperioComponent, ParentComponent {
6
5
  title?: string;
7
6
  breadcrumbs?: Breadcrumb[];
@@ -1,5 +1,5 @@
1
- import { SoperioComponent } from '@soperio/react';
2
-
1
+ /// <reference types="react" />
2
+ import { SoperioComponent } from "@soperio/react";
3
3
  export declare function StatusBadge({ status, ...props }: {
4
4
  status: "draft" | "published";
5
5
  } & SoperioComponent): JSX.Element;
@@ -1,6 +1,6 @@
1
- import { TileProps } from '@valerya/ui';
2
- import { ColumnDef } from '@tanstack/react-table';
3
-
1
+ /// <reference types="react" />
2
+ import { ColumnDef } from "@tanstack/react-table";
3
+ import { TileProps } from "@valerya/ui";
4
4
  interface TableContainerProps extends TileProps {
5
5
  initialPageSize?: number;
6
6
  columns?: ColumnDef<any>[];
@@ -1,6 +1,5 @@
1
- import { ColumnDef } from '@tanstack/react-table';
2
- import { default as React } from 'react';
3
-
1
+ import React from "react";
2
+ import { ColumnDef } from "@tanstack/react-table";
4
3
  type TableContainerContextProps = {
5
4
  showFilters?: boolean;
6
5
  setShowFilters: (show: boolean) => void;
@@ -1,3 +1,3 @@
1
- import { DialogButtonProps } from '../buttons/DialogButton';
2
-
1
+ /// <reference types="react" />
2
+ import { DialogButtonProps } from "../buttons/DialogButton";
3
3
  export declare function TableCreateButton({ children, ...props }: DialogButtonProps): JSX.Element;
@@ -1,3 +1,3 @@
1
- import { ButtonProps } from '@valerya/ui';
2
-
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "@valerya/ui";
3
3
  export declare function TableFilterButton({ ...props }: ButtonProps): JSX.Element;
@@ -1,5 +1,5 @@
1
- import { FormRendererConfig } from '../../../../form/src/index.ts';
2
-
1
+ /// <reference types="react" />
2
+ import { FormRendererConfig } from "@compill/form";
3
3
  interface TableFiltersProps {
4
4
  form: FormRendererConfig;
5
5
  initialValues: any;
@@ -1,5 +1,5 @@
1
- import { MassAction } from '../json/types/TableView';
2
-
1
+ /// <reference types="react" />
2
+ import { MassAction } from "../json/types/TableView";
3
3
  interface TableMassActionsProps {
4
4
  actions: MassAction[];
5
5
  }
@@ -1,5 +1,5 @@
1
- import { ParentComponent, SoperioComponent } from '@soperio/react';
2
-
1
+ /// <reference types="react" />
2
+ import { ParentComponent, SoperioComponent } from "@soperio/react";
3
3
  interface TableRowActionBarProps extends SoperioComponent, ParentComponent {
4
4
  publishId?: string;
5
5
  viewPath?: string;
@@ -1,3 +1,3 @@
1
- import { DialogButtonProps } from '../buttons/DialogButton';
2
-
1
+ /// <reference types="react" />
2
+ import { DialogButtonProps } from "../buttons/DialogButton";
3
3
  export declare function TableRowDeleteButton({ children, ...props }: DialogButtonProps): JSX.Element;
@@ -1,3 +1,3 @@
1
- import { DialogButtonProps } from '../buttons/DialogButton';
2
-
1
+ /// <reference types="react" />
2
+ import { DialogButtonProps } from "../buttons/DialogButton";
3
3
  export declare function TableRowEditButton({ children, ...props }: DialogButtonProps): JSX.Element;
@@ -1,5 +1,5 @@
1
- import { ButtonProps } from '@valerya/ui';
2
-
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "@valerya/ui";
3
3
  export declare function TableRowNavigateButton({ path, ...props }: {
4
4
  path: string;
5
5
  } & ButtonProps): JSX.Element;
@@ -1,6 +1,6 @@
1
- import { API } from '../../../../../admin-api/src/index.ts';
2
- import { ButtonProps } from '@valerya/ui';
3
-
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "@valerya/ui";
3
+ import { API } from "@compill/admin-api";
4
4
  export declare function TableRowPublishPostButton({ id, api, status, invalidateQueryKey, ...props }: {
5
5
  id: string;
6
6
  api: API<any>;
@@ -1,5 +1,5 @@
1
- import { ButtonProps } from '@valerya/ui';
2
-
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "@valerya/ui";
3
3
  export declare function TableRowViewButton({ path, ...props }: {
4
4
  path: string;
5
5
  } & ButtonProps): JSX.Element;
@@ -1,5 +1,5 @@
1
- import { ParentComponent, SoperioComponent } from '@soperio/react';
2
-
1
+ /// <reference types="react" />
2
+ import { ParentComponent, SoperioComponent } from "@soperio/react";
3
3
  interface TableTopBarProps extends SoperioComponent, ParentComponent {
4
4
  title?: string;
5
5
  queryKey: string[];
package/index.d.ts DELETED
@@ -1,44 +0,0 @@
1
- export * from './lib/SectionTitle';
2
- export * from './lib/breadcrumbs/BreadCrumbs';
3
- export * from './lib/buttons/DialogButton';
4
- export * from './lib/buttons/IconButton';
5
- export * from './lib/buttons/InvalidateButton';
6
- export * from './lib/buttons/NavigateButton';
7
- export * from './lib/buttons/PublishButton';
8
- export * from './lib/buttons/UpdateButton';
9
- export * from './lib/buttons/ViewButton';
10
- export * from './lib/cells/OrderCell';
11
- export * from './lib/json/types/ScreenConfig';
12
- export * from './lib/json/types/EditItemDialog';
13
- export * from './lib/json/types/TableView';
14
- export * from './lib/json/types/TabbedView';
15
- export * from './lib/json/types/DetailsView';
16
- export * from './lib/json/types/QueryWrapper';
17
- export * from './lib/json/types/QueryWrapperDialog';
18
- export * from './lib/json/types/MultiQueryWrapper';
19
- export * from './lib/json/ScreenRenderer';
20
- export * from './lib/modal/AttachDialog';
21
- export * from './lib/modal/FormActionDialog';
22
- export * from './lib/modal/ItemEditDialog';
23
- export * from './lib/page/PageContainer';
24
- export * from './lib/page/PageContentEditor';
25
- export * from './lib/page/PageMain';
26
- export * from './lib/page/PageQueryStateContainer';
27
- export * from './lib/page/PageSectionTitle';
28
- export * from './lib/page/PageSidebar';
29
- export * from './lib/page/PageSidebarSection';
30
- export * from './lib/page/PageStateContainer';
31
- export * from './lib/page/PageSubSectionTitle';
32
- export * from './lib/page/PageTitle';
33
- export * from './lib/page/PageTopBar';
34
- export * from './lib/status/StatusBadge';
35
- export * from './lib/table/TableContainer';
36
- export * from './lib/table/TableCreateButton';
37
- export * from './lib/table/TableFilterButton';
38
- export * from './lib/table/TableRowActionBar';
39
- export * from './lib/table/TableRowDeleteButton';
40
- export * from './lib/table/TableRowEditButton';
41
- export * from './lib/table/TableRowNavigateButton';
42
- export * from './lib/table/TableRowPublishPostButton';
43
- export * from './lib/table/TableRowViewButton';
44
- export * from './lib/table/TableTopBar';
package/index.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";var ts=Object.defineProperty;var ns=(e,t,n)=>t in e?ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Sn=(e,t,n)=>(ns(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@soperio/jsx-runtime"),_=require("@valerya/ui"),rs=require("react/jsx-runtime"),v=require("react"),M=require("@compill/api"),ce=require("react-router-dom"),te=require("@compill/form"),Me=require("formik"),X=require("@compill/components"),z=require("@soperio/react"),os=require("@compill/form-extras"),ss=require("@compill/admin"),is=require("react-dom"),ke=require("@compill/table"),zr=require("@compill/hooks"),Kr=require("@tanstack/react-query");function as({children:e,...t}){return c.jsx("h2",{textSize:"xl",fontWeight:"600",textColor:"slate-800",...t,children:e})}var us="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",cs="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",ls="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",fs="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",ds="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",en="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",cn="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",ps="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",hs="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",ln="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",$r="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",ms="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",ys="M3 3V21H21V3H3M18 18H6V17H18V18M18 16H6V15H18V16M18 12H6V6H18V12Z",Wr="M5,4V6H19V4H5M5,14H9V20H15V14H19L12,7L5,14Z",Qr="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",gs="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";function bs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tn={exports:{}},Ne={};Ne._=Ne._interop_require_default=vs;function vs(e){return e&&e.__esModule?e:{default:e}}var He={exports:{}},vt={},Ln;function Gr(){return Ln||(Ln=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var u in a)Object.defineProperty(s,u,{enumerable:!0,get:a[u]})}t(e,{assign:function(){return i},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}});function n(s){const a={};return s.forEach((u,f)=>{typeof a[f]>"u"?a[f]=u:Array.isArray(a[f])?a[f].push(u):a[f]=[a[f],u]}),a}function r(s){return typeof s=="string"||typeof s=="number"&&!isNaN(s)||typeof s=="boolean"?String(s):""}function o(s){const a=new URLSearchParams;return Object.entries(s).forEach(u=>{let[f,d]=u;Array.isArray(d)?d.forEach(l=>a.append(f,r(l))):a.set(f,r(d))}),a}function i(s){for(var a=arguments.length,u=new Array(a>1?a-1:0),f=1;f<a;f++)u[f-1]=arguments[f];return u.forEach(d=>{Array.from(d.keys()).forEach(l=>s.delete(l)),d.forEach((l,g)=>s.append(g,l))}),s}}(vt)),vt}var xt={},qe={},Mn;function xs(){if(Mn)return qe;Mn=1;function e(n){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(e=function(i){return i?o:r})(n)}qe._=qe._interop_require_wildcard=t;function t(n,r){if(!r&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var o=e(r);if(o&&o.has(n))return o.get(n);var i={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in n)if(a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)){var u=s?Object.getOwnPropertyDescriptor(n,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=n[a]}return i.default=n,o&&o.set(n,i),i}return qe}var Nn;function Xr(){return Nn||(Nn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,f){for(var d in f)Object.defineProperty(u,d,{enumerable:!0,get:f[d]})}t(e,{formatUrl:function(){return i},formatWithValidation:function(){return a},urlObjectKeys:function(){return s}});const r=xs()._(Gr()),o=/https?|ftp|gopher|file/;function i(u){let{auth:f,hostname:d}=u,l=u.protocol||"",g=u.pathname||"",h=u.hash||"",m=u.query||"",p=!1;f=f?encodeURIComponent(f).replace(/%3A/i,":")+"@":"",u.host?p=f+u.host:d&&(p=f+(~d.indexOf(":")?"["+d+"]":d),u.port&&(p+=":"+u.port)),m&&typeof m=="object"&&(m=String(r.urlQueryToSearchParams(m)));let y=u.search||m&&"?"+m||"";return l&&!l.endsWith(":")&&(l+=":"),u.slashes||(!l||o.test(l))&&p!==!1?(p="//"+(p||""),g&&g[0]!=="/"&&(g="/"+g)):p||(p=""),h&&h[0]!=="#"&&(h="#"+h),y&&y[0]!=="?"&&(y="?"+y),g=g.replace(/[?#]/g,encodeURIComponent),y=y.replace("#","%23"),""+l+p+g+y+h}const s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function a(u){return process.env.NODE_ENV==="development"&&u!==null&&typeof u=="object"&&Object.keys(u).forEach(f=>{s.includes(f)||console.warn("Unknown key passed via urlObject into url.format: "+f)}),i(u)}}(xt)),xt}var Et={},In;function Es(){return In||(In=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"omit",{enumerable:!0,get:function(){return t}});function t(n,r){const o={};return Object.keys(n).forEach(i=>{r.includes(i)||(o[i]=n[i])}),o}}(Et)),Et}var wt={},kn;function it(){return kn||(kn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(b,P){for(var T in P)Object.defineProperty(b,T,{enumerable:!0,get:P[T]})}t(e,{DecodeError:function(){return m},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return x},NormalizeError:function(){return p},PageNotFoundError:function(){return y},SP:function(){return g},ST:function(){return h},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return u},getLocationOrigin:function(){return s},getURL:function(){return a},isAbsoluteUrl:function(){return i},isResSent:function(){return f},loadGetInitialProps:function(){return l},normalizeRepeatedSlashes:function(){return d},stringifyError:function(){return w}});const n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(b){let P=!1,T;return function(){for(var C=arguments.length,R=new Array(C),A=0;A<C;A++)R[A]=arguments[A];return P||(P=!0,T=b(...R)),T}}const o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=b=>o.test(b);function s(){const{protocol:b,hostname:P,port:T}=window.location;return b+"//"+P+(T?":"+T:"")}function a(){const{href:b}=window.location,P=s();return b.substring(P.length)}function u(b){return typeof b=="string"?b:b.displayName||b.name||"Unknown"}function f(b){return b.finished||b.headersSent}function d(b){const P=b.split("?");return P[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(P[1]?"?"+P.slice(1).join("?"):"")}async function l(b,P){if(process.env.NODE_ENV!=="production"){var T;if((T=b.prototype)!=null&&T.getInitialProps){const A='"'+u(b)+'.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(A)}}const C=P.res||P.ctx&&P.ctx.res;if(!b.getInitialProps)return P.ctx&&P.Component?{pageProps:await l(P.Component,P.ctx)}:{};const R=await b.getInitialProps(P);if(C&&f(C))return R;if(!R){const A='"'+u(b)+'.getInitialProps()" should resolve to an object. But found "'+R+'" instead.';throw new Error(A)}return process.env.NODE_ENV!=="production"&&Object.keys(R).length===0&&!P.ctx&&console.warn(""+u(b)+" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps"),R}const g=typeof performance<"u",h=g&&["mark","measure","getEntriesByName"].every(b=>typeof performance[b]=="function");class m extends Error{}class p extends Error{}class y extends Error{constructor(P){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+P}}class x extends Error{constructor(P,T){super(),this.message="Failed to load static file for page: "+P+" "+T}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(b){return JSON.stringify({message:b.message,stack:b.stack})}}(wt)),wt}var Ue={exports:{}},Pt={},Bn;function Jr(){return Bn||(Bn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeTrailingSlash",{enumerable:!0,get:function(){return t}});function t(n){return n.replace(/\/$/,"")||"/"}}(Pt)),Pt}var Rt={},Fn;function fn(){return Fn||(Fn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return t}});function t(n){const r=n.indexOf("#"),o=n.indexOf("?"),i=o>-1&&(r<0||o<r);return i||r>-1?{pathname:n.substring(0,i?o:r),query:i?n.substring(o,r>-1?r:void 0):"",hash:r>-1?n.slice(r):""}:{pathname:n,query:"",hash:""}}}(Rt)),Rt}var Dn;function at(){return Dn||(Dn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return o}});const n=Jr(),r=fn(),o=i=>{if(!i.startsWith("/")||process.env.__NEXT_MANUAL_TRAILING_SLASH)return i;const{pathname:s,query:a,hash:u}=(0,r.parsePath)(i);return process.env.__NEXT_TRAILING_SLASH?/\.[^/]+\/?$/.test(s)?""+(0,n.removeTrailingSlash)(s)+a+u:s.endsWith("/")?""+s+a+u:s+"/"+a+u:""+(0,n.removeTrailingSlash)(s)+a+u};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ue,Ue.exports)),Ue.exports}var _t={},Ve={exports:{}},jt={},Hn;function Zr(){return Hn||(Hn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"pathHasPrefix",{enumerable:!0,get:function(){return n}});const t=fn();function n(r,o){if(typeof r!="string")return!1;const{pathname:i}=(0,t.parsePath)(r);return i===o||i.startsWith(o+"/")}}(jt)),jt}var qn;function ws(){return qn||(qn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});const n=Zr(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i){return(0,n.pathHasPrefix)(i,r)}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ve,Ve.exports)),Ve.exports}var Un;function Yr(){return Un||(Un=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"isLocalURL",{enumerable:!0,get:function(){return r}});const t=it(),n=ws();function r(o){if(!(0,t.isAbsoluteUrl)(o))return!0;try{const i=(0,t.getLocationOrigin)(),s=new URL(o,i);return s.origin===i&&(0,n.hasBasePath)(s.pathname)}catch{return!1}}}(_t)),_t}var Tt={},Ct={},Vn;function Ps(){return Vn||(Vn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getSortedRoutes",{enumerable:!0,get:function(){return n}});class t{insert(o){this._insert(o.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(o){o===void 0&&(o="/");const i=[...this.children.keys()].sort();this.slugName!==null&&i.splice(i.indexOf("[]"),1),this.restSlugName!==null&&i.splice(i.indexOf("[...]"),1),this.optionalRestSlugName!==null&&i.splice(i.indexOf("[[...]]"),1);const s=i.map(a=>this.children.get(a)._smoosh(""+o+a+"/")).reduce((a,u)=>[...a,...u],[]);if(this.slugName!==null&&s.push(...this.children.get("[]")._smoosh(o+"["+this.slugName+"]/")),!this.placeholder){const a=o==="/"?"/":o.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(o+"[..."+this.restSlugName+"]/")),this.optionalRestSlugName!==null&&s.push(...this.children.get("[[...]]")._smoosh(o+"[[..."+this.optionalRestSlugName+"]]/")),s}_insert(o,i,s){if(o.length===0){this.placeholder=!1;return}if(s)throw new Error("Catch-all must be the last part of the URL.");let a=o[0];if(a.startsWith("[")&&a.endsWith("]")){let d=function(l,g){if(l!==null&&l!==g)throw new Error("You cannot use different slug names for the same dynamic path ('"+l+"' !== '"+g+"').");i.forEach(h=>{if(h===g)throw new Error('You cannot have the same slug name "'+g+'" repeat within a single dynamic path');if(h.replace(/\W/g,"")===a.replace(/\W/g,""))throw new Error('You cannot have the slug names "'+h+'" and "'+g+'" differ only by non-word symbols within a single dynamic path')}),i.push(g)},u=a.slice(1,-1),f=!1;if(u.startsWith("[")&&u.endsWith("]")&&(u=u.slice(1,-1),f=!0),u.startsWith("...")&&(u=u.substring(3),s=!0),u.startsWith("[")||u.endsWith("]"))throw new Error("Segment names may not start or end with extra brackets ('"+u+"').");if(u.startsWith("."))throw new Error("Segment names may not start with erroneous periods ('"+u+"').");if(s)if(f){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 "'+o[0]+'" ).');d(this.optionalRestSlugName,u),this.optionalRestSlugName=u,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 "'+o[0]+'").');d(this.restSlugName,u),this.restSlugName=u,a="[...]"}else{if(f)throw new Error('Optional route parameters are not yet supported ("'+o[0]+'").');d(this.slugName,u),this.slugName=u,a="[]"}}this.children.has(a)||this.children.set(a,new t),this.children.get(a)._insert(o.slice(1),i,s)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function n(r){const o=new t;return r.forEach(i=>o.insert(i)),o.smoosh()}}(Ct)),Ct}var Ot={},At={},St={},Lt={},zn;function Rs(){return zn||(zn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ensureLeadingSlash",{enumerable:!0,get:function(){return t}});function t(n){return n.startsWith("/")?n:"/"+n}}(Lt)),Lt}var Mt={},Kn;function _s(){return Kn||(Kn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}t(e,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});function n(i){return i[0]==="("&&i.endsWith(")")}const r="__PAGE__",o="__DEFAULT__"}(Mt)),Mt}var $n;function js(){return $n||($n=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var u in a)Object.defineProperty(s,u,{enumerable:!0,get:a[u]})}t(e,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return i}});const n=Rs(),r=_s();function o(s){return(0,n.ensureLeadingSlash)(s.split("/").reduce((a,u,f,d)=>!u||(0,r.isGroupSegment)(u)||u[0]==="@"||(u==="page"||u==="route")&&f===d.length-1?a:a+"/"+u,""))}function i(s){return s.replace(/\.rsc($|\?)/,"$1")}}(St)),St}var Wn;function eo(){return Wn||(Wn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var u in a)Object.defineProperty(s,u,{enumerable:!0,get:a[u]})}t(e,{INTERCEPTION_ROUTE_MARKERS:function(){return r},extractInterceptionRouteInformation:function(){return i},isInterceptionRouteAppPath:function(){return o}});const n=js(),r=["(..)(..)","(.)","(..)","(...)"];function o(s){return s.split("/").find(a=>r.find(u=>a.startsWith(u)))!==void 0}function i(s){let a,u,f;for(const d of s.split("/"))if(u=r.find(l=>d.startsWith(l)),u){[a,f]=s.split(u,2);break}if(!a||!u||!f)throw new Error(`Invalid interception route: ${s}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(a=(0,n.normalizeAppPath)(a),u){case"(.)":a==="/"?f=`/${f}`:f=a+"/"+f;break;case"(..)":if(a==="/")throw new Error(`Invalid interception route: ${s}. Cannot use (..) marker at the root level, use (.) instead.`);f=a.split("/").slice(0,-1).concat(f).join("/");break;case"(...)":f="/"+f;break;case"(..)(..)":const d=a.split("/");if(d.length<=2)throw new Error(`Invalid interception route: ${s}. Cannot use (..)(..) marker at the root level or one level up.`);f=d.slice(0,-2).concat(f).join("/");break;default:throw new Error("Invariant: unexpected marker")}return{interceptingRoute:a,interceptedRoute:f}}}(At)),At}var Qn;function Ts(){return Qn||(Qn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"isDynamicRoute",{enumerable:!0,get:function(){return r}});const t=eo(),n=/\/\[[^/]+?\](?=\/|$)/;function r(o){return(0,t.isInterceptionRouteAppPath)(o)&&(o=(0,t.extractInterceptionRouteInformation)(o).interceptedRoute),n.test(o)}}(Ot)),Ot}var Gn;function Cs(){return Gn||(Gn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}t(e,{getSortedRoutes:function(){return n.getSortedRoutes},isDynamicRoute:function(){return r.isDynamicRoute}});const n=Ps(),r=Ts()}(Tt)),Tt}var Nt={},It={},Xn;function Os(){return Xn||(Xn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getRouteMatcher",{enumerable:!0,get:function(){return n}});const t=it();function n(r){let{re:o,groups:i}=r;return s=>{const a=o.exec(s);if(!a)return!1;const u=d=>{try{return decodeURIComponent(d)}catch{throw new t.DecodeError("failed to decode param")}},f={};return Object.keys(i).forEach(d=>{const l=i[d],g=a[l.pos];g!==void 0&&(f[d]=~g.indexOf("/")?g.split("/").map(h=>u(h)):l.repeat?[u(g)]:u(g))}),f}}}(It)),It}var kt={},Bt={},Jn;function As(){return Jn||(Jn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"escapeStringRegexp",{enumerable:!0,get:function(){return r}});const t=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function r(o){return t.test(o)?o.replace(n,"\\$&"):o}}(Bt)),Bt}var Zn;function Ss(){return Zn||(Zn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(p,y){for(var x in y)Object.defineProperty(p,x,{enumerable:!0,get:y[x]})}t(e,{getNamedMiddlewareRegex:function(){return m},getNamedRouteRegex:function(){return h},getRouteRegex:function(){return f},parseParameter:function(){return a}});const n=eo(),r=As(),o=Jr(),i="nxtP",s="nxtI";function a(p){const y=p.startsWith("[")&&p.endsWith("]");y&&(p=p.slice(1,-1));const x=p.startsWith("...");return x&&(p=p.slice(3)),{key:p,repeat:x,optional:y}}function u(p){const y=(0,o.removeTrailingSlash)(p).slice(1).split("/"),x={};let j=1;return{parameterizedRoute:y.map(w=>{const b=n.INTERCEPTION_ROUTE_MARKERS.find(T=>w.startsWith(T)),P=w.match(/\[((?:\[.*\])|.+)\]/);if(b&&P){const{key:T,optional:C,repeat:R}=a(P[1]);return x[T]={pos:j++,repeat:R,optional:C},"/"+(0,r.escapeStringRegexp)(b)+"([^/]+?)"}else if(P){const{key:T,repeat:C,optional:R}=a(P[1]);return x[T]={pos:j++,repeat:C,optional:R},C?R?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}else return"/"+(0,r.escapeStringRegexp)(w)}).join(""),groups:x}}function f(p){const{parameterizedRoute:y,groups:x}=u(p);return{re:new RegExp("^"+y+"(?:/)?$"),groups:x}}function d(){let p=0;return()=>{let y="",x=++p;for(;x>0;)y+=String.fromCharCode(97+(x-1)%26),x=Math.floor((x-1)/26);return y}}function l(p){let{interceptionMarker:y,getSafeRouteKey:x,segment:j,routeKeys:w,keyPrefix:b}=p;const{key:P,optional:T,repeat:C}=a(j);let R=P.replace(/\W/g,"");b&&(R=""+b+R);let A=!1;(R.length===0||R.length>30)&&(A=!0),isNaN(parseInt(R.slice(0,1)))||(A=!0),A&&(R=x()),b?w[R]=""+b+P:w[R]=P;const S=y?(0,r.escapeStringRegexp)(y):"";return C?T?"(?:/"+S+"(?<"+R+">.+?))?":"/"+S+"(?<"+R+">.+?)":"/"+S+"(?<"+R+">[^/]+?)"}function g(p,y){const x=(0,o.removeTrailingSlash)(p).slice(1).split("/"),j=d(),w={};return{namedParameterizedRoute:x.map(b=>{const P=n.INTERCEPTION_ROUTE_MARKERS.some(C=>b.startsWith(C)),T=b.match(/\[((?:\[.*\])|.+)\]/);if(P&&T){const[C]=b.split(T[0]);return l({getSafeRouteKey:j,interceptionMarker:C,segment:T[1],routeKeys:w,keyPrefix:y?s:void 0})}else return T?l({getSafeRouteKey:j,segment:T[1],routeKeys:w,keyPrefix:y?i:void 0}):"/"+(0,r.escapeStringRegexp)(b)}).join(""),routeKeys:w}}function h(p,y){const x=g(p,y);return{...f(p),namedRegex:"^"+x.namedParameterizedRoute+"(?:/)?$",routeKeys:x.routeKeys}}function m(p,y){const{parameterizedRoute:x}=u(p),{catchAll:j=!0}=y;if(x==="/")return{namedRegex:"^/"+(j?".*":"")+"$"};const{namedParameterizedRoute:w}=g(p,!1);let b=j?"(?:(/.*)?)":"";return{namedRegex:"^"+w+b+"$"}}}(kt)),kt}var Yn;function Ls(){return Yn||(Yn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"interpolateAs",{enumerable:!0,get:function(){return r}});const t=Os(),n=Ss();function r(o,i,s){let a="";const u=(0,n.getRouteRegex)(o),f=u.groups,d=(i!==o?(0,t.getRouteMatcher)(u)(i):"")||s;a=o;const l=Object.keys(f);return l.every(g=>{let h=d[g]||"";const{repeat:m,optional:p}=f[g];let y="["+(m?"...":"")+g+"]";return p&&(y=(h?"":"/")+"["+y+"]"),m&&!Array.isArray(h)&&(h=[h]),(p||g in d)&&(a=a.replace(y,m?h.map(x=>encodeURIComponent(x)).join("/"):encodeURIComponent(h))||"/")})||(a=""),{params:l,result:a}}}(Nt)),Nt}var er;function Ms(){return er||(er=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return d}});const n=Gr(),r=Xr(),o=Es(),i=it(),s=at(),a=Yr(),u=Cs(),f=Ls();function d(l,g,h){let m,p=typeof g=="string"?g:(0,r.formatWithValidation)(g);const y=p.match(/^[a-zA-Z]{1,}:\/\//),x=y?p.slice(y[0].length):p;if((x.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+p+"' passed to next/router in page: '"+l.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");const w=(0,i.normalizeRepeatedSlashes)(x);p=(y?y[0]:"")+w}if(!(0,a.isLocalURL)(p))return h?[p]:p;try{m=new URL(p.startsWith("#")?l.asPath:l.pathname,"http://n")}catch{m=new URL("/","http://n")}try{const w=new URL(p,m);w.pathname=(0,s.normalizePathTrailingSlash)(w.pathname);let b="";if((0,u.isDynamicRoute)(w.pathname)&&w.searchParams&&h){const T=(0,n.searchParamsToUrlQuery)(w.searchParams),{result:C,params:R}=(0,f.interpolateAs)(w.pathname,w.pathname,T);C&&(b=(0,r.formatWithValidation)({pathname:C,hash:w.hash,query:(0,o.omit)(T,R)}))}const P=w.origin===m.origin?w.href.slice(w.origin.length):w.href;return h?[P,b||P]:P}catch{return h?[p]:p}}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(He,He.exports)),He.exports}var ze={exports:{}},Ft={},Dt={},tr;function to(){return tr||(tr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathPrefix",{enumerable:!0,get:function(){return n}});const t=fn();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:i,query:s,hash:a}=(0,t.parsePath)(r);return""+o+i+s+a}}(Dt)),Dt}var nr;function Ns(){return nr||(nr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return r}});const t=to(),n=Zr();function r(o,i,s,a){if(!i||i===s)return o;const u=o.toLowerCase();return!a&&((0,n.pathHasPrefix)(u,"/api")||(0,n.pathHasPrefix)(u,"/"+i.toLowerCase()))?o:(0,t.addPathPrefix)(o,"/"+i)}}(Ft)),Ft}var rr;function Is(){return rr||(rr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return r}});const n=at(),r=function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];return process.env.__NEXT_I18N_SUPPORT?(0,n.normalizePathTrailingSlash)(Ns().addLocale(o,...s)):o};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(ze,ze.exports)),ze.exports}var Ht={},or;function ks(){return or||(or=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"RouterContext",{enumerable:!0,get:function(){return r}});const r=Ne._(v).default.createContext(null);process.env.NODE_ENV!=="production"&&(r.displayName="RouterContext")}(Ht)),Ht}var qt={},sr;function Bs(){return sr||(sr=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function t(f,d){for(var l in d)Object.defineProperty(f,l,{enumerable:!0,get:d[l]})}t(e,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return s},LayoutRouterContext:function(){return i},MissingSlotContext:function(){return u},TemplateContext:function(){return a}});const r=Ne._(v),o=r.default.createContext(null),i=r.default.createContext(null),s=r.default.createContext(null),a=r.default.createContext(null);process.env.NODE_ENV!=="production"&&(o.displayName="AppRouterContext",i.displayName="LayoutRouterContext",s.displayName="GlobalLayoutRouterContext",a.displayName="TemplateContext");const u=r.default.createContext(new Set)}(qt)),qt}var Ke={exports:{}},$e={exports:{}},ir;function Fs(){return ir||(ir=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}n(t,{cancelIdleCallback:function(){return o},requestIdleCallback:function(){return r}});const r=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(i){let s=Date.now();return self.setTimeout(function(){i({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-s))}})},1)},o=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(i){return clearTimeout(i)};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}($e,$e.exports)),$e.exports}var ar;function Ds(){return ar||(ar=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return f}});const n=v,r=Fs(),o=typeof IntersectionObserver=="function",i=new Map,s=[];function a(d){const l={root:d.root||null,margin:d.rootMargin||""},g=s.find(y=>y.root===l.root&&y.margin===l.margin);let h;if(g&&(h=i.get(g),h))return h;const m=new Map,p=new IntersectionObserver(y=>{y.forEach(x=>{const j=m.get(x.target),w=x.isIntersecting||x.intersectionRatio>0;j&&w&&j(w)})},d);return h={id:l,observer:p,elements:m},s.push(l),i.set(l,h),h}function u(d,l,g){const{id:h,observer:m,elements:p}=a(g);return p.set(d,l),m.observe(d),function(){if(p.delete(d),m.unobserve(d),p.size===0){m.disconnect(),i.delete(h);const x=s.findIndex(j=>j.root===h.root&&j.margin===h.margin);x>-1&&s.splice(x,1)}}}function f(d){let{rootRef:l,rootMargin:g,disabled:h}=d;const m=h||!o,[p,y]=(0,n.useState)(!1),x=(0,n.useRef)(null),j=(0,n.useCallback)(b=>{x.current=b},[]);(0,n.useEffect)(()=>{if(o){if(m||p)return;const b=x.current;if(b&&b.tagName)return u(b,T=>T&&y(T),{root:l==null?void 0:l.current,rootMargin:g})}else if(!p){const b=(0,r.requestIdleCallback)(()=>y(!0));return()=>(0,r.cancelIdleCallback)(b)}},[m,g,l,p,x.current]);const w=(0,n.useCallback)(()=>{y(!1)},[]);return[j,p,w]}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ke,Ke.exports)),Ke.exports}var We={exports:{}},Qe={exports:{}},Ut={},ur;function Hs(){return ur||(ur=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return t}});function t(n,r){let o;const i=n.split("/");return(r||[]).some(s=>i[1]&&i[1].toLowerCase()===s.toLowerCase()?(o=s,i.splice(1,1),n=i.join("/")||"/",!0):!1),{pathname:n,detectedLocale:o}}}(Ut)),Ut}var cr;function qs(){return cr||(cr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});const n=(r,o)=>process.env.__NEXT_I18N_SUPPORT?Hs().normalizeLocalePath(r,o):{pathname:r,detectedLocale:void 0};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Qe,Qe.exports)),Qe.exports}var Ge={exports:{}},Vt={},lr;function Us(){return lr||(lr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return t}});function t(n,r,o){if(n){o&&(o=o.toLowerCase());for(const a of n){var i,s;const u=(i=a.domain)==null?void 0:i.split(":",1)[0].toLowerCase();if(r===u||o===a.defaultLocale.toLowerCase()||(s=a.locales)!=null&&s.some(f=>f.toLowerCase()===o))return a}}}}(Vt)),Vt}var fr;function Vs(){return fr||(fr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return n}});const n=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(process.env.__NEXT_I18N_SUPPORT)return Us().detectDomainLocale(...o)};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ge,Ge.exports)),Ge.exports}var dr;function zs(){return dr||(dr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return o}});const n=at(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i,s,a,u){if(process.env.__NEXT_I18N_SUPPORT){const f=qs().normalizeLocalePath,d=Vs().detectDomainLocale,l=s||f(i,a).detectedLocale,g=d(u,void 0,l);if(g){const h="http"+(g.http?"":"s")+"://",m=l===g.defaultLocale?"":"/"+l;return""+h+g.domain+(0,n.normalizePathTrailingSlash)(""+r+m+i)}return!1}else return!1}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(We,We.exports)),We.exports}var Xe={exports:{}},pr;function Ks(){return pr||(pr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return i}});const n=to(),r=at(),o=process.env.__NEXT_ROUTER_BASEPATH||"";function i(s,a){return(0,r.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!a?s:(0,n.addPathPrefix)(s,o))}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Xe,Xe.exports)),Xe.exports}var Je={exports:{}},hr;function $s(){return hr||(hr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(h,m){for(var p in m)Object.defineProperty(h,p,{enumerable:!0,get:m[p]})}n(t,{ACTION_FAST_REFRESH:function(){return u},ACTION_NAVIGATE:function(){return o},ACTION_PREFETCH:function(){return a},ACTION_REFRESH:function(){return r},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return f},ACTION_SERVER_PATCH:function(){return s},PrefetchCacheEntryStatus:function(){return l},PrefetchKind:function(){return d},isThenable:function(){return g}});const r="refresh",o="navigate",i="restore",s="server-patch",a="prefetch",u="fast-refresh",f="server-action";var d;(function(h){h.AUTO="auto",h.FULL="full",h.TEMPORARY="temporary"})(d||(d={}));var l;(function(h){h.fresh="fresh",h.reusable="reusable",h.expired="expired",h.stale="stale"})(l||(l={}));function g(h){return h&&(typeof h=="object"||typeof h=="function")&&typeof h.then=="function"}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Je,Je.exports)),Je.exports}(function(e,t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return T}});const n=Ne,r=rs,o=n._(v),i=Ms(),s=Yr(),a=Xr(),u=it(),f=Is(),d=ks(),l=Bs(),g=Ds(),h=zs(),m=Ks(),p=$s(),y=new Set;function x(C,R,A,S,O,D){if(typeof window>"u"||!D&&!(0,s.isLocalURL)(R))return;if(!S.bypassPrefetchedCheck){const H=typeof S.locale<"u"?S.locale:"locale"in C?C.locale:void 0,q=R+"%"+A+"%"+H;if(y.has(q))return;y.add(q)}(async()=>D?C.prefetch(R,O):C.prefetch(R,A,S))().catch(H=>{if(process.env.NODE_ENV!=="production")throw H})}function j(C){const A=C.currentTarget.getAttribute("target");return A&&A!=="_self"||C.metaKey||C.ctrlKey||C.shiftKey||C.altKey||C.nativeEvent&&C.nativeEvent.which===2}function w(C,R,A,S,O,D,I,H,q){const{nodeName:V}=C.currentTarget;if(V.toUpperCase()==="A"&&(j(C)||!q&&!(0,s.isLocalURL)(A)))return;C.preventDefault();const U=()=>{const K=I??!0;"beforePopState"in R?R[O?"replace":"push"](A,S,{shallow:D,locale:H,scroll:K}):R[O?"replace":"push"](S||A,{scroll:K})};q?o.default.startTransition(U):U()}function b(C){return typeof C=="string"?C:(0,a.formatUrl)(C)}const T=o.default.forwardRef(function(R,A){let S;const{href:O,as:D,children:I,prefetch:H=null,passHref:q,replace:V,shallow:$,scroll:U,locale:K,onClick:W,onMouseEnter:ne,onTouchStart:Q,legacyBehavior:Z=!1,...je}=R;S=I,Z&&(typeof S=="string"||typeof S=="number")&&(S=(0,r.jsx)("a",{children:S}));const G=o.default.useContext(d.RouterContext),bt=o.default.useContext(l.AppRouterContext),k=G??bt,Y=!G,ae=H!==!1,ve=H===null?p.PrefetchKind.AUTO:p.PrefetchKind.FULL;if(process.env.NODE_ENV!=="production"){let B=function(F){return new Error("Failed prop type: The prop `"+F.key+"` expects a "+F.expected+" in `<Link>`, but got `"+F.actual+"` instead."+(typeof window<"u"?`
2
- Open your browser's console to view the Component stack trace.`:""))};Object.keys({href:!0}).forEach(F=>{if(F==="href"&&(R[F]==null||typeof R[F]!="string"&&typeof R[F]!="object"))throw B({key:F,expected:"`string` or `object`",actual:R[F]===null?"null":typeof R[F]})}),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(F=>{const de=typeof R[F];if(F==="as"){if(R[F]&&de!=="string"&&de!=="object")throw B({key:F,expected:"`string` or `object`",actual:de})}else if(F==="locale"){if(R[F]&&de!=="string")throw B({key:F,expected:"`string`",actual:de})}else if(F==="onClick"||F==="onMouseEnter"||F==="onTouchStart"){if(R[F]&&de!=="function")throw B({key:F,expected:"`function`",actual:de})}else if((F==="replace"||F==="scroll"||F==="shallow"||F==="passHref"||F==="prefetch"||F==="legacyBehavior")&&R[F]!=null&&de!=="boolean")throw B({key:F,expected:"`boolean`",actual:de})});const An=o.default.useRef(!1);R.prefetch&&!An.current&&!Y&&(An.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"&&Y&&!D){let B;if(typeof O=="string"?B=O:typeof O=="object"&&typeof O.pathname=="string"&&(B=O.pathname),B&&B.split("/").some(Pe=>Pe.startsWith("[")&&Pe.endsWith("]")))throw new Error("Dynamic href `"+B+"` 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:fe,as:oe}=o.default.useMemo(()=>{if(!G){const Pe=b(O);return{href:Pe,as:D?b(D):Pe}}const[B,he]=(0,i.resolveHref)(G,O,!0);return{href:B,as:D?(0,i.resolveHref)(G,D):he||B}},[G,O,D]),_n=o.default.useRef(fe),jn=o.default.useRef(oe);let ee;if(Z)if(process.env.NODE_ENV==="development"){W&&console.warn('"onClick" was passed to <Link> with `href` of `'+O+'` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link'),ne&&console.warn('"onMouseEnter" was passed to <Link> with `href` of `'+O+'` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link');try{ee=o.default.Children.only(S)}catch{throw S?new Error("Multiple children were passed to <Link> with `href` of `"+O+"` 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 `"+O+"` but one child is required https://nextjs.org/docs/messages/link-no-children")}}else ee=o.default.Children.only(S);else if(process.env.NODE_ENV==="development"&&(S==null?void 0:S.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 we=Z?ee&&typeof ee=="object"&&ee.ref:A,[Tn,Cn,On]=(0,g.useIntersection)({rootMargin:"200px"}),es=o.default.useCallback(B=>{(jn.current!==oe||_n.current!==fe)&&(On(),jn.current=oe,_n.current=fe),Tn(B),we&&(typeof we=="function"?we(B):typeof we=="object"&&(we.current=B))},[oe,we,fe,On,Tn]);o.default.useEffect(()=>{process.env.NODE_ENV==="production"&&k&&(!Cn||!ae||x(k,fe,oe,{locale:K},{kind:ve},Y))},[oe,fe,Cn,K,ae,G==null?void 0:G.locale,k,Y,ve]);const De={ref:es,onClick(B){if(process.env.NODE_ENV!=="production"&&!B)throw new Error('Component rendered inside next/link has to pass click event to "onClick" prop.');!Z&&typeof W=="function"&&W(B),Z&&ee.props&&typeof ee.props.onClick=="function"&&ee.props.onClick(B),k&&(B.defaultPrevented||w(B,k,fe,oe,V,$,U,K,Y))},onMouseEnter(B){!Z&&typeof ne=="function"&&ne(B),Z&&ee.props&&typeof ee.props.onMouseEnter=="function"&&ee.props.onMouseEnter(B),k&&((!ae||process.env.NODE_ENV==="development")&&Y||x(k,fe,oe,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:ve},Y))},onTouchStart:process.env.__NEXT_LINK_NO_TOUCH_START?void 0:function(he){!Z&&typeof Q=="function"&&Q(he),Z&&ee.props&&typeof ee.props.onTouchStart=="function"&&ee.props.onTouchStart(he),k&&(!ae&&Y||x(k,fe,oe,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:ve},Y))}};if((0,u.isAbsoluteUrl)(oe))De.href=oe;else if(!Z||q||ee.type==="a"&&!("href"in ee.props)){const B=typeof K<"u"?K:G==null?void 0:G.locale,he=(G==null?void 0:G.isLocaleDomain)&&(0,h.getDomainLocale)(oe,B,G==null?void 0:G.locales,G==null?void 0:G.domainLocales);De.href=he||(0,m.addBasePath)((0,f.addLocale)(oe,B,G==null?void 0:G.defaultLocale))}return Z?o.default.cloneElement(ee,De):(0,r.jsx)("a",{...je,...De,children:S})});(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(tn,tn.exports);var Ws=tn.exports,Qs=Ws;const Gs=bs(Qs);function dn({breadcrumbs:e,...t}){return c.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",trait:"typo.h5",...t,children:e.map((n,r)=>c.jsx(Xs,{breadcrumb:n,showSeparator:r>0},r))})}function Xs({breadcrumb:e,showSeparator:t}){return c.jsxs(c.Fragment,{children:[t&&c.jsx(_.Icon,{path:ls,mx:"1"}),c.jsx(Gs,{href:`/${e.path??"#"}`,children:c.jsx("span",{hover_textDecoration:e.path?"underline":void 0,cursor:e.path?"pointer":void 0,children:e.label})})]})}function ut({buildDialog:e,...t}){const[n,r]=v.useState(!1),o=v.useCallback(s=>{s==null||s.preventDefault(),s==null||s.stopPropagation(),r(!0)},[r]),i=v.useCallback(()=>{r(!1)},[r]);return c.jsxs(c.Fragment,{children:[c.jsx(_.Button,{onClick:o,...t}),n&&e(i)]})}function Js({icon:e,...t}){return c.jsx(_.Button,{variant:"glass",w:"10",h:"10",rounded:"full",...t,children:c.jsx(_.Icon,{path:e})})}function no(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zs}=Object.prototype,{getPrototypeOf:pn}=Object,ct=(e=>t=>{const n=Zs.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),le=e=>(e=e.toLowerCase(),t=>ct(t)===e),lt=e=>t=>typeof t===e,{isArray:_e}=Array,Ie=lt("undefined");function Ys(e){return e!==null&&!Ie(e)&&e.constructor!==null&&!Ie(e.constructor)&&ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ro=le("ArrayBuffer");function ei(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ro(e.buffer),t}const ti=lt("string"),ie=lt("function"),oo=lt("number"),ft=e=>e!==null&&typeof e=="object",ni=e=>e===!0||e===!1,et=e=>{if(ct(e)!=="object")return!1;const t=pn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ri=le("Date"),oi=le("File"),si=le("Blob"),ii=le("FileList"),ai=e=>ft(e)&&ie(e.pipe),ui=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ie(e.append)&&((t=ct(e))==="formdata"||t==="object"&&ie(e.toString)&&e.toString()==="[object FormData]"))},ci=le("URLSearchParams"),li=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Be(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),_e(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(r=0;r<s;r++)a=i[r],t.call(null,e[a],a,e)}}function so(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const io=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ao=e=>!Ie(e)&&e!==io;function nn(){const{caseless:e}=ao(this)&&this||{},t={},n=(r,o)=>{const i=e&&so(t,o)||o;et(t[i])&&et(r)?t[i]=nn(t[i],r):et(r)?t[i]=nn({},r):_e(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Be(arguments[r],n);return t}const fi=(e,t,n,{allOwnKeys:r}={})=>(Be(t,(o,i)=>{n&&ie(o)?e[i]=no(o,n):e[i]=o},{allOwnKeys:r}),e),di=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pi=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},hi=(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&pn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},mi=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},yi=e=>{if(!e)return null;if(_e(e))return e;let t=e.length;if(!oo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},gi=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&pn(Uint8Array)),bi=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},vi=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xi=le("HTMLFormElement"),Ei=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),mr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),wi=le("RegExp"),uo=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Be(n,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(r[i]=s||o)}),Object.defineProperties(e,r)},Pi=e=>{uo(e,(t,n)=>{if(ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ie(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ri=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return _e(e)?r(e):r(String(e).split(t)),n},_i=()=>{},ji=(e,t)=>(e=+e,Number.isFinite(e)?e:t),zt="abcdefghijklmnopqrstuvwxyz",yr="0123456789",co={DIGIT:yr,ALPHA:zt,ALPHA_DIGIT:zt+zt.toUpperCase()+yr},Ti=(e=16,t=co.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Ci(e){return!!(e&&ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Oi=e=>{const t=new Array(10),n=(r,o)=>{if(ft(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=_e(r)?[]:{};return Be(r,(s,a)=>{const u=n(s,o+1);!Ie(u)&&(i[a]=u)}),t[o]=void 0,i}}return r};return n(e,0)},Ai=le("AsyncFunction"),Si=e=>e&&(ft(e)||ie(e))&&ie(e.then)&&ie(e.catch),E={isArray:_e,isArrayBuffer:ro,isBuffer:Ys,isFormData:ui,isArrayBufferView:ei,isString:ti,isNumber:oo,isBoolean:ni,isObject:ft,isPlainObject:et,isUndefined:Ie,isDate:ri,isFile:oi,isBlob:si,isRegExp:wi,isFunction:ie,isStream:ai,isURLSearchParams:ci,isTypedArray:gi,isFileList:ii,forEach:Be,merge:nn,extend:fi,trim:li,stripBOM:di,inherits:pi,toFlatObject:hi,kindOf:ct,kindOfTest:le,endsWith:mi,toArray:yi,forEachEntry:bi,matchAll:vi,isHTMLForm:xi,hasOwnProperty:mr,hasOwnProp:mr,reduceDescriptors:uo,freezeMethods:Pi,toObjectSet:Ri,toCamelCase:Ei,noop:_i,toFiniteNumber:ji,findKey:so,global:io,isContextDefined:ao,ALPHABET:co,generateString:Ti,isSpecCompliantForm:Ci,toJSONObject:Oi,isAsyncFn:Ai,isThenable:Si};function N(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}E.inherits(N,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:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const lo=N.prototype,fo={};["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(e=>{fo[e]={value:e}});Object.defineProperties(N,fo);Object.defineProperty(lo,"isAxiosError",{value:!0});N.from=(e,t,n,r,o,i)=>{const s=Object.create(lo);return E.toFlatObject(e,s,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),N.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const Li=null;function rn(e){return E.isPlainObject(e)||E.isArray(e)}function po(e){return E.endsWith(e,"[]")?e.slice(0,-2):e}function gr(e,t,n){return e?e.concat(t).map(function(o,i){return o=po(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function Mi(e){return E.isArray(e)&&!e.some(rn)}const Ni=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function dt(e,t,n){if(!E.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=E.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,y){return!E.isUndefined(y[p])});const r=n.metaTokens,o=n.visitor||d,i=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(o))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(!u&&E.isBlob(m))throw new N("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function d(m,p,y){let x=m;if(m&&!y&&typeof m=="object"){if(E.endsWith(p,"{}"))p=r?p:p.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&Mi(m)||(E.isFileList(m)||E.endsWith(p,"[]"))&&(x=E.toArray(m)))return p=po(p),x.forEach(function(w,b){!(E.isUndefined(w)||w===null)&&t.append(s===!0?gr([p],b,i):s===null?p:p+"[]",f(w))}),!1}return rn(m)?!0:(t.append(gr(y,p,i),f(m)),!1)}const l=[],g=Object.assign(Ni,{defaultVisitor:d,convertValue:f,isVisitable:rn});function h(m,p){if(!E.isUndefined(m)){if(l.indexOf(m)!==-1)throw Error("Circular reference detected in "+p.join("."));l.push(m),E.forEach(m,function(x,j){(!(E.isUndefined(x)||x===null)&&o.call(t,x,E.isString(j)?j.trim():j,p,g))===!0&&h(x,p?p.concat(j):[j])}),l.pop()}}if(!E.isObject(e))throw new TypeError("data must be an object");return h(e),t}function br(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hn(e,t){this._pairs=[],e&&dt(e,this,t)}const ho=hn.prototype;ho.append=function(t,n){this._pairs.push([t,n])};ho.toString=function(t){const n=t?function(r){return t.call(this,r,br)}:br;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Ii(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mo(e,t,n){if(!t)return e;const r=n&&n.encode||Ii,o=n&&n.serialize;let i;if(o?i=o(t,n):i=E.isURLSearchParams(t)?t.toString():new hn(t,n).toString(r),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class vr{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(r){r!==null&&t(r)})}}const yo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ki=typeof URLSearchParams<"u"?URLSearchParams:hn,Bi=typeof FormData<"u"?FormData:null,Fi=typeof Blob<"u"?Blob:null,Di={isBrowser:!0,classes:{URLSearchParams:ki,FormData:Bi,Blob:Fi},protocols:["http","https","file","blob","url","data"]},go=typeof window<"u"&&typeof document<"u",Hi=(e=>go&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),qi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ui=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:go,hasStandardBrowserEnv:Hi,hasStandardBrowserWebWorkerEnv:qi},Symbol.toStringTag,{value:"Module"})),ue={...Ui,...Di};function Vi(e,t){return dt(e,new ue.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return ue.isNode&&E.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function zi(e){return E.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ki(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function bo(e){function t(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),u=i>=n.length;return s=!s&&E.isArray(o)?o.length:s,u?(E.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!E.isObject(o[s]))&&(o[s]=[]),t(n,r,o[s],i)&&E.isArray(o[s])&&(o[s]=Ki(o[s])),!a)}if(E.isFormData(e)&&E.isFunction(e.entries)){const n={};return E.forEachEntry(e,(r,o)=>{t(zi(r),o,n,0)}),n}return null}function $i(e,t,n){if(E.isString(e))try{return(t||JSON.parse)(e),E.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const mn={transitional:yo,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=E.isObject(t);if(i&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return o?JSON.stringify(bo(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Vi(t,this.formSerializer).toString();if((a=E.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return dt(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),$i(t)):t}],transformResponse:[function(t){const n=this.transitional||mn.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&E.isString(t)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?N.from(a,N.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],e=>{mn.headers[e]={}});const yn=mn,Wi=E.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"]),Qi=e=>{const t={};let n,r,o;return e&&e.split(`
5
- `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||t[n]&&Wi[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},xr=Symbol("internals");function Te(e){return e&&String(e).trim().toLowerCase()}function tt(e){return e===!1||e==null?e:E.isArray(e)?e.map(tt):String(e)}function Gi(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Xi=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Kt(e,t,n,r,o){if(E.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!E.isString(t)){if(E.isString(r))return t.indexOf(r)!==-1;if(E.isRegExp(r))return r.test(t)}}function Ji(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Zi(e,t){const n=E.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}class pt{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(a,u,f){const d=Te(u);if(!d)throw new Error("header name must be a non-empty string");const l=E.findKey(o,d);(!l||o[l]===void 0||f===!0||f===void 0&&o[l]!==!1)&&(o[l||u]=tt(a))}const s=(a,u)=>E.forEach(a,(f,d)=>i(f,d,u));return E.isPlainObject(t)||t instanceof this.constructor?s(t,n):E.isString(t)&&(t=t.trim())&&!Xi(t)?s(Qi(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Te(t),t){const r=E.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Gi(o);if(E.isFunction(n))return n.call(this,o,r);if(E.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Te(t),t){const r=E.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Kt(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(s){if(s=Te(s),s){const a=E.findKey(r,s);a&&(!n||Kt(r,r[a],a,n))&&(delete r[a],o=!0)}}return E.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||Kt(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return E.forEach(this,(o,i)=>{const s=E.findKey(r,i);if(s){n[s]=tt(o),delete n[i];return}const a=t?Ji(i):String(i).trim();a!==i&&delete n[i],n[a]=tt(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return E.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&E.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
6
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[xr]=this[xr]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Te(s);r[a]||(Zi(o,s),r[a]=!0)}return E.isArray(t)?t.forEach(i):i(t),this}}pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);E.reduceDescriptors(pt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});E.freezeMethods(pt);const pe=pt;function $t(e,t){const n=this||yn,r=t||n,o=pe.from(r.headers);let i=r.data;return E.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function vo(e){return!!(e&&e.__CANCEL__)}function Fe(e,t,n){N.call(this,e??"canceled",N.ERR_CANCELED,t,n),this.name="CanceledError"}E.inherits(Fe,N,{__CANCEL__:!0});function Yi(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new N("Request failed with status code "+n.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const ea=ue.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];E.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),E.isString(r)&&s.push("path="+r),E.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ta(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function na(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xo(e,t){return e&&!ta(t)?na(e,t):t}const ra=ue.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return t&&(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=o(window.location.href),function(s){const a=E.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function oa(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function sa(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const f=Date.now(),d=r[i];s||(s=f),n[o]=u,r[o]=f;let l=i,g=0;for(;l!==o;)g+=n[l++],l=l%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),f-s<t)return;const h=d&&f-d;return h?Math.round(g*1e3/h):void 0}}function Er(e,t){let n=0;const r=sa(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,u=r(a),f=i<=s;n=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&f?(s-i)/u:void 0,event:o};d[t?"download":"upload"]=!0,e(d)}}const ia=typeof XMLHttpRequest<"u",aa=ia&&function(e){return new Promise(function(n,r){let o=e.data;const i=pe.from(e.headers).normalize();let{responseType:s,withXSRFToken:a}=e,u;function f(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let d;if(E.isFormData(o)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((d=i.getContentType())!==!1){const[p,...y]=d?d.split(";").map(x=>x.trim()).filter(Boolean):[];i.setContentType([p||"multipart/form-data",...y].join("; "))}}let l=new XMLHttpRequest;if(e.auth){const p=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+y))}const g=xo(e.baseURL,e.url);l.open(e.method.toUpperCase(),mo(g,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function h(){if(!l)return;const p=pe.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),x={data:!s||s==="text"||s==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:p,config:e,request:l};Yi(function(w){n(w),f()},function(w){r(w),f()},x),l=null}if("onloadend"in l?l.onloadend=h:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(h)},l.onabort=function(){l&&(r(new N("Request aborted",N.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new N("Network Error",N.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let y=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const x=e.transitional||yo;e.timeoutErrorMessage&&(y=e.timeoutErrorMessage),r(new N(y,x.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,l)),l=null},ue.hasStandardBrowserEnv&&(a&&E.isFunction(a)&&(a=a(e)),a||a!==!1&&ra(g))){const p=e.xsrfHeaderName&&e.xsrfCookieName&&ea.read(e.xsrfCookieName);p&&i.set(e.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in l&&E.forEach(i.toJSON(),function(y,x){l.setRequestHeader(x,y)}),E.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&s!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",Er(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Er(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=p=>{l&&(r(!p||p.type?new Fe(null,e,l):p),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const m=oa(g);if(m&&ue.protocols.indexOf(m)===-1){r(new N("Unsupported protocol "+m+":",N.ERR_BAD_REQUEST,e));return}l.send(o||null)})},on={http:Li,xhr:aa};E.forEach(on,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const wr=e=>`- ${e}`,ua=e=>E.isFunction(e)||e===null||e===!1,Eo={getAdapter:e=>{e=E.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let s;if(r=n,!ua(n)&&(r=on[(s=String(n)).toLowerCase()],r===void 0))throw new N(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
7
- `+i.map(wr).join(`
8
- `):" "+wr(i[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:on};function Wt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fe(null,e)}function Pr(e){return Wt(e),e.headers=pe.from(e.headers),e.data=$t.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Eo.getAdapter(e.adapter||yn.adapter)(e).then(function(r){return Wt(e),r.data=$t.call(e,e.transformResponse,r),r.headers=pe.from(r.headers),r},function(r){return vo(r)||(Wt(e),r&&r.response&&(r.response.data=$t.call(e,e.transformResponse,r.response),r.response.headers=pe.from(r.response.headers))),Promise.reject(r)})}const Rr=e=>e instanceof pe?e.toJSON():e;function Re(e,t){t=t||{};const n={};function r(f,d,l){return E.isPlainObject(f)&&E.isPlainObject(d)?E.merge.call({caseless:l},f,d):E.isPlainObject(d)?E.merge({},d):E.isArray(d)?d.slice():d}function o(f,d,l){if(E.isUndefined(d)){if(!E.isUndefined(f))return r(void 0,f,l)}else return r(f,d,l)}function i(f,d){if(!E.isUndefined(d))return r(void 0,d)}function s(f,d){if(E.isUndefined(d)){if(!E.isUndefined(f))return r(void 0,f)}else return r(void 0,d)}function a(f,d,l){if(l in t)return r(f,d);if(l in e)return r(void 0,f)}const u={url:i,method:i,data:i,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:(f,d)=>o(Rr(f),Rr(d),!0)};return E.forEach(Object.keys(Object.assign({},e,t)),function(d){const l=u[d]||o,g=l(e[d],t[d],d);E.isUndefined(g)&&l!==a||(n[d]=g)}),n}const wo="1.6.7",gn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const _r={};gn.transitional=function(t,n,r){function o(i,s){return"[Axios v"+wo+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(t===!1)throw new N(o(s," has been removed"+(n?" in "+n:"")),N.ERR_DEPRECATED);return n&&!_r[s]&&(_r[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,a):!0}};function ca(e,t,n){if(typeof e!="object")throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new N("option "+i+" must be "+u,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N("Unknown option "+i,N.ERR_BAD_OPTION)}}const sn={assertOptions:ca,validators:gn},me=sn.validators;class ot{constructor(t){this.defaults=t,this.interceptors={request:new vr,response:new vr}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
9
- `+i):r.stack=i}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Re(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&sn.assertOptions(r,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1),o!=null&&(E.isFunction(o)?n.paramsSerializer={serialize:o}:sn.assertOptions(o,{encode:me.function,serialize:me.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&E.merge(i.common,i[n.method]);i&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),n.headers=pe.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const f=[];this.interceptors.response.forEach(function(p){f.push(p.fulfilled,p.rejected)});let d,l=0,g;if(!u){const m=[Pr.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,f),g=m.length,d=Promise.resolve(n);l<g;)d=d.then(m[l++],m[l++]);return d}g=a.length;let h=n;for(l=0;l<g;){const m=a[l++],p=a[l++];try{h=m(h)}catch(y){p.call(this,y);break}}try{d=Pr.call(this,h)}catch(m){return Promise.reject(m)}for(l=0,g=f.length;l<g;)d=d.then(f[l++],f[l++]);return d}getUri(t){t=Re(this.defaults,t);const n=xo(t.baseURL,t.url);return mo(n,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){ot.prototype[t]=function(n,r){return this.request(Re(r||{},{method:t,url:n,data:(r||{}).data}))}});E.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,a){return this.request(Re(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ot.prototype[t]=n(),ot.prototype[t+"Form"]=n(!0)});const nt=ot;class bn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,a){r.reason||(r.reason=new Fe(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new bn(function(o){t=o}),cancel:t}}}const la=bn;function fa(e){return function(n){return e.apply(null,n)}}function da(e){return E.isObject(e)&&e.isAxiosError===!0}const an={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(an).forEach(([e,t])=>{an[t]=e});const pa=an;function Po(e){const t=new nt(e),n=no(nt.prototype.request,t);return E.extend(n,nt.prototype,t,{allOwnKeys:!0}),E.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Po(Re(e,o))},n}const J=Po(yn);J.Axios=nt;J.CanceledError=Fe;J.CancelToken=la;J.isCancel=vo;J.VERSION=wo;J.toFormData=dt;J.AxiosError=N;J.Cancel=J.CanceledError;J.all=function(t){return Promise.all(t)};J.spread=fa;J.isAxiosError=da;J.mergeConfig=Re;J.AxiosHeaders=pe;J.formToJSON=e=>bo(E.isHTMLForm(e)?new FormData(e):e);J.getAdapter=Eo.getAdapter;J.HttpStatusCode=pa;J.default=J;const jr={adminApiURL:"",nextAPIURL:"",invalidateToken:""};class Tr extends M.BaseAPI{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=J.create({baseURL:jr.nextAPIURL,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","Invalidate-Token":jr.invalidateToken},withCredentials:!0});super(r,"api/invalidate");Sn(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 o=n.substring(8);r=o.substring(o.indexOf("/"))}if(n.startsWith("http://")){const o=n.substring(7);r=o.substring(o.indexOf("/"))}return r.startsWith("/")||console.warn("Invalidate: string does not start with /: ",n,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{_path:r})}}const ha={new:e=>new Tr(e),custom:()=>new Tr("")};function vn({pathOrPermalink:e,...t}){const n=ha.new(e),r=M.useApiMutation(n.invalidate,n.queryKey),o=M.useMutate(r,{successMsg:"Page successfully invalidated"});return c.jsx(_.Button,{scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",title:"Regenerate",disabled:r.isLoading,onClick:o,...t,children:c.jsx(_.Icon,{path:ds})})}function ma({path:e,...t}){const n=ce.useNavigate(),r=v.useCallback(()=>{n(e)},[n,e]);return c.jsx(_.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...t,children:c.jsx(_.Icon,{path:ys})})}function Ro(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ro(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ye(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ro(e))&&(r&&(r+=" "),r+=t);return r}const Ae=e=>typeof e=="number"&&!isNaN(e),Ee=e=>typeof e=="string",re=e=>typeof e=="function",rt=e=>Ee(e)||re(e)?e:null,Qt=e=>v.isValidElement(e)||Ee(e)||re(e)||Ae(e);function ya(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function ht(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(s){let{children:a,position:u,preventExitTransition:f,done:d,nodeRef:l,isIn:g}=s;const h=r?`${t}--${u}`:t,m=r?`${n}--${u}`:n,p=v.useRef(0);return v.useLayoutEffect(()=>{const y=l.current,x=h.split(" "),j=w=>{w.target===l.current&&(y.dispatchEvent(new Event("d")),y.removeEventListener("animationend",j),y.removeEventListener("animationcancel",j),p.current===0&&w.type!=="animationcancel"&&y.classList.remove(...x))};y.classList.add(...x),y.addEventListener("animationend",j),y.addEventListener("animationcancel",j)},[]),v.useEffect(()=>{const y=l.current,x=()=>{y.removeEventListener("animationend",x),o?ya(y,d,i):d()};g||(f?x():(p.current=1,y.className+=` ${m}`,y.addEventListener("animationend",x)))},[g]),v.createElement(v.Fragment,null,a)}}function Cr(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const se={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(r=>r!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},Ze=e=>{let{theme:t,type:n,...r}=e;return v.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Gt={info:function(e){return v.createElement(Ze,{...e},v.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(e){return v.createElement(Ze,{...e},v.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(e){return v.createElement(Ze,{...e},v.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(e){return v.createElement(Ze,{...e},v.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 v.createElement("div",{className:"Toastify__spinner"})}};function ga(e){const[,t]=v.useReducer(h=>h+1,0),[n,r]=v.useState([]),o=v.useRef(null),i=v.useRef(new Map).current,s=h=>n.indexOf(h)!==-1,a=v.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:s,getToast:h=>i.get(h)}).current;function u(h){let{containerId:m}=h;const{limit:p}=a.props;!p||m&&a.containerId!==m||(a.count-=a.queue.length,a.queue=[])}function f(h){r(m=>h==null?[]:m.filter(p=>p!==h))}function d(){const{toastContent:h,toastProps:m,staleId:p}=a.queue.shift();g(h,m,p)}function l(h,m){let{delay:p,staleId:y,...x}=m;if(!Qt(h)||function(D){return!o.current||a.props.enableMultiContainer&&D.containerId!==a.props.containerId||i.has(D.toastId)&&D.updateId==null}(x))return;const{toastId:j,updateId:w,data:b}=x,{props:P}=a,T=()=>f(j),C=w==null;C&&a.count++;const R={...P,style:P.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(x).filter(D=>{let[I,H]=D;return H!=null})),toastId:j,updateId:w,data:b,closeToast:T,isIn:!1,className:rt(x.className||P.toastClassName),bodyClassName:rt(x.bodyClassName||P.bodyClassName),progressClassName:rt(x.progressClassName||P.progressClassName),autoClose:!x.isLoading&&(A=x.autoClose,S=P.autoClose,A===!1||Ae(A)&&A>0?A:S),deleteToast(){const D=Cr(i.get(j),"removed");i.delete(j),se.emit(4,D);const I=a.queue.length;if(a.count=j==null?a.count-a.displayedToast:a.count-1,a.count<0&&(a.count=0),I>0){const H=j==null?a.props.limit:1;if(I===1||H===1)a.displayedToast++,d();else{const q=H>I?I:H;a.displayedToast=q;for(let V=0;V<q;V++)d()}}else t()}};var A,S;R.iconOut=function(D){let{theme:I,type:H,isLoading:q,icon:V}=D,$=null;const U={theme:I,type:H};return V===!1||(re(V)?$=V(U):v.isValidElement(V)?$=v.cloneElement(V,U):Ee(V)||Ae(V)?$=V:q?$=Gt.spinner():(K=>K in Gt)(H)&&($=Gt[H](U))),$}(R),re(x.onOpen)&&(R.onOpen=x.onOpen),re(x.onClose)&&(R.onClose=x.onClose),R.closeButton=P.closeButton,x.closeButton===!1||Qt(x.closeButton)?R.closeButton=x.closeButton:x.closeButton===!0&&(R.closeButton=!Qt(P.closeButton)||P.closeButton);let O=h;v.isValidElement(h)&&!Ee(h.type)?O=v.cloneElement(h,{closeToast:T,toastProps:R,data:b}):re(h)&&(O=h({closeToast:T,toastProps:R,data:b})),P.limit&&P.limit>0&&a.count>P.limit&&C?a.queue.push({toastContent:O,toastProps:R,staleId:y}):Ae(p)?setTimeout(()=>{g(O,R,y)},p):g(O,R,y)}function g(h,m,p){const{toastId:y}=m;p&&i.delete(p);const x={content:h,props:m};i.set(y,x),r(j=>[...j,y].filter(w=>w!==p)),se.emit(4,Cr(x,x.props.updateId==null?"added":"updated"))}return v.useEffect(()=>(a.containerId=e.containerId,se.cancelEmit(3).on(0,l).on(1,h=>o.current&&f(h)).on(5,u).emit(2,a),()=>{i.clear(),se.emit(3,a)}),[]),v.useEffect(()=>{a.props=e,a.isToastActive=s,a.displayedToast=n.length}),{getToastToRender:function(h){const m=new Map,p=Array.from(i.values());return e.newestOnTop&&p.reverse(),p.forEach(y=>{const{position:x}=y.props;m.has(x)||m.set(x,[]),m.get(x).push(y)}),Array.from(m,y=>h(y[0],y[1]))},containerRef:o,isToastActive:s}}function Or(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Ar(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function ba(e){const[t,n]=v.useState(!1),[r,o]=v.useState(!1),i=v.useRef(null),s=v.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,a=v.useRef(e),{autoClose:u,pauseOnHover:f,closeToast:d,onClick:l,closeOnClick:g}=e;function h(b){if(e.draggable){b.nativeEvent.type==="touchstart"&&b.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",x),document.addEventListener("mouseup",j),document.addEventListener("touchmove",x),document.addEventListener("touchend",j);const P=i.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=P.getBoundingClientRect(),P.style.transition="",s.x=Or(b.nativeEvent),s.y=Ar(b.nativeEvent),e.draggableDirection==="x"?(s.start=s.x,s.removalDistance=P.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=P.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function m(b){if(s.boundingRect){const{top:P,bottom:T,left:C,right:R}=s.boundingRect;b.nativeEvent.type!=="touchend"&&e.pauseOnHover&&s.x>=C&&s.x<=R&&s.y>=P&&s.y<=T?y():p()}}function p(){n(!0)}function y(){n(!1)}function x(b){const P=i.current;s.canDrag&&P&&(s.didMove=!0,t&&y(),s.x=Or(b),s.y=Ar(b),s.delta=e.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),P.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,P.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function j(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",j),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",j);const b=i.current;if(s.canDrag&&s.didMove&&b){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),void e.closeToast();b.style.transition="transform 0.2s, opacity 0.2s",b.style.transform=`translate${e.draggableDirection}(0)`,b.style.opacity="1"}}v.useEffect(()=>{a.current=e}),v.useEffect(()=>(i.current&&i.current.addEventListener("d",p,{once:!0}),re(e.onOpen)&&e.onOpen(v.isValidElement(e.children)&&e.children.props),()=>{const b=a.current;re(b.onClose)&&b.onClose(v.isValidElement(b.children)&&b.children.props)}),[]),v.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||y(),window.addEventListener("focus",p),window.addEventListener("blur",y)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",p),window.removeEventListener("blur",y))}),[e.pauseOnFocusLoss]);const w={onMouseDown:h,onTouchStart:h,onMouseUp:m,onTouchEnd:m};return u&&f&&(w.onMouseEnter=y,w.onMouseLeave=p),g&&(w.onClick=b=>{l&&l(b),s.canCloseOnClick&&d()}),{playToast:p,pauseToast:y,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:w}}function _o(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return v.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},v.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},v.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 va(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:s,style:a,controlledProgress:u,progress:f,rtl:d,isIn:l,theme:g}=e;const h=i||u&&f===0,m={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:h?0:1};u&&(m.transform=`scaleX(${f})`);const p=ye("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":d}),y=re(s)?s({rtl:d,type:o,defaultClassName:p}):ye(p,s);return v.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:y,style:m,[u&&f>=1?"onTransitionEnd":"onAnimationEnd"]:u&&f<1?null:()=>{l&&r()}})}const xa=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=ba(e),{closeButton:i,children:s,autoClose:a,onClick:u,type:f,hideProgressBar:d,closeToast:l,transition:g,position:h,className:m,style:p,bodyClassName:y,bodyStyle:x,progressClassName:j,progressStyle:w,updateId:b,role:P,progress:T,rtl:C,toastId:R,deleteToast:A,isIn:S,isLoading:O,iconOut:D,closeOnClick:I,theme:H}=e,q=ye("Toastify__toast",`Toastify__toast-theme--${H}`,`Toastify__toast--${f}`,{"Toastify__toast--rtl":C},{"Toastify__toast--close-on-click":I}),V=re(m)?m({rtl:C,position:h,type:f,defaultClassName:q}):ye(q,m),$=!!T||!a,U={closeToast:l,type:f,theme:H};let K=null;return i===!1||(K=re(i)?i(U):v.isValidElement(i)?v.cloneElement(i,U):_o(U)),v.createElement(g,{isIn:S,done:A,position:h,preventExitTransition:n,nodeRef:r},v.createElement("div",{id:R,onClick:u,className:V,...o,style:p,ref:r},v.createElement("div",{...S&&{role:P},className:re(y)?y({type:f}):ye("Toastify__toast-body",y),style:x},D!=null&&v.createElement("div",{className:ye("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!O})},D),v.createElement("div",null,s)),K,v.createElement(va,{...b&&!$?{key:`pb-${b}`}:{},rtl:C,theme:H,delay:a,isRunning:t,isIn:S,closeToast:l,hide:d,type:f,style:w,className:j,controlledProgress:$,progress:T||0})))},mt=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},Ea=ht(mt("bounce",!0));ht(mt("slide",!0));ht(mt("zoom"));ht(mt("flip"));const Sr=v.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=ga(e),{className:i,style:s,rtl:a,containerId:u}=e;function f(d){const l=ye("Toastify__toast-container",`Toastify__toast-container--${d}`,{"Toastify__toast-container--rtl":a});return re(i)?i({position:d,rtl:a,defaultClassName:l}):ye(l,rt(i))}return v.useEffect(()=>{t&&(t.current=r.current)},[]),v.createElement("div",{ref:r,className:"Toastify",id:u},n((d,l)=>{const g=l.length?{...s}:{...s,pointerEvents:"none"};return v.createElement("div",{className:f(d),style:g,key:`container-${d}`},l.map((h,m)=>{let{content:p,props:y}=h;return v.createElement(xa,{...y,isIn:o(y.toastId),style:{...y.style,"--nth":m+1,"--len":l.length},key:`toast-${y.key}`},p)}))}))});Sr.displayName="ToastContainer",Sr.defaultProps={position:"top-right",transition:Ea,autoClose:5e3,closeButton:_o,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Xt,xe=new Map,Ce=[],wa=1;function jo(){return""+wa++}function Pa(e){return e&&(Ee(e.toastId)||Ae(e.toastId))?e.toastId:jo()}function Se(e,t){return xe.size>0?se.emit(0,e,t):Ce.push({content:e,options:t}),t.toastId}function st(e,t){return{...t,type:t&&t.type||e,toastId:Pa(t)}}function Ye(e){return(t,n)=>Se(t,st(e,n))}function L(e,t){return Se(e,st("default",t))}L.loading=(e,t)=>Se(e,st("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),L.promise=function(e,t,n){let r,{pending:o,error:i,success:s}=t;o&&(r=Ee(o)?L.loading(o,n):L.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(d,l,g)=>{if(l==null)return void L.dismiss(r);const h={type:d,...a,...n,data:g},m=Ee(l)?{render:l}:l;return r?L.update(r,{...h,...m}):L(m.render,{...h,...m}),g},f=re(e)?e():e;return f.then(d=>u("success",s,d)).catch(d=>u("error",i,d)),f},L.success=Ye("success"),L.info=Ye("info"),L.error=Ye("error"),L.warning=Ye("warning"),L.warn=L.warning,L.dark=(e,t)=>Se(e,st("default",{theme:"dark",...t})),L.dismiss=e=>{xe.size>0?se.emit(1,e):Ce=Ce.filter(t=>e!=null&&t.options.toastId!==e)},L.clearWaitingQueue=function(e){return e===void 0&&(e={}),se.emit(5,e)},L.isActive=e=>{let t=!1;return xe.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},L.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const s=xe.get(i||Xt);return s&&s.getToast(r)}(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:jo()};i.toastId!==e&&(i.staleId=e);const s=i.render||o;delete i.render,Se(s,i)}},0)},L.done=e=>{L.update(e,{progress:1})},L.onChange=e=>(se.on(4,e),()=>{se.off(4,e)}),L.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"},L.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},se.on(2,e=>{Xt=e.containerId||e,xe.set(Xt,e),Ce.forEach(t=>{se.emit(0,t.content,t.options)}),Ce=[]}).on(3,e=>{xe.delete(e.containerId||e),xe.size===0&&se.off(0).off(1).off(5)});function To({status:e,queryId:t,api:n,...r}){const o=e=="draft",i=M.useInvalidateMutation(o?n.publish:n.unpublish,n.queryKey,t,{networkMode:"always"}),s=v.useCallback(()=>{i.reset(),i.mutateAsync(t).then(()=>L.success(o?"Published!":"Unpublished!")).catch(a=>L.error(`Error: ${a}`))},[i,t]);return c.jsxs(_.Button,{scheme:"secondary",variant:"glass",corners:"pill",px:"4",disabled:i.isLoading,onClick:s,dflex:!0,alignItems:"center",gap:"3",...r,children:[c.jsx(_.Icon,{path:o?cn:ps}),o?"Publish":"Switch to draft"]})}function un(){return un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},un.apply(this,arguments)}var Co=["shift","alt","meta","mod","ctrl"],Ra={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 ge(e){return(Ra[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function _a(e){return Co.includes(e)}function Jt(e,t){return t===void 0&&(t=","),e.split(t)}function Zt(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(s){return ge(s)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},i=r.filter(function(s){return!Co.includes(s)});return un({},o,{keys:i,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Oo([ge(e.key),ge(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Ao([ge(e.key),ge(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){be.clear()})})();var be=new Set;function xn(e){return Array.isArray(e)}function ja(e,t){t===void 0&&(t=",");var n=xn(e)?e:e.split(t);return n.every(function(r){return be.has(r.trim().toLowerCase())})}function Oo(e){var t=Array.isArray(e)?e:[e];be.has("meta")&&be.forEach(function(n){return!_a(n)&&be.delete(n.toLowerCase())}),t.forEach(function(n){return be.add(n.toLowerCase())})}function Ao(e){var t=Array.isArray(e)?e:[e];e==="meta"?be.clear():t.forEach(function(n){return be.delete(n.toLowerCase())})}function Ta(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function Ca(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function Oa(e){return So(e,["input","textarea","select"])}function So(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return xn(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function Aa(e,t){return e.length===0&&t?(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):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var Sa=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,i=n.meta,s=n.mod,a=n.shift,u=n.ctrl,f=n.keys,d=t.key,l=t.code,g=t.ctrlKey,h=t.metaKey,m=t.shiftKey,p=t.altKey,y=ge(l),x=d.toLowerCase();if(!(f!=null&&f.includes(y))&&!(f!=null&&f.includes(x))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(y))return!1;if(!r){if(o===!p&&x!=="alt"||a===!m&&x!=="shift")return!1;if(s){if(!h&&!g)return!1}else if(i===!h&&x!=="meta"&&x!=="os"||u===!g&&x!=="ctrl"&&x!=="control")return!1}return f&&f.length===1&&(f.includes(x)||f.includes(y))?!0:f?ja(f):!f},La=v.createContext(void 0),Ma=function(){return v.useContext(La)};function Lo(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&Lo(e[r],t[r])},!0):e===t}var Na=v.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Ia=function(){return v.useContext(Na)};function ka(e){var t=v.useRef(void 0);return Lo(t.current,e)||(t.current=e),t.current}var Lr=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Ba=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Mo(e,t,n,r){var o=v.useRef(null),i=v.useRef(!1),s=n instanceof Array?r instanceof Array?void 0:r:n,a=xn(e)?e.join(s==null?void 0:s.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,f=v.useCallback(t,u??[]),d=v.useRef(f);u?d.current=f:d.current=t;var l=ka(s),g=Ia(),h=g.enabledScopes,m=Ma();return Ba(function(){if(!((l==null?void 0:l.enabled)===!1||!Aa(h,l==null?void 0:l.scopes))){var p=function(b,P){var T;if(P===void 0&&(P=!1),!(Oa(b)&&!So(b,l==null?void 0:l.enableOnFormTags))){if(o.current!==null){var C=o.current.getRootNode();if((C instanceof Document||C instanceof ShadowRoot)&&C.activeElement!==o.current&&!o.current.contains(C.activeElement)){Lr(b);return}}(T=b.target)!=null&&T.isContentEditable&&!(l!=null&&l.enableOnContentEditable)||Jt(a,l==null?void 0:l.splitKey).forEach(function(R){var A,S=Zt(R,l==null?void 0:l.combinationKey);if(Sa(b,S,l==null?void 0:l.ignoreModifiers)||(A=S.keys)!=null&&A.includes("*")){if(l!=null&&l.ignoreEventWhen!=null&&l.ignoreEventWhen(b)||P&&i.current)return;if(Ta(b,S,l==null?void 0:l.preventDefault),!Ca(b,S,l==null?void 0:l.enabled)){Lr(b);return}d.current(b,S),P||(i.current=!0)}})}},y=function(b){b.key!==void 0&&(Oo(ge(b.code)),((l==null?void 0:l.keydown)===void 0&&(l==null?void 0:l.keyup)!==!0||l!=null&&l.keydown)&&p(b))},x=function(b){b.key!==void 0&&(Ao(ge(b.code)),i.current=!1,l!=null&&l.keyup&&p(b,!0))},j=o.current||(s==null?void 0:s.document)||document;return j.addEventListener("keyup",x),j.addEventListener("keydown",y),m&&Jt(a,l==null?void 0:l.splitKey).forEach(function(w){return m.addHotkey(Zt(w,l==null?void 0:l.combinationKey,l==null?void 0:l.description))}),function(){j.removeEventListener("keyup",x),j.removeEventListener("keydown",y),m&&Jt(a,l==null?void 0:l.splitKey).forEach(function(w){return m.removeHotkey(Zt(w,l==null?void 0:l.combinationKey,l==null?void 0:l.description))})}}},[a,l,h]),o}function No({...e}){const{dirty:t,handleSubmit:n}=Me.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}};return Mo("ctrl+s",()=>{t&&!e.disabled&&n()},{preventDefault:!0},[t,e,n]),c.jsxs(te.SubmitButton,{type:"submit",corners:"pill",px:"4",dflex:!0,alignItems:"center",gap:"3",...e,children:[c.jsx(_.Icon,{path:fs}),"Update"]})}function Io({path:e,icon:t,...n}){const r=v.useCallback(()=>{window.open(e,"_blank")},[e]);return c.jsx(_.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...n,children:c.jsx(_.Icon,{path:t??ln})})}function Fa({api:e,postId:t,order:n}){const r=M.useInvalidateMutation(e.moveDown,e.queryKey),o=M.useInvalidateMutation(e.moveUp,e.queryKey),i=v.useCallback(a=>{a.stopPropagation(),r.mutateAsync(t).catch(u=>{L.error(`Error: ${u}`)})},[r,t]),s=v.useCallback(a=>{a.stopPropagation(),o.mutateAsync(t).catch(u=>{L.error(`Error: ${u}`)})},[o,t]);return c.jsxs(X.FlexCenter,{placeContent:"start",numericFontVariant:"tabular-nums",children:[n,c.jsx(_.Button,{ms:"3",variant:"borderless",scheme:"dark",onClick:s,children:c.jsx(_.Icon,{path:cs})}),c.jsx(_.Button,{variant:"borderless",scheme:"dark",onClick:i,children:c.jsx(_.Icon,{path:us})})]})}function yt({children:e,...t}){return c.jsx(_.Container,{center:!0,dflex:!0,flexCol:!0,gap:"8",...t,children:e})}function ko({children:e,...t}){return c.jsx(_.Tile,{scheme:"light",p:"5",...t,children:e})}function Bo({name:e,...t}){return c.jsx(ko,{h:"min",...t,children:c.jsx(os.FormEditor,{minH:"128",minW:"144",name:e,placeHolder:"Write here..."})})}function Da({queryId:e,api:t,children:n,...r}){const{data:o,isLoading:i,isError:s}=M.useApiQuery(t.queryKey,t.get,e),a=M.useInvalidateQuery(t.queryKey,e);return i?c.jsx(X.QueryLoadingState,{w:"full",h:"100%"}):s?c.jsx(X.RetryOnError,{p:"0",onClick:a}):c.jsx(yt,{...r,children:n(o)})}const En=v.forwardRef(Da);function Fo({children:e,...t}){return c.jsx("div",{w:"112",minW:"112",minH:"100%",gap:"8",dflex:!0,flexCol:!0,...t,children:e})}function Do({title:e,children:t,...n}){return c.jsxs("div",{w:"full",bgColor:"white",rounded:!0,p:"5",textSize:"sm",...n,children:[e&&c.jsx(ss.PageSectionTitle,{children:e}),t]})}function wn({children:e,...t}){return c.jsx("div",{trait:"typo.h5",children:e})}function Pn({title:e,breadcrumbs:t,children:n,...r}){return c.jsxs(X.FlexCenter,{gap:"3",minH:"9",...r,children:[e&&c.jsx(wn,{children:e}),t&&c.jsx(dn,{breadcrumbs:t}),c.jsx("div",{flexGrow:!0}),n]})}const[Ha,Ho]=z.createContext();function qo({children:e}){const[t,n]=v.useState(null);return v.createRef(),c.jsx(Ha,{value:{containerEl:t,setContainerEl:n},children:e})}function Uo({title:e,breadcrumbs:t,children:n,...r}){const o=v.createRef(),{setContainerEl:i}=Ho(),[s,a]=v.useState(!1);return v.useEffect(()=>(!s&&o.current&&(i(o.current),a(!0)),()=>i(null)),[]),c.jsx(X.FlexCenter,{gap:"3",minH:"9",...r,children:c.jsxs(c.Fragment,{children:[e&&c.jsx(wn,{children:e}),t&&c.jsx(dn,{breadcrumbs:t}),c.jsx("div",{flexGrow:!0}),c.jsx("div",{ref:o,dflex:!0,flexRow:!0,gap:"3"}),n]})})}function Vo({trackingRef:e,children:t}){const{containerEl:n}=Ho(),[r,o]=v.useState(!1),i=v.useMemo(()=>n,[n]),s=n??(typeof window<"u"?document.body:void 0);v.useLayoutEffect(()=>{if(!(!i||!s)){try{r?s.appendChild(i):s.removeChild(i)}catch{}return()=>{try{s.removeChild(i)}catch{}}}},[r,i,s]);const a=v.useCallback(u=>{o(u[0].isVisible)},[t]);return v.useEffect(()=>{const u={root:null,rootMargin:"0px",threshold:0,trackVisibility:!0,delay:100},f=new IntersectionObserver(a,u);return e&&f.observe(e),()=>f.disconnect()},[e,a,t]),s&&i?is.createPortal(t,i):null}function qa({tabbed:e,breadcrumbs:t,api:n,item:r,isLoading:o,buttonBar:i,trackingRef:s}){return c.jsxs(c.Fragment,{children:[e&&c.jsx(Vo,{trackingRef:s,children:c.jsx(Mr,{api:n,item:r,isLoading:o,buttonBar:i})}),!e&&c.jsx(Pn,{breadcrumbs:t,children:c.jsx(Mr,{api:n,item:r,isLoading:o,buttonBar:i})})]})}function Mr({api:e,item:t,isLoading:n,buttonBar:r}){return c.jsxs(c.Fragment,{children:[r==null?void 0:r.map((o,i)=>c.jsxs(v.Fragment,{children:[o.type==="link"&&c.jsx(Io,{path:o.path,icon:o.icon}),o.type==="invalidate"&&c.jsx(vn,{pathOrPermalink:o.pathOrPermalink}),o.type=="custom"&&o.render(t)]},i)),c.jsx(To,{api:e,queryId:t.id,status:t.status,disabled:n}),c.jsx(No,{disabled:n})]})}function Ua({queryField:e,api:t,processInput:n,screen:r,tabbed:o,...i}){const{[e]:s}=ce.useParams(),a=v.useRef(null);return c.jsx(En,{api:t,queryId:s,ref:a,p:"5",...i,children:u=>c.jsx(Va,{item:u,screen:r,api:t,tabbed:o,processInput:n,containerRef:a})})}function Va({item:e,screen:t,api:n,processInput:r,tabbed:o,containerRef:i}){const{breadcrumbs:s,schema:a,initialValues:u,header:f,editorFooter:d,sections:l,buttonBar:g,editor:h,type:m,invalidateParentQueryKey:p}=z.runIfFn(t,e),y=M.useInvalidateParentMutation(n.update,p??n.queryKey,{networkMode:"always"}),x=M.useMutate(y,{processInput:r,successMsg:w=>`${w.title} updated.`,errorMsg:(w,b)=>`Error updating ${b.title}: ${w}`});let j;return m=="post"?j="calc(1280px - 30rem)":m=="section"&&(j="calc(1280px - 22rem)"),c.jsxs(te.FormProvider,{initialValues:z.runIfFn(u,e),validationSchema:a,onSubmit:x,enableReinitialize:!0,children:[c.jsx(qa,{tabbed:o,api:n,breadcrumbs:s,buttonBar:g,item:e,isLoading:y.isLoading,trackingRef:i==null?void 0:i.current}),c.jsxs(yt,{w:j?"auto":"full",size:"x2",id:"pagecontainer",children:[f,c.jsxs("div",{dflex:!0,gap:"8",children:[c.jsxs("div",{dflex:!0,flexCol:!0,gap:"8",flexGrow:!0,children:[(h==null?void 0:h.type)!="textarea"&&c.jsx(Bo,{name:"content",maxW:j,minW:"144"}),(h==null?void 0:h.type)=="textarea"&&c.jsx(te.TextArea,{name:h==null?void 0:h.name,maxW:j,minW:j,minH:"128",rows:25,bgColor:"white",border:"0",p:"5",textColor:"slate-800"}),d]}),c.jsx(Fo,{children:l==null?void 0:l.map((w,b)=>c.jsx(za,{section:w,item:e},b))})]})]})]})}function za({section:e,item:t}){return e.type==="section"?c.jsx(Do,{title:e.title,children:c.jsx(te.FormRenderer,{form:z.runIfFn(e.form,t)})}):e.type==="custom"?z.runIfFn(e.component,t):null}function Ka(e,t){const n=ce.useParams();if(t===void 0)return{id:void 0,api:e};const{[t]:r}=n;return{id:r,api:z.runIfFn(e,r)}}function $a({api:e,queryField:t,fn:n,transformFn:r,config:o,tabbed:i,...s}){const{id:a,api:u}=Ka(e,t),{data:f}=M.useApiQuery(u.queryKey,n==="get"||n==="getTransformed"?u.get:u.getAll,z.isFunction(e)?void 0:a),d=v.useMemo(()=>f&&(n==="getTransformed"||n==="getAllTransformed")?(r||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${n}`),r==null?void 0:r(f)):f,[f]);return f?c.jsx(gt,{config:o(d),tabbed:i,...s}):null}function Wa({queryField:e,api:t,screen:n,...r}){const{[e]:o}=ce.useParams();return c.jsx(En,{queryId:o,api:t,p:"5",children:i=>{const{breadcrumbs:s,tabs:a}=z.runIfFn(n,i);return c.jsxs(qo,{children:[c.jsx(Uo,{breadcrumbs:s,mb:"-3"}),c.jsx(X.TabContainer,{tabs:a.map(u=>u.label),saveKey:`tab-${o}`,mt:"-3",mb:"3",id:"fff",children:a.map((u,f)=>c.jsx(Qa,{tab:u},f))})]})}})}function Qa({tab:e}){if(!e.component&&!e.config)throw new Error(`Screen config for tabbed view: one of your tabs does not have a component or config declared: ${e.label}`);return e.component?e.component():c.jsx(gt,{config:e.config,tabbed:!0,p:"0"})}const[Ga,Xa]=z.createContext();function Nr(e){return e.accessorKey??e.id}function Ja({initialVisibleColumns:e,columns:t,children:n}){const[r,o]=v.useState(!1),[i,s]=v.useState(!1),[a,u]=v.useState(e??(t==null?void 0:t.map(m=>Nr(m)))??[]),f=(t==null?void 0:t.filter(m=>a.includes(Nr(m))))??[],d=v.useCallback(m=>{const p=a.indexOf(m);if(p>-1){const y=a.concat();y.splice(p,1),u(y)}else u(a.concat(m))},[a,u]),l=v.useCallback(m=>a.includes(m),[a]),g=Ga,h={showFilters:r,setShowFilters:o,showMassActions:i,setShowMassActions:s,columns:t??[],filteredColumns:f,toggleColumnVisibility:d,isColumnVisible:l};return c.jsx(g,{value:h,children:n})}function zo({initialPageSize:e,initialVisibleColumns:t,columns:n,children:r,...o}){return c.jsx(_.Tile,{scheme:"light",shadow:!0,rounded:"md",px:"0",py:"4",w:"full",dflex:!0,flexCol:!0,...o,children:c.jsx(ke.TableContextProvider,{initialPageSize:e,children:c.jsx(Ja,{columns:n,initialVisibleColumns:t,children:r})})})}function Ko({children:e,...t}){return c.jsx(ut,{scheme:"default",corners:"pill",h:"10",variant:"glass",...t,children:e??c.jsx(_.Icon,{path:ms})})}function $o({...e}){return c.jsxs(_.Popover,{side:"bottom-end",modal:!0,children:[c.jsx(_.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",...e,children:c.jsx(_.Icon,{path:hs})}),c.jsxs("div",{bgColor:"white",rounded:!0,shadow:!0,children:[c.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"First Item"}),c.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Second Item"}),c.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Third Item"})]})]})}function Wo({title:e,queryKey:t,children:n,...r}){const o=M.useInvalidateQuery(t);return Mo("ctrl+r",()=>o(),{preventDefault:!0},[o]),c.jsxs("div",{dflex:!0,flexRow:!0,pb:"4",alignItems:"center",gap:"3",px:"8",borderB:"0.5",borderBColor:"--bg-2",...r,children:[e&&c.jsx("h2",{textSize:"x3",fontWeight:"600",textColor:"#3f4254",textTransform:"capitalize",children:e}),c.jsx("div",{flexGrow:!0,children:" "}),c.jsxs("div",{spaceX:"2",dflex:!0,alignItems:"center",children:[c.jsx(_.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",onClick:o,children:c.jsx(_.Icon,{path:gs})}),n]})]})}const Ir="Oops, something went wrong...";function kr(e){if(e){const t={...e};for(const n in e)t[n]=t[n]??"";return t}return e}function Rn({initialValues:e,itemLabel:t,queryId:n="",api:r,queryFetchOptions:o,querySaveOptions:i,onSuccess:s,onFetchError:a,fetchErrorMsg:u=Ir,onSaveError:f,saveErrorMsg:d=Ir,fetchToFormData:l,formToQueryData:g,invalidateQueriesOnSuccess:h=!0,invalidateQueryKey:m,retryText:p="Retry",cancelLabel:y="Cancel",saveLabel:x,size:j="lg",title:w,form:b,show:P,onClose:T,formikProps:C,...R}){const{isInitialLoading:A,isFetching:S,data:O,isError:D,error:I,refetch:H}=M.useApiQuery(r.queryKey,r.get,n,{enabled:!(n==""||n==null||n==null),onError:a,...o}),q=h?M.useInvalidateParentMutation(r.upsert,m??r.queryKey,i):M.useApiMutation(r.upsert,r.queryKey,n,i),V=v.useCallback(()=>H(),[H]),$=v.useCallback(async(U,K)=>{q.reset();const W=g?g(U):{...U};await q.mutateAsync(W).then(ne=>{s?s(W,ne):L.success(`${w?w(W):W.name??W.title} ${n?"saved":"created"}`),T==null||T()}).catch(ne=>{console.error("on error",ne),f?f(U):L.error(`Couldn't save ${w?w(W):W.name??W.title}`),K.setSubmitting(!1)})},[q,g,s,f,T]);return c.jsxs(_.Modal,{size:j,show:P,onClose:T,scheme:"light",transition:!0,...R,children:[c.jsxs(_.Modal.Header,{children:[!A&&n&&`Edit ${w?w(O):(O==null?void 0:O.name)??(O==null?void 0:O.title)??""}`,!n&&`Create new ${t??"item"}`,Array.isArray(b)&&c.jsx(c.Fragment,{})]}),A&&c.jsx(_.Modal.Body,{children:c.jsx(X.QueryLoadingState,{minW:"72"})}),D&&c.jsx(_.Modal.Body,{children:c.jsx(X.RetryOnError,{label:`${u} ${I}`,onClick:V})}),!A&&!D&&c.jsx(c.Fragment,{children:c.jsx(Me.Formik,{initialValues:l&&n&&O?l(kr(O)):kr(e(O))??{},onSubmit:$,...C,children:({setFieldValue:U,dirty:K,handleSubmit:W,isValid:ne,values:Q})=>c.jsxs(c.Fragment,{children:[c.jsx(_.Modal.Body,{pb:"6",children:c.jsxs(Me.Form,{children:[v.isValidElement(b)&&b,Array.isArray(b)&&c.jsx(te.FormRenderer,{form:b}),z.isFunction(b)&&c.jsx(te.FormRenderer,{form:b(O??Q)})]})}),c.jsxs(_.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[c.jsx(_.Button,{disabled:q.isLoading,onClick:T,variant:"borderless",me:"2",children:y}),c.jsx(_.Button,{type:"submit",disabled:!K||q.isLoading,onClick:()=>W(),children:x||(n?"Update":"Create")})]})]})})}),q.isLoading&&c.jsx(X.ModalLoadingOverlay,{})]})}function Za({api:e,fn:t,transformFn:n,config:r,onClose:o,queryId:i,invalidateQueryKey:s}){const{data:a,isFetching:u}=M.useApiQuery(e.queryKey,t==="get"||t==="getTransformed"?e.get:e.getAll,void 0,{retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1}),f=v.useMemo(()=>a&&(t==="getTransformed"||t==="getAllTransformed")?(n||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${t}`),n==null?void 0:n(a)):a,[a,t,n]);return u?null:c.jsx(Rn,{...r(f),queryId:i,invalidateQueryKey:s,show:!0,onClose:o})}function Ya({queries:e,config:t,onClose:n,queryId:r,invalidateQueryKey:o}){const{data:i,isFetching:s,isError:a}=M.useApiQueries(e.map(f=>({queryKey:f.api.queryKey,queryFn:f.fn=="get"?f.api.get:f.api.getAll,queryOptions:{cacheTime:f.cache===!1?0:void 0,staleTime:f.cache===!1?0:void 0}}))),u=v.useMemo(()=>i==null?void 0:i.map((f,d)=>{var l,g;return e[d].transformFn?(g=(l=e[d])==null?void 0:l.transformFn)==null?void 0:g.call(l,f):f}),[i,e]);return c.jsx(Rn,{isPreloading:s,...t(...u),queryId:r,invalidateQueryKey:o,show:!0,onClose:n})}function Qo({config:e,onClose:t,invalidateQueryKey:n,queryId:r}){const{type:o,...i}=e;return e.type==="dialog"?c.jsx(Rn,{...i,queryId:r,invalidateQueryKey:n,show:!0,onClose:t}):e.type==="query"?c.jsx(Za,{...i,queryId:r,invalidateQueryKey:n,onClose:t}):e.type==="multiQuery"?c.jsx(Ya,{...i,queryId:r,invalidateQueryKey:n,onClose:t}):null}function eu({itemLabel:e,queryId:t="",api:n,invalidateQueriesOnSuccess:r=!0,invalidateQueryKey:o,size:i="lg",show:s,onClose:a,...u}){const f=r?M.useInvalidateParentMutation(n.delete,o??n.queryKey):M.useApiMutation(n.upsert,n.queryKey),d=M.useMutate(f,{onSuccess:()=>a==null?void 0:a()}),l=v.useCallback(()=>d(t),[d,t]);return c.jsxs(_.Modal,{size:i,show:s,onClose:a,scheme:"danger",variant:"glass",transition:!0,...u,children:[c.jsx(_.Modal.Header,{children:`Delete ${e}`}),c.jsxs(_.Modal.Body,{pb:"6",children:["Do you really want to delete ",e,"?"]}),c.jsxs(_.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[c.jsx(_.Button,{disabled:f.isLoading,onClick:a,variant:"borderless",scheme:"secondary",me:"2",children:"Cancel"}),c.jsx(_.Button,{scheme:"danger",disabled:f.isLoading,onClick:l,children:"Delete"})]}),f.isLoading&&c.jsx(X.ModalLoadingOverlay,{})]})}const[tu,Go]=z.createContext();function nu({editView:e,deleteItem:t,queryKey:n,children:r}){const o=zr.useOpenLink(),i=ce.useNavigate(),[s,a]=v.useState(null),u=v.useCallback(()=>a(null),[a]),f=v.useCallback((g,h)=>{switch(g.type){case"view":{i(z.runIfFn(g.path,h));break}case"link":{o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${z.runIfFn(g.path,h)}`);break}case"edit":{e.type=="customDialog"?a(e.render({show:!0,onClose:u})):a(c.jsx(Qo,{onClose:u,config:e,queryId:h.id,invalidateQueryKey:n}));break}case"delete":{a(c.jsx(eu,{show:!0,onClose:u,queryId:h.id,invalidateQueryKey:n,...t,itemLabel:z.runIfFn(t.itemLabel,h)}));break}}},[i,e,t]),d=tu,l={dialog:s,onAction:f};return c.jsx(d,{value:l,children:r})}/**
10
- * table-core
11
- *
12
- * Copyright (c) TanStack
13
- *
14
- * This source code is licensed under the MIT license found in the
15
- * LICENSE.md file in the root directory of this source tree.
16
- *
17
- * @license MIT
18
- */function ru(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function ou({id:e,api:t,status:n,invalidateQueryKey:r,...o}){const i=n=="draft",s=M.useInvalidateParentMutation(i?t.publish:t.unpublish,r??t.queryKey,{networkMode:"always"}),a=v.useCallback(u=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),s.reset(),s.mutateAsync(e).then(()=>L.success(i?"Published!":"Unpublished!")).catch(f=>L.error(`Error: ${f}`))},[s,e]);return c.jsx(_.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:c.jsx(_.Icon,{path:i?Wr:Qr})})}function su({row:e,onAction:t,rowActions:n,api:r,queryKey:o}){const i=e.original;return c.jsx("div",{dflex:!0,spaceX:"1",placeContent:"end",children:n==null?void 0:n.map((s,a)=>c.jsxs(v.Fragment,{children:[s.type==="publish"&&c.jsx(ou,{id:i.id,api:r,status:i.status,invalidateQueryKey:o}),s.type=="custom"&&c.jsx(c.Fragment,{children:s.component(i,o,s.icon,s.label)}),!["publish","custom"].includes(s.type)&&c.jsx(iu,{onClick:()=>t(s,i),scheme:uu[s.type],children:c.jsx(_.Icon,{path:au[s.type]})})]},a))})}function iu({onClick:e,...t}){const n=v.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),e==null||e(r)},[e]);return c.jsx(_.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",onClick:n,...t})}const au={link:ln,view:cn,edit:$r,delete:en,publish:en,custom:""},uu={link:"dark",view:"secondary",edit:"warning",delete:"danger",publish:"warning",custom:"default"};function cu(e,t,n){const r=ce.useNavigate(),o=zr.useOpenLink(),{onAction:i}=Go(),{onRowClick:s,columns:a,...u}=t,f=v.useCallback(g=>{(s==null?void 0:s.type)==="navigate"?r(z.runIfFn(s.path,g)):(s==null?void 0:s.type)=="link"&&o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${z.runIfFn(s.path,g)}`)},[r,s]),d=v.useMemo(()=>{const g=t.columns.concat([]);return n&&g.push(ru().display({id:"actions",header:"Actions",cell:h=>c.jsx(su,{row:h.row,onAction:i,rowActions:n,api:e,queryKey:e.queryKey})})),g},[t]),l={...u};return l.columns=d,l.onRowClick=f,l.queryKey=e.queryKey,l.queryFn=e.search,l}function lu(e,t,n){return e<t?n==="asc"?-1:1:e>t?n==="asc"?1:-1:0}function fu(e,t,n){return e.slice().sort((r,o)=>{const i=n.length;for(let s=0;s<t.length;s++){const a=i>s?n[s]:n[i-1],u=t[s],f=typeof u=="function",d=f?u(r):r[u],l=f?u(o):o[u],g=lu(d,l,a);if(g!==0)return g}return 0})}function du(e,t){return fu(e,t,["asc"])}function pu(){}function Br(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Fr(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const hu="[object RegExp]",mu="[object String]",yu="[object Number]",gu="[object Boolean]",Dr="[object Arguments]",bu="[object Symbol]",vu="[object Date]",xu="[object Map]",Eu="[object Set]",wu="[object Array]",Pu="[object Function]",Ru="[object ArrayBuffer]",Yt="[object Object]",_u="[object Error]",ju="[object DataView]",Tu="[object Uint8Array]",Cu="[object Uint8ClampedArray]",Ou="[object Uint16Array]",Au="[object Uint32Array]",Su="[object BigUint64Array]",Lu="[object Int8Array]",Mu="[object Int16Array]",Nu="[object Int32Array]",Iu="[object BigInt64Array]",ku="[object Float32Array]",Bu="[object Float64Array]";function Hr(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function Fu(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Du(e,t,n){return Oe(e,t,void 0,void 0,void 0,void 0,n)}function Oe(e,t,n,r,o,i,s){const a=s(e,t,n,r,o,i);if(a!==void 0)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return Le(e,t,i,s)}return Le(e,t,i,s)}function Le(e,t,n,r){if(Object.is(e,t))return!0;let o=Fr(e),i=Fr(t);if(o===Dr&&(o=Yt),i===Dr&&(i=Yt),o!==i)return!1;switch(o){case mu:return e.toString()===t.toString();case yu:{const u=e.valueOf(),f=t.valueOf();return Fu(u,f)}case gu:case vu:case bu:return Object.is(e.valueOf(),t.valueOf());case hu:return e.source===t.source&&e.flags===t.flags;case Pu:return e===t}n=n??new Map;const s=n.get(e),a=n.get(t);if(s!=null&&a!=null)return s===t;n.set(e,t),n.set(t,e);try{switch(o){case xu:{if(e.size!==t.size)return!1;for(const[u,f]of e.entries())if(!t.has(u)||!Oe(f,t.get(u),u,e,t,n,r))return!1;return!0}case Eu:{if(e.size!==t.size)return!1;const u=Array.from(e.values()),f=Array.from(t.values());for(let d=0;d<u.length;d++){const l=u[d],g=f.findIndex(h=>Oe(l,h,void 0,e,t,n,r));if(g===-1)return!1;f.splice(g,1)}return!0}case wu:case Tu:case Cu:case Ou:case Au:case Su:case Lu:case Mu:case Nu:case Iu:case ku:case Bu:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let u=0;u<e.length;u++)if(!Oe(e[u],t[u],u,e,t,n,r))return!1;return!0}case Ru:return e.byteLength!==t.byteLength?!1:Le(new Uint8Array(e),new Uint8Array(t),n,r);case ju:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:Le(new Uint8Array(e),new Uint8Array(t),n,r);case _u:return e.name===t.name&&e.message===t.message;case Yt:{if(!(Le(e.constructor,t.constructor,n,r)||Hr(e)&&Hr(t)))return!1;const f=[...Object.keys(e),...Br(e)],d=[...Object.keys(t),...Br(t)];if(f.length!==d.length)return!1;for(let l=0;l<f.length;l++){const g=f[l],h=e[g];if(!Object.hasOwn(t,g))return!1;const m=t[g];if(!Oe(h,m,g,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function Hu(e,t){return Du(e,t,pu)}function qu({form:e,initialValues:t,schema:n,processInput:r}){const{showFilters:o}=Xa(),{getFilters:i,setFilters:s}=ke.useTableContext(),a=v.useCallback((f,d)=>{const l=(r==null?void 0:r(f))??f;Hu(l,i())||s(l),d.setSubmitting(!1)},[s,r]),u=v.useCallback(f=>{s(t),f()},[s,t]);return v.useEffect(()=>s(t),[]),c.jsx(_.Collapse,{in:o,style:{overflow:o?"initial":"hidden"},children:c.jsx("div",{p:"8",borderT:"px",borderB:"px",borderColor:"slate-100",children:c.jsx(te.FormProvider,{initialValues:te.mergeInitialFormValues(i(),t),onSubmit:a,validationSchema:n,enableReinitialize:!0,children:f=>c.jsxs("div",{dflex:!0,gap:"3",placeContent:"start",children:[c.jsx(te.FormRenderer,{flexRow:!0,w:"auto",form:e}),c.jsx(Uu,{handleReset:()=>u(f.resetForm)})]})})})})}function Uu({handleReset:e}){return c.jsxs("div",{dflex:!0,gap:"3",children:[c.jsxs("div",{dflex:!0,flexCol:!0,children:[c.jsx(te.FieldLabel,{name:"",label:" "}),c.jsx(te.SubmitButton,{children:"Filter"})]}),c.jsxs("div",{dflex:!0,flexCol:!0,children:[c.jsx(te.FieldLabel,{name:"",label:" "}),c.jsx(_.Button,{scheme:"neutral",onClick:e,children:"Reset"})]})]})}function Vu({label:e,buttonProps:t,icon:n,queryKey:r,queryFn:o,successMsg:i,errorMsg:s,invalidateParent:a}){const u=a?M.useInvalidateParentMutation(o,r):M.useApiMutation(o,r),f=M.useMutate(u,{successMsg:i,errorMsg:s});return c.jsxs(_.Button,{display:"flex",alignItems:"center",gap:"3",...t,onClick:f,disabled:u.isLoading,children:[n&&c.jsx(_.Icon,{path:n}),e]})}function zu({actions:e}){const{ids:t}=ke.useTableContext(),n=t&&t.length>0;return c.jsx(_.Collapse,{in:n,style:{overflow:n?"initial":"hidden"},children:c.jsx("div",{dflex:!0,gap:"3",flexWrap:!0,alignItems:"center",px:"8",pt:"5",children:e.map((r,o)=>c.jsx("div",{children:r.type=="button"&&!r.showConfirmationDialog&&c.jsx(Vu,{label:r.label,queryFn:r.queryFn,queryKey:r.queryKey,buttonProps:r.buttonProps})},o))})})}function Ku(e){const t=ce.useParams();if(e===void 0)return;const{[e]:n}=t;return n}function $u({queryField:e,title:t,subtitle:n,screen:r,...o}){const i=Ku(e),s=z.runIfFn(r,i);return c.jsx(yt,{p:"5",...o,children:c.jsx(zo,{columns:s.table.columns,initialVisibleColumns:s.table.initialVisibleColumns,children:c.jsx(Wu,{id:i,title:t,subtitle:n,screen:s})})})}function Wu({id:e,title:t,subtitle:n,screen:r}){const{setRowSelection:o}=ke.useTableContext(),{api:i,table:s,filters:a,massActions:u,buttonBar:f,rowActions:d,createView:l,editView:g,deleteItem:h,breadcrumbs:m}=r,p=z.runIfFn(i,e??"");return c.jsxs(c.Fragment,{children:[m&&c.jsx(Pn,{breadcrumbs:m}),c.jsxs(Wo,{title:t,queryKey:p.queryKey,children:[c.jsx(Qu,{buttonBar:f,createView:l,editView:g,api:p}),a&&c.jsx($o,{})]}),a&&c.jsx(qu,{form:a.form,initialValues:a.initialValues,schema:a.schema,processInput:a.processInput}),u&&c.jsx(zu,{actions:u.items}),c.jsxs(nu,{queryKey:p.queryKey,editView:g,deleteItem:h,children:[c.jsx(Gu,{table:{...s,onSelectionChange:o},rowActions:d,api:p,subtitle:n}),c.jsx(Xu,{})]})]})}function Qu({buttonBar:e,createView:t,editView:n,api:r}){const o=v.useCallback(i=>{const s=t??n;return s.type=="customDialog"?s.render({show:!0,onClose:i}):c.jsx(Qo,{config:s,onClose:i,invalidateQueryKey:r.queryKey})},[n,r]);return c.jsx(c.Fragment,{children:e&&e.map((i,s)=>c.jsxs("div",{children:[i.type==="create"&&n&&c.jsx(Ko,{buildDialog:o}),i.type==="invalidate"&&c.jsx(vn,{pathOrPermalink:i.pathOrPermalink}),i.type==="custom"&&i.render()]},s))})}function Gu({table:e,subtitle:t,rowActions:n,api:r}){const o=cu(r,e,n),i=v.useMemo(()=>{if(t)return s=>c.jsx("div",{textSize:"lg",textColor:"#475569",fontWeight:"600",children:z.isFunction(t)?t(s):t})},[t]);return c.jsx(ke.Table,{...o,title:i})}function Xu(){const{dialog:e}=Go();return e}function Ju(e){const t=ce.useParams(),{data:n,isFetching:r,isError:o}=M.useApiQueries(e.map(s=>{if(!s.queryField||!z.isFunction(s.api)){const f=s.api;return{queryKey:f.queryKey,queryFn:s.fn=="get"?f.get:f.getAll,queryParam:s.params}}const a=t[s.queryField],u=z.runIfFn(s.api,a);return{queryKey:u.queryKey,queryFn:s.fn=="get"?u.get:u.getAll,queryParam:s.fn=="getAll"?s.params:z.isFunction(s.api)?void 0:a}}));let i;return!r&&!o&&(i=n==null?void 0:n.map((s,a)=>{var u,f;return e[a].transformFn?(f=(u=e[a]).transformFn)==null?void 0:f.call(u,s):s})),{data:i,isFetching:r,isError:o}}function Zu(e){const t=Kr.useQueryClient(),n=ce.useParams();return v.useCallback(()=>{const o=[];e.forEach(i=>{if(!i.queryField||!z.isFunction(i.api))o.push(i.api.queryKey);else{const s=n[i.queryField],a=z.runIfFn(i.api,s);o.push(a.queryKey)}}),t.invalidateQueries({predicate:i=>o.includes(i.queryKey)})},[e,t,n])}function Yu({queries:e,config:t,tabbed:n,...r}){const{data:o,isFetching:i,isError:s}=Ju(e),a=Zu(e);return i?c.jsx(X.QueryLoadingState,{w:"full",h:"100vh"}):s||!o?c.jsx(X.RetryOnError,{p:"0",w:"full",h:"100vh",onClick:a}):c.jsx(gt,{config:t(...o),tabbed:n,...r})}function gt({config:e,tabbed:t,...n}){return e.type==="table"?c.jsx($u,{...e,...n}):e.type==="tabbed"?c.jsx(Wa,{...e,...n}):e.type==="details"?c.jsx(Ua,{...e,tabbed:t,...n}):e.type==="query"?c.jsx($a,{...e,tabbed:t,...n}):e.type==="multiQuery"?c.jsx(Yu,{...e,tabbed:t,...n}):c.jsx(c.Fragment,{})}const qr="Oops, something went wrong...";function ec({queryId:e,queryKey:t,queryFetchFn:n,queryFetchAllKey:r,queryFetchAllFn:o,querySaveFn:i,matchKey:s,size:a="lg",show:u,onClose:f,itemLabel:d,onSuccess:l,onFetchError:g,fetchErrorMsg:h=qr,onSaveError:m,saveErrorMsg:p=qr,invalidateQueriesOnSuccess:y=!0,retryText:x="Retry",cancelLabel:j="Cancel",saveLabel:w,formikProps:b,getItemName:P,...T}){const C=Kr.useQueryClient(),{data:R,isInitialLoading:A,isError:S,refetch:O,error:D}=M.useApiQuery(t,n),{data:I,isInitialLoading:H,isError:q,refetch:V,error:$}=M.useApiQuery(r,o),[U,K]=v.useState([]),W=A||H,ne=S||q,Q=M.useApiMutation(i,t,e),Z=v.useCallback(k=>{const Y=(k==null?void 0:k.currentTarget.dataset.id)??"",ae=U.concat([]),ve=U.indexOf(Y);ve!=-1?ae.splice(ve,1):ae.push(Y),K(ae)},[U,K]),je=v.useCallback(()=>{S&&O(),q&&V()},[O,V,S,q]),G=v.useCallback(()=>{Q.reset(),Q.mutateAsync({resources:U}).then(k=>{l?l(k):L.success(`${d} saved`),y&&C.invalidateQueries({queryKey:t}),f==null||f()}).catch(k=>{console.error("on error",k),m?m():L.error(`Error adding ${d}`)})},[Q,e,l,C,m,f]),bt=v.useMemo(()=>{let k=[];return R&&I&&(k=[].concat(I),R.forEach(Y=>k.splice(k.findIndex(ae=>ae.id==Y[s]),1)),P&&(k=k.map(Y=>({...Y,name:P(Y)}))),k=du(k,["name"])),k},[R,I]);return c.jsxs(_.Modal,{size:a,show:u,onClose:f,scheme:"light",transition:!0,...T,children:[c.jsx(_.Modal.Header,{children:`Add ${d}`}),W&&c.jsx(_.Modal.Body,{children:c.jsx(X.QueryLoadingState,{minW:"72"})}),ne&&c.jsx(_.Modal.Body,{children:c.jsx(X.RetryOnError,{label:`${h} ${D}`,onClick:je})}),!W&&!ne&&c.jsxs(c.Fragment,{children:[c.jsx(_.Modal.Body,{px:"0",pb:"6",maxH:"750px",overflow:"auto",children:c.jsx("div",{dflex:!0,flexCol:!0,overflow:"auto",children:bt.map(k=>c.jsx(tc,{label:k.name,value:k.id,"data-id":k.id,checked:U.includes(`${k.id}`),onClick:Z},k.id))})}),c.jsxs(_.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[c.jsx(_.Button,{disabled:Q.isLoading,onClick:f,variant:"borderless",me:"2",children:j}),c.jsx(_.Button,{type:"submit",disabled:U.length==0||Q.isLoading,onClick:G,children:w||(e?"Update":"Create")})]})]}),Q.isLoading&&c.jsx(X.ModalLoadingOverlay,{})]})}function tc({label:e,value:t,checked:n,...r}){return c.jsxs("div",{dflex:!0,alignItems:"center",hover_bgColor:"slate-100",px:"5",py:"2",cursor:"pointer",...r,children:[c.jsx("span",{flexGrow:!0,children:e}),c.jsx(_.Checkbox,{name:`resources.${t}`,value:t,checked:n})]})}function nc({initialValues:e,itemLabel:t,queryId:n="",queryKey:r,queryFn:o,queryOptions:i,onSuccess:s,successMsg:a,showSuccessMsg:u,onError:f,errorMsg:d,showErrorMsg:l,processInput:g,invalidateQueriesOnSuccess:h=!0,cancelLabel:m="Cancel",saveLabel:p="Send",size:y="lg",title:x,form:j,show:w,onClose:b,formikProps:P,...T}){const C=h?M.useInvalidateParentMutation(o,r,i):M.useApiMutation(o,r,n,i),R=M.useMutate(C,{onSuccess:s,successMsg:a,showSuccessMsg:u,onError:f,errorMsg:d,showErrorMsg:l,processInput:g});return c.jsxs(_.Modal,{size:y,show:w,onClose:b,scheme:"light",transition:!0,...T,children:[c.jsx(_.Modal.Header,{children:x}),c.jsxs(te.FormProvider,{initialValues:e??{},onSubmit:R,...P,children:[c.jsxs(_.Modal.Body,{pb:"6",children:[v.isValidElement(j)&&j,Array.isArray(j)&&c.jsx(te.FormRenderer,{form:j})]}),c.jsxs(_.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[c.jsx(_.Button,{disabled:C.isLoading,onClick:b,variant:"borderless",me:"2",children:m}),c.jsx(te.SubmitButton,{disabled:C.isLoading,children:p})]})]}),C.isLoading&&c.jsx(X.ModalLoadingOverlay,{})]})}const Ur="Oops, something went wrong...";function Vr(e){if(e){const t={...e};for(const n in e)t[n]=t[n]??"";return t}return e}function rc({initialValues:e,itemLabel:t,queryId:n="",queryKey:r,queryFetchFn:o,queryFetchOptions:i,querySaveFn:s,querySaveOptions:a,onSuccess:u,onFetchError:f,fetchErrorMsg:d=Ur,onSaveError:l,saveErrorMsg:g=Ur,fetchToFormData:h,formToQueryData:m,invalidateQueriesOnSuccess:p=!0,invalidateQueryKey:y,retryText:x="Retry",cancelLabel:j="Cancel",saveLabel:w,size:b="lg",title:P,form:T,show:C,onClose:R,formikProps:A,...S}){const{isInitialLoading:O,isFetching:D,data:I,isError:H,error:q,refetch:V}=M.useApiQuery(r,o,n,{enabled:!(n==""||n==null||n==null),onError:f,...i}),$=p?M.useInvalidateParentMutation(s,y??r,a):M.useApiMutation(s,r,n,a),U=v.useCallback(()=>V(),[V]),K=v.useCallback((W,ne)=>{$.reset();const Q=m?m(W):{...W};$.mutateAsync(Q).then(Z=>{u?u(Q,Z):L.success(`${P?P(Q):Q.name??Q.title} ${n?"saved":"created"}`),R==null||R()}).catch(Z=>{console.error("on error",Z),l?l(W):L.error(`Couldn't save ${P?P(Q):Q.name??Q.title}`),ne.setSubmitting(!1)})},[$,m,u,l,R]);return c.jsxs(_.Modal,{size:b,show:C,onClose:R,scheme:"light",transition:!0,...S,children:[c.jsxs(_.Modal.Header,{children:[!O&&n&&`Edit ${P?P(I):(I==null?void 0:I.name)??(I==null?void 0:I.title)??""}`,!n&&`Create new ${t??"item"}`,Array.isArray(T)&&c.jsx(c.Fragment,{})]}),O&&c.jsx(_.Modal.Body,{children:c.jsx(X.QueryLoadingState,{minW:"72"})}),H&&c.jsx(_.Modal.Body,{children:c.jsx(X.RetryOnError,{label:`${d} ${q}`,onClick:U})}),!O&&!H&&c.jsx(c.Fragment,{children:c.jsx(Me.Formik,{initialValues:h&&n&&I?h(Vr(I)):Vr(I)??e??{},onSubmit:K,...A,children:({setFieldValue:W,dirty:ne,handleSubmit:Q,isValid:Z,values:je})=>c.jsxs(c.Fragment,{children:[c.jsx(_.Modal.Body,{pb:"6",children:c.jsxs(Me.Form,{children:[v.isValidElement(T)&&T,Array.isArray(T)&&c.jsx(te.FormRenderer,{form:T}),z.isFunction(T)&&c.jsx(te.FormRenderer,{form:T(I??je)})]})}),c.jsxs(_.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[c.jsx(_.Button,{disabled:$.isLoading,onClick:R,variant:"borderless",me:"2",children:j}),c.jsx(_.Button,{type:"submit",disabled:!ne||$.isLoading,onClick:()=>Q(),children:w||(n?"Update":"Create")})]})]})})}),$.isLoading&&c.jsx(X.ModalLoadingOverlay,{})]})}function oc({children:e,...t}){return c.jsx("div",{trait:"typo.h6",mb:"5",...t,children:e})}const sc=v.forwardRef(({loading:e=!1,children:t,...n},r)=>c.jsxs(c.Fragment,{children:[e&&c.jsx(X.QueryLoadingState,{w:"full",h:"100%"}),!e&&c.jsx(_.Container,{ref:r,center:!0,size:"x2",dflex:!0,flexCol:!0,gap:"8",...n,children:t})]}));function ic({children:e,...t}){return c.jsx("div",{trait:"typo.h6",mb:"3",...t,children:e})}const ac={draft:"Draft",published:"Published",pending:"Pending",approved:"Approved",partially_approved:"Partially Approved",rejected:"Rejected"},uc={draft:"warning",published:"success",pending:"secondary",approved:"success",partially_approved:"warning",rejected:"danger"};function cc({status:e,...t}){return c.jsx(_.Badge,{size:"sm",variant:"glass",whiteSpace:"nowrap",rounded:"full",px:"3",scheme:uc[e],...t,children:ac[e]})}function Xo({path:e,...t}){const n=v.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),window.open(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${e}`,"_blank")},[e]);return c.jsx(_.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"dark",onClick:n,...t,children:c.jsx(_.Icon,{path:ln})})}function Jo({path:e,...t}){const n=ce.useNavigate(),r=v.useCallback(o=>{o==null||o.preventDefault(),o==null||o.stopPropagation(),n(`${e}`)},[n,e]);return c.jsx(_.Button,{scheme:"secondary",w:"10",h:"10",variant:"borderless",corners:"pill",onClick:r,...t,children:c.jsx(_.Icon,{path:cn})})}function Zo({children:e,...t}){return c.jsx(ut,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"warning",...t,children:e??c.jsx(_.Icon,{path:$r})})}function Yo({children:e,...t}){return c.jsx(ut,{w:"10",h:"10",scheme:"danger",variant:"borderless",corners:"pill",...t,children:e??c.jsx(_.Icon,{path:en})})}function lc({publishId:e,viewPath:t,navigatePath:n,editDialog:r,deleteDialog:o,children:i,...s}){return c.jsxs("div",{dflex:!0,spaceX:"1",placeContent:"end",...s,children:[t&&c.jsx(Xo,{path:t}),n&&c.jsx(Jo,{path:n}),r&&c.jsx(Zo,{buildDialog:r}),o&&c.jsx(Yo,{buildDialog:o}),i]})}function fc({id:e,api:t,status:n,invalidateQueryKey:r,...o}){const i=n=="draft",s=M.useInvalidateParentMutation(i?t.publish:t.unpublish,r??t.queryKey,{networkMode:"always"}),a=v.useCallback(u=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),s.reset(),s.mutateAsync(e).then(()=>L.success(i?"Published!":"Unpublished!")).catch(f=>L.error(`Error: ${f}`))},[s,e]);return c.jsx(_.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:c.jsx(_.Icon,{path:i?Wr:Qr})})}exports.AttachDialog=ec;exports.Breadcrumbs=dn;exports.DialogButton=ut;exports.FormActionDialog=nc;exports.IconButton=Js;exports.InvalidateButton=vn;exports.ItemEditDialog=rc;exports.NavigateButton=ma;exports.OrderCell=Fa;exports.PageContainer=yt;exports.PageContentEditor=Bo;exports.PageMain=ko;exports.PageQueryStateContainer=En;exports.PageSectionTitle=oc;exports.PageSidebar=Fo;exports.PageSidebarSection=Do;exports.PageStateContainer=sc;exports.PageSubSectionTitle=ic;exports.PageTabbedTopBar=Uo;exports.PageTabbedTopBarProvider=qo;exports.PageTitle=wn;exports.PageTopBar=Pn;exports.PageTopBarToolbar=Vo;exports.PublishButton=To;exports.ScreenRenderer=gt;exports.SectionTitle=as;exports.StatusBadge=cc;exports.TableContainer=zo;exports.TableCreateButton=Ko;exports.TableFilterButton=$o;exports.TableRowActionBar=lc;exports.TableRowDeleteButton=Yo;exports.TableRowEditButton=Zo;exports.TableRowNavigateButton=Jo;exports.TableRowPublishPostButton=fc;exports.TableRowViewButton=Xo;exports.TableTopBar=Wo;exports.UpdateButton=No;exports.ViewButton=Io;