@payloadcms/ui 3.41.0-internal.c079756 → 3.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/elements/BulkUpload/EditForm/index.d.ts.map +1 -1
  2. package/dist/elements/BulkUpload/EditForm/index.js +2 -1
  3. package/dist/elements/BulkUpload/EditForm/index.js.map +1 -1
  4. package/dist/elements/DocumentControls/index.d.ts.map +1 -1
  5. package/dist/elements/DocumentControls/index.js +2 -1
  6. package/dist/elements/DocumentControls/index.js.map +1 -1
  7. package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts +1 -0
  8. package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts.map +1 -1
  9. package/dist/elements/DocumentDrawer/DrawerHeader/index.js +30 -19
  10. package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
  11. package/dist/elements/DocumentDrawer/DrawerHeader/index.scss +16 -8
  12. package/dist/elements/DrawerActionHeader/index.d.ts +2 -1
  13. package/dist/elements/DrawerActionHeader/index.d.ts.map +1 -1
  14. package/dist/elements/DrawerActionHeader/index.js +41 -30
  15. package/dist/elements/DrawerActionHeader/index.js.map +1 -1
  16. package/dist/elements/DrawerActionHeader/index.scss +2 -2
  17. package/dist/elements/EmailAndUsername/index.d.ts.map +1 -1
  18. package/dist/elements/EmailAndUsername/index.js +3 -0
  19. package/dist/elements/EmailAndUsername/index.js.map +1 -1
  20. package/dist/elements/FolderView/Cell/index.client.d.ts +6 -5
  21. package/dist/elements/FolderView/Cell/index.client.d.ts.map +1 -1
  22. package/dist/elements/FolderView/Cell/index.client.js +6 -3
  23. package/dist/elements/FolderView/Cell/index.client.js.map +1 -1
  24. package/dist/elements/FolderView/Cell/index.server.d.ts.map +1 -1
  25. package/dist/elements/FolderView/Cell/index.server.js +4 -0
  26. package/dist/elements/FolderView/Cell/index.server.js.map +1 -1
  27. package/dist/elements/FolderView/CollectionTypePill/index.d.ts.map +1 -1
  28. package/dist/elements/FolderView/CollectionTypePill/index.js +20 -18
  29. package/dist/elements/FolderView/CollectionTypePill/index.js.map +1 -1
  30. package/dist/elements/FolderView/CurrentFolderActions/index.d.ts.map +1 -1
  31. package/dist/elements/FolderView/CurrentFolderActions/index.js +20 -14
  32. package/dist/elements/FolderView/CurrentFolderActions/index.js.map +1 -1
  33. package/dist/elements/FolderView/Drawers/EditFolderAction/index.d.ts +9 -0
  34. package/dist/elements/FolderView/Drawers/EditFolderAction/index.d.ts.map +1 -0
  35. package/dist/elements/FolderView/Drawers/EditFolderAction/index.js +36 -0
  36. package/dist/elements/FolderView/Drawers/EditFolderAction/index.js.map +1 -0
  37. package/dist/elements/FolderView/Drawers/MoveToFolder/index.d.ts +2 -0
  38. package/dist/elements/FolderView/Drawers/MoveToFolder/index.d.ts.map +1 -1
  39. package/dist/elements/FolderView/Drawers/MoveToFolder/index.js +120 -101
  40. package/dist/elements/FolderView/Drawers/MoveToFolder/index.js.map +1 -1
  41. package/dist/elements/FolderView/Drawers/MoveToFolder/index.scss +1 -1
  42. package/dist/elements/FolderView/Field/index.server.d.ts.map +1 -1
  43. package/dist/elements/FolderView/Field/index.server.js +4 -0
  44. package/dist/elements/FolderView/Field/index.server.js.map +1 -1
  45. package/dist/elements/FolderView/MoveDocToFolder/index.d.ts +19 -16
  46. package/dist/elements/FolderView/MoveDocToFolder/index.d.ts.map +1 -1
  47. package/dist/elements/FolderView/MoveDocToFolder/index.js +52 -41
  48. package/dist/elements/FolderView/MoveDocToFolder/index.js.map +1 -1
  49. package/dist/elements/ListFolderPills/index.d.ts +4 -3
  50. package/dist/elements/ListFolderPills/index.d.ts.map +1 -1
  51. package/dist/elements/ListFolderPills/index.js +5 -1
  52. package/dist/elements/ListFolderPills/index.js.map +1 -1
  53. package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.d.ts.map +1 -1
  54. package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js +75 -55
  55. package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js.map +1 -1
  56. package/dist/elements/Upload/index.scss +2 -3
  57. package/dist/elements/WhereBuilder/reduceFields.d.ts.map +1 -1
  58. package/dist/elements/WhereBuilder/reduceFields.js +1 -28
  59. package/dist/elements/WhereBuilder/reduceFields.js.map +1 -1
  60. package/dist/exports/client/{CodeEditor-7N7BMHRP.js → CodeEditor-Z3ZZJH7C.js} +2 -2
  61. package/dist/exports/client/chunk-CNCOIY3Y.js +26 -0
  62. package/dist/exports/client/{chunk-QPA2ZA5J.js.map → chunk-CNCOIY3Y.js.map} +3 -3
  63. package/dist/exports/client/index.d.ts +0 -1
  64. package/dist/exports/client/index.d.ts.map +1 -1
  65. package/dist/exports/client/index.js +22 -22
  66. package/dist/exports/client/index.js.map +4 -4
  67. package/dist/exports/shared/index.js +2 -2
  68. package/dist/exports/shared/index.js.map +1 -1
  69. package/dist/fields/Number/index.d.ts.map +1 -1
  70. package/dist/fields/Number/index.js +4 -3
  71. package/dist/fields/Number/index.js.map +1 -1
  72. package/dist/fields/Text/Input.d.ts.map +1 -1
  73. package/dist/fields/Text/Input.js +55 -52
  74. package/dist/fields/Text/Input.js.map +1 -1
  75. package/dist/fields/Text/index.d.ts.map +1 -1
  76. package/dist/fields/Text/index.js +4 -0
  77. package/dist/fields/Text/index.js.map +1 -1
  78. package/dist/fields/Text/types.d.ts +4 -1
  79. package/dist/fields/Text/types.d.ts.map +1 -1
  80. package/dist/fields/Text/types.js.map +1 -1
  81. package/dist/providers/Config/index.d.ts.map +1 -1
  82. package/dist/providers/Config/index.js +12 -6
  83. package/dist/providers/Config/index.js.map +1 -1
  84. package/dist/providers/Folders/index.d.ts +10 -2
  85. package/dist/providers/Folders/index.d.ts.map +1 -1
  86. package/dist/providers/Folders/index.js +7 -5
  87. package/dist/providers/Folders/index.js.map +1 -1
  88. package/dist/styles.css +1 -1
  89. package/dist/utilities/formatDocTitle/formatDateTitle.d.ts +3 -3
  90. package/dist/utilities/formatDocTitle/formatDateTitle.d.ts.map +1 -1
  91. package/dist/utilities/formatDocTitle/formatDateTitle.js.map +1 -1
  92. package/dist/views/BrowseByFolder/index.d.ts.map +1 -1
  93. package/dist/views/BrowseByFolder/index.js +4 -3
  94. package/dist/views/BrowseByFolder/index.js.map +1 -1
  95. package/dist/views/CollectionFolder/ListSelection/index.d.ts.map +1 -1
  96. package/dist/views/CollectionFolder/ListSelection/index.js +36 -37
  97. package/dist/views/CollectionFolder/ListSelection/index.js.map +1 -1
  98. package/dist/views/CollectionFolder/index.d.ts.map +1 -1
  99. package/dist/views/CollectionFolder/index.js +7 -4
  100. package/dist/views/CollectionFolder/index.js.map +1 -1
  101. package/dist/views/Edit/index.d.ts.map +1 -1
  102. package/dist/views/Edit/index.js +5 -3
  103. package/dist/views/Edit/index.js.map +1 -1
  104. package/dist/views/List/ListHeader/index.d.ts.map +1 -1
  105. package/dist/views/List/ListHeader/index.js +2 -1
  106. package/dist/views/List/ListHeader/index.js.map +1 -1
  107. package/package.json +4 -4
  108. package/dist/elements/FolderView/Drawers/DrawerHeader/index.d.ts +0 -10
  109. package/dist/elements/FolderView/Drawers/DrawerHeader/index.d.ts.map +0 -1
  110. package/dist/elements/FolderView/Drawers/DrawerHeader/index.js +0 -55
  111. package/dist/elements/FolderView/Drawers/DrawerHeader/index.js.map +0 -1
  112. package/dist/elements/FolderView/Drawers/DrawerHeader/index.scss +0 -30
  113. package/dist/elements/FolderView/Drawers/NewFolder/index.d.ts +0 -9
  114. package/dist/elements/FolderView/Drawers/NewFolder/index.d.ts.map +0 -1
  115. package/dist/elements/FolderView/Drawers/NewFolder/index.js +0 -157
  116. package/dist/elements/FolderView/Drawers/NewFolder/index.js.map +0 -1
  117. package/dist/elements/FolderView/Drawers/RenameFolder/index.d.ts +0 -13
  118. package/dist/elements/FolderView/Drawers/RenameFolder/index.d.ts.map +0 -1
  119. package/dist/elements/FolderView/Drawers/RenameFolder/index.js +0 -140
  120. package/dist/elements/FolderView/Drawers/RenameFolder/index.js.map +0 -1
  121. package/dist/exports/client/chunk-QPA2ZA5J.js +0 -26
  122. /package/dist/exports/client/{CodeEditor-7N7BMHRP.js.map → CodeEditor-Z3ZZJH7C.js.map} +0 -0
@@ -1,6 +1,6 @@
1
- import*as h from"react";var w=({elements:e,translationString:t})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,n=t.split(r);return h.createElement("span",null,n.map((o,i)=>{if(e&&o.startsWith("<")&&o.endsWith(">")){let s=o[1],a=e[s];if(a){let c=new RegExp(`<${s}>(.*?)</${s}>`,"g"),m=o.replace(c,(l,u)=>u);return h.createElement(a,{key:i},h.createElement(w,{translationString:m}))}}return o}))},N=({elements:e,i18nKey:t,t:r,variables:n})=>{let o=r(t,n||{});return e?h.createElement(w,{elements:e,translationString:o}):o};import{isReactServerComponentOrFunction as A,serverProps as k}from"payload/shared";import Z from"react";function E({Component:e,sanitizeServerOnlyProps:t,toMergeIntoProps:r}){return t===void 0&&(t=!A(e)),o=>{let i=B(o,r);return t&&k.forEach(s=>{delete i[s]}),Z.createElement(e,{...i})}}function B(e,t){return{...e,...t}}import{isReactServerComponentOrFunction as G}from"payload/shared";import W from"react";var q=({Component:e,serverOnlyProps:t,...r})=>e?(o=>{let i={...o,...G(e)?t??{}:{}};return W.createElement(e,{...i})})(r):null;var $=e=>({...e?.admin?.style||{},...e?.admin?.width?{"--field-width":e.admin.width}:{flex:"1 1 auto"},...e?.admin?.style?.flex?{flex:e.admin.style.flex}:{}});var j=["validate","customComponents"],H=e=>{let t={...e};for(let r of j)delete t[r];return t},V=e=>{let t={};for(let r in e)t[r]=H(e[r]);return t};import T from"react";var K=({fill:e})=>{let t=e||"var(--theme-elevation-1000)";return T.createElement("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:t}),T.createElement("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:t}))};import p from"react";var Y=`
1
+ import*as h from"react";var w=({elements:e,translationString:t})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,n=t.split(r);return h.createElement("span",null,n.map((o,i)=>{if(e&&o.startsWith("<")&&o.endsWith(">")){let s=o[1],a=e[s];if(a){let c=new RegExp(`<${s}>(.*?)</${s}>`,"g"),m=o.replace(c,(l,u)=>u);return h.createElement(a,{key:i},h.createElement(w,{translationString:m}))}}return o}))},k=({elements:e,i18nKey:t,t:r,variables:n})=>{let o=r(t,n||{});return e?h.createElement(w,{elements:e,translationString:o}):o};import{isReactServerComponentOrFunction as N,serverProps as A}from"payload/shared";import Z from"react";function E({Component:e,sanitizeServerOnlyProps:t,toMergeIntoProps:r}){return t===void 0&&(t=!N(e)),o=>{let i=B(o,r);return t&&A.forEach(s=>{delete i[s]}),Z.createElement(e,{...i})}}function B(e,t){return{...e,...t}}import{isReactServerComponentOrFunction as G}from"payload/shared";import W from"react";var q=({Component:e,serverOnlyProps:t,...r})=>e?(o=>{let i={...o,...G(e)?t??{}:{}};return W.createElement(e,{...i})})(r):null;var $=e=>({...e?.admin?.style||{},...e?.admin?.width?{"--field-width":e.admin.width}:{flex:"1 1 auto"},...e?.admin?.style?.flex?{flex:e.admin.style.flex}:{}});var j=["validate","customComponents"],H=e=>{let t={...e};for(let r of j)delete t[r];return t},V=e=>{let t={};for(let r in e)t[r]=H(e[r]);return t};import T from"react";var K=({fill:e})=>{let t=e||"var(--theme-elevation-1000)";return T.createElement("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:t}),T.createElement("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:t}))};import p from"react";var Y=`
2
2
  .graphic-logo path {
3
3
  fill: var(--theme-elevation-1000);
4
4
  }
5
- `,Q=()=>p.createElement("svg",{className:"graphic-logo",fill:"none",height:"43.5",id:"b",viewBox:"0 0 193.38 43.5",width:"193.38",xmlns:"http://www.w3.org/2000/svg"},p.createElement("style",null,Y),p.createElement("g",{id:"c"},p.createElement("path",{d:"M18.01,35.63l-12.36-7.13c-.15-.09-.25-.25-.25-.43v-11.02c0-.19.21-.31.37-.22l14.35,8.28c.2.12.45-.03.45-.26v-5.37c0-.21-.11-.41-.3-.52L3.01,9c-.15-.09-.35-.09-.5,0l-2.26,1.31c-.15.09-.25.25-.25.43v20.47c0,.18.1.34.25.43l17.73,10.24c.15.09.35.09.5,0l14.89-8.6c.2-.12.2-.4,0-.52l-4.64-2.68c-.19-.11-.41-.11-.6,0l-9.61,5.55c-.15.09-.35.09-.5,0Z"}),p.createElement("path",{d:"M36.21,10.3L18.48.07c-.15-.09-.35-.09-.5,0l-9.37,5.41c-.2.12-.2.4,0,.52l4.6,2.66c.19.11.41.11.6,0l4.2-2.42c.15-.09.35-.09.5,0l12.36,7.13c.15.09.25.25.25.43v11.07c0,.21.11.41.3.52l4.6,2.65c.2.12.45-.03.45-.26V10.74c0-.18-.1-.34-.25-.43Z"}),p.createElement("g",{id:"d"},p.createElement("path",{d:"M193.38,9.47c0,1.94-1.48,3.32-3.3,3.32s-3.31-1.39-3.31-3.32,1.49-3.31,3.31-3.31,3.3,1.39,3.3,3.31ZM192.92,9.47c0-1.68-1.26-2.88-2.84-2.88s-2.84,1.2-2.84,2.88,1.26,2.89,2.84,2.89,2.84-1.2,2.84-2.89ZM188.69,11.17v-3.51h1.61c.85,0,1.35.39,1.35,1.15,0,.53-.3.86-.67,1.02l.79,1.35h-.89l-.72-1.22h-.64v1.22h-.82ZM190.18,9.31c.46,0,.64-.16.64-.5s-.19-.49-.64-.49h-.67v.99h.67Z"}),p.createElement("path",{d:"M54.72,24.84v10.93h-5.4V6.1h12.26c7.02,0,11.1,3.2,11.1,9.39s-4.07,9.35-11.06,9.35h-6.9,0ZM61.12,20.52c4.07,0,6.11-1.66,6.11-5.03s-2.04-5.03-6.11-5.03h-6.4v10.06h6.4Z"}),p.createElement("path",{d:"M85.94,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.18-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM85.73,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z"}),p.createElement("path",{d:"M90.39,14.66h5.4l5.86,15.92h.08l5.57-15.92h5.28l-8.23,21.49c-2,5.28-4.45,7.32-8.89,7.36-.71,0-1.7-.08-2.45-.21v-4.03c.62.13.96.13,1.41.13,2.16,0,3.07-.75,4.2-3.66l-8.23-21.07h0Z"}),p.createElement("path",{d:"M113.46,35.77V6.1h5.32v29.67h-5.32Z"}),p.createElement("path",{d:"M130.79,36.27c-6.23,0-10.68-4.2-10.68-11.05s4.45-11.05,10.68-11.05,10.68,4.24,10.68,11.05-4.45,11.05-10.68,11.05ZM130.79,32.32c3.41,0,5.36-2.66,5.36-7.11s-1.95-7.11-5.36-7.11-5.36,2.7-5.36,7.11,1.91,7.11,5.36,7.11Z"}),p.createElement("path",{d:"M156.19,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.19-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM155.98,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z"}),p.createElement("path",{d:"M178.5,32.41c-1.04,2.12-3.58,3.87-6.78,3.87-5.53,0-9.31-4.49-9.31-11.05s3.78-11.05,9.31-11.05c3.28,0,5.69,1.83,6.69,3.95V6.1h5.32v29.67h-5.24v-3.37h0ZM178.55,24.84c0-4.11-1.95-6.78-5.32-6.78s-5.45,2.83-5.45,7.15,2,7.15,5.45,7.15,5.32-2.66,5.32-6.78v-.75h0Z"}))));import{fieldIsHiddenOrDisabled as J,fieldIsID as X}from"payload/shared";var _=e=>{let t=n=>n.type!=="ui"&&J(n)&&!X(n)||n?.admin?.disableListColumn===!0;return e?.reduce((n,o)=>{if(t(o))return n;let i=o.type==="tabs"&&"tabs"in o?{...o,tabs:o.tabs.map(s=>({...s,fields:s.fields.filter(a=>!t(a))}))}:o;return n.push(i),n},[])};import{fieldAffectsData as P}from"payload/shared";var x=(e,t)=>e?.reduce((r,n)=>P(n)&&n.name===t?r:!P(n)&&"fields"in n?[...r,...x(n.fields,t)]:n.type==="tabs"&&"tabs"in n?[...r,...n.tabs.reduce((o,i)=>[...o,..."name"in i?[i.name]:x(i.fields,t)],[])]:[...r,n.name],[]),ee=(e,t,r)=>{let n=[];if(Array.isArray(r)&&r.length>=1)n=r;else{t&&n.push(t);let o=x(e,t);n=n.concat(o),n=n.slice(0,4)}return n.map(o=>({accessor:o,active:!0}))};function te(e){if(e)try{e.abort()}catch{}}function re(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}import*as M from"qs-esm";var ne={delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"delete"};return fetch(e,n)},get:(e,t={headers:{}})=>{let r="";return t.params&&(r=M.stringify(t.params,{addQueryPrefix:!0})),fetch(`${e}${r}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"PATCH"};return fetch(e,n)},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"post"};return fetch(`${e}`,n)},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"put"};return fetch(e,n)}};var oe=(e,t)=>!e?.locales||e.locales.length===0?null:e.locales.find(r=>r?.code===t);import{formatAdminURL as ie}from"payload/shared";var se={},g={};function d(e,t){try{let n=(se[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return n in g?g[n]:L(n,n.split(":"))}catch{if(e in g)return g[e];let r=e?.match(ae);return r?L(e,r.slice(1)):NaN}}var ae=/([+-]\d\d):?(\d\d)?/;function L(e,t){let r=+t[0],n=+(t[1]||0);return g[e]=r>0?r*60+n:r*60-n}var f=class e extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(d(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),I(this,NaN),b(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-d(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),b(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},R=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!R.test(e))return;let t=e.replace(R,"$1UTC");f.prototype[t]&&(e.startsWith("get")?f.prototype[e]=function(){return this.internal[t]()}:(f.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),le(this),+this},f.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),b(this),+this}))});function b(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function le(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),I(e)}function I(e){let t=d(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let n=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),i=n-o,s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);let a=n-t;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);let c=d(e.timeZone,e),l=-new Date(+e).getTimezoneOffset()-c,u=c!==t,D=l-a;if(u&&D){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+D);let z=d(e.timeZone,e),C=c-z;C&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+C),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+C))}}import{format as O,formatDistanceToNow as Ye,transpose as ce}from"date-fns";var S=({date:e,i18n:t,pattern:r,timezone:n})=>{let o=new f(new Date(e));if(n){let i=f.tz(n),s=o.withTimeZone(n),a=ce(s,i);return t.dateFNS?O(a,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?O(o,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`};import{getTranslation as pe}from"@payloadcms/translations";function F(e){return typeof e=="object"&&"root"in e}function y(e,t){for(let r of e)"text"in r&&r.text?t+=r.text:"children"in r||(t+=`[${r.type}]`),"children"in r&&r.children&&(t+=y(r.children,t));return t}var me=({collectionConfig:e,data:t,dateFormat:r,fallback:n,globalConfig:o,i18n:i})=>{let s;if(e){let a=e?.admin?.useAsTitle;if(a&&(s=t?.[a]||s,s)){let c=e.fields.find(l=>"name"in l&&l.name===a);if(c?.type==="date"){let l="date"in c.admin&&c?.admin?.date?.displayFormat||r;s=S({date:s,i18n:i,pattern:l})||s}}}return o&&(s=pe(o?.label,i)||o?.slug),F(s)&&(s=y(s.root.children?.[0]?.children||[],"")),!s&&F(n)&&(s=y(n.root.children?.[0]?.children||[],"")),s||(s=typeof n=="string"?n:`[${i.t("general:untitled")}]`),s};import{getTranslation as v}from"@payloadcms/translations";var U=(r=>(r.collection="collections",r.global="globals",r))(U||{});function fe(e,t,r){return e.reduce((o,i)=>{if(i.entity?.admin?.group===!1)return o;if(t?.[i.type.toLowerCase()]?.[i.entity.slug]?.read){let s=v(i.entity.admin.group,r),a="labels"in i.entity?i.entity.labels.plural:i.entity.label,c=typeof a=="function"?a({i18n:r,t:r.t}):a;if(i.entity.admin.group){let m=o.find(u=>v(u.label,r)===s),l=m;m||(l={entities:[],label:s},o.push(l)),l.entities.push({slug:i.entity.slug,type:i.type,label:c})}else o.find(l=>v(l.label,r)===r.t(`general:${i.type}`)).entities.push({slug:i.entity.slug,type:i.type,label:c})}return o},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(o=>o.entities.length>0)}import{formatAdminURL as de}from"payload/shared";var ue=({adminRoute:e,router:t})=>{let r=de({adminRoute:e,path:"/"});t.push(r)};import{formatAdminURL as he}from"payload/shared";var ge=({adminRoute:e,collectionSlug:t,router:r})=>{let n=he({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(n)};var ye=(e,t,r,n,o,i,s,a,c,m)=>{if(c)try{i(e,t??r,n),o||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:n},s(n),o&&m&&m(!1)}catch(l){console.error("Error during document takeover:",l)}};var Ce=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:n,isEditing:o}=e;return t?!!(o&&r?.update||!o&&r?.create):n?!!r?.update:!1};var Te=e=>e&&typeof e=="object";var xe=({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e);function be(e){return e===void 0||typeof e=="number"?e:decodeURIComponent(e)}import{mergeListSearchAndWhere as Zt}from"payload/shared";export{U as EntityType,K as PayloadIcon,Q as PayloadLogo,N as Translation,q as WithServerSideProps,te as abortAndIgnore,_ as filterFields,oe as findLocaleFromCode,ie as formatAdminURL,S as formatDate,me as formatDocTitle,ee as getInitialColumns,fe as groupNavItems,re as handleAbortRef,ue as handleBackToDashboard,ge as handleGoBack,ye as handleTakeOver,Ce as hasSavePermission,Te as isClientUserObject,xe as isEditing,$ as mergeFieldStyles,Zt as mergeListSearchAndWhere,V as reduceToSerializableFields,ne as requests,be as sanitizeID,E as withMergedProps};
5
+ `,Q=()=>p.createElement("svg",{className:"graphic-logo",fill:"none",height:"43.5",id:"b",viewBox:"0 0 193.38 43.5",width:"193.38",xmlns:"http://www.w3.org/2000/svg"},p.createElement("style",null,Y),p.createElement("g",{id:"c"},p.createElement("path",{d:"M18.01,35.63l-12.36-7.13c-.15-.09-.25-.25-.25-.43v-11.02c0-.19.21-.31.37-.22l14.35,8.28c.2.12.45-.03.45-.26v-5.37c0-.21-.11-.41-.3-.52L3.01,9c-.15-.09-.35-.09-.5,0l-2.26,1.31c-.15.09-.25.25-.25.43v20.47c0,.18.1.34.25.43l17.73,10.24c.15.09.35.09.5,0l14.89-8.6c.2-.12.2-.4,0-.52l-4.64-2.68c-.19-.11-.41-.11-.6,0l-9.61,5.55c-.15.09-.35.09-.5,0Z"}),p.createElement("path",{d:"M36.21,10.3L18.48.07c-.15-.09-.35-.09-.5,0l-9.37,5.41c-.2.12-.2.4,0,.52l4.6,2.66c.19.11.41.11.6,0l4.2-2.42c.15-.09.35-.09.5,0l12.36,7.13c.15.09.25.25.25.43v11.07c0,.21.11.41.3.52l4.6,2.65c.2.12.45-.03.45-.26V10.74c0-.18-.1-.34-.25-.43Z"}),p.createElement("g",{id:"d"},p.createElement("path",{d:"M193.38,9.47c0,1.94-1.48,3.32-3.3,3.32s-3.31-1.39-3.31-3.32,1.49-3.31,3.31-3.31,3.3,1.39,3.3,3.31ZM192.92,9.47c0-1.68-1.26-2.88-2.84-2.88s-2.84,1.2-2.84,2.88,1.26,2.89,2.84,2.89,2.84-1.2,2.84-2.89ZM188.69,11.17v-3.51h1.61c.85,0,1.35.39,1.35,1.15,0,.53-.3.86-.67,1.02l.79,1.35h-.89l-.72-1.22h-.64v1.22h-.82ZM190.18,9.31c.46,0,.64-.16.64-.5s-.19-.49-.64-.49h-.67v.99h.67Z"}),p.createElement("path",{d:"M54.72,24.84v10.93h-5.4V6.1h12.26c7.02,0,11.1,3.2,11.1,9.39s-4.07,9.35-11.06,9.35h-6.9,0ZM61.12,20.52c4.07,0,6.11-1.66,6.11-5.03s-2.04-5.03-6.11-5.03h-6.4v10.06h6.4Z"}),p.createElement("path",{d:"M85.94,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.18-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM85.73,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z"}),p.createElement("path",{d:"M90.39,14.66h5.4l5.86,15.92h.08l5.57-15.92h5.28l-8.23,21.49c-2,5.28-4.45,7.32-8.89,7.36-.71,0-1.7-.08-2.45-.21v-4.03c.62.13.96.13,1.41.13,2.16,0,3.07-.75,4.2-3.66l-8.23-21.07h0Z"}),p.createElement("path",{d:"M113.46,35.77V6.1h5.32v29.67h-5.32Z"}),p.createElement("path",{d:"M130.79,36.27c-6.23,0-10.68-4.2-10.68-11.05s4.45-11.05,10.68-11.05,10.68,4.24,10.68,11.05-4.45,11.05-10.68,11.05ZM130.79,32.32c3.41,0,5.36-2.66,5.36-7.11s-1.95-7.11-5.36-7.11-5.36,2.7-5.36,7.11,1.91,7.11,5.36,7.11Z"}),p.createElement("path",{d:"M156.19,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.19-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM155.98,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z"}),p.createElement("path",{d:"M178.5,32.41c-1.04,2.12-3.58,3.87-6.78,3.87-5.53,0-9.31-4.49-9.31-11.05s3.78-11.05,9.31-11.05c3.28,0,5.69,1.83,6.69,3.95V6.1h5.32v29.67h-5.24v-3.37h0ZM178.55,24.84c0-4.11-1.95-6.78-5.32-6.78s-5.45,2.83-5.45,7.15,2,7.15,5.45,7.15,5.32-2.66,5.32-6.78v-.75h0Z"}))));import{fieldIsHiddenOrDisabled as J,fieldIsID as X}from"payload/shared";var _=e=>{let t=n=>n.type!=="ui"&&J(n)&&!X(n)||n?.admin?.disableListColumn===!0;return e?.reduce((n,o)=>{if(t(o))return n;let i=o.type==="tabs"&&"tabs"in o?{...o,tabs:o.tabs.map(s=>({...s,fields:s.fields.filter(a=>!t(a))}))}:o;return n.push(i),n},[])};import{fieldAffectsData as P}from"payload/shared";var x=(e,t)=>e?.reduce((r,n)=>P(n)&&n.name===t?r:!P(n)&&"fields"in n?[...r,...x(n.fields,t)]:n.type==="tabs"&&"tabs"in n?[...r,...n.tabs.reduce((o,i)=>[...o,..."name"in i?[i.name]:x(i.fields,t)],[])]:[...r,n.name],[]),ee=(e,t,r)=>{let n=[];if(Array.isArray(r)&&r.length>=1)n=r;else{t&&n.push(t);let o=x(e,t);n=n.concat(o),n=n.slice(0,4)}return n.map(o=>({accessor:o,active:!0}))};function te(e){if(e)try{e.abort()}catch{}}function re(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}import*as M from"qs-esm";var ne={delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"delete"};return fetch(e,n)},get:(e,t={headers:{}})=>{let r="";return t.params&&(r=M.stringify(t.params,{addQueryPrefix:!0})),fetch(`${e}${r}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"PATCH"};return fetch(e,n)},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"post"};return fetch(`${e}`,n)},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},n={...t,credentials:"include",headers:{...r},method:"put"};return fetch(e,n)}};var oe=(e,t)=>!e?.locales||e.locales.length===0?null:e.locales.find(r=>r?.code===t);import{formatAdminURL as ie}from"payload/shared";var se={},g={};function d(e,t){try{let n=(se[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return n in g?g[n]:L(n,n.split(":"))}catch{if(e in g)return g[e];let r=e?.match(ae);return r?L(e,r.slice(1)):NaN}}var ae=/([+-]\d\d):?(\d\d)?/;function L(e,t){let r=+t[0],n=+(t[1]||0);return g[e]=r>0?r*60+n:r*60-n}var f=class e extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(d(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),I(this,NaN),b(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-d(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),b(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},R=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!R.test(e))return;let t=e.replace(R,"$1UTC");f.prototype[t]&&(e.startsWith("get")?f.prototype[e]=function(){return this.internal[t]()}:(f.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),le(this),+this},f.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),b(this),+this}))});function b(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function le(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),I(e)}function I(e){let t=d(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let n=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),i=n-o,s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);let a=n-t;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);let c=d(e.timeZone,e),l=-new Date(+e).getTimezoneOffset()-c,u=c!==t,D=l-a;if(u&&D){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+D);let z=d(e.timeZone,e),C=c-z;C&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+C),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+C))}}import{format as O,formatDistanceToNow as Ye,transpose as ce}from"date-fns";var S=({date:e,i18n:t,pattern:r,timezone:n})=>{let o=new f(new Date(e));if(n){let i=f.tz(n),s=o.withTimeZone(n),a=ce(s,i);return t.dateFNS?O(a,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?O(o,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`};import{getTranslation as pe}from"@payloadcms/translations";function F(e){return typeof e=="object"&&"root"in e}function y(e,t){for(let r of e)"text"in r&&r.text?t+=r.text:"children"in r||(t+=`[${r.type}]`),"children"in r&&r.children&&(t+=y(r.children,t));return t}var me=({collectionConfig:e,data:t,dateFormat:r,fallback:n,globalConfig:o,i18n:i})=>{let s;if(e){let a=e?.admin?.useAsTitle;if(a&&(s=t?.[a]||s,s)){let c=e.fields.find(l=>"name"in l&&l.name===a);if(c?.type==="date"){let l="date"in c.admin&&c?.admin?.date?.displayFormat||r;s=S({date:s,i18n:i,pattern:l})||s}}}return o&&(s=pe(o?.label,i)||o?.slug),F(s)&&(s=y(s.root.children?.[0]?.children||[],"")),!s&&F(n)&&(s=y(n.root.children?.[0]?.children||[],"")),s||(s=typeof n=="string"?n:`[${i.t("general:untitled")}]`),s};import{getTranslation as v}from"@payloadcms/translations";var U=(r=>(r.collection="collections",r.global="globals",r))(U||{});function fe(e,t,r){return e.reduce((o,i)=>{if(i.entity?.admin?.group===!1)return o;if(t?.[i.type.toLowerCase()]?.[i.entity.slug]?.read){let s=v(i.entity.admin.group,r),a="labels"in i.entity?i.entity.labels.plural:i.entity.label,c=typeof a=="function"?a({i18n:r,t:r.t}):a;if(i.entity.admin.group){let m=o.find(u=>v(u.label,r)===s),l=m;m||(l={entities:[],label:s},o.push(l)),l.entities.push({slug:i.entity.slug,type:i.type,label:c})}else o.find(l=>v(l.label,r)===r.t(`general:${i.type}`)).entities.push({slug:i.entity.slug,type:i.type,label:c})}return o},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(o=>o.entities.length>0)}import{formatAdminURL as de}from"payload/shared";var ue=({adminRoute:e,router:t})=>{let r=de({adminRoute:e,path:"/"});t.push(r)};import{formatAdminURL as he}from"payload/shared";var ge=({adminRoute:e,collectionSlug:t,router:r})=>{let n=he({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(n)};var ye=(e,t,r,n,o,i,s,a,c,m)=>{if(c)try{i(e,t??r,n),o||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:n},s(n),o&&m&&m(!1)}catch(l){console.error("Error during document takeover:",l)}};var Ce=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:n,isEditing:o}=e;return t?!!(o&&r?.update||!o&&r?.create):n?!!r?.update:!1};var Te=e=>e&&typeof e=="object";var xe=({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e);function be(e){return e===void 0||typeof e=="number"?e:decodeURIComponent(e)}import{mergeListSearchAndWhere as Zt}from"payload/shared";export{U as EntityType,K as PayloadIcon,Q as PayloadLogo,k as Translation,q as WithServerSideProps,te as abortAndIgnore,_ as filterFields,oe as findLocaleFromCode,ie as formatAdminURL,S as formatDate,me as formatDocTitle,ee as getInitialColumns,fe as groupNavItems,re as handleAbortRef,ue as handleBackToDashboard,ge as handleGoBack,ye as handleTakeOver,Ce as hasSavePermission,Te as isClientUserObject,xe as isEditing,$ as mergeFieldStyles,Zt as mergeListSearchAndWhere,V as reduceToSerializableFields,ne as requests,be as sanitizeID,E as withMergedProps};
6
6
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/Translation/index.tsx", "../../../src/elements/withMergedProps/index.tsx", "../../../src/elements/WithServerSideProps/index.tsx", "../../../src/fields/mergeFieldStyles.ts", "../../../src/forms/Form/reduceToSerializableFields.ts", "../../../src/graphics/Icon/index.tsx", "../../../src/graphics/Logo/index.tsx", "../../../src/providers/TableColumns/buildColumnState/filterFields.tsx", "../../../src/providers/TableColumns/getInitialColumns.ts", "../../../src/utilities/abortAndIgnore.ts", "../../../src/utilities/api.ts", "../../../src/utilities/findLocaleFromCode.ts", "../../../src/utilities/formatAdminURL.ts", "../../../../../node_modules/.pnpm/@date-fns+tz@1.2.0/node_modules/@date-fns/tz/tzOffset/index.js", "../../../../../node_modules/.pnpm/@date-fns+tz@1.2.0/node_modules/@date-fns/tz/date/mini.js", "../../../src/utilities/formatDocTitle/formatDateTitle.ts", "../../../src/utilities/formatDocTitle/index.ts", "../../../src/utilities/formatDocTitle/formatLexicalDocTitle.ts", "../../../src/utilities/groupNavItems.ts", "../../../src/utilities/handleBackToDashboard.tsx", "../../../src/utilities/handleGoBack.tsx", "../../../src/utilities/handleTakeOver.tsx", "../../../src/utilities/hasSavePermission.ts", "../../../src/utilities/isClientUserObject.ts", "../../../src/utilities/isEditing.ts", "../../../src/utilities/sanitizeID.ts", "../../../src/exports/shared/index.ts"],
4
- "sourcesContent": ["import type { ClientTranslationKeys, TFunction } from '@payloadcms/translations'\n\nimport * as React from 'react'\n\nconst RecursiveTranslation: React.FC<{\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n translationString: string\n}> = ({ elements, translationString }) => {\n const regex = /(<[^>]+>.*?<\\/[^>]+>)/g\n const sections = translationString.split(regex)\n\n return (\n <span>\n {sections.map((section, index) => {\n if (elements && section.startsWith('<') && section.endsWith('>')) {\n const elementKey = section[1]\n const Element = elements[elementKey]\n\n if (Element) {\n const regex = new RegExp(`<${elementKey}>(.*?)<\\/${elementKey}>`, 'g')\n const children = section.replace(regex, (_, group) => group)\n\n return (\n <Element key={index}>\n <RecursiveTranslation translationString={children} />\n </Element>\n )\n }\n }\n\n return section\n })}\n </span>\n )\n}\n\nexport type TranslationProps = {\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n i18nKey: ClientTranslationKeys\n t: TFunction\n variables?: Record<string, unknown>\n}\n\nexport const Translation: React.FC<TranslationProps> = ({ elements, i18nKey, t, variables }) => {\n const stringWithVariables = t(i18nKey, variables || {})\n\n if (!elements) {\n return stringWithVariables\n }\n\n return <RecursiveTranslation elements={elements} translationString={stringWithVariables} />\n}\n", "import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent = getMergedPropsComponent({\n * Component: OriginalComponent,\n * toMergeIntoProps: { someExtraValue: 5 }\n * });\n * // Using <PredefinedComponent customProp=\"value\" /> will result in\n * // <OriginalComponent customProp=\"value\" someExtraValue={5} />\n *\n * @returns A higher-order component with combined properties.\n *\n * @param Component - The original component to wrap.\n * @param sanitizeServerOnlyProps - If true, server-only props will be removed from the merged props. @default true if the component is not a server component, false otherwise.\n * @param toMergeIntoProps - The properties to merge into the passed props.\n */\nexport function withMergedProps<ToMergeIntoProps, CompleteReturnProps>({\n Component,\n sanitizeServerOnlyProps,\n toMergeIntoProps,\n}: {\n Component: React.FC<CompleteReturnProps>\n sanitizeServerOnlyProps?: boolean\n toMergeIntoProps: ToMergeIntoProps\n}): React.FC<CompleteReturnProps> {\n if (sanitizeServerOnlyProps === undefined) {\n sanitizeServerOnlyProps = !isReactServerComponentOrFunction(Component)\n }\n // A wrapper around the args.Component to inject the args.toMergeArgs as props, which are merged with the passed props\n const MergedPropsComponent: React.FC<CompleteReturnProps> = (passedProps) => {\n const mergedProps = simpleMergeProps(passedProps, toMergeIntoProps) as CompleteReturnProps\n\n if (sanitizeServerOnlyProps) {\n serverProps.forEach((prop) => {\n delete mergedProps[prop]\n })\n }\n\n return <Component {...mergedProps} />\n }\n\n return MergedPropsComponent\n}\n\nfunction simpleMergeProps(props, toMerge) {\n return { ...props, ...toMerge }\n}\n", "import type { WithServerSidePropsComponent } from 'payload'\n\nimport { isReactServerComponentOrFunction } from 'payload/shared'\nimport React from 'react'\n\nexport const WithServerSideProps: WithServerSidePropsComponent = ({\n Component,\n serverOnlyProps,\n ...rest\n}) => {\n if (Component) {\n const WithServerSideProps: React.FC = (passedProps) => {\n const propsWithServerOnlyProps = {\n ...passedProps,\n ...(isReactServerComponentOrFunction(Component) ? (serverOnlyProps ?? {}) : {}),\n }\n\n return <Component {...propsWithServerOnlyProps} />\n }\n\n return WithServerSideProps(rest)\n }\n\n return null\n}\n", "import type { ClientField } from 'payload'\n\nexport const mergeFieldStyles = (\n field: ClientField | Omit<ClientField, 'type'>,\n): React.CSSProperties => ({\n ...(field?.admin?.style || {}),\n ...(field?.admin?.width\n ? {\n '--field-width': field.admin.width,\n }\n : {\n flex: '1 1 auto',\n }),\n // allow flex overrides to still take precedence over the fallback\n ...(field?.admin?.style?.flex\n ? {\n flex: field.admin.style.flex,\n }\n : {}),\n})\n", "import { type FormField, type FormState } from 'payload'\n\ntype BlacklistedKeys = 'customComponents' | 'validate'\nconst blacklistedKeys: BlacklistedKeys[] = ['validate', 'customComponents']\n\nconst sanitizeField = (incomingField: FormField): FormField => {\n const field = { ...incomingField } // shallow copy, as we only need to remove top-level keys\n\n for (const key of blacklistedKeys) {\n delete field[key]\n }\n\n return field\n}\n\n/**\n * Takes in FormState and removes fields that are not serializable.\n * Returns FormState without blacklisted keys.\n */\nexport const reduceToSerializableFields = (\n fields: FormState,\n): {\n [key: string]: Omit<FormField, BlacklistedKeys>\n} => {\n const result: Record<string, Omit<FormField, BlacklistedKeys>> = {}\n\n for (const key in fields) {\n result[key] = sanitizeField(fields[key])\n }\n\n return result\n}\n", "import React from 'react'\n\nexport const PayloadIcon: React.FC<{\n fill?: string\n}> = ({ fill: fillFromProps }) => {\n const fill = fillFromProps || 'var(--theme-elevation-1000)'\n\n return (\n <svg\n className=\"graphic-icon\"\n height=\"100%\"\n viewBox=\"0 0 25 25\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z\"\n fill={fill}\n />\n <path\n d=\"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z\"\n fill={fill}\n />\n </svg>\n )\n}\n", "import React from 'react'\n\nconst css = `\n .graphic-logo path {\n fill: var(--theme-elevation-1000);\n }\n`\n\nexport const PayloadLogo: React.FC = () => (\n <svg\n className=\"graphic-logo\"\n fill=\"none\"\n height=\"43.5\"\n id=\"b\"\n viewBox=\"0 0 193.38 43.5\"\n width=\"193.38\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <style>{css}</style>\n <g id=\"c\">\n <path d=\"M18.01,35.63l-12.36-7.13c-.15-.09-.25-.25-.25-.43v-11.02c0-.19.21-.31.37-.22l14.35,8.28c.2.12.45-.03.45-.26v-5.37c0-.21-.11-.41-.3-.52L3.01,9c-.15-.09-.35-.09-.5,0l-2.26,1.31c-.15.09-.25.25-.25.43v20.47c0,.18.1.34.25.43l17.73,10.24c.15.09.35.09.5,0l14.89-8.6c.2-.12.2-.4,0-.52l-4.64-2.68c-.19-.11-.41-.11-.6,0l-9.61,5.55c-.15.09-.35.09-.5,0Z\" />\n <path d=\"M36.21,10.3L18.48.07c-.15-.09-.35-.09-.5,0l-9.37,5.41c-.2.12-.2.4,0,.52l4.6,2.66c.19.11.41.11.6,0l4.2-2.42c.15-.09.35-.09.5,0l12.36,7.13c.15.09.25.25.25.43v11.07c0,.21.11.41.3.52l4.6,2.65c.2.12.45-.03.45-.26V10.74c0-.18-.1-.34-.25-.43Z\" />\n <g id=\"d\">\n <path d=\"M193.38,9.47c0,1.94-1.48,3.32-3.3,3.32s-3.31-1.39-3.31-3.32,1.49-3.31,3.31-3.31,3.3,1.39,3.3,3.31ZM192.92,9.47c0-1.68-1.26-2.88-2.84-2.88s-2.84,1.2-2.84,2.88,1.26,2.89,2.84,2.89,2.84-1.2,2.84-2.89ZM188.69,11.17v-3.51h1.61c.85,0,1.35.39,1.35,1.15,0,.53-.3.86-.67,1.02l.79,1.35h-.89l-.72-1.22h-.64v1.22h-.82ZM190.18,9.31c.46,0,.64-.16.64-.5s-.19-.49-.64-.49h-.67v.99h.67Z\" />\n <path d=\"M54.72,24.84v10.93h-5.4V6.1h12.26c7.02,0,11.1,3.2,11.1,9.39s-4.07,9.35-11.06,9.35h-6.9,0ZM61.12,20.52c4.07,0,6.11-1.66,6.11-5.03s-2.04-5.03-6.11-5.03h-6.4v10.06h6.4Z\" />\n <path d=\"M85.94,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.18-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM85.73,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M90.39,14.66h5.4l5.86,15.92h.08l5.57-15.92h5.28l-8.23,21.49c-2,5.28-4.45,7.32-8.89,7.36-.71,0-1.7-.08-2.45-.21v-4.03c.62.13.96.13,1.41.13,2.16,0,3.07-.75,4.2-3.66l-8.23-21.07h0Z\" />\n <path d=\"M113.46,35.77V6.1h5.32v29.67h-5.32Z\" />\n <path d=\"M130.79,36.27c-6.23,0-10.68-4.2-10.68-11.05s4.45-11.05,10.68-11.05,10.68,4.24,10.68,11.05-4.45,11.05-10.68,11.05ZM130.79,32.32c3.41,0,5.36-2.66,5.36-7.11s-1.95-7.11-5.36-7.11-5.36,2.7-5.36,7.11,1.91,7.11,5.36,7.11Z\" />\n <path d=\"M156.19,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.19-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM155.98,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M178.5,32.41c-1.04,2.12-3.58,3.87-6.78,3.87-5.53,0-9.31-4.49-9.31-11.05s3.78-11.05,9.31-11.05c3.28,0,5.69,1.83,6.69,3.95V6.1h5.32v29.67h-5.24v-3.37h0ZM178.55,24.84c0-4.11-1.95-6.78-5.32-6.78s-5.45,2.83-5.45,7.15,2,7.15,5.45,7.15,5.32-2.66,5.32-6.78v-.75h0Z\" />\n </g>\n </g>\n </svg>\n)\n", "import type { ClientField, Field } from 'payload'\n\nimport { fieldIsHiddenOrDisabled, fieldIsID } from 'payload/shared'\n\n/**\n * Filters fields that are hidden, disabled, or have `disableListColumn` set to `true`\n * Does so recursively for `tabs` fields.\n */\nexport const filterFields = <T extends ClientField | Field>(incomingFields: T[]): T[] => {\n const shouldSkipField = (field: T): boolean =>\n (field.type !== 'ui' && fieldIsHiddenOrDisabled(field) && !fieldIsID(field)) ||\n field?.admin?.disableListColumn === true\n\n const fields: T[] = incomingFields?.reduce((acc, field) => {\n if (shouldSkipField(field)) {\n return acc\n }\n\n // extract top-level `tabs` fields and filter out the same\n const formattedField: T =\n field.type === 'tabs' && 'tabs' in field\n ? {\n ...field,\n tabs: field.tabs.map((tab) => ({\n ...tab,\n fields: tab.fields.filter((tabField) => !shouldSkipField(tabField)),\n })),\n }\n : field\n\n acc.push(formattedField)\n\n return acc\n }, [])\n\n return fields\n}\n", "import type { ClientField, CollectionConfig, Field, ListPreferences } from 'payload'\n\nimport { fieldAffectsData } from 'payload/shared'\n\nconst getRemainingColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: string,\n): ListPreferences['columns'] =>\n fields?.reduce((remaining, field) => {\n if (fieldAffectsData(field) && field.name === useAsTitle) {\n return remaining\n }\n\n if (!fieldAffectsData(field) && 'fields' in field) {\n return [...remaining, ...getRemainingColumns(field.fields, useAsTitle)]\n }\n\n if (field.type === 'tabs' && 'tabs' in field) {\n return [\n ...remaining,\n ...field.tabs.reduce(\n (tabFieldColumns, tab) => [\n ...tabFieldColumns,\n ...('name' in tab ? [tab.name] : getRemainingColumns(tab.fields, useAsTitle)),\n ],\n [],\n ),\n ]\n }\n\n return [...remaining, field.name]\n }, [])\n\n/**\n * Returns the initial columns to display in the table based on the following criteria:\n * 1. If `defaultColumns` is set in the collection config, use those columns\n * 2. Otherwise take `useAtTitle, if set, and the next 3 fields that are not hidden or disabled\n */\nexport const getInitialColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: CollectionConfig['admin']['useAsTitle'],\n defaultColumns: CollectionConfig['admin']['defaultColumns'],\n): ListPreferences['columns'] => {\n let initialColumns = []\n\n if (Array.isArray(defaultColumns) && defaultColumns.length >= 1) {\n initialColumns = defaultColumns\n } else {\n if (useAsTitle) {\n initialColumns.push(useAsTitle)\n }\n\n const remainingColumns = getRemainingColumns(fields, useAsTitle)\n\n initialColumns = initialColumns.concat(remainingColumns)\n initialColumns = initialColumns.slice(0, 4)\n }\n\n return initialColumns.map((column) => ({\n accessor: column,\n active: true,\n }))\n}\n", "export function abortAndIgnore(abortController: AbortController) {\n if (abortController) {\n try {\n abortController.abort()\n } catch (_err) {\n // swallow error\n }\n }\n}\n\n/**\n * Use this function when an effect is triggered multiple times over and you want to cancel the previous effect.\n * It will abort the previous effect and create a new AbortController for the next effect.\n * Important: You must also _reset_ the `abortControllerRef` after the effect is done, otherwise the next effect will be aborted immediately.\n * For example, run `abortControllerRef.current = null` in a `finally` block or after an awaited promise.\n * @param abortControllerRef\n * @returns {AbortController}\n */\nexport function handleAbortRef(\n abortControllerRef: React.RefObject<AbortController>,\n): AbortController {\n const newController = new AbortController()\n\n if (abortControllerRef.current) {\n try {\n abortControllerRef.current.abort()\n } catch (_err) {\n // swallow error\n }\n }\n\n abortControllerRef.current = newController\n\n return newController\n}\n", "import * as qs from 'qs-esm'\n\ntype GetOptions = {\n params?: Record<string, unknown>\n} & RequestInit\n\nexport const requests = {\n delete: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'delete',\n }\n\n return fetch(url, formattedOptions)\n },\n\n get: (url: string, options: GetOptions = { headers: {} }): Promise<Response> => {\n let query = ''\n if (options.params) {\n query = qs.stringify(options.params, { addQueryPrefix: true })\n }\n return fetch(`${url}${query}`, {\n credentials: 'include',\n ...options,\n })\n },\n\n patch: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'PATCH',\n }\n\n return fetch(url, formattedOptions)\n },\n\n post: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'post',\n }\n\n return fetch(`${url}`, formattedOptions)\n },\n\n put: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'put',\n }\n\n return fetch(url, formattedOptions)\n },\n}\n", "import type { Locale, SanitizedLocalizationConfig } from 'payload'\n/*\n return the Locale for given locale code, else return null\n*/\nexport const findLocaleFromCode = (\n localizationConfig: SanitizedLocalizationConfig,\n locale: string,\n): Locale | null => {\n if (!localizationConfig?.locales || localizationConfig.locales.length === 0) {\n return null\n }\n\n return localizationConfig.locales.find((el) => el?.code === locale)\n}\n", "/** Will read the `routes.admin` config and appropriately handle `\"/\"` admin paths */\nexport { formatAdminURL } from 'payload/shared'\n", "const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function extracts UTC offset in minutes from the given date in specified\n * time zone.\n *\n * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value\n * mirrored to the sign of the offset in the time zone. For Asia/Singapore\n * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.\n *\n * @param timeZone - Time zone name (IANA or UTC offset)\n * @param date - Date to check the offset for\n *\n * @returns UTC offset in minutes\n */\nexport function tzOffset(timeZone, date) {\n try {\n const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat(\"en-GB\", {\n timeZone,\n hour: \"numeric\",\n timeZoneName: \"longOffset\"\n }).format;\n const offsetStr = format(date).split('GMT')[1] || '';\n if (offsetStr in offsetCache) return offsetCache[offsetStr];\n return calcOffset(offsetStr, offsetStr.split(\":\"));\n } catch {\n // Fallback to manual parsing if the runtime doesn't support \u00B1HH:MM/\u00B1HHMM/\u00B1HH\n // See: https://github.com/nodejs/node/issues/53419\n if (timeZone in offsetCache) return offsetCache[timeZone];\n const captures = timeZone?.match(offsetRe);\n if (captures) return calcOffset(timeZone, captures.slice(1));\n return NaN;\n }\n}\nconst offsetRe = /([+-]\\d\\d):?(\\d\\d)?/;\nfunction calcOffset(cacheStr, values) {\n const hours = +values[0];\n const minutes = +(values[1] || 0);\n return offsetCache[cacheStr] = hours > 0 ? hours * 60 + minutes : hours * 60 - minutes;\n}", "import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n return -tzOffset(this.timeZone, this);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const offset = tzOffset(date.timeZone, date);\n\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postOffset = tzOffset(date.timeZone, date);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newOffset = tzOffset(date.timeZone, date);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}", "import type { I18n } from '@payloadcms/translations'\n\nimport { TZDateMini as TZDate } from '@date-fns/tz/date/mini'\nimport { format, formatDistanceToNow, transpose } from 'date-fns'\n\nexport type FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown>\n pattern: string\n timezone?: string\n}\n\nexport const formatDate = ({ date, i18n, pattern, timezone }: FormatDateArgs): string => {\n const theDate = new TZDate(new Date(date))\n\n if (timezone) {\n const DateWithOriginalTz = TZDate.tz(timezone)\n\n const modifiedDate = theDate.withTimeZone(timezone)\n\n // Transpose the date to the selected timezone\n const dateWithTimezone = transpose(modifiedDate, DateWithOriginalTz)\n\n // Transpose the date to the user's timezone - this is necessary because the react-datepicker component insists on displaying the date in the user's timezone\n return i18n.dateFNS\n ? format(dateWithTimezone, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n }\n\n return i18n.dateFNS\n ? format(theDate, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n\ntype FormatTimeToNowArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = new Date(date)\n return i18n?.dateFNS\n ? formatDistanceToNow(theDate, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n", "import type { I18n } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientGlobalConfig,\n SanitizedConfig,\n TypeWithID,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { formatDate } from './formatDateTitle.js'\nimport { formatLexicalDocTitle, isSerializedLexicalEditor } from './formatLexicalDocTitle.js'\n\nexport const formatDocTitle = ({\n collectionConfig,\n data,\n dateFormat: dateFormatFromConfig,\n fallback,\n globalConfig,\n i18n,\n}: {\n collectionConfig?: ClientCollectionConfig\n data: TypeWithID\n dateFormat: SanitizedConfig['admin']['dateFormat']\n fallback?: object | string\n globalConfig?: ClientGlobalConfig\n i18n: I18n<any, any>\n}): string => {\n let title: string\n\n if (collectionConfig) {\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n if (useAsTitle) {\n title = data?.[useAsTitle] || title\n\n if (title) {\n const fieldConfig = collectionConfig.fields.find(\n (f) => 'name' in f && f.name === useAsTitle,\n )\n\n const isDate = fieldConfig?.type === 'date'\n\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n // richtext lexical case. We convert the first child of root to plain text\n if (isSerializedLexicalEditor(title)) {\n title = formatLexicalDocTitle(title.root.children?.[0]?.children || [], '')\n }\n\n if (!title && isSerializedLexicalEditor(fallback)) {\n title = formatLexicalDocTitle(fallback.root.children?.[0]?.children || [], '')\n }\n\n if (!title) {\n title = typeof fallback === 'string' ? fallback : `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n", "type SerializedLexicalEditor = {\n root: {\n children: Array<{ children?: Array<{ type: string }>; type: string }>\n }\n}\n\nexport function isSerializedLexicalEditor(value: unknown): value is SerializedLexicalEditor {\n return typeof value === 'object' && 'root' in value\n}\n\nexport function formatLexicalDocTitle(\n editorState: Array<{ children?: Array<{ type: string }>; type: string }>,\n textContent: string,\n): string {\n for (const node of editorState) {\n if ('text' in node && node.text) {\n textContent += node.text as string\n } else {\n if (!('children' in node)) {\n textContent += `[${node.type}]`\n }\n }\n if ('children' in node && node.children) {\n textContent += formatLexicalDocTitle(node.children as Array<{ type: string }>, textContent)\n }\n }\n return textContent\n}\n", "import type { I18nClient } from '@payloadcms/translations'\nimport type {\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n SanitizedPermissions,\n StaticLabel,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nexport enum EntityType {\n collection = 'collections',\n global = 'globals',\n}\n\nexport type EntityToGroup =\n | {\n entity: SanitizedCollectionConfig\n type: EntityType.collection\n }\n | {\n entity: SanitizedGlobalConfig\n type: EntityType.global\n }\n\nexport type NavGroupType = {\n entities: {\n label: StaticLabel\n slug: string\n type: EntityType\n }[]\n label: string\n}\n\nexport function groupNavItems(\n entities: EntityToGroup[],\n permissions: SanitizedPermissions,\n i18n: I18nClient,\n): NavGroupType[] {\n const result = entities.reduce(\n (groups, entityToGroup) => {\n // Skip entities where admin.group is explicitly false\n if (entityToGroup.entity?.admin?.group === false) {\n return groups\n }\n\n if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read) {\n const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n)\n\n const labelOrFunction =\n 'labels' in entityToGroup.entity\n ? entityToGroup.entity.labels.plural\n : entityToGroup.entity.label\n\n const label =\n typeof labelOrFunction === 'function'\n ? labelOrFunction({ i18n, t: i18n.t })\n : labelOrFunction\n\n if (entityToGroup.entity.admin.group) {\n const existingGroup = groups.find(\n (group) => getTranslation(group.label, i18n) === translatedGroup,\n ) as NavGroupType\n\n let matchedGroup: NavGroupType = existingGroup\n\n if (!existingGroup) {\n matchedGroup = { entities: [], label: translatedGroup }\n groups.push(matchedGroup)\n }\n\n matchedGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n } else {\n const defaultGroup = groups.find((group) => {\n return getTranslation(group.label, i18n) === i18n.t(`general:${entityToGroup.type}`)\n }) as NavGroupType\n defaultGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n }\n }\n\n return groups\n },\n [\n {\n entities: [],\n label: i18n.t('general:collections'),\n },\n {\n entities: [],\n label: i18n.t('general:globals'),\n },\n ],\n )\n\n return result.filter((group) => group.entities.length > 0)\n}\n", "import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype BackToDashboardProps = {\n adminRoute: string\n router: AppRouterInstance\n}\n\nexport const handleBackToDashboard = ({ adminRoute, router }: BackToDashboardProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: '/',\n })\n router.push(redirectRoute)\n}\n", "import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype GoBackProps = {\n adminRoute: string\n collectionSlug: string\n router: AppRouterInstance\n}\n\nexport const handleGoBack = ({ adminRoute, collectionSlug, router }: GoBackProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: collectionSlug ? `/collections/${collectionSlug}` : '/',\n })\n router.push(redirectRoute)\n}\n", "import type { ClientUser } from 'payload'\n\nexport const handleTakeOver = (\n id: number | string,\n collectionSlug: string,\n globalSlug: string,\n user: ClientUser | number | string,\n isWithinDoc: boolean,\n updateDocumentEditor: (\n docID: number | string,\n slug: string,\n user: ClientUser | number | string,\n ) => Promise<void>,\n setCurrentEditor: (value: React.SetStateAction<ClientUser | number | string>) => void,\n documentLockStateRef: React.RefObject<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: ClientUser | number | string\n }>,\n isLockingEnabled: boolean,\n setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void,\n): void => {\n if (!isLockingEnabled) {\n return\n }\n\n try {\n // Call updateDocumentEditor to update the document's owner to the current user\n void updateDocumentEditor(id, collectionSlug ?? globalSlug, user)\n\n if (!isWithinDoc) {\n documentLockStateRef.current.hasShownLockedModal = true\n }\n\n // Update the locked state to reflect the current user as the owner\n documentLockStateRef.current = {\n hasShownLockedModal: documentLockStateRef.current?.hasShownLockedModal,\n isLocked: true,\n user,\n }\n setCurrentEditor(user)\n\n // If this is a takeover within the document, ensure the document is editable\n if (isWithinDoc && setIsReadOnlyForIncomingUser) {\n setIsReadOnlyForIncomingUser(false)\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error during document takeover:', error)\n }\n}\n", "import type {\n SanitizedCollectionPermission,\n SanitizedDocumentPermissions,\n SanitizedGlobalPermission,\n} from 'payload'\n\nexport const hasSavePermission = (args: {\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n collectionSlug?: string\n docPermissions: SanitizedDocumentPermissions\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n globalSlug?: string\n isEditing: boolean\n}) => {\n const { collectionSlug, docPermissions, globalSlug, isEditing } = args\n\n if (collectionSlug) {\n return Boolean(\n (isEditing && docPermissions?.update) ||\n (!isEditing && (docPermissions as SanitizedCollectionPermission)?.create),\n )\n }\n\n if (globalSlug) {\n return Boolean((docPermissions as SanitizedGlobalPermission)?.update)\n }\n\n return false\n}\n", "import type { ClientUser } from 'payload'\n\nexport const isClientUserObject = (user): user is ClientUser => {\n return user && typeof user === 'object'\n}\n", "export const isEditing = ({\n id,\n collectionSlug,\n globalSlug,\n}: {\n collectionSlug?: string\n globalSlug?: string\n id?: number | string\n}): boolean => Boolean(globalSlug || (collectionSlug && !!id))\n", "export function sanitizeID(id: number | string): number | string {\n if (id === undefined) {\n return id\n }\n\n if (typeof id === 'number') {\n return id\n }\n\n return decodeURIComponent(id)\n}\n", "export { Translation } from '../../elements/Translation/index.js'\nexport { withMergedProps } from '../../elements/withMergedProps/index.js' // cannot be within a 'use client', thus we export this from shared\nexport { WithServerSideProps } from '../../elements/WithServerSideProps/index.js'\nexport { mergeFieldStyles } from '../../fields/mergeFieldStyles.js'\nexport { reduceToSerializableFields } from '../../forms/Form/reduceToSerializableFields.js'\nexport { PayloadIcon } from '../../graphics/Icon/index.js'\nexport { PayloadLogo } from '../../graphics/Logo/index.js'\n// IMPORTANT: the shared.ts file CANNOT contain any Server Components _that import client components_.\nexport { filterFields } from '../../providers/TableColumns/buildColumnState/filterFields.js'\nexport { getInitialColumns } from '../../providers/TableColumns/getInitialColumns.js'\nexport { abortAndIgnore, handleAbortRef } from '../../utilities/abortAndIgnore.js'\nexport { requests } from '../../utilities/api.js'\nexport { findLocaleFromCode } from '../../utilities/findLocaleFromCode.js'\nexport { formatAdminURL } from '../../utilities/formatAdminURL.js'\nexport { formatDate } from '../../utilities/formatDocTitle/formatDateTitle.js'\nexport { formatDocTitle } from '../../utilities/formatDocTitle/index.js'\nexport {\n type EntityToGroup,\n EntityType,\n groupNavItems,\n type NavGroupType,\n} from '../../utilities/groupNavItems.js'\nexport { handleBackToDashboard } from '../../utilities/handleBackToDashboard.js'\nexport { handleGoBack } from '../../utilities/handleGoBack.js'\nexport { handleTakeOver } from '../../utilities/handleTakeOver.js'\nexport { hasSavePermission } from '../../utilities/hasSavePermission.js'\nexport { isClientUserObject } from '../../utilities/isClientUserObject.js'\nexport { isEditing } from '../../utilities/isEditing.js'\nexport { sanitizeID } from '../../utilities/sanitizeID.js'\n/**\n * @deprecated\n * The `mergeListSearchAndWhere` function is deprecated.\n * Import this from `payload/shared` instead.\n */\nexport { mergeListSearchAndWhere } from 'payload/shared'\n"],
4
+ "sourcesContent": ["import type { ClientTranslationKeys, TFunction } from '@payloadcms/translations'\n\nimport * as React from 'react'\n\nconst RecursiveTranslation: React.FC<{\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n translationString: string\n}> = ({ elements, translationString }) => {\n const regex = /(<[^>]+>.*?<\\/[^>]+>)/g\n const sections = translationString.split(regex)\n\n return (\n <span>\n {sections.map((section, index) => {\n if (elements && section.startsWith('<') && section.endsWith('>')) {\n const elementKey = section[1]\n const Element = elements[elementKey]\n\n if (Element) {\n const regex = new RegExp(`<${elementKey}>(.*?)<\\/${elementKey}>`, 'g')\n const children = section.replace(regex, (_, group) => group)\n\n return (\n <Element key={index}>\n <RecursiveTranslation translationString={children} />\n </Element>\n )\n }\n }\n\n return section\n })}\n </span>\n )\n}\n\nexport type TranslationProps = {\n elements?: Record<string, React.FC<{ children: React.ReactNode }>>\n i18nKey: ClientTranslationKeys\n t: TFunction\n variables?: Record<string, unknown>\n}\n\nexport const Translation: React.FC<TranslationProps> = ({ elements, i18nKey, t, variables }) => {\n const stringWithVariables = t(i18nKey, variables || {})\n\n if (!elements) {\n return stringWithVariables\n }\n\n return <RecursiveTranslation elements={elements} translationString={stringWithVariables} />\n}\n", "import { isReactServerComponentOrFunction, serverProps } from 'payload/shared'\nimport React from 'react'\n\n/**\n * Creates a higher-order component (HOC) that merges predefined properties (`toMergeIntoProps`)\n * with any properties passed to the resulting component.\n *\n * Use this when you want to pre-specify some props for a component, while also allowing users to\n * pass in their own props. The HOC ensures the passed props and predefined props are combined before\n * rendering the original component.\n *\n * @example\n * const PredefinedComponent = getMergedPropsComponent({\n * Component: OriginalComponent,\n * toMergeIntoProps: { someExtraValue: 5 }\n * });\n * // Using <PredefinedComponent customProp=\"value\" /> will result in\n * // <OriginalComponent customProp=\"value\" someExtraValue={5} />\n *\n * @returns A higher-order component with combined properties.\n *\n * @param Component - The original component to wrap.\n * @param sanitizeServerOnlyProps - If true, server-only props will be removed from the merged props. @default true if the component is not a server component, false otherwise.\n * @param toMergeIntoProps - The properties to merge into the passed props.\n */\nexport function withMergedProps<ToMergeIntoProps, CompleteReturnProps>({\n Component,\n sanitizeServerOnlyProps,\n toMergeIntoProps,\n}: {\n Component: React.FC<CompleteReturnProps>\n sanitizeServerOnlyProps?: boolean\n toMergeIntoProps: ToMergeIntoProps\n}): React.FC<CompleteReturnProps> {\n if (sanitizeServerOnlyProps === undefined) {\n sanitizeServerOnlyProps = !isReactServerComponentOrFunction(Component)\n }\n // A wrapper around the args.Component to inject the args.toMergeArgs as props, which are merged with the passed props\n const MergedPropsComponent: React.FC<CompleteReturnProps> = (passedProps) => {\n const mergedProps = simpleMergeProps(passedProps, toMergeIntoProps) as CompleteReturnProps\n\n if (sanitizeServerOnlyProps) {\n serverProps.forEach((prop) => {\n delete mergedProps[prop]\n })\n }\n\n return <Component {...mergedProps} />\n }\n\n return MergedPropsComponent\n}\n\nfunction simpleMergeProps(props, toMerge) {\n return { ...props, ...toMerge }\n}\n", "import type { WithServerSidePropsComponent } from 'payload'\n\nimport { isReactServerComponentOrFunction } from 'payload/shared'\nimport React from 'react'\n\nexport const WithServerSideProps: WithServerSidePropsComponent = ({\n Component,\n serverOnlyProps,\n ...rest\n}) => {\n if (Component) {\n const WithServerSideProps: React.FC = (passedProps) => {\n const propsWithServerOnlyProps = {\n ...passedProps,\n ...(isReactServerComponentOrFunction(Component) ? (serverOnlyProps ?? {}) : {}),\n }\n\n return <Component {...propsWithServerOnlyProps} />\n }\n\n return WithServerSideProps(rest)\n }\n\n return null\n}\n", "import type { ClientField } from 'payload'\n\nexport const mergeFieldStyles = (\n field: ClientField | Omit<ClientField, 'type'>,\n): React.CSSProperties => ({\n ...(field?.admin?.style || {}),\n ...(field?.admin?.width\n ? {\n '--field-width': field.admin.width,\n }\n : {\n flex: '1 1 auto',\n }),\n // allow flex overrides to still take precedence over the fallback\n ...(field?.admin?.style?.flex\n ? {\n flex: field.admin.style.flex,\n }\n : {}),\n})\n", "import { type FormField, type FormState } from 'payload'\n\ntype BlacklistedKeys = 'customComponents' | 'validate'\nconst blacklistedKeys: BlacklistedKeys[] = ['validate', 'customComponents']\n\nconst sanitizeField = (incomingField: FormField): FormField => {\n const field = { ...incomingField } // shallow copy, as we only need to remove top-level keys\n\n for (const key of blacklistedKeys) {\n delete field[key]\n }\n\n return field\n}\n\n/**\n * Takes in FormState and removes fields that are not serializable.\n * Returns FormState without blacklisted keys.\n */\nexport const reduceToSerializableFields = (\n fields: FormState,\n): {\n [key: string]: Omit<FormField, BlacklistedKeys>\n} => {\n const result: Record<string, Omit<FormField, BlacklistedKeys>> = {}\n\n for (const key in fields) {\n result[key] = sanitizeField(fields[key])\n }\n\n return result\n}\n", "import React from 'react'\n\nexport const PayloadIcon: React.FC<{\n fill?: string\n}> = ({ fill: fillFromProps }) => {\n const fill = fillFromProps || 'var(--theme-elevation-1000)'\n\n return (\n <svg\n className=\"graphic-icon\"\n height=\"100%\"\n viewBox=\"0 0 25 25\"\n width=\"100%\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z\"\n fill={fill}\n />\n <path\n d=\"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z\"\n fill={fill}\n />\n </svg>\n )\n}\n", "import React from 'react'\n\nconst css = `\n .graphic-logo path {\n fill: var(--theme-elevation-1000);\n }\n`\n\nexport const PayloadLogo: React.FC = () => (\n <svg\n className=\"graphic-logo\"\n fill=\"none\"\n height=\"43.5\"\n id=\"b\"\n viewBox=\"0 0 193.38 43.5\"\n width=\"193.38\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <style>{css}</style>\n <g id=\"c\">\n <path d=\"M18.01,35.63l-12.36-7.13c-.15-.09-.25-.25-.25-.43v-11.02c0-.19.21-.31.37-.22l14.35,8.28c.2.12.45-.03.45-.26v-5.37c0-.21-.11-.41-.3-.52L3.01,9c-.15-.09-.35-.09-.5,0l-2.26,1.31c-.15.09-.25.25-.25.43v20.47c0,.18.1.34.25.43l17.73,10.24c.15.09.35.09.5,0l14.89-8.6c.2-.12.2-.4,0-.52l-4.64-2.68c-.19-.11-.41-.11-.6,0l-9.61,5.55c-.15.09-.35.09-.5,0Z\" />\n <path d=\"M36.21,10.3L18.48.07c-.15-.09-.35-.09-.5,0l-9.37,5.41c-.2.12-.2.4,0,.52l4.6,2.66c.19.11.41.11.6,0l4.2-2.42c.15-.09.35-.09.5,0l12.36,7.13c.15.09.25.25.25.43v11.07c0,.21.11.41.3.52l4.6,2.65c.2.12.45-.03.45-.26V10.74c0-.18-.1-.34-.25-.43Z\" />\n <g id=\"d\">\n <path d=\"M193.38,9.47c0,1.94-1.48,3.32-3.3,3.32s-3.31-1.39-3.31-3.32,1.49-3.31,3.31-3.31,3.3,1.39,3.3,3.31ZM192.92,9.47c0-1.68-1.26-2.88-2.84-2.88s-2.84,1.2-2.84,2.88,1.26,2.89,2.84,2.89,2.84-1.2,2.84-2.89ZM188.69,11.17v-3.51h1.61c.85,0,1.35.39,1.35,1.15,0,.53-.3.86-.67,1.02l.79,1.35h-.89l-.72-1.22h-.64v1.22h-.82ZM190.18,9.31c.46,0,.64-.16.64-.5s-.19-.49-.64-.49h-.67v.99h.67Z\" />\n <path d=\"M54.72,24.84v10.93h-5.4V6.1h12.26c7.02,0,11.1,3.2,11.1,9.39s-4.07,9.35-11.06,9.35h-6.9,0ZM61.12,20.52c4.07,0,6.11-1.66,6.11-5.03s-2.04-5.03-6.11-5.03h-6.4v10.06h6.4Z\" />\n <path d=\"M85.94,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.18-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM85.73,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M90.39,14.66h5.4l5.86,15.92h.08l5.57-15.92h5.28l-8.23,21.49c-2,5.28-4.45,7.32-8.89,7.36-.71,0-1.7-.08-2.45-.21v-4.03c.62.13.96.13,1.41.13,2.16,0,3.07-.75,4.2-3.66l-8.23-21.07h0Z\" />\n <path d=\"M113.46,35.77V6.1h5.32v29.67h-5.32Z\" />\n <path d=\"M130.79,36.27c-6.23,0-10.68-4.2-10.68-11.05s4.45-11.05,10.68-11.05,10.68,4.24,10.68,11.05-4.45,11.05-10.68,11.05ZM130.79,32.32c3.41,0,5.36-2.66,5.36-7.11s-1.95-7.11-5.36-7.11-5.36,2.7-5.36,7.11,1.91,7.11,5.36,7.11Z\" />\n <path d=\"M156.19,32.45c-1,2.41-3.66,3.78-7.02,3.78-4.11,0-7.11-2.29-7.11-6.11,0-4.24,3.32-5.98,7.61-6.48l6.32-.71v-1c0-2.58-1.58-3.82-3.99-3.82s-3.74,1.29-3.91,3.24h-5.11c.46-4.53,3.99-7.19,9.19-7.19,5.74,0,9.02,2.7,9.02,8.19v8.15c0,1.95.08,3.58.42,5.28h-5.11c-.21-1.16-.29-2.29-.29-3.32h0ZM155.98,27.58v-1.29l-4.7.54c-2.24.29-3.95.79-3.95,2.99,0,1.66,1.16,2.7,3.28,2.7,2.74,0,5.36-1.62,5.36-4.95h0Z\" />\n <path d=\"M178.5,32.41c-1.04,2.12-3.58,3.87-6.78,3.87-5.53,0-9.31-4.49-9.31-11.05s3.78-11.05,9.31-11.05c3.28,0,5.69,1.83,6.69,3.95V6.1h5.32v29.67h-5.24v-3.37h0ZM178.55,24.84c0-4.11-1.95-6.78-5.32-6.78s-5.45,2.83-5.45,7.15,2,7.15,5.45,7.15,5.32-2.66,5.32-6.78v-.75h0Z\" />\n </g>\n </g>\n </svg>\n)\n", "import type { ClientField, Field } from 'payload'\n\nimport { fieldIsHiddenOrDisabled, fieldIsID } from 'payload/shared'\n\n/**\n * Filters fields that are hidden, disabled, or have `disableListColumn` set to `true`\n * Does so recursively for `tabs` fields.\n */\nexport const filterFields = <T extends ClientField | Field>(incomingFields: T[]): T[] => {\n const shouldSkipField = (field: T): boolean =>\n (field.type !== 'ui' && fieldIsHiddenOrDisabled(field) && !fieldIsID(field)) ||\n field?.admin?.disableListColumn === true\n\n const fields: T[] = incomingFields?.reduce((acc, field) => {\n if (shouldSkipField(field)) {\n return acc\n }\n\n // extract top-level `tabs` fields and filter out the same\n const formattedField: T =\n field.type === 'tabs' && 'tabs' in field\n ? {\n ...field,\n tabs: field.tabs.map((tab) => ({\n ...tab,\n fields: tab.fields.filter((tabField) => !shouldSkipField(tabField)),\n })),\n }\n : field\n\n acc.push(formattedField)\n\n return acc\n }, [])\n\n return fields\n}\n", "import type { ClientField, CollectionConfig, Field, ListPreferences } from 'payload'\n\nimport { fieldAffectsData } from 'payload/shared'\n\nconst getRemainingColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: string,\n): ListPreferences['columns'] =>\n fields?.reduce((remaining, field) => {\n if (fieldAffectsData(field) && field.name === useAsTitle) {\n return remaining\n }\n\n if (!fieldAffectsData(field) && 'fields' in field) {\n return [...remaining, ...getRemainingColumns(field.fields, useAsTitle)]\n }\n\n if (field.type === 'tabs' && 'tabs' in field) {\n return [\n ...remaining,\n ...field.tabs.reduce(\n (tabFieldColumns, tab) => [\n ...tabFieldColumns,\n ...('name' in tab ? [tab.name] : getRemainingColumns(tab.fields, useAsTitle)),\n ],\n [],\n ),\n ]\n }\n\n return [...remaining, field.name]\n }, [])\n\n/**\n * Returns the initial columns to display in the table based on the following criteria:\n * 1. If `defaultColumns` is set in the collection config, use those columns\n * 2. Otherwise take `useAtTitle, if set, and the next 3 fields that are not hidden or disabled\n */\nexport const getInitialColumns = <T extends ClientField[] | Field[]>(\n fields: T,\n useAsTitle: CollectionConfig['admin']['useAsTitle'],\n defaultColumns: CollectionConfig['admin']['defaultColumns'],\n): ListPreferences['columns'] => {\n let initialColumns = []\n\n if (Array.isArray(defaultColumns) && defaultColumns.length >= 1) {\n initialColumns = defaultColumns\n } else {\n if (useAsTitle) {\n initialColumns.push(useAsTitle)\n }\n\n const remainingColumns = getRemainingColumns(fields, useAsTitle)\n\n initialColumns = initialColumns.concat(remainingColumns)\n initialColumns = initialColumns.slice(0, 4)\n }\n\n return initialColumns.map((column) => ({\n accessor: column,\n active: true,\n }))\n}\n", "export function abortAndIgnore(abortController: AbortController) {\n if (abortController) {\n try {\n abortController.abort()\n } catch (_err) {\n // swallow error\n }\n }\n}\n\n/**\n * Use this function when an effect is triggered multiple times over and you want to cancel the previous effect.\n * It will abort the previous effect and create a new AbortController for the next effect.\n * Important: You must also _reset_ the `abortControllerRef` after the effect is done, otherwise the next effect will be aborted immediately.\n * For example, run `abortControllerRef.current = null` in a `finally` block or after an awaited promise.\n * @param abortControllerRef\n * @returns {AbortController}\n */\nexport function handleAbortRef(\n abortControllerRef: React.RefObject<AbortController>,\n): AbortController {\n const newController = new AbortController()\n\n if (abortControllerRef.current) {\n try {\n abortControllerRef.current.abort()\n } catch (_err) {\n // swallow error\n }\n }\n\n abortControllerRef.current = newController\n\n return newController\n}\n", "import * as qs from 'qs-esm'\n\ntype GetOptions = {\n params?: Record<string, unknown>\n} & RequestInit\n\nexport const requests = {\n delete: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'delete',\n }\n\n return fetch(url, formattedOptions)\n },\n\n get: (url: string, options: GetOptions = { headers: {} }): Promise<Response> => {\n let query = ''\n if (options.params) {\n query = qs.stringify(options.params, { addQueryPrefix: true })\n }\n return fetch(`${url}${query}`, {\n credentials: 'include',\n ...options,\n })\n },\n\n patch: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'PATCH',\n }\n\n return fetch(url, formattedOptions)\n },\n\n post: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'post',\n }\n\n return fetch(`${url}`, formattedOptions)\n },\n\n put: (url: string, options: RequestInit = { headers: {} }): Promise<Response> => {\n const headers = options && options.headers ? { ...options.headers } : {}\n\n const formattedOptions: RequestInit = {\n ...options,\n credentials: 'include',\n headers: {\n ...headers,\n },\n method: 'put',\n }\n\n return fetch(url, formattedOptions)\n },\n}\n", "import type { Locale, SanitizedLocalizationConfig } from 'payload'\n/*\n return the Locale for given locale code, else return null\n*/\nexport const findLocaleFromCode = (\n localizationConfig: SanitizedLocalizationConfig,\n locale: string,\n): Locale | null => {\n if (!localizationConfig?.locales || localizationConfig.locales.length === 0) {\n return null\n }\n\n return localizationConfig.locales.find((el) => el?.code === locale)\n}\n", "/** Will read the `routes.admin` config and appropriately handle `\"/\"` admin paths */\nexport { formatAdminURL } from 'payload/shared'\n", "const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function extracts UTC offset in minutes from the given date in specified\n * time zone.\n *\n * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value\n * mirrored to the sign of the offset in the time zone. For Asia/Singapore\n * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.\n *\n * @param timeZone - Time zone name (IANA or UTC offset)\n * @param date - Date to check the offset for\n *\n * @returns UTC offset in minutes\n */\nexport function tzOffset(timeZone, date) {\n try {\n const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat(\"en-GB\", {\n timeZone,\n hour: \"numeric\",\n timeZoneName: \"longOffset\"\n }).format;\n const offsetStr = format(date).split('GMT')[1] || '';\n if (offsetStr in offsetCache) return offsetCache[offsetStr];\n return calcOffset(offsetStr, offsetStr.split(\":\"));\n } catch {\n // Fallback to manual parsing if the runtime doesn't support \u00B1HH:MM/\u00B1HHMM/\u00B1HH\n // See: https://github.com/nodejs/node/issues/53419\n if (timeZone in offsetCache) return offsetCache[timeZone];\n const captures = timeZone?.match(offsetRe);\n if (captures) return calcOffset(timeZone, captures.slice(1));\n return NaN;\n }\n}\nconst offsetRe = /([+-]\\d\\d):?(\\d\\d)?/;\nfunction calcOffset(cacheStr, values) {\n const hours = +values[0];\n const minutes = +(values[1] || 0);\n return offsetCache[cacheStr] = hours > 0 ? hours * 60 + minutes : hours * 60 - minutes;\n}", "import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n return -tzOffset(this.timeZone, this);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const offset = tzOffset(date.timeZone, date);\n\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postOffset = tzOffset(date.timeZone, date);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newOffset = tzOffset(date.timeZone, date);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}", "import type { I18n, I18nClient } from '@payloadcms/translations'\n\nimport { TZDateMini as TZDate } from '@date-fns/tz/date/mini'\nimport { format, formatDistanceToNow, transpose } from 'date-fns'\n\nexport type FormatDateArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown> | I18nClient<unknown>\n pattern: string\n timezone?: string\n}\n\nexport const formatDate = ({ date, i18n, pattern, timezone }: FormatDateArgs): string => {\n const theDate = new TZDate(new Date(date))\n\n if (timezone) {\n const DateWithOriginalTz = TZDate.tz(timezone)\n\n const modifiedDate = theDate.withTimeZone(timezone)\n\n // Transpose the date to the selected timezone\n const dateWithTimezone = transpose(modifiedDate, DateWithOriginalTz)\n\n // Transpose the date to the user's timezone - this is necessary because the react-datepicker component insists on displaying the date in the user's timezone\n return i18n.dateFNS\n ? format(dateWithTimezone, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n }\n\n return i18n.dateFNS\n ? format(theDate, pattern, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n\ntype FormatTimeToNowArgs = {\n date: Date | number | string | undefined\n i18n: I18n<unknown, unknown> | I18nClient<unknown>\n}\n\nexport const formatTimeToNow = ({ date, i18n }: FormatTimeToNowArgs): string => {\n const theDate = new Date(date)\n return i18n?.dateFNS\n ? formatDistanceToNow(theDate, { locale: i18n.dateFNS })\n : `${i18n.t('general:loading')}...`\n}\n", "import type { I18n } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientGlobalConfig,\n SanitizedConfig,\n TypeWithID,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { formatDate } from './formatDateTitle.js'\nimport { formatLexicalDocTitle, isSerializedLexicalEditor } from './formatLexicalDocTitle.js'\n\nexport const formatDocTitle = ({\n collectionConfig,\n data,\n dateFormat: dateFormatFromConfig,\n fallback,\n globalConfig,\n i18n,\n}: {\n collectionConfig?: ClientCollectionConfig\n data: TypeWithID\n dateFormat: SanitizedConfig['admin']['dateFormat']\n fallback?: object | string\n globalConfig?: ClientGlobalConfig\n i18n: I18n<any, any>\n}): string => {\n let title: string\n\n if (collectionConfig) {\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n\n if (useAsTitle) {\n title = data?.[useAsTitle] || title\n\n if (title) {\n const fieldConfig = collectionConfig.fields.find(\n (f) => 'name' in f && f.name === useAsTitle,\n )\n\n const isDate = fieldConfig?.type === 'date'\n\n if (isDate) {\n const dateFormat =\n ('date' in fieldConfig.admin && fieldConfig?.admin?.date?.displayFormat) ||\n dateFormatFromConfig\n\n title = formatDate({ date: title, i18n, pattern: dateFormat }) || title\n }\n }\n }\n }\n\n if (globalConfig) {\n title = getTranslation(globalConfig?.label, i18n) || globalConfig?.slug\n }\n\n // richtext lexical case. We convert the first child of root to plain text\n if (isSerializedLexicalEditor(title)) {\n title = formatLexicalDocTitle(title.root.children?.[0]?.children || [], '')\n }\n\n if (!title && isSerializedLexicalEditor(fallback)) {\n title = formatLexicalDocTitle(fallback.root.children?.[0]?.children || [], '')\n }\n\n if (!title) {\n title = typeof fallback === 'string' ? fallback : `[${i18n.t('general:untitled')}]`\n }\n\n return title\n}\n", "type SerializedLexicalEditor = {\n root: {\n children: Array<{ children?: Array<{ type: string }>; type: string }>\n }\n}\n\nexport function isSerializedLexicalEditor(value: unknown): value is SerializedLexicalEditor {\n return typeof value === 'object' && 'root' in value\n}\n\nexport function formatLexicalDocTitle(\n editorState: Array<{ children?: Array<{ type: string }>; type: string }>,\n textContent: string,\n): string {\n for (const node of editorState) {\n if ('text' in node && node.text) {\n textContent += node.text as string\n } else {\n if (!('children' in node)) {\n textContent += `[${node.type}]`\n }\n }\n if ('children' in node && node.children) {\n textContent += formatLexicalDocTitle(node.children as Array<{ type: string }>, textContent)\n }\n }\n return textContent\n}\n", "import type { I18nClient } from '@payloadcms/translations'\nimport type {\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n SanitizedPermissions,\n StaticLabel,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nexport enum EntityType {\n collection = 'collections',\n global = 'globals',\n}\n\nexport type EntityToGroup =\n | {\n entity: SanitizedCollectionConfig\n type: EntityType.collection\n }\n | {\n entity: SanitizedGlobalConfig\n type: EntityType.global\n }\n\nexport type NavGroupType = {\n entities: {\n label: StaticLabel\n slug: string\n type: EntityType\n }[]\n label: string\n}\n\nexport function groupNavItems(\n entities: EntityToGroup[],\n permissions: SanitizedPermissions,\n i18n: I18nClient,\n): NavGroupType[] {\n const result = entities.reduce(\n (groups, entityToGroup) => {\n // Skip entities where admin.group is explicitly false\n if (entityToGroup.entity?.admin?.group === false) {\n return groups\n }\n\n if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read) {\n const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n)\n\n const labelOrFunction =\n 'labels' in entityToGroup.entity\n ? entityToGroup.entity.labels.plural\n : entityToGroup.entity.label\n\n const label =\n typeof labelOrFunction === 'function'\n ? labelOrFunction({ i18n, t: i18n.t })\n : labelOrFunction\n\n if (entityToGroup.entity.admin.group) {\n const existingGroup = groups.find(\n (group) => getTranslation(group.label, i18n) === translatedGroup,\n ) as NavGroupType\n\n let matchedGroup: NavGroupType = existingGroup\n\n if (!existingGroup) {\n matchedGroup = { entities: [], label: translatedGroup }\n groups.push(matchedGroup)\n }\n\n matchedGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n } else {\n const defaultGroup = groups.find((group) => {\n return getTranslation(group.label, i18n) === i18n.t(`general:${entityToGroup.type}`)\n }) as NavGroupType\n defaultGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n }\n }\n\n return groups\n },\n [\n {\n entities: [],\n label: i18n.t('general:collections'),\n },\n {\n entities: [],\n label: i18n.t('general:globals'),\n },\n ],\n )\n\n return result.filter((group) => group.entities.length > 0)\n}\n", "import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype BackToDashboardProps = {\n adminRoute: string\n router: AppRouterInstance\n}\n\nexport const handleBackToDashboard = ({ adminRoute, router }: BackToDashboardProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: '/',\n })\n router.push(redirectRoute)\n}\n", "import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype GoBackProps = {\n adminRoute: string\n collectionSlug: string\n router: AppRouterInstance\n}\n\nexport const handleGoBack = ({ adminRoute, collectionSlug, router }: GoBackProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: collectionSlug ? `/collections/${collectionSlug}` : '/',\n })\n router.push(redirectRoute)\n}\n", "import type { ClientUser } from 'payload'\n\nexport const handleTakeOver = (\n id: number | string,\n collectionSlug: string,\n globalSlug: string,\n user: ClientUser | number | string,\n isWithinDoc: boolean,\n updateDocumentEditor: (\n docID: number | string,\n slug: string,\n user: ClientUser | number | string,\n ) => Promise<void>,\n setCurrentEditor: (value: React.SetStateAction<ClientUser | number | string>) => void,\n documentLockStateRef: React.RefObject<{\n hasShownLockedModal: boolean\n isLocked: boolean\n user: ClientUser | number | string\n }>,\n isLockingEnabled: boolean,\n setIsReadOnlyForIncomingUser?: (value: React.SetStateAction<boolean>) => void,\n): void => {\n if (!isLockingEnabled) {\n return\n }\n\n try {\n // Call updateDocumentEditor to update the document's owner to the current user\n void updateDocumentEditor(id, collectionSlug ?? globalSlug, user)\n\n if (!isWithinDoc) {\n documentLockStateRef.current.hasShownLockedModal = true\n }\n\n // Update the locked state to reflect the current user as the owner\n documentLockStateRef.current = {\n hasShownLockedModal: documentLockStateRef.current?.hasShownLockedModal,\n isLocked: true,\n user,\n }\n setCurrentEditor(user)\n\n // If this is a takeover within the document, ensure the document is editable\n if (isWithinDoc && setIsReadOnlyForIncomingUser) {\n setIsReadOnlyForIncomingUser(false)\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error during document takeover:', error)\n }\n}\n", "import type {\n SanitizedCollectionPermission,\n SanitizedDocumentPermissions,\n SanitizedGlobalPermission,\n} from 'payload'\n\nexport const hasSavePermission = (args: {\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n collectionSlug?: string\n docPermissions: SanitizedDocumentPermissions\n /*\n * Pass either `collectionSlug` or `globalSlug`\n */\n globalSlug?: string\n isEditing: boolean\n}) => {\n const { collectionSlug, docPermissions, globalSlug, isEditing } = args\n\n if (collectionSlug) {\n return Boolean(\n (isEditing && docPermissions?.update) ||\n (!isEditing && (docPermissions as SanitizedCollectionPermission)?.create),\n )\n }\n\n if (globalSlug) {\n return Boolean((docPermissions as SanitizedGlobalPermission)?.update)\n }\n\n return false\n}\n", "import type { ClientUser } from 'payload'\n\nexport const isClientUserObject = (user): user is ClientUser => {\n return user && typeof user === 'object'\n}\n", "export const isEditing = ({\n id,\n collectionSlug,\n globalSlug,\n}: {\n collectionSlug?: string\n globalSlug?: string\n id?: number | string\n}): boolean => Boolean(globalSlug || (collectionSlug && !!id))\n", "export function sanitizeID(id: number | string): number | string {\n if (id === undefined) {\n return id\n }\n\n if (typeof id === 'number') {\n return id\n }\n\n return decodeURIComponent(id)\n}\n", "export { Translation } from '../../elements/Translation/index.js'\nexport { withMergedProps } from '../../elements/withMergedProps/index.js' // cannot be within a 'use client', thus we export this from shared\nexport { WithServerSideProps } from '../../elements/WithServerSideProps/index.js'\nexport { mergeFieldStyles } from '../../fields/mergeFieldStyles.js'\nexport { reduceToSerializableFields } from '../../forms/Form/reduceToSerializableFields.js'\nexport { PayloadIcon } from '../../graphics/Icon/index.js'\nexport { PayloadLogo } from '../../graphics/Logo/index.js'\n// IMPORTANT: the shared.ts file CANNOT contain any Server Components _that import client components_.\nexport { filterFields } from '../../providers/TableColumns/buildColumnState/filterFields.js'\nexport { getInitialColumns } from '../../providers/TableColumns/getInitialColumns.js'\nexport { abortAndIgnore, handleAbortRef } from '../../utilities/abortAndIgnore.js'\nexport { requests } from '../../utilities/api.js'\nexport { findLocaleFromCode } from '../../utilities/findLocaleFromCode.js'\nexport { formatAdminURL } from '../../utilities/formatAdminURL.js'\nexport { formatDate } from '../../utilities/formatDocTitle/formatDateTitle.js'\nexport { formatDocTitle } from '../../utilities/formatDocTitle/index.js'\nexport {\n type EntityToGroup,\n EntityType,\n groupNavItems,\n type NavGroupType,\n} from '../../utilities/groupNavItems.js'\nexport { handleBackToDashboard } from '../../utilities/handleBackToDashboard.js'\nexport { handleGoBack } from '../../utilities/handleGoBack.js'\nexport { handleTakeOver } from '../../utilities/handleTakeOver.js'\nexport { hasSavePermission } from '../../utilities/hasSavePermission.js'\nexport { isClientUserObject } from '../../utilities/isClientUserObject.js'\nexport { isEditing } from '../../utilities/isEditing.js'\nexport { sanitizeID } from '../../utilities/sanitizeID.js'\n/**\n * @deprecated\n * The `mergeListSearchAndWhere` function is deprecated.\n * Import this from `payload/shared` instead.\n */\nexport { mergeListSearchAndWhere } from 'payload/shared'\n"],
5
5
  "mappings": "AAEA,UAAYA,MAAW,QAEvB,IAAMC,EAGD,CAAC,CAAE,SAAAC,EAAU,kBAAAC,CAAkB,IAAM,CACxC,IAAMC,EAAQ,yBACRC,EAAWF,EAAkB,MAAMC,CAAK,EAE9C,OACE,gBAAC,YACEC,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AA+B",
6
6
  "names": ["React", "RecursiveTranslation", "elements", "translationString", "regex", "sections", "section", "index", "elementKey", "Element", "children", "_", "group", "Translation", "i18nKey", "t", "variables", "stringWithVariables", "isReactServerComponentOrFunction", "serverProps", "React", "withMergedProps", "Component", "sanitizeServerOnlyProps", "toMergeIntoProps", "passedProps", "mergedProps", "simpleMergeProps", "prop", "props", "toMerge", "isReactServerComponentOrFunction", "React", "WithServerSideProps", "Component", "serverOnlyProps", "rest", "passedProps", "propsWithServerOnlyProps", "mergeFieldStyles", "field", "blacklistedKeys", "sanitizeField", "incomingField", "field", "key", "reduceToSerializableFields", "fields", "result", "React", "PayloadIcon", "fillFromProps", "fill", "React", "css", "PayloadLogo", "fieldIsHiddenOrDisabled", "fieldIsID", "filterFields", "incomingFields", "shouldSkipField", "field", "acc", "formattedField", "tab", "tabField", "fieldAffectsData", "getRemainingColumns", "fields", "useAsTitle", "remaining", "field", "tabFieldColumns", "tab", "getInitialColumns", "defaultColumns", "initialColumns", "remainingColumns", "column", "abortAndIgnore", "abortController", "handleAbortRef", "abortControllerRef", "newController", "qs", "requests", "url", "options", "headers", "formattedOptions", "query", "findLocaleFromCode", "localizationConfig", "locale", "el", "formatAdminURL", "offsetFormatCache", "offsetCache", "tzOffset", "timeZone", "date", "offsetStr", "calcOffset", "captures", "offsetRe", "cacheStr", "values", "hours", "minutes", "TZDateMini", "_TZDateMini", "args", "tzOffset", "adjustToSystemTZ", "syncToInternal", "tz", "timeZone", "time", "date", "re", "method", "utcMethod", "syncFromInternal", "offset", "prevHour", "systemOffset", "prevHourSystemOffset", "systemDSTChange", "dstShift", "offsetDiff", "postOffset", "postOffsetDiff", "offsetChanged", "postDiff", "newOffset", "offsetChange", "format", "formatDistanceToNow", "transpose", "formatDate", "date", "i18n", "pattern", "timezone", "theDate", "TZDateMini", "DateWithOriginalTz", "modifiedDate", "dateWithTimezone", "getTranslation", "isSerializedLexicalEditor", "value", "formatLexicalDocTitle", "editorState", "textContent", "node", "formatDocTitle", "collectionConfig", "data", "dateFormatFromConfig", "fallback", "globalConfig", "i18n", "title", "useAsTitle", "fieldConfig", "f", "dateFormat", "formatDate", "getTranslation", "isSerializedLexicalEditor", "formatLexicalDocTitle", "getTranslation", "EntityType", "groupNavItems", "entities", "permissions", "i18n", "groups", "entityToGroup", "translatedGroup", "labelOrFunction", "label", "existingGroup", "group", "matchedGroup", "formatAdminURL", "handleBackToDashboard", "adminRoute", "router", "redirectRoute", "formatAdminURL", "handleGoBack", "adminRoute", "collectionSlug", "router", "redirectRoute", "handleTakeOver", "id", "collectionSlug", "globalSlug", "user", "isWithinDoc", "updateDocumentEditor", "setCurrentEditor", "documentLockStateRef", "isLockingEnabled", "setIsReadOnlyForIncomingUser", "error", "hasSavePermission", "args", "collectionSlug", "docPermissions", "globalSlug", "isEditing", "isClientUserObject", "user", "isEditing", "id", "collectionSlug", "globalSlug", "sanitizeID", "id", "mergeListSearchAndWhere"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Number/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAaxE,OAAO,cAAc,CAAA;AAgMrB,eAAO,MAAM,WAAW;;;;;;+EAAsC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Number/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAaxE,OAAO,cAAc,CAAA;AAkMrB,eAAO,MAAM,WAAW;;;;;;+EAAsC,CAAA"}
@@ -22,7 +22,7 @@ const NumberFieldComponent = props => {
22
22
  admin: {
23
23
  className,
24
24
  description,
25
- placeholder,
25
+ placeholder: placeholderFromProps,
26
26
  step = 1
27
27
  } = {},
28
28
  hasMany = false,
@@ -111,6 +111,7 @@ const NumberFieldComponent = props => {
111
111
  }
112
112
  }, [value_0, hasMany]);
113
113
  const styles = useMemo(() => mergeFieldStyles(field), [field]);
114
+ const placeholder = getTranslation(placeholderFromProps, i18n);
114
115
  return /*#__PURE__*/_jsxs("div", {
115
116
  className: [fieldBaseClass, 'number', className, showError && 'error', (readOnly || disabled) && 'read-only', hasMany && 'has-many'].filter(Boolean).join(' '),
116
117
  style: styles,
@@ -154,7 +155,7 @@ const NumberFieldComponent = props => {
154
155
  // numberOnly
155
156
  onChange: handleHasManyChange,
156
157
  options: [],
157
- placeholder: t('general:enterAValue'),
158
+ placeholder: placeholder,
158
159
  showError: showError,
159
160
  value: valueToRender
160
161
  }) : /*#__PURE__*/_jsx("div", {
@@ -169,7 +170,7 @@ const NumberFieldComponent = props => {
169
170
  // @ts-expect-error
170
171
  e_0.target.blur();
171
172
  },
172
- placeholder: getTranslation(placeholder, i18n),
173
+ placeholder: placeholder,
173
174
  step: step,
174
175
  type: "number",
175
176
  value: typeof value_0 === 'number' ? value_0 : ''
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getTranslation","isNumber","React","useCallback","useEffect","useMemo","useState","ReactSelect","RenderCustomComponent","useField","withCondition","useTranslation","FieldDescription","FieldError","FieldLabel","mergeFieldStyles","fieldBaseClass","NumberFieldComponent","props","field","admin","className","description","placeholder","step","hasMany","label","localized","max","Infinity","maxRows","min","required","onChange","onChangeFromProps","path","pathFromProps","readOnly","validate","i18n","t","memoizedValidate","value","options","customComponents","AfterInput","BeforeInput","Description","Error","Label","disabled","setValue","showError","potentiallyStalePath","handleChange","e","val","parseFloat","target","newVal","Number","isNaN","valueToRender","setValueToRender","handleHasManyChange","selectedOption","newValue","Array","isArray","map","option","index","id","toString","styles","_jsxs","filter","Boolean","join","style","_jsx","CustomComponent","Fallback","replace","filterOption","_","rawInput","isOverHasMany","length","isClearable","isCreatable","isMulti","isSortable","noOptionsMessage","name","onWheel","blur","type","NumberField"],"sources":["../../../src/fields/Number/index.tsx"],"sourcesContent":["'use client'\nimport type { NumberFieldClientComponent, NumberFieldClientProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { isNumber } from 'payload/shared'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport type { Option } from '../../elements/ReactSelect/types.js'\n\nimport { ReactSelect } from '../../elements/ReactSelect/index.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { mergeFieldStyles } from '../mergeFieldStyles.js'\nimport './index.scss'\nimport { fieldBaseClass } from '../shared/index.js'\n\nconst NumberFieldComponent: NumberFieldClientComponent = (props) => {\n const {\n field,\n field: {\n admin: {\n className,\n description,\n placeholder,\n step = 1,\n } = {} as NumberFieldClientProps['field']['admin'],\n hasMany = false,\n label,\n localized,\n max = Infinity,\n maxRows = Infinity,\n min = -Infinity,\n required,\n },\n onChange: onChangeFromProps,\n path: pathFromProps,\n readOnly,\n validate,\n } = props\n\n const { i18n, t } = useTranslation()\n\n const memoizedValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, max, min, required })\n }\n },\n [validate, min, max, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n disabled,\n path,\n setValue,\n showError,\n value,\n } = useField<number | number[]>({\n potentiallyStalePath: pathFromProps,\n validate: memoizedValidate,\n })\n\n const handleChange = useCallback(\n (e) => {\n const val = parseFloat(e.target.value)\n let newVal = val\n\n if (Number.isNaN(val)) {\n newVal = null\n }\n\n if (typeof onChangeFromProps === 'function') {\n onChangeFromProps(newVal)\n }\n\n setValue(newVal)\n },\n [onChangeFromProps, setValue],\n )\n\n const [valueToRender, setValueToRender] = useState<\n { id: string; label: string; value: { value: number } }[]\n >([]) // Only for hasMany\n\n const handleHasManyChange = useCallback(\n (selectedOption) => {\n if (!(readOnly || disabled)) {\n let newValue\n if (!selectedOption) {\n newValue = []\n } else if (Array.isArray(selectedOption)) {\n newValue = selectedOption.map((option) => Number(option.value?.value || option.value))\n } else {\n newValue = [Number(selectedOption.value?.value || selectedOption.value)]\n }\n\n setValue(newValue)\n }\n },\n [readOnly, disabled, setValue],\n )\n\n // useEffect update valueToRender:\n useEffect(() => {\n if (hasMany && Array.isArray(value)) {\n setValueToRender(\n value.map((val, index) => {\n return {\n id: `${val}${index}`, // append index to avoid duplicate keys but allow duplicate numbers\n label: `${val}`,\n value: {\n toString: () => `${val}${index}`,\n value: (val as unknown as Record<string, number>)?.value || val,\n }, // You're probably wondering, why the hell is this done that way? Well, React-select automatically uses \"label-value\" as a key, so we will get that react duplicate key warning if we just pass in the value as multiple values can be the same. So we need to append the index to the toString() of the value to avoid that warning, as it uses that as the key.\n }\n }),\n )\n }\n }, [value, hasMany])\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n return (\n <div\n className={[\n fieldBaseClass,\n 'number',\n className,\n showError && 'error',\n (readOnly || disabled) && 'read-only',\n hasMany && 'has-many',\n ]\n .filter(Boolean)\n .join(' ')}\n style={styles}\n >\n <RenderCustomComponent\n CustomComponent={Label}\n Fallback={\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n }\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n {BeforeInput}\n {hasMany ? (\n <ReactSelect\n className={`field-${path.replace(/\\./g, '__')}`}\n disabled={readOnly || disabled}\n filterOption={(_, rawInput) => {\n const isOverHasMany = Array.isArray(value) && value.length >= maxRows\n return isNumber(rawInput) && !isOverHasMany\n }}\n isClearable\n isCreatable\n isMulti\n isSortable\n noOptionsMessage={() => {\n const isOverHasMany = Array.isArray(value) && value.length >= maxRows\n if (isOverHasMany) {\n return t('validation:limitReached', { max: maxRows, value: value.length + 1 })\n }\n return null\n }}\n // numberOnly\n onChange={handleHasManyChange}\n options={[]}\n placeholder={t('general:enterAValue')}\n showError={showError}\n value={valueToRender as Option[]}\n />\n ) : (\n <div>\n <input\n disabled={readOnly || disabled}\n id={`field-${path.replace(/\\./g, '__')}`}\n max={max}\n min={min}\n name={path}\n onChange={handleChange}\n onWheel={(e) => {\n // @ts-expect-error\n e.target.blur()\n }}\n placeholder={getTranslation(placeholder, i18n)}\n step={step}\n type=\"number\"\n value={typeof value === 'number' ? value : ''}\n />\n </div>\n )}\n {AfterInput}\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nexport const NumberField = withCondition(NumberFieldComponent)\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,SAASC,QAAQ,QAAQ;AACzB,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AAIjE,SAASC,WAAW,QAAQ;AAC5B,SAASC,qBAAqB,QAAQ;AACtC,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ;AACjC,OAAO;AACP,SAASC,cAAc,QAAQ;AAE/B,MAAMC,oBAAA,GAAoDC,KAAA;EACxD,MAAM;IACJC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QACLC,SAAS;QACTC,WAAW;QACXC,WAAW;QACXC,IAAA,GAAO;MAAC,CACT,GAAG,CAAC,CAA6C;MAClDC,OAAA,GAAU,KAAK;MACfC,KAAK;MACLC,SAAS;MACTC,GAAA,GAAMC,QAAQ;MACdC,OAAA,GAAUD,QAAQ;MAClBE,GAAA,GAAM,CAACF,QAAQ;MACfG;IAAQ,CACT;IACDC,QAAA,EAAUC,iBAAiB;IAC3BC,IAAA,EAAMC,aAAa;IACnBC,QA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A,EAAaiB,CAAA,CAAE;QACfY,SAAA,EAAWA,SAAA;QACXV,KAAA,EAAOoB;wBAGTkB,IAAA,CAAC;kBACC,aAAAA,IAAA,CAAC;UACC9B,QAAA,EAAUb,QAAA,IAAYa,QAAA;UACtBsB,EAAA,EAAI,SAASrC,IAAA,CAAKgD,OAAO,CAAC,OAAO,OAAO;UACxCvD,GAAA,EAAKA,GAAA;UACLG,GAAA,EAAKA,GAAA;UACL+D,IAAA,EAAM3D,IAAA;UACNF,QAAA,EAAUqB,YAAA;UACVyC,OAAA,EAAUxC,GAAA;YACR;YACAA,GAAA,CAAEG,MAAM,CAACsC,IAAI;UACf;UACAzE,WAAA,EAAavB,cAAA,CAAeuB,WAAA,EAAagB,IAAA;UACzCf,IAAA,EAAMA,IAAA;UACNyE,IAAA,EAAK;UACLvD,KAAA,EAAO,OAAOA,OAAA,KAAU,WAAWA,OAAA,GAAQ;;UAIhDG,UAAA,E,aACDmC,IAAA,CAACxE,qBAAA;QACCyE,eAAA,EAAiBlC,WAAA;QACjBmC,QAAA,eAAUF,IAAA,CAACpE,gBAAA;UAAiBU,WAAA,EAAaA,WAAA;UAAaa,IAAA,EAAMA;;;;;AAKtE;AAEA,OAAO,MAAM+D,WAAA,GAAcxF,aAAA,CAAcO,oBAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["getTranslation","isNumber","React","useCallback","useEffect","useMemo","useState","ReactSelect","RenderCustomComponent","useField","withCondition","useTranslation","FieldDescription","FieldError","FieldLabel","mergeFieldStyles","fieldBaseClass","NumberFieldComponent","props","field","admin","className","description","placeholder","placeholderFromProps","step","hasMany","label","localized","max","Infinity","maxRows","min","required","onChange","onChangeFromProps","path","pathFromProps","readOnly","validate","i18n","t","memoizedValidate","value","options","customComponents","AfterInput","BeforeInput","Description","Error","Label","disabled","setValue","showError","potentiallyStalePath","handleChange","e","val","parseFloat","target","newVal","Number","isNaN","valueToRender","setValueToRender","handleHasManyChange","selectedOption","newValue","Array","isArray","map","option","index","id","toString","styles","_jsxs","filter","Boolean","join","style","_jsx","CustomComponent","Fallback","replace","filterOption","_","rawInput","isOverHasMany","length","isClearable","isCreatable","isMulti","isSortable","noOptionsMessage","name","onWheel","blur","type","NumberField"],"sources":["../../../src/fields/Number/index.tsx"],"sourcesContent":["'use client'\nimport type { NumberFieldClientComponent, NumberFieldClientProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { isNumber } from 'payload/shared'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport type { Option } from '../../elements/ReactSelect/types.js'\n\nimport { ReactSelect } from '../../elements/ReactSelect/index.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { useField } from '../../forms/useField/index.js'\nimport { withCondition } from '../../forms/withCondition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { FieldDescription } from '../FieldDescription/index.js'\nimport { FieldError } from '../FieldError/index.js'\nimport { FieldLabel } from '../FieldLabel/index.js'\nimport { mergeFieldStyles } from '../mergeFieldStyles.js'\nimport './index.scss'\nimport { fieldBaseClass } from '../shared/index.js'\n\nconst NumberFieldComponent: NumberFieldClientComponent = (props) => {\n const {\n field,\n field: {\n admin: {\n className,\n description,\n placeholder: placeholderFromProps,\n step = 1,\n } = {} as NumberFieldClientProps['field']['admin'],\n hasMany = false,\n label,\n localized,\n max = Infinity,\n maxRows = Infinity,\n min = -Infinity,\n required,\n },\n onChange: onChangeFromProps,\n path: pathFromProps,\n readOnly,\n validate,\n } = props\n\n const { i18n, t } = useTranslation()\n\n const memoizedValidate = useCallback(\n (value, options) => {\n if (typeof validate === 'function') {\n return validate(value, { ...options, max, min, required })\n }\n },\n [validate, min, max, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n disabled,\n path,\n setValue,\n showError,\n value,\n } = useField<number | number[]>({\n potentiallyStalePath: pathFromProps,\n validate: memoizedValidate,\n })\n\n const handleChange = useCallback(\n (e) => {\n const val = parseFloat(e.target.value)\n let newVal = val\n\n if (Number.isNaN(val)) {\n newVal = null\n }\n\n if (typeof onChangeFromProps === 'function') {\n onChangeFromProps(newVal)\n }\n\n setValue(newVal)\n },\n [onChangeFromProps, setValue],\n )\n\n const [valueToRender, setValueToRender] = useState<\n { id: string; label: string; value: { value: number } }[]\n >([]) // Only for hasMany\n\n const handleHasManyChange = useCallback(\n (selectedOption) => {\n if (!(readOnly || disabled)) {\n let newValue\n if (!selectedOption) {\n newValue = []\n } else if (Array.isArray(selectedOption)) {\n newValue = selectedOption.map((option) => Number(option.value?.value || option.value))\n } else {\n newValue = [Number(selectedOption.value?.value || selectedOption.value)]\n }\n\n setValue(newValue)\n }\n },\n [readOnly, disabled, setValue],\n )\n\n // useEffect update valueToRender:\n useEffect(() => {\n if (hasMany && Array.isArray(value)) {\n setValueToRender(\n value.map((val, index) => {\n return {\n id: `${val}${index}`, // append index to avoid duplicate keys but allow duplicate numbers\n label: `${val}`,\n value: {\n toString: () => `${val}${index}`,\n value: (val as unknown as Record<string, number>)?.value || val,\n }, // You're probably wondering, why the hell is this done that way? Well, React-select automatically uses \"label-value\" as a key, so we will get that react duplicate key warning if we just pass in the value as multiple values can be the same. So we need to append the index to the toString() of the value to avoid that warning, as it uses that as the key.\n }\n }),\n )\n }\n }, [value, hasMany])\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n const placeholder = getTranslation(placeholderFromProps, i18n)\n\n return (\n <div\n className={[\n fieldBaseClass,\n 'number',\n className,\n showError && 'error',\n (readOnly || disabled) && 'read-only',\n hasMany && 'has-many',\n ]\n .filter(Boolean)\n .join(' ')}\n style={styles}\n >\n <RenderCustomComponent\n CustomComponent={Label}\n Fallback={\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n }\n />\n <div className={`${fieldBaseClass}__wrap`}>\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n {BeforeInput}\n {hasMany ? (\n <ReactSelect\n className={`field-${path.replace(/\\./g, '__')}`}\n disabled={readOnly || disabled}\n filterOption={(_, rawInput) => {\n const isOverHasMany = Array.isArray(value) && value.length >= maxRows\n return isNumber(rawInput) && !isOverHasMany\n }}\n isClearable\n isCreatable\n isMulti\n isSortable\n noOptionsMessage={() => {\n const isOverHasMany = Array.isArray(value) && value.length >= maxRows\n if (isOverHasMany) {\n return t('validation:limitReached', { max: maxRows, value: value.length + 1 })\n }\n return null\n }}\n // numberOnly\n onChange={handleHasManyChange}\n options={[]}\n placeholder={placeholder}\n showError={showError}\n value={valueToRender as Option[]}\n />\n ) : (\n <div>\n <input\n disabled={readOnly || disabled}\n id={`field-${path.replace(/\\./g, '__')}`}\n max={max}\n min={min}\n name={path}\n onChange={handleChange}\n onWheel={(e) => {\n // @ts-expect-error\n e.target.blur()\n }}\n placeholder={placeholder}\n step={step}\n type=\"number\"\n value={typeof value === 'number' ? value : ''}\n />\n </div>\n )}\n {AfterInput}\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nexport const NumberField = withCondition(NumberFieldComponent)\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,SAASC,QAAQ,QAAQ;AACzB,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AAIjE,SAASC,WAAW,QAAQ;AAC5B,SAASC,qBAAqB,QAAQ;AACtC,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ;AACjC,OAAO;AACP,SAASC,cAAc,QAAQ;AAE/B,MAAMC,oBAAA,GAAoDC,KAAA;EACxD,MAAM;IACJC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QACLC,SAAS;QAC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AAU;QACVC,gBAAA,EAAkBA,CAAA;UAChB,MAAMN,eAAA,GAAgBpB,KAAA,CAAMC,OAAO,CAAC1B,OAAA,KAAUA,OAAA,CAAM8C,MAAM,IAAI1D,OAAA;UAC9D,IAAIyD,eAAA,EAAe;YACjB,OAAO/C,CAAA,CAAE,2BAA2B;cAAEZ,GAAA,EAAKE,OAAA;cAASY,KAAA,EAAOA,OAAA,CAAM8C,MAAM,GAAG;YAAE;UAC9E;UACA,OAAO;QACT;QACA;QACAvD,QAAA,EAAU+B,mBAAA;QACVrB,OAAA,EAAS,EAAE;QACXrB,WAAA,EAAaA,WAAA;QACb8B,SAAA,EAAWA,SAAA;QACXV,KAAA,EAAOoB;wBAGTkB,IAAA,CAAC;kBACC,aAAAA,IAAA,CAAC;UACC9B,QAAA,EAAUb,QAAA,IAAYa,QAAA;UACtBsB,EAAA,EAAI,SAASrC,IAAA,CAAKgD,OAAO,CAAC,OAAO,OAAO;UACxCvD,GAAA,EAAKA,GAAA;UACLG,GAAA,EAAKA,GAAA;UACL+D,IAAA,EAAM3D,IAAA;UACNF,QAAA,EAAUqB,YAAA;UACVyC,OAAA,EAAUxC,GAAA;YACR;YACAA,GAAA,CAAEG,MAAM,CAACsC,IAAI;UACf;UACA1E,WAAA,EAAaA,WAAA;UACbE,IAAA,EAAMA,IAAA;UACNyE,IAAA,EAAK;UACLvD,KAAA,EAAO,OAAOA,OAAA,KAAU,WAAWA,OAAA,GAAQ;;UAIhDG,UAAA,E,aACDmC,IAAA,CAACzE,qBAAA;QACC0E,eAAA,EAAiBlC,WAAA;QACjBmC,QAAA,eAAUF,IAAA,CAACrE,gBAAA;UAAiBU,WAAA,EAAaA,WAAA;UAAac,IAAA,EAAMA;;;;;AAKtE;AAEA,OAAO,MAAM+D,WAAA,GAAczF,aAAA,CAAcO,oBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/fields/Text/Input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAShD,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAwJ9C,CAAA"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/fields/Text/Input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAShD,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4J9C,CAAA"}
@@ -13,7 +13,7 @@ import { useTranslation } from '../../providers/Translation/index.js';
13
13
  import { fieldBaseClass } from '../shared/index.js';
14
14
  import './index.scss';
15
15
  export const TextInput = props => {
16
- const $ = _c(31);
16
+ const $ = _c(32);
17
17
  const {
18
18
  AfterInput,
19
19
  BeforeInput,
@@ -22,6 +22,7 @@ export const TextInput = props => {
22
22
  description,
23
23
  Error,
24
24
  hasMany,
25
+ htmlAttributes,
25
26
  inputRef,
26
27
  Label,
27
28
  label,
@@ -30,7 +31,7 @@ export const TextInput = props => {
30
31
  onChange,
31
32
  onKeyDown,
32
33
  path,
33
- placeholder,
34
+ placeholder: placeholderFromProps,
34
35
  readOnly,
35
36
  required,
36
37
  rtl,
@@ -44,25 +45,25 @@ export const TextInput = props => {
44
45
  t
45
46
  } = useTranslation();
46
47
  const editableProps = _temp2;
47
- const t0 = showError && "error";
48
- const t1 = readOnly && "read-only";
49
- const t2 = hasMany && "has-many";
50
- let t3;
51
- if ($[0] !== className || $[1] !== t0 || $[2] !== t1 || $[3] !== t2) {
52
- t3 = [fieldBaseClass, "text", className, t0, t1, t2].filter(Boolean);
53
- $[0] = className;
54
- $[1] = t0;
55
- $[2] = t1;
56
- $[3] = t2;
57
- $[4] = t3;
58
- } else {
59
- t3 = $[4];
60
- }
61
- const t4 = t3.join(" ");
62
- let t5;
63
- if ($[5] !== AfterInput || $[6] !== BeforeInput || $[7] !== Description || $[8] !== Error || $[9] !== Label || $[10] !== description || $[11] !== hasMany || $[12] !== i18n || $[13] !== inputRef || $[14] !== label || $[15] !== localized || $[16] !== maxRows || $[17] !== onChange || $[18] !== onKeyDown || $[19] !== path || $[20] !== placeholder || $[21] !== readOnly || $[22] !== required || $[23] !== rtl || $[24] !== showError || $[25] !== style || $[26] !== t || $[27] !== t4 || $[28] !== value || $[29] !== valueToRender) {
64
- t5 = _jsxs("div", {
65
- className: t4,
48
+ let t0;
49
+ if ($[0] !== AfterInput || $[1] !== BeforeInput || $[2] !== Description || $[3] !== Error || $[4] !== Label || $[5] !== className || $[6] !== description || $[7] !== hasMany || $[8] !== htmlAttributes || $[9] !== i18n || $[10] !== inputRef || $[11] !== label || $[12] !== localized || $[13] !== maxRows || $[14] !== onChange || $[15] !== onKeyDown || $[16] !== path || $[17] !== placeholderFromProps || $[18] !== readOnly || $[19] !== required || $[20] !== rtl || $[21] !== showError || $[22] !== style || $[23] !== t || $[24] !== value || $[25] !== valueToRender) {
50
+ const placeholder = getTranslation(placeholderFromProps, i18n);
51
+ const t1 = showError && "error";
52
+ const t2 = readOnly && "read-only";
53
+ const t3 = hasMany && "has-many";
54
+ let t4;
55
+ if ($[27] !== className || $[28] !== t1 || $[29] !== t2 || $[30] !== t3) {
56
+ t4 = [fieldBaseClass, "text", className, t1, t2, t3].filter(Boolean);
57
+ $[27] = className;
58
+ $[28] = t1;
59
+ $[29] = t2;
60
+ $[30] = t3;
61
+ $[31] = t4;
62
+ } else {
63
+ t4 = $[31];
64
+ }
65
+ t0 = _jsxs("div", {
66
+ className: t4.join(" "),
66
67
  style,
67
68
  children: [_jsx(RenderCustomComponent, {
68
69
  CustomComponent: Label,
@@ -107,7 +108,7 @@ export const TextInput = props => {
107
108
  },
108
109
  onChange,
109
110
  options: [],
110
- placeholder: t("general:enterAValue"),
111
+ placeholder,
111
112
  showError,
112
113
  value: valueToRender
113
114
  }) : _jsx("input", {
@@ -117,10 +118,11 @@ export const TextInput = props => {
117
118
  name: path,
118
119
  onChange,
119
120
  onKeyDown,
120
- placeholder: getTranslation(placeholder, i18n),
121
+ placeholder,
121
122
  ref: inputRef,
122
123
  type: "text",
123
- value: value || ""
124
+ value: value || "",
125
+ ...(htmlAttributes ?? {})
124
126
  }), AfterInput, _jsx(RenderCustomComponent, {
125
127
  CustomComponent: Description,
126
128
  Fallback: _jsx(FieldDescription, {
@@ -130,36 +132,37 @@ export const TextInput = props => {
130
132
  })]
131
133
  })]
132
134
  });
133
- $[5] = AfterInput;
134
- $[6] = BeforeInput;
135
- $[7] = Description;
136
- $[8] = Error;
137
- $[9] = Label;
138
- $[10] = description;
139
- $[11] = hasMany;
140
- $[12] = i18n;
141
- $[13] = inputRef;
142
- $[14] = label;
143
- $[15] = localized;
144
- $[16] = maxRows;
145
- $[17] = onChange;
146
- $[18] = onKeyDown;
147
- $[19] = path;
148
- $[20] = placeholder;
149
- $[21] = readOnly;
150
- $[22] = required;
151
- $[23] = rtl;
152
- $[24] = showError;
153
- $[25] = style;
154
- $[26] = t;
155
- $[27] = t4;
156
- $[28] = value;
157
- $[29] = valueToRender;
158
- $[30] = t5;
135
+ $[0] = AfterInput;
136
+ $[1] = BeforeInput;
137
+ $[2] = Description;
138
+ $[3] = Error;
139
+ $[4] = Label;
140
+ $[5] = className;
141
+ $[6] = description;
142
+ $[7] = hasMany;
143
+ $[8] = htmlAttributes;
144
+ $[9] = i18n;
145
+ $[10] = inputRef;
146
+ $[11] = label;
147
+ $[12] = localized;
148
+ $[13] = maxRows;
149
+ $[14] = onChange;
150
+ $[15] = onKeyDown;
151
+ $[16] = path;
152
+ $[17] = placeholderFromProps;
153
+ $[18] = readOnly;
154
+ $[19] = required;
155
+ $[20] = rtl;
156
+ $[21] = showError;
157
+ $[22] = style;
158
+ $[23] = t;
159
+ $[24] = value;
160
+ $[25] = valueToRender;
161
+ $[26] = t0;
159
162
  } else {
160
- t5 = $[30];
163
+ t0 = $[26];
161
164
  }
162
- return t5;
165
+ return t0;
163
166
  };
164
167
  function _temp(event) {
165
168
  event.currentTarget.contentEditable = "false";